{"version":3,"file":"run-DNzZBHT2.mjs","names":["NEWLINE","encoder","GraphemeCount","IsMinLength","IsMaxLength","IsArray","IsBigInt","IsEqual","IsBoolean","IsConstructor","IsUndefined","IsFunction","IsInteger","IsNull","IsNumber","IsObjectNotArray","IsObject","IsString","IsSymbol","IsGreaterThan","IsLessThan","IsLessEqualThan","IsGreaterEqualThan","IsMultipleOf","String.GraphemeCount","IsMaxLength","String.IsMaxLength","IsMinLength","String.IsMinLength","Every","Some","SomeAll","Counted","HasPropertyKey","Keys","Entries","IsDeepEqual","IsArray","IsBigInt","IsBoolean","IsInteger","IsNull","IsNumber","IsObject","IsString","IsSymbol","IsUndefined","IsFunction","IsConstructor","IsMinLength","IsMaxLength","G.IsEqual","Entries","G.IsValueLike","G.IsString","If","IsBoolean","IsNumber","IsString","IsDate","Guard","Get","Settings.Get","IsSchemaObject","Guard.HasPropertyKey","Guard.Keys","Guard.IsUnsafePropertyKey","FromValue","Guard.IsEqual","Guard.Symbols","FromObject","Guard.IsClassInstance","FromArray","FromRegExp","GlobalsGuard.IsTypeArray","GlobalsGuard.IsRegExp","GlobalsGuard.IsMap","GlobalsGuard.IsSet","Guard.IsArray","Guard.IsObject","Clone","Create","Settings.Get","Guard.Keys","Clone","Update","Settings.Get","Clone","Guard.IsObject","Guard.HasPropertyKey","Guard.IsEqual","IsSchema","Memory.Create","Memory.Update","Memory.Update","Memory.Create","Memory.Discard","Memory.Create","Memory.Discard","Memory.Create","Memory.Discard","Ref","Memory.Create","IsRef","Memory.Create","Any","Memory.Create","Memory.Create","Optional","IsSchema","Guard.HasPropertyKey","Guard.Keys","Guard.Values","Memory.Create","Memory.Discard","Memory.Create","Guard.Keys","Memory.Update","Memory.Create","Memory.Update","Guard.IsObjectNotArray","Guard.HasPropertyKey","Guard.IsNull","Match","Memory.Create","Memory.Discard","Guard.IsObjectNotArray","Guard.Keys","Memory.Create","IsEnum","Memory.Create","Memory.Discard","Guard.IsUndefined","Settings.Get","Evaluate","FromArray","FromBigInt","FromBoolean","FromConstructor","FromFunction","FromNull","FromNumber","FromObject","encoder","FromString","FromSymbol","FromUndefined","FromValue","GlobalsGuard.IsTypeArray","GlobalsGuard.IsDate","GlobalsGuard.IsRegExp","GlobalsGuard.IsBoolean","GlobalsGuard.IsString","GlobalsGuard.IsNumber","Guard.IsArray","Guard.IsBoolean","Guard.IsBigInt","Guard.IsConstructor","Guard.IsNull","Guard.IsObject","Guard.IsString","Guard.IsSymbol","Guard.IsUndefined","Guard.IsFunction","Get","IsSchema","Guard.HasPropertyKey","Guard.IsObject","IsSchema","Guard.HasPropertyKey","IsSchema","Guard.HasPropertyKey","BigInt","Memory.Create","Boolean","Memory.Create","Integer","Memory.Create","Guard.IsBigInt","Guard.IsBoolean","Guard.IsNumber","Guard.IsString","Memory.Create","Null","Memory.Create","Number","Memory.Create","Symbol","Memory.Create","String","Memory.Create","Memory.Create","Memory.Discard","Guard.IsEqual","FromLiteral","Guard.ShiftLeft","FromType","FromTypes","Guard.IsEqual","Memory.Create","Guard.ShiftLeft","FromLiteral","Guard.IsEqual","FromUnion","FromType","String","Memory.Create","Object","Memory.Create","Memory.Discard","Memory.Discard","Memory.Update","Memory.Discard","Memory.Update","Object","Guard.Keys","Object","Guard.IsEqual","Guard.ShiftLeft","Guard.IsEqual","Distribute","ExtendsResult.IsExtendsTrueLike","Guard.ShiftLeft","Guard.ShiftLeft","Distribute","IsEnum","Guard.IsEqual","Guard.IsString","Guard.IsNumber","Object","Guard.IsEqual","Guard.HasPropertyKey","Guard.IsString","Guard.ShiftLeft","Guard.IsEqual","Guard.IsString","Guard.IsNumber","Object","IsSchema","IsEnum","Object","Memory.Update","Guard.IsEqual","String","Integer","Number","Guard.Keys","Memory.Create","Memory.Create","T.BigInt","T.String","T.Number","T.Integer","T.Never","T.Literal","T.Union","IsEqual","Match","IsEqual","IsEqual","AllowedDigits","IsEqual","IsEqual","Match","Match","IsEqual","Token.Const","S.PatternBigIntMapping","S.PatternStringMapping","S.PatternNumberMapping","S.PatternIntegerMapping","S.PatternNeverMapping","Token.Until_1","S.PatternTextMapping","S.PatternBaseMapping","S.PatternGroupMapping","S.PatternUnionMapping","S.PatternTermMapping","S.PatternBodyMapping","S.PatternMapping","Guard.ShiftLeft","IsEnum","Memory.Update","IsSchema","Guard.HasPropertyKey","Guard.IsEqual","ExtendsUnion","Memory.Create","Guard.IsObject","Guard.HasPropertyKey","Guard.IsEqual","Match","Result.Match","Result.ExtendsTrue","Memory.Assign","Result.ExtendsFalse","Guard.ShiftLeft","IsEnum","Result.ExtendsTrue","Result.ExtendsUnion","Result.ExtendsFalse","Result.ExtendsTrue","Result.ExtendsTrue","Result.ExtendsFalse","Result.Match","Guard.ShiftLeft","Result.ExtendsTrue","Result.ExtendsTrue","Result.ExtendsTrue","Result.Match","Result.ExtendsFalse","Result.Match","Result.ExtendsTrue","Result.Match","Result.ExtendsFalse","Result.ExtendsTrue","Result.ExtendsTrue","Result.ExtendsFalse","Guard.IsBigInt","Guard.IsBoolean","Guard.IsNumber","Guard.IsString","Result.ExtendsTrue","Result.ExtendsTrue","Result.ExtendsTrue","Result.ExtendsTrue","Result.ExtendsFalse","Result.Match","Result.IsExtendsTrueLike","Guard.Keys","Memory.Assign","Guard.Values","Guard.HasPropertyKey","Guard.ShiftLeft","Object","FromObject","Guard.IsEqual","Guard.Keys","Result.ExtendsTrue","Result.ExtendsFalse","FromRecord","Result.ExtendsTrue","Result.ExtendsTrue","Memory.Create","Guard.IsObject","Guard.HasPropertyKey","Guard.IsEqual","Guard.IsString","Guard.ShiftLeft","Result.Match","Guard.IsArray","Result.ExtendsTrue","Memory.Assign","Result.ExtendsFalse","IsSchema","Result.Match","Result.ExtendsFalse","Guard.ShiftLeft","Guard.IsEqual","Result.ExtendsTrue","Result.ExtendsTrue","Guard.ShiftLeft","Result.Match","Result.ExtendsTrue","Result.ExtendsFalse","Result.ExtendsTrue","Result.ExtendsFalse","Result.ExtendsTrue","IsEnum","Result.ExtendsFalse","Object","Memory.Update","IsSchema","Guard.HasPropertyKey","Guard.IsEqual","FromRef","FromType","FromProperties","FromTypes","Guard.ShiftLeft","IsRef","FromRef","FromType","FromProperties","FromTypes","IsRef","FromRef","Any","FromProperties","Guard.Keys","FromType","FromTypes","IsRef","Object","Object","Guard.Keys","IsRef","ExtendsResult.IsExtendsTrueLike","ExtendsResult.IsExtendsFalse","Guard.ShiftLeft","Guard.IsEqual","Memory.Update","Guard.IsEqual","IsRef","Guard.ShiftLeft","IsEnum","FromRef","FromType","IsRef","ExtendsResult.IsExtendsTrueLike","Memory.Assign","Guard.ShiftLeft","Guard.IsLessThan","Settings.Get","Guard.IsEqual","Guard.IsGreaterThan","Ref","Memory.Create","Memory.Discard","Memory.Update","FromLiteral","Guard.IsString","FromTemplateLiteral","FromType","FromUnion","FromType","FromType","FromLiteral","FromTemplateLiteral","FromUnion","Memory.Update","FromType","ExtendsResult.IsExtendsUnion","ExtendsResult.IsExtendsTrue","Memory.Update","Memory.Update","Memory.Update","ExtendsResult.IsExtendsTrueLike","Guard.ShiftLeft","Memory.Update","FromCyclic","FromType","FromDependent","FromType","Guard.Keys","Guard.HasPropertyKey","Memory.Assign","FromIntersect","FromType","FromObject","FromTuple","FromType","Guard.Keys","Guard.ShiftLeft","FromType","FromUnion","FromType","FromCyclic","FromDependent","FromIntersect","FromUnion","FromTuple","FromObject","FromType","Object","FromArray","Number","ExtendsResult.IsExtendsTrueLike","Guard.IsEqual","FromCyclic","FromType","FromDependent","FromType","FromEnum","FromType","FromIntersect","FromType","FromLiteral","FromTemplateLiteral","FromType","FromUnion","FromType","FromType","FromCyclic","FromDependent","IsEnum","FromEnum","FromIntersect","FromLiteral","FromTemplateLiteral","FromUnion","FromType","FromTypes","FromType","FromObject","ExtendsResult.IsExtendsTrueLike","FromTuple","Guard.IsEqual","FromType","FromArray","FromObject","FromTuple","NormalizeType","Memory.Update","FromType","Memory.Update","Number","String","Symbol","FromArray","Number","FromObject","Guard.Keys","FromRecord","FromTuple","FromType","FromArray","FromObject","FromRecord","FromTuple","Memory.Update","FromType","FromTemplateLiteral","FromType","FromUnion","FromEnum","FromLiteral","Guard.IsNumber","IsEnum","Memory.Assign","Object","Memory.Update","Memory.Assign","Guard.Keys","Memory.Update","Null","Memory.Update","FromKeys","Guard.Keys","FromType","Object","Memory.Update","FromType","Memory.Update","FromCyclic","FromType","Memory.Assign","FromDependent","FromType","FromIntersect","FromType","FromUnion","FromType","FromObject","Guard.Keys","Object","FromType","FromCyclic","FromDependent","FromIntersect","FromUnion","FromObject","Object","Memory.Update","FromType","Guard.Keys","Memory.Assign","FromType","Object","Memory.Update","FromType","FromArray","Array","FromCyclic","FromType","Memory.Assign","FromDependent","FromType","FromIntersect","FromType","FromObject","Guard.Keys","Object","FromTuple","FromUnion","FromType","FromType","FromArray","FromCyclic","FromDependent","FromIntersect","FromObject","FromTuple","FromUnion","Memory.Update","FromType","FromCyclic","FromType","Memory.Assign","FromType","FromIntersect","FromType","FromUnion","FromType","FromObject","Guard.Keys","Object","FromType","FromCyclic","FromIntersect","FromUnion","FromObject","Object","Memory.Update","FromType","Memory.Update","Memory.Update","IsRef","Guard.ShiftLeft","IsRef","Guard.Keys","Guard.IsEqual","Object","Memory.Update","Guard.IsEqual","Insert","Guard.ShiftLeft","Guard.HasPropertyKey","Guard.IsArray","Guard.Every","Guard.IsObject","Guard.IsFunction","Guard.IsObject","Guard.IsArray","Guard.IsBoolean","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.IsArray","Guard.HasPropertyKey","Guard.IsString","Guard.HasPropertyKey","Guard.IsArray","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.IsObject","Guard.IsArray","Guard.IsString","Guard.HasPropertyKey","Guard.IsObject","Guard.IsArray","Guard.IsString","Guard.HasPropertyKey","Guard.IsObject","Guard.HasPropertyKey","Guard.IsString","Guard.HasPropertyKey","Guard.IsString","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.IsArray","Guard.HasPropertyKey","Guard.IsNumber","Guard.IsBigInt","Guard.HasPropertyKey","Guard.IsNumber","Guard.IsBigInt","Guard.HasPropertyKey","Guard.IsString","Guard.HasPropertyKey","Guard.IsString","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.IsArray","Guard.HasPropertyKey","Guard.IsNumber","Guard.IsBigInt","Guard.HasPropertyKey","Guard.IsNumber","Guard.HasPropertyKey","Guard.IsNumber","Guard.HasPropertyKey","Guard.IsNumber","Guard.HasPropertyKey","Guard.IsNumber","Guard.HasPropertyKey","Guard.IsNumber","Guard.IsBigInt","Guard.HasPropertyKey","Guard.IsNumber","Guard.HasPropertyKey","Guard.IsNumber","Guard.HasPropertyKey","Guard.IsNumber","Guard.HasPropertyKey","Guard.IsNumber","Guard.HasPropertyKey","Guard.IsNumber","Guard.IsBigInt","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.IsArray","Guard.HasPropertyKey","Guard.IsString","Guard.HasPropertyKey","Guard.IsObject","Guard.HasPropertyKey","Guard.IsArray","Guard.HasPropertyKey","Guard.IsObject","Guard.HasPropertyKey","Guard.IsObject","Guard.HasPropertyKey","Guard.IsBoolean","Guard.IsEqual","Guard.HasPropertyKey","Guard.IsString","Guard.HasPropertyKey","Guard.IsString","Guard.HasPropertyKey","Guard.IsArray","Guard.IsString","Guard.HasPropertyKey","Guard.HasPropertyKey","Guard.IsString","Guard.IsArray","Guard.HasPropertyKey","Guard.IsBoolean","Guard.HasPropertyKey","Guard.HasPropertyKey","Schema.IsUnevaluatedItems","Schema.IsUnevaluatedProperties","G.Some","G.Keys","G.IsArray","G.IsObject","E.Call","E.Member","Settings.Get","V.CreateVariable","E.Every","E.Constant","E.Call","E.Member","G.Every","G.EveryAll","index","IsValid","Schema.IsItems","G.IsArray","E.IsLessThan","E.Constant","E.Every","E.Or","E.And","G.Every","G.IsLessThan","G.IsEqual","G.IsObject","G.Keys","S.IsPatternProperties","S.IsProperties","S.IsRequired","E.IsEqual","E.Member","E.Call","E.Constant","V.CreateVariable","E.Or","E.And","E.Every","E.Keys","G.Every","G.EveryAll","E.ConstDeclaration","E.New","E.Call","E.ArrowFunction","E.If","E.Member","E.Return","E.And","E.Statements","E.IsEqual","E.Member","E.Constant","E.ReduceAnd","G.IsEqual","ErrorSchema","E.IsGreaterThan","E.Member","E.Constant","E.ReduceOr","G.IsGreaterThan","ErrorSchema","E.Constant","G.IsValueLike","E.IsEqual","E.Constant","E.IsDeepEqual","Externals.CreateVariable","G.IsEqual","G.IsDeepEqual","IsValid","Schema.IsMinContains","G.IsEqual","E.Not","E.IsEqual","E.Member","E.Constant","E.SomeAll","E.And","E.Some","G.SomeAll","E.IsEqual","E.Member","E.Keys","E.Constant","E.ReduceAnd","G.Entries","E.Not","E.HasPropertyKey","E.Or","G.IsArray","G.IsEqual","G.Keys","G.Every","G.HasPropertyKey","G.EveryAll","ErrorSchema","E.IsEqual","E.Member","E.Keys","E.Constant","E.ReduceAnd","G.Entries","E.Not","E.HasPropertyKey","E.Or","G.IsEqual","G.Keys","G.Every","G.HasPropertyKey","G.EveryAll","E.IsEqual","E.Member","E.Keys","E.Constant","E.ReduceAnd","G.Entries","E.Not","E.HasPropertyKey","E.Or","G.IsEqual","G.Keys","G.Every","G.HasPropertyKey","G.EveryAll","ErrorSchema","Functions.CreateFunction","Schema.IsSchema","ErrorSchema","E.ReduceOr","G.IsValueLike","E.IsEqual","E.Constant","Externals.CreateVariable","E.IsDeepEqual","G.Some","G.IsEqual","G.IsDeepEqual","E.IsLessThan","E.Constant","G.IsLessThan","E.IsGreaterThan","E.Constant","G.IsGreaterThan","DATE","TIME","Duration","Decode","Encode","FormatPuny.IsAcePrefixed","FormatPuny.Decode","FormatPuny.Encode","FormatBidi.HasRightToLeftCharacters","FormatBidi.SatisfiesBidiRule","FormatPuny.IsAcePrefixed","FormatPuny.Decode","LabelUnicode.IsUnicodeLabel","IsValidLabelLength","IsLabel","LabelPuny.IsPunyLabel","LabelAscii.IsAsciiLabel","IsHostname","LabelPuny.IsPunyLabel","LabelUnicode.IsUnicodeLabel","IsIdnHostname","FormatBidi.HasBidiChars","FormatBidi.SatisfiesBidiRule","Idna.IsHostname","Idna.IsIdnHostname","InvalidIriChars","formats","Set","Get","E.Call","E.Member","E.Constant","Format.Test","Schema.IsThen","Schema.IsElse","E.Ternary","ErrorSchema","E.ReduceAnd","E.IsLessEqualThan","E.Member","E.Constant","E.Or","E.And","G.Every","G.IsLessEqualThan","G.EveryAll","Schema.IsPrefixItems","E.Every","Schema.IsItemsSized","IsValid","Schema.IsContains","E.Constant","E.Counted","E.IsLessEqualThan","G.Counted","G.IsLessEqualThan","Schema.IsMinContains","E.IsLessEqualThan","E.Constant","G.IsLessEqualThan","E.IsLessEqualThan","E.Member","E.Constant","G.IsLessEqualThan","E.IsMaxLength","E.Constant","G.IsMaxLength","E.IsLessEqualThan","E.Member","E.Keys","E.Constant","G.IsLessEqualThan","G.Keys","IsValid","Schema.IsContains","E.Counted","E.And","E.IsGreaterEqualThan","E.Constant","G.Counted","G.IsGreaterEqualThan","E.IsGreaterEqualThan","E.Constant","G.IsGreaterEqualThan","E.IsGreaterEqualThan","E.Member","E.Constant","G.IsGreaterEqualThan","E.IsMinLength","E.Constant","G.IsMinLength","E.IsGreaterEqualThan","E.Member","E.Keys","E.Constant","G.IsGreaterEqualThan","G.Keys","E.MultipleOf","E.Constant","G.IsMultipleOf","E.Not","E.IsEqual","E.Member","E.Constant","E.IsEqual","E.Member","E.Constant","E.ArrayLiteral","E.Counted","G.IsEqual","ErrorSchema","Externals.CreateVariable","G.IsString","E.Call","E.Member","E.ReduceAnd","G.Entries","Externals.CreateVariable","E.Not","E.Call","E.Member","E.Or","E.And","E.Every","E.Entries","E.Constant","G.Every","G.EveryAll","E.ReduceAnd","E.IsLessEqualThan","E.Member","E.Constant","E.And","E.Or","G.IsEqual","G.Every","G.IsLessEqualThan","G.EveryAll","Settings.Get","E.IsUndefined","E.Member","G.IsUndefined","Schema.IsRequired","G.Entries","E.Not","E.HasPropertyKey","E.Constant","E.Member","E.And","E.Or","E.ReduceAnd","G.Every","G.HasPropertyKey","G.EveryAll","E.Every","E.Keys","E.Constant","G.Every","G.Keys","G.EveryAll","ErrorSchema","Functions.CreateFunction","Schema.IsSchema","ErrorSchema","E.ArrowFunction","Functions.CreateFunction","E.Statements","E.ConstDeclaration","E.New","E.Call","E.If","E.Return","Schema.IsSchema","ErrorSchema","E.ReduceAnd","E.HasPropertyKey","E.Constant","G.Every","G.HasPropertyKey","G.EveryAll","G.IsEqual","E.IsObjectNotArray","E.IsArray","E.IsBoolean","E.IsInteger","E.IsNumber","E.IsNull","E.IsString","E.IsBigInt","E.IsConstructor","E.IsFunction","E.IsSymbol","E.IsUndefined","E.Constant","G.IsObjectNotArray","G.IsArray","G.IsBoolean","G.IsInteger","G.IsNumber","G.IsNull","G.IsString","G.IsBigInt","G.IsConstructor","G.IsFunction","G.IsSymbol","G.IsUndefined","E.ReduceOr","G.Some","E.Call","E.Member","E.Every","E.Constant","E.And","E.Or","E.ArrowFunction","E.Statements","E.ConstDeclaration","E.Return","G.Every","G.EveryAll","ErrorSchema","E.Call","E.Member","E.Every","E.Entries","E.Constant","E.Or","E.And","E.ArrowFunction","E.Statements","E.ConstDeclaration","E.Return","G.Every","G.Entries","G.EveryAll","ErrorSchema","G.IsEqual","E.Constant","E.Member","E.New","E.Call","E.IsEqual","Hashing.Hash","Schema.IsType","G.IsArray","G.IsGreaterThan","G.Every","G.IsEqual","Schema.IsSchemaObject","Schema.IsAdditionalProperties","Schema.IsDependencies","Schema.IsDependentRequired","Schema.IsDependentSchemas","Schema.IsProperties","Schema.IsPatternProperties","Schema.IsPropertyNames","Schema.IsMinProperties","Schema.IsMaxProperties","Schema.IsRequired","Schema.IsUnevaluatedProperties","Schema.IsAdditionalItems","Schema.IsItems","Schema.IsContains","Schema.IsMaxContains","Schema.IsMaxItems","Schema.IsMinContains","Schema.IsMinItems","Schema.IsPrefixItems","Schema.IsUnevaluatedItems","Schema.IsUniqueItems","Schema.IsMinLength","Schema.IsMaxLength","Schema.IsFormat","Schema.IsPattern","Schema.IsMinimum","Schema.IsMaximum","Schema.IsExclusiveMaximum","Schema.IsExclusiveMinimum","Schema.IsMultipleOf","E.And","Schema.IsSchemaBoolean","E.ReduceAnd","E.Or","E.Not","E.IsObjectNotArray","E.IsArray","E.IsString","E.IsNumber","E.IsBigInt","Schema.IsRef","Schema.IsRecursiveRef","Schema.IsDynamicRef","Schema.IsConst","Schema.IsEnum","Schema.IsIf","Schema.IsNot","Schema.IsAllOf","Schema.IsAnyOf","Schema.IsOneOf","E.IsObject","Schema.IsRefine","G.IsObject","G.IsString","G.IsNumber","G.IsBigInt","ErrorSchema","names","E.Call","E.ConstDeclaration","E.ArrowFunction","Guard.IsObject","Guard.IsUnsafePropertyKey","Guard.IsEqual","Guard.IsObject","Schema.IsDynamicAnchor","Guard.IsEqual","Guard.Keys","Schema.IsSchemaObject","Schema.IsId","Guard.IsArray","Guard.IsUndefined","Pointer.Get","Schema.IsAnchor","FromArray","FromObject","Guard.HasPropertyKey","ResolveRef","Schema.IsRecursiveAnchorTrue","__classPrivateFieldGet","Schema.IsSchemaObject","Schema.IsId","Schema.IsAnchor","Schema.IsRecursiveAnchorTrue","Schema.IsDynamicAnchor","Resolve.ResolveRef","Resolve.ResolveRecursiveRef","Resolve.ResolveDynamicRef","Guard.IsUndefined","Resolve.DefaultBase","Schema.IsSchemaBoolean","Guard.IsArray","Guard.Keys","Guard.IsEqual","Environment.Evaluate","Engine.CheckContext","Guard","Format","Hashing","Engine.Stack","Engine.CheckSchema","Environment.CanEvaluate","Arguments.Match","Engine.BuildContext","Engine.HasUnevaluated","Engine.CreateFunction","Engine.GetFunctions","Engine.GetExternal","Errors","Arguments.Match","Engine.Stack","Engine.ErrorContext","Engine.ErrorSchema","GetLocalizationFunction","Check","Arguments.Match","Engine.Stack","Engine.CheckContext","Engine.CheckSchema","Arguments.Match","SchemaCheck","Arguments.Match","SchemaErrors","FromArray","Guard.IsArray","FromType","FromCyclic","FromType","Ref","Guard.HasPropertyKey","FromIntersect","FromType","Guard.HasPropertyKey","FromObject","Guard.IsObject","Guard.IsArray","Guard.Keys","Guard.HasPropertyKey","FromType","Guard.IsBoolean","Guard.IsEqual","IsSchema","FromRecord","Guard.IsObject","Guard.Keys","FromType","Guard.IsBoolean","Guard.IsEqual","IsSchema","FromRef","Guard.HasPropertyKey","FromType","FromTuple","Guard.IsArray","FromType","Guard.IsGreaterThan","SystemClone","FromUnion","FromType","FromType","T.IsArray","FromArray","T.IsCyclic","FromCyclic","T.IsIntersect","FromIntersect","T.IsObject","FromObject","T.IsRecord","FromRecord","T.IsRef","FromRef","T.IsTuple","FromTuple","T.IsUnion","FromUnion","Guard","FromProperties","FromType","Arguments.Match","Settings.Get","FromType","Guard.IsObject","Guard.HasPropertyKey","Guard.IsArray","FromBoolean","Guard.IsEqual","FromString","Guard.IsBigInt","Guard.IsBoolean","Guard.IsNumber","Guard.IsNull","Guard.IsString","Guard.IsUndefined","FromBigInt","Guard.IsEqual","FromNumber","FromString","Guard.IsBigInt","Guard.IsBoolean","Guard.IsNumber","Guard.IsNull","Guard.IsString","Guard.IsUndefined","FromBigInt","Guard.IsEqual","FromBoolean","FromNumber","FromString","Guard.IsBigInt","Guard.IsBoolean","Guard.IsNumber","Guard.IsNull","Guard.IsString","Guard.IsUndefined","FromBigInt","FromBoolean","FromString","Guard.IsNumber","Guard.IsEqual","Guard.IsBigInt","Guard.IsBoolean","Guard.IsNull","Guard.IsString","Guard.IsUndefined","Guard.IsBigInt","Guard.IsBoolean","Guard.IsNumber","Guard.IsNull","Guard.IsString","Guard.IsUndefined","FromBigInt","Guard.IsEqual","FromBoolean","FromNumber","FromString","Guard.IsBigInt","Guard.IsBoolean","Guard.IsNumber","Guard.IsNull","Guard.IsString","Guard.IsUndefined","FromArray","Try.TryArray","FromType","FromBigInt","Try.TryBigInt","Try.IsOk","FromBoolean","Try.TryBoolean","Try.IsOk","FromCyclic","FromType","Ref","FromEnum","FromType","FromInteger","Try.TryNumber","Try.IsOk","FromIntersect","FromType","Try.TryBigInt","Try.IsOk","Guard.IsEqual","Try.TryBoolean","Try.TryNumber","Try.TryString","FromLiteral","FromNull","Try.TryNull","Try.IsOk","FromNumber","Try.TryNumber","Try.IsOk","Guard.Keys","FromType","Guard.IsUndefined","Guard.EntriesRegExp","Guard.Keys","FromType","Guard.HasPropertyKey","Guard.IsObject","FromObject","Guard.IsObjectNotArray","Guard.EntriesRegExp","Guard.Keys","FromType","Guard.HasPropertyKey","Guard.IsObject","FromRecord","Guard.IsObjectNotArray","FromRef","Guard.HasPropertyKey","FromType","FromString","Try.TryString","Try.IsOk","FromTemplateLiteral","FromType","FromTuple","Guard.IsArray","FromType","FromUndefined","Try.TryUndefined","Try.IsOk","FromUnion","FromType","Guard.IsUndefined","FromVoid","Try.TryUndefined","Try.IsOk","FromType","Type.IsArray","FromArray","Type.IsBigInt","FromBigInt","Type.IsBoolean","FromBoolean","Type.IsCyclic","FromCyclic","Type.IsEnum","FromEnum","Type.IsInteger","FromInteger","Type.IsIntersect","FromIntersect","Type.IsLiteral","FromLiteral","Type.IsNull","FromNull","Type.IsNumber","FromNumber","Type.IsObject","FromObject","Type.IsRecord","FromRecord","Type.IsRef","FromRef","Type.IsString","FromString","Type.IsTemplateLiteral","FromTemplateLiteral","Type.IsTuple","FromTuple","Type.IsUndefined","FromUndefined","Type.IsUnion","FromUnion","Type.IsVoid","FromVoid","Convert","Arguments.Match","FromType","FromArray","Guard.IsArray","FromType","FromCyclic","FromType","Ref","FromDefault","Guard.IsUndefined","Guard.IsFunction","FromIntersect","FromType","FromObject","Guard.IsObject","Guard.Keys","FromType","Guard.IsUndefined","Guard.HasPropertyKey","Guard.IsBoolean","FromRecord","Guard.IsObject","Guard.Keys","FromType","FromRef","Guard.HasPropertyKey","FromType","FromTuple","Guard.IsArray","FromType","FromUnion","FromType","FromType","FromDefault","T.IsArray","FromArray","T.IsCyclic","FromCyclic","T.IsIntersect","FromIntersect","T.IsObject","FromObject","T.IsRecord","FromRecord","T.IsRef","FromRef","T.IsTuple","FromTuple","T.IsUnion","FromUnion","Arguments.Match","FromType","Arguments.Match","Decode","Encode","Guard.IsEqual","Decode","Guard.IsArray","FromType","Encode","FromArray","Guard.IsEqual","FromCyclic","FromType","Ref","Guard.IsDeepEqual","Decode","Guard.IsEqual","FromType","Guard.IsObject","Encode","FromIntersect","Decode","Guard.IsObjectNotArray","Guard.Keys","Guard.HasPropertyKey","FromType","Encode","FromObject","Guard.IsEqual","Decode","Guard.IsObjectNotArray","Guard.Keys","FromType","Encode","FromRecord","Guard.IsEqual","Guard.HasPropertyKey","FromType","FromRef","Guard.IsEqual","Decode","Guard.IsArray","FromType","Encode","FromTuple","Guard.IsEqual","Decode","FromType","Encode","FromUnion","Guard.IsEqual","FromType","Type.IsArray","FromArray","Type.IsCyclic","FromCyclic","Type.IsIntersect","FromIntersect","Type.IsObject","FromObject","Type.IsRecord","FromRecord","Type.IsRef","FromRef","Type.IsTuple","FromTuple","Type.IsUnion","FromUnion","Assert","Settings.Get","FromType","Convert","Arguments.Match","Assert","Settings.Get","FromType","Convert","Arguments.Match","FromArray","FromType","FromCyclic","FromRef","Ref","FromIntersect","FromObject","Guard.Keys","FromRecord","Guard.HasPropertyKey","FromTuple","FromUnion","IsRef","Arguments.Match","Guard.IsFunction","Guard.IsObject","Ref","Guard.IsNumber","Guard.IsNumber","Guard.IsUndefined","Guard.HasPropertyKey","Guard.IsEqual","S.IsDefault","T.IsArray","T.IsBigInt","T.IsBoolean","T.IsConstructor","T.IsCyclic","T.IsEnum","T.IsFunction","T.IsInteger","T.IsIntersect","T.IsLiteral","T.IsNever","T.IsNull","T.IsNumber","T.IsObject","T.IsRecord","T.IsRef","T.IsString","T.IsSymbol","T.IsTemplateLiteral","T.IsTuple","T.IsUndefined","T.IsUnion","T.IsVoid","Arguments.Match","Convert","T.Object","T.Literal","T.String","T.Unknown","T.Union","invalid","canonicalJson","Value.Check","Value.Errors","invalid","normalize","Value.Clean","Value.Default","Value.Clone","opaque","invalid","Type.Unsafe","Type.Object","Type.Union","Type.Literal","Type.Optional","Type.String","DescriptionSchema","Type.Integer","Type.Record","canonicalJson","Value.Check","coverage","sequence","Source","noop","invalid","Value.Clean","Value.Clone","Reload","coverage","invalid","Id","Type.Integer","Name","Type.String","Type.Immutable","Type.Array","Type.Object","Type.Enum","Type.Optional","Type.Number","Type.Union","Type.Literal","Type.Boolean","DescriptionSchema","Type.Unknown","Type.Record","Value.Check","encoder","decoder","invalid","encoder","decoder","Value.Clean","Value.Clone","invalid","canonicalJson","normalize","invalid","names","contentText","SCAN_PAGE_SIZE","settle","contentText","appendInput","isRecord","encoder","Settings.Get","Convert","Arguments.Match","DEFAULT_MAX_BYTES","errorMessage","jsonEqual","run","failNoModel","appendInput","truncate","advance","parts","SCAN_PAGE_SIZE","LIVE_STATUSES","nodeOf","errorMessage","SCAN_PAGE_SIZE","inside","sameList","describe","record","text","a","o","s","c","l","isRecord","packageRootOf","PROFILE_OPTION","DOMAIN_OPTION","DOMAINS_OPTION","MAJOR_MODE_OPTION","PRIVATE_FILE_MODE","parseDocument","isRecord","isObject","isRecord","describe","Type.String","Type.Union","Type.Literal","Type.Object","Type.Optional","Type.Number","Type.Array","Type.Boolean","Type.Integer","CORE_OWNER","skillSource","Type.Object","Type.String","Type.Optional","Type.Union","Type.Literal","Type.Object","Type.Optional","Type.String","normalizeText","Check","Type.Union","Type.Object","Type.Literal","Type.String","Type.Unknown","Check","crypto","STORE_FILE","STORE_VERSION","MAX_CONVERSATION_BYTES","DIRECTORY_MODE","FILE_MODE","LOOSE_MODE_MASK","Json","Type.Unsafe","Type.Object","Type.String","Type.Record","Text","Type.String","Optional","Type.Optional","Strings","Type.Array","Flag","Type.Boolean","NumberValue","Type.Number","Type.Object","Type.Literal","Json","Type.Unknown","Type.Union","Type.Tuple","Type.Record","Type.Null","Text","Type.String","Json","Type.Unsafe","Type.Object","Type.Record","Type.Array","Type.Optional","Type.Integer","Type.Union","Type.Null","Type.Intersect","Type.Object","Type.String","Type.Record","Type.Unsafe","Text","Type.String","Type.Number","Type.Boolean","Json","Type.Unsafe","Type.Unknown","Type.Optional","Type.Array","Type.Object","Type.Union","Type.Literal","Lifecycle","Type.Null","Type.Intersect","Type.Record","Type.Tuple","Type.Object","Type.String","Type.Union","Type.Null","Type.Boolean","MAX_BYTES","Type.Union","Type.Null","Type.Object","Type.String","Type.Integer","opaque","Type.Boolean","readyValue","keyOf","sessionView","dormantView","Type.Record","Type.String","Type.Array","TOKEN_BYTES","digest","core._isoDateTime","core._isoDate","core._coercedNumber","schemas.ZodNumber","z.lazy","z.union","z.string","z.number","z.boolean","z.null","z.record","z.array","z.object","z.looseObject","z.literal","z.unknown","z.enum","z.intersection","z.preprocess","z.optional","z.iso.datetime","z.discriminatedUnion","z.url","z.NEVER","z.coerce.number","z.any","z.lazy","z.union","z.string","z.number","z.boolean","z.null","z.record","z.array","z.object","z.looseObject","z.literal","z.enum","z.intersection","z.preprocess","z.optional","z.unknown","z.iso.datetime","z.discriminatedUnion","z.safeParse","z.toJSONSchema","z.email","z.url","z.iso.date","isJsonObject","isPlainObject","require_validation","DefaultJsonSchemaValidator","toError","json","WebSocket","json","tokenDigest","readBody","writeResponse","WebSocketServer","Type.Object","Type.String","Type.Object","Type.String","Type.Optional","Type.Boolean","Type.Literal","Errors","Type.Union","Type.Literal","Type.Object","Type.String","Type.Array","Type.Integer","Type.Optional","Type.Object","Type.String","Value.Check","defaultAuthContext","MAX_RESPONSE_BYTES","LOGIN_MESSAGE","INVALID_RESPONSE","record","MAX_RESPONSE_BYTES","errorMessage","isRecord","isJsonObject","Value.Check","withTimeout","Json","Type.Unsafe","Type.String","Type.Union","Type.Literal","Type.Object","Type.Array","Type.Record","Type.Optional","Type.Integer","Type.Boolean","isRecord","Check","isNodeError","fsWatch","toError","pathExists","runCommand","osConstants","openFile","fs","isLooseMode","tightenMode","isLooseMode","TOKEN_BYTES","MS_PER_MINUTE","TOKEN_BYTES","ID_BYTES","digest","l","u","d","f","s","t","p","m","e","i","n","a","h","r","g","o","c","d","f","p","m","h","g","l","_","u","v","c","y","T","b","s","x","S","C","r","w","i","n","o","t","e","a","r","i","a","t","o","e","n","isRecord","verifyDeviceSignature","isRecord","base64","base64","toUTF8String","decodeFirst","tinyCbor.decodePartialCBOR","encode","tinyCbor.encodeCBOR","isoUint8Array.toHex","isoCBOR.decodeFirst","isoUint8Array.concat","isoCBOR.decodeFirst","isoBase64URL.toUTF8String","isoCBOR.decodeFirst","isoCrypto.getRandomValues","isoCrypto.getRandomValues","BASE64_REGEX","BASE64URL_REGEX","concat","NAME","pvutils.utilToBase","pvutils.utilFromBase","pvutils.isEqualBuffer","Boolean","OctetString","BitString","pvutils.utilConcatView","pvutils.utilEncodeTC","Set","pvutils.padNumber","_a","encode","decode","is","normalize","is","encode","decode","parse","format","encode","decode","encode","decode","normalize","is","encode","encodeBinary","decode","decodeBinary","normalize","encode","decode","parseBody","encode","decode","parse","format","binary.encode","binary.decode","binary.is","hex.encode","hex.decode","hex.format","hex.is","hex.normalize","hex.parse","base64.encode","base64.decode","base64.is","base64.normalize","base64url.encode","base64url.decode","base64url.is","base64url.normalize","utf8.decode","utf8.encode","utf16.decode","utf16.encode","tryDecode","parse","format","hex.decode","base64.encode","base64.decode","base64url.encode","base64url.decode","hex.encode","binary.encode","binary.decode","utf8.decode","utf8.encode","utf16.decode","utf16.encode","hex.is","base64.is","base64url.is","base64.normalize","asn1js.BitString","asn1js.OctetString","asn1js.Null","asn1js.fromBER","asn1js.Integer","asn1js.Enumerated","asn1js.BitString","asn1js.ObjectIdentifier","asn1js.RelativeObjectIdentifier","asn1js.Boolean","asn1js.OctetString","asn1js.Utf8String","asn1js.BmpString","asn1js.UniversalString","asn1js.NumericString","asn1js.PrintableString","asn1js.TeletexString","asn1js.VideotexString","asn1js.IA5String","asn1js.GraphicString","asn1js.VisibleString","asn1js.GeneralString","asn1js.CharacterString","asn1js.UTCTime","asn1js.GeneralizedTime","asn1js","asn1js.Any","asn1js.Set","asn1js.Sequence","asn1js.Repeated","asn1js.Constructed","asn1js.Primitive","asn1js.Choice","defaultConverter","converters.defaultConverter","asn1js.fromBER","asn1js.Constructed","asn1js.Sequence","asn1js.compareSchema","converters.defaultConverter","asn1js.Set","asn1js","asn1js.BaseBlock","converters.defaultConverter","asn1js.Null","asn1js.Primitive","asn1js.Constructed","asn1js.Sequence","asn1js.Set","asn1js.fromBER","hex.encode","hex.encode","Name","GeneralName","Name","GeneralName","GeneralName","GeneralNames","GeneralName","GeneralNames","GeneralName","ExtendedKeyUsage","GeneralNames","KeyUsageFlags","GeneralName","GeneralNames","Attribute","Attribute","Extension","Version","Version","Name","Extension","Name","Name","Attribute","Attribute","CounterSignature","SigningTime","GeneralName","Attribute","GeneralNames","GeneralNames","GeneralName","GeneralNames","Attribute","GeneralNames","GeneralName","GeneralNames","GeneralName","GeneralName","Attribute","create","oid.id_ecdsaWithSHA1","oid.id_ecdsaWithSHA224","oid.id_ecdsaWithSHA256","oid.id_ecdsaWithSHA384","oid.id_ecdsaWithSHA512","oid.id_md2","oid.id_md5","oid.id_sha1","oid.id_sha224","sha256","oid.id_sha256","oid.id_sha384","oid.id_sha512","oid.id_sha512_224","oid.id_sha512_256","oid.id_mgf1","oid.id_pSpecified","oid.id_rsaEncryption","oid.id_md2WithRSAEncryption","oid.id_md5WithRSAEncryption","oid.id_sha1WithRSAEncryption","oid.id_sha512_224WithRSAEncryption","oid.id_sha512_256WithRSAEncryption","oid.id_sha384WithRSAEncryption","oid.id_sha512WithRSAEncryption","Lifecycle","injectable","EncryptedPrivateKeyInfo","Attributes_1","Version","Attributes","Attribute","PrivateKeyInfo","PrivateKeyInfo","EncryptedPrivateKeyInfo","attr.id_at","x509.DirectoryString","cms.ContentInfo","pfx.PFX","pkcs8.EncryptedPrivateKeyInfo","x509.Time","cms.SignerInfo","x509.Extensions","cms.Attribute","x509.AlgorithmIdentifier","Version","Attributes","Attribute","Name","container","unknown","asn1Ecc.ecdsaWithSHA1","asn1Ecc.ecdsaWithSHA256","asn1Ecc.ecdsaWithSHA384","asn1Ecc.ecdsaWithSHA512","asn1Ecc.id_secp256r1","asn1Ecc.id_secp384r1","asn1Ecc.id_secp521r1","asn1Ecc.id_ecPublicKey","asn1Ecc.ECParameters","asn1Ecc.id_ecdsaWithSHA1","asn1Ecc.id_ecdsaWithSHA256","asn1Ecc.id_ecdsaWithSHA384","asn1Ecc.id_ecdsaWithSHA512","injectable","NAME","asn1Rsa.id_sha1","asn1Rsa.id_sha224","asn1Rsa.id_sha256","asn1Rsa.id_sha384","asn1Rsa.id_sha512","asn1Rsa.id_rsaEncryption","asn1Rsa.id_sha1WithRSAEncryption","asn1Rsa.id_sha224WithRSAEncryption","asn1Rsa.id_sha256WithRSAEncryption","asn1Rsa.id_sha384WithRSAEncryption","asn1Rsa.id_sha512WithRSAEncryption","asn1Ecc.id_ecdsaWithSHA224","asn1X509.id_kp_serverAuth","asn1X509.id_kp_clientAuth","asn1X509.id_kp_codeSigning","asn1X509.id_kp_emailProtection","asn1X509.id_kp_timeStamping","asn1X509.id_kp_OCSPSigning","asn1Cms.id_signedData","names","escape","URL","asn1X509.Name","asn1X509.GeneralName","asn1X509.OtherName","asn1X509.DirectoryString","asn1X509.GeneralNames","asn1X509.AuthorityKeyIdentifier","asn1X509.KeyIdentifier","asn1X509.id_ce_authorityKeyIdentifier","asn1X509.ExtendedKeyUsage","asn1X509.id_ce_extKeyUsage","asn1X509.SubjectKeyIdentifier","asn1X509.id_ce_subjectKeyIdentifier","asn1X509.id_ce_subjectAltName","asn1X509.SubjectAlternativeName","asn1X509.CertificatePolicies","asn1X509.PolicyInformation","asn1X509.id_ce_certificatePolicies","asn1X509.DistributionPoint","asn1X509.DistributionPointName","asn1X509.CRLDistributionPoints","asn1X509.id_ce_cRLDistributionPoints","asn1X509.AuthorityInfoAccessSyntax","asn1X509.id_pe_authorityInfoAccess","asn1X509.id_ad_ocsp","asn1X509.id_ad_caIssuers","asn1X509.id_ad_timeStamping","asn1X509.id_ad_caRepository","asn1X509.AccessDescription","asn1X509.id_ce_issuerAltName","Attribute$1","asnPkcs9.ChallengePassword","asnPkcs9.id_pkcs9_at_challengePassword","asn1X509.Extensions","asn1X509.Extension","asnPkcs9.id_pkcs9_at_extensionRequest","asn1Rsa.RsaSaPssParams","asn1Rsa.id_mgf1","asn1Rsa.id_RSASSA_PSS","Version","asn1Cms.SignedData","asn1Cms.id_data","asn1Cms.EncapsulatedContent","asn1Cms.CertificateSet","asn1Cms.CertificateChoices","asn1Cms.ContentInfo","asn1Cms.CMSVersion","asn1X509.id_ce_basicConstraints","asn1X509.id_ce_keyUsage","fetch","fetch","isoCBOR.decodeFirst","_err","isoUint8Array.toDataView","isoUint8Array.fromHex","isoUint8Array.areEqual","isoCBOR.decodeFirst","isoCBOR.encode","isoUint8Array.fromUTF8String","isoCrypto.digest","isoCrypto.verify","isoBase64URL.toUTF8String","isoBase64URL.fromBuffer","isoBase64URL.fromBuffer","isoUint8Array.fromUTF8String","isoBase64URL.toBuffer","isoBase64URL.toUTF8String","isoBase64URL.toBuffer","_error","isoBase64URL.fromBuffer","_err","isoBase64URL.fromBuffer","isoUint8Array.concat","verify","isoBase64URL.isBase64URL","isoBase64URL.toBase64","isoBase64URL.isBase64","isoBase64URL.fromBuffer","isoUint8Array.fromUTF8String","isoBase64URL.fromBuffer","isoBase64URL.isBase64URL","isoBase64URL.trimPadding","isoUint8Array.fromASCIIString","isoUint8Array.areEqual","_err","isoUint8Array.concat","isoUint8Array.toHex","_err","isoUint8Array.areEqual","isoUint8Array.toHex","fetch","isoUint8Array.concat","_err","isoUint8Array.toUTF8String","isoBase64URL.toUTF8String","isoUint8Array.concat","isoBase64URL.fromBuffer","isoBase64URL.toBuffer","_err","isoUint8Array.fromUTF8String","isoUint8Array.toDataView","isoUint8Array.toDataView","isoUint8Array.concat","isoUint8Array.areEqual","isoUint8Array.concat","ExtendedKeyUsage","_err","isoUint8Array.areEqual","isoUint8Array.concat","_err","isoUint8Array.concat","isoUint8Array.areEqual","isoBase64URL.toBuffer","isoBase64URL.fromBuffer","isoUint8Array.fromUTF8String","isoBase64URL.fromBuffer","isoBase64URL.isBase64URL","isoBase64URL.trimPadding","isoBase64URL.isBase64URL","isoBase64URL.toBuffer","isoUint8Array.concat","describe","createHostHandshake","START_TIMEOUT_MS","UNAUTHORIZED","BAD_GATEWAY","BAD_REQUEST","FORBIDDEN","NOT_FOUND","CREATED","BAD_GATEWAY","WebSocket","parse","parse","Hono","Node","Node","WebSocketServer","createBundleSigner","crypto","NATIVE_ENTRY_PATH","Type.String","Type.Union","Type.Literal","Type.Number","Type.Boolean","Type.Optional","Type.Object","Type.Integer","Type.Array","Type.Record","Type.Unknown","MAX_PAYLOAD_BYTES","parse","Type.Object","Type.Optional","Type.Array","Type.String","Type.Union","Type.Literal","Type.Boolean","Type.Object","Type.Optional","Type.Array","Type.String","Type.Boolean","parse","stringify","isLoopbackHost","AGENT_PLUGIN_SCHEMA","crypto","parse","stringify","crypto","fs","fs","Type.String","Type.Array","Type.Object","Type.Optional","Type.Boolean","Type.Null","ID_METADATA","resolveInstanceBindingNode","TWO_PARAMS","THREE_PARAMS","FOUR_PARAMS","TWO_PARAMS","THREE_PARAMS","ZERO_CONSTRUCTOR_ARGUMENTS","ONE_CONSTRUCTOR_ARGUMENT","TWO_CONSTRUCTOR_ARGUMENTS","THREE_CONSTRUCTOR_ARGUMENTS","FOUR_CONSTRUCTOR_ARGUMENTS","curryResolveInstanceBindingNode","ZERO_PARAMS","ONE_PARAM","TWO_PARAMS","THREE_PARAMS","FOUR_PARAMS","subplan","buildServiceNodeBindings","crypto","u","d","f","m","h","g","_","v","y","b","x","S","C","w","T","E","k","A","ce","j","M","N","P","F","I","L","R","z","B","V","le","H","ue","U","de","W","r","n","G","K","q","fe","pe","me","J","Y","he","ge","X","Z","Q","$","a","s","o","i","c.load","e","t","l","o","t","n","s","d","m","_","y","a.enum","a.record","a.string","a.unknown","a.object","a.number","a.array","a.literal","a.boolean","j","M","N","P","F","I","L","R","z","B","V","i","e","H","r","f","ae","S","ne","re","v","g","y","b","a","m","e","p","s","n","w","oe","ie","T","x","c","l","u","D","O","k","_","C","se","E","h","A","te","o","i","t","r","c","o.object","o.string","o.union","o.array","o.number","u","o.enum","e.string","e.union","e.array","e.iso.datetime","e.number","e.enum","e.object","e.literal","e.toJSONSchema","resolveLogSinkPort","sleep","performance","Type.Unsafe","WebSocket","Type.Object","Type.String","Type.Integer","Type.Unknown","Type.Optional","Type.Array","Type.Union","Type.Literal","Type.Boolean","SESSION_ID_OPTION","NAME_OPTION","NO_DOMAINS_OPTION","MODEL_OPTION","THINKING_OPTION","crypto","MAJOR_MODE_OPTION","DOMAINS_OPTION","PROFILE_OPTION"],"sources":["../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/env/decode.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/env/line-scan.js","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/memory/metrics.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/guard/string.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/guard/guard.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/guard/emit.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/guard/globals.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/guard/index.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/settings/settings.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/memory/freeze.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/memory/assign.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/memory/clone.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/memory/create.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/memory/discard.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/memory/update.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/schema.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/deferred.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/constructor.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/function.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/ref.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/generic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/any.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/never.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/_add_optional.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/_optional.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/properties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/unknown.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/unsafe.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/arguments/arguments.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/infer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/dependent.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/enum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/environment/evaluate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/unreachable/unreachable.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/hashing/hash.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/locale/en_US.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/system/locale/_config.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/_codec.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/_immutable.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/_add_readonly.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/_readonly.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/bigint.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/boolean.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/integer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/null.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/number.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/symbol.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/string.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/patterns/pattern.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/template_literal/create.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/template_literal/decode.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/record_create.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_any.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/_remove_readonly.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/_remove_optional.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/tuple/to_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/evaluate/composite.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/evaluate/narrow.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/evaluate/distribute.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/exclude/operation.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_enum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_integer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_number.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_string.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/evaluate/flatten.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/from_key.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/record/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/record.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/rest.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/this.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/undefined.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/void.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/mapping.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/internal/match.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/internal/take.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/internal/char.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/internal/trim.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/unsigned_integer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/const.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/ident.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/unsigned_number.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/until.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/token/until_1.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/script/parser.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/template_literal/encode.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/template_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/result.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/extends_right.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/any.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/bigint.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/boolean.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/parameters.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/return_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/constructor.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/dependent.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/enum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/function.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/integer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/never.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/null.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/number.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/record.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/string.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/symbol.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/template_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/inference.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/undefined.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/unknown.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/void.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/extends_left.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/interface/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/interface.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/cyclic/check.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/cyclic/candidates.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/cyclic/extends.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/cyclic/target.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/extends/extends.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/evaluate/compare.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/evaluate/broaden.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/call/resolve_target.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/call/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/types/call.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/capitalize.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/lowercase.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/uncapitalize.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/uppercase.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/conditional.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/conditional/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/constructor_parameters.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/exclude.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/exclude/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/extract.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/extract/operation.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/extract/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/indexed.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/object/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/object/from_dependent.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/object/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/object/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/object/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/object/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/object/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/object/collapse.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/helpers/keys.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexed/from_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/from_enum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/from_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/this/expand_this.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexed/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexed/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexed/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/instance_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/keyof.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/keyof/from_any.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/keyof/from_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/keyof/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/keyof/from_record.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/keyof/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/keyof/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/mapped.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/mapped/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/module/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/non_nullable.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/omit.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/omit/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/omit/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/parameters.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/parameters/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/partial.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/partial/from_dependent.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/partial/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/partial/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/partial/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/partial/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/partial/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/pick.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/pick/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/pick/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/readonly_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/ref/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/required/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/required/from_dependent.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/required/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/required/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/required/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/required/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/required.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/required/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/return_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/return_type/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/with.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/with/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/rest/spread.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/instantiate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/_add_immutable.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/action/evaluate.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/type/engine/priority/priority.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/_refine.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/schema.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/additionalItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/additionalProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/allOf.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/anchor.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/anyOf.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/const.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/contains.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/default.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/dependencies.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/dependentRequired.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/dependentSchemas.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/dynamicAnchor.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/dynamicRef.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/else.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/enum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/exclusiveMaximum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/exclusiveMinimum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/format.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/id.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/if.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/items.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/maximum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/maxContains.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/maxItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/maxLength.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/maxProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/minimum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/minContains.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/minItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/minLength.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/minProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/multipleOf.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/not.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/oneOf.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/pattern.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/patternProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/prefixItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/properties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/propertyNames.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/recursiveAnchor.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/recursiveRef.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/ref.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/required.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/then.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/uniqueItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/unevaluatedItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/types/unevaluatedProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_context.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_externals.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_refine.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_unique.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/additionalItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_regexp.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/additionalProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_reducer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/allOf.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/anyOf.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/boolean.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/const.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/contains.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/dependencies.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/dependentRequired.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/dependentSchemas.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/dynamicRef.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/enum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/date.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/time.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/date_time.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/duration.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/email.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idna/pattern/pattern.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idna/label/ascii.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idna/format/puny.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idna/format/bidi.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idna/label/unicode.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idna/label/puny.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idna/hostname.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idna/idn-hostname.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/hostname.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idn_email.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/idn_hostname.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/ipv4.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/ipv6.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/iri_reference.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/iri.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/json_pointer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/regex.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/relative_json_pointer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/uri_reference.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/uri_template.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/uri.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/url.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/uuid.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/_registry.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/format/format.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/format.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/if.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/items.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/maxContains.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/maximum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/maxItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/maxLength.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/maxProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/minContains.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/minimum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/minItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/minLength.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/minProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/multipleOf.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/not.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/oneOf.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/pattern.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/patternProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/prefixItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_exact_optional.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/properties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/propertyNames.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/recursiveRef.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/ref.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/required.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/uniqueItems.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/schema.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_functions.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/pointer/pointer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/resolve/resolve.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/engine/_stack.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/build.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/errors.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/schema/check.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/check/check.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/errors/errors.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/assert/assert.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/additional.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_record.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_ref.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clone/clone.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/shared/union_priority_sort.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/clean/clean.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/try/try_result.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/try/try_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/try/try_bigint.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/try/try_boolean.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/try/try_null.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/try/try_number.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/try/try_string.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/try/try_undefined.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_bigint.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_boolean.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_enum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_integer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_null.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_number.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_additional.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/shared/optional_undefined.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_record.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_ref.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_string.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_template_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_undefined.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_void.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/convert/convert.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_default.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_record.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_ref.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/default/default.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/pipeline/pipeline.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/callback.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_record.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_ref.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/decode.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/encode.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/codec/has.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/error.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_default.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_array.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_bigint.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_boolean.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_constructor.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_cyclic.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_enum.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_function.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_integer.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_intersect.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_never.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_null.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_number.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_object.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_record.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_ref.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_string.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_symbol.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_template_literal.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_tuple.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_undefined.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_union.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_void.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/from_type.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/create/create.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/parse/parse.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/value/delta/edit.mjs","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/errors.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/schema.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/contract.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/delta/diff.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/publish.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/cell.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/object.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/reload.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/wire.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/cluster.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/link.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/connection.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/remote.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/host.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/entries.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/agent.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/text.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/retry.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/tasks.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/context.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/transcript.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/json.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/prompt.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/provider.js","../../../../../node_modules/.pnpm/@earendil-works+chord@1.3.0/node_modules/@earendil-works/chord/dist/output.js","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/compile/validator.mjs","../../../../../node_modules/.pnpm/typebox@1.3.27/node_modules/typebox/build/compile/compile.mjs","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/validation.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/truncate.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/usage.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/tool.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/generation.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/live.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/util.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/define.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/view.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/events.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/registry.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/harness/harness.js","../../../../core/po-core/dist/src/services/fileAccess/accessibleFile.mjs","../../../../core/po-core/dist/src/services/fileAccess/index.mjs","../../../../core/po-core/dist/src/services/kernel/index.mjs","../../../../core/po-core/dist/src/services/serverHost/index.mjs","../../../../core/po-core/dist/src/server/serverPackages.mjs","../../../../core/po-core/dist/src/schemas/packageApi.mjs","../../../../core/po-core/dist/src/schemas/home.mjs","../../../../core/po-core/dist/src/web/services/apiClient/index.mjs","../../../../core/po-web-security/dist/types/sealedChannel.mjs","../../../../core/po-core/dist/src/services/openSessionRegistry/openSessionRecords.mjs","../../../../core/po-core/dist/src/services/openSessionRegistry/sync.mjs","../../../../cli/po/src/builders/server/mcpBundle.ts","../../../../cli/po/src/cli/matrixOptions.ts","../../../../foundations/po-config/dist/configWriter-C-UadpFY.mjs","../../../../foundations/po-config/dist/piConfig-Bq36PQFF.mjs","../../../../foundations/po-config/dist/settingsApi-CRSCi4JR.mjs","../../../../core/po-core/dist/runtimeConfig.mjs","../../../../core/po-core/dist/src/services/toolCost/index.mjs","../../../../core/po-core/dist/contextProjection.mjs","../../../../core/po-core/dist/src/schemas/backgroundWork.mjs","../../../../core/po-core/dist/src/schemas/hubChannel.mjs","../../../../core/po-core/dist/src/schemas/notification.mjs","../../../../core/po-core/dist/src/schemas/sessionProtocol.mjs","../../../../core/po-core/dist/src/constants/agentSettled.mjs","../../../../core/po-core/dist/src/schemas/pluginProtocol.mjs","../../../../core/po-core/dist/src/services/sessionGitStatus/index.mjs","../../../../core/po-core/dist/headlessHub.mjs","../../../../core/po-core/dist/src/server/harnessErrorMessage.mjs","../../../../core/po-core/dist/serverTelemetry.mjs","../../../../core/po-core/dist/src/services/sessionMcpActivity/index.mjs","../../../../core/po-core/dist/src/services/sessionMcpConversations/index.mjs","../../../../core/po-core/dist/src/services/sessionMcpRegistrationStore/index.mjs","../../../../core/po-core/dist/src/schemas/protocolContracts.mjs","../../../../core/po-core/dist/src/schemas/protocolChannelsContract.mjs","../../../../core/po-core/dist/src/schemas/httpApiContracts.mjs","../../../../core/po-core/dist/src/schemas/protocolHubContract.mjs","../../../../core/po-core/dist/src/schemas/protocolThreadContract.mjs","../../../../core/po-core/dist/src/schemas/sessionApiContracts.mjs","../../../../core/po-core/dist/src/schemas/protocolSessionContract.mjs","../../../../core/po-core/dist/src/services/sessionPresentation/index.mjs","../../../../core/po-core/dist/src/pi/piSessionRuntime.mjs","../../../../core/po-core/dist/src/server/largeFrameLink.mjs","../../../../core/po-core/dist/src/server/threadJournals.mjs","../../../../core/po-core/dist/headlessProtocol.mjs","../../../../core/po-core/dist/src/services/sessionMcpAuthorization/index.mjs","../../../../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs","../../../../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs","../../../../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/compat.js","../../../../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js","../../../../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/coerce.js","../../../../../node_modules/.pnpm/@modelcontextprotocol+core@2.3.1/node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs","../../../../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs","../../../../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs","../../../../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs","../../../../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/index.mjs","../../../../core/po-core/dist/src/server/sessionMcpHandler.mjs","../../../../core/po-core/dist/src/server/sessionMcpRoutes.mjs","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js","../../../../clients/po-desktop/__vite-optional-peer-dep:bufferutil:ws","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/buffer-util.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/limiter.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js","../../../../clients/po-desktop/__vite-optional-peer-dep:utf-8-validate:ws","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/validation.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/receiver.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/sender.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/event-target.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/extension.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/stream.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/subprotocol.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket-server.js","../../../../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/wrapper.mjs","../../../../core/po-core/dist/headlessServer.mjs","../../../../core/po-core/dist/src/schemas/agentModel.mjs","../../../../core/po-core/dist/src/systems/child/types/childSession.mjs","../../../../core/po-core/dist/runtimeProtocol.mjs","../../../../core/po-core/dist/src/services/skillPrompt/index.mjs","../../../../core/po-core/dist/src/schemas/mcpStatus.mjs","../../../../core/po-core/dist/src/systems/main/adapters/headlessHost.mjs","../../../../core/po-core/dist/src/schemas/workflow.mjs","../../../../core/po-core/dist/src/services/durableSubagents/docs.mjs","../../../../core/po-core/dist/src/services/durableSubagents/tasks.mjs","../../../../core/po-core/dist/src/services/durableSubagents/extension.mjs","../../../../core/po-core/dist/src/services/durableSubagents/index.mjs","../../../../core/po-core/dist/src/services/toolContinuation/index.mjs","../../../../core/po-core/dist/src/services/durableNavigation/index.mjs","../../../../core/po-core/dist/src/services/durableQueue/docs.mjs","../../../../core/po-core/dist/src/services/durableQueue/index.mjs","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/api/lazy.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/auth/context.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/abort.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/models-error.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/models-store.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/models.js","../../../../core/po-core/dist/src/server/directHarnessRuntime.mjs","../../../../core/po-core/dist/src/services/chatgptImages/index.mjs","../../../../core/po-core/dist/src/services/chatgptWebSearch/index.mjs","../../../../core/po-core/dist/contextDetail.mjs","../../../../core/po-core/dist/src/services/headlessClient/index.mjs","../../../../core/po-core/dist/src/services/nodeModelDependencies/index.mjs","../../../../core/po-core/dist/src/services/piArgs/index.mjs","../../../../core/po-core/dist/src/services/piSummary/index.mjs","../../../../core/po-core/dist/src/services/toolPrompt/index.mjs","../../../../core/po-core/dist/src/systems/child/services/childSession/index.mjs","../../../../core/po-core/dist/src/services/nativeChildTools/index.mjs","../../../../core/po-core/dist/src/systems/child/adapters/headlessChildSessionService.mjs","../../../../../node_modules/.pnpm/@earendil-works+pi-ai@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelcontextpro_569f7bcf3b0e573d424ecac6137e296e/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js","../../../../core/po-core/dist/src/systems/main/adapters/headlessSessionHost.mjs","../../../../core/po-core/dist/headlessSessionManager.mjs","../../../../core/po-core/dist/src/server/mcpBundleLoader.mjs","../../../../core/po-core/dist/src/constants/modelGateway.mjs","../../../../core/po-core/dist/src/schemas/modelGateway.mjs","../../../../core/po-core/dist/src/services/modelGatewayWire/index.mjs","../../../../core/po-core/dist/src/services/modelGatewayContainer/index.mjs","../../../../core/po-core/dist/src/services/modelGatewayHost/index.mjs","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/env/node-watch.js","../../../../../node_modules/.pnpm/@earendil-works+pi-durable@1.3.0_@aws-sdk+credential-provider-node@3.972.86_@modelconte_ead33b53ae4efd7ac6c054138533add9/node_modules/@earendil-works/pi-durable/dist/env/node.js","../../../../core/po-core/dist/nodePlatform.mjs","../../../../core/po-core/dist/src/services/traceContext/index.mjs","../../../../core/po-core/dist/packageApiServer.mjs","../../../../core/po-core/dist/src/schemas/remoteOrigin.mjs","../../../../core/po-core/dist/src/constants/remote.mjs","../../../../core/po-core/dist/src/services/devProxyPolicy/index.mjs","../../../../core/po-core/dist/src/services/devProxyStore/devProxyRecords.mjs","../../../../core/po-core/dist/src/services/devProxyStore/sync.mjs","../../../../core/po-core/dist/src/services/devProxyStore/index.mjs","../../../../core/po-core/dist/src/services/publicFileShares/index.mjs","../../../../core/po-core/dist/src/services/webauthnPolicy/index.mjs","../../../../core/po-core/dist/src/services/remoteGuardPolicy/index.mjs","../../../../core/po-core/dist/src/services/deviceSessions/index.mjs","../../../../core/po-core/dist/src/services/deviceAuth/index.mjs","../../../../core/po-web-security/dist/services/nodeSealedChannel/index.mjs","../../../../core/po-web-security/dist/services/bundleSigner/index.mjs","../../../../core/po-web-security/dist/services/deviceSignature/index.mjs","../../../../core/po-core/dist/src/services/deviceTrust/index.mjs","../../../../core/po-core/dist/src/services/nativePushRegistration/index.mjs","../../../../core/po-core/dist/src/services/pairingFlow/index.mjs","../../../../core/po-core/dist/src/services/remoteAccessSettings/index.mjs","../../../../../node_modules/.pnpm/@hexagon+base64@1.1.28/node_modules/@hexagon/base64/src/base64.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.js","../../../../../node_modules/.pnpm/@levischuck+tiny-cbor@0.2.11/node_modules/@levischuck/tiny-cbor/esm/cbor/cbor_internal.js","../../../../../node_modules/.pnpm/@levischuck+tiny-cbor@0.2.11/node_modules/@levischuck/tiny-cbor/esm/cbor/cbor.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/cose.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoHashAlgName.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.js","../../../../../node_modules/.pnpm/pvtsutils@1.3.6/node_modules/pvtsutils/build/index.es.js","../../../../../node_modules/.pnpm/pvutils@1.2.0/node_modules/pvutils/build/utils.es.js","../../../../../node_modules/.pnpm/asn1js@3.0.10/node_modules/asn1js/build/index.es.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/bytes/buffer-source.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/bytes/equal.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/encoding/binary.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/encoding/hex.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/encoding/utf8.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/encoding/utf16.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/encoding/base64.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/encoding/base64url.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/pem/pem.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/converters/registry.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/converters/defaults.js","../../../../../node_modules/.pnpm/@peculiar+utils@2.0.3/node_modules/@peculiar/utils/build/esm/converters/convert.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/enums.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/types/bit_string.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/types/octet_string.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/converters.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/helper.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/schema.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/storage.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/decorators.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/errors/schema_validation.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/parser.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/serializer.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/objects.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.9.4/node_modules/@peculiar/asn1-schema/build/es2015/convert.js","../../../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/ip_converter.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/name.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/general_name.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/object_identifiers.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/authority_information_access.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/authority_key_identifier.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/basic_constraints.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/general_names.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/certificate_issuer.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/certificate_policies.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_number.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_delta_indicator.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_distribution_points.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_freshest.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_issuing_distribution_point.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_reason.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/extended_key_usage.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/inhibit_any_policy.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/invalidity_date.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/issuer_alternative_name.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/key_usage.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/name_constraints.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/policy_constraints.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/policy_mappings.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_alternative_name.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/attribute.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_directory_attributes.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_key_identifier.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/private_key_usage_period.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/entrust_version_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_info_access.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/algorithm_identifier.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/subject_public_key_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/time.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/validity.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/extension.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/types.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/tbs_certificate.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/certificate.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/tbs_cert_list.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509@2.9.4/node_modules/@peculiar/asn1-x509/build/es2015/certificate_list.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.js","../../../../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/issuer_and_serial_number.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/signer_identifier.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/types.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/attribute.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/signer_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/attributes/counter_signature.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/attributes/signing_time.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/aa_clear_attrs.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/attr_spec.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/aa_controls.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/issuer_serial.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/object_digest_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/v2_form.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/attr_cert_issuer.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/attr_cert_validity_period.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/holder.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/attribute_certificate_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/attribute_certificate.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/class_list.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/security_category.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/clearance.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/ietf_attr_syntax.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/object_identifiers.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/target.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/proxy_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/role_syntax.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-attr@2.9.4/node_modules/@peculiar/asn1-x509-attr/build/es2015/svce_auth_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/certificate_choices.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/content_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/encapsulated_content_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/encrypted_content_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/other_key_attribute.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/key_agree_recipient_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/key_trans_recipient_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/kek_recipient_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/password_recipient_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/recipient_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/recipient_infos.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/revocation_info_choice.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/originator_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/enveloped_data.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/object_identifiers.js","../../../../../node_modules/.pnpm/@peculiar+asn1-cms@2.9.4/node_modules/@peculiar/asn1-cms/build/es2015/signed_data.js","../../../../../node_modules/.pnpm/@peculiar+asn1-ecc@2.9.4/node_modules/@peculiar/asn1-ecc/build/es2015/object_identifiers.js","../../../../../node_modules/.pnpm/@peculiar+asn1-ecc@2.9.4/node_modules/@peculiar/asn1-ecc/build/es2015/algorithms.js","../../../../../node_modules/.pnpm/@peculiar+asn1-ecc@2.9.4/node_modules/@peculiar/asn1-ecc/build/es2015/rfc3279.js","../../../../../node_modules/.pnpm/@peculiar+asn1-ecc@2.9.4/node_modules/@peculiar/asn1-ecc/build/es2015/ec_parameters.js","../../../../../node_modules/.pnpm/@peculiar+asn1-ecc@2.9.4/node_modules/@peculiar/asn1-ecc/build/es2015/ec_private_key.js","../../../../../node_modules/.pnpm/@peculiar+asn1-ecc@2.9.4/node_modules/@peculiar/asn1-ecc/build/es2015/ec_signature_value.js","../../../../../node_modules/.pnpm/@peculiar+asn1-rsa@2.9.4/node_modules/@peculiar/asn1-rsa/build/es2015/object_identifiers.js","../../../../../node_modules/.pnpm/@peculiar+asn1-rsa@2.9.4/node_modules/@peculiar/asn1-rsa/build/es2015/algorithms.js","../../../../../node_modules/.pnpm/@peculiar+asn1-rsa@2.9.4/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsaes_oaep.js","../../../../../node_modules/.pnpm/@peculiar+asn1-rsa@2.9.4/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsassa_pss.js","../../../../../node_modules/.pnpm/@peculiar+asn1-rsa@2.9.4/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsassa_pkcs1_v1_5.js","../../../../../node_modules/.pnpm/@peculiar+asn1-rsa@2.9.4/node_modules/@peculiar/asn1-rsa/build/es2015/other_prime_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-rsa@2.9.4/node_modules/@peculiar/asn1-rsa/build/es2015/rsa_private_key.js","../../../../../node_modules/.pnpm/@peculiar+asn1-rsa@2.9.4/node_modules/@peculiar/asn1-rsa/build/es2015/rsa_public_key.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/types/lifecycle.js","../../../../../node_modules/.pnpm/tslib@1.14.1/node_modules/tslib/tslib.es6.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/reflection-helpers.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/providers/class-provider.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/providers/factory-provider.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/lazy-helpers.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/providers/injection-token.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/providers/token-provider.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/providers/value-provider.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/providers/provider.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/registry-base.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/registry.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/resolution-context.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/error-helpers.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/types/disposable.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/interceptors.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/dependency-container.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/decorators/injectable.js","../../../../../node_modules/.pnpm/tsyringe@4.10.0/node_modules/tsyringe/dist/esm5/index.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/attribute.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/authenticated_safe.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/bags/types.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/bags/cert_bag.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/bags/crl_bag.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pkcs8@2.9.4/node_modules/@peculiar/asn1-pkcs8/build/es2015/encrypted_private_key_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pkcs8@2.9.4/node_modules/@peculiar/asn1-pkcs8/build/es2015/private_key_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/bags/key_bag.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/bags/pkcs8_shrouded_key_bag.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/bags/secret_bag.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/mac_data.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/pfx.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pfx@2.9.4/node_modules/@peculiar/asn1-pfx/build/es2015/safe_bag.js","../../../../../node_modules/.pnpm/@peculiar+asn1-pkcs9@2.9.4/node_modules/@peculiar/asn1-pkcs9/build/es2015/index.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-post-quantum@2.9.4/node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/composite_signatures.js","../../../../../node_modules/.pnpm/@peculiar+asn1-asym-key@2.9.4/node_modules/@peculiar/asn1-asym-key/build/es2015/index.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-post-quantum@2.9.4/node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/composite_keys.js","../../../../../node_modules/.pnpm/@peculiar+asn1-x509-post-quantum@2.9.4/node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/object_identifiers.js","../../../../../node_modules/.pnpm/@peculiar+asn1-csr@2.9.4/node_modules/@peculiar/asn1-csr/build/es2015/attributes.js","../../../../../node_modules/.pnpm/@peculiar+asn1-csr@2.9.4/node_modules/@peculiar/asn1-csr/build/es2015/certification_request_info.js","../../../../../node_modules/.pnpm/@peculiar+asn1-csr@2.9.4/node_modules/@peculiar/asn1-csr/build/es2015/certification_request.js","../../../../../node_modules/.pnpm/@peculiar+x509@2.1.0/node_modules/@peculiar/x509/build/x509.es.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/fetch.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/toHash.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/errors/index.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/mapJWSAlgToCOSEAlg.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importJWKKey.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyAKP.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/runtimeSupportsWebCryptoKeyAlg.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/services/settingsService.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/helpers/logging.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/services/metadataService.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/isValidTPMManufacturerID.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.js","../../../../../node_modules/.pnpm/@peculiar+asn1-android@2.9.4/node_modules/@peculiar/asn1-android/build/es2015/key_description.js","../../../../../node_modules/.pnpm/@peculiar+asn1-android@2.9.4/node_modules/@peculiar/asn1-android/build/es2015/nonstandard.js","../../../../../node_modules/.pnpm/@peculiar+asn1-android@2.9.4/node_modules/@peculiar/asn1-android/build/es2015/attestation.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.js","../../../../../node_modules/.pnpm/@simplewebauthn+server@14.0.3/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.js","../../../../core/po-core/dist/src/services/webauthn/index.mjs","../../../../core/po-core/dist/src/services/remoteAccess/index.mjs","../../../../core/po-core/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs","../../../../core/po-core/dist/src/services/remoteAccessStore/sync.mjs","../../../../core/po-core/dist/src/services/remoteAccessStore/index.mjs","../../../../core/po-core/dist/src/services/pairingPage/index.mjs","../../../../core/po-core/dist/src/services/tunnelOutput/index.mjs","../../../../core/po-core/dist/src/services/tunnelProcess/index.mjs","../../../../core/po-core/dist/src/services/loopbackAddress/index.mjs","../../../../core/po-core/dist/src/server/devProxyForward.mjs","../../../../core/po-core/dist/src/server/devProxyRoutes.mjs","../../../../core/po-core/dist/src/server/devProxySocket.mjs","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/utils/url.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/utils/cookie.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/helper/cookie/index.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/http-exception.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/middleware/body-limit/index.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/middleware/timeout/index.js","../../../../core/po-core/dist/src/server/remoteRoutes.mjs","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/request/constants.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/utils/buffer.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/utils/body.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/request.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/utils/html.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/context.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/compose.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/utils/constants.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/hono-base.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router/utils.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router/reg-exp-router/matcher.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router/reg-exp-router/node.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router/reg-exp-router/trie.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router/reg-exp-router/router.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router/smart-router/router.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router/trie-router/node.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/router/trie-router/router.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/hono.js","../../../../core/po-core/dist/remoteRuntime.mjs","../../../../core/po-core/dist/src/schemas/sandboxIdentity.mjs","../../../../core/po-core/dist/src/services/bundlePublication/index.mjs","../../../../core/po-core/dist/webCompositions.mjs","../../../../core/po-core/dist/src/schemas/workspaceSandboxes.mjs","../../../../core/po-core/dist/src/services/workspaceSandboxes/index.mjs","../../../../foundations/po-minor-mode/dist/mode-CKUTHAVr.mjs","../../../../foundations/po-notification/dist/index.mjs","../../../../core/po-core/dist/src/schemas/mcpProjection.mjs","../../../../core/po-core/dist/src/schemas/mcpSession.mjs","../../../../foundations/po-domain/dist/mcpFilter-CKUbKmxz.mjs","../../../../foundations/po-config/dist/agentPluginMcp.mjs","../../../../foundations/po-domain/dist/pluginMaterializer-D9-oDF-b.mjs","../../../../foundations/po-domain/dist/toolNames-L4VE90mU.mjs","../../../../foundations/po-domain/dist/resourceCollector-DoXqQLuN.mjs","../../../../foundations/po-ui/dist/theme-BX_hfErv.mjs","../../../../cli/po/src/builders/cli/harnessContext.ts","../../../../cli/po/src/builders/isolate/compile.ts","../../../../cli/po/src/builders/isolate/membrane.ts","../../../../cli/po/src/builders/isolate/index.ts","../../../../cli/po/src/builders/npm/index.ts","../../../../cli/po/src/builders/server/index.ts","../../../../cli/po/src/builders/server/packageReloadCheck.ts","../../../../cli/po/src/builders/server/bundlerService.ts","../../../../cli/po/src/builders/server/computerUseRecordings.ts","../../../../cli/po/src/builders/server/computerUseBinding.ts","../../../../cli/po/src/builders/server/containedSessions.ts","../../../../cli/po/src/builders/server/defaultWorkspace.ts","../../../../cli/po/src/builders/server/hostModelGateway.ts","../../../../cli/po/src/builders/server/idleRestart.ts","../../../../../node_modules/.pnpm/@inversifyjs+common@2.0.1/node_modules/@inversifyjs/common/lib/common/calculations/isPromise.js","../../../../../node_modules/.pnpm/@inversifyjs+common@2.0.1/node_modules/@inversifyjs/common/lib/services/calculations/stringifyServiceIdentifier.js","../../../../../node_modules/.pnpm/@inversifyjs+common@2.0.1/node_modules/@inversifyjs/common/lib/services/models/LazyServiceIdentifier.js","../../../../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/ReflectLite.js","../../../../../node_modules/.pnpm/@inversifyjs+reflect-metadata-utils@1.5.0_reflect-metadata@0.2.2/node_modules/@inversifyjs/reflect-metadata-utils/lib/reflectMetadata/utils/getOwnReflectMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+reflect-metadata-utils@1.5.0_reflect-metadata@0.2.2/node_modules/@inversifyjs/reflect-metadata-utils/lib/reflectMetadata/utils/setReflectMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+reflect-metadata-utils@1.5.0_reflect-metadata@0.2.2/node_modules/@inversifyjs/reflect-metadata-utils/lib/reflectMetadata/utils/updateOwnReflectMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+container@3.1.3_reflect-metadata@0.2.2/node_modules/@inversifyjs/container/lib/container/actions/getContainerModuleId.js","../../../../../node_modules/.pnpm/@inversifyjs+container@3.1.3_reflect-metadata@0.2.2/node_modules/@inversifyjs/container/lib/container/models/ContainerModule.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/actions/getBindingId.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/models/BindingScope.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/models/BindingType.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/services/ActivationsService.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/reflectMetadata/data/classMetadataReflectKey.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/getDefaultClassMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/reflectMetadata/data/pendingClassMetadataCountReflectKey.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/isPendingClassMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/error/models/InversifyCoreError.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/error/models/InversifyCoreErrorKind.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/models/MaybeClassElementMetadataKind.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/throwAtInvalidClassMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/validateConstructorMetadataArray.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/getClassMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/calculations/buildInstanceBinding.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/services/BindingService.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/services/DeactivationsService.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/getDefaultPendingClassMetadataCount.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/actions/decrementPendingClassMetadataCount.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/models/ClassElementMetadataKind.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/buildClassElementMetadataFromMaybeClassElementMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/buildDefaultManagedMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/assertMetadataFromTypescriptIfManaged.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/buildManagedMetadataFromMaybeManagedMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/buildManagedMetadataFromMaybeClassElementMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/actions/updateMaybeClassMetadataConstructorArgument.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/actions/updateMaybeClassMetadataProperty.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/decorator/models/DecoratorInfoKind.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/decorator/calculations/getDecoratorInfo.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/decorator/calculations/stringifyDecoratorInfo.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/handleInjectionError.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/decorators/injectBase.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/decorators/inject.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/reflectMetadata/data/classIsInjectableFlagReflectKey.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/actions/setIsInjectableFlag.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/reflectMetadata/data/typescriptDesignParameterTypesReflectKey.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/buildClassElementMetadataFromTypescriptParameterType.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/isUserlandEmittedType.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/actions/updateClassMetadataWithTypescriptParameterTypes.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/decorators/injectable.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/buildDefaultUnmanagedMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/buildUnmanagedMetadataFromMaybeManagedMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/calculations/buildUnmanagedMetadataFromMaybeClassElementMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/decorators/unmanaged.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/metadata/models/ResolvedValueElementMetadataKind.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/models/BindingConstraintsImplementation.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/isPlanServiceRedirectionBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveServiceRedirectionBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveMultipleBindingServiceNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/PlanMultipleBindingServiceNodeImplementation.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/DynamicallyResolvableBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/isDynamicallyResolvableBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/PlanSingleBindingServiceNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildFilteredServiceBindings.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/binding/calculations/stringifyBinding.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/curryBuildPlanServiceNodeFromOptions.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/LazyPlanServiceNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/common/calculations/buildBuildServiceNodeOptionsFromPlanParamsConstraints.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/common/models/SingleImmutableLinkedList.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildPlanBindingConstraintsList.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/actions/curryBuildPlanServiceNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/cacheResolvedValue.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveBindingActivationsFromIteratorAsync.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveBindingActivationsFromIterator.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveBindingServiceActivations.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveBindingActivations.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveScoped.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/ConstantValueBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveScopedWithNoActivations.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveServiceActivations.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildNoActivationsDynamicValueBindingNodeResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/DynamicValueBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/FactoryBindingNodeImplementation.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveInstanceBindingConstructorParams.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveInstanceBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolvePostConstruct.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/setInstanceProperties.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveInstanceBindingNodeFromConstructorParams.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveInstanceBindingNodeAsyncFromConstructorParams.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildConstructorArgumentsResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/resolveFour.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildFourConstructorArgumentResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildOneConstructorArgumentResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/resolveThree.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildThreeConstructorArgumentResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/resolveTwo.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildTwoConstructorArgumentResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildZeroConstructorArgumentsResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/resolveMany.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildNoActivationsInstanceBindingNodeResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/getGeneratedResolverId.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildConstructorArgumentsResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildOneConstructorArgumentResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildOnePropertyArgumentResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildResolveMany.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildZeroConstructorArgumentsResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildNoActivationsInstanceBindingNodeResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/InstanceBindingNodeImplementation.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/PlanServiceRedirectionBindingNodeImplementation.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveResolvedValueBindingParams.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/resolution/actions/resolveResolvedValueBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildFourResolvedValueArgumentResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildOneResolvedValueArgumentResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildThreeResolvedValueArgumentResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildTwoResolvedValueArgumentResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildZeroResolvedValueArgumentsResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildNoActivationsResolvedValueBindingNodeResolver.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildOneResolvedValueArgumentResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildResolvedValueArgumentsResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildZeroResolvedValueArgumentsResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildNoActivationsResolvedValueBindingNodeResolverJit.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/ResolvedValueBindingNodeImplementation.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/actions/curryBuildServiceNodeBindings.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/common/calculations/buildBuildServiceNodeOptionsFromClassElementMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/common/calculations/buildBuildServiceNodeOptionsFromResolvedValueElementMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/buildConstructorNoParamNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/isInstanceBindingNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/tryBuildGetPlanOptionsFromBuildServiceNodeOptions.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/tryBuildGetPlanOptionsFromManagedClassElementMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/actions/cacheNonRootPlanServiceNode.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/actions/currySubplan.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/actions/plan.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/models/CacheBindingInvalidationKind.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/calculations/curryLazyBuildPlanServiceNodeFromOptions.js","../../../../../node_modules/.pnpm/@inversifyjs+core@15.0.1_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/planning/actions/addServiceNodeBindingIfContextFree.js","../../../../../node_modules/.pnpm/@inversifyjs+container@3.1.3_reflect-metadata@0.2.2/node_modules/@inversifyjs/container/lib/error/models/InversifyContainerErrorKind.js","../../../../../node_modules/.pnpm/@inversifyjs+container@3.1.3_reflect-metadata@0.2.2/node_modules/@inversifyjs/container/lib/container/services/Container.js","../../../../../node_modules/.pnpm/sqlite-vec@0.1.9/node_modules/sqlite-vec/index.mjs","../../../../../node_modules/.pnpm/layerr@3.0.0/node_modules/layerr/dist/error.js","../../../../../node_modules/.pnpm/layerr@3.0.0/node_modules/layerr/dist/global.js","../../../../../node_modules/.pnpm/layerr@3.0.0/node_modules/layerr/dist/tools.js","../../../../../node_modules/.pnpm/layerr@3.0.0/node_modules/layerr/dist/layerr.js","../../../../../node_modules/.pnpm/ulidx@2.4.1/node_modules/ulidx/dist/node/index.js","../../../../tooling/po-logsink/dist/LogStorageService-FUtAkl3y.mjs","../../../../../node_modules/.pnpm/@agimon-ai+foundation-process-registry@0.30.14_zod@4.6.7/node_modules/@agimon-ai/foundation-process-registry/dist/ProcessRegistryService.mjs","../../../../tooling/po-logsink/dist/container-DATXzAs6.mjs","../../../../tooling/po-logsink/dist/stdio-DVTvHUla.mjs","../../../../tooling/po-logsink/dist/queryContracts.mjs","../../../../cli/po/src/builders/server/logSink.ts","../../../../cli/po/src/builders/server/nativePush.ts","../../../../cli/po/src/builders/server/runtimeResources.ts","../../../../cli/po/src/builders/server/sandboxRouter.ts","../../../../cli/po/src/builders/server/sandboxSessionHandoff.ts","../../../../core/po-core/dist/src/constants/voiceTools.mjs","../../../../core/po-core/dist/src/schemas/voiceTools.mjs","../../../../foundations/po-domain/dist/domainText-D0iurn8D.mjs","../../../../foundations/po-major-mode/dist/index.mjs","../../../../cli/po/src/builders/server/selectionStatus.ts","../../../../cli/po/src/builders/server/sessionArguments.ts","../../../../cli/po/src/builders/server/shutdown.ts","../../../../cli/po/src/builders/server/watcherService.ts","../../../../cli/po/src/builders/server/webTemplateDecision.ts","../../../../cli/po/src/builders/server/workspaceCheckout.ts","../../../../cli/po/src/builders/server/runtime.ts","../../../../cli/po/src/cli/options.ts","../../../../cli/po/src/cli/harnessOptions.ts","../../../../cli/po/src/cli/server/options.ts","../../../../cli/po/src/cli/server/run.ts"],"sourcesContent":["/**\n * Decoding that matches `new TextDecoder().decode(bytes)` of the whole input when the input arrives in pieces. Node's\n * streaming decoder with BOM handling can drop a U+FEFF that follows a chunk boundary, not only a leading byte-order\n * mark, so these decoders turn BOM handling off and drop a leading mark themselves.\n */\n/** A streaming decoder for a byte range; callers that start at the beginning of a file skip a leading mark themselves. */\nexport function rangeDecoder() {\n    return new TextDecoder(\"utf-8\", { ignoreBOM: true });\n}\n/** Whether decoding the whole input drops its first three bytes as a byte-order mark. */\nexport function startsWithBom(firstBytes) {\n    return firstBytes[0] === 0xef && firstBytes[1] === 0xbb && firstBytes[2] === 0xbf;\n}\n/** Decodes one stream chunk by chunk exactly like decoding all of it at once. */\nexport class StreamDecoder {\n    #decoder = rangeDecoder();\n    #started = false;\n    /** Text for `bytes`, holding back an incomplete character; without `bytes`, the end of the stream. */\n    decode(bytes) {\n        const text = bytes === undefined ? this.#decoder.decode() : this.#decoder.decode(bytes, { stream: true });\n        if (this.#started || text === \"\")\n            return text;\n        this.#started = true;\n        // U+FEFF encodes only as EF BB BF, so a leading U+FEFF is exactly a byte-order mark at the stream's start.\n        return text.startsWith(\"\\ufeff\") ? text.slice(1) : text;\n    }\n}\n//# sourceMappingURL=decode.js.map","import { rangeDecoder, startsWithBom } from \"./decode.js\";\nconst NEWLINE = 0x0a;\nconst encoder = new TextEncoder();\n/** UTF-8 byte length of decoded text. */\nfunction decodedBytes(text) {\n    return text === \"\" ? 0 : encoder.encode(text).length;\n}\n/**\n * Computes a `LineScan` from a file's bytes fed in order, so an environment can scan any size in bounded memory. Decoded\n * sizes use the same streaming WHATWG decoder as decoding the whole file at once.\n */\nexport class LineScanner {\n    #startLine;\n    #endLine;\n    #position = 0;\n    #newlines = 0;\n    #lineStart = 0;\n    #start;\n    #end;\n    #firstLineEnd;\n    #lastLineStart;\n    #selectedBytes = 0;\n    #firstLineBytes = 0;\n    #selection;\n    #firstLine;\n    /** The first bytes, held until it is known whether they are a byte-order mark. */\n    #head = [];\n    #bom = false;\n    /** `startLine` and `endLine` must be non-negative integers with `endLine > startLine`; `endLine` absent: to the end. */\n    constructor(startLine, endLine = Number.POSITIVE_INFINITY) {\n        if (!Number.isSafeInteger(startLine) || startLine < 0 || !(endLine > startLine)) {\n            throw new RangeError(\"Invalid line range\");\n        }\n        if (endLine !== Number.POSITIVE_INFINITY && !Number.isSafeInteger(endLine))\n            throw new RangeError(\"Invalid line range\");\n        this.#startLine = startLine;\n        this.#endLine = endLine;\n        if (startLine === 0)\n            this.#begin(0);\n    }\n    push(chunk) {\n        if (this.#head !== undefined) {\n            const take = Math.min(3 - this.#head.length, chunk.length);\n            this.#head.push(...chunk.subarray(0, take));\n            if (this.#head.length < 3)\n                return;\n            this.#releaseHead();\n            chunk = chunk.subarray(take);\n        }\n        this.#process(chunk);\n    }\n    #releaseHead() {\n        const head = Uint8Array.from(this.#head ?? []);\n        this.#head = undefined;\n        this.#bom = startsWithBom(head);\n        this.#process(head);\n    }\n    #process(chunk) {\n        const base = this.#position;\n        let from = 0;\n        for (let index = chunk.indexOf(NEWLINE); index !== -1; index = chunk.indexOf(NEWLINE, index + 1)) {\n            // The newline ends line `this.#newlines`. It belongs to the selection between selected lines only.\n            this.#feed(chunk, base, from, index);\n            const line = this.#newlines;\n            const position = base + index;\n            if (line === this.#startLine)\n                this.#endFirstLine(position);\n            if (line === this.#endLine - 1)\n                this.#endSelection(position);\n            this.#feed(chunk, base, index, index + 1);\n            from = index + 1;\n            this.#newlines++;\n            this.#lineStart = position + 1;\n            if (this.#newlines === this.#startLine)\n                this.#begin(this.#lineStart);\n            if (this.#newlines === this.#endLine - 1)\n                this.#lastLineStart = this.#lineStart;\n        }\n        this.#feed(chunk, base, from, chunk.length);\n        this.#position += chunk.length;\n    }\n    finish() {\n        if (this.#head !== undefined)\n            this.#releaseHead();\n        const size = this.#position;\n        if (this.#start === undefined) {\n            return {\n                newlines: this.#newlines,\n                start: size,\n                end: size,\n                firstLineEnd: size,\n                lastLineStart: size,\n                selectedBytes: 0,\n                firstLineBytes: 0,\n            };\n        }\n        if (this.#firstLineEnd === undefined)\n            this.#endFirstLine(size);\n        if (this.#end === undefined)\n            this.#endSelection(size);\n        return {\n            newlines: this.#newlines,\n            start: this.#start,\n            end: this.#end ?? size,\n            firstLineEnd: this.#firstLineEnd ?? size,\n            // A selection that reaches past the last line ends with the last line.\n            lastLineStart: this.#lastLineStart ?? this.#lineStart,\n            selectedBytes: this.#selectedBytes,\n            firstLineBytes: this.#firstLineBytes,\n        };\n    }\n    #begin(start) {\n        this.#start = start;\n        if (this.#startLine === this.#endLine - 1)\n            this.#lastLineStart = start;\n        this.#selection = rangeDecoder();\n        this.#firstLine = rangeDecoder();\n    }\n    #endFirstLine(position) {\n        this.#firstLineEnd = position;\n        if (this.#firstLine !== undefined)\n            this.#firstLineBytes += decodedBytes(this.#firstLine.decode());\n        this.#firstLine = undefined;\n    }\n    #endSelection(position) {\n        this.#end = position;\n        if (this.#selection !== undefined)\n            this.#selectedBytes += decodedBytes(this.#selection.decode());\n        this.#selection = undefined;\n    }\n    /** Feed `chunk[from, to)`, which starts at file offset `base`, to the decoders of the ranges still open. */\n    #feed(chunk, base, from, to) {\n        // Decoding the whole file drops a leading byte-order mark.\n        if (this.#bom && base + from < 3)\n            from = Math.min(to, 3 - base);\n        if (to <= from)\n            return;\n        const bytes = chunk.subarray(from, to);\n        if (this.#selection !== undefined) {\n            this.#selectedBytes += decodedBytes(this.#selection.decode(bytes, { stream: true }));\n        }\n        if (this.#firstLine !== undefined) {\n            this.#firstLineBytes += decodedBytes(this.#firstLine.decode(bytes, { stream: true }));\n        }\n    }\n}\n//# sourceMappingURL=line-scan.js.map","/** TypeBox instantiation metrics */\nexport const Metrics = {\n    assign: 0,\n    create: 0,\n    clone: 0,\n    discard: 0,\n    update: 0\n};\n","// --------------------------------------------------------------------------\n// IsBetween\n// --------------------------------------------------------------------------\nfunction IsBetween(value, min, max) {\n    return value >= min && value <= max;\n}\n// --------------------------------------------------------------------------\n// IsZeroWidthJoiner\n// --------------------------------------------------------------------------\nfunction IsZeroWidthJoiner(value) {\n    return (value === 0x200D);\n}\n// --------------------------------------------------------------------------\n// IsHighSurrogate\n// --------------------------------------------------------------------------\nfunction IsHighSurrogate(value) {\n    return IsBetween(value, 0xD800, 0xDBFF);\n}\n// --------------------------------------------------------------------------\n// IsRegionalIndicator\n// --------------------------------------------------------------------------\nfunction IsRegionalIndicator(value) {\n    return IsBetween(value, 0x1F1E6, 0x1F1FF);\n}\n// --------------------------------------------------------------------------\n// IsVariationSelector\n// --------------------------------------------------------------------------\nfunction IsVariationSelector(value) {\n    return IsBetween(value, 0xFE00, 0xFE0F);\n}\n// --------------------------------------------------------------------------\n// IsCombiningMark\n// --------------------------------------------------------------------------\nfunction IsCombiningMark(value) {\n    return (IsBetween(value, 0x0300, 0x036F) ||\n        IsBetween(value, 0x1AB0, 0x1AFF) ||\n        IsBetween(value, 0x1DC0, 0x1DFF) ||\n        IsBetween(value, 0xFE20, 0xFE2F));\n}\n// --------------------------------------------------------------------------\n// CodePointLength\n// --------------------------------------------------------------------------\nfunction CodePointLength(value) {\n    return value > 0xFFFF ? 2 : 1;\n}\n// --------------------------------------------------------------------------\n// ConsumeModifiers (helper)\n// --------------------------------------------------------------------------\nfunction ConsumeModifiers(value, index) {\n    while (index < value.length) {\n        const point = value.codePointAt(index);\n        if (IsCombiningMark(point) || IsVariationSelector(point)) {\n            index += CodePointLength(point);\n        }\n        else {\n            break;\n        }\n    }\n    return index;\n}\n// --------------------------------------------------------------------------\n// NextGraphemeClusterIndex\n// --------------------------------------------------------------------------\nfunction NextGraphemeClusterIndex(value, clusterStart) {\n    const startCP = value.codePointAt(clusterStart);\n    let clusterEnd = clusterStart + CodePointLength(startCP);\n    // Consume combining marks & variation selectors\n    clusterEnd = ConsumeModifiers(value, clusterEnd);\n    // Handle multi-ZWJ sequences\n    while (clusterEnd < value.length - 1 && IsZeroWidthJoiner(value.codePointAt(clusterEnd))) {\n        const nextCP = value.codePointAt(clusterEnd + 1);\n        clusterEnd += 1 + CodePointLength(nextCP);\n        clusterEnd = ConsumeModifiers(value, clusterEnd);\n    }\n    // Handle regional indicator pairs (flags)\n    if (IsRegionalIndicator(startCP) &&\n        clusterEnd < value.length &&\n        IsRegionalIndicator(value.codePointAt(clusterEnd))) {\n        clusterEnd += CodePointLength(value.codePointAt(clusterEnd));\n    }\n    return clusterEnd;\n}\n// --------------------------------------------------------------------------\n// IsGraphemeCodePoint\n// --------------------------------------------------------------------------\nfunction IsGraphemeCodePoint(value) {\n    return ((value >= 0x0300) && ( // above special range\n    IsHighSurrogate(value) ||\n        IsCombiningMark(value) ||\n        IsVariationSelector(value) ||\n        IsZeroWidthJoiner(value)));\n}\n// --------------------------------------------------------------------------\n// GraphemeCount\n// --------------------------------------------------------------------------\n/** Returns the number of grapheme clusters in a string */\nexport function GraphemeCount(value) {\n    let count = 0;\n    let index = 0;\n    while (index < value.length) {\n        index = NextGraphemeClusterIndex(value, index);\n        count++;\n    }\n    return count;\n}\n// --------------------------------------------------------------------------\n// IsMinLengthSegmented\n// --------------------------------------------------------------------------\n/** Checks if a string has at least a minimum number of grapheme clusters */\nfunction IsMinLengthSegmented(value, minLength) {\n    // if (minLength === 0) return true // 0-length (unreachable)\n    let count = 0;\n    let index = 0;\n    while (index < value.length) {\n        index = NextGraphemeClusterIndex(value, index);\n        if ((++count) >= minLength)\n            return true;\n    }\n    return false;\n}\n// --------------------------------------------------------------------------\n// IsMaxLengthSegmented\n// --------------------------------------------------------------------------\n/** Checks if a string has at most a maximum number of grapheme clusters */\nfunction IsMaxLengthSegmented(value, maxLength) {\n    let count = 0;\n    let index = 0;\n    while (index < value.length) {\n        index = NextGraphemeClusterIndex(value, index);\n        if ((++count) > maxLength)\n            return false;\n    }\n    return true;\n}\n// --------------------------------------------------------------------------\n// IsMinLengthFast\n// --------------------------------------------------------------------------\n/** Fast check for minimum grapheme length, falls back to full check if needed */\nexport function IsMinLength(value, minLength) {\n    if (minLength === 0)\n        return true; // 0-length\n    if (value.length < minLength)\n        return false; // length is upper bound on grapheme count\n    let index = 0;\n    while (true) {\n        if (IsGraphemeCodePoint(value.charCodeAt(index))) {\n            return IsMinLengthSegmented(value, minLength);\n        }\n        if ((++index) >= minLength)\n            return true;\n    }\n}\n// --------------------------------------------------------------------------\n// IsMaxLengthFast\n// --------------------------------------------------------------------------\n/** Fast check for maximum grapheme length, falls back to full check if needed */\nexport function IsMaxLength(value, maxLength) {\n    if (value.length <= maxLength)\n        return true; // length is upper bound on grapheme count\n    let index = 0;\n    while (true) {\n        if (IsGraphemeCodePoint(value.charCodeAt(index))) {\n            return IsMaxLengthSegmented(value, maxLength);\n        }\n        if ((++index) > maxLength)\n            return false;\n    }\n}\n","// deno-fmt-ignore-file\nimport * as String from './string.mjs';\n// --------------------------------------------------------------------------\n// Guards\n// --------------------------------------------------------------------------\n/** Returns true if this value is an array */\nexport function IsArray(value) {\n    return Array.isArray(value);\n}\n/** Returns true if this value is bigint */\nexport function IsBigInt(value) {\n    return IsEqual(typeof value, 'bigint');\n}\n/** Returns true if this value is a boolean */\nexport function IsBoolean(value) {\n    return IsEqual(typeof value, 'boolean');\n}\n/** Returns true if this value is a constructor */\nexport function IsConstructor(value) {\n    if (IsUndefined(value) || !IsFunction(value))\n        return false;\n    const result = Function.prototype.toString.call(value);\n    if (/^class\\s/.test(result))\n        return true;\n    if (/\\[native code\\]/.test(result))\n        return true;\n    return false;\n}\n/** Returns true if this value is a function */\nexport function IsFunction(value) {\n    return IsEqual(typeof value, 'function');\n}\n/** Returns true if this value is integer */\nexport function IsInteger(value) {\n    return Number.isInteger(value);\n}\n/** Returns true if this value is null */\nexport function IsNull(value) {\n    return IsEqual(value, null);\n}\n/** Returns true if this value is number */\nexport function IsNumber(value) {\n    return Number.isFinite(value);\n}\n/** Returns true if this value is an object but not an array */\nexport function IsObjectNotArray(value) {\n    return IsObject(value) && !IsArray(value);\n}\n/** Returns true if this value is an object */\nexport function IsObject(value) {\n    return IsEqual(typeof value, 'object') && !(IsNull(value));\n}\n/** Returns true if this value is string */\nexport function IsString(value) {\n    return IsEqual(typeof value, 'string');\n}\n/** Returns true if this value is symbol */\nexport function IsSymbol(value) {\n    return IsEqual(typeof value, 'symbol');\n}\n/** Returns true if this value is undefined */\nexport function IsUndefined(value) {\n    return IsEqual(value, undefined);\n}\n// --------------------------------------------------------------------------\n// Relational\n// --------------------------------------------------------------------------\nexport function IsEqual(left, right) {\n    return left === right;\n}\nexport function IsGreaterThan(left, right) {\n    return left > right;\n}\nexport function IsLessThan(left, right) {\n    return left < right;\n}\nexport function IsLessEqualThan(left, right) {\n    return left <= right;\n}\nexport function IsGreaterEqualThan(left, right) {\n    return left >= right;\n}\n// --------------------------------------------------------------------------\n// MultipleOf\n// --------------------------------------------------------------------------\nexport function IsMultipleOf(dividend, divisor) {\n    if (IsBigInt(dividend) || IsBigInt(divisor)) {\n        return BigInt(dividend) % BigInt(divisor) === 0n;\n    }\n    const tolerance = 1e-10;\n    if (!IsNumber(dividend))\n        return true;\n    if (IsInteger(dividend) && (1 / divisor) % 1 === 0)\n        return true;\n    const mod = dividend % divisor;\n    return Math.min(Math.abs(mod), Math.abs(mod - divisor), Math.abs(mod + divisor)) < tolerance;\n}\n// ------------------------------------------------------------------\n// IsClassInstance\n// ------------------------------------------------------------------\n/** Returns true if the value appears to be an instance of a class. */\nexport function IsClassInstance(value) {\n    if (!IsObject(value))\n        return false;\n    const proto = globalThis.Object.getPrototypeOf(value);\n    if (IsNull(proto))\n        return false;\n    return IsEqual(typeof proto.constructor, 'function') &&\n        !(IsEqual(proto.constructor, globalThis.Object) ||\n            IsEqual(proto.constructor.name, 'Object'));\n}\n// ------------------------------------------------------------------\n// IsValueLike\n// ------------------------------------------------------------------\nexport function IsValueLike(value) {\n    return IsBigInt(value) ||\n        IsBoolean(value) ||\n        IsNull(value) ||\n        IsNumber(value) ||\n        IsString(value) ||\n        IsUndefined(value);\n}\n// --------------------------------------------------------------------------\n// String\n// --------------------------------------------------------------------------\n/** Returns the number of grapheme clusters in the string */\nexport function GraphemeCount(value) {\n    return String.GraphemeCount(value);\n}\n/** Returns true if the string has at most the given number of graphemes */\nexport function IsMaxLength(value, length) {\n    return String.IsMaxLength(value, length);\n}\n/** Returns true if the string has at least the given number of graphemes */\nexport function IsMinLength(value, length) {\n    return String.IsMinLength(value, length);\n}\n// --------------------------------------------------------------------------\n// Array\n// --------------------------------------------------------------------------\n/** Returns true if every element from offset satisfies the callback, short-circuiting on the first failure */\nexport function Every(value, offset, callback) {\n    return value.every((item, index) => (index < offset) || callback(item, index));\n}\n/** Returns true if every element from offset satisfies the callback, using exhaustive enumeration */\nexport function EveryAll(value, offset, callback) {\n    let result = true;\n    value.forEach((item, index) => { if ((index >= offset) && !callback(item, index))\n        result = false; });\n    return result;\n}\n/** Returns true if some element satisfies the callback, short-circuiting on the first success */\nexport function Some(value, callback) {\n    return value.some((value, index) => callback(value, index));\n}\n/** Returns true if some element satisfies the callback, using exhaustive enumeration */\nexport function SomeAll(value, callback) {\n    let result = false;\n    value.forEach((item, index) => { if (callback(item, index))\n        result = true; });\n    return result;\n}\n/** Returns the count of elements that satisfy the callback */\nexport function Counted(value, callback) {\n    return value.reduce((result, value, index) => callback(value, index) ? ++result : result, 0);\n}\n/** Shifts the left-most element from an array and dispatches to the true arm, or the false arm if empty */\nexport function ShiftLeft(array, true_, false_) {\n    return (IsEqual(array.length, 0) ? false_() : true_(array[0], array.slice(1)));\n}\n// --------------------------------------------------------------------------\n// Object\n// --------------------------------------------------------------------------\n/** Returns true if the PropertyKey is Unsafe (ref: prototype-pollution). */\nexport function IsUnsafePropertyKey(key) {\n    return IsEqual(key, '__proto__') || IsEqual(key, 'constructor') || IsEqual(key, 'prototype');\n}\n/** Returns true if this value has this property key */\nexport function HasPropertyKey(value, key) {\n    return IsUnsafePropertyKey(key) ? Object.prototype.hasOwnProperty.call(value, key) : key in value;\n}\n/** Returns object entries as `[RegExp, Value][]` */\nexport function EntriesRegExp(value) {\n    return Keys(value).map((key) => [new RegExp(`^${key}$`), value[key]]);\n}\n/** Returns object entries as `[string, Value][]` */\nexport function Entries(value) {\n    return Object.entries(value);\n}\n/** Returns property keys for this object via `Object.getOwnPropertyNames({ ... })` */\nexport function Keys(value) {\n    return Object.getOwnPropertyNames(value);\n}\n/** Returns the property keys for this object via `Object.getOwnPropertySymbols({ ... })` */\nexport function Symbols(value) {\n    return Object.getOwnPropertySymbols(value);\n}\n/** Returns the property values for the given object via `Object.values()` */\nexport function Values(value) {\n    return Object.values(value);\n}\n// ------------------------------------------------------------------\n// IsDeepEqual\n// ------------------------------------------------------------------\nfunction DeepEqualObject(left, right) {\n    if (!IsObject(right))\n        return false;\n    const keys = Keys(left);\n    return IsEqual(keys.length, Keys(right).length) &&\n        keys.every((key) => IsDeepEqual(left[key], right[key]));\n}\nfunction DeepEqualArray(left, right) {\n    return IsArray(right) && IsEqual(left.length, right.length) &&\n        left.every((_, index) => IsDeepEqual(left[index], right[index]));\n}\n/** Returns true if left and right values are structurally equal */\nexport function IsDeepEqual(left, right) {\n    return (IsArray(left) ? DeepEqualArray(left, right) :\n        IsObject(left) ? DeepEqualObject(left, right) :\n            IsEqual(left, right));\n}\n","import * as G from './guard.mjs';\n// ------------------------------------------------------------------\n// Identifier\n// ------------------------------------------------------------------\nconst identifierRegExp = /^[\\p{ID_Start}_$][\\p{ID_Continue}_$\\u200C\\u200D]*$/u;\n/** Returns true if this value is a valid JavaScript identifier */\nfunction IsIdentifier(value) {\n    return identifierRegExp.test(value);\n}\n// ------------------------------------------------------------------\n// Logical\n// ------------------------------------------------------------------\nexport function And(left, right) {\n    return `(${left} && ${right})`;\n}\nexport function Or(left, right) {\n    return `(${left} || ${right})`;\n}\nexport function Not(expr) {\n    return `!(${expr})`;\n}\n// --------------------------------------------------------------------------\n// Guards\n// --------------------------------------------------------------------------\n/** Returns true if this value is an array */\nexport function IsArray(value) {\n    return `Array.isArray(${value})`;\n}\n/** Returns true if this value is bigint */\nexport function IsBigInt(value) {\n    return `typeof ${value} === \"bigint\"`;\n}\n/** Returns true if this value is a boolean */\nexport function IsBoolean(value) {\n    return `typeof ${value} === \"boolean\"`;\n}\n/** Returns true if this value is integer */\nexport function IsInteger(value) {\n    return `Number.isInteger(${value})`;\n}\n/** Returns true if this value is null */\nexport function IsNull(value) {\n    return `${value} === null`;\n}\n/** Returns true if this value is number */\nexport function IsNumber(value) {\n    return `Number.isFinite(${value})`;\n}\n/** Returns true if this value is an object but not an array */\nexport function IsObjectNotArray(value) {\n    return And(IsObject(value), Not(IsArray(value)));\n}\n/** Returns true if this value is an object */\nexport function IsObject(value) {\n    return `typeof ${value} === \"object\" && ${value} !== null`;\n}\n/** Returns true if this value is string */\nexport function IsString(value) {\n    return `typeof ${value} === \"string\"`;\n}\n/** Returns true if this value is symbol */\nexport function IsSymbol(value) {\n    return `typeof ${value} === \"symbol\"`;\n}\n/** Returns true if this value is undefined */\nexport function IsUndefined(value) {\n    return `${value} === undefined`;\n}\n// ------------------------------------------------------------------\n// Functions and Constructors\n// ------------------------------------------------------------------\nexport function IsFunction(value) {\n    return `typeof ${value} === \"function\"`;\n}\nexport function IsConstructor(value) {\n    return `Guard.IsConstructor(${value})`;\n}\n// ------------------------------------------------------------------\n// Relational\n// ------------------------------------------------------------------\nexport function IsEqual(left, right) {\n    return `${left} === ${right}`;\n}\nexport function IsGreaterThan(left, right) {\n    return `${left} > ${right}`;\n}\nexport function IsLessThan(left, right) {\n    return `${left} < ${right}`;\n}\nexport function IsLessEqualThan(left, right) {\n    return `${left} <= ${right}`;\n}\nexport function IsGreaterEqualThan(left, right) {\n    return `${left} >= ${right}`;\n}\n// --------------------------------------------------------------------------\n// String\n// --------------------------------------------------------------------------\nexport function IsMinLength(value, length) {\n    return `Guard.IsMinLength(${value}, ${length})`;\n}\nexport function IsMaxLength(value, length) {\n    return `Guard.IsMaxLength(${value}, ${length})`;\n}\n// --------------------------------------------------------------------------\n// Array\n// --------------------------------------------------------------------------\nexport function Every(value, offset, params, expression) {\n    return G.IsEqual(offset, '0') ? `${value}.every((${params[0]}, ${params[1]}) => (${expression}))` : `${value}.every((${params[0]}, ${params[1]}) => (${params[1]} < ${offset}) || (${expression}))`;\n}\nexport function Some(value, params, expression) {\n    return `${value}.some((${params[0]}, ${params[1]}) => ${expression})`;\n}\nexport function SomeAll(value, params, expression) {\n    return `((value) => { let result = false; value.forEach((${params[0]}, ${params[1]}) => { if (${expression}) result = true }); return result })(${value})`;\n}\nexport function Counted(value, params, expression) {\n    return `${value}.reduce((result, ${params[0]}, ${params[1]}) => (${expression}) ? ++result : result, 0)`;\n}\n// --------------------------------------------------------------------------\n// Objects\n// --------------------------------------------------------------------------\nexport function Entries(value) {\n    return `Object.entries(${value})`;\n}\nexport function Keys(value) {\n    return `Object.getOwnPropertyNames(${value})`;\n}\nexport function HasPropertyKey(value, key) {\n    const isProtoField = G.IsEqual(key, '\"__proto__\"') || G.IsEqual(key, '\"constructor\"');\n    return isProtoField ? `Object.prototype.hasOwnProperty.call(${value}, ${key})` : `${key} in ${value}`;\n}\nexport function IsDeepEqual(left, right) {\n    return `Guard.IsDeepEqual(${left}, ${right})`;\n}\n// ------------------------------------------------------------------\n// Expressions\n// ------------------------------------------------------------------\nexport function ArrayLiteral(elements) {\n    return `[${elements.join(', ')}]`;\n}\nexport function ArrowFunction(parameters, body) {\n    return `((${parameters.join(', ')}) => ${body})`;\n}\nexport function Call(value, arguments_) {\n    return `${value}(${arguments_.join(', ')})`;\n}\nexport function New(value, arguments_) {\n    return `new ${value}(${arguments_.join(', ')})`;\n}\nexport function Member(left, right) {\n    return `${left}${IsIdentifier(right) ? `.${right}` : `[${Constant(right)}]`}`;\n}\nexport function Constant(value) {\n    if (!G.IsValueLike(value))\n        throw Error('Unsupported Constant');\n    return G.IsString(value) ? JSON.stringify(value) : `${value}`;\n}\nexport function Ternary(condition, true_, false_) {\n    return `(${condition} ? ${true_} : ${false_})`;\n}\n// ------------------------------------------------------------------\n// Statements\n// ------------------------------------------------------------------\nexport function Statements(statements) {\n    return `{ ${statements.join('; ')}; }`;\n}\nexport function ConstDeclaration(identifier, expression) {\n    return `const ${identifier} = ${expression}`;\n}\nexport function If(condition, then) {\n    return `if(${condition}) { ${then} }`;\n}\nexport function Return(expression) {\n    return `return ${expression}`;\n}\n// ------------------------------------------------------------------\n// Logical\n// ------------------------------------------------------------------\nexport function ReduceAnd(operands) {\n    return G.IsEqual(operands.length, 0) ? 'true' : operands.reduce((left, right) => And(left, right));\n}\nexport function ReduceOr(operands) {\n    return G.IsEqual(operands.length, 0) ? 'false' : operands.reduce((left, right) => Or(left, right));\n}\n// --------------------------------------------------------------------------\n// MultipleOf\n// --------------------------------------------------------------------------\nexport function MultipleOf(dividend, divisor) {\n    return `Guard.IsMultipleOf(${dividend}, ${divisor})`;\n}\n","// --------------------------------------------------------------------------\n// Primitives\n// --------------------------------------------------------------------------\nexport function IsBoolean(value) {\n    return value instanceof Boolean;\n}\nexport function IsNumber(value) {\n    return value instanceof Number;\n}\nexport function IsString(value) {\n    return value instanceof String;\n}\n// --------------------------------------------------------------------------\n// TypeArray\n// --------------------------------------------------------------------------\nexport function IsTypeArray(value) {\n    return globalThis.ArrayBuffer.isView(value);\n}\n/** Returns true if the value is a Int8Array */\nexport function IsInt8Array(value) {\n    return value instanceof globalThis.Int8Array;\n}\n/** Returns true if the value is a Uint8Array */\nexport function IsUint8Array(value) {\n    return value instanceof globalThis.Uint8Array;\n}\n/** Returns true if the value is a Uint8ClampedArray */\nexport function IsUint8ClampedArray(value) {\n    return value instanceof globalThis.Uint8ClampedArray;\n}\n/** Returns true if the value is a Int16Array */\nexport function IsInt16Array(value) {\n    return value instanceof globalThis.Int16Array;\n}\n/** Returns true if the value is a Uint16Array */\nexport function IsUint16Array(value) {\n    return value instanceof globalThis.Uint16Array;\n}\n/** Returns true if the value is a Int32Array */\nexport function IsInt32Array(value) {\n    return value instanceof globalThis.Int32Array;\n}\n/** Returns true if the value is a Uint32Array */\nexport function IsUint32Array(value) {\n    return value instanceof globalThis.Uint32Array;\n}\n/** Returns true if the value is a Float32Array */\nexport function IsFloat32Array(value) {\n    return value instanceof globalThis.Float32Array;\n}\n/** Returns true if the value is a Float64Array */\nexport function IsFloat64Array(value) {\n    return value instanceof globalThis.Float64Array;\n}\n/** Returns true if the value is a BigInt64Array */\nexport function IsBigInt64Array(value) {\n    return value instanceof globalThis.BigInt64Array;\n}\n/** Returns true if the value is a BigUint64Array */\nexport function IsBigUint64Array(value) {\n    return value instanceof globalThis.BigUint64Array;\n}\n// ------------------------------------------------------------------\n// RegExp\n// ------------------------------------------------------------------\n/** Returns true if the value is a RegExp */\nexport function IsRegExp(value) {\n    return value instanceof globalThis.RegExp;\n}\n// ------------------------------------------------------------------\n// Date\n// ------------------------------------------------------------------\n/** Returns true if the value is a Date */\nexport function IsDate(value) {\n    return value instanceof globalThis.Date;\n}\n// ------------------------------------------------------------------\n// Set\n// ------------------------------------------------------------------\n/** Returns true if the value is a Set */\nexport function IsSet(value) {\n    return value instanceof globalThis.Set;\n}\n// ------------------------------------------------------------------\n// Map\n// ------------------------------------------------------------------\n/** Returns true if the value is a Map */\nexport function IsMap(value) {\n    return value instanceof globalThis.Map;\n}\n","export * as EmitGuard from './emit.mjs';\nexport * as GlobalsGuard from './globals.mjs';\nexport * as NativeGuard from './native.mjs';\nimport * as Guard from './guard.mjs';\nexport * as Guard from './guard.mjs';\nexport default Guard;\n","import { Guard } from '../../guard/index.mjs';\n// Internal mutable state\nconst settings = {\n    immutableTypes: false,\n    maxErrors: 8,\n    maxInstantiationCount: 128,\n    useAcceleration: true,\n    exactOptionalPropertyTypes: false,\n    enumerableKind: false,\n    correctiveParse: false,\n    unionPrioritySort: true\n};\n/** Resets system settings to defaults */\nexport function Reset() {\n    settings.immutableTypes = false;\n    settings.maxErrors = 8;\n    settings.maxInstantiationCount = 128;\n    settings.useAcceleration = true;\n    settings.exactOptionalPropertyTypes = false;\n    settings.enumerableKind = false;\n    settings.correctiveParse = false;\n    settings.unionPrioritySort = true;\n}\n/** Sets system settings */\nexport function Set(options) {\n    for (const key of Guard.Keys(options)) {\n        const value = options[key];\n        if (value !== undefined) {\n            Object.defineProperty(settings, key, { value });\n        }\n    }\n}\n/** Gets current system settings */\nexport function Get() {\n    return settings;\n}\n","// deno-lint-ignore-file no-explicit-any\nimport { Settings } from '../settings/index.mjs';\n/** Conditionally freezes the value if `immutableTypes` is true, otherwise no action. */\nexport function Freeze(value) {\n    return Settings.Get().immutableTypes ? Object.freeze(value) : value;\n}\n","// deno-lint-ignore-file ban-types no-explicit-any\n// deno-fmt-ignore-file\nimport { Metrics } from './metrics.mjs';\nimport { Freeze } from './freeze.mjs';\n/**\n * Performs an Object assign using the Left and Right object types. We track this operation as it\n * creates a new GC handle per assignment.\n */\nexport function Assign(left, right) {\n    Metrics.assign += 1;\n    return Freeze({ ...left, ...right });\n}\n","// deno-fmt-ignore-file\nimport { Guard, GlobalsGuard } from '../../guard/index.mjs';\nimport { Metrics } from './metrics.mjs';\n// ------------------------------------------------------------------\n// ClassInstance\n//\n// TypeBox does not clone arbitrary class instances. Class instances\n// cannot be safely cloned without potentially breaking private\n// members of the instance.\n//\n// ------------------------------------------------------------------\nfunction FromClassInstance(value) {\n    return value; // atomic\n}\n// ------------------------------------------------------------------\n// SchemaObject\n//\n// Schema objects have non-enumerable properties that MUST be preserved \n// on Clone. The following is the optimal path these objects.\n// ------------------------------------------------------------------\nfunction IsSchemaObject(value) {\n    return (Guard.HasPropertyKey(value, '~kind') ||\n        Guard.HasPropertyKey(value, '~unsafe'));\n}\nfunction FromSchemaObject(value) {\n    const result = {};\n    for (const key of Guard.Keys(value)) {\n        if (Guard.IsUnsafePropertyKey(key))\n            continue; // (ignore: prototype-pollution)\n        const descriptor = Object.getOwnPropertyDescriptor(value, key); // safe-name!\n        descriptor.value = FromValue(descriptor.value);\n        if (Guard.IsEqual(descriptor.enumerable, true)) {\n            result[key] = descriptor.value;\n        }\n        else {\n            Object.defineProperty(result, key, descriptor);\n        }\n    }\n    return result;\n}\n// ------------------------------------------------------------------\n// PlainObject\n// ------------------------------------------------------------------\nfunction FromPlainObject(value) {\n    const result = {};\n    for (const key of Guard.Keys(value)) {\n        if (Guard.IsUnsafePropertyKey(key))\n            continue; // (ignore: prototype-pollution)\n        result[key] = FromValue(value[key]);\n    }\n    for (const key of Guard.Symbols(value)) {\n        result[key] = FromValue(value[key]);\n    }\n    return result;\n}\n// ------------------------------------------------------------------\n// Object\n// ------------------------------------------------------------------\nfunction FromObject(value) {\n    return (Guard.IsClassInstance(value) ? FromClassInstance(value) :\n        IsSchemaObject(value) ? FromSchemaObject(value) :\n            FromPlainObject(value));\n}\n// ------------------------------------------------------------------\n// Array\n// ------------------------------------------------------------------\nfunction FromArray(value) {\n    return value.map((element) => FromValue(element));\n}\n// ------------------------------------------------------------------\n// TypeArray\n// ------------------------------------------------------------------\nfunction FromTypedArray(value) {\n    return value.slice();\n}\n// ------------------------------------------------------------------\n// RegExp\n// ------------------------------------------------------------------\nfunction FromRegExp(value) {\n    return new RegExp(value.source, value.flags);\n}\n// ------------------------------------------------------------------\n// Map\n// ------------------------------------------------------------------\nfunction FromMap(value) {\n    return new Map(FromValue([...value.entries()]));\n}\n// ------------------------------------------------------------------\n// Set\n// ------------------------------------------------------------------\nfunction FromSet(value) {\n    return new Set(FromValue([...value.values()]));\n}\nfunction FromValue(value) {\n    return (GlobalsGuard.IsTypeArray(value) ? FromTypedArray(value) :\n        GlobalsGuard.IsRegExp(value) ? FromRegExp(value) :\n            GlobalsGuard.IsMap(value) ? FromMap(value) :\n                GlobalsGuard.IsSet(value) ? FromSet(value) :\n                    Guard.IsArray(value) ? FromArray(value) :\n                        Guard.IsObject(value) ? FromObject(value) :\n                            value);\n}\n// ------------------------------------------------------------------\n// Clone\n// ------------------------------------------------------------------\n/**\n * Returns a Clone of the given value. This function is similar to structuredClone()\n * but also supports deep cloning instances of Map, Set and TypeArray.\n */\nexport function Clone(value) {\n    Metrics.clone += 1;\n    return FromValue(value);\n}\n","// deno-lint-ignore-file no-explicit-any\nimport { Settings } from '../settings/index.mjs';\nimport { Metrics } from './metrics.mjs';\nimport { Freeze } from './freeze.mjs';\nfunction MergeHidden(left, right) {\n    for (const key of Object.keys(right)) {\n        Object.defineProperty(left, key, {\n            configurable: true,\n            writable: true,\n            enumerable: false,\n            value: right[key]\n        });\n    }\n    return left;\n}\nfunction Merge(left, right) {\n    return { ...left, ...right };\n}\n/**\n * Creates an object with hidden, enumerable, and optional property sets. This function\n * ensures types are instantiated according to configuration rules for enumerable and\n * non-enumerable properties.\n */\nexport function Create(hidden, enumerable, options = {}) {\n    Metrics.create += 1;\n    const withOptions = Merge(enumerable, options);\n    const withHidden = Settings.Get().enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);\n    return Freeze(withHidden);\n}\n","// deno-lint-ignore-file no-explicit-any\nimport { Guard } from '../../guard/index.mjs';\nimport { Metrics } from './metrics.mjs';\nimport { Freeze } from './freeze.mjs';\nimport { Clone } from './clone.mjs';\n/** Discards multiple property keys from the given object value */\nexport function Discard(value, propertyKeys) {\n    Metrics.discard += 1;\n    const result = {};\n    for (const key of Guard.Keys(value)) {\n        if (propertyKeys.includes(key))\n            continue;\n        const descriptor = Object.getOwnPropertyDescriptor(value, key); // safe-name!\n        descriptor.value = Clone(descriptor.value);\n        Object.defineProperty(result, key, descriptor);\n    }\n    return Freeze(result);\n}\n","// deno-lint-ignore-file no-explicit-any\nimport { Settings } from '../settings/index.mjs';\nimport { Metrics } from './metrics.mjs';\nimport { Freeze } from './freeze.mjs';\nimport { Clone } from './clone.mjs';\n/**\n * Updates a value with new properties while preserving property enumerability. Use this function to modify\n * existing types without altering their configuration.\n */\nexport function Update(current, hidden, enumerable) {\n    Metrics.update += 1;\n    const settings = Settings.Get();\n    const result = Clone(current);\n    // hidden\n    for (const key of Object.keys(hidden)) {\n        Object.defineProperty(result, key, {\n            configurable: true,\n            writable: true,\n            enumerable: settings.enumerableKind,\n            value: hidden[key]\n        });\n    }\n    // enumerable\n    for (const key of Object.keys(enumerable)) {\n        Object.defineProperty(result, key, {\n            configurable: true,\n            enumerable: true,\n            writable: true,\n            value: enumerable[key]\n        });\n    }\n    return Freeze(result);\n}\n","// deno-lint-ignore-file\n// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Kind\n// ------------------------------------------------------------------\nexport function IsKind(value, kind) {\n    return Guard.IsObject(value) && Guard.HasPropertyKey(value, '~kind') && Guard.IsEqual(value[\"~kind\"], kind);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\nexport function IsSchema(value) {\n    return Guard.IsObject(value);\n}\n","import { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Deferred action. */\nexport function Deferred(action, parameters, options) {\n    return Memory.Create({ '~kind': 'Deferred' }, { type: 'deferred', action, parameters, options }, {});\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TDeferred. */\nexport function IsDeferred(value) {\n    return IsKind(value, 'Deferred');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nfunction AddReadonlyOperation(type) {\n    return Memory.Update(type, { '~readonly': true }, {});\n}\nexport function AddReadonlyAction(type, options) {\n    const result = Memory.Update(AddReadonlyOperation(type), {}, options);\n    return result;\n}\nexport function AddReadonlyInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return AddReadonlyAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nfunction AddOptionalOperation(type) {\n    return Memory.Update(type, { '~optional': true }, {});\n}\nexport function AddOptionalAction(type, options) {\n    const result = Memory.Update(AddOptionalOperation(type), {}, options);\n    return result;\n}\nexport function AddOptionalInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return AddOptionalAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates an Array type. */\nexport function _Array_(items, options) {\n    return Memory.Create({ '~kind': 'Array' }, { type: 'array', items }, options);\n}\nexport { _Array_ as Array }; // Prevent Collision With Global Scope\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TArray. */\nexport function IsArray(value) {\n    return IsKind(value, 'Array');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TArray. */\nexport function ArrayOptions(type) {\n    return Memory.Discard(type, ['~kind', 'type', 'items']);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Constructor type. */\nexport function Constructor(parameters, instanceType, options = {}) {\n    return Memory.Create({ '~kind': 'Constructor' }, { type: 'constructor', parameters, instanceType }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TConstructor. */\nexport function IsConstructor(value) {\n    return IsKind(value, 'Constructor');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TConstructor. */\nexport function ConstructorOptions(type) {\n    return Memory.Discard(type, ['~kind', 'type', 'parameters', 'instanceType']);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Function type. */\nexport function _Function_(parameters, returnType, options = {}) {\n    return Memory.Create({ ['~kind']: 'Function' }, { type: 'function', parameters, returnType }, options);\n}\nexport { _Function_ as Function }; // Prevent Collision With Global Scope\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TFunction. */\nexport function IsFunction(value) {\n    return IsKind(value, 'Function');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TFunction. */\nexport function FunctionOptions(type) {\n    return Memory.Discard(type, ['~kind', 'type', 'parameters', 'returnType']);\n}\n","// deno-lint-ignore-file no-explicit-any\n// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Ref type. */\nexport function Ref(ref, options) {\n    return Memory.Create({ ['~kind']: 'Ref' }, { $ref: ref }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TRef. */\nexport function IsRef(value) {\n    return IsKind(value, 'Ref');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from '../types/schema.mjs';\n// ------------------------------------------------------------------\n// Type\n// ------------------------------------------------------------------\n/** Creates a Generic type. */\nexport function Generic(parameters, expression) {\n    return Memory.Create({ '~kind': 'Generic' }, { type: 'generic', parameters, expression });\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TGeneric. */\nexport function IsGeneric(value) {\n    return IsKind(value, 'Generic');\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file \nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Any type. */\nexport function Any(options) {\n    return Memory.Create({ ['~kind']: 'Any' }, {}, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TAny. */\nexport function IsAny(value) {\n    return IsKind(value, 'Any');\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Pattern\n// ------------------------------------------------------------------\nexport const NeverPattern = '(?!)';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Never type. */\nexport function Never(options) {\n    return Memory.Create({ '~kind': 'Never' }, { not: {} }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TNever. */\nexport function IsNever(value) {\n    return IsKind(value, 'Never');\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { AddOptionalAction } from '../engine/optional/instantiate_add.mjs';\n/** Creates a deferred AddOptional action. */\nexport function AddOptionalDeferred(type, options = {}) {\n    return Deferred('AddOptional', [type], options);\n}\n/** Applies an AddOptional action to a type. */\nexport function AddOptional(type, options = {}) {\n    return AddOptionalAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\nimport { AddOptional } from '../action/_add_optional.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Applies an Optional modifier to the given type. */\nexport function Optional(type) {\n    return AddOptional(type);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TOptional */\nexport function IsOptional(value) {\n    return IsSchema(value) && Guard.HasPropertyKey(value, '~optional');\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsOptional } from './_optional.mjs';\n/** Creates a RequiredArray derived from the given TProperties value. */\nexport function RequiredArray(properties) {\n    return Guard.Keys(properties).filter((key) => !IsOptional(properties[key]));\n}\n/** Extracts a tuple of keys from a TProperties value. */\nexport function PropertyKeys(properties) {\n    return Guard.Keys(properties);\n}\n/** Extracts a tuple of property values from a TProperties value. */\nexport function PropertyValues(properties) {\n    return Guard.Values(properties);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\nimport { RequiredArray } from './properties.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates an Object type. */\nexport function _Object_(properties, options = {}) {\n    const requiredKeys = RequiredArray(properties);\n    const required = requiredKeys.length > 0 ? { required: requiredKeys } : {};\n    return Memory.Create({ '~kind': 'Object' }, { type: 'object', ...required, properties }, options);\n}\nexport { _Object_ as Object }; // Prevent Collision With Global Scope\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TObject. */\nexport function IsObject(value) {\n    return IsKind(value, 'Object');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TObject. */\nexport function ObjectOptions(type) {\n    return Memory.Discard(type, ['~kind', 'type', 'properties', 'required']);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates an Unknown type. */\nexport function Unknown(options) {\n    return Memory.Create({ ['~kind']: 'Unknown' }, {}, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TUnknown. */\nexport function IsUnknown(value) {\n    return IsKind(value, 'Unknown');\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Cyclic type. */\nexport function Cyclic($defs, $ref, options) {\n    // $defs require an $id per definition to enable Ajv to resolve correctly\n    const defs = Guard.Keys($defs).reduce((result, key) => {\n        return { ...result, [key]: Memory.Update($defs[key], {}, { $id: key }) };\n    }, {});\n    return Memory.Create({ ['~kind']: 'Cyclic' }, { $defs: defs, $ref }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TCyclic. */\nexport function IsCyclic(value) {\n    return IsKind(value, 'Cyclic');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TCyclic. */\nexport function CyclicOptions(type) {\n    return Memory.Discard(type, ['~kind', '$defs', '$ref']);\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file \nimport { Guard } from '../../guard/index.mjs';\nimport { Memory } from '../../system/memory/index.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Unsafe type. */\nexport function Unsafe(schema) {\n    return Memory.Update(schema, { ['~unsafe']: null }, {});\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TUnsafe. */\nexport function IsUnsafe(value) {\n    return Guard.IsObjectNotArray(value)\n        && Guard.HasPropertyKey(value, '~unsafe')\n        && Guard.IsNull(value['~unsafe']);\n}\n","/**\n * Match arguments for overloaded functions that use the `...args: unknown[]` pattern. Arguments\n * are parsed using argument length only.\n */\nexport function Match(args, match) {\n    return (match[args.length]?.(...args) ?? (() => {\n        throw Error('Invalid Arguments');\n    })());\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from '../types/schema.mjs';\nimport { Unknown } from '../types/unknown.mjs';\n/** Creates an Infer instruction. */\nexport function Infer(...args) {\n    const [name, extends_] = Arguments.Match(args, {\n        2: (name, extends_) => [name, extends_, extends_],\n        1: (name) => [name, Unknown(), Unknown()],\n    });\n    return Memory.Create({ ['~kind']: 'Infer' }, { type: 'infer', name, extends: extends_ }, {});\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TInfer. */\nexport function IsInfer(value) {\n    return IsKind(value, 'Infer');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Dependent type */\nexport function Dependent(if_, then_, else_, options = {}) {\n    return Memory.Create({ '~kind': 'Dependent' }, { if: if_, then: then_, else: else_ }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TDependent. */\nexport function IsDependent(value) {\n    return IsKind(value, 'Dependent');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a IsDependent. */\nexport function DependentOptions(type) {\n    return Memory.Discard(type, ['~kind', 'if', 'then', 'else']);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nexport function IsTypeScriptEnumLike(value) {\n    return Guard.IsObjectNotArray(value);\n}\nexport function TypeScriptEnumToEnumValues(type) {\n    const keys = Guard.Keys(type).filter((key) => isNaN(key));\n    return keys.reduce((result, key) => [...result, type[key]], []);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\nimport { IsTypeScriptEnumLike } from '../engine/enum/typescript_enum_to_enum_values.mjs';\nimport { TypeScriptEnumToEnumValues } from '../engine/enum/typescript_enum_to_enum_values.mjs';\n/** Returns true if the given value is a EnumValue */\nexport function IsEnumValue(value) {\n    return Guard.IsString(value) || Guard.IsNumber(value);\n}\n/** Creates an Enum type. */\nexport function Enum(value, options) {\n    const values = IsTypeScriptEnumLike(value) ? TypeScriptEnumToEnumValues(value) : value;\n    return Memory.Create({ '~kind': 'Enum' }, { enum: values }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TEnum. */\nexport function IsEnum(value) {\n    return IsKind(value, 'Enum');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Intersect type. */\nexport function Intersect(types, options = {}) {\n    return Memory.Create({ '~kind': 'Intersect' }, { allOf: types }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TIntersect. */\nexport function IsIntersect(value) {\n    return IsKind(value, 'Intersect');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TIntersect. */\nexport function IntersectOptions(type) {\n    return Memory.Discard(type, ['~kind', 'allOf']);\n}\n","import { Settings } from '../settings/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nlet supported = undefined;\n// ------------------------------------------------------------------\n// TryEvaluate\n// ------------------------------------------------------------------\nfunction TryEvaluate() {\n    try {\n        Evaluate('null')();\n        return true;\n    } // deno-coverage-ignore-start - unreachable in test-suite\n    catch {\n        return false;\n    }\n    // deno-coverage-ignore-stop\n}\n// ------------------------------------------------------------------\n// CanEvaluate\n// ------------------------------------------------------------------\n/** Returns true if the environment supports dynamic JavaScript evaluation */\nexport function CanEvaluate() {\n    if (Guard.IsUndefined(supported))\n        supported = TryEvaluate();\n    return supported && Settings.Get().useAcceleration;\n}\n// ------------------------------------------------------------------\n// Evaluate\n// ------------------------------------------------------------------\n/**\n * Evaluates code in the current environment. This function will throw if the\n * environment Content-Security-Policy does not support `unsafe-eval`. Use the\n * Environment.CanEvaluate() to determine if the environment supports Evaluate\n * before calling this function.\n */\nexport function Evaluate(...args) {\n    return new (globalThis.Function)(...args);\n}\n","// deno-coverage-ignore-start - unreachable by definition\n/** Used for unreachable logic */\nexport function Unreachable() {\n    throw new Error('Unreachable');\n}\n// deno-coverage-ignore-stop\n","// deno-fmt-ignore-file\nimport { Unreachable } from '../unreachable/index.mjs';\nimport { Guard, GlobalsGuard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// InstanceKeys\n//\n// Retrieves all enumerable and non-enumerable own property keys \n// and inherited prototype keys (excluding symbols and the 'constructor') \n// from an object instance.\n//\n// This function is useful for differentiating between class instances \n// based on their structural keys rather than relying on the \n// constructor name. It provides a more reliable structural comparison \n// by capturing both own and prototype properties.\n//\n// ------------------------------------------------------------------\nfunction InstanceKeys(value) {\n    const propertyKeys = new Set();\n    let current = value;\n    while (current && current !== Object.prototype) {\n        for (const key of Reflect.ownKeys(current)) {\n            if (key !== 'constructor' && typeof key !== 'symbol')\n                propertyKeys.add(key);\n        }\n        current = Object.getPrototypeOf(current);\n    }\n    return [...propertyKeys];\n}\n// ------------------------------------------------------------------\n// IsIEEE754\n//\n// TypeBox guards do not consider +/- Infinity or NaN as valid\n// numbers, but they are valid IEEE754 numbers. We use a special\n// guard to ensure these numbers are considered for hashing.\n//\n// ------------------------------------------------------------------\nfunction IsIEEE754(value) {\n    return typeof value === 'number';\n}\n// ------------------------------------------------------------------\n// ByteMarker\n// ------------------------------------------------------------------\nvar ByteMarker;\n(function (ByteMarker) {\n    ByteMarker[ByteMarker[\"Array\"] = 0] = \"Array\";\n    ByteMarker[ByteMarker[\"BigInt\"] = 1] = \"BigInt\";\n    ByteMarker[ByteMarker[\"Boolean\"] = 2] = \"Boolean\";\n    ByteMarker[ByteMarker[\"Date\"] = 3] = \"Date\";\n    ByteMarker[ByteMarker[\"Constructor\"] = 4] = \"Constructor\";\n    ByteMarker[ByteMarker[\"Function\"] = 5] = \"Function\";\n    ByteMarker[ByteMarker[\"Null\"] = 6] = \"Null\";\n    ByteMarker[ByteMarker[\"Number\"] = 7] = \"Number\";\n    ByteMarker[ByteMarker[\"Object\"] = 8] = \"Object\";\n    ByteMarker[ByteMarker[\"RegExp\"] = 9] = \"RegExp\";\n    ByteMarker[ByteMarker[\"String\"] = 10] = \"String\";\n    ByteMarker[ByteMarker[\"Symbol\"] = 11] = \"Symbol\";\n    ByteMarker[ByteMarker[\"TypeArray\"] = 12] = \"TypeArray\";\n    ByteMarker[ByteMarker[\"Undefined\"] = 13] = \"Undefined\";\n})(ByteMarker || (ByteMarker = {}));\n// ------------------------------------------------------------------\n// State\n// ------------------------------------------------------------------\nlet Accumulator = BigInt('14695981039346656037');\nconst [Prime, Size] = [BigInt('1099511628211'), BigInt('18446744073709551616' /* 2 ^ 64 */)];\nconst Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));\nconst F64 = new Float64Array(1);\nconst F64In = new DataView(F64.buffer);\nconst F64Out = new Uint8Array(F64.buffer);\n// ------------------------------------------------------------------\n// Operation\n// ------------------------------------------------------------------\nfunction FNV1A64_OP(byte) {\n    Accumulator = Accumulator ^ Bytes[byte];\n    Accumulator = (Accumulator * Prime) % Size;\n}\n// ------------------------------------------------------------------\n// Array\n// ------------------------------------------------------------------\nfunction FromArray(value) {\n    FNV1A64_OP(ByteMarker.Array);\n    for (const item of value) {\n        FromValue(item);\n    }\n}\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\nfunction FromBigInt(value) {\n    FNV1A64_OP(ByteMarker.BigInt);\n    F64In.setBigInt64(0, value);\n    for (const byte of F64Out) {\n        FNV1A64_OP(byte);\n    }\n}\n// ------------------------------------------------------------------\n// Boolean\n// ------------------------------------------------------------------\nfunction FromBoolean(value) {\n    FNV1A64_OP(ByteMarker.Boolean);\n    FNV1A64_OP(value ? 1 : 0);\n}\n// ------------------------------------------------------------------\n// Constructor\n// ------------------------------------------------------------------\nfunction FromConstructor(value) {\n    FNV1A64_OP(ByteMarker.Constructor);\n    FromValue(value.toString());\n}\n// ------------------------------------------------------------------\n// Date\n// ------------------------------------------------------------------\nfunction FromDate(value) {\n    FNV1A64_OP(ByteMarker.Date);\n    FromValue(value.getTime());\n}\n// ------------------------------------------------------------------\n// Function\n// ------------------------------------------------------------------\nfunction FromFunction(value) {\n    FNV1A64_OP(ByteMarker.Function);\n    FromValue(value.toString());\n}\n// ------------------------------------------------------------------\n// Null\n// ------------------------------------------------------------------\nfunction FromNull(_value) {\n    FNV1A64_OP(ByteMarker.Null);\n}\n// ------------------------------------------------------------------\n// Number | IEEE754\n// ------------------------------------------------------------------\nfunction FromNumber(value) {\n    FNV1A64_OP(ByteMarker.Number);\n    F64In.setFloat64(0, value, true /* little-endian */);\n    for (const byte of F64Out) {\n        FNV1A64_OP(byte);\n    }\n}\n// ------------------------------------------------------------------\n// Object\n// ------------------------------------------------------------------\nfunction FromObject(value) {\n    FNV1A64_OP(ByteMarker.Object);\n    for (const key of InstanceKeys(value).sort()) {\n        FromValue(key);\n        FromValue(value[key]);\n    }\n}\n// ------------------------------------------------------------------\n// RegExp\n// ------------------------------------------------------------------\nfunction FromRegExp(value) {\n    FNV1A64_OP(ByteMarker.RegExp);\n    FromString(value.toString());\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\nconst encoder = new TextEncoder();\nfunction FromString(value) {\n    FNV1A64_OP(ByteMarker.String);\n    for (const byte of encoder.encode(value)) {\n        FNV1A64_OP(byte);\n    }\n}\n// ------------------------------------------------------------------\n// Symbol\n// ------------------------------------------------------------------\nfunction FromSymbol(value) {\n    FNV1A64_OP(ByteMarker.Symbol);\n    FromValue(value.toString());\n}\n// ------------------------------------------------------------------\n// TypeArray\n// ------------------------------------------------------------------\nfunction FromTypeArray(value) {\n    FNV1A64_OP(ByteMarker.TypeArray);\n    const buffer = new Uint8Array(value.buffer);\n    for (let i = 0; i < buffer.length; i++) {\n        FNV1A64_OP(buffer[i]);\n    }\n}\n// ------------------------------------------------------------------\n// Undefined\n// ------------------------------------------------------------------\nfunction FromUndefined(_value) {\n    return FNV1A64_OP(ByteMarker.Undefined);\n}\n// ------------------------------------------------------------------\n// Hash\n//\n// deno-coverage-ignore-start - unreachable\n//\n// This function should all JavaScript values so we can't reach the\n// fall-through. We use Unreachable to assert that no values pass\n// through. We will need to handle these should they arise.\n//\n// ------------------------------------------------------------------\nfunction FromValue(value) {\n    return (GlobalsGuard.IsTypeArray(value) ? FromTypeArray(value) :\n        GlobalsGuard.IsDate(value) ? FromDate(value) :\n            GlobalsGuard.IsRegExp(value) ? FromRegExp(value) :\n                GlobalsGuard.IsBoolean(value) ? FromBoolean(value.valueOf()) :\n                    GlobalsGuard.IsString(value) ? FromString(value.valueOf()) :\n                        GlobalsGuard.IsNumber(value) ? FromNumber(value.valueOf()) :\n                            IsIEEE754(value) ? FromNumber(value) :\n                                Guard.IsArray(value) ? FromArray(value) :\n                                    Guard.IsBoolean(value) ? FromBoolean(value) :\n                                        Guard.IsBigInt(value) ? FromBigInt(value) :\n                                            Guard.IsConstructor(value) ? FromConstructor(value) :\n                                                Guard.IsNull(value) ? FromNull(value) :\n                                                    Guard.IsObject(value) ? FromObject(value) :\n                                                        Guard.IsString(value) ? FromString(value) :\n                                                            Guard.IsSymbol(value) ? FromSymbol(value) :\n                                                                Guard.IsUndefined(value) ? FromUndefined(value) :\n                                                                    Guard.IsFunction(value) ? FromFunction(value) :\n                                                                        Unreachable());\n}\n// deno-coverage-ignore-stop\n// ------------------------------------------------------------------\n// Hash\n// ------------------------------------------------------------------\n/** Generates a FNV1A-64 non cryptographic hash of the given value */\nexport function HashCode(value) {\n    Accumulator = BigInt('14695981039346656037');\n    FromValue(value);\n    return Accumulator;\n}\n/** Generates a FNV1A-64 non cryptographic hash of the given value */\nexport function Hash(value) {\n    return HashCode(value).toString(16).padStart(16, '0');\n}\n","// deno-fmt-ignore-file\n/** en_US: English (United States) - ISO 639-1 language code 'en' with ISO 3166-1 alpha-2 country code 'US' for United States. */\nexport function en_US(error) {\n    switch (error.keyword) {\n        case 'additionalProperties': return 'must not have additional properties';\n        case 'anyOf': return 'must match a schema in anyOf';\n        case 'boolean': return 'schema is false';\n        case 'const': return 'must be equal to constant';\n        case 'contains': return 'must contain at least 1 valid item';\n        case 'dependencies': return `must have properties ${error.params.dependencies.join(', ')} when property ${error.params.property} is present`;\n        case 'dependentRequired': return `must have properties ${error.params.dependencies.join(', ')} when property ${error.params.property} is present`;\n        case 'enum': return 'must be equal to one of the allowed values';\n        case 'exclusiveMaximum': return `must be ${error.params.comparison} ${error.params.limit}`;\n        case 'exclusiveMinimum': return `must be ${error.params.comparison} ${error.params.limit}`;\n        case 'format': return `must match format \"${error.params.format}\"`;\n        case 'if': return `must match \"${error.params.failingKeyword}\" schema`;\n        case 'maxItems': return `must not have more than ${error.params.limit} items`;\n        case 'maxLength': return `must not have more than ${error.params.limit} characters`;\n        case 'maxProperties': return `must not have more than ${error.params.limit} properties`;\n        case 'maximum': return `must be ${error.params.comparison} ${error.params.limit}`;\n        case 'minItems': return `must not have fewer than ${error.params.limit} items`;\n        case 'minLength': return `must not have fewer than ${error.params.limit} characters`;\n        case 'minProperties': return `must not have fewer than ${error.params.limit} properties`;\n        case 'minimum': return `must be ${error.params.comparison} ${error.params.limit}`;\n        case 'multipleOf': return `must be multiple of ${error.params.multipleOf}`;\n        case 'not': return 'must not be valid';\n        case 'oneOf': return 'must match exactly one schema in oneOf';\n        case 'pattern': return `must match pattern \"${error.params.pattern}\"`;\n        case 'propertyNames': return `property names ${error.params.propertyNames.join(', ')} are invalid`;\n        case 'required': return `must have required properties ${error.params.requiredProperties.join(', ')}`;\n        case 'type': return typeof error.params.type === 'string' ? `must be ${error.params.type}` : `must be either ${error.params.type.join(' or ')}`;\n        case 'unevaluatedItems': return 'must not have unevaluated items';\n        case 'unevaluatedProperties': return 'must not have unevaluated properties';\n        case 'uniqueItems': return `must not have duplicate items`;\n        case '~refine': return error.params.message;\n        // deno-coverage-ignore - unreachable\n        default: return 'an unknown validation error occurred';\n    }\n}\n","// deno-fmt-ignore-file\nimport { en_US } from './en_US.mjs';\nlet locale = en_US;\n/** Sets the locale */\nexport function Set(callback) {\n    locale = callback;\n}\n/** Gets the locale */\nexport function Get() {\n    return locale;\n}\n/** Resets the locale to `en_US` */\nexport function Reset() {\n    Set(en_US);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\nexport class EncodeBuilder {\n    constructor(type, decode) {\n        this.type = type;\n        this.decode = decode;\n    }\n    Encode(callback) {\n        const type = this.type;\n        const decode = IsCodec(type) ? (value) => this.decode(type['~codec'].decode(value)) : this.decode;\n        const encode = IsCodec(type) ? (value) => type['~codec'].encode(callback(value)) : callback;\n        const codec = { decode, encode };\n        return Memory.Update(this.type, { '~codec': codec }, {});\n    }\n}\nexport class DecodeBuilder {\n    constructor(type) {\n        this.type = type;\n    }\n    Decode(callback) {\n        return new EncodeBuilder(this.type, callback);\n    }\n}\n// ------------------------------------------------------------------\n// Bidirectional\n// ------------------------------------------------------------------\n/** Creates a bi-directional Codec. Codec functions are called on Value.Decode and Value.Encode. */\nexport function Codec(type) {\n    return new DecodeBuilder(type);\n}\n// ------------------------------------------------------------------\n// Unidirectional\n// ------------------------------------------------------------------\n/** Createsa  uni-directional Codec with Decode only. The Decode function is called on Value.Decode */\nexport function Decode(type, callback) {\n    return Codec(type).Decode(callback).Encode(() => {\n        throw Error('Encode not implemented');\n    });\n}\n/** Creates a uni-directional Codec with Encode only. The Encode function is called on Value.Encode */\nexport function Encode(type, callback) {\n    return Codec(type).Decode(() => {\n        throw Error('Decode not implemented');\n    }).Encode(callback);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\nexport function IsCodec(value) {\n    return IsSchema(value) &&\n        Guard.HasPropertyKey(value, '~codec') &&\n        Guard.IsObject(value['~codec']) &&\n        Guard.HasPropertyKey(value['~codec'], 'encode') &&\n        Guard.HasPropertyKey(value['~codec'], 'decode');\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\nimport { AddImmutable } from '../action/_add_immutable.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Applies an Immutable modifier to the given type. */\nexport function Immutable(type) {\n    return AddImmutable(type);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TImmutable */\nexport function IsImmutable(value) {\n    return IsSchema(value) && Guard.HasPropertyKey(value, '~immutable');\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { AddReadonlyAction } from '../engine/readonly/instantiate_add.mjs';\n/** Creates a deferred AddReadonly action. */\nexport function AddReadonlyDeferred(type, options = {}) {\n    return Deferred('AddReadonly', [type], options);\n}\n/** Applies an AddReadonly action to a type. */\nexport function AddReadonly(type, options = {}) {\n    return AddReadonlyAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\nimport { AddReadonly } from '../action/_add_readonly.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Applies an Readonly property modifier to the given type. */\nexport function Readonly(type) {\n    return AddReadonly(type);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TReadonly */\nexport function IsReadonly(value) {\n    return IsSchema(value) && Guard.HasPropertyKey(value, '~readonly');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Pattern\n// ------------------------------------------------------------------\nexport const BigIntPattern = '-?(?:0|[1-9][0-9]*)n';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a BigInt type. */\nexport function BigInt(options) {\n    return Memory.Create({ '~kind': 'BigInt' }, { type: 'bigint' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TBigInt. */\nexport function IsBigInt(value) {\n    return IsKind(value, 'BigInt');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Boolean type. */\nexport function Boolean(options) {\n    return Memory.Create({ '~kind': 'Boolean' }, { type: 'boolean' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TBoolean. */\nexport function IsBoolean(value) {\n    return IsKind(value, 'Boolean');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Pattern\n// ------------------------------------------------------------------\nexport const IntegerPattern = '-?(?:0|[1-9][0-9]*)';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Integer type. */\nexport function Integer(options) {\n    return Memory.Create({ '~kind': 'Integer' }, { type: 'integer' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TInteger. */\nexport function IsInteger(value) {\n    return IsKind(value, 'Integer');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// InvalidLiteralValue\n// ------------------------------------------------------------------\nexport class InvalidLiteralValue extends Error {\n    constructor(value) {\n        super(`Invalid Literal value`);\n        Object.defineProperty(this, 'cause', {\n            value: { value },\n            writable: false,\n            configurable: false,\n            enumerable: false\n        });\n    }\n}\nexport function LiteralTypeName(value) {\n    return (Guard.IsBigInt(value) ? 'bigint' :\n        Guard.IsBoolean(value) ? 'boolean' :\n            Guard.IsNumber(value) ? 'number' :\n                Guard.IsString(value) ? 'string' :\n                    (() => { throw new InvalidLiteralValue(value); })());\n}\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Literal type. */\nexport function Literal(value, options) {\n    return Memory.Create({ '~kind': 'Literal' }, { type: LiteralTypeName(value), const: value }, options);\n}\n// ------------------------------------------------------------------\n// Guards\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TLiteralValue. */\nexport function IsLiteralValue(value) {\n    return Guard.IsBigInt(value)\n        || Guard.IsBoolean(value)\n        || Guard.IsNumber(value)\n        || Guard.IsString(value);\n}\n/** Returns true if the given value is TLiteral<bigint>. */\nexport function IsLiteralBigInt(value) {\n    return IsLiteral(value) && Guard.IsBigInt(value.const);\n}\n/** Returns true if the given value is TLiteral<boolean>. */\nexport function IsLiteralBoolean(value) {\n    return IsLiteral(value) && Guard.IsBoolean(value.const);\n}\n/** Returns true if the given value is TLiteral<number>. */\nexport function IsLiteralNumber(value) {\n    return IsLiteral(value) && Guard.IsNumber(value.const);\n}\n/** Returns true if the given value is TLiteral<string>. */\nexport function IsLiteralString(value) {\n    return IsLiteral(value) && Guard.IsString(value.const);\n}\n/** Returns true if the given value is TLiteral. */\nexport function IsLiteral(value) {\n    return IsKind(value, 'Literal');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Null type. */\nexport function Null(options) {\n    return Memory.Create({ '~kind': 'Null' }, { type: 'null' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TNull. */\nexport function IsNull(value) {\n    return IsKind(value, 'Null');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Pattern\n// ------------------------------------------------------------------\nexport const NumberPattern = '-?(?:0|[1-9][0-9]*)(?:\\\\.[0-9]+)?';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Number type. */\nexport function Number(options) {\n    return Memory.Create({ '~kind': 'Number' }, { type: 'number' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TNumber. */\nexport function IsNumber(value) {\n    return IsKind(value, 'Number');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Symbol type. */\nexport function Symbol(options) {\n    return Memory.Create({ '~kind': 'Symbol' }, { type: 'symbol' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TSymbol. */\nexport function IsSymbol(value) {\n    return IsKind(value, 'Symbol');\n}\n","// deno-lint-ignore-file\n// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// StringPattern\n// ------------------------------------------------------------------\nexport const StringPattern = '.*';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a String type. */\nexport function String(options) {\n    return Memory.Create({ '~kind': 'String' }, { type: 'string' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TString. */\nexport function IsString(value) {\n    return IsKind(value, 'String');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Union type. */\nexport function Union(anyOf, options = {}) {\n    return Memory.Create({ '~kind': 'Union' }, { anyOf }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TUnion. */\nexport function IsUnion(value) {\n    return IsKind(value, 'Union');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TUnion. */\nexport function UnionOptions(type) {\n    return Memory.Discard(type, ['~kind', 'anyOf']);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Pattern } from '../../script/parser.mjs';\n/** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */\nexport function ParsePatternIntoTypes(pattern) {\n    const parsed = Pattern(pattern);\n    const result = Guard.IsEqual(parsed.length, 2)\n        ? parsed[0]\n        : []; // Failed to Parse\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsLiteral } from '../../types/literal.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nfunction FromLiteral(_value) {\n    return true;\n}\nfunction FromTypesReduce(types) {\n    return Guard.ShiftLeft(types, (left, right) => FromType(left)\n        ? FromTypesReduce(right)\n        : false, () => true);\n}\nfunction FromTypes(types) {\n    const result = Guard.IsEqual(types.length, 0) ? false : FromTypesReduce(types);\n    return result;\n}\nfunction FromType(type) {\n    return (IsUnion(type) ? FromTypes(type.anyOf) :\n        IsLiteral(type) ? FromLiteral(type.const) :\n            false);\n}\n/** Returns true if the given TemplateLiteral types yields a finite variant set */\nexport function IsTemplateLiteralFinite(types) {\n    const result = FromTypes(types);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nexport function TemplateLiteralCreate(pattern) {\n    return Memory.Create({ ['~kind']: 'TemplateLiteral' }, { type: 'string', pattern }, {});\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Unreachable } from '../../../system/unreachable/index.mjs';\nimport { Literal, IsLiteral } from '../../types/literal.mjs';\nimport { String } from '../../types/string.mjs';\nimport { IsTemplateLiteral } from '../../types/template_literal.mjs';\nimport { Union, IsUnion } from '../../types/union.mjs';\nimport { ParsePatternIntoTypes } from '../patterns/pattern.mjs';\nimport { IsTemplateLiteralFinite } from './is_finite.mjs';\nimport { TemplateLiteralCreate } from './create.mjs';\nfunction FromLiteralPush(variants, value, result = []) {\n    return Guard.ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...result, `${left}${value}`]), () => result);\n}\nfunction FromLiteral(variants, value) {\n    return (Guard.IsEqual(variants.length, 0) ? [`${value}`] : FromLiteralPush(variants, value));\n}\nfunction FromUnion(variants, types, result = []) {\n    return Guard.ShiftLeft(types, (left, right) => FromUnion(variants, right, [...result, ...FromType(variants, left)]), () => result);\n}\n// ------------------------------------------------------------------\n// deno-coverage-ignore-start - symmetric unreachable | internal\n// \n// Parsed TemplateLiteral patterns only yield Literal or Union but\n// we keep the fall-through to assert that no other types can reach \n// here without error.\n//\n// ------------------------------------------------------------------\nfunction FromType(variants, type) {\n    const result = (IsUnion(type) ? FromUnion(variants, type.anyOf) :\n        IsLiteral(type) ? FromLiteral(variants, type.const) :\n            Unreachable() // []\n    );\n    return result;\n}\nfunction DecodeFromSpan(variants, types) {\n    return Guard.ShiftLeft(types, (left, right) => DecodeFromSpan(FromType(variants, left), right), () => variants);\n}\nfunction VariantsToLiterals(variants) {\n    return variants.map(variant => Literal(variant));\n}\nfunction DecodeTypesAsUnion(types) {\n    const variants = DecodeFromSpan([], types);\n    const literals = VariantsToLiterals(variants);\n    const result = Union(literals);\n    return result;\n}\n// ------------------------------------------------------------------\n// deno-coverage-ignore-start - internal\n// \n// Cannot invoke the 0-length condition as the TemplateLiteral \n// parsers always return at least 1 TLiteral or TUnion. We would \n// return a empty string TLiteral for this case, but will use \n// Unreachable to catch parse inputs that trigger 0-length.\n//\n// ------------------------------------------------------------------\nfunction DecodeTypes(types) {\n    return (Guard.IsEqual(types.length, 0) ? Unreachable() : // Literal('') :\n        Guard.IsEqual(types.length, 1) && IsLiteral(types[0]) ? types[0] :\n            DecodeTypesAsUnion(types));\n}\n/**\n * (Internal) Decodes a TemplateLiteral pattern into a Type. This function is unsafe. Decoding a non-finite\n * TemplateLiteral pattern may produce another TemplateLiteral pattern. During enumeration, this\n * TemplateLiteral -> TemplateLiteral behavior can cause a StackOverflow. A better in-flight template-literal\n * decoding algorithm is needed. (for review)\n */\nexport function TemplateLiteralDecodeUnsafe(pattern) {\n    const types = ParsePatternIntoTypes(pattern);\n    const result = Guard.IsEqual(types.length, 0) // Failed to Parse | IsTemplateLiteralPattern\n        ? String() // ... Pattern cannot be typed, so discard\n        : IsTemplateLiteralFinite(types)\n            ? DecodeTypes(types)\n            : TemplateLiteralCreate(pattern);\n    return result;\n}\n/** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */\nexport function TemplateLiteralDecode(pattern) {\n    const decoded = TemplateLiteralDecodeUnsafe(pattern);\n    const result = IsTemplateLiteral(decoded) ? String() : decoded;\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nexport function CreateRecord(key, value) {\n    const type = 'object';\n    const patternProperties = { [key]: value };\n    return Memory.Create({ ['~kind']: 'Record' }, { type, patternProperties });\n}\n","// deno-fmt-ignore-file\nimport { StringKey } from '../../types/record.mjs';\nimport { CreateRecord } from './record_create.mjs';\nexport function FromAnyKey(value) {\n    return CreateRecord(StringKey, value);\n}\n","// deno-fmt-ignore-file\nimport { Object } from '../../types/object.mjs';\nexport function FromBooleanKey(value) {\n    return Object({ true: value, false: value });\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Tuple type. */\nexport function Tuple(types, options = {}) {\n    const [items, minItems, additionalItems] = [types, types.length, false];\n    return Memory.Create({ ['~kind']: 'Tuple' }, { type: 'array', additionalItems, items, minItems }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TTuple. */\nexport function IsTuple(value) {\n    return IsKind(value, 'Tuple');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TTuple. */\nexport function TupleOptions(type) {\n    return Memory.Discard(type, ['~kind', 'type', 'items', 'minItems', 'additionalItems']);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nfunction RemoveReadonlyOperation(type) {\n    return Memory.Discard(type, ['~readonly']);\n}\nexport function RemoveReadonlyAction(type, options) {\n    const result = Memory.Update(RemoveReadonlyOperation(type), {}, options);\n    return result;\n}\nexport function RemoveReadonlyInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return RemoveReadonlyAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { RemoveReadonlyAction } from '../engine/readonly/instantiate_remove.mjs';\n/** Creates a deferred RemoveReadonly action. */\nexport function RemoveReadonlyDeferred(type, options = {}) {\n    return Deferred('RemoveReadonly', [type], options);\n}\n/** Applies an RemoveReadonly action to a type. */\nexport function RemoveReadonly(type, options = {}) {\n    return RemoveReadonlyAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nfunction RemoveOptionalOperation(type) {\n    return Memory.Discard(type, ['~optional']);\n}\nexport function RemoveOptionalAction(type, options) {\n    const result = Memory.Update(RemoveOptionalOperation(type), {}, options);\n    return result;\n}\nexport function RemoveOptionalInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return RemoveOptionalAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { RemoveOptionalAction } from '../engine/optional/instantiate_remove.mjs';\n/** Creates a deferred RemoveOptional action. */\nexport function RemoveOptionalDeferred(type, options = {}) {\n    return Deferred('RemoveOptional', [type], options);\n}\n/** Applies an RemoveOptional action to a type. */\nexport function RemoveOptional(type, options = {}) {\n    return RemoveOptionalAction(type, options);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Object } from '../../types/object.mjs';\nexport function TupleElementsToProperties(types) {\n    const result = types.reduceRight((result, right, index) => {\n        return { [index]: right, ...result };\n    }, {});\n    return result;\n}\nexport function TupleToObject(type) {\n    const properties = TupleElementsToProperties(type.items);\n    const result = Object(properties);\n    return result;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsReadonly } from '../../types/_readonly.mjs';\nimport { IsOptional } from '../../types/_optional.mjs';\nimport { Object, IsObject } from '../../types/object.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { IsTuple } from '../../types/tuple.mjs';\nimport { AddReadonly } from '../../action/_add_readonly.mjs';\nimport { AddOptional } from '../../action/_add_optional.mjs';\nimport { RemoveReadonly } from '../../action/_remove_readonly.mjs';\nimport { RemoveOptional } from '../../action/_remove_optional.mjs';\nimport { TupleElementsToProperties } from '../tuple/to_object.mjs';\nimport { EvaluateIntersect } from './evaluate.mjs';\n/** Returns true if the type is a valid operand to Composite. */\nexport function CanComposite(type) {\n    return (IsObject(type) || IsTuple(type));\n}\nfunction IsReadonlyProperty(left, right) {\n    return (IsReadonly(left) ? IsReadonly(right) ? true : false : false);\n}\nfunction IsOptionalProperty(left, right) {\n    return (IsOptional(left) ? IsOptional(right) ? true : false : false);\n}\nfunction CompositeProperty(left, right) {\n    const isReadonly = IsReadonlyProperty(left, right);\n    const isOptional = IsOptionalProperty(left, right);\n    const evaluated = EvaluateIntersect([left, right]);\n    // Modifiers need to be discarded and re-applied\n    const property = RemoveReadonly(RemoveOptional(evaluated));\n    return (isReadonly && isOptional ? AddReadonly(AddOptional(property)) :\n        isReadonly && !isOptional ? AddReadonly(property) :\n            !isReadonly && isOptional ? AddOptional(property) :\n                property);\n}\nfunction CompositePropertyKey(left, right, key) {\n    return (key in left\n        ? key in right ? CompositeProperty(left[key], right[key]) : left[key]\n        : key in right ? right[key] : Never());\n}\nfunction CompositeProperties(left, right) {\n    const keys = new Set([...Guard.Keys(left), ...Guard.Keys(right)]);\n    const result = [...keys].reduce((result, key) => {\n        return { ...result, [key]: CompositePropertyKey(left, right, key) };\n    }, {});\n    return result;\n}\nfunction GetProperties(type) {\n    const result = (IsObject(type) ? type.properties :\n        IsTuple(type) ? TupleElementsToProperties(type.items) :\n            {});\n    return result;\n}\nexport function Composite(left, right) {\n    const leftProperties = GetProperties(left);\n    const rightProperties = GetProperties(right);\n    const properties = CompositeProperties(leftProperties, rightProperties);\n    const result = Object(properties);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsAny } from '../../types/any.mjs';\nimport { Never, IsNever } from '../../types/never.mjs';\nimport { IsUnknown } from '../../types/unknown.mjs';\nimport { Compare, CompareResultLeftInside, CompareResultRightInside, CompareResultEqual } from './compare.mjs';\nimport { Composite, CanComposite } from './composite.mjs';\nfunction NarrowCompareRule(left, right) {\n    const result = Compare(left, right);\n    return (Guard.IsEqual(result, CompareResultLeftInside) ? left :\n        Guard.IsEqual(result, CompareResultRightInside) ? right :\n            Guard.IsEqual(result, CompareResultEqual) ? right :\n                Never());\n}\nfunction NarrowCompositeRule(left, right) {\n    const canCompositeLeft = CanComposite(left);\n    const canCompositeRight = CanComposite(right);\n    return (canCompositeLeft && canCompositeRight ? Composite(left, right) :\n        canCompositeLeft && !canCompositeRight ? left :\n            !canCompositeLeft && canCompositeRight ? right :\n                NarrowCompareRule(left, right));\n}\nexport function Narrow(left, right) {\n    return (IsNever(left) ? left :\n        IsAny(left) ? left :\n            IsUnknown(left) ? right :\n                IsNever(right) ? right :\n                    IsAny(right) ? right :\n                        IsUnknown(right) ? left :\n                            NarrowCompositeRule(left, right));\n}\n","// deno-fmt-ignore-file\n// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { Narrow } from './narrow.mjs';\nimport { EvaluateIntersect } from './evaluate.mjs';\nimport { EvaluateType } from './evaluate.mjs';\nfunction ShouldEvaluate(left, right) {\n    const result = IsUnion(left) || IsUnion(right);\n    return result;\n}\nfunction DistributeOperation(left, right) {\n    const evaluatedLeft = EvaluateType(left);\n    const evaluatedRight = EvaluateType(right);\n    const shouldEvaluate = ShouldEvaluate(evaluatedLeft, evaluatedRight);\n    const result = shouldEvaluate\n        ? EvaluateIntersect([evaluatedLeft, evaluatedRight])\n        : Narrow(evaluatedLeft, evaluatedRight);\n    return result;\n}\nfunction DistributeType(type, types, result = []) {\n    return Guard.ShiftLeft(types, (left, right) => DistributeType(type, right, [...result, DistributeOperation(left, type)]), () => Guard.IsEqual(result.length, 0)\n        ? [type]\n        : result);\n}\nfunction DistributeUnion(types, distribution, result = []) {\n    return Guard.ShiftLeft(types, (left, right) => DistributeUnion(right, distribution, [...result, ...Distribute([left], distribution)]), () => result);\n}\nexport function Distribute(types, result = []) {\n    return Guard.ShiftLeft(types, (left, right) => IsUnion(left)\n        ? Distribute(right, DistributeUnion(left.anyOf, result))\n        : Distribute(right, DistributeType(left, result)), () => result);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { Extends, ExtendsResult } from '../../extends/index.mjs';\nimport { EvaluateType } from '../evaluate/evaluate.mjs';\nimport { EvaluateUnion } from '../evaluate/evaluate.mjs';\nfunction ExcludeType(left, right) {\n    const check = Extends({}, left, right);\n    const result = ExtendsResult.IsExtendsTrueLike(check) ? [] : [left];\n    return result;\n}\nfunction ExcludeUnion(left, right, result = []) {\n    return Guard.ShiftLeft(left, (head, tail) => ExcludeUnion(tail, right, [...result, ...ExcludeType(head, right)]), () => result);\n}\nexport function ExcludeOperation(left, right) {\n    const evaluated = EvaluateType(left);\n    const canonical = IsUnion(evaluated) ? evaluated.anyOf : [evaluated];\n    const remaining = ExcludeUnion(canonical, right);\n    const result = EvaluateUnion(remaining);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsDependent } from '../../types/dependent.mjs';\nimport { IsEnum } from '../../types/enum.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { Literal } from '../../types/literal.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { IsTemplateLiteral } from '../../types/template_literal.mjs';\nimport { Union, IsUnion } from '../../types/union.mjs';\n// ------------------------------------------------------------------\n// Infrastructure\n// ------------------------------------------------------------------\nimport { Distribute } from './distribute.mjs';\nimport { Broaden } from './broaden.mjs';\nimport { ExcludeOperation } from '../exclude/operation.mjs';\nimport { TemplateLiteralDecode } from '../template_literal/decode.mjs';\nexport function EvaluateDependent(if_, then_, else_) {\n    const intersected = EvaluateIntersect([if_, then_]);\n    const excluded = ExcludeOperation(else_, if_);\n    const result = EvaluateUnion([intersected, excluded]);\n    return result;\n}\nexport function EvaluateEnum(values, result = []) {\n    return Guard.ShiftLeft(values, (left, right) => EvaluateEnum(right, [...result, Literal(left)]), () => EvaluateUnion(result));\n}\nexport function EvaluateIntersect(types) {\n    const distribution = Distribute(types);\n    const broadend = Broaden(distribution);\n    const result = EvaluateUnion(broadend);\n    return result;\n}\nexport function EvaluateTemplateLiteral(pattern) {\n    const evaluated = TemplateLiteralDecode(pattern);\n    const result = EvaluateType(evaluated);\n    return result;\n}\nexport function EvaluateUnion(types) {\n    const broadend = Broaden(types);\n    const result = EvaluateUnionFast(broadend);\n    return result;\n}\nexport function EvaluateType(type) {\n    const result = (IsDependent(type) ? EvaluateDependent(type.if, type.then, type.else) :\n        IsEnum(type) ? EvaluateEnum(type.enum) :\n            IsIntersect(type) ? EvaluateIntersect(type.allOf) :\n                IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) :\n                    IsUnion(type) ? EvaluateUnion(type.anyOf) :\n                        type);\n    return result;\n}\nexport function EvaluateUnionFast(types) {\n    const result = (Guard.IsEqual(types.length, 1) ? types[0] :\n        Guard.IsEqual(types.length, 0) ? Never() :\n            Union(types));\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromKey } from './from_key.mjs';\nimport { EvaluateEnum } from '../evaluate/evaluate.mjs';\nexport function FromEnumKey(values, value) {\n    const unionKey = EvaluateEnum(values);\n    const result = FromKey(unionKey, value);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { IntegerKey } from '../../types/record.mjs';\nimport { CreateRecord } from './record_create.mjs';\nexport function FromIntegerKey(_key, value) {\n    const result = CreateRecord(IntegerKey, value);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nimport { FromKey } from './from_key.mjs';\nexport function FromIntersectKey(types, value) {\n    const evaluatedKey = EvaluateIntersect(types);\n    const result = FromKey(evaluatedKey, value);\n    return result;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Object } from '../../types/object.mjs';\nexport function FromLiteralKey(key, value) {\n    return (Guard.IsString(key) || Guard.IsNumber(key) ? Object({ [key]: value }) :\n        Guard.IsEqual(key, false) ? Object({ false: value }) :\n            Guard.IsEqual(key, true) ? Object({ true: value }) :\n                Object({}));\n}\n","// deno-fmt-ignore-file\nimport { NumberKey } from '../../types/record.mjs';\nimport { CreateRecord } from './record_create.mjs';\nexport function FromNumberKey(_key, value) {\n    const result = CreateRecord(NumberKey, value);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { StringKey } from '../../types/record.mjs';\nimport { CreateRecord } from './record_create.mjs';\nexport function FromStringKey(key, value) {\n    // special case: override for string with raw pattern. We do not observe inference for the\n    // raw string patterns, but as a pattern (assuming non-never) is in the set of string, we\n    // allow overriding. Callers will need to narrow to the pattern manually. TB legacy.\n    return (Guard.HasPropertyKey(key, 'pattern') && (Guard.IsString(key.pattern) || key.pattern instanceof RegExp)\n        ? CreateRecord(key.pattern.toString(), value)\n        : CreateRecord(StringKey, value));\n}\n","// deno-fmt-ignore-file\nimport { FromKey } from './from_key.mjs';\nimport { ParsePatternIntoTypes } from '../patterns/pattern.mjs';\nimport { IsTemplateLiteralFinite } from '../template_literal/is_finite.mjs';\nimport { EvaluateTemplateLiteral } from '../evaluate/evaluate.mjs';\nimport { CreateRecord } from './record_create.mjs';\nexport function FromTemplateKey(pattern, value) {\n    const types = ParsePatternIntoTypes(pattern);\n    const finite = IsTemplateLiteralFinite(types);\n    const result = finite ? FromKey(EvaluateTemplateLiteral(pattern), value) : CreateRecord(pattern, value);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nfunction FlattenType(type) {\n    const result = IsUnion(type) ? Flatten(type.anyOf) : [type];\n    return result;\n}\nexport function Flatten(types, result = []) {\n    return Guard.ShiftLeft(types, (left, right) => Flatten(right, [...result, ...FlattenType(left)]), () => result);\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsSchema } from '../../types/schema.mjs';\nimport { IsLiteral } from '../../types/literal.mjs';\nimport { IsNumber } from '../../types/number.mjs';\nimport { IsInteger } from '../../types/integer.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { IsString } from '../../types/string.mjs';\nimport { StringKey } from '../../types/record.mjs';\nimport { Flatten } from '../evaluate/flatten.mjs';\nimport { CreateRecord } from './record_create.mjs';\nfunction StringOrNumberCheck(types) {\n    return types.some(type => IsString(type) || IsNumber(type) || IsInteger(type));\n}\nfunction TryBuildRecord(types, value) {\n    return (Guard.IsEqual(StringOrNumberCheck(types), true)\n        ? CreateRecord(StringKey, value)\n        : undefined);\n}\nfunction CreateProperties(types, value) {\n    return types.reduce((result, left) => {\n        return IsLiteral(left) && (Guard.IsString(left.const) || Guard.IsNumber(left.const))\n            ? { ...result, [left.const]: value }\n            : result;\n    }, {});\n}\nfunction CreateObject(types, value) {\n    const properties = CreateProperties(types, value);\n    const result = Object(properties);\n    return result;\n}\nexport function FromUnionKey(types, value) {\n    const flattened = Flatten(types);\n    const record = TryBuildRecord(flattened, value);\n    return (IsSchema(record) // maybe IsRecord?\n        ? record\n        : CreateObject(flattened, value));\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { IsAny } from '../../types/any.mjs';\nimport { IsBoolean } from '../../types/boolean.mjs';\nimport { IsEnum } from '../../types/enum.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { IsInteger } from '../../types/integer.mjs';\nimport { IsLiteral } from '../../types/literal.mjs';\nimport { IsNumber } from '../../types/number.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { IsString } from '../../types/string.mjs';\nimport { IsTemplateLiteral } from '../../types/template_literal.mjs';\nimport { IsUnion } from '../../types/union.mjs';\n// ------------------------------------------------------------------\n// Keys and Deferred\n// ------------------------------------------------------------------\nimport { FromAnyKey } from './from_key_any.mjs';\nimport { FromBooleanKey } from './from_key_boolean.mjs';\nimport { FromEnumKey } from './from_key_enum.mjs';\nimport { FromIntegerKey } from './from_key_integer.mjs';\nimport { FromIntersectKey } from './from_key_intersect.mjs';\nimport { FromLiteralKey } from './from_key_literal.mjs';\nimport { FromNumberKey } from './from_key_number.mjs';\nimport { FromStringKey } from './from_key_string.mjs';\nimport { FromTemplateKey } from './from_key_template_literal.mjs';\nimport { FromUnionKey } from './from_key_union.mjs';\nexport function FromKey(key, value) {\n    const result = (IsAny(key) ? FromAnyKey(value) :\n        IsBoolean(key) ? FromBooleanKey(value) :\n            IsEnum(key) ? FromEnumKey(key.enum, value) :\n                IsInteger(key) ? FromIntegerKey(key, value) :\n                    IsIntersect(key) ? FromIntersectKey(key.allOf, value) :\n                        IsLiteral(key) ? FromLiteralKey(key.const, value) :\n                            IsNumber(key) ? FromNumberKey(key, value) :\n                                IsUnion(key) ? FromUnionKey(key.anyOf, value) :\n                                    IsString(key) ? FromStringKey(key, value) :\n                                        IsTemplateLiteral(key) ? FromTemplateKey(key.pattern, value) :\n                                            Object({}));\n    return result;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { RecordDeferred } from '../../types/record.mjs';\nimport { FromKey } from './from_key.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nexport function RecordAction(key, value, options) {\n    const result = CanInstantiate([key])\n        ? Memory.Update(FromKey(key, value), {}, options)\n        : RecordDeferred(key, value, options);\n    return result;\n}\nexport function RecordInstantiate(context, state, key, value, options) {\n    const instantiatedKey = InstantiateType(context, state, key);\n    const instantiatedValue = InstantiateType(context, state, value);\n    return RecordAction(instantiatedKey, instantiatedValue, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsKind } from './schema.mjs';\nimport { Integer, IntegerPattern } from './integer.mjs';\nimport { Number, NumberPattern } from './number.mjs';\nimport { String, StringPattern } from './string.mjs';\nimport { Deferred } from './deferred.mjs';\nimport { TemplateLiteralDecodeUnsafe } from '../engine/template_literal/decode.mjs';\nimport { CreateRecord } from '../engine/record/record_create.mjs';\nimport { RecordAction } from '../engine/record/instantiate.mjs';\nexport const IntegerKey = `^${IntegerPattern}$`;\nexport const NumberKey = `^${NumberPattern}$`;\nexport const StringKey = `^${StringPattern}$`;\n/** Represents a deferred Record action. */\nexport function RecordDeferred(key, value, options = {}) {\n    return Deferred('Record', [key, value], options);\n}\n// -------------------------------------------------------------------\n// Factory\n// -------------------------------------------------------------------\n/** Creates a Record type. */\nexport function Record(key, value, options = {}) {\n    return RecordAction(key, value, options);\n}\n// -------------------------------------------------------------------\n// RecordFromPattern\n// -------------------------------------------------------------------\n/** Creates a Record type from regular expression pattern. */\nexport function RecordFromPattern(pattern, value) {\n    return CreateRecord(pattern, value);\n}\n/** Transforms a Record Pattern to a Type */\nexport function RecordPatternToType(pattern) {\n    const result = (Guard.IsEqual(pattern, StringKey) ? String() :\n        Guard.IsEqual(pattern, IntegerKey) ? Integer() :\n            Guard.IsEqual(pattern, NumberKey) ? Number() :\n                TemplateLiteralDecodeUnsafe(pattern));\n    return result;\n}\n/** Extracts the Pattern from a Record type */\nexport function RecordPattern(type) {\n    return Guard.Keys(type.patternProperties)[0];\n}\n/** Extracts the Key from a Record type */\nexport function RecordKey(type) {\n    const pattern = RecordPattern(type);\n    const result = RecordPatternToType(pattern);\n    return result;\n}\n/** Extracts the Value from a Record type */\nexport function RecordValue(type) {\n    return type.patternProperties[RecordPattern(type)];\n}\n// -------------------------------------------------------------------\n// Guard\n// -------------------------------------------------------------------\nexport function IsRecord(value) {\n    return IsKind(value, 'Record');\n}\n// -------------------------------------------------------------------\n// Options\n// -------------------------------------------------------------------\nexport function RecordOptions(type) {\n    return Memory.Discard(type, ['~kind', 'type', 'patternProperties']);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from '../types/schema.mjs';\n// ------------------------------------------------------------------\n// Type\n// ------------------------------------------------------------------\n/** Creates a Rest instruction type. */\nexport function Rest(type) {\n    return Memory.Create({ '~kind': 'Rest' }, { type: 'rest', items: type }, {});\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TRest. */\nexport function IsRest(value) {\n    return IsKind(value, 'Rest');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a This type. */\nexport function This(options) {\n    return Memory.Create({ ['~kind']: 'This' }, { $ref: '#' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TThis. */\nexport function IsThis(value) {\n    return IsKind(value, 'This');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Undefined type. */\nexport function Undefined(options) {\n    return Memory.Create({ '~kind': 'Undefined' }, { type: 'undefined' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TUndefined. */\nexport function IsUndefined(value) {\n    return IsKind(value, 'Undefined');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Void type. */\nexport function Void(options) {\n    return Memory.Create({ '~kind': 'Void' }, { type: 'void' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TVoid. */\nexport function IsVoid(value) {\n    return IsKind(value, 'Void');\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport * as T from '../types/index.mjs';\nimport * as S from '../action/index.mjs';\nfunction IntrinsicOrCall(ref, parameters) {\n    // deno-coverage-ignore-start\n    //\n    // Have extensively tested but reports show no Omit coverage (review)\n    return (Guard.IsEqual(ref, 'Array') ? T.Array(parameters[0]) :\n        Guard.IsEqual(ref, 'Capitalize') ? S.CapitalizeDeferred(parameters[0]) :\n            Guard.IsEqual(ref, 'ConstructorParameters') ? S.ConstructorParametersDeferred(parameters[0]) :\n                Guard.IsEqual(ref, 'Evaluate') ? S.EvaluateDeferred(parameters[0]) :\n                    Guard.IsEqual(ref, 'Exclude') ? S.ExcludeDeferred(parameters[0], parameters[1]) :\n                        Guard.IsEqual(ref, 'Extract') ? S.ExtractDeferred(parameters[0], parameters[1]) :\n                            Guard.IsEqual(ref, 'Index') ? S.IndexDeferred(parameters[0], parameters[1]) :\n                                Guard.IsEqual(ref, 'InstanceType') ? S.InstanceTypeDeferred(parameters[0]) :\n                                    Guard.IsEqual(ref, 'Lowercase') ? S.LowercaseDeferred(parameters[0]) :\n                                        Guard.IsEqual(ref, 'NonNullable') ? S.NonNullableDeferred(parameters[0]) :\n                                            Guard.IsEqual(ref, 'Omit') ? S.OmitDeferred(parameters[0], parameters[1]) :\n                                                Guard.IsEqual(ref, 'Parameters') ? S.ParametersDeferred(parameters[0]) :\n                                                    Guard.IsEqual(ref, 'Partial') ? S.PartialDeferred(parameters[0]) :\n                                                        Guard.IsEqual(ref, 'Pick') ? S.PickDeferred(parameters[0], parameters[1]) :\n                                                            Guard.IsEqual(ref, 'Readonly') ? S.ReadonlyObjectDeferred(parameters[0]) :\n                                                                Guard.IsEqual(ref, 'KeyOf') ? S.KeyOfDeferred(parameters[0]) :\n                                                                    Guard.IsEqual(ref, 'Record') ? T.RecordDeferred(parameters[0], parameters[1]) :\n                                                                        Guard.IsEqual(ref, 'Required') ? S.RequiredDeferred(parameters[0]) :\n                                                                            Guard.IsEqual(ref, 'ReturnType') ? S.ReturnTypeDeferred(parameters[0]) :\n                                                                                Guard.IsEqual(ref, 'Uncapitalize') ? S.UncapitalizeDeferred(parameters[0]) :\n                                                                                    Guard.IsEqual(ref, 'Uppercase') ? S.UppercaseDeferred(parameters[0]) :\n                                                                                        T.CallConstruct(T.Ref(ref), parameters));\n    // deno-coverage-ignore-stop\n}\n// ------------------------------------------------------------------\n// Unreachable\n// ------------------------------------------------------------------\n// deno-coverage-ignore-start\nfunction Unreachable() {\n    throw Error('Unreachable');\n}\nfunction DelimitedDecode(input, result = []) {\n    return Guard.ShiftLeft(input, (left, right) => DelimitedDecode(right, [...result, left[1]]), () => result);\n}\nfunction Delimited(input) {\n    return Guard.IsEqual(input.length, 3)\n        ? [input[0], ...DelimitedDecode(input[1])]\n        : [];\n}\nexport function GenericParameterExtendsEqualsMapping(input) {\n    return T.Parameter(input[0], input[2], input[4]);\n}\nexport function GenericParameterExtendsMapping(input) {\n    return T.Parameter(input[0], input[2], input[2]);\n}\nexport function GenericParameterEqualsMapping(input) {\n    return T.Parameter(input[0], T.Unknown(), input[2]);\n}\nexport function GenericParameterIdentifierMapping(input) {\n    return T.Parameter(input, T.Unknown(), T.Unknown());\n}\nexport function GenericParameterMapping(input) {\n    return input;\n}\nexport function GenericParameterListMapping(input) {\n    return Delimited(input);\n}\nexport function GenericParametersMapping(input) {\n    return input[1];\n}\nexport function GenericCallArgumentListMapping(input) {\n    return Delimited(input);\n}\nexport function GenericCallArgumentsMapping(input) {\n    return input[1];\n}\nexport function GenericCallMapping(input) {\n    return IntrinsicOrCall(input[0], input[1]);\n}\nexport function OptionalSemiColonMapping(input) {\n    return null;\n}\nexport function KeywordStringMapping(input) {\n    return T.String();\n}\nexport function KeywordNumberMapping(input) {\n    return T.Number();\n}\nexport function KeywordBooleanMapping(input) {\n    return T.Boolean();\n}\nexport function KeywordUndefinedMapping(input) {\n    return T.Undefined();\n}\nexport function KeywordNullMapping(input) {\n    return T.Null();\n}\nexport function KeywordIntegerMapping(input) {\n    return T.Integer();\n}\nexport function KeywordBigIntMapping(input) {\n    return T.BigInt();\n}\nexport function KeywordUnknownMapping(input) {\n    return T.Unknown();\n}\nexport function KeywordAnyMapping(input) {\n    return T.Any();\n}\nexport function KeywordObjectMapping(input) {\n    return T.Object({});\n}\nexport function KeywordNeverMapping(input) {\n    return T.Never();\n}\nexport function KeywordSymbolMapping(input) {\n    return T.Symbol();\n}\nexport function KeywordVoidMapping(input) {\n    return T.Void();\n}\nexport function KeywordThisMapping(input) {\n    return T.This();\n}\nexport function LiteralBigIntMapping(input) {\n    return T.Literal(BigInt(input));\n}\nexport function LiteralBooleanMapping(input) {\n    return T.Literal(Guard.IsEqual(input, 'true'));\n}\nexport function LiteralNumberMapping(input) {\n    return T.Literal(parseFloat(input));\n}\nexport function LiteralStringMapping(input) {\n    return T.Literal(input);\n}\nexport function TemplateInterpolateMapping(input) {\n    return input[1];\n}\nexport function TemplateSpanMapping(input) {\n    return T.Literal(input);\n}\nexport function TemplateBodyMapping(input) {\n    return (Guard.IsEqual(input.length, 3)\n        ? [input[0], input[1], ...input[2]]\n        : [input[0]]);\n}\nexport function TemplateLiteralTypesMapping(input) {\n    return input[1];\n}\nexport function TemplateLiteralMapping(input) {\n    return T.TemplateLiteralDeferred(input);\n}\nexport function DependentMapping(input) {\n    return (Guard.IsEqual(input.length, 6) ? T.Dependent(input[1], input[3], input[5]) :\n        T.Dependent(input[1], input[3], T.Unknown()));\n}\nexport function KeyOfMapping(input) {\n    return input.length > 0;\n}\nexport function IndexArrayMapping(input) {\n    return input.reduce((result, current) => {\n        return Guard.IsEqual(current.length, 3)\n            ? [...result, [current[1]]]\n            : [...result, []];\n    }, []);\n}\nexport function ExtendsMapping(input) {\n    return Guard.IsEqual(input.length, 6)\n        ? [input[1], input[3], input[5]]\n        : [];\n}\nexport function BaseMapping(input) {\n    return Guard.IsArray(input) && Guard.IsEqual(input.length, 3)\n        ? input[1]\n        : input;\n}\nexport function WithMapping(input) {\n    return Guard.IsEqual(input.length, 2) ? input[1] : [];\n}\n// deno-coverage-ignore-start\nfunction FactorIndexArray(Type, indexArray) {\n    return indexArray.reduce((result, left) => {\n        const _left = left;\n        return (Guard.IsEqual(_left.length, 1) ? S.IndexDeferred(result, _left[0]) :\n            Guard.IsEqual(_left.length, 0) ? T.Array(result) :\n                Unreachable());\n    }, Type);\n}\n// deno-coverage-ignore-stop\nfunction FactorExtends(type, extend) {\n    return Guard.IsEqual(extend.length, 3)\n        ? S.ConditionalDeferred(type, extend[0], extend[1], extend[2])\n        : type;\n}\nfunction FactorWith(type, withClause) {\n    return Guard.IsArray(withClause) && Guard.IsEqual(withClause.length, 0)\n        ? type\n        : S.WithDeferred(type, withClause);\n}\nexport function FactorMapping(input) {\n    const [keyOf, type, indexArray, extend, withClause] = input;\n    return FactorWith(keyOf\n        ? FactorExtends(S.KeyOfDeferred(FactorIndexArray(type, indexArray)), extend)\n        : FactorExtends(FactorIndexArray(type, indexArray), extend), withClause);\n}\n// deno-coverage-ignore-start\nfunction ExprBinaryMapping(left, rest) {\n    return (Guard.IsEqual(rest.length, 3) ? (() => {\n        const [operator, right, next] = rest;\n        const Schema = ExprBinaryMapping(right, next);\n        if (Guard.IsEqual(operator, '&')) {\n            return T.IsIntersect(Schema)\n                ? T.Intersect([left, ...Schema.allOf])\n                : T.Intersect([left, Schema]);\n        }\n        if (Guard.IsEqual(operator, '|')) {\n            return T.IsUnion(Schema)\n                ? T.Union([left, ...Schema.anyOf])\n                : T.Union([left, Schema]);\n        }\n        Unreachable();\n    })() : left);\n}\nexport function ExprTermTailMapping(input) {\n    return input;\n}\nexport function ExprTermMapping(input) {\n    const [left, rest] = input;\n    return ExprBinaryMapping(left, rest);\n}\nexport function ExprTailMapping(input) {\n    return input;\n}\nexport function ExprMapping(input) {\n    const [left, rest] = input;\n    return ExprBinaryMapping(left, rest);\n}\nexport function ExprReadonlyMapping(input) {\n    return S.AddImmutableDeferred(input[1]);\n}\nexport function ExprPipeMapping(input) {\n    return input[1];\n}\nexport function GenericTypeMapping(input) {\n    return T.Generic(input[0], input[2]);\n}\n// deno-coverage-ignore-start\nexport function InferTypeMapping(input) {\n    return (Guard.IsEqual(input.length, 4) ? T.Infer(input[1], input[3]) :\n        Guard.IsEqual(input.length, 2) ? T.Infer(input[1], T.Unknown()) :\n            Unreachable());\n}\nexport function TypeMapping(input) {\n    return input;\n}\nexport function PropertyKeyNumberMapping(input) {\n    return `${input}`;\n}\nexport function PropertyKeyIdentMapping(input) {\n    return input;\n}\nexport function PropertyKeyQuotedMapping(input) {\n    return input;\n}\n// deno-coverage-ignore-start\nexport function PropertyKeyIndexMapping(input) {\n    return (T.IsInteger(input[3]) ? T.IntegerKey :\n        T.IsNumber(input[3]) ? T.NumberKey :\n            T.IsSymbol(input[3]) ? T.StringKey :\n                T.IsString(input[3]) ? T.StringKey :\n                    Unreachable());\n}\nexport function PropertyKeyMapping(input) {\n    return input;\n}\nexport function ReadonlyMapping(input) {\n    return input.length > 0;\n}\nexport function OptionalMapping(input) {\n    return input.length > 0;\n}\nexport function PropertyMapping(input) {\n    const [isReadonly, key, isOptional, _colon, type] = input;\n    return {\n        [key]: (isReadonly && isOptional ? S.AddReadonlyDeferred(S.AddOptionalDeferred(type)) :\n            isReadonly && !isOptional ? S.AddReadonlyDeferred(type) :\n                !isReadonly && isOptional ? S.AddOptionalDeferred(type) :\n                    type)\n    };\n}\nexport function PropertyDelimiterMapping(input) {\n    return input;\n}\nexport function PropertyListMapping(input) {\n    return Delimited(input);\n}\nfunction PropertiesReduce(propertyList) {\n    return propertyList.reduce((result, left) => {\n        const isPatternProperties = (Guard.HasPropertyKey(left, T.IntegerKey) || Guard.HasPropertyKey(left, T.NumberKey) || Guard.HasPropertyKey(left, T.StringKey));\n        // @ts-ignore 5.0.4 - unable to observe ...left on right arm\n        return (isPatternProperties\n            ? [result[0], Memory.Assign(result[1], left)]\n            : [Memory.Assign(result[0], left), result[1]]);\n    }, [{}, {}]);\n}\nexport function PropertiesMapping(input) {\n    return PropertiesReduce(input[1]);\n}\nexport function _Object_Mapping(input) {\n    const [properties, patternProperties] = input;\n    const options = Guard.IsEqual(Guard.Keys(patternProperties).length, 0) ? {} : { patternProperties };\n    return T.Object(properties, options);\n}\n// deno-coverage-ignore-start\nexport function ElementNamedMapping(input) {\n    return (Guard.IsEqual(input.length, 5) ? S.AddReadonlyDeferred(S.AddOptionalDeferred(input[4])) :\n        Guard.IsEqual(input.length, 3) ? input[2] :\n            Guard.IsEqual(input.length, 4) ? (Guard.IsEqual(input[2], 'readonly') ? S.AddReadonlyDeferred(input[3]) : S.AddOptionalDeferred(input[3])) :\n                Unreachable());\n}\nexport function ElementBaseMapping(input) {\n    if (!Guard.IsArray(input) || !Guard.IsEqual(input.length, 3))\n        return input;\n    const [isReadonly, type, isOptional] = input;\n    return (isReadonly && isOptional ? S.AddReadonlyDeferred(S.AddOptionalDeferred(type)) :\n        isReadonly && !isOptional ? S.AddReadonlyDeferred(type) :\n            !isReadonly && isOptional ? S.AddOptionalDeferred(type) :\n                type);\n}\n// deno-coverage-ignore-start\nexport function ElementMapping(input) {\n    return (Guard.IsEqual(input.length, 2) ? T.Rest(input[1]) :\n        Guard.IsEqual(input.length, 1) ? input[0] :\n            Unreachable());\n}\nexport function ElementListMapping(input) {\n    return Delimited(input);\n}\nexport function _Tuple_Mapping(input) {\n    return T.Tuple(input[1]);\n}\nexport function ParameterReadonlyOptionalMapping(input) {\n    return S.AddReadonlyDeferred(S.AddOptionalDeferred(input[4]));\n}\nexport function ParameterReadonlyMapping(input) {\n    return S.AddReadonlyDeferred(input[3]);\n}\nexport function ParameterOptionalMapping(input) {\n    return S.AddOptionalDeferred(input[3]);\n}\nexport function ParameterTypeMapping(input) {\n    return input[2];\n}\nexport function ParameterBaseMapping(input) {\n    return input;\n}\n// deno-coverage-ignore-start\nexport function ParameterMapping(input) {\n    return (Guard.IsEqual(input.length, 2) ? T.Rest(input[1]) :\n        Guard.IsEqual(input.length, 1) ? input[0] :\n            Unreachable());\n}\nexport function ParameterListMapping(input) {\n    return Delimited(input);\n}\nexport function _Function_Mapping(input) {\n    return T._Function_(input[1], input[4]);\n}\nexport function _Constructor_Mapping(input) {\n    return T.Constructor(input[2], input[5]);\n}\nfunction ApplyReadonly(state, type) {\n    return (Guard.IsEqual(state, 'remove') ? S.RemoveReadonlyDeferred(type) :\n        Guard.IsEqual(state, 'add') ? S.AddReadonlyDeferred(type) :\n            type);\n}\nexport function MappedReadonlyMapping(input) {\n    return (Guard.IsEqual(input.length, 2) && Guard.IsEqual(input[0], '-') ? 'remove' :\n        Guard.IsEqual(input.length, 2) && Guard.IsEqual(input[0], '+') ? 'add' :\n            Guard.IsEqual(input.length, 1) ? 'add' :\n                'none');\n}\nfunction ApplyOptional(state, type) {\n    return (Guard.IsEqual(state, 'remove') ? S.RemoveOptionalDeferred(type) :\n        Guard.IsEqual(state, 'add') ? S.AddOptionalDeferred(type) :\n            type);\n}\nexport function MappedOptionalMapping(input) {\n    return (Guard.IsEqual(input.length, 2) && Guard.IsEqual(input[0], '-') ? 'remove' :\n        Guard.IsEqual(input.length, 2) && Guard.IsEqual(input[0], '+') ? 'add' :\n            Guard.IsEqual(input.length, 1) ? 'add' :\n                'none');\n}\nexport function MappedAsMapping(input) {\n    return Guard.IsEqual(input.length, 2) ? [input[1]] : [];\n}\nexport function _Mapped_Mapping(input) {\n    return (Guard.IsArray(input[6]) && Guard.IsEqual(input[6].length, 1)\n        ? S.MappedDeferred(T.Identifier(input[3]), input[5], input[6][0], ApplyReadonly(input[1], ApplyOptional(input[8], input[10])))\n        : S.MappedDeferred(T.Identifier(input[3]), input[5], T.Ref(input[3]), ApplyReadonly(input[1], ApplyOptional(input[8], input[10]))));\n}\nexport function ReferenceMapping(input) {\n    return T.Ref(input);\n}\nexport function WithBigIntMapping(input) {\n    return BigInt(input);\n}\nexport function WithNumberMapping(input) {\n    return parseFloat(input);\n}\nexport function WithBooleanMapping(input) {\n    return Guard.IsEqual(input, 'true');\n}\nexport function WithStringMapping(input) {\n    return input;\n}\nexport function WithNullMapping(input) {\n    return null;\n}\nexport function WithUndefinedMapping(input) {\n    return undefined;\n}\nexport function WithPropertyMapping(input) {\n    return { [input[0]]: input[2] };\n}\nexport function WithPropertyListMapping(input) {\n    return Delimited(input);\n}\nfunction WithObjectMappingReduce(propertyList) {\n    return propertyList.reduce((result, left) => {\n        return Memory.Assign(result, left);\n    }, {});\n}\nexport function WithObjectMapping(input) {\n    return WithObjectMappingReduce(input[1]);\n}\nexport function WithElementListMapping(input) {\n    return Delimited(input);\n}\nexport function WithArrayMapping(input) {\n    return input[1];\n}\nexport function WithValueMapping(input) {\n    return input;\n}\nexport function PatternBigIntMapping(input) {\n    return T.BigInt();\n}\nexport function PatternStringMapping(input) {\n    return T.String();\n}\nexport function PatternNumberMapping(input) {\n    return T.Number();\n}\nexport function PatternIntegerMapping(input) {\n    return T.Integer();\n}\nexport function PatternNeverMapping(input) {\n    return T.Never();\n}\nexport function PatternTextMapping(input) {\n    return T.Literal(input);\n}\nexport function PatternBaseMapping(input) {\n    return input;\n}\nexport function PatternGroupMapping(input) {\n    return T.Union(input[1]);\n}\nexport function PatternUnionMapping(input) {\n    return (input.length === 3 ? [...input[0], ...input[2]] :\n        input.length === 1 ? [...input[0]] :\n            []);\n}\nexport function PatternTermMapping(input) {\n    return [input[0], ...input[1]];\n}\nexport function PatternBodyMapping(input) {\n    return input;\n}\nexport function PatternMapping(input) {\n    return input[1];\n}\nexport function InterfaceDeclarationHeritageListMapping(input) {\n    return Delimited(input);\n}\nexport function InterfaceDeclarationHeritageMapping(input) {\n    return Guard.IsEqual(input.length, 2) ? input[1] : [];\n}\nexport function InterfaceDeclarationGenericMapping(input) {\n    const parameters = input[2];\n    const heritage = input[3];\n    const [properties, patternProperties] = input[4];\n    const options = Guard.IsEqual(Guard.Keys(patternProperties).length, 0) ? {} : { patternProperties };\n    return { [input[1]]: T.Generic(parameters, S.InterfaceDeferred(heritage, properties, options)) };\n}\nexport function InterfaceDeclarationMapping(input) {\n    const heritage = input[2];\n    const [properties, patternProperties] = input[3];\n    const options = Guard.IsEqual(Guard.Keys(patternProperties).length, 0) ? {} : { patternProperties };\n    return { [input[1]]: S.InterfaceDeferred(heritage, properties, options) };\n}\nexport function TypeAliasDeclarationGenericMapping(input) {\n    return { [input[1]]: T.Generic(input[2], input[4]) };\n}\nexport function TypeAliasDeclarationMapping(input) {\n    return { [input[1]]: input[3] };\n}\nexport function ExportKeywordMapping(input) {\n    return null; // ignored-dont-care\n}\nexport function ModuleDeclarationDelimiterMapping(input) {\n    return input;\n}\nexport function ModuleDeclarationListMapping(input) {\n    return Delimited(input);\n}\nexport function ModuleDeclarationMapping(input) {\n    return input[1];\n}\nexport function ModuleMapping(input) {\n    const [moduleDeclaration, moduleDeclarationList] = [input[0], input[1]];\n    return S.ModuleDeferred(Memory.Assign(moduleDeclaration, PropertiesReduce(moduleDeclarationList)[0]));\n}\nexport function ScriptMapping(input) {\n    return input;\n}\n","// deno-coverage-ignore-start - parsebox tested\nimport { IsEqual } from './guard.mjs';\n/** Checks the value is a Tuple-2 [string, string] result */\nexport function IsMatch(value) {\n    return IsEqual(value.length, 2);\n}\n/** Matches on a result and dispatches either left or right arm */\nexport function Match(input, ok, fail) {\n    return IsMatch(input) ? ok(input[0], input[1]) : fail();\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { IsMatch } from './match.mjs';\nimport { IsEqual } from './guard.mjs';\nfunction TakeVariant(variant, input) {\n    return (IsEqual(input.indexOf(variant), 0)\n        ? [variant, input.slice(variant.length)]\n        : []);\n}\n/** Takes one of the given variants or fail */\nexport function Take(variants, input) {\n    // ----------------------------------------------------------------\n    // Symmetric\n    // ----------------------------------------------------------------\n    // return Guard.ShiftLeft(variants, (valueLeft, valueRight) => \n    //   Match(TakeVariant(valueLeft, input), (take, rest) => \n    //     [take, rest],\n    //     () => Take(valueRight, input)),\n    //   () => []) as never\n    // ----------------------------------------------------------------\n    // Inline\n    // ----------------------------------------------------------------\n    for (let i = 0; i < variants.length; i++) {\n        const result = TakeVariant(variants[i], input);\n        if (IsMatch(result))\n            return result;\n    }\n    return [];\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\n// ------------------------------------------------------------------\n// Range\n// ------------------------------------------------------------------\nfunction Range(start, end) {\n    return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));\n}\nexport const Alpha = [\n    ...Range(97, 122), // Lowercase\n    ...Range(65, 90) // Uppercase\n];\nexport const Zero = '0';\nexport const NonZero = Range(49, 57); // 1 - 9\nexport const Digit = [Zero, ...NonZero];\n// ------------------------------------------------------------------\n// Characters\n// ------------------------------------------------------------------\nexport const WhiteSpace = ' ';\nexport const NewLine = '\\n';\nexport const TabSpace = '\\t';\nexport const UnderScore = '_';\nexport const Dot = '.';\nexport const DollarSign = '$';\nexport const Hyphen = '-';\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { IsEqual } from './guard.mjs';\nimport * as Char from './char.mjs';\nconst LineComment = '//';\nconst OpenComment = '/*';\nconst CloseComment = '*/';\nfunction DiscardMultilineComment(input) {\n    const index = input.indexOf(CloseComment);\n    const result = IsEqual(index, -1) ? '' : input.slice(index + 2);\n    return result;\n}\nfunction DiscardLineComment(input) {\n    const index = input.indexOf(Char.NewLine);\n    const result = IsEqual(index, -1) ? '' : input.slice(index);\n    return result;\n}\n// ...\nfunction TrimStartUntilNewline(input) {\n    return input.replace(/^[ \\t\\r\\f\\v]+/, '');\n}\nexport function TrimWhitespace(input) {\n    const trimmed = TrimStartUntilNewline(input);\n    return (trimmed.startsWith(OpenComment) ? TrimWhitespace(DiscardMultilineComment(trimmed.slice(2))) :\n        trimmed.startsWith(LineComment) ? TrimWhitespace(DiscardLineComment(trimmed.slice(2))) :\n            trimmed);\n}\nexport function Trim(input) {\n    const trimmed = input.trimStart();\n    return (trimmed.startsWith(OpenComment) ? Trim(DiscardMultilineComment(trimmed.slice(2))) :\n        trimmed.startsWith(LineComment) ? Trim(DiscardLineComment(trimmed.slice(2))) :\n            trimmed);\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { Match } from './internal/match.mjs';\nimport { Trim } from './internal/trim.mjs';\nimport { Take } from './internal/take.mjs';\nimport { Many } from './internal/many.mjs';\nimport { Digit } from './internal/char.mjs';\nimport { Zero } from './internal/char.mjs';\nimport { NonZero } from './internal/char.mjs';\nimport { UnderScore } from './internal/char.mjs';\nfunction TakeNonZero(input) {\n    return Take(NonZero, input);\n}\nconst AllowedDigits = [...Digit, UnderScore];\nfunction TakeDigits(input) {\n    return Many(AllowedDigits, [UnderScore], input);\n}\nfunction TakeUnsignedInteger(input) {\n    return Match(Take([Zero], input), (Zero, ZeroRest) => [Zero, ZeroRest], () => Match(TakeNonZero(input), (NonZero, NonZeroRest) => Match(TakeDigits(NonZeroRest), (Digits, DigitsRest) => [`${NonZero}${Digits}`, DigitsRest], () => []), // fail: did not match Digits\n    () => [])); // fail: did not match NonZero\n}\n/** Matches if next is a UnsignedInteger */\nexport function UnsignedInteger(input) {\n    return TakeUnsignedInteger(Trim(input));\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { IsEqual } from './internal/guard.mjs';\nimport { TrimWhitespace } from './internal/trim.mjs';\nimport { Trim } from './internal/trim.mjs';\nimport { Take } from './internal/take.mjs';\nimport { NewLine } from './internal/char.mjs';\nimport { WhiteSpace } from './internal/char.mjs';\nfunction TakeConst(const_, input) {\n    return Take([const_], input);\n}\n/** Matches if next is the given Const value */\nexport function Const(const_, input) {\n    return (IsEqual(const_, '') ? ['', input] : (const_.startsWith(NewLine) ? TakeConst(const_, TrimWhitespace(input)) :\n        const_.startsWith(WhiteSpace) ? TakeConst(const_, input) :\n            TakeConst(const_, Trim(input))));\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { Match } from './internal/match.mjs';\nimport { Trim } from './internal/trim.mjs';\nimport { Take } from './internal/take.mjs';\nimport { Alpha } from './internal/char.mjs';\nimport { Digit } from './internal/char.mjs';\nimport { UnderScore } from './internal/char.mjs';\nimport { DollarSign } from './internal/char.mjs';\nconst Initial = [...Alpha, UnderScore, DollarSign];\nfunction TakeInitial(input) {\n    return Take(Initial, input);\n}\nconst Remaining = [...Initial, ...Digit];\nfunction TakeRemaining(input, result = '') {\n    return Match(Take(Remaining, input), (Remaining, RemainingRest) => TakeRemaining(RemainingRest, `${result}${Remaining}`), () => [result, input]);\n}\nfunction TakeIdent(input) {\n    return Match(TakeInitial(input), (Initial, InitialRest) => Match(TakeRemaining(InitialRest), (Remaining, RemainingRest) => [`${Initial}${Remaining}`, RemainingRest], () => []), // fail: did not match Remaining\n    () => []); // fail: did not match Initial\n}\n/** Matches if next is an Ident */\nexport function Ident(input) {\n    return TakeIdent(Trim(input));\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { IsEqual } from './internal/guard.mjs';\nimport { IsMatch, Match } from './internal/match.mjs';\nimport { Trim } from './internal/trim.mjs';\nimport { Take } from './internal/take.mjs';\nimport { Many } from './internal/many.mjs';\nimport { Digit, UnderScore } from './internal/char.mjs';\nimport { Dot } from './internal/char.mjs';\nimport { UnsignedInteger } from './unsigned_integer.mjs';\nconst AllowedDigits = [...Digit, UnderScore];\nfunction IsLeadingDot(input) {\n    return IsMatch(Take([Dot], input));\n}\nfunction TakeFractional(input) {\n    return Match(Many(AllowedDigits, [UnderScore], input), (Digits, DigitsRest) => IsEqual(Digits, '')\n        ? [] // fail: no Digits\n        : [Digits, DigitsRest], () => []); // fail: did not match Digits\n}\nfunction LeadingDot(input) {\n    return Match(Take([Dot], input), (Dot, DotRest) => Match(TakeFractional(DotRest), (Fractional, FractionalRest) => [`0${Dot}${Fractional}`, FractionalRest], () => []), // fail: did not match Fractional\n    () => []); // fail: did not match Dot\n}\nfunction LeadingInteger(input) {\n    return Match(UnsignedInteger(input), (Integer, IntegerRest) => Match(Take([Dot], IntegerRest), (Dot, DotRest) => Match(TakeFractional(DotRest), (Fractional, FractionalRest) => [`${Integer}${Dot}${Fractional}`, FractionalRest], () => [`${Integer}`, DotRest]), // fail: did not match Fractional, use Integer\n    () => [`${Integer}`, IntegerRest]), // fail: did not match Dot, use Integer\n    () => []); // fail: did not match Integer\n}\nfunction TakeUnsignedNumber(input) {\n    return (IsLeadingDot(input)\n        ? LeadingDot(input)\n        : LeadingInteger(input));\n}\n/** Matches if next is a UnsignedNumber */\nexport function UnsignedNumber(input) {\n    return TakeUnsignedNumber(Trim(input));\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { Match } from './internal/match.mjs';\nimport { IsEqual, ShiftLeft } from './internal/guard.mjs';\nfunction TakeOne(input) {\n    const result = IsEqual(input, '') ? [] : [input.slice(0, 1), input.slice(1)];\n    return result;\n}\nfunction IsInputMatchSentinal(end, input) {\n    return ShiftLeft(end, (left, right) => input.startsWith(left)\n        ? true\n        : IsInputMatchSentinal(right, input), () => false);\n}\n/** Match Input until but not including End. No match if End not found. */\nexport function Until(end, input, result = '') {\n    return Match(TakeOne(input), (One, Rest) => IsInputMatchSentinal(end, input)\n        ? [result, input] // ok: at sentinal \n        : Until(end, Rest, `${result}${One}`) // fail: advance + 1\n    , () => []);\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { IsEqual } from './internal/guard.mjs';\nimport { Match } from './internal/match.mjs';\nimport { Until } from './until.mjs';\n/** Match Input until but not including End. No match if End not found or match is zero-length. */\nexport function Until_1(end, input) {\n    return Match(Until(end, input), (Until, UntilRest) => IsEqual(Until, '')\n        ? [] // fail: match has no characters\n        : [Until, UntilRest], () => []); // fail: did not match Until\n}\n// deno-coverage-ignore-stop\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\n// ------------------------------------------------------------------\n//\n// This module was auto-generated by TypeBox's parser compiler\n// infrastructure (ParseBox). The source grammar is located at:\n//\n// Source: ./design/syntax/syntax.ts\n//\n// ------------------------------------------------------------------\nimport * as S from './mapping.mjs';\nimport * as Token from './token/index.mjs';\nconst If = (result, left, right = () => []) => result.length === 2 ? left(result) : right();\nexport const GenericParameterExtendsEquals = (input) => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('extends', input), ([_1, input]) => If(Type(input), ([_2, input]) => If(Token.Const('=', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.GenericParameterExtendsEqualsMapping(_0), input]);\nexport const GenericParameterExtends = (input) => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('extends', input), ([_1, input]) => If(Type(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericParameterExtendsMapping(_0), input]);\nexport const GenericParameterEquals = (input) => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('=', input), ([_1, input]) => If(Type(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericParameterEqualsMapping(_0), input]);\nexport const GenericParameterIdentifier = (input) => If(Token.Ident(input), ([_0, input]) => [S.GenericParameterIdentifierMapping(_0), input]);\nexport const GenericParameter = (input) => If(If(GenericParameterExtendsEquals(input), ([_0, input]) => [_0, input], () => If(GenericParameterExtends(input), ([_0, input]) => [_0, input], () => If(GenericParameterEquals(input), ([_0, input]) => [_0, input], () => If(GenericParameterIdentifier(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.GenericParameterMapping(_0), input]);\nexport const GenericParameterList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(GenericParameter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericParameterList_0(input, [...result, _0]), () => [result, input]);\nexport const GenericParameterList = (input) => If(If(If(GenericParameter(input), ([_0, input]) => If(GenericParameterList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.GenericParameterListMapping(_0), input]);\nexport const GenericParameters = (input) => If(If(Token.Const('<', input), ([_0, input]) => If(GenericParameterList(input), ([_1, input]) => If(Token.Const('>', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericParametersMapping(_0), input]);\nexport const GenericCallArgumentList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericCallArgumentList_0(input, [...result, _0]), () => [result, input]);\nexport const GenericCallArgumentList = (input) => If(If(If(Type(input), ([_0, input]) => If(GenericCallArgumentList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.GenericCallArgumentListMapping(_0), input]);\nexport const GenericCallArguments = (input) => If(If(Token.Const('<', input), ([_0, input]) => If(GenericCallArgumentList(input), ([_1, input]) => If(Token.Const('>', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericCallArgumentsMapping(_0), input]);\nexport const GenericCall = (input) => If(If(Token.Ident(input), ([_0, input]) => If(GenericCallArguments(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericCallMapping(_0), input]);\nexport const OptionalSemiColon = (input) => If(If(If(Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.OptionalSemiColonMapping(_0), input]);\nexport const KeywordString = (input) => If(Token.Const('string', input), ([_0, input]) => [S.KeywordStringMapping(_0), input]);\nexport const KeywordNumber = (input) => If(Token.Const('number', input), ([_0, input]) => [S.KeywordNumberMapping(_0), input]);\nexport const KeywordBoolean = (input) => If(Token.Const('boolean', input), ([_0, input]) => [S.KeywordBooleanMapping(_0), input]);\nexport const KeywordUndefined = (input) => If(Token.Const('undefined', input), ([_0, input]) => [S.KeywordUndefinedMapping(_0), input]);\nexport const KeywordNull = (input) => If(Token.Const('null', input), ([_0, input]) => [S.KeywordNullMapping(_0), input]);\nexport const KeywordInteger = (input) => If(Token.Const('integer', input), ([_0, input]) => [S.KeywordIntegerMapping(_0), input]);\nexport const KeywordBigInt = (input) => If(Token.Const('bigint', input), ([_0, input]) => [S.KeywordBigIntMapping(_0), input]);\nexport const KeywordUnknown = (input) => If(Token.Const('unknown', input), ([_0, input]) => [S.KeywordUnknownMapping(_0), input]);\nexport const KeywordAny = (input) => If(Token.Const('any', input), ([_0, input]) => [S.KeywordAnyMapping(_0), input]);\nexport const KeywordObject = (input) => If(Token.Const('object', input), ([_0, input]) => [S.KeywordObjectMapping(_0), input]);\nexport const KeywordNever = (input) => If(Token.Const('never', input), ([_0, input]) => [S.KeywordNeverMapping(_0), input]);\nexport const KeywordSymbol = (input) => If(Token.Const('symbol', input), ([_0, input]) => [S.KeywordSymbolMapping(_0), input]);\nexport const KeywordVoid = (input) => If(Token.Const('void', input), ([_0, input]) => [S.KeywordVoidMapping(_0), input]);\nexport const KeywordThis = (input) => If(Token.Const('this', input), ([_0, input]) => [S.KeywordThisMapping(_0), input]);\nexport const TemplateInterpolate = (input) => If(If(Token.Const('${', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.TemplateInterpolateMapping(_0), input]);\nexport const TemplateSpan = (input) => If(Token.Until(['${', '`'], input), ([_0, input]) => [S.TemplateSpanMapping(_0), input]);\nexport const TemplateBody = (input) => If(If(If(TemplateSpan(input), ([_0, input]) => If(TemplateInterpolate(input), ([_1, input]) => If(TemplateBody(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(If(TemplateSpan(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(TemplateSpan(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.TemplateBodyMapping(_0), input]);\nexport const TemplateLiteralTypes = (input) => If(If(Token.Const('`', input), ([_0, input]) => If(TemplateBody(input), ([_1, input]) => If(Token.Const('`', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.TemplateLiteralTypesMapping(_0), input]);\nexport const TemplateLiteral = (input) => If(TemplateLiteralTypes(input), ([_0, input]) => [S.TemplateLiteralMapping(_0), input]);\nexport const Dependent = (input) => If(If(If(Token.Const('if', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const('then', input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Token.Const('else', input), ([_4, input]) => If(Type(input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [_0, input], () => If(If(Token.Const('if', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const('then', input), ([_2, input]) => If(Type(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.DependentMapping(_0), input]);\nexport const LiteralBigInt = (input) => If(Token.BigInt(input), ([_0, input]) => [S.LiteralBigIntMapping(_0), input]);\nexport const LiteralBoolean = (input) => If(If(Token.Const('true', input), ([_0, input]) => [_0, input], () => If(Token.Const('false', input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.LiteralBooleanMapping(_0), input]);\nexport const LiteralNumber = (input) => If(Token.Number(input), ([_0, input]) => [S.LiteralNumberMapping(_0), input]);\nexport const LiteralString = (input) => If(Token.String(['\\'', '\\\"'], input), ([_0, input]) => [S.LiteralStringMapping(_0), input]);\nexport const KeyOf = (input) => If(If(If(Token.Const('keyof', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.KeyOfMapping(_0), input]);\nexport const IndexArray_0 = (input, result = []) => If(If(If(Token.Const('[', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(If(Token.Const('[', input), ([_0, input]) => If(Token.Const(']', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => IndexArray_0(input, [...result, _0]), () => [result, input]);\nexport const IndexArray = (input) => If(IndexArray_0(input), ([_0, input]) => [S.IndexArrayMapping(_0), input]);\nexport const Extends = (input) => If(If(If(Token.Const('extends', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const('?', input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Token.Const(':', input), ([_4, input]) => If(Type(input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExtendsMapping(_0), input]);\nexport const Base = (input) => If(If(If(Token.Const('(', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const(')', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordBoolean(input), ([_0, input]) => [_0, input], () => If(KeywordUndefined(input), ([_0, input]) => [_0, input], () => If(KeywordNull(input), ([_0, input]) => [_0, input], () => If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordBigInt(input), ([_0, input]) => [_0, input], () => If(KeywordUnknown(input), ([_0, input]) => [_0, input], () => If(KeywordAny(input), ([_0, input]) => [_0, input], () => If(KeywordObject(input), ([_0, input]) => [_0, input], () => If(KeywordNever(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => If(KeywordVoid(input), ([_0, input]) => [_0, input], () => If(KeywordThis(input), ([_0, input]) => [_0, input], () => If(LiteralBigInt(input), ([_0, input]) => [_0, input], () => If(LiteralBoolean(input), ([_0, input]) => [_0, input], () => If(LiteralNumber(input), ([_0, input]) => [_0, input], () => If(LiteralString(input), ([_0, input]) => [_0, input], () => If(TemplateLiteral(input), ([_0, input]) => [_0, input], () => If(Dependent(input), ([_0, input]) => [_0, input], () => If(_Object_(input), ([_0, input]) => [_0, input], () => If(_Tuple_(input), ([_0, input]) => [_0, input], () => If(_Constructor_(input), ([_0, input]) => [_0, input], () => If(_Function_(input), ([_0, input]) => [_0, input], () => If(_Mapped_(input), ([_0, input]) => [_0, input], () => If(GenericCall(input), ([_0, input]) => [_0, input], () => If(Reference(input), ([_0, input]) => [_0, input], () => [])))))))))))))))))))))))))))), ([_0, input]) => [S.BaseMapping(_0), input]);\nexport const With = (input) => If(If(If(Token.Const('with', input), ([_0, input]) => If(WithObject(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithMapping(_0), input]);\nexport const Factor = (input) => If(If(KeyOf(input), ([_0, input]) => If(Base(input), ([_1, input]) => If(IndexArray(input), ([_2, input]) => If(Extends(input), ([_3, input]) => If(With(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.FactorMapping(_0), input]);\nexport const ExprTermTail = (input) => If(If(If(Token.Const('&', input), ([_0, input]) => If(Factor(input), ([_1, input]) => If(ExprTermTail(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTermTailMapping(_0), input]);\nexport const ExprTerm = (input) => If(If(Factor(input), ([_0, input]) => If(ExprTermTail(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprTermMapping(_0), input]);\nexport const ExprTail = (input) => If(If(If(Token.Const('|', input), ([_0, input]) => If(ExprTerm(input), ([_1, input]) => If(ExprTail(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTailMapping(_0), input]);\nexport const Expr = (input) => If(If(ExprTerm(input), ([_0, input]) => If(ExprTail(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprMapping(_0), input]);\nexport const ExprReadonly = (input) => If(If(Token.Const('readonly', input), ([_0, input]) => If(Expr(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprReadonlyMapping(_0), input]);\nexport const ExprPipe = (input) => If(If(Token.Const('|', input), ([_0, input]) => If(Expr(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprPipeMapping(_0), input]);\nexport const GenericType = (input) => If(If(GenericParameters(input), ([_0, input]) => If(Token.Const('=', input), ([_1, input]) => If(Type(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericTypeMapping(_0), input]);\nexport const InferType = (input) => If(If(If(Token.Const('infer', input), ([_0, input]) => If(Token.Ident(input), ([_1, input]) => If(Token.Const('extends', input), ([_2, input]) => If(Expr(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [_0, input], () => If(If(Token.Const('infer', input), ([_0, input]) => If(Token.Ident(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.InferTypeMapping(_0), input]);\nexport const Type = (input) => If(If(InferType(input), ([_0, input]) => [_0, input], () => If(ExprPipe(input), ([_0, input]) => [_0, input], () => If(ExprReadonly(input), ([_0, input]) => [_0, input], () => If(Expr(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.TypeMapping(_0), input]);\nexport const PropertyKeyNumber = (input) => If(Token.Number(input), ([_0, input]) => [S.PropertyKeyNumberMapping(_0), input]);\nexport const PropertyKeyIdent = (input) => If(Token.Ident(input), ([_0, input]) => [S.PropertyKeyIdentMapping(_0), input]);\nexport const PropertyKeyQuoted = (input) => If(Token.String(['\\'', '\\\"'], input), ([_0, input]) => [S.PropertyKeyQuotedMapping(_0), input]);\nexport const PropertyKeyIndex = (input) => If(If(Token.Const('[', input), ([_0, input]) => If(Token.Ident(input), ([_1, input]) => If(Token.Const(':', input), ([_2, input]) => If(If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => [])))), ([_3, input]) => If(Token.Const(']', input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.PropertyKeyIndexMapping(_0), input]);\nexport const PropertyKey = (input) => If(If(PropertyKeyNumber(input), ([_0, input]) => [_0, input], () => If(PropertyKeyIdent(input), ([_0, input]) => [_0, input], () => If(PropertyKeyQuoted(input), ([_0, input]) => [_0, input], () => If(PropertyKeyIndex(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.PropertyKeyMapping(_0), input]);\nexport const Readonly = (input) => If(If(If(Token.Const('readonly', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ReadonlyMapping(_0), input]);\nexport const Optional = (input) => If(If(If(Token.Const('?', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.OptionalMapping(_0), input]);\nexport const Property = (input) => If(If(Readonly(input), ([_0, input]) => If(PropertyKey(input), ([_1, input]) => If(Optional(input), ([_2, input]) => If(Token.Const(':', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.PropertyMapping(_0), input]);\nexport const PropertyDelimiter = (input) => If(If(If(Token.Const(',', input), ([_0, input]) => If(Token.Const('\\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const(';', input), ([_0, input]) => If(Token.Const('\\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Token.Const('\\n', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))))), ([_0, input]) => [S.PropertyDelimiterMapping(_0), input]);\nexport const PropertyList_0 = (input, result = []) => If(If(PropertyDelimiter(input), ([_0, input]) => If(Property(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => PropertyList_0(input, [...result, _0]), () => [result, input]);\nexport const PropertyList = (input) => If(If(If(Property(input), ([_0, input]) => If(PropertyList_0(input), ([_1, input]) => If(If(PropertyDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.PropertyListMapping(_0), input]);\nexport const Properties = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(PropertyList(input), ([_1, input]) => If(Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.PropertiesMapping(_0), input]);\nexport const _Object_ = (input) => If(Properties(input), ([_0, input]) => [S._Object_Mapping(_0), input]);\nexport const ElementNamed = (input) => If(If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => If(Token.Const(':', input), ([_2, input]) => If(Token.Const('readonly', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [_0, input], () => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(Token.Const('readonly', input), ([_2, input]) => If(Type(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [_0, input], () => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => If(Token.Const(':', input), ([_2, input]) => If(Type(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [_0, input], () => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(Type(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.ElementNamedMapping(_0), input]);\nexport const ElementBase = (input) => If(If(ElementNamed(input), ([_0, input]) => [_0, input], () => If(If(Readonly(input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Optional(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ElementBaseMapping(_0), input]);\nexport const Element = (input) => If(If(If(Token.Const('...', input), ([_0, input]) => If(ElementBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ElementBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ElementMapping(_0), input]);\nexport const ElementList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(Element(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ElementList_0(input, [...result, _0]), () => [result, input]);\nexport const ElementList = (input) => If(If(If(Element(input), ([_0, input]) => If(ElementList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ElementListMapping(_0), input]);\nexport const _Tuple_ = (input) => If(If(Token.Const('[', input), ([_0, input]) => If(ElementList(input), ([_1, input]) => If(Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S._Tuple_Mapping(_0), input]);\nexport const ParameterReadonlyOptional = (input) => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => If(Token.Const(':', input), ([_2, input]) => If(Token.Const('readonly', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.ParameterReadonlyOptionalMapping(_0), input]);\nexport const ParameterReadonly = (input) => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(Token.Const('readonly', input), ([_2, input]) => If(Type(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ParameterReadonlyMapping(_0), input]);\nexport const ParameterOptional = (input) => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => If(Token.Const(':', input), ([_2, input]) => If(Type(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ParameterOptionalMapping(_0), input]);\nexport const ParameterType = (input) => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(Type(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ParameterTypeMapping(_0), input]);\nexport const ParameterBase = (input) => If(If(ParameterReadonlyOptional(input), ([_0, input]) => [_0, input], () => If(ParameterReadonly(input), ([_0, input]) => [_0, input], () => If(ParameterOptional(input), ([_0, input]) => [_0, input], () => If(ParameterType(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.ParameterBaseMapping(_0), input]);\nexport const Parameter = (input) => If(If(If(Token.Const('...', input), ([_0, input]) => If(ParameterBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ParameterBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ParameterMapping(_0), input]);\nexport const ParameterList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(Parameter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ParameterList_0(input, [...result, _0]), () => [result, input]);\nexport const ParameterList = (input) => If(If(If(Parameter(input), ([_0, input]) => If(ParameterList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ParameterListMapping(_0), input]);\nexport const _Function_ = (input) => If(If(Token.Const('(', input), ([_0, input]) => If(ParameterList(input), ([_1, input]) => If(Token.Const(')', input), ([_2, input]) => If(Token.Const('=>', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S._Function_Mapping(_0), input]);\nexport const _Constructor_ = (input) => If(If(Token.Const('new', input), ([_0, input]) => If(Token.Const('(', input), ([_1, input]) => If(ParameterList(input), ([_2, input]) => If(Token.Const(')', input), ([_3, input]) => If(Token.Const('=>', input), ([_4, input]) => If(Type(input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S._Constructor_Mapping(_0), input]);\nexport const MappedReadonly = (input) => If(If(If(Token.Const('+', input), ([_0, input]) => If(Token.Const('readonly', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const('-', input), ([_0, input]) => If(Token.Const('readonly', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const('readonly', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.MappedReadonlyMapping(_0), input]);\nexport const MappedOptional = (input) => If(If(If(Token.Const('+', input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const('-', input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const('?', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.MappedOptionalMapping(_0), input]);\nexport const MappedAs = (input) => If(If(If(Token.Const('as', input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.MappedAsMapping(_0), input]);\nexport const _Mapped_ = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(MappedReadonly(input), ([_1, input]) => If(Token.Const('[', input), ([_2, input]) => If(Token.Ident(input), ([_3, input]) => If(Token.Const('in', input), ([_4, input]) => If(Type(input), ([_5, input]) => If(MappedAs(input), ([_6, input]) => If(Token.Const(']', input), ([_7, input]) => If(MappedOptional(input), ([_8, input]) => If(Token.Const(':', input), ([_9, input]) => If(Type(input), ([_10, input]) => If(OptionalSemiColon(input), ([_11, input]) => If(Token.Const('}', input), ([_12, input]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12], input]))))))))))))), ([_0, input]) => [S._Mapped_Mapping(_0), input]);\nexport const Reference = (input) => If(Token.Ident(input), ([_0, input]) => [S.ReferenceMapping(_0), input]);\nexport const WithBigInt = (input) => If(Token.BigInt(input), ([_0, input]) => [S.WithBigIntMapping(_0), input]);\nexport const WithNumber = (input) => If(Token.Number(input), ([_0, input]) => [S.WithNumberMapping(_0), input]);\nexport const WithBoolean = (input) => If(If(Token.Const('true', input), ([_0, input]) => [_0, input], () => If(Token.Const('false', input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithBooleanMapping(_0), input]);\nexport const WithString = (input) => If(Token.String(['\\\"', '\\''], input), ([_0, input]) => [S.WithStringMapping(_0), input]);\nexport const WithNull = (input) => If(Token.Const('null', input), ([_0, input]) => [S.WithNullMapping(_0), input]);\nexport const WithUndefined = (input) => If(Token.Const('undefined', input), ([_0, input]) => [S.WithUndefinedMapping(_0), input]);\nexport const WithProperty = (input) => If(If(PropertyKey(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(WithValue(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.WithPropertyMapping(_0), input]);\nexport const WithPropertyList_0 = (input, result = []) => If(If(PropertyDelimiter(input), ([_0, input]) => If(WithProperty(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithPropertyList_0(input, [...result, _0]), () => [result, input]);\nexport const WithPropertyList = (input) => If(If(If(WithProperty(input), ([_0, input]) => If(WithPropertyList_0(input), ([_1, input]) => If(If(PropertyDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithPropertyListMapping(_0), input]);\nexport const WithObject = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(WithPropertyList(input), ([_1, input]) => If(Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.WithObjectMapping(_0), input]);\nexport const WithElementList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(WithValue(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithElementList_0(input, [...result, _0]), () => [result, input]);\nexport const WithElementList = (input) => If(If(If(WithValue(input), ([_0, input]) => If(WithElementList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithElementListMapping(_0), input]);\nexport const WithArray = (input) => If(If(Token.Const('[', input), ([_0, input]) => If(WithElementList(input), ([_1, input]) => If(Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.WithArrayMapping(_0), input]);\nexport const WithValue = (input) => If(If(WithBigInt(input), ([_0, input]) => [_0, input], () => If(WithNumber(input), ([_0, input]) => [_0, input], () => If(WithBoolean(input), ([_0, input]) => [_0, input], () => If(WithString(input), ([_0, input]) => [_0, input], () => If(WithNull(input), ([_0, input]) => [_0, input], () => If(WithUndefined(input), ([_0, input]) => [_0, input], () => If(WithObject(input), ([_0, input]) => [_0, input], () => If(WithArray(input), ([_0, input]) => [_0, input], () => [])))))))), ([_0, input]) => [S.WithValueMapping(_0), input]);\nexport const PatternBigInt = (input) => If(Token.Const('-?(?:0|[1-9][0-9]*)n', input), ([_0, input]) => [S.PatternBigIntMapping(_0), input]);\nexport const PatternString = (input) => If(Token.Const('.*', input), ([_0, input]) => [S.PatternStringMapping(_0), input]);\nexport const PatternNumber = (input) => If(Token.Const('-?(?:0|[1-9][0-9]*)(?:\\\\.[0-9]+)?', input), ([_0, input]) => [S.PatternNumberMapping(_0), input]);\nexport const PatternInteger = (input) => If(Token.Const('-?(?:0|[1-9][0-9]*)', input), ([_0, input]) => [S.PatternIntegerMapping(_0), input]);\nexport const PatternNever = (input) => If(Token.Const('(?!)', input), ([_0, input]) => [S.PatternNeverMapping(_0), input]);\nexport const PatternText = (input) => If(Token.Until_1(['-?(?:0|[1-9][0-9]*)n', '.*', '-?(?:0|[1-9][0-9]*)(?:\\\\.[0-9]+)?', '-?(?:0|[1-9][0-9]*)', '(?!)', '(', ')', '$', '|'], input), ([_0, input]) => [S.PatternTextMapping(_0), input]);\nexport const PatternBase = (input) => If(If(PatternBigInt(input), ([_0, input]) => [_0, input], () => If(PatternString(input), ([_0, input]) => [_0, input], () => If(PatternNumber(input), ([_0, input]) => [_0, input], () => If(PatternInteger(input), ([_0, input]) => [_0, input], () => If(PatternNever(input), ([_0, input]) => [_0, input], () => If(PatternGroup(input), ([_0, input]) => [_0, input], () => If(PatternText(input), ([_0, input]) => [_0, input], () => []))))))), ([_0, input]) => [S.PatternBaseMapping(_0), input]);\nexport const PatternGroup = (input) => If(If(Token.Const('(', input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Token.Const(')', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.PatternGroupMapping(_0), input]);\nexport const PatternUnion = (input) => If(If(If(PatternTerm(input), ([_0, input]) => If(Token.Const('|', input), ([_1, input]) => If(PatternUnion(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(If(PatternTerm(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.PatternUnionMapping(_0), input]);\nexport const PatternTerm = (input) => If(If(PatternBase(input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.PatternTermMapping(_0), input]);\nexport const PatternBody = (input) => If(If(PatternUnion(input), ([_0, input]) => [_0, input], () => If(PatternTerm(input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.PatternBodyMapping(_0), input]);\nexport const Pattern = (input) => If(If(Token.Const('^', input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Token.Const('$', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.PatternMapping(_0), input]);\nexport const InterfaceDeclarationHeritageList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => InterfaceDeclarationHeritageList_0(input, [...result, _0]), () => [result, input]);\nexport const InterfaceDeclarationHeritageList = (input) => If(If(If(Type(input), ([_0, input]) => If(InterfaceDeclarationHeritageList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.InterfaceDeclarationHeritageListMapping(_0), input]);\nexport const InterfaceDeclarationHeritage = (input) => If(If(If(Token.Const('extends', input), ([_0, input]) => If(InterfaceDeclarationHeritageList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.InterfaceDeclarationHeritageMapping(_0), input]);\nexport const InterfaceDeclarationGeneric = (input) => If(If(Token.Const('interface', input), ([_0, input]) => If(Token.Ident(input), ([_1, input]) => If(GenericParameters(input), ([_2, input]) => If(InterfaceDeclarationHeritage(input), ([_3, input]) => If(Properties(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.InterfaceDeclarationGenericMapping(_0), input]);\nexport const InterfaceDeclaration = (input) => If(If(Token.Const('interface', input), ([_0, input]) => If(Token.Ident(input), ([_1, input]) => If(InterfaceDeclarationHeritage(input), ([_2, input]) => If(Properties(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.InterfaceDeclarationMapping(_0), input]);\nexport const TypeAliasDeclarationGeneric = (input) => If(If(Token.Const('type', input), ([_0, input]) => If(Token.Ident(input), ([_1, input]) => If(GenericParameters(input), ([_2, input]) => If(Token.Const('=', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.TypeAliasDeclarationGenericMapping(_0), input]);\nexport const TypeAliasDeclaration = (input) => If(If(Token.Const('type', input), ([_0, input]) => If(Token.Ident(input), ([_1, input]) => If(Token.Const('=', input), ([_2, input]) => If(Type(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.TypeAliasDeclarationMapping(_0), input]);\nexport const ExportKeyword = (input) => If(If(If(Token.Const('export', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExportKeywordMapping(_0), input]);\nexport const ModuleDeclarationDelimiter = (input) => If(If(If(Token.Const(';', input), ([_0, input]) => If(Token.Const('\\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Token.Const('\\n', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.ModuleDeclarationDelimiterMapping(_0), input]);\nexport const ModuleDeclarationList_0 = (input, result = []) => If(If(ModuleDeclarationDelimiter(input), ([_0, input]) => If(ModuleDeclaration(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ModuleDeclarationList_0(input, [...result, _0]), () => [result, input]);\nexport const ModuleDeclarationList = (input) => If(If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList_0(input), ([_1, input]) => If(If(ModuleDeclarationDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ModuleDeclarationListMapping(_0), input]);\nexport const ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input]) => If(If(InterfaceDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(InterfaceDeclaration(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclaration(input), ([_0, input]) => [_0, input], () => [])))), ([_1, input]) => If(OptionalSemiColon(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ModuleDeclarationMapping(_0), input]);\nexport const Module = (input) => If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ModuleMapping(_0), input]);\nexport const Script = (input) => If(If(Module(input), ([_0, input]) => [_0, input], () => If(GenericType(input), ([_0, input]) => [_0, input], () => If(Type(input), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.ScriptMapping(_0), input]);\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsEnum } from '../../types/enum.mjs';\nimport { Literal, IsLiteral } from '../../types/literal.mjs';\nimport { Union, IsUnion } from '../../types/union.mjs';\nimport { IsTemplateLiteral, IsTemplateLiteralDeferred } from '../../types/template_literal.mjs';\nimport { IsBigInt, BigIntPattern } from '../../types/bigint.mjs';\nimport { IsString, StringPattern } from '../../types/string.mjs';\nimport { IsNumber, NumberPattern } from '../../types/number.mjs';\nimport { IsInteger, IntegerPattern } from '../../types/integer.mjs';\nimport { IsBoolean } from '../../types/boolean.mjs';\nimport { NeverPattern } from '../../types/never.mjs';\nimport { TemplateLiteralCreate } from './create.mjs';\nimport { EvaluateEnum } from '../evaluate/evaluate.mjs';\nimport { TemplateLiteralAction } from './instantiate.mjs';\nfunction JoinString(input) {\n    return input.join('|');\n}\nfunction UnwrapTemplateLiteralPattern(pattern) {\n    return pattern.slice(1, pattern.length - 1);\n}\nfunction EncodeLiteral(value, right, pattern) {\n    return EncodeTypes(right, `${pattern}${value}`);\n}\nfunction EncodeBigInt(right, pattern) {\n    return EncodeTypes(right, `${pattern}${BigIntPattern}`);\n}\nfunction EncodeInteger(right, pattern) {\n    return EncodeTypes(right, `${pattern}${IntegerPattern}`);\n}\nfunction EncodeNumber(right, pattern) {\n    return EncodeTypes(right, `${pattern}${NumberPattern}`);\n}\nfunction EncodeBoolean(right, pattern) {\n    return EncodeType(Union([Literal('false'), Literal('true')]), right, pattern);\n}\nfunction EncodeString(right, pattern) {\n    return EncodeTypes(right, `${pattern}${StringPattern}`);\n}\nfunction EncodeTemplateLiteral(templatePattern, right, pattern) {\n    return EncodeTypes(right, `${pattern}${UnwrapTemplateLiteralPattern(templatePattern)}`);\n}\nfunction EncodeTemplateLiteralDeferred(types, right, pattern) {\n    const templateLiteral = TemplateLiteralAction(types, {});\n    const result = EncodeType(templateLiteral, right, pattern);\n    return result;\n}\nfunction EncodeEnum(values, right, pattern) {\n    const evaluated = EvaluateEnum(values);\n    return EncodeType(evaluated, right, pattern);\n}\nfunction EncodeUnion(types, right, pattern, result = []) {\n    return Guard.ShiftLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], '')]), () => EncodeTypes(right, `${pattern}(${JoinString(result)})`));\n}\nfunction EncodeType(type, right, pattern) {\n    return (IsEnum(type) ? EncodeEnum(type.enum, right, pattern) :\n        IsInteger(type) ? EncodeInteger(right, pattern) :\n            IsLiteral(type) ? EncodeLiteral(type.const, right, pattern) :\n                IsBigInt(type) ? EncodeBigInt(right, pattern) :\n                    IsBoolean(type) ? EncodeBoolean(right, pattern) :\n                        IsNumber(type) ? EncodeNumber(right, pattern) :\n                            IsString(type) ? EncodeString(right, pattern) :\n                                IsTemplateLiteral(type) ? EncodeTemplateLiteral(type.pattern, right, pattern) :\n                                    IsTemplateLiteralDeferred(type) ? EncodeTemplateLiteralDeferred(type.parameters[0], right, pattern) :\n                                        IsUnion(type) ? EncodeUnion(type.anyOf, right, pattern) :\n                                            NeverPattern);\n}\nfunction EncodeTypes(types, pattern) {\n    return Guard.ShiftLeft(types, (left, right) => EncodeType(left, right, pattern), () => pattern);\n}\nfunction EncodePattern(types) {\n    const encoded = EncodeTypes(types, '');\n    const result = `^${encoded}$`;\n    return result;\n}\n/** Encodes a TemplateLiteral type sequence into a TemplateLiteral */\nexport function TemplateLiteralEncode(types) {\n    const pattern = EncodePattern(types);\n    const result = TemplateLiteralCreate(pattern);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { TemplateLiteralDeferred } from '../../types/template_literal.mjs';\nimport { TemplateLiteralEncode } from './encode.mjs';\nimport { InstantiateTypes, CanInstantiate } from '../instantiate.mjs';\nexport function TemplateLiteralAction(types, options) {\n    const result = CanInstantiate(types)\n        ? Memory.Update(TemplateLiteralEncode(types), {}, options)\n        : TemplateLiteralDeferred(types, options);\n    return result;\n}\nexport function TemplateLiteralInstantiate(context, state, types, options) {\n    const instantiatedTypes = InstantiateTypes(context, state, types);\n    return TemplateLiteralAction(instantiatedTypes, options);\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Memory } from '../../system/system.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema, IsKind } from './schema.mjs';\nimport { Deferred } from './deferred.mjs';\nimport { ParseTemplateIntoTypes } from '../engine/patterns/template.mjs';\nimport { TemplateLiteralAction } from '../engine/template_literal/instantiate.mjs';\n/** Creates a deferred TemplateLiteral action. */\nexport function TemplateLiteralDeferred(types, options = {}) {\n    return Deferred('TemplateLiteral', [types], options);\n}\n/** Returns true if this value is a deferred Interface action. */\nexport function IsTemplateLiteralDeferred(value) {\n    return IsSchema(value)\n        && Guard.HasPropertyKey(value, 'action')\n        && Guard.IsEqual(value.action, 'TemplateLiteral');\n}\nexport function TemplateLiteralFromTypes(types) {\n    return TemplateLiteralAction(types, {});\n}\nexport function TemplateLiteralFromString(template) {\n    const types = ParseTemplateIntoTypes(template);\n    return TemplateLiteralFromTypes(types);\n}\n/** Creates a TemplateLiteral type. */\nexport function TemplateLiteral(input, options = {}) {\n    const type = Guard.IsString(input) ? TemplateLiteralFromString(input) : TemplateLiteralFromTypes(input);\n    return Memory.Update(type, {}, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TTemplateLiteral. */\nexport function IsTemplateLiteral(value) {\n    return IsKind(value, 'TemplateLiteral');\n}\n","import { Guard } from '../../guard/index.mjs';\nimport { Memory } from '../../system/memory/index.mjs';\nexport function ExtendsUnion(inferred) {\n    return Memory.Create({ ['~kind']: 'ExtendsUnion' }, { inferred });\n}\nexport function IsExtendsUnion(value) {\n    return Guard.IsObject(value) &&\n        Guard.HasPropertyKey(value, '~kind') &&\n        Guard.HasPropertyKey(value, 'inferred') &&\n        Guard.IsEqual(value['~kind'], 'ExtendsUnion') &&\n        Guard.IsObject(value.inferred);\n}\nexport function ExtendsTrue(inferred) {\n    return Memory.Create({ ['~kind']: 'ExtendsTrue' }, { inferred });\n}\nexport function IsExtendsTrue(value) {\n    return Guard.IsObject(value) &&\n        Guard.HasPropertyKey(value, '~kind') &&\n        Guard.HasPropertyKey(value, 'inferred') &&\n        Guard.IsEqual(value['~kind'], 'ExtendsTrue') &&\n        Guard.IsObject(value.inferred);\n}\nexport function ExtendsFalse() {\n    return Memory.Create({ ['~kind']: 'ExtendsFalse' }, {});\n}\nexport function IsExtendsFalse(value) {\n    return Guard.IsObject(value) &&\n        Guard.HasPropertyKey(value, '~kind') &&\n        Guard.IsEqual(value['~kind'], 'ExtendsFalse');\n}\nexport function IsExtendsTrueLike(value) {\n    return IsExtendsUnion(value) || IsExtendsTrue(value);\n}\nexport function Match(result, true_, false_) {\n    return IsExtendsTrueLike(result) ? true_(result.inferred) : false_();\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsAny } from '../types/any.mjs';\nimport { IsDependent } from '../types/dependent.mjs';\nimport { IsEnum } from '../types/enum.mjs';\nimport { IsInfer } from '../types/infer.mjs';\nimport { IsIntersect } from '../types/intersect.mjs';\nimport { IsTemplateLiteral } from '../types/template_literal.mjs';\nimport { IsUnion } from '../types/union.mjs';\nimport { IsUnknown } from '../types/unknown.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport * as Result from './result.mjs';\nimport { EvaluateEnum } from '../engine/evaluate/evaluate.mjs';\nimport { EvaluateTemplateLiteral } from '../engine/evaluate/evaluate.mjs';\nfunction ExtendsRightInfer(inferred, name, left, right) {\n    return Result.Match(ExtendsLeft(inferred, left, right), checkInferred => Result.ExtendsTrue(Memory.Assign(Memory.Assign(inferred, checkInferred), { [name]: left })), () => Result.ExtendsFalse());\n}\nfunction ExtendsRightAny(inferred, _left) {\n    return Result.ExtendsTrue(inferred);\n}\nfunction ExtendsRightDependent(inferred, left, if_, then_, else_) {\n    return Result.Match(ExtendsLeft(inferred, left, if_), inferred => Result.Match(ExtendsLeft(inferred, left, then_), inferred => Result.ExtendsTrue(inferred), () => Result.ExtendsFalse()), () => Result.Match(ExtendsLeft(inferred, left, else_), inferred => Result.ExtendsTrue(inferred), () => Result.ExtendsFalse()));\n}\nfunction ExtendsRightEnum(inferred, left, right) {\n    const evaluated = EvaluateEnum(right);\n    return ExtendsLeft(inferred, left, evaluated);\n}\nfunction ExtendsRightIntersect(inferred, left, right) {\n    return Guard.ShiftLeft(right, (head, tail) => Result.Match(ExtendsLeft(inferred, left, head), inferred => ExtendsRightIntersect(inferred, left, tail), () => Result.ExtendsFalse()), () => Result.ExtendsTrue(inferred));\n}\nfunction ExtendsRightTemplateLiteral(inferred, left, right) {\n    const evaluated = EvaluateTemplateLiteral(right);\n    return ExtendsLeft(inferred, left, evaluated);\n}\nfunction ExtendsRightUnion(inferred, left, right) {\n    return Guard.ShiftLeft(right, (head, tail) => Result.Match(ExtendsLeft(inferred, left, head), inferred => Result.ExtendsTrue(inferred), () => ExtendsRightUnion(inferred, left, tail)), () => Result.ExtendsFalse());\n}\nexport function ExtendsRight(inferred, left, right) {\n    return (IsAny(right) ? ExtendsRightAny(inferred, left) :\n        IsDependent(right) ? ExtendsRightDependent(inferred, left, right.if, right.then, right.else) :\n            IsEnum(right) ? ExtendsRightEnum(inferred, left, right.enum) :\n                IsInfer(right) ? ExtendsRightInfer(inferred, right.name, left, right.extends) :\n                    IsIntersect(right) ? ExtendsRightIntersect(inferred, left, right.allOf) :\n                        IsTemplateLiteral(right) ? ExtendsRightTemplateLiteral(inferred, left, right.pattern) :\n                            IsUnion(right) ? ExtendsRightUnion(inferred, left, right.anyOf) :\n                                IsUnknown(right) ? Result.ExtendsTrue(inferred) :\n                                    Result.ExtendsFalse());\n}\n","// deno-fmt-ignore-file\nimport { IsInfer } from '../types/infer.mjs';\nimport { IsAny } from '../types/any.mjs';\nimport { IsUnknown } from '../types/unknown.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsAny(inferred, left, right) {\n    return (IsInfer(right) ? ExtendsRight(inferred, left, right) :\n        IsAny(right) ? Result.ExtendsTrue(inferred) :\n            IsUnknown(right) ? Result.ExtendsTrue(inferred) :\n                Result.ExtendsUnion(inferred));\n}\n","// deno-fmt-ignore-file\nimport { IsArray } from '../types/array.mjs';\nimport { IsImmutable } from '../types/_immutable.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport * as Result from './result.mjs';\nfunction ExtendsImmutable(left, right) {\n    const isImmutableLeft = IsImmutable(left);\n    const isImmutableRight = IsImmutable(right);\n    return (isImmutableLeft && isImmutableRight ? true :\n        !isImmutableLeft && isImmutableRight ? true :\n            isImmutableLeft && !isImmutableRight ? false :\n                true);\n}\nexport function ExtendsArray(inferred, arrayLeft, left, right) {\n    return (IsArray(right)\n        ? ExtendsImmutable(arrayLeft, right)\n            ? ExtendsLeft(inferred, left, right.items)\n            : Result.ExtendsFalse()\n        : ExtendsRight(inferred, arrayLeft, right));\n}\n","// deno-fmt-ignore-file\nimport { IsBigInt } from '../types/bigint.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsBigInt(inferred, left, right) {\n    return (IsBigInt(right)\n        ? Result.ExtendsTrue(inferred)\n        : ExtendsRight(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { IsBoolean } from '../types/boolean.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsBoolean(inferred, left, right) {\n    return (IsBoolean(right)\n        ? Result.ExtendsTrue(inferred)\n        : ExtendsRight(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsInfer } from '../types/infer.mjs';\nimport { IsOptional } from '../types/_optional.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport * as Result from './result.mjs';\nfunction ParameterCompare(inferred, left, leftRest, right, rightRest) {\n    // Parameter extends Right on Left, except when infer Right  \n    const checkLeft = IsInfer(right) ? left : right;\n    const checkRight = IsInfer(right) ? right : left;\n    const isLeftOptional = IsOptional(left);\n    const isRightOptional = IsOptional(right);\n    return ((!isLeftOptional && isRightOptional)\n        ? Result.ExtendsFalse() // 'fail: left-required-but-right-is-optional'\n        : Result.Match(ExtendsLeft(inferred, checkLeft, checkRight), inferred => ExtendsParameters(inferred, leftRest, rightRest), () => Result.ExtendsFalse()) // 'fail: left-and-right-did-not-match'\n    );\n}\nfunction ParameterRight(inferred, left, leftRest, rightRest) {\n    return Guard.ShiftLeft(rightRest, (head, tail) => ParameterCompare(inferred, left, leftRest, head, tail), () => IsOptional(left) // 'right-did-not-have-enough-elements'\n        ? Result.ExtendsTrue(inferred) // 'ok: left was optional'\n        : Result.ExtendsFalse()); // 'fail: left was required'\n}\nfunction ParametersLeft(inferred, left, rightRest) {\n    return Guard.ShiftLeft(left, (head, tail) => ParameterRight(inferred, head, tail, rightRest), () => Result.ExtendsTrue(inferred)); // 'ok: no-more-elements-in-left'\n}\nexport function ExtendsParameters(inferred, left, right) {\n    return ParametersLeft(inferred, left, right);\n}\n","// deno-fmt-ignore-file\nimport { IsVoid } from '../types/void.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsReturnType(inferred, left, right) {\n    return (IsVoid(right)\n        ? Result.ExtendsTrue(inferred)\n        : ExtendsLeft(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { IsAny } from '../types/any.mjs';\nimport { IsConstructor } from '../types/constructor.mjs';\nimport { IsUnknown } from '../types/unknown.mjs';\nimport * as Result from './result.mjs';\n// ------------------------------------------------------------------\n// Parameters | ReturnType\n// ------------------------------------------------------------------ \nimport { ExtendsParameters } from './parameters.mjs';\nimport { ExtendsReturnType } from './return_type.mjs';\nexport function ExtendsConstructor(inferred, parameters, returnType, right) {\n    return (IsAny(right) ? Result.ExtendsTrue(inferred) :\n        IsUnknown(right) ? Result.ExtendsTrue(inferred) :\n            IsConstructor(right) ? Result.Match(ExtendsParameters(inferred, parameters, right['parameters']), inferred => ExtendsReturnType(inferred, returnType, right['instanceType']), () => Result.ExtendsFalse()) // 'not-a-parameter-match'\n                : Result.ExtendsFalse() // 'not-a-constructor'\n    );\n}\n","// deno-fmt-ignore-file\nimport { ExtendsLeft } from './extends_left.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsDependent(inferred, if_, then_, else_, right) {\n    return Result.Match(ExtendsLeft(inferred, if_, right), () => ExtendsLeft(inferred, then_, right), () => ExtendsLeft(inferred, else_, right));\n}\n","// deno-fmt-ignore-file\nimport { ExtendsLeft } from './extends_left.mjs';\nimport { EvaluateEnum } from '../engine/evaluate/evaluate.mjs';\nexport function ExtendsEnum(inferred, left, right) {\n    const evaluated = EvaluateEnum(left);\n    return ExtendsLeft(inferred, evaluated, right);\n}\n","// deno-fmt-ignore-file\nimport { IsAny } from '../types/any.mjs';\nimport { IsFunction } from '../types/function.mjs';\nimport { IsUnknown } from '../types/unknown.mjs';\nimport * as Result from './result.mjs';\n// ------------------------------------------------------------------\n// Parameters | ReturnType\n// ------------------------------------------------------------------ \nimport { ExtendsParameters } from './parameters.mjs';\nimport { ExtendsReturnType } from './return_type.mjs';\nexport function ExtendsFunction(inferred, parameters, returnType, right) {\n    return (IsAny(right) ? Result.ExtendsTrue(inferred) :\n        IsUnknown(right) ? Result.ExtendsTrue(inferred) :\n            IsFunction(right) ? Result.Match(ExtendsParameters(inferred, parameters, right['parameters']), inferred => ExtendsReturnType(inferred, returnType, right['returnType']), () => Result.ExtendsFalse()) // 'not-a-parameter-match'\n                : Result.ExtendsFalse() // 'not-a-function'\n    );\n}\n","// deno-fmt-ignore-file\nimport { IsInteger } from '../types/integer.mjs';\nimport { IsNumber } from '../types/number.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsInteger(inferred, left, right) {\n    return (IsInteger(right) ? Result.ExtendsTrue(inferred) :\n        IsNumber(right) ? Result.ExtendsTrue(inferred) :\n            ExtendsRight(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { ExtendsLeft } from './extends_left.mjs';\n// ----------------------------------------------------------------------------\n// ExtendsIntersect\n//\n// This function evaluates the intersection and continues. This is different\n// to IntersectRight which MUST enumerate each type to derive Inferred. Left \n// side types do not infer so it should be ok to do this.\n//\n// ----------------------------------------------------------------------------\nimport { EvaluateIntersect } from '../engine/evaluate/index.mjs';\nexport function ExtendsIntersect(inferred, left, right) {\n    const evaluated = EvaluateIntersect(left);\n    return ExtendsLeft(inferred, evaluated, right);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Unreachable } from '../../system/unreachable/unreachable.mjs';\nimport { IsLiteral, Literal } from '../types/literal.mjs';\nimport { IsBigInt } from '../types/bigint.mjs';\nimport { IsBoolean } from '../types/boolean.mjs';\nimport { IsNumber } from '../types/number.mjs';\nimport { IsString } from '../types/string.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nfunction ExtendsLiteralValue(inferred, left, right) {\n    return (left === right\n        ? Result.ExtendsTrue(inferred)\n        : Result.ExtendsFalse());\n}\nfunction ExtendsLiteralBigInt(inferred, left, right) {\n    return (IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) :\n        IsBigInt(right) ? Result.ExtendsTrue(inferred) :\n            ExtendsRight(inferred, Literal(left), right));\n}\nfunction ExtendsLiteralBoolean(inferred, left, right) {\n    return (IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) :\n        IsBoolean(right) ? Result.ExtendsTrue(inferred) :\n            ExtendsRight(inferred, Literal(left), right));\n}\nfunction ExtendsLiteralNumber(inferred, left, right) {\n    return (IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) :\n        IsNumber(right) ? Result.ExtendsTrue(inferred) :\n            ExtendsRight(inferred, Literal(left), right));\n}\nfunction ExtendsLiteralString(inferred, left, right) {\n    return (IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) :\n        IsString(right) ? Result.ExtendsTrue(inferred) :\n            ExtendsRight(inferred, Literal(left), right));\n}\nexport function ExtendsLiteral(inferred, left, right) {\n    return (Guard.IsBigInt(left.const) ? ExtendsLiteralBigInt(inferred, left.const, right) :\n        Guard.IsBoolean(left.const) ? ExtendsLiteralBoolean(inferred, left.const, right) :\n            Guard.IsNumber(left.const) ? ExtendsLiteralNumber(inferred, left.const, right) :\n                Guard.IsString(left.const) ? ExtendsLiteralString(inferred, left.const, right) :\n                    Unreachable() // ExtendsRight(inferred, left, right)\n    );\n}\n// deno-coverage-ignore-stop\n","// deno-fmt-ignore-file\nimport { IsInfer } from '../types/infer.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsNever(inferred, left, right) {\n    return (IsInfer(right)\n        ? ExtendsRight(inferred, left, right)\n        : Result.ExtendsTrue(inferred));\n}\n","// deno-fmt-ignore-file\nimport { IsNull } from '../types/null.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsNull(inferred, left, right) {\n    return (IsNull(right)\n        ? Result.ExtendsTrue(inferred)\n        : ExtendsRight(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { IsNumber } from '../types/number.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsNumber(inferred, left, right) {\n    return (IsNumber(right)\n        ? Result.ExtendsTrue(inferred)\n        : ExtendsRight(inferred, left, right));\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Unreachable } from '../../system/unreachable/index.mjs';\nimport { Memory } from '../../system/memory/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsOptional } from '../types/_optional.mjs';\nimport { IsInfer } from '../types/infer.mjs';\nimport { IsNever } from '../types/never.mjs';\nimport { IsObject, Object } from '../types/object.mjs';\nimport { IsRecord, RecordPattern, RecordValue } from '../types/record.mjs';\nimport { Union, IsUnion } from '../types/union.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nfunction ExtendsPropertyOptional(inferred, left, right) {\n    return (IsOptional(left)\n        ? IsOptional(right)\n            ? Result.ExtendsTrue(inferred)\n            : Result.ExtendsFalse()\n        : Result.ExtendsTrue(inferred));\n}\nfunction ExtendsProperty(inferred, left, right) {\n    return (\n    // Right TInfer<TNever> is TExtendsFalse\n    (IsInfer(right) && IsNever(right.extends))\n        ? Result.ExtendsFalse()\n        : Result.Match(ExtendsLeft(inferred, left, right), inferred => ExtendsPropertyOptional(inferred, left, right), () => Result.ExtendsFalse()));\n}\nfunction ExtractInferredProperties(keys, properties) {\n    return keys.reduce((result, key) => {\n        return key in properties\n            ? Result.IsExtendsTrueLike(properties[key])\n                // @ts-ignore 5.0.4 cannot see `.inferred`\n                ? { ...result, ...properties[key].inferred }\n                : Unreachable() // result\n            : Unreachable(); // result\n    }, {});\n}\nfunction ExtendsPropertiesComparer(inferred, left, right) {\n    const properties = {};\n    for (const rightKey of Guard.Keys(right)) {\n        properties[rightKey] = (rightKey in left\n            // We don't consider the exterior Inferred as part of the property check as\n            // we don't want the exterior Context to override the Inferred Context for\n            // the Property Key. This override behavior is observed in the following\n            // case we want the inferred A to shadow the exterior A.\n            //\n            // const A = Type.Script(`{ x: 1, y: 1 }`)\n            // const S = Type.Script({ A }, `{\n            //   [K in keyof A]: A extends { \n            //     x: infer A, \n            //     y: infer B \n            //   } ? [A, B]   <-- inferred 'A' shadows the exterior 'A'\n            //     : never\n            // }`)\n            ? ExtendsProperty({}, left[rightKey], right[rightKey])\n            // If the right key K is not in left, but the right property is optional\n            // then we say this property is permissable. This is because an optional\n            // property on right is the same as property missing in left. If the\n            // right is infer, then we just assign the extend type to inferred.\n            : IsOptional(right[rightKey])\n                ? IsInfer(right[rightKey])\n                    // @ts-ignore 5.0.1 - cannot observe extend in right[rightKey].extends\n                    ? Result.ExtendsTrue(Memory.Assign(inferred, { [right[rightKey].name]: right[rightKey].extends }))\n                    : Result.ExtendsTrue(inferred)\n                : Result.ExtendsFalse());\n    }\n    // Check if all properties are ExtendsTrueLike\n    const checked = Guard.Values(properties).every(result => Result.IsExtendsTrueLike(result));\n    // Extract inferred results from properties, but only if the check is true.\n    const extracted = checked ? ExtractInferredProperties(Guard.Keys(properties), properties) : {};\n    return (checked\n        ? Result.ExtendsTrue(extracted)\n        : Result.ExtendsFalse());\n}\nfunction ExtendsProperties(inferred, left, right) {\n    const compared = ExtendsPropertiesComparer(inferred, left, right);\n    return (Result.IsExtendsTrueLike(compared)\n        ? Result.ExtendsTrue(Memory.Assign(inferred, compared.inferred))\n        : Result.ExtendsFalse());\n}\nfunction ExtendsObjectToObject(inferred, left, right) {\n    return ExtendsProperties(inferred, left, right);\n}\nfunction RecordMergeInferred(left, right) {\n    return Guard.Keys(right).reduce((result, key) => {\n        return {\n            ...result, [key]: Guard.HasPropertyKey(left, key)\n                ? IsUnion(result[key])\n                    // @ts-ignore 5.0.4 cannot see `.anyOf`\n                    ? Union([...result[key].anyOf, right[key]])\n                    : Union([left[key], right[key]])\n                : right[key]\n        };\n    }, left);\n}\nfunction ExtendsRecordComparer(properties, keys, type, result) {\n    return Guard.ShiftLeft(keys, (left, right) => Result.Match(ExtendsLeft({}, properties[left], type), inferred => ExtendsRecordComparer(properties, right, type, RecordMergeInferred(result, inferred)), () => Result.ExtendsFalse()), () => Result.ExtendsTrue(result));\n}\nfunction ExtendsObjectToRecord(inferred, properties, _pattern, value) {\n    const keys = Guard.Keys(properties);\n    const result = ExtendsRecordComparer(properties, keys, value, inferred);\n    return result;\n}\nexport function ExtendsObject(inferred, left, right) {\n    return (IsRecord(right) ? ExtendsObjectToRecord(inferred, left, RecordPattern(right), RecordValue(right)) :\n        IsObject(right) ? ExtendsObjectToObject(inferred, left, right.properties) :\n            ExtendsRight(inferred, Object(left), right));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsAny } from '../types/any.mjs';\nimport { IsUnknown } from '../types/unknown.mjs';\nimport { IsObject } from '../types/object.mjs';\nimport { IsRecord, RecordPatternToType, RecordPattern, RecordValue } from '../types/record.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport * as Result from './result.mjs';\nfunction FromObject(inferred, properties) {\n    return (Guard.IsEqual(Guard.Keys(properties).length, 0)\n        ? Result.ExtendsTrue(inferred)\n        : Result.ExtendsFalse());\n}\nfunction FromRecord(inferred, _leftKey, leftValue, _rightKey, rightValue) {\n    return ExtendsLeft(inferred, leftValue, rightValue);\n}\nexport function ExtendsRecord(inferred, leftPattern, leftValue, right) {\n    return (IsRecord(right) ? FromRecord(inferred, RecordPatternToType(leftPattern), leftValue, RecordPatternToType(RecordPattern(right)), RecordValue(right)) :\n        IsObject(right) ? FromObject(inferred, right.properties) :\n            IsAny(right) ? Result.ExtendsTrue(inferred) :\n                IsUnknown(right) ? Result.ExtendsTrue(inferred) :\n                    Result.ExtendsFalse());\n}\n","// deno-fmt-ignore-file\nimport { IsString } from '../types/string.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsString(inferred, left, right) {\n    return (IsString(right)\n        ? Result.ExtendsTrue(inferred)\n        : ExtendsRight(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { IsSymbol } from '../types/symbol.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsSymbol(inferred, left, right) {\n    return (IsSymbol(right)\n        ? Result.ExtendsTrue(inferred)\n        : ExtendsRight(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { ExtendsLeft } from './extends_left.mjs';\nimport { EvaluateTemplateLiteral } from '../engine/evaluate/evaluate.mjs';\nexport function ExtendsTemplateLiteral(inferred, left, right) {\n    const evaluated = EvaluateTemplateLiteral(left);\n    return ExtendsLeft(inferred, evaluated, right);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Unreachable } from '../../system/unreachable/index.mjs';\nimport { Memory } from '../../system/memory/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsArray } from '../types/array.mjs';\nimport { IsUnknown } from '../types/unknown.mjs';\nimport { Tuple } from '../types/tuple.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport { Union } from '../types/union.mjs';\n// ----------------------------------------------------------------------------\n// Operator\n// ----------------------------------------------------------------------------\nimport { IsInfer } from '../types/infer.mjs';\nimport { IsRest } from '../types/rest.mjs';\nimport * as Result from './result.mjs';\n// ----------------------------------------------------------------------------\n// Factory\n// ----------------------------------------------------------------------------\nexport function Inferrable(name, type) {\n    return Memory.Create({ '~kind': 'Inferrable' }, { name, type }, {});\n}\n// ----------------------------------------------------------------------------\n// Guard\n// ----------------------------------------------------------------------------\nexport function IsInferable(value) {\n    return Guard.IsObject(value)\n        && Guard.HasPropertyKey(value, '~kind')\n        && Guard.HasPropertyKey(value, 'name')\n        && Guard.HasPropertyKey(value, 'type')\n        && Guard.IsEqual(value[\"~kind\"], 'Inferrable')\n        && Guard.IsString(value.name)\n        && Guard.IsObject(value.type);\n}\nexport function TryRestInferable(type) {\n    return (IsRest(type)\n        ? IsInfer(type.items)\n            ? IsArray(type.items.extends) ? Inferrable(type.items.name, type.items.extends.items) :\n                IsUnknown(type.items.extends) ? Inferrable(type.items.name, type.items.extends) :\n                    undefined\n            : Unreachable() // undefined\n        : undefined);\n}\nexport function TryInferable(type) {\n    return (IsInfer(type) ? Inferrable(type.name, type.extends) :\n        undefined);\n}\nfunction TryInferResults(rest, right, result = []) {\n    return Guard.ShiftLeft(rest, (head, tail) => Result.Match(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result, head]), () => undefined), () => result);\n}\nexport function InferTupleResult(inferred, name, left, right) {\n    const results = TryInferResults(left, right);\n    return (Guard.IsArray(results)\n        ? Result.ExtendsTrue(Memory.Assign(inferred, { [name]: Tuple(results) }))\n        : Result.ExtendsFalse());\n}\nexport function InferUnionResult(inferred, name, left, right) {\n    const results = TryInferResults(left, right);\n    return (Guard.IsArray(results)\n        ? Result.ExtendsTrue(Memory.Assign(inferred, { [name]: Union(results) }))\n        : Result.ExtendsFalse());\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from '../types/schema.mjs';\nimport { IsArray } from '../types/array.mjs';\nimport { IsTuple, Tuple } from '../types/tuple.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nimport { InstantiateElements } from '../engine/instantiate.mjs';\nimport { State } from '../engine/instantiate.mjs';\n// ----------------------------------------------------------------------------\n// Inference\n// ----------------------------------------------------------------------------\nimport { TryRestInferable, TryInferable, IsInferable, InferTupleResult, InferUnionResult } from './inference.mjs';\nfunction Reverse(types) {\n    return [...types].reverse();\n}\nfunction ApplyReverse(types, reversed) {\n    return (reversed ? Reverse(types) : types);\n}\nfunction Reversed(types) {\n    const first = types.length > 0 ? types[0] : undefined;\n    const inferrable = IsSchema(first) ? TryRestInferable(first) : undefined;\n    return IsSchema(inferrable);\n}\nfunction ElementsCompare(inferred, reversed, left, leftRest, right, rightRest) {\n    return Result.Match(ExtendsLeft(inferred, left, right), checkInferred => Elements(checkInferred, reversed, leftRest, rightRest), () => Result.ExtendsFalse()); // 'left-and-right-not-compared'\n}\nfunction ElementsLeft(inferred, reversed, leftRest, right, rightRest) {\n    const inferable = TryRestInferable(right);\n    return (\n    // Rest Inferrable Right Means we delegate to TInferTupleResult to Generate a Result\n    IsInferable(inferable)\n        ? InferTupleResult(inferred, inferable['name'], ApplyReverse(leftRest, reversed), inferable['type'])\n        : Guard.ShiftLeft(leftRest, (head, tail) => ElementsCompare(inferred, reversed, head, tail, right, rightRest), () => Result.ExtendsFalse()));\n}\nfunction ElementsRight(inferred, reversed, leftRest, rightRest) {\n    return Guard.ShiftLeft(rightRest, (head, tail) => ElementsLeft(inferred, reversed, leftRest, head, tail), () => Guard.IsEqual(leftRest.length, 0)\n        ? Result.ExtendsTrue(inferred) // 'Ok: right-empty-and-left-empty'\n        : Result.ExtendsFalse()); // 'Fail: right-empty-and-left-not-empty'\n}\nfunction Elements(inferred, reversed, leftRest, rightRest) {\n    return ElementsRight(inferred, reversed, leftRest, rightRest);\n}\nfunction ExtendsTupleToTuple(inferred, left, right) {\n    const instantiatedRight = InstantiateElements(inferred, State([], []), right);\n    const reversed = Reversed(instantiatedRight);\n    return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));\n}\nfunction ExtendsTupleToArray(inferred, left, right) {\n    const inferrable = TryInferable(right);\n    return (IsInferable(inferrable)\n        ? InferUnionResult(inferred, inferrable['name'], left, inferrable['type'])\n        : Guard.ShiftLeft(left, (head, tail) => Result.Match(ExtendsLeft(inferred, head, right), inferred => ExtendsTupleToArray(inferred, tail, right), () => Result.ExtendsFalse()), () => Result.ExtendsTrue(inferred)));\n}\nexport function ExtendsTuple(inferred, left, right) {\n    const instantiatedLeft = InstantiateElements(inferred, State([], []), left);\n    return (IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) :\n        IsArray(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) :\n            ExtendsRight(inferred, Tuple(instantiatedLeft), right));\n}\n","// deno-fmt-ignore-file\nimport { IsUndefined } from '../types/undefined.mjs';\nimport { IsVoid } from '../types/void.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsUndefined(inferred, left, right) {\n    return (IsVoid(right) ? Result.ExtendsTrue(inferred) :\n        IsUndefined(right) ? Result.ExtendsTrue(inferred) :\n            ExtendsRight(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsUnion } from '../types/union.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport * as Result from './result.mjs';\n// ----------------------------------------------------------------------------\n// Inference\n// ----------------------------------------------------------------------------\nimport { IsInferable, TryInferable, InferUnionResult } from './inference.mjs';\nfunction ExtendsUnionSome(inferred, type, unionTypes) {\n    return Guard.ShiftLeft(unionTypes, (head, tail) => Result.Match(ExtendsLeft(inferred, type, head), inferred => Result.ExtendsTrue(inferred), () => ExtendsUnionSome(inferred, type, tail)), () => Result.ExtendsFalse());\n}\nfunction ExtendsUnionLeft(inferred, left, right) {\n    return Guard.ShiftLeft(left, (head, tail) => Result.Match(ExtendsUnionSome(inferred, head, right), inferred => ExtendsUnionLeft(inferred, tail, right), () => Result.ExtendsFalse()), () => Result.ExtendsTrue(inferred));\n}\nexport function ExtendsUnion(inferred, left, right) {\n    const inferrable = TryInferable(right);\n    return (IsInferable(inferrable)\n        // @ts-ignore 4.9.5 fails to see `type` property on inferrable\n        ? InferUnionResult(inferred, inferrable.name, left, inferrable.type)\n        : IsUnion(right)\n            ? ExtendsUnionLeft(inferred, left, right.anyOf)\n            : ExtendsUnionLeft(inferred, left, [right]));\n}\n","// deno-fmt-ignore-file\nimport { IsAny } from '../types/any.mjs';\nimport { IsUnknown } from '../types/unknown.mjs';\nimport { IsInfer } from '../types/infer.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsUnknown(inferred, left, right) {\n    return (IsInfer(right) ? ExtendsRight(inferred, left, right) :\n        IsAny(right) ? Result.ExtendsTrue(inferred) :\n            IsUnknown(right) ? Result.ExtendsTrue(inferred) :\n                Result.ExtendsFalse());\n}\n","// deno-fmt-ignore-file\nimport { IsVoid } from '../types/void.mjs';\nimport { ExtendsRight } from './extends_right.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsVoid(inferred, left, right) {\n    return (IsVoid(right)\n        ? Result.ExtendsTrue(inferred)\n        : ExtendsRight(inferred, left, right));\n}\n","// deno-fmt-ignore-file\nimport { ExtendsAny } from './any.mjs';\nimport { ExtendsArray } from './array.mjs';\nimport { ExtendsBigInt } from './bigint.mjs';\nimport { ExtendsBoolean } from './boolean.mjs';\nimport { ExtendsConstructor } from './constructor.mjs';\nimport { ExtendsDependent } from './dependent.mjs';\nimport { ExtendsEnum } from './enum.mjs';\nimport { ExtendsFunction } from './function.mjs';\nimport { ExtendsInteger } from './integer.mjs';\nimport { ExtendsIntersect } from './intersect.mjs';\nimport { ExtendsLiteral } from './literal.mjs';\nimport { ExtendsNever } from './never.mjs';\nimport { ExtendsNull } from './null.mjs';\nimport { ExtendsNumber } from './number.mjs';\nimport { ExtendsObject } from './object.mjs';\nimport { ExtendsRecord } from './record.mjs';\nimport { ExtendsString } from './string.mjs';\nimport { ExtendsSymbol } from './symbol.mjs';\nimport { ExtendsTemplateLiteral } from './template_literal.mjs';\nimport { ExtendsTuple } from './tuple.mjs';\nimport { ExtendsUndefined } from './undefined.mjs';\nimport { ExtendsUnion } from './union.mjs';\nimport { ExtendsUnknown } from './unknown.mjs';\nimport { ExtendsVoid } from './void.mjs';\n// ----------------------------------------------------------------------------\n// Types\n// ----------------------------------------------------------------------------\nimport { IsAny } from '../types/any.mjs';\nimport { IsArray } from '../types/array.mjs';\nimport { IsBigInt } from '../types/bigint.mjs';\nimport { IsBoolean } from '../types/boolean.mjs';\nimport { IsConstructor } from '../types/constructor.mjs';\nimport { IsDependent } from '../types/dependent.mjs';\nimport { IsEnum } from '../types/enum.mjs';\nimport { IsFunction } from '../types/function.mjs';\nimport { IsInteger } from '../types/integer.mjs';\nimport { IsIntersect } from '../types/intersect.mjs';\nimport { IsLiteral } from '../types/literal.mjs';\nimport { IsNever } from '../types/never.mjs';\nimport { IsNull } from '../types/null.mjs';\nimport { IsNumber } from '../types/number.mjs';\nimport { IsObject } from '../types/object.mjs';\nimport { IsRecord, RecordPattern, RecordValue } from '../types/record.mjs';\nimport { IsString } from '../types/string.mjs';\nimport { IsSymbol } from '../types/symbol.mjs';\nimport { IsTemplateLiteral } from '../types/template_literal.mjs';\nimport { IsTuple } from '../types/tuple.mjs';\nimport { IsUndefined } from '../types/undefined.mjs';\nimport { IsUnknown } from '../types/unknown.mjs';\nimport { IsUnion } from '../types/union.mjs';\nimport { IsVoid } from '../types/void.mjs';\nimport * as Result from './result.mjs';\nexport function ExtendsLeft(inferred, left, right) {\n    return (IsAny(left) ? ExtendsAny(inferred, left, right) :\n        IsArray(left) ? ExtendsArray(inferred, left, left.items, right) :\n            IsBigInt(left) ? ExtendsBigInt(inferred, left, right) :\n                IsBoolean(left) ? ExtendsBoolean(inferred, left, right) :\n                    IsConstructor(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) :\n                        IsDependent(left) ? ExtendsDependent(inferred, left.if, left.then, left.else, right) :\n                            IsEnum(left) ? ExtendsEnum(inferred, left.enum, right) :\n                                IsFunction(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) :\n                                    IsInteger(left) ? ExtendsInteger(inferred, left, right) :\n                                        IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) :\n                                            IsLiteral(left) ? ExtendsLiteral(inferred, left, right) :\n                                                IsNever(left) ? ExtendsNever(inferred, left, right) :\n                                                    IsNull(left) ? ExtendsNull(inferred, left, right) :\n                                                        IsNumber(left) ? ExtendsNumber(inferred, left, right) :\n                                                            IsObject(left) ? ExtendsObject(inferred, left.properties, right) :\n                                                                IsRecord(left) ? ExtendsRecord(inferred, RecordPattern(left), RecordValue(left), right) :\n                                                                    IsString(left) ? ExtendsString(inferred, left, right) :\n                                                                        IsSymbol(left) ? ExtendsSymbol(inferred, left, right) :\n                                                                            IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) :\n                                                                                IsTuple(left) ? ExtendsTuple(inferred, left.items, right) :\n                                                                                    IsUndefined(left) ? ExtendsUndefined(inferred, left, right) :\n                                                                                        IsUnion(left) ? ExtendsUnion(inferred, left.anyOf, right) :\n                                                                                            IsUnknown(left) ? ExtendsUnknown(inferred, left, right) :\n                                                                                                IsVoid(left) ? ExtendsVoid(inferred, left, right) :\n                                                                                                    Result.ExtendsFalse());\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nimport { InterfaceDeferred } from '../../action/index.mjs';\nimport { CanInstantiate } from '../instantiate.mjs';\nimport { InstantiateProperties } from '../instantiate.mjs';\nimport { InstantiateTypes } from '../instantiate.mjs';\nfunction InterfaceOperation(heritage, properties) {\n    const result = EvaluateIntersect([...heritage, Object(properties)]);\n    return result;\n}\nexport function InterfaceAction(heritage, properties, options) {\n    const result = CanInstantiate(heritage)\n        ? Memory.Update(InterfaceOperation(heritage, properties), {}, options)\n        : InterfaceDeferred(heritage, properties, options);\n    return result;\n}\nexport function InterfaceInstantiate(context, state, heritage, properties, options) {\n    const instantiatedHeritage = InstantiateTypes(context, state, heritage);\n    const instantiatedProperties = InstantiateProperties(context, state, properties);\n    return InterfaceAction(instantiatedHeritage, instantiatedProperties, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from '../types/schema.mjs';\nimport { Deferred } from '../types/deferred.mjs';\nimport { InterfaceAction } from '../engine/interface/instantiate.mjs';\n/** Creates a deferred Interface action. */\nexport function InterfaceDeferred(heritage, properties, options = {}) {\n    return Deferred('Interface', [heritage, properties], options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if this value is a deferred Interface action. */\nexport function IsInterfaceDeferred(value) {\n    return IsSchema(value)\n        && Guard.HasPropertyKey(value, 'action')\n        && Guard.IsEqual(value.action, 'Interface');\n}\n/** Creates an Interface using the given heritage and properties. */\nexport function Interface(heritage, properties, options = {}) {\n    return InterfaceAction(heritage, properties, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsArray } from '../../types/array.mjs';\nimport { IsConstructor } from '../../types/constructor.mjs';\nimport { IsFunction } from '../../types/function.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { IsObject } from '../../types/object.mjs';\nimport { PropertyValues } from '../../types/properties.mjs';\nimport { IsRecord, RecordValue } from '../../types/record.mjs';\nimport { IsTuple } from '../../types/tuple.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { IsRef } from '../../types/ref.mjs';\nimport { IsInterfaceDeferred } from '../../action/interface.mjs';\nfunction FromRef(stack, context, ref) {\n    return (stack.includes(ref)\n        ? true\n        : FromType([...stack, ref], context, context[ref]));\n}\nfunction FromProperties(stack, context, properties) {\n    const types = PropertyValues(properties);\n    return FromTypes(stack, context, types);\n}\nfunction FromTypes(stack, context, types) {\n    return Guard.ShiftLeft(types, (left, right) => FromType(stack, context, left)\n        ? true\n        : FromTypes(stack, context, right), () => false);\n}\nfunction FromType(stack, context, type) {\n    return (IsRef(type) ? FromRef(stack, context, type.$ref) :\n        IsArray(type) ? FromType(stack, context, type.items) :\n            IsConstructor(type) ? FromTypes(stack, context, [...type.parameters, type.instanceType]) :\n                IsFunction(type) ? FromTypes(stack, context, [...type.parameters, type.returnType]) :\n                    IsInterfaceDeferred(type) ? FromProperties(stack, context, type.parameters[1]) :\n                        IsIntersect(type) ? FromTypes(stack, context, type.allOf) :\n                            IsObject(type) ? FromProperties(stack, context, type.properties) :\n                                IsUnion(type) ? FromTypes(stack, context, type.anyOf) :\n                                    IsTuple(type) ? FromTypes(stack, context, type.items) :\n                                        IsRecord(type) ? FromType(stack, context, RecordValue(type)) :\n                                            false);\n}\n/** Performs a cyclic check on the given type. Initial key stack can be empty, but faster if specified */\nexport function CyclicCheck(stack, context, type) {\n    const result = FromType(stack, context, type);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { PropertyKeys } from '../../types/properties.mjs';\nimport { CyclicCheck } from './check.mjs';\nfunction ResolveCandidateKeys(context, keys) {\n    return keys.reduce((result, left) => {\n        return CyclicCheck([left], context, context[left])\n            ? [...result, left]\n            : result;\n    }, []);\n}\n/** Returns keys for context types that need to be transformed to TCyclic. */\nexport function CyclicCandidates(context) {\n    const keys = PropertyKeys(context);\n    const result = ResolveCandidateKeys(context, keys);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Unreachable } from '../../../system/unreachable/index.mjs';\nimport { IsArray } from '../../types/array.mjs';\nimport { IsConstructor } from '../../types/constructor.mjs';\nimport { IsFunction } from '../../types/function.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { IsObject } from '../../types/object.mjs';\nimport { PropertyValues } from '../../types/properties.mjs';\nimport { IsRecord, RecordValue } from '../../types/record.mjs';\nimport { IsTuple } from '../../types/tuple.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { IsRef } from '../../types/ref.mjs';\nimport { IsInterfaceDeferred } from '../../action/interface.mjs';\nfunction FromRef(context, ref, result) {\n    return (result.includes(ref)\n        ? result\n        : ref in context\n            ? FromType(context, context[ref], [...result, ref])\n            : Unreachable());\n}\nfunction FromProperties(context, properties, result) {\n    const types = PropertyValues(properties);\n    return FromTypes(context, types, result);\n}\nfunction FromTypes(context, types, result) {\n    return types.reduce((result, left) => {\n        return FromType(context, left, result);\n    }, result);\n}\nfunction FromType(context, type, result) {\n    return (IsRef(type) ? FromRef(context, type.$ref, result) :\n        IsArray(type) ? FromType(context, type.items, result) :\n            IsConstructor(type) ? FromTypes(context, [...type.parameters, type.instanceType], result) :\n                IsFunction(type) ? FromTypes(context, [...type.parameters, type.returnType], result) :\n                    IsInterfaceDeferred(type) ? FromProperties(context, type.parameters[1], result) :\n                        IsIntersect(type) ? FromTypes(context, type.allOf, result) :\n                            IsObject(type) ? FromProperties(context, type.properties, result) :\n                                IsUnion(type) ? FromTypes(context, type.anyOf, result) :\n                                    IsTuple(type) ? FromTypes(context, type.items, result) :\n                                        IsRecord(type) ? FromType(context, RecordValue(type), result) :\n                                            result);\n}\n/** Returns dependent cyclic keys for the given type. This function is used to dead-type-eliminate (DTE) for initializing TCyclic types. */\nexport function CyclicDependencies(context, key, type) {\n    const result = FromType(context, type, [key]);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Any } from '../../types/any.mjs';\nimport { Array as _Array_, IsArray, ArrayOptions } from '../../types/array.mjs';\nimport { Constructor, IsConstructor } from '../../types/constructor.mjs';\nimport { Function as _Function_, IsFunction } from '../../types/function.mjs';\nimport { Intersect, IsIntersect } from '../../types/intersect.mjs';\nimport { Object, IsObject } from '../../types/object.mjs';\nimport { IsRecord, Record, RecordKey, RecordValue } from '../../types/record.mjs';\nimport { IsRef } from '../../types/ref.mjs';\nimport { Tuple, IsTuple } from '../../types/tuple.mjs';\nimport { Union, IsUnion } from '../../types/union.mjs';\nimport { Unknown } from '../../types/unknown.mjs';\nfunction FromRef(_ref) {\n    return Any();\n}\nfunction FromProperties(properties) {\n    return Guard.Keys(properties).reduce((result, key) => {\n        return { ...result, [key]: FromType(properties[key]) };\n    }, {});\n}\nfunction FromTypes(types) {\n    return types.reduce((result, left) => {\n        return [...result, FromType(left)];\n    }, []);\n}\nfunction FromType(type) {\n    return (IsRef(type) ? FromRef(type.$ref) :\n        IsArray(type) ? _Array_(FromType(type.items), ArrayOptions(type)) :\n            IsConstructor(type) ? Constructor(FromTypes(type.parameters), FromType(type.instanceType)) :\n                IsFunction(type) ? _Function_(FromTypes(type.parameters), FromType(type.returnType)) :\n                    IsIntersect(type) ? Intersect(FromTypes(type.allOf)) :\n                        IsObject(type) ? Object(FromProperties(type.properties)) :\n                            IsRecord(type) ? Record(RecordKey(type), FromType(RecordValue(type))) :\n                                IsUnion(type) ? Union(FromTypes(type.anyOf)) :\n                                    IsTuple(type) ? Tuple(FromTypes(type.items)) :\n                                        type);\n}\nfunction CyclicAnyFromParameters(defs, ref) {\n    return (ref in defs\n        ? FromType(defs[ref])\n        : Unknown());\n}\n/** Transforms TCyclic TRef's into TAny's. This function is used prior to TExtends checks to enable cyclics to be structurally checked and terminated (with TAny) at first point of recursion, what would otherwise be a recursive TRef.*/\nexport function CyclicExtends(type) {\n    return CyclicAnyFromParameters(type.$defs, type.$ref);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Cyclic } from '../../types/cyclic.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { CyclicDependencies } from '../cyclic/dependencies.mjs';\nimport { IsInterfaceDeferred } from '../../action/index.mjs';\nimport { InstantiateProperties } from '../instantiate.mjs';\nimport { InstantiateTypes } from '../instantiate.mjs';\nimport { State } from '../instantiate.mjs';\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nfunction CyclicInterface(context, heritage, properties) {\n    const instantiatedHeritage = InstantiateTypes(context, State([], []), heritage);\n    const instantiatedProperties = InstantiateProperties({}, State([], []), properties);\n    const evaluatedInterface = EvaluateIntersect([...instantiatedHeritage, Object(instantiatedProperties)]);\n    return evaluatedInterface;\n}\nfunction CyclicDefinitions(context, dependencies) {\n    const keys = Guard.Keys(context).filter(key => dependencies.includes(key));\n    return keys.reduce((result, key) => {\n        const type = context[key];\n        const instantiatedType = IsInterfaceDeferred(type) ? CyclicInterface(context, type.parameters[0], type.parameters[1]) : type;\n        return { ...result, [key]: instantiatedType };\n    }, {});\n}\nexport function InstantiateCyclic(context, ref, type) {\n    const dependencies = CyclicDependencies(context, ref, type);\n    const definitions = CyclicDefinitions(context, dependencies);\n    const result = Cyclic(definitions, ref);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Never } from '../../types/never.mjs';\nimport { IsRef } from '../../types/ref.mjs';\nfunction Resolve(defs, ref) {\n    return (ref in defs\n        ? IsRef(defs[ref])\n            // @ts-ignore 5.0.4 - does not see $ref\n            ? Resolve(defs, defs[ref].$ref)\n            : defs[ref]\n        : Never());\n}\n/** Returns the target Type from the Defs or Never if target is non-resolvable */\nexport function CyclicTarget(defs, ref) {\n    const result = Resolve(defs, ref);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { IsCyclic } from '../types/cyclic.mjs';\nimport { Unknown } from '../types/unknown.mjs';\nimport { IsUnsafe } from '../types/unsafe.mjs';\nimport { ExtendsLeft } from './extends_left.mjs';\nimport { CyclicExtends } from '../engine/cyclic/index.mjs';\nfunction Canonical(type) {\n    return (IsCyclic(type) ? CyclicExtends(type) :\n        IsUnsafe(type) ? Unknown() :\n            type);\n}\n/** Performs a structural extends check on left and right types and yields inferred types on right if specified. */\nexport function Extends(inferred, left, right) {\n    const canonicalLeft = Canonical(left);\n    const canonicalRight = Canonical(right);\n    return ExtendsLeft(inferred, canonicalLeft, canonicalRight);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Extends, ExtendsResult } from \"../../extends/index.mjs\";\n// ------------------------------------------------------------------\n// TCompare\n// ------------------------------------------------------------------\nexport const CompareResultEqual = 0; // 'equal'\nexport const CompareResultDisjoint = 1; // 'disjoint'\nexport const CompareResultLeftInside = 2; // 'left-inside'\nexport const CompareResultRightInside = 3; // 'right-inside'\n/** Compares left and right types and determines their set relationship. */\nexport function Compare(left, right) {\n    const extendsCheck = [Extends({}, left, right), Extends({}, right, left)];\n    return (ExtendsResult.IsExtendsTrueLike(extendsCheck[0]) && ExtendsResult.IsExtendsTrueLike(extendsCheck[1]) ? CompareResultEqual :\n        ExtendsResult.IsExtendsTrueLike(extendsCheck[0]) && ExtendsResult.IsExtendsFalse(extendsCheck[1]) ? CompareResultLeftInside :\n            ExtendsResult.IsExtendsFalse(extendsCheck[0]) && ExtendsResult.IsExtendsTrueLike(extendsCheck[1]) ? CompareResultRightInside :\n                CompareResultDisjoint);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsAny } from '../../types/any.mjs';\nimport { IsNever } from '../../types/never.mjs';\nimport { IsObject } from '../../types/object.mjs';\nimport { IsUnknown } from '../../types/unknown.mjs';\nimport { Compare, CompareResultLeftInside, CompareResultEqual, CompareResultDisjoint } from './compare.mjs';\nimport { Flatten } from './flatten.mjs';\nimport { EvaluateType } from './evaluate.mjs';\nfunction BroadenFilter(type, types, result = [], all = types) {\n    return Guard.ShiftLeft(types, (left, right) => {\n        const compare = Compare(type, left);\n        return ((Guard.IsEqual(compare, CompareResultLeftInside) || Guard.IsEqual(compare, CompareResultEqual))\n            ? all // Left in set. Return original All set.\n            : Guard.IsEqual(compare, CompareResultDisjoint)\n                ? BroadenFilter(type, right, [...result, left], all) // Left is disjoint, keep it\n                : BroadenFilter(type, right, result, all) // Left in Type, drop it\n        );\n    }, () => [...result, type]); // Type broadest in set\n}\nfunction BroadenType(type, types, result) {\n    const evaluated = EvaluateType(type);\n    return (IsAny(evaluated) ? [evaluated] : // terminate (always the most broad)\n        IsUnknown(evaluated) ? [evaluated] : // terminate (always the most broad)\n            IsNever(evaluated) ? BroadenTypes(types, result) : // ignored: never is dropped\n                IsObject(evaluated) ? BroadenTypes(types, [...result, evaluated]) : // objects are always considered (too expensive to compare)\n                    BroadenTypes(types, BroadenFilter(evaluated, result)));\n}\nfunction BroadenTypes(types, result = []) {\n    return Guard.ShiftLeft(types, (left, right) => (BroadenType(left, right, result)), () => result);\n}\n/** Broadens a set of types and returns either the most broad type, or union or disjoint types. */\nexport function Broaden(types) {\n    const broadened = BroadenTypes(types);\n    const flattened = Flatten(broadened);\n    return flattened;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nimport { EvaluateType } from './evaluate.mjs';\nexport function EvaluateAction(type, options) {\n    const result = Memory.Update(EvaluateType(type), {}, options);\n    return result;\n}\nexport function EvaluateInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return EvaluateAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { IsDeferred } from '../../types/deferred.mjs';\nimport { IsEnum } from '../../types/enum.mjs';\nimport { IsTemplateLiteral } from '../../types/template_literal.mjs';\nimport { IsRef } from '../../types/ref.mjs';\n// ------------------------------------------------------------------\n// Infrastructure\n// ------------------------------------------------------------------\nimport { EvaluateTemplateLiteral } from '../evaluate/evaluate.mjs';\nimport { EvaluateEnum } from '../evaluate/evaluate.mjs';\nfunction CollectDistributionNames(expression, result = []) {\n    return (\n    // Conditional\n    IsDeferred(expression) && Guard.IsEqual(expression.action, 'Conditional')\n        ? IsRef(expression.parameters[0])\n            ? CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], [...result, expression.parameters[0]['$ref']]))\n            : CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], result))\n        // Mapped\n        : IsDeferred(expression) && Guard.IsEqual(expression.action, 'Mapped')\n            ? (IsDeferred(expression.parameters[1]) && Guard.IsEqual(expression.parameters[1].action, 'KeyOf') && IsRef(expression.parameters[1].parameters[0]) ? [...result, expression.parameters[1].parameters[0]['$ref']] :\n                result) : result);\n}\nfunction BuildDistributionArray(parameters, names) {\n    return parameters.reduce((result, left) => [...result, names.includes(left.name)], []);\n}\nfunction ZipDistributionArray(arguments_, distributionArray, result = []) {\n    return Guard.ShiftLeft(arguments_, (argumentLeft, argumentRight) => Guard.ShiftLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...result, [booleanLeft, argumentLeft]]), () => result), () => result);\n}\nfunction CanonicalArgument(type) {\n    return (IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) :\n        IsEnum(type) ? EvaluateEnum(type.enum) :\n            type);\n}\nfunction Expand(type) {\n    const canonicalArgument = CanonicalArgument(type);\n    return (IsUnion(canonicalArgument)\n        ? [...canonicalArgument.anyOf]\n        : [canonicalArgument]);\n}\nfunction Append(current, type) {\n    return current.reduce((result, left) => [...result, [...left, type]], []);\n}\nfunction Cross(current, variants) {\n    return variants.reduce((result, left) => {\n        return [...result, ...Append(current, left)];\n    }, []);\n}\nfunction Distribute(zipped) {\n    return zipped.reduce((result, left) => {\n        return Guard.IsEqual(left[0], true)\n            ? Cross(result, Expand(left[1]))\n            : Cross(result, [left[1]]); // - no-expansion\n    }, [[]]);\n}\nexport function DistributeArguments(parameters, arguments_, expression) {\n    const distributionNames = CollectDistributionNames(expression);\n    const distributionArray = BuildDistributionArray(parameters, distributionNames);\n    const zippedArguments = ZipDistributionArray(arguments_, distributionArray);\n    return (IsDeferred(expression) && Guard.IsEqual(expression.action, 'Conditional')\n        ? Distribute(zippedArguments)\n        : IsDeferred(expression) && Guard.IsEqual(expression.action, 'Mapped')\n            ? Distribute(zippedArguments)\n            : [arguments_]);\n}\n","// deno-fmt-ignore-file\nimport { Generic, IsGeneric } from '../../types/generic.mjs';\nimport { IsRef } from '../../types/ref.mjs';\nimport { Never } from '../../types/never.mjs';\nfunction FromNotResolvable() {\n    return ['(not-resolvable)', Never()];\n}\nfunction FromNotGeneric() {\n    return ['(not-generic)', Never()];\n}\nfunction FromGeneric(name, parameters, expression) {\n    return [name, Generic(parameters, expression)];\n}\nfunction FromRef(context, ref, arguments_) {\n    return (ref in context\n        ? FromType(context, ref, context[ref], arguments_)\n        : FromNotResolvable());\n}\nfunction FromType(context, name, target, arguments_) {\n    return (IsGeneric(target) ? FromGeneric(name, target.parameters, target.expression) :\n        IsRef(target) ? FromRef(context, target.$ref, arguments_) :\n            FromNotGeneric());\n}\n/** Resolves a named generic target from the context, or returns TNever if it cannot be resolved or is not generic. */\nexport function ResolveTarget(context, target, arguments_) {\n    return FromType(context, '(anonymous)', target, arguments_);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nimport { Extends, ExtendsResult } from '../../extends/index.mjs';\nimport { IsInfer } from '../../types/infer.mjs';\nimport { IsCall } from '../../types/call.mjs';\n// ------------------------------------------------------------------\n// AssertArgument\n// ------------------------------------------------------------------\nfunction AssertArgumentExtends(name, type, extends_) {\n    if (IsInfer(type) || IsCall(type) || ExtendsResult.IsExtendsTrueLike(Extends({}, type, extends_)))\n        return;\n    const cause = { parameter: name, expect: extends_, actual: type };\n    // @ts-ignore - no definition for { cause } options \n    throw new Error(`Argument for parameter ${name} does not satisfy constraint`, { cause });\n}\nfunction BindArgument(context, state, name, extends_, type) {\n    const instantiatedArgument = InstantiateType(context, state, type);\n    AssertArgumentExtends(name, instantiatedArgument, extends_);\n    return Memory.Assign(context, { [name]: instantiatedArgument });\n}\nfunction BindArguments(context, state, parameterLeft, parameterRight, arguments_) {\n    const instantiatedExtends = InstantiateType(context, state, parameterLeft.extends);\n    const instantiatedEquals = InstantiateType(context, state, parameterLeft.equals);\n    return Guard.ShiftLeft(arguments_, (left, right) => BindParameters(BindArgument(context, state, parameterLeft['name'], instantiatedExtends, left), state, parameterRight, right), () => BindParameters(BindArgument(context, state, parameterLeft['name'], instantiatedExtends, instantiatedEquals), state, parameterRight, []));\n}\nfunction BindParameters(context, state, parameters, arguments_) {\n    return Guard.ShiftLeft(parameters, (left, right) => BindArguments(context, state, left, right, arguments_), () => context);\n}\nexport function ResolveArgumentsContext(context, state, parameters, arguments_) {\n    return BindParameters(context, state, parameters, arguments_);\n}\n","// deno-fmt-ignore-file\nimport { Settings } from '../../../system/settings/index.mjs';\nimport { Guard } from '../../../guard/index.mjs';\nimport { CallConstruct } from '../../types/call.mjs';\nimport { Ref } from '../../types/ref.mjs';\nimport { IsGeneric } from '../../types/generic.mjs';\nimport { EvaluateUnion } from '../evaluate/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nimport { InstantiateTypes } from '../instantiate.mjs';\nimport { State } from '../instantiate.mjs';\n// ------------------------------------------------------------------\n// Infrastructure\n// ------------------------------------------------------------------\nimport { DistributeArguments } from './distribute_arguments.mjs';\nimport { ResolveTarget } from './resolve_target.mjs';\nimport { ResolveArgumentsContext } from './resolve_arguments.mjs';\n// ------------------------------------------------------------------\n// InstantiationGuard\n// ------------------------------------------------------------------\nlet instantiationDepth = 0;\nlet instantiationCount = 0;\nfunction InstantiationAssert() {\n    if (Guard.IsLessThan(instantiationCount, Settings.Get().maxInstantiationCount))\n        return;\n    throw Error('Type instantiation is excessively deep and possibly infinite');\n}\nfunction InstantiationIncrement() {\n    InstantiationAssert();\n    instantiationCount++;\n    instantiationDepth++;\n}\nfunction InstantiationDecrement() {\n    instantiationDepth--;\n    if (Guard.IsEqual(instantiationDepth, 0))\n        instantiationCount = 0;\n}\nfunction Peek(state) {\n    const result = Guard.IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : '';\n    return result;\n}\nfunction IsTailCall(state, name) {\n    const result = Guard.IsEqual(Peek(state), name);\n    return result;\n}\nfunction CallDispatch(context, state, target, parameters, expression, arguments_) {\n    InstantiationIncrement();\n    try {\n        const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);\n        const returnType = InstantiateType(argumentsContext, State([...state['callstack'], target['$ref']], state['visited']), expression);\n        return InstantiateType(argumentsContext, State([], []), returnType);\n    }\n    finally {\n        InstantiationDecrement();\n    }\n}\nfunction CallDistributed(context, state, target, parameters, expression, distributedArguments) {\n    return distributedArguments.reduce((result, arguments_) => {\n        const returnType = CallDispatch(context, state, target, parameters, expression, arguments_);\n        return [...result, returnType];\n    }, []);\n}\nfunction CallImmediate(context, state, target, parameters, expression, arguments_) {\n    const distributedArguments = DistributeArguments(parameters, arguments_, expression);\n    const returnTypes = CallDistributed(context, state, target, parameters, expression, distributedArguments);\n    const result = Guard.IsEqual(returnTypes.length, 1) ? returnTypes[0] : EvaluateUnion(returnTypes);\n    return result;\n}\nexport function CallInstantiate(context, state, target, arguments_) {\n    const instantiatedArguments = InstantiateTypes(context, state, arguments_);\n    const resolved = ResolveTarget(context, target, arguments_);\n    const name = resolved[0];\n    const type = resolved[1];\n    const result = (IsGeneric(type)\n        ? IsTailCall(state, name)\n            ? CallConstruct(Ref(name), instantiatedArguments)\n            : CallImmediate(context, state, Ref(name), type.parameters, type.expression, instantiatedArguments)\n        : CallConstruct(target, instantiatedArguments));\n    return result;\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\nimport { CallInstantiate } from '../engine/call/instantiate.mjs';\nimport { State } from '../engine/instantiate.mjs';\nexport function CallConstruct(target, arguments_) {\n    return Memory.Create({ ['~kind']: 'Call' }, { type: 'call', target, arguments: arguments_ }, {});\n}\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Call type. */\nexport function Call(target, arguments_) {\n    return CallInstantiate({}, State([], []), target, arguments_);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given type is a TCall. */\nexport function IsCall(value) {\n    return IsKind(value, 'Call');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nfunction RemoveImmutableOperation(type) {\n    return Memory.Discard(type, ['~immutable']);\n}\nexport function RemoveImmutableAction(type, options) {\n    const result = Memory.Update(RemoveImmutableOperation(type), {}, options);\n    return result;\n}\nexport function RemoveImmutableInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return RemoveImmutableAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nexport function ApplyMapping(mapping, value) {\n    return mapping(value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Literal } from '../../types/literal.mjs';\nimport { ApplyMapping } from './mapping.mjs';\nexport function FromLiteral(mapping, value) {\n    return (Guard.IsString(value)\n        ? Literal(ApplyMapping(mapping, value))\n        : Literal(value));\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateTemplateLiteral } from '../evaluate/index.mjs';\nexport function FromTemplateLiteral(mapping, pattern) {\n    const evaluated = EvaluateTemplateLiteral(pattern);\n    const result = FromType(mapping, evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Union } from '../../types/union.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(mapping, types) {\n    const result = types.map(type => FromType(mapping, type));\n    return Union(result);\n}\n","// deno-fmt-ignore-file\nimport { IsLiteral } from '../../types/literal.mjs';\nimport { IsTemplateLiteral } from '../../types/template_literal.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { FromLiteral } from './from_literal.mjs';\nimport { FromTemplateLiteral } from './from_template_literal.mjs';\nimport { FromUnion } from './from_union.mjs';\nexport function FromType(mapping, type) {\n    return (IsLiteral(type) ? FromLiteral(mapping, type.const) :\n        IsTemplateLiteral(type) ? FromTemplateLiteral(mapping, type.pattern) :\n            IsUnion(type) ? FromUnion(mapping, type.anyOf) :\n                type);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { CapitalizeAction } from '../engine/intrinsics/instantiate.mjs';\n/** Creates a deferred Capitalize action. */\nexport function CapitalizeDeferred(type, options = {}) {\n    return Deferred('Capitalize', [type], options);\n}\n/** Applies a Capitalize action to the given type. */\nexport function Capitalize(type, options = {}) {\n    return CapitalizeAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { LowercaseAction } from '../engine/intrinsics/instantiate.mjs';\n/** Creates a deferred Lowercase action. */\nexport function LowercaseDeferred(type, options = {}) {\n    return Deferred('Lowercase', [type], options);\n}\n/** Applies a Lowercase action to the given type. */\nexport function Lowercase(type, options = {}) {\n    return LowercaseAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { UncapitalizeAction } from '../engine/intrinsics/instantiate.mjs';\n/** Creates a deferred Uncapitalize action. */\nexport function UncapitalizeDeferred(type, options = {}) {\n    return Deferred('Uncapitalize', [type], options);\n}\n/** Applies a Uncapitalize action to the given type. */\nexport function Uncapitalize(type, options = {}) {\n    return UncapitalizeAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { UppercaseAction } from '../engine/intrinsics/instantiate.mjs';\n/** Creates a deferred Uppercase action. */\nexport function UppercaseDeferred(type, options = {}) {\n    return Deferred('Uppercase', [type], options);\n}\n/** Applies a Uppercase action to the given type. */\nexport function Uppercase(type, options = {}) {\n    return UppercaseAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { CapitalizeDeferred } from '../../action/capitalize.mjs';\nimport { LowercaseDeferred } from '../../action/lowercase.mjs';\nimport { UncapitalizeDeferred } from '../../action/uncapitalize.mjs';\nimport { UppercaseDeferred } from '../../action/uppercase.mjs';\nconst CapitalizeMapping = (input) => input[0].toUpperCase() + input.slice(1);\nconst LowercaseMapping = (input) => input.toLowerCase();\nconst UncapitalizeMapping = (input) => input[0].toLowerCase() + input.slice(1);\nconst UppercaseMapping = (input) => input.toUpperCase();\nexport function CapitalizeAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(FromType(CapitalizeMapping, type), {}, options)\n        : CapitalizeDeferred(type, options);\n    return result;\n}\nexport function LowercaseAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(FromType(LowercaseMapping, type), {}, options)\n        : LowercaseDeferred(type, options);\n    return result;\n}\nexport function UncapitalizeAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(FromType(UncapitalizeMapping, type), {}, options)\n        : UncapitalizeDeferred(type, options);\n    return result;\n}\nexport function UppercaseAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(FromType(UppercaseMapping, type), {}, options)\n        : UppercaseDeferred(type, options);\n    return result;\n}\nexport function CapitalizeInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return CapitalizeAction(instantiatedType, options);\n}\nexport function LowercaseInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return LowercaseAction(instantiatedType, options);\n}\nexport function UncapitalizeInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return UncapitalizeAction(instantiatedType, options);\n}\nexport function UppercaseInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return UppercaseAction(instantiatedType, options);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { ConditionalAction } from '../engine/conditional/instantiate.mjs';\nimport { State } from '../engine/instantiate.mjs';\n/** Creates a deferred Conditional action. */\nexport function ConditionalDeferred(left, right, true_, false_, options = {}) {\n    return Deferred('Conditional', [left, right, true_, false_], options);\n}\n/** Applies a Conditional action to the given types. */\nexport function Conditional(left, right, true_, false_, options = {}) {\n    return ConditionalAction({}, State([], []), left, right, true_, false_, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { Union } from '../../types/union.mjs';\nimport { Extends, ExtendsResult } from '../../extends/index.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { ConditionalDeferred } from '../../action/conditional.mjs';\nfunction ConditionalOperation(context, state, left, right, true_, false_) {\n    const extendsResult = Extends(context, left, right);\n    return (ExtendsResult.IsExtendsUnion(extendsResult) ? Union([InstantiateType(extendsResult.inferred, state, true_), InstantiateType(context, state, false_)]) :\n        ExtendsResult.IsExtendsTrue(extendsResult) ? InstantiateType(extendsResult.inferred, state, true_) :\n            InstantiateType(context, state, false_));\n}\nexport function ConditionalAction(context, state, left, right, true_, false_, options) {\n    const result = CanInstantiate([left, right])\n        ? Memory.Update(ConditionalOperation(context, state, left, right, true_, false_), {}, options)\n        : ConditionalDeferred(left, right, true_, false_, options);\n    return result;\n}\nexport function ConditionalInstantiate(context, state, left, right, true_, false_, options) {\n    const instantiatedLeft = InstantiateType(context, state, left);\n    const instantiatedRight = InstantiateType(context, state, right);\n    return ConditionalAction(context, state, instantiatedLeft, instantiatedRight, true_, false_, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { ConstructorParametersAction } from '../engine/constructor_parameters/instantiate.mjs';\n/** Creates a deferred ConstructorParameters action. */\nexport function ConstructorParametersDeferred(type, options = {}) {\n    return Deferred('ConstructorParameters', [type], options);\n}\n/** Applies a ConstructorParameters action to a type. */\nexport function ConstructorParameters(type, options = {}) {\n    return ConstructorParametersAction(type, options);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { IsConstructor } from '../../types/constructor.mjs';\nimport { Tuple } from '../../types/tuple.mjs';\nimport { ConstructorParametersDeferred } from '../../action/constructor_parameters.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { InstantiateElements } from '../instantiate.mjs';\nimport { State } from '../instantiate.mjs';\nfunction ConstructorParametersOperation(type) {\n    const parameters = IsConstructor(type) ? type['parameters'] : [];\n    const instantiatedParameters = InstantiateElements({}, State([], []), parameters);\n    const result = Tuple(instantiatedParameters);\n    return result;\n}\nexport function ConstructorParametersAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(ConstructorParametersOperation(type), {}, options)\n        : ConstructorParametersDeferred(type, options);\n    return result;\n}\nexport function ConstructorParametersInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return ConstructorParametersAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { ExcludeAction } from '../engine/exclude/instantiate.mjs';\n/** Creates a deferred Exclude action. */\nexport function ExcludeDeferred(left, right, options = {}) {\n    return Deferred('Exclude', [left, right], options);\n}\n/** Applies a Exclude action using the given types */\nexport function Exclude(left, right, options = {}) {\n    return ExcludeAction(left, right, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { ExcludeDeferred } from '../../action/exclude.mjs';\nimport { ExcludeOperation } from './operation.mjs';\nexport function ExcludeAction(left, right, options) {\n    const result = CanInstantiate([left, right])\n        ? Memory.Update(ExcludeOperation(left, right), {}, options)\n        : ExcludeDeferred(left, right, options);\n    return result;\n}\nexport function ExcludeInstantiate(context, state, left, right, options) {\n    const instantiatedLeft = InstantiateType(context, state, left);\n    const instantiatedRight = InstantiateType(context, state, right);\n    return ExcludeAction(instantiatedLeft, instantiatedRight, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { ExtractAction } from '../engine/extract/instantiate.mjs';\n/** Creates a deferred Extract action. */\nexport function ExtractDeferred(left, right, options = {}) {\n    return Deferred('Extract', [left, right], options);\n}\n/** Applies an Extract action using the given types. */\nexport function Extract(left, right, options = {}) {\n    return ExtractAction(left, right, options);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { Extends, ExtendsResult } from '../../extends/index.mjs';\nimport { EvaluateType } from '../evaluate/evaluate.mjs';\nimport { EvaluateUnion } from '../evaluate/evaluate.mjs';\nfunction ExtractType(left, right) {\n    const check = Extends({}, left, right);\n    const result = ExtendsResult.IsExtendsTrueLike(check) ? [left] : [];\n    return result;\n}\nfunction ExtractUnion(left, right, result = []) {\n    return Guard.ShiftLeft(left, (head, tail) => ExtractUnion(tail, right, [...result, ...ExtractType(head, right)]), () => result);\n}\nexport function ExtractOperation(left, right) {\n    const evaluated = EvaluateType(left);\n    const canonical = IsUnion(evaluated) ? evaluated.anyOf : [evaluated];\n    const remaining = ExtractUnion(canonical, right);\n    const result = EvaluateUnion(remaining);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { ExtractDeferred } from '../../action/extract.mjs';\nimport { ExtractOperation } from './operation.mjs';\nexport function ExtractAction(left, right, options) {\n    const result = CanInstantiate([left, right])\n        ? Memory.Update(ExtractOperation(left, right), {}, options)\n        : ExtractDeferred(left, right, options);\n    return result;\n}\nexport function ExtractInstantiate(context, state, left, right, options) {\n    const instantiatedLeft = InstantiateType(context, state, left);\n    const instantiatedRight = InstantiateType(context, state, right);\n    return ExtractAction(instantiatedLeft, instantiatedRight, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Deferred } from '../types/deferred.mjs';\nimport { KeysToIndexer } from '../engine/helpers/keys_to_indexer.mjs';\nimport { IndexAction } from '../engine/indexed/instantiate.mjs';\n/** Creates a deferred Index action. */\nexport function IndexDeferred(type, indexer, options = {}) {\n    return Deferred('Index', [type, indexer], options);\n}\n/** Applies a Index action using the given types. */\nexport function Index(type, indexer_or_keys, options = {}) {\n    const indexer = Guard.IsArray(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys;\n    return IndexAction(type, indexer, options);\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { CyclicTarget } from '../cyclic/target.mjs';\nexport function FromCyclic(defs, ref) {\n    const target = CyclicTarget(defs, ref);\n    const result = FromType(target);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateDependent } from '../evaluate/evaluate.mjs';\nexport function FromDependent(if_, then_, else_) {\n    const evaluated = EvaluateDependent(if_, then_, else_);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { Guard } from '../../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nfunction CollapseIntersectProperties(left, right) {\n    const leftKeys = Guard.Keys(left).filter((key) => !Guard.HasPropertyKey(right, key));\n    const rightKeys = Guard.Keys(right).filter((key) => !Guard.HasPropertyKey(left, key));\n    const sharedKeys = Guard.Keys(left).filter((key) => Guard.HasPropertyKey(right, key));\n    const leftProperties = leftKeys.reduce((result, key) => ({ ...result, [key]: left[key] }), {});\n    const rightProperties = rightKeys.reduce((result, key) => ({ ...result, [key]: right[key] }), {});\n    const sharedProperties = sharedKeys.reduce((result, key) => ({ ...result, [key]: EvaluateIntersect([left[key], right[key]]) }), {});\n    const unique = Memory.Assign(leftProperties, rightProperties);\n    const shared = Memory.Assign(unique, sharedProperties);\n    return shared;\n}\nexport function FromIntersect(types) {\n    return types.reduce((result, left) => {\n        return CollapseIntersectProperties(result, FromType(left));\n    }, {});\n}\n","// deno-fmt-ignore-file\nexport function FromObject(properties) {\n    return properties;\n}\n","// deno-fmt-ignore-file\nimport { Tuple } from '../../types/tuple.mjs';\nimport { TupleToObject } from '../tuple/to_object.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromTuple(types) {\n    const object = TupleToObject(Tuple(types));\n    const result = FromType(object);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Unreachable } from '../../../system/unreachable/index.mjs';\nimport { EvaluateUnion } from '../evaluate/evaluate.mjs';\nimport { FromType } from './from_type.mjs';\nfunction CollapseUnionProperties(left, right) {\n    const sharedKeys = Guard.Keys(left).filter((key) => key in right);\n    const result = sharedKeys.reduce((result, key) => {\n        return { ...result, [key]: EvaluateUnion([left[key], right[key]]) };\n    }, {});\n    return result;\n}\nfunction ReduceVariants(types, result) {\n    return Guard.ShiftLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(result, FromType(left))), () => result);\n}\nexport function FromUnion(types) {\n    return Guard.ShiftLeft(types, (left, right) => ReduceVariants(right, FromType(left)), () => Unreachable());\n}\n// deno-coverage-ignore-stop\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { IsCyclic } from '../../types/cyclic.mjs';\nimport { IsDependent } from '../../types/dependent.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { IsObject } from '../../types/object.mjs';\nimport { IsTuple } from '../../types/tuple.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromDependent } from './from_dependent.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nimport { FromUnion } from './from_union.mjs';\nexport function FromType(type) {\n    return (IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) :\n        IsDependent(type) ? FromDependent(type.if, type.then, type.else) :\n            IsIntersect(type) ? FromIntersect(type.allOf) :\n                IsUnion(type) ? FromUnion(type.anyOf) :\n                    IsTuple(type) ? FromTuple(type.items) :\n                        IsObject(type) ? FromObject(type.properties) :\n                            {});\n}\n","// deno-fmt-ignore-file\nimport { Object } from '../../types/object.mjs';\nimport { FromType } from './from_type.mjs';\n/**\n * Collapses a type into a TObject schema. This is a lossy fast path used to\n * normalize arbitrary TSchema types into a TObject structure. This function is\n * primarily used in indexing operations where a normalized object structure\n * is required. If the type cannot be collapsed, an empty object schema is returned.\n */\nexport function CollapseToObject(type) {\n    const properties = FromType(type);\n    const result = Object(properties);\n    return result;\n}\n","// deno-fmt-ignore-file\nconst integerKeyPattern = new RegExp('^(?:0|[1-9][0-9]*)$');\nexport function ConvertToIntegerKey(value) {\n    const normal = `${value}`;\n    return (integerKeyPattern.test(normal)\n        ? parseInt(normal)\n        : value);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Intersect, IsIntersect } from '../../types/intersect.mjs';\nimport { Union, IsUnion } from '../../types/union.mjs';\nimport { Literal, IsLiteral } from '../../types/literal.mjs';\nimport { Number } from '../../types/number.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { Extends, ExtendsResult } from '../../extends/index.mjs';\nimport { ConvertToIntegerKey } from '../helpers/keys.mjs';\nfunction NormalizeLiteral(value) {\n    return Literal(ConvertToIntegerKey(value));\n}\nfunction NormalizeIndexerTypes(types) {\n    return types.map(type => NormalizeIndexer(type));\n}\nexport function NormalizeIndexer(type) {\n    return (IsIntersect(type) ? Intersect(NormalizeIndexerTypes(type.allOf)) :\n        IsUnion(type) ? Union(NormalizeIndexerTypes(type.anyOf)) :\n            IsLiteral(type) ? NormalizeLiteral(type.const) :\n                type);\n}\nexport function FromArray(type, indexer) {\n    const normalizedIndexer = NormalizeIndexer(indexer);\n    const check = Extends({}, normalizedIndexer, Number());\n    const result = (\n    // indexer\n    ExtendsResult.IsExtendsTrueLike(check)\n        ? type\n        // length (intrinsic)\n        : IsLiteral(indexer) && Guard.IsEqual(indexer.const, 'length')\n            ? Number()\n            : Never());\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { CyclicTarget } from '../cyclic/target.mjs';\nexport function FromCyclic(defs, ref) {\n    const target = CyclicTarget(defs, ref);\n    const result = FromType(target);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateDependent } from '../evaluate/evaluate.mjs';\nexport function FromDependent(if_, then_, else_) {\n    const evaluated = EvaluateDependent(if_, then_, else_);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateEnum } from '../evaluate/evaluate.mjs';\nexport function FromEnum(values) {\n    const evaluated = EvaluateEnum(values);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromIntersect(types) {\n    const evaluated = EvaluateIntersect(types);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nexport function FromLiteral(value) {\n    const result = [`${value}`];\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateTemplateLiteral } from '../evaluate/evaluate.mjs';\nexport function FromTemplateLiteral(pattern) {\n    const evaluated = EvaluateTemplateLiteral(pattern);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(types) {\n    return types.reduce((result, left) => {\n        return [...result, ...FromType(left)];\n    }, []);\n}\n","// deno-fmt-ignore-file\nimport { IsCyclic } from '../../types/cyclic.mjs';\nimport { IsDependent } from '../../types/dependent.mjs';\nimport { IsEnum } from '../../types/enum.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { IsLiteral } from '../../types/literal.mjs';\nimport { IsTemplateLiteral } from '../../types/template_literal.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromDependent } from './from_dependent.mjs';\nimport { FromEnum } from './from_enum.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromLiteral } from './from_literal.mjs';\nimport { FromTemplateLiteral } from './from_template_literal.mjs';\nimport { FromUnion } from './from_union.mjs';\nexport function FromType(type) {\n    return (IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) :\n        IsDependent(type) ? FromDependent(type.if, type.then, type.else) :\n            IsEnum(type) ? FromEnum(type.enum) :\n                IsIntersect(type) ? FromIntersect(type.allOf) :\n                    IsLiteral(type) ? FromLiteral(type.const) :\n                        IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) :\n                            IsUnion(type) ? FromUnion(type.anyOf) :\n                                []);\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\n/**\n * Transforms a type meant as an Indexer into string[] array which is used by Indexable types\n * like Index, Pick and Omit to select from property keys. This function should only be used\n * for Object key selection, and not for Array / Tuple key selection as Array-Like structures\n * require TNumber indexing support.\n */\nexport function ToIndexableKeys(type) {\n    const result = FromType(type);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { IsArray, _Array_ } from '../../types/array.mjs';\nimport { IsConstructor, Constructor } from '../../types/constructor.mjs';\nimport { IsFunction, _Function_ } from '../../types/function.mjs';\nimport { IsIntersect, Intersect } from '../../types/intersect.mjs';\nimport { _Object_ } from '../../types/object.mjs';\nimport { IsTuple, Tuple } from '../../types/tuple.mjs';\nimport { IsThis } from '../../types/this.mjs';\nimport { IsUnion, Union } from '../../types/union.mjs';\nfunction FromTypes(properties, types) {\n    return types.map(type => FromType(properties, type));\n}\nexport function FromType(properties, type) {\n    return (IsArray(type) ? _Array_(FromType(properties, type.items)) :\n        IsConstructor(type) ? Constructor(FromTypes(properties, type.parameters), FromType(properties, type.instanceType)) :\n            IsFunction(type) ? _Function_(FromTypes(properties, type.parameters), FromType(properties, type.returnType)) :\n                IsTuple(type) ? Tuple(FromTypes(properties, type.items)) :\n                    IsUnion(type) ? Union(FromTypes(properties, type.anyOf)) :\n                        IsIntersect(type) ? Intersect(FromTypes(properties, type.allOf)) :\n                            IsThis(type) ? _Object_(properties) :\n                                type);\n}\nexport function ExpandThis(properties, type) {\n    const result = FromType(properties, type);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { IsNumber } from '../../types/number.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { PropertyKeys } from '../../types/properties.mjs';\nimport { EvaluateUnion } from '../evaluate/evaluate.mjs';\nimport { ToIndexableKeys } from '../indexable/to_indexable_keys.mjs';\nimport { IntegerKey } from '../../types/record.mjs';\nimport { ExpandThis } from '../this/expand_this.mjs';\nfunction IndexProperty(properties, key) {\n    const selectedType = key in properties ? properties[key] : Never();\n    const result = ExpandThis(properties, selectedType);\n    return result;\n}\nfunction IndexProperties(properties, keys) {\n    return keys.reduce((result, left) => {\n        return [...result, IndexProperty(properties, left)];\n    }, []);\n}\nfunction FromIndexer(properties, indexer) {\n    const keys = ToIndexableKeys(indexer);\n    const variants = IndexProperties(properties, keys);\n    const result = EvaluateUnion(variants);\n    return result;\n}\nconst NumericKeyPattern = new RegExp(IntegerKey);\nfunction NumericKeys(keys) {\n    const result = keys.filter(key => NumericKeyPattern.test(key));\n    return result;\n}\nfunction FromIndexerNumber(properties) {\n    const keys = PropertyKeys(properties);\n    const numericKeys = NumericKeys(keys);\n    const variants = IndexProperties(properties, numericKeys);\n    const result = EvaluateUnion(variants);\n    return result;\n}\nexport function FromObject(properties, indexer) {\n    const result = IsNumber(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Union, IsUnion } from '../../types/union.mjs';\nimport { Intersect, IsIntersect } from '../../types/intersect.mjs';\nimport { Literal, IsLiteral } from '../../types/literal.mjs';\nimport { ConvertToIntegerKey } from '../helpers/keys.mjs';\nfunction ConvertLiteral(value) {\n    return Literal(ConvertToIntegerKey(value));\n}\nfunction ArrayIndexerTypes(types) {\n    return types.map(type => FormatArrayIndexer(type));\n}\n/** Formats embedded integer-like strings on an Indexer to be number values inline with TS indexing | coercion behaviors. */\nexport function FormatArrayIndexer(type) {\n    return (IsIntersect(type) ? Intersect(ArrayIndexerTypes(type.allOf)) :\n        IsUnion(type) ? Union(ArrayIndexerTypes(type.anyOf)) :\n            IsLiteral(type) ? ConvertLiteral(type.const) :\n                type);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Literal, IsLiteral } from '../../types/literal.mjs';\nimport { IsNumber } from '../../types/number.mjs';\nimport { IsInteger } from '../../types/integer.mjs';\nimport { EvaluateUnionFast } from '../evaluate/evaluate.mjs';\nimport { Extends, ExtendsResult } from '../../extends/index.mjs';\nimport { FormatArrayIndexer } from './array_indexer.mjs';\nfunction IndexElementsWithIndexer(types, indexer) {\n    return types.reduceRight((result, right, index) => {\n        const check = Extends({}, Literal(index), indexer);\n        return ExtendsResult.IsExtendsTrueLike(check)\n            ? [right, ...result]\n            : result;\n    }, []);\n}\nfunction FromTupleWithIndexer(types, indexer) {\n    const formattedArrayIndexer = FormatArrayIndexer(indexer);\n    const elements = IndexElementsWithIndexer(types, formattedArrayIndexer);\n    return EvaluateUnionFast(elements);\n}\nfunction FromTupleWithoutIndexer(types) {\n    return EvaluateUnionFast(types);\n}\nexport function FromTuple(types, indexer) {\n    return (\n    // length (intrinsic)\n    IsLiteral(indexer) && Guard.IsEqual(indexer.const, 'length')\n        ? Literal(types.length)\n        // indexer\n        : IsNumber(indexer) || IsInteger(indexer)\n            ? FromTupleWithoutIndexer(types)\n            : FromTupleWithIndexer(types, indexer));\n}\n","// deno-fmt-ignore-file\nimport { IsArray } from '../../types/array.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { IsObject } from '../../types/object.mjs';\nimport { IsTuple } from '../../types/tuple.mjs';\nimport { FromArray } from './from_array.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nexport function FromType(type, indexer) {\n    return (IsArray(type) ? FromArray(type.items, indexer) :\n        IsObject(type) ? FromObject(type.properties, indexer) :\n            IsTuple(type) ? FromTuple(type.items, indexer) :\n                Never());\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { IsCyclic } from '../../types/cyclic.mjs';\nimport { IsDependent } from '../../types/dependent.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { IndexDeferred } from '../../action/indexed.mjs';\nimport { CollapseToObject } from '../object/index.mjs';\nimport { FromType } from './from_type.mjs';\nfunction NormalizeType(type) {\n    const result = (IsCyclic(type) ||\n        IsDependent(type) ||\n        IsIntersect(type) ||\n        IsUnion(type)) ? CollapseToObject(type) : type;\n    return result;\n}\nexport function IndexAction(type, indexer, options) {\n    const result = CanInstantiate([type, indexer])\n        ? Memory.Update(FromType(NormalizeType(type), indexer), {}, options)\n        : IndexDeferred(type, indexer, options);\n    return result;\n}\nexport function IndexInstantiate(context, state, type, indexer, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    const instantiatedIndexer = InstantiateType(context, state, indexer);\n    return IndexAction(instantiatedType, instantiatedIndexer, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { InstanceTypeAction } from '../engine/instance_type/instantiate.mjs';\n/** Creates a deferred InstanceType action. */\nexport function InstanceTypeDeferred(type, options = {}) {\n    return Deferred('InstanceType', [type], options);\n}\n/** Applies a InstanceType action to the given type. */\nexport function InstanceType(type, options = {}) {\n    return InstanceTypeAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { IsConstructor } from '../../types/constructor.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { InstanceTypeDeferred } from '../../action/instance_type.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nfunction InstanceTypeOperation(type) {\n    return (IsConstructor(type)\n        ? type['instanceType']\n        : Never());\n}\nexport function InstanceTypeAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(InstanceTypeOperation(type), {}, options)\n        : InstanceTypeDeferred(type, options);\n    return result;\n}\nexport function InstanceTypeInstantiate(context, state, type, options = {}) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return InstanceTypeAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { KeyOfAction } from '../engine/keyof/instantiate.mjs';\n/** Creates a deferred KeyOf action. */\nexport function KeyOfDeferred(type, options = {}) {\n    return Deferred('KeyOf', [type], options);\n}\n/** Applies a KeyOf action to the given type. */\nexport function KeyOf(type, options = {}) {\n    return KeyOfAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Number } from '../../types/number.mjs';\nimport { String } from '../../types/string.mjs';\nimport { Symbol } from '../../types/symbol.mjs';\nimport { Union } from '../../types/union.mjs';\nexport function FromAny() {\n    return Union([Number(), String(), Symbol()]);\n}\n","// deno-fmt-ignore-file\nimport { Number } from '../../types/number.mjs';\nexport function FromArray(_type) {\n    return Number();\n}\n","// deno-fmt-ignore-file\nimport { Unreachable } from '../../../system/unreachable/index.mjs';\nimport { Guard } from '../../../guard/index.mjs';\nimport { Literal, IsLiteralValue } from '../../types/literal.mjs';\nimport { ConvertToIntegerKey } from '../helpers/keys.mjs';\nimport { EvaluateUnionFast } from '../evaluate/evaluate.mjs';\nfunction FromPropertyKeys(keys) {\n    const result = keys.reduce((result, left) => {\n        return IsLiteralValue(left)\n            ? [...result, Literal(ConvertToIntegerKey(left))]\n            : Unreachable();\n    }, []);\n    return result;\n}\nexport function FromObject(properties) {\n    const propertyKeys = Guard.Keys(properties);\n    const variants = FromPropertyKeys(propertyKeys);\n    const result = EvaluateUnionFast(variants);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { RecordKey } from '../../types/record.mjs';\nexport function FromRecord(type) {\n    return RecordKey(type);\n}\n","// deno-fmt-ignore-file\nimport { Literal } from '../../types/literal.mjs';\nimport { EvaluateUnionFast } from '../evaluate/evaluate.mjs';\nexport function FromTuple(types) {\n    const result = types.map((_, index) => Literal(index));\n    return EvaluateUnionFast(result);\n}\n","// deno-fmt-ignore-file\nimport { IsAny } from '../../types/any.mjs';\nimport { IsArray } from '../../types/array.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { IsObject } from '../../types/object.mjs';\nimport { IsRecord } from '../../types/record.mjs';\nimport { IsTuple } from '../../types/tuple.mjs';\n// ------------------------------------------------------------------\n// Computed\n// ------------------------------------------------------------------\nimport { FromAny } from './from_any.mjs';\nimport { FromArray } from './from_array.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromRecord } from './from_record.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nexport function FromType(type) {\n    return (IsAny(type) ? FromAny() :\n        IsArray(type) ? FromArray(type.items) :\n            IsObject(type) ? FromObject(type.properties) :\n                IsRecord(type) ? FromRecord(type) :\n                    IsTuple(type) ? FromTuple(type.items) :\n                        Never());\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { IsCyclic } from '../../types/cyclic.mjs';\nimport { IsDependent } from '../../types/dependent.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { KeyOfDeferred } from '../../action/keyof.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { CollapseToObject } from '../object/index.mjs';\n// ------------------------------------------------------------------\n// Computed\n// ------------------------------------------------------------------\nimport { FromType } from './from_type.mjs';\nfunction NormalizeType(type) {\n    const result = (IsCyclic(type) ||\n        IsDependent(type) ||\n        IsIntersect(type) ||\n        IsUnion(type)) ? CollapseToObject(type) : type;\n    return result;\n}\nexport function KeyOfAction(type, options) {\n    return (CanInstantiate([type])\n        ? Memory.Update(FromType(NormalizeType(type)), {}, options)\n        : KeyOfDeferred(type, options));\n}\nexport function KeyOfInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return KeyOfAction(instantiatedType, options);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { MappedAction } from '../engine/mapped/instantiate.mjs';\nimport { State } from '../engine/instantiate.mjs';\n/** Creates a deferred Mapped action. */\nexport function MappedDeferred(identifier, type, as, property, options = {}) {\n    return Deferred('Mapped', [identifier, type, as, property], options);\n}\n/** Applies a Mapped action using the given types. */\nexport function Mapped(identifier, type, as, property, options = {}) {\n    return MappedAction({}, State([], []), identifier, type, as, property, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Literal, IsLiteral } from '../../types/literal.mjs';\nimport { IsEnum } from '../../types/enum.mjs';\nimport { IsTemplateLiteral } from '../../types/template_literal.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { EvaluateEnum } from '../evaluate/evaluate.mjs';\nimport { EvaluateTemplateLiteral } from '../evaluate/evaluate.mjs';\nfunction FromTemplateLiteral(pattern) {\n    const evaluated = EvaluateTemplateLiteral(pattern);\n    const result = FromType(evaluated);\n    return result;\n}\nfunction FromUnion(types) {\n    return types.reduce((result, left) => {\n        return [...result, ...FromType(left)];\n    }, []);\n}\nfunction FromEnum(values) {\n    const evaluated = EvaluateEnum(values);\n    const result = FromType(evaluated);\n    return result;\n}\nfunction FromLiteral(value) {\n    const result = Guard.IsNumber(value) ? [Literal(`${value}`)] : [Literal(value)];\n    return result;\n}\nfunction FromType(type) {\n    const result = (IsEnum(type) ? FromEnum(type.enum) :\n        IsLiteral(type) ? FromLiteral(type.const) :\n            IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) :\n                IsUnion(type) ? FromUnion(type.anyOf) :\n                    [type]);\n    return result;\n}\nexport function MappedVariants(type) {\n    const result = FromType(type);\n    return result;\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { IsLiteralNumber, IsLiteralString } from '../../types/literal.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { IsTemplateLiteral } from '../../types/template_literal.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nimport { EvaluateTemplateLiteral } from '../evaluate/evaluate.mjs';\nimport { MappedVariants } from './mapped_variants.mjs';\nfunction CanonicalAs(instantiatedAs) {\n    const result = IsTemplateLiteral(instantiatedAs)\n        ? EvaluateTemplateLiteral(instantiatedAs.pattern)\n        : instantiatedAs;\n    return result;\n}\nfunction MappedVariant(context, state, identifier, variant, as, property) {\n    const variantContext = Memory.Assign(context, { [identifier['name']]: variant });\n    const instantiatedAs = InstantiateType(variantContext, state, as);\n    const canonicalAs = CanonicalAs(instantiatedAs);\n    const instantiatedProperty = InstantiateType(variantContext, state, property);\n    return (IsLiteralNumber(canonicalAs) || IsLiteralString(canonicalAs)\n        ? { [canonicalAs.const]: instantiatedProperty }\n        : {});\n}\nfunction MappedProperties(context, state, identifier, variants, as, property) {\n    return variants.reduce((result, left) => {\n        return [...result, MappedVariant(context, state, identifier, left, as, property)];\n    }, []);\n}\nfunction MappedObjects(properties) {\n    return properties.reduce((result, left) => {\n        return [...result, Object(left)];\n    }, []);\n}\nexport function MappedOperation(context, state, identifier, type, as, property) {\n    const variants = MappedVariants(type);\n    const mappedProperties = MappedProperties(context, state, identifier, variants, as, property);\n    const mappedObjects = MappedObjects(mappedProperties);\n    const result = EvaluateIntersect(mappedObjects);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { MappedDeferred } from '../../action/mapped.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { MappedOperation } from './mapped_operation.mjs';\nexport function MappedAction(context, state, identifier, type, as, property, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(MappedOperation(context, state, identifier, type, as, property), {}, options)\n        : MappedDeferred(identifier, type, as, property, options);\n    return result;\n}\nexport function MappedInstantiate(context, state, identifier, type, as, property, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return MappedAction(context, state, identifier, instantiatedType, as, property, options);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { State } from '../instantiate.mjs';\n// ------------------------------------------------------------------\n// Module: Instantiation Infrastructure\n// ------------------------------------------------------------------\nimport { CyclicCandidates } from '../cyclic/candidates.mjs';\nimport { InstantiateCyclic } from '../cyclic/instantiate.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nfunction InstantiateCyclics(context, declarations, cyclicKeys) {\n    const declarationContext = Memory.Assign(context, declarations);\n    const declarationKeys = Guard.Keys(declarations).filter(key => cyclicKeys.includes(key));\n    return declarationKeys.reduce((result, key) => {\n        return { ...result, [key]: InstantiateCyclic(declarationContext, key, declarations[key]) };\n    }, {});\n}\nfunction InstantiateNonCyclics(context, declarations, cyclicKeys) {\n    const declarationContext = Memory.Assign(context, declarations);\n    const declarationKeys = Guard.Keys(declarations).filter(key => !cyclicKeys.includes(key));\n    return declarationKeys.reduce((result, key) => {\n        return { ...result, [key]: InstantiateType(declarationContext, State([], []), declarations[key]) };\n    }, {});\n}\nfunction InstantiateModule(context, declarations, options) {\n    const cyclicCandidates = CyclicCandidates(declarations);\n    const instantiatedCyclics = InstantiateCyclics(context, declarations, cyclicCandidates);\n    const instantiatedNonCyclics = InstantiateNonCyclics(context, declarations, cyclicCandidates);\n    const instantiatedModule = { ...instantiatedCyclics, ...instantiatedNonCyclics };\n    return Memory.Update(instantiatedModule, {}, options);\n}\nexport function ModuleInstantiate(context, _state, declarations, options) {\n    const instantiatedModule = InstantiateModule(context, declarations, options);\n    return instantiatedModule;\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { NonNullableAction } from '../engine/non_nullable/instantiate.mjs';\n/** Creates a deferred NonNullable action. */\nexport function NonNullableDeferred(type, options = {}) {\n    return Deferred('NonNullable', [type], options);\n}\n/** Applies a NonNullable action to the given type. */\nexport function NonNullable(type, options = {}) {\n    return NonNullableAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { Null } from '../../types/null.mjs';\nimport { Undefined } from '../../types/undefined.mjs';\nimport { Union } from '../../types/union.mjs';\nimport { ExcludeAction } from '../exclude/instantiate.mjs';\nimport { NonNullableDeferred } from '../../action/non_nullable.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nfunction NonNullableOperation(type) {\n    const excluded = Union([Null(), Undefined()]);\n    return ExcludeAction(type, excluded, {});\n}\nexport function NonNullableAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(NonNullableOperation(type), {}, options)\n        : NonNullableDeferred(type, options);\n    return result;\n}\nexport function NonNullableInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return NonNullableAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Deferred } from '../types/deferred.mjs';\nimport { KeysToIndexer } from '../engine/helpers/keys_to_indexer.mjs';\nimport { OmitAction } from '../engine/omit/instantiate.mjs';\n/** Creates a deferred Omit action. */\nexport function OmitDeferred(type, indexer, options = {}) {\n    return Deferred('Omit', [type, indexer], options);\n}\n/** Applies a Omit action using the given types. */\nexport function Omit(type, indexer_or_keys, options = {}) {\n    const indexer = Guard.IsArray(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys;\n    return OmitAction(type, indexer, options);\n}\n","// deno-fmt-ignore-file\nimport { Unreachable } from '../../../system/unreachable/index.mjs';\nimport { IsObject } from '../../types/object.mjs';\nimport { CollapseToObject } from '../object/index.mjs';\n// deno-coverage-ignore-start - symmetric unreachable\n/** Transforms a type into a TProperties used for indexing operations */\nexport function ToIndexable(type) {\n    const collapsed = CollapseToObject(type);\n    const result = IsObject(collapsed)\n        ? collapsed.properties\n        : Unreachable();\n    return result;\n}\n// deno-coverage-ignore-stop\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { ToIndexableKeys } from '../indexable/to_indexable_keys.mjs';\nimport { ToIndexable } from '../indexable/to_indexable.mjs';\nfunction FromKeys(properties, keys) {\n    const result = Guard.Keys(properties).reduce((result, key) => {\n        return keys.includes(key) ? result : { ...result, [key]: properties[key] };\n    }, {});\n    return result;\n}\nexport function FromType(type, indexer) {\n    const indexable = ToIndexable(type);\n    const indexableKeys = ToIndexableKeys(indexer);\n    const omitted = FromKeys(indexable, indexableKeys);\n    const result = Object(omitted);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { OmitDeferred } from '../../action/omit.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { FromType } from './from_type.mjs';\nexport function OmitAction(type, indexer, options) {\n    const result = CanInstantiate([type, indexer])\n        ? Memory.Update(FromType(type, indexer), {}, options)\n        : OmitDeferred(type, indexer, options);\n    return result;\n}\nexport function OmitInstantiate(context, state, type, indexer, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    const instantiatedIndexer = InstantiateType(context, state, indexer);\n    return OmitAction(instantiatedType, instantiatedIndexer, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { ParametersAction } from '../engine/parameters/instantiate.mjs';\n/** Creates a deferred Parameters action. */\nexport function ParametersDeferred(type, options = {}) {\n    return Deferred('Parameters', [type], options);\n}\n/** Applies a Parameters action to the given type. */\nexport function Parameters(type, options = {}) {\n    return ParametersAction(type, options);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { IsFunction } from '../../types/function.mjs';\nimport { Tuple } from '../../types/tuple.mjs';\nimport { ParametersDeferred } from '../../action/parameters.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { InstantiateElements } from '../instantiate.mjs';\nimport { State } from '../instantiate.mjs';\nfunction ParametersOperation(type) {\n    const parameters = IsFunction(type) ? type['parameters'] : [];\n    const instantiatedParameters = InstantiateElements({}, State([], []), parameters);\n    const result = Tuple(instantiatedParameters);\n    return result;\n}\nexport function ParametersAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(ParametersOperation(type), {}, options)\n        : ParametersDeferred(type, options);\n    return result;\n}\nexport function ParametersInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return ParametersAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { PartialAction } from '../engine/partial/instantiate.mjs';\n/** Creates a deferred Partial action. */\nexport function PartialDeferred(type, options = {}) {\n    return Deferred('Partial', [type], options);\n}\n/** Applies a Partial action to the given type. */\nexport function Partial(type, options = {}) {\n    return PartialAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { Cyclic } from '../../types/cyclic.mjs';\nimport { FromType } from './from_type.mjs';\nimport { CyclicTarget } from '../cyclic/target.mjs';\nexport function FromCyclic(defs, ref) {\n    const target = CyclicTarget(defs, ref);\n    const partial = FromType(target);\n    const result = Cyclic(Memory.Assign(defs, { [ref]: partial }), ref);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateDependent } from '../evaluate/evaluate.mjs';\nexport function FromDependent(if_, then_, else_) {\n    const evaluated = EvaluateDependent(if_, then_, else_);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nexport function FromIntersect(types) {\n    const evaluated = EvaluateIntersect(types);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Union } from '../../types/union.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(types) {\n    const result = types.map(type => FromType(type));\n    return Union(result);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { AddOptional } from '../../action/_add_optional.mjs';\nexport function FromObject(properties) {\n    const mapped = Guard.Keys(properties).reduce((result, left) => {\n        return { ...result, [left]: AddOptional(properties[left]) };\n    }, {});\n    const result = Object(mapped);\n    return result;\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { IsCyclic } from '../../types/cyclic.mjs';\nimport { IsDependent } from '../../types/dependent.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { Object, IsObject } from '../../types/object.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromDependent } from './from_dependent.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromUnion } from './from_union.mjs';\nimport { FromObject } from './from_object.mjs';\nexport function FromType(type) {\n    return (IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) :\n        IsDependent(type) ? FromDependent(type.if, type.then, type.else) :\n            IsIntersect(type) ? FromIntersect(type.allOf) :\n                IsUnion(type) ? FromUnion(type.anyOf) :\n                    IsObject(type) ? FromObject(type.properties) :\n                        Object({}));\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { PartialDeferred } from '../../action/partial.mjs';\nimport { FromType } from './from_type.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nexport function PartialAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(FromType(type), {}, options)\n        : PartialDeferred(type, options);\n    return result;\n}\nexport function PartialInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return PartialAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Deferred } from '../types/deferred.mjs';\nimport { KeysToIndexer } from '../engine/helpers/keys_to_indexer.mjs';\nimport { PickAction } from '../engine/pick/instantiate.mjs';\n/** Creates a deferred Pick action. */\nexport function PickDeferred(type, indexer, options = {}) {\n    return Deferred('Pick', [type, indexer], options);\n}\n/** Applies a Pick action using the given types. */\nexport function Pick(type, indexer_or_keys, options = {}) {\n    const indexer = Guard.IsArray(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys;\n    return PickAction(type, indexer, options);\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { Guard } from '../../../guard/index.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { ToIndexableKeys } from '../indexable/to_indexable_keys.mjs';\nimport { ToIndexable } from '../indexable/to_indexable.mjs';\nfunction FromKeys(properties, keys) {\n    const result = Guard.Keys(properties).reduce((result, key) => {\n        return keys.includes(key) ? Memory.Assign(result, { [key]: properties[key] }) : result;\n    }, {});\n    return result;\n}\nexport function FromType(type, indexer) {\n    const indexable = ToIndexable(type);\n    const keys = ToIndexableKeys(indexer);\n    const applied = FromKeys(indexable, keys);\n    const result = Object(applied);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { PickDeferred } from '../../action/pick.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { FromType } from './from_type.mjs';\nexport function PickAction(type, indexer, options) {\n    const result = CanInstantiate([type, indexer])\n        ? Memory.Update(FromType(type, indexer), {}, options)\n        : PickDeferred(type, indexer, options);\n    return result;\n}\nexport function PickInstantiate(context, state, type, indexer, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    const instantiatedIndexer = InstantiateType(context, state, indexer);\n    return PickAction(instantiatedType, instantiatedIndexer, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { ReadonlyObjectAction } from '../engine/readonly_object/instantiate.mjs';\n/** Creates a deferred ReadonlyType action. */\nexport function ReadonlyObjectDeferred(type, options = {}) {\n    return Deferred('ReadonlyObject', [type], options);\n}\n/** This type is an alias for TypeScript's `Readonly<T>` utility type. It will make all properties of a TObject readonly or marks an TArray or TTuple as immutable `readonly T[]`. */\nexport function ReadonlyObject(type, options = {}) {\n    return ReadonlyObjectAction(type, options);\n}\n// ------------------------------------------------------------------\n// Alias\n// ------------------------------------------------------------------\n/**\n * This type has been renamed to ReadonlyObject.\n * @deprecated\n*/\nexport const ReadonlyType = ReadonlyObject;\n","// deno-fmt-ignore-file\nimport { Array } from '../../types/array.mjs';\nimport { AddImmutable } from '../../action/_add_immutable.mjs';\nexport function FromArray(type) {\n    const result = AddImmutable(Array(type));\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { Cyclic } from '../../types/cyclic.mjs';\nimport { FromType } from './from_type.mjs';\nimport { CyclicTarget } from '../cyclic/target.mjs';\nexport function FromCyclic(defs, ref) {\n    const target = CyclicTarget(defs, ref);\n    const partial = FromType(target);\n    const result = Cyclic(Memory.Assign(defs, { [ref]: partial }), ref);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateDependent } from '../evaluate/evaluate.mjs';\nexport function FromDependent(if_, then_, else_) {\n    const evaluated = EvaluateDependent(if_, then_, else_);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nexport function FromIntersect(types) {\n    const evaluated = EvaluateIntersect(types);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { AddReadonly } from '../../action/_add_readonly.mjs';\nexport function FromObject(properties) {\n    const mapped = Guard.Keys(properties).reduce((result, left) => {\n        return { ...result, [left]: AddReadonly(properties[left]) };\n    }, {});\n    const result = Object(mapped);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Tuple } from '../../types/tuple.mjs';\nimport { AddImmutable } from '../../action/_add_immutable.mjs';\nexport function FromTuple(types) {\n    const result = AddImmutable(Tuple(types));\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Union } from '../../types/union.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(types) {\n    const result = types.map(type => FromType(type));\n    return Union(result);\n}\n","// deno-fmt-ignore-file\nimport { IsArray } from '../../types/array.mjs';\nimport { IsCyclic } from '../../types/cyclic.mjs';\nimport { IsDependent } from '../../types/dependent.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { IsObject } from '../../types/object.mjs';\nimport { IsTuple } from '../../types/tuple.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { FromArray } from './from_array.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromDependent } from './from_dependent.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nimport { FromUnion } from './from_union.mjs';\nexport function FromType(type) {\n    return (IsArray(type) ? FromArray(type.items) :\n        IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) :\n            IsDependent(type) ? FromDependent(type.if, type.then, type.else) :\n                IsIntersect(type) ? FromIntersect(type.allOf) :\n                    IsObject(type) ? FromObject(type.properties) :\n                        IsTuple(type) ? FromTuple(type.items) :\n                            IsUnion(type) ? FromUnion(type.anyOf) :\n                                type);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { ReadonlyObjectDeferred } from '../../action/readonly_object.mjs';\nimport { FromType } from './from_type.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nexport function ReadonlyObjectAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(FromType(type), {}, options)\n        : ReadonlyObjectDeferred(type);\n    return result;\n}\nexport function ReadonlyObjectInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return ReadonlyObjectAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { InstantiateType } from '../instantiate.mjs';\nimport { State } from '../instantiate.mjs';\nexport function RefInstantiate(context, state, type, ref) {\n    return (state.visited.includes(ref)\n        ? type\n        : ref in context\n            ? InstantiateType(context, State(state['callstack'], [...state['visited'], ref]), context[ref])\n            : type);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { Cyclic } from '../../types/cyclic.mjs';\nimport { FromType } from './from_type.mjs';\nimport { CyclicTarget } from '../cyclic/target.mjs';\nexport function FromCyclic(defs, ref) {\n    const target = CyclicTarget(defs, ref);\n    const partial = FromType(target);\n    const result = Cyclic(Memory.Assign(defs, { [ref]: partial }), ref);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateDependent } from '../evaluate/evaluate.mjs';\nexport function FromDependent(if_, then_, else_) {\n    const evaluated = EvaluateDependent(if_, then_, else_);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { EvaluateIntersect } from '../evaluate/evaluate.mjs';\nexport function FromIntersect(types) {\n    const evaluated = EvaluateIntersect(types);\n    const result = FromType(evaluated);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Union } from '../../types/union.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(types) {\n    const result = types.map(type => FromType(type));\n    return Union(result);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Object } from '../../types/object.mjs';\nimport { RemoveOptional } from '../../action/_remove_optional.mjs';\nexport function FromObject(properties) {\n    const mapped = Guard.Keys(properties).reduce((result, left) => {\n        return { ...result, [left]: RemoveOptional(properties[left]) };\n    }, {});\n    const result = Object(mapped);\n    return result;\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { IsCyclic } from '../../types/cyclic.mjs';\nimport { IsDependent } from '../../types/dependent.mjs';\nimport { IsIntersect } from '../../types/intersect.mjs';\nimport { Object, IsObject } from '../../types/object.mjs';\nimport { IsUnion } from '../../types/union.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromDependent } from './from_dependent.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromUnion } from './from_union.mjs';\nimport { FromObject } from './from_object.mjs';\nexport function FromType(type) {\n    return (IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) :\n        IsDependent(type) ? FromDependent(type.if, type.then, type.else) :\n            IsIntersect(type) ? FromIntersect(type.allOf) :\n                IsUnion(type) ? FromUnion(type.anyOf) :\n                    IsObject(type) ? FromObject(type.properties) :\n                        Object({}));\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { RequiredAction } from '../engine/required/instantiate.mjs';\n/** Creates a deferred Required action. */\nexport function RequiredDeferred(type, options = {}) {\n    return Deferred('Required', [type], options);\n}\n/** Applies a Required action to the given type. */\nexport function Required(type, options = {}) {\n    return RequiredAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { RequiredDeferred } from '../../action/required.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nexport function RequiredAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(FromType(type), {}, options)\n        : RequiredDeferred(type, options);\n    return result;\n}\nexport function RequiredInstantiate(context, state, type, options) {\n    const instaniatedType = InstantiateType(context, state, type);\n    return RequiredAction(instaniatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { ReturnTypeAction } from '../engine/return_type/instantiate.mjs';\n/** Creates a deferred ReturnType action. */\nexport function ReturnTypeDeferred(type, options = {}) {\n    return Deferred('ReturnType', [type], options);\n}\n/** Applies a ReturnType action to the given type. */\nexport function ReturnType(type, options = {}) {\n    return ReturnTypeAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { IsFunction } from '../../types/function.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { ReturnTypeDeferred } from '../../action/return_type.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nfunction ReturnTypeOperation(type) {\n    return (IsFunction(type)\n        ? type['returnType']\n        : Never());\n}\nexport function ReturnTypeAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(ReturnTypeOperation(type), {}, options)\n        : ReturnTypeDeferred(type, options);\n    return result;\n}\nexport function ReturnTypeInstantiate(context, state, type, options = {}) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return ReturnTypeAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { WithAction } from '../engine/with/instantiate.mjs';\n/** Creates a deferred With action. */\nexport function WithDeferred(type, options) {\n    return Deferred('With', [type, options], {});\n}\n/** Applies annotation options to the given type. */\nexport function With(type, options) {\n    return WithAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType, CanInstantiate } from '../instantiate.mjs';\nimport { WithDeferred } from '../../action/with.mjs';\nexport function WithAction(type, options) {\n    const result = CanInstantiate([type])\n        ? Memory.Update(type, {}, options)\n        : WithDeferred(type, options);\n    return result;\n}\nexport function WithInstantiate(context, state, type, options) {\n    const instaniatedType = InstantiateType(context, state, type);\n    return WithAction(instaniatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { IsInfer } from '../../types/infer.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { IsRest } from '../../types/rest.mjs';\nimport { IsRef } from '../../types/ref.mjs';\nimport { IsTuple } from '../../types/tuple.mjs';\nfunction SpreadElement(type) {\n    const result = (IsRest(type) ? (IsTuple(type.items) ? RestSpread(type.items.items) :\n        IsInfer(type.items) ? [type] :\n            IsRef(type.items) ? [type] :\n                [Never()]) : [type]);\n    return result;\n}\nexport function RestSpread(types) {\n    const result = types.reduce((result, left) => {\n        return [...result, ...SpreadElement(left)];\n    }, []);\n    return result;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Modifiers\n// ------------------------------------------------------------------\nimport { AddImmutableAction } from './immutable/instantiate_add.mjs';\nimport { AddReadonlyAction } from './readonly/instantiate_add.mjs';\nimport { AddOptionalAction } from './optional/instantiate_add.mjs';\nimport { _Array_, IsArray, ArrayOptions } from '../types/array.mjs';\nimport { Constructor, IsConstructor, ConstructorOptions } from '../types/constructor.mjs';\nimport { Deferred, IsDeferred } from '../types/deferred.mjs';\nimport { _Function_, IsFunction, FunctionOptions } from '../types/function.mjs';\nimport { IsCall } from '../types/call.mjs';\nimport { Dependent, IsDependent, DependentOptions } from '../types/dependent.mjs';\nimport { Intersect, IsIntersect, IntersectOptions } from '../types/intersect.mjs';\nimport { Object, IsObject, ObjectOptions } from '../types/object.mjs';\nimport { RecordFromPattern, IsRecord, RecordPattern, RecordValue } from '../types/record.mjs';\nimport { Tuple, IsTuple, TupleOptions } from '../types/tuple.mjs';\nimport { Union, IsUnion, UnionOptions } from '../types/union.mjs';\nimport { IsRef } from '../types/ref.mjs';\nimport { Rest, IsRest } from '../types/rest.mjs';\n// ------------------------------------------------------------------\n// Modifier Instantiate\n// ------------------------------------------------------------------\nimport { AddImmutableInstantiate } from './immutable/instantiate_add.mjs';\nimport { RemoveImmutableInstantiate } from './immutable/instantiate_remove.mjs';\nimport { AddReadonlyInstantiate } from './readonly/instantiate_add.mjs';\nimport { RemoveReadonlyInstantiate } from './readonly/instantiate_remove.mjs';\nimport { AddOptionalInstantiate } from './optional/instantiate_add.mjs';\nimport { RemoveOptionalInstantiate } from './optional/instantiate_remove.mjs';\nimport { IsOptional } from '../types/_optional.mjs';\nimport { IsImmutable } from '../types/_immutable.mjs';\nimport { IsReadonly } from '../types/_readonly.mjs';\n// ------------------------------------------------------------------\n// Instantiate\n// ------------------------------------------------------------------\nimport { CallInstantiate } from './call/instantiate.mjs';\nimport { CapitalizeInstantiate } from './intrinsics/instantiate.mjs';\nimport { ConditionalInstantiate } from './conditional/index.mjs';\nimport { ConstructorParametersInstantiate } from './constructor_parameters/instantiate.mjs';\nimport { EvaluateInstantiate } from './evaluate/instantiate.mjs';\nimport { ExcludeInstantiate } from './exclude/instantiate.mjs';\nimport { ExtractInstantiate } from './extract/instantiate.mjs';\nimport { IndexInstantiate } from './indexed/instantiate.mjs';\nimport { InstanceTypeInstantiate } from './instance_type/instantiate.mjs';\nimport { InterfaceInstantiate } from './interface/instantiate.mjs';\nimport { KeyOfInstantiate } from './keyof/instantiate.mjs';\nimport { LowercaseInstantiate } from './intrinsics/instantiate.mjs';\nimport { MappedInstantiate } from './mapped/instantiate.mjs';\nimport { ModuleInstantiate } from './module/instantiate.mjs';\nimport { NonNullableInstantiate } from './non_nullable/instantiate.mjs';\nimport { OmitInstantiate } from './omit/instantiate.mjs';\nimport { ParametersInstantiate } from './parameters/instantiate.mjs';\nimport { PartialInstantiate } from './partial/instantiate.mjs';\nimport { PickInstantiate } from './pick/instantiate.mjs';\nimport { ReadonlyObjectInstantiate } from './readonly_object/instantiate.mjs';\nimport { RecordInstantiate } from './record/instantiate.mjs';\nimport { RefInstantiate } from './ref/instantiate.mjs';\nimport { RequiredInstantiate } from './required/instantiate.mjs';\nimport { ReturnTypeInstantiate } from './return_type/instantiate.mjs';\nimport { TemplateLiteralInstantiate } from './template_literal/instantiate.mjs';\nimport { UncapitalizeInstantiate } from './intrinsics/instantiate.mjs';\nimport { UppercaseInstantiate } from './intrinsics/instantiate.mjs';\nimport { WithInstantiate } from './with/instantiate.mjs';\nimport { RestSpread } from './rest/index.mjs';\nexport function State(callstack, visited) {\n    return { callstack, visited };\n}\nexport function CanInstantiate(types) {\n    return Guard.ShiftLeft(types, (left, right) => IsRef(left)\n        ? false\n        : CanInstantiate(right), () => true);\n}\nexport function InstantiateProperties(context, state, properties) {\n    return Guard.Keys(properties).reduce((result, key) => {\n        return { ...result, [key]: InstantiateType(context, state, properties[key]) };\n    }, {});\n}\nexport function InstantiateElements(context, state, types) {\n    const elements = InstantiateTypes(context, state, types);\n    const result = RestSpread(elements);\n    return result;\n}\nexport function InstantiateTypes(context, state, types) {\n    return types.map(type => InstantiateType(context, state, type));\n}\nfunction WithModifiers(type, instantiatedType) {\n    const withOptional = IsOptional(type) ? AddOptionalAction(instantiatedType, {}) : instantiatedType;\n    const withReadonly = IsReadonly(type) ? AddReadonlyAction(withOptional, {}) : withOptional;\n    const withImmutable = IsImmutable(type) ? AddImmutableAction(withReadonly, {}) : withReadonly;\n    return withImmutable;\n}\nfunction InstantiateDeferred(context, state, action, parameters, options) {\n    return (\n    // Modifiers\n    Guard.IsEqual(action, 'AddImmutable') ? AddImmutableInstantiate(context, state, parameters[0], options) :\n        Guard.IsEqual(action, 'RemoveImmutable') ? RemoveImmutableInstantiate(context, state, parameters[0], options) :\n            Guard.IsEqual(action, 'AddReadonly') ? AddReadonlyInstantiate(context, state, parameters[0], options) :\n                Guard.IsEqual(action, 'RemoveReadonly') ? RemoveReadonlyInstantiate(context, state, parameters[0], options) :\n                    Guard.IsEqual(action, 'AddOptional') ? AddOptionalInstantiate(context, state, parameters[0], options) :\n                        Guard.IsEqual(action, 'RemoveOptional') ? RemoveOptionalInstantiate(context, state, parameters[0], options) :\n                            // Actions\n                            Guard.IsEqual(action, 'Capitalize') ? CapitalizeInstantiate(context, state, parameters[0], options) :\n                                Guard.IsEqual(action, 'Conditional') ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) :\n                                    Guard.IsEqual(action, 'ConstructorParameters') ? ConstructorParametersInstantiate(context, state, parameters[0], options) :\n                                        Guard.IsEqual(action, 'Evaluate') ? EvaluateInstantiate(context, state, parameters[0], options) :\n                                            Guard.IsEqual(action, 'Exclude') ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) :\n                                                Guard.IsEqual(action, 'Extract') ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) :\n                                                    Guard.IsEqual(action, 'Index') ? IndexInstantiate(context, state, parameters[0], parameters[1], options) :\n                                                        Guard.IsEqual(action, 'InstanceType') ? InstanceTypeInstantiate(context, state, parameters[0], options) :\n                                                            Guard.IsEqual(action, 'Interface') ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) :\n                                                                Guard.IsEqual(action, 'KeyOf') ? KeyOfInstantiate(context, state, parameters[0], options) :\n                                                                    Guard.IsEqual(action, 'Lowercase') ? LowercaseInstantiate(context, state, parameters[0], options) :\n                                                                        Guard.IsEqual(action, 'Mapped') ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) :\n                                                                            Guard.IsEqual(action, 'Module') ? ModuleInstantiate(context, state, parameters[0], options) :\n                                                                                Guard.IsEqual(action, 'NonNullable') ? NonNullableInstantiate(context, state, parameters[0], options) :\n                                                                                    Guard.IsEqual(action, 'Pick') ? PickInstantiate(context, state, parameters[0], parameters[1], options) :\n                                                                                        Guard.IsEqual(action, 'Parameters') ? ParametersInstantiate(context, state, parameters[0], options) :\n                                                                                            Guard.IsEqual(action, 'Partial') ? PartialInstantiate(context, state, parameters[0], options) :\n                                                                                                Guard.IsEqual(action, 'Omit') ? OmitInstantiate(context, state, parameters[0], parameters[1], options) :\n                                                                                                    Guard.IsEqual(action, 'ReadonlyObject') ? ReadonlyObjectInstantiate(context, state, parameters[0], options) :\n                                                                                                        Guard.IsEqual(action, 'Record') ? RecordInstantiate(context, state, parameters[0], parameters[1], options) :\n                                                                                                            Guard.IsEqual(action, 'Required') ? RequiredInstantiate(context, state, parameters[0], options) :\n                                                                                                                Guard.IsEqual(action, 'ReturnType') ? ReturnTypeInstantiate(context, state, parameters[0], options) :\n                                                                                                                    Guard.IsEqual(action, 'TemplateLiteral') ? TemplateLiteralInstantiate(context, state, parameters[0], options) :\n                                                                                                                        Guard.IsEqual(action, 'Uncapitalize') ? UncapitalizeInstantiate(context, state, parameters[0], options) :\n                                                                                                                            Guard.IsEqual(action, 'Uppercase') ? UppercaseInstantiate(context, state, parameters[0], options) :\n                                                                                                                                Guard.IsEqual(action, 'With') ? WithInstantiate(context, state, parameters[0], parameters[1]) :\n                                                                                                                                    Deferred(action, parameters, options));\n}\nfunction InstantiateImmediate(context, state, type) {\n    const instantiatedType = (IsRef(type) ? RefInstantiate(context, state, type, type.$ref) :\n        IsArray(type) ? _Array_(InstantiateType(context, state, type.items), ArrayOptions(type)) :\n            IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) :\n                IsConstructor(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) :\n                    IsFunction(type) ? _Function_(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) :\n                        IsDependent(type) ? Dependent(InstantiateType(context, state, type.if), InstantiateType(context, state, type.then), InstantiateType(context, state, type.else), DependentOptions(type)) :\n                            IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) :\n                                IsObject(type) ? Object(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) :\n                                    IsRecord(type) ? RecordFromPattern(RecordPattern(type), InstantiateType(context, state, RecordValue(type))) :\n                                        IsRest(type) ? Rest(InstantiateType(context, state, type.items)) :\n                                            IsTuple(type) ? Tuple(InstantiateElements(context, state, type.items), TupleOptions(type)) :\n                                                IsUnion(type) ? Union(InstantiateTypes(context, state, type.anyOf), UnionOptions(type)) :\n                                                    type);\n    const withModifiers = WithModifiers(type, instantiatedType);\n    return withModifiers;\n}\nexport function InstantiateType(context, state, type) {\n    const result = IsDeferred(type)\n        ? InstantiateDeferred(context, state, type.action, type.parameters, type.options)\n        : InstantiateImmediate(context, state, type);\n    return result;\n}\n/** Instantiates computed schematics using the given context and type. */\nexport function Instantiate(context, type) {\n    return InstantiateType(context, State([], []), type);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nfunction AddImmutableOperation(type) {\n    return Memory.Update(type, { '~immutable': true }, {});\n}\nexport function AddImmutableAction(type, options) {\n    const result = Memory.Update(AddImmutableOperation(type), {}, options);\n    return result;\n}\nexport function AddImmutableInstantiate(context, state, type, options) {\n    const instantiatedType = InstantiateType(context, state, type);\n    return AddImmutableAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { AddImmutableAction } from '../engine/immutable/instantiate_add.mjs';\n/** Creates a deferred AddImmutable action. */\nexport function AddImmutableDeferred(type, options = {}) {\n    return Deferred('AddImmutable', [type], options);\n}\n/** Applies an AddImmutable action to a type. */\nexport function AddImmutable(type, options = {}) {\n    return AddImmutableAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { EvaluateAction } from '../engine/evaluate/instantiate.mjs';\n/** Creates a deferred Evaluate action. */\nexport function EvaluateDeferred(type, options = {}) {\n    return Deferred('Evaluate', [type], options);\n}\n/** Applies an Evaluate action to a type. */\nexport function Evaluate(type, options = {}) {\n    return EvaluateAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Compare, CompareResultRightInside, CompareResultDisjoint } from '../evaluate/compare.mjs';\nfunction Comparer(left, right) {\n    const compareResult = Compare(left, right);\n    return (Guard.IsEqual(compareResult, CompareResultRightInside) ? 1 :\n        Guard.IsEqual(compareResult, CompareResultDisjoint) ? 1 :\n            0);\n}\nfunction Insert(type, types, result = []) {\n    return Guard.ShiftLeft(types, (left, right) => Guard.IsEqual(Comparer(type, left), 1)\n        ? Insert(type, right, [...result, left])\n        : [...result, type, ...types], () => [...result, type]);\n}\nfunction Sort(types, result = []) {\n    return Guard.ShiftLeft(types, (left, right) => Sort(right, Insert(left, result)), () => result);\n}\n/**\n * Priority sorts types in sequence of narrowest to broadest using an Insertion Sort\n * algorithm. This function is typically used to sequence types for union variant\n * checks to ensure that values are checked against the most narrow types before\n * the broadest, which in turn helps ensure order-independent Union checking.\n */\nexport function Priority(types) {\n    const result = Sort(types);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains an '~refine` keyword\n * @specification None\n */\nexport function IsRefine(value) {\n    return Guard.HasPropertyKey(value, '~refine')\n        && Guard.IsArray(value[\"~refine\"])\n        && Guard.Every(value['~refine'], 0, value => Guard.IsObject(value)\n            && Guard.HasPropertyKey(value, 'check')\n            && Guard.HasPropertyKey(value, 'error')\n            && Guard.IsFunction(value.check)\n            && Guard.IsFunction(value.error));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n/** Returns true if this value is object like */\nexport function IsSchemaObject(value) {\n    return Guard.IsObject(value) && !Guard.IsArray(value);\n}\n/** Returns true if this value is a boolean */\nexport function IsSchemaBoolean(value) {\n    return Guard.IsBoolean(value);\n}\n/** Returns true if this value is schema like */\nexport function IsSchema(value) {\n    return IsSchemaObject(value) || IsSchemaBoolean(value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from '../types/schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid additionalItems property\n * @specification Json Schema 7\n */\nexport function IsAdditionalItems(schema) {\n    return Guard.HasPropertyKey(schema, 'additionalItems')\n        && IsSchema(schema.additionalItems);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid additionalProperties property\n * @specification Json Schema 7\n */\nexport function IsAdditionalProperties(schema) {\n    return Guard.HasPropertyKey(schema, 'additionalProperties')\n        && IsSchema(schema.additionalProperties);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid allOf property\n * @specification Json Schema 7\n */\nexport function IsAllOf(schema) {\n    return Guard.HasPropertyKey(schema, 'allOf')\n        && Guard.IsArray(schema.allOf)\n        && schema.allOf.every(value => IsSchema(value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid $anchor property\n */\nexport function IsAnchor(schema) {\n    return Guard.HasPropertyKey(schema, '$anchor')\n        && Guard.IsString(schema.$anchor);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid anyOf property\n * @specification Json Schema 7\n */\nexport function IsAnyOf(schema) {\n    return Guard.HasPropertyKey(schema, 'anyOf')\n        && Guard.IsArray(schema.anyOf)\n        && schema.anyOf.every(value => IsSchema(value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid const property\n * @specification Json Schema 7\n */\nexport function IsConst(value) {\n    return Guard.HasPropertyKey(value, 'const');\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid contains property\n * @specification Json Schema 7\n */\nexport function IsContains(schema) {\n    return Guard.HasPropertyKey(schema, 'contains')\n        && IsSchema(schema.contains);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid contentMediaType property\n * @specification Json Schema 7\n */\nexport function IsDefault(schema) {\n    return Guard.HasPropertyKey(schema, 'default');\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid dependencies property\n * @specification Json Schema 7\n */\nexport function IsDependencies(schema) {\n    return Guard.HasPropertyKey(schema, 'dependencies')\n        && Guard.IsObject(schema.dependencies)\n        && Object.values(schema.dependencies).every(value => IsSchema(value)\n            || (Guard.IsArray(value) && value.every(value => Guard.IsString(value))));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid dependentRequired property\n * @specification Json Schema 2019-09\n */\nexport function IsDependentRequired(schema) {\n    return Guard.HasPropertyKey(schema, 'dependentRequired')\n        && Guard.IsObject(schema.dependentRequired)\n        && Object.values(schema.dependentRequired).every(value => Guard.IsArray(value)\n            && value.every(value => Guard.IsString(value)));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid dependentRequired property\n * @specification Json Schema 2019-09\n */\nexport function IsDependentSchemas(schema) {\n    return Guard.HasPropertyKey(schema, 'dependentSchemas')\n        && Guard.IsObject(schema.dependentSchemas)\n        && Object.values(schema.dependentSchemas).every(value => IsSchema(value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid $dynamicAnchor property\n */\nexport function IsDynamicAnchor(schema) {\n    return Guard.HasPropertyKey(schema, '$dynamicAnchor')\n        && Guard.IsString(schema.$dynamicAnchor);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid $dynamicRef property\n */\nexport function IsDynamicRef(schema) {\n    return Guard.HasPropertyKey(schema, '$dynamicRef')\n        && Guard.IsString(schema.$dynamicRef);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid else property\n * @specification Json Schema 7\n */\nexport function IsElse(schema) {\n    return Guard.HasPropertyKey(schema, 'else')\n        && IsSchema(schema.else);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid enum property\n * @specification Json Schema 7\n */\nexport function IsEnum(schema) {\n    return Guard.HasPropertyKey(schema, 'enum')\n        && Guard.IsArray(schema.enum);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid exclusiveMaximum property\n * @specification Json Schema 7\n */\nexport function IsExclusiveMaximum(schema) {\n    return Guard.HasPropertyKey(schema, 'exclusiveMaximum')\n        && (Guard.IsNumber(schema.exclusiveMaximum) || Guard.IsBigInt(schema.exclusiveMaximum));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid exclusiveMinimum property\n * @specification Json Schema 7\n */\nexport function IsExclusiveMinimum(schema) {\n    return Guard.HasPropertyKey(schema, 'exclusiveMinimum')\n        && (Guard.IsNumber(schema.exclusiveMinimum) || Guard.IsBigInt(schema.exclusiveMinimum));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid format property\n * @specification Json Schema 7\n */\nexport function IsFormat(schema) {\n    return Guard.HasPropertyKey(schema, 'format')\n        && Guard.IsString(schema.format);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid $id property\n * @specification Json Schema 7\n */\nexport function IsId(schema) {\n    return Guard.HasPropertyKey(schema, '$id')\n        && Guard.IsString(schema.$id);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid $id property\n * @specification Json Schema 7\n */\nexport function IsIf(schema) {\n    return Guard.HasPropertyKey(schema, 'if')\n        && IsSchema(schema.if);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid items property\n * @specification Json Schema 7\n */\nexport function IsItems(schema) {\n    return Guard.HasPropertyKey(schema, 'items')\n        && (IsSchema(schema.items)\n            || (Guard.IsArray(schema.items)\n                && schema.items.every(value => {\n                    return IsSchema(value);\n                })));\n}\n/** Returns true if this schema is a sized items variant */\nexport function IsItemsSized(schema) {\n    return IsItems(schema) && Guard.IsArray(schema.items);\n}\n/** Returns true if this schema is a unsized items variant */\nexport function IsItemsUnsized(schema) {\n    return IsItems(schema) && !Guard.IsArray(schema.items);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid maximum property\n * @specification Json Schema 7\n */\nexport function IsMaximum(schema) {\n    return Guard.HasPropertyKey(schema, 'maximum')\n        && (Guard.IsNumber(schema.maximum) || Guard.IsBigInt(schema.maximum));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid maxContains property\n * @specification Json Schema 2019-09\n */\nexport function IsMaxContains(schema) {\n    return Guard.HasPropertyKey(schema, 'maxContains')\n        && Guard.IsNumber(schema.maxContains);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid maxItems property\n * @specification Json Schema 7\n */\nexport function IsMaxItems(schema) {\n    return Guard.HasPropertyKey(schema, 'maxItems')\n        && Guard.IsNumber(schema.maxItems);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid maxLength property\n * @specification Json Schema 7\n */\nexport function IsMaxLength(schema) {\n    return Guard.HasPropertyKey(schema, 'maxLength')\n        && Guard.IsNumber(schema.maxLength);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid maxProperties property\n * @specification Json Schema 7\n */\nexport function IsMaxProperties(schema) {\n    return Guard.HasPropertyKey(schema, 'maxProperties')\n        && Guard.IsNumber(schema.maxProperties);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid minimum property\n * @specification Json Schema 7\n */\nexport function IsMinimum(schema) {\n    return Guard.HasPropertyKey(schema, 'minimum')\n        && (Guard.IsNumber(schema.minimum) || Guard.IsBigInt(schema.minimum));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid maxContains property\n * @specification Json Schema 2019-09\n */\nexport function IsMinContains(schema) {\n    return Guard.HasPropertyKey(schema, 'minContains')\n        && Guard.IsNumber(schema.minContains);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid minItems property\n * @specification Json Schema 7\n */\nexport function IsMinItems(schema) {\n    return Guard.HasPropertyKey(schema, 'minItems')\n        && Guard.IsNumber(schema.minItems);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid minLength property\n * @specification Json Schema 7\n */\nexport function IsMinLength(schema) {\n    return Guard.HasPropertyKey(schema, 'minLength')\n        && Guard.IsNumber(schema.minLength);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid minProperties property\n * @specification Json Schema 7\n */\nexport function IsMinProperties(schema) {\n    return Guard.HasPropertyKey(schema, 'minProperties')\n        && Guard.IsNumber(schema.minProperties);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid multipleOf property\n * @specification Json Schema 7\n */\nexport function IsMultipleOf(schema) {\n    return Guard.HasPropertyKey(schema, 'multipleOf')\n        && (Guard.IsNumber(schema.multipleOf) || Guard.IsBigInt(schema.multipleOf));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid not property\n * @specification Json Schema 7\n */\nexport function IsNot(schema) {\n    return Guard.HasPropertyKey(schema, 'not')\n        && IsSchema(schema.not);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid oneOf property\n * @specification Json Schema 7\n */\nexport function IsOneOf(schema) {\n    return Guard.HasPropertyKey(schema, 'oneOf')\n        && Guard.IsArray(schema.oneOf)\n        && schema.oneOf.every(value => IsSchema(value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid pattern property\n * @specification Json Schema 7\n */\nexport function IsPattern(schema) {\n    return Guard.HasPropertyKey(schema, 'pattern')\n        && (Guard.IsString(schema.pattern)\n            || schema.pattern instanceof RegExp);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid patternProperties property\n * @specification Json Schema 7\n */\nexport function IsPatternProperties(schema) {\n    return Guard.HasPropertyKey(schema, 'patternProperties')\n        && Guard.IsObject(schema.patternProperties)\n        && Object.values(schema.patternProperties).every(value => IsSchema(value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid prefixItems property\n */\nexport function IsPrefixItems(schema) {\n    return Guard.HasPropertyKey(schema, 'prefixItems')\n        && Guard.IsArray(schema.prefixItems)\n        && schema.prefixItems.every(schema => IsSchema(schema));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid properties property\n * @specification Json Schema 7\n */\nexport function IsProperties(schema) {\n    return Guard.HasPropertyKey(schema, 'properties')\n        && Guard.IsObject(schema.properties)\n        && Object.values(schema.properties).every(value => IsSchema(value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid propertyNames property\n * @specification Json Schema 7\n */\nexport function IsPropertyNames(schema) {\n    return Guard.HasPropertyKey(schema, 'propertyNames')\n        && (Guard.IsObject(schema.propertyNames)\n            || IsSchema(schema.propertyNames));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid $recursiveAnchor property\n */\nexport function IsRecursiveAnchor(schema) {\n    return Guard.HasPropertyKey(schema, '$recursiveAnchor')\n        && Guard.IsBoolean(schema.$recursiveAnchor);\n}\n/**\n * Returns true if the schema contains a valid $recursiveAnchor property that is true\n */\nexport function IsRecursiveAnchorTrue(schema) {\n    return IsRecursiveAnchor(schema)\n        && Guard.IsEqual(schema.$recursiveAnchor, true);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid $recursiveRef property\n */\nexport function IsRecursiveRef(schema) {\n    return Guard.HasPropertyKey(schema, '$recursiveRef')\n        && Guard.IsString(schema.$recursiveRef);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid $ref property\n * @specification Json Schema 7\n */\nexport function IsRef(schema) {\n    return Guard.HasPropertyKey(schema, '$ref')\n        && Guard.IsString(schema.$ref);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid required property\n * @specification Json Schema 7\n */\nexport function IsRequired(schema) {\n    return Guard.HasPropertyKey(schema, 'required')\n        && Guard.IsArray(schema.required)\n        && schema.required.every(value => Guard.IsString(value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid then property\n * @specification Json Schema 7\n */\nexport function IsThen(schema) {\n    return Guard.HasPropertyKey(schema, 'then')\n        && IsSchema(schema.then);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid type property\n * @specification Json Schema 7\n */\nexport function IsType(schema) {\n    return Guard.HasPropertyKey(schema, 'type')\n        && (Guard.IsString(schema.type)\n            || (Guard.IsArray(schema.type)\n                && schema.type.every(value => Guard.IsString(value))));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid uniqueItems property\n * @specification Json Schema 7\n */\nexport function IsUniqueItems(schema) {\n    return Guard.HasPropertyKey(schema, 'uniqueItems')\n        && Guard.IsBoolean(schema.uniqueItems);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid unevaluatedItems property\n * @specification Json Schema 2019-09\n */\nexport function IsUnevaluatedItems(schema) {\n    return Guard.HasPropertyKey(schema, 'unevaluatedItems')\n        && IsSchema(schema.unevaluatedItems);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/**\n * Returns true if the schema contains a valid unevaluatedProperties property\n * @specification Json Schema 2019-09\n */\nexport function IsUnevaluatedProperties(schema) {\n    return Guard.HasPropertyKey(schema, 'unevaluatedProperties')\n        && IsSchema(schema.unevaluatedProperties);\n}\n","// deno-fmt-ignore-file\nimport { Settings } from '../../system/settings/index.mjs';\nimport * as Schema from '../types/index.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// HasUnevaluated\n// ------------------------------------------------------------------\nfunction HasUnevaluatedFromObject(value) {\n    return (Schema.IsUnevaluatedItems(value)\n        || Schema.IsUnevaluatedProperties(value)\n        || G.Some(G.Keys(value), key => HasUnevaluatedFromUnknown(value[key])));\n}\nfunction HasUnevaluatedFromArray(value) {\n    return G.Some(value, value => HasUnevaluatedFromUnknown(value));\n}\nfunction HasUnevaluatedFromUnknown(value) {\n    return (G.IsArray(value) ? HasUnevaluatedFromArray(value) :\n        G.IsObject(value) ? HasUnevaluatedFromObject(value) :\n            false);\n}\nexport function HasUnevaluated(context, schema) {\n    return HasUnevaluatedFromUnknown(schema) || G.Some(G.Keys(context), key => HasUnevaluatedFromUnknown(context[key]));\n}\n// ------------------------------------------------------------------\n// BuildContext\n// ------------------------------------------------------------------\nexport class BuildContext {\n    constructor(hasUnevaluated) {\n        this.hasUnevaluated = hasUnevaluated;\n    }\n    UseUnevaluated() {\n        return this.hasUnevaluated;\n    }\n    // ----------------------------------------------------------------\n    // Stack\n    // ----------------------------------------------------------------\n    Push() {\n        return E.Call(E.Member('context', 'Push'), []);\n    }\n    Pop() {\n        return E.Call(E.Member('context', 'Pop'), []);\n    }\n    // ----------------------------------------------------------------\n    // Top\n    // ----------------------------------------------------------------\n    AddIndex(index) {\n        return E.Call(E.Member('context', 'AddIndex'), [index]);\n    }\n    AddKey(key) {\n        return E.Call(E.Member('context', 'AddKey'), [key]);\n    }\n    Merge(results) {\n        return E.Call(E.Member('context', 'Merge'), [results]);\n    }\n}\n// ------------------------------------------------------------------\n// CheckContext\n// ------------------------------------------------------------------\nexport class CheckContext {\n    constructor() {\n        const indices = new Set();\n        const keys = new Set();\n        this.stack = [{ indices, keys }];\n    }\n    // ----------------------------------------------------------------\n    // Stack\n    // ----------------------------------------------------------------\n    Push() {\n        const indices = new Set();\n        const keys = new Set();\n        this.stack.push({ indices, keys });\n        return true;\n    }\n    Pop() {\n        this.stack.pop();\n        return true;\n    }\n    // ----------------------------------------------------------------\n    // Top\n    // ----------------------------------------------------------------\n    AddIndex(index) {\n        this.GetIndices().add(index);\n        return true;\n    }\n    AddKey(key) {\n        this.GetKeys().add(key);\n        return true;\n    }\n    GetIndices() {\n        const top = this.stack[this.stack.length - 1];\n        return top.indices;\n    }\n    GetKeys() {\n        const top = this.stack[this.stack.length - 1];\n        return top.keys;\n    }\n    Merge(results) {\n        for (const context of results) {\n            context.GetIndices().forEach(value => this.GetIndices().add(value));\n            context.GetKeys().forEach(value => this.GetKeys().add(value));\n        }\n        return true;\n    }\n}\n// ------------------------------------------------------------------\n// ErrorContext\n// ------------------------------------------------------------------\nexport class ErrorContext extends CheckContext {\n    constructor() {\n        super();\n        this.errors = [];\n    }\n    AtCapacity() {\n        return this.errors.length >= Settings.Get().maxErrors;\n    }\n    AddError(error) {\n        if (!this.AtCapacity())\n            this.errors.push(error);\n        return false;\n    }\n    GetErrors() {\n        return this.errors;\n    }\n}\n","// deno-fmt-ignore-file\nconst state = {\n    identifier: 'External',\n    variables: []\n};\n// ------------------------------------------------------------------\n// CreateVariable\n// ------------------------------------------------------------------\nexport function CreateVariable(value) {\n    const call = `External[${state.variables.length}]`;\n    state.variables.push(value);\n    return call;\n}\n// ------------------------------------------------------------------\n// ResetExternal\n// ------------------------------------------------------------------\nexport function ResetExternal() {\n    state.variables = [];\n}\n// ------------------------------------------------------------------\n// GetExternals\n// ------------------------------------------------------------------\nexport function GetExternal() {\n    return { ...state };\n}\n","// deno-fmt-ignore-file\nimport * as V from './_externals.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildRefine(_stack, _context, schema, value) {\n    const refinements = V.CreateVariable(schema['~refine'].map((refinement) => refinement));\n    return E.Every(refinements, E.Constant(0), ['refinement', '_'], E.Call(E.Member('refinement', 'check'), [value]));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckRefine(_stack, _context, schema, value) {\n    return G.Every(schema['~refine'], 0, (refinement, _) => refinement.check(value));\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorRefine(_stack, context, schemaPath, instancePath, schema, value) {\n    return G.EveryAll(schema['~refine'], 0, (refinement, index) => {\n        return refinement.check(value) || context.AddError({\n            keyword: '~refine',\n            schemaPath,\n            instancePath,\n            params: { index, message: refinement.error(value) },\n        });\n    });\n}\n","let index = 0;\n/** Returns a Unique Variable Name */\nexport function Unique() {\n    return `var_${index++}`;\n}\n","// deno-fmt-ignore-file\nimport * as Schema from '../types/index.mjs';\nimport { Unique } from './_unique.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';\n// ------------------------------------------------------------------\n// Valid\n// ------------------------------------------------------------------\nfunction IsValid(schema) {\n    return Schema.IsItems(schema) && G.IsArray(schema.items);\n}\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nfunction BuildAdditionalItemsStandard(stack, context, schema, value) {\n    const [item, index] = [Unique(), Unique()];\n    const isSchema = BuildSchemaPushStack(stack, context, schema.additionalItems, item);\n    const isLength = E.IsLessThan(index, E.Constant(schema.items.length));\n    const addIndex = context.AddIndex(index);\n    return E.Every(value, E.Constant(0), [item, index], E.Or(isLength, E.And(isSchema, addIndex)));\n}\nfunction BuildAdditionalItemsFast(stack, context, schema, value) {\n    const [item, index] = [Unique(), Unique()];\n    const isSchema = BuildSchemaPushStack(stack, context, schema.additionalItems, item);\n    const isLength = E.IsLessThan(index, E.Constant(schema.items.length));\n    return E.Every(value, E.Constant(0), [item, index], E.Or(isLength, isSchema));\n}\nexport function BuildAdditionalItems(stack, context, schema, value) {\n    if (!IsValid(schema))\n        return E.Constant(true);\n    return context.UseUnevaluated()\n        ? BuildAdditionalItemsStandard(stack, context, schema, value)\n        : BuildAdditionalItemsFast(stack, context, schema, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckAdditionalItems(stack, context, schema, value) {\n    if (!IsValid(schema))\n        return true;\n    const isAdditionalItems = G.Every(value, 0, (item, index) => {\n        return G.IsLessThan(index, schema.items.length)\n            || (CheckSchemaPushStack(stack, context, schema.additionalItems, item) && context.AddIndex(index));\n    });\n    return isAdditionalItems;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorAdditionalItems(stack, context, schemaPath, instancePath, schema, value) {\n    if (!IsValid(schema))\n        return true;\n    const isAdditionalItems = G.Every(value, 0, (item, index) => {\n        const nextSchemaPath = `${schemaPath}/additionalItems`;\n        const nextInstancePath = `${instancePath}/${index}`;\n        return G.IsLessThan(index, schema.items.length) ||\n            (ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema.additionalItems, item) && context.AddIndex(index));\n    });\n    return isAdditionalItems;\n}\n","/** Standard RegExp with Unicode */\nexport function UnicodeRegExp(pattern) {\n    return new RegExp(pattern, 'u');\n}\n","// deno-fmt-ignore-file\nimport * as S from '../types/index.mjs';\nimport * as V from './_externals.mjs';\nimport { Unique } from './_unique.mjs';\nimport { UnicodeRegExp } from './_regexp.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\nimport { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';\n// ------------------------------------------------------------------\n// Optimization: IsAdditionalPropertiesIgnored\n//\n// We can ignore additionalProperties if the schema is true-like and\n// we are not in an unevaluated context, noting that additional\n// properties are considered tracked, evaluated keys.\n// ------------------------------------------------------------------\nfunction IsAdditionalPropertiesIgnored(context, additionalProperties) {\n    return !context.UseUnevaluated() &&\n        (G.IsEqual(additionalProperties, true) ||\n            (G.IsObject(additionalProperties) && G.IsEqual(G.Keys(additionalProperties).length, 0)));\n}\n// ------------------------------------------------------------------\n// Optimization: GetPropertiesPattern\n//\n// Constructs a regular expression that matches all property keys\n// and pattern properties defined in a schema. This approach unifies\n// handling of both property types, avoiding separate logic paths.\n//\n// If no keys or patterns are present, it returns a pattern that\n// matches nothing: '(?!)'.\n//\n// ------------------------------------------------------------------\nfunction GetPropertyKeyAsPattern(key) {\n    const escaped = key.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n    return `^${escaped}$`;\n}\nfunction GetPropertiesPattern(schema) {\n    const patterns = [];\n    if (S.IsPatternProperties(schema))\n        patterns.push(...G.Keys(schema.patternProperties));\n    if (S.IsProperties(schema))\n        patterns.push(...G.Keys(schema.properties).map(GetPropertyKeyAsPattern));\n    return G.IsEqual(patterns.length, 0) ? '(?!)' : `(${patterns.join('|')})`;\n}\n// ------------------------------------------------------------------\n// BuildAdditionalPropertiesFast\n//\n// Optimized logic for schemas with `additionalProperties: false`.\n//\n// This fast-path applies only when:\n// - `additionalProperties` is explicitly set to false,\n// - the schema uses only `properties` (no `patternProperties`),\n// - and all defined properties are required (i.e., no optional keys).\n//\n// This constraint is common when enforcing strict object shapes\n// with only known, fixed keys. When all these conditions are met,\n// we can generate a simplified and efficient runtime check.\n//\n// ------------------------------------------------------------------\nexport function CanAdditionalPropertiesFast(_context, schema, _value) {\n    return S.IsRequired(schema)\n        && S.IsProperties(schema)\n        && !S.IsPatternProperties(schema)\n        && G.IsEqual(schema.additionalProperties, false)\n        && G.IsEqual(G.Keys(schema.properties).length, schema.required.length);\n}\nexport function BuildAdditionalPropertiesFast(_context, schema, value) {\n    return E.IsEqual(E.Member(E.Call(E.Member('Object', 'getOwnPropertyNames'), [value]), 'length'), E.Constant(schema.required.length));\n}\n// ------------------------------------------------------------------\n// BuildAdditionalPropertiesStandard\n// ------------------------------------------------------------------\nexport function BuildAdditionalPropertiesStandard(stack, context, schema, value) {\n    const [key, _index] = [Unique(), Unique()];\n    const regexp = V.CreateVariable(UnicodeRegExp(GetPropertiesPattern(schema)));\n    const isSchema = BuildSchemaPushStack(stack, context, schema.additionalProperties, `${value}[${key}]`);\n    const isKey = E.Call(E.Member(regexp, 'test'), [key]);\n    const addKey = context.AddKey(key);\n    const guarded = context.UseUnevaluated() ? E.Or(isKey, E.And(isSchema, addKey)) : E.Or(isKey, isSchema);\n    const result = E.Every(E.Keys(value), E.Constant(0), [key, _index], guarded);\n    return result;\n}\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildAdditionalProperties(stack, context, schema, value) {\n    if (IsAdditionalPropertiesIgnored(context, schema.additionalProperties))\n        return E.Constant(true);\n    return CanAdditionalPropertiesFast(context, schema, value)\n        ? BuildAdditionalPropertiesFast(context, schema, value)\n        : BuildAdditionalPropertiesStandard(stack, context, schema, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckAdditionalProperties(stack, context, schema, value) {\n    const regexp = UnicodeRegExp(GetPropertiesPattern(schema));\n    const isAdditionalProperties = G.Every(G.Keys(value), 0, (key, _index) => {\n        return regexp.test(key) ||\n            (CheckSchemaPushStack(stack, context, schema.additionalProperties, value[key]) && context.AddKey(key));\n    });\n    return isAdditionalProperties;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorAdditionalProperties(stack, context, schemaPath, instancePath, schema, value) {\n    const regexp = UnicodeRegExp(GetPropertiesPattern(schema));\n    const additionalProperties = [];\n    const isAdditionalProperties = G.EveryAll(G.Keys(value), 0, (key, _index) => {\n        const nextSchemaPath = `${schemaPath}/additionalProperties`;\n        const nextInstancePath = `${instancePath}/${key}`;\n        const isAdditionalProperty = regexp.test(key) ||\n            (ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema.additionalProperties, value[key]) && context.AddKey(key));\n        if (!isAdditionalProperty)\n            additionalProperties.push(key);\n        return isAdditionalProperty;\n    });\n    return isAdditionalProperties || context.AddError({\n        keyword: 'additionalProperties',\n        schemaPath,\n        instancePath,\n        params: { additionalProperties },\n    });\n}\n","// deno-fmt-ignore-file\nimport { EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Reducer\n//\n// This function is used to generate an reducer evaluation context \n// for the allOf, anyOf, oneOf and not keywords. The reducer mechansism\n// is required from 2019-09 onwards to gather evaluated keys and indices\n// for the unevaluatedItems and unevaluatedProperties keywords.\n//\n// ------------------------------------------------------------------\n//\n// const context = new Context() // exterior\n//\n// (() => {\n//   const results = []\n//\n//   const context_0 = context.Clone()\n//   const context_1 = context.Clone()\n//   const context_2 = context.Clone()\n//   const context_3 = context.Clone()\n//   \n//   const condition_0 = ((context) => <subschema>)(context_0)\n//   const condition_1 = ((context) => <subschema>)(context_1)\n//   const condition_2 = ((context) => <subschema>)(context_2)\n//   const condition_3 = ((context) => <subschema>)(context_3)\n// \n//   if(condition_0) results.push(context_0)\n//   if(condition_1) results.push(context_1)\n//   if(condition_2) results.push(context_2)\n//   if(condition_3) results.push(context_3)\n//\n//   return <check> && context.Merge(results)\n// })()\n//\n// ------------------------------------------------------------------\nexport function Reducer(stack, context, schemas, value, check) {\n    const results = E.ConstDeclaration('results', '[]');\n    const context_n = schemas.map((_schema, index) => E.ConstDeclaration(`context_${index}`, E.New('CheckContext', [])));\n    const condition_n = schemas.map((schema, index) => E.ConstDeclaration(`condition_${index}`, E.Call(E.ArrowFunction(['context'], BuildSchema(stack, context, schema, value)), [`context_${index}`])));\n    const checks = schemas.map((_schema, index) => E.If(`condition_${index}`, E.Call(E.Member('results', 'push'), [`context_${index}`])));\n    const returns = E.Return(E.And(check, context.Merge('results')));\n    return E.Call(E.ArrowFunction([], E.Statements([results, ...context_n, ...condition_n, ...checks, returns])), []);\n}\n","// deno-fmt-ignore-file\nimport { CheckContext, ErrorContext } from './_context.mjs';\nimport { Reducer } from './_reducer.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nfunction BuildAllOfStandard(stack, context, schema, value) {\n    return Reducer(stack, context, schema.allOf, value, E.IsEqual(E.Member('results', 'length'), E.Constant(schema.allOf.length)));\n}\nfunction BuildAllOfFast(stack, context, schema, value) {\n    return E.ReduceAnd(schema.allOf.map((schema) => BuildSchema(stack, context, schema, value)));\n}\nexport function BuildAllOf(stack, context, schema, value) {\n    return context.UseUnevaluated()\n        ? BuildAllOfStandard(stack, context, schema, value)\n        : BuildAllOfFast(stack, context, schema, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckAllOf(stack, context, schema, value) {\n    const results = schema.allOf.reduce((result, schema) => {\n        const nextContext = new CheckContext();\n        return CheckSchema(stack, nextContext, schema, value) ? [...result, nextContext] : result;\n    }, []);\n    return G.IsEqual(results.length, schema.allOf.length) && context.Merge(results);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorAllOf(stack, context, schemaPath, instancePath, schema, value) {\n    const failedContexts = [];\n    const results = schema.allOf.reduce((result, schema, index) => {\n        const nextSchemaPath = `${schemaPath}/allOf/${index}`;\n        const nextContext = new ErrorContext();\n        const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema, value);\n        if (!isSchema)\n            failedContexts.push(nextContext);\n        return isSchema ? [...result, nextContext] : result;\n    }, []);\n    const isAllOf = G.IsEqual(results.length, schema.allOf.length) && context.Merge(results);\n    if (!isAllOf)\n        failedContexts.forEach(failed => failed.GetErrors().forEach(error => context.AddError(error)));\n    return isAllOf;\n}\n","// deno-fmt-ignore-file\nimport { CheckContext, ErrorContext } from './_context.mjs';\nimport { Reducer } from './_reducer.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nfunction BuildAnyOfStandard(stack, context, schema, value) {\n    return Reducer(stack, context, schema.anyOf, value, E.IsGreaterThan(E.Member('results', 'length'), E.Constant(0)));\n}\nfunction BuildAnyOfFast(stack, context, schema, value) {\n    return E.ReduceOr(schema.anyOf.map((schema) => BuildSchema(stack, context, schema, value)));\n}\nexport function BuildAnyOf(stack, context, schema, value) {\n    return context.UseUnevaluated()\n        ? BuildAnyOfStandard(stack, context, schema, value)\n        : BuildAnyOfFast(stack, context, schema, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckAnyOf(stack, context, schema, value) {\n    const results = schema.anyOf.reduce((result, schema) => {\n        const nextContext = new CheckContext();\n        return CheckSchema(stack, nextContext, schema, value) ? [...result, nextContext] : result;\n    }, []);\n    return G.IsGreaterThan(results.length, 0) && context.Merge(results);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorAnyOf(stack, context, schemaPath, instancePath, schema, value) {\n    const failedContexts = [];\n    const results = schema.anyOf.reduce((result, schema, index) => {\n        const nextContext = new ErrorContext();\n        const nextSchemaPath = `${schemaPath}/anyOf/${index}`;\n        const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema, value);\n        if (!isSchema)\n            failedContexts.push(nextContext);\n        return isSchema ? [...result, nextContext] : result;\n    }, []);\n    const isAnyOf = G.IsGreaterThan(results.length, 0) && context.Merge(results);\n    if (!isAnyOf)\n        failedContexts.forEach(failed => failed.GetErrors().forEach(error => context.AddError(error)));\n    return isAnyOf || context.AddError({\n        keyword: 'anyOf',\n        schemaPath,\n        instancePath,\n        params: {}\n    });\n}\n","// deno-fmt-ignore-file\nimport { EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildSchemaBoolean(_stack, _context, schema, _value) {\n    return schema ? E.Constant(true) : E.Constant(false);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckSchemaBoolean(_stack, _context, schema, _value) {\n    return schema;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorSchemaBoolean(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckSchemaBoolean(stack, context, schema, value) || context.AddError({\n        keyword: 'boolean',\n        schemaPath,\n        instancePath,\n        params: {}\n    });\n}\n","// deno-fmt-ignore-file\nimport * as Externals from './_externals.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildConst(_stack, _context, schema, value) {\n    return G.IsValueLike(schema.const)\n        ? E.IsEqual(value, E.Constant(schema.const))\n        : E.IsDeepEqual(value, Externals.CreateVariable(schema.const));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckConst(_stack, _context, schema, value) {\n    return G.IsValueLike(schema.const)\n        ? G.IsEqual(value, schema.const)\n        : G.IsDeepEqual(value, schema.const);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function ErrorConst(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckConst(stack, context, schema, value) || context.AddError({\n        keyword: 'const',\n        schemaPath,\n        instancePath,\n        params: { allowedValue: schema.const },\n    });\n}\n","// deno-fmt-ignore-file\nimport * as Schema from '../types/index.mjs';\nimport { Unique } from './_unique.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Invalid\n// ------------------------------------------------------------------\nfunction IsValid(schema) {\n    return !(Schema.IsMinContains(schema) && G.IsEqual(schema.minContains, 0));\n}\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nfunction BuildContainsStandard(stack, context, schema, value) {\n    const [item, index] = [Unique(), Unique()];\n    const isLength = E.Not(E.IsEqual(E.Member(value, 'length'), E.Constant(0)));\n    const isSome = E.SomeAll(value, [item, index], E.And(BuildSchema(stack, context, schema.contains, item), context.AddIndex(index)));\n    return E.And(isLength, isSome);\n}\nfunction BuildContainsFast(stack, context, schema, value) {\n    const [item] = [Unique()];\n    const isLength = E.Not(E.IsEqual(E.Member(value, 'length'), E.Constant(0)));\n    const isSome = E.Some(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));\n    return E.And(isLength, isSome);\n}\nexport function BuildContains(stack, context, schema, value) {\n    if (!IsValid(schema))\n        return E.Constant(true);\n    return context.UseUnevaluated()\n        ? BuildContainsStandard(stack, context, schema, value)\n        : BuildContainsFast(stack, context, schema, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckContains(stack, context, schema, value) {\n    if (!IsValid(schema))\n        return true;\n    return !G.IsEqual(value.length, 0) && G.SomeAll(value, (item, index) => {\n        return CheckSchema(stack, context, schema.contains, item) && context.AddIndex(index);\n    });\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorContains(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckContains(stack, context, schema, value) || context.AddError({\n        keyword: 'contains',\n        schemaPath,\n        instancePath,\n        params: { minContains: 1 },\n    });\n}\n","// deno-fmt-ignore-file\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildDependencies(stack, context, schema, value) {\n    const isLength = E.IsEqual(E.Member(E.Keys(value), 'length'), E.Constant(0));\n    const isEveryDependency = E.ReduceAnd(G.Entries(schema.dependencies).map(([key, schema]) => {\n        const notKey = E.Not(E.HasPropertyKey(value, E.Constant(key)));\n        const isSchema = BuildSchema(stack, context, schema, value);\n        const isEveryKey = (schema) => E.ReduceAnd(schema.map((key) => E.HasPropertyKey(value, E.Constant(key))));\n        return E.Or(notKey, G.IsArray(schema) ? isEveryKey(schema) : isSchema);\n    }));\n    return E.Or(isLength, isEveryDependency);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckDependencies(stack, context, schema, value) {\n    const isLength = G.IsEqual(G.Keys(value).length, 0);\n    const isEvery = G.Every(G.Entries(schema.dependencies), 0, ([key, schema]) => {\n        return !G.HasPropertyKey(value, key) || (G.IsArray(schema)\n            ? schema.every((key) => G.HasPropertyKey(value, key))\n            : CheckSchema(stack, context, schema, value));\n    });\n    return isLength || isEvery;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorDependencies(stack, context, schemaPath, instancePath, schema, value) {\n    const isLength = G.IsEqual(G.Keys(value).length, 0);\n    const isEvery = G.EveryAll(G.Entries(schema.dependencies), 0, ([key, schema]) => {\n        const nextSchemaPath = `${schemaPath}/dependencies/${key}`;\n        return !G.HasPropertyKey(value, key) || (G.IsArray(schema)\n            ? schema.every((dependency) => G.HasPropertyKey(value, dependency) || context.AddError({\n                keyword: 'dependencies',\n                schemaPath,\n                instancePath,\n                params: { property: key, dependencies: schema },\n            })) : ErrorSchema(stack, context, nextSchemaPath, instancePath, schema, value));\n    });\n    return isLength || isEvery;\n}\n","// deno-fmt-ignore-file\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildDependentRequired(_stack, _context, schema, value) {\n    const isLength = E.IsEqual(E.Member(E.Keys(value), 'length'), E.Constant(0));\n    const isEvery = E.ReduceAnd(G.Entries(schema.dependentRequired).map(([key, keys]) => {\n        const notKey = E.Not(E.HasPropertyKey(value, E.Constant(key)));\n        const everyKey = E.ReduceAnd(keys.map((key) => E.HasPropertyKey(value, E.Constant(key))));\n        return E.Or(notKey, everyKey);\n    }));\n    return E.Or(isLength, isEvery);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckDependentRequired(_stack, _context, schema, value) {\n    const isLength = G.IsEqual(G.Keys(value).length, 0);\n    const isEvery = G.Every(G.Entries(schema.dependentRequired), 0, ([key, keys]) => {\n        return !G.HasPropertyKey(value, key) ||\n            keys.every((key) => G.HasPropertyKey(value, key));\n    });\n    return isLength || isEvery;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorDependentRequired(_stack, context, schemaPath, instancePath, schema, value) {\n    const isLength = G.IsEqual(G.Keys(value).length, 0);\n    const isEveryEntry = G.EveryAll(G.Entries(schema.dependentRequired), 0, ([key, keys]) => {\n        return !G.HasPropertyKey(value, key) || G.EveryAll(keys, 0, (dependency) => G.HasPropertyKey(value, dependency) || context.AddError({\n            keyword: 'dependentRequired',\n            schemaPath,\n            instancePath,\n            params: { property: key, dependencies: keys },\n        }));\n    });\n    return isLength || isEveryEntry;\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildDependentSchemas(stack, context, schema, value) {\n    const isLength = E.IsEqual(E.Member(E.Keys(value), 'length'), E.Constant(0));\n    const isEvery = E.ReduceAnd(G.Entries(schema.dependentSchemas).map(([key, schema]) => {\n        const notKey = E.Not(E.HasPropertyKey(value, E.Constant(key)));\n        const isSchema = BuildSchema(stack, context, schema, value);\n        return E.Or(notKey, isSchema);\n    }));\n    return E.Or(isLength, isEvery);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckDependentSchemas(stack, context, schema, value) {\n    const isLength = G.IsEqual(G.Keys(value).length, 0);\n    const isEvery = G.Every(G.Entries(schema.dependentSchemas), 0, ([key, schema]) => {\n        return !G.HasPropertyKey(value, key) ||\n            CheckSchema(stack, context, schema, value);\n    });\n    return isLength || isEvery;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorDependentSchemas(stack, context, schemaPath, instancePath, schema, value) {\n    const isLength = G.IsEqual(G.Keys(value).length, 0);\n    const isEvery = G.EveryAll(G.Entries(schema.dependentSchemas), 0, ([key, schema]) => {\n        const nextSchemaPath = `${schemaPath}/dependentSchemas/${key}`;\n        return !G.HasPropertyKey(value, key) ||\n            ErrorSchema(stack, context, nextSchemaPath, instancePath, schema, value);\n    });\n    return isLength || isEvery;\n}\n","// deno-fmt-ignore-file\nimport * as Functions from './_functions.mjs';\nimport * as Schema from '../types/index.mjs';\nimport { CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildDynamicRef(stack, context, schema, value) {\n    const target = stack.DynamicRef(schema) ?? false;\n    return Functions.CreateFunction(stack, context, target, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckDynamicRef(stack, context, schema, value) {\n    const target = stack.DynamicRef(schema) ?? false;\n    return (Schema.IsSchema(target) && CheckSchema(stack, context, target, value));\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorDynamicRef(stack, context, _schemaPath, instancePath, schema, value) {\n    const target = stack.DynamicRef(schema) ?? false;\n    return (Schema.IsSchema(target) && ErrorSchema(stack, context, '#', instancePath, target, value));\n}\n","// deno-fmt-ignore-file\nimport * as Externals from './_externals.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildEnum(_stack, _context, schema, value) {\n    return E.ReduceOr(schema.enum.map(option => {\n        if (G.IsValueLike(option))\n            return E.IsEqual(value, E.Constant(option));\n        const variable = Externals.CreateVariable(option);\n        return E.IsDeepEqual(value, variable);\n    }));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckEnum(_stack, _context, schema, value) {\n    return G.Some(schema.enum, option => G.IsValueLike(option)\n        ? G.IsEqual(value, option)\n        : G.IsDeepEqual(value, option));\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorEnum(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckEnum(stack, context, schema, value) || context.AddError({\n        keyword: 'enum',\n        schemaPath,\n        instancePath,\n        params: { allowedValues: schema.enum }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildExclusiveMaximum(_stack, _context, schema, value) {\n    return E.IsLessThan(value, E.Constant(schema.exclusiveMaximum));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckExclusiveMaximum(_stack, _context, schema, value) {\n    return G.IsLessThan(value, schema.exclusiveMaximum);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorExclusiveMaximum(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckExclusiveMaximum(stack, context, schema, value) || context.AddError({\n        keyword: 'exclusiveMaximum',\n        schemaPath,\n        instancePath,\n        params: { comparison: '<', limit: schema.exclusiveMaximum }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildExclusiveMinimum(_stack, _context, schema, value) {\n    return E.IsGreaterThan(value, E.Constant(schema.exclusiveMinimum));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckExclusiveMinimum(_stack, _context, schema, value) {\n    return G.IsGreaterThan(value, schema.exclusiveMinimum);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorExclusiveMinimum(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckExclusiveMinimum(stack, context, schema, value) || context.AddError({\n        keyword: 'exclusiveMinimum',\n        schemaPath,\n        instancePath,\n        params: { comparison: '>', limit: schema.exclusiveMinimum }\n    });\n}\n","const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\nfunction IsLeapYear(year) {\n    return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n/**\n * Returns true if the value is a ISO8601 Date component string\n * @description https://datatracker.ietf.org/doc/html/rfc3339\n * @example `2020-12-12`\n */\nexport function IsDate(value) {\n    const matches = DATE.exec(value);\n    if (!matches)\n        return false;\n    const year = +matches[1];\n    const month = +matches[2];\n    const day = +matches[3];\n    return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && IsLeapYear(year) ? 29 : DAYS[month]);\n}\n","const TIME = /^(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.\\d+)?(?:([Zz])|([+-])(\\d\\d):(\\d\\d))?$/;\n/**\n * Returns true if the value is an ISO time string\n * @specification https://datatracker.ietf.org/doc/html/rfc3339\n */\nexport function IsTime(value, strictTimeZone = true) {\n    const matches = TIME.exec(value);\n    if (!matches)\n        return false;\n    // Require timezone offset or 'Z'/'z' when strictTimeZone is true\n    if (strictTimeZone && !matches[4] && !matches[5])\n        return false;\n    const hr = +matches[1];\n    const min = +matches[2];\n    const sec = +matches[3];\n    if (hr > 23 || min > 59 || sec > 60)\n        return false;\n    if (matches[5]) {\n        const tzH = +matches[6];\n        const tzM = +matches[7];\n        if (tzH > 23 || tzM > 59)\n            return false;\n    }\n    if (sec < 60)\n        return true;\n    // Leap second handling: must normalize to 23:59:60 UTC (1439 total UTC minutes)\n    const tzSign = matches[5] === '-' ? -1 : 1;\n    const tzH = +(matches[6] || 0);\n    const tzM = +(matches[7] || 0);\n    const totalUtcMin = (hr * 60 + min) - tzSign * (tzH * 60 + tzM);\n    return (totalUtcMin % 1440 + 1440) % 1440 === 1439;\n}\n","import { IsDate } from './date.mjs';\nimport { IsTime } from './time.mjs';\n/**\n * Returns true if the value is a ISO8601 DateTime string\n * @specification https://datatracker.ietf.org/doc/html/rfc3339\n * @example `2020-12-12T20:20:40+00:00`\n */\nexport function IsDateTime(value) {\n    const dateTime = value.split(/T/i);\n    return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]);\n}\n","const Duration = /^P((\\d+Y(\\d+M(\\d+D)?)?|\\d+M(\\d+D)?|\\d+D)(T(\\d+H(\\d+M(\\d+S)?)?|\\d+M(\\d+S)?|\\d+S))?|T(\\d+H(\\d+M(\\d+S)?)?|\\d+M(\\d+S)?|\\d+S)|\\d+W)$/;\n/**\n * Returns true if the value is a valid ISO-8601 duration.\n * @specification https://tools.ietf.org/html/rfc3339\n */\nexport function IsDuration(value) {\n    return Duration.test(value);\n}\n","const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[^\"\\\\]|\\\\[\\x20-\\x7e])*\")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\\])$/i;\n/**\n * Returns true if the value is an Email\n * @specification https://datatracker.ietf.org/doc/html/rfc5322\n */\nexport function IsEmail(value) {\n    return Email.test(value);\n}\n","// deno-fmt-ignore-file\n// -------------------------------------------------------------------\n// Validation Rules\n// -------------------------------------------------------------------\nexport const RE_RULE_HYPHEN_PLACEMENT = /^(?!-).*(?<!-)$/;\nexport const RE_RULE_NOT_RESERVED_ACE = /^(?!..--)/;\nexport const RE_ASCII_LDH = /^[a-zA-Z0-9-]*$/;\n// -------------------------------------------------------------------\n// ASCII & Encoding\n// -------------------------------------------------------------------\nexport const RE_ASCII = /^\\p{ASCII}*$/u;\nexport const RE_NON_ASCII = /[^\\p{ASCII}]/u;\n// -------------------------------------------------------------------\n// Structural & Unicode Controls\n// -------------------------------------------------------------------\nexport const RE_HIGH_SURROGATE = /[\\u{d800}-\\u{dbff}]/u;\nexport const RE_REGIONAL_INDICATOR = /[\\u{1f1e6}-\\u{1f1ff}]/u;\nexport const RE_VARIATION_SELECTOR = /[\\u{fe00}-\\u{fe0f}]/u;\nexport const RE_ZERO_WIDTH_JOINER = /\\u{200d}/u;\n// -------------------------------------------------------------------\n// Numbers & Digits\n// -------------------------------------------------------------------\nexport const RE_ASCII_DIGIT = /[0-9]/;\nexport const RE_ARABIC_INDIC_DIGIT = /[\\u{0660}-\\u{0669}]/u;\nexport const RE_EXT_ARABIC_INDIC_DIGIT = /[\\u{06f0}-\\u{06f9}]/u;\n// -------------------------------------------------------------------\n// Separators\n// -------------------------------------------------------------------\nexport const RE_COMMON_SEPARATOR = /[\\u{002e}\\u{002c}\\u{003a}\\u{002f}]/u;\nexport const RE_EUROPEAN_SEPARATOR = /[\\u{002d}\\u{002b}]/u;\n// -------------------------------------------------------------------\n// General Categories\n// -------------------------------------------------------------------\nexport const RE_MARK_NONSPACING = /\\p{Mn}/u;\nexport const RE_MARK_SPACING_COMBINING = /\\p{Mc}/u;\nexport const RE_MARK_ENCLOSING = /\\p{Me}/u;\nexport const RE_COMBINING_MARK = /[\\p{Mn}\\p{Mc}\\p{Me}]/u;\nexport const RE_LETTER = /\\p{L}/u;\nexport const RE_NUMBER_DECIMAL = /\\p{Nd}/u;\n// -------------------------------------------------------------------\n// Scripts\n// -------------------------------------------------------------------\nexport const RE_SCRIPT_GREEK = /\\p{Script=Greek}/u;\nexport const RE_SCRIPT_HEBREW = /\\p{Script=Hebrew}/u;\nexport const RE_SCRIPT_JAPANESE = /[\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Han}]/u;\nexport const RE_SCRIPT_ARABIC_LETTER = /[\\p{Script=Arabic}\\p{Script=Syriac}\\p{Script=Thaana}\\p{Script=Mandaic}]/u;\n// -------------------------------------------------------------------\n// RFC Specifications & Context Exceptions\n// -------------------------------------------------------------------\nexport const RE_VIRAMA = /[\\u{094d}\\u{09cd}\\u{0a4d}\\u{0acd}\\u{0b4d}\\u{0bcd}\\u{0c4d}\\u{0ccd}\\u{0d3b}\\u{0d3c}\\u{0d4d}\\u{0dca}\\u{1b44}\\u{1baa}\\u{1bab}\\u{a9c0}\\u{11046}\\u{1107f}\\u{110b9}\\u{11133}\\u{11134}\\u{111c0}\\u{11235}\\u{1134d}\\u{11442}\\u{114c2}\\u{115bf}\\u{1163f}\\u{116b6}\\u{11c3f}\\u{11d44}\\u{11d45}]/u;\nexport const RE_RFC5892_DISALLOWED = /[\\u{0640}\\u{07fa}\\u{302e}\\u{302f}\\u{3031}\\u{3032}\\u{3033}\\u{3034}\\u{3035}\\u{303b}]/u;\nexport const RE_CONTEXTO_EXCEPTIONS = /[\\u{00b7}\\u{0375}\\u{05f3}\\u{05f4}\\u{200c}\\u{200d}\\u{30fb}]/u;\nexport const RE_PVALID_EXCEPTIONS = /[\\u{00df}\\u{03c2}\\u{06fd}\\u{06fe}\\u{0f0b}\\u{3007}]/u;\n// -------------------------------------------------------------------\n// Composite Patterns\n// -------------------------------------------------------------------\nexport const RE_EUROPEAN_NUMBER = new RegExp([\n    RE_ASCII_DIGIT,\n    RE_EXT_ARABIC_INDIC_DIGIT\n].map((regexp) => regexp.source).join('|'), 'u');\nexport const RE_PERMITTED_CATEGORY = new RegExp([\n    RE_LETTER,\n    RE_EUROPEAN_SEPARATOR,\n    RE_COMMON_SEPARATOR,\n    RE_NUMBER_DECIMAL,\n    RE_MARK_NONSPACING,\n    RE_MARK_SPACING_COMBINING,\n    RE_CONTEXTO_EXCEPTIONS,\n    RE_PVALID_EXCEPTIONS\n].map((regexp) => regexp.source).join('|'), 'u');\n","import * as Pattern from '../pattern/pattern.mjs';\n// -------------------------------------------------------------------\n// Validates an ASCII LDH label per RFC 5891 §4.2.3.1\n// -------------------------------------------------------------------\nexport function IsAsciiLabel(value) {\n    return (Pattern.RE_RULE_HYPHEN_PLACEMENT.test(value) &&\n        Pattern.RE_RULE_NOT_RESERVED_ACE.test(value) &&\n        Pattern.RE_ASCII_LDH.test(value));\n}\n","import * as Pattern from '../pattern/pattern.mjs';\n// ------------------------------------------------------------------\n// PunyCode (RFC 3492)\n// ------------------------------------------------------------------\nconst PUNYCODE_BASE = 36;\nconst PUNYCODE_TMIN = 1;\nconst PUNYCODE_TMAX = 26;\nconst PUNYCODE_SKEW = 38;\nconst PUNYCODE_DAMP = 700;\nconst PUNYCODE_INITIAL_BIAS = 72;\nconst PUNYCODE_INITIAL_N = 128;\n// ------------------------------------------------------------------\n// ThrowDontCare\n// ------------------------------------------------------------------\nfunction ThrowDontCare() {\n    throw null;\n}\n// ------------------------------------------------------------------\n// IsAcePrefixed\n// ------------------------------------------------------------------\nexport function IsAcePrefixed(value) {\n    return value.toLowerCase().startsWith('xn--');\n}\n// ------------------------------------------------------------------\n// Adapt\n// ------------------------------------------------------------------\nfunction Adapt(delta, numPoints, firstTime) {\n    delta = firstTime ? Math.floor(delta / PUNYCODE_DAMP) : delta >> 1;\n    delta += Math.floor(delta / numPoints);\n    let k = 0;\n    while (delta > (((PUNYCODE_BASE - PUNYCODE_TMIN) * PUNYCODE_TMAX) >> 1)) {\n        delta = Math.floor(delta / (PUNYCODE_BASE - PUNYCODE_TMIN));\n        k += PUNYCODE_BASE;\n    }\n    return k + Math.floor(((PUNYCODE_BASE - PUNYCODE_TMIN + 1) * delta) / (delta + PUNYCODE_SKEW));\n}\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\nexport function Decode(value) {\n    const output = [];\n    let n = PUNYCODE_INITIAL_N;\n    let i = 0;\n    let bias = PUNYCODE_INITIAL_BIAS;\n    const delimIdx = value.lastIndexOf('-');\n    if (delimIdx > 0) {\n        for (let j = 0; j < delimIdx; j++) {\n            const cp = value.charCodeAt(j);\n            if (cp >= 128)\n                ThrowDontCare(); // throw new Error('Invalid punycode: non-basic before delimiter')\n            output.push(cp);\n        }\n    }\n    let inIdx = delimIdx < 0 ? 0 : delimIdx + 1;\n    while (inIdx < value.length) {\n        const oldi = i;\n        let w = 1;\n        let k = PUNYCODE_BASE;\n        while (true) {\n            if (inIdx >= value.length)\n                ThrowDontCare(); // throw new Error('Invalid punycode: unexpected end of input')\n            const ch = value.charCodeAt(inIdx++);\n            let digit;\n            if (ch >= 0x61 && ch <= 0x7a)\n                digit = ch - 0x61; // a-z => 0-25\n            else if (ch >= 0x30 && ch <= 0x39)\n                digit = ch - 0x30 + 26; // 0-9 => 26-35\n            // else if (ch >= 0x41 && ch <= 0x5a) digit = ch - 0x41 // A-Z => 0-25 // (no-spec-coverage)\n            else\n                ThrowDontCare(); // throw new Error('Invalid punycode: bad digit character')\n            i += digit * w;\n            const t = k <= bias ? PUNYCODE_TMIN : k >= bias + PUNYCODE_TMAX ? PUNYCODE_TMAX : k - bias;\n            if (digit < t)\n                break;\n            w *= PUNYCODE_BASE - t;\n            k += PUNYCODE_BASE;\n        }\n        const outLen = output.length + 1;\n        bias = Adapt(i - oldi, outLen, oldi === 0);\n        n += Math.floor(i / outLen);\n        i %= outLen;\n        output.splice(i, 0, n);\n        i++;\n    }\n    return String.fromCodePoint(...output);\n}\n// ------------------------------------------------------------------\n// DigitToChar\n// ------------------------------------------------------------------\nfunction DigitToChar(digit) {\n    return digit < 26 ? String.fromCharCode(digit + 0x61) : String.fromCharCode(digit - 26 + 0x30);\n}\n// ------------------------------------------------------------------\n// Encode\n//\n// Encodes a Unicode string into its Punycode payload (the part that\n// follows the 'xn--' ACE prefix). Used to compute the true A-label\n// length of a U-label, since the 63-octet label length limit (RFC\n// 5891 §4.2.4) applies to the encoded form, not the code point count.\n// ------------------------------------------------------------------\nconst RE_REPLACE_NON_ASCII = new RegExp(Pattern.RE_NON_ASCII.source, 'gu');\nexport function Encode(input) {\n    // Extract basic ASCII characters and set initial output array state\n    const basic = input.replace(RE_REPLACE_NON_ASCII, '');\n    const basicLength = basic.length;\n    const result = basicLength > 0 ? [basic, '-'] : [];\n    // Extract unicode codepoints\n    const codePoints = Array.from(input, (char) => char.codePointAt(0));\n    let n = PUNYCODE_INITIAL_N;\n    let delta = 0;\n    let bias = PUNYCODE_INITIAL_BIAS;\n    let handledCPCount = basicLength;\n    while (handledCPCount < codePoints.length) {\n        let m = Infinity;\n        for (const cp of codePoints) {\n            if (cp >= n && cp < m)\n                m = cp;\n        }\n        delta += (m - n) * (handledCPCount + 1);\n        n = m;\n        for (const cp of codePoints) {\n            if (cp < n)\n                delta++;\n            if (cp === n) {\n                let q = delta;\n                for (let k = PUNYCODE_BASE;; k += PUNYCODE_BASE) {\n                    const t = k <= bias ? PUNYCODE_TMIN : k >= bias + PUNYCODE_TMAX ? PUNYCODE_TMAX : k - bias;\n                    if (q < t)\n                        break;\n                    const digit = t + ((q - t) % (PUNYCODE_BASE - t));\n                    result.push(DigitToChar(digit));\n                    q = Math.floor((q - t) / (PUNYCODE_BASE - t));\n                }\n                result.push(DigitToChar(q));\n                bias = Adapt(delta, handledCPCount + 1, handledCPCount === basicLength);\n                delta = 0;\n                handledCPCount++;\n            }\n        }\n        delta++;\n        n++;\n    }\n    return result.join('');\n}\n","// deno-fmt-ignore-file\nimport * as FormatPuny from './puny.mjs';\nimport * as Pattern from '../pattern/pattern.mjs';\n// ------------------------------------------------------------------\n// LOCAL REGEX: Allowed Bidi classes per direction (RFC 5893)\n// ------------------------------------------------------------------\nconst RE_RTL_ALLOWED = /^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/;\nconst RE_LTR_ALLOWED = /^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/;\nconst RE_RTL_CLASSES = /^(?:R|AL|AN)$/;\n// ------------------------------------------------------------------\n// HasBidiChars\n//\n// Decodes a punycode label to its Unicode form (if it is one) and\n// checks whether the result is an RTL label per RFC 5893 §1.4.\n// ------------------------------------------------------------------\nexport function HasBidiChars(value) {\n    if (FormatPuny.IsAcePrefixed(value)) {\n        try {\n            return HasRightToLeftCharacters(FormatPuny.Decode(value.slice(4).toLowerCase()));\n        }\n        catch {\n            return false;\n        }\n    }\n    return HasRightToLeftCharacters(value);\n}\n// ------------------------------------------------------------------\n// GetBidiClass\n// ------------------------------------------------------------------\nfunction GetBidiClass(codePoint) {\n    const char = String.fromCodePoint(codePoint);\n    return (Pattern.RE_EUROPEAN_NUMBER.test(char) ? 'EN' :\n        Pattern.RE_ARABIC_INDIC_DIGIT.test(char) ? 'AN' :\n            // Pattern.RE_EUROPEAN_SEPARATOR.test(char) ? 'ES' : // (no-spec-coverage)\n            // Pattern.RE_COMMON_SEPARATOR.test(char) ? 'CS' : // (no-spec-coverage)\n            Pattern.RE_MARK_NONSPACING.test(char) ? 'NSM' :\n                Pattern.RE_SCRIPT_HEBREW.test(char) ? 'R' :\n                    Pattern.RE_SCRIPT_ARABIC_LETTER.test(char) ? 'AL' :\n                        Pattern.RE_LETTER.test(char) ? 'L' :\n                            'ON');\n}\n// ------------------------------------------------------------------\n// HasRightToLeftCharacters\n//\n// Per RFC 5893 §1.4: \"An RTL label is a label that contains at least\n// one character of type R, AL, or AN.\" Used to determine whether a\n// domain name is a \"Bidi domain name\" (RFC 5893 §1.4), in which case\n// the Bidi Rule applies to every label in the domain.\n// ------------------------------------------------------------------\nexport function HasRightToLeftCharacters(value) {\n    for (const ch of value)\n        if (RE_RTL_CLASSES.test(GetBidiClass(ch.codePointAt(0))))\n            return true;\n    return false;\n}\n// ------------------------------------------------------------------\n// SatisfiesBidiRule\n// ------------------------------------------------------------------\nexport function SatisfiesBidiRule(value) {\n    let isRtl = false;\n    let allowed = RE_LTR_ALLOWED;\n    let sawEN = false;\n    let sawAN = false;\n    let isFirst = true;\n    // let lastClass: string | null = null // (no-spec-coverage)\n    for (const ch of value) {\n        const bidiClass = GetBidiClass(ch.codePointAt(0));\n        if (isFirst) {\n            // 1. The first character must be a character with Bidi property L, R, or AL.\n            if (bidiClass !== 'L' && bidiClass !== 'R' && bidiClass !== 'AL')\n                return false;\n            isRtl = bidiClass === 'R' || bidiClass === 'AL';\n            allowed = isRtl ? RE_RTL_ALLOWED : RE_LTR_ALLOWED;\n            isFirst = false;\n        }\n        // 2 / 5. Only characters in the allowed set for this direction may appear.\n        if (!allowed.test(bidiClass))\n            return false;\n        if (bidiClass === 'EN')\n            sawEN = true;\n        else if (bidiClass === 'AN')\n            sawAN = true;\n        // if (bidiClass !== 'NSM') lastClass = bidiClass // (no-spec-coverage)\n    }\n    if (isRtl && sawEN && sawAN)\n        return false; // spec coverage path\n    // (no-spec-coverage)\n    // if (isRtl) {\n    //   // 3. The end of the label must be R, AL, EN, or AN (ignoring trailing NSM).\n    //   // if (lastClass !== 'R' && lastClass !== 'AL' && lastClass !== 'EN' && lastClass !== 'AN') return false\n    //   // 4. If an EN is present, no AN may be present, and vice versa.\n    //   if (sawEN && sawAN) return false\n    // } else {\n    //   // 6. The end of the label must be L or EN (ignoring trailing NSM).\n    //   // if (lastClass !== 'L' && lastClass !== 'EN') return false\n    // }\n    return true;\n}\n","import * as Pattern from '../pattern/pattern.mjs';\nimport * as FormatBidi from '../format/bidi.mjs';\nimport * as FormatPuny from '../format/puny.mjs';\n// ------------------------------------------------------------------\n// ExceedsMaxALabelLength\n//\n// RFC 5890 §2.3.2.1: an A-label (the ACE-encoded form of a label,\n// \"xn--\" + punycode) must not exceed 63 octets. Only labels\n// containing non-ASCII characters need checking - a pure-ASCII label\n// has no \"xn--\" prefix and is used as-is, so its punycode-encoded\n// length is irrelevant. The ASCII check is a cheap short-circuit that\n// avoids running the punycode encoder on labels that don't need it.\n// ------------------------------------------------------------------\nfunction ExceedsMaxALabelLength(value) {\n    return Pattern.RE_NON_ASCII.test(value) && FormatPuny.Encode(value).length + 4 > 63;\n}\n// ------------------------------------------------------------------\n// HasInvalidHyphens\n//\n// RFC 5891 §4.2.3.2: label must not start or end with a hyphen, and\n// must not have hyphens in the 3rd and 4th codepoint positions (the\n// ACE prefix reservation, e.g. \"xn--\"). Operates on `chars` (the\n// per-codepoint string array) rather than raw string indices so\n// supplementary-plane characters earlier in the label don't throw\n// off the codepoint-position count.\n// ------------------------------------------------------------------\nfunction HasInvalidHyphens(chars) {\n    if (chars[0] === '-' || chars[chars.length - 1] === '-')\n        return true;\n    return chars.slice(2).join('').startsWith('--');\n}\n// ------------------------------------------------------------------\n// IsUnicodeLabel\n// ------------------------------------------------------------------\nexport function IsUnicodeLabel(value) {\n    // RFC 5890 §2.3.2.1: Ensure Max Length\n    if (ExceedsMaxALabelLength(value))\n        return false;\n    // RFC 5893 - Bidi Rule (applies whenever this label itself is RTL)\n    if (FormatBidi.HasRightToLeftCharacters(value) && !FormatBidi.SatisfiesBidiRule(value))\n        return false;\n    const chars = [...value];\n    const codePoints = chars.map((c) => c.codePointAt(0));\n    const length = codePoints.length;\n    // RFC 5891 §4.2.3.2: Hyphen rules\n    if (HasInvalidHyphens(chars))\n        return false;\n    // RFC 5891 §4.2.3.2 - Must not begin with a combining mark\n    if (Pattern.RE_COMBINING_MARK.test(chars[0]))\n        return false;\n    let hasJapanese = false;\n    // let hasArabicIndic = false // (no-spec-coverage)\n    // let hasExtendedArabicIndic = false // (no-spec-coverage)\n    for (let i = 0; i < length; i++) {\n        const codePoint = codePoints[i];\n        const char = chars[i];\n        // 1. DISALLOWED exceptions\n        if (Pattern.RE_RFC5892_DISALLOWED.test(char))\n            return false;\n        // 1b. General category (PVALID) enforcement\n        if (!Pattern.RE_PERMITTED_CATEGORY.test(char))\n            return false;\n        // 2. Collect Flags\n        if (Pattern.RE_SCRIPT_JAPANESE.test(char))\n            hasJapanese = true;\n        // if (Pattern.RE_ARABIC_INDIC_DIGIT.test(char)) hasArabicIndic = true  // (no-spec-coverage)\n        // if (Pattern.RE_EXT_ARABIC_INDIC_DIGIT.test(char)) hasExtendedArabicIndic = true  // (no-spec-coverage)\n        // 3. CONTEXTO / CONTEXTJ Neighbor Rules\n        const prev = codePoints[i - 1], next = codePoints[i + 1];\n        switch (codePoint) {\n            case 0x00b7:\n                if (prev !== 0x006c || next !== 0x006c)\n                    return false;\n                break; // MIDDLE DOT (Catalan)\n            case 0x0375:\n                if (!next || !Pattern.RE_SCRIPT_GREEK.test(chars[i + 1]))\n                    return false;\n                break; // Greek KERAIA\n            case 0x05f3:\n            case 0x05f4:\n                if (!prev || !Pattern.RE_SCRIPT_HEBREW.test(chars[i - 1]))\n                    return false;\n                break; // Hebrew GERESH\n            case 0x200c: // ZWNJ - RFC 5892 Appendix A.1\n                // Note: Full validation requires a Unicode joining type table. We reject\n                // only when preceded by ASCII (U+0000-U+007F), which can never satisfy\n                // the Virama or cursive-joining rules.\n                if (!prev || (prev < 0x0080 && !Pattern.RE_VIRAMA.test(chars[i - 1])))\n                    return false;\n                break;\n            case 0x200d: // ZWJ: RFC 5892 Appendix A.2\n                if (!prev || !Pattern.RE_VIRAMA.test(chars[i - 1]))\n                    return false;\n                break;\n            case 0x30fb: // Checked at end via hasJapanese\n                break; // KATAKANA MIDDLE DOT\n        }\n    }\n    // 4. Global Context Validations (Post-loop)\n    // RFC 5892 Appendix A.7 - Katakana Middle Dot requirement\n    if (value.includes('\\u30fb') && !hasJapanese)\n        return false;\n    // RFC 5892 Appendix A.8/A.9 - Mixing Arabic Digits\n    // if (hasArabicIndic && hasExtendedArabicIndic) return false // (no-spec-coverage)\n    return true;\n}\n","import * as FormatPuny from '../format/puny.mjs';\nimport * as LabelUnicode from './unicode.mjs';\nimport * as Pattern from '../pattern/pattern.mjs';\n// ------------------------------------------------------------------\n// IsPunyLabel\n// ------------------------------------------------------------------\nexport function IsPunyLabel(value) {\n    if (!FormatPuny.IsAcePrefixed(value))\n        return false;\n    try {\n        const body = value.slice(4).toLowerCase();\n        // A payload consisting of only a hyphen, or starting with the delimiter\n        // (like \"-9uc\"), has 0 basic ASCII characters preceding it and is malformed.\n        if (body.lastIndexOf('-') === 0)\n            return false;\n        const decoded = FormatPuny.Decode(body);\n        // RFC 5890 §2.3.2.1 - a U-label must contain at least one non-ASCII\n        // character. Code-unit level check: any non-ASCII codepoint has at least\n        // one UTF-16 unit >= 0x80 (surrogate halves included), so no need to\n        // decode codepoints or allocate a character array to answer this.\n        if (!Pattern.RE_NON_ASCII.test(decoded))\n            return false;\n        return LabelUnicode.IsUnicodeLabel(decoded);\n    }\n    catch {\n        return false;\n    }\n}\n","import * as LabelAscii from './label/ascii.mjs';\nimport * as LabelPuny from './label/puny.mjs';\nfunction IsValidLabelLength(value) {\n    return value.length > 0 && value.length <= 63;\n}\nfunction IsLabel(value) {\n    return IsValidLabelLength(value) && (LabelPuny.IsPunyLabel(value) ||\n        LabelAscii.IsAsciiLabel(value));\n}\nexport function IsHostname(value) {\n    if (value.length === 0 || value.length > 253)\n        return false;\n    if (value.charCodeAt(value.length - 1) === 46)\n        return false;\n    return value.split('.').every((label) => IsLabel(label));\n}\n","import * as FormatBidi from './format/bidi.mjs';\nimport * as LabelUnicode from './label/unicode.mjs';\nimport * as LabelPuny from './label/puny.mjs';\n// ------------------------------------------------------------------\n// IsLabel\n// ------------------------------------------------------------------\nfunction IsValidLabelLength(value) {\n    return value.length > 0 && value.length <= 63;\n}\nfunction IsLabel(value) {\n    return IsValidLabelLength(value) && (LabelPuny.IsPunyLabel(value) ||\n        LabelUnicode.IsUnicodeLabel(value));\n}\n// ------------------------------------------------------------------\n// NormalizeHostname\n//\n// Normalizes a hostname for label validation. Maps fullwidth\n// codepoints to their ASCII equivalent (e.g. 'ａ' U+FF41 maps to\n// 'a'), then normalizes for NFC such that equivalent codepoint\n// sequences can be uniformly compared. It also removes codepoints\n// that IDNA mapping ignores, and converts full stop variants to\n// ASCII '.' so the hostname can be split into labels.\n// ------------------------------------------------------------------\nfunction NormalizeHostname(value) {\n    return value\n        .replace(/[\\uff01-\\uff5e]/g, (char) => String.fromCharCode(char.charCodeAt(0) - 0xfee0)) // RE_FULLWIDTH_MAPPING\n        .normalize('NFC')\n        .replace(/[\\u00ad\\u034f\\u180b-\\u180d\\u200b\\ufe00-\\ufe0f\\u{e0100}-\\u{e01ef}]/gu, '') // RE_IGNORED_MAPPING\n        .replace(/[\\u002E\\u3002\\uFF0E\\uFF61]/g, '.'); // RE_FULL_STOP_MAPPING\n}\n// ------------------------------------------------------------------\n// IsIdnHostname\n// ------------------------------------------------------------------\nexport function IsIdnHostname(value) {\n    if (value.length === 0 || value.includes(' '))\n        return false;\n    const normalized = NormalizeHostname(value);\n    if (normalized.length > 253)\n        return false;\n    const labels = normalized.split('.');\n    const hasBidiChars = labels.some((label) => FormatBidi.HasBidiChars(label));\n    return labels.every((label) => IsLabel(label) && (!hasBidiChars || FormatBidi.SatisfiesBidiRule(label)));\n}\n","import * as Idna from './idna/index.mjs';\n/**\n * Returns true if the value is a valid hostname.\n * @specification https://tools.ietf.org/html/rfc1123\n * @specification https://tools.ietf.org/html/rfc5891\n * @specification https://tools.ietf.org/html/rfc5892\n */\nexport function IsHostname(value) {\n    return Idna.IsHostname(value);\n}\n","const IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+\\/=?^_`{|}~\\u{0080}-\\u{10FFFF}-]+(?:\\.[A-Za-z0-9!#$%&'*+\\/=?^_`{|}~\\u{0080}-\\u{10FFFF}-]+)*|\"(?:[^\"\\\\]|\\\\.)*\")@[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,62})(?<!-)(?:\\.[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,62})(?<!-))*$/iu;\n/**\n * Returns true if the value is an IdnEmail\n * @specification https://datatracker.ietf.org/doc/html/rfc4952\n */\nexport function IsIdnEmail(value) {\n    return IdnEmail.test(value.normalize('NFC'));\n}\n","import * as Idna from './idna/index.mjs';\n/**\n * Returns true if the value is a valid internationalized (IDN) hostname.\n * @specification https://tools.ietf.org/html/rfc3490\n * @specification https://tools.ietf.org/html/rfc5891\n * @specification https://tools.ietf.org/html/rfc5892\n * @specification https://tools.ietf.org/html/rfc5893\n */\nexport function IsIdnHostname(value) {\n    return Idna.IsIdnHostname(value);\n}\n","const IPv4 = /^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)$/;\n/**\n * Returns true if the value is a IPV4 address\n * @specification http://tools.ietf.org/html/rfc2673#section-3.2\n */\nexport function IsIPv4(value) {\n    return IPv4.test(value);\n}\n","const IPv6 = /^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;\n/**\n * Returns true if the value is an IPv6 address\n * @specification http://tools.ietf.org/html/rfc2373#section-2.2\n */\nexport function IsIPv6(value) {\n    return IPv6.test(value);\n}\n","// deno-lint-ignore-file no-control-regex\n// Rejects unencoded spaces (0x20), backslashes, control characters (0x00-0x1F, 0x7F), or malformed percent-encodings\nconst InvalidIriChars = /[\\x00-\\x20\\x7F\\\\]|%(?![0-9a-fA-F]{2})/;\n// Detects malformed scheme/authority patterns lacking a colon (e.g. \"httpx//example.com\")\nconst MalformedScheme = /^[a-zA-Z][a-zA-Z0-9+\\-.]*\\/\\//;\n/**\n * Returns true if the value is an IRI reference\n * @specification https://tools.ietf.org/html/rfc3987\n */\nexport function IsIriReference(value) {\n    return (!InvalidIriChars.test(value) &&\n        !MalformedScheme.test(value) &&\n        URL.canParse(value, 'http://example.com'));\n}\n","// deno-lint-ignore-file no-control-regex\nconst IpvFutureMatchMaxLength = 2048;\nconst IpvFutureMatch = /\\[[vV][0-9a-fA-F]+\\.[^\\]]+\\]/; // Guarded By IpvFutureMatchMaxLength\nconst InvalidIriChars = /[\\x00-\\x20<>\\^`{|}\\\\]/;\nconst InvalidPercentEncoding = /%(?![0-9a-fA-F]{2})/;\n// ------------------------------------------------------------------\n// NarrowIpvFuture\n//\n// Substitutes an IPvFuture address with a standard IPv6 loopback\n// address ([::1]). We do this because the native URL.canParse\n// (WHATWG standard) rejects IPvFuture literals, which are\n// otherwise valid in RFC 3987. Because regex substitution can\n// be expensive on large strings, this operation is strictly\n// limited to inputs under a defined length threshold.\n//\n// (review-optimization)\n//\n// ------------------------------------------------------------------\nfunction NarrowIpvFuture(value) {\n    return value.length < IpvFutureMatchMaxLength ? value.replace(IpvFutureMatch, '[::1]') : value;\n}\n/**\n * Returns true if the value is a valid Internationalized Resource Identifier.\n * @specification https://datatracker.ietf.org/doc/html/rfc3987\n */\nexport function IsIri(value) {\n    // 1. Reject strings containing unencoded whitespace or illegal control characters.\n    if (InvalidIriChars.test(value))\n        return false;\n    // 2. Reject malformed percent-encoding triplets.\n    if (InvalidPercentEncoding.test(value))\n        return false;\n    // 3. Delegate to the native URL parser, patching the IPvFuture edge case beforehand.\n    return URL.canParse(NarrowIpvFuture(value));\n}\n","const JsonPointerUriFragment = /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;\n/**\n * Returns true if the value is a json pointer uri fragment\n * @specification https://datatracker.ietf.org/doc/html/rfc6901\n * @source https://github.com/ajv-validator/ajv-formats\n */\nexport function IsJsonPointerUriFragment(value) {\n    return JsonPointerUriFragment.test(value);\n}\n","const JsonPointer = /^(?:\\/(?:[^~/]|~0|~1)*)*$/;\n/**\n * Returns true if the value is a json pointer\n * @specification https://datatracker.ietf.org/doc/html/rfc6901\n * @source https://github.com/ajv-validator/ajv-formats\n */\nexport function IsJsonPointer(value) {\n    return JsonPointer.test(value);\n}\n","/**\n * Returns true if the value is a regular expression string pattern\n * @specification https://ecma-international.org/ecma-262\n */\nexport function IsRegex(value) {\n    try {\n        new RegExp(value, 'u');\n        return true;\n    }\n    catch {\n        return false;\n    }\n}\n","const RelativeJsonPointer = /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/;\n/**\n * Returns true if the value is a relative json pointer\n * @specification https://datatracker.ietf.org/doc/html/rfc6901\n * @source https://github.com/ajv-validator/ajv-formats\n */\nexport function IsRelativeJsonPointer(value) {\n    return RelativeJsonPointer.test(value);\n}\n","const UriReference = /^(?:[a-z][a-z0-9+\\-.]*:(?:\\/\\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:[\\da-f]{1,4}:){6}(?:[\\da-f]{1,4}:[\\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d))|::(?:[\\da-f]{1,4}:){5}(?:[\\da-f]{1,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:\\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;\n/**\n * Returns true if the value is a valid Uri Reference.\n * @specification https://tools.ietf.org/html/rfc3986\n */\nexport function IsUriReference(value) {\n    return UriReference.test(value);\n}\n","// deno-lint-ignore-file no-control-regex\nconst UriTemplate = /^(?:(?:[^\\x00-\\x20\"<>%\\\\^`{|}\\x7f]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\\d{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\\d{0,3}|\\*)?)*\\})*$/i;\n/**\n * Returns true if the value is a valid Uri Template\n * @specification https://datatracker.ietf.org/doc/html/rfc6570\n */\nexport function IsUriTemplate(value) {\n    return UriTemplate.test(value);\n}\n","const Uri = /^[a-z][a-z0-9+\\-.]*:(?:\\/\\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:[\\da-f]{1,4}:){6}(?:[\\da-f]{1,4}:[\\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d))|::(?:[\\da-f]{1,4}:){5}(?:[\\da-f]{1,4}:[\\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d))|(?:[\\da-f]{1,4})?::(?:[\\da-f]{1,4}:){4}(?:[\\da-f]{1,4}:[\\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\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/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;\n/**\n * Returns true if the value is a valid Uniform Resource Identifier.\n * @specification https://tools.ietf.org/html/rfc3986\n */\nexport function IsUri(value) {\n    return Uri.test(value);\n}\n","/**\n * Returns true if the value is a valid Uniform Resource Locator\n * @specification https://datatracker.ietf.org/doc/html/rfc3986\n * @specification https://datatracker.ietf.org/doc/html/rfc3987\n */\nexport function IsUrl(value) {\n    return URL.canParse(value);\n}\n","const Uuid = /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;\n/**\n * Returns true if the value is a uuid\n * @specification https://www.rfc-editor.org/info/rfc4122/\n * @specification https://www.rfc-editor.org/info/rfc9562/\n */\nexport function IsUuid(value) {\n    return Uuid.test(value);\n}\n","import { IsDateTime } from './date_time.mjs';\nimport { IsDate } from './date.mjs';\nimport { IsDuration } from './duration.mjs';\nimport { IsEmail } from './email.mjs';\nimport { IsHostname } from './hostname.mjs';\nimport { IsIdnEmail } from './idn_email.mjs';\nimport { IsIdnHostname } from './idn_hostname.mjs';\nimport { IsIPv4 } from './ipv4.mjs';\nimport { IsIPv6 } from './ipv6.mjs';\nimport { IsIriReference } from './iri_reference.mjs';\nimport { IsIri } from './iri.mjs';\nimport { IsJsonPointerUriFragment } from './json_pointer_uri_fragment.mjs';\nimport { IsJsonPointer } from './json_pointer.mjs';\nimport { IsRegex } from './regex.mjs';\nimport { IsRelativeJsonPointer } from './relative_json_pointer.mjs';\nimport { IsTime } from './time.mjs';\nimport { IsUriReference } from './uri_reference.mjs';\nimport { IsUriTemplate } from './uri_template.mjs';\nimport { IsUri } from './uri.mjs';\nimport { IsUrl } from './url.mjs';\nimport { IsUuid } from './uuid.mjs';\n// ------------------------------------------------------------------\n// Formats\n// ------------------------------------------------------------------\nconst formats = new Map();\n// ------------------------------------------------------------------\n// Clear\n// ------------------------------------------------------------------\n/** Clears all entries */\nexport function Clear() {\n    formats.clear();\n}\n// ------------------------------------------------------------------\n// Entries\n// ------------------------------------------------------------------\n/** Returns format entries in this registry */\nexport function Entries() {\n    return [...formats.entries()];\n}\n// ------------------------------------------------------------------\n// Set\n// ------------------------------------------------------------------\n/** Sets a format */\nexport function Set(format, check) {\n    formats.set(format, check);\n}\n// ------------------------------------------------------------------\n// Has\n// ------------------------------------------------------------------\n/** Returns true if the registry has this format */\nexport function Has(format) {\n    return formats.has(format);\n}\n// ------------------------------------------------------------------\n// Get\n// ------------------------------------------------------------------\n/** Gets a format or undefined if not exists */\nexport function Get(format) {\n    return formats.get(format);\n}\n// ------------------------------------------------------------------\n// Test\n// ------------------------------------------------------------------\n/** Tests a value against a format, if the format is not registered, true */\nexport function Test(format, value) {\n    return formats.get(format)?.(value) ?? true;\n}\n// ------------------------------------------------------------------\n// Reset\n// ------------------------------------------------------------------\n/** Resets all formats to defaults */\nexport function Reset() {\n    Clear();\n    formats.set('date-time', IsDateTime);\n    formats.set('date', IsDate);\n    formats.set('duration', IsDuration);\n    formats.set('email', IsEmail);\n    formats.set('hostname', IsHostname);\n    formats.set('idn-email', IsIdnEmail);\n    formats.set('idn-hostname', IsIdnHostname);\n    formats.set('ipv4', IsIPv4);\n    formats.set('ipv6', IsIPv6);\n    formats.set('iri-reference', IsIriReference);\n    formats.set('iri', IsIri);\n    formats.set('json-pointer-uri-fragment', IsJsonPointerUriFragment);\n    formats.set('json-pointer', IsJsonPointer);\n    formats.set('regex', IsRegex);\n    formats.set('relative-json-pointer', IsRelativeJsonPointer);\n    formats.set('time', IsTime);\n    formats.set('uri-reference', IsUriReference);\n    formats.set('uri-template', IsUriTemplate);\n    formats.set('uri', IsUri);\n    formats.set('url', IsUrl);\n    formats.set('uuid', IsUuid);\n}\nReset();\n","export * from './_registry.mjs';\nexport { IsDateTime } from './date_time.mjs';\nexport { IsDate } from './date.mjs';\nexport { IsDuration } from './duration.mjs';\nexport { IsEmail } from './email.mjs';\nexport { IsHostname } from './hostname.mjs';\nexport { IsIdnEmail } from './idn_email.mjs';\nexport { IsIdnHostname } from './idn_hostname.mjs';\nexport { IsIPv4 } from './ipv4.mjs';\nexport { IsIPv6 } from './ipv6.mjs';\nexport { IsIriReference } from './iri_reference.mjs';\nexport { IsIri } from './iri.mjs';\nexport { IsJsonPointerUriFragment } from './json_pointer_uri_fragment.mjs';\nexport { IsJsonPointer } from './json_pointer.mjs';\nexport { IsRegex } from './regex.mjs';\nexport { IsRelativeJsonPointer } from './relative_json_pointer.mjs';\nexport { IsTime } from './time.mjs';\nexport { IsUriReference } from './uri_reference.mjs';\nexport { IsUriTemplate } from './uri_template.mjs';\nexport { IsUri } from './uri.mjs';\nexport { IsUrl } from './url.mjs';\nexport { IsUuid } from './uuid.mjs';\n","// deno-fmt-ignore-file\nimport { Format } from '../../format/index.mjs';\nimport { EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildFormat(_stack, _context, schema, value) {\n    return E.Call(E.Member('Format', 'Test'), [E.Constant(schema.format), value]);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckFormat(_stack, _context, schema, value) {\n    return Format.Test(schema.format, value);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorFormat(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckFormat(stack, context, schema, value) || context.AddError({\n        keyword: 'format',\n        schemaPath,\n        instancePath,\n        params: { format: schema.format },\n    });\n}\n","// deno-fmt-ignore-file\nimport * as Schema from '../types/index.mjs';\nimport { ErrorContext } from './_context.mjs';\nimport { EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildIf(stack, context, schema, value) {\n    const thenSchema = Schema.IsThen(schema) ? schema.then : true;\n    const elseSchema = Schema.IsElse(schema) ? schema.else : true;\n    return E.Ternary(BuildSchema(stack, context, schema.if, value), BuildSchema(stack, context, thenSchema, value), BuildSchema(stack, context, elseSchema, value));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckIf(stack, context, schema, value) {\n    const thenSchema = Schema.IsThen(schema) ? schema.then : true;\n    const elseSchema = Schema.IsElse(schema) ? schema.else : true;\n    return CheckSchema(stack, context, schema.if, value)\n        ? CheckSchema(stack, context, thenSchema, value)\n        : CheckSchema(stack, context, elseSchema, value);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorIf(stack, context, schemaPath, instancePath, schema, value) {\n    const thenSchema = Schema.IsThen(schema) ? schema.then : true;\n    const elseSchema = Schema.IsElse(schema) ? schema.else : true;\n    const trueContext = new ErrorContext();\n    const isIf = ErrorSchema(stack, trueContext, `${schemaPath}/if`, instancePath, schema.if, value)\n        ? ErrorSchema(stack, trueContext, `${schemaPath}/then`, instancePath, thenSchema, value) || context.AddError({\n            keyword: 'if',\n            schemaPath,\n            instancePath,\n            params: { failingKeyword: 'then' },\n        })\n        : ErrorSchema(stack, context, `${schemaPath}/else`, instancePath, elseSchema, value) || context.AddError({\n            keyword: 'if',\n            schemaPath,\n            instancePath,\n            params: { failingKeyword: 'else' },\n        });\n    if (isIf)\n        context.Merge([trueContext]);\n    return isIf;\n}\n","// deno-fmt-ignore-file\nimport * as Schema from '../types/index.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';\n// ------------------------------------------------------------------\n// ItemsSized\n// ------------------------------------------------------------------\nfunction BuildItemsSizedStandard(stack, context, schema, value) {\n    return E.ReduceAnd(schema.items.map((schema, index) => {\n        const isLength = E.IsLessEqualThan(E.Member(value, 'length'), E.Constant(index));\n        const isSchema = BuildSchemaPushStack(stack, context, schema, `${value}[${index}]`);\n        const addIndex = context.AddIndex(E.Constant(index));\n        return E.Or(isLength, E.And(isSchema, addIndex));\n    }));\n}\nfunction BuildItemsSizedFast(stack, context, schema, value) {\n    return E.ReduceAnd(schema.items.map((schema, index) => {\n        const isLength = E.IsLessEqualThan(E.Member(value, 'length'), E.Constant(index));\n        const isSchema = BuildSchemaPushStack(stack, context, schema, `${value}[${index}]`);\n        return E.Or(isLength, isSchema);\n    }));\n}\nfunction BuildItemsSized(stack, context, schema, value) {\n    return context.UseUnevaluated()\n        ? BuildItemsSizedStandard(stack, context, schema, value)\n        : BuildItemsSizedFast(stack, context, schema, value);\n}\nfunction CheckItemsSized(stack, context, schema, value) {\n    return G.Every(schema.items, 0, (schema, index) => {\n        return G.IsLessEqualThan(value.length, index)\n            || (CheckSchemaPushStack(stack, context, schema, value[index]) && context.AddIndex(index));\n    });\n}\nfunction ErrorItemsSized(stack, context, schemaPath, instancePath, schema, value) {\n    return G.EveryAll(schema.items, 0, (schema, index) => {\n        const nextSchemaPath = `${schemaPath}/items/${index}`;\n        const nextInstancePath = `${instancePath}/${index}`;\n        return G.IsLessEqualThan(value.length, index)\n            || (ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema, value[index]) && context.AddIndex(index));\n    });\n}\n// ------------------------------------------------------------------\n// ItemsUnsized\n// ------------------------------------------------------------------\nfunction BuildItemsUnsizedStandard(stack, context, schema, value) {\n    const offset = Schema.IsPrefixItems(schema) ? schema.prefixItems.length : 0;\n    const isSchema = BuildSchemaPushStack(stack, context, schema.items, 'element');\n    const addIndex = context.AddIndex('index');\n    return E.Every(value, E.Constant(offset), ['element', 'index'], E.And(isSchema, addIndex));\n}\nfunction BuildItemsUnsizedFast(stack, context, schema, value) {\n    const offset = Schema.IsPrefixItems(schema) ? schema.prefixItems.length : 0;\n    const isSchema = BuildSchemaPushStack(stack, context, schema.items, 'element');\n    return E.Every(value, E.Constant(offset), ['element', 'index'], isSchema);\n}\nfunction BuildItemsUnsized(stack, context, schema, value) {\n    return context.UseUnevaluated()\n        ? BuildItemsUnsizedStandard(stack, context, schema, value)\n        : BuildItemsUnsizedFast(stack, context, schema, value);\n}\nfunction CheckItemsUnsized(stack, context, schema, value) {\n    const offset = Schema.IsPrefixItems(schema) ? schema.prefixItems.length : 0;\n    return G.Every(value, offset, (element, index) => {\n        return CheckSchemaPushStack(stack, context, schema.items, element)\n            && context.AddIndex(index);\n    });\n}\nfunction ErrorItemsUnsized(stack, context, schemaPath, instancePath, schema, value) {\n    const offset = Schema.IsPrefixItems(schema) ? schema.prefixItems.length : 0;\n    return G.EveryAll(value, offset, (element, index) => {\n        const nextSchemaPath = `${schemaPath}/items`;\n        const nextInstancePath = `${instancePath}/${index}`;\n        return ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema.items, element)\n            && context.AddIndex(index);\n    });\n}\n// ------------------------------------------------------------------\n// Items\n// ------------------------------------------------------------------\nexport function BuildItems(stack, context, schema, value) {\n    return Schema.IsItemsSized(schema) ? BuildItemsSized(stack, context, schema, value) : BuildItemsUnsized(stack, context, schema, value);\n}\nexport function CheckItems(stack, context, schema, value) {\n    return Schema.IsItemsSized(schema) ? CheckItemsSized(stack, context, schema, value) : CheckItemsUnsized(stack, context, schema, value);\n}\nexport function ErrorItems(stack, context, schemaPath, instancePath, schema, value) {\n    return Schema.IsItemsSized(schema) ? ErrorItemsSized(stack, context, schemaPath, instancePath, schema, value) : ErrorItemsUnsized(stack, context, schemaPath, instancePath, schema, value);\n}\n","// deno-fmt-ignore-file\nimport * as Schema from '../types/index.mjs';\nimport { Unique } from './_unique.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Valid\n// ------------------------------------------------------------------\nfunction IsValid(schema) {\n    return Schema.IsContains(schema);\n}\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMaxContains(stack, context, schema, value) {\n    if (!IsValid(schema))\n        return E.Constant(true);\n    const [item] = [Unique()];\n    const count = E.Counted(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));\n    return E.IsLessEqualThan(count, E.Constant(schema.maxContains));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMaxContains(stack, context, schema, value) {\n    if (!IsValid(schema))\n        return true;\n    const count = G.Counted(value, (item) => CheckSchema(stack, context, schema.contains, item));\n    return G.IsLessEqualThan(count, schema.maxContains);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMaxContains(stack, context, schemaPath, instancePath, schema, value) {\n    const minContains = Schema.IsMinContains(schema) ? schema.minContains : 1;\n    return CheckMaxContains(stack, context, schema, value) || context.AddError({\n        keyword: 'contains',\n        schemaPath,\n        instancePath,\n        params: { minContains, maxContains: schema.maxContains },\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMaximum(_stack, _context, schema, value) {\n    return E.IsLessEqualThan(value, E.Constant(schema.maximum));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMaximum(_stack, _context, schema, value) {\n    return G.IsLessEqualThan(value, schema.maximum);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMaximum(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMaximum(stack, context, schema, value) || context.AddError({\n        keyword: 'maximum',\n        schemaPath,\n        instancePath,\n        params: { comparison: '<=', limit: schema.maximum }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMaxItems(_stack, _context, schema, value) {\n    return E.IsLessEqualThan(E.Member(value, 'length'), E.Constant(schema.maxItems));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMaxItems(_stack, _context, schema, value) {\n    return G.IsLessEqualThan(value.length, schema.maxItems);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMaxItems(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMaxItems(stack, context, schema, value) || context.AddError({\n        keyword: 'maxItems',\n        schemaPath,\n        instancePath,\n        params: { limit: schema.maxItems }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMaxLength(_stack, _context, schema, value) {\n    return E.IsMaxLength(value, E.Constant(schema.maxLength));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMaxLength(_stack, _context, schema, value) {\n    return G.IsMaxLength(value, schema.maxLength);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMaxLength(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMaxLength(stack, context, schema, value) || context.AddError({\n        keyword: 'maxLength',\n        schemaPath,\n        instancePath,\n        params: { limit: schema.maxLength }\n    });\n}\n","// deno-fmt-ignore-file\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMaxProperties(_stack, _context, schema, value) {\n    return E.IsLessEqualThan(E.Member(E.Keys(value), 'length'), E.Constant(schema.maxProperties));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMaxProperties(_stack, _context, schema, value) {\n    return G.IsLessEqualThan(G.Keys(value).length, schema.maxProperties);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function ErrorMaxProperties(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMaxProperties(stack, context, schema, value) || context.AddError({\n        keyword: 'maxProperties',\n        schemaPath,\n        instancePath,\n        params: { limit: schema.maxProperties },\n    });\n}\n","// deno-fmt-ignore-file\nimport * as Schema from '../types/index.mjs';\nimport { Unique } from './_unique.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Valid\n// ------------------------------------------------------------------\nfunction IsValid(schema) {\n    return Schema.IsContains(schema);\n}\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nfunction BuildMinContainsStandard(stack, context, schema, value) {\n    const [item, index] = [Unique(), Unique()];\n    const count = E.Counted(value, [item, index], E.And(BuildSchema(stack, context, schema.contains, item), context.AddIndex(index)));\n    return E.IsGreaterEqualThan(count, E.Constant(schema.minContains));\n}\nfunction BuildMinContainsFast(stack, context, schema, value) {\n    const [item] = [Unique()];\n    const count = E.Counted(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));\n    return E.IsGreaterEqualThan(count, E.Constant(schema.minContains));\n}\nexport function BuildMinContains(stack, context, schema, value) {\n    if (!IsValid(schema))\n        return E.Constant(true);\n    return context.UseUnevaluated()\n        ? BuildMinContainsStandard(stack, context, schema, value)\n        : BuildMinContainsFast(stack, context, schema, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMinContains(stack, context, schema, value) {\n    if (!IsValid(schema))\n        return true;\n    const count = G.Counted(value, (item, index) => CheckSchema(stack, context, schema.contains, item) && context.AddIndex(index));\n    return G.IsGreaterEqualThan(count, schema.minContains);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMinContains(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMinContains(stack, context, schema, value) || context.AddError({\n        keyword: 'contains',\n        schemaPath,\n        instancePath,\n        params: { minContains: schema.minContains }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMinimum(_stack, _context, schema, value) {\n    return E.IsGreaterEqualThan(value, E.Constant(schema.minimum));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMinimum(_stack, _context, schema, value) {\n    return G.IsGreaterEqualThan(value, schema.minimum);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMinimum(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMinimum(stack, context, schema, value) || context.AddError({\n        keyword: 'minimum',\n        schemaPath,\n        instancePath,\n        params: { comparison: '>=', limit: schema.minimum }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMinItems(_stack, _context, schema, value) {\n    return E.IsGreaterEqualThan(E.Member(value, 'length'), E.Constant(schema.minItems));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMinItems(_stack, _context, schema, value) {\n    return G.IsGreaterEqualThan(value.length, schema.minItems);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMinItems(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMinItems(stack, context, schema, value) || context.AddError({\n        keyword: 'minItems',\n        schemaPath,\n        instancePath,\n        params: { limit: schema.minItems }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMinLength(_stack, _context, schema, value) {\n    return E.IsMinLength(value, E.Constant(schema.minLength));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMinLength(_stack, _context, schema, value) {\n    return G.IsMinLength(value, schema.minLength);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMinLength(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMinLength(stack, context, schema, value) || context.AddError({\n        keyword: 'minLength',\n        schemaPath,\n        instancePath,\n        params: { limit: schema.minLength }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMinProperties(_stack, _context, schema, value) {\n    return E.IsGreaterEqualThan(E.Member(E.Keys(value), 'length'), E.Constant(schema.minProperties));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMinProperties(_stack, _context, schema, value) {\n    return G.IsGreaterEqualThan(G.Keys(value).length, schema.minProperties);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMinProperties(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMinProperties(stack, context, schema, value) || context.AddError({\n        keyword: 'minProperties',\n        schemaPath,\n        instancePath,\n        params: { limit: schema.minProperties },\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildMultipleOf(_stack, _context, schema, value) {\n    return E.MultipleOf(value, E.Constant(schema.multipleOf));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckMultipleOf(_stack, _context, schema, value) {\n    return G.IsMultipleOf(value, schema.multipleOf);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorMultipleOf(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckMultipleOf(stack, context, schema, value) || context.AddError({\n        keyword: 'multipleOf',\n        schemaPath,\n        instancePath,\n        params: { multipleOf: schema.multipleOf }\n    });\n}\n","// deno-fmt-ignore-file\nimport { CheckContext } from './_context.mjs';\nimport { Reducer } from './_reducer.mjs';\nimport { EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nfunction BuildNotStandard(stack, context, schema, value) {\n    return Reducer(stack, context, [schema.not], value, E.Not(E.IsEqual(E.Member('results', 'length'), E.Constant(1))));\n}\nfunction BuildNotFast(stack, context, schema, value) {\n    return E.Not(BuildSchema(stack, context, schema.not, value));\n}\nexport function BuildNot(stack, context, schema, value) {\n    return context.UseUnevaluated()\n        ? BuildNotStandard(stack, context, schema, value)\n        : BuildNotFast(stack, context, schema, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckNot(stack, context, schema, value) {\n    const nextContext = new CheckContext();\n    const isSchema = !CheckSchema(stack, nextContext, schema.not, value);\n    const isNot = isSchema && context.Merge([nextContext]);\n    return isNot;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorNot(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckNot(stack, context, schema, value) || context.AddError({\n        keyword: 'not',\n        schemaPath,\n        instancePath,\n        params: {},\n    });\n}\n","// deno-fmt-ignore-file\nimport { CheckContext, ErrorContext } from './_context.mjs';\nimport { Reducer } from './_reducer.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\nimport { Unique } from './_unique.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nfunction BuildOneOfStandard(stack, context, schema, value) {\n    return Reducer(stack, context, schema.oneOf, value, E.IsEqual(E.Member('results', 'length'), E.Constant(1)));\n}\nfunction BuildOneOfFast(stack, context, schema, value) {\n    const [result] = [Unique()];\n    const results = E.ArrayLiteral(schema.oneOf.map((schema) => BuildSchema(stack, context, schema, value)));\n    const count = E.Counted(results, [result, '_'], E.IsEqual(result, E.Constant(true)));\n    return E.IsEqual(count, E.Constant(1));\n}\nexport function BuildOneOf(stack, context, schema, value) {\n    return context.UseUnevaluated()\n        ? BuildOneOfStandard(stack, context, schema, value)\n        : BuildOneOfFast(stack, context, schema, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckOneOf(stack, context, schema, value) {\n    const passedContexts = schema.oneOf.reduce((result, schema) => {\n        const nextContext = new CheckContext();\n        return CheckSchema(stack, nextContext, schema, value) ? [...result, nextContext] : result;\n    }, []);\n    return G.IsEqual(passedContexts.length, 1) && context.Merge(passedContexts);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorOneOf(stack, context, schemaPath, instancePath, schema, value) {\n    const failedContexts = [];\n    const passingSchemas = [];\n    const passedContexts = schema.oneOf.reduce((result, schema, index) => {\n        const nextContext = new ErrorContext();\n        const nextSchemaPath = `${schemaPath}/oneOf/${index}`;\n        const isSchema = ErrorSchema(stack, nextContext, nextSchemaPath, instancePath, schema, value);\n        if (isSchema)\n            passingSchemas.push(index);\n        if (!isSchema)\n            failedContexts.push(nextContext);\n        return isSchema ? [...result, nextContext] : result;\n    }, []);\n    const isOneOf = G.IsEqual(passedContexts.length, 1) && context.Merge(passedContexts);\n    if (!isOneOf && G.IsEqual(passingSchemas.length, 0))\n        failedContexts.forEach(failed => failed.GetErrors().forEach(error => context.AddError(error)));\n    return isOneOf || context.AddError({\n        keyword: 'oneOf',\n        schemaPath,\n        instancePath,\n        params: { passingSchemas },\n    });\n}\n","// deno-fmt-ignore-file\nimport * as Externals from './_externals.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { UnicodeRegExp } from './_regexp.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildPattern(_stack, _context, schema, value) {\n    const regexp = Externals.CreateVariable(G.IsString(schema.pattern) ? UnicodeRegExp(schema.pattern) : schema.pattern);\n    return E.Call(E.Member(regexp, 'test'), [value]);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckPattern(_stack, _context, schema, value) {\n    const regexp = G.IsString(schema.pattern) ? UnicodeRegExp(schema.pattern) : schema.pattern;\n    return regexp.test(value);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorPattern(stack, context, schemaPath, instancePath, schema, value) {\n    return CheckPattern(stack, context, schema, value) || context.AddError({\n        keyword: 'pattern',\n        schemaPath,\n        instancePath,\n        params: { pattern: schema.pattern }\n    });\n}\n","// deno-fmt-ignore-file\nimport * as Externals from './_externals.mjs';\nimport { Unique } from './_unique.mjs';\nimport { UnicodeRegExp } from './_regexp.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildPatternProperties(stack, context, schema, value) {\n    return E.ReduceAnd(G.Entries(schema.patternProperties).map(([pattern, schema]) => {\n        const [key, prop] = [Unique(), Unique()];\n        const regexp = Externals.CreateVariable(UnicodeRegExp(pattern));\n        const notKey = E.Not(E.Call(E.Member(regexp, 'test'), [key]));\n        const isSchema = BuildSchemaPushStack(stack, context, schema, prop);\n        const addKey = context.AddKey(key);\n        const guarded = context.UseUnevaluated() ? E.Or(notKey, E.And(isSchema, addKey)) : E.Or(notKey, isSchema);\n        return E.Every(E.Entries(value), E.Constant(0), [`[${key}, ${prop}]`, '_'], guarded);\n    }));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckPatternProperties(stack, context, schema, value) {\n    return G.Every(G.Entries(schema.patternProperties), 0, ([pattern, schema]) => {\n        const regexp = UnicodeRegExp(pattern);\n        return G.Every(G.Entries(value), 0, ([key, prop]) => {\n            return !regexp.test(key) || CheckSchemaPushStack(stack, context, schema, prop) && context.AddKey(key);\n        });\n    });\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorPatternProperties(stack, context, schemaPath, instancePath, schema, value) {\n    return G.EveryAll(G.Entries(schema.patternProperties), 0, ([pattern, schema]) => {\n        const nextSchemaPath = `${schemaPath}/patternProperties/${pattern}`;\n        const regexp = UnicodeRegExp(pattern);\n        return G.EveryAll(G.Entries(value), 0, ([key, value]) => {\n            const nextInstancePath = `${instancePath}/${key}`;\n            const notKey = !regexp.test(key);\n            return notKey || ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema, value) && context.AddKey(key);\n        });\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildPrefixItems(stack, context, schema, value) {\n    return E.ReduceAnd(schema.prefixItems.map((schema, index) => {\n        const isLength = E.IsLessEqualThan(E.Member(value, 'length'), E.Constant(index));\n        const isSchema = BuildSchemaPushStack(stack, context, schema, `${value}[${index}]`);\n        const addIndex = context.AddIndex(E.Constant(index));\n        const guarded = context.UseUnevaluated() ? E.And(isSchema, addIndex) : isSchema;\n        return E.Or(isLength, guarded);\n    }));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckPrefixItems(stack, context, schema, value) {\n    return G.IsEqual(value.length, 0) || G.Every(schema.prefixItems, 0, (schema, index) => {\n        return G.IsLessEqualThan(value.length, index)\n            || (CheckSchemaPushStack(stack, context, schema, value[index]) && context.AddIndex(index));\n    });\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorPrefixItems(stack, context, schemaPath, instancePath, schema, value) {\n    return G.IsEqual(value.length, 0) || G.EveryAll(schema.prefixItems, 0, (schema, index) => {\n        const nextSchemaPath = `${schemaPath}/prefixItems/${index}`;\n        const nextInstancePath = `${instancePath}/${index}`;\n        return G.IsLessEqualThan(value.length, index)\n            || (ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema, value[index]) && context.AddIndex(index));\n    });\n}\n","import { Settings } from '../../system/settings/index.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// IsExactOptional\n// ------------------------------------------------------------------\nexport function IsExactOptional(required, key) {\n    return required.includes(key) || Settings.Get().exactOptionalPropertyTypes;\n}\n// ------------------------------------------------------------------\n// ExactOptionalBuild\n// ------------------------------------------------------------------\nexport function InexactOptionalBuild(value, key) {\n    return E.IsUndefined(E.Member(value, key));\n}\n// ------------------------------------------------------------------\n// ExactOptionalCheck\n// ------------------------------------------------------------------\nexport function InexactOptionalCheck(value, key) {\n    return G.IsUndefined(value[key]);\n}\n","// deno-fmt-ignore-file\nimport * as Schema from '../types/index.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';\nimport { InexactOptionalCheck, InexactOptionalBuild, IsExactOptional } from './_exact_optional.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildProperties(stack, context, schema, value) {\n    const required = Schema.IsRequired(schema) ? schema.required : [];\n    const everyKey = G.Entries(schema.properties).map(([key, schema]) => {\n        const notKey = E.Not(E.HasPropertyKey(value, E.Constant(key)));\n        const isSchema = BuildSchemaPushStack(stack, context, schema, E.Member(value, key));\n        const addKey = context.AddKey(E.Constant(key));\n        const guarded = context.UseUnevaluated() ? E.And(isSchema, addKey) : isSchema;\n        // --------------------------------------------------------------\n        // Optimization\n        //\n        // If a key is required, we can skip the `notKey` check since this\n        // condition is already enforced by Required. This optimization is\n        // only valid when Required is evaluated before Properties.\n        //\n        // --------------------------------------------------------------\n        const isProperty = required.includes(key) ? guarded : E.Or(notKey, guarded);\n        // --------------------------------------------------------------\n        // ExactOptionalProperties\n        //\n        // By default, TypeScript allows optional properties to be assigned\n        // undefined. This is a bit misleading, since 'optional' is usually\n        // understood to mean 'the key may be absent', not 'the key may be\n        // present with an undefined value'.\n        //\n        // The 'IsExactOptional' check returns false by default, matching\n        // TypeScript's behavior. When exactOptionalPropertyTypes is enabled\n        // in tsconfig.json, TypeBox can be configured to use the stricter \n        // semantics via System settings:\n        //\n        //   Settings.Set({ exactOptionalPropertyTypes: true })\n        //\n        // --------------------------------------------------------------\n        return IsExactOptional(required, key)\n            ? isProperty\n            : E.Or(InexactOptionalBuild(value, key), isProperty);\n    });\n    return E.ReduceAnd(everyKey);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckProperties(stack, context, schema, value) {\n    const required = Schema.IsRequired(schema) ? schema.required : [];\n    const isProperties = G.Every(G.Entries(schema.properties), 0, ([key, schema]) => {\n        const isProperty = !G.HasPropertyKey(value, key) || (CheckSchemaPushStack(stack, context, schema, value[key]) && context.AddKey(key));\n        return IsExactOptional(required, key)\n            ? isProperty\n            : InexactOptionalCheck(value, key) || isProperty;\n    });\n    return isProperties;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorProperties(stack, context, schemaPath, instancePath, schema, value) {\n    const required = Schema.IsRequired(schema) ? schema.required : [];\n    const isProperties = G.EveryAll(G.Entries(schema.properties), 0, ([key, schema]) => {\n        const nextSchemaPath = `${schemaPath}/properties/${key}`;\n        const nextInstancePath = `${instancePath}/${key}`;\n        // Defer error generation for IsExactOptional\n        const isProperty = () => (!G.HasPropertyKey(value, key) || (ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema, value[key]) && context.AddKey(key)));\n        return IsExactOptional(required, key)\n            ? isProperty()\n            : InexactOptionalCheck(value, key) || isProperty();\n    });\n    return isProperties;\n}\n","// deno-fmt-ignore-file\nimport { Unique } from './_unique.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildPropertyNames(stack, context, schema, value) {\n    const [key, _index] = [Unique(), Unique()];\n    return E.Every(E.Keys(value), E.Constant(0), [key, _index], BuildSchema(stack, context, schema.propertyNames, key));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckPropertyNames(stack, context, schema, value) {\n    return G.Every(G.Keys(value), 0, (key, _index) => CheckSchema(stack, context, schema.propertyNames, key));\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorPropertyNames(stack, context, schemaPath, instancePath, schema, value) {\n    const propertyNames = [];\n    const isPropertyNames = G.EveryAll(G.Keys(value), 0, (key, _index) => {\n        const nextInstancePath = `${instancePath}/${key}`;\n        const nextSchemaPath = `${schemaPath}/propertyNames`;\n        const isPropertyName = ErrorSchema(stack, context, nextSchemaPath, nextInstancePath, schema.propertyNames, key);\n        if (!isPropertyName)\n            propertyNames.push(key);\n        return isPropertyName;\n    });\n    return isPropertyNames || context.AddError({\n        keyword: 'propertyNames',\n        schemaPath,\n        instancePath,\n        params: { propertyNames }\n    });\n}\n","// deno-fmt-ignore-file\nimport * as Functions from './_functions.mjs';\nimport * as Schema from '../types/index.mjs';\nimport { CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildRecursiveRef(stack, context, schema, value) {\n    const target = stack.RecursiveRef(schema) ?? false;\n    return Functions.CreateFunction(stack, context, target, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckRecursiveRef(stack, context, schema, value) {\n    const target = stack.RecursiveRef(schema) ?? false;\n    return (Schema.IsSchema(target) && CheckSchema(stack, context, target, value));\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorRecursiveRef(stack, context, _schemaPath, instancePath, schema, value) {\n    const target = stack.RecursiveRef(schema) ?? false;\n    return (Schema.IsSchema(target) && ErrorSchema(stack, context, '#', instancePath, target, value));\n}\n","// deno-fmt-ignore-file\nimport * as Functions from './_functions.mjs';\nimport * as Schema from '../types/index.mjs';\nimport { CheckContext, ErrorContext } from './_context.mjs';\nimport { EmitGuard as E } from '../../guard/index.mjs';\nimport { CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// BuildRef\n// ------------------------------------------------------------------\nfunction BuildRefStandard(stack, context, target, value) {\n    const interior = E.ArrowFunction(['context', 'value'], Functions.CreateFunction(stack, context, target, 'value'));\n    const exterior = E.ArrowFunction(['context', 'value'], E.Statements([\n        E.ConstDeclaration('nextContext', E.New('CheckContext', [])),\n        E.ConstDeclaration('result', E.Call(interior, ['nextContext', 'value'])),\n        E.If('result', context.Merge('[nextContext]')),\n        E.Return('result')\n    ]));\n    return E.Call(exterior, ['context', value]);\n}\nfunction BuildRefFast(stack, context, target, value) {\n    return Functions.CreateFunction(stack, context, target, value);\n}\nexport function BuildRef(stack, context, schema, value) {\n    const target = stack.Ref(schema) ?? false;\n    return context.UseUnevaluated()\n        ? BuildRefStandard(stack, context, target, value)\n        : BuildRefFast(stack, context, target, value);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckRef(stack, context, schema, value) {\n    const target = stack.Ref(schema) ?? false;\n    const nextContext = new CheckContext();\n    const result = (Schema.IsSchema(target) && CheckSchema(stack, nextContext, target, value));\n    if (result)\n        context.Merge([nextContext]);\n    return result;\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorRef(stack, context, _schemaPath, instancePath, schema, value) {\n    const target = stack.Ref(schema) ?? false;\n    const nextContext = new ErrorContext();\n    const result = (Schema.IsSchema(target) && ErrorSchema(stack, nextContext, '#', instancePath, target, value));\n    if (result)\n        context.Merge([nextContext]);\n    if (!result)\n        nextContext.GetErrors().forEach(error => context.AddError(error));\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildRequired(_stack, _context, schema, value) {\n    return E.ReduceAnd(schema.required.map((key) => E.HasPropertyKey(value, E.Constant(key))));\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckRequired(_stack, _context, schema, value) {\n    return G.Every(schema.required, 0, (key) => G.HasPropertyKey(value, key));\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorRequired(_stack, context, schemaPath, instancePath, schema, value) {\n    const requiredProperties = [];\n    const isRequired = G.EveryAll(schema.required, 0, (key) => {\n        const hasKey = G.HasPropertyKey(value, key);\n        if (!hasKey)\n            requiredProperties.push(key);\n        return hasKey;\n    });\n    return isRequired || context.AddError({\n        keyword: 'required',\n        schemaPath,\n        instancePath,\n        params: { requiredProperties }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// TypeName\n// ------------------------------------------------------------------\nfunction BuildTypeName(_stack, _context, type, value) {\n    return (\n    // jsonschema\n    G.IsEqual(type, 'object') ? E.IsObjectNotArray(value) :\n        G.IsEqual(type, 'array') ? E.IsArray(value) :\n            G.IsEqual(type, 'boolean') ? E.IsBoolean(value) :\n                G.IsEqual(type, 'integer') ? E.IsInteger(value) :\n                    G.IsEqual(type, 'number') ? E.IsNumber(value) :\n                        G.IsEqual(type, 'null') ? E.IsNull(value) :\n                            G.IsEqual(type, 'string') ? E.IsString(value) :\n                                // xschema\n                                G.IsEqual(type, 'bigint') ? E.IsBigInt(value) :\n                                    G.IsEqual(type, 'constructor') ? E.IsConstructor(value) :\n                                        G.IsEqual(type, 'function') ? E.IsFunction(value) :\n                                            G.IsEqual(type, 'symbol') ? E.IsSymbol(value) :\n                                                G.IsEqual(type, 'undefined') ? E.IsUndefined(value) :\n                                                    G.IsEqual(type, 'void') ? E.IsUndefined(value) :\n                                                        E.Constant(true));\n}\nfunction CheckTypeName(_stack, _context, type, _schema, value) {\n    return (\n    // jsonschema\n    G.IsEqual(type, 'object') ? G.IsObjectNotArray(value) :\n        G.IsEqual(type, 'array') ? G.IsArray(value) :\n            G.IsEqual(type, 'boolean') ? G.IsBoolean(value) :\n                G.IsEqual(type, 'integer') ? G.IsInteger(value) :\n                    G.IsEqual(type, 'number') ? G.IsNumber(value) :\n                        G.IsEqual(type, 'null') ? G.IsNull(value) :\n                            G.IsEqual(type, 'string') ? G.IsString(value) :\n                                // xschema\n                                G.IsEqual(type, 'bigint') ? G.IsBigInt(value) :\n                                    G.IsEqual(type, 'constructor') ? G.IsConstructor(value) :\n                                        G.IsEqual(type, 'function') ? G.IsFunction(value) :\n                                            G.IsEqual(type, 'symbol') ? G.IsSymbol(value) :\n                                                G.IsEqual(type, 'undefined') ? G.IsUndefined(value) :\n                                                    G.IsEqual(type, 'void') ? G.IsUndefined(value) :\n                                                        true);\n}\n// ------------------------------------------------------------------\n// TypeNames\n// ------------------------------------------------------------------\nfunction BuildTypeNames(stack, context, typenames, value) {\n    return E.ReduceOr(typenames.map(type => BuildTypeName(stack, context, type, value)));\n}\nfunction CheckTypeNames(stack, context, types, schema, value) {\n    return G.Some(types, type => CheckTypeName(stack, context, type, schema, value));\n}\n// ------------------------------------------------------------------\n// Type\n// ------------------------------------------------------------------\nexport function BuildType(stack, context, schema, value) {\n    return G.IsArray(schema.type) ? BuildTypeNames(stack, context, schema.type, value) : BuildTypeName(stack, context, schema.type, value);\n}\nexport function CheckType(stack, context, schema, value) {\n    return G.IsArray(schema.type) ? CheckTypeNames(stack, context, schema.type, schema, value) : CheckTypeName(stack, context, schema.type, schema, value);\n}\nexport function ErrorType(stack, context, schemaPath, instancePath, schema, value) {\n    const isType = G.IsArray(schema.type) ? CheckTypeNames(stack, context, schema.type, schema, value) : CheckTypeName(stack, context, schema.type, schema, value);\n    return isType || context.AddError({\n        keyword: 'type',\n        schemaPath,\n        instancePath,\n        params: { type: schema.type }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Unique } from './_unique.mjs';\nimport { ErrorContext } from './_context.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildUnevaluatedItems(stack, context, schema, value) {\n    const [index, item] = [Unique(), Unique()];\n    const indices = E.Call(E.Member('context', 'GetIndices'), []);\n    const hasIndex = E.Call(E.Member('indices', 'has'), [index]);\n    const isSchema = BuildSchema(stack, context, schema.unevaluatedItems, item);\n    const addIndex = E.Call(E.Member('context', 'AddIndex'), [index]);\n    const isEvery = E.Every(value, E.Constant(0), [item, index], E.And(E.Or(hasIndex, isSchema), addIndex));\n    return E.Call(E.ArrowFunction(['context'], E.Statements([\n        E.ConstDeclaration('indices', indices),\n        E.Return(isEvery)\n    ])), ['context']);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckUnevaluatedItems(stack, context, schema, value) {\n    const indices = context.GetIndices();\n    return G.Every(value, 0, (item, index) => {\n        return (indices.has(index) || CheckSchema(stack, context, schema.unevaluatedItems, item))\n            && context.AddIndex(index);\n    });\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorUnevaluatedItems(stack, context, schemaPath, instancePath, schema, value) {\n    const indices = context.GetIndices();\n    const unevaluatedItems = [];\n    const isUnevaluatedItems = G.EveryAll(value, 0, (item, index) => {\n        const nextContext = new ErrorContext();\n        const isEvaluatedItem = (indices.has(index) || ErrorSchema(stack, nextContext, schemaPath, instancePath, schema.unevaluatedItems, item))\n            && context.AddIndex(index);\n        if (!isEvaluatedItem)\n            unevaluatedItems.push(index);\n        return isEvaluatedItem;\n    });\n    return isUnevaluatedItems || context.AddError({\n        keyword: 'unevaluatedItems',\n        schemaPath,\n        instancePath,\n        params: { unevaluatedItems }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Unique } from './_unique.mjs';\nimport { ErrorContext } from './_context.mjs';\nimport { Guard as G, EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildUnevaluatedProperties(stack, context, schema, value) {\n    const [key, prop] = [Unique(), Unique()];\n    const keys = E.Call(E.Member('context', 'GetKeys'), []);\n    const hasKey = E.Call(E.Member('keys', 'has'), [key]);\n    const addKey = E.Call(E.Member('context', 'AddKey'), [key]);\n    const isSchema = BuildSchema(stack, context, schema.unevaluatedProperties, prop);\n    const isEvery = E.Every(E.Entries(value), E.Constant(0), [`[${key}, ${prop}]`, '_'], E.Or(hasKey, E.And(isSchema, addKey)));\n    return E.Call(E.ArrowFunction(['context'], E.Statements([\n        E.ConstDeclaration('keys', keys),\n        E.Return(isEvery)\n    ])), ['context']);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckUnevaluatedProperties(stack, context, schema, value) {\n    const keys = context.GetKeys();\n    return G.Every(G.Entries(value), 0, ([key, prop]) => {\n        return keys.has(key)\n            || (CheckSchema(stack, context, schema.unevaluatedProperties, prop) && context.AddKey(key));\n    });\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorUnevaluatedProperties(stack, context, schemaPath, instancePath, schema, value) {\n    const keys = context.GetKeys();\n    const unevaluatedProperties = [];\n    const isUnevaluatedProperties = G.EveryAll(G.Entries(value), 0, ([key, prop]) => {\n        const nextContext = new ErrorContext();\n        const isEvaluatedProperty = keys.has(key)\n            || (ErrorSchema(stack, nextContext, schemaPath, instancePath, schema.unevaluatedProperties, prop) && context.AddKey(key));\n        if (!isEvaluatedProperty)\n            unevaluatedProperties.push(key);\n        return isEvaluatedProperty;\n    });\n    return isUnevaluatedProperties || context.AddError({\n        keyword: 'unevaluatedProperties',\n        schemaPath,\n        instancePath,\n        params: { unevaluatedProperties }\n    });\n}\n","// deno-fmt-ignore-file\nimport { Hashing } from '../../system/hashing/index.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Valid\n// ------------------------------------------------------------------\nfunction IsValid(schema) {\n    return !G.IsEqual(schema.uniqueItems, false);\n}\n// ------------------------------------------------------------------\n// Build\n// ------------------------------------------------------------------\nexport function BuildUniqueItems(_stack, _context, schema, value) {\n    if (!IsValid(schema))\n        return E.Constant(true);\n    const set = E.Member(E.New('Set', [E.Call(E.Member(value, 'map'), [E.Member('Hashing', 'Hash')])]), 'size');\n    const isLength = E.Member(value, 'length');\n    return E.IsEqual(set, isLength);\n}\n// ------------------------------------------------------------------\n// Check\n// ------------------------------------------------------------------\nexport function CheckUniqueItems(_stack, _context, schema, value) {\n    if (!IsValid(schema))\n        return true;\n    const set = new Set(value.map(Hashing.Hash)).size;\n    const isLength = value.length;\n    return G.IsEqual(set, isLength);\n}\n// ------------------------------------------------------------------\n// Error\n// ------------------------------------------------------------------\nexport function ErrorUniqueItems(_stack, context, schemaPath, instancePath, schema, value) {\n    if (!IsValid(schema))\n        return true;\n    const set = new Set();\n    const duplicateItems = value.reduce((result, value, index) => {\n        const hash = Hashing.Hash(value);\n        if (set.has(hash))\n            return [...result, index];\n        set.add(hash);\n        return result;\n    }, []);\n    const isUniqueItems = G.IsEqual(duplicateItems.length, 0);\n    return isUniqueItems || context.AddError({\n        keyword: 'uniqueItems',\n        schemaPath,\n        instancePath,\n        params: { duplicateItems },\n    });\n}\n","// deno-fmt-ignore-file\nimport * as Schema from '../types/index.mjs';\nimport { BuildRefine, CheckRefine, ErrorRefine } from './_refine.mjs';\nimport { EmitGuard as E, Guard as G } from '../../guard/index.mjs';\nimport { BuildAdditionalItems, CheckAdditionalItems, ErrorAdditionalItems } from './additionalItems.mjs';\nimport { BuildAdditionalProperties, CheckAdditionalProperties, ErrorAdditionalProperties } from './additionalProperties.mjs';\nimport { BuildAllOf, CheckAllOf, ErrorAllOf } from './allOf.mjs';\nimport { BuildAnyOf, CheckAnyOf, ErrorAnyOf } from './anyOf.mjs';\nimport { BuildSchemaBoolean, CheckSchemaBoolean, ErrorSchemaBoolean } from './boolean.mjs';\nimport { BuildConst, CheckConst, ErrorConst } from './const.mjs';\nimport { BuildContains, CheckContains, ErrorContains } from './contains.mjs';\nimport { BuildDependencies, CheckDependencies, ErrorDependencies } from './dependencies.mjs';\nimport { BuildDependentRequired, CheckDependentRequired, ErrorDependentRequired } from './dependentRequired.mjs';\nimport { BuildDependentSchemas, CheckDependentSchemas, ErrorDependentSchemas } from './dependentSchemas.mjs';\nimport { BuildDynamicRef, CheckDynamicRef, ErrorDynamicRef } from './dynamicRef.mjs';\nimport { BuildEnum, CheckEnum, ErrorEnum } from './enum.mjs';\nimport { BuildExclusiveMaximum, CheckExclusiveMaximum, ErrorExclusiveMaximum } from './exclusiveMaximum.mjs';\nimport { BuildExclusiveMinimum, CheckExclusiveMinimum, ErrorExclusiveMinimum } from './exclusiveMinimum.mjs';\nimport { BuildFormat, CheckFormat, ErrorFormat } from './format.mjs';\nimport { BuildIf, CheckIf, ErrorIf } from './if.mjs';\nimport { BuildItems, CheckItems, ErrorItems } from './items.mjs';\nimport { BuildMaxContains, CheckMaxContains, ErrorMaxContains } from './maxContains.mjs';\nimport { BuildMaximum, CheckMaximum, ErrorMaximum } from './maximum.mjs';\nimport { BuildMaxItems, CheckMaxItems, ErrorMaxItems } from './maxItems.mjs';\nimport { BuildMaxLength, CheckMaxLength, ErrorMaxLength } from './maxLength.mjs';\nimport { BuildMaxProperties, CheckMaxProperties, ErrorMaxProperties } from './maxProperties.mjs';\nimport { BuildMinContains, CheckMinContains, ErrorMinContains } from './minContains.mjs';\nimport { BuildMinimum, CheckMinimum, ErrorMinimum } from './minimum.mjs';\nimport { BuildMinItems, CheckMinItems, ErrorMinItems } from './minItems.mjs';\nimport { BuildMinLength, CheckMinLength, ErrorMinLength } from './minLength.mjs';\nimport { BuildMinProperties, CheckMinProperties, ErrorMinProperties } from './minProperties.mjs';\nimport { BuildMultipleOf, CheckMultipleOf, ErrorMultipleOf } from './multipleOf.mjs';\nimport { BuildNot, CheckNot, ErrorNot } from './not.mjs';\nimport { BuildOneOf, CheckOneOf, ErrorOneOf } from './oneOf.mjs';\nimport { BuildPattern, CheckPattern, ErrorPattern } from './pattern.mjs';\nimport { BuildPatternProperties, CheckPatternProperties, ErrorPatternProperties } from './patternProperties.mjs';\nimport { BuildPrefixItems, CheckPrefixItems, ErrorPrefixItems } from './prefixItems.mjs';\nimport { BuildProperties, CheckProperties, ErrorProperties } from './properties.mjs';\nimport { BuildPropertyNames, CheckPropertyNames, ErrorPropertyNames } from './propertyNames.mjs';\nimport { BuildRecursiveRef, CheckRecursiveRef, ErrorRecursiveRef } from './recursiveRef.mjs';\nimport { BuildRef, CheckRef, ErrorRef } from './ref.mjs';\nimport { BuildRequired, CheckRequired, ErrorRequired } from './required.mjs';\nimport { BuildType, CheckType, ErrorType } from './type.mjs';\nimport { BuildUnevaluatedItems, CheckUnevaluatedItems, ErrorUnevaluatedItems } from './unevaluatedItems.mjs';\nimport { BuildUnevaluatedProperties, CheckUnevaluatedProperties, ErrorUnevaluatedProperties } from './unevaluatedProperties.mjs';\nimport { BuildUniqueItems, CheckUniqueItems, ErrorUniqueItems } from './uniqueItems.mjs';\n// ----------------------------------------------------------------\n// HasTypeName (Optimization)\n//\n// We only consider a schema as having a type name when the schema \n// has a single type string, or when every element in the type \n// array is the same. For a type array, we must treat multi-variant \n// types as unions and therefore can NOT use an optimized forward \n// type check.\n//\n// ----------------------------------------------------------------\nfunction HasTypeName(schema, typename) {\n    return (Schema.IsType(schema) &&\n        ((G.IsArray(schema.type) &&\n            G.IsGreaterThan(schema.type.length, 0) &&\n            G.Every(schema.type, 0, type => G.IsEqual(type, typename))) ||\n            G.IsEqual(schema.type, typename)));\n}\n// ----------------------------------------------------------------\n// HasObject\n// ----------------------------------------------------------------\nfunction HasObjectType(schema) {\n    return HasTypeName(schema, 'object');\n}\nfunction HasObjectKeywords(schema) {\n    return Schema.IsSchemaObject(schema) && (Schema.IsAdditionalProperties(schema) ||\n        Schema.IsDependencies(schema) ||\n        Schema.IsDependentRequired(schema) ||\n        Schema.IsDependentSchemas(schema) ||\n        Schema.IsProperties(schema) ||\n        Schema.IsPatternProperties(schema) ||\n        Schema.IsPropertyNames(schema) ||\n        Schema.IsMinProperties(schema) ||\n        Schema.IsMaxProperties(schema) ||\n        Schema.IsRequired(schema) ||\n        Schema.IsUnevaluatedProperties(schema));\n}\n// ----------------------------------------------------------------\n// HasArray\n// ----------------------------------------------------------------\nfunction HasArrayType(schema) {\n    return HasTypeName(schema, 'array');\n}\nfunction HasArrayKeywords(schema) {\n    return Schema.IsSchemaObject(schema) && (Schema.IsAdditionalItems(schema) ||\n        Schema.IsItems(schema) ||\n        Schema.IsContains(schema) ||\n        Schema.IsMaxContains(schema) ||\n        Schema.IsMaxItems(schema) ||\n        Schema.IsMinContains(schema) ||\n        Schema.IsMinItems(schema) ||\n        Schema.IsPrefixItems(schema) ||\n        Schema.IsUnevaluatedItems(schema) ||\n        Schema.IsUniqueItems(schema));\n}\n// ----------------------------------------------------------------\n// HasString\n// ----------------------------------------------------------------\nfunction HasStringType(schema) {\n    return HasTypeName(schema, 'string');\n}\nfunction HasStringKeywords(schema) {\n    return Schema.IsSchemaObject(schema) && (Schema.IsMinLength(schema) ||\n        Schema.IsMaxLength(schema) ||\n        Schema.IsFormat(schema) ||\n        Schema.IsPattern(schema));\n}\n// ----------------------------------------------------------------\n// HasNumber\n// ----------------------------------------------------------------\nfunction HasNumberType(schema) {\n    return HasTypeName(schema, 'number') || HasTypeName(schema, 'bigint');\n}\nfunction HasNumberKeywords(schema) {\n    return Schema.IsSchemaObject(schema) && (Schema.IsMinimum(schema) ||\n        Schema.IsMaximum(schema) ||\n        Schema.IsExclusiveMaximum(schema) ||\n        Schema.IsExclusiveMinimum(schema) ||\n        Schema.IsMultipleOf(schema));\n}\n// ----------------------------------------------------------------\n// Build\n// ----------------------------------------------------------------\nexport function BuildSchemaPushStack(stack, context, schema, value) {\n    return context.UseUnevaluated()\n        ? E.And(E.And(context.Push(), BuildSchema(stack, context, schema, value)), context.Pop())\n        : BuildSchema(stack, context, schema, value);\n}\nexport function BuildSchema(stack, context, schema, value) {\n    stack.Push(schema);\n    const conditions = [];\n    if (Schema.IsSchemaBoolean(schema))\n        return BuildSchemaBoolean(stack, context, schema, value);\n    if (Schema.IsType(schema))\n        conditions.push(BuildType(stack, context, schema, value));\n    if (HasObjectKeywords(schema)) {\n        const constraints = [];\n        if (Schema.IsRequired(schema))\n            constraints.push(BuildRequired(stack, context, schema, value));\n        if (Schema.IsAdditionalProperties(schema))\n            constraints.push(BuildAdditionalProperties(stack, context, schema, value));\n        if (Schema.IsDependencies(schema))\n            constraints.push(BuildDependencies(stack, context, schema, value));\n        if (Schema.IsDependentRequired(schema))\n            constraints.push(BuildDependentRequired(stack, context, schema, value));\n        if (Schema.IsDependentSchemas(schema))\n            constraints.push(BuildDependentSchemas(stack, context, schema, value));\n        if (Schema.IsPatternProperties(schema))\n            constraints.push(BuildPatternProperties(stack, context, schema, value));\n        if (Schema.IsProperties(schema))\n            constraints.push(BuildProperties(stack, context, schema, value));\n        if (Schema.IsPropertyNames(schema))\n            constraints.push(BuildPropertyNames(stack, context, schema, value));\n        if (Schema.IsMinProperties(schema))\n            constraints.push(BuildMinProperties(stack, context, schema, value));\n        if (Schema.IsMaxProperties(schema))\n            constraints.push(BuildMaxProperties(stack, context, schema, value));\n        const reduced = E.ReduceAnd(constraints);\n        const guarded = E.Or(E.Not(E.IsObjectNotArray(value)), reduced);\n        conditions.push(HasObjectType(schema) ? reduced : guarded);\n    }\n    if (HasArrayKeywords(schema)) {\n        const constraints = [];\n        if (Schema.IsAdditionalItems(schema))\n            constraints.push(BuildAdditionalItems(stack, context, schema, value));\n        if (Schema.IsContains(schema))\n            constraints.push(BuildContains(stack, context, schema, value));\n        if (Schema.IsItems(schema))\n            constraints.push(BuildItems(stack, context, schema, value));\n        if (Schema.IsMaxContains(schema))\n            constraints.push(BuildMaxContains(stack, context, schema, value));\n        if (Schema.IsMaxItems(schema))\n            constraints.push(BuildMaxItems(stack, context, schema, value));\n        if (Schema.IsMinContains(schema))\n            constraints.push(BuildMinContains(stack, context, schema, value));\n        if (Schema.IsMinItems(schema))\n            constraints.push(BuildMinItems(stack, context, schema, value));\n        if (Schema.IsPrefixItems(schema))\n            constraints.push(BuildPrefixItems(stack, context, schema, value));\n        if (Schema.IsUniqueItems(schema))\n            constraints.push(BuildUniqueItems(stack, context, schema, value));\n        const reduced = E.ReduceAnd(constraints);\n        const guarded = E.Or(E.Not(E.IsArray(value)), reduced);\n        conditions.push(HasArrayType(schema) ? reduced : guarded);\n    }\n    if (HasStringKeywords(schema)) {\n        const constraints = [];\n        if (Schema.IsMaxLength(schema))\n            constraints.push(BuildMaxLength(stack, context, schema, value));\n        if (Schema.IsMinLength(schema))\n            constraints.push(BuildMinLength(stack, context, schema, value));\n        if (Schema.IsFormat(schema))\n            constraints.push(BuildFormat(stack, context, schema, value));\n        if (Schema.IsPattern(schema))\n            constraints.push(BuildPattern(stack, context, schema, value));\n        const reduced = E.ReduceAnd(constraints);\n        const guarded = E.Or(E.Not(E.IsString(value)), reduced);\n        conditions.push(HasStringType(schema) ? reduced : guarded);\n    }\n    if (HasNumberKeywords(schema)) {\n        const constraints = [];\n        if (Schema.IsExclusiveMaximum(schema))\n            constraints.push(BuildExclusiveMaximum(stack, context, schema, value));\n        if (Schema.IsExclusiveMinimum(schema))\n            constraints.push(BuildExclusiveMinimum(stack, context, schema, value));\n        if (Schema.IsMaximum(schema))\n            constraints.push(BuildMaximum(stack, context, schema, value));\n        if (Schema.IsMinimum(schema))\n            constraints.push(BuildMinimum(stack, context, schema, value));\n        if (Schema.IsMultipleOf(schema))\n            constraints.push(BuildMultipleOf(stack, context, schema, value));\n        const reduced = E.ReduceAnd(constraints);\n        const guarded = E.Or(E.Not(E.Or(E.IsNumber(value), E.IsBigInt(value))), reduced);\n        conditions.push(HasNumberType(schema) ? reduced : guarded);\n    }\n    if (Schema.IsRef(schema))\n        conditions.push(BuildRef(stack, context, schema, value));\n    if (Schema.IsRecursiveRef(schema))\n        conditions.push(BuildRecursiveRef(stack, context, schema, value));\n    if (Schema.IsDynamicRef(schema))\n        conditions.push(BuildDynamicRef(stack, context, schema, value));\n    if (Schema.IsConst(schema))\n        conditions.push(BuildConst(stack, context, schema, value));\n    if (Schema.IsEnum(schema))\n        conditions.push(BuildEnum(stack, context, schema, value));\n    if (Schema.IsIf(schema))\n        conditions.push(BuildIf(stack, context, schema, value));\n    if (Schema.IsNot(schema))\n        conditions.push(BuildNot(stack, context, schema, value));\n    if (Schema.IsAllOf(schema))\n        conditions.push(BuildAllOf(stack, context, schema, value));\n    if (Schema.IsAnyOf(schema))\n        conditions.push(BuildAnyOf(stack, context, schema, value));\n    if (Schema.IsOneOf(schema))\n        conditions.push(BuildOneOf(stack, context, schema, value));\n    if (Schema.IsUnevaluatedItems(schema))\n        conditions.push(E.Or(E.Not(E.IsArray(value)), BuildUnevaluatedItems(stack, context, schema, value)));\n    if (Schema.IsUnevaluatedProperties(schema))\n        conditions.push(E.Or(E.Not(E.IsObject(value)), BuildUnevaluatedProperties(stack, context, schema, value)));\n    if (Schema.IsRefine(schema))\n        conditions.push(BuildRefine(stack, context, schema, value));\n    const result = E.ReduceAnd(conditions);\n    stack.Pop(schema);\n    return result;\n}\n// ----------------------------------------------------------------\n// Check\n// ----------------------------------------------------------------\nexport function CheckSchemaPushStack(stack, context, schema, value) {\n    return (context.Push() && CheckSchema(stack, context, schema, value)) && context.Pop();\n}\nexport function CheckSchema(stack, context, schema, value) {\n    stack.Push(schema);\n    const result = Schema.IsSchemaBoolean(schema) ? CheckSchemaBoolean(stack, context, schema, value) : ((!Schema.IsType(schema) || CheckType(stack, context, schema, value)) &&\n        (!(G.IsObject(value) && !G.IsArray(value)) || ((!Schema.IsRequired(schema) || CheckRequired(stack, context, schema, value)) &&\n            (!Schema.IsAdditionalProperties(schema) || CheckAdditionalProperties(stack, context, schema, value)) &&\n            (!Schema.IsDependencies(schema) || CheckDependencies(stack, context, schema, value)) &&\n            (!Schema.IsDependentRequired(schema) || CheckDependentRequired(stack, context, schema, value)) &&\n            (!Schema.IsDependentSchemas(schema) || CheckDependentSchemas(stack, context, schema, value)) &&\n            (!Schema.IsPatternProperties(schema) || CheckPatternProperties(stack, context, schema, value)) &&\n            (!Schema.IsProperties(schema) || CheckProperties(stack, context, schema, value)) &&\n            (!Schema.IsPropertyNames(schema) || CheckPropertyNames(stack, context, schema, value)) &&\n            (!Schema.IsMinProperties(schema) || CheckMinProperties(stack, context, schema, value)) &&\n            (!Schema.IsMaxProperties(schema) || CheckMaxProperties(stack, context, schema, value)))) &&\n        (!G.IsArray(value) || ((!Schema.IsAdditionalItems(schema) || CheckAdditionalItems(stack, context, schema, value)) &&\n            (!Schema.IsContains(schema) || CheckContains(stack, context, schema, value)) &&\n            (!Schema.IsItems(schema) || CheckItems(stack, context, schema, value)) &&\n            (!Schema.IsMaxContains(schema) || CheckMaxContains(stack, context, schema, value)) &&\n            (!Schema.IsMaxItems(schema) || CheckMaxItems(stack, context, schema, value)) &&\n            (!Schema.IsMinContains(schema) || CheckMinContains(stack, context, schema, value)) &&\n            (!Schema.IsMinItems(schema) || CheckMinItems(stack, context, schema, value)) &&\n            (!Schema.IsPrefixItems(schema) || CheckPrefixItems(stack, context, schema, value)) &&\n            (!Schema.IsUniqueItems(schema) || CheckUniqueItems(stack, context, schema, value)))) &&\n        (!G.IsString(value) || ((!Schema.IsMaxLength(schema) || CheckMaxLength(stack, context, schema, value)) &&\n            (!Schema.IsMinLength(schema) || CheckMinLength(stack, context, schema, value)) &&\n            (!Schema.IsFormat(schema) || CheckFormat(stack, context, schema, value)) &&\n            (!Schema.IsPattern(schema) || CheckPattern(stack, context, schema, value)))) &&\n        (!(G.IsNumber(value) || G.IsBigInt(value)) || ((!Schema.IsExclusiveMaximum(schema) || CheckExclusiveMaximum(stack, context, schema, value)) &&\n            (!Schema.IsExclusiveMinimum(schema) || CheckExclusiveMinimum(stack, context, schema, value)) &&\n            (!Schema.IsMaximum(schema) || CheckMaximum(stack, context, schema, value)) &&\n            (!Schema.IsMinimum(schema) || CheckMinimum(stack, context, schema, value)) &&\n            (!Schema.IsMultipleOf(schema) || CheckMultipleOf(stack, context, schema, value)))) &&\n        (!Schema.IsRef(schema) || CheckRef(stack, context, schema, value)) &&\n        (!Schema.IsRecursiveRef(schema) || CheckRecursiveRef(stack, context, schema, value)) &&\n        (!Schema.IsDynamicRef(schema) || CheckDynamicRef(stack, context, schema, value)) &&\n        (!Schema.IsConst(schema) || CheckConst(stack, context, schema, value)) &&\n        (!Schema.IsEnum(schema) || CheckEnum(stack, context, schema, value)) &&\n        (!Schema.IsIf(schema) || CheckIf(stack, context, schema, value)) &&\n        (!Schema.IsNot(schema) || CheckNot(stack, context, schema, value)) &&\n        (!Schema.IsAllOf(schema) || CheckAllOf(stack, context, schema, value)) &&\n        (!Schema.IsAnyOf(schema) || CheckAnyOf(stack, context, schema, value)) &&\n        (!Schema.IsOneOf(schema) || CheckOneOf(stack, context, schema, value)) &&\n        (!Schema.IsUnevaluatedItems(schema) || (!G.IsArray(value) || CheckUnevaluatedItems(stack, context, schema, value))) &&\n        (!Schema.IsUnevaluatedProperties(schema) || (!G.IsObject(value) || CheckUnevaluatedProperties(stack, context, schema, value))) &&\n        (!Schema.IsRefine(schema) || CheckRefine(stack, context, schema, value)));\n    stack.Pop(schema);\n    return result;\n}\n// ----------------------------------------------------------------\n// Error\n// ----------------------------------------------------------------\nexport function ErrorSchemaPushStack(stack, context, schemaPath, instancePath, schema, value) {\n    return (context.Push() && ErrorSchema(stack, context, schemaPath, instancePath, schema, value)) && context.Pop();\n}\nexport function ErrorSchema(stack, context, schemaPath, instancePath, schema, value) {\n    // Optimization: We can safely terminate here when the context is at capacity because we are unable to\n    // append additional errors. It is worth being mindful that logical keywords such as allOf, anyOf,\n    // oneOf pass a new context per operand, so the capacity check applies per context, not across the\n    // full set of errors accumulated by the schema as a whole. (review)\n    if (context.AtCapacity())\n        return false;\n    stack.Push(schema);\n    const result = (Schema.IsSchemaBoolean(schema)) ? ErrorSchemaBoolean(stack, context, schemaPath, instancePath, schema, value) : (!!(+(!Schema.IsType(schema) || ErrorType(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!(G.IsObject(value) && !G.IsArray(value)) || !!(+(!Schema.IsRequired(schema) || ErrorRequired(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsAdditionalProperties(schema) || ErrorAdditionalProperties(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsDependencies(schema) || ErrorDependencies(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsDependentRequired(schema) || ErrorDependentRequired(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsDependentSchemas(schema) || ErrorDependentSchemas(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsPatternProperties(schema) || ErrorPatternProperties(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsProperties(schema) || ErrorProperties(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsPropertyNames(schema) || ErrorPropertyNames(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMinProperties(schema) || ErrorMinProperties(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMaxProperties(schema) || ErrorMaxProperties(stack, context, schemaPath, instancePath, schema, value)))) &\n        +(!G.IsArray(value) || !!(+(!Schema.IsAdditionalItems(schema) || ErrorAdditionalItems(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsContains(schema) || ErrorContains(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsItems(schema) || ErrorItems(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMaxContains(schema) || ErrorMaxContains(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMaxItems(schema) || ErrorMaxItems(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMinContains(schema) || ErrorMinContains(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMinItems(schema) || ErrorMinItems(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsPrefixItems(schema) || ErrorPrefixItems(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsUniqueItems(schema) || ErrorUniqueItems(stack, context, schemaPath, instancePath, schema, value)))) &\n        +(!G.IsString(value) || !!(+(!Schema.IsMaxLength(schema) || ErrorMaxLength(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMinLength(schema) || ErrorMinLength(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsFormat(schema) || ErrorFormat(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsPattern(schema) || ErrorPattern(stack, context, schemaPath, instancePath, schema, value)))) &\n        +(!(G.IsNumber(value) || G.IsBigInt(value)) || !!(+(!Schema.IsExclusiveMaximum(schema) || ErrorExclusiveMaximum(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsExclusiveMinimum(schema) || ErrorExclusiveMinimum(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMaximum(schema) || ErrorMaximum(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMinimum(schema) || ErrorMinimum(stack, context, schemaPath, instancePath, schema, value)) &\n            +(!Schema.IsMultipleOf(schema) || ErrorMultipleOf(stack, context, schemaPath, instancePath, schema, value)))) &\n        +(!Schema.IsRef(schema) || ErrorRef(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsRecursiveRef(schema) || ErrorRecursiveRef(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsDynamicRef(schema) || ErrorDynamicRef(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsConst(schema) || ErrorConst(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsEnum(schema) || ErrorEnum(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsIf(schema) || ErrorIf(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsNot(schema) || ErrorNot(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsAllOf(schema) || ErrorAllOf(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsAnyOf(schema) || ErrorAnyOf(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsOneOf(schema) || ErrorOneOf(stack, context, schemaPath, instancePath, schema, value)) &\n        +(!Schema.IsUnevaluatedItems(schema) || (!G.IsArray(value) || ErrorUnevaluatedItems(stack, context, schemaPath, instancePath, schema, value))) &\n        +(!Schema.IsUnevaluatedProperties(schema) || (!G.IsObject(value) || ErrorUnevaluatedProperties(stack, context, schemaPath, instancePath, schema, value)))) &&\n        (!Schema.IsRefine(schema) || ErrorRefine(stack, context, schemaPath, instancePath, schema, value)));\n    stack.Pop(schema);\n    return result;\n}\n","// deno-fmt-ignore-file\nimport { EmitGuard as E } from '../../guard/index.mjs';\nimport { BuildSchema } from './schema.mjs';\nconst index = [0];\nconst names = new Map;\nconst funcs = new Map();\n// ------------------------------------------------------------------\n// CreateName\n// ------------------------------------------------------------------\nfunction NextName() {\n    return `${index[0]++}`;\n}\nfunction CreateName(schema, href) {\n    if (!names.has(schema))\n        names.set(schema, new Map());\n    const hrefs = names.get(schema);\n    if (hrefs.has(href))\n        return hrefs.get(href);\n    const name = NextName();\n    hrefs.set(href, name);\n    return name;\n}\n// ------------------------------------------------------------------\n// CreateCallExpression\n// ------------------------------------------------------------------\nfunction CreateCallExpression(context, _schema, name, value) {\n    return context.UseUnevaluated()\n        ? E.Call(`check_${name}`, ['context', value])\n        : E.Call(`check_${name}`, [value]);\n}\n// ------------------------------------------------------------------\n// CreateFunctionExpression\n// ------------------------------------------------------------------\nfunction CreateFunctionExpression(stack, context, schema, name) {\n    const expression = BuildSchema(stack, context, schema, 'value');\n    return context.UseUnevaluated()\n        ? E.ConstDeclaration(`check_${name}`, E.ArrowFunction(['context', 'value'], expression))\n        : E.ConstDeclaration(`check_${name}`, E.ArrowFunction(['value'], expression));\n}\n// ------------------------------------------------------------------\n// ResetFunctions\n// ------------------------------------------------------------------\nexport function ResetFunctions() {\n    index[0] = 0;\n    names.clear();\n    funcs.clear();\n}\n// ------------------------------------------------------------------\n// GetFunctions\n// ------------------------------------------------------------------\nexport function GetFunctions() {\n    return [...funcs.values()];\n}\n// ------------------------------------------------------------------\n// CreateFunction\n// ------------------------------------------------------------------\nexport function CreateFunction(stack, context, schema, value) {\n    const name = CreateName(schema, stack.LexicalBaseURL());\n    const call = CreateCallExpression(context, schema, name, value);\n    if (funcs.has(name))\n        return call;\n    funcs.set(name, '');\n    funcs.set(name, CreateFunctionExpression(stack, context, schema, name));\n    return call;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Asserts\n// ------------------------------------------------------------------\nfunction AssertNotRoot(indices) {\n    if (indices.length === 0)\n        throw Error('Cannot set root');\n}\nfunction AssertCanSet(value) {\n    if (!Guard.IsObject(value))\n        throw Error('Cannot set value');\n}\nfunction AssertIndex(index) {\n    if (Guard.IsUnsafePropertyKey(index))\n        throw Error('Pointer contains unsafe property key');\n}\nfunction AssertIndices(indices) {\n    for (const index of indices)\n        AssertIndex(index);\n}\n// ------------------------------------------------------------------\n// Indices\n// ------------------------------------------------------------------\nfunction IsNumericIndex(index) {\n    return /^(0|[1-9]\\d*)$/.test(index);\n}\nfunction TakeIndexRight(indices) {\n    return [\n        indices.slice(0, indices.length - 1),\n        indices.slice(indices.length - 1)[0]\n    ];\n}\nfunction HasIndex(index, value) {\n    return Guard.IsObject(value) && Guard.HasPropertyKey(value, index);\n}\nfunction GetIndex(index, value) {\n    return Guard.IsObject(value) && !Guard.IsUnsafePropertyKey(index) ? value[index] : undefined;\n}\nfunction GetIndices(indices, value) {\n    return indices.reduce((value, index) => GetIndex(index, value), value);\n}\n// ------------------------------------------------------------------\n// Indices\n// ------------------------------------------------------------------\n/** Returns an array of path indices for the given pointer */\nexport function Indices(pointer) {\n    if (Guard.IsEqual(pointer.length, 0))\n        return [];\n    const indices = pointer.split(\"/\").map(index => index.replace(/~1/g, \"/\").replace(/~0/g, \"~\"));\n    return (indices.length > 0 && indices[0] === '') ? indices.slice(1) : indices;\n}\n// ------------------------------------------------------------------\n// Has\n// ------------------------------------------------------------------\n/** Returns true if a value exists at the current pointer */\nexport function Has(value, pointer) {\n    let current = value;\n    return Indices(pointer).every(index => {\n        if (!HasIndex(index, current))\n            return false;\n        current = current[index];\n        return true;\n    });\n}\n// ------------------------------------------------------------------\n// Get\n// ------------------------------------------------------------------\n/** Gets a value at the pointer, or undefined if not exists */\nexport function Get(value, pointer) {\n    const indices = Indices(pointer);\n    return GetIndices(indices, value);\n}\n// ------------------------------------------------------------------\n// Set\n// ------------------------------------------------------------------\n/** Sets a value at the given pointer. May throw if the target value is not indexable */\nexport function Set(value, pointer, next) {\n    const indices = Indices(pointer);\n    AssertNotRoot(indices);\n    AssertIndices(indices);\n    const [head, index] = TakeIndexRight(indices);\n    const parent = GetIndices(head, value);\n    AssertCanSet(parent);\n    parent[index] = next;\n    return value;\n}\n// ------------------------------------------------------------------\n// Delete\n// ------------------------------------------------------------------\n/** Deletes the value at the given pointer. May throw if the target value is not indexable */\nexport function Delete(value, pointer) {\n    const indices = Indices(pointer);\n    AssertNotRoot(indices);\n    AssertIndices(indices);\n    const [head, index] = TakeIndexRight(indices);\n    const parent = GetIndices(head, value);\n    AssertCanSet(parent);\n    if (Guard.IsArray(parent) && IsNumericIndex(index)) {\n        parent.splice(+index, 1);\n    }\n    else {\n        delete parent[index];\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Pointer } from '../pointer/index.mjs';\nimport * as Schema from '../types/index.mjs';\nexport const DefaultBase = 'https://json-schema.org';\n// ------------------------------------------------------------------\n// Find: FindDynamicAnchor\n// ------------------------------------------------------------------\nfunction FindDynamicAnchor(schema, name) {\n    if (Guard.IsObject(schema) && Schema.IsDynamicAnchor(schema) && Guard.IsEqual(schema.$dynamicAnchor, name)) {\n        return schema;\n    }\n    if (Guard.IsObject(schema)) {\n        for (const key of Guard.Keys(schema)) {\n            const result = FindDynamicAnchor(schema[key], name);\n            if (result)\n                return result;\n        }\n    }\n    // (no-coverage) - is it even possible to search for an anchor\n    // with embedded logical schema like allOf, anyOf, etc?\n    // if (Guard.IsArray(schema)) { // (no-coverage)\n    //   for (const item of schema) {\n    //     const result = FindDynamicAnchor(item, name)\n    //     if (result) return result\n    //   }\n    // }\n    return undefined;\n}\n// ------------------------------------------------------------------\n// Find: FindBase\n// ------------------------------------------------------------------\nfunction FindBase(schema, base, target) {\n    if (Guard.IsEqual(schema, target))\n        return base.href;\n    const nextBase = Schema.IsSchemaObject(schema) && Schema.IsId(schema) ? new URL(schema.$id, base.href) : base;\n    if (Guard.IsArray(schema)) {\n        for (const item of schema) {\n            const result = FindBase(item, nextBase, target);\n            if (!Guard.IsUndefined(result))\n                return result;\n        }\n    }\n    else if (Guard.IsObject(schema)) {\n        for (const key of Guard.Keys(schema)) {\n            const result = FindBase(schema[key], nextBase, target);\n            if (!Guard.IsUndefined(result))\n                return result;\n        }\n    }\n    return undefined;\n}\n// ------------------------------------------------------------------\n// Match: MatchId\n// ------------------------------------------------------------------\nfunction MatchId(schema, base, ref) {\n    // ref is a bare fragment naming this schema's $id directly\n    if (Guard.IsEqual(schema.$id, ref.hash))\n        return schema;\n    const absoluteRef = new URL(ref.href, base.href);\n    // ref shares this $id's document, so resolve the fragment within it\n    if (Guard.IsEqual(base.pathname, absoluteRef.pathname))\n        return ref.hash.startsWith('#') ? MatchHash(schema, ref) : schema;\n    return undefined;\n}\n// ------------------------------------------------------------------\n// Match: MatchAnchor\n// ------------------------------------------------------------------\nfunction MatchAnchor(schema, base, ref) {\n    const absoluteAnchor = new URL(`#${schema.$anchor}`, base.href);\n    const absoluteRef = new URL(ref.href, base.href);\n    return Guard.IsEqual(absoluteAnchor.href, absoluteRef.href) ? schema : undefined;\n}\n// ------------------------------------------------------------------\n// Match: MatchDynamicAnchor\n// ------------------------------------------------------------------\nfunction MatchDynamicAnchor(schema, base, ref) {\n    const absoluteAnchor = new URL(`#${schema.$dynamicAnchor}`, base.href);\n    const absoluteRef = new URL(ref.href, base.href);\n    const isMatch = Guard.IsEqual(absoluteAnchor.href, absoluteRef.href);\n    return isMatch ? schema : undefined;\n}\n// ------------------------------------------------------------------\n// Match: MatchHash\n// ------------------------------------------------------------------\nfunction MatchHash(schema, ref) {\n    if (ref.href.endsWith('#'))\n        return schema;\n    if (!ref.hash.startsWith('#'))\n        return undefined;\n    const fragment = decodeURIComponent(ref.hash.slice(1));\n    if (!fragment.startsWith('/'))\n        return undefined;\n    const result = Pointer.Get(schema, fragment);\n    return result;\n}\n// ------------------------------------------------------------------\n// Match: Match\n// ------------------------------------------------------------------\nfunction Match(schema, base, ref) {\n    if (Schema.IsId(schema)) {\n        const result = MatchId(schema, base, ref);\n        if (!Guard.IsUndefined(result))\n            return result;\n    }\n    if (Schema.IsAnchor(schema)) {\n        const result = MatchAnchor(schema, base, ref);\n        if (!Guard.IsUndefined(result))\n            return result;\n    }\n    if (Schema.IsDynamicAnchor(schema)) {\n        const result = MatchDynamicAnchor(schema, base, ref);\n        if (!Guard.IsUndefined(result))\n            return result;\n    }\n    return MatchHash(schema, ref);\n}\n// ------------------------------------------------------------------\n// FromArray\n// ------------------------------------------------------------------\nfunction FromArray(schema, base, ref) {\n    return schema.reduce((result, item) => {\n        const match = FromValue(item, base, ref);\n        return !Guard.IsUndefined(match) ? match : result;\n    }, undefined);\n}\n// ------------------------------------------------------------------\n// FromObject\n// ------------------------------------------------------------------\nfunction SkipProperty(key) {\n    return Guard.IsEqual(key, 'const') || Guard.IsEqual(key, 'enum');\n}\nfunction FromObject(schema, base, ref) {\n    return Guard.Keys(schema).reduce((result, key) => {\n        if (SkipProperty(key))\n            return result;\n        const match = FromValue(schema[key], base, ref);\n        return !Guard.IsUndefined(match) ? match : result;\n    }, undefined);\n}\n// ------------------------------------------------------------------\n// FromValue\n// ------------------------------------------------------------------\nfunction FromValue(schema, base, ref) {\n    const nextBase = Schema.IsSchemaObject(schema) && Schema.IsId(schema) ? new URL(schema.$id, base.href) : base;\n    if (Schema.IsSchemaObject(schema)) {\n        const result = Match(schema, nextBase, ref);\n        if (!Guard.IsUndefined(result))\n            return result;\n    }\n    if (Guard.IsArray(schema))\n        return FromArray(schema, nextBase, ref);\n    if (Guard.IsObject(schema))\n        return FromObject(schema, nextBase, ref);\n    return undefined;\n}\n// ------------------------------------------------------------------\n// Base\n// ------------------------------------------------------------------\nexport function Base(schema, base, target) {\n    return FindBase(schema, new URL(base || '.', DefaultBase), target);\n}\n// ------------------------------------------------------------------\n// Resource\n// ------------------------------------------------------------------\nexport function Resource(context, schema, base, ref) {\n    const result = Ref(context, schema, base, ref, false);\n    return Schema.IsSchemaObject(result) && Schema.IsId(result) ? result : undefined;\n}\n// ------------------------------------------------------------------\n// CanonicalHref\n// ------------------------------------------------------------------\nfunction CanonicalHref(url) {\n    return url.href.split('#')[0];\n}\n// ------------------------------------------------------------------\n// Ref: RefRemote (Phase 1)\n// ------------------------------------------------------------------\nfunction RefContext(context, ref) {\n    return Guard.HasPropertyKey(context, ref) ? context[ref] : undefined;\n}\n// ------------------------------------------------------------------\n// Ref: RefRemote (Phase 2)\n// ------------------------------------------------------------------\nfunction RefLocal(schema, base, ref) {\n    return FromValue(schema, base, ref);\n}\n// ------------------------------------------------------------------\n// Ref: RefRemote (Phase 3)\n// ------------------------------------------------------------------\nfunction RefRemote(context, base, ref) {\n    const canonicalHref = CanonicalHref(ref);\n    if (Guard.IsEqual(canonicalHref, CanonicalHref(base)))\n        return undefined;\n    if (!Guard.HasPropertyKey(context, canonicalHref))\n        return undefined;\n    const remoteSchema = context[canonicalHref];\n    const remoteBase = (Schema.IsSchemaObject(remoteSchema) && Schema.IsId(remoteSchema)) ? new URL(remoteSchema.$id, canonicalHref) : new URL(canonicalHref);\n    const result = Guard.IsEqual(ref.hash, '') ? remoteSchema : FromValue(remoteSchema, remoteBase, ref);\n    return result;\n}\n// ------------------------------------------------------------------\n// RetrievedResource: LegacyRetrievedResource\n//\n// Draft-4 style schemas (no $schema keyword) treat a nested $id as an\n// in-place base URI change rather than a new resource boundary. A\n// local ('#...') ref that lands somewhere with a different base than\n// the current reference base needs a frame so later anchor/pointer\n// resolution is computed against the right base.\n// ------------------------------------------------------------------\nfunction LegacyRetrievedResource(root, lexicalSchema, referenceBase, ref, schema) {\n    if (!ref.$ref.startsWith('#'))\n        return undefined;\n    if (Guard.HasPropertyKey(root, '$schema'))\n        return undefined;\n    const targetBase = Base(lexicalSchema, referenceBase, schema);\n    if (Guard.IsUndefined(targetBase) || Guard.IsEqual(targetBase, referenceBase))\n        return undefined;\n    return { target: schema, base: targetBase, root: lexicalSchema };\n}\n// ------------------------------------------------------------------\n// RetrievedResource: RemoteRetrievedResource\n//\n// The ref's canonical URL names a document already loaded into\n// context. That document becomes the frame's root going forward.\n// ------------------------------------------------------------------\nfunction RemoteRetrievedResource(context, canonical, schema) {\n    const remoteRoot = context[canonical];\n    if (!Schema.IsSchemaObject(remoteRoot))\n        return undefined;\n    return { target: schema, base: canonical, root: remoteRoot };\n}\n// ------------------------------------------------------------------\n// RetrievedResource\n//\n// A genuinely remote document frame always wins over a same-document\n// legacy one: only one frame is ever entered per ref.\n// ------------------------------------------------------------------\nfunction FindRetrievedResource(stackframe, ref, schema, canonical, isRemote) {\n    const remote = isRemote ? RemoteRetrievedResource(stackframe.context, canonical, schema) : undefined;\n    if (!Guard.IsUndefined(remote))\n        return remote;\n    return LegacyRetrievedResource(stackframe.root, stackframe.lexicalSchema, stackframe.referenceBase, ref, schema);\n}\n// ------------------------------------------------------------------\n// ResolvedResource: FindResolvedResource\n//\n// The ref crossed into a different resource but landed on a schema\n// that doesn't itself carry that resource's $id (e.g. a pointer into\n// the middle of a remote document). The enclosing resource still\n// needs to be entered so lexical/base lookups behave as if traversal\n// had walked in from its top.\n// ------------------------------------------------------------------\nfunction FindResolvedResource(context, root, referenceBase, canonical, schema, ids) {\n    if (Schema.IsId(schema))\n        return undefined;\n    const resource = Resource(context, root, referenceBase, canonical);\n    if (!resource || ids.includes(resource))\n        return undefined;\n    return { target: schema, resource };\n}\n// ------------------------------------------------------------------\n// Ref\n// ------------------------------------------------------------------\nexport function Ref(remotes, schema, base, ref, applySchemaId = true) {\n    const initialBase = new URL(base || '.', DefaultBase);\n    const resolvedBase = applySchemaId && Schema.IsId(schema) ? new URL(schema.$id, initialBase) : initialBase;\n    const initialRef = new URL(ref, resolvedBase.href);\n    return RefContext(remotes, ref) ?? RefLocal(schema, resolvedBase, initialRef) ?? RefRemote(remotes, resolvedBase, initialRef);\n}\n// ------------------------------------------------------------------\n// DynamicRef\n// ------------------------------------------------------------------\nexport function DynamicRef(context, root, base, schema, dynamicRef, dynamicAnchors) {\n    const initialBase = new URL(base || '.', DefaultBase);\n    const fragmentRoot = dynamicRef.$dynamicRef.startsWith('#') ? schema : root;\n    const fragmentTarget = Ref(context, fragmentRoot, base, dynamicRef.$dynamicRef, false);\n    if (Guard.IsUndefined(fragmentTarget)) {\n        const fragment = new URL(dynamicRef.$dynamicRef, initialBase).hash;\n        if (!fragment.startsWith('#/') && fragment.startsWith('#')) {\n            const name = decodeURIComponent(fragment.slice(1));\n            const anchorTarget = dynamicAnchors.find((anchor) => Guard.IsEqual(anchor.$dynamicAnchor, name)) ?? FindDynamicAnchor(root, name);\n            return anchorTarget;\n        }\n        return undefined;\n    }\n    if (!Schema.IsSchemaObject(fragmentTarget) || !Schema.IsDynamicAnchor(fragmentTarget))\n        return fragmentTarget;\n    const fragment = new URL(dynamicRef.$dynamicRef, initialBase).hash;\n    if (fragment.startsWith('#/'))\n        return fragmentTarget;\n    const anchorTarget = dynamicAnchors.find((anchor) => Guard.IsEqual(anchor.$dynamicAnchor, fragmentTarget.$dynamicAnchor));\n    return anchorTarget ?? fragmentTarget;\n}\n// ------------------------------------------------------------------\n// ResolveRef\n//\n// Resolves the schema a $ref points to, and describes whether that\n// crossing implies a \"retrieved resource\" frame or entering a\n// resource the target doesn't itself carry the $id for. The caller\n// decides whether and how to record these.\n// ------------------------------------------------------------------\nexport function ResolveRef(stackframe, ref) {\n    const source = stackframe.inRetrievedFrame ? stackframe.lexicalSchema : stackframe.root;\n    const refRoot = ref.$ref.startsWith('#') ? stackframe.lexicalSchema : source;\n    const schema = Ref(stackframe.context, refRoot, stackframe.referenceBase, ref.$ref, false);\n    if (!schema || !Schema.IsSchemaObject(schema))\n        return { schema };\n    const canonical = new URL(ref.$ref, stackframe.referenceBase).href.split('#')[0];\n    const isRemote = !Guard.IsEqual(canonical, stackframe.resourceBase);\n    const retrievedResource = FindRetrievedResource(stackframe, ref, schema, canonical, isRemote);\n    const resolvedResource = isRemote ? FindResolvedResource(stackframe.context, stackframe.root, stackframe.referenceBase, canonical, schema, stackframe.ids) : undefined;\n    return { schema, retrievedResource, resolvedResource };\n}\n// ------------------------------------------------------------------\n// ResolveRecursiveRef\n// ------------------------------------------------------------------\nexport function ResolveRecursiveRef(stackframe, recursiveRef) {\n    const refRoot = Schema.IsRecursiveAnchorTrue(stackframe.lexicalSchema) ? stackframe.recursiveAnchors[0] : stackframe.lexicalSchema;\n    return Ref(stackframe.context, refRoot, stackframe.lexicalBase, recursiveRef.$recursiveRef, false);\n}\n// ------------------------------------------------------------------\n// ResolveDynamicRef\n// ------------------------------------------------------------------\nexport function ResolveDynamicRef(stackframe, dynamicRef) {\n    return DynamicRef(stackframe.context, stackframe.root, stackframe.lexicalBase, stackframe.lexicalSchema, dynamicRef, stackframe.dynamicAnchors);\n}\n","// deno-fmt-ignore-file\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Stack_instances, _Stack_StackFrame, _Stack_ApplyRefResult, _Stack_BuildBase, _Stack_ResourceBaseURL, _Stack_ReferenceBaseURL, _Stack_LexicalSchema, _Stack_RegisterResourceAnchorArray, _Stack_UnregisterResourceAnchorArray, _Stack_RegisterResourceAnchors, _Stack_UnregisterResourceAnchors, _Stack_RegisterResource, _Stack_UnregisterResource, _Stack_EnterResolvedResource, _Stack_ExitResolvedResource;\nimport * as Schema from '../types/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { Resolve } from '../resolve/index.mjs';\n// --------------------------------------------------------------------------\n// Stack\n//\n// Tracks traversal state ($ids, $anchors, stack frames) and applies scope\n// updates. Reference resolution rules ($ref, $dynamicRef) are delegated to\n// the Resolve functions using state snapshots (Resolve.Scope).\n// --------------------------------------------------------------------------\nexport class Stack {\n    constructor(context, schema) {\n        _Stack_instances.add(this);\n        this.context = context;\n        this.schema = schema;\n        this.ids = [];\n        this.resourceIds = [];\n        this.anchors = [];\n        this.recursiveAnchors = [];\n        this.dynamicAnchors = [];\n        this.retrievedResources = new Map();\n        this.retrievedFrames = [];\n        this.resolvedResources = new Map();\n        this.pendingResource = true;\n    }\n    // ----------------------------------------------------------------\n    // LexicalBaseURL\n    // ----------------------------------------------------------------\n    LexicalBaseURL() {\n        return __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_BuildBase).call(this, this.ids);\n    }\n    // ----------------------------------------------------------------\n    // Push\n    // ----------------------------------------------------------------\n    Push(schema) {\n        if (!Schema.IsSchemaObject(schema))\n            return;\n        if (Schema.IsId(schema))\n            __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_RegisterResource).call(this, schema);\n        if (Schema.IsAnchor(schema))\n            this.anchors.push(schema);\n        if (Schema.IsRecursiveAnchorTrue(schema))\n            this.recursiveAnchors.push(schema);\n        if (Schema.IsDynamicAnchor(schema))\n            this.dynamicAnchors.push(schema);\n        const retrievedResource = this.retrievedResources.get(schema);\n        if (retrievedResource) {\n            this.retrievedFrames.push({\n                schema: retrievedResource.root,\n                base: retrievedResource.base,\n                idDepth: this.ids.length,\n                resourceDepth: this.resourceIds.length\n            });\n        }\n    }\n    // ----------------------------------------------------------------\n    // Pop\n    // ----------------------------------------------------------------\n    Pop(schema) {\n        if (!Schema.IsSchemaObject(schema))\n            return;\n        if (Schema.IsId(schema))\n            __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_UnregisterResource).call(this, schema);\n        if (Schema.IsAnchor(schema))\n            this.anchors.pop();\n        if (Schema.IsRecursiveAnchorTrue(schema))\n            this.recursiveAnchors.pop();\n        if (Schema.IsDynamicAnchor(schema))\n            this.dynamicAnchors.pop();\n        if (this.retrievedResources.has(schema))\n            this.retrievedFrames.pop();\n        __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_ExitResolvedResource).call(this, schema);\n    }\n    // ----------------------------------------------------------------\n    // Ref\n    // ----------------------------------------------------------------\n    Ref(ref) {\n        const result = Resolve.ResolveRef(__classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_StackFrame).call(this), ref);\n        __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_ApplyRefResult).call(this, result);\n        return result.schema;\n    }\n    // ----------------------------------------------------------------\n    // RecursiveRef\n    // ----------------------------------------------------------------\n    RecursiveRef(recursiveRef) {\n        const result = Resolve.ResolveRecursiveRef(__classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_StackFrame).call(this), recursiveRef);\n        if (result)\n            this.pendingResource = true;\n        return result;\n    }\n    // ----------------------------------------------------------------\n    // DynamicRef\n    // ----------------------------------------------------------------\n    DynamicRef(dynamicRef) {\n        const result = Resolve.ResolveDynamicRef(__classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_StackFrame).call(this), dynamicRef);\n        if (result)\n            this.pendingResource = true;\n        return result;\n    }\n}\n_Stack_instances = new WeakSet(), _Stack_StackFrame = function _Stack_StackFrame() {\n    return {\n        context: this.context,\n        root: this.schema,\n        ids: this.ids,\n        lexicalSchema: __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_LexicalSchema).call(this),\n        lexicalBase: this.LexicalBaseURL(),\n        referenceBase: __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_ReferenceBaseURL).call(this),\n        resourceBase: __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_ResourceBaseURL).call(this),\n        recursiveAnchors: this.recursiveAnchors,\n        dynamicAnchors: this.dynamicAnchors,\n        inRetrievedFrame: this.retrievedFrames.length > 0\n    };\n}, _Stack_ApplyRefResult = function _Stack_ApplyRefResult(result) {\n    if (!Guard.IsUndefined(result.schema))\n        this.pendingResource = true;\n    if (!Guard.IsUndefined(result.resolvedResource)) {\n        __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_EnterResolvedResource).call(this, result.resolvedResource.target, result.resolvedResource.resource);\n    }\n    if (!Guard.IsUndefined(result.retrievedResource)) {\n        this.retrievedResources.set(result.retrievedResource.target, {\n            base: result.retrievedResource.base,\n            root: result.retrievedResource.root\n        });\n    }\n}, _Stack_BuildBase = function _Stack_BuildBase(stack) {\n    const frame = this.retrievedFrames[this.retrievedFrames.length - 1];\n    const base = frame ? new URL(frame.base) : new URL(Resolve.DefaultBase);\n    const scoped = frame ? stack.slice(frame.idDepth) : stack;\n    return scoped.reduce((result, schema) => new URL(schema.$id, result), base).href;\n}, _Stack_ResourceBaseURL = function _Stack_ResourceBaseURL() {\n    const frame = this.retrievedFrames[this.retrievedFrames.length - 1];\n    if (!frame)\n        return __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_BuildBase).call(this, this.resourceIds);\n    return this.resourceIds.slice(frame.resourceDepth).reduce((result, schema) => new URL(schema.$id, result), new URL(frame.base)).href;\n}, _Stack_ReferenceBaseURL = function _Stack_ReferenceBaseURL() {\n    if (this.retrievedFrames.length > 0)\n        return __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_ResourceBaseURL).call(this);\n    const lexical = this.ids[this.ids.length - 1];\n    if (lexical && !/^[A-Za-z][A-Za-z0-9+.-]*:/.test(lexical.$id))\n        return this.LexicalBaseURL();\n    return __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_ResourceBaseURL).call(this);\n}, _Stack_LexicalSchema = function _Stack_LexicalSchema() {\n    const frame = this.retrievedFrames[this.retrievedFrames.length - 1];\n    if (frame)\n        return this.ids.length > frame.idDepth ? this.ids[this.ids.length - 1] : frame.schema;\n    return this.ids.length > 0 ? this.ids[this.ids.length - 1] : this.schema;\n}, _Stack_RegisterResourceAnchorArray = function _Stack_RegisterResourceAnchorArray(schema) {\n    schema.forEach((schema) => __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_RegisterResourceAnchors).call(this, schema, false));\n}, _Stack_UnregisterResourceAnchorArray = function _Stack_UnregisterResourceAnchorArray(schema) {\n    schema.forEach((schema) => __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_UnregisterResourceAnchors).call(this, schema, false));\n}, _Stack_RegisterResourceAnchors = function _Stack_RegisterResourceAnchors(schema, isRoot = true) {\n    if (Schema.IsSchemaBoolean(schema))\n        return;\n    if (Guard.IsArray(schema))\n        return __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_RegisterResourceAnchorArray).call(this, schema);\n    if (!Schema.IsSchemaObject(schema))\n        return;\n    const current = schema;\n    if (!isRoot && Schema.IsId(current))\n        return;\n    if (!isRoot && Schema.IsDynamicAnchor(current))\n        this.dynamicAnchors.push(current);\n    for (const key of Guard.Keys(current))\n        __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_RegisterResourceAnchors).call(this, current[key], false);\n}, _Stack_UnregisterResourceAnchors = function _Stack_UnregisterResourceAnchors(schema, isRoot = true) {\n    if (Schema.IsSchemaBoolean(schema))\n        return;\n    if (Guard.IsArray(schema))\n        return __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_UnregisterResourceAnchorArray).call(this, schema);\n    if (!Schema.IsSchemaObject(schema))\n        return;\n    const current = schema;\n    if (!isRoot && Schema.IsId(current))\n        return;\n    if (!isRoot && Schema.IsDynamicAnchor(current))\n        this.dynamicAnchors.pop();\n    for (const key of Guard.Keys(current))\n        __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_UnregisterResourceAnchors).call(this, current[key], false);\n}, _Stack_RegisterResource = function _Stack_RegisterResource(schema) {\n    this.ids.push(schema);\n    const isResource = this.pendingResource;\n    this.pendingResource = false;\n    if (isResource)\n        this.resourceIds.push(schema);\n    __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_RegisterResourceAnchors).call(this, schema, true);\n}, _Stack_UnregisterResource = function _Stack_UnregisterResource(schema) {\n    this.ids.pop();\n    const isResource = this.resourceIds.length > 0 && Guard.IsEqual(this.resourceIds[this.resourceIds.length - 1], schema);\n    if (isResource)\n        this.resourceIds.pop();\n    __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_UnregisterResourceAnchors).call(this, schema, true);\n}, _Stack_EnterResolvedResource = function _Stack_EnterResolvedResource(target, resource) {\n    __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_RegisterResource).call(this, resource);\n    this.resolvedResources.set(target, resource);\n}, _Stack_ExitResolvedResource = function _Stack_ExitResolvedResource(target) {\n    if (!this.resolvedResources.has(target))\n        return;\n    const resource = this.resolvedResources.get(target);\n    __classPrivateFieldGet(this, _Stack_instances, \"m\", _Stack_UnregisterResource).call(this, resource);\n    this.resolvedResources.delete(target);\n};\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Arguments } from '../system/arguments/index.mjs';\nimport { Environment } from '../system/environment/index.mjs';\nimport { Hashing } from '../system/hashing/index.mjs';\nimport { Guard } from '../guard/index.mjs';\nimport { Format } from '../format/index.mjs';\nimport * as Engine from './engine/index.mjs';\n// ------------------------------------------------------------------\n// CreateCode\n// ------------------------------------------------------------------\nfunction CreateCode(build) {\n    const functions = build.Functions().join(';\\n');\n    const statements = build.UseUnevaluated()\n        ? ['const context = new CheckContext({}, {})', `return ${build.Entry()}`]\n        : [`return ${build.Entry()}`];\n    return `${functions}; return (value) => { ${statements.join('; ')} }`;\n}\n// ------------------------------------------------------------------\n// CreateEvaluatedCheck\n// ------------------------------------------------------------------\nfunction CreateEvaluatedCheck(build, code) {\n    const factory = Environment.Evaluate('CheckContext', 'Guard', 'Format', 'Hashing', build.External().identifier, code);\n    return factory(Engine.CheckContext, Guard, Format, Hashing, build.External().variables);\n}\n// ------------------------------------------------------------------\n// CreateDynamicCheck\n// ------------------------------------------------------------------\nfunction CreateDynamicCheck(build) {\n    const stack = new Engine.Stack(build.Context(), build.Schema());\n    const context = new Engine.CheckContext();\n    return (value) => Engine.CheckSchema(stack, context, build.Schema(), value);\n}\n// ------------------------------------------------------------------\n// CreateCheck\n// ------------------------------------------------------------------\nfunction CreateCheck(build, code) {\n    return Environment.CanEvaluate()\n        ? CreateEvaluatedCheck(build, code)\n        : CreateDynamicCheck(build);\n}\n// ------------------------------------------------------------------\n// EvaluateResult\n// ------------------------------------------------------------------\nexport class EvaluateResult {\n    constructor(isAccelerated, code, check) {\n        this.isAccelerated = isAccelerated;\n        this.code = code;\n        this.check = check;\n    }\n    IsAccelerated() {\n        return this.isAccelerated;\n    }\n    Code() {\n        return this.code;\n    }\n    Check(value) {\n        return this.check(value);\n    }\n}\n// ------------------------------------------------------------------\n// BuildResult\n// ------------------------------------------------------------------\nexport class BuildResult {\n    constructor(context, schema, external, functions, entry, useUnevaluated) {\n        this.context = context;\n        this.schema = schema;\n        this.external = external;\n        this.functions = functions;\n        this.entry = entry;\n        this.useUnevaluated = useUnevaluated;\n    }\n    /** Returns the Context used for this build */\n    Context() {\n        return this.context;\n    }\n    /** Returns the Schema used for this build */\n    Schema() {\n        return this.schema;\n    }\n    /** Returns true if this build requires a Unevaluated context */\n    UseUnevaluated() {\n        return this.useUnevaluated;\n    }\n    /** Returns external variables */\n    External() {\n        return this.external;\n    }\n    /** Returns check functions */\n    Functions() {\n        return this.functions;\n    }\n    /** Return entry function call. */\n    Entry() {\n        return this.entry;\n    }\n    /** Evaluates the build into a validation function */\n    Evaluate() {\n        const code = CreateCode(this);\n        const check = CreateCheck(this, code);\n        return new EvaluateResult(Environment.CanEvaluate(), code, check);\n    }\n}\n/** Builds a schema into a optimized runtime validator */\nexport function Build(...args) {\n    const [context, schema] = Arguments.Match(args, {\n        2: (context, schema) => [context, schema],\n        1: (schema) => [{}, schema]\n    });\n    Engine.ResetExternal();\n    Engine.ResetFunctions();\n    const stack = new Engine.Stack(context, schema);\n    const build = new Engine.BuildContext(Engine.HasUnevaluated(context, schema));\n    const call = Engine.CreateFunction(stack, build, schema, 'value');\n    const functions = Engine.GetFunctions();\n    const externals = Engine.GetExternal();\n    return new BuildResult(context, schema, externals, functions, call, build.UseUnevaluated());\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../system/arguments/index.mjs';\nimport { Get as GetLocalizationFunction } from '../system/locale/_config.mjs';\nimport * as Engine from './engine/index.mjs';\n/** Returns an array of validation errors for the given value. */\nexport function Errors(...args) {\n    const [context, schema, value] = Arguments.Match(args, {\n        3: (context, schema, value) => [context, schema, value],\n        2: (schema, value) => [{}, schema, value]\n    });\n    const stack = new Engine.Stack(context, schema);\n    const errorContext = new Engine.ErrorContext();\n    const result = Engine.ErrorSchema(stack, errorContext, '#', '', schema, value);\n    const errors = errorContext.GetErrors();\n    const locale = GetLocalizationFunction();\n    const localized = errors.map(error => ({ ...error, message: locale(error) }));\n    return [result, localized];\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Arguments } from '../system/arguments/index.mjs';\nimport * as Engine from './engine/index.mjs';\n/** Checks a value against the provided schema */\nexport function Check(...args) {\n    const [context, schema, value] = Arguments.Match(args, {\n        3: (context, schema, value) => [context, schema, value],\n        2: (schema, value) => [{}, schema, value]\n    });\n    const stack = new Engine.Stack(context, schema);\n    const checkContext = new Engine.CheckContext();\n    return Engine.CheckSchema(stack, checkContext, schema, value);\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { Check as SchemaCheck } from '../../schema/index.mjs';\n/** Checks a value matches the provided type. */\nexport function Check(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value]\n    });\n    return SchemaCheck(context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { Errors as SchemaErrors } from '../../schema/index.mjs';\n/** Returns an array of validation errors for the given value. */\nexport function Errors(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value],\n    });\n    const [_, errors] = SchemaErrors(context, type, value);\n    return errors;\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { Check } from '../check/index.mjs';\nimport { Errors } from '../errors/index.mjs';\n// ------------------------------------------------------------------\n// AssertError\n// ------------------------------------------------------------------\nexport class AssertError extends Error {\n    constructor(source, value, errors) {\n        super(source);\n        Object.defineProperty(this, 'cause', {\n            value: { source, errors, value },\n            writable: false,\n            configurable: false,\n            enumerable: false\n        });\n    }\n}\n/** Asserts the a value matches the given type. This function returns a TypeScript type asserts predicate and will throw AssertError if value does not match. */\nexport function Assert(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value]\n    });\n    const check = Check(context, type, value);\n    if (!check)\n        throw new AssertError('Assert', value, Errors(context, type, value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromArray(context, type, value) {\n    if (!Guard.IsArray(value))\n        return value;\n    return value.map((value) => FromType(context, type.items, value));\n}\n","// deno-fmt-ignore-file\nimport { Ref } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromCyclic(context, type, value) {\n    return FromType({ ...context, ...type.$defs }, Ref(type.$ref), value);\n}\n","// deno-fmt-ignore-file\nimport { Evaluate, Instantiate, IsObject, With } from '../../type/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\n// ------------------------------------------------------------------\n// EvaluateIntersection\n// ------------------------------------------------------------------\nfunction EvaluateIntersection(context, type) {\n    // Note: reinterpret unevaluatedProperties as additionalProperties\n    const additionalProperties = Guard.HasPropertyKey(type, 'unevaluatedProperties')\n        ? { additionalProperties: type.unevaluatedProperties }\n        : {};\n    const instantiated = Instantiate(context, type);\n    const evaluated = Evaluate(instantiated);\n    return IsObject(evaluated)\n        ? With(evaluated, additionalProperties)\n        : evaluated;\n}\n// ------------------------------------------------------------------\n// FromIntersection\n// ------------------------------------------------------------------\nexport function FromIntersect(context, type, value) {\n    // Note: Evaluate and route back to FromType in evaluated form (likely an Object)\n    const evaluated = EvaluateIntersection(context, type);\n    return FromType(context, evaluated, value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nexport function GetAdditionalProperties(type) {\n    const additionalProperties = Guard.HasPropertyKey(type, 'additionalProperties') ? type.additionalProperties : undefined;\n    return additionalProperties;\n}\n","// deno-fmt-ignore-file\nimport { IsSchema } from '../../type/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Check } from '../check/index.mjs';\nimport { GetAdditionalProperties } from './additional.mjs';\n// ------------------------------------------------------------------\n// FromObject\n// ------------------------------------------------------------------\nexport function FromObject(context, type, value) {\n    if (!Guard.IsObject(value) || Guard.IsArray(value))\n        return value;\n    const additionalProperties = GetAdditionalProperties(type);\n    for (const key of Guard.Keys(value)) {\n        if (Guard.HasPropertyKey(type.properties, key)) {\n            value[key] = FromType(context, type.properties[key], value[key]);\n            continue;\n        }\n        const unknownCheck = \n        // 1. additionalProperties: true\n        (Guard.IsBoolean(additionalProperties) && Guard.IsEqual(additionalProperties, true))\n            // 2. additionalProperties: TSchema\n            || IsSchema(additionalProperties) && Check(context, additionalProperties, value[key]);\n        if (unknownCheck) {\n            value[key] = FromType(context, additionalProperties, value[key]);\n            continue;\n        }\n        delete value[key];\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\nimport { IsSchema, RecordPattern, RecordValue } from '../../type/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Check } from '../check/index.mjs';\nimport { GetAdditionalProperties } from './additional.mjs';\n// ------------------------------------------------------------------\n// FromRecord\n// ------------------------------------------------------------------\nexport function FromRecord(context, type, value) {\n    if (!Guard.IsObject(value))\n        return value;\n    const additionalProperties = GetAdditionalProperties(type);\n    const [recordPattern, recordValue] = [new RegExp(RecordPattern(type)), RecordValue(type)];\n    for (const key of Guard.Keys(value)) {\n        if (recordPattern.test(key)) {\n            value[key] = FromType(context, recordValue, value[key]);\n            continue;\n        }\n        const unknownCheck = \n        // 1. additionalProperties: true\n        (Guard.IsBoolean(additionalProperties) && Guard.IsEqual(additionalProperties, true))\n            // 2. additionalProperties: TSchema\n            || IsSchema(additionalProperties) && Check(context, additionalProperties, value[key]);\n        if (unknownCheck) {\n            value[key] = FromType(context, additionalProperties, value[key]);\n            continue;\n        }\n        delete value[key];\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromRef(context, type, value) {\n    return Guard.HasPropertyKey(context, type.$ref)\n        ? FromType(context, context[type.$ref], value)\n        : value;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromTuple(context, schema, value) {\n    if (!Guard.IsArray(value))\n        return value;\n    const length = Math.min(value.length, schema.items.length);\n    for (let index = 0; index < length; index++) {\n        value[index] = FromType(context, schema.items[index], value[index]);\n    }\n    return Guard.IsGreaterThan(value.length, length)\n        ? value.slice(0, length)\n        : value;\n}\n","// deno-fmt-ignore-file\nimport { Clone as SystemClone } from '../../system/memory/clone.mjs';\n// ------------------------------------------------------------------\n// Clone\n// ------------------------------------------------------------------\n/**\n * Returns a Clone of the given value. This function is similar to structuredClone()\n * but also supports deep cloning instances of Map, Set and TypeArray.\n */\nexport function Clone(value) {\n    return SystemClone(value);\n}\n","// deno-fmt-ignore-file\nimport { Check } from '../check/index.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(context, type, value) {\n    for (const schema of type.anyOf) {\n        const clean = FromType(context, schema, Clone(value));\n        if (Check(context, schema, clean))\n            return clean;\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\nimport * as T from '../../type/index.mjs';\nimport { FromArray } from './from_array.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromRecord } from './from_record.mjs';\nimport { FromRef } from './from_ref.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nimport { FromUnion } from './from_union.mjs';\nexport function FromType(context, type, value) {\n    return (T.IsArray(type) ? FromArray(context, type, value) :\n        T.IsCyclic(type) ? FromCyclic(context, type, value) :\n            T.IsIntersect(type) ? FromIntersect(context, type, value) :\n                T.IsObject(type) ? FromObject(context, type, value) :\n                    T.IsRecord(type) ? FromRecord(context, type, value) :\n                        T.IsRef(type) ? FromRef(context, type, value) :\n                            T.IsTuple(type) ? FromTuple(context, type, value) :\n                                T.IsUnion(type) ? FromUnion(context, type, value) :\n                                    value);\n}\n","// deno-fmt-ignore-file\nimport Guard from '../../guard/index.mjs';\nimport { IsArray, Array as _Array_, ArrayOptions } from '../../type/index.mjs';\nimport { IsUnion, Union } from '../../type/index.mjs';\nimport { IsObject, Object as _Object_ } from '../../type/index.mjs';\nimport { IsRecord, Record, RecordKey, RecordValue } from '../../type/index.mjs';\nimport { IsTuple, Tuple } from '../../type/index.mjs';\nimport { IsIntersect, Intersect } from '../../type/index.mjs';\nimport { Priority } from '../../type/index.mjs';\n// ------------------------------------------------------------------\n// Modifiers (Mutable)\n//\n// Prioritized types lose `~modifier` properties and additional constraints\n// (e.g. additionalProperties) during the mapping phase and need to be\n// reassigned afterward. This is a fast mutable assignment to handle that,\n// but we should consider a more general solution. (review)\n//\n// ------------------------------------------------------------------\nfunction Modifiers(type, next) {\n    for (const key of Guard.Keys(type)) {\n        if (Guard.HasPropertyKey(next, key))\n            continue;\n        next[key] = type[key];\n    }\n    return next;\n}\n// ------------------------------------------------------------------\n// Properties\n// ------------------------------------------------------------------\nfunction FromProperties(properties) {\n    const result = {};\n    for (const key of Guard.Keys(properties))\n        result[key] = FromType(properties[key]);\n    return result;\n}\n// ------------------------------------------------------------------\n// PriorityTypes\n// ------------------------------------------------------------------\nfunction FromPriorityTypes(types) {\n    return FromTypes(Priority(types));\n}\n// ------------------------------------------------------------------\n// Types\n// ------------------------------------------------------------------\nfunction FromTypes(types) {\n    return types.map(type => FromType(type));\n}\n// ------------------------------------------------------------------\n// Type\n// ------------------------------------------------------------------\nfunction FromType(type) {\n    const next = (IsArray(type) ? _Array_(FromType(type.items), ArrayOptions(type)) :\n        IsIntersect(type) ? Intersect(FromTypes(type.allOf)) :\n            IsUnion(type) ? Union(FromPriorityTypes(type.anyOf)) :\n                IsObject(type) ? _Object_(FromProperties(type.properties)) :\n                    IsRecord(type) ? Record(RecordKey(type), FromType(RecordValue(type))) :\n                        IsTuple(type) ? Tuple(FromTypes(type.items)) :\n                            type);\n    return Modifiers(type, next);\n}\n// ------------------------------------------------------------------\n// UnionPrioritySort\n// ------------------------------------------------------------------\n/**\n * (Type-Preprocessor) Recursively reorders Union variants from narrowest to broadest, ensuring\n * more specific types (e.g. Literal) are evaluated before broader types (e.g. String). Used\n * prior to Clean, Decode, and Encode operations.\n */\nexport function UnionPrioritySort(type) {\n    const result = FromType(type);\n    return result;\n}\n","import { Arguments, Settings } from '../../system/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { UnionPrioritySort } from '../shared/union_priority_sort.mjs';\n/**\n * Cleans a value by removing non-evaluated properties and elements as derived from the provided type.\n * This function returns unknown so callers should Check the return value before use. This function\n * mutates the provided value. If mutation is not wanted, you should Clone the value before passing\n * to this function.\n */\nexport function Clean(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value]\n    });\n    const sorted = Settings.Get().unionPrioritySort ? UnionPrioritySort(type) : type;\n    return FromType(context, sorted, value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\nexport function IsOk(value) {\n    return Guard.IsObject(value) && Guard.HasPropertyKey(value, 'value');\n}\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\nexport function Ok(value) {\n    return { value };\n}\nexport function Fail() {\n    return undefined;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Ok } from './try_result.mjs';\nexport function TryArray(value) {\n    return Guard.IsArray(value) ? Ok(value) : Ok([value]);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Ok, Fail } from './try_result.mjs';\n// ------------------------------------------------------------------\n// Boolean\n// ------------------------------------------------------------------\nfunction FromBoolean(value) {\n    return Guard.IsEqual(value, true) ? Ok(BigInt(1)) : Ok(BigInt(0));\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\nconst bigintPattern = /^-?(0|[1-9]\\d*)n$/;\nconst decimalPattern = /^-?(0|[1-9]\\d*)\\.\\d+$/;\nconst integerPattern = /^-?(0|[1-9]\\d*)$/;\nfunction IsStringBigIntLike(value) {\n    return bigintPattern.test(value);\n}\nfunction IsStringDecimalLike(value) {\n    return decimalPattern.test(value);\n}\nfunction IsStringIntegerLike(value) {\n    return integerPattern.test(value);\n}\nfunction FromString(value) {\n    const lowercase = value.toLowerCase();\n    return (IsStringBigIntLike(value) ? Ok(BigInt(value.slice(0, value.length - 1))) :\n        IsStringDecimalLike(value) ? Ok(BigInt(value.split('.')[0])) :\n            IsStringIntegerLike(value) ? Ok(BigInt(value)) :\n                Guard.IsEqual(lowercase, 'false') ? Ok(BigInt(0)) :\n                    Guard.IsEqual(lowercase, 'true') ? Ok(BigInt(1)) :\n                        Fail());\n}\n// ------------------------------------------------------------------\n// Try\n// ------------------------------------------------------------------\nexport function TryBigInt(value) {\n    return (Guard.IsBigInt(value) ? Ok(value) :\n        Guard.IsBoolean(value) ? FromBoolean(value) :\n            Guard.IsNumber(value) ? Ok(BigInt(Math.trunc(value))) :\n                Guard.IsNull(value) ? Ok(BigInt(0)) :\n                    Guard.IsString(value) ? FromString(value) :\n                        Guard.IsUndefined(value) ? Ok(BigInt(0)) :\n                            Fail());\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Ok, Fail } from './try_result.mjs';\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\nfunction FromBigInt(value) {\n    return (Guard.IsEqual(value, BigInt(0)) ? Ok(false) :\n        Guard.IsEqual(value, BigInt(1)) ? Ok(true) :\n            Fail());\n}\n// ------------------------------------------------------------------\n// Number\n// ------------------------------------------------------------------\nfunction FromNumber(value) {\n    return (Guard.IsEqual(value, 0) ? Ok(false) :\n        Guard.IsEqual(value, 1) ? Ok(true) :\n            Fail());\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\nfunction FromString(value) {\n    return (Guard.IsEqual(value.toLowerCase(), 'false') ? Ok(false) :\n        Guard.IsEqual(value.toLowerCase(), 'true') ? Ok(true) :\n            Guard.IsEqual(value, '0') ? Ok(false) :\n                Guard.IsEqual(value, '1') ? Ok(true) :\n                    Fail());\n}\n// ------------------------------------------------------------------\n// Try\n// ------------------------------------------------------------------\nexport function TryBoolean(value) {\n    return (Guard.IsBigInt(value) ? FromBigInt(value) :\n        Guard.IsBoolean(value) ? Ok(value) :\n            Guard.IsNumber(value) ? FromNumber(value) :\n                Guard.IsNull(value) ? Ok(false) :\n                    Guard.IsString(value) ? FromString(value) :\n                        Guard.IsUndefined(value) ? Ok(false) :\n                            Fail());\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Ok, Fail } from './try_result.mjs';\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\nfunction FromBigInt(value) {\n    return Guard.IsEqual(value, BigInt(0)) ? Ok(null) : Fail();\n}\n// ------------------------------------------------------------------\n// Boolean\n// ------------------------------------------------------------------\nfunction FromBoolean(value) {\n    return Guard.IsEqual(value, false) ? Ok(null) : Fail();\n}\n// ------------------------------------------------------------------\n// Number\n// ------------------------------------------------------------------\nfunction FromNumber(value) {\n    return Guard.IsEqual(value, 0) ? Ok(null) : Fail();\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\nfunction FromString(value) {\n    const lowercase = value.toLowerCase();\n    const predicate = Guard.IsEqual(lowercase, 'undefined')\n        || Guard.IsEqual(lowercase, 'null')\n        || Guard.IsEqual(value, '')\n        || Guard.IsEqual(value, '0');\n    return predicate ? Ok(null) : Fail();\n}\n// ------------------------------------------------------------------\n// Try\n// ------------------------------------------------------------------\nexport function TryNull(value) {\n    return (Guard.IsBigInt(value) ? FromBigInt(value) :\n        Guard.IsBoolean(value) ? FromBoolean(value) :\n            Guard.IsNumber(value) ? FromNumber(value) :\n                Guard.IsNull(value) ? Ok(null) :\n                    Guard.IsString(value) ? FromString(value) :\n                        Guard.IsUndefined(value) ? Ok(null) :\n                            Fail());\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Ok, Fail, IsOk } from './try_result.mjs';\nimport { TryBigInt } from './try_bigint.mjs';\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\nconst maxBigInt = BigInt(Number.MAX_SAFE_INTEGER);\nconst minBigInt = BigInt(Number.MIN_SAFE_INTEGER);\nfunction FromBigInt(value) {\n    return (value <= maxBigInt && value >= minBigInt) ? Ok(Number(value)) : Fail();\n}\nfunction FromBoolean(value) {\n    return Ok(value ? 1 : 0);\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\nfunction FromString(value) {\n    const coerced = +value;\n    if (Guard.IsNumber(coerced))\n        return Ok(coerced);\n    const lowercase = value.toLowerCase();\n    if (Guard.IsEqual(lowercase, 'false'))\n        return Ok(0);\n    if (Guard.IsEqual(lowercase, 'true'))\n        return Ok(1);\n    const result = TryBigInt(value);\n    if (IsOk(result))\n        return (result.value <= maxBigInt && result.value >= minBigInt) ? Ok(Number(result.value)) : Fail();\n    return Fail();\n}\n// ------------------------------------------------------------------\n// Try\n// ------------------------------------------------------------------\nexport function TryNumber(value) {\n    return (Guard.IsBigInt(value) ? FromBigInt(value) :\n        Guard.IsBoolean(value) ? FromBoolean(value) :\n            Guard.IsNumber(value) ? Ok(value) :\n                Guard.IsNull(value) ? Ok(0) :\n                    Guard.IsString(value) ? FromString(value) :\n                        Guard.IsUndefined(value) ? Ok(0) :\n                            Fail());\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Ok, Fail } from './try_result.mjs';\nexport function TryString(value) {\n    return (Guard.IsBigInt(value) ? Ok(value.toString()) :\n        Guard.IsBoolean(value) ? Ok(value.toString()) :\n            Guard.IsNumber(value) ? Ok(value.toString()) :\n                Guard.IsNull(value) ? Ok('null') :\n                    Guard.IsString(value) ? Ok(value) :\n                        Guard.IsUndefined(value) ? Ok('') :\n                            Fail());\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../../guard/index.mjs';\nimport { Ok, Fail } from './try_result.mjs';\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\nfunction FromBigInt(value) {\n    return Guard.IsEqual(value, BigInt(0)) ? Ok(undefined) : Fail();\n}\n// ------------------------------------------------------------------\n// Boolean\n// ------------------------------------------------------------------\nfunction FromBoolean(value) {\n    return Guard.IsEqual(value, false) ? Ok(undefined) : Fail();\n}\n// ------------------------------------------------------------------\n// Number\n// ------------------------------------------------------------------\nfunction FromNumber(value) {\n    return Guard.IsEqual(value, 0) ? Ok(undefined) : Fail();\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\nfunction FromString(value) {\n    const lowercase = value.toLowerCase();\n    const predicate = Guard.IsEqual(lowercase, 'undefined')\n        || Guard.IsEqual(lowercase, 'null')\n        || Guard.IsEqual(value, '')\n        || Guard.IsEqual(value, '0');\n    return predicate ? Ok(undefined) : Fail();\n}\n// ------------------------------------------------------------------\n// Try\n// ------------------------------------------------------------------\nexport function TryUndefined(value) {\n    return (Guard.IsBigInt(value) ? FromBigInt(value) :\n        Guard.IsBoolean(value) ? FromBoolean(value) :\n            Guard.IsNumber(value) ? FromNumber(value) :\n                Guard.IsNull(value) ? Ok(undefined) :\n                    Guard.IsString(value) ? FromString(value) :\n                        Guard.IsUndefined(value) ? Ok(value) :\n                            Fail());\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { Try } from './try/index.mjs';\nexport function FromArray(context, type, value) {\n    const result = Try.TryArray(value);\n    return result.value.map(value => FromType(context, type.items, value));\n}\n","// deno-fmt-ignore-file\nimport { Try } from './try/index.mjs';\nexport function FromBigInt(_context, _type, value) {\n    const result = Try.TryBigInt(value);\n    return Try.IsOk(result) ? result.value : value;\n}\n","// deno-fmt-ignore-file\nimport { Try } from './try/index.mjs';\nexport function FromBoolean(_context, _type, value) {\n    const result = Try.TryBoolean(value);\n    return Try.IsOk(result) ? result.value : value;\n}\n","// deno-fmt-ignore-file\nimport { Ref } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromCyclic(context, type, value) {\n    return FromType({ ...context, ...type.$defs }, Ref(type.$ref), value);\n}\n","// deno-fmt-ignore-file\nimport { Evaluate } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromEnum(context, type, value) {\n    return FromType(context, Evaluate(type), value);\n}\n","// deno-fmt-ignore-file\nimport { Try } from './try/index.mjs';\nexport function FromInteger(_context, _type, value) {\n    const result = Try.TryNumber(value);\n    return Try.IsOk(result) ? Math.trunc(result.value) : value;\n}\n","// deno-fmt-ignore-file\nimport { Evaluate, Instantiate } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromIntersect(context, type, value) {\n    const instantiated = Instantiate(context, type);\n    const evaluated = Evaluate(instantiated);\n    return FromType(context, evaluated, value);\n}\n","// deno-fmt-ignore-file\nimport { Unreachable } from '../../system/unreachable/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsLiteralBigInt, IsLiteralBoolean, IsLiteralNumber, IsLiteralString } from '../../type/index.mjs';\nimport { Try } from './try/index.mjs';\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\nfunction FromLiteralBigInt(_context, type, value) {\n    const result = Try.TryBigInt(value);\n    return Try.IsOk(result) && Guard.IsEqual(type.const, result.value) ? result.value : value;\n}\n// ------------------------------------------------------------------\n// Boolean\n// ------------------------------------------------------------------\nfunction FromLiteralBoolean(_context, type, value) {\n    const result = Try.TryBoolean(value);\n    return Try.IsOk(result) && Guard.IsEqual(type.const, result.value) ? result.value : value;\n}\n// ------------------------------------------------------------------\n// Number\n// ------------------------------------------------------------------\nfunction FromLiteralNumber(_context, type, value) {\n    const result = Try.TryNumber(value);\n    return Try.IsOk(result) && Guard.IsEqual(type.const, result.value) ? result.value : value;\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\nfunction FromLiteralString(_context, type, value) {\n    const result = Try.TryString(value);\n    return Try.IsOk(result) && Guard.IsEqual(type.const, result.value) ? result.value : value;\n}\n// deno-coverage-ignore-start - unreachable | guarded\nexport function FromLiteral(context, type, value) {\n    if (Guard.IsEqual(type.const, value))\n        return value;\n    return (IsLiteralBigInt(type) ? FromLiteralBigInt(context, type, value) :\n        IsLiteralBoolean(type) ? FromLiteralBoolean(context, type, value) :\n            IsLiteralNumber(type) ? FromLiteralNumber(context, type, value) :\n                IsLiteralString(type) ? FromLiteralString(context, type, value) :\n                    Unreachable());\n}\n// deno-coverage-ignore-stop\n","// deno-fmt-ignore-file\nimport { Try } from './try/index.mjs';\nexport function FromNull(_context, _type, value) {\n    const result = Try.TryNull(value);\n    return Try.IsOk(result) ? result.value : value;\n}\n","// deno-fmt-ignore-file\nimport { Try } from './try/index.mjs';\nexport function FromNumber(_context, _type, value) {\n    const result = Try.TryNumber(value);\n    return Try.IsOk(result) ? result.value : value;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\n/**\n * Used by Object and Record Types. The entries are derived from the known\n * properties obtained from 'properties' and 'patternProperties' respectively.\n */\nexport function FromAdditionalProperties(context, entries, additionalProperties, value) {\n    const keys = Guard.Keys(value);\n    for (const [regexp, _] of entries) {\n        for (const key of keys) {\n            if (!regexp.test(key)) {\n                value[key] = FromType(context, additionalProperties, value[key]);\n            }\n        }\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsOptional } from '../../type/index.mjs';\n// ------------------------------------------------------------------\n// IsOptionalUndefined\n//\n// Indicates whether a key should be excluded from processing when it is \n// defined as optional in the schema and its corresponding value is undefined. \n// This case cannot be reliably distinguished from an omitted key, and therefore \n// introduces ambiguity between a key that is not provided and one that is \n// explicitly assigned an undefined value.\n// ------------------------------------------------------------------\nexport function IsOptionalUndefined(property, key, value) {\n    return IsOptional(property) && Guard.IsUndefined(value[key]);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { FromAdditionalProperties } from './from_additional.mjs';\nimport { IsOptionalUndefined } from '../shared/optional_undefined.mjs';\n// ------------------------------------------------------------------\n// FromProperties\n// ------------------------------------------------------------------\nfunction FromProperties(context, type, value) {\n    const entries = Guard.EntriesRegExp(type.properties);\n    const keys = Guard.Keys(value);\n    for (const [regexp, property] of entries) {\n        for (const key of keys) {\n            // Ignore for non-present or optional-undefined\n            if (!regexp.test(key) || IsOptionalUndefined(property, key, value))\n                continue;\n            value[key] = FromType(context, property, value[key]);\n        }\n    }\n    return (Guard.HasPropertyKey(type, 'additionalProperties') && Guard.IsObject(type.additionalProperties)\n        ? FromAdditionalProperties(context, entries, type.additionalProperties, value)\n        : value);\n}\nexport function FromObject(context, type, value) {\n    return Guard.IsObjectNotArray(value)\n        ? FromProperties(context, type, value)\n        : value;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { FromAdditionalProperties } from './from_additional.mjs';\nfunction FromPatternProperties(context, type, value) {\n    const entries = Guard.EntriesRegExp(type.patternProperties);\n    const keys = Guard.Keys(value);\n    for (const [regexp, schema] of entries) {\n        for (const key of keys) {\n            if (regexp.test(key)) {\n                value[key] = FromType(context, schema, value[key]);\n            }\n        }\n    }\n    return (Guard.HasPropertyKey(type, 'additionalProperties') && Guard.IsObject(type.additionalProperties)\n        ? FromAdditionalProperties(context, entries, type.additionalProperties, value)\n        : value);\n}\nexport function FromRecord(context, type, value) {\n    return Guard.IsObjectNotArray(value)\n        ? FromPatternProperties(context, type, value)\n        : value;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nimport { Guard } from '../../guard/index.mjs';\nexport function FromRef(context, type, value) {\n    return (Guard.HasPropertyKey(context, type.$ref)\n        ? FromType(context, context[type.$ref], value)\n        : value);\n}\n","// deno-fmt-ignore-file\nimport { Try } from './try/index.mjs';\nexport function FromString(_context, _type, value) {\n    const result = Try.TryString(value);\n    return Try.IsOk(result) ? result.value : value;\n}\n","// deno-fmt-ignore-file\nimport { Evaluate } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromTemplateLiteral(context, type, value) {\n    return FromType(context, Evaluate(type), value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromTuple(context, type, value) {\n    if (!Guard.IsArray(value))\n        return value;\n    for (let index = 0; index < Math.min(type.items.length, value.length); index++) {\n        value[index] = FromType(context, type.items[index], value[index]);\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\nimport { Try } from './try/index.mjs';\nexport function FromUndefined(_context, _type, value) {\n    const result = Try.TryUndefined(value);\n    return Try.IsOk(result) ? result.value : value;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Check } from '../check/index.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(context, type, value) {\n    const matched = type.anyOf.some(type => Check(context, type, value));\n    if (matched)\n        return value;\n    const candidates = type.anyOf.map(type => FromType(context, type, Clone(value)));\n    const selected = candidates.find(value => Check(context, type, value));\n    return Guard.IsUndefined(selected) ? value : selected;\n}\n","// deno-fmt-ignore-file\nimport { Try } from './try/index.mjs';\nexport function FromVoid(_context, _type, value) {\n    const result = Try.TryUndefined(value);\n    return Try.IsOk(result) ? (void 0) : value;\n}\n","// deno-fmt-ignore-file\nimport * as Type from '../../type/index.mjs';\nimport { FromArray } from './from_array.mjs';\nimport { FromBigInt } from './from_bigint.mjs';\nimport { FromBoolean } from './from_boolean.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromEnum } from './from_enum.mjs';\nimport { FromInteger } from './from_integer.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromLiteral } from './from_literal.mjs';\nimport { FromNull } from './from_null.mjs';\nimport { FromNumber } from './from_number.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromRecord } from './from_record.mjs';\nimport { FromRef } from './from_ref.mjs';\nimport { FromString } from './from_string.mjs';\nimport { FromTemplateLiteral } from './from_template_literal.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nimport { FromUndefined } from './from_undefined.mjs';\nimport { FromUnion } from './from_union.mjs';\nimport { FromVoid } from './from_void.mjs';\nexport function FromType(context, type, value) {\n    return (Type.IsArray(type) ? FromArray(context, type, value) :\n        Type.IsBigInt(type) ? FromBigInt(context, type, value) :\n            Type.IsBoolean(type) ? FromBoolean(context, type, value) :\n                Type.IsCyclic(type) ? FromCyclic(context, type, value) :\n                    Type.IsEnum(type) ? FromEnum(context, type, value) :\n                        Type.IsInteger(type) ? FromInteger(context, type, value) :\n                            Type.IsIntersect(type) ? FromIntersect(context, type, value) :\n                                Type.IsLiteral(type) ? FromLiteral(context, type, value) :\n                                    Type.IsNull(type) ? FromNull(context, type, value) :\n                                        Type.IsNumber(type) ? FromNumber(context, type, value) :\n                                            Type.IsObject(type) ? FromObject(context, type, value) :\n                                                Type.IsRecord(type) ? FromRecord(context, type, value) :\n                                                    Type.IsRef(type) ? FromRef(context, type, value) :\n                                                        Type.IsString(type) ? FromString(context, type, value) :\n                                                            Type.IsTemplateLiteral(type) ? FromTemplateLiteral(context, type, value) :\n                                                                Type.IsTuple(type) ? FromTuple(context, type, value) :\n                                                                    Type.IsUndefined(type) ? FromUndefined(context, type, value) :\n                                                                        Type.IsUnion(type) ? FromUnion(context, type, value) :\n                                                                            Type.IsVoid(type) ? FromVoid(context, type, value) :\n                                                                                value);\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { FromType } from './from_type.mjs';\n/**\n * Converts a value to the given type, coercing interior values if a reasonable conversion is possible. This\n * function returns unknown so callers should Check the return value before use. This function mutates the\n * provided value. If mutation is not wanted, you should Clone the value before passing to this function.\n */\nexport function Convert(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value],\n    });\n    return FromType(context, type, value);\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromArray(context, type, value) {\n    if (!Guard.IsArray(value))\n        return value;\n    for (let i = 0; i < value.length; i++) {\n        value[i] = FromType(context, type.items, value[i]);\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Ref } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromCyclic(context, type, value) {\n    return FromType({ ...context, ...type.$defs }, Ref(type.$ref), value);\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Clone } from '../clone/index.mjs';\n// ------------------------------------------------------------------\n// FromDefault\n// ------------------------------------------------------------------\nexport function FromDefault(type, value) {\n    // we only use defaults when values are undefined, exit early\n    if (!Guard.IsUndefined(value))\n        return value;\n    return Guard.IsFunction(type.default) ? type.default() : Clone(type.default);\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Evaluate, Instantiate } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromIntersect(context, type, value) {\n    const instantiated = Instantiate(context, type);\n    const evaluated = Evaluate(instantiated);\n    return FromType(context, evaluated, value);\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { IsOptional } from '../../type/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { IsAdditionalProperties } from '../../schema/types/index.mjs';\nexport function FromObject(context, type, value) {\n    if (!Guard.IsObject(value))\n        return value;\n    const knownPropertyKeys = Guard.Keys(type.properties);\n    // Properties\n    for (const key of knownPropertyKeys) {\n        // Resolve Value for Property\n        const propertyValue = FromType(context, type.properties[key], value[key]);\n        // Ambiguious Undefined: If the value is undefined, the type is optional there's no default. ignore.\n        const isUnassignableUndefined = Guard.IsUndefined(propertyValue) && (IsOptional(type.properties[key]) || !Guard.HasPropertyKey(type.properties[key], 'default'));\n        if (isUnassignableUndefined)\n            continue;\n        // Assign\n        value[key] = propertyValue;\n    }\n    // return if not additional properties\n    if (!IsAdditionalProperties(type) || Guard.IsBoolean(type.additionalProperties))\n        return value;\n    // AdditionalProperties\n    for (const key of Guard.Keys(value)) {\n        if (knownPropertyKeys.includes(key))\n            continue;\n        value[key] = FromType(context, type.additionalProperties, value[key]);\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { RecordPattern, RecordValue } from '../../type/index.mjs';\nimport { IsAdditionalProperties, IsDefault } from '../../schema/types/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromRecord(context, type, value) {\n    if (!Guard.IsObject(value))\n        return value;\n    // PatternProperties\n    const [recordKey, recordValue] = [new RegExp(RecordPattern(type)), RecordValue(type)];\n    for (const key of Guard.Keys(value)) {\n        if (!(recordKey.test(key) && IsDefault(recordValue)))\n            continue;\n        value[key] = FromType(context, recordValue, value[key]);\n    }\n    // AdditionalProperties\n    if (!IsAdditionalProperties(type))\n        return value;\n    for (const key of Guard.Keys(value)) {\n        if (recordKey.test(key))\n            continue;\n        value[key] = FromType(context, type.additionalProperties, value[key]);\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromRef(context, type, value) {\n    return Guard.HasPropertyKey(context, type.$ref)\n        ? FromType(context, context[type.$ref], value)\n        : value;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromTuple(context, schema, value) {\n    if (!Guard.IsArray(value))\n        return value;\n    const [items, max] = [schema.items, Math.max(schema.items.length, value.length)];\n    for (let i = 0; i < max; i++) {\n        if (i < items.length)\n            value[i] = FromType(context, items[i], value[i]);\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { Check } from '../check/index.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(context, schema, value) {\n    for (const inner of schema.anyOf) {\n        const result = FromType(context, inner, Clone(value));\n        if (Check(context, inner, result)) {\n            return result;\n        }\n    }\n    return value;\n}\n","// deno-fmt-ignore-file\n// deno-lint-ignore-file\nimport { IsDefault } from '../../schema/index.mjs';\nimport * as T from '../../type/index.mjs';\nimport { FromArray } from './from_array.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromDefault } from './from_default.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromRecord } from './from_record.mjs';\nimport { FromRef } from './from_ref.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nimport { FromUnion } from './from_union.mjs';\nexport function FromType(context, type, value) {\n    const defaulted = IsDefault(type) ? FromDefault(type, value) : value;\n    return (T.IsArray(type) ? FromArray(context, type, defaulted) :\n        T.IsCyclic(type) ? FromCyclic(context, type, defaulted) :\n            T.IsIntersect(type) ? FromIntersect(context, type, defaulted) :\n                T.IsObject(type) ? FromObject(context, type, defaulted) :\n                    T.IsRecord(type) ? FromRecord(context, type, defaulted) :\n                        T.IsRef(type) ? FromRef(context, type, defaulted) :\n                            T.IsTuple(type) ? FromTuple(context, type, defaulted) :\n                                T.IsUnion(type) ? FromUnion(context, type, defaulted) :\n                                    defaulted);\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { FromType } from './from_type.mjs';\n/**\n * Patches missing properties on the value using default annotations specified on the provided type. This\n * function returns unknown so callers should Check the return value before use. This function mutates the\n * provided value. If mutation is not wanted, you should Clone the value before passing to this function.\n */\nexport function Default(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value],\n    });\n    return FromType(context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\n// ------------------------------------------------------------------\n// Pipeline\n// ------------------------------------------------------------------\n/** Creates a value processing pipeline. */\nexport function Pipeline(pipeline) {\n    return (...args) => {\n        const [context, type, value] = Arguments.Match(args, {\n            3: (context, type, value) => [context, type, value],\n            2: (type, value) => [{}, type, value],\n        });\n        return pipeline.reduce((result, func) => func(context, type, result), value);\n    };\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsCodec } from '../../type/index.mjs';\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\nfunction Decode(_context, type, value) {\n    return type['~codec'].decode(value);\n}\n// ------------------------------------------------------------------\n// Encode\n// ------------------------------------------------------------------\nfunction Encode(_context, type, value) {\n    return type['~codec'].encode(value);\n}\n// ------------------------------------------------------------------\n// Callback\n// ------------------------------------------------------------------\nexport function Callback(direction, context, type, value) {\n    if (!IsCodec(type))\n        return value;\n    return Guard.IsEqual(direction, 'Decode')\n        ? Decode(context, type, value)\n        : Encode(context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Callback } from './callback.mjs';\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\nfunction Decode(direction, context, type, value) {\n    if (!Guard.IsArray(value))\n        return value;\n    for (let i = 0; i < value.length; i++) {\n        value[i] = FromType(direction, context, type.items, value[i]);\n    }\n    return Callback(direction, context, type, value);\n}\n// ------------------------------------------------------------------\n// Encode\n// ------------------------------------------------------------------\nfunction Encode(direction, context, type, value) {\n    const exterior = Callback(direction, context, type, value);\n    if (!Guard.IsArray(exterior))\n        return exterior;\n    for (let i = 0; i < exterior.length; i++) {\n        exterior[i] = FromType(direction, context, type.items, exterior[i]);\n    }\n    return exterior;\n}\n// ------------------------------------------------------------------\n// FromArray\n// ------------------------------------------------------------------\nexport function FromArray(direction, context, type, value) {\n    return Guard.IsEqual(direction, 'Decode')\n        ? Decode(direction, context, type, value)\n        : Encode(direction, context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Ref } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Callback } from './callback.mjs';\nexport function FromCyclic(direction, context, type, value) {\n    value = FromType(direction, { ...context, ...type.$defs }, Ref(type.$ref), value);\n    return Callback(direction, context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Callback } from './callback.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { Clean } from '../clean/index.mjs';\n// ------------------------------------------------------------------\n// MergeInteriors\n//\n// Merges all interior operand results into a single object. Each\n// subsequent operand's properties override those of prior operands.\n//\n// ------------------------------------------------------------------\nfunction MergeInteriors(interiors) {\n    return interiors.reduce((results, interior) => ({ ...results, ...interior }), {});\n}\n// ------------------------------------------------------------------\n// NonMatchingInterior\n//\n// Used when Intersect operands do not all produce Objects. Returns\n// the first interior result that differs from the original value,\n// indicating a Codec has transformed the data. If no operand\n// produced a change, defaults to the first interior result.\n//\n// ------------------------------------------------------------------\nfunction NonMatchingInterior(value, interiors) {\n    for (const interior of interiors)\n        if (!Guard.IsDeepEqual(value, interior))\n            return interior;\n    return value; // value-unchanged\n}\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\nfunction Decode(direction, context, type, value) {\n    if (Guard.IsEqual(type.allOf.length, 0))\n        return Callback(direction, context, type, value);\n    const interiors = type.allOf.map((schema) => FromType(direction, context, schema, Clean(schema, Clone(value))));\n    const structural = interiors.every((result) => Guard.IsObject(result));\n    const exterior = structural ? MergeInteriors(interiors) : NonMatchingInterior(value, interiors);\n    return Callback(direction, context, type, exterior);\n}\n// ------------------------------------------------------------------\n// Encode\n// ------------------------------------------------------------------\nfunction Encode(direction, context, type, value) {\n    if (Guard.IsEqual(type.allOf.length, 0))\n        return Callback(direction, context, type, value);\n    const exterior = Callback(direction, context, type, value);\n    const interiors = type.allOf.map((schema) => FromType(direction, context, schema, Clean(schema, Clone(exterior))));\n    const structural = interiors.every((result) => Guard.IsObject(result));\n    if (structural)\n        return MergeInteriors(interiors);\n    return NonMatchingInterior(exterior, interiors);\n}\nexport function FromIntersect(direction, context, type, value) {\n    return Guard.IsEqual(direction, 'Decode') ? Decode(direction, context, type, value) : Encode(direction, context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Callback } from './callback.mjs';\nimport { IsOptionalUndefined } from '../shared/optional_undefined.mjs';\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\nfunction Decode(direction, context, type, value) {\n    if (!Guard.IsObjectNotArray(value))\n        return value;\n    for (const key of Guard.Keys(type.properties)) {\n        // Ignore for non-present or optional-undefined\n        if (!Guard.HasPropertyKey(value, key) || IsOptionalUndefined(type.properties[key], key, value))\n            continue;\n        value[key] = FromType(direction, context, type.properties[key], value[key]);\n    }\n    return Callback(direction, context, type, value);\n}\n// ------------------------------------------------------------------\n// Encode\n// ------------------------------------------------------------------\nfunction Encode(direction, context, type, value) {\n    const exterior = Callback(direction, context, type, value);\n    if (!Guard.IsObjectNotArray(exterior))\n        return exterior;\n    for (const key of Guard.Keys(type.properties)) {\n        // Ignore for non-present or optional-undefined\n        if (!Guard.HasPropertyKey(exterior, key) || IsOptionalUndefined(type.properties[key], key, exterior))\n            continue;\n        exterior[key] = FromType(direction, context, type.properties[key], exterior[key]);\n    }\n    return exterior;\n}\n// ------------------------------------------------------------------\n// FromObject\n// ------------------------------------------------------------------\nexport function FromObject(direction, context, type, value) {\n    return Guard.IsEqual(direction, 'Decode')\n        ? Decode(direction, context, type, value)\n        : Encode(direction, context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { RecordPattern, RecordValue } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Callback } from './callback.mjs';\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\nfunction Decode(direction, context, type, value) {\n    if (!Guard.IsObjectNotArray(value))\n        return value;\n    const regexp = new RegExp(RecordPattern(type));\n    for (const key of Guard.Keys(value)) {\n        if (!regexp.test(key))\n            continue;\n        value[key] = FromType(direction, context, RecordValue(type), value[key]);\n    }\n    return Callback(direction, context, type, value);\n}\n// ------------------------------------------------------------------\n// Encode\n// ------------------------------------------------------------------\nfunction Encode(direction, context, type, value) {\n    const exterior = Callback(direction, context, type, value);\n    if (!Guard.IsObjectNotArray(exterior))\n        return exterior;\n    const regexp = new RegExp(RecordPattern(type));\n    for (const key of Guard.Keys(exterior)) {\n        if (!regexp.test(key))\n            continue;\n        exterior[key] = FromType(direction, context, RecordValue(type), exterior[key]);\n    }\n    return exterior;\n}\nexport function FromRecord(direction, context, type, value) {\n    return Guard.IsEqual(direction, 'Decode')\n        ? Decode(direction, context, type, value)\n        : Encode(direction, context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Callback } from './callback.mjs';\n// ------------------------------------------------------------------\n// ResolveRef\n// ------------------------------------------------------------------\nfunction ResolveRef(direction, context, type, value) {\n    return Guard.HasPropertyKey(context, type.$ref)\n        ? FromType(direction, context, context[type.$ref], value)\n        : value;\n}\n// ------------------------------------------------------------------\n// FromRef\n//\n// Decode and Encode apply the Callback and the referenced type's\n// codec pipeline in opposite orders, since the two operations are\n// inverses of each other.\n//\n// Decode: referenced type resolves first, Callback runs after.\n//   wire value -> resolve $ref -> Callback -> decoded value\n//\n// Encode: Callback runs first, referenced type resolves after.\n//   encoded value -> Callback -> resolve $ref -> wire value\n//\n// ------------------------------------------------------------------\nexport function FromRef(direction, context, type, value) {\n    return Guard.IsEqual(direction, 'Decode')\n        ? Callback(direction, context, type, ResolveRef(direction, context, type, value))\n        : ResolveRef(direction, context, type, Callback(direction, context, type, value));\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Callback } from './callback.mjs';\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\nfunction Decode(direction, context, type, value) {\n    if (!Guard.IsArray(value))\n        return value;\n    for (let i = 0; i < Math.min(type.items.length, value.length); i++) {\n        value[i] = FromType(direction, context, type.items[i], value[i]);\n    }\n    return Callback(direction, context, type, value);\n}\n// ------------------------------------------------------------------\n// Encode\n// ------------------------------------------------------------------\nfunction Encode(direction, context, type, value) {\n    const exterior = Callback(direction, context, type, value);\n    if (!Guard.IsArray(exterior))\n        return value;\n    for (let i = 0; i < Math.min(type.items.length, exterior.length); i++) {\n        exterior[i] = FromType(direction, context, type.items[i], exterior[i]);\n    }\n    return exterior;\n}\nexport function FromTuple(direction, context, type, value) {\n    return Guard.IsEqual(direction, 'Decode')\n        ? Decode(direction, context, type, value)\n        : Encode(direction, context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Callback } from './callback.mjs';\nimport { FromType } from './from_type.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { Check } from '../check/index.mjs';\n// ------------------------------------------------------------------\n// Decode\n// ------------------------------------------------------------------\nfunction Decode(direction, context, type, value) {\n    for (const schema of type.anyOf) {\n        if (!Check(context, schema, value))\n            continue;\n        const variant = FromType(direction, context, schema, value);\n        return Callback(direction, context, type, variant);\n    }\n    return value;\n}\n// ------------------------------------------------------------------\n// Encode\n// ------------------------------------------------------------------\nfunction Encode(direction, context, type, value) {\n    const exterior = Callback(direction, context, type, value);\n    for (const schema of type.anyOf) {\n        const variant = FromType(direction, context, schema, Clone(exterior));\n        if (!Check(context, schema, variant))\n            continue;\n        return variant;\n    }\n    return exterior;\n}\n// ------------------------------------------------------------------\n// FromUnion\n// ------------------------------------------------------------------\nexport function FromUnion(direction, context, type, value) {\n    return Guard.IsEqual(direction, 'Decode')\n        ? Decode(direction, context, type, value)\n        : Encode(direction, context, type, value);\n}\n","// deno-fmt-ignore-file\nimport * as Type from '../../type/index.mjs';\nimport { FromArray } from './from_array.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromRecord } from './from_record.mjs';\nimport { FromRef } from './from_ref.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nimport { FromUnion } from './from_union.mjs';\nimport { Callback } from './callback.mjs';\nexport function FromType(direction, context, type, value) {\n    return (Type.IsArray(type) ? FromArray(direction, context, type, value) :\n        Type.IsCyclic(type) ? FromCyclic(direction, context, type, value) :\n            Type.IsIntersect(type) ? FromIntersect(direction, context, type, value) :\n                Type.IsObject(type) ? FromObject(direction, context, type, value) :\n                    Type.IsRecord(type) ? FromRecord(direction, context, type, value) :\n                        Type.IsRef(type) ? FromRef(direction, context, type, value) :\n                            Type.IsTuple(type) ? FromTuple(direction, context, type, value) :\n                                Type.IsUnion(type) ? FromUnion(direction, context, type, value) :\n                                    Callback(direction, context, type, value));\n}\n","// deno-fmt-ignore-file\nimport { Arguments, Settings } from '../../system/index.mjs';\nimport { AssertError } from '../assert/index.mjs';\nimport { Check } from '../check/index.mjs';\nimport { Errors } from '../errors/index.mjs';\nimport { Clean } from '../clean/index.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { Convert } from '../convert/index.mjs';\nimport { Default } from '../default/index.mjs';\nimport { Pipeline } from '../pipeline/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { UnionPrioritySort } from '../shared/union_priority_sort.mjs';\n// ------------------------------------------------------------------\n// Assert\n// ------------------------------------------------------------------\nexport class DecodeError extends AssertError {\n    constructor(value, errors) {\n        super('Decode', value, errors);\n    }\n}\nfunction Assert(context, type, value) {\n    if (!Check(context, type, value))\n        throw new DecodeError(value, Errors(context, type, value));\n    return value;\n}\n// ------------------------------------------------------------------\n// DecodeUnsafe\n// ------------------------------------------------------------------\n/** Executes Decode callbacks only */\nexport function DecodeUnsafe(context, type, value) {\n    const sorted = Settings.Get().unionPrioritySort ? UnionPrioritySort(type) : type;\n    return FromType('Decode', context, sorted, value);\n}\n// ------------------------------------------------------------------\n// Decoder\n// ------------------------------------------------------------------\nconst Decoder = Pipeline([\n    (_context, _type, value) => Clone(value),\n    (context, type, value) => Default(context, type, value),\n    (context, type, value) => Convert(context, type, value),\n    (context, type, value) => Clean(context, type, value),\n    (context, type, value) => Assert(context, type, value),\n    (context, type, value) => DecodeUnsafe(context, type, value)\n]);\n/** Decodes a value with the given type. */\nexport function Decode(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value],\n    });\n    return Decoder(context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Arguments, Settings } from '../../system/index.mjs';\nimport { AssertError } from '../assert/index.mjs';\nimport { Check } from '../check/index.mjs';\nimport { Errors } from '../errors/index.mjs';\nimport { Clean } from '../clean/index.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { Convert } from '../convert/index.mjs';\nimport { Default } from '../default/index.mjs';\nimport { Pipeline } from '../pipeline/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { UnionPrioritySort } from '../shared/union_priority_sort.mjs';\n// ------------------------------------------------------------------\n// Assert\n// ------------------------------------------------------------------\nexport class EncodeError extends AssertError {\n    constructor(value, errors) {\n        super('Encode', value, errors);\n    }\n}\nfunction Assert(context, type, value) {\n    if (!Check(context, type, value))\n        throw new EncodeError(value, Errors(context, type, value));\n    return value;\n}\n// ------------------------------------------------------------------\n// EncodeUnsafe\n// ------------------------------------------------------------------\n/** Executes Encode callbacks only */\nexport function EncodeUnsafe(context, type, value) {\n    const sorted = Settings.Get().unionPrioritySort ? UnionPrioritySort(type) : type;\n    return FromType('Encode', context, sorted, value);\n}\n// ------------------------------------------------------------------\n// Encoder\n// ------------------------------------------------------------------\nconst Encoder = Pipeline([\n    (_context, _type, value) => Clone(value),\n    (context, type, value) => EncodeUnsafe(context, type, value),\n    (context, type, value) => Default(context, type, value),\n    (context, type, value) => Convert(context, type, value),\n    (context, type, value) => Clean(context, type, value),\n    (context, type, value) => Assert(context, type, value),\n]);\n/** Encodes a value with the given type. */\nexport function Encode(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value],\n    });\n    return Encoder(context, type, value);\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsCodec } from '../../type/index.mjs';\nimport { IsArray } from '../../type/index.mjs';\nimport { IsCyclic } from '../../type/index.mjs';\nimport { IsIntersect } from '../../type/index.mjs';\nimport { IsObject } from '../../type/index.mjs';\nimport { IsRecord, RecordValue } from '../../type/index.mjs';\nimport { IsRef, Ref } from '../../type/index.mjs';\nimport { IsTuple } from '../../type/index.mjs';\nimport { IsUnion } from '../../type/index.mjs';\n// ------------------------------------------------------------------\n// Array\n// ------------------------------------------------------------------\nfunction FromArray(context, type) {\n    return IsCodec(type) || FromType(context, type.items);\n}\n// ------------------------------------------------------------------\n// Cyclic\n// ------------------------------------------------------------------\nfunction FromCyclic(context, type) {\n    return IsCodec(type) || FromRef({ ...context, ...type.$defs }, Ref(type.$ref));\n}\n// ------------------------------------------------------------------\n// Intersect\n// ------------------------------------------------------------------\nfunction FromIntersect(context, type) {\n    return IsCodec(type) || type.allOf.some((type) => FromType(context, type));\n}\n// ------------------------------------------------------------------\n// Object\n// ------------------------------------------------------------------\nfunction FromObject(context, type) {\n    return IsCodec(type) || Guard.Keys(type.properties).some(key => {\n        return FromType(context, type.properties[key]);\n    });\n}\n// ------------------------------------------------------------------\n// Record\n// ------------------------------------------------------------------\nfunction FromRecord(context, type) {\n    return IsCodec(type) || FromType(context, RecordValue(type));\n}\n// ------------------------------------------------------------------\n// Ref\n// ------------------------------------------------------------------\nfunction FromRef(context, type) {\n    if (visited.has(type.$ref))\n        return false;\n    visited.add(type.$ref);\n    return IsCodec(type) || (Guard.HasPropertyKey(context, type.$ref)\n        && FromType(context, context[type.$ref]));\n}\n// ------------------------------------------------------------------\n// Tuple\n// ------------------------------------------------------------------\nfunction FromTuple(context, type) {\n    return IsCodec(type) || type.items.some(type => FromType(context, type));\n}\n// ------------------------------------------------------------------\n// Union\n// ------------------------------------------------------------------\nfunction FromUnion(context, type) {\n    return IsCodec(type) || type.anyOf.some(type => FromType(context, type));\n}\n// ------------------------------------------------------------------\n// Type\n// ------------------------------------------------------------------\nfunction FromType(context, type) {\n    return (IsArray(type) ? FromArray(context, type) :\n        IsCyclic(type) ? FromCyclic(context, type) :\n            IsIntersect(type) ? FromIntersect(context, type) :\n                IsObject(type) ? FromObject(context, type) :\n                    IsRecord(type) ? FromRecord(context, type) :\n                        IsRef(type) ? FromRef(context, type) :\n                            IsTuple(type) ? FromTuple(context, type) :\n                                IsUnion(type) ? FromUnion(context, type) :\n                                    IsCodec(type));\n}\n// ------------------------------------------------------------------\n// Visited\n// ------------------------------------------------------------------\nconst visited = new Set();\n/** Returns true if this type contains a Codec */\nexport function HasCodec(...args) {\n    const [context, type] = Arguments.Match(args, {\n        2: (context, type) => [context, type],\n        1: (type) => [{}, type]\n    });\n    visited.clear();\n    return FromType(context, type);\n}\n","// deno-fmt-ignore-file\nexport class CreateError extends Error {\n    constructor(type, message) {\n        super(message);\n        this.type = type;\n    }\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { Clone } from '../clone/index.mjs';\nexport function FromDefault(_context, schema) {\n    return Guard.IsFunction(schema.default)\n        ? schema.default(schema)\n        : Guard.IsObject(schema.default)\n            ? Clone(schema.default)\n            : schema.default;\n}\n","// deno-fmt-ignore-file\nimport { IsUniqueItems, IsDefault, IsMinItems } from '../../schema/types/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { CreateError } from './error.mjs';\nexport function FromArray(context, type) {\n    if (IsUniqueItems(type) && !IsDefault(type))\n        throw new CreateError(type, 'Arrays with uniqueItems constraints must specify a default annotation');\n    const length = IsMinItems(type) ? type.minItems : 0;\n    return Array.from({ length }, () => FromType(context, type.items));\n}\n","// deno-fmt-ignore-file\nimport { IsExclusiveMinimum, IsMinimum } from '../../schema/types/index.mjs';\nexport function FromBigInt(_context, type) {\n    return (IsExclusiveMinimum(type) ? BigInt(type.exclusiveMinimum) + BigInt(1) :\n        IsMinimum(type) ? BigInt(type.minimum) :\n            BigInt(0));\n}\n","// deno-fmt-ignore-file\nexport function FromBoolean(_context, _type) {\n    return false;\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nexport function FromConstructor(context, type) {\n    const instanceType = FromType(context, type.instanceType);\n    return class {\n        constructor() {\n            Object.assign(this, instanceType);\n        }\n    };\n}\n","// deno-fmt-ignore-file\nimport { Ref } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromCyclic(context, type) {\n    return FromType({ ...context, ...type.$defs }, Ref(type.$ref));\n}\n","// deno-fmt-ignore-file\nimport { Evaluate } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromEnum(context, type) {\n    return FromType(context, Evaluate(type));\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nexport function FromFunction(context, type) {\n    const returnType = FromType(context, type.returnType);\n    return () => returnType;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsExclusiveMinimum, IsMinimum } from '../../schema/types/index.mjs';\nexport function FromInteger(_context, type) {\n    return ((IsExclusiveMinimum(type) && Guard.IsNumber(type.exclusiveMinimum)) ? type.exclusiveMinimum + 1 :\n        IsMinimum(type) ? type.minimum :\n            0);\n}\n","// deno-fmt-ignore-file\nimport { Evaluate, Instantiate } from '../../type/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromIntersect(context, type) {\n    const instantiated = Instantiate(context, type);\n    const evaluated = Evaluate(instantiated);\n    return FromType(context, evaluated);\n}\n","// deno-fmt-ignore-file\nexport function FromLiteral(_context, type) {\n    return type.const;\n}\n","// deno-fmt-ignore-file\nimport { CreateError } from './error.mjs';\nexport function FromNever(_context, type) {\n    throw new CreateError(type, 'Cannot create TNever types');\n}\n","// deno-fmt-ignore-file\nexport function FromNull(_context, _type) {\n    return null;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsExclusiveMinimum, IsMinimum } from '../../schema/types/index.mjs';\nexport function FromNumber(_context, type) {\n    return (IsExclusiveMinimum(type) && Guard.IsNumber(type.exclusiveMinimum) ? type.exclusiveMinimum + 1 :\n        IsMinimum(type) ? type.minimum :\n            0);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromObject(context, type) {\n    const required = Guard.IsUndefined(type.required) ? [] : type.required;\n    return required.reduce((result, key) => {\n        return { ...result, [key]: FromType(context, type.properties[key]) };\n    }, {});\n}\n","// deno-fmt-ignore-file\nimport { IsMinProperties, IsDefault } from '../../schema/types/index.mjs';\nimport { CreateError } from './error.mjs';\nexport function FromRecord(_context, type) {\n    if (IsMinProperties(type) && !IsDefault(type))\n        throw new CreateError(type, 'Record with the minProperties constraint must have a default annotation');\n    return {};\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { CreateError } from './error.mjs';\nexport function FromRef(context, type) {\n    return Guard.HasPropertyKey(context, type.$ref)\n        ? FromType(context, context[type.$ref])\n        : (() => { throw new CreateError(type, 'Unable to deref Ref'); })();\n}\n","// deno-fmt-ignore-file\nimport { IsPattern, IsFormat, IsDefault, IsMinLength } from '../../schema/types/index.mjs';\nexport function FromString(_context, type) {\n    const needsDefault = (IsPattern(type) || IsFormat(type)) && !IsDefault(type);\n    if (needsDefault)\n        throw Error('Strings with format or pattern constraints must specify default');\n    const minLength = IsMinLength(type) ? type.minLength : 0;\n    return ''.padEnd(minLength);\n}\n","// deno-fmt-ignore-file\nexport function FromSymbol(_context, _type) {\n    return Symbol();\n}\n","// deno-fmt-ignore-file\nimport { IsString } from '../../type/index.mjs';\nimport { TemplateLiteralDecode } from '../../type/engine/template_literal/index.mjs';\nimport { FromType } from './from_type.mjs';\nimport { CreateError } from './error.mjs';\nexport function FromTemplateLiteral(context, type) {\n    const decoded = TemplateLiteralDecode(type.pattern);\n    if (IsString(decoded))\n        throw new CreateError(type, 'Unable to create TemplateLiteral due to infinite type expansion');\n    return FromType(context, decoded);\n}\n","// deno-fmt-ignore-file\nimport { FromType } from './from_type.mjs';\nexport function FromTuple(context, type) {\n    return Array.from({ length: type.minItems }, (_, i) => FromType(context, type.items[i]));\n}\n","// deno-fmt-ignore-file\nexport function FromUndefined(_context, _type) {\n    return undefined;\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { FromType } from './from_type.mjs';\nexport function FromUnion(context, type) {\n    if (Guard.IsEqual(type.anyOf.length, 0)) {\n        throw Error('Unable to create Union with no variants');\n    }\n    return FromType(context, type.anyOf[0]);\n}\n","// deno-fmt-ignore-file\nexport function FromVoid(_context, _type) {\n    return void 0;\n}\n","// deno-fmt-ignore-file\nimport * as T from '../../type/index.mjs';\nimport * as S from '../../schema/types/index.mjs';\nimport { FromDefault } from './from_default.mjs';\nimport { FromArray } from './from_array.mjs';\nimport { FromBigInt } from './from_bigint.mjs';\nimport { FromBoolean } from './from_boolean.mjs';\nimport { FromConstructor } from './from_constructor.mjs';\nimport { FromCyclic } from './from_cyclic.mjs';\nimport { FromEnum } from './from_enum.mjs';\nimport { FromFunction } from './from_function.mjs';\nimport { FromInteger } from './from_integer.mjs';\nimport { FromIntersect } from './from_intersect.mjs';\nimport { FromLiteral } from './from_literal.mjs';\nimport { FromNever } from './from_never.mjs';\nimport { FromNull } from './from_null.mjs';\nimport { FromNumber } from './from_number.mjs';\nimport { FromObject } from './from_object.mjs';\nimport { FromRecord } from './from_record.mjs';\nimport { FromRef } from './from_ref.mjs';\nimport { FromString } from './from_string.mjs';\nimport { FromSymbol } from './from_symbol.mjs';\nimport { FromTemplateLiteral } from './from_template_literal.mjs';\nimport { FromTuple } from './from_tuple.mjs';\nimport { FromUndefined } from './from_undefined.mjs';\nimport { FromUnion } from './from_union.mjs';\nimport { FromVoid } from './from_void.mjs';\nexport function FromType(context, type) {\n    return (\n    // -----------------------------------------------------\n    // Default\n    // -----------------------------------------------------\n    S.IsDefault(type) ? FromDefault(context, type) :\n        // -----------------------------------------------------\n        // Types\n        // -----------------------------------------------------\n        T.IsArray(type) ? FromArray(context, type) :\n            T.IsBigInt(type) ? FromBigInt(context, type) :\n                T.IsBoolean(type) ? FromBoolean(context, type) :\n                    T.IsConstructor(type) ? FromConstructor(context, type) :\n                        T.IsCyclic(type) ? FromCyclic(context, type) :\n                            T.IsEnum(type) ? FromEnum(context, type) :\n                                T.IsFunction(type) ? FromFunction(context, type) :\n                                    T.IsInteger(type) ? FromInteger(context, type) :\n                                        T.IsIntersect(type) ? FromIntersect(context, type) :\n                                            T.IsLiteral(type) ? FromLiteral(context, type) :\n                                                T.IsNever(type) ? FromNever(context, type) :\n                                                    T.IsNull(type) ? FromNull(context, type) :\n                                                        T.IsNumber(type) ? FromNumber(context, type) :\n                                                            T.IsObject(type) ? FromObject(context, type) :\n                                                                T.IsRecord(type) ? FromRecord(context, type) :\n                                                                    T.IsRef(type) ? FromRef(context, type) :\n                                                                        T.IsString(type) ? FromString(context, type) :\n                                                                            T.IsSymbol(type) ? FromSymbol(context, type) :\n                                                                                T.IsTemplateLiteral(type) ? FromTemplateLiteral(context, type) :\n                                                                                    T.IsTuple(type) ? FromTuple(context, type) :\n                                                                                        T.IsUndefined(type) ? FromUndefined(context, type) :\n                                                                                            T.IsUnion(type) ? FromUnion(context, type) :\n                                                                                                T.IsVoid(type) ? FromVoid(context, type) :\n                                                                                                    undefined);\n}\n","// deno-fmt-ignore-file\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { FromType } from './from_type.mjs';\n/** Creates a value from the provided type. This function will use `default` annotations if present. */\nexport function Create(...args) {\n    const [context, type] = Arguments.Match(args, {\n        2: (context, type) => [context, type],\n        1: (type) => [{}, type],\n    });\n    return FromType(context, type);\n}\n","// deno-fmt-ignore-file\nimport { Settings } from '../../system/system.mjs';\nimport { Arguments } from '../../system/arguments/index.mjs';\nimport { AssertError } from '../assert/index.mjs';\nimport { Check } from '../check/index.mjs';\nimport { Errors } from '../errors/index.mjs';\nimport { Clean } from '../clean/index.mjs';\nimport { Clone } from '../clone/index.mjs';\nimport { Convert } from '../convert/index.mjs';\nimport { Default } from '../default/index.mjs';\nimport { Pipeline } from '../pipeline/index.mjs';\n// ------------------------------------------------------------------\n// Assert\n// ------------------------------------------------------------------\nexport class ParseError extends AssertError {\n    constructor(value, errors) {\n        super('Parse', value, errors);\n    }\n}\nfunction Assert(context, type, value) {\n    if (!Check(context, type, value))\n        throw new ParseError(value, Errors(context, type, value));\n    return value;\n}\n// ------------------------------------------------------------------\n// Parser\n// ------------------------------------------------------------------\nexport const Parser = Pipeline([\n    (_context, _type, value) => Clone(value),\n    (context, type, value) => Default(context, type, value),\n    (context, type, value) => Convert(context, type, value),\n    (context, type, value) => Clean(context, type, value),\n    (context, type, value) => Assert(context, type, value)\n]);\n/**  Parses a value with the given type. */\nexport function Parse(...args) {\n    const [context, type, value] = Arguments.Match(args, {\n        3: (context, type, value) => [context, type, value],\n        2: (type, value) => [{}, type, value],\n    });\n    const checked = Check(context, type, value);\n    if (checked)\n        return value;\n    if (Settings.Get().correctiveParse)\n        return Parser(context, type, value);\n    throw new ParseError(value, Errors(context, type, value));\n}\n","// deno-fmt-ignore-file\nimport * as T from '../../type/index.mjs';\nexport const Insert = T.Object({\n    type: T.Literal('insert'),\n    path: T.String(),\n    value: T.Unknown(),\n});\nexport const Update = Object({\n    type: T.Literal('update'),\n    path: T.String(),\n    value: T.Unknown(),\n});\nexport const Delete = T.Object({\n    type: T.Literal('delete'),\n    path: T.String(),\n});\nexport const Edit = T.Union([Insert, Update, Delete]);\n","/** Error codes callers see (guide table). A refused or aborted reload keeps the code of its cause. */\nexport const CHORD_ERROR_CODES = [\n    \"aborted\",\n    \"contract_mismatch\",\n    \"forbidden\",\n    \"gone\",\n    \"invalid\",\n    \"not_in_variant\",\n    \"not_ready\",\n    \"released\",\n    \"superseded\",\n    \"unavailable\",\n    \"upgrade_conflict\",\n    \"upgrade_required\",\n];\nconst RETRYABLE = new Set([\"superseded\", \"upgrade_conflict\"]);\nexport class ChordError extends Error {\n    code;\n    reason;\n    retryable;\n    details;\n    constructor(code, message, options) {\n        super(`${code}${options?.reason ? `/${options.reason}` : \"\"}: ${message}`, {\n            cause: options?.cause,\n        });\n        this.name = \"ChordError\";\n        this.code = code;\n        this.reason = options?.reason;\n        this.retryable = RETRYABLE.has(code);\n        this.details = options?.details;\n    }\n}\nexport const isChordError = (error, code) => error instanceof ChordError && (code === undefined || error.code === code);\n/** For factories and methods refusing a principal: `throw forbidden()`. */\nexport const forbidden = (message = \"forbidden\") => new ChordError(\"forbidden\", message);\nexport const invalid = (reason, message, details) => new ChordError(\"invalid\", message, { reason, details });\n/** Keeps a ChordError's code; anything else becomes `unavailable` with the original as cause. */\nexport const asChordError = (error, context) => error instanceof ChordError\n    ? error\n    : new ChordError(\"unavailable\", `${context}: ${error instanceof Error ? error.message : String(error)}`, {\n        cause: error,\n    });\n/** Runs every step, then throws one error, or an AggregateError when several failed. */\nexport async function runAll(steps, message) {\n    const errors = [];\n    for (const step of steps) {\n        try {\n            await step();\n        }\n        catch (error) {\n            errors.push(error);\n        }\n    }\n    if (errors.length === 1)\n        throw errors[0];\n    if (errors.length > 1)\n        throw new AggregateError(errors, message);\n}\n//# sourceMappingURL=errors.js.map","import { Value } from \"typebox/value\";\nimport { invalid } from \"./errors.js\";\nconst asSchema = (schema) => schema !== null && typeof schema === \"object\" ? schema : schema === false ? { not: {} } : {};\n/** Canonical JSON: sorted object keys, `undefined` members dropped. */\nexport function canonicalJson(value) {\n    if (value === null || typeof value !== \"object\")\n        return JSON.stringify(value) ?? \"null\";\n    if (Array.isArray(value))\n        return `[${value.map((item) => canonicalJson(item)).join(\",\")}]`;\n    const keys = Object.keys(value)\n        .filter((key) => value[key] !== undefined)\n        .sort();\n    return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(value[key])}`).join(\",\")}}`;\n}\n/** Non-cryptographic 64-bit hash (two FNV-1a lanes). Contracts are trusted, so collisions are not an attack surface. */\nexport function hash64(text) {\n    let a = 0x811c9dc5;\n    let b = 0x01000193 ^ 0x5bd1e995;\n    for (let index = 0; index < text.length; index++) {\n        const code = text.charCodeAt(index);\n        a = Math.imul(a ^ code, 0x01000193);\n        b = Math.imul(b ^ code, 0x5bd1e995) ^ (b >>> 13);\n    }\n    return (a >>> 0).toString(16).padStart(8, \"0\") + (b >>> 0).toString(16).padStart(8, \"0\");\n}\nexport function deepEqual(a, b) {\n    return a === b || canonicalJson(a) === canonicalJson(b);\n}\n/** Throws `invalid` (with `reason`) and the first schema errors when `value` does not match. */\nexport function assertValid(reason, what, schema, value) {\n    if (Value.Check(schema, value))\n        return;\n    const errors = [...Value.Errors(schema, value)].slice(0, 3);\n    const summary = errors.map((error) => `${error.instancePath || \"/\"} ${error.message}`).join(\"; \");\n    throw invalid(reason, `${what}: ${summary}`, errors);\n}\n/** Applies defaults, strips unknown fields, validates. Returns a fresh value. */\nexport function normalize(schema, value, what) {\n    const normalized = Value.Clean(schema, Value.Default(schema, Value.Clone(value ?? {})));\n    assertValid(\"input\", what, schema, normalized);\n    return normalized;\n}\n/** Canonical identity of a normalized value: fields equal to their schema default are omitted. */\nexport function canonicalIdentity(schema, value) {\n    return canonicalJson(stripDefaults(asSchema(schema), value));\n}\nfunction stripDefaults(schema, value) {\n    if (Array.isArray(value)) {\n        const items = schema.items;\n        if (Array.isArray(items))\n            return value.map((item, index) => stripDefaults(asSchema(items[index]), item));\n        return value.map((item) => stripDefaults(asSchema(items), item));\n    }\n    if (value === null || typeof value !== \"object\")\n        return value;\n    const properties = asSchema(schema.properties);\n    const result = {};\n    for (const [key, item] of Object.entries(value)) {\n        const property = asSchema(properties[key]);\n        if (\"default\" in property && deepEqual(property.default, item))\n            continue;\n        result[key] = stripDefaults(property, item);\n    }\n    return result;\n}\nconst CONSTRAINTS = [\n    \"minLength\",\n    \"maxLength\",\n    \"pattern\",\n    \"format\",\n    \"minimum\",\n    \"maximum\",\n    \"exclusiveMinimum\",\n    \"exclusiveMaximum\",\n    \"multipleOf\",\n    \"minItems\",\n    \"maxItems\",\n    \"uniqueItems\",\n    \"minProperties\",\n    \"maxProperties\",\n];\nconst typesOf = (schema) => typeof schema.type === \"string\" ? [schema.type] : Array.isArray(schema.type) ? schema.type : undefined;\n/** Keywords `fits` reasons about. Any other validation keyword in the provider's schema forces exact equality. */\nconst KNOWN = new Set([\n    ...CONSTRAINTS,\n    \"type\",\n    \"properties\",\n    \"required\",\n    \"additionalProperties\",\n    \"patternProperties\",\n    \"items\",\n    \"additionalItems\",\n    \"const\",\n    \"enum\",\n    \"anyOf\",\n    \"parameters\",\n    \"returnType\",\n]);\n/** Annotations: no effect on validity. */\nconst ANNOTATIONS = new Set([\n    \"title\",\n    \"description\",\n    \"default\",\n    \"examples\",\n    \"$id\",\n    \"$schema\",\n    \"$comment\",\n    \"readOnly\",\n    \"writeOnly\",\n    \"deprecated\",\n]);\nconst withoutAnnotations = (schema) => Object.fromEntries(Object.entries(schema).filter(([key]) => !ANNOTATIONS.has(key)));\n/**\n * Conservative structural subtyping: true only if every value valid under `sub` is valid under `sup`, where object\n * fields missing from `sub` but optional in `sup` count as fine (unknown fields are stripped at the provider, see\n * `RecordImpl.call`). A provider schema using a keyword this function does not model (`not`, `allOf`, `contains`,\n * `$ref`, ...) or an `additionalProperties` schema only fits an identical consumer schema.\n */\nexport function fits(subSchema, supSchema) {\n    const sub = withoutAnnotations(asSchema(subSchema));\n    const sup = withoutAnnotations(asSchema(supSchema));\n    if (Object.keys(sup).length === 0)\n        return true;\n    if (deepEqual(sub, sup))\n        return true;\n    if (Object.keys(sup).some((key) => !KNOWN.has(key)))\n        return false;\n    if (sup.additionalProperties !== undefined && typeof sup.additionalProperties !== \"boolean\")\n        return false;\n    if (Array.isArray(sub.anyOf))\n        return sub.anyOf.every((branch) => fits(branch, sup));\n    if (Array.isArray(sup.anyOf))\n        return sup.anyOf.some((branch) => fits(sub, branch));\n    if (\"const\" in sup)\n        return \"const\" in sub && deepEqual(sub.const, sup.const);\n    if (Array.isArray(sup.enum)) {\n        const values = \"const\" in sub ? [sub.const] : Array.isArray(sub.enum) ? sub.enum : undefined;\n        return values?.every((item) => sup.enum.some((allowed) => deepEqual(allowed, item))) ?? false;\n    }\n    for (const key of CONSTRAINTS)\n        if (key in sup && !deepEqual(sub[key], sup[key]))\n            return false;\n    const supTypes = typesOf(sup);\n    const subTypes = typesOf(sub);\n    if (supTypes === undefined || subTypes === undefined)\n        return false;\n    if (!subTypes.every((type) => supTypes.includes(type) || (type === \"integer\" && supTypes.includes(\"number\")))) {\n        return false;\n    }\n    if (\"const\" in sub || Array.isArray(sub.enum))\n        return true;\n    if (subTypes.includes(\"object\") && !objectFits(sub, sup))\n        return false;\n    if (subTypes.includes(\"array\") && !arrayFits(sub, sup))\n        return false;\n    if (subTypes.includes(\"function\"))\n        return functionFits(sub, sup);\n    return true;\n}\nfunction objectFits(sub, sup) {\n    const subProperties = asSchema(sub.properties);\n    const supProperties = asSchema(sup.properties);\n    const subRequired = new Set(sub.required ?? []);\n    for (const key of sup.required ?? [])\n        if (!subRequired.has(key))\n            return false;\n    for (const [key, property] of Object.entries(supProperties)) {\n        if (key in subProperties) {\n            if (!fits(subProperties[key], property))\n                return false;\n        }\n        else if (typeof sub.additionalProperties === \"object\" && !fits(sub.additionalProperties, property)) {\n            // The consumer may send this name with any value its `additionalProperties` allows. Open consumer objects\n            // are fine: unknown names are stripped with the consumer's own schema before the call (`RecordImpl.call`).\n            return false;\n        }\n    }\n    if (sup.additionalProperties === false) {\n        if (sub.additionalProperties !== false)\n            return false;\n        if (Object.keys(subProperties).some((key) => !(key in supProperties)))\n            return false;\n    }\n    const supPatterns = asSchema(sup.patternProperties);\n    if (Object.keys(supPatterns).length > 0) {\n        // Every value the consumer may put under a matching name must fit, and the consumer must not allow arbitrary\n        // extra names (it would then allow any value under a matching one).\n        const subPatterns = asSchema(sub.patternProperties);\n        if (sub.additionalProperties !== false && Object.keys(subPatterns).length === 0)\n            return false;\n        for (const [pattern, property] of Object.entries(supPatterns)) {\n            const matcher = new RegExp(pattern, \"u\");\n            for (const [key, subProperty] of Object.entries(subProperties)) {\n                if (!(key in supProperties) && matcher.test(key) && !fits(subProperty, property))\n                    return false;\n            }\n            if (Object.keys(subPatterns).length > 0 &&\n                (!(pattern in subPatterns) || !fits(subPatterns[pattern], property))) {\n                return false;\n            }\n        }\n        for (const pattern of Object.keys(subPatterns))\n            if (!(pattern in supPatterns))\n                return false;\n    }\n    return true;\n}\nfunction arrayFits(sub, sup) {\n    if (Array.isArray(sup.items)) {\n        if (!Array.isArray(sub.items) || sub.items.length !== sup.items.length)\n            return false;\n        return sub.items.every((item, index) => fits(item, sup.items[index]));\n    }\n    if (Array.isArray(sub.items))\n        return sub.items.every((item) => fits(item, sup.items));\n    return fits(sub.items, sup.items);\n}\nfunction functionFits(sub, sup) {\n    const subParameters = sub.parameters ?? [];\n    const supParameters = sup.parameters ?? [];\n    // A function accepting fewer parameters is fine; each shared parameter is contravariant.\n    if (subParameters.length > supParameters.length)\n        return false;\n    if (!subParameters.every((parameter, index) => fits(supParameters[index], parameter)))\n        return false;\n    return fits(sub.returnType, sup.returnType);\n}\n//# sourceMappingURL=schema.js.map","import { Type } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport { ChordError, invalid } from \"./errors.js\";\nimport { canonicalJson, fits, hash64 } from \"./schema.js\";\nconst MEMBER = Symbol(\"chord.member\");\nexport function method(args, result) {\n    return { [MEMBER]: \"method\", args, result };\n}\n/** A native in-process object identified by `name@version` (local contracts only). */\nexport const opaque = (id) => {\n    if (!/^[^@\\s]+@\\d+$/.test(id))\n        throw new TypeError(`opaque id must be name@version: ${id}`);\n    return { [MEMBER]: \"opaque\", id };\n};\n/** Objects of the type live on the host named `name` (`hostNamed(\"server\")`). */\nexport function hostNamed(name) {\n    if (typeof name !== \"string\" || name === \"\")\n        throw new TypeError(\"hostNamed needs a host name\");\n    return { name };\n}\n/**\n * Objects of the type live on `prefix` + the value of the input's string field `key`: `hostFamily(\"session:\",\n * \"session\")` puts `{ session: \"S1\", … }` on `session:S1`. The field is required and must be a non-empty string.\n */\nexport function hostFamily(prefix, key) {\n    if (typeof prefix !== \"string\" || prefix === \"\")\n        throw new TypeError(\"hostFamily needs a host-name prefix\");\n    if (typeof key !== \"string\" || key === \"\")\n        throw new TypeError(\"hostFamily needs an input field name\");\n    return { prefix, key };\n}\n/** The host an object of `placement` with this (normalized) input lives on. Throws `invalid/placement`. */\nexport function resolveHost(typeName, placement, input) {\n    if (\"name\" in placement)\n        return placement.name;\n    const value = input !== null && typeof input === \"object\" ? input[placement.key] : undefined;\n    if (typeof value !== \"string\" || value === \"\")\n        throw invalid(\"placement\", `${typeName}: input field ${placement.key} names no host`);\n    return placement.prefix + value;\n}\n/** Whether the host named `hostName` may serve a type of `placement`. */\nexport const placedOn = (placement, hostName) => \"name\" in placement\n    ? placement.name === hostName\n    : hostName.startsWith(placement.prefix) && hostName.length > placement.prefix.length;\nexport const placementText = (placement) => \"name\" in placement ? placement.name : `${placement.prefix}<${placement.key}>`;\n// A description travels as a reference's contract token (wire.ts), so it is declared once, as the schema that validates it.\n// `TSchema` is an empty interface: any object is one, which is all a peer's schema is checked for here.\nconst SchemaObject = Type.Unsafe(Type.Object({}));\nconst MemberDescriptionSchema = Type.Union([\n    // Absent `args`: the method takes none. Absent `result`: it returns nothing.\n    Type.Object({\n        kind: Type.Literal(\"method\"),\n        args: Type.Optional(SchemaObject),\n        result: Type.Optional(SchemaObject),\n    }),\n    Type.Object({ kind: Type.Literal(\"state\"), schema: SchemaObject }),\n    Type.Object({ kind: Type.Literal(\"opaque\"), id: Type.String() }),\n]);\n/** Local contracts have one unnamed variant. */\nexport const LOCAL_VARIANT = \"\";\nconst PlacementSchema = Type.Union([\n    Type.Object({ name: Type.String({ minLength: 1 }) }, { additionalProperties: false }),\n    Type.Object({ prefix: Type.String({ minLength: 1 }), key: Type.String({ minLength: 1 }) }, { additionalProperties: false }),\n]);\nexport const DescriptionSchema = Type.Object({\n    name: Type.String({ minLength: 1 }),\n    scope: Type.Union([Type.Literal(\"remote\"), Type.Literal(\"local\")]),\n    version: Type.Integer(),\n    input: SchemaObject,\n    /** Remote types only (required there): where their objects live. */\n    host: Type.Optional(PlacementSchema),\n    variants: Type.Record(Type.String(), Type.Record(Type.String(), MemberDescriptionSchema)),\n});\n/** Names a reference uses itself; members may not use them. */\nexport const RESERVED_MEMBERS = new Set([\n    \"variant\",\n    \"status\",\n    \"ready\",\n    \"shape\",\n    \"error\",\n    \"onShape\",\n    \"onStatus\",\n    \"release\",\n    \"then\",\n    \"contract\",\n]);\nfunction describeMember(name, member, scope) {\n    if (RESERVED_MEMBERS.has(name))\n        throw new TypeError(`member name is reserved: ${name}`);\n    const brand = member[MEMBER];\n    if (brand === \"method\") {\n        const spec = member;\n        return {\n            kind: \"method\",\n            ...(spec.args === undefined ? {} : { args: spec.args }),\n            ...(spec.result === undefined ? {} : { result: spec.result }),\n        };\n    }\n    if (brand === \"opaque\") {\n        if (scope === \"remote\")\n            throw new TypeError(`remote contracts cannot expose opaque members: ${name}`);\n        return { kind: \"opaque\", id: member.id };\n    }\n    return { kind: \"state\", schema: member };\n}\nfunction finish(contract) {\n    return { ...contract, fingerprint: hash64(canonicalJson(contract.description)) };\n}\nfunction checkHeader(name, version) {\n    if (!name)\n        throw new TypeError(\"contract name is empty\");\n    if (!Number.isInteger(version) || version < 1)\n        throw new TypeError(`contract version must be a positive integer`);\n}\nexport function remote(name, def) {\n    checkHeader(name, def.version);\n    const placement = def.host;\n    if (placement === undefined || !Value.Check(PlacementSchema, placement))\n        throw new TypeError(`remote contract ${name} needs \\`host\\`: hostNamed(…) or hostFamily(…)`);\n    // A JSON copy: the description travels, and a placement object may carry nothing else.\n    const host = \"name\" in placement ? { name: placement.name } : { prefix: placement.prefix, key: placement.key };\n    const variants = {};\n    if (Object.keys(def.variants).length === 0)\n        throw new TypeError(`remote contract ${name} has no variants`);\n    for (const [kind, variant] of Object.entries(def.variants)) {\n        const members = {};\n        for (const [key, schema] of Object.entries(variant.state ?? {}))\n            members[key] = describeMember(key, schema, \"remote\");\n        for (const [key, spec] of Object.entries(variant.methods ?? {})) {\n            if (key in members)\n                throw new TypeError(`member ${key} is both state and method in ${name}.${kind}`);\n            members[key] = describeMember(key, spec, \"remote\");\n            if (members[key].kind !== \"method\")\n                throw new TypeError(`methods.${key} is not a method()`);\n        }\n        variants[kind] = members;\n    }\n    const description = { name, scope: \"remote\", version: def.version, input: def.input, host, variants };\n    return finish({\n        scope: \"remote\",\n        name,\n        version: def.version,\n        input: def.input,\n        def,\n        description,\n    });\n}\nexport function local(name, def) {\n    checkHeader(name, def.version);\n    const members = {};\n    for (const [key, member] of Object.entries(def.members ?? {}))\n        members[key] = describeMember(key, member, \"local\");\n    const description = {\n        name,\n        scope: \"local\",\n        version: def.version,\n        input: def.input,\n        variants: { [LOCAL_VARIANT]: members },\n    };\n    return finish({ scope: \"local\", name, version: def.version, input: def.input, def, description });\n}\n/**\n * A consumer token received over a link (only its description travels). Has no `def`, so it is only good for binding\n * and validation, never for TypeScript types.\n */\nexport function contractFromDescription(description) {\n    const { name, scope, version, input, host } = description;\n    if (typeof name !== \"string\" ||\n        (scope !== \"remote\" && scope !== \"local\") ||\n        !Number.isInteger(version) ||\n        (scope === \"remote\") !== (host !== undefined)) {\n        throw new ChordError(\"invalid\", \"malformed contract token\", { reason: \"token\" });\n    }\n    const base = { name, version, input, description, fingerprint: hash64(canonicalJson(description)) };\n    return scope === \"remote\"\n        ? { ...base, scope, def: { version, input, host: host, variants: {} } }\n        : { ...base, scope, def: { version, input } };\n}\n/** Returns why `provider` does not cover `consumer`, or undefined when it does. */\nexport function coverage(provider, consumer) {\n    if (provider.name !== consumer.name || provider.scope !== consumer.scope)\n        return \"different type\";\n    if (!samePlacement(provider, consumer))\n        return \"host\";\n    if (!fits(consumer.input, provider.input))\n        return \"input\";\n    for (const [kind, consumerMembers] of Object.entries(consumer.variants)) {\n        const providerMembers = provider.variants[kind];\n        if (providerMembers === undefined)\n            return `variant ${kind} missing`;\n        for (const [name, wanted] of Object.entries(consumerMembers)) {\n            const offered = providerMembers[name];\n            if (offered === undefined || offered.kind !== wanted.kind)\n                return `${kind}.${name} missing or of another kind`;\n            if (offered.kind === \"method\" && wanted.kind === \"method\") {\n                // Both take arguments or neither does; a consumer that expects no result accepts any.\n                if ((wanted.args === undefined) !== (offered.args === undefined))\n                    return `${kind}.${name} arguments`;\n                if (wanted.args !== undefined && offered.args !== undefined && !fits(wanted.args, offered.args))\n                    return `${kind}.${name} arguments`;\n                if (wanted.result !== undefined && (offered.result === undefined || !fits(offered.result, wanted.result)))\n                    return `${kind}.${name} result`;\n            }\n            else if (offered.kind === \"state\" && wanted.kind === \"state\") {\n                if (!fits(offered.schema, wanted.schema))\n                    return `${kind}.${name} state`;\n            }\n            else if (offered.kind === \"opaque\" && wanted.kind === \"opaque\" && offered.id !== wanted.id) {\n                return `${kind}.${name} opaque ${offered.id} != ${wanted.id}`;\n            }\n        }\n    }\n    return undefined;\n}\nconst samePlacement = (a, b) => canonicalJson(a.host ?? null) === canonicalJson(b.host ?? null);\nconst placementOf = (description) => description.host === undefined ? \"(local)\" : placementText(description.host);\n/** How a consumer token binds to a provider: directly or through an `accepts` adapter. Throws contract_mismatch. */\nexport function bind(provider, accepts, consumer) {\n    if (provider.fingerprint === consumer.fingerprint)\n        return undefined;\n    // A moved type is another type for its consumers: no adapter reaches across hosts.\n    if (!samePlacement(provider.description, consumer.description)) {\n        throw new ChordError(\"contract_mismatch\", `${provider.name} lives on ${placementOf(provider.description)}, the consumer expects ${placementOf(consumer.description)}`);\n    }\n    if (provider.version === consumer.version) {\n        const reason = coverage(provider.description, consumer.description);\n        if (reason === undefined)\n            return undefined;\n        throw new ChordError(\"contract_mismatch\", `${provider.name}@${provider.version} does not cover the consumer's description (${reason}); forgotten version bump?`);\n    }\n    const adapter = accepts?.[consumer.version];\n    if (adapter === undefined) {\n        throw new ChordError(\"contract_mismatch\", `${provider.name}: provider version ${provider.version}, consumer version ${consumer.version}, no accepts adapter`);\n    }\n    return adapter;\n}\n/** Whether `contract`'s method `name` takes no arguments (it is called as `ref.name(ctx)`). */\nexport function takesNoArgs(contract, name) {\n    for (const members of Object.values(contract.description.variants)) {\n        const member = members[name];\n        if (member?.kind === \"method\")\n            return member.args === undefined;\n    }\n    return false;\n}\n//# sourceMappingURL=contract.js.map","import { overlap, RESERVED_SEGMENTS } from \"./index.js\";\nconst DEFAULT_OVERLAP_SCAN = 65_536;\nconst MAX_DELTA_OPERATIONS = 4_096;\nconst overflowedBatches = new WeakSet();\nconst emitOperation = (operations, operation) => {\n    if (overflowedBatches.has(operations))\n        return;\n    if (operations.length >= MAX_DELTA_OPERATIONS) {\n        overflowedBatches.add(operations);\n        return;\n    }\n    operations.push(operation);\n};\nconst isContainer = (value) => value !== null && typeof value === \"object\";\nconst emitSet = (path, value, operations) => {\n    if (path.length === 0)\n        emitOperation(operations, [\"r\", value]);\n    else\n        emitOperation(operations, [\"s\", path, value]);\n};\nconst equalJson = (left, right) => {\n    if (left === right)\n        return true;\n    if (!isContainer(left) || !isContainer(right) || Array.isArray(left) !== Array.isArray(right))\n        return false;\n    if (Array.isArray(left)) {\n        const other = right;\n        if (left.length !== other.length)\n            return false;\n        for (let index = 0; index < left.length; index++) {\n            if (!equalJson(left[index], other[index]))\n                return false;\n        }\n        return true;\n    }\n    const other = right;\n    const keys = Object.keys(left);\n    if (keys.length !== Object.keys(other).length)\n        return false;\n    for (const key of keys) {\n        if (!Object.hasOwn(other, key) || !equalJson(left[key], other[key]))\n            return false;\n    }\n    return true;\n};\nconst permutation = (before, after) => {\n    if (before.length !== after.length)\n        return undefined;\n    const positions = new Map();\n    for (let index = 0; index < before.length; index++) {\n        const value = before[index];\n        const entry = positions.get(value);\n        if (entry === undefined)\n            positions.set(value, { indices: [index], used: 0 });\n        else\n            entry.indices.push(index);\n    }\n    const result = new Array(after.length);\n    for (let index = 0; index < after.length; index++) {\n        const entry = positions.get(after[index]);\n        if (entry === undefined || entry.used === entry.indices.length)\n            return undefined;\n        result[index] = entry.indices[entry.used++];\n    }\n    return result;\n};\nconst emitString = (before, after, path, operations) => {\n    if (before === after)\n        return;\n    if (after.length > before.length && after.slice(0, before.length) === before) {\n        emitOperation(operations, [\"a\", path, after.slice(before.length)]);\n        return;\n    }\n    const shared = overlap(before, after, DEFAULT_OVERLAP_SCAN);\n    if (shared === 0) {\n        emitOperation(operations, [\"s\", path, after]);\n        return;\n    }\n    emitOperation(operations, [\"t\", path, before.length - shared]);\n    if (after.length > shared)\n        emitOperation(operations, [\"a\", path, after.slice(shared)]);\n};\nconst MAX_IDENTITY_CANDIDATES = 200_000;\nconst MAX_SEMANTIC_CELLS = 65_536;\nconst sameValue = (left, right) => left === right || equalJson(left, right);\nconst lcsMatches = (before, after, equal, maxCells) => {\n    if (before.length === 0 || after.length === 0)\n        return [];\n    if (before.length * after.length > maxCells)\n        return undefined;\n    const width = after.length + 1;\n    const lengths = new Uint32Array((before.length + 1) * width);\n    for (let left = before.length - 1; left >= 0; left--) {\n        for (let right = after.length - 1; right >= 0; right--) {\n            const at = left * width + right;\n            lengths[at] = equal(before[left], after[right])\n                ? lengths[(left + 1) * width + right + 1] + 1\n                : Math.max(lengths[(left + 1) * width + right], lengths[left * width + right + 1]);\n        }\n    }\n    const matches = [];\n    let left = 0;\n    let right = 0;\n    while (left < before.length && right < after.length) {\n        if (equal(before[left], after[right]) &&\n            lengths[left * width + right] === lengths[(left + 1) * width + right + 1] + 1) {\n            matches.push([left++, right++]);\n        }\n        else if (lengths[(left + 1) * width + right] >= lengths[left * width + right + 1])\n            left += 1;\n        else\n            right += 1;\n    }\n    return matches;\n};\nconst semanticallyAligned = (left, right) => {\n    if (sameValue(left, right))\n        return true;\n    if (!isContainer(left) || !isContainer(right) || Array.isArray(left) !== Array.isArray(right))\n        return false;\n    if (Array.isArray(left) && Array.isArray(right)) {\n        if (left.length !== right.length)\n            return false;\n        return left.some((value, index) => isContainer(value) && value === right[index]);\n    }\n    const leftObject = left;\n    const rightObject = right;\n    for (const key of Object.keys(leftObject)) {\n        const value = leftObject[key];\n        if (isContainer(value) && Object.hasOwn(rightObject, key) && value === rightObject[key])\n            return true;\n    }\n    return false;\n};\nconst lowerBound = (values, value) => {\n    let low = 0;\n    let high = values.length;\n    while (low < high) {\n        const middle = (low + high) >>> 1;\n        if (values[middle] < value)\n            low = middle + 1;\n        else\n            high = middle;\n    }\n    return low;\n};\nconst identitySubsequence = (before, beforeStart, beforeEnd, after, afterStart, afterEnd) => {\n    const beforeCount = beforeEnd - beforeStart;\n    const afterCount = afterEnd - afterStart;\n    const matches = [];\n    if (afterCount < beforeCount) {\n        let beforeIndex = beforeStart;\n        for (let afterIndex = afterStart; afterIndex < afterEnd; afterIndex++) {\n            while (beforeIndex < beforeEnd && before[beforeIndex] !== after[afterIndex])\n                beforeIndex += 1;\n            if (beforeIndex === beforeEnd)\n                return undefined;\n            matches.push([beforeIndex++, afterIndex]);\n        }\n        return matches;\n    }\n    if (beforeCount < afterCount) {\n        let afterIndex = afterStart;\n        for (let beforeIndex = beforeStart; beforeIndex < beforeEnd; beforeIndex++) {\n            while (afterIndex < afterEnd && before[beforeIndex] !== after[afterIndex])\n                afterIndex += 1;\n            if (afterIndex === afterEnd)\n                return undefined;\n            matches.push([beforeIndex, afterIndex++]);\n        }\n        return matches;\n    }\n    return undefined;\n};\nconst greedyIdentityAnchors = (positions, after, afterStart, afterEnd) => {\n    const matches = [];\n    let previous = -1;\n    for (let afterIndex = afterStart; afterIndex < afterEnd; afterIndex++) {\n        const candidates = positions.get(after[afterIndex]);\n        if (candidates === undefined)\n            continue;\n        const at = lowerBound(candidates, previous + 1);\n        const beforeIndex = candidates[at];\n        if (beforeIndex === undefined)\n            continue;\n        matches.push([beforeIndex, afterIndex]);\n        previous = beforeIndex;\n    }\n    return matches;\n};\nconst identityAnchors = (before, beforeStart, beforeEnd, after, afterStart, afterEnd) => {\n    const positions = new Map();\n    for (let index = beforeStart; index < beforeEnd; index++) {\n        const value = before[index];\n        const existing = positions.get(value);\n        if (existing === undefined)\n            positions.set(value, [index]);\n        else\n            existing.push(index);\n    }\n    let candidateCount = 0;\n    for (let index = afterStart; index < afterEnd; index++) {\n        candidateCount += positions.get(after[index])?.length ?? 0;\n        if (candidateCount > MAX_IDENTITY_CANDIDATES) {\n            return greedyIdentityAnchors(positions, after, afterStart, afterEnd);\n        }\n    }\n    if (candidateCount === 0)\n        return [];\n    const candidates = [];\n    const tails = [];\n    const tailValues = [];\n    for (let afterIndex = afterStart; afterIndex < afterEnd; afterIndex++) {\n        const beforePositions = positions.get(after[afterIndex]);\n        if (beforePositions === undefined)\n            continue;\n        for (let index = beforePositions.length - 1; index >= 0; index--) {\n            const beforeIndex = beforePositions[index];\n            const at = lowerBound(tailValues, beforeIndex);\n            const candidateIndex = candidates.length;\n            candidates.push({ before: beforeIndex, after: afterIndex, previous: at === 0 ? -1 : tails[at - 1] });\n            tails[at] = candidateIndex;\n            tailValues[at] = beforeIndex;\n        }\n    }\n    const matches = [];\n    let candidateIndex = tails[tails.length - 1] ?? -1;\n    while (candidateIndex >= 0) {\n        const candidate = candidates[candidateIndex];\n        matches.push([candidate.before, candidate.after]);\n        candidateIndex = candidate.previous;\n    }\n    matches.reverse();\n    return matches;\n};\nconst processArrayMatches = (before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, matches) => {\n    let beforeAt = beforeStart;\n    let afterAt = afterStart;\n    let outputAt = outputStart;\n    for (const [beforeMatch, afterMatch] of matches) {\n        if (overflowedBatches.has(operations))\n            return;\n        diffArrayRegion(before, after, path, operations, beforeAt, beforeMatch, afterAt, afterMatch, outputAt);\n        outputAt += afterMatch - afterAt;\n        if (!sameValue(before[beforeMatch], after[afterMatch])) {\n            diffValue(before[beforeMatch], after[afterMatch], [...path, outputAt], operations);\n        }\n        outputAt += 1;\n        beforeAt = beforeMatch + 1;\n        afterAt = afterMatch + 1;\n    }\n    if (!overflowedBatches.has(operations)) {\n        diffArrayRegion(before, after, path, operations, beforeAt, beforeEnd, afterAt, afterEnd, outputAt);\n    }\n};\nfunction diffArrayRegion(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart) {\n    if (overflowedBatches.has(operations))\n        return;\n    while (beforeStart < beforeEnd && afterStart < afterEnd && sameValue(before[beforeStart], after[afterStart])) {\n        beforeStart += 1;\n        afterStart += 1;\n        outputStart += 1;\n    }\n    while (beforeStart < beforeEnd && afterStart < afterEnd && sameValue(before[beforeEnd - 1], after[afterEnd - 1])) {\n        beforeEnd -= 1;\n        afterEnd -= 1;\n    }\n    const beforeCount = beforeEnd - beforeStart;\n    const afterCount = afterEnd - afterStart;\n    if (beforeCount === 0 && afterCount === 0)\n        return;\n    if (beforeCount === 0 || afterCount === 0) {\n        emitOperation(operations, [\"p\", path, outputStart, beforeCount, after.slice(afterStart, afterEnd)]);\n        return;\n    }\n    if (beforeCount === afterCount) {\n        const positional = [];\n        for (let offset = 0; offset < beforeCount; offset++) {\n            if (sameValue(before[beforeStart + offset], after[afterStart + offset])) {\n                positional.push([beforeStart + offset, afterStart + offset]);\n            }\n        }\n        if (positional.length > 0) {\n            processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, positional);\n            return;\n        }\n    }\n    const subsequence = identitySubsequence(before, beforeStart, beforeEnd, after, afterStart, afterEnd);\n    if (subsequence !== undefined && subsequence.length > 0) {\n        processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, subsequence);\n        return;\n    }\n    const identity = identityAnchors(before, beforeStart, beforeEnd, after, afterStart, afterEnd);\n    if (identity.length > 0) {\n        processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, identity);\n        return;\n    }\n    const semantic = lcsMatches(before.slice(beforeStart, beforeEnd), after.slice(afterStart, afterEnd), semanticallyAligned, MAX_SEMANTIC_CELLS);\n    if (semantic !== undefined && semantic.length > 0) {\n        const absolute = semantic.map(([beforeIndex, afterIndex]) => [beforeStart + beforeIndex, afterStart + afterIndex]);\n        processArrayMatches(before, after, path, operations, beforeStart, beforeEnd, afterStart, afterEnd, outputStart, absolute);\n        return;\n    }\n    if (beforeCount === 1 && afterCount === 1) {\n        diffValue(before[beforeStart], after[afterStart], [...path, outputStart], operations);\n        return;\n    }\n    emitOperation(operations, [\"p\", path, outputStart, beforeCount, after.slice(afterStart, afterEnd)]);\n}\nconst diffArray = (before, after, path, operations) => {\n    if (before === after || equalJson(before, after))\n        return;\n    if (before.length === after.length &&\n        before.length > 1 &&\n        !sameValue(before[0], after[0]) &&\n        !sameValue(before[before.length - 1], after[after.length - 1])) {\n        const order = permutation(before, after);\n        if (order !== undefined) {\n            emitOperation(operations, [\"m\", path, order]);\n            return;\n        }\n    }\n    diffArrayRegion(before, after, path, operations, 0, before.length, 0, after.length, 0);\n};\nconst diffObject = (before, after, path, operations) => {\n    const beforeKeys = Object.keys(before);\n    const afterKeys = Object.keys(after);\n    if ([...beforeKeys, ...afterKeys].some((key) => RESERVED_SEGMENTS.has(key))) {\n        if (!equalJson(before, after))\n            emitSet(path, after, operations);\n        return;\n    }\n    for (const key of afterKeys) {\n        if (overflowedBatches.has(operations))\n            return;\n        if (Object.hasOwn(before, key))\n            diffValue(before[key], after[key], [...path, key], operations);\n        else\n            emitSet([...path, key], after[key], operations);\n    }\n    for (const key of beforeKeys) {\n        if (overflowedBatches.has(operations))\n            return;\n        if (!Object.hasOwn(after, key))\n            emitOperation(operations, [\"d\", [...path, key]]);\n    }\n};\nconst diffValue = (before, after, path, operations) => {\n    if (before === after || overflowedBatches.has(operations))\n        return;\n    if (typeof before === \"string\" && typeof after === \"string\" && path.length > 0) {\n        emitString(before, after, path, operations);\n        return;\n    }\n    if (Array.isArray(before) && Array.isArray(after)) {\n        diffArray(before, after, path, operations);\n        return;\n    }\n    if (isContainer(before) && isContainer(after) && !Array.isArray(before) && !Array.isArray(after)) {\n        diffObject(before, after, path, operations);\n        return;\n    }\n    emitSet(path, after, operations);\n};\nconst jsonCost = (value) => {\n    if (value === null)\n        return 4;\n    if (typeof value === \"string\")\n        return value.length + 2;\n    if (typeof value === \"number\")\n        return String(value).length;\n    if (typeof value === \"boolean\")\n        return value ? 4 : 5;\n    if (Array.isArray(value)) {\n        let cost = 2;\n        for (let index = 0; index < value.length; index++)\n            cost += jsonCost(value[index]) + (index === 0 ? 0 : 1);\n        return cost;\n    }\n    let cost = 2;\n    let index = 0;\n    for (const key of Object.keys(value)) {\n        cost += key.length + 3 + jsonCost(value[key]) + (index++ === 0 ? 0 : 1);\n    }\n    return cost;\n};\nconst pathCost = (path) => {\n    let cost = 2;\n    for (let index = 0; index < path.length; index++) {\n        const segment = path[index];\n        cost += (typeof segment === \"string\" ? segment.length + 2 : String(segment).length) + (index === 0 ? 0 : 1);\n    }\n    return cost;\n};\nconst operationCost = (operation) => {\n    switch (operation[0]) {\n        case \"r\":\n            return 6 + jsonCost(operation[1]);\n        case \"s\":\n            return 7 + pathCost(operation[1]) + jsonCost(operation[2]);\n        case \"d\":\n            return 6 + pathCost(operation[1]);\n        case \"a\":\n            return 7 + pathCost(operation[1]) + operation[2].length + 2;\n        case \"t\":\n            return 7 + pathCost(operation[1]) + String(operation[2]).length;\n        case \"p\":\n            return (10 +\n                pathCost(operation[1]) +\n                String(operation[2]).length +\n                String(operation[3]).length +\n                jsonCost(operation[4]));\n        case \"m\":\n            return 7 + pathCost(operation[1]) + jsonCost(operation[2]);\n    }\n};\n/** Compute a compact operation batch from two immutable JSON revisions. */\nexport function diffRevisions(before, after) {\n    const operations = [];\n    diffValue(before, after, [], operations);\n    if (overflowedBatches.has(operations))\n        return [[\"r\", after]];\n    if (operations.length === 0 || operations[0]?.[0] === \"r\")\n        return operations;\n    let deltaCost = 2;\n    for (const operation of operations)\n        deltaCost += operationCost(operation) + 1;\n    if (deltaCost < 65_536)\n        return operations;\n    const snapshotCost = jsonCost(after) + 6;\n    return deltaCost >= snapshotCost ? [[\"r\", after]] : operations;\n}\n//# sourceMappingURL=diff.js.map","// One FIFO queue for every observer notification (state events, shape pushes, registry tables, listener\n// invocations).\n//\n// Problem: notifying observers synchronously from inside a write lets a re-entrant write overtake the write being\n// published. Example: subscriber A reacts to n = 1 by writing n = 2; subscriber B then sees 2 before 1.\n// Solution: a publication first adopts every revision it makes (cells and derivations), then enqueues its\n// notifications. Notifications run in enqueue order, so every observer sees revisions in adoption order.\n// `holdPublications` defers delivery until a multi-step change (a reload commit) is complete.\nconst queue = [];\nlet held = 0;\nlet draining = false;\n/** Runs `task` after everything enqueued before it. Tasks must not throw (report instead). */\nexport function enqueue(task) {\n    queue.push(task);\n    drain();\n}\n/** Delivers nothing until `fn` returns, then everything it enqueued, in order. */\nexport function holdPublications(fn) {\n    held++;\n    try {\n        return fn();\n    }\n    finally {\n        held--;\n        drain();\n    }\n}\nfunction drain() {\n    if (draining || held > 0)\n        return;\n    draining = true;\n    try {\n        for (let task = queue.shift(); task !== undefined; task = queue.shift())\n            task();\n    }\n    finally {\n        draining = false;\n    }\n}\n//# sourceMappingURL=publish.js.map","import { diffRevisions, track } from \"./delta/index.js\";\nimport { ChordError } from \"./errors.js\";\nimport { enqueue, holdPublications } from \"./publish.js\";\nimport { assertValid } from \"./schema.js\";\nlet sequence = 0;\n/** Fans out values and delta events; listener errors are reported, not thrown to the writer. */\nclass Fanout {\n    #values = new Set();\n    #events = new Set();\n    #report;\n    constructor(report) {\n        this.#report = report;\n    }\n    subscribe(listener, current) {\n        this.#values.add(listener);\n        this.#call(listener, current);\n        return () => this.#values.delete(listener);\n    }\n    events(listener, current) {\n        this.#events.add(listener);\n        this.#call(listener, { type: \"snap\", value: current });\n        return () => this.#events.delete(listener);\n    }\n    /**\n     * Queues delivery to the listeners subscribed now. A listener that subscribes later already got this revision in\n     * its snapshot; one that unsubscribes before delivery is skipped.\n     */\n    emit(event) {\n        const events = [...this.#events];\n        const values = [...this.#values];\n        enqueue(() => {\n            for (const listener of events)\n                if (this.#events.has(listener))\n                    this.#call(listener, event);\n            for (const listener of values)\n                if (this.#values.has(listener))\n                    this.#call(listener, event.value);\n        });\n    }\n    #call(listener, value) {\n        try {\n            listener(value);\n        }\n        catch (error) {\n            this.#report(error);\n        }\n    }\n}\n/**\n * Whether a state source has its value (entry 8): a remote reference's member before its first snapshot has none, and\n * neither has anything derived from or forwarding it. Sources without this symbol always have their value.\n */\nexport const HYDRATION = Symbol(\"chord.hydration\");\n/** The hydration of a readable, or undefined for a source that always has its value. */\nexport function hydrationOf(value) {\n    if (value === null || typeof value !== \"object\")\n        return undefined;\n    return value[HYDRATION];\n}\n/** The hydrations of `sources` that are not hydrated yet. */\nexport const unhydrated = (sources) => [...sources].map(hydrationOf).filter((hydration) => hydration?.hydrated === false);\n/** An object-owned state source (cell or derivation). Writes recompute dependents atomically. */\nexport class Source {\n    key;\n    seq = ++sequence;\n    dependents = new Set();\n    /** Schemas of remote state members currently exposing this source (checked per write in dev mode). */\n    schemas = [];\n    options;\n    fanout;\n    constructor(key, options) {\n        this.key = key;\n        this.options = options;\n        this.fanout = new Fanout(options.report);\n    }\n    subscribe(listener) {\n        return this.fanout.subscribe(listener, this.value);\n    }\n    events(listener) {\n        return this.fanout.events(listener, this.value);\n    }\n    /** Per-write validation, dev mode only. */\n    validate(value) {\n        if (!this.options.dev)\n            return;\n        for (const schema of this.ownSchemas())\n            assertValid(\"state\", `state ${this.key}`, schema, value);\n        for (const schema of this.schemas)\n            assertValid(\"state\", `state ${this.key}`, schema, value);\n    }\n    ownSchemas() {\n        return [];\n    }\n}\nfunction unbox(ops, value) {\n    const result = [];\n    for (const op of ops) {\n        if (op[0] === \"r\" || op[1].length === 0)\n            return [[\"r\", value]];\n        const path = op[1].slice(1);\n        switch (op[0]) {\n            case \"p\":\n                result.push([\"p\", path, op[2], op[3], op[4]]);\n                break;\n            case \"m\":\n                result.push([\"m\", path, op[2]]);\n                break;\n            default:\n                // s/d/a/t on the value itself replace it.\n                if (path.length === 0)\n                    return [[\"r\", value]];\n                if (op[0] === \"d\")\n                    result.push([\"d\", path]);\n                else\n                    result.push([op[0], path, op[2]]);\n        }\n    }\n    return result;\n}\n/** A state cell holding any JSON value, validated against its schema at creation and (dev mode) on writes. */\nexport class Cell extends Source {\n    /** Replaced at a reload commit that changes the schema (state-version bump). */\n    schema;\n    #tracker;\n    #guard;\n    /** False until `initialize` for a cell declared with `init`: reads and writes throw `not_ready`. */\n    #initialized;\n    /**\n     * `initial` is always validated against `schema`; ownership moves to the cell. Without `initial`, the cell has no\n     * value until `initialize` (a cell declared with `init`, filled before its object goes live).\n     */\n    constructor(key, schema, initial, guard, options) {\n        super(key, options);\n        if (initial !== undefined)\n            assertValid(\"state\", `initial value of state ${key}`, schema, initial.value);\n        this.schema = schema;\n        this.#tracker = track({ v: (initial?.value ?? null) });\n        this.#guard = guard;\n        this.#initialized = initial !== undefined;\n    }\n    /** Sets the first value of a cell declared with `init` (validated; ownership moves to the cell). Publishes nothing. */\n    initialize(value) {\n        if (this.#initialized)\n            throw new Error(`state ${this.key} is already initialized`);\n        assertValid(\"state\", `initial value of state ${this.key}`, this.schema, value);\n        this.#tracker = track({ v: value });\n        this.#initialized = true;\n    }\n    ownSchemas() {\n        return [this.schema];\n    }\n    get value() {\n        if (!this.#initialized)\n            throw notReady(`state ${this.key} (its init has not run)`);\n        return this.#tracker.value.v;\n    }\n    change(ctx, fn) {\n        this.#guard(ctx);\n        if (!this.#initialized)\n            throw notReady(`state ${this.key} (its init has not run)`);\n        const change = this.#tracker.beginChange();\n        let prepared;\n        try {\n            const draft = change.state;\n            const result = fn(draft.v);\n            if (result instanceof Promise)\n                throw new TypeError(\"cell.change callbacks must be synchronous\");\n            if (result !== undefined) {\n                if (result !== draft.v)\n                    assertValid(\"state\", `state ${this.key}`, this.schema, result);\n                draft.v = result;\n            }\n            prepared = change.prepare();\n        }\n        catch (error) {\n            change.abort();\n            throw error;\n        }\n        this.#publish(prepared, \"ops\");\n    }\n    /**\n     * Replaces the whole value. Ownership of `value` moves to the cell: never mutate it afterwards.\n     *\n     * Subscribers get a structural diff (`diffRevisions`) when `diff` is true, or by default when the new value shares\n     * containers with the old one (a new immutable revision of the same state, e.g. mirrored from another store);\n     * otherwise a single `r` op. The resulting value is the same either way; only the ops differ.\n     */\n    replace(ctx, value, options = {}) {\n        this.#guard(ctx);\n        if (!this.#initialized)\n            throw notReady(`state ${this.key} (its init has not run)`);\n        const before = this.value;\n        const diff = options.diff ?? sharesStructure(before, value);\n        const ops = diff ? diffRevisions(before, value) : undefined;\n        this.#publish(this.#tracker.prepareReplace({ v: value }), \"ops\", true, ops);\n    }\n    /**\n     * Installs a migrated value and its schema (reload commit). The caller validated the value and the derivations\n     * over it against every schema that will apply, so nothing is checked here. Subscribers receive a reset.\n     */\n    reset(value, schema) {\n        this.schema = schema;\n        this.#publish(this.#tracker.prepareReplace({ v: value }), \"reset\", false);\n    }\n    /** Adopts this revision and every derived one, then queues all notifications (cell first, then derivations). */\n    #publish(prepared, type, validate = true, ops) {\n        if (prepared.ops.length === 0 && type === \"ops\") {\n            this.#tracker.adopt(prepared);\n            return;\n        }\n        const value = prepared.value.v;\n        let candidates;\n        try {\n            if (validate)\n                this.validate(value);\n            candidates = computeDependents(this, value, validate);\n        }\n        catch (error) {\n            prepared.abort();\n            throw error;\n        }\n        holdPublications(() => {\n            this.#tracker.adopt(prepared);\n            const published = ops !== undefined && ops.length > 0 ? ops : unbox(prepared.ops, value);\n            this.fanout.emit(type === \"reset\" ? { type, value } : { type, ops: published, value });\n            for (const [derived, next] of candidates)\n                derived.install(next);\n        });\n    }\n}\n/** True if `b` reuses at least one container of `a` at the same key: a new revision of the same state. */\nfunction sharesStructure(a, b) {\n    if (a === null || b === null || typeof a !== \"object\" || typeof b !== \"object\" || a === b)\n        return false;\n    if (Array.isArray(a) !== Array.isArray(b))\n        return false;\n    for (const [key, child] of Object.entries(b)) {\n        if (child !== null && typeof child === \"object\" && a[key] === child)\n            return true;\n    }\n    return false;\n}\n/** Recomputes every transitive dependent of `changed` against candidate values and validates them. */\nfunction computeDependents(changed, value, validate = true) {\n    const pending = new Set();\n    const visit = (source) => {\n        for (const derived of source.dependents) {\n            if (pending.has(derived))\n                continue;\n            pending.add(derived);\n            visit(derived);\n        }\n    };\n    visit(changed);\n    const values = new Map([[changed, value]]);\n    const result = new Map();\n    for (const derived of [...pending].sort((a, b) => a.seq - b.seq)) {\n        const next = derived.compute((source) => (values.has(source) ? values.get(source) : source.value));\n        if (validate)\n            derived.validate(next);\n        values.set(derived, next);\n        result.set(derived, next);\n    }\n    return result;\n}\nconst isReadable = (value) => value !== null &&\n    typeof value === \"object\" &&\n    typeof value.subscribe === \"function\" &&\n    \"value\" in value;\n/**\n * A synchronous derivation. Sources are object cells/derivations (recomputed atomically with the write) or other\n * readables such as reference state members (recomputed when they publish). Subscribers receive diffs.\n */\nexport class Derived extends Source {\n    sources;\n    #fn;\n    #value;\n    #external = [];\n    constructor(key, sources, fn, options) {\n        super(key, options);\n        this.sources = sources.map((source) => {\n            if (!isReadable(source))\n                throw new TypeError(`derive ${key}: sources must be readables`);\n            return source;\n        });\n        this.#fn = fn;\n        this.#value = undefined;\n    }\n    get value() {\n        return this.#value;\n    }\n    /** Hydrated once every source is (a derivation over a remote member waits for its snapshot). */\n    get [HYDRATION]() {\n        const pending = unhydrated(this.sources);\n        if (pending.length === 0)\n            return undefined;\n        return {\n            hydrated: false,\n            whenHydrated: () => Promise.all(pending.map((hydration) => hydration.whenHydrated())).then(() => { }),\n        };\n    }\n    /**\n     * Computes the first value (or takes it from `precomputed`, a reload's validated dry run) and starts following\n     * the sources (at install, never inside a factory).\n     */\n    attach(precomputed) {\n        this.#value = precomputed?.has(this) ? precomputed.get(this) : this.compute((source) => source.value);\n        for (const source of this.sources) {\n            if (source instanceof Source)\n                source.dependents.add(this);\n            else\n                this.#external.push(source.subscribe(() => this.refresh()));\n        }\n    }\n    detach() {\n        for (const source of this.sources)\n            if (source instanceof Source)\n                source.dependents.delete(this);\n        for (const unsubscribe of this.#external.splice(0))\n            unsubscribe();\n    }\n    compute(read) {\n        const result = this.#fn(...this.sources.map(read));\n        if (result instanceof Promise)\n            throw new TypeError(`derive ${this.key}: fn must be synchronous`);\n        return result;\n    }\n    /** Recomputes and republishes, including dependents. Errors are reported (the source write already happened). */\n    refresh() {\n        try {\n            const next = this.compute((source) => source.value);\n            const dependents = computeDependents(this, next);\n            holdPublications(() => {\n                this.install(next);\n                for (const [derived, value] of dependents)\n                    derived.install(value);\n            });\n        }\n        catch (error) {\n            this.options.report(error);\n        }\n    }\n    install(next) {\n        const before = this.#value;\n        this.#value = next;\n        const ops = before === undefined || next === undefined\n            ? [[\"r\", (next ?? null)]]\n            : diffRevisions(before, next);\n        if (ops.length > 0)\n            this.fanout.emit({ type: \"ops\", ops, value: next });\n    }\n}\nexport const isSource = (value) => value instanceof Source;\n/** Thrown by placeholders used before activation finished. */\nexport const notReady = (what) => new ChordError(\"not_ready\", `${what} is not ready`);\n//# sourceMappingURL=cell.js.map","import { Value } from \"typebox/value\";\nimport { Cell, Derived, HYDRATION, hydrationOf, isSource, notReady, unhydrated, } from \"./cell.js\";\nimport { bind, LOCAL_VARIANT, takesNoArgs, } from \"./contract.js\";\nimport { asChordError, ChordError, invalid, runAll } from \"./errors.js\";\nimport { enqueue } from \"./publish.js\";\nimport { assertValid, normalize } from \"./schema.js\";\nconst noop = () => { };\nexport const makeService = (contract, factory, options, facet) => {\n    checkLifetime(contract, options);\n    return {\n        contract,\n        factory: factory,\n        options: options,\n        facet,\n    };\n};\n/** Whether objects of `service` have `lifetime: \"host\"`. */\nexport const hostLifetime = (service) => service.options.lifetime === \"host\";\n/** Refuses lifetimes the type cannot have, when it is served. */\nfunction checkLifetime(contract, options) {\n    const lifetime = options.lifetime ?? \"referenced\";\n    if (lifetime !== \"referenced\" && lifetime !== \"host\")\n        throw new TypeError(`${contract.name}: unknown lifetime ${String(lifetime)}`);\n    if (lifetime !== \"host\")\n        return;\n    if (contract.scope !== \"local\")\n        throw new TypeError(`${contract.name}: lifetime \"host\" needs a local type (remote types are referenced)`);\n    if (options.linger !== undefined)\n        throw new TypeError(`${contract.name}: an object of lifetime \"host\" does not linger (it lives as long as the host)`);\n    try {\n        normalize(contract.input, {}, `${contract.name} input`);\n    }\n    catch {\n        throw new TypeError(`${contract.name}: lifetime \"host\" needs an input that accepts {} (the object's one address)`);\n    }\n}\n/** Runtime form of `Exposed<T>`. */\nclass ExposedImpl {\n    resource;\n    constructor(resource) {\n        this.resource = resource;\n    }\n}\nexport class ResourceImpl {\n    key;\n    /** The declaration of the factory run whose code is current: a kept resource adopts the new one at commit. */\n    spec;\n    deps;\n    /** `unavailable`: a close/reopen failed during a reload rollback; the value is gone for good. */\n    state = \"closed\";\n    #value;\n    constructor(key, spec, deps) {\n        this.key = key;\n        this.spec = spec;\n        this.deps = deps;\n    }\n    get value() {\n        if (this.state === \"unavailable\")\n            throw new ChordError(\"unavailable\", `resource ${this.key} could not be restored`);\n        if (this.state !== \"open\")\n            throw notReady(`resource ${this.key}`);\n        return this.#value;\n    }\n    get exclusive() {\n        return this.spec.exclusive === true;\n    }\n    /**\n     * Opens the resource. An open that completes after `signal` aborted (rollback, abandonment) closes the value it\n     * produced at once: nobody owns it any more.\n     */\n    async open(signal, order) {\n        if (this.state !== \"closed\")\n            return;\n        this.state = \"opening\";\n        let value;\n        try {\n            value = await this.spec.open({ signal });\n        }\n        catch (error) {\n            this.state = \"closed\";\n            throw error;\n        }\n        if (signal.aborted) {\n            this.state = \"closed\";\n            await this.spec.close?.(value);\n            throw new ChordError(\"aborted\", `resource ${this.key} opened after abort`);\n        }\n        this.#value = value;\n        this.state = \"open\";\n        order.push(this);\n    }\n    async close(order) {\n        if (this.state !== \"open\")\n            return;\n        this.state = \"closed\";\n        const index = order.indexOf(this);\n        if (index !== -1)\n            order.splice(index, 1);\n        const value = this.#value;\n        this.#value = undefined;\n        await this.spec.close?.(value);\n    }\n    markUnavailable() {\n        this.state = \"unavailable\";\n        this.#value = undefined;\n    }\n    /**\n     * A reload kept this resource (same version, deps and exclusivity): its later `close` is the new declaration's, and\n     * the old declaration (with the old code it closes over) is no longer referenced.\n     */\n    adopt(spec) {\n        this.spec = spec;\n    }\n}\n/**\n * What `self.resources` returns: the resource, except that `.value` throws `not_ready` while any factory runs, even\n * if the resource is open (a reload's prepare rerun must not touch the native resource the old code uses).\n */\nclass ResourceFacade {\n    #resource;\n    #host;\n    constructor(resource, host) {\n        this.#resource = resource;\n        this.#host = host;\n        facades.set(this, resource);\n    }\n    get key() {\n        return this.#resource.key;\n    }\n    get value() {\n        if (this.#host.inFactory > 0)\n            throw notReady(`resource ${this.key} (inside a factory)`);\n        return this.#resource.value;\n    }\n}\nconst facades = new WeakMap();\nconst resourceOf = (value) => value instanceof ResourceImpl ? value : value !== null && typeof value === \"object\" ? facades.get(value) : undefined;\n/** Everything one factory run declared, by kind and key. */\nexport class Decls {\n    cells = new Map();\n    cellSchemas = new Map();\n    cellVersions = new Map();\n    cellMigrations = new Map();\n    refs = new Map();\n    resources = new Map();\n    /** Resources this run kept from the previous one, with this run's declarations (adopted at commit). */\n    adopted = new Map();\n    listeners = new Map();\n    /** By position (`#0`, `#1`, …): tasks have no names. */\n    tasks = new Map();\n    /** By position: derivations have no names and are new at every run. */\n    derives = new Map();\n    registrations = new Map();\n}\nconst isStateInit = (value) => value !== null && typeof value === \"object\" && typeof value.init === \"function\";\n// ─── Contexts ────────────────────────────────────────────────────────────────\nexport class CtxImpl {\n    host;\n    signal;\n    rootId;\n    codeVersion;\n    principal;\n    /** Code holders (tasks): every call they make starts a fresh root. */\n    holder;\n    #refs = [];\n    #release;\n    /** Aborted when the ctx closes: awaited `get`s give up. */\n    #closing = new AbortController();\n    #closed = false;\n    /** True after the call or root that received this ctx settled: it may no longer start work. */\n    get closed() {\n        return this.#closed;\n    }\n    /** Throws unless this ctx may start work on `host` (the called reference's host) now: not expired, aborted or foreign. */\n    check(host) {\n        if (this.host !== host)\n            throw invalid(\"foreign_ctx\", \"ctx belongs to another host\");\n        if (this.#closed)\n            throw new ChordError(\"aborted\", \"ctx expired: its call already settled\", { reason: \"expired\" });\n        if (this.signal.aborted) {\n            const reason = this.signal.reason;\n            // A forced retirement aborted the root: its code version is gone, so the next call is `superseded` (retryable).\n            if (reason instanceof ChordError && reason.code === \"superseded\")\n                throw new ChordError(\"superseded\", reason.message, { cause: reason });\n            throw new ChordError(\"aborted\", \"ctx aborted\", { cause: reason });\n        }\n    }\n    /** `signals`: the ctx is aborted with the first of them; it stops following them when it closes. */\n    constructor(host, fields) {\n        this.host = host;\n        const linked = linkedSignal(fields.signals);\n        this.signal = linked.signal;\n        this.#release = linked.release;\n        this.rootId = fields.rootId;\n        this.codeVersion = fields.codeVersion;\n        this.principal = fields.principal;\n        this.holder = fields.holder ?? false;\n    }\n    async get(type, input, options) {\n        this.check(this.host);\n        const ref = this.host.acquire(type, input, { principal: this.principal, ...options }, \"call\");\n        this.#refs.push(ref);\n        await awaitReady(ref, [this.signal, this.#closing.signal], this.host.readyTimeout);\n        return ref.proxy;\n    }\n    /**\n     * A context for a call into `object`: same root and code version, its own call-owned references, aborted on forced\n     * disposal. Code inside an object acts as the host principal.\n     */\n    child(object) {\n        return new CtxImpl(this.host, {\n            signals: [this.signal, object.callAbort.signal],\n            rootId: this.rootId,\n            codeVersion: this.codeVersion,\n            principal: this.host.principal,\n        });\n    }\n    close() {\n        this.#closed = true;\n        this.#closing.abort(new ChordError(\"aborted\", \"ctx expired: its call already settled\", { reason: \"expired\" }));\n        this.#release();\n        for (const ref of this.#refs.splice(0))\n            ref.release();\n    }\n}\n/**\n * A signal aborted with the first of `sources` to abort, until `release()`. Not `AbortSignal.any`: Node keeps a\n * dependant of a long-lived source (an object's or a code version's) reachable while it has abort listeners, so every\n * call or task context would keep its listeners, and the code they close over, alive as long as the source.\n */\nexport function linkedSignal(sources) {\n    const controller = new AbortController();\n    const detach = [];\n    const release = () => {\n        for (const remove of detach.splice(0))\n            remove();\n    };\n    for (const source of sources) {\n        if (source.aborted) {\n            release();\n            controller.abort(source.reason);\n            break;\n        }\n        const forward = () => {\n            release();\n            controller.abort(source.reason);\n        };\n        source.addEventListener(\"abort\", forward, { once: true });\n        detach.push(() => source.removeEventListener(\"abort\", forward));\n    }\n    return { signal: controller.signal, release };\n}\n/**\n * Waits until `ref` is ready, at most `ms` and until a signal aborts; on failure the reference is released (only it: a\n * binding other references share stays) and the error is rethrown: the activation error, `aborted`, or\n * `unavailable/ready_timeout`.\n */\nexport async function awaitReady(ref, signals, ms) {\n    const timeout = new AbortController();\n    const timer = Number.isFinite(ms)\n        ? setTimeout(() => timeout.abort(new ChordError(\"unavailable\", `${ref.address} was not ready after ${ms} ms`, {\n            reason: \"ready_timeout\",\n        })), ms)\n        : undefined;\n    timer?.unref?.();\n    const linked = linkedSignal([...signals, timeout.signal]);\n    try {\n        await raceSignal(ref.ready, linked.signal);\n    }\n    catch (error) {\n        ref.release();\n        const reason = linked.signal.reason;\n        throw reason instanceof ChordError && reason.reason === \"ready_timeout\" ? reason : error;\n    }\n    finally {\n        clearTimeout(timer);\n        linked.release();\n    }\n}\nexport async function raceSignal(promise, signal) {\n    if (signal.aborted)\n        throw new ChordError(\"aborted\", \"call aborted\", { cause: signal.reason });\n    let onAbort = noop;\n    const aborted = new Promise((_, reject) => {\n        onAbort = () => reject(new ChordError(\"aborted\", \"call aborted\", { cause: signal.reason }));\n        signal.addEventListener(\"abort\", onAbort, { once: true });\n    });\n    try {\n        return await Promise.race([promise, aborted]);\n    }\n    finally {\n        signal.removeEventListener(\"abort\", onAbort);\n    }\n}\nexport const REF_BASE = new Set([\n    \"contract\",\n    \"status\",\n    \"ready\",\n    \"variant\",\n    \"shape\",\n    \"error\",\n    \"onShape\",\n    \"onStatus\",\n    \"release\",\n]);\n/** Queues a status notification (after the change that caused it is complete, like every publication). */\nexport function notifyStatus(listeners, status, error, report) {\n    if (listeners.size === 0)\n        return;\n    const current = [...listeners];\n    enqueue(() => {\n        for (const listener of current) {\n            try {\n                listener(status, error);\n            }\n            catch (thrown) {\n                report(thrown);\n            }\n        }\n    });\n}\n/** Proxy → reference, for `deps: [ref]` and links. */\nexport const refsByProxy = new WeakMap();\nexport const refOf = (value) => value !== null && typeof value === \"object\" ? refsByProxy.get(value) : undefined;\n/**\n * A reference's state member: a stable readable that follows whatever source the current implementation exposes under\n * that name. Reading throws `not_ready` until the reference is live, `not_in_variant` while the variant lacks the\n * member. A listener added before the member is readable gets its snapshot then. Rebinding (reload, variant) delivers a\n * reset. Upstream is subscribed only while someone listens.\n */\nclass MemberReadable {\n    #ref;\n    #name;\n    #values = new Set();\n    #events = new Set();\n    /** Event listeners that have not had their snapshot yet (added while the member was not readable). */\n    #unseen = new Set();\n    #source;\n    #upstream = noop;\n    /** The value listeners last saw; a first upstream snapshot equal to it is not re-announced. */\n    #seen;\n    constructor(ref, name) {\n        this.#ref = ref;\n        this.#name = name;\n    }\n    get value() {\n        const ref = this.#ref;\n        if (ref.status === \"released\" || ref.status === \"gone\")\n            throw ref.terminalError();\n        if (ref.status !== \"live\")\n            throw notReady(`${ref.address}.${this.#name}`);\n        const view = ref.currentView();\n        if (view === undefined)\n            throw notReady(`${ref.address}.${this.#name}`);\n        const source = this.#current();\n        if (source === undefined) {\n            throw new ChordError(\"not_in_variant\", `${ref.address}: ${this.#name} is not a state member of variant ${variantOf(view) ?? \"(local)\"}`);\n        }\n        return source.value;\n    }\n    /** Not hydrated while the reference is not live, or while its source (a forwarded remote member) is not. */\n    get [HYDRATION]() {\n        const ref = this.#ref;\n        if (ref.status === \"live\")\n            return hydrationOf(this.#current());\n        return {\n            hydrated: false,\n            whenHydrated: async () => {\n                await ref.ready;\n                await hydrationOf(this.#current())?.whenHydrated();\n            },\n        };\n    }\n    subscribe(listener) {\n        this.#values.add(listener);\n        const source = this.#readable();\n        if (source !== undefined) {\n            this.#seen = { value: source.value };\n            this.#safe(() => listener(source.value));\n        }\n        this.bind();\n        return () => this.#remove(this.#values, listener);\n    }\n    events(listener) {\n        this.#events.add(listener);\n        const source = this.#readable();\n        if (source !== undefined) {\n            const value = source.value;\n            this.#seen = { value };\n            this.#safe(() => listener({ type: \"snap\", value }));\n        }\n        else\n            this.#unseen.add(listener);\n        this.bind();\n        return () => {\n            this.#unseen.delete(listener);\n            this.#remove(this.#events, listener);\n        };\n    }\n    /** (Re)subscribes upstream to the current source; a changed source is announced as a reset. */\n    bind() {\n        const source = this.#values.size + this.#events.size > 0 ? this.#current() : undefined;\n        if (source === this.#source)\n            return;\n        this.#upstream();\n        this.#upstream = noop;\n        this.#source = source;\n        if (source === undefined)\n            return;\n        let first = true;\n        this.#upstream = source.events((event) => {\n            const isFirst = first;\n            first = false;\n            if (isFirst && this.#unseen.size === 0 && this.#seen !== undefined && event.value === this.#seen.value)\n                return;\n            this.#seen = { value: event.value };\n            const translated = isFirst ? { type: \"reset\", value: event.value } : event;\n            const events = [...this.#events];\n            const values = [...this.#values];\n            const unseen = new Set(this.#unseen);\n            this.#unseen.clear();\n            // Queued: a rebind during a commit must not run observers before the commit completes.\n            enqueue(() => {\n                for (const listener of events) {\n                    if (!this.#events.has(listener))\n                        continue;\n                    const delivered = unseen.has(listener)\n                        ? { type: \"snap\", value: event.value }\n                        : translated;\n                    this.#safe(() => listener(delivered));\n                }\n                for (const listener of values)\n                    if (this.#values.has(listener))\n                        this.#safe(() => listener(event.value));\n            });\n        });\n    }\n    stop() {\n        this.#values.clear();\n        this.#events.clear();\n        this.#unseen.clear();\n        this.bind();\n    }\n    #current() {\n        const view = this.#ref.currentView();\n        if (view === undefined || !this.#ref.inVariant(view, this.#name))\n            return undefined;\n        const value = view[this.#name];\n        // Cells and derivations, or any readable an `accepts` adapter maps them to.\n        return isSource(value) || isReadableLike(value) ? value : undefined;\n    }\n    /** The current source if its value can be read now (live, in the variant, hydrated). */\n    #readable() {\n        const source = this.#current();\n        return source === undefined || hydrationOf(source)?.hydrated === false ? undefined : source;\n    }\n    #remove(set, listener) {\n        set.delete(listener);\n        this.bind();\n    }\n    #safe(fn) {\n        try {\n            fn();\n        }\n        catch (error) {\n            this.#ref.object.host.report(error);\n        }\n    }\n}\n/** One reference on an object. Exposed through a Proxy so members bind late to the current implementation. */\nexport class RefImpl {\n    object;\n    contract;\n    owner;\n    address;\n    proxy;\n    ready;\n    status;\n    error;\n    shapeListeners = new Set();\n    /** Internal: notified when the reference becomes gone (links forward it). */\n    goneListeners = new Set();\n    readables = new Map();\n    /** Weak: a retired code version's service (and the factory code it holds) must not be kept alive by its consumers. */\n    bindings = new WeakMap();\n    views = new WeakMap();\n    callers = new Map();\n    constructor(object, contract, owner) {\n        this.object = object;\n        this.contract = contract;\n        this.owner = owner;\n        this.address = object.address;\n        this.status = object.status === \"live\" ? \"live\" : \"loading\";\n        this.ready = object.ready.then(() => {\n            if (this.status === \"gone\")\n                throw this.error;\n            if (this.status === \"released\")\n                throw new ChordError(\"released\", `reference ${this.address} released`);\n        });\n        this.ready.catch(noop);\n        this.proxy = new Proxy(this, {\n            get: (target, property) => {\n                if (REF_BASE.has(property)) {\n                    const value = Reflect.get(target, property, target);\n                    return typeof value === \"function\" ? value.bind(target) : value;\n                }\n                if (typeof property !== \"string\" || property === \"then\")\n                    return undefined;\n                return target.member(property);\n            },\n            has: (target, property) => REF_BASE.has(property) || target.member(String(property)) !== undefined,\n        });\n        refsByProxy.set(this.proxy, this);\n    }\n    get variant() {\n        const view = this.currentView();\n        return view === undefined ? undefined : variantOf(view);\n    }\n    get shape() {\n        const installed = this.status === \"live\" ? this.object.currentInstalled() : undefined;\n        const view = installed === undefined ? undefined : this.#safeView(installed);\n        if (installed === undefined || view === undefined)\n            return undefined;\n        return {\n            variant: variantOf(view),\n            members: Object.keys(view).filter((key) => key !== \"variant\"),\n            contract: installed.service.contract.fingerprint,\n        };\n    }\n    onShape(listener) {\n        this.shapeListeners.add(listener);\n        return () => this.shapeListeners.delete(listener);\n    }\n    onStatus(listener) {\n        this.#statusListeners.add(listener);\n        return () => this.#statusListeners.delete(listener);\n    }\n    #statusListeners = new Set();\n    #statusChanged() {\n        notifyStatus(this.#statusListeners, this.status, this.error, (error) => this.object.host.report(error));\n    }\n    release() {\n        if (this.status === \"released\" || this.status === \"gone\")\n            return;\n        this.status = \"released\";\n        this.#stopReadables();\n        this.#statusChanged();\n        this.object.release(this);\n    }\n    // ─── internal ───\n    live() {\n        if (this.status !== \"loading\")\n            return;\n        this.status = \"live\";\n        this.#statusChanged();\n        this.shapeChanged();\n    }\n    gone(error) {\n        if (this.status === \"released\" || this.status === \"gone\")\n            return;\n        this.status = \"gone\";\n        this.error = error;\n        this.#stopReadables();\n        this.#statusChanged();\n        for (const listener of [...this.goneListeners])\n            listener(error);\n    }\n    shapeChanged() {\n        for (const readable of this.readables.values())\n            readable.bind();\n        const shape = this.shape;\n        if (shape === undefined)\n            return;\n        const listeners = [...this.shapeListeners];\n        enqueue(() => {\n            for (const listener of listeners) {\n                try {\n                    listener(shape);\n                }\n                catch (error) {\n                    this.object.host.report(error);\n                }\n            }\n        });\n    }\n    terminalError() {\n        return this.status === \"gone\" ? this.error : new ChordError(\"released\", `reference ${this.address} released`);\n    }\n    /** The implementation as this consumer sees it (through an accepts adapter when bound to another version). */\n    viewOf(installed) {\n        let adapter = this.bindings.get(installed.service);\n        if (!this.bindings.has(installed.service)) {\n            adapter = bind(installed.service.contract, installed.service.options.accepts, this.contract);\n            this.bindings.set(installed.service, adapter);\n        }\n        if (adapter === undefined)\n            return installed.implementation;\n        let view = this.views.get(installed.implementation);\n        if (view === undefined) {\n            view = adapter(installed.implementation);\n            this.views.set(installed.implementation, view);\n        }\n        return view;\n    }\n    currentView() {\n        if (this.status !== \"live\")\n            return undefined;\n        const installed = this.object.currentInstalled();\n        return installed === undefined ? undefined : this.#safeView(installed);\n    }\n    /** The view, or undefined when this consumer no longer binds (reported; calls reject with the bind error). */\n    #safeView(installed) {\n        try {\n            return this.viewOf(installed);\n        }\n        catch (error) {\n            this.object.host.report(error);\n            return undefined;\n        }\n    }\n    describe(variant, member) {\n        const variants = this.contract.description.variants;\n        if (variant !== undefined)\n            return variants[variant]?.[member];\n        for (const members of Object.values(variants))\n            if (members[member] !== undefined)\n                return members[member];\n        return undefined;\n    }\n    /** Remote consumers see only the members their contract lists for the current variant. */\n    inVariant(view, name) {\n        return this.contract.scope !== \"remote\" || this.describe(variantOf(view), name) !== undefined;\n    }\n    member(name) {\n        const declared = this.describe(undefined, name);\n        const view = this.currentView();\n        const value = view?.[name];\n        if (declared?.kind === \"method\" || (declared === undefined && typeof value === \"function\")) {\n            return this.caller(name);\n        }\n        if (declared?.kind === \"state\" || (declared === undefined && (isSource(value) || isReadableLike(value)))) {\n            let readable = this.readables.get(name);\n            if (readable === undefined) {\n                readable = new MemberReadable(this, name);\n                this.readables.set(name, readable);\n            }\n            return readable;\n        }\n        if (view === undefined || !this.inVariant(view, name))\n            return undefined;\n        return value instanceof ExposedImpl ? value.resource.value : value;\n    }\n    caller(name) {\n        let caller = this.callers.get(name);\n        if (caller === undefined) {\n            const noArgs = takesNoArgs(this.contract, name);\n            caller = (...given) => {\n                // A method without arguments is called as `ref.name(ctx)`.\n                const [args, ctx] = (noArgs ? [undefined, given[0]] : given);\n                if (this.object.host.inFactory > 0) {\n                    throw new ChordError(\"not_ready\", `${this.address}.${name} called inside a factory`);\n                }\n                if (ctx !== undefined && !(ctx instanceof CtxImpl)) {\n                    return Promise.reject(invalid(\"foreign_ctx\", \"ctx must come from a Chord host\"));\n                }\n                if (ctx === undefined || ctx.holder) {\n                    // A code holder (task) starts a fresh root per call, cancelled with the holder.\n                    try {\n                        ctx?.check(this.object.host);\n                    }\n                    catch (error) {\n                        return Promise.reject(error);\n                    }\n                    return this.object.host.root((root) => this.object.call(this, name, args, root), {\n                        signal: ctx?.signal,\n                    });\n                }\n                return this.object.call(this, name, args, ctx);\n            };\n            this.callers.set(name, caller);\n        }\n        return caller;\n    }\n    #stopReadables() {\n        for (const readable of this.readables.values())\n            readable.stop();\n    }\n}\nexport const variantOf = (implementation) => typeof implementation.variant === \"string\" ? implementation.variant : undefined;\n/**\n * Two `select` functions are the same if they are identical or have the same source text: an inline arrow is a new\n * object on every factory run, but its code is what matters. (A select whose implementation depends on captured values\n * that change between runs is not detected; such a listener keeps its old subscription until its source changes.)\n */\nconst sameSelect = (a, b) => a === b || (a !== undefined && b !== undefined && String(a) === String(b));\nexport class ObjectImpl {\n    host;\n    address;\n    typeName;\n    input;\n    principal;\n    /** The one object of a `lifetime: \"host\"` type: only such objects may register. */\n    hostLifetime;\n    status = \"activating\";\n    ready = Promise.resolve();\n    service;\n    /** Calls carrying an older code version are rejected upgrade_conflict (state bump or exclusive resource replaced). */\n    minCodeVersion = 0;\n    decls = new Decls();\n    /** Declarations of a factory run that has not been installed yet (activation or reload candidate). */\n    pending = new Set();\n    implementations = new Map();\n    refs = new Set();\n    leases = new Map();\n    openOrder = [];\n    callAbort = new AbortController();\n    activationAbort = new AbortController();\n    gate;\n    /** Served only by a running reload's pending code version: listeners, tasks and registrations start at its commit. */\n    deferredRuntime = false;\n    #subscriptions = new Map();\n    #invocations = new Set();\n    #tasks = new Map();\n    /** Aborted task runs that have not finished yet. */\n    #stopped = new Set();\n    /** Bumped by every start and stop of the tasks: a delayed start that is no longer the latest is dropped. */\n    #taskRuns = 0;\n    #linger;\n    #disposal;\n    constructor(host, identity) {\n        this.host = host;\n        this.address = identity.address;\n        this.typeName = identity.typeName;\n        this.input = identity.input;\n        this.principal = identity.principal;\n        this.hostLifetime = identity.hostLifetime;\n    }\n    start(after) {\n        this.ready = this.#activate(after).then(() => {\n            for (const ref of this.refs)\n                ref.live();\n            this.#maybeIdle();\n        }, (cause) => {\n            if (this.status === \"activating\")\n                this.status = \"failed\";\n            this.host.forget(this);\n            // A ChordError (forbidden, a dependency's error, ...) keeps its code; anything else is `unavailable`.\n            const error = asChordError(cause, `activating ${this.address}`);\n            for (const ref of this.refs)\n                ref.gone(error);\n            throw error;\n        });\n        this.ready.catch(noop);\n    }\n    /**\n     * Activation as one transaction: factory, opens, then a synchronous finalization (registry check and publication,\n     * implementations, runtime). Every failure, including one during finalization or a release while listeners start,\n     * unwinds everything this activation did.\n     */\n    async #activate(after) {\n        await after?.catch(noop);\n        const signal = this.activationAbort.signal;\n        const abandoned = () => new ChordError(\"aborted\", `${this.address} abandoned`);\n        if (signal.aborted)\n            throw abandoned();\n        const service = this.host.service(this.typeName);\n        if (service === undefined)\n            throw new ChordError(\"unavailable\", `${this.typeName} is not served`, { reason: \"unknown_type\" });\n        this.service = service;\n        const run = this.run(service, undefined);\n        try {\n            await this.open(run.created.resources, run.created.refs, signal);\n            if (signal.aborted)\n                throw abandoned();\n            await this.waitHydrated(run);\n            if (signal.aborted)\n                throw abandoned();\n            await this.initCells(run, signal);\n            if (signal.aborted)\n                throw abandoned();\n            this.host.checkRegistrations(this, run.decls);\n            this.decls = run.decls;\n            for (const [retained, services] of this.host.retainedCodeVersions()) {\n                if (services.get(this.typeName) === service) {\n                    this.implementations.set(retained, {\n                        codeVersion: retained,\n                        service,\n                        implementation: run.implementation,\n                        decls: run.decls,\n                    });\n                }\n            }\n            const pending = this.host.pendingCodeVersion();\n            if (!this.implementations.has(this.host.currentCodeVersion()) &&\n                (pending === undefined || !this.implementations.has(pending))) {\n                throw new ChordError(\"superseded\", `${this.address}: code changed during activation`);\n            }\n            for (const derived of run.created.derives)\n                derived.attach();\n            this.refreshSchemas();\n            // Served only by a running reload's pending code version: new code must not run (listeners, tasks,\n            // registrations) before that reload commits.\n            this.deferredRuntime = !this.implementations.has(this.host.currentCodeVersion());\n            if (!this.deferredRuntime) {\n                if (run.decls.registrations.size > 0)\n                    this.host.registriesChanged(this);\n                this.startRuntime();\n            }\n            // A listener starting up may have released the last reference synchronously: no resurrection.\n            if (signal.aborted)\n                throw abandoned();\n            this.status = \"live\";\n        }\n        catch (error) {\n            // Invocations started during finalization (listener roots) end before their resources close.\n            this.callAbort.abort(error);\n            this.stopListeners();\n            this.stopTasks();\n            const registered = this.decls.registrations.size > 0 && !this.deferredRuntime;\n            this.implementations.clear();\n            this.decls = new Decls();\n            if (registered)\n                this.host.registriesChanged();\n            await Promise.allSettled([...this.#invocations, ...this.#stopped]);\n            await this.unwind(run).catch((cleanup) => this.host.report(cleanup));\n            throw error;\n        }\n        finally {\n            this.pending.delete(run.decls);\n        }\n    }\n    /**\n     * Runs the factory synchronously. With `previous`, runs in recording mode for a reload prepare. The run's\n     * declarations stay in `pending` (visible to the cycle check) until the caller installs or discards them.\n     */\n    run(service, previous) {\n        const self = new SelfImpl(this, previous);\n        const discard = (run) => {\n            this.pending.delete(run.decls);\n            void this.unwind(run).catch((cleanup) => this.host.report(cleanup));\n        };\n        this.pending.add(self.run(undefined).decls);\n        this.host.inFactory++;\n        let implementation;\n        try {\n            implementation = service.factory(this.input, this.principal, self);\n        }\n        catch (error) {\n            this.host.inFactory--;\n            discard(self.run(undefined));\n            throw error;\n        }\n        this.host.inFactory--;\n        const run = self.run(implementation);\n        try {\n            if (implementation instanceof Promise)\n                throw invalid(\"implementation\", `${this.typeName}: factories must be synchronous`);\n            validateImplementation(service, run.implementation);\n        }\n        catch (error) {\n            discard(run);\n            throw error;\n        }\n        return run;\n    }\n    /** Opens resources (dependencies first) and waits for references; settles all before failing. */\n    async open(resources, refs, signal) {\n        const opening = new Map();\n        const openOne = (resource) => {\n            let promise = opening.get(resource);\n            if (promise === undefined) {\n                promise = (async () => {\n                    await Promise.all(resource.deps.map((dep) => !(dep instanceof ResourceImpl) ? dep.ready : resources.includes(dep) ? openOne(dep) : undefined));\n                    await resource.open(signal, this.openOrder);\n                })();\n                opening.set(resource, promise);\n            }\n            return promise;\n        };\n        const ready = this.withinReadyTimeout(Promise.all(refs.map((ref) => ref.ready)), () => refs.filter((ref) => ref.status === \"loading\").map((ref) => ref.address));\n        const results = await Promise.allSettled([...resources.map(openOne), ready]);\n        const failure = results.find((result) => result.status === \"rejected\");\n        if (failure !== undefined)\n            throw failure.reason;\n    }\n    /**\n     * Waits until the state sources a run exposes or derives from have their values: a local object goes live only with\n     * its state, also where it forwards or derives from a remote reference's member.\n     */\n    async waitHydrated(run) {\n        const exposed = Object.entries(run.implementation ?? {});\n        const pending = unhydrated([...run.created.derives, ...exposed.map(([, value]) => value)]);\n        if (pending.length === 0)\n            return;\n        await this.withinReadyTimeout(Promise.all(pending.map((hydration) => hydration.whenHydrated())), () => [\n            ...exposed\n                .filter(([, value]) => hydrationOf(value)?.hydrated === false)\n                .map(([name]) => `${this.address}.${name}`),\n            ...run.created.derives\n                .filter((derived) => hydrationOf(derived) !== undefined)\n                .map((derived) => `derive ${derived.key}`),\n        ]);\n    }\n    /** `work` within the host's `readyTimeout`; a timeout names what is still awaited. */\n    async withinReadyTimeout(work, waiting) {\n        const ms = this.host.readyTimeout;\n        if (!Number.isFinite(ms))\n            return work;\n        let timer;\n        const timeout = new Promise((_, reject) => {\n            timer = setTimeout(() => {\n                const list = waiting();\n                reject(new ChordError(\"unavailable\", `${this.address} was not ready after ${ms} ms${list.length === 0 ? \"\" : `, waiting on ${list.join(\", \")}`} (a reference cycle across hosts?)`, { reason: \"ready_timeout\" }));\n            }, ms);\n            timer.unref?.();\n        });\n        timeout.catch(noop);\n        try {\n            return await Promise.race([work, timeout]);\n        }\n        finally {\n            clearTimeout(timer);\n        }\n    }\n    /**\n     * Fills the cells `run` created with `init`, each in a root of its own, in parallel; settles all before failing. Runs\n     * after the run's resources are open and its references live, before anything reads the cells.\n     */\n    async initCells(run, signal) {\n        if (run.created.inits.length === 0)\n            return;\n        const results = await Promise.allSettled(run.created.inits.map(async ([cell, init]) => {\n            const value = await this.host.root((ctx) => init(ctx), { signal });\n            if (!signal.aborted)\n                cell.initialize(value);\n        }));\n        const failure = results.find((result) => result.status === \"rejected\");\n        if (failure !== undefined)\n            throw failure.reason;\n    }\n    /** Undoes the objects a run created: closes its resources (reverse order) and releases its references. */\n    async unwind(run) {\n        for (const derived of run.created.derives)\n            derived.detach();\n        const resources = [...run.created.resources].sort((a, b) => this.openOrder.indexOf(b) - this.openOrder.indexOf(a));\n        await runAll([\n            ...resources.map((resource) => () => resource.close(this.openOrder)),\n            ...run.created.refs.map((ref) => () => ref.release()),\n        ], `${this.address}: cleanup failed`);\n    }\n    currentInstalled() {\n        return this.implementations.get(this.host.currentCodeVersion()) ?? [...this.implementations.values()].at(-1);\n    }\n    /** Every state source exposed as a remote state member gets that member's schema (checked per write in dev mode). */\n    refreshSchemas() {\n        const schemas = new Map();\n        for (const installed of this.implementations.values()) {\n            for (const [source, list] of memberSchemas(installed.service, installed.implementation)) {\n                schemas.set(source, [...(schemas.get(source) ?? []), ...list]);\n            }\n        }\n        for (const decls of this.allDecls()) {\n            for (const source of [...decls.cells.values(), ...decls.derives.values()])\n                source.schemas = schemas.get(source) ?? [];\n        }\n    }\n    allDecls() {\n        const result = new Set([this.decls, ...this.pending]);\n        for (const installed of this.implementations.values())\n            result.add(installed.decls);\n        return result;\n    }\n    // ─── runtime: listeners and tasks of the current declarations ───\n    /** The resource a listener is declared on, or its source itself. */\n    #origin(decl) {\n        return resourceOf(decl.source) ?? decl.source;\n    }\n    /** Resolves a listener's subscribable: `select(resource value)`, `select(source)` or the source itself. */\n    #listenSource(key, decl) {\n        const resource = resourceOf(decl.source);\n        const value = resource === undefined ? decl.source : resource.value;\n        const source = (decl.select === undefined ? value : decl.select(value));\n        if (typeof source?.subscribe !== \"function\")\n            throw invalid(\"implementation\", `listener ${key}: source has no subscribe()`);\n        return source;\n    }\n    /**\n     * Subscribes the listeners of `decls` without delivering: events are buffered until `activate`. A listener declared\n     * on the same resource (or source) with the same `select` keeps its subscription without calling `select` again\n     * (only its function is swapped, by name), so sources that accept a single subscriber survive reloads. Throws, with\n     * nothing left subscribed, if any source fails.\n     */\n    stageListeners(decls) {\n        const fresh = new Map();\n        const kept = new Set();\n        try {\n            for (const [key, decl] of decls.listeners) {\n                const origin = this.#origin(decl);\n                const previous = this.#subscriptions.get(key);\n                if (previous !== undefined && previous.origin === origin && sameSelect(previous.select, decl.select)) {\n                    kept.add(key);\n                    continue;\n                }\n                const source = this.#listenSource(key, decl);\n                const entry = {\n                    origin,\n                    select: decl.select,\n                    unsubscribe: noop,\n                    buffer: [],\n                };\n                fresh.set(key, entry);\n                // State (a readable) is subscribed when the listener activates: it delivers the value current then, not one\n                // of the candidate before the commit (a new derivation computes its value at the commit).\n                if (isSource(source) || isReadableLike(source)) {\n                    entry.buffer = undefined;\n                    entry.subscribe = () => {\n                        entry.unsubscribe = source.subscribe((event) => this.#deliver(key, event));\n                    };\n                    continue;\n                }\n                entry.unsubscribe = source.subscribe((event) => {\n                    if (entry.buffer !== undefined)\n                        entry.buffer.push(event);\n                    else\n                        this.#deliver(key, event);\n                });\n            }\n        }\n        catch (error) {\n            for (const entry of fresh.values())\n                entry.unsubscribe();\n            throw error;\n        }\n        return {\n            activate: () => {\n                for (const [key, subscription] of this.#subscriptions) {\n                    if (kept.has(key))\n                        continue;\n                    subscription.unsubscribe();\n                    this.#subscriptions.delete(key);\n                }\n                for (const [key, entry] of fresh) {\n                    this.#subscriptions.set(key, entry);\n                    entry.subscribe?.();\n                    const buffered = entry.buffer ?? [];\n                    entry.buffer = undefined;\n                    for (const event of buffered)\n                        this.#deliver(key, event);\n                }\n            },\n            discard: () => {\n                for (const entry of fresh.values())\n                    entry.unsubscribe();\n            },\n        };\n    }\n    startRuntime() {\n        this.stageListeners(this.decls).activate();\n        this.startTasks();\n    }\n    /**\n     * Starts the tasks of the current declarations. Runs aborted by `stopTasks` (a reload, a gate) may still be finishing:\n     * their replacements start once they all finished, or after `taskStopDeadline` (reported), so the old and the new run\n     * of a task never work side by side. A later start or stop, or the object leaving `live`, cancels a delayed start.\n     */\n    startTasks() {\n        const run = ++this.#taskRuns;\n        const start = () => {\n            for (const key of this.decls.tasks.keys())\n                this.#startTask(key, this.host.currentCodeVersion());\n        };\n        if (this.#stopped.size === 0) {\n            start();\n            return;\n        }\n        const deadline = this.host.taskStopDeadline;\n        let timer;\n        const late = new Promise((resolve) => {\n            timer = setTimeout(() => resolve(true), deadline);\n        });\n        const stopped = Promise.allSettled([...this.#stopped]).then(() => false);\n        void Promise.race([stopped, late]).then((missed) => {\n            clearTimeout(timer);\n            if (run !== this.#taskRuns || this.status !== \"live\")\n                return;\n            if (missed) {\n                this.host.report(new ChordError(\"aborted\", `${this.address}: aborted tasks still running after ${deadline} ms; starting their replacements anyway`));\n            }\n            start();\n        });\n    }\n    stopListeners() {\n        for (const subscription of this.#subscriptions.values())\n            subscription.unsubscribe();\n        this.#subscriptions.clear();\n    }\n    #startTask(key, codeVersion) {\n        const fn = this.decls.tasks.get(key);\n        if (fn === undefined)\n            return;\n        const controller = new AbortController();\n        const ctx = new CtxImpl(this.host, {\n            signals: [controller.signal, this.callAbort.signal],\n            rootId: `task:${this.address}:${key}`,\n            codeVersion,\n            principal: this.host.principal,\n            holder: true,\n        });\n        const done = (async () => {\n            try {\n                await fn(ctx);\n            }\n            catch (error) {\n                if (!ctx.signal.aborted)\n                    this.host.report(error);\n            }\n            finally {\n                ctx.close();\n                if (this.#tasks.get(key)?.controller === controller)\n                    this.#tasks.delete(key);\n            }\n        })();\n        this.#tasks.set(key, { controller, done });\n    }\n    /**\n     * Aborts running tasks (and cancels a delayed start). Their completion is awaited by the next `startTasks` and at\n     * disposal; each leaves `#stopped` when it finishes.\n     */\n    stopTasks() {\n        this.#taskRuns++;\n        for (const task of this.#tasks.values()) {\n            task.controller.abort(new ChordError(\"aborted\", \"task stopped\"));\n            const done = task.done;\n            this.#stopped.add(done);\n            void done.finally(() => this.#stopped.delete(done));\n        }\n        this.#tasks.clear();\n    }\n    /**\n     * Delivers one listener event, in publication order. The invocation is a root that references a lease on this object\n     * (a reload gate waits for it like for any other root that touched the object), counts as an invocation (disposal\n     * waits for it) and is cancelled by forced disposal.\n     */\n    #deliver(key, event) {\n        enqueue(() => {\n            if (this.gate !== undefined) {\n                this.gate.queue.push({ key, event });\n                return;\n            }\n            const decl = this.decls.listeners.get(key);\n            if (decl === undefined || (this.status !== \"live\" && this.status !== \"activating\"))\n                return;\n            const invocation = this.host.root((root) => {\n                this.lease(root);\n                const child = root.child(this);\n                return this.#invoke(async () => {\n                    try {\n                        await decl.fn(event, child);\n                    }\n                    finally {\n                        child.close();\n                    }\n                });\n            });\n            invocation.catch((error) => this.host.report(error));\n        });\n    }\n    /** Opens the object's gate and replays queued listener events through the current listeners. */\n    openGate() {\n        const gate = this.gate;\n        this.gate = undefined;\n        for (const { key, event } of gate?.queue ?? [])\n            this.#deliver(key, event);\n    }\n    // ─── calls ───\n    /** Admission for a call or write carrying `ctx`. */\n    admit(ctx) {\n        if (this.host.failed !== undefined) {\n            throw new ChordError(\"unavailable\", `${this.host.name} failed and admits no work`, { reason: \"host_failed\" });\n        }\n        if (!this.host.hasCodeVersion(ctx.codeVersion))\n            throw new ChordError(\"superseded\", `code version ${ctx.codeVersion} is retired`);\n        if (ctx.codeVersion < this.minCodeVersion) {\n            throw new ChordError(\"upgrade_conflict\", `${this.address} was upgraded in code version ${this.minCodeVersion}`);\n        }\n        if (this.gate !== undefined && !this.gate.grandfathered.has(ctx.rootId)) {\n            throw new ChordError(\"upgrade_conflict\", `${this.address} is being upgraded`);\n        }\n    }\n    /** Records that the root of `ctx` touched this object (a reload gate grandfathers it). */\n    lease(ctx) {\n        if (this.leases.has(ctx.rootId))\n            return;\n        this.leases.set(ctx.rootId, ctx.codeVersion);\n        this.host.touch(ctx.rootId, this);\n    }\n    guard = (ctx) => {\n        if (this.host.inFactory > 0)\n            throw invalid(\"read_only\", \"cells cannot be written while a factory runs\");\n        if (ctx instanceof CtxImpl)\n            ctx.check(this.host);\n        if (ctx.signal.aborted)\n            throw new ChordError(\"aborted\", \"write with an aborted ctx\");\n        if (this.status === \"disposed\")\n            throw new ChordError(\"gone\", `${this.address} is disposed`);\n        if (ctx.rootId.startsWith(\"task:\"))\n            return;\n        this.admit(ctx);\n    };\n    async call(ref, name, args, ctx) {\n        ctx.check(this.host);\n        if (ref.status === \"released\" || ref.status === \"gone\")\n            throw ref.terminalError();\n        if (ref.status === \"loading\")\n            await raceSignal(ref.ready, ctx.signal);\n        if (ref.status !== \"live\" || this.status !== \"live\") {\n            throw ref.status === \"live\"\n                ? new ChordError(\"gone\", `${this.address} is ${this.status}`)\n                : ref.terminalError();\n        }\n        this.admit(ctx);\n        const installed = this.implementations.get(ctx.codeVersion);\n        if (installed === undefined)\n            throw new ChordError(\"superseded\", `${this.address} has no implementation for code version ${ctx.codeVersion}`);\n        const view = ref.viewOf(installed);\n        const variant = variantOf(view);\n        const wanted = ref.describe(ref.contract.scope === \"remote\" ? variant : LOCAL_VARIANT, name);\n        const fn = view[name];\n        if (typeof fn !== \"function\" || (ref.contract.scope === \"remote\" && wanted?.kind !== \"method\")) {\n            throw new ChordError(\"not_in_variant\", `${this.address}: ${name} is not a method of variant ${variant ?? \"(local)\"}`);\n        }\n        const direct = view === installed.implementation;\n        const schema = direct\n            ? installed.service.contract.description.variants[variant ?? LOCAL_VARIANT]?.[name]\n            : wanted;\n        const method = schema?.kind === \"method\" ? schema : undefined;\n        const validated = ref.contract.scope === \"remote\" ? method : undefined;\n        // No arguments: the handler takes only ctx. No result (void): the caller gets undefined, whatever it returned.\n        const takesArgs = method === undefined || method.args !== undefined;\n        const returns = method === undefined || method.result !== undefined;\n        let input;\n        if (takesArgs) {\n            // The additive rule assumes a consumer sends only what its own schema knows, and a provider sees only what its\n            // schema knows: strip with both before validating.\n            const own = ref.contract.scope === \"remote\" && wanted?.kind === \"method\" ? wanted.args : undefined;\n            const sent = own === undefined ? args : Value.Clean(own, Value.Clone(args));\n            input = validated?.args ? Value.Clean(validated.args, Value.Clone(sent)) : sent;\n            if (validated?.args)\n                assertValid(\"args\", `${this.address}.${name} args`, validated.args, input);\n        }\n        this.lease(ctx);\n        const child = ctx.child(this);\n        let result;\n        try {\n            result = await this.#invoke(() => takesArgs\n                ? fn(input, child)\n                : fn(child));\n        }\n        finally {\n            child.close();\n        }\n        if (!returns)\n            return undefined;\n        if (validated?.result)\n            assertValid(\"result\", `${this.address}.${name} result`, validated.result, result);\n        return result;\n    }\n    /** Runs an invocation (method or listener) that keeps the object alive until it settles. */\n    #invoke(fn) {\n        const invocation = (async () => fn())();\n        this.#invocations.add(invocation);\n        const done = () => {\n            this.#invocations.delete(invocation);\n            if (this.#invocations.size === 0)\n                this.#maybeIdle();\n        };\n        invocation.then(done, done);\n        return invocation;\n    }\n    rootEnded(rootId) {\n        this.leases.delete(rootId);\n        const gate = this.gate;\n        if (gate?.grandfathered.delete(rootId) && gate.grandfathered.size === 0)\n            gate.drained();\n    }\n    // ─── lifetime ───\n    addRef(ref) {\n        this.refs.add(ref);\n        if (this.#linger !== undefined)\n            clearTimeout(this.#linger);\n        this.#linger = undefined;\n    }\n    release(ref) {\n        if (this.refs.delete(ref))\n            this.#maybeIdle();\n    }\n    /** No references and no invocations: dispose (after `linger` for a live object). */\n    #maybeIdle() {\n        if (this.refs.size > 0 || this.#invocations.size > 0 || this.#linger !== undefined)\n            return;\n        if (this.status === \"activating\") {\n            this.#background(this.dispose(false));\n            return;\n        }\n        if (this.status !== \"live\")\n            return;\n        const linger = this.service?.options.linger ?? 0;\n        if (linger <= 0) {\n            this.#background(this.dispose(false));\n            return;\n        }\n        this.#linger = setTimeout(() => {\n            this.#linger = undefined;\n            if (this.refs.size === 0 && this.#invocations.size === 0 && this.status === \"live\") {\n                this.#background(this.dispose(false));\n            }\n        }, linger);\n        this.#linger.unref?.();\n    }\n    #background(disposal) {\n        disposal.catch((error) => this.host.report(error));\n    }\n    /**\n     * Disposes the object. Forced: references become gone at once (new calls are rejected) and running invocations are\n     * cancelled. Either way, resources close only after every invocation settled.\n     */\n    dispose(forced, reason) {\n        this.#disposal ??= this.#dispose(forced, reason);\n        return this.#disposal;\n    }\n    async #dispose(forced, reason) {\n        const wasActivating = this.status === \"activating\";\n        this.status = \"disposing\";\n        this.host.forget(this);\n        if (this.#linger !== undefined)\n            clearTimeout(this.#linger);\n        this.#linger = undefined;\n        const error = reason ?? new ChordError(\"gone\", `${this.address} was disposed`);\n        if (forced) {\n            for (const ref of this.refs)\n                ref.gone(error);\n            this.callAbort.abort(error);\n        }\n        this.activationAbort.abort(error);\n        if (wasActivating)\n            await this.ready.catch(noop);\n        for (const ref of this.refs)\n            ref.gone(error);\n        const decls = this.allDecls();\n        this.stopTasks();\n        this.stopListeners();\n        await Promise.allSettled([...this.#invocations]);\n        const registered = [...decls].some((set) => set.registrations.size > 0) && !this.deferredRuntime;\n        this.implementations.clear();\n        this.decls = new Decls();\n        if (registered)\n            this.host.registriesChanged();\n        const refs = new Set();\n        for (const set of decls) {\n            for (const derived of set.derives.values())\n                derived.detach();\n            for (const ref of set.refs.values())\n                refs.add(ref);\n        }\n        try {\n            await runAll([\n                () => Promise.allSettled([...this.#stopped]),\n                ...[...this.openOrder].reverse().map((resource) => () => resource.close(this.openOrder)),\n                ...[...refs].map((ref) => () => ref.release()),\n            ], `${this.address}: disposal failed`);\n        }\n        finally {\n            this.status = \"disposed\";\n            this.host.disposed(this);\n        }\n    }\n}\nconst isReadableLike = (value) => value !== null &&\n    typeof value === \"object\" &&\n    typeof value.events === \"function\" &&\n    typeof value.subscribe === \"function\";\n/** The remote state-member schemas an implementation exposes, by source. */\nexport function memberSchemas(service, implementation) {\n    const schemas = new Map();\n    const contract = service.contract;\n    if (contract.scope !== \"remote\")\n        return schemas;\n    const members = contract.description.variants[variantOf(implementation) ?? \"\"] ?? {};\n    for (const [name, description] of Object.entries(members)) {\n        const source = implementation[name];\n        if (description.kind !== \"state\" || !isSource(source))\n            continue;\n        schemas.set(source, [...(schemas.get(source) ?? []), description.schema]);\n    }\n    return schemas;\n}\nfunction validateImplementation(service, implementation) {\n    const contract = service.contract;\n    const fail = (message) => {\n        throw invalid(\"implementation\", `${contract.name}: ${message}`);\n    };\n    if (implementation === null || typeof implementation !== \"object\")\n        fail(\"factory must return an object\");\n    let members;\n    if (contract.scope === \"remote\") {\n        const variant = implementation.variant;\n        if (typeof variant !== \"string\" || contract.description.variants[variant] === undefined)\n            fail(`unknown variant ${String(variant)}`);\n        members = contract.description.variants[variant];\n        for (const key of Object.keys(implementation))\n            if (key !== \"variant\" && members[key] === undefined)\n                fail(`${key} is not in variant ${String(variant)}`);\n    }\n    else {\n        members = contract.description.variants[LOCAL_VARIANT] ?? {};\n    }\n    for (const [name, description] of Object.entries(members)) {\n        const value = implementation[name];\n        if (description.kind === \"method\" && typeof value !== \"function\")\n            fail(`${name} must be a method`);\n        if (description.kind === \"state\" && !isSource(value) && !isReadableLike(value)) {\n            fail(`${name} must be a cell, a derivation or a held object's state member`);\n        }\n        if (description.kind === \"opaque\" && value === undefined)\n            fail(`${name} is missing`);\n    }\n}\n// ─── The factory's `self` ────────────────────────────────────────────────────\nclass SelfImpl {\n    #object;\n    #previous;\n    #decls = new Decls();\n    #created = { refs: [], resources: [], derives: [], inits: [] };\n    constructor(object, previous) {\n        this.#object = object;\n        this.#previous = previous;\n    }\n    run(implementation) {\n        return { implementation: implementation, decls: this.#decls, created: this.#created };\n    }\n    /** Refuses a second declaration of `name` of one kind in this run (TypeScript cannot see string names). */\n    #unique(map, kind, name) {\n        if (typeof name !== \"string\" || name === \"\")\n            throw new TypeError(`${kind} needs a name`);\n        if (map.has(name))\n            throw invalid(\"duplicate\", `${this.#object.typeName}: duplicate ${kind} name ${name}`);\n    }\n    state(name, schema, initial, options = {}) {\n        this.#unique(this.#decls.cells, \"state\", name);\n        const version = options.version ?? 1;\n        if (!Number.isInteger(version) || version < 1)\n            throw new TypeError(`state ${name}: version must be a positive integer`);\n        const host = this.#object.host;\n        // A JSON value never holds a function: an object with a function `init` is the initializer, not a value.\n        const init = isStateInit(initial) ? initial.init : undefined;\n        let cell = this.#previous?.cells.get(name);\n        if (cell === undefined) {\n            cell = new Cell(name, schema, init === undefined ? { value: initial } : undefined, this.#object.guard, {\n                dev: host.dev,\n                report: (error) => host.report(error),\n            });\n            if (init !== undefined)\n                this.#created.inits.push([cell, init]);\n        }\n        this.#decls.cells.set(name, cell);\n        this.#decls.cellSchemas.set(name, schema);\n        this.#decls.cellVersions.set(name, version);\n        if (options.migrate !== undefined)\n            this.#decls.cellMigrations.set(name, options.migrate);\n        return cell;\n    }\n    get(type, input, options) {\n        const host = this.#object.host;\n        // A prepare rerun (recording mode) binds new references against the reload's pending contracts: a breaking provider\n        // change and its updated consumer reload together.\n        const candidate = this.#previous !== undefined;\n        const address = host.addressOf(type, input, options?.principal ?? host.principal, candidate);\n        const declared = this.#decls.refs.get(address);\n        if (declared !== undefined) {\n            if (declared.contract.fingerprint !== type.fingerprint) {\n                throw invalid(\"duplicate\", `${this.#object.typeName}: ${type.name} held twice with different contracts`);\n            }\n            return declared.proxy;\n        }\n        const existing = this.#previous?.refs.get(address);\n        if (existing !== undefined &&\n            existing.contract.fingerprint === type.fingerprint &&\n            existing.status !== \"gone\" &&\n            existing.status !== \"released\") {\n            this.#decls.refs.set(address, existing);\n            return existing.proxy;\n        }\n        const ref = host.acquire(type, input, options, \"object\", this.#object, candidate);\n        this.#decls.refs.set(address, ref);\n        this.#created.refs.push(ref);\n        return ref.proxy;\n    }\n    resource(name, declaration) {\n        this.#unique(this.#decls.resources, \"resource\", name);\n        if (!Number.isInteger(declaration.version))\n            throw new TypeError(`resource ${name}: version must be an integer`);\n        const deps = (declaration.deps ?? []).map((dep) => {\n            const resolved = refOf(dep) ?? resourceOf(dep);\n            if (resolved === undefined) {\n                throw new TypeError(`resource ${name}: deps must be references or resources of this object`);\n            }\n            return resolved;\n        });\n        const existing = this.#previous?.resources.get(name);\n        const kept = existing !== undefined &&\n            existing.spec.version === declaration.version &&\n            existing.exclusive === (declaration.exclusive === true) &&\n            existing.deps.length === deps.length &&\n            existing.deps.every((dep, index) => dep === deps[index]);\n        const resource = kept ? existing : new ResourceImpl(name, declaration, deps);\n        if (kept)\n            this.#decls.adopted.set(existing, declaration);\n        else\n            this.#created.resources.push(resource);\n        this.#decls.resources.set(name, resource);\n        return new ResourceFacade(resource, this.#object.host);\n    }\n    on(name, source, ...rest) {\n        this.#unique(this.#decls.listeners, \"listener\", name);\n        const [select, fn] = rest.length === 1 ? [undefined, rest[0]] : [rest[0], rest[1]];\n        if (typeof fn !== \"function\")\n            throw new TypeError(`listener ${name}: the handler must be a function`);\n        if (select !== undefined && typeof select !== \"function\")\n            throw new TypeError(`listener ${name}: select must be a function`);\n        this.#decls.listeners.set(name, {\n            source,\n            select: select,\n            fn: fn,\n        });\n    }\n    task(fn) {\n        if (typeof fn !== \"function\")\n            throw new TypeError(\"a task must be a function\");\n        this.#decls.tasks.set(`#${this.#decls.tasks.size}`, fn);\n    }\n    derive(sources, fn) {\n        if (typeof fn !== \"function\")\n            throw new TypeError(\"a derivation needs a function\");\n        const host = this.#object.host;\n        const key = `#${this.#decls.derives.size}`;\n        const derived = new Derived(key, sources, fn, {\n            dev: host.dev,\n            report: (error) => host.report(error),\n        });\n        this.#created.derives.push(derived);\n        this.#decls.derives.set(key, derived);\n        return derived;\n    }\n    expose(resource) {\n        const resolved = resourceOf(resource);\n        if (resolved === undefined || ![...this.#decls.resources.values()].includes(resolved)) {\n            throw new TypeError(\"expose takes a resource declared by this object\");\n        }\n        return new ExposedImpl(resolved);\n    }\n    register(registry, entries) {\n        if (!this.#object.hostLifetime)\n            throw invalid(\"not_host_lifetime\", `${this.#object.typeName}: only objects of lifetime \"host\" may register`);\n        for (const [key, value] of Object.entries(entries)) {\n            const id = `${registry.name}\\u0000${key}`;\n            this.#unique(this.#decls.registrations, \"register\", id);\n            this.#decls.registrations.set(id, { registry: registry, key, value });\n        }\n    }\n}\n//# sourceMappingURL=object.js.map","import { bind, coverage } from \"./contract.js\";\nimport { asChordError, ChordError, invalid, isChordError } from \"./errors.js\";\nimport { hostLifetime, makeService, memberSchemas, RefImpl, } from \"./object.js\";\nimport { holdPublications } from \"./publish.js\";\nimport { assertValid, deepEqual } from \"./schema.js\";\n/**\n * Computes the new derivation functions over the candidate values and validates every prospective value (migrated\n * cells and derivations) against every schema that will apply after the commit: the cell's new schema and the new\n * implementation's remote state-member schemas. A failure fails prepare; the commit then installs without re-checking.\n */\nfunction dryRun(candidate) {\n    const { run, migrated, service, object } = candidate;\n    const exposed = memberSchemas(service, run.implementation);\n    for (const [cell, value] of migrated) {\n        for (const schema of exposed.get(cell) ?? [])\n            assertValid(\"state\", `${object.address}: migrated state ${cell.key}`, schema, value);\n    }\n    const values = new Map(migrated);\n    const derives = [...run.decls.derives].sort(([, a], [, b]) => a.seq - b.seq);\n    for (const [name, derived] of derives) {\n        const value = derived.compute((source) => (values.has(source) ? values.get(source) : candidateValue(source)));\n        for (const schema of exposed.get(derived) ?? [])\n            assertValid(\"state\", `${object.address}: derivation ${name}`, schema, value);\n        values.set(derived, value);\n    }\n    candidate.derived = values;\n}\n/**\n * A source's value for a dry run. A reference to a provider this reload upgrades too reads nothing before the commit\n * (its new contract does not bind the old code): the dry run computes without it, the commit with the real value.\n */\nfunction candidateValue(source) {\n    try {\n        return source.value;\n    }\n    catch (error) {\n        if (isChordError(error, \"not_ready\") || isChordError(error, \"not_in_variant\"))\n            return undefined;\n        throw error;\n    }\n}\n/** A reload error keeps the underlying code (`contract_mismatch`, `invalid`, ...) and says it aborted the reload. */\nexport function reloadError(error) {\n    const cause = asChordError(error, \"reload\");\n    if (/^reload aborted/.test(cause.message.replace(/^[^:]*: /, \"\")))\n        return cause;\n    return new ChordError(cause.code, `reload aborted: ${cause.message}`, {\n        cause,\n        reason: cause.reason,\n        details: cause.details,\n    });\n}\n/** Serialized: a second reload while one runs is rejected. */\nexport async function runReload(host, plugins, options) {\n    const reload = await beginReload(host, plugins, options);\n    try {\n        await reload.prepare();\n        return reload.commit();\n    }\n    finally {\n        endReload(host);\n    }\n}\n/** Takes the host's reload slot and loads the plugin modules. Pair with `endReload`. */\nexport async function beginReload(host, plugins, options, codeVersion) {\n    if (host.reloading) {\n        throw new ChordError(\"unavailable\", \"a reload is already running\", { reason: \"reload_running\" });\n    }\n    host.reloading = true;\n    try {\n        return new Reload(host, await host.resolve(plugins), options, codeVersion);\n    }\n    catch (error) {\n        host.reloadEnded();\n        throw reloadError(error);\n    }\n}\nexport function endReload(host) {\n    host.reloadEnded();\n}\n/** Most milliseconds a forced retirement waits for aborted roots to settle before it closes what they used. */\nconst ABORTED_ROOTS_GRACE = 1000;\n/** Resolves true once `ready()` holds (checked whenever retirement-relevant state changes), false after `ms`. */\nfunction until(host, ready, ms) {\n    if (ready())\n        return Promise.resolve(true);\n    return new Promise((resolve) => {\n        const timer = setTimeout(() => {\n            stop();\n            resolve(false);\n        }, ms);\n        const stop = host.watchRetirement(() => {\n            if (!ready())\n                return;\n            clearTimeout(timer);\n            stop();\n            resolve(true);\n        });\n    });\n}\n/** One reload on one host: `prepare` (load, prepare, gate), then `commit` or `rollback`. */\nexport class Reload {\n    host;\n    facets;\n    options;\n    /** Code version id to commit (issued by the coordinating server); a local reload allocates one. */\n    codeVersion;\n    candidates = new Map();\n    abort = new AbortController();\n    closed = [];\n    services = new Map();\n    changed = new Set();\n    removed = new Set();\n    tables = new Map();\n    gated = [];\n    rolledBack = false;\n    /** Objects of types this reload adds, with their staged listeners: their runtime starts at commit. */\n    deferred = new Map();\n    /** This reload's run of each facet it loads (`FacetApi.signal`): installed at commit, aborted at rollback. */\n    facetRuns = new Map();\n    constructor(host, facets, options, codeVersion) {\n        this.host = host;\n        this.facets = facets;\n        this.options = options;\n        this.codeVersion = codeVersion;\n    }\n    /** Everything up to the commit. On failure the host is rolled back and the underlying error is thrown. */\n    async prepare() {\n        try {\n            await this.waitForRetirement();\n            this.load();\n            this.checkProviders();\n            await this.prepareAll();\n            // From here new objects of changed types are rejected (upgrade_conflict, retryable) until commit or abort,\n            // so the candidate set is final once the activations already in flight have been prepared.\n            this.host.gating = this.changed;\n            await this.withDeadline(this.prepareAll(), \"activations in flight did not finish\");\n            this.checkRefs();\n            this.tables = this.host.buildTables(this.entries());\n            await this.gate();\n            this.#alive();\n            this.#stage();\n        }\n        catch (error) {\n            await this.rollback();\n            throw reloadError(error);\n        }\n    }\n    /** What a successful prepare will commit (a child sends it with its vote). */\n    summary() {\n        const live = [...this.candidates.values()].filter(({ object }) => object.status === \"live\");\n        return {\n            codeVersion: this.host.pending?.id ?? this.host.current.id,\n            previous: this.host.current.id,\n            changed: [...this.changed],\n            removed: [...this.removed],\n            prepared: live.map(({ object }) => object.address),\n            gated: this.gated.map(({ object }) => object.address),\n        };\n    }\n    /** After every await of prepare: a rollback meanwhile (abort from the coordinator) ends it. */\n    #alive() {\n        if (this.rolledBack)\n            throw new ChordError(\"aborted\", \"reload aborted while preparing\", { reason: \"aborted\" });\n    }\n    /**\n     * Subscribes every new listener now, buffering its events, so a failing source fails prepare instead of leaving a\n     * half-installed code version. Objects running only the new code (types this reload adds) are staged too.\n     */\n    #stage() {\n        for (const candidate of this.candidates.values()) {\n            if (candidate.object.status === \"live\")\n                candidate.staged = candidate.object.stageListeners(candidate.run.decls);\n        }\n        for (const object of this.host.objects.values()) {\n            if (object.status === \"live\" && object.deferredRuntime)\n                this.deferred.set(object, object.stageListeners(object.decls));\n        }\n    }\n    /**\n     * Retires the previous code version before loading the next one (a host keeps two). Waits until its roots ended and,\n     * on a child host, its parent retired it too (`retire` frame), at most `retireDeadline`. Past the deadline it is\n     * retired anyway: its remaining roots are aborted first and get a short grace to stop, so they see cancellation\n     * before the resources only that code version used are closed; their next call is `superseded`.\n     */\n    async waitForRetirement() {\n        const host = this.host;\n        const previous = host.previous;\n        if (previous === undefined)\n            return;\n        const deadline = this.options.retireDeadline ?? 5000;\n        const gone = () => host.previous !== previous;\n        if (!(await until(host, () => gone() || host.retirable(), deadline)) && !gone()) {\n            previous.abort.abort(new ChordError(\"superseded\", `code version ${previous.id} was retired`));\n            await until(host, () => gone() || previous.roots.size === 0, Math.min(deadline, ABORTED_ROOTS_GRACE));\n        }\n        if (!gone())\n            host.retire();\n    }\n    /** Builds the candidate service table: unchanged services plus everything the given facets serve. */\n    load() {\n        const replaced = new Set([...this.facets.map((facet) => facet.name), ...(this.options.remove ?? [])]);\n        const current = this.host.current.services;\n        this.services = new Map([...current].filter(([, service]) => !replaced.has(service.facet)));\n        for (const facet of this.facets) {\n            const run = new AbortController();\n            this.facetRuns.set(facet.name, run);\n            facet.setup(this.host.facetApi(((type, factory, options = {}) => this.host.serveInto(this.services, makeService(type, factory, options, facet.name))), run.signal));\n        }\n        for (const [name, service] of this.services)\n            if (current.get(name) !== service)\n                this.changed.add(name);\n        for (const name of current.keys())\n            if (!this.services.has(name))\n                this.removed.add(name);\n        this.host.pending = {\n            id: this.host.nextCodeVersionId(this.codeVersion),\n            services: this.services,\n            tables: new Map(),\n            roots: new Map(),\n            abort: new AbortController(),\n        };\n    }\n    async withDeadline(promise, what) {\n        const deadline = this.options.gateDeadline ?? 5000;\n        let timer;\n        const timeout = new Promise((_, reject) => {\n            timer = setTimeout(() => reject(new ChordError(\"aborted\", `${what} within ${deadline} ms`, { reason: \"deadline\" })), deadline);\n        });\n        try {\n            return await Promise.race([promise, timeout]);\n        }\n        finally {\n            clearTimeout(timer);\n        }\n    }\n    /** Same contract version must cover the old description (forgotten bump); facets' `uses` must bind. */\n    checkProviders() {\n        for (const name of this.changed) {\n            const next = this.services.get(name).contract;\n            const old = this.host.current.services.get(name)?.contract;\n            if (old === undefined || old.version !== next.version)\n                continue;\n            const reason = coverage(next.description, old.description);\n            if (reason !== undefined) {\n                throw new ChordError(\"contract_mismatch\", `${name}@${next.version} changed incompatibly without a version bump (${reason})`);\n            }\n        }\n        const facets = new Map(this.host.facets);\n        for (const facet of this.facets)\n            facets.set(facet.name, facet);\n        for (const name of this.options.remove ?? [])\n            facets.delete(name);\n        for (const facet of facets.values()) {\n            for (const token of facet.uses ?? []) {\n                const service = this.services.get(token.name);\n                if (service !== undefined && this.changed.has(token.name))\n                    bind(service.contract, service.options.accepts, token);\n            }\n        }\n    }\n    /**\n     * Prepares every live object of a changed type, including objects that activate meanwhile, to a fixpoint. Objects\n     * already running the new code (types this reload adds) are skipped.\n     */\n    async prepareAll() {\n        for (;;) {\n            const todo = [...this.host.objects.values()].filter((object) => this.changed.has(object.typeName) &&\n                !this.candidates.has(object) &&\n                object.service !== this.services.get(object.typeName) &&\n                (object.status === \"live\" || object.status === \"activating\"));\n            if (todo.length === 0)\n                return;\n            await Promise.allSettled(todo.map((object) => object.ready));\n            this.#alive();\n            for (const object of todo) {\n                if (object.status === \"live\" && object.service !== this.services.get(object.typeName)) {\n                    await this.prepareObject(object);\n                    this.#alive();\n                }\n            }\n        }\n    }\n    /** Runs the new factory in recording mode and opens what can be opened without the gate. */\n    async prepareObject(object) {\n        const service = this.services.get(object.typeName);\n        const run = object.run(service, object.decls);\n        const candidate = {\n            object,\n            service,\n            run,\n            reasons: [],\n            atGate: [],\n            replaced: [],\n            migrated: new Map(),\n            derived: new Map(),\n            staged: undefined,\n        };\n        this.candidates.set(object, candidate);\n        // Each cell carries its own version: a raised one gates and migrates, a schema change without one is refused.\n        for (const [name, cell] of run.decls.cells) {\n            if (object.decls.cells.get(name) !== cell)\n                continue;\n            const from = object.decls.cellVersions.get(name) ?? 1;\n            const to = run.decls.cellVersions.get(name) ?? 1;\n            if (to < from)\n                throw invalid(\"state\", `${object.address}: version of state ${name} lowered from ${from} to ${to}`);\n            if (to > from)\n                candidate.reasons.push(`state ${name} version ${from} -> ${to}`);\n            else if (!deepEqual(cell.schema, run.decls.cellSchemas.get(name)))\n                throw invalid(\"state\", `${object.address}: schema of state ${name} changed without a version bump`);\n        }\n        const deferred = new Set();\n        for (const resource of run.created.resources) {\n            if (resource.exclusive || resource.deps.some((dep) => deferred.has(dep)))\n                deferred.add(resource);\n        }\n        for (const resource of deferred) {\n            candidate.atGate.push(resource);\n            const old = object.decls.resources.get(resource.key);\n            if (resource.exclusive && old?.exclusive && old.state === \"open\")\n                candidate.replaced.push(old);\n        }\n        if (deferred.size > 0)\n            candidate.reasons.push(\"exclusive resource replaced\");\n        await object.open(run.created.resources.filter((resource) => !deferred.has(resource)), run.created.refs, this.abort.signal);\n        await object.waitHydrated(run);\n        // Cells this reload adds read their first value once the new resources are open (gated objects: at the gate);\n        // the derivations over them are checked after.\n        if (candidate.reasons.length === 0) {\n            await object.initCells(run, this.abort.signal);\n            dryRun(candidate);\n        }\n    }\n    /**\n     * Every reference that survives into the new code version must bind to the new provider. Browser references don't block a\n     * reload: after the commit they get `upgrade_required` instead.\n     */\n    checkRefs() {\n        const dropped = new Set();\n        for (const { object, run } of this.candidates.values()) {\n            for (const ref of object.decls.refs.values())\n                if (![...run.decls.refs.values()].includes(ref))\n                    dropped.add(ref);\n        }\n        for (const object of this.host.objects.values()) {\n            const service = this.services.get(object.typeName);\n            if (service === undefined || !this.changed.has(object.typeName))\n                continue;\n            for (const ref of object.refs) {\n                // The host's bootstrap reference follows this provider at commit; it is not an old-code consumer.\n                if (ref === this.host.hostObjects.get(object.typeName))\n                    continue;\n                if (!dropped.has(ref) && ref.owner !== \"client\")\n                    bind(service.contract, service.options.accepts, ref.contract);\n            }\n        }\n    }\n    entries() {\n        return this.host\n            .liveDecls(true)\n            .filter(([object]) => !this.removed.has(object.typeName))\n            .map(([object, decls]) => [object, this.candidates.get(object)?.run.decls ?? decls]);\n    }\n    /**\n     * Admission cut, wait for grandfathered roots (deadline), replace exclusive resources, migrate into private\n     * copies. Old tasks of gated objects are stopped at the cut; listener events are queued until commit or abort.\n     */\n    async gate() {\n        this.gated = [...this.candidates.values()].filter((candidate) => candidate.reasons.length > 0 && candidate.object.status === \"live\");\n        const drained = this.gated.map(({ object }) => {\n            const grandfathered = new Set(object.leases.keys());\n            return new Promise((resolve) => {\n                object.gate = { grandfathered, queue: [], drained: resolve };\n                object.stopTasks();\n                if (grandfathered.size === 0)\n                    resolve();\n            });\n        });\n        const deadline = this.options.gateDeadline ?? 5000;\n        let timer;\n        const timedOut = await Promise.race([\n            Promise.all(drained).then(() => false),\n            new Promise((resolve) => {\n                timer = setTimeout(() => resolve(true), deadline);\n            }),\n        ]);\n        clearTimeout(timer);\n        if (timedOut) {\n            const blocking = this.gated.flatMap(({ object }) => [...(object.gate?.grandfathered ?? [])]);\n            throw new ChordError(\"aborted\", `gate deadline (${deadline} ms) missed; blocking roots: ${blocking.join(\", \")}`, {\n                reason: \"gate_deadline\",\n                details: { blocking },\n            });\n        }\n        this.#alive();\n        for (const candidate of this.gated) {\n            const { object } = candidate;\n            for (const old of candidate.replaced) {\n                // Owned by the rollback before closing: a failing close must still be restored.\n                this.closed.push([object, old]);\n                await old.close(object.openOrder);\n            }\n            await object.open(candidate.atGate, [], this.abort.signal);\n            this.#alive();\n            await object.initCells(candidate.run, this.abort.signal);\n            this.#alive();\n        }\n        for (const candidate of this.gated)\n            this.migrate(candidate);\n    }\n    migrate(candidate) {\n        const { object, run } = candidate;\n        for (const [name, cell] of run.decls.cells) {\n            if (object.decls.cells.get(name) !== cell)\n                continue;\n            const schema = run.decls.cellSchemas.get(name);\n            const from = object.decls.cellVersions.get(name) ?? 1;\n            const fn = run.decls.cellMigrations.get(name);\n            let value;\n            if ((run.decls.cellVersions.get(name) ?? 1) > from && fn !== undefined)\n                value = fn(structuredClone(cell.value), from);\n            else if (!deepEqual(cell.schema, schema))\n                value = cell.value;\n            else\n                continue;\n            assertValid(\"state\", `${object.address}: migrated state ${name}`, schema, value);\n            candidate.migrated.set(cell, value);\n        }\n        dryRun(candidate);\n    }\n    async rollback() {\n        if (this.rolledBack)\n            return;\n        this.rolledBack = true;\n        this.abort.abort(new ChordError(\"aborted\", \"reload aborted\"));\n        for (const run of this.facetRuns.values())\n            run.abort(new ChordError(\"aborted\", \"reload aborted\"));\n        const report = (error) => this.host.report(error);\n        for (const candidate of this.candidates.values())\n            candidate.staged?.discard();\n        for (const staged of this.deferred.values())\n            staged.discard();\n        for (const { object, run } of this.candidates.values()) {\n            object.pending.delete(run.decls);\n            await object.unwind(run).catch(report);\n        }\n        // Replaced exclusive resources are restored; one that cannot be is marked unavailable, never silently closed.\n        for (const [object, resource] of this.closed) {\n            if (resource.state !== \"closed\")\n                continue;\n            await resource.open(new AbortController().signal, object.openOrder).catch((error) => {\n                resource.markUnavailable();\n                report(new ChordError(\"unavailable\", `${object.address}: resource ${resource.key} could not be restored`, {\n                    cause: error,\n                }));\n            });\n        }\n        for (const { object } of this.gated) {\n            if (object.gate === undefined)\n                continue;\n            object.openGate();\n            object.startTasks();\n        }\n        // Objects of types this reload would have added lose their code.\n        const reason = new ChordError(\"gone\", \"reload aborted; type not served\");\n        for (const object of [...this.host.objects.values()]) {\n            if (!this.host.current.services.has(object.typeName))\n                await object.dispose(true, reason).catch(report);\n        }\n        this.host.pending = undefined;\n        this.host.gating = undefined;\n    }\n    /**\n     * Publishes the new code version in one synchronous step. Everything fallible ran in prepare (factories, opens,\n     * migration and derivation checks against the prospective schemas, listener subscriptions), so this only installs.\n     * Observers (state, shapes, registries, listener roots) are notified after the whole step. If an install still\n     * throws, the code version is half-published: the host fails terminally and admits no more work.\n     */\n    commit(beforeStart) {\n        try {\n            return holdPublications(() => {\n                const report = this.#publish();\n                // Installed, not yet started: the coordinator queues its commit frames here, so nothing this code version\n                // starts (tasks, host object activations, then the held listener/registry/state notifications) can reach a child\n                // first.\n                beforeStart?.();\n                for (const start of this.#starts.splice(0))\n                    start();\n                return report;\n            });\n        }\n        catch (error) {\n            this.host.fail(error);\n            throw reloadError(error);\n        }\n    }\n    /** Work that may start new-code-version roots, run after installation (and after the coordinator's commit frames). */\n    #starts = [];\n    #publish() {\n        const host = this.host;\n        const previous = host.current;\n        const next = host.pending;\n        host.pending = undefined;\n        host.codeVersions.set(next.id, next);\n        host.previous = previous;\n        host.current = next;\n        const prepared = [];\n        for (const object of [...host.objects.values()]) {\n            if (this.removed.has(object.typeName))\n                continue;\n            const candidate = this.candidates.get(object);\n            if (candidate === undefined) {\n                const installed = object.implementations.get(previous.id);\n                if (installed !== undefined)\n                    object.implementations.set(next.id, { ...installed, codeVersion: next.id });\n                continue;\n            }\n            if (object.status !== \"live\")\n                continue;\n            this.install(candidate, next.id);\n            prepared.push(object.address);\n        }\n        for (const { object, run, staged } of this.candidates.values()) {\n            if (object.status === \"live\")\n                continue;\n            staged?.discard();\n            object.pending.delete(run.decls);\n            object.unwind(run).catch((error) => host.report(error));\n        }\n        // Objects of types this reload adds start their runtime now.\n        for (const [object, staged] of this.deferred) {\n            if (object.status !== \"live\") {\n                staged.discard();\n                continue;\n            }\n            object.deferredRuntime = false;\n            staged.activate();\n            this.#starts.push(() => object.startTasks());\n        }\n        host.installTables(next, this.tables, true);\n        const reason = new ChordError(\"gone\", \"type no longer served\");\n        for (const object of [...host.objects.values()]) {\n            if (this.removed.has(object.typeName))\n                object.dispose(true, reason).catch((error) => host.report(error));\n        }\n        for (const name of this.removed)\n            host.hostObjects.delete(name);\n        for (const facet of this.facets)\n            host.facets.set(facet.name, facet);\n        for (const name of this.options.remove ?? [])\n            host.facets.delete(name);\n        // The replaced and removed runs' signals abort after the install, like other observers.\n        for (const [name, run] of this.facetRuns)\n            this.#starts.push(() => host.facetRunChanged(name, run));\n        for (const name of this.options.remove ?? [])\n            this.#starts.push(() => host.facetRunChanged(name, undefined));\n        host.gating = undefined;\n        for (const [name, service] of this.services) {\n            if (hostLifetime(service) && this.changed.has(name) && host.hostObjects.get(name)?.object?.status !== \"live\") {\n                this.#starts.push(() => host.startHostObject(service));\n            }\n            // A type whose lifetime became \"referenced\" lives on only while someone else references its object.\n            const pinned = host.hostObjects.get(name);\n            if (!hostLifetime(service) && pinned !== undefined) {\n                host.hostObjects.delete(name);\n                this.#starts.push(() => pinned.release());\n            }\n        }\n        return {\n            codeVersion: next.id,\n            previous: previous.id,\n            changed: [...this.changed],\n            removed: [...this.removed],\n            prepared,\n            gated: this.gated.map(({ object }) => object.address),\n        };\n    }\n    install(candidate, codeVersion) {\n        const { object, run, service } = candidate;\n        const gated = candidate.reasons.length > 0;\n        object.pending.delete(run.decls);\n        object.stopTasks();\n        if (gated) {\n            // Old derivations would compute over migrated values; the old implementation can no longer run anyway.\n            const kept = new Set(run.decls.derives.values());\n            for (const derived of object.decls.derives.values())\n                if (!kept.has(derived))\n                    derived.detach();\n        }\n        object.decls = run.decls;\n        object.service = service;\n        // Kept resources close with the new code's `close`; replaced ones keep their own (closed at retirement).\n        for (const [resource, declaration] of run.decls.adopted)\n            resource.adopt(declaration);\n        object.implementations.set(codeVersion, {\n            codeVersion,\n            service,\n            implementation: run.implementation,\n            decls: run.decls,\n        });\n        if (gated) {\n            // Old code can never run over migrated state: drop the previous implementation now, not at retirement.\n            object.minCodeVersion = codeVersion;\n            for (const old of [...object.implementations.keys()])\n                if (old !== codeVersion)\n                    this.host.retireImplementation(object, old);\n        }\n        // Schemas first, then the values validated against them in prepare.\n        object.refreshSchemas();\n        for (const [name, cell] of run.decls.cells) {\n            const schema = run.decls.cellSchemas.get(name);\n            if (candidate.migrated.has(cell))\n                cell.reset(candidate.migrated.get(cell), schema);\n            else\n                cell.schema = schema;\n        }\n        const created = new Set(run.created.derives);\n        for (const derived of run.created.derives)\n            derived.attach(candidate.derived);\n        for (const derived of run.decls.derives.values())\n            if (!created.has(derived))\n                derived.refresh();\n        candidate.staged?.activate();\n        this.#starts.push(() => object.startTasks());\n        object.openGate();\n        const pinned = this.host.hostObjects.get(object.typeName);\n        if (pinned?.object === object && pinned.contract.fingerprint !== service.contract.fingerprint) {\n            const replacement = new RefImpl(object, service.contract, \"host\");\n            // Acquire first: releasing the only reference must not dispose/reopen the surviving host object.\n            object.addRef(replacement);\n            this.host.hostObjects.set(object.typeName, replacement);\n            pinned.release();\n        }\n        for (const ref of [...object.refs]) {\n            // Browser references whose contract no longer binds are told to reload their code (they never block a reload).\n            if (ref.owner === \"client\") {\n                try {\n                    bind(service.contract, service.options.accepts, ref.contract);\n                }\n                catch (error) {\n                    ref.gone(new ChordError(\"upgrade_required\", `${object.typeName} changed; reload the web facets`, {\n                        cause: error,\n                    }));\n                    object.release(ref);\n                    continue;\n                }\n            }\n            ref.shapeChanged();\n        }\n    }\n}\n//# sourceMappingURL=reload.js.map","import { Type } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport { DescriptionSchema } from \"./contract.js\";\nimport { CHORD_ERROR_CODES, ChordError } from \"./errors.js\";\n// JSON frames between two hosts (or a host and a client). Ids are chosen by the side that creates the hold, call or\n// subscription; every frame type has one direction, so ids never collide:\n//   consumer → provider: hold, release, call, cancel, sub, unsub, resync\n//   provider → consumer: shape, gone, result, state\n// State is addressed by (hold id, member): a hold implies the state of its variant, sent as units (a shape followed by\n// a snapshot of each member the consumer lacks; see Connection).\n//   both: hello, ping, pong, bye, root_end, ack; parent → child: invalidate, prepare, commit, abort, retire;\n//   child → parent: vote\n//\n// Each frame is declared once, as the schema every received frame is checked against (`isFrame`); the types are derived\n// from it. Payloads (hold inputs, call args, results, snapshots) stay `unknown`: they are validated where they are\n// used, against the contract. State ops are checked op by op by the delta decoder.\n/**\n * The link protocol version, announced in `hello`. Peers of different versions do not talk: the side that notices\n * closes the link with reason `protocol-version <its version>`, so the other side learns it too\n * (`LinkOptions.onProtocolMismatch`).\n */\nexport const PROTOCOL_VERSION = 4;\nconst Id = Type.Integer({ minimum: 1 });\nconst Name = Type.String({ minLength: 1 });\nconst Reload = Type.Integer({ minimum: 1 });\n/** Arrays a sender may pass as readonly. */\nconst List = (item) => Type.Immutable(Type.Array(item));\nconst RootRefSchema = Type.Object({ rootId: Name, codeVersion: Type.Integer({ minimum: 1 }) });\nconst WireErrorSchema = Type.Object({\n    code: Type.Enum(CHORD_ERROR_CODES),\n    message: Type.String(),\n    reason: Type.Optional(Type.String()),\n});\nconst WireReloadOptionsSchema = Type.Object({\n    remove: Type.Optional(List(Type.String())),\n    gateDeadline: Type.Optional(Type.Number()),\n    retireDeadline: Type.Optional(Type.Number()),\n});\n/** A child's prepared reload, sent with its vote (same fields as `ReloadReport`, without children). */\nconst WireReloadReportSchema = Type.Object({\n    codeVersion: Type.Integer(),\n    previous: Type.Integer(),\n    changed: List(Type.String()),\n    removed: List(Type.String()),\n    prepared: List(Type.String()),\n    gated: List(Type.String()),\n});\nconst FrameSchema = Type.Union([\n    Type.Object({\n        t: Type.Literal(\"hello\"),\n        /** The link protocol version (`PROTOCOL_VERSION`; absent: 1). Peers of another version close the link. */\n        protocol: Type.Optional(Type.Integer({ minimum: 1 })),\n        name: Name,\n        kind: Type.Union([Type.Literal(\"host\"), Type.Literal(\"client\")]),\n        codeVersion: Type.Integer({ minimum: 0 }),\n        /** The sender acknowledges what it receives (`ack`). Flow control applies only when both hellos say so. */\n        acks: Type.Optional(Type.Boolean()),\n    }),\n    /** Every frame received so far except `ack` frames, counted from the link's start, once processed. */\n    Type.Object({ t: Type.Literal(\"ack\"), n: Type.Integer({ minimum: 1 }) }),\n    Type.Object({\n        t: Type.Literal(\"hold\"),\n        id: Id,\n        /**\n         * Target host name, resolved by the consumer from the token's `host` and `input`. Relays route on it after\n         * checking it against both; the target refuses an input its own contract places elsewhere.\n         */\n        at: Name,\n        /** The consumer's contract token; the provider checks that it covers it. Remote tokens carry `host`. */\n        token: DescriptionSchema,\n        /** Normalized with the consumer's contract. */\n        input: Type.Unknown(),\n        /** A forwarded principal. Honored only on frames from the parent link. */\n        principal: Type.Optional(Type.Unknown()),\n        /**\n         * The client connection the hold comes from: an opaque id the server assigned to it, forwarded by relays. Honored\n         * only on frames from the parent link; present means the hold is a client's (not a reload participant).\n         */\n        origin: Type.Optional(Name),\n        /** False: no state for this hold until `sub` (a method-only binding). */\n        state: Type.Optional(Type.Literal(false)),\n        /** The consumer already has values (a re-hold after a link loss): its unit is not urgent. */\n        again: Type.Optional(Type.Literal(true)),\n    }),\n    Type.Object({ t: Type.Literal(\"release\"), id: Id }),\n    Type.Object({\n        t: Type.Literal(\"shape\"),\n        id: Id,\n        variant: Type.Optional(Type.String()),\n        members: List(Type.String()),\n        contract: Type.String(),\n        /** The state members whose snapshots follow this frame; the consumer applies the shape once they are here. */\n        state: List(Name),\n    }),\n    Type.Object({ t: Type.Literal(\"gone\"), id: Id, error: WireErrorSchema }),\n    Type.Object({\n        t: Type.Literal(\"call\"),\n        id: Id,\n        hold: Id,\n        member: Name,\n        args: Type.Optional(Type.Unknown()),\n        /** Absent: the receiving host starts a root (browsers never carry roots). */\n        root: Type.Optional(RootRefSchema),\n    }),\n    Type.Object({\n        t: Type.Literal(\"result\"),\n        id: Id,\n        value: Type.Optional(Type.Unknown()),\n        error: Type.Optional(WireErrorSchema),\n    }),\n    Type.Object({ t: Type.Literal(\"cancel\"), id: Id }),\n    /** Starts the state of a hold opened with `state: false` (answered with a unit). */\n    Type.Object({ t: Type.Literal(\"sub\"), hold: Id }),\n    /** Stops the state of a hold. */\n    Type.Object({ t: Type.Literal(\"unsub\"), hold: Id }),\n    /** Sends member `m` again as a reset (a relay that had to drop what waited for it). */\n    Type.Object({ t: Type.Literal(\"resync\"), hold: Id, m: Name }),\n    Type.Object({\n        t: Type.Literal(\"state\"),\n        hold: Id,\n        m: Name,\n        /** `snap`/`reset` without `value`: the value is `undefined`. */\n        as: Type.Union([Type.Literal(\"snap\"), Type.Literal(\"reset\"), Type.Literal(\"ops\"), Type.Literal(\"error\")]),\n        value: Type.Optional(Type.Unknown()),\n        /** Encoded with the stream's delta encoder; the decoder validates each op. */\n        ops: Type.Optional(List(List(Type.Unknown()))),\n        error: Type.Optional(WireErrorSchema),\n    }),\n    Type.Object({ t: Type.Literal(\"ping\"), n: Type.Integer() }),\n    Type.Object({ t: Type.Literal(\"pong\"), n: Type.Integer() }),\n    /** Ends the link (consumed by the link itself). `reason: \"protocol-version <n>\"`: the sender speaks version n. */\n    Type.Object({ t: Type.Literal(\"bye\"), reason: Type.Optional(Type.String()) }),\n    /** The root ended at its origin: its leases on objects end (sent on every link the root's calls used). */\n    Type.Object({ t: Type.Literal(\"root_end\"), rootId: Name }),\n    Type.Object({ t: Type.Literal(\"invalidate\"), pattern: Type.Record(Type.String(), Type.Unknown()) }),\n    Type.Object({\n        t: Type.Literal(\"prepare\"),\n        reload: Reload,\n        codeVersion: Type.Integer({ minimum: 1 }),\n        plugins: List(Type.String()),\n        options: WireReloadOptionsSchema,\n    }),\n    Type.Object({\n        t: Type.Literal(\"vote\"),\n        reload: Reload,\n        error: Type.Optional(WireErrorSchema),\n        report: Type.Optional(WireReloadReportSchema),\n    }),\n    Type.Object({ t: Type.Literal(\"commit\"), reload: Reload }),\n    /** The parent dropped `codeVersion`: roots of it may still come from there no longer. */\n    Type.Object({ t: Type.Literal(\"retire\"), codeVersion: Type.Integer({ minimum: 1 }) }),\n    Type.Object({ t: Type.Literal(\"abort\"), reload: Reload }),\n]);\n/** A frame that passes validation; anything else is a protocol violation. */\nexport const isFrame = (value) => Value.Check(FrameSchema, value);\nexport function toWireError(error) {\n    if (error instanceof ChordError) {\n        return error.reason === undefined\n            ? { code: error.code, message: error.message }\n            : { code: error.code, message: error.message, reason: error.reason };\n    }\n    return { code: \"unavailable\", message: error instanceof Error ? error.message : String(error) };\n}\nexport const fromWireError = (error) => new ChordError(error.code, error.message.replace(/^[a-z_]+(\\/[a-z_]+)?: /, \"\"), { reason: error.reason });\n//# sourceMappingURL=wire.js.map","import { ChordError } from \"./errors.js\";\nimport { beginReload, endReload, reloadError } from \"./reload.js\";\nimport { toWireError } from \"./wire.js\";\n// Cross-host reload, coordinated by the server (the host without a parent):\n//   server: prepare itself and send `prepare` to every synced child host; collect votes\n//   all ok: the server installs its new code version, sends `commit` to every child, and only then starts what may make\n// new-code-version calls (tasks, listener and registry callbacks). Links are FIFO, so a child commits before it\n//           can receive any frame of a root started in the new code version.\n//   any failure or missed vote deadline: `abort` everywhere; each host rolls back to where it was.\n// Clients (browsers) are not participants: they see shape/reset pushes, or `upgrade_required`.\n// A child that connects behind the server's code version is fenced and reconciled with the same protocol.\nlet reloadSeq = 0;\nconst modulesFor = (remote, hostName) => {\n    let best;\n    for (const entry of Object.entries(remote ?? {})) {\n        if (hostName?.startsWith(entry[0]) && (best === undefined || entry[0].length > best[0].length))\n            best = entry;\n    }\n    return [...(best?.[1] ?? [])];\n};\n/** A vote, or its rejection after `deadline` milliseconds. */\nfunction awaitVote(connection, id, deadline) {\n    let timer;\n    const vote = new Promise((resolve, reject) => {\n        connection.votes.set(id, { resolve, reject });\n        timer = setTimeout(() => {\n            connection.votes.delete(id);\n            reject(new ChordError(\"aborted\", `votes missing after ${deadline} ms`, { reason: \"vote_deadline\" }));\n        }, deadline);\n    });\n    return vote.finally(() => clearTimeout(timer));\n}\nexport async function runClusterReload(host, plugins, options) {\n    // Participants are the children in step now. Fenced children (behind, being reconciled) reconcile to the new code\n    // version afterwards; a child whose hello arrives while the reload runs is synced or reconciled once it ends\n    // (`HostImpl.peerHello`).\n    const synced = [...host.connections].filter((connection) => connection.role === \"downstream\" && connection.peer.kind === \"host\" && connection.open && connection.synced);\n    const codeVersion = host.peekNextCodeVersion();\n    const reload = await beginReload(host, plugins, options, codeVersion);\n    try {\n        // Retire first: its `retire` frames reach every child before `prepare` (FIFO), so a child never retires a code\n        // version this host still runs roots of.\n        await reload.waitForRetirement();\n        const participants = synced.filter((connection) => connection.open);\n        const id = ++reloadSeq;\n        const deadline = options.voteDeadline ?? (options.gateDeadline ?? 5000) + (options.retireDeadline ?? 5000) + 5000;\n        const votes = participants.map((connection) => {\n            const name = connection.name ?? \"child\";\n            const vote = awaitVote(connection, id, deadline);\n            connection.send({\n                t: \"prepare\",\n                reload: id,\n                codeVersion,\n                plugins: modulesFor(options.remote, name),\n                options: {\n                    remove: modulesFor(options.remoteRemove, name),\n                    gateDeadline: options.gateDeadline,\n                    retireDeadline: options.retireDeadline,\n                },\n            });\n            return vote.then((report) => [name, report], (error) => {\n                const cause = reloadError(error);\n                throw new ChordError(cause.code, `${name}: ${cause.message}`, { cause, reason: cause.reason });\n            });\n        });\n        let local = false;\n        const results = await Promise.allSettled([\n            reload.prepare().then(() => {\n                local = true;\n            }),\n            ...votes,\n        ]);\n        const failed = results.find((result) => result.status === \"rejected\");\n        if (failed !== undefined) {\n            for (const connection of participants) {\n                connection.votes.delete(id);\n                connection.send({ t: \"abort\", reload: id });\n            }\n            if (local)\n                await reload.rollback();\n            throw failed.reason;\n        }\n        const report = reload.commit(() => {\n            for (const connection of participants) {\n                connection.send({ t: \"commit\", reload: id });\n                connection.peerCodeVersion = codeVersion;\n            }\n        });\n        host.rememberRemoteModules(options.remote, options.remoteRemove);\n        const children = {};\n        for (const result of results.slice(1)) {\n            if (result.status !== \"fulfilled\")\n                continue;\n            const [name, child] = result.value;\n            if (child !== undefined)\n                children[name] = child;\n        }\n        return { ...report, children };\n    }\n    finally {\n        endReload(host);\n    }\n}\n/**\n * Brings a child that connected behind this host's code version up to it: a reload of the child's modules (the ones\n * cluster reloads gave its name) to this host's current code version, prepared, voted and committed like a cluster\n * reload. Until then the child is fenced: nothing is routed to it. The child's old code is never relabeled as a newer\n * code version.\n */\nexport async function reconcileChild(host, connection) {\n    for (;;) {\n        if (!connection.open)\n            return;\n        // Not during a reload of this host: the child is not one of its participants, so whatever it would be synced to\n        // now may be superseded by that reload's commit. Recheck once it ended.\n        if (host.reloading) {\n            await host.whenReloadEnded();\n            continue;\n        }\n        const codeVersion = host.current.id;\n        if (connection.peerCodeVersion === codeVersion) {\n            connection.markSynced(codeVersion);\n            host.announceRetired(connection);\n            return;\n        }\n        // Before `prepare`: the child's prepare first retires its previous code version, which waits for this permission.\n        host.announceRetired(connection);\n        const id = ++reloadSeq;\n        const vote = awaitVote(connection, id, 30_000);\n        connection.send({\n            t: \"prepare\",\n            reload: id,\n            codeVersion,\n            plugins: modulesFor(host.remoteModules, connection.name),\n            options: { remove: modulesFor(host.remoteRemoved, connection.name) },\n        });\n        await vote;\n        if (host.current.id !== codeVersion) {\n            // This host moved on meanwhile: abort and try again with the newer code version.\n            connection.send({ t: \"abort\", reload: id });\n            continue;\n        }\n        connection.send({ t: \"commit\", reload: id });\n        connection.peerCodeVersion = codeVersion;\n    }\n}\n/**\n * The child side: prepare and vote, then wait for the server's commit or abort. An abort or a lost parent link can\n * arrive at any point: while loading modules, while preparing (pending opens close themselves when they complete),\n * or after the vote. The operation is unwound once its pending work settles, and the reload slot is freed.\n */\nexport class ChildReloads {\n    #host;\n    #operation;\n    constructor(host) {\n        this.#host = host;\n    }\n    handle(connection, frame) {\n        if (frame.t === \"prepare\") {\n            if (this.#operation !== undefined) {\n                const error = new ChordError(\"unavailable\", \"a reload is already running\", { reason: \"reload_running\" });\n                connection.send({ t: \"vote\", reload: frame.reload, error: toWireError(error) });\n                return;\n            }\n            const operation = { id: frame.reload, reload: undefined, state: \"loading\", cancelled: false };\n            this.#operation = operation;\n            this.#run(operation, connection, frame).catch((error) => this.#host.report(error));\n            return;\n        }\n        const operation = this.#operation;\n        if (operation === undefined || operation.id !== frame.reload)\n            return;\n        if (frame.t === \"abort\") {\n            this.#cancel(operation);\n            return;\n        }\n        if (operation.state !== \"prepared\")\n            return;\n        this.#operation = undefined;\n        try {\n            operation.reload?.commit();\n        }\n        finally {\n            endReload(this.#host);\n        }\n    }\n    /** The parent link died: nobody will commit, so roll back (now, or once pending work settles). */\n    parentLost() {\n        if (this.#operation !== undefined)\n            this.#cancel(this.#operation);\n    }\n    #cancel(operation) {\n        operation.cancelled = true;\n        if (operation.state !== \"prepared\") {\n            // Loading or preparing: make prepare fail now; #run unwinds when it settles.\n            operation.reload?.rollback().catch((error) => this.#host.report(error));\n            return;\n        }\n        this.#operation = undefined;\n        operation.reload\n            ?.rollback()\n            .catch((error) => this.#host.report(error))\n            .finally(() => endReload(this.#host));\n    }\n    async #run(operation, connection, frame) {\n        const cancelled = () => new ChordError(\"aborted\", \"reload aborted by the server\", { reason: \"aborted\" });\n        try {\n            operation.reload = await beginReload(this.#host, frame.plugins, frame.options, frame.codeVersion);\n            if (operation.cancelled)\n                throw cancelled();\n            operation.state = \"preparing\";\n            await operation.reload.prepare();\n            if (operation.cancelled)\n                throw cancelled();\n            operation.state = \"prepared\";\n            connection.send({ t: \"vote\", reload: frame.reload, report: operation.reload.summary() });\n        }\n        catch (error) {\n            if (operation.reload !== undefined) {\n                await operation.reload.rollback().catch((cleanup) => this.#host.report(cleanup));\n                endReload(this.#host);\n            }\n            if (this.#operation === operation)\n                this.#operation = undefined;\n            if (!operation.cancelled)\n                connection.send({ t: \"vote\", reload: frame.reload, error: toWireError(error) });\n        }\n    }\n}\n//# sourceMappingURL=cluster.js.map","/** Shared plumbing: receive queue, close handlers, `bye`. Transports implement `transmit` and `shutdown`. */\nclass BaseLink {\n    #handler;\n    #queue = [];\n    #closeHandlers = new Set();\n    #closed = false;\n    /** The tail of frames being decoded asynchronously; undefined when none is. */\n    #decoding;\n    get closed() {\n        return this.#closed;\n    }\n    send(frame) {\n        if (this.#closed)\n            return undefined;\n        return this.transmit(frame);\n    }\n    receive(handler) {\n        this.#handler = handler;\n        for (const frame of this.#queue.splice(0))\n            handler(frame);\n    }\n    onClose(handler) {\n        if (this.#closed)\n            handler(\"closed\");\n        else\n            this.#closeHandlers.add(handler);\n    }\n    close(reason = \"closed\") {\n        if (this.#closed)\n            return;\n        try {\n            this.transmit({ t: \"bye\", reason });\n        }\n        catch {\n            // The transport may already be gone.\n        }\n        this.ended(reason);\n    }\n    /** Delivers a parsed frame from the transport, after any frame still being decoded (`deliverLater`). */\n    deliver(frame) {\n        if (this.#decoding !== undefined)\n            this.deliverLater(Promise.resolve(frame));\n        else\n            this.#deliverNow(frame);\n    }\n    /** Delivers a frame that is still being decoded (inflated in a browser); later frames wait for it, in order. */\n    deliverLater(frame) {\n        const next = (this.#decoding ?? Promise.resolve())\n            .then(() => frame)\n            .then((decoded) => this.#deliverNow(decoded), () => this.close(\"protocol error\"))\n            .finally(() => {\n            if (this.#decoding === next)\n                this.#decoding = undefined;\n        });\n        this.#decoding = next;\n    }\n    #deliverNow(frame) {\n        if (this.#closed)\n            return;\n        if (frame.t === \"bye\") {\n            this.ended(frame.reason ?? \"peer closed\");\n            return;\n        }\n        if (this.#handler === undefined)\n            this.#queue.push(frame);\n        else\n            this.#handler(frame);\n    }\n    /** Marks the link closed (transport ended) and notifies once. */\n    ended(reason) {\n        if (this.#closed)\n            return;\n        this.#closed = true;\n        this.#queue = [];\n        try {\n            this.shutdown();\n        }\n        finally {\n            for (const handler of this.#closeHandlers)\n                handler(reason);\n            this.#closeHandlers.clear();\n        }\n    }\n}\n// ─── payload packing ─────────────────────────────────────────────────────────\n//\n// A transport optimization, invisible above the links. A frame's payload (call args, a result value, a state snapshot)\n// whose JSON exceeds `PACK_THRESHOLD` characters is sent deflated. A host that only relays the frame forwards the\n// deflated bytes unread (`Packed`); the host that uses the payload inflates it (`unpack`). Only hosts with Node's zlib\n// deflate (synchronously, so frames keep their order); a browser inflates with `DecompressionStream` before delivery.\n/** Payloads whose JSON is longer than this many characters are deflated. */\nexport const PACK_THRESHOLD = 64 * 1024;\nconst zlib = globalThis.process?.getBuiltinModule?.(\"node:zlib\");\n/** A deflated JSON payload, kept as received until a host uses it. */\nexport class Packed {\n    bytes;\n    constructor(bytes) {\n        this.bytes = bytes;\n    }\n}\n/** A frame payload as its user needs it: inflated and parsed if it arrived packed. */\nexport function unpack(value) {\n    if (!(value instanceof Packed))\n        return value;\n    if (zlib === undefined)\n        throw new TypeError(\"packed payload without zlib\");\n    return JSON.parse(zlib.inflateRawSync(value.bytes).toString(\"utf8\"));\n}\nconst PAYLOAD_FIELDS = new Set([\"args\", \"value\"]);\nfunction payloadField(frame) {\n    if (frame.t === \"call\")\n        return frame.args === undefined ? undefined : \"args\";\n    if (frame.t === \"result\" || frame.t === \"state\")\n        return frame.value === undefined ? undefined : \"value\";\n    return undefined;\n}\n/** The frame without its payload field (the envelope). */\nfunction envelopeOf(frame, field) {\n    const envelope = { ...frame };\n    delete envelope[field];\n    return envelope;\n}\n/** The payload's deflated bytes: as received, or deflated now if large. Undefined: send it as JSON. */\nfunction packedBytes(value, compress, json) {\n    if (value instanceof Packed)\n        return value.bytes;\n    if (!compress || zlib === undefined || json === undefined || json.length <= PACK_THRESHOLD)\n        return undefined;\n    return zlib.deflateRawSync(json, { level: 1 });\n}\n/** For object transports (Node IPC, memory): a packed payload travels as `z: [field, base64]`. */\nfunction packObject(frame, compress) {\n    const field = payloadField(frame);\n    if (field === undefined)\n        return frame;\n    const value = frame[field];\n    const bytes = packedBytes(value, compress, compress && zlib !== undefined ? JSON.stringify(value) : undefined);\n    if (bytes === undefined)\n        return frame;\n    return {\n        ...envelopeOf(frame, field),\n        z: [field, Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString(\"base64\")],\n    };\n}\nfunction unpackObject(message) {\n    if (message === null || typeof message !== \"object\" || !(\"z\" in message))\n        return message;\n    const { z, ...rest } = message;\n    if (!Array.isArray(z) || !PAYLOAD_FIELDS.has(z[0]) || typeof z[1] !== \"string\")\n        throw new TypeError(\"bad packed payload\");\n    return { ...rest, [z[0]]: new Packed(Buffer.from(z[1], \"base64\")) };\n}\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder();\n/**\n * For WebSockets: a frame with a packed payload is a binary message, `[envelope length: u32 BE][envelope JSON, with\n * z: field][deflated payload]`; any other frame is text. The payload's JSON is spliced in, not encoded twice.\n */\nfunction packMessage(frame, compress) {\n    const field = payloadField(frame);\n    if (field === undefined)\n        return JSON.stringify(frame);\n    const value = frame[field];\n    const json = value instanceof Packed ? undefined : JSON.stringify(value);\n    const bytes = packedBytes(value, compress, json);\n    const envelope = envelopeOf(frame, field);\n    if (bytes === undefined) {\n        const head = JSON.stringify(envelope);\n        return `${head.slice(0, -1)},${JSON.stringify(field)}:${json}}`;\n    }\n    const head = encoder.encode(JSON.stringify({ ...envelope, z: field }));\n    const message = new Uint8Array(4 + head.byteLength + bytes.byteLength);\n    new DataView(message.buffer).setUint32(0, head.byteLength);\n    message.set(head, 4);\n    message.set(bytes, 4 + head.byteLength);\n    return message;\n}\n/** The envelope of a binary message and its payload bytes. */\nfunction splitMessage(data) {\n    const length = new DataView(data.buffer, data.byteOffset, data.byteLength).getUint32(0);\n    const envelope = JSON.parse(decoder.decode(data.subarray(4, 4 + length)));\n    if (envelope === null || typeof envelope !== \"object\")\n        throw new TypeError(\"bad envelope\");\n    const { z: field, ...rest } = envelope;\n    if (typeof field !== \"string\" || !PAYLOAD_FIELDS.has(field))\n        throw new TypeError(\"bad packed payload\");\n    return { envelope: rest, field: field, bytes: data.slice(4 + length) };\n}\n/**\n * The text frame of a binary (packed) WebSocket message, inflated: for a transport that relays text frames only (the\n * TUI launcher feeding its sandbox). Needs zlib.\n */\nexport function inflateMessage(data) {\n    if (zlib === undefined)\n        throw new TypeError(\"inflateMessage needs zlib\");\n    const { envelope, field, bytes } = splitMessage(data);\n    const head = JSON.stringify(envelope);\n    return `${head.slice(0, -1)},${JSON.stringify(field)}:${zlib.inflateRawSync(bytes).toString(\"utf8\")}}`;\n}\n/** Inflates without zlib (browsers). */\nasync function inflate(bytes) {\n    const stream = new Blob([bytes])\n        .stream()\n        .pipeThrough(new DecompressionStream(\"deflate-raw\"));\n    return JSON.parse(await new Response(stream).text());\n}\n/** Parses a JSON frame; anything else is a protocol error. */\nfunction parseFrame(data) {\n    const frame = unpackObject(JSON.parse(data));\n    if (frame === null || typeof frame !== \"object\" || typeof frame.t !== \"string\")\n        throw new TypeError(\"not a frame\");\n    return frame;\n}\n// ─── memory ──────────────────────────────────────────────────────────────────\nexport class MemoryLink extends BaseLink {\n    peer;\n    #severed = false;\n    #pending = Promise.resolve();\n    /** Simulates a dead network: frames are dropped silently in both directions and no close is signalled. */\n    sever() {\n        this.#severed = true;\n        if (this.peer)\n            this.peer.#severed = true;\n    }\n    transmit(frame) {\n        if (this.#severed)\n            return undefined;\n        // A JSON round trip detaches the frame (and rejects what JSON would mangle silently, e.g. bigint).\n        const data = JSON.stringify(packObject(frame, true));\n        const peer = this.peer;\n        // One promise chain per direction keeps delivery FIFO and asynchronous, like a real transport.\n        this.#pending = this.#pending.then(() => {\n            if (!this.#severed && peer !== undefined)\n                peer.deliver(parseFrame(data));\n        });\n        return data.length;\n    }\n    shutdown() {\n        const peer = this.peer;\n        this.#pending = this.#pending.then(() => peer?.ended(\"peer closed\"));\n    }\n}\n/** Two connected in-memory links (tests). */\nexport function memoryLinkPair() {\n    const a = new MemoryLink();\n    const b = new MemoryLink();\n    a.peer = b;\n    b.peer = a;\n    return [a, b];\n}\n/**\n * Chord frames on an IPC channel are wrapped as `{ chord2: frame }`; other messages (control) pass by. Both ends are\n * Node processes of one application, so large payloads are packed both ways. Node serializes the messages itself, so\n * the link reports no sizes and is not windowed: both ends are local processes.\n */\nexport class IpcLink extends BaseLink {\n    #channel;\n    #onMessage = (message) => {\n        const frame = message?.chord2;\n        if (frame === undefined)\n            return;\n        try {\n            this.deliver(unpackObject(frame));\n        }\n        catch {\n            this.close(\"protocol error\");\n        }\n    };\n    #onDisconnect = () => this.ended(\"ipc disconnected\");\n    /**\n     * A write can fail after the peer exited and before the channel reports `disconnect` (an `ack` or a `bye` sent then).\n     * The peer is gone either way: the link ends, as on `disconnect`.\n     */\n    #onSent = (error) => {\n        if (error !== null)\n            this.ended(`ipc send failed: ${error.code ?? error.message}`);\n    };\n    constructor(channel) {\n        super();\n        this.#channel = channel;\n        channel.on(\"message\", this.#onMessage);\n        channel.on(\"disconnect\", this.#onDisconnect);\n    }\n    transmit(frame) {\n        if (this.#channel.connected)\n            this.#channel.send({ chord2: packObject(frame, true) }, this.#onSent);\n        return undefined;\n    }\n    shutdown() {\n        this.#channel.off(\"message\", this.#onMessage);\n        this.#channel.off(\"disconnect\", this.#onDisconnect);\n    }\n}\nexport const ipcLink = (channel) => new IpcLink(channel);\nconst OPEN = 1;\nexport class WebSocketLink extends BaseLink {\n    #socket;\n    #compress;\n    #outbox = [];\n    constructor(socket, options = {}) {\n        super();\n        this.#socket = socket;\n        this.#compress = options.compress ?? false;\n        const acceptPacked = options.acceptPacked ?? true;\n        // Binary messages as ArrayBuffer (browsers and Node's WebSocket default to Blob).\n        if (\"binaryType\" in socket)\n            socket.binaryType = \"arraybuffer\";\n        socket.addEventListener(\"open\", () => {\n            for (const data of this.#outbox.splice(0))\n                socket.send(data);\n        });\n        socket.addEventListener(\"message\", (event) => {\n            try {\n                const data = event.data;\n                if (typeof data === \"string\") {\n                    this.deliver(parseFrame(data));\n                    return;\n                }\n                if (!acceptPacked)\n                    throw new TypeError(\"packed frames are not accepted\");\n                const bytes = data instanceof ArrayBuffer\n                    ? new Uint8Array(data)\n                    : ArrayBuffer.isView(data)\n                        ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength)\n                        : undefined;\n                if (bytes === undefined)\n                    throw new TypeError(\"unknown message type\");\n                const { envelope, field, bytes: payload } = splitMessage(bytes);\n                if (zlib !== undefined)\n                    this.deliver({ ...envelope, [field]: new Packed(payload) });\n                else\n                    this.deliverLater(inflate(payload).then((value) => ({ ...envelope, [field]: value })));\n            }\n            catch {\n                this.close(\"protocol error\");\n            }\n        });\n        socket.addEventListener(\"close\", () => this.ended(\"socket closed\"));\n    }\n    transmit(frame) {\n        const data = packMessage(frame, this.#compress);\n        if (this.#socket.readyState === OPEN)\n            this.#socket.send(data);\n        else\n            this.#outbox.push(data);\n        return typeof data === \"string\" ? data.length : data.byteLength;\n    }\n    shutdown() {\n        this.#outbox = [];\n        if (this.#socket.readyState <= OPEN)\n            this.#socket.close(1000);\n    }\n}\nexport const webSocketLink = (socket, options) => new WebSocketLink(socket, options);\n//# sourceMappingURL=link.js.map","import { contractFromDescription, LOCAL_VARIANT, resolveHost } from \"./contract.js\";\nimport { encoder } from \"./delta/index.js\";\nimport { ChordError, invalid } from \"./errors.js\";\nimport { Packed, unpack } from \"./link.js\";\nimport { RefImpl, variantOf } from \"./object.js\";\nimport { assertValid } from \"./schema.js\";\nimport { fromWireError, isFrame, PROTOCOL_VERSION, toWireError } from \"./wire.js\";\nconst DEFAULT_WINDOW = 256 * 1024;\n/** The default cap of waiting state ops per link, in windows. */\nconst PENDING_WINDOWS = 4;\nconst unavailable = (message) => new ChordError(\"unavailable\", message);\n// ─── relay ───────────────────────────────────────────────────────────────────\n/**\n * A hold relayed from an origin link to a downstream link. It owns everything done through it: state and calls queued\n * while the route resolves, and the downstream twins once forwarded. `close` undoes all of it exactly once (cancels\n * calls downstream, drops what waits for the origin, releases the downstream hold, rejects waiters).\n */\nexport class RelayRef {\n    origin;\n    frame;\n    principal;\n    /** The client connection the hold comes from (forwarded downstream); undefined for a host's own holds. */\n    originTag;\n    /** The origin's authorization generation when the hold arrived; a revocation bumps it. */\n    generation;\n    down;\n    downId = 0;\n    closed = false;\n    /** The origin wants state (forwarded as `state: false`, `sub`, `unsub`). */\n    stateWanted;\n    /** The members of the first unit, still to forward past the origin's window. */\n    urgent;\n    #shaped = false;\n    /** Members whose ops this relay dropped: downstream ops are ignored until their reset arrives. */\n    awaiting = new Set();\n    calls = new Map();\n    #waiters = new Set();\n    constructor(origin, frame, principal, originTag) {\n        this.origin = origin;\n        this.frame = frame;\n        this.principal = principal;\n        this.originTag = originTag;\n        this.stateWanted = frame.state !== false;\n        this.generation = origin.generation;\n    }\n    get originId() {\n        return this.frame.id;\n    }\n    get client() {\n        return this.originTag !== undefined;\n    }\n    /** Still authorized as it was when it arrived. */\n    get current() {\n        return !this.closed && this.origin.open && this.origin.generation === this.generation;\n    }\n    /** The downstream connection once the route resolved; rejects if the relay closes first. */\n    ready() {\n        if (this.closed)\n            return Promise.reject(new ChordError(\"gone\", \"relayed hold closed\"));\n        if (this.down !== undefined)\n            return Promise.resolve(this.down);\n        return new Promise((resolve, reject) => {\n            this.#waiters.add({ resolve: resolve, reject });\n        });\n    }\n    /** Forwards the hold to `down`. */\n    open(down) {\n        if (this.closed)\n            return;\n        this.down = down;\n        this.downId = down.nextId();\n        down.relayedRefs.set(this.downId, this);\n        const { at, token, input } = this.frame;\n        down.send({\n            t: \"hold\",\n            id: this.downId,\n            at,\n            token,\n            input,\n            principal: this.principal,\n            ...(this.originTag === undefined ? {} : { origin: this.originTag }),\n            ...(this.stateWanted ? {} : { state: false }),\n            ...(this.frame.again === true ? { again: true } : {}),\n        });\n        for (const waiter of this.#waiters)\n            waiter.resolve(down);\n        this.#waiters.clear();\n    }\n    /** The origin starts or stops the hold's state. */\n    wantState(wanted) {\n        if (this.closed || wanted === this.stateWanted)\n            return;\n        this.stateWanted = wanted;\n        if (!wanted) {\n            this.origin.dropHoldState(this.originId);\n            this.awaiting.clear();\n        }\n        this.down?.send({ t: wanted ? \"sub\" : \"unsub\", hold: this.downId });\n    }\n    /**\n     * The origin could not keep up and dropped what waited for member `m` (or asked for it again): ask downstream for a\n     * reset, and ignore its ops until the reset arrives.\n     */\n    resync(m) {\n        if (this.closed)\n            return;\n        this.awaiting.add(m);\n        this.down?.send({ t: \"resync\", hold: this.downId, m });\n    }\n    /** A shape from downstream: forwarded at once; the members of the first unit then skip the origin's window. */\n    shape(frame) {\n        if (this.closed)\n            return;\n        if (!this.#shaped) {\n            this.#shaped = true;\n            if (this.frame.again !== true)\n                this.urgent = new Set(frame.state);\n        }\n        this.origin.send({ ...frame, id: this.originId });\n    }\n    /** A state frame from downstream. */\n    state(frame) {\n        if (this.closed)\n            return;\n        const m = frame.m;\n        if (this.awaiting.has(m)) {\n            if (frame.as === \"ops\")\n                return;\n            this.awaiting.delete(m);\n        }\n        const out = { ...frame, hold: this.originId };\n        if (this.urgent?.delete(m) === true) {\n            this.origin.send(out);\n            return;\n        }\n        this.origin.sendState(out, { resync: () => this.resync(m) });\n    }\n    /**\n     * Closes the relay. `releaseDown`: the downstream hold is still there (origin released, disconnected, or was\n     * revoked): cancel its calls and release it. `notify`: tell the origin the hold is gone.\n     */\n    close(error, options) {\n        if (this.closed)\n            return;\n        this.closed = true;\n        for (const call of [...this.calls.values()])\n            call.cancel(error, options.releaseDown);\n        this.origin.dropHoldState(this.originId);\n        if (this.origin.served.get(this.originId)?.kind === \"relay\")\n            this.origin.served.delete(this.originId);\n        if (this.down !== undefined) {\n            this.down.relayedRefs.delete(this.downId);\n            if (options.releaseDown)\n                this.down.send({ t: \"release\", id: this.downId });\n        }\n        for (const waiter of this.#waiters)\n            waiter.reject(error);\n        this.#waiters.clear();\n        if (options.notify)\n            this.origin.send({ t: \"gone\", id: this.originId, error: toWireError(error) });\n    }\n}\n/** One relayed call: settles once, by result, cancellation or the relay closing; removes both mappings. */\nexport class RelayCall {\n    relay;\n    originId;\n    downId;\n    #pending;\n    #settled = false;\n    constructor(relay, originId, downId, pending) {\n        this.relay = relay;\n        this.originId = originId;\n        this.downId = downId;\n        this.#pending = pending;\n        relay.calls.set(originId, this);\n        relay.down?.relayedCalls.set(downId, this);\n    }\n    finish(error, value) {\n        if (this.#settled)\n            return;\n        this.#settled = true;\n        this.relay.calls.delete(this.originId);\n        this.relay.down?.relayedCalls.delete(this.downId);\n        if (error === undefined)\n            this.#pending.resolve(value);\n        else\n            this.#pending.reject(error);\n    }\n    /** Cancels downstream (when the downstream hold still exists) and settles with `error`. */\n    cancel(error, forward) {\n        if (this.#settled)\n            return;\n        if (forward)\n            this.relay.down?.send({ t: \"cancel\", id: this.downId });\n        this.finish(error);\n    }\n}\n// ─── connection ──────────────────────────────────────────────────────────────\n/**\n * One end of a link on a host: consumer of remote references, provider for the peer's holds, and relay.\n *\n * State\n * -----\n *\n * A hold implies the state of its variant (unless it says `state: false`). The provider answers with a unit: the shape,\n * then a snapshot of each state member the consumer does not have yet (`shape.state` lists them), then the members'\n * ops and resets. A reload or a variant change sends another unit with the members that are new; members that left the\n * variant stop. The consumer applies a shape once its snapshots are here (`RemoteBinding`).\n *\n * Flow control\n * ------------\n *\n * Problem: state is pushed as fast as it changes, but a peer may read slowly (a phone behind a relay), and a relay may\n * hide that: Cloudflare forwards to browsers without backpressure. Everything sent then queues in front of the next\n * call result. Example: a browser opens three long transcripts (500 KiB of snapshots each) over a 5 Mbit/s path; a\n * result sent next waits 2.4 s, and the snapshot of a transcript the user already left is still sent in full.\n *\n * Solution: the peer acknowledges what it processed (`ack`, a cumulative frame count), and the sender counts the sizes\n * of the frames not yet acknowledged. While they exceed the window, state waits here in slots, flushed in creation\n * order as acknowledgements come:\n * - a member's stream has one slot: ops are appended (encoded batches of one stream may be concatenated, see\n *   `encoder`), a snapshot, reset or error replaces it;\n * - a hold's unit has one slot, built lazily from the current values when it is sent, so a newer unit merges into it;\n *   while it waits, the members it introduces have no stream yet.\n *\n * The first unit of a hold that is not a re-hold (`again`) is sent at once, past the window: a `get` waits for it, and\n * must not wait behind other holds' state. Results, shapes, gone, reload control and pings are sent at once too: they\n * are bounded by the requests the peer makes. Hence the one ordering exception of a link: while state waits, a result\n * can arrive before state changes made before it. Frames of one stream stay in order.\n *\n * Waiting ops are capped per link (`pendingCap`): beyond, the oldest streams are replaced by their current value (a\n * reset built at flush), or, on a relay, by a reset asked of the provider (`resync`), so memory stays bounded however\n * long the peer stalls. The window bounds what is unacknowledged when a frame is sent, so one frame (a large snapshot)\n * may exceed it. Both hellos must announce `acks`; with an older peer nothing is acknowledged and nothing waits. Links\n * that do not report sizes (IPC) never fill the window.\n */\nexport class Connection {\n    host;\n    link;\n    /** `upstream`: the link to this host's parent. `downstream`: a link this host accepted. */\n    role;\n    peer;\n    /** A client connection's opaque id: holds that come over it (directly or relayed) carry it as their `origin`. */\n    originId;\n    principal;\n    restamp;\n    /** Bumped when the stamped principal is revoked or re-stamped: relays from before are refused. */\n    generation = 0;\n    /** The code version a downstream host peer runs (from its hello, then from commits). */\n    peerCodeVersion;\n    /** A downstream host peer is usable once it runs this host's current code version (see `HostImpl.peerHello`). */\n    synced;\n    /** Code versions this child announced while behind this host (fenced): this host never ran them. */\n    fencedCodeVersions = new Set();\n    /** Roots of fenced code versions, by the code version of this host they were admitted in. */\n    #admitted = new Map();\n    #parentName;\n    #syncWaiters = new Set();\n    #nextId = 1;\n    #lastSeen = Date.now();\n    #pinger;\n    #maxCalls;\n    // flow control (see the class comment)\n    #window;\n    #pendingCap;\n    /** Whether the peer acknowledges frames; until its hello is here, frames are counted in case it does. */\n    #peerAcks;\n    #sent = 0;\n    #acked = 0;\n    /** Sizes of the frames sent after the last acknowledged one. */\n    #unacked = [];\n    #unackedBytes = 0;\n    #pending = new Map();\n    /** Bytes of ops waiting in `#pending`. */\n    #pendingBytes = 0;\n    #received = 0;\n    #ackTimer;\n    #onProtocolMismatch;\n    /** The peer speaks another protocol version: nothing it sends is processed any more. */\n    #mismatched = false;\n    // consumer side: what this host asked of the peer\n    remotes = new Map();\n    calls = new Map();\n    // provider side: what the peer asked of this host\n    served = new Map();\n    incoming = new Map();\n    // downstream side of relays: ids this host used on this link\n    relayedRefs = new Map();\n    relayedCalls = new Map();\n    /** Reload votes awaited from this (child) peer. */\n    votes = new Map();\n    constructor(host, link, config) {\n        this.host = host;\n        this.link = link;\n        this.role = config.role;\n        this.peer = config.peer;\n        this.originId = config.originId;\n        this.principal = config.principal;\n        this.restamp = config.restamp;\n        this.synced = !(this.role === \"downstream\" && this.peer.kind === \"host\");\n        this.#window = config.window ?? DEFAULT_WINDOW;\n        this.#pendingCap = config.pendingCap ?? this.#window * PENDING_WINDOWS;\n        this.#maxCalls = config.maxCalls ?? Number.POSITIVE_INFINITY;\n        this.#onProtocolMismatch = config.onProtocolMismatch;\n        link.onClose((reason) => this.#closed(reason));\n        link.receive((frame) => this.#receive(frame));\n        this.send({\n            t: \"hello\",\n            protocol: PROTOCOL_VERSION,\n            name: host.name,\n            kind: host.kind,\n            codeVersion: host.current.id,\n            acks: true,\n        });\n        const interval = config.pingInterval ?? 15_000;\n        const timeout = config.pingTimeout ?? 45_000;\n        // A link that was already closed closed this connection above; it needs no keepalive.\n        if (link.closed)\n            return;\n        let n = 0;\n        this.#pinger = setInterval(() => {\n            if (Date.now() - this.#lastSeen > timeout)\n                link.close(\"ping timeout\");\n            else\n                this.send({ t: \"ping\", n: ++n });\n        }, interval);\n        this.#pinger.unref?.();\n    }\n    get open() {\n        return !this.link.closed;\n    }\n    /** The peer's name: configured for downstream hosts, announced by the parent upstream. */\n    get name() {\n        return this.role === \"upstream\" ? this.#parentName : this.peer.name;\n    }\n    send(frame) {\n        const size = this.link.send(frame) ?? 0;\n        if (this.#peerAcks === false)\n            return;\n        this.#sent++;\n        this.#unacked.push(size);\n        this.#unackedBytes += size;\n    }\n    /** Sends a state frame, or keeps it waiting (see the class comment). */\n    sendState(frame, overflow) {\n        const key = stateKey(frame.hold, frame.m);\n        let slot = this.#pending.get(key);\n        if (slot === undefined && !this.#full) {\n            this.send(frame);\n            return;\n        }\n        if (slot?.kind === \"unit\")\n            return;\n        if (slot === undefined) {\n            slot = {\n                kind: \"state\",\n                hold: frame.hold,\n                m: frame.m,\n                base: undefined,\n                ops: [],\n                size: 0,\n                lazy: false,\n                overflow,\n            };\n            this.#pending.set(key, slot);\n        }\n        if (frame.as !== \"ops\") {\n            this.#pendingBytes -= slot.size;\n            slot.base = frame;\n            slot.ops = [];\n            slot.size = 0;\n            slot.lazy = false;\n            return;\n        }\n        // A reset built at flush already covers these ops.\n        if (slot.lazy)\n            return;\n        const size = JSON.stringify(frame.ops).length;\n        if (this.#pendingBytes + size > this.#pendingCap)\n            this.#makeRoom(size, slot);\n        if (slot.lazy || this.#pending.get(key) !== slot)\n            return;\n        for (const op of frame.ops ?? [])\n            slot.ops.push(op);\n        slot.size += size;\n        this.#pendingBytes += size;\n    }\n    /** Replaces the oldest waiting streams by resets until `size` more bytes fit; `current` last, if needed. */\n    #makeRoom(size, current) {\n        for (const slot of [...this.#pending.values()]) {\n            if (this.#pendingBytes + size <= this.#pendingCap)\n                return;\n            if (slot.kind === \"state\" && slot !== current && slot.size > 0)\n                this.#drop(slot);\n        }\n        if (this.#pendingBytes + size > this.#pendingCap)\n            this.#drop(current);\n    }\n    /** Drops what waits for a stream: a lazy reset replaces it (provider), or the relay asks downstream for one. */\n    #drop(slot) {\n        this.#pendingBytes -= slot.size;\n        slot.base = undefined;\n        slot.ops = [];\n        slot.size = 0;\n        if (\"resend\" in slot.overflow) {\n            slot.lazy = true;\n            return;\n        }\n        this.#pending.delete(stateKey(slot.hold, slot.m));\n        slot.overflow.resync();\n    }\n    /** Sends member `m` of a served hold again as a reset, through the window (`resync`). */\n    #resetLater(hold, m, resend) {\n        const key = stateKey(hold, m);\n        let slot = this.#pending.get(key);\n        if (slot?.kind === \"unit\")\n            return;\n        if (slot === undefined) {\n            slot = { kind: \"state\", hold, m, base: undefined, ops: [], size: 0, lazy: true, overflow: { resend } };\n            this.#pending.set(key, slot);\n        }\n        else {\n            this.#pendingBytes -= slot.size;\n            slot.base = undefined;\n            slot.ops = [];\n            slot.size = 0;\n            slot.lazy = true;\n        }\n        this.#flush();\n    }\n    /** Queues a hold's lazy unit (a waiting one already covers this one), and sends what the window allows. */\n    #queueUnit(hold, flush) {\n        const key = unitKey(hold);\n        if (!this.#pending.has(key))\n            this.#pending.set(key, { kind: \"unit\", hold, flush });\n        this.#flush();\n    }\n    /** Forgets what waits for a stream that ended. */\n    dropState(hold, m) {\n        const slot = this.#pending.get(stateKey(hold, m));\n        if (slot?.kind !== \"state\")\n            return;\n        this.#pendingBytes -= slot.size;\n        this.#pending.delete(stateKey(hold, m));\n    }\n    /** Forgets everything that waits for a hold (released, closed, or its state stopped). */\n    dropHoldState(hold) {\n        for (const [key, slot] of this.#pending) {\n            if (slot.hold !== hold)\n                continue;\n            if (slot.kind === \"state\")\n                this.#pendingBytes -= slot.size;\n            this.#pending.delete(key);\n        }\n    }\n    /** What waits for the peer: slots and bytes of ops (for tests and diagnostics). */\n    get waiting() {\n        return { slots: this.#pending.size, bytes: this.#pendingBytes };\n    }\n    get #full() {\n        return this.#peerAcks === true && this.#unackedBytes >= this.#window;\n    }\n    #onAck(n) {\n        if (this.#peerAcks !== true || n < this.#acked || n > this.#sent) {\n            this.#violation(`ack ${n} outside ${this.#acked}..${this.#sent}`);\n            return;\n        }\n        for (const size of this.#unacked.splice(0, n - this.#acked))\n            this.#unackedBytes -= size;\n        this.#acked = n;\n        this.#flush();\n    }\n    /** Sends waiting slots in creation order while the window allows. */\n    #flush() {\n        for (const [key, slot] of this.#pending) {\n            if (this.#full)\n                return;\n            this.#pending.delete(key);\n            if (slot.kind === \"unit\") {\n                slot.flush();\n                continue;\n            }\n            this.#pendingBytes -= slot.size;\n            if (slot.lazy) {\n                if (\"resend\" in slot.overflow)\n                    slot.overflow.resend();\n                continue;\n            }\n            if (slot.base !== undefined)\n                this.send(slot.base);\n            if (slot.ops.length > 0)\n                this.send({ t: \"state\", hold: slot.hold, m: slot.m, as: \"ops\", ops: slot.ops });\n        }\n    }\n    /** Acknowledges once the frames that arrived together are processed: one ack per burst, not per frame. */\n    #scheduleAck() {\n        if (this.#peerAcks !== true || this.#ackTimer !== undefined || !this.open)\n            return;\n        this.#ackTimer = setTimeout(() => {\n            this.#ackTimer = undefined;\n            this.link.send({ t: \"ack\", n: this.#received });\n        }, 0);\n        this.#ackTimer.unref?.();\n    }\n    nextId() {\n        return this.#nextId++;\n    }\n    /** Resolves once the peer is usable (a host peer runs this host's code version); rejects if the link closes first. */\n    whenSynced() {\n        if (!this.open)\n            return Promise.reject(unavailable(`link to ${this.name ?? \"peer\"} closed`));\n        if (this.synced)\n            return Promise.resolve();\n        return new Promise((resolve, reject) => this.#syncWaiters.add({ resolve: resolve, reject }));\n    }\n    markSynced(codeVersion) {\n        this.peerCodeVersion = codeVersion;\n        this.synced = true;\n        for (const waiter of this.#syncWaiters)\n            waiter.resolve(undefined);\n        this.#syncWaiters.clear();\n    }\n    /** Revokes the stamped principal: relays made under it close at once (also those still resolving a route). */\n    revoke(next) {\n        this.generation++;\n        const error = new ChordError(\"gone\", \"principal invalidated\");\n        for (const served of [...this.served.values()]) {\n            if (served.kind === \"relay\")\n                served.relay.close(error, { releaseDown: true, notify: true });\n        }\n        if (next === undefined)\n            this.link.close(\"principal invalidated\");\n        else\n            this.principal = next;\n    }\n    /**\n     * Stops talking to a peer of another protocol version: reports it and closes the link. The close reason tells the\n     * peer this side's version (`protocol-version <n>`); a peer that noticed first told us the same way (`#closed`).\n     */\n    #protocolMismatch(peer, close = true) {\n        if (this.#mismatched)\n            return;\n        this.#mismatched = true;\n        try {\n            this.#onProtocolMismatch?.({ local: PROTOCOL_VERSION, peer });\n        }\n        catch (error) {\n            this.host.report(error);\n        }\n        if (close)\n            this.link.close(`protocol-version ${PROTOCOL_VERSION}`);\n    }\n    /** A protocol violation: the peer cannot be trusted with anything on this link any more. */\n    #violation(reason) {\n        this.host.report(new ChordError(\"invalid\", `link to ${this.name ?? \"peer\"}: ${reason}`, { reason: \"protocol\" }));\n        this.link.close(`protocol error: ${reason}`);\n    }\n    // ─── consumer side (RemoteChannel) ───\n    hold(binding, again) {\n        const id = this.nextId();\n        this.remotes.set(id, binding);\n        binding.bound(this, id);\n        const principal = binding.principal;\n        this.send({\n            t: \"hold\",\n            id,\n            at: binding.at,\n            token: binding.contract.description,\n            input: binding.input,\n            ...(principal === undefined ? {} : { principal }),\n            ...(binding.stateOn ? {} : { state: false }),\n            ...(again ? { again: true } : {}),\n        });\n        return id;\n    }\n    release(id) {\n        this.remotes.delete(id);\n        this.send({ t: \"release\", id });\n    }\n    wantState(hold, wanted) {\n        if (this.remotes.has(hold))\n            this.send({ t: wanted ? \"sub\" : \"unsub\", hold });\n    }\n    call(hold, member, args, root, signal) {\n        const id = this.nextId();\n        return new Promise((resolve, reject) => {\n            if (signal.aborted) {\n                reject(new ChordError(\"aborted\", \"call aborted\"));\n                return;\n            }\n            const onAbort = () => {\n                this.calls.delete(id);\n                this.send({ t: \"cancel\", id });\n                reject(new ChordError(\"aborted\", \"call aborted\", { cause: signal.reason }));\n            };\n            signal.addEventListener(\"abort\", onAbort, { once: true });\n            const done = () => signal.removeEventListener(\"abort\", onAbort);\n            this.calls.set(id, {\n                resolve: (value) => {\n                    done();\n                    resolve(value);\n                },\n                reject: (error) => {\n                    done();\n                    reject(error);\n                },\n            });\n            // Clients never carry roots or code versions: the server starts roots for them.\n            const carried = root !== undefined && this.host.kind === \"host\";\n            if (carried)\n                this.host.rootSent(root.rootId, this);\n            this.send({ t: \"call\", id, hold, member, args, ...(carried ? { root } : {}) });\n        });\n    }\n    // ─── receiving ───\n    #receive(frame) {\n        if (this.#mismatched)\n            return;\n        this.#lastSeen = Date.now();\n        if (!isFrame(frame)) {\n            this.#violation(\"malformed frame\");\n            return;\n        }\n        if (frame.t === \"ack\") {\n            this.#onAck(frame.n);\n            return;\n        }\n        this.#received++;\n        try {\n            this.#dispatch(frame);\n        }\n        catch (error) {\n            this.host.report(error);\n        }\n        this.#scheduleAck();\n    }\n    #dispatch(frame) {\n        switch (frame.t) {\n            case \"hello\":\n                this.#onHello(frame);\n                return;\n            case \"ping\":\n                this.send({ t: \"pong\", n: frame.n });\n                return;\n            case \"pong\":\n            case \"bye\":\n            case \"ack\":\n                return;\n            case \"hold\":\n                this.#onHold(frame);\n                return;\n            case \"release\":\n                this.#dropServed(frame.id, true);\n                return;\n            case \"call\":\n                this.#onCall(frame);\n                return;\n            case \"cancel\":\n                this.incoming.get(frame.id)?.abort(new ChordError(\"aborted\", \"cancelled by caller\"));\n                return;\n            case \"sub\":\n            case \"unsub\":\n                this.#onWantState(frame.hold, frame.t === \"sub\");\n                return;\n            case \"resync\":\n                this.#onResync(frame.hold, frame.m);\n                return;\n            case \"shape\":\n            case \"gone\":\n                this.#onHoldReply(frame);\n                return;\n            case \"result\":\n                this.#onResult(frame);\n                return;\n            case \"state\":\n                this.#onState(frame);\n                return;\n            case \"root_end\":\n                // Honored only from the link the root came over (see HostImpl.foreignRootEnded).\n                this.#admitted.delete(frame.rootId);\n                this.host.foreignRootEnded(frame.rootId, this);\n                return;\n            case \"invalidate\":\n            case \"prepare\":\n            case \"commit\":\n            case \"abort\":\n            case \"retire\":\n                // Control frames only from the parent.\n                if (this.role !== \"upstream\") {\n                    this.#violation(`${frame.t} from a child`);\n                    return;\n                }\n                if (frame.t === \"invalidate\") {\n                    this.host.invalidatePrincipal(frame.pattern).catch((error) => this.host.report(error));\n                }\n                else if (frame.t === \"retire\")\n                    this.host.allowRetire(frame.codeVersion);\n                else\n                    this.host.onReloadFrame(this, frame);\n                return;\n            case \"vote\": {\n                if (this.role !== \"downstream\" || this.peer.kind !== \"host\") {\n                    this.#violation(\"vote from a non-participant\");\n                    return;\n                }\n                const vote = this.votes.get(frame.reload);\n                this.votes.delete(frame.reload);\n                if (frame.error === undefined)\n                    vote?.resolve(frame.report);\n                else\n                    vote?.reject(fromWireError(frame.error));\n                return;\n            }\n        }\n    }\n    /**\n     * The peer's hello must agree with what this side decided about it. A downstream host announces its code version:\n     * the host either finds it in step or fences and reconciles it (never renumbers).\n     */\n    #onHello(frame) {\n        if ((frame.protocol ?? 1) !== PROTOCOL_VERSION) {\n            this.#protocolMismatch(frame.protocol ?? 1);\n            return;\n        }\n        if (this.#peerAcks === undefined) {\n            this.#peerAcks = frame.acks === true;\n            if (!this.#peerAcks) {\n                this.#unacked = [];\n                this.#unackedBytes = 0;\n            }\n        }\n        if (this.role === \"upstream\") {\n            if (frame.kind !== \"host\") {\n                this.#violation(\"parent is not a host\");\n                return;\n            }\n            this.#parentName ??= frame.name;\n            return;\n        }\n        if (frame.kind !== this.peer.kind || (this.peer.name !== undefined && frame.name !== this.peer.name)) {\n            this.#violation(`hello ${frame.kind} ${frame.name} does not match the accepted ${this.peer.kind} ${this.peer.name ?? \"\"}`);\n            return;\n        }\n        if (this.peer.kind === \"host\")\n            this.host.peerHello(this, frame.codeVersion);\n    }\n    /**\n     * Principal stamping: a downstream link acts as the principal it was accepted with, whatever the frame says. Only\n     * the parent may forward a principal (relayed requests); its own requests act as the principal given to `connect`.\n     */\n    #principalOf(frame) {\n        if (this.role === \"downstream\")\n            return this.principal;\n        return frame.principal ?? this.principal;\n    }\n    /**\n     * The client connection a hold comes from: this link's own id for a client link (whatever the frame says), the id\n     * the parent forwarded for a relayed hold, none for a host's own holds.\n     */\n    #originOf(frame) {\n        return this.role === \"downstream\" ? this.originId : frame.origin;\n    }\n    #onHold(frame) {\n        if (this.served.has(frame.id)) {\n            this.#violation(`duplicate hold id ${frame.id}`);\n            return;\n        }\n        const principal = this.#principalOf(frame);\n        const origin = this.#originOf(frame);\n        const client = origin !== undefined;\n        if (frame.at !== this.host.name) {\n            if (this.role === \"upstream\") {\n                this.send({ t: \"gone\", id: frame.id, error: toWireError(unavailable(`${this.host.name} does not relay`)) });\n                return;\n            }\n            const relay = new RelayRef(this, frame, principal, origin);\n            this.served.set(frame.id, { kind: \"relay\", relay });\n            this.host.relay(relay).catch((error) => relay.close(error, { releaseDown: true, notify: true }));\n            return;\n        }\n        let ref;\n        try {\n            const token = contractFromDescription(frame.token);\n            if (token.scope !== \"remote\")\n                throw invalid(\"token\", `${token.name} is local; only remote types cross links`);\n            // Addressed here, so the input must place it here (also by this host's contract, checked when acquiring).\n            if (resolveHost(token.name, token.description.host, frame.input) !== this.host.name)\n                throw invalid(\"placement\", `${token.name} with this input does not live on ${this.host.name}`);\n            const acquired = this.host.acquire(token, frame.input, { principal }, client ? \"client\" : \"connection\");\n            if (!(acquired instanceof RefImpl))\n                throw unavailable(\"not a local reference\");\n            ref = acquired;\n        }\n        catch (error) {\n            this.send({ t: \"gone\", id: frame.id, error: toWireError(client ? clientError(error) : error) });\n            return;\n        }\n        const served = {\n            kind: \"local\",\n            id: frame.id,\n            ref,\n            principal,\n            origin,\n            wantsState: frame.state !== false,\n            again: frame.again === true,\n            unitSent: false,\n            feeds: new Map(),\n        };\n        this.served.set(frame.id, served);\n        ref.onShape(() => this.#unit(served));\n        ref.goneListeners.add((error) => {\n            if (this.served.get(frame.id) !== served)\n                return;\n            this.#dropServed(frame.id, false);\n            this.send({ t: \"gone\", id: frame.id, error: toWireError(error) });\n        });\n        if (ref.status === \"live\")\n            this.#unit(served);\n    }\n    /** The state members of `shape` the consumer's contract knows. */\n    #stateMembers(ref, shape) {\n        return shape.members.filter((name) => ref.describe(shape.variant, name)?.kind === \"state\");\n    }\n    /**\n     * The shape changed (live, reload, variant) or state was asked for: members that left lose their stream, and a unit\n     * goes out with the shape and the members the consumer lacks. The first unit of a hold (not a re-hold) is urgent.\n     */\n    #unit(served) {\n        if (this.served.get(served.id) !== served)\n            return;\n        const shape = served.ref.shape;\n        if (shape === undefined)\n            return;\n        const members = new Set(served.wantsState ? this.#stateMembers(served.ref, shape) : []);\n        for (const [name, feed] of served.feeds) {\n            if (members.has(name))\n                continue;\n            feed.unsubscribe();\n            served.feeds.delete(name);\n            this.dropState(served.id, name);\n        }\n        const urgent = served.feeds.size === 0 && !(served.again && !served.unitSent);\n        if (urgent)\n            this.#sendUnit(served);\n        else\n            this.#queueUnit(served.id, () => this.#sendUnit(served));\n    }\n    /** Builds and sends a unit from the current shape and values. */\n    #sendUnit(served) {\n        this.#pending.delete(unitKey(served.id));\n        if (this.served.get(served.id) !== served)\n            return;\n        const shape = served.ref.shape;\n        if (shape === undefined)\n            return;\n        served.unitSent = true;\n        const members = served.wantsState ? this.#stateMembers(served.ref, shape) : [];\n        const listed = members.filter((name) => !served.feeds.has(name));\n        const snaps = [];\n        const attached = [];\n        for (const name of listed) {\n            const attachment = this.#attach(served, name);\n            if (attachment === undefined)\n                continue;\n            snaps.push(attachment.frame);\n            attached.push([name, attachment.feed]);\n        }\n        this.send({\n            t: \"shape\",\n            id: served.id,\n            ...(shape.variant === undefined ? {} : { variant: shape.variant }),\n            members: shape.members,\n            contract: shape.contract,\n            state: snaps.map((frame) => frame.m),\n        });\n        for (const frame of snaps)\n            this.send(frame);\n        for (const [name, feed] of attached)\n            this.#replay(served, name, feed);\n    }\n    /**\n     * Subscribes member `name` for the consumer: its snapshot (as a frame of type `as`), and a feed whose later events\n     * wait in its buffer until the snapshot is sent (`#replay`). Undefined if the member is not readable state.\n     */\n    #attach(served, name, as = \"snap\") {\n        const readable = served.ref.member(name);\n        if (readable === undefined || typeof readable.events !== \"function\")\n            return undefined;\n        const feed = { unsubscribe: () => { }, encoder: encoder(), buffer: [] };\n        let first;\n        feed.unsubscribe = readable.events((event) => {\n            if (first === undefined)\n                first = event;\n            else if (feed.buffer !== undefined)\n                feed.buffer.push(event);\n            else\n                this.#feedEvent(served, name, feed, event);\n        });\n        served.feeds.set(name, feed);\n        return { frame: this.#snapshot(served, name, as, first?.value), feed };\n    }\n    /** Sends the events that arrived while the snapshot was built, now that it is sent. */\n    #replay(served, name, feed) {\n        const buffered = feed.buffer ?? [];\n        feed.buffer = undefined;\n        for (const event of buffered)\n            this.#feedEvent(served, name, feed, event);\n    }\n    /** A member's state frame for a snapshot or reset: validated against the schema the consumer is promised. */\n    #snapshot(served, name, as, value) {\n        try {\n            validateSnapshot(served.ref, name, value);\n        }\n        catch (error) {\n            return { t: \"state\", hold: served.id, m: name, as: \"error\", error: toWireError(error) };\n        }\n        return { t: \"state\", hold: served.id, m: name, as, ...(value === undefined ? {} : { value }) };\n    }\n    /** A later event of a member's stream: ops are encoded, a reset starts a new stream. */\n    #feedEvent(served, name, feed, event) {\n        if (served.feeds.get(name) !== feed)\n            return;\n        const overflow = { resend: () => this.#resend(served, name) };\n        if (event.type === \"ops\") {\n            this.sendState({ t: \"state\", hold: served.id, m: name, as: \"ops\", ops: feed.encoder.encode(event.ops) }, overflow);\n            return;\n        }\n        feed.encoder = encoder();\n        this.sendState(this.#snapshot(served, name, \"reset\", event.value), overflow);\n    }\n    /** Sends member `name` again, now, as a reset from its current value (a lazy slot is flushed, or `resync`). */\n    #resend(served, name) {\n        const feed = served.feeds.get(name);\n        if (feed === undefined || this.served.get(served.id) !== served)\n            return;\n        feed.unsubscribe();\n        served.feeds.delete(name);\n        const attachment = this.#attach(served, name, \"reset\");\n        if (attachment === undefined)\n            return;\n        this.send(attachment.frame);\n        this.#replay(served, name, attachment.feed);\n    }\n    /** The consumer starts (`sub`) or stops (`unsub`) the state of a hold. */\n    #onWantState(hold, wanted) {\n        const served = this.served.get(hold);\n        if (served === undefined)\n            return;\n        if (served.kind === \"relay\") {\n            served.relay.wantState(wanted);\n            return;\n        }\n        if (served.wantsState === wanted)\n            return;\n        served.wantsState = wanted;\n        if (wanted) {\n            this.#unit(served);\n            return;\n        }\n        for (const feed of served.feeds.values())\n            feed.unsubscribe();\n        served.feeds.clear();\n        this.dropHoldState(hold);\n    }\n    /** The consumer (a relay that dropped ops) asks for member `m` again as a reset. */\n    #onResync(hold, m) {\n        const served = this.served.get(hold);\n        if (served === undefined)\n            return;\n        if (served.kind === \"relay\") {\n            served.relay.resync(m);\n            return;\n        }\n        if (!served.feeds.has(m))\n            return;\n        this.#resetLater(hold, m, () => this.#resend(served, m));\n    }\n    /** Forgets a served hold: unsubscribes its feeds and releases it (locally or downstream). */\n    #dropServed(id, release) {\n        const served = this.served.get(id);\n        if (served === undefined)\n            return;\n        this.served.delete(id);\n        if (served.kind === \"relay\") {\n            served.relay.close(new ChordError(\"released\", \"relayed hold released\"), {\n                releaseDown: release,\n                notify: false,\n            });\n            return;\n        }\n        for (const feed of served.feeds.values())\n            feed.unsubscribe();\n        served.feeds.clear();\n        this.dropHoldState(id);\n        if (release)\n            served.ref.release();\n    }\n    #onCall(frame) {\n        if (this.incoming.has(frame.id)) {\n            this.#violation(`duplicate call id ${frame.id}`);\n            return;\n        }\n        if (this.incoming.size >= this.#maxCalls) {\n            const error = new ChordError(\"unavailable\", `Too many calls in progress on this connection (${this.#maxCalls}); wait for earlier ones to finish`, { reason: \"too_many_calls\" });\n            this.send({ t: \"result\", id: frame.id, error: toWireError(error) });\n            return;\n        }\n        const served = this.served.get(frame.hold);\n        if (served === undefined) {\n            this.send({ t: \"result\", id: frame.id, error: toWireError(new ChordError(\"gone\", \"unknown hold\")) });\n            return;\n        }\n        const controller = new AbortController();\n        this.incoming.set(frame.id, controller);\n        // Roots are honored from hosts only; a request without one (or from a client) starts one here.\n        const root = this.peer.kind === \"host\" ? this.#admitRoot(frame.root) : undefined;\n        const principal = served.kind === \"local\" ? served.principal : served.relay.principal;\n        const options = { principal, signal: controller.signal };\n        const run = served.kind === \"local\"\n            ? (ctx) => served.ref.object.call(served.ref, frame.member, unpack(frame.args), ctx)\n            : (ctx) => relayCall(served.relay, frame, { rootId: ctx.rootId, codeVersion: ctx.codeVersion }, \n            // The root's signal: a cancel from the origin and the root's code version retiring both reach it.\n            ctx.signal, this.host);\n        const result = root === undefined\n            ? this.host.root(run, options)\n            : this.host.joinRoot(root.rootId, root.codeVersion, run, { ...options, from: this });\n        result\n            .then((value) => this.send({ t: \"result\", id: frame.id, value }), (error) => this.send({ t: \"result\", id: frame.id, error: toWireError(error) }))\n            .finally(() => this.incoming.delete(frame.id));\n    }\n    /**\n     * A child that connected behind this host runs roots of a code version this host never had (it was fenced and is\n     * being, or was, reconciled). Such a root is admitted in this host's current code version at its first call here,\n     * and keeps that code version for its later calls (`superseded` once this host retired it). Other unknown code\n     * versions stay `superseded`.\n     */\n    #admitRoot(root) {\n        if (root === undefined || this.role !== \"downstream\" || !this.fencedCodeVersions.has(root.codeVersion))\n            return root;\n        if (this.host.hasCodeVersion(root.codeVersion))\n            return root;\n        let codeVersion = this.#admitted.get(root.rootId);\n        if (codeVersion === undefined) {\n            codeVersion = this.host.current.id;\n            this.#admitted.set(root.rootId, codeVersion);\n        }\n        return { rootId: root.rootId, codeVersion };\n    }\n    #onHoldReply(frame) {\n        const relay = this.relayedRefs.get(frame.id);\n        if (relay !== undefined) {\n            if (frame.t === \"gone\")\n                relay.close(fromWireError(frame.error), { releaseDown: false, notify: true });\n            else\n                relay.shape(frame);\n            return;\n        }\n        const binding = this.remotes.get(frame.id);\n        if (binding === undefined)\n            return;\n        if (frame.t === \"gone\") {\n            this.remotes.delete(frame.id);\n            binding.gone(fromWireError(frame.error));\n            return;\n        }\n        binding.shaped({ variant: frame.variant, members: frame.members, contract: frame.contract }, frame.state);\n    }\n    #onResult(frame) {\n        const relayed = this.relayedCalls.get(frame.id);\n        if (relayed !== undefined) {\n            relayed.finish(frame.error === undefined ? undefined : fromWireError(frame.error), frame.value);\n            return;\n        }\n        const pending = this.calls.get(frame.id);\n        this.calls.delete(frame.id);\n        if (frame.error !== undefined) {\n            pending?.reject(fromWireError(frame.error));\n            return;\n        }\n        let value;\n        try {\n            value = unpack(frame.value);\n        }\n        catch (error) {\n            pending?.reject(error);\n            return;\n        }\n        pending?.resolve(value);\n    }\n    #onState(frame) {\n        const relay = this.relayedRefs.get(frame.hold);\n        if (relay !== undefined) {\n            relay.state(frame);\n            return;\n        }\n        const binding = this.remotes.get(frame.hold);\n        if (binding === undefined)\n            return;\n        if (!(frame.value instanceof Packed)) {\n            binding.state(frame.m, frame);\n            return;\n        }\n        let value;\n        try {\n            value = unpack(frame.value);\n        }\n        catch (error) {\n            binding.state(frame.m, { as: \"error\", error: toWireError(error) });\n            return;\n        }\n        binding.state(frame.m, { ...frame, value });\n    }\n    // ─── lifetime ───\n    #closed(reason) {\n        const told = /^protocol-version (\\d+)$/.exec(reason);\n        if (told !== null && Number(told[1]) !== PROTOCOL_VERSION)\n            this.#protocolMismatch(Number(told[1]), false);\n        if (this.#pinger !== undefined)\n            clearInterval(this.#pinger);\n        if (this.#ackTimer !== undefined)\n            clearTimeout(this.#ackTimer);\n        this.#pending.clear();\n        this.#pendingBytes = 0;\n        const error = unavailable(`link to ${this.name ?? \"peer\"} closed: ${reason}`);\n        // As origin: everything the peer held here, relayed or not, is released (downstream calls cancelled).\n        for (const id of [...this.served.keys()])\n            this.#dropServed(id, true);\n        for (const controller of this.incoming.values())\n            controller.abort(error);\n        this.incoming.clear();\n        for (const pending of this.calls.values())\n            pending.reject(error);\n        this.calls.clear();\n        for (const vote of this.votes.values())\n            vote.reject(error);\n        this.votes.clear();\n        for (const waiter of this.#syncWaiters)\n            waiter.reject(error);\n        this.#syncWaiters.clear();\n        // As downstream of relays: their origins lose the hold.\n        for (const relay of [...this.relayedRefs.values()])\n            relay.close(error, { releaseDown: false, notify: true });\n        this.relayedRefs.clear();\n        this.relayedCalls.clear();\n        const bindings = [...this.remotes.values()];\n        this.remotes.clear();\n        for (const binding of bindings) {\n            // An upstream link may be replaced (reconnect); a downstream host that went away is gone.\n            if (this.role === \"upstream\")\n                binding.detached();\n            else\n                binding.gone(error);\n        }\n        this.host.connectionClosed(this);\n    }\n}\nconst stateKey = (hold, m) => `s${hold}\\u0000${m}`;\nconst unitKey = (hold) => `u${hold}`;\n/**\n * A call through a relay: waits for the route, then forwards with the root it runs in. It settles exactly once; a\n * cancel (or the origin going away) is forwarded downstream and removes both mappings.\n */\nasync function relayCall(relay, frame, root, signal, host) {\n    const abortError = () => new ChordError(\"aborted\", \"call cancelled\", { cause: signal.reason });\n    if (signal.aborted)\n        throw abortError();\n    let onAbort = () => { };\n    let onCancel = () => { };\n    const aborted = new Promise((_, reject) => {\n        onAbort = () => reject(abortError());\n        signal.addEventListener(\"abort\", onAbort, { once: true });\n    });\n    aborted.catch(() => { });\n    try {\n        const down = await Promise.race([relay.ready(), aborted]);\n        if (relay.closed)\n            throw new ChordError(\"gone\", \"relayed hold closed\");\n        return await new Promise((resolve, reject) => {\n            const call = new RelayCall(relay, frame.id, down.nextId(), { resolve, reject });\n            onCancel = () => call.cancel(abortError(), true);\n            signal.addEventListener(\"abort\", onCancel, { once: true });\n            host.rootSent(root.rootId, down);\n            down.send({ t: \"call\", id: call.downId, hold: relay.downId, member: frame.member, args: frame.args, root });\n        });\n    }\n    finally {\n        signal.removeEventListener(\"abort\", onAbort);\n        signal.removeEventListener(\"abort\", onCancel);\n    }\n}\n/**\n * Validates a snapshot against the schema the consumer is promised: the provider's own schema for a direct binding,\n * the consumer's contract for one through an `accepts` adapter (the adapter's view is what the consumer gets).\n */\nfunction validateSnapshot(ref, member, value) {\n    if (value === undefined)\n        return;\n    const installed = ref.object.currentInstalled();\n    if (installed === undefined)\n        return;\n    const view = ref.currentView();\n    const variant = view === undefined ? variantOf(installed.implementation) : variantOf(view);\n    const description = view !== undefined && view !== installed.implementation\n        ? ref.contract.description.variants[variant ?? LOCAL_VARIANT]?.[member]\n        : installed.service.contract.description.variants[variantOf(installed.implementation) ?? LOCAL_VARIANT]?.[member];\n    if (description?.kind === \"state\")\n        assertValid(\"state\", `${ref.address}.${member}`, description.schema, value);\n}\n/** Clients (browsers) holding an outdated contract are told to reload their code. */\nfunction clientError(error) {\n    if (error instanceof ChordError && error.code === \"contract_mismatch\") {\n        return new ChordError(\"upgrade_required\", error.message, { cause: error });\n    }\n    return error;\n}\n//# sourceMappingURL=connection.js.map","import { Value } from \"typebox/value\";\nimport { HYDRATION } from \"./cell.js\";\nimport { takesNoArgs } from \"./contract.js\";\nimport { applyImmutable, decoder } from \"./delta/index.js\";\nimport { ChordError, invalid } from \"./errors.js\";\nimport { CtxImpl, notifyStatus, REF_BASE, raceSignal, refsByProxy, } from \"./object.js\";\nimport { fromWireError } from \"./wire.js\";\nconst noop = () => { };\nfunction deferred() {\n    let resolve = noop;\n    let reject = noop;\n    const promise = new Promise((done, fail) => {\n        resolve = done;\n        reject = fail;\n    });\n    promise.catch(noop);\n    return { promise, resolve, reject };\n}\n/**\n * One hold per host and key (type, normalized input, principal key, contract fingerprint), shared by every reference to\n * it: one hold over the link, one stream per state member, calls over the same hold. References are views onto it.\n *\n * A hold implies the state of its variant (unless no view wants state): the provider answers with a unit, the shape\n * followed by a snapshot of each state member the binding lacks. A shape is applied only once all of its snapshots are\n * here, so a live binding always has every state member of its variant. After the first hydration the values stay\n * readable while the binding re-holds (link loss): status `loading`, last values kept.\n */\nexport class RemoteBinding {\n    host;\n    key;\n    contract;\n    at;\n    input;\n    /** Forwarded principal (omitted for the host's own principal). */\n    principal;\n    /** `ended`: gone with `error`, or closed (no views, no linger). */\n    status = \"loading\";\n    error;\n    /** The applied shape (kept while re-holding). */\n    shape;\n    /** Every state member of the applied shape has a value (stays true while re-holding). */\n    hydrated = false;\n    /** The current hold; undefined while resolving the route or after a link loss. */\n    hold;\n    /** What the provider was told: state for this hold (`state: false` / `sub` / `unsub`). */\n    stateOn = false;\n    views = new Set();\n    members = new Map();\n    /** Lingering since (no views): set by the host. */\n    lingerTimer;\n    #listeners = new Map();\n    /** A shape waiting for its snapshots. */\n    #pending;\n    /** Resolved while a shape is applied for the current hold (calls wait for it). */\n    #live = deferred();\n    /** A shape was applied once (a re-hold says `again`). */\n    #applied = false;\n    /** Waiting for the first hydration (`whenHydrated`). */\n    #hydrationWaiters = new Set();\n    constructor(host, fields) {\n        this.host = host;\n        this.key = fields.key;\n        this.contract = fields.contract;\n        this.at = fields.at;\n        this.input = fields.input;\n        this.principal = fields.principal;\n    }\n    get ended() {\n        return this.status === \"ended\";\n    }\n    /** Views that want state. */\n    get stateViews() {\n        let count = 0;\n        for (const view of this.views)\n            if (view.wantsState)\n                count++;\n        return count;\n    }\n    /** Whether the next hold should carry state: some view wants it, or nobody is left (lingering keeps it). */\n    get wantsState() {\n        return this.views.size === 0 ? this.stateOn : this.stateViews > 0;\n    }\n    /** Whether a re-hold is `again` (the binding already has a shape). */\n    get applied() {\n        return this.#applied;\n    }\n    // ─── views ───\n    addView(view) {\n        this.views.add(view);\n        if (this.lingerTimer !== undefined) {\n            clearTimeout(this.lingerTimer);\n            this.lingerTimer = undefined;\n        }\n        this.#syncState();\n        view.update();\n    }\n    removeView(view) {\n        if (!this.views.delete(view))\n            return;\n        for (const set of this.#listeners.values())\n            for (const readable of set)\n                if (readable.view === view)\n                    set.delete(readable);\n        if (this.views.size === 0) {\n            this.host.bindingIdle(this);\n            return;\n        }\n        this.#syncState();\n    }\n    /** Tells the provider to start or stop state when the views' wish changed. */\n    #syncState() {\n        if (this.ended || this.views.size === 0)\n            return;\n        const wanted = this.stateViews > 0;\n        if (wanted === this.stateOn)\n            return;\n        this.stateOn = wanted;\n        if (!wanted) {\n            this.hydrated = false;\n            this.members.clear();\n            if (this.#pending !== undefined)\n                this.#pending.missing.clear();\n        }\n        if (this.hold !== undefined)\n            this.hold.channel.wantState(this.hold.id, wanted);\n        for (const view of this.views)\n            view.update();\n    }\n    listen(name, readable) {\n        let set = this.#listeners.get(name);\n        if (set === undefined) {\n            set = new Set();\n            this.#listeners.set(name, set);\n        }\n        set.add(readable);\n    }\n    unlisten(name, readable) {\n        this.#listeners.get(name)?.delete(readable);\n    }\n    /** Whether `name` is a state member of the applied variant (as the consumer's contract describes it). */\n    inVariant(name) {\n        const variant = this.shape?.variant;\n        return variant !== undefined && this.contract.description.variants[variant]?.[name]?.kind === \"state\";\n    }\n    /** The members' value as views read it: throws `not_ready` before the first hydration, `not_in_variant` outside it. */\n    read(name) {\n        if (this.status === \"ended\")\n            throw this.terminalError();\n        if (!this.hydrated)\n            throw new ChordError(\"not_ready\", `${this.key}.${name} is not hydrated yet`);\n        if (!this.inVariant(name))\n            throw new ChordError(\"not_in_variant\", `${this.key}: ${name} is not a state member of variant ${this.shape?.variant}`);\n        return this.members.get(name)?.value;\n    }\n    /** Resolves once the binding has its state (rejects if it ends first). */\n    whenHydrated() {\n        if (this.hydrated)\n            return Promise.resolve();\n        if (this.ended)\n            return Promise.reject(this.terminalError());\n        return new Promise((resolve, reject) => this.#hydrationWaiters.add({ resolve, reject }));\n    }\n    #settleHydration(error) {\n        const waiters = [...this.#hydrationWaiters];\n        this.#hydrationWaiters.clear();\n        for (const waiter of waiters) {\n            if (error === undefined)\n                waiter.resolve();\n            else\n                waiter.reject(error);\n        }\n    }\n    readable(name) {\n        return this.status !== \"ended\" && this.hydrated && this.inVariant(name);\n    }\n    terminalError() {\n        return this.error ?? new ChordError(\"released\", `reference ${this.key} released`);\n    }\n    // ─── driven by the host and the link ───\n    bound(channel, id) {\n        this.hold = { channel, id };\n        this.stateOn = this.wantsState;\n    }\n    /** A unit begins: `listed` are the members whose snapshots follow. */\n    shaped(shape, listed) {\n        if (this.ended)\n            return;\n        const previous = this.#pending;\n        const missing = new Set(listed);\n        // A newer shape before the older one's snapshots (relays may reorder them): wait for both.\n        if (previous !== undefined)\n            for (const name of previous.missing)\n                missing.add(name);\n        const wanted = new Set(this.#stateMembers(shape));\n        for (const name of [...missing])\n            if (!wanted.has(name) || !this.stateOn)\n                missing.delete(name);\n        this.#pending = { shape, missing, values: previous?.values ?? new Map() };\n        if (missing.size === 0)\n            this.#apply();\n    }\n    /** A state frame for member `name` of the current hold. */\n    state(name, frame) {\n        if (this.ended)\n            return;\n        if (frame.as === \"error\") {\n            const error = fromWireError(frame.error);\n            // Before the first hydration nobody could read anything: the binding fails instead of waiting forever.\n            if (!this.hydrated && this.stateOn) {\n                this.gone(error);\n                this.close();\n            }\n            else\n                this.host.report(error);\n            return;\n        }\n        const pending = this.#pending;\n        if (frame.as === \"ops\") {\n            const target = pending?.values.get(name) ?? this.members.get(name);\n            if (target === undefined)\n                return;\n            const ops = target.decoder.decode(frame.ops ?? []);\n            target.value = applyImmutable(target.value, ops);\n            if (target === this.members.get(name))\n                this.#deliver(name, { type: \"ops\", ops, value: target.value });\n            return;\n        }\n        const fresh = { value: frame.value, decoder: decoder() };\n        if (pending !== undefined && (pending.missing.has(name) || pending.values.has(name))) {\n            pending.values.set(name, fresh);\n            pending.missing.delete(name);\n            if (pending.missing.size === 0)\n                this.#apply();\n            return;\n        }\n        if (!this.inVariant(name))\n            return;\n        this.members.set(name, fresh);\n        this.#deliver(name, { type: \"reset\", value: fresh.value });\n    }\n    /** The provider ended the object (or refused the hold): every view is gone. */\n    gone(error) {\n        if (this.ended)\n            return;\n        this.status = \"ended\";\n        this.error = error;\n        this.hold = undefined;\n        this.#pending = undefined;\n        this.#live.reject(error);\n        this.#settleHydration(error);\n        for (const view of [...this.views])\n            view.end(error);\n        this.#listeners.clear();\n        this.host.forgetBinding(this);\n    }\n    /** The link went down but may come back (upstream reconnect): keep the values, wait for the re-hold. */\n    detached() {\n        if (this.ended)\n            return;\n        this.hold = undefined;\n        this.#pending = undefined;\n        if (this.status === \"live\") {\n            this.status = \"loading\";\n            this.#live = deferred();\n        }\n        for (const view of this.views)\n            view.update();\n    }\n    /** No views and no linger: releases the hold and forgets the binding. */\n    close() {\n        if (this.lingerTimer !== undefined)\n            clearTimeout(this.lingerTimer);\n        this.lingerTimer = undefined;\n        if (this.hold !== undefined)\n            this.hold.channel.release(this.hold.id);\n        this.hold = undefined;\n        if (this.status !== \"ended\") {\n            this.status = \"ended\";\n            const error = new ChordError(\"released\", `reference ${this.key} released`);\n            this.#live.reject(error);\n            this.#settleHydration(error);\n            for (const view of [...this.views])\n                view.end(error);\n        }\n        this.#pending = undefined;\n        this.#listeners.clear();\n        this.host.forgetBinding(this);\n    }\n    /** Calls `name` over the current hold, waiting for it while the binding (re)holds. */\n    async call(name, args, ctx) {\n        for (;;) {\n            if (this.ended)\n                throw this.terminalError();\n            if (this.status !== \"live\" || this.hold === undefined)\n                await raceSignal(this.#live.promise, ctx.signal);\n            const hold = this.hold;\n            if (hold === undefined || this.status !== \"live\")\n                continue;\n            const variant = this.shape?.variant;\n            const description = variant === undefined ? undefined : this.contract.description.variants[variant]?.[name];\n            if (description?.kind !== \"method\") {\n                throw new ChordError(\"not_in_variant\", `${this.key}: ${name} is not a method of variant ${variant}`);\n            }\n            // Send only what the consumer's own schema knows (the additive rule's premise; see ObjectImpl.call).\n            const sent = description.args === undefined ? undefined : Value.Clean(description.args, Value.Clone(args));\n            return hold.channel.call(hold.id, name, sent, { rootId: ctx.rootId, codeVersion: ctx.codeVersion }, ctx.signal);\n        }\n    }\n    #stateMembers(shape) {\n        const members = shape.variant === undefined ? undefined : this.contract.description.variants[shape.variant];\n        if (members === undefined)\n            return [];\n        return shape.members.filter((name) => members[name]?.kind === \"state\");\n    }\n    /** Applies the pending shape with its snapshots: members outside the variant go, new values are announced. */\n    #apply() {\n        const pending = this.#pending;\n        if (pending === undefined)\n            return;\n        this.#pending = undefined;\n        this.shape = pending.shape;\n        const wanted = new Set(this.#stateMembers(pending.shape));\n        for (const name of [...this.members.keys()])\n            if (!wanted.has(name))\n                this.members.delete(name);\n        for (const [name, state] of pending.values)\n            if (wanted.has(name))\n                this.members.set(name, state);\n        this.hydrated = this.stateOn && [...wanted].every((name) => this.members.has(name));\n        if (this.hydrated)\n            this.#settleHydration();\n        this.status = \"live\";\n        this.#applied = true;\n        this.#live.resolve();\n        for (const view of this.views)\n            view.update();\n        for (const [name, state] of pending.values) {\n            if (wanted.has(name))\n                this.#deliver(name, { type: \"reset\", value: state.value });\n        }\n        for (const view of [...this.views])\n            view.shapeChanged();\n    }\n    #deliver(name, event) {\n        const readables = this.#listeners.get(name);\n        if (readables === undefined)\n            return;\n        for (const readable of [...readables])\n            readable.deliver(event);\n    }\n}\n/**\n * A state member of a remote reference: the binding's value. Reading throws `not_ready` before the first hydration and\n * `not_in_variant` outside the variant. A listener added before the hydration gets its snapshot then.\n */\nclass ViewReadable {\n    view;\n    #name;\n    #values = new Set();\n    #events = new Set();\n    /** Event listeners that have not had their snapshot yet. */\n    #unseen = new Set();\n    constructor(view, name) {\n        this.view = view;\n        this.#name = name;\n    }\n    get value() {\n        if (this.view.ended)\n            throw this.view.terminalError();\n        return this.view.binding.read(this.#name);\n    }\n    /** Not hydrated before the binding's first snapshots (a local object forwarding this member waits for them). */\n    get [HYDRATION]() {\n        const binding = this.view.binding;\n        if (binding.hydrated)\n            return undefined;\n        return { hydrated: false, whenHydrated: () => binding.whenHydrated() };\n    }\n    subscribe(listener) {\n        this.#values.add(listener);\n        this.#attach();\n        if (this.#readable())\n            this.#safe(() => listener(this.view.binding.members.get(this.#name)?.value));\n        return () => this.#remove(this.#values, listener);\n    }\n    events(listener) {\n        this.#events.add(listener);\n        this.#attach();\n        if (this.#readable()) {\n            const value = this.view.binding.members.get(this.#name)?.value;\n            this.#safe(() => listener({ type: \"snap\", value }));\n        }\n        else\n            this.#unseen.add(listener);\n        return () => {\n            this.#unseen.delete(listener);\n            this.#remove(this.#events, listener);\n        };\n    }\n    deliver(event) {\n        for (const listener of [...this.#events]) {\n            if (!this.#unseen.delete(listener))\n                this.#safe(() => listener(event));\n            else if (event.type !== \"ops\")\n                this.#safe(() => listener({ type: \"snap\", value: event.value }));\n        }\n        for (const listener of [...this.#values])\n            this.#safe(() => listener(event.value));\n    }\n    stop() {\n        this.#values.clear();\n        this.#events.clear();\n        this.#unseen.clear();\n        this.view.binding.unlisten(this.#name, this);\n    }\n    #readable() {\n        return !this.view.ended && this.view.binding.readable(this.#name);\n    }\n    #attach() {\n        if (!this.view.ended)\n            this.view.binding.listen(this.#name, this);\n    }\n    #remove(set, listener) {\n        set.delete(listener);\n        if (this.#values.size + this.#events.size === 0)\n            this.view.binding.unlisten(this.#name, this);\n    }\n    #safe(fn) {\n        try {\n            fn();\n        }\n        catch (error) {\n            this.view.binding.host.report(error);\n        }\n    }\n}\n/**\n * A reference to an object on another host: a view onto the host's shared binding for its key. Each view has its own\n * owner, status, observers and `release`; ending by the provider and re-holding belong to the binding.\n */\nexport class RemoteRef {\n    object = undefined;\n    binding;\n    owner;\n    /** False: a method-only view (`state: false`), ready once live. */\n    wantsState;\n    proxy;\n    ready;\n    status = \"loading\";\n    error;\n    shapeListeners = new Set();\n    #statusListeners = new Set();\n    #readables = new Map();\n    #callers = new Map();\n    #settleReady;\n    constructor(binding, owner, wantsState) {\n        this.binding = binding;\n        this.owner = owner;\n        this.wantsState = wantsState;\n        const ready = deferred();\n        this.ready = ready.promise;\n        this.#settleReady = ready;\n        this.proxy = new Proxy(this, {\n            get: (target, property) => {\n                if (REF_BASE.has(property)) {\n                    const value = Reflect.get(target, property, target);\n                    return typeof value === \"function\" ? value.bind(target) : value;\n                }\n                if (typeof property !== \"string\" || property === \"then\")\n                    return undefined;\n                return target.member(property);\n            },\n        });\n        refsByProxy.set(this.proxy, this);\n    }\n    get contract() {\n        return this.binding.contract;\n    }\n    get address() {\n        return this.binding.key;\n    }\n    get ended() {\n        return this.status === \"released\" || this.status === \"gone\";\n    }\n    get variant() {\n        return this.binding.shape?.variant;\n    }\n    get shape() {\n        return this.binding.shape;\n    }\n    onShape(listener) {\n        this.shapeListeners.add(listener);\n        return () => this.shapeListeners.delete(listener);\n    }\n    onStatus(listener) {\n        this.#statusListeners.add(listener);\n        return () => this.#statusListeners.delete(listener);\n    }\n    terminalError() {\n        return this.status === \"gone\" ? this.error : new ChordError(\"released\", `reference ${this.address} released`);\n    }\n    release() {\n        if (this.ended)\n            return;\n        this.status = \"released\";\n        this.#notify();\n        this.#settleReady?.reject(new ChordError(\"released\", `reference ${this.address} released`));\n        this.#settleReady = undefined;\n        for (const readable of this.#readables.values())\n            readable.stop();\n        this.binding.removeView(this);\n    }\n    // ─── driven by the binding ───\n    /** Follows the binding: live once it has a shape (and, for a state view, its state) over a current hold. */\n    update() {\n        if (this.ended)\n            return;\n        const binding = this.binding;\n        const live = binding.status === \"live\" && binding.hold !== undefined && (!this.wantsState || binding.hydrated);\n        const next = live ? \"live\" : \"loading\";\n        if (next === this.status)\n            return;\n        this.status = next;\n        this.#notify();\n        if (live) {\n            this.#settleReady?.resolve();\n            this.#settleReady = undefined;\n        }\n    }\n    end(error) {\n        if (this.ended)\n            return;\n        const released = error instanceof ChordError && error.code === \"released\";\n        this.status = released ? \"released\" : \"gone\";\n        if (!released)\n            this.error = error;\n        this.#notify();\n        this.#settleReady?.reject(error);\n        this.#settleReady = undefined;\n        for (const readable of this.#readables.values())\n            readable.stop();\n    }\n    shapeChanged() {\n        const shape = this.binding.shape;\n        if (shape === undefined || this.ended)\n            return;\n        for (const listener of [...this.shapeListeners]) {\n            try {\n                listener(shape);\n            }\n            catch (error) {\n                this.binding.host.report(error);\n            }\n        }\n    }\n    #notify() {\n        notifyStatus(this.#statusListeners, this.status, this.error, (error) => this.binding.host.report(error));\n    }\n    // ─── members ───\n    member(name) {\n        const description = Object.values(this.contract.description.variants)\n            .map((members) => members[name])\n            .find((member) => member !== undefined);\n        if (description?.kind === \"method\")\n            return this.#caller(name);\n        if (description?.kind === \"state\") {\n            let readable = this.#readables.get(name);\n            if (readable === undefined) {\n                readable = new ViewReadable(this, name);\n                this.#readables.set(name, readable);\n            }\n            return readable;\n        }\n        return undefined;\n    }\n    #caller(name) {\n        let caller = this.#callers.get(name);\n        if (caller === undefined) {\n            const noArgs = takesNoArgs(this.contract, name);\n            caller = (...given) => {\n                // A method without arguments is called as `ref.name(ctx)`.\n                const [args, ctx] = (noArgs ? [undefined, given[0]] : given);\n                const host = this.binding.host;\n                if (host.inFactory > 0)\n                    throw new ChordError(\"not_ready\", `${this.address}.${name} called inside a factory`);\n                // The same checks as a local reference's caller (RefImpl.caller and ObjectImpl.call): a ctx from another host\n                // or one not made by Chord would carry a root this host does not own over its link.\n                if (ctx !== undefined && !(ctx instanceof CtxImpl)) {\n                    return Promise.reject(invalid(\"foreign_ctx\", \"ctx must come from a Chord host\"));\n                }\n                try {\n                    ctx?.check(host);\n                }\n                catch (error) {\n                    return Promise.reject(error);\n                }\n                if (ctx === undefined || ctx.holder) {\n                    return host.root((root) => this.#call(name, args, root), { signal: ctx?.signal });\n                }\n                return this.#call(name, args, ctx);\n            };\n            this.#callers.set(name, caller);\n        }\n        return caller;\n    }\n    #call(name, args, ctx) {\n        if (this.ended)\n            return Promise.reject(this.terminalError());\n        return this.binding.call(name, args, ctx);\n    }\n}\n//# sourceMappingURL=remote.js.map","import { ChildReloads, reconcileChild, runClusterReload } from \"./cluster.js\";\nimport { Connection } from \"./connection.js\";\nimport { bind, contractFromDescription, placedOn, placementText, resolveHost, } from \"./contract.js\";\nimport { ChordError, invalid, runAll } from \"./errors.js\";\nimport { awaitReady, CtxImpl, hostLifetime, makeService, ObjectImpl, RefImpl, } from \"./object.js\";\nimport { enqueue } from \"./publish.js\";\nimport { runReload } from \"./reload.js\";\nimport { RemoteBinding, RemoteRef } from \"./remote.js\";\nimport { canonicalIdentity, canonicalJson, deepEqual, normalize } from \"./schema.js\";\n/** `defineFacet<P>(…)`: an app passes its principal type, so factories and contexts see `P`. */\nexport const defineFacet = (setup, options = {}) => ({ setup, uses: options.uses });\nconst isFacet = (ref) => typeof ref === \"object\" && !(ref instanceof URL);\nconst EMPTY_TABLE = new Map();\n/** A host whose principals are `P` (the app's type; `unknown` if not given). */\nexport function createHost(options) {\n    return new HostImpl(options);\n}\nexport class HostImpl {\n    name;\n    dev;\n    principal;\n    inFactory = 0;\n    failed;\n    objects = new Map();\n    codeVersions = new Map();\n    facets = new Map();\n    /** The host's own references to its `lifetime: \"host\"` objects, by type name. */\n    hostObjects = new Map();\n    kind;\n    connections = new Set();\n    upstream;\n    /** Shared bindings of this host's remote references, by key (re-held after an upstream reconnect). */\n    bindings = new Map();\n    /** Bindings without references that linger, least recently released first. */\n    #lingering = new Map();\n    #lingerTypes;\n    #lingerCap;\n    #originSeq = 0;\n    #routes = new Map();\n    #childReloads = new ChildReloads(this);\n    /** Child facet modules by host-name prefix, from every committed cluster reload (for reconciling children). */\n    remoteModules = {};\n    /** Removal tombstones also reconcile children that connected during a transaction. */\n    remoteRemoved = {};\n    /** Highest code version the parent has retired. */\n    #retireAllowed = 0;\n    /** Roots that came over a link, by the link they came from. */\n    /** Foreign roots (started on another host), by the links they came over. */\n    #foreign = new Map();\n    /** Roots started on this host that have not ended. */\n    #local = new Set();\n    #incarnation = Math.random().toString(36).slice(2, 8);\n    /** Links each root's calls went out on. */\n    #rootLinks = new Map();\n    current;\n    previous;\n    /** The code version a running reload will commit; new types activated during prepare install their implementation for it. */\n    pending;\n    /** Activations of these types wait (reload gate). */\n    /** Types behind a reload gate: new objects of these types are rejected `upgrade_conflict` until commit/abort. */\n    gating;\n    reloading = false;\n    taskStopDeadline;\n    readyTimeout;\n    #principalKey;\n    /** `principalKey(self)`: an equal principal is the host's own, whatever object carries it. */\n    #selfKey;\n    /** Called when a root ends, the parent allows a retirement, or the previous code version retires. */\n    #retirementWatchers = new Set();\n    /** Child hosts whose hello arrived while a reload ran: synced or reconciled once it ends. */\n    #deferredHellos = new Map();\n    /** Resolved when the running reload ends. */\n    #reloadWaiters = [];\n    /** Aborted when the installed run of a facet (by name) is replaced, removed, or the host closes. */\n    #facetRuns = new Map();\n    #onError;\n    #loader;\n    #dying = new Map();\n    #touches = new Map();\n    #order = new Map();\n    #subscribers = new Map();\n    #codeVersionSeq = 1;\n    #rootSeq = 0;\n    constructor(options) {\n        this.name = options.name ?? \"host\";\n        this.dev = options.dev ?? false;\n        if (!(\"self\" in options))\n            throw new TypeError(\"createHost needs `self`: the principal of the host's own code\");\n        this.principal = options.self;\n        this.#principalKey = options.principalKey ?? canonicalJson;\n        this.#selfKey = this.#principalKey(options.self);\n        this.#onError = options.onError ?? ((error) => console.error(\"chord:\", error));\n        this.#loader = options.loader;\n        this.taskStopDeadline = options.taskStopDeadline ?? 5000;\n        this.readyTimeout = options.readyTimeout ?? 60_000;\n        this.#lingerTypes = options.linger?.types ?? {};\n        this.#lingerCap = options.linger?.cap ?? 4;\n        this.current = {\n            id: this.#codeVersionSeq,\n            services: new Map(),\n            tables: new Map(),\n            roots: new Map(),\n            abort: new AbortController(),\n        };\n        this.codeVersions.set(this.current.id, this.current);\n        this.kind = options.kind ?? \"host\";\n        if (options.upstream !== undefined)\n            this.connect(options.upstream.link, options.upstream);\n    }\n    /** Whether `principal` is the host's own: the same key as `self`. */\n    isSelf(principal) {\n        return principal === this.principal || this.#principalKey(principal) === this.#selfKey;\n    }\n    get codeVersion() {\n        return this.current.id;\n    }\n    get previousCodeVersion() {\n        return this.previous?.id;\n    }\n    /** Allocates the next code version id, or adopts one issued by the coordinating server. */\n    nextCodeVersionId(given) {\n        if (given !== undefined && given <= this.current.id)\n            throw new Error(`code version ${given} is not newer than ${this.current.id}`);\n        this.#codeVersionSeq = given ?? this.#codeVersionSeq + 1;\n        return this.#codeVersionSeq;\n    }\n    report(error) {\n        this.#onError(error);\n    }\n    // ─── serving ───\n    serve = ((type, factory, options = {}) => {\n        if (this.reloading)\n            throw new Error(\"host.serve during a reload; serve from a facet passed to reload()\");\n        this.serveInto(this.current.services, makeService(type, factory, options, \"\"));\n        if (options.lifetime === \"host\")\n            this.startHostObject(this.current.services.get(type.name));\n    });\n    install(facet, options = {}) {\n        if (this.reloading)\n            throw new Error(\"host.install during a reload\");\n        if (this.facets.has(facet.name))\n            throw new Error(`facet ${facet.name} is already installed; use reload()`);\n        const added = [];\n        const run = new AbortController();\n        try {\n            facet.setup(this.facetApi(((type, factory, options = {}) => {\n                const service = makeService(type, factory, options, facet.name);\n                this.serveInto(this.current.services, service);\n                added.push(service);\n            }), run.signal));\n        }\n        catch (error) {\n            run.abort(error);\n            throw error;\n        }\n        this.facets.set(facet.name, facet);\n        this.facetRunChanged(facet.name, run);\n        const refs = added.filter(hostLifetime).map((service) => this.startHostObject(service));\n        return options.awaitHostObjects === false ? Promise.resolve() : this.#hostObjectsReady(refs);\n    }\n    async load(plugins, options = {}) {\n        const facets = await this.resolve(plugins);\n        // No await between installs: a host object's factory may consume a type served by a later facet.\n        await Promise.all(facets.map((facet) => this.install(facet, options)));\n    }\n    ready() {\n        return this.#hostObjectsReady(this.hostObjects.values());\n    }\n    #hostObjectsReady(refs) {\n        const ready = Promise.all([...refs].map((ref) => ref.ready)).then(() => { });\n        // Ignoring install's return still reports through onError without an unhandled rejection.\n        ready.catch(() => { });\n        return ready;\n    }\n    /** Turns plugin references into facets, importing modules through the loader. */\n    async resolve(plugins) {\n        const modules = plugins.filter((ref) => !isFacet(ref));\n        if (modules.length > 0 && this.#loader === undefined) {\n            throw new Error(\"loading modules needs createHost({ loader }), e.g. nodeLoader from @earendil-works/chord/node\");\n        }\n        const loaded = modules.length > 0 && this.#loader !== undefined ? await this.#loader(modules) : [];\n        return plugins.map((ref) => (isFacet(ref) ? ref : loaded.shift()));\n    }\n    facetApi(serve, signal) {\n        return {\n            serve,\n            name: this.name,\n            root: (fn, options) => this.root(fn, options),\n            registry: (registry) => this.registry(registry),\n            signal,\n        };\n    }\n    /** The installed run of facet `name` is now `run` (or none): the run it replaces is aborted. */\n    facetRunChanged(name, run) {\n        const replaced = this.#facetRuns.get(name);\n        if (run === undefined)\n            this.#facetRuns.delete(name);\n        else\n            this.#facetRuns.set(name, run);\n        if (replaced !== run)\n            replaced?.abort(new ChordError(\"gone\", `facet ${name} was replaced or removed`));\n    }\n    serveInto(services, service) {\n        if (services.has(service.contract.name))\n            throw new Error(`${service.contract.name} is already served`);\n        const placement = service.contract.description.host;\n        if (placement !== undefined && !placedOn(placement, this.name)) {\n            throw new TypeError(`${service.contract.name} is declared for ${placementText(placement)}, but ${this.name} serves it`);\n        }\n        services.set(service.contract.name, service);\n    }\n    startHostObject(service) {\n        const ref = this.acquire(service.contract, {}, undefined, \"host\");\n        this.hostObjects.set(service.contract.name, ref);\n        ref.ready.catch((error) => this.report(error));\n        return ref;\n    }\n    // ─── HostCore ───\n    currentCodeVersion() {\n        return this.current.id;\n    }\n    hasCodeVersion(codeVersion) {\n        return this.codeVersions.has(codeVersion);\n    }\n    *retainedCodeVersions() {\n        for (const [id, state] of this.codeVersions)\n            yield [id, state.services];\n        if (this.pending !== undefined)\n            yield [this.pending.id, this.pending.services];\n    }\n    pendingCodeVersion() {\n        return this.pending?.id;\n    }\n    /** The current code for a type; a type a running reload adds is served from the pending code version. */\n    service(typeName) {\n        return this.current.services.get(typeName) ?? this.pending?.services.get(typeName);\n    }\n    addressOf(type, input, principal, candidate = false) {\n        const elsewhere = this.#elsewhere(type, input);\n        if (elsewhere !== undefined)\n            return this.#remoteKey(type, elsewhere.input, principal);\n        const service = this.#bindingService(type.name, candidate);\n        if (service === undefined)\n            throw unknownType(type.name, this.name);\n        return this.#locate(service, input, principal).address;\n    }\n    /**\n     * Where an object of a remote type lives when that is another host: its name and the input normalized with the\n     * caller's contract (the placement is read from it). `undefined`: here (and every local type).\n     */\n    #elsewhere(type, input) {\n        const placement = type.description.host;\n        if (type.scope !== \"remote\" || placement === undefined)\n            return undefined;\n        const normalized = normalize(type.input, input, `${type.name} input`);\n        const at = resolveHost(type.name, placement, normalized);\n        return at === this.name ? undefined : { at, input: normalized };\n    }\n    /**\n     * The address of `input` for `principal`, normalized. A `lifetime: \"host\"` type has one object: the empty input, for\n     * the host principal, whoever asks; another input is invalid.\n     */\n    #locate(service, input, principal) {\n        const { name, input: schema } = service.contract;\n        const normalized = normalize(schema, input, `${name} input`);\n        const identity = canonicalIdentity(schema, normalized);\n        if (hostLifetime(service)) {\n            if (identity !== canonicalIdentity(schema, normalize(schema, {}, `${name} input`)))\n                throw invalid(\"input\", `${name} has lifetime \"host\": its one object has the empty input`);\n            principal = this.principal;\n        }\n        return { address: `${name}\\u0000${identity}\\u0000${this.#principalPart(principal)}`, normalized, principal };\n    }\n    #principalPart(principal) {\n        return this.isSelf(principal) ? \"host\" : `p:${this.#principalKey(principal)}`;\n    }\n    /**\n     * The key of a remote binding: type, input identity (fields equal to their defaults omitted, as for local objects),\n     * principal key and the consumer's contract fingerprint. No host name: the type and the input decide where it lives.\n     */\n    #remoteKey(type, normalized, principal) {\n        const identity = canonicalIdentity(type.input, normalized);\n        return `@${type.name}\\u0000${identity}\\u0000${this.#principalPart(principal)}\\u0000${type.fingerprint}`;\n    }\n    acquire(type, input, options, owner, from, candidate = false) {\n        const elsewhere = this.#elsewhere(type, input);\n        if (elsewhere !== undefined)\n            return this.#acquireRemote(type, elsewhere.at, elsewhere.input, options, owner);\n        const service = this.#bindingService(type.name, candidate);\n        if (service === undefined)\n            throw unknownType(type.name, this.name);\n        bind(service.contract, service.options.accepts, type);\n        const { address, normalized, principal } = this.#locate(service, input, options?.principal ?? this.principal);\n        // The provider's own placement decides, never where a request says it is going (a client picks that).\n        const placement = service.contract.description.host;\n        if (placement !== undefined && resolveHost(type.name, placement, normalized) !== this.name) {\n            throw invalid(\"placement\", `${type.name} with this input lives on ${resolveHost(type.name, placement, normalized)}, not ${this.name}`);\n        }\n        let object = this.objects.get(address);\n        if (from !== undefined && object !== undefined && (object === from || reaches(object, from))) {\n            throw invalid(\"cycle\", `${from.address} -> ${address} would create a ref cycle`);\n        }\n        if (object === undefined) {\n            if (this.gating?.has(type.name)) {\n                throw new ChordError(\"upgrade_conflict\", `${type.name} is being upgraded; retry`, { reason: \"gate\" });\n            }\n            const dying = this.#dying.get(address);\n            if (dying?.status === \"disposed\")\n                this.#dying.delete(address);\n            object = new ObjectImpl(this, {\n                address,\n                typeName: type.name,\n                input: normalized,\n                principal,\n                hostLifetime: hostLifetime(service),\n            });\n            this.objects.set(address, object);\n            // A new object for an address still being disposed waits for that cleanup (exclusive resources).\n            object.start(dying?.status === \"disposing\" ? dying.dispose(false) : undefined);\n        }\n        const ref = new RefImpl(object, type, owner);\n        object.addRef(ref);\n        return ref;\n    }\n    forget(object) {\n        if (this.objects.get(object.address) === object)\n            this.objects.delete(object.address);\n        if (object.status === \"disposing\")\n            this.#dying.set(object.address, object);\n    }\n    disposed(object) {\n        if (this.#dying.get(object.address) === object)\n            this.#dying.delete(object.address);\n    }\n    touch(rootId, object) {\n        let touched = this.#touches.get(rootId);\n        if (touched === undefined) {\n            touched = new Set();\n            this.#touches.set(rootId, touched);\n        }\n        touched.add(object);\n    }\n    // ─── roots ───\n    async root(fn, options = {}) {\n        // The incarnation keeps root ids unique across restarts of a host with the same name.\n        const rootId = `${this.name}#${this.#incarnation}:${++this.#rootSeq}`;\n        this.#local.add(rootId);\n        return this.joinRoot(rootId, options.codeVersion ?? this.current.id, fn, options);\n    }\n    /**\n     * Runs `fn` inside root `rootId` of `codeVersion`. A root counts as running here (for retirement) while any of its\n     * calls runs here. A root that started here ends when its last call here settles, even if it went out and came back\n     * over a link meanwhile. A foreign root (started elsewhere, arriving `from` a link) keeps its leases on objects\n     * until every link it came over announced its end (`root_end`) or closed, so its re-entry stays grandfathered.\n     */\n    async joinRoot(rootId, codeVersionId, fn, options = {}) {\n        const codeVersion = this.codeVersions.get(codeVersionId);\n        if (codeVersion === undefined) {\n            this.#local.delete(rootId);\n            throw new ChordError(\"superseded\", `code version ${codeVersionId} is not retained by ${this.name}`);\n        }\n        if (options.from !== undefined && !this.#local.has(rootId)) {\n            let links = this.#foreign.get(rootId);\n            if (links === undefined) {\n                links = new Set();\n                this.#foreign.set(rootId, links);\n            }\n            links.add(options.from);\n        }\n        codeVersion.roots.set(rootId, (codeVersion.roots.get(rootId) ?? 0) + 1);\n        const ctx = new CtxImpl(this, {\n            // Forced retirement aborts what still runs on a code version before closing what only it used.\n            signals: options.signal === undefined ? [codeVersion.abort.signal] : [options.signal, codeVersion.abort.signal],\n            rootId,\n            codeVersion: codeVersion.id,\n            principal: options.principal ?? this.principal,\n        });\n        try {\n            return await fn(ctx);\n        }\n        finally {\n            ctx.close();\n            const count = (codeVersion.roots.get(rootId) ?? 1) - 1;\n            if (count > 0)\n                codeVersion.roots.set(rootId, count);\n            else {\n                codeVersion.roots.delete(rootId);\n                if (!this.#foreign.has(rootId))\n                    this.endRoot(rootId);\n                this.maybeRetire();\n                this.#retirementChanged();\n            }\n        }\n    }\n    /** Remembers that calls of `rootId` went out on `connection`, which must hear when the root ends. */\n    rootSent(rootId, connection) {\n        let links = this.#rootLinks.get(rootId);\n        if (links === undefined) {\n            links = new Set();\n            this.#rootLinks.set(rootId, links);\n        }\n        links.add(connection);\n    }\n    /** A root ended (here, or announced by its origin): end its leases and tell the links it went out on. */\n    endRoot(rootId) {\n        this.#local.delete(rootId);\n        this.#foreign.delete(rootId);\n        for (const object of this.#touches.get(rootId) ?? [])\n            object.rootEnded(rootId);\n        this.#touches.delete(rootId);\n        for (const connection of this.#rootLinks.get(rootId) ?? [])\n            connection.send({ t: \"root_end\", rootId });\n        this.#rootLinks.delete(rootId);\n    }\n    /**\n     * `from` announced the end of a foreign root (or closed). Honored only if the root came over `from`: a peer cannot\n     * end leases of roots it never carried. The root ends when no link that brought it remains.\n     */\n    foreignRootEnded(rootId, from) {\n        const links = this.#foreign.get(rootId);\n        if (links === undefined || !links.delete(from) || links.size > 0)\n            return;\n        const running = [...this.codeVersions.values()].some((codeVersion) => codeVersion.roots.has(rootId));\n        // Still running here (a call in flight): the lease ends when it settles.\n        if (running)\n            this.#foreign.delete(rootId);\n        else\n            this.endRoot(rootId);\n    }\n    /**\n     * Retires the previous code version once no local roots of it remain. A child also waits for its parent to retire\n     * it: roots span hosts, and an old root on the server may still call in.\n     */\n    maybeRetire() {\n        if (this.retirable())\n            this.retire();\n    }\n    /** The previous code version has no roots left here and, on a child host, the parent has retired it. */\n    retirable() {\n        const previous = this.previous;\n        if (previous === undefined || previous.roots.size > 0)\n            return false;\n        return this.kind === \"client\" || this.upstream === undefined || previous.id <= this.#retireAllowed;\n    }\n    allowRetire(codeVersion) {\n        this.#retireAllowed = Math.max(this.#retireAllowed, codeVersion);\n        this.maybeRetire();\n        this.#retirementChanged();\n    }\n    /** Calls `watcher` whenever a root ends, the parent allows a retirement, or a code version retires. */\n    watchRetirement(watcher) {\n        this.#retirementWatchers.add(watcher);\n        return () => this.#retirementWatchers.delete(watcher);\n    }\n    #retirementChanged() {\n        for (const watcher of [...this.#retirementWatchers])\n            watcher();\n    }\n    /**\n     * Tells a child that is now in step which code versions this host retired before: every id below the oldest one it\n     * retains (ids only grow). Without it, a child reconciled after those retirements would never hear a `retire` frame for\n     * its own previous code version and would wait for the retire deadline at every reload.\n     */\n    announceRetired(connection) {\n        const retired = (this.previous ?? this.current).id - 1;\n        if (retired > 0)\n            connection.send({ t: \"retire\", codeVersion: retired });\n    }\n    /** Drops the previous code version: its implementations and the declarations only it used. */\n    retire() {\n        const previous = this.previous;\n        if (previous === undefined)\n            return;\n        this.previous = undefined;\n        this.codeVersions.delete(previous.id);\n        for (const object of [...this.objects.values()])\n            this.retireImplementation(object, previous.id);\n        for (const connection of this.connections) {\n            if (connection.role === \"downstream\" && connection.peer?.kind === \"host\")\n                connection.send({ t: \"retire\", codeVersion: previous.id });\n        }\n        this.#retirementChanged();\n    }\n    /**\n     * Drops an object's implementation for `codeVersion` and what only that implementation declared, in disposal order:\n     * resources close (reverse open order) before its references are released.\n     */\n    retireImplementation(object, codeVersion) {\n        const installed = object.implementations.get(codeVersion);\n        object.implementations.delete(codeVersion);\n        if (installed === undefined || installed.decls === object.decls)\n            return;\n        const kept = object.allDecls();\n        const keep = (pick) => new Set([...kept].flatMap((decls) => [...pick(decls)]));\n        const refs = keep((decls) => decls.refs.values());\n        const resources = keep((decls) => decls.resources.values());\n        const derives = keep((decls) => decls.derives.values());\n        for (const derived of installed.decls.derives.values())\n            if (!derives.has(derived))\n                derived.detach();\n        const closing = [...installed.decls.resources.values()]\n            .filter((resource) => !resources.has(resource))\n            .sort((a, b) => object.openOrder.indexOf(b) - object.openOrder.indexOf(a));\n        const releasing = [...installed.decls.refs.values()].filter((ref) => !refs.has(ref));\n        object.refreshSchemas();\n        runAll([\n            ...closing.map((resource) => () => resource.close(object.openOrder)),\n            ...releasing.map((ref) => () => ref.release()),\n        ], `${object.address}: retiring code version ${codeVersion} failed`).catch((error) => this.report(error));\n    }\n    // ─── registries ───\n    registry(registry) {\n        const table = (ctx) => {\n            const codeVersion = ctx === undefined ? this.current : this.codeVersions.get(ctx.codeVersion);\n            if (codeVersion === undefined)\n                throw new ChordError(\"superseded\", `code version ${ctx?.codeVersion} is retired`);\n            return (codeVersion.tables.get(registry.name) ?? EMPTY_TABLE);\n        };\n        return {\n            table,\n            get: (key, ctx) => table(ctx).get(key),\n            subscribe: (listener) => {\n                let set = this.#subscribers.get(registry.name);\n                if (set === undefined) {\n                    set = new Set();\n                    this.#subscribers.set(registry.name, set);\n                }\n                const wrapped = listener;\n                set.add(wrapped);\n                wrapped(table(), this.current.id);\n                return () => set.delete(wrapped);\n            },\n        };\n    }\n    /** Builds registry tables from (object, declarations) pairs. Throws registry_conflict. */\n    buildTables(entries) {\n        const byRegistry = new Map();\n        for (const [object, decls] of entries) {\n            for (const { registry, key, value } of decls.registrations.values()) {\n                let entries = byRegistry.get(registry.name);\n                if (entries === undefined) {\n                    entries = new Map();\n                    byRegistry.set(registry.name, entries);\n                }\n                const existing = entries.get(key);\n                if (existing !== undefined && existing.object !== object && registry.conflict === \"error\") {\n                    throw invalid(\"registry_conflict\", `${registry.name}: ${key} registered by ${existing.object.address} and ${object.address}`);\n                }\n                entries.set(key, { value, object });\n                let order = this.#order.get(registry.name);\n                if (order === undefined) {\n                    order = new Map();\n                    this.#order.set(registry.name, order);\n                }\n                if (!order.has(key))\n                    order.set(key, order.size);\n            }\n        }\n        const tables = new Map();\n        for (const [name, entries] of byRegistry) {\n            const order = this.#order.get(name);\n            const sorted = [...entries].sort(([a], [b]) => order.get(a) - order.get(b));\n            tables.set(name, new Map(sorted.map(([key, entry]) => [key, entry.value])));\n        }\n        return tables;\n    }\n    /**\n     * The service a reference binds against: the current one, or for a prepare rerun (`candidate`) the running reload's\n     * pending one, so consumer and provider of a breaking change can reload in one batch.\n     */\n    #bindingService(typeName, candidate) {\n        return (candidate ? this.pending?.services.get(typeName) : undefined) ?? this.service(typeName);\n    }\n    /** Live objects with their current declarations; objects waiting for a reload's commit only with `candidates`. */\n    liveDecls(candidates = false) {\n        return [...this.objects.values()]\n            .filter((object) => object.status === \"live\" && (candidates || !object.deferredRuntime))\n            .map((object) => [object, object.decls]);\n    }\n    checkRegistrations(object, decls) {\n        if (decls.registrations.size === 0)\n            return;\n        this.buildTables([...this.liveDecls().filter(([other]) => other !== object), [object, decls]]);\n    }\n    registriesChanged(including) {\n        const entries = this.liveDecls().filter(([object]) => object !== including);\n        if (including !== undefined)\n            entries.push([including, including.decls]);\n        this.installTables(this.current, this.buildTables(entries));\n    }\n    /** A commit failed midway: from now on this host admits no work (calls fail `unavailable/host_failed`). */\n    fail(error) {\n        this.failed ??= error;\n        this.report(error);\n    }\n    /** Installs tables for `codeVersion`; subscribers hear about changed tables of the current code version (all tables when `all`). */\n    installTables(codeVersion, tables, all = false) {\n        const before = codeVersion.tables;\n        codeVersion.tables = tables;\n        if (codeVersion !== this.current)\n            return;\n        for (const [name, listeners] of this.#subscribers) {\n            const next = tables.get(name) ?? EMPTY_TABLE;\n            if (!all && sameTable(before.get(name) ?? EMPTY_TABLE, next))\n                continue;\n            const current = [...listeners];\n            enqueue(() => {\n                for (const listener of current) {\n                    try {\n                        listener(next, codeVersion.id);\n                    }\n                    catch (error) {\n                        this.report(error);\n                    }\n                }\n            });\n        }\n    }\n    // ─── public API ───\n    async get(type, input, options) {\n        const ref = this.acquire(type, input, options, \"external\");\n        await awaitReady(ref, options?.signal === undefined ? [] : [options.signal], this.readyTimeout);\n        return ref.proxy;\n    }\n    hold(type, input, options) {\n        return this.acquire(type, input, options, \"external\").proxy;\n    }\n    async invalidatePrincipal(match) {\n        const matches = typeof match === \"function\" ? match : (principal) => matchesPattern(match, principal);\n        const reason = new ChordError(\"gone\", \"principal invalidated\");\n        // Links acting as a matching principal are re-stamped (if the acceptor can) or closed.\n        for (const connection of [...this.connections]) {\n            if (connection.role !== \"downstream\" || !matches(connection.principal))\n                continue;\n            // Relays under the old principal close at once, including those still resolving their route.\n            connection.revoke(connection.restamp?.(connection.principal));\n        }\n        // Patterns propagate to child hosts, which dispose their own matching objects (e.g. relayed guests).\n        if (typeof match !== \"function\") {\n            for (const connection of this.connections) {\n                if (connection.role === \"downstream\" && connection.peer.kind === \"host\") {\n                    connection.send({ t: \"invalidate\", pattern: match });\n                }\n            }\n        }\n        const matching = [...this.objects.values()].filter((object) => !this.isSelf(object.principal) && matches(object.principal));\n        await disposeHoldersFirst(matching, reason, \"invalidatePrincipal: disposal failed\");\n    }\n    // ─── links ───\n    accept(link, options) {\n        const kind = options.kind ?? \"client\";\n        if (kind === \"host\" && options.name === undefined)\n            throw new TypeError(\"accepting a host link needs its name\");\n        this.#addConnection(link, {\n            ...options,\n            role: \"downstream\",\n            principal: options.principal,\n            peer: { kind, name: kind === \"host\" ? options.name : undefined },\n            // Holds over a client link carry its id as their origin (also when relayed), so hosts can tell clients apart.\n            ...(kind === \"client\" ? { originId: `${this.#incarnation}:${++this.#originSeq}` } : {}),\n        });\n    }\n    connect(link, options) {\n        if (!(\"principal\" in options))\n            throw new TypeError(\"connect needs `principal`: what the parent's own requests act as\");\n        if (this.upstream?.open)\n            this.upstream.link.close(\"replaced\");\n        const connection = this.#addConnection(link, {\n            ...options,\n            role: \"upstream\",\n            principal: options.principal,\n            peer: { kind: \"host\", name: undefined },\n        });\n        this.upstream = connection;\n        // Bindings that lost their link re-hold over the new one (`again`: they keep their values meanwhile).\n        for (const binding of this.bindings.values())\n            if (binding.hold === undefined && !binding.ended)\n                connection.hold(binding, binding.applied);\n    }\n    #addConnection(link, config) {\n        const connection = new Connection(this, link, config);\n        // A link that was already closed closed the connection in its constructor: keeping it would route to it forever.\n        if (connection.open)\n            this.connections.add(connection);\n        return connection;\n    }\n    route(prefix, route) {\n        if (typeof route.principal !== \"function\")\n            throw new TypeError(`route ${prefix} needs \\`principal\\`: what the routed hosts act as when they call back`);\n        this.#routes.set(prefix, route);\n    }\n    /**\n     * A child host announced its code version. In step: usable. Behind: fenced (nothing is routed to it) and reconciled\n     * by a reload of its modules to this host's code version, never by renumbering what it runs. Ahead: impossible,\n     * refused.\n     */\n    peerHello(connection, codeVersion) {\n        if (codeVersion > this.current.id) {\n            this.report(new ChordError(\"invalid\", `${connection.name} runs code version ${codeVersion}, ahead of ${this.current.id}`));\n            connection.link.close(\"code version ahead of parent\");\n            return;\n        }\n        if (this.reloading) {\n            // Not a participant of the running reload (participants are fixed when it starts): in step now, it would miss\n            // the commit. Decided when the reload ends. A child already behind is fenced now, so the calls its roots make\n            // meanwhile are admitted in this host's code version (never relabeled) instead of being `superseded`.\n            connection.peerCodeVersion = codeVersion;\n            if (codeVersion < this.current.id)\n                connection.fencedCodeVersions.add(codeVersion);\n            this.#deferredHellos.set(connection, codeVersion);\n            return;\n        }\n        if (codeVersion === this.current.id) {\n            connection.markSynced(codeVersion);\n            this.announceRetired(connection);\n            return;\n        }\n        connection.peerCodeVersion = codeVersion;\n        connection.fencedCodeVersions.add(codeVersion);\n        reconcileChild(this, connection).catch((error) => {\n            this.report(error);\n            connection.link.close(\"reconciliation failed\");\n        });\n    }\n    /** The host's reload slot was freed: children that said hello meanwhile are synced or reconciled now. */\n    reloadEnded() {\n        this.reloading = false;\n        const deferred = [...this.#deferredHellos];\n        this.#deferredHellos.clear();\n        for (const [connection, codeVersion] of deferred)\n            if (connection.open)\n                this.peerHello(connection, codeVersion);\n        for (const resolve of this.#reloadWaiters.splice(0))\n            resolve();\n        this.maybeRetire();\n    }\n    /** Resolves once no reload runs on this host. */\n    whenReloadEnded() {\n        if (!this.reloading)\n            return Promise.resolve();\n        return new Promise((resolve) => this.#reloadWaiters.push(resolve));\n    }\n    connectionClosed(connection) {\n        this.connections.delete(connection);\n        this.#deferredHellos.delete(connection);\n        // Foreign roots that came over this link will never announce their end over it.\n        for (const [rootId, links] of [...this.#foreign])\n            if (links.has(connection))\n                this.foreignRootEnded(rootId, connection);\n        for (const links of this.#rootLinks.values())\n            links.delete(connection);\n        if (this.upstream === connection) {\n            this.upstream = undefined;\n            this.#childReloads.parentLost();\n        }\n    }\n    /** The last reference to `binding` was released: it lingers if its type does (`HostOptions.linger`), else closes. */\n    bindingIdle(binding) {\n        const ms = Object.hasOwn(this.#lingerTypes, binding.contract.name)\n            ? this.#lingerTypes[binding.contract.name]\n            : 0;\n        // A binding that never had a shape has nothing worth keeping.\n        if (ms <= 0 || binding.ended || !binding.applied || this.#lingerCap <= 0) {\n            binding.close();\n            return;\n        }\n        binding.lingerTimer = setTimeout(() => binding.close(), ms);\n        binding.lingerTimer.unref?.();\n        this.#lingering.set(binding.key, binding);\n        for (const oldest of this.#lingering.values()) {\n            if (this.#lingering.size <= this.#lingerCap)\n                break;\n            oldest.close();\n        }\n    }\n    forgetBinding(binding) {\n        if (this.bindings.get(binding.key) === binding)\n            this.bindings.delete(binding.key);\n        if (this.#lingering.get(binding.key) === binding)\n            this.#lingering.delete(binding.key);\n    }\n    /** A downstream host connection by its configured name (never by what a peer announced). */\n    #childNamed(name) {\n        return [...this.connections].find((connection) => connection.open &&\n            connection.role === \"downstream\" &&\n            connection.peer.kind === \"host\" &&\n            connection.peer.name === name);\n    }\n    /**\n     * A reference to an object on host `at`: a view onto the binding for its key, created (and held) if there is none.\n     * `input` is normalized with `type` (the hold carries it so).\n     */\n    #acquireRemote(type, at, input, options, owner) {\n        const principal = options?.principal === undefined || this.isSelf(options.principal) ? undefined : options.principal;\n        const key = this.#remoteKey(type, input, principal ?? this.principal);\n        let binding = this.bindings.get(key);\n        const fresh = binding === undefined || binding.ended;\n        if (binding === undefined || binding.ended) {\n            binding = new RemoteBinding(this, { key, contract: type, at, input, principal });\n            this.bindings.set(key, binding);\n        }\n        const ref = new RemoteRef(binding, owner, options?.state !== false);\n        this.#lingering.delete(key);\n        binding.addView(ref);\n        if (fresh)\n            this.#hold(binding);\n        return ref;\n    }\n    /** Holds `binding` over the link to its host: the parent's, a child's, or one a route resolves. */\n    #hold(binding) {\n        const bindWhenSynced = (connection) => {\n            connection.then((target) => {\n                if (!binding.ended && binding.hold === undefined)\n                    target.hold(binding, false);\n            }, (error) => binding.gone(error));\n        };\n        const direct = this.#childNamed(binding.at);\n        if (this.upstream !== undefined)\n            this.upstream.hold(binding, false);\n        else if (direct !== undefined)\n            bindWhenSynced(direct.whenSynced().then(() => direct));\n        else {\n            const route = this.#routeFor(binding.at);\n            if (route === undefined)\n                binding.gone(new ChordError(\"unavailable\", `no route to ${binding.at}`));\n            else\n                bindWhenSynced(this.#resolve(route, binding.at, binding.principal ?? this.principal));\n        }\n    }\n    #routeFor(hostName) {\n        let best;\n        for (const entry of this.#routes) {\n            if (hostName.startsWith(entry[0]) && (best === undefined || entry[0].length > best[0].length))\n                best = entry;\n        }\n        return best?.[1];\n    }\n    /** Authorize, resolve (maybe spawn), authorize again; returns the synced connection to the host. */\n    async #resolve(route, hostName, principal, still = () => true) {\n        const refuse = () => new ChordError(\"forbidden\", `${hostName} refused for this principal`);\n        const revoked = () => new ChordError(\"gone\", \"principal invalidated while resolving\");\n        if (!(await route.authorize(principal, hostName)))\n            throw refuse();\n        if (!still())\n            throw revoked();\n        const link = await route.resolve(hostName);\n        if (!still())\n            throw revoked();\n        if (!(await route.authorize(principal, hostName)))\n            throw refuse();\n        if (!still())\n            throw revoked();\n        let connection = [...this.connections].find((candidate) => candidate.link === link);\n        connection ??= this.#addConnection(link, {\n            role: \"downstream\",\n            principal: route.principal(hostName),\n            peer: { kind: \"host\", name: hostName },\n        });\n        await connection.whenSynced();\n        if (!still())\n            throw revoked();\n        return connection;\n    }\n    /**\n     * Relays a reference from `relay.origin` to the host it names. Relaying needs a route: it is where authorization\n     * lives. The origin's authorization generation is re-checked after every await and right before forwarding, so a\n     * revocation during resolution wins.\n     */\n    async relay(relay) {\n        const at = relay.frame.at;\n        // The hold names its target; its contract token says where the type lives. They must agree.\n        const placement = contractFromDescription(relay.frame.token).description.host;\n        if (placement === undefined || resolveHost(relay.frame.token.name, placement, relay.frame.input) !== at)\n            throw invalid(\"placement\", `${relay.frame.token.name} with this input does not live on ${at}`);\n        const route = this.#routeFor(at);\n        if (route === undefined) {\n            throw this.#childNamed(at) === undefined\n                ? new ChordError(\"unavailable\", `no route to ${at}`)\n                : new ChordError(\"forbidden\", `no route authorizes ${at}`);\n        }\n        const down = await this.#resolve(route, at, relay.principal, () => relay.current);\n        if (!relay.current)\n            return;\n        relay.open(down);\n    }\n    reload(plugins, options = {}) {\n        // Client-local facet code versions never cross the parent link; only child hosts require cluster coordination.\n        if (this.kind !== \"client\" && this.upstream !== undefined) {\n            return Promise.reject(new ChordError(\"unavailable\", \"reloads are coordinated by the server\", { reason: \"not_coordinator\" }));\n        }\n        const children = [...this.connections].some((connection) => connection.role === \"downstream\" && connection.peer.kind === \"host\");\n        return children || options.remote !== undefined || options.remoteRemove !== undefined\n            ? runClusterReload(this, plugins, options)\n            : runReload(this, plugins, options);\n    }\n    onReloadFrame(connection, frame) {\n        this.#childReloads.handle(connection, frame);\n    }\n    rememberRemoteModules(remote, remove) {\n        for (const prefix of new Set([...Object.keys(remote ?? {}), ...Object.keys(remove ?? {})])) {\n            const modules = remote?.[prefix] ?? [];\n            const removed = remove?.[prefix] ?? [];\n            this.remoteModules[prefix] = [...new Set([...(this.remoteModules[prefix] ?? []), ...modules])].filter((module) => !removed.includes(module));\n            this.remoteRemoved[prefix] = [...new Set([...(this.remoteRemoved[prefix] ?? []), ...removed])].filter((module) => !modules.includes(module));\n        }\n    }\n    /** The code version id the next reload would commit. */\n    peekNextCodeVersion() {\n        return this.#codeVersionSeq + 1;\n    }\n    /**\n     * Disposes every object, holders before what they reference (a resource's `close` may still use the objects its object\n     * references, local or remote), then closes the links.\n     */\n    async close() {\n        for (const binding of [...this.#lingering.values()])\n            binding.close();\n        this.hostObjects.clear();\n        for (const name of [...this.#facetRuns.keys()])\n            this.facetRunChanged(name, undefined);\n        const reason = new ChordError(\"gone\", `host ${this.name} closed`);\n        try {\n            await disposeHoldersFirst([...this.objects.values()], reason, \"host close: disposal failed\");\n        }\n        finally {\n            for (const connection of [...this.connections])\n                connection.link.close(\"host closed\");\n        }\n    }\n}\n/**\n * Force-disposes `objects` in waves: an object goes once no object of the set that references it is left, so holders are\n * disposed (and their resources closed) while what they reference is still live. In-host references are acyclic. Errors of\n * every disposal are collected.\n */\nasync function disposeHoldersFirst(objects, reason, message) {\n    const remaining = new Set(objects);\n    const held = (object) => {\n        const result = new Set();\n        for (const decls of object.allDecls()) {\n            for (const ref of decls.refs.values())\n                if (ref.object !== undefined)\n                    result.add(ref.object);\n        }\n        return result;\n    };\n    const refs = new Map(objects.map((object) => [object, held(object)]));\n    const errors = [];\n    while (remaining.size > 0) {\n        const heldByRemaining = new Set();\n        for (const object of remaining)\n            for (const target of refs.get(object) ?? [])\n                heldByRemaining.add(target);\n        let wave = [...remaining].filter((object) => !heldByRemaining.has(object));\n        // A cycle cannot happen in-host; dispose the rest together rather than loop.\n        if (wave.length === 0)\n            wave = [...remaining];\n        for (const object of wave)\n            remaining.delete(object);\n        const results = await Promise.allSettled(wave.map((object) => object.dispose(true, reason)));\n        for (const result of results)\n            if (result.status === \"rejected\")\n                errors.push(result.reason);\n    }\n    if (errors.length === 1)\n        throw errors[0];\n    if (errors.length > 1)\n        throw new AggregateError(errors, message);\n}\nfunction sameTable(a, b) {\n    if (a.size !== b.size)\n        return false;\n    const keys = [...a.keys()];\n    return [...b].every(([key, value], index) => keys[index] === key && a.get(key) === value);\n}\nconst matchesPattern = (pattern, principal) => principal !== null &&\n    typeof principal === \"object\" &&\n    Object.entries(pattern).every(([key, value]) => deepEqual(principal[key], value));\nconst unknownType = (type, host) => new ChordError(\"unavailable\", `${type} is not served by ${host}`, { reason: \"unknown_type\" });\n/** True if `from` references `to`, directly or transitively, through object-owned references on this host. */\nfunction reaches(from, to) {\n    const seen = new Set();\n    const stack = [from];\n    while (stack.length > 0) {\n        const object = stack.pop();\n        if (object === to)\n            return true;\n        if (seen.has(object))\n            continue;\n        seen.add(object);\n        // Remote references have no object here: cycles across hosts are avoided by convention.\n        for (const decls of object.allDecls()) {\n            for (const ref of decls.refs.values())\n                if (ref.object !== undefined)\n                    stack.push(ref.object);\n        }\n    }\n    return false;\n}\n//# sourceMappingURL=host.js.map","/** Define a typed entry kind whose `is()` guard narrows by `EntryRecord.kind`. */\nexport function defineEntry(kind) {\n    if (typeof kind !== \"string\" || kind.length === 0)\n        throw new TypeError(\"Entry kind must be a non-empty string\");\n    return {\n        kind,\n        is: (entry) => entry !== undefined && entry.kind === kind,\n    };\n}\n/** User input: `model` is `[UserMessage]`. Written by submissions. */\nexport const UserEntry = defineEntry(\"pi.user\");\n/** Provider result with any stop reason: `model` is `[AssistantMessage]`. Written by generation. */\nexport const AssistantEntry = defineEntry(\"pi.assistant\");\n/** Positional prompt and tool change: `model` is `[SystemMessage]` with empty `content`. */\nexport const SystemEntry = defineEntry(\"pi.system\");\n/**\n * Tool result: `model` is `[ToolResultMessage]`, whose content ends with the rendered diagnostics block; `data` holds\n * the structured diagnostics, possibly none. Written by tool tasks, and by generation for calls it did not offer.\n */\nexport const ToolResultEntry = defineEntry(\"pi.tool-result\");\n/**\n * Start of a new context: always `head: \"self\"`, with `model` absent for a plain reset or `[UserMessage]` carrying the\n * handoff text. Written by `Conversation.reset()` and the `handoff` tool control.\n */\nexport const ResetEntry = defineEntry(\"pi.reset\");\n/**\n * Compaction summary: `model` is `[UserMessage]` with the wrapped summary, `head` the first kept entry. Written by\n * compaction tasks, directly or through a write submission.\n */\nexport const CompactionEntry = defineEntry(\"pi.compaction\");\n//# sourceMappingURL=entries.js.map","import { copyJson } from \"@earendil-works/chord\";\nimport { defineDoc } from \"../documents.js\";\nimport { documentRetention } from \"../session/session.js\";\nexport const DEFAULT_RETRY_POLICY = {\n    enabled: true,\n    maxRetries: 3,\n    baseDelayMs: 2000,\n    maxAgentDelayMs: 60000,\n};\nexport const DEFAULT_COMPACTION_POLICY = {\n    enabled: true,\n    reserveTokens: 16384,\n    keepRecentTokens: 20000,\n    backgroundTokens: 32768,\n};\nexport const DEFAULT_PROGRESS_POLICY = {\n    partialIntervalMs: 100,\n    outputIntervalMs: 100,\n};\n/** The reserved section key of the agent's `instructions`. */\nexport const INSTRUCTIONS_KEY = \"instructions\";\n/** Built-in agent document; rewindable so forks start from the agent at their fork entry. */\nexport const AgentDoc = defineDoc({\n    kind: \"pi.agent\",\n    version: 1,\n    scope: \"conversation\",\n    history: \"rewindable\",\n    fork: \"asOf\",\n    initial: () => ({}),\n    checkpointWhen: () => true,\n});\n/** Default `settings.contextRetentionMs`: ten minutes. */\nconst DEFAULT_CONTEXT_RETENTION_MS = 600_000;\n/** Resolve the host settings: every field over its built-in default, object fields merged. */\nexport function resolveSettings(settings) {\n    const extensions = settings?.extensions;\n    return {\n        ...(extensions === undefined ? {} : { extensions }),\n        stream: { ...settings?.stream },\n        retry: { ...DEFAULT_RETRY_POLICY, ...settings?.retry },\n        compaction: { ...DEFAULT_COMPACTION_POLICY, ...settings?.compaction },\n        // Field by field, so an explicitly undefined interval keeps its default.\n        progress: {\n            partialIntervalMs: settings?.progress?.partialIntervalMs ?? DEFAULT_PROGRESS_POLICY.partialIntervalMs,\n            outputIntervalMs: settings?.progress?.outputIntervalMs ?? DEFAULT_PROGRESS_POLICY.outputIntervalMs,\n        },\n        toolExecution: settings?.toolExecution ?? \"parallel\",\n        steeringMode: settings?.steeringMode ?? \"one-at-a-time\",\n        followUpMode: settings?.followUpMode ?? \"one-at-a-time\",\n        contextRetentionMs: settings?.contextRetentionMs ?? DEFAULT_CONTEXT_RETENTION_MS,\n        documentRetentionMs: documentRetention(settings?.documentRetentionMs),\n    };\n}\n/** Apply one change to `pi.agent`: a given field replaces the stored one, `null` clears it, `undefined` changes nothing. */\nexport async function configure(tx, conversationId, change) {\n    const state = await tx.doc(AgentDoc, conversationId);\n    applyChange(state, change);\n}\n/**\n * `addTools` of a tool round, applied to `tools` and `modelTools`, so the next request offers the tools: an array gets\n * each name it lacks appended, and `{ remove }` loses the names. An unset `tools` already enables every tool, so nothing\n * is written for it. An unset or object `modelTools` also gets each name appended to its `add`, which loads deferred\n * tools and has no effect for others. By name, without the registry: a tool that is not registered now, such as one of\n * an MCP server that is reconnecting, is offered once it is again.\n */\nexport async function addTools(tx, conversationId, added) {\n    const state = await tx.doc(AgentDoc, conversationId);\n    const tools = state.tools;\n    if (Array.isArray(tools)) {\n        for (const name of added)\n            if (!tools.includes(name))\n                tools.push(name);\n    }\n    else if (tools?.remove.some((name) => added.includes(name))) {\n        state.tools = { remove: tools.remove.filter((name) => !added.includes(name)) };\n    }\n    const modelTools = state.modelTools;\n    if (Array.isArray(modelTools)) {\n        for (const name of added)\n            if (!modelTools.includes(name))\n                modelTools.push(name);\n        return;\n    }\n    // Assigned whole; a document write of an equal value records no change.\n    const remove = (modelTools?.remove ?? []).filter((name) => !added.includes(name));\n    const add = [...(modelTools?.add ?? [])];\n    for (const name of added)\n        if (!add.includes(name))\n            add.push(name);\n    state.modelTools = { ...(remove.length === 0 ? {} : { remove }), add };\n}\nfunction applyChange(state, change) {\n    const set = (key, value) => {\n        if (value === undefined)\n            return;\n        if (value === null)\n            delete state[key];\n        else\n            state[key] = value;\n    };\n    set(\"model\", change.model === undefined || change.model === null ? change.model : { ...change.model });\n    set(\"thinkingLevel\", change.thinkingLevel);\n    const extensions = change.extensions;\n    set(\"extensions\", extensions === undefined || extensions === null\n        ? extensions\n        : isList(extensions)\n            ? names(extensions)\n            : {\n                ...(extensions.add === undefined ? {} : { add: names(extensions.add) }),\n                ...(extensions.remove === undefined ? {} : { remove: names(extensions.remove) }),\n            });\n    const tools = change.tools;\n    set(\"tools\", tools === undefined || tools === null ? tools : isList(tools) ? names(tools) : { remove: names(tools.remove) });\n    const modelTools = change.modelTools;\n    set(\"modelTools\", modelTools === undefined || modelTools === null\n        ? modelTools\n        : isList(modelTools)\n            ? names(modelTools)\n            : {\n                ...(modelTools.remove === undefined ? {} : { remove: names(modelTools.remove) }),\n                ...(modelTools.add === undefined ? {} : { add: names(modelTools.add) }),\n            });\n    set(\"instructions\", change.instructions);\n    set(\"cwd\", change.cwd);\n}\nfunction isList(value) {\n    return Array.isArray(value);\n}\nfunction names(items) {\n    return items.map((item) => item.name);\n}\n/**\n * Built-in part of every Harness commit that creates or forks a conversation, for `pi.agent`: a fork keeps its `asOf`\n * copy; a new task-owned conversation copies the stored agent of its owner task's conversation; a new ownerless one\n * starts empty.\n */\nexport async function createAgent(tx, conversation) {\n    if (conversation.parent !== undefined)\n        return;\n    const agent = await tx.doc(AgentDoc, conversation.id);\n    if (conversation.owner === undefined)\n        return;\n    const owner = await tx.doc(AgentDoc, conversation.owner.conversationId);\n    Object.assign(agent, copyJson(owner));\n}\n/** Handlers of the selected extensions' hooks for a task name, in extension order. */\nexport function agentHooks(agent, taskName) {\n    const handlers = [];\n    for (const extension of agent.extensions) {\n        for (const hook of extension.hooks ?? [])\n            if (hook.task === taskName)\n                handlers.push(hook.handlers);\n    }\n    return handlers;\n}\n/**\n * Resolve an agent from its stored state (absent: every field unset), a registry snapshot, and resolved settings. A\n * wrapper that throws or renames drops its target and is reported; a wrapper without a target does nothing.\n */\nexport function resolveAgent(state, snapshot, settings, report) {\n    const extensions = selectExtensions(state?.extensions, snapshot, settings);\n    const composed = new Map();\n    for (const extension of extensions)\n        for (const tool of extension.tools ?? [])\n            composed.set(tool.name, tool);\n    const sections = new Map();\n    for (const extension of extensions) {\n        for (const section of extension.sections ?? [])\n            sections.set(section.key, section);\n    }\n    for (const extension of extensions) {\n        for (const wrap of extension.wraps ?? []) {\n            if (\"tool\" in wrap)\n                applyWrap(composed, wrap.tool, (tool) => wrap.wrap(tool), (tool) => tool.name, report);\n            else\n                applyWrap(sections, wrap.section, (section) => wrap.wrap(section), (section) => section.key, report);\n        }\n    }\n    const enabled = filterTools([...composed.values()], state?.tools);\n    const callableBy = (caller) => (tool) => tool.callers === undefined || tool.callers.includes(caller);\n    const modelCallable = enabled.filter(callableBy(\"model\"));\n    const tools = offeredTools(modelCallable, state?.modelTools);\n    const offered = new Set(tools);\n    const deferred = modelCallable.filter((tool) => tool.deferred === true && !offered.has(tool));\n    const callable = enabled.filter(callableBy(\"tools\"));\n    const instructions = state?.instructions;\n    const agentSections = [...sections.values()];\n    if (instructions !== undefined)\n        agentSections.push({ key: INSTRUCTIONS_KEY, render: () => instructions });\n    const agent = {\n        ...(state?.model === undefined ? {} : { model: state.model }),\n        thinkingLevel: state?.thinkingLevel ?? \"off\",\n        extensions,\n        tools,\n        callable,\n        deferred,\n        sections: agentSections,\n        ...(instructions === undefined ? {} : { instructions }),\n        ...(state?.cwd === undefined ? {} : { cwd: state.cwd }),\n    };\n    return agent;\n}\n/** The tools offered to the model, as `AgentState.modelTools` describes. */\nfunction offeredTools(tools, filter) {\n    if (Array.isArray(filter))\n        return filterTools(tools, filter);\n    const removed = new Set(filter?.remove ?? []);\n    const kept = tools.filter((tool) => tool.deferred !== true && !removed.has(tool.name));\n    // Loaded deferred tools follow in load order, so loading one appends to the declared tools.\n    const byName = new Map(tools.map((tool) => [tool.name, tool]));\n    const loaded = [...new Set(filter?.add ?? [])].flatMap((name) => {\n        const tool = byName.get(name);\n        return tool?.deferred === true && !removed.has(name) ? [tool] : [];\n    });\n    return [...kept, ...loaded];\n}\n/** `tools` through a stored filter: an array selects exactly its names, in its order; `{ remove }` drops names. */\nfunction filterTools(tools, filter) {\n    if (filter === undefined)\n        return tools;\n    if (Array.isArray(filter)) {\n        const byName = new Map(tools.map((tool) => [tool.name, tool]));\n        return [...new Set(filter)].flatMap((name) => {\n            const tool = byName.get(name);\n            return tool === undefined ? [] : [tool];\n        });\n    }\n    const removed = new Set(filter.remove);\n    return tools.filter((tool) => !removed.has(tool.name));\n}\n/** Selected installed extensions: the stored array, or the default selection edited by `{ add, remove }`. */\nfunction selectExtensions(stored, snapshot, settings) {\n    let selected;\n    if (Array.isArray(stored))\n        selected = stored;\n    else {\n        const base = settings.extensions?.map((extension) => extension.name) ?? snapshot.installed().map((e) => e.name);\n        const edit = stored;\n        const removed = new Set(edit?.remove ?? []);\n        selected = [...base, ...(edit?.add ?? [])].filter((name) => !removed.has(name));\n    }\n    const extensions = [];\n    for (const name of new Set(selected)) {\n        const extension = snapshot.extension(name);\n        if (extension !== undefined)\n            extensions.push(extension);\n    }\n    return extensions;\n}\nfunction applyWrap(items, target, wrap, nameOf, report) {\n    const item = items.get(target);\n    if (item === undefined)\n        return;\n    try {\n        const wrapped = wrap(item);\n        if (nameOf(wrapped) !== target)\n            throw new Error(`Wrapper renamed ${target} to ${nameOf(wrapped)}`);\n        items.set(target, wrapped);\n    }\n    catch (error) {\n        items.delete(target);\n        report(error);\n    }\n}\n//# sourceMappingURL=agent.js.map","/** Extract and join text from message content. */\nexport function contentText(content, separator = \"\\n\") {\n    if (typeof content === \"string\")\n        return content;\n    return content\n        .filter((block) => block.type === \"text\")\n        .map((block) => block.text)\n        .join(separator);\n}\n/** Render a system message as a complete prompt: its content followed by its sections. */\nexport function getSystemMessageText(message) {\n    const parts = [contentText(message.content)];\n    for (const text of Object.values(message.sections ?? {})) {\n        if (text !== null)\n            parts.push(text);\n    }\n    return parts.filter((part) => part.length > 0).join(\"\\n\\n\");\n}\n/**\n * Render a later system message for APIs that accept system messages mid-conversation.\n * Section changes are framed by name so the model can relate them to the leading prompt.\n * This framing is request-time only and may change between versions.\n */\nexport function renderSystemMessageUpdate(message) {\n    const parts = [];\n    const text = contentText(message.content);\n    if (text.length > 0)\n        parts.push(text);\n    for (const [name, value] of Object.entries(message.sections ?? {})) {\n        parts.push(value === null\n            ? `Removed system prompt section \"${name}\".`\n            : `Updated system prompt section \"${name}\":\\n\\n${value}`);\n    }\n    return parts.join(\"\\n\\n\");\n}\n//# sourceMappingURL=text.js.map","import { getSystemMessageText } from \"./text.js\";\nconst CHARS_PER_TOKEN = 3.5;\nconst ESTIMATED_IMAGE_CHARS = 4800;\nexport function calculateContextTokens(usage) {\n    return usage.totalTokens || usage.input + usage.output + usage.cacheRead + usage.cacheWrite;\n}\nfunction safeJsonStringify(value) {\n    try {\n        return JSON.stringify(value) ?? \"undefined\";\n    }\n    catch {\n        return \"[unserializable]\";\n    }\n}\nfunction estimateTextAndImageContentChars(content) {\n    if (typeof content === \"string\")\n        return content.length;\n    let chars = 0;\n    for (const block of content)\n        chars += block.type === \"text\" ? block.text.length : ESTIMATED_IMAGE_CHARS;\n    return chars;\n}\nexport function estimateTextTokens(text) {\n    return Math.ceil(text.length / CHARS_PER_TOKEN);\n}\nexport function estimateTextAndImageContentTokens(content) {\n    return Math.ceil(estimateTextAndImageContentChars(content) / CHARS_PER_TOKEN);\n}\nexport function estimateMessageTokens(message) {\n    let chars = 0;\n    if (message.role === \"system\") {\n        return (estimateTextTokens(getSystemMessageText(message)) +\n            estimateToolsTokens(message.toolsAdded) +\n            estimateToolsTokens(message.toolsRemoved));\n    }\n    if (message.role === \"user\")\n        return estimateTextAndImageContentTokens(message.content);\n    if (message.role === \"toolResult\")\n        return estimateTextAndImageContentTokens(message.content);\n    for (const block of message.content) {\n        if (block.type === \"text\") {\n            chars += block.text.length;\n        }\n        else if (block.type === \"thinking\") {\n            chars += block.thinking.length;\n        }\n        else {\n            chars += block.name.length + safeJsonStringify(block.arguments).length;\n        }\n    }\n    return Math.ceil(chars / CHARS_PER_TOKEN);\n}\nfunction getLastAssistantUsageInfo(messages) {\n    let latestPrefixTimestamp = Number.NEGATIVE_INFINITY;\n    let usageInfo;\n    for (let i = 0; i < messages.length; i++) {\n        const message = messages[i];\n        if (message.role === \"assistant\") {\n            const assistant = message;\n            // A newer prefix message was inserted after this response (for example, a\n            // compaction summary), so its usage cannot describe the current prefix.\n            const usageAppliesToPrefix = assistant.timestamp >= latestPrefixTimestamp;\n            if (usageAppliesToPrefix &&\n                assistant.stopReason !== \"aborted\" &&\n                assistant.stopReason !== \"error\" &&\n                calculateContextTokens(assistant.usage) > 0) {\n                usageInfo = { usage: assistant.usage, index: i };\n            }\n        }\n        latestPrefixTimestamp = Math.max(latestPrefixTimestamp, message.timestamp);\n    }\n    return usageInfo;\n}\nexport function estimateContextTokens(context) {\n    const messages = \"messages\" in context ? context.messages : context;\n    const usageInfo = getLastAssistantUsageInfo(messages);\n    if (usageInfo) {\n        const usageTokens = calculateContextTokens(usageInfo.usage);\n        let trailingTokens = 0;\n        for (let i = usageInfo.index + 1; i < messages.length; i++) {\n            trailingTokens += estimateMessageTokens(messages[i]);\n        }\n        return { tokens: usageTokens + trailingTokens, usageTokens, trailingTokens, lastUsageIndex: usageInfo.index };\n    }\n    let tokens = 0;\n    for (const message of messages)\n        tokens += estimateMessageTokens(message);\n    return { tokens, usageTokens: 0, trailingTokens: tokens, lastUsageIndex: null };\n}\nfunction estimateToolsTokens(tools) {\n    if (!tools || tools.length === 0)\n        return 0;\n    return estimateTextTokens(safeJsonStringify(tools));\n}\n//# sourceMappingURL=estimate.js.map","function buildProviderErrorPattern(patterns) {\n    return new RegExp(patterns.join(\"|\"), \"i\");\n}\nconst NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN = buildProviderErrorPattern([\n    // OpenCode Go/free-tier limits returned as 429 JSON error types by OpenCode's\n    // Zen API. These are subscription/account limits, not transient throttles.\n    \"GoUsageLimitError\",\n    \"FreeUsageLimitError\",\n    // OpenCode Go subscription-limit text asks users to enable available-balance\n    // usage after rolling/weekly/monthly limits are reached.\n    \"Monthly usage limit reached\",\n    \"available balance\",\n    // Generic quota/budget/billing exhaustion. `insufficient_quota` is OpenAI's\n    // quota/billing error code; the other strings cover common gateway wording.\n    \"insufficient_quota\",\n    \"out of budget\",\n    \"quota exceeded\",\n    \"billing\",\n    // Sign in with ChatGPT: the subscription's shared usage limit, which resets\n    // after hours rather than seconds.\n    \"subscription_sharing_usage_limit_exceeded\",\n]);\nconst RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([\n    // Generic provider load, HTTP status, and server-side transient failures.\n    \"overloaded\",\n    \"server_busy\",\n    \"servers are currently busy\",\n    \"currently experiencing high demand\",\n    \"model is at capacity\",\n    \"rate.?limit\",\n    \"too many requests\",\n    \"429\",\n    \"500\",\n    \"502\",\n    \"503\",\n    \"504\",\n    \"520\",\n    \"524\",\n    // Also matches \"The service is temporarily unavailable\" (#10965).\n    \"service.?(?:is.?)?(?:temporarily.?)?unavailable\",\n    \"server.?error\",\n    \"internal.?error\",\n    // Wrapper/provider text for transient upstream failures, including OpenRouter\n    // \"Provider returned error\" responses (#2264) and gateway wording such as\n    // \"The upstream provider returned an error\" (#10842).\n    \"provider.?returned.?(?:an.?)?error\",\n    \"exceeded request buffer limit while retrying upstream\",\n    // Gateway failure relaying the upstream response stream, sent as an OpenAI\n    // Responses `response.failed` event without an error code (#10920).\n    \"unable to forward upstream\",\n    // Network, proxy, and fetch transport failures. This includes OpenAI Codex\n    // raw-fetch failures such as \"upstream connect\", \"connection refused\", and\n    // \"reset before headers\" (#733), plus OpenRouter connection drops (#3317).\n    \"network.?error\",\n    \"connection.?error\",\n    \"connection.?refused\",\n    \"connection.?lost\",\n    \"other side closed\",\n    \"fetch failed\",\n    \"getaddrinfo\",\n    \"ENOTFOUND\",\n    \"EAI_AGAIN\",\n    \"upstream.?connect\",\n    \"reset before headers\",\n    \"socket hang up\",\n    \"socket connection was closed\",\n    \"timed? out\",\n    \"timeout\",\n    \"terminated\",\n    // WebSocket transports can report close/error text instead of HTTP/fetch text.\n    \"websocket.?closed\",\n    \"websocket.?error\",\n    // Premature stream endings from SDKs and transports. Anthropic can throw\n    // \"stream ended without ...\" and \"Anthropic stream ended before message_stop\"\n    // (#4433); Bedrock/Smithy can throw an HTTP/2 no-response error (#3594).\n    \"ended without\",\n    \"stream ended before message_stop\",\n    \"stream ended before a terminal response event\",\n    \"http2 request did not get a response\",\n    // Node ERR_HTTP2_STREAM_CANCEL: the HTTP/2 session died before the request was\n    // sent, e.g. after the Bedrock SDK's 5-minute session timeout (#10379).\n    \"pending stream has been canceled\",\n    // Provider-requested retry delay cap failures should flow through the outer\n    // retry policy so callers can surface/abort the backoff (#1123).\n    \"retry delay\",\n    // Explicit retry guidance emitted mid-stream by OpenAI Responses and Bedrock\n    // stream exceptions (#6019).\n    \"you can retry your request\",\n    \"try your request again\",\n    \"please retry your request\",\n    // gRPC based providers (e.g. NVIDIA NIM)\n    \"ResourceExhausted\",\n    // Sign in with ChatGPT: usage or user data temporarily unavailable. Usage\n    // failures can arrive mid-stream without an HTTP 503 in the message.\n    \"subscription_sharing_usage_unavailable\",\n    \"subscription_sharing_user_unavailable\",\n]);\nexport const DEFAULT_MAX_AGENT_RETRY_DELAY_MS = 60_000;\nexport function retryDelayMs(policy, attempt) {\n    const delay = policy.baseDelayMs * 2 ** Math.max(0, attempt - 1);\n    const safeDelay = Number.isSafeInteger(delay) ? delay : Number.MAX_SAFE_INTEGER;\n    return Math.min(safeDelay, policy.maxAgentDelayMs ?? DEFAULT_MAX_AGENT_RETRY_DELAY_MS);\n}\nclass RetrySleepAbortError extends Error {\n    constructor() {\n        super(\"Aborted\");\n    }\n}\nfunction sleep(ms, signal) {\n    return new Promise((resolve, reject) => {\n        if (signal?.aborted) {\n            reject(new RetrySleepAbortError());\n            return;\n        }\n        const timeout = setTimeout(resolve, ms);\n        signal?.addEventListener(\"abort\", () => {\n            clearTimeout(timeout);\n            reject(new RetrySleepAbortError());\n        }, { once: true });\n    });\n}\n/**\n * Run a single assistant-producing call with bounded retry on transient errors.\n *\n * Behavior:\n * - A successful response is returned immediately. Aborts are terminal and never\n *   retried, but reported as unsuccessful if they happen after a retry was scheduled.\n *   Aborts during the backoff sleep are normalized to an aborted `AssistantMessage`\n *   too, so callers do not need to care when cancellation happened.\n * - A non-retryable error (per {@link isRetryableAssistantError}, including quota/\n *   billing exhaustion) is returned immediately so deterministic errors fail fast.\n * - Otherwise retries up to `maxRetries` times with exponential backoff, emitting\n *   `onRetryScheduled` before each sleep, `onRetryAttemptStart` after each sleep before\n *   the retried call starts, and `onRetryFinished` once at the end (whether the loop\n *   ends in success, exhausted retries, or an aborted backoff).\n *\n * When `policy` is undefined or disabled, the first response is returned unchanged\n * (equivalent to calling `produce()` directly).\n */\nexport async function retryAssistantCall(produce, policy, signal, callbacks) {\n    const maxAttempts = policy?.enabled ? policy.maxRetries : 0;\n    let attempt = 0;\n    let lastRetry;\n    for (;;) {\n        const response = await produce();\n        // Abort: terminal but not successful. Never retry an aborted message.\n        if (response.stopReason === \"aborted\") {\n            if (lastRetry)\n                await callbacks?.onRetryFinished?.(false, lastRetry.attempt);\n            return response;\n        }\n        // Success: non-error, non-abort responses return as-is.\n        if (response.stopReason !== \"error\") {\n            if (lastRetry)\n                await callbacks?.onRetryFinished?.(true, lastRetry.attempt);\n            return response;\n        }\n        // Non-retryable, or budget exhausted: return the final error message.\n        if (attempt >= maxAttempts || !isRetryableAssistantError(response)) {\n            if (lastRetry)\n                await callbacks?.onRetryFinished?.(false, lastRetry.attempt, response.errorMessage);\n            return response;\n        }\n        attempt++;\n        lastRetry = { attempt, errorMessage: response.errorMessage || \"Unknown error\" };\n        const delayMs = retryDelayMs(policy, attempt);\n        await callbacks?.onRetryScheduled?.(attempt, maxAttempts, delayMs, lastRetry.errorMessage);\n        // Normalize aborts during retry backoff to the same AssistantMessage shape as\n        // provider stream aborts, so callers do not need to care when cancellation happened.\n        try {\n            await sleep(delayMs, signal);\n        }\n        catch (error) {\n            await callbacks?.onRetryFinished?.(false, attempt, lastRetry.errorMessage);\n            if (error instanceof RetrySleepAbortError) {\n                const { errorMessage: _errorMessage, ...rest } = response;\n                return { ...rest, stopReason: \"aborted\" };\n            }\n            throw error;\n        }\n        await callbacks?.onRetryAttemptStart?.();\n    }\n}\n/**\n * Classifies whether a failed assistant message looks like a transient provider\n * or transport error, so callers can decide if the last assistant turn should be\n * restarted.\n *\n * This does not implement retry policy. Callers should first handle context\n * overflow separately, then apply their own retry budget, backoff, and reporting\n * before restarting the assistant turn.\n */\nexport function isRetryableAssistantError(message) {\n    if (message.stopReason !== \"error\" || !message.errorMessage)\n        return false;\n    const errorMessage = message.errorMessage;\n    if (NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN.test(errorMessage))\n        return false;\n    return RETRYABLE_PROVIDER_ERROR_PATTERN.test(errorMessage);\n}\n//# sourceMappingURL=retry.js.map","/** Define an executable task. Register it in the registry so a Harness can run tasks of its kind. */\nexport function defineTask(definition) {\n    return { definition };\n}\n//# sourceMappingURL=tasks.js.map","import { SystemEntry } from \"../entries.js\";\nimport { idFromNumber } from \"../ids.js\";\nconst SCAN_PAGE_SIZE = 256;\nconst EXCLUDED_STOP_REASONS = new Set([\"aborted\", \"error\", \"deferred\"]);\nconst MISSING_RESULT_TEXT = \"Tool result unavailable: history ends before this call completed.\";\n/**\n * Capture the bounds of the current context, or of the context cut off at the visible entry `at`, with two O(1)\n * reads. Run this on the Session line; entries at or below the tail are immutable, so `deriveContext()` can then scan\n * them off the line.\n */\nexport async function captureContextBounds(storage, conversationId, context, at) {\n    let tail;\n    if (at === undefined) {\n        tail = (await storage.scanEntries({ conversationId }, 1, undefined, context)).items[0]?.id;\n        if (tail === undefined)\n            return undefined;\n    }\n    else {\n        if ((await storage.entry(conversationId, at, context)) === undefined) {\n            throw new Error(`Entry ${at} is not visible from conversation ${conversationId}`);\n        }\n        tail = at;\n    }\n    return { head: await storage.findLatestHeadMarker(conversationId, tail, context), tail };\n}\n/**\n * `readContext()` that reuses `previous`, an earlier range of the same conversation: with the same head marker, only\n * entries after its tail are scanned. Returns the view and the range to pass to the next read. A range outlives the\n * read, so its entries are frozen like `MemoryStorage` records, and the returned view has its own arrays.\n */\nexport async function readContextFrom(session, storage, conversationId, context, at, previous) {\n    const bounds = await session.readOnLine(() => captureContextBounds(storage, conversationId, context, at));\n    if (bounds === undefined)\n        return { view: emptyView(), range: undefined };\n    freezeJson(bounds.head);\n    let range;\n    if (previous === undefined || previous.bounds.head?.id !== bounds.head?.id) {\n        range = deriveRange(bounds, freezeJson(await scanRange(storage, conversationId, rangeQuery(bounds), context)));\n    }\n    else if (bounds.tail === previous.bounds.tail) {\n        range = previous;\n    }\n    else if (bounds.tail < previous.bounds.tail) {\n        range = deriveRange(bounds, previous.entries.filter((entry) => entry.id <= bounds.tail));\n    }\n    else {\n        const minEntryId = idFromNumber(previous.bounds.tail + 1);\n        const added = await scanRange(storage, conversationId, { minEntryId, maxEntryId: bounds.tail }, context);\n        range = extendRange(previous, bounds, freezeJson(added));\n    }\n    const { view } = range;\n    return {\n        view: {\n            ...view,\n            entries: [...view.entries],\n            contributions: [...view.contributions],\n            messages: [...view.messages],\n        },\n        range,\n    };\n}\n/** Committed context of one conversation: bounds captured on the Session line, entries derived off it. */\nexport async function readContext(session, storage, conversationId, context, at) {\n    const bounds = await session.readOnLine(() => captureContextBounds(storage, conversationId, context, at));\n    return deriveContext(storage, conversationId, bounds, context);\n}\n/**\n * Derive the active transcript and model context of one conversation within captured bounds.\n *\n * H = newest visible head marker; the range runs from `H.head` (or transcript start) through the tail. Per target,\n * the newest edit in the range wins. Context entries are H followed by the range's non-head entries.\n */\nexport async function deriveContext(storage, conversationId, bounds, context) {\n    if (bounds === undefined)\n        return emptyView();\n    return deriveRange(bounds, await scanRange(storage, conversationId, rangeQuery(bounds), context)).view;\n}\nfunction emptyView() {\n    return { head: undefined, entries: [], contributions: [], messages: [] };\n}\n/** Derive the context view from the entries scanned within `bounds`. */\nfunction deriveRange(bounds, entries) {\n    const edits = new Map();\n    // Edits of every entry in the range count, including older head markers that `selectActive()` drops.\n    for (const entry of entries)\n        for (const edit of entry.edits ?? [])\n            edits.set(edit.target, edit);\n    const active = selectActive(bounds.head, entries);\n    const contributions = active.map((entry) => contribute(entry, edits.get(entry.id)));\n    const { settled, open } = settle([], contributions.flat());\n    const baseline = findBaseline(bounds.head, active);\n    const messages = leadWithSystem([...settled, ...orderToolResults(open)], baseline);\n    const view = { head: bounds.head, entries: active, contributions, messages };\n    return { bounds, entries, view, edited: new Set(edits.keys()), settled, open, baseline };\n}\n/**\n * `previous` extended by the entries `added` after its tail under the same head marker: only their contributions and\n * the open messages are derived. An added edit can change an earlier entry, so it derives the whole range again.\n */\nfunction extendRange(previous, bounds, added) {\n    const entries = [...previous.entries, ...added];\n    if (added.some((entry) => entry.edits !== undefined || entry.head !== undefined || previous.edited.has(entry.id))) {\n        return deriveRange(bounds, entries);\n    }\n    const contributions = added.map((entry) => contribute(entry, undefined));\n    const { settled, open } = settle(previous.settled, [...previous.open, ...contributions.flat()]);\n    const baseline = previous.baseline !== undefined ? previous.baseline : findBaseline(bounds.head, added);\n    const view = {\n        head: bounds.head,\n        entries: [...previous.view.entries, ...added],\n        contributions: [...previous.view.contributions, ...contributions],\n        messages: leadWithSystem([...settled, ...orderToolResults(open)], baseline),\n    };\n    return { bounds, entries, view, edited: previous.edited, settled, open, baseline };\n}\n/**\n * The baseline among `entries`, oldest first: the system message of the first `pi.system` entry after the head\n * marker, or of the transcript without one, when generation wrote it with every section and tool in effect. After a\n * head marker it always does, and omits the retained `pi.system` entries. Without one it does when it saw no system\n * message before, which holds unless an earlier entry carries one, even if an edit omits it later. An edit that targets\n * the baseline contributes other messages, or none, so none leads; a later entry does not take its place.\n */\nfunction findBaseline(head, entries) {\n    for (const entry of entries) {\n        if (head !== undefined && entry.id <= head.id)\n            continue;\n        if (SystemEntry.is(entry))\n            return entry.model?.find((message) => message.role === \"system\") ?? null;\n        if (head === undefined && carriesSystemMessage(entry))\n            return null;\n    }\n    return undefined;\n}\n/** Whether an entry's own messages, or the replacement messages of its edits, include a system message. */\nfunction carriesSystemMessage(entry) {\n    const isSystem = (message) => message.role === \"system\";\n    return ((entry.model?.some(isSystem) ?? false) ||\n        (entry.edits?.some((edit) => edit.action === \"replace\" && edit.messages.some(isSystem)) ?? false));\n}\n/**\n * Move the first system message to the front when only user messages precede it, or when it is the baseline's. A run's\n * input is committed before generation renders the system prompt, so a transcript starts with the input followed by\n * the baseline, and the range after a compaction with the kept history, assistant messages included. Providers treat\n * only a leading system message as the initial prompt and tool set; without it, a later tool change rewrites the\n * request's tool list and invalidates the whole prompt cache. Only the first system message moves, so replaying\n * system messages in order gives the same sections and tools. Any other system message, before an assistant message,\n * stays where it was committed: moving it would change what it means to the model.\n */\nfunction leadWithSystem(messages, baseline) {\n    const index = messages.findIndex((message) => message.role === \"system\");\n    if (index <= 0)\n        return messages;\n    const system = messages[index];\n    if (system !== baseline && messages.slice(0, index).some((message) => message.role !== \"user\")) {\n        return messages;\n    }\n    return [system, ...messages.slice(0, index), ...messages.slice(index + 1)];\n}\n/** One active entry's model messages after its edit and excluded stop reasons, before tool result ordering. */\nfunction contribute(entry, edit) {\n    if (edit?.action === \"omit\")\n        return Object.freeze([]);\n    const contributed = edit?.action === \"replace\" ? edit.messages : (entry.model ?? []);\n    return Object.freeze(contributed.filter((message) => message.role !== \"assistant\" || !EXCLUDED_STOP_REASONS.has(message.stopReason)));\n}\n/** Objects `freezeJson()` froze with everything in them. `Object.isFrozen()` holds for shallow freezes too. */\nconst deeplyFrozen = new WeakSet();\n/** Freeze a JSON value and everything in it. */\nfunction freezeJson(value) {\n    if (value === null || typeof value !== \"object\" || deeplyFrozen.has(value))\n        return value;\n    for (const child of Object.values(value))\n        freezeJson(child);\n    Object.freeze(value);\n    deeplyFrozen.add(value);\n    return value;\n}\n/**\n * Move the ordered messages before the last assistant message of `open` to `settled`. `orderToolResults()` of a\n * sequence equals the concatenation over its parts when each later part starts with an assistant message.\n */\nfunction settle(settled, open) {\n    const last = open.findLastIndex((message) => message.role === \"assistant\");\n    if (last <= 0)\n        return { settled, open };\n    return { settled: [...settled, ...orderToolResults(open.slice(0, last))], open: open.slice(last) };\n}\n/** The raw active entries within captured bounds, without deriving model context. */\nexport async function activeEntries(storage, conversationId, bounds, context) {\n    if (bounds === undefined)\n        return [];\n    return selectActive(bounds.head, await scanRange(storage, conversationId, rangeQuery(bounds), context));\n}\n/** The visible range of `bounds`: from the head marker's head, or transcript start, through the tail. */\nfunction rangeQuery(bounds) {\n    const head = bounds.head;\n    return head === undefined ? { maxEntryId: bounds.tail } : { minEntryId: head.head, maxEntryId: bounds.tail };\n}\n/** Visible entries within `range`, oldest first. */\nasync function scanRange(storage, conversationId, range, context) {\n    const entries = [];\n    let cursor;\n    do {\n        const page = await storage.scanEntries({ conversationId, ...range }, SCAN_PAGE_SIZE, cursor, context);\n        entries.push(...page.items);\n        cursor = page.next;\n    } while (cursor !== undefined);\n    return entries.reverse();\n}\n/** The head marker followed by the range's non-head entries, or the whole range without a marker. */\nfunction selectActive(head, range) {\n    return head === undefined ? range : [head, ...range.filter((entry) => entry.head === undefined)];\n}\n/**\n * Place each assistant's tool results directly after it in call order. Results are taken from the messages before\n * the next assistant; a missing result is synthesized and unmatched results are dropped.\n */\nexport function orderToolResults(messages) {\n    const ordered = [];\n    for (let index = 0; index < messages.length; index++) {\n        const message = messages[index];\n        if (message.role === \"toolResult\")\n            continue;\n        ordered.push(message);\n        if (message.role !== \"assistant\")\n            continue;\n        const calls = message.content.filter((content) => content.type === \"toolCall\");\n        if (calls.length === 0)\n            continue;\n        const results = new Map();\n        for (let next = index + 1; next < messages.length && messages[next].role !== \"assistant\"; next++) {\n            const candidate = messages[next];\n            if (candidate.role === \"toolResult\" && !results.has(candidate.toolCallId)) {\n                results.set(candidate.toolCallId, next);\n            }\n        }\n        for (const call of calls) {\n            const resultIndex = results.get(call.id);\n            ordered.push(resultIndex === undefined ? missingResult(call, message.timestamp) : messages[resultIndex]);\n        }\n    }\n    return ordered;\n}\nfunction missingResult(call, timestamp) {\n    return freezeJson({\n        role: \"toolResult\",\n        toolCallId: call.id,\n        toolName: call.name,\n        content: [{ type: \"text\", text: MISSING_RESULT_TEXT }],\n        isError: true,\n        details: { reason: \"missing_result\" },\n        timestamp,\n    });\n}\n//# sourceMappingURL=context.js.map","/**\n * Regex patterns to detect context overflow errors from different providers.\n *\n * These patterns match error messages returned when the input exceeds\n * the model's context window.\n *\n * Provider-specific patterns (with example error messages):\n *\n * - Anthropic: \"prompt is too long: 213462 tokens > 200000 maximum\"\n * - Anthropic: \"413 {\\\"error\\\":{\\\"type\\\":\\\"request_too_large\\\",\\\"message\\\":\\\"Request exceeds the maximum size\\\"}}\"\n * - OpenAI: \"Your input exceeds the context window of this model\"\n * - OpenAI/LiteLLM: \"Requested token count exceeds the model's maximum context length of 131072 tokens\"\n * - OpenAI-compatible: \"Input length (265330) exceeds model's maximum context length (262144).\"\n * - Google: \"The input token count (1196265) exceeds the maximum number of tokens allowed (1048575)\"\n * - xAI: \"This model's maximum prompt length is 131072 but the request contains 537812 tokens\"\n * - Groq: \"Please reduce the length of the messages or completion\"\n * - OpenRouter: \"This endpoint's maximum context length is X tokens. However, you requested about Y tokens\"\n * - OpenRouter/Poolside: \"Input length X exceeds the maximum allowed input length of Y tokens.\"\n * - Together AI: \"The input (X tokens) is longer than the model's context length (Y tokens).\"\n * - llama.cpp: \"the request exceeds the available context size, try increasing it\"\n * - LM Studio: \"tokens to keep from the initial prompt is greater than the context length\"\n * - GitHub Copilot: \"prompt token count of X exceeds the limit of Y\"\n * - MiniMax: \"invalid params, context window exceeds limit\"\n * - Kimi For Coding: \"Your request exceeded model token limit: X (requested: Y)\"\n * - DS4: \"Prompt has X tokens, but the configured context size is Y tokens\"\n * - Cerebras: \"400/413 status code (no body)\"\n * - Mistral: \"Prompt contains X tokens ... too large for model with Y maximum context length\"\n * - z.ai: `{\"code\":\"1261\",\"message\":\"Prompt too long\"}`, `{\"code\":\"1261\",\"message\":\"Prompt exceeds max length\"}` (CN endpoint), or silent overflow via usage.input > contextWindow\n * - Xiaomi MiMo: Truncates input to fill contextWindow exactly, then returns finish_reason \"length\"\n *   with output=0 (no room left to generate). Detected via stopReason \"length\" + zero output +\n *   input filling the context window.\n * - DashScope/Qwen: \"Range of input length should be [1, X]\" (HTTP 400 invalid_parameter_error)\n * - Ollama: Some deployments truncate silently, others return errors like \"prompt too long; exceeded max context length by X tokens\"\n */\nconst OVERFLOW_PATTERNS = [\n    /prompt (?:is )?too long/i, // Anthropic and z.ai token overflow\n    /prompt exceeds max length/i, // z.ai CN endpoint token overflow\n    /request_too_large/i, // Anthropic request byte-size overflow (HTTP 413)\n    /input is too long for requested model/i, // Amazon Bedrock\n    /exceeds the context window/i, // OpenAI (Completions & Responses API)\n    /exceeds (?:the )?(?:model'?s )?maximum context length(?: of [\\d,]+ tokens?|\\s*\\([\\d,]+\\))/i, // OpenAI-compatible proxies (LiteLLM)\n    /input token count.*exceeds the maximum/i, // Google (Gemini)\n    /maximum prompt length is \\d+/i, // xAI (Grok)\n    /reduce the length of the messages/i, // Groq\n    /maximum context length is \\d+ tokens/i, // OpenRouter (most backends)\n    /exceeds (?:the )?maximum allowed input length of [\\d,]+ tokens?/i, // OpenRouter/Poolside\n    /input \\(\\d+ tokens\\) is longer than the model'?s context length \\(\\d+ tokens\\)/i, // Together AI\n    /exceeds the limit of \\d+/i, // GitHub Copilot\n    /exceeds the available context size/i, // llama.cpp server\n    /greater than the context length/i, // LM Studio\n    /context window exceeds limit/i, // MiniMax\n    /exceeded model token limit/i, // Kimi For Coding\n    /too large for model with \\d+ maximum context length/i, // Mistral\n    /prompt has [\\d,]+ tokens?, but the configured context size is [\\d,]+ tokens?/i, // DS4 server\n    /model_context_window_exceeded/i, // z.ai non-standard finish_reason surfaced as error text\n    /prompt too long; exceeded (?:max )?context length/i, // Ollama explicit overflow error\n    /range of input length should be/i, // DashScope / Qwen Token Plan\n    /context[_ ]length[_ ]exceeded/i, // Generic fallback\n    /too many tokens/i, // Generic fallback\n    /token limit exceeded/i, // Generic fallback\n];\nconst CEREBRAS_BODYLESS_OVERFLOW_PATTERN = /^4(?:00|13)\\s*(?:status code)?\\s*\\(no body\\)/i;\n/**\n * Patterns that indicate non-overflow errors (e.g. rate limiting, server errors).\n * Error messages matching any of these are excluded from overflow detection\n * even if they also match an OVERFLOW_PATTERN.\n *\n * Example: Bedrock formats throttling errors as \"ThrottlingException: Too many tokens,\n * please wait before trying again.\" which would match the /too many tokens/i overflow\n * pattern without this exclusion.\n */\nconst NON_OVERFLOW_PATTERNS = [\n    /^(Throttling error|Service unavailable):/i, // AWS Bedrock non-overflow errors (human-readable prefixes from formatBedrockError)\n    /rate limit/i, // Generic rate limiting\n    /too many requests/i, // Generic HTTP 429 style\n];\n/**\n * Check if an assistant message represents a context overflow error.\n *\n * This handles three cases:\n * 1. Error-based overflow: Most providers return stopReason \"error\" with a\n *    specific error message pattern.\n * 2. Silent overflow: Some providers accept overflow requests and return\n *    successfully. For these, we check if usage.input exceeds the context window.\n * 3. Length-stop overflow: Xiaomi MiMo can return \"length\" with zero output when\n *    the input fills the context window.\n *\n * ## Reliability by Provider\n *\n * **Reliable detection (returns error with detectable message):**\n * - Anthropic: \"prompt is too long: X tokens > Y maximum\" or \"request_too_large\"\n * - OpenAI (Completions & Responses): \"exceeds the context window\", \"exceeds the model's maximum context length of X tokens\", or \"exceeds model's maximum context length (X)\"\n * - Google Gemini: \"input token count exceeds the maximum\"\n * - xAI (Grok): \"maximum prompt length is X but request contains Y\"\n * - Groq: \"reduce the length of the messages\"\n * - Cerebras: 400/413 status code (no body)\n * - Mistral: \"Prompt contains X tokens ... too large for model with Y maximum context length\"\n * - OpenRouter (most backends): \"maximum context length is X tokens\"\n * - OpenRouter/Poolside: \"Input length X exceeds the maximum allowed input length of Y tokens.\"\n * - Together AI: \"The input (X tokens) is longer than the model's context length (Y tokens).\"\n * - llama.cpp: \"exceeds the available context size\"\n * - LM Studio: \"greater than the context length\"\n * - Kimi For Coding: \"exceeded model token limit: X (requested: Y)\"\n * - DS4: \"Prompt has X tokens, but the configured context size is Y tokens\"\n * - DashScope/Qwen: \"Range of input length should be [1, X]\"\n * - z.ai: \"Prompt too long\"\n *\n * **Unreliable detection:**\n * - z.ai: Sometimes accepts overflow silently (detectable via usage.input > contextWindow),\n *   sometimes returns rate limit errors. Pass contextWindow param to detect silent overflow.\n * - Xiaomi MiMo: Truncates input to fit contextWindow then returns stopReason \"length\" with\n *   output=0. Pass contextWindow param to detect via the \"filled context + zero output\" signal.\n * - Ollama: May truncate input silently for some setups, but may also return explicit\n *   overflow errors that match the patterns above. Silent truncation still cannot be\n *   detected here because we do not know the expected token count.\n *\n * ## Custom Providers\n *\n * If you've added custom models via settings.json, this function may not detect\n * overflow errors from those providers. To add support:\n *\n * 1. Send a request that exceeds the model's context window\n * 2. Check the errorMessage in the response\n * 3. Create a regex pattern that matches the error\n * 4. The pattern should be added to OVERFLOW_PATTERNS in this file, or\n *    check the errorMessage yourself before calling this function\n *\n * @param message - The assistant message to check\n * @param contextWindow - Optional context window size for detecting silent overflow (z.ai)\n * @returns true if the message indicates a context overflow\n */\nexport function isContextOverflow(message, contextWindow) {\n    // Case 1: Check error message patterns\n    if (message.stopReason === \"error\" && message.errorMessage) {\n        // Skip messages matching known non-overflow patterns (e.g. throttling / rate-limit)\n        const isNonOverflow = NON_OVERFLOW_PATTERNS.some((p) => p.test(message.errorMessage));\n        if (!isNonOverflow) {\n            if (OVERFLOW_PATTERNS.some((p) => p.test(message.errorMessage))) {\n                return true;\n            }\n            if (message.provider === \"cerebras\" && CEREBRAS_BODYLESS_OVERFLOW_PATTERN.test(message.errorMessage)) {\n                return true;\n            }\n        }\n    }\n    // Case 2: Silent overflow (z.ai style) - successful but usage exceeds context\n    if (contextWindow && message.stopReason === \"stop\") {\n        const inputTokens = message.usage.input + message.usage.cacheRead;\n        if (inputTokens > contextWindow) {\n            return true;\n        }\n    }\n    // Case 3: Length-stop overflow (Xiaomi MiMo style) - server truncates oversized input\n    // to fit the context window, leaving no room for output. Returns stopReason \"length\"\n    // with output=0 and input+cacheRead filling the context window.\n    if (contextWindow && message.stopReason === \"length\" && message.usage.output === 0) {\n        const inputTokens = message.usage.input + message.usage.cacheRead;\n        if (inputTokens >= contextWindow * 0.99) {\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * Check whether a length stop ended below the caller or model's intended output limit.\n * Such responses may be caused by context pressure or provider-side truncation, so callers\n * can make one bounded compact-and-retry attempt. `desiredMaxOutput` must be the original\n * limit before any context-based clamping.\n */\nexport function isRecoverableLength(message, desiredMaxOutput) {\n    return message.stopReason === \"length\" && desiredMaxOutput > 0 && message.usage.output < desiredMaxOutput;\n}\n/**\n * Get the overflow patterns for testing purposes.\n */\nexport function getOverflowPatterns() {\n    return [...OVERFLOW_PATTERNS];\n}\n//# sourceMappingURL=overflow.js.map","import { contentText, getSystemMessageText } from \"./text.js\";\n/**\n * Build the leading system message for a prompt and tool set. Returns undefined when\n * both are empty, so an empty transcript stays empty.\n */\nexport function createInitialSystemMessage(systemPrompt, tools) {\n    const hasSystemPrompt = systemPrompt !== undefined && systemPrompt.length > 0;\n    const hasTools = tools !== undefined && tools.length > 0;\n    if (!hasSystemPrompt && !hasTools)\n        return undefined;\n    return {\n        role: \"system\",\n        content: systemPrompt ?? \"\",\n        ...(hasTools ? { toolsAdded: tools } : {}),\n        timestamp: 0,\n    };\n}\n/**\n * Fold `Context.systemPrompt` and `Context.tools` into a leading system message.\n * This is the only entry point that produces a {@link TranscriptContext}; every\n * provider-facing function expects the result.\n */\nexport function normalizeContext(context) {\n    const initialMessage = createInitialSystemMessage(context.systemPrompt, context.tools);\n    const messages = initialMessage ? [initialMessage, ...context.messages] : context.messages;\n    return { messages };\n}\nfunction isSystemMessage(message) {\n    return message.role === \"system\";\n}\n/** Return the leading system message, if the transcript starts with one. */\nexport function getInitialSystemMessage(messages) {\n    const first = messages[0];\n    return first && isSystemMessage(first) ? first : undefined;\n}\n/** Drop the leading system message for APIs that carry the prompt outside the message list. */\nexport function withoutInitialSystemMessage(messages) {\n    return getInitialSystemMessage(messages) ? messages.slice(1) : messages;\n}\n/** Resolve the tools available after applying every transcript delta in order. */\nexport function getCurrentTools(messages) {\n    const tools = new Map();\n    for (const message of messages) {\n        if (!isSystemMessage(message))\n            continue;\n        for (const tool of message.toolsRemoved ?? [])\n            tools.delete(tool.name);\n        for (const tool of message.toolsAdded ?? [])\n            tools.set(tool.name, tool);\n    }\n    return [...tools.values()];\n}\n/**\n * Replay every system message into one leading system message holding the current\n * prompt and tools. Later `content` is appended to the base prompt, `sections` are\n * patched by name, and tools are resolved with {@link getCurrentTools}.\n */\nexport function getCurrentSystemMessage(messages) {\n    const content = [];\n    const sections = new Map();\n    let timestamp;\n    for (const message of messages) {\n        if (!isSystemMessage(message))\n            continue;\n        timestamp ??= message.timestamp;\n        const text = contentText(message.content);\n        if (text.length > 0)\n            content.push(text);\n        for (const [name, value] of Object.entries(message.sections ?? {})) {\n            if (value === null)\n                sections.delete(name);\n            else\n                sections.set(name, value);\n        }\n    }\n    const tools = getCurrentTools(messages);\n    if (timestamp === undefined && tools.length === 0)\n        return undefined;\n    return {\n        role: \"system\",\n        content: content.join(\"\\n\\n\"),\n        ...(sections.size > 0 ? { sections: Object.fromEntries(sections) } : {}),\n        ...(tools.length > 0 ? { toolsAdded: tools } : {}),\n        timestamp: timestamp ?? 0,\n    };\n}\n/** Render the current system prompt text after replaying every system message. */\nexport function getCurrentSystemPrompt(messages) {\n    const message = getCurrentSystemMessage(messages);\n    return message ? getSystemMessageText(message) : \"\";\n}\n/**\n * Rebuild the transcript for APIs without mid-conversation system messages: the replayed\n * system message leads, and every later system message is dropped.\n */\nexport function collapseSystemMessages(context) {\n    const head = getCurrentSystemMessage(context.messages);\n    const messages = context.messages.filter((message) => message.role !== \"system\");\n    return { messages: head ? [head, ...messages] : messages };\n}\n/** Keep later system messages in place when the model accepts them; otherwise collapse them. */\nexport function resolveTranscript(context, supportsMidConvoSystemMessages) {\n    return supportsMidConvoSystemMessages ? context : collapseSystemMessages(context);\n}\n/** Strip executable and display-only fields from a tool before transcript comparison or persistence. */\nexport function toToolDeclaration(tool) {\n    return {\n        name: tool.name,\n        description: tool.description,\n        parameters: JSON.parse(JSON.stringify(tool.parameters)),\n        ...(tool.constrainedSampling === undefined ? {} : { constrainedSampling: tool.constrainedSampling }),\n    };\n}\n/**\n * Whether two tools declare the same interface to the model.\n *\n * Both sides go through {@link toToolDeclaration} first: its JSON round-trip drops the\n * typebox symbol keys and `undefined` fields that a structural comparison would see, and\n * builds both objects with the same key order, so comparing the serialized declarations\n * is exact. This avoids a deep-equal dependency in a browser-safe package.\n */\nexport function declarationsEqual(left, right) {\n    return JSON.stringify(toToolDeclaration(left)) === JSON.stringify(toToolDeclaration(right));\n}\n/** Compare two complete tool states. A changed definition is a removal followed by an addition. */\nexport function getToolStateChanges(previous, current) {\n    const previousTools = new Map(previous.map((tool) => [tool.name, tool]));\n    const currentTools = new Map(current.map((tool) => [tool.name, tool]));\n    return {\n        toolsAdded: current\n            .filter((tool) => {\n            const previousTool = previousTools.get(tool.name);\n            return previousTool === undefined || !declarationsEqual(previousTool, tool);\n        })\n            .map(toToolDeclaration),\n        toolsRemoved: previous\n            .filter((tool) => {\n            const currentTool = currentTools.get(tool.name);\n            return currentTool === undefined || !declarationsEqual(tool, currentTool);\n        })\n            .map((tool) => ({ name: tool.name })),\n    };\n}\n/** Every definition referenced by transcript tool state, in first-declaration order. */\nexport function getDeclaredTools(messages) {\n    const definitions = new Map();\n    for (const message of messages) {\n        if (!isSystemMessage(message))\n            continue;\n        for (const tool of message.toolsAdded ?? [])\n            definitions.set(tool.name, tool);\n    }\n    return [...definitions.values()];\n}\n/**\n * Whether a tool name was declared twice with different definitions. A transport that can\n * only reference previously declared tools by name cannot replay such a history.\n *\n * @deprecated No built-in transport needs this anymore: Anthropic expresses redefinitions with\n * inline `tool_definition` blocks. Kept for API compatibility and will be removed in a future release.\n */\nexport function hasToolRedefinitions(messages) {\n    const declared = new Map();\n    for (const message of messages) {\n        if (!isSystemMessage(message))\n            continue;\n        for (const tool of message.toolsAdded ?? []) {\n            const previous = declared.get(tool.name);\n            if (previous !== undefined && !declarationsEqual(previous, tool))\n                return true;\n            declared.set(tool.name, tool);\n        }\n    }\n    return false;\n}\n/** Whether tool history contains a removal or same-name redeclaration that an addition-only transport cannot replay. */\nexport function hasNonAdditiveToolChanges(messages) {\n    const declared = new Set();\n    for (const message of messages) {\n        if (!isSystemMessage(message))\n            continue;\n        if ((message.toolsRemoved?.length ?? 0) > 0)\n            return true;\n        for (const tool of message.toolsAdded ?? []) {\n            if (declared.has(tool.name))\n                return true;\n            declared.add(tool.name);\n        }\n    }\n    return false;\n}\n/**\n * Split tool declarations between the top-level request field and in-place additions.\n * Transports that can anchor additions at a system message keep the initial tools at the\n * top and load later ones where they appear; that only works when no tool was removed or\n * redeclared, so everything else sends the current tool list.\n */\nexport function resolveTranscriptTools(messages, supportsToolAdditions) {\n    const anchorsAdditions = supportsToolAdditions && !hasNonAdditiveToolChanges(messages);\n    return {\n        requestTools: anchorsAdditions\n            ? (getInitialSystemMessage(messages)?.toolsAdded ?? [])\n            : getCurrentTools(messages),\n        anchorsAdditions,\n    };\n}\n//# sourceMappingURL=transcript.js.map","import { copyJson } from \"@earendil-works/chord\";\nimport { defineDoc } from \"../documents.js\";\nimport { UserEntry } from \"../entries.js\";\nexport const InboxDoc = defineDoc({\n    kind: \"pi.inbox\",\n    version: 1,\n    scope: \"conversation\",\n    history: \"latest\",\n    fork: \"initial\",\n    initial: () => ({ items: [] }),\n    checkpointWhen: (value) => value.items.length === 0,\n});\n/**\n * Read what a boundary needs. Table reads must precede the commit's first table write, so callers prepare the\n * boundary at the start of their commit.\n */\nexport async function prepareBoundary(tx, conversationId, modes) {\n    const head = (await tx.latestHeadMarker(conversationId))?.head;\n    const inbox = await tx.doc(InboxDoc, conversationId);\n    return {\n        conversationId,\n        inbox,\n        steeringMode: modes.steeringMode,\n        followUpMode: modes.followUpMode,\n        head,\n    };\n}\n/**\n * Place the queued items a boundary selects (spec §6): every write, the first or all steers, and at `final` the first\n * or all follow-ups. A selected reset turns a `postTools` boundary into `final`. Writes are placed first and user\n * items after them, each in ID order, so user items queued before a reset run in the new context. A write whose head\n * targets an entry before the active range, including a range started earlier in this commit, is stale. Selected and\n * stale items are removed positionally.\n */\nexport async function applyBoundary(tx, boundary, at, now) {\n    const { conversationId, inbox } = boundary;\n    const items = inbox.items;\n    const reset = hasQueuedReset(items);\n    const final = at === \"final\" || reset;\n    const pick = (mode, queueMode) => {\n        const indexes = items.flatMap((item, index) => (item.mode === mode ? [index] : []));\n        return queueMode === \"all\" ? indexes : indexes.slice(0, 1);\n    };\n    const writes = items.flatMap((item, index) => (item.mode === \"write\" ? [index] : []));\n    const users = [...pick(\"steer\", boundary.steeringMode), ...(final ? pick(\"followUp\", boundary.followUpMode) : [])];\n    users.sort((a, b) => a - b);\n    // `appendEntry()` copies the drafts' values; the items are removed only afterwards.\n    for (const index of writes) {\n        const item = items[index];\n        const draft = item.entry;\n        if (isStale(boundary, draft)) {\n            tx.settleSubmission(item.id, { status: \"unanswered\", reason: \"stale\" });\n            continue;\n        }\n        const entry = await tx.appendEntry(conversationId, draft);\n        if (draft.head !== undefined)\n            boundary.head = draft.head === \"self\" ? entry.id : draft.head;\n        tx.placeSubmission(item.id, entry.id);\n    }\n    const placed = [];\n    for (const index of users) {\n        const item = items[index];\n        const entry = await appendInput(tx, conversationId, item.content, item.entry, now);\n        tx.placeSubmission(item.id, entry.id);\n        placed.push(item.id);\n    }\n    const removed = [...writes, ...users].sort((a, b) => b - a);\n    for (const index of removed)\n        items.splice(index, 1);\n    return { users: placed, reset };\n}\n/** Append the entry an input is placed as: `entry`'s kind and data, or `pi.user`, with the user message of `content`. */\nexport function appendInput(tx, conversationId, content, entry, now) {\n    const message = { role: \"user\", content, timestamp: now };\n    if (entry === undefined)\n        return tx.appendEntry(UserEntry, conversationId, { model: [message] });\n    return tx.appendEntry(conversationId, { ...pickInputEntry(entry), model: [message] });\n}\n/** The kind and data of an input's entry as strict JSON, without other fields an untyped caller might pass. */\nexport function pickInputEntry({ kind, data }) {\n    const picked = data === undefined ? { kind } : { kind, data };\n    return copyJson(picked, { omitUndefinedProperties: true });\n}\n/**\n * Whether a write is display-only: it has no `model`, `head`, or `edits` (present counts, even if empty), so it changes\n * nothing the model sees and needs no boundary.\n */\nexport function isDisplayOnly(entry) {\n    return entry.model === undefined && entry.head === undefined && entry.edits === undefined;\n}\n/** Whether a reset (`head: \"self\"` write) is queued; entries appended before it leave the active range when it lands. */\nexport function hasQueuedReset(items) {\n    return items.some((item) => item.mode === \"write\" && item.entry.head === \"self\");\n}\n/** Whether a head write targets an entry before the active range, so placing it would bring back cut history. */\nexport function isStale(boundary, entry) {\n    return typeof entry.head === \"number\" && boundary.head !== undefined && entry.head < boundary.head;\n}\n/** Remove a withdrawn submission's item; the caller settles the submission. */\nexport async function removeInboxItem(tx, conversationId, id) {\n    const items = (await tx.doc(InboxDoc, conversationId)).items;\n    const index = items.findIndex((item) => item.id === id);\n    if (index >= 0)\n        items.splice(index, 1);\n}\n/**\n * Withdraw every queued input of a conversation, as `Conversation.abort()` and abort cascades do: each settles\n * `unanswered` with `aborted` and leaves the inbox; queued writes stay for later placement.\n */\nexport async function withdrawQueuedInputs(tx, conversationId) {\n    const items = (await tx.doc(InboxDoc, conversationId)).items;\n    for (let index = items.length - 1; index >= 0; index--) {\n        const item = items[index];\n        if (item.mode === \"write\")\n            continue;\n        tx.settleSubmission(item.id, { status: \"unanswered\", reason: \"aborted\" });\n        items.splice(index, 1);\n    }\n}\n//# sourceMappingURL=inbox.js.map","/**\n * Assign `value` at `target[key]` leaf by leaf. Chord records a container assignment as one full set and only emits an\n * append when a string leaf is reassigned with a longer string, so writing the partial whole would store and publish the\n * complete message on every flush.\n */\nexport function assignJson(target, key, value) {\n    const slots = target;\n    const current = slots[key];\n    if (isRecord(current) && isRecord(value)) {\n        for (const name of Object.keys(current))\n            if (!Object.hasOwn(value, name))\n                delete current[name];\n        for (const [name, child] of Object.entries(value))\n            assignJson(current, name, child);\n        return;\n    }\n    if (Array.isArray(current) && Array.isArray(value) && current.length <= value.length) {\n        const items = current;\n        for (let index = 0; index < value.length; index++) {\n            if (index < items.length)\n                assignJson(items, index, value[index]);\n            else\n                items.push(value[index]);\n        }\n        return;\n    }\n    if (current !== value)\n        slots[key] = value;\n}\nfunction isRecord(value) {\n    return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n//# sourceMappingURL=json.js.map","import { declarationsEqual, getCurrentTools, toToolDeclaration } from \"@earendil-works/pi-ai/utils/transcript\";\nimport { SystemEntry } from \"../entries.js\";\n/** Sections in effect after replaying system messages in order: set in place, `null` deletes, re-adding appends. */\nexport function replaySections(messages) {\n    const shown = new Map();\n    for (const message of messages) {\n        if (message.role !== \"system\" || message.sections === undefined)\n            continue;\n        for (const [key, value] of Object.entries(message.sections)) {\n            if (value === null)\n                shown.delete(key);\n            else\n                shown.set(key, value);\n        }\n    }\n    return shown;\n}\n/**\n * Render the agent's sections in order. `undefined` omits a section; tagged text is wrapped as `<key>\\n...\\n</key>`. A\n * section that throws keeps its shown text, if any, and is reported; errors after `context` is aborted propagate.\n */\nexport async function renderSections(sections, input, shown, report, context) {\n    const desired = new Map();\n    for (const section of sections) {\n        let text;\n        try {\n            text = await section.render(input, context);\n        }\n        catch (error) {\n            if (context.abortSignal?.aborted)\n                throw error;\n            report(error);\n            const kept = shown.get(section.key);\n            if (kept !== undefined)\n                desired.set(section.key, kept);\n            continue;\n        }\n        if (text === undefined)\n            continue;\n        desired.set(section.key, section.tag === false ? text : `<${section.key}>\\n${text}\\n</${section.key}>`);\n    }\n    return desired;\n}\n/**\n * Plan the `pi.system` entries that make the replayed sections and tools of `view` equal `desired` and `tools` in values\n * and order.\n *\n * - A head marker with no later `pi.system` entry in context: one complete baseline that omits every retained earlier\n *   `pi.system` entry, written even when it restates the replayed values.\n * - Otherwise, when a minimal section patch would leave a different order: remove every shown section, then re-add\n *   every desired section in order.\n * - Otherwise the minimal patch of changed values and `null` removals, or nothing.\n *\n * Tool changes ride on the last planned entry, or on one entry of their own.\n */\nexport function planSystemEntries(view, desired, tools, timestamp) {\n    const head = view.head;\n    if (head !== undefined && !view.entries.some((entry) => SystemEntry.is(entry) && entry.id > head.id)) {\n        const edits = view.entries\n            .filter((entry) => SystemEntry.is(entry))\n            .map((entry) => ({ target: entry.id, action: \"omit\" }));\n        const baseline = systemEntry(Object.fromEntries(desired), { toolsRemoved: [], toolsAdded: tools.map(toToolDeclaration) }, timestamp);\n        return [edits.length === 0 ? baseline : { ...baseline, edits }];\n    }\n    const sections = planSections(replaySections(view.messages), desired);\n    const changes = planTools(getCurrentTools(view.messages), tools);\n    if (changes.toolsRemoved.length === 0 && changes.toolsAdded.length === 0) {\n        return sections.map((patch) => systemEntry(patch, undefined, timestamp));\n    }\n    if (sections.length === 0)\n        return [systemEntry(undefined, changes, timestamp)];\n    return sections.map((patch, index) => systemEntry(patch, index === sections.length - 1 ? changes : undefined, timestamp));\n}\n/**\n * Tool changes from `offered` to `desired`. A changed declaration is removed and re-added. Replay keeps retained tools\n * in place and appends additions; when that would not yield the desired order, every offered tool is removed and\n * every desired tool re-added in order.\n */\nfunction planTools(offered, desired) {\n    const wanted = new Map(desired.map((tool) => [tool.name, tool]));\n    const kept = offered.filter((tool) => {\n        const next = wanted.get(tool.name);\n        return next !== undefined && declarationsEqual(tool, next);\n    });\n    const keptNames = new Set(kept.map((tool) => tool.name));\n    const added = desired.filter((tool) => !keptNames.has(tool.name));\n    const replayed = [...kept, ...added];\n    if (replayed.some((tool, index) => tool.name !== desired[index].name)) {\n        return {\n            toolsRemoved: offered.map((tool) => ({ name: tool.name })),\n            toolsAdded: desired.map(toToolDeclaration),\n        };\n    }\n    return {\n        toolsRemoved: offered.filter((tool) => !keptNames.has(tool.name)).map((tool) => ({ name: tool.name })),\n        toolsAdded: added.map(toToolDeclaration),\n    };\n}\n/** Section patches: none, the minimal patch, or a remove-all/re-add-all pair when the order would differ. */\nfunction planSections(shown, desired) {\n    const patchedOrder = [\n        ...[...shown.keys()].filter((key) => desired.has(key)),\n        ...[...desired.keys()].filter((key) => !shown.has(key)),\n    ];\n    const desiredOrder = [...desired.keys()];\n    if (patchedOrder.some((key, index) => key !== desiredOrder[index])) {\n        return [Object.fromEntries([...shown.keys()].map((key) => [key, null])), Object.fromEntries(desired)];\n    }\n    const patch = {};\n    for (const [key, value] of shown) {\n        const next = desired.get(key);\n        if (next !== value)\n            patch[key] = next ?? null;\n    }\n    for (const [key, value] of desired)\n        if (!shown.has(key))\n            patch[key] = value;\n    return Object.keys(patch).length === 0 ? [] : [patch];\n}\nfunction systemEntry(sections, tools, timestamp) {\n    const message = {\n        role: \"system\",\n        content: \"\",\n        ...(sections === undefined ? {} : { sections }),\n        ...(tools === undefined || tools.toolsRemoved.length === 0 ? {} : { toolsRemoved: tools.toolsRemoved }),\n        ...(tools === undefined || tools.toolsAdded.length === 0 ? {} : { toolsAdded: tools.toolsAdded }),\n        timestamp,\n    };\n    return { model: [message] };\n}\n//# sourceMappingURL=prompt.js.map","const MAX_UUID_V7_TIMESTAMP = 0xffffffffffff;\nconst MAX_SEQUENCE = (1n << 41n) - 1n;\nlet lastOrdinaryTimestamp = -1;\nlet sequence;\n/** Generate a time-ordered UUIDv7. A supplied timestamp is preserved for follower ids. */\nexport function uuidv7(timestampMs) {\n    const requestedTimestamp = timestampMs ?? Date.now();\n    if (!Number.isInteger(requestedTimestamp) || requestedTimestamp < 0 || requestedTimestamp > MAX_UUID_V7_TIMESTAMP) {\n        throw new RangeError(`UUIDv7 timestamp must be an integer between 0 and ${MAX_UUID_V7_TIMESTAMP}`);\n    }\n    const effectiveTimestamp = timestampMs === undefined ? Math.max(requestedTimestamp, lastOrdinaryTimestamp) : timestampMs;\n    if (timestampMs === undefined)\n        lastOrdinaryTimestamp = effectiveTimestamp;\n    const bytes = new Uint8Array(16);\n    globalThis.crypto.getRandomValues(bytes);\n    if (sequence === undefined) {\n        sequence =\n            (BigInt(bytes[1]) << 32n) |\n                (BigInt(bytes[2]) << 24n) |\n                (BigInt(bytes[3]) << 16n) |\n                (BigInt(bytes[4]) << 8n) |\n                BigInt(bytes[5]);\n    }\n    else {\n        if (sequence === MAX_SEQUENCE)\n            throw new RangeError(\"UUIDv7 generator sequence exhausted\");\n        sequence++;\n    }\n    const timestamp = BigInt(effectiveTimestamp);\n    for (let index = 5; index >= 0; index--) {\n        bytes[index] = Number(timestamp >> BigInt((5 - index) * 8)) & 0xff;\n    }\n    bytes[6] = 0x70 | Number((sequence >> 37n) & 0x0fn);\n    bytes[7] = Number((sequence >> 29n) & 0xffn);\n    bytes[8] = 0x80 | Number((sequence >> 23n) & 0x3fn);\n    bytes[9] = Number((sequence >> 15n) & 0xffn);\n    bytes[10] = Number((sequence >> 7n) & 0xffn);\n    bytes[11] = Number((sequence & 0x7fn) << 1n) | (bytes[11] & 0x01);\n    const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\"));\n    return `${hex.slice(0, 4).join(\"\")}-${hex.slice(4, 6).join(\"\")}-${hex.slice(6, 8).join(\"\")}-${hex.slice(8, 10).join(\"\")}-${hex.slice(10).join(\"\")}`;\n}\n//# sourceMappingURL=uuid.js.map","import { uuidv7 } from \"@earendil-works/pi-ai/utils/uuid\";\nimport { defineDoc } from \"../documents.js\";\n/** Built-in provider state; every fork starts with a fresh identity instead of copying its parent. */\nexport const ProviderDoc = defineDoc({\n    kind: \"pi.provider\",\n    version: 1,\n    scope: \"conversation\",\n    history: \"latest\",\n    fork: \"initial\",\n    initial: () => ({ sessionId: uuidv7() }),\n    checkpointWhen: () => true,\n});\n/**\n * Return the persisted identity without writing in the normal path. A legacy conversation without `pi.provider` gets\n * one migration commit whose `tx.doc()` runs `initial()` before the provider request starts.\n */\nexport async function ensureProviderSessionId(runtime, context) {\n    const existing = await runtime.snapshot(ProviderDoc, runtime.conversationId, context);\n    if (existing !== undefined)\n        return existing.sessionId;\n    let created;\n    await runtime.commit(async (tx) => {\n        created = (await tx.doc(ProviderDoc, runtime.conversationId)).sessionId;\n        return undefined;\n    }, context);\n    if (created === undefined)\n        throw new Error(`Conversation ${runtime.conversationId} has no provider session ID`);\n    return created;\n}\n//# sourceMappingURL=provider.js.map","/**\n * Bounded output streams and adaptive progress commits: `OutputBuffer` keeps a head or tail window of a stream at a cost\n * proportional to each chunk, and `Progress` paces commits of a changing value by their size.\n */\nconst NEWLINE = 0x0a;\nconst INVALID_OUTPUT = /[\\x00-\\x08\\x0b-\\x1f\\ufff9-\\ufffb]/g;\nconst encoder = new TextEncoder();\n/** Slices decode exactly: a U+FEFF at a slice's start is text, not a byte-order mark. */\nconst decoder = new TextDecoder(\"utf-8\", { ignoreBOM: true });\n/** Remove control characters that break display and transcripts; tabs and newlines stay. */\nexport function sanitizeOutput(text) {\n    return text.replace(INVALID_OUTPUT, \"\");\n}\n/**\n * Bound `text` to whole lines within the limits: the first lines for `head`, the last lines for `tail`. The result is an\n * exact slice, trailing newline included. A single line longer than `maxBytes` is cut at the byte limit on a character\n * boundary.\n */\nexport function boundOutput(text, limits) {\n    const bytes = encoder.encode(text);\n    const [from, to] = limits.retain === \"head\" ? headRange(bytes, limits) : tailRange(bytes, limits);\n    const kept = bytes.subarray(from, to);\n    return {\n        text: kept.length === bytes.length ? text : decoder.decode(kept),\n        bytes: kept.length,\n        droppedBytes: bytes.length - kept.length,\n        droppedLines: lineCount(bytes) - lineCount(kept),\n    };\n}\nfunction headRange(bytes, limits) {\n    if (limits.maxLines === 0 || limits.maxBytes === 0)\n        return [0, 0];\n    let end = bytes.length;\n    let lines = 0;\n    for (let index = bytes.indexOf(NEWLINE); index !== -1; index = bytes.indexOf(NEWLINE, index + 1)) {\n        if (++lines === limits.maxLines) {\n            end = index + 1;\n            break;\n        }\n    }\n    if (end > limits.maxBytes) {\n        const newline = bytes.lastIndexOf(NEWLINE, limits.maxBytes - 1);\n        end = newline === -1 ? characterEnd(bytes, limits.maxBytes) : newline + 1;\n    }\n    return [0, end];\n}\nfunction tailRange(bytes, limits) {\n    if (limits.maxLines === 0 || limits.maxBytes === 0)\n        return [bytes.length, bytes.length];\n    // A trailing newline ends the last line rather than starting another.\n    const last = bytes[bytes.length - 1] === NEWLINE ? bytes.length - 2 : bytes.length - 1;\n    let start = 0;\n    let lines = 1;\n    for (let index = last < 0 ? -1 : bytes.lastIndexOf(NEWLINE, last); index !== -1;) {\n        if (lines === limits.maxLines) {\n            start = index + 1;\n            break;\n        }\n        lines++;\n        index = index === 0 ? -1 : bytes.lastIndexOf(NEWLINE, index - 1);\n    }\n    if (bytes.length - start > limits.maxBytes) {\n        const from = bytes.length - limits.maxBytes;\n        const newline = bytes.indexOf(NEWLINE, from - 1);\n        // The first line starting inside the byte window, or a cut of the last line when it alone is too long.\n        start = newline !== -1 && newline + 1 < bytes.length ? newline + 1 : characterStart(bytes, from);\n    }\n    return [start, bytes.length];\n}\n/** The last character boundary at or before `index`. */\nexport function characterEnd(bytes, index) {\n    let end = index;\n    while (end > 0 && ((bytes[end] ?? 0) & 0xc0) === 0x80)\n        end--;\n    return end;\n}\n/** The first character boundary at or after `index`. */\nfunction characterStart(bytes, index) {\n    let start = index;\n    while (start < bytes.length && ((bytes[start] ?? 0) & 0xc0) === 0x80)\n        start++;\n    return start;\n}\nfunction lineCount(bytes) {\n    if (bytes.length === 0)\n        return 0;\n    let newlines = 0;\n    for (let index = bytes.indexOf(NEWLINE); index !== -1; index = bytes.indexOf(NEWLINE, index + 1))\n        newlines++;\n    return newlines + (bytes[bytes.length - 1] === NEWLINE ? 0 : 1);\n}\n/**\n * Bounded running output of one stream, such as a tool call's or a process's. Accepting a chunk costs time proportional to the chunk: head retention stops\n * storing once the window is full, and tail retention drops stored text the window no longer needs when it snapshots.\n * Counts of the whole stream are kept so the dropped totals stay exact.\n */\nexport class OutputBuffer {\n    #limits;\n    /**\n     * Decoder of byte chunks. A string chunk or a skip ends an incomplete character of earlier bytes (it becomes U+FFFD);\n     * the next byte chunk then starts a new character. As in `StreamDecoder`, only a byte-order mark at the very start of\n     * the output is dropped, never a U+FEFF later in it.\n     */\n    #decoder = new TextDecoder(\"utf-8\", { ignoreBOM: true });\n    #started = false;\n    /** Stored chunks: for head the start of the stream, for tail a suffix that still contains the next window. */\n    #chunks = [];\n    #storedBytes = 0;\n    #storedNewlines = 0;\n    #full = false;\n    #totalBytes = 0;\n    #totalNewlines = 0;\n    #endsWithNewline = true;\n    constructor(limits) {\n        this.#limits = limits;\n    }\n    /** Bytes currently held; bounded by the limits plus one chunk. */\n    get storedBytes() {\n        return this.#storedBytes;\n    }\n    /**\n     * Accept a chunk; returns whether anything was accepted. `skipped` is output omitted right before the chunk, which\n     * must be more than the tail window by at least one byte or line; only tail retention accepts it.\n     */\n    push(chunk, skipped) {\n        // Bytes of an incomplete character from an earlier byte chunk come first.\n        const pending = typeof chunk === \"string\" || skipped !== undefined ? this.#decoder.decode() : \"\";\n        let text = typeof chunk === \"string\" ? chunk : this.#decoder.decode(chunk, { stream: true });\n        const first = !this.#started && pending === \"\" && skipped === undefined;\n        if (pending !== \"\" || text !== \"\" || skipped !== undefined)\n            this.#started = true;\n        if (first && typeof chunk !== \"string\" && text.startsWith(\"\\ufeff\"))\n            text = text.slice(1);\n        if (skipped === undefined)\n            return this.#accept(pending + text);\n        if (this.#limits.retain !== \"tail\")\n            throw new Error(\"Skipped output requires tail retention\");\n        this.#accept(pending);\n        this.#skip(skipped);\n        this.#accept(text);\n        return true;\n    }\n    /** Count omitted output; nothing stored before it can be in the window once the text after it arrives. */\n    #skip(skipped) {\n        if (skipped.bytes === 0)\n            return;\n        this.#totalBytes += skipped.bytes;\n        this.#totalNewlines += skipped.newlines;\n        this.#endsWithNewline = skipped.endsWithNewline;\n        this.#chunks = [];\n        this.#storedBytes = 0;\n        this.#storedNewlines = 0;\n    }\n    /** Flush an incomplete trailing character as a replacement character; call when the stream ends. */\n    end() {\n        this.#accept(this.#decoder.decode());\n    }\n    #accept(text) {\n        if (text.length === 0)\n            return false;\n        const bytes = utf8ByteLength(text);\n        const newlines = countNewlines(text);\n        this.#totalBytes += bytes;\n        this.#totalNewlines += newlines;\n        this.#endsWithNewline = text.endsWith(\"\\n\");\n        if (this.#full)\n            return true;\n        this.#chunks.push({ text, bytes, newlines });\n        this.#storedBytes += bytes;\n        this.#storedNewlines += newlines;\n        if (this.#limits.retain === \"head\") {\n            // Nothing past a full window is ever needed.\n            this.#full = this.#storedBytes > this.#limits.maxBytes || this.#storedNewlines >= this.#limits.maxLines;\n            return true;\n        }\n        // Drop leading chunks while the rest still holds more than a window: more than `maxBytes` bytes or `maxLines`\n        // newlines, plus one, so the window's line start can still be found. Each chunk is dropped once.\n        while (this.#chunks.length > 1) {\n            const first = this.#chunks[0];\n            const bytesAfter = this.#storedBytes - first.bytes;\n            const newlinesAfter = this.#storedNewlines - first.newlines;\n            if (bytesAfter <= this.#limits.maxBytes + 1 && newlinesAfter <= this.#limits.maxLines + 1)\n                break;\n            this.#chunks.shift();\n            this.#storedBytes = bytesAfter;\n            this.#storedNewlines = newlinesAfter;\n        }\n        return true;\n    }\n    /** Retained, sanitized output and what the limits dropped from the whole stream. */\n    snapshot() {\n        const stored = this.#chunks.length === 1 ? this.#chunks[0].text : this.#chunks.map((chunk) => chunk.text).join(\"\");\n        const kept = boundOutput(stored, this.#limits);\n        const storedLines = lines(this.#storedNewlines, stored === \"\" || stored.endsWith(\"\\n\"));\n        const keptLines = storedLines - kept.droppedLines;\n        // Tail windows never reach back before this one, but finding a later window's first line needs what precedes it:\n        // keep the shortest suffix longer than the window by a byte or a line, as `#accept` does.\n        if (this.#limits.retain === \"tail\" || this.#chunks.length > 1) {\n            const text = this.#limits.retain === \"tail\" ? tailMargin(stored, this.#limits) : stored;\n            const bytes = this.#limits.retain === \"tail\" ? utf8ByteLength(text) : this.#storedBytes;\n            this.#chunks = text === \"\" ? [] : [{ text, bytes, newlines: countNewlines(text) }];\n            this.#storedBytes = bytes;\n            this.#storedNewlines = this.#chunks[0]?.newlines ?? 0;\n        }\n        return {\n            text: sanitizeOutput(kept.text),\n            droppedBytes: this.#totalBytes - kept.bytes,\n            droppedLines: lines(this.#totalNewlines, this.#endsWithNewline) - keptLines,\n        };\n    }\n}\n/**\n * The shortest suffix of `text` with more than `maxBytes` bytes or more than `maxLines` newlines, or all of it. The\n * tail window of any text that ends with this suffix, followed by anything, is the same as of `text` followed by it.\n */\nfunction tailMargin(text, limits) {\n    const bytes = encoder.encode(text);\n    const byteStart = bytes.length > limits.maxBytes ? characterEnd(bytes, bytes.length - limits.maxBytes - 1) : 0;\n    let lineStart = 0;\n    let newlines = 0;\n    for (let index = bytes.lastIndexOf(NEWLINE); index !== -1; index = bytes.lastIndexOf(NEWLINE, index - 1)) {\n        if (++newlines > limits.maxLines) {\n            lineStart = index;\n            break;\n        }\n        if (index === 0)\n            break;\n    }\n    const start = Math.max(byteStart, lineStart);\n    return start === 0 ? text : decoder.decode(bytes.subarray(start));\n}\n/** Lines of text with `newlines` newlines; a final unterminated line counts. */\nfunction lines(newlines, terminated) {\n    return newlines + (terminated ? 0 : 1);\n}\nconst runtimeBuffer = globalThis.Buffer;\nconst nonAsciiPattern = /[^\\x00-\\x7f]/;\n/** UTF-8 byte length of `content`; a lone surrogate counts as U+FFFD, three bytes. */\nexport function utf8ByteLength(content) {\n    if (runtimeBuffer)\n        return runtimeBuffer.byteLength(content, \"utf8\");\n    const firstNonAscii = content.search(nonAsciiPattern);\n    if (firstNonAscii === -1)\n        return content.length;\n    let bytes = firstNonAscii;\n    for (let i = firstNonAscii; i < content.length; i++) {\n        const code = content.charCodeAt(i);\n        if (code <= 0x7f)\n            bytes += 1;\n        else if (code <= 0x7ff)\n            bytes += 2;\n        else if (code >= 0xd800 && code <= 0xdbff && i + 1 < content.length) {\n            const next = content.charCodeAt(i + 1);\n            if (next >= 0xdc00 && next <= 0xdfff) {\n                bytes += 4;\n                i++;\n            }\n            else\n                bytes += 3;\n        }\n        else\n            bytes += 3;\n    }\n    return bytes;\n}\nfunction countNewlines(text) {\n    let count = 0;\n    for (let index = text.indexOf(\"\\n\"); index !== -1; index = text.indexOf(\"\\n\", index + 1))\n        count++;\n    return count;\n}\n/** Each progress commit also buys a pause proportional to what it wrote. */\nexport const PROGRESS_BYTES_PER_SECOND = 100 * 1024;\n/**\n * Adaptive progress commits: the first change after an idle period commits at once; each commit then delays the next\n * by at least `minIntervalMs` and by its written size at 100 KiB/s. At most one commit is in flight; changes made\n * meanwhile coalesce into the next one.\n */\nexport class Progress {\n    #write;\n    #onError;\n    #minIntervalMs;\n    #waiters = [];\n    #timer;\n    #inFlight;\n    #nextAt = 0;\n    #dirty = false;\n    #stopped = false;\n    constructor(write, onError, minIntervalMs) {\n        this.#write = write;\n        this.#onError = onError;\n        this.#minIntervalMs = minIntervalMs;\n    }\n    /** Schedule a commit. */\n    mark() {\n        this.#dirty = true;\n        this.#schedule();\n    }\n    /** Schedule a commit; the promise settles with the commit that includes this change. */\n    markAndWait() {\n        const waiter = Promise.withResolvers();\n        this.#waiters.push(waiter);\n        this.mark();\n        return waiter.promise;\n    }\n    /** Stop committing and wait for the commit in flight; returns the waiters the final commit must settle. */\n    async stop() {\n        this.#stopped = true;\n        clearTimeout(this.#timer);\n        this.#timer = undefined;\n        await this.#inFlight;\n        return this.#waiters.splice(0);\n    }\n    #schedule() {\n        if (this.#stopped || this.#timer !== undefined || this.#inFlight !== undefined)\n            return;\n        const wait = this.#nextAt - Date.now();\n        if (wait <= 0)\n            this.#flush();\n        else\n            this.#timer = setTimeout(() => {\n                this.#timer = undefined;\n                this.#flush();\n            }, wait);\n    }\n    #flush() {\n        if (this.#stopped || !this.#dirty)\n            return;\n        this.#dirty = false;\n        const waiters = this.#waiters.splice(0);\n        const started = Date.now();\n        this.#inFlight = this.#write()\n            .then((bytes) => {\n            this.#nextAt = started + Math.max(this.#minIntervalMs, (bytes * 1000) / PROGRESS_BYTES_PER_SECOND);\n            for (const waiter of waiters)\n                waiter.resolve();\n        }, (error) => {\n            this.#nextAt = started + this.#minIntervalMs;\n            for (const waiter of waiters)\n                waiter.reject(error);\n            this.#onError(error);\n        })\n            .finally(() => {\n            this.#inFlight = undefined;\n            if (this.#dirty)\n                this.#schedule();\n        });\n    }\n}\n//# sourceMappingURL=output.js.map","// deno-fmt-ignore-file\nimport { Settings } from '../system/settings/index.mjs';\nimport { Errors, Clean, Convert, Create, Default, Decode, Encode, HasCodec, Parser, ParseError } from '../value/index.mjs';\nimport { Build } from '../schema/index.mjs';\n// ------------------------------------------------------------------\n// Validator<...>\n// ------------------------------------------------------------------\nexport class Validator {\n    /** Constructs a Validator. */\n    constructor(context, type) {\n        this.hasCodec = HasCodec(context, type);\n        this.buildResult = Build(context, type);\n        this.evaluateResult = this.buildResult.Evaluate();\n    }\n    // ----------------------------------------------------------------\n    // IsAccelerated\n    // ----------------------------------------------------------------\n    /** Returns true if this Validator is using JIT acceleration. */\n    IsAccelerated() {\n        return this.evaluateResult.IsAccelerated();\n    }\n    // ----------------------------------------------------------------\n    // Context & Type\n    // ----------------------------------------------------------------\n    /** Returns the Context for this validator. */\n    Context() {\n        return this.buildResult.Context();\n    }\n    /** Returns the underlying Type used to construct this Validator. */\n    Type() {\n        return this.buildResult.Schema();\n    }\n    // ----------------------------------------------------------------\n    // Code\n    // ----------------------------------------------------------------\n    /** Returns the generated code for this validator. */\n    Code() {\n        return this.evaluateResult.Code();\n    }\n    // ----------------------------------------------------------------\n    // Standard Validator\n    // ----------------------------------------------------------------\n    /** Performs a type-guard check on the provided value. */\n    Check(value) {\n        return this.evaluateResult.Check(value);\n    }\n    /** Validates a value and returns it. Will throw if invalid. */\n    Parse(value) {\n        const checked = this.Check(value);\n        if (checked)\n            return value;\n        if (Settings.Get().correctiveParse)\n            return Parser(this.Context(), this.Type(), value);\n        throw new ParseError(value, this.Errors(value));\n    }\n    /** Returns an array of validation errors for the given value. */\n    Errors(value) {\n        if (this.IsAccelerated() && this.Check(value))\n            return [];\n        return Errors(this.Context(), this.Type(), value);\n    }\n    // ----------------------------------------------------------------\n    // Value.* Operations\n    // ----------------------------------------------------------------\n    /** Cleans a value using the Validator type. */\n    Clean(value) {\n        return Clean(this.Context(), this.Type(), value);\n    }\n    /** Converts a value using the Validator type. */\n    Convert(value) {\n        return Convert(this.Context(), this.Type(), value);\n    }\n    /** Creates a value using the Validator type. */\n    Create() {\n        return Create(this.Context(), this.Type());\n    }\n    /** Creates defaults using the Validator type. */\n    Default(value) {\n        return Default(this.Context(), this.Type(), value);\n    }\n    /** Decodes a value */\n    Decode(value) {\n        const result = this.hasCodec ? Decode(this.Context(), this.Type(), value) : this.Parse(value);\n        return result;\n    }\n    /** Encodes a value */\n    Encode(value) {\n        const result = this.hasCodec ? Encode(this.Context(), this.Type(), value) : this.Parse(value);\n        return result;\n    }\n}\n","// deno-lint-ignore-file ban-types\n// deno-fmt-ignore-file\nimport { Arguments } from '../system/arguments/index.mjs';\nimport { Validator } from './validator.mjs';\n/** Compiles a type into a high performance Validator */\nexport function Compile(...args) {\n    const [context, type] = Arguments.Match(args, {\n        2: (context, type) => [context, type],\n        1: (type) => [{}, type]\n    });\n    return new Validator(context, type);\n}\n","import { Compile } from \"typebox/compile\";\nimport { Value } from \"typebox/value\";\nconst validatorCache = new WeakMap();\nconst TYPEBOX_KIND = Symbol.for(\"TypeBox.Kind\");\nfunction getSchemaTypes(schema) {\n    if (typeof schema.type === \"string\") {\n        return [schema.type];\n    }\n    if (Array.isArray(schema.type)) {\n        return schema.type.filter((type) => typeof type === \"string\");\n    }\n    return [];\n}\nfunction matchesJsonType(value, type) {\n    switch (type) {\n        case \"number\":\n            return typeof value === \"number\";\n        case \"integer\":\n            return typeof value === \"number\" && Number.isInteger(value);\n        case \"boolean\":\n            return typeof value === \"boolean\";\n        case \"string\":\n            return typeof value === \"string\";\n        case \"null\":\n            return value === null;\n        case \"array\":\n            return Array.isArray(value);\n        case \"object\":\n            return typeof value === \"object\" && value !== null && !Array.isArray(value);\n        default:\n            return false;\n    }\n}\nfunction getSubSchemaValidator(schema) {\n    try {\n        return getValidator(schema);\n    }\n    catch {\n        return undefined;\n    }\n}\nfunction coercePrimitiveByType(value, type) {\n    switch (type) {\n        case \"number\": {\n            if (value === null) {\n                return 0;\n            }\n            if (typeof value === \"string\" && value.trim() !== \"\") {\n                const parsed = Number(value);\n                if (Number.isFinite(parsed)) {\n                    return parsed;\n                }\n            }\n            if (typeof value === \"boolean\") {\n                return value ? 1 : 0;\n            }\n            return value;\n        }\n        case \"integer\": {\n            if (value === null) {\n                return 0;\n            }\n            if (typeof value === \"string\" && value.trim() !== \"\") {\n                const parsed = Number(value);\n                if (Number.isInteger(parsed)) {\n                    return parsed;\n                }\n            }\n            if (typeof value === \"boolean\") {\n                return value ? 1 : 0;\n            }\n            return value;\n        }\n        case \"boolean\": {\n            if (value === null) {\n                return false;\n            }\n            if (typeof value === \"string\") {\n                if (value === \"true\") {\n                    return true;\n                }\n                if (value === \"false\") {\n                    return false;\n                }\n            }\n            if (typeof value === \"number\") {\n                if (value === 1) {\n                    return true;\n                }\n                if (value === 0) {\n                    return false;\n                }\n            }\n            return value;\n        }\n        case \"string\": {\n            if (value === null) {\n                return \"\";\n            }\n            if (typeof value === \"number\" || typeof value === \"boolean\") {\n                return String(value);\n            }\n            return value;\n        }\n        case \"null\": {\n            if (value === \"\" || value === 0 || value === false) {\n                return null;\n            }\n            return value;\n        }\n        default:\n            return value;\n    }\n}\nfunction applySchemaObjectCoercion(value, schema) {\n    const properties = schema.properties;\n    const definedKeys = new Set(properties ? Object.keys(properties) : []);\n    if (properties) {\n        for (const [key, propertySchema] of Object.entries(properties)) {\n            if (!(key in value)) {\n                continue;\n            }\n            value[key] = coerceWithJsonSchema(value[key], propertySchema);\n        }\n    }\n    if (schema.additionalProperties && typeof schema.additionalProperties === \"object\") {\n        for (const [key, propertyValue] of Object.entries(value)) {\n            if (definedKeys.has(key)) {\n                continue;\n            }\n            value[key] = coerceWithJsonSchema(propertyValue, schema.additionalProperties);\n        }\n    }\n}\nfunction applySchemaArrayCoercion(value, schema) {\n    if (Array.isArray(schema.items)) {\n        for (let index = 0; index < value.length; index++) {\n            const itemSchema = schema.items[index];\n            if (!itemSchema) {\n                continue;\n            }\n            value[index] = coerceWithJsonSchema(value[index], itemSchema);\n        }\n        return;\n    }\n    if (schema.items && typeof schema.items === \"object\") {\n        for (let index = 0; index < value.length; index++) {\n            value[index] = coerceWithJsonSchema(value[index], schema.items);\n        }\n    }\n}\nfunction coerceWithUnionSchema(value, schemas) {\n    for (const schema of schemas) {\n        const validator = getSubSchemaValidator(schema);\n        if (validator?.Check(value)) {\n            return value;\n        }\n    }\n    for (const schema of schemas) {\n        const candidate = structuredClone(value);\n        const coerced = coerceWithJsonSchema(candidate, schema);\n        const validator = getSubSchemaValidator(schema);\n        if (validator?.Check(coerced)) {\n            return coerced;\n        }\n    }\n    return value;\n}\nfunction coerceWithJsonSchema(value, schema) {\n    let nextValue = value;\n    if (Array.isArray(schema.allOf)) {\n        for (const nested of schema.allOf) {\n            nextValue = coerceWithJsonSchema(nextValue, nested);\n        }\n    }\n    if (Array.isArray(schema.anyOf)) {\n        nextValue = coerceWithUnionSchema(nextValue, schema.anyOf);\n    }\n    if (Array.isArray(schema.oneOf)) {\n        nextValue = coerceWithUnionSchema(nextValue, schema.oneOf);\n    }\n    const schemaTypes = getSchemaTypes(schema);\n    const matchesUnionMember = schemaTypes.length > 1 && schemaTypes.some((schemaType) => matchesJsonType(nextValue, schemaType));\n    if (schemaTypes.length > 0 && !matchesUnionMember) {\n        for (const schemaType of schemaTypes) {\n            const candidate = coercePrimitiveByType(nextValue, schemaType);\n            if (candidate !== nextValue) {\n                nextValue = candidate;\n                break;\n            }\n        }\n    }\n    if (schemaTypes.includes(\"object\") &&\n        typeof nextValue === \"object\" &&\n        nextValue !== null &&\n        !Array.isArray(nextValue)) {\n        applySchemaObjectCoercion(nextValue, schema);\n    }\n    if (schemaTypes.includes(\"array\") && Array.isArray(nextValue)) {\n        applySchemaArrayCoercion(nextValue, schema);\n    }\n    return nextValue;\n}\nfunction normalizeOptionalNulls(value, schema) {\n    if (Array.isArray(value)) {\n        if (Array.isArray(schema.items)) {\n            for (let index = 0; index < value.length; index++) {\n                const itemSchema = schema.items[index];\n                if (itemSchema)\n                    normalizeOptionalNulls(value[index], itemSchema);\n            }\n        }\n        else if (schema.items) {\n            for (const item of value)\n                normalizeOptionalNulls(item, schema.items);\n        }\n        return;\n    }\n    if (typeof value !== \"object\" || value === null || !schema.properties)\n        return;\n    const object = value;\n    const required = new Set(schema.required ?? []);\n    for (const [key, propertySchema] of Object.entries(schema.properties)) {\n        if (!(key in object))\n            continue;\n        if (object[key] === null &&\n            !required.has(key) &&\n            typeof propertySchema.$ref !== \"string\" &&\n            getSubSchemaValidator(propertySchema)?.Check(null) === false) {\n            delete object[key];\n        }\n        else {\n            normalizeOptionalNulls(object[key], propertySchema);\n        }\n    }\n}\nfunction getValidator(schema) {\n    const key = schema;\n    const cached = validatorCache.get(key);\n    if (cached) {\n        return cached;\n    }\n    const validator = Compile(schema);\n    validatorCache.set(key, validator);\n    return validator;\n}\nfunction formatValidationPath(error) {\n    if (error.keyword === \"required\") {\n        const requiredProperties = error.params.requiredProperties;\n        const requiredProperty = requiredProperties?.[0];\n        if (requiredProperty) {\n            const basePath = error.instancePath.replace(/^\\//, \"\").replace(/\\//g, \".\");\n            return basePath ? `${basePath}.${requiredProperty}` : requiredProperty;\n        }\n    }\n    const path = error.instancePath.replace(/^\\//, \"\").replace(/\\//g, \".\");\n    return path || \"root\";\n}\n/**\n * Finds a tool by name and validates the tool call arguments against its TypeBox schema\n * @param tools Array of tool definitions\n * @param toolCall The tool call from the LLM\n * @returns The validated arguments\n * @throws Error if tool is not found or validation fails\n */\nexport function validateToolCall(tools, toolCall) {\n    const tool = tools.find((t) => t.name === toolCall.name);\n    if (!tool) {\n        throw new Error(`Tool \"${toolCall.name}\" not found`);\n    }\n    return validateToolArguments(tool, toolCall);\n}\n/**\n * Validates tool call arguments against the tool's TypeBox schema\n * @param tool The tool definition with TypeBox schema\n * @param toolCall The tool call from the LLM\n * @returns The validated (and potentially coerced) arguments\n * @throws Error with formatted message if validation fails\n */\nexport function validateToolArguments(tool, toolCall) {\n    if (toolCall.argumentsError) {\n        throw new Error(`Invalid arguments for tool \"${toolCall.name}\": ${toolCall.argumentsError}`);\n    }\n    const args = structuredClone(toolCall.arguments);\n    normalizeOptionalNulls(args, tool.parameters);\n    Value.Convert(tool.parameters, args);\n    const validator = getValidator(tool.parameters);\n    if (!Object.getOwnPropertySymbols(tool.parameters).includes(TYPEBOX_KIND)) {\n        const coerced = coerceWithJsonSchema(args, tool.parameters);\n        if (coerced !== args) {\n            if (typeof args === \"object\" && args !== null && typeof coerced === \"object\" && coerced !== null) {\n                for (const key of Object.keys(args)) {\n                    delete args[key];\n                }\n                Object.assign(args, coerced);\n            }\n            else {\n                return validator.Check(coerced) ? coerced : args;\n            }\n        }\n    }\n    if (validator.Check(args)) {\n        return args;\n    }\n    const errors = validator\n        .Errors(args)\n        .map((error) => `  - ${formatValidationPath(error)}: ${error.message}`)\n        .join(\"\\n\") || \"Unknown validation error\";\n    const errorMessage = `Validation failed for tool \"${toolCall.name}\":\\n${errors}\\n\\nReceived arguments:\\n${JSON.stringify(toolCall.arguments, null, 2)}`;\n    throw new Error(errorMessage);\n}\n//# sourceMappingURL=validation.js.map","import { utf8ByteLength } from \"@earendil-works/chord/output\";\n/**\n * Shared truncation utilities for tool outputs.\n *\n * Truncation is based on two independent limits - whichever is hit first wins:\n * - Line limit (default: 2000 lines)\n * - Byte limit (default: 50KB)\n *\n * Never returns partial lines. Tool output streams are bounded by `OutputBuffer` from `@earendil-works/chord/output` instead.\n */\nexport const DEFAULT_MAX_LINES = 2000;\nexport const DEFAULT_MAX_BYTES = 50 * 1024; // 50KB\n// One implementation, shared with the output buffer.\nexport { utf8ByteLength };\nfunction splitLinesForCounting(content) {\n    if (content.length === 0)\n        return [];\n    const lines = content.split(\"\\n\");\n    if (content.endsWith(\"\\n\"))\n        lines.pop();\n    return lines;\n}\n/**\n * Format bytes as human-readable size.\n */\nexport function formatSize(bytes) {\n    if (bytes < 1024) {\n        return `${bytes}B`;\n    }\n    else if (bytes < 1024 * 1024) {\n        return `${(bytes / 1024).toFixed(1)}KB`;\n    }\n    else {\n        return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;\n    }\n}\n/**\n * Truncate content from the head (keep first N lines/bytes).\n * Suitable for file reads where you want to see the beginning.\n *\n * Never returns partial lines. If first line exceeds byte limit,\n * returns empty content with firstLineExceedsLimit=true.\n */\nexport function truncateHead(content, options = {}) {\n    return truncateHeadOf(content, { lines: splitLinesForCounting(content).length, bytes: utf8ByteLength(content) }, options);\n}\n/**\n * `truncateHead` of a text known by a prefix and its totals (`lines` counted like `truncateHead`, ignoring a trailing\n * newline). The prefix must be the whole text, or longer than `maxBytes + 1` UTF-8 bytes, or hold at least `maxLines`\n * newlines; then the result equals `truncateHead` of the whole text.\n */\nexport function truncateHeadOf(prefix, totals, options = {}) {\n    const maxLines = options.maxLines ?? DEFAULT_MAX_LINES;\n    const maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES;\n    const totalBytes = totals.bytes;\n    const lines = splitLinesForCounting(prefix);\n    const totalLines = totals.lines;\n    // Check if no truncation needed\n    if (totalLines <= maxLines && totalBytes <= maxBytes) {\n        return {\n            content: prefix,\n            truncated: false,\n            truncatedBy: null,\n            totalLines,\n            totalBytes,\n            outputLines: totalLines,\n            outputBytes: totalBytes,\n            lastLinePartial: false,\n            firstLineExceedsLimit: false,\n            maxLines,\n            maxBytes,\n        };\n    }\n    // Check if first line alone exceeds byte limit\n    const firstLineBytes = utf8ByteLength(lines[0]);\n    if (firstLineBytes > maxBytes) {\n        return {\n            content: \"\",\n            truncated: true,\n            truncatedBy: \"bytes\",\n            totalLines,\n            totalBytes,\n            outputLines: 0,\n            outputBytes: 0,\n            lastLinePartial: false,\n            firstLineExceedsLimit: true,\n            maxLines,\n            maxBytes,\n        };\n    }\n    // Collect complete lines that fit\n    const outputLinesArr = [];\n    let outputBytesCount = 0;\n    let truncatedBy = \"lines\";\n    for (let i = 0; i < lines.length && i < maxLines; i++) {\n        const line = lines[i];\n        const lineBytes = utf8ByteLength(line) + (i > 0 ? 1 : 0); // +1 for newline\n        if (outputBytesCount + lineBytes > maxBytes) {\n            truncatedBy = \"bytes\";\n            break;\n        }\n        outputLinesArr.push(line);\n        outputBytesCount += lineBytes;\n    }\n    // Without a byte break, only omitted lines prove the line limit was reached; otherwise a trailing newline exceeded bytes.\n    if (truncatedBy !== \"bytes\")\n        truncatedBy = outputLinesArr.length < totalLines ? \"lines\" : \"bytes\";\n    const outputContent = outputLinesArr.join(\"\\n\");\n    const finalOutputBytes = utf8ByteLength(outputContent);\n    return {\n        content: outputContent,\n        truncated: true,\n        truncatedBy,\n        totalLines,\n        totalBytes,\n        outputLines: outputLinesArr.length,\n        outputBytes: finalOutputBytes,\n        lastLinePartial: false,\n        firstLineExceedsLimit: false,\n        maxLines,\n        maxBytes,\n    };\n}\n//# sourceMappingURL=truncate.js.map","import { copyJson } from \"@earendil-works/chord\";\nimport { defineDoc } from \"../documents.js\";\nexport const UsageDoc = defineDoc({\n    kind: \"pi.usage\",\n    version: 1,\n    scope: \"conversation\",\n    history: \"latest\",\n    fork: \"initial\",\n    initial: () => ({ models: {}, tools: {} }),\n    checkpointWhen: () => true,\n});\n/** Add `usage` to one bucket of the conversation's `pi.usage`, in the commit that records the response. */\nexport async function recordUsage(tx, conversationId, bucket, key, usage) {\n    const totals = (await tx.doc(UsageDoc, conversationId))[bucket];\n    // Own keys only: a tool may be called `toString`.\n    const total = Object.hasOwn(totals, key) ? totals[key] : undefined;\n    // Providers may leave optional counters `undefined`; drafts take strict JSON.\n    if (total === undefined)\n        totals[key] = copyJson(usage, { omitUndefinedProperties: true });\n    else\n        addUsage(total, usage);\n}\n/** Add every counter of `usage` to `total`; optional counters are added once either side reports them. */\nexport function addUsage(total, usage) {\n    total.input += usage.input;\n    total.output += usage.output;\n    total.cacheRead += usage.cacheRead;\n    total.cacheWrite += usage.cacheWrite;\n    total.totalTokens += usage.totalTokens;\n    if (usage.cacheWrite1h !== undefined)\n        total.cacheWrite1h = (total.cacheWrite1h ?? 0) + usage.cacheWrite1h;\n    if (usage.reasoning !== undefined)\n        total.reasoning = (total.reasoning ?? 0) + usage.reasoning;\n    total.cost.input += usage.cost.input;\n    total.cost.output += usage.cost.output;\n    total.cost.cacheRead += usage.cost.cacheRead;\n    total.cost.cacheWrite += usage.cost.cacheWrite;\n    total.cost.total += usage.cost.total;\n}\n/** Add every bucket of `state` into `sum`. */\nexport function addUsageState(sum, state) {\n    for (const bucket of [\"models\", \"tools\"]) {\n        for (const [key, usage] of Object.entries(state[bucket])) {\n            const total = Object.hasOwn(sum[bucket], key) ? sum[bucket][key] : undefined;\n            // Define rather than assign: assigning a tool named `__proto__` would set the prototype.\n            if (total !== undefined)\n                addUsage(total, usage);\n            else\n                Object.defineProperty(sum[bucket], key, {\n                    value: structuredClone(usage),\n                    enumerable: true,\n                    writable: true,\n                });\n        }\n    }\n}\n//# sourceMappingURL=usage.js.map","import { copyJson } from \"@earendil-works/chord\";\nimport { awaitWithContext } from \"@earendil-works/chord/context\";\nimport { overlap } from \"@earendil-works/chord/delta\";\nimport { boundOutput, OutputBuffer, PROGRESS_BYTES_PER_SECOND, Progress, } from \"@earendil-works/chord/output\";\nimport { validateToolArguments } from \"@earendil-works/pi-ai/utils/validation\";\nimport { Compile } from \"typebox/compile\";\nimport { defineDocFamily } from \"../documents.js\";\nimport { AssistantEntry, ToolResultEntry } from \"../entries.js\";\nimport { errorMessage } from \"../errors.js\";\nimport { defineTask } from \"../tasks.js\";\nimport { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, utf8ByteLength } from \"../truncate.js\";\nimport { assignJson } from \"./json.js\";\nimport { clearProgress, finishSlot, LiveDoc, removeNestedSlots, toolSlot, } from \"./live.js\";\nimport { recordUsage } from \"./usage.js\";\n/**\n * Memo of a tool task that made a nested call, in any attempt, committed before the first admission of each attempt:\n * only then can `pi.live` hold slots below it, which settling removes. A crash between the two only costs a scan.\n */\nconst MADE_NESTED_CALLS = \"pi.tool.madeNestedCalls\";\n/**\n * The nested calls of a tool call, a task-scoped family of the calling task keyed by the nested call's key: so a rerun\n * finds the calls it already made, and the caller reads each result. Created with the nested task; the nested call's\n * terminal commit adds its result. One document per call, so no commit rewrites the others. Retires with the caller.\n */\nexport const NestedCallDoc = defineDocFamily({\n    kind: \"pi.tool.nested-call\",\n    version: 1,\n    scope: \"task\",\n    family: true,\n    initial: () => ({}),\n});\n/**\n * Built-in tool task: resolves the called tool among its phase agent's tools, validates, runs `beforeTool`, records intent,\n * executes, runs `afterTool`, and settles the result, all in one `call` handler so nothing separates resolution from\n * settlement. `execute` is reached only by recovery and applies the replay rule. A model-issued call settles by\n * appending its result entry; a nested call by writing its result to its caller's `NestedCallDoc`.\n */\nexport const ToolTask = defineTask({\n    name: \"pi.tool\",\n    version: 2,\n    initial: () => ({ phase: \"call\" }),\n    // Version 1 had only model-issued calls.\n    migrate: (input, checkpoint) => ({\n        input: { kind: \"model\", ...input },\n        checkpoint: checkpoint,\n    }),\n    phases: {\n        call: async (task, runtime, context) => {\n            const call = await readCall(runtime, task.input, context);\n            const tool = await resolveTool(runtime, task.input, call.name, context);\n            if (tool === undefined) {\n                const error = harnessError(\"tool_unavailable\", `Tool ${call.name} is not available`);\n                return settle(runtime, task.input, call, COMPLETED, () => error, context);\n            }\n            const prepared = prepare(tool, call.arguments);\n            const checked = \"error\" in prepared ? prepared : validate(tool, call, prepared.args);\n            if (\"error\" in checked)\n                return settle(runtime, task.input, call, COMPLETED, () => invalid(checked.error), context);\n            let args = checked.args;\n            let block;\n            await runtime.hooks.each(\"beforeTool\", async (hook) => {\n                if (block !== undefined)\n                    return;\n                try {\n                    const decision = await hook({ ...call, arguments: args }, runtime, context);\n                    if (decision?.block !== undefined)\n                        block = decision.block;\n                    else if (decision?.arguments !== undefined)\n                        args = decision.arguments;\n                }\n                catch (error) {\n                    if (runtime.signal.aborted)\n                        throw error;\n                    block = errorMessage(error);\n                }\n            });\n            if (block !== undefined) {\n                const blocked = harnessError(\"blocked\", `Tool call blocked: ${block}`);\n                return settle(runtime, task.input, call, COMPLETED, () => blocked, context);\n            }\n            const validated = validate(tool, call, args);\n            if (\"error\" in validated)\n                return settle(runtime, task.input, call, COMPLETED, () => invalid(validated.error), context);\n            // Strict JSON: repair may set optional properties to undefined, which the slot and checkpoint cannot hold.\n            const final = copyJson(validated.args, { omitUndefinedProperties: true });\n            await runtime.commit(async (tx) => {\n                const slot = toolSlot(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId);\n                if (slot !== undefined)\n                    slot.status = \"running\";\n                // A nested slot shows the arguments the call runs with, which repair, hooks, and coercion may have changed.\n                // Compared with the input, which the slot got at admission: reading the draft would track every leaf.\n                const changed = task.input.kind === \"nested\" && !jsonEqual(task.input.call.arguments, final);\n                if (changed && slot !== undefined && \"parentTaskId\" in slot)\n                    slot.arguments = final;\n                const intent = { phase: \"execute\", arguments: final, replay: tool.replay ?? \"unsafe\" };\n                return { status: \"running\", checkpoint: intent };\n            }, context);\n            await run(runtime, task.input, call, tool, final, context);\n        },\n        /** Recovery after intent: rerun only when the stored and the current policy both say `safe`. */\n        execute: async (task, runtime, context) => {\n            const { arguments: args, replay } = task.state.checkpoint;\n            const call = await readCall(runtime, task.input, context);\n            const tool = await resolveTool(runtime, task.input, call.name, context);\n            if (replay === \"safe\" && tool?.replay === \"safe\") {\n                // The rerun reports from scratch; clear what the interrupted attempt published.\n                await runtime.commit(async (tx) => {\n                    const slot = toolSlot(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId);\n                    if (slot !== undefined)\n                        clearProgress(slot);\n                    return undefined;\n                }, context);\n                return run(runtime, task.input, call, tool, args, context);\n            }\n            const message = `Tool ${call.name} was interrupted and may have partially run`;\n            // `failed` records cancellation intent, so the call's owned conversations, left unsupervised, are aborted.\n            const ending = { status: \"failed\", message };\n            await settle(runtime, task.input, call, ending, (slot) => fromSlot(slot, \"interrupted\", message), context);\n        },\n    },\n    abort: async (task, runtime, context) => {\n        const call = await readCall(runtime, task.input, context);\n        // Abandoned after a restart (`TaskOptions.abandonOnRestart`): say whether the call may have run.\n        const [code, message] = task.abortReason !== \"restart\"\n            ? [\"aborted\", `Tool ${call.name} was aborted`]\n            : task.state.checkpoint.phase === \"execute\"\n                ? [\"interrupted\", `Tool ${call.name} was interrupted by a restart and may have partially run`]\n                : [\"abandoned\", `Tool ${call.name} was not started: its caller ended with a restart`];\n        const ending = { status: \"aborted\" };\n        await settle(runtime, task.input, call, ending, (slot) => fromSlot(slot, code, message), context);\n    },\n});\n/** The called tool: among the tools the model is offered for a model-issued call, else among those tools may call. */\nasync function resolveTool(runtime, input, name, context) {\n    const agent = await runtime.agent(context);\n    return (input.kind === \"model\" ? agent.tools : agent.callable).find((tool) => tool.name === name);\n}\n/** The call: from the input for a nested call, which hooks see with its parent, else from the assistant entry. */\nasync function readCall(runtime, input, context) {\n    if (input.kind === \"nested\")\n        return { ...input.call, parent: { taskId: input.parent, callId: input.parentCallId } };\n    const entry = await runtime.entry(AssistantEntry, input.assistant, context);\n    const message = entry?.model?.[0];\n    const call = message?.role === \"assistant\"\n        ? message.content.find((content) => content.type === \"toolCall\" && content.id === input.callId)\n        : undefined;\n    if (call === undefined)\n        throw new Error(`Entry ${input.assistant} has no tool call ${input.callId}`);\n    return call;\n}\n/** The call's arguments as repaired by the tool; a throwing repair makes them invalid. */\nfunction prepare(tool, args) {\n    if (tool.prepareArguments === undefined)\n        return { args };\n    try {\n        return { args: tool.prepareArguments(args) };\n    }\n    catch (error) {\n        return { error: errorMessage(error) };\n    }\n}\n/** Arguments validated and coerced against the implementation's schema. */\nfunction validate(tool, call, args) {\n    try {\n        return { args: validateToolArguments(tool, { ...call, arguments: args }) };\n    }\n    catch (error) {\n        return { error: errorMessage(error) };\n    }\n}\nfunction invalid(message) {\n    return harnessError(\"invalid_arguments\", message);\n}\n/** Execute with the resolved implementation, then settle its result. */\nasync function run(runtime, input, call, tool, args, context) {\n    const limits = {\n        maxBytes: tool.outputLimits?.maxBytes ?? DEFAULT_MAX_BYTES,\n        maxLines: tool.outputLimits?.maxLines ?? DEFAULT_MAX_LINES,\n        retain: tool.outputLimits?.retain ?? \"head\",\n    };\n    const reported = { output: new OutputBuffer(limits), limits, diagnostics: [], details: undefined };\n    const streams = input.kind === \"model\" || input.progress !== false;\n    const progress = publishProgress(runtime, reported, streams, context);\n    /** Nested call admissions this invocation started; cleanup waits for them, so it sees every nested call. */\n    const admissions = [];\n    // A caller that can rerun reattaches to its nested calls and child tasks after a restart; any other caller never\n    // resumes, so they are abandoned (`TaskOptions.abandonOnRestart`).\n    const resumes = tool.replay === \"safe\";\n    /** Default keys: the order of this invocation's calls, so a rerun that calls in the same order reattaches. */\n    let sequence = 0;\n    /** This attempt's commit of the `MADE_NESTED_CALLS` memo. */\n    let madeNestedMemo;\n    let ended = false;\n    const assertLive = () => {\n        if (ended)\n            throw new Error(`Tool call ${call.id} has settled`);\n    };\n    const api = {\n        taskId: runtime.taskId,\n        conversationId: runtime.conversationId,\n        callId: call.id,\n        registry: runtime.registry,\n        agent: runtime.agent,\n        models: runtime.models,\n        output: (chunk, skipped) => {\n            assertLive();\n            if (reported.output.push(chunk, skipped))\n                progress.mark();\n        },\n        outputWindow: limits.retain === \"tail\"\n            ? {\n                maxBytes: limits.maxBytes,\n                maxLines: limits.maxLines,\n                minIntervalMs: runtime.settings.progress.outputIntervalMs,\n                bytesPerSecond: PROGRESS_BYTES_PER_SECOND,\n            }\n            : undefined,\n        retainedOutput: () => {\n            assertLive();\n            const retained = reported.output.snapshot();\n            return { text: retained.text, truncated: retained.droppedBytes > 0 };\n        },\n        diagnostic: (diagnostic) => {\n            assertLive();\n            reported.diagnostics.push(copyJson(diagnostic, { omitUndefinedProperties: true }));\n            progress.mark();\n        },\n        details: async (value, detailsContext) => {\n            assertLive();\n            detailsContext.abortSignal?.throwIfAborted();\n            reported.details = copyJson(value, { omitUndefinedProperties: true });\n            const committed = progress.markAndWait();\n            // Cancelling the wait leaves the update in place; the commit's own outcome stays observed.\n            committed.catch(() => { });\n            return awaitWithContext(committed, detailsContext);\n        },\n        commit: async (change, commitContext) => {\n            let result;\n            await runtime.commit(async (tx) => {\n                result = await change(tx);\n                return undefined;\n            }, commitContext);\n            return result;\n        },\n        memo: runtime.memo,\n        createTask: async (task, input, options, taskContext) => {\n            const child = options.ownership.kind === \"task\" && !resumes ? { abandonOnRestart: true, ...options } : options;\n            let id;\n            await runtime.commit(async (tx) => {\n                id = await tx.createTask(task, input, child);\n                return undefined;\n            }, taskContext);\n            return id;\n        },\n        getTask: runtime.getTask,\n        waitForTask: runtime.waitForTask,\n        conversation: runtime.conversation,\n        snapshot: runtime.snapshot,\n        snapshotAsOf: runtime.snapshotAsOf,\n        watchDoc: runtime.watchDoc,\n        executeTool: async (name, toolArgs, callContext, options = {}) => {\n            assertLive();\n            const key = options.key ?? String(++sequence);\n            if (options.key !== undefined)\n                checkKey(options.key);\n            // The memo first, once per attempt; a failed one is tried again by the next call.\n            madeNestedMemo ??= runtime.memo(MADE_NESTED_CALLS, true, callContext).catch((error) => {\n                madeNestedMemo = undefined;\n                throw error;\n            });\n            // Registered now, so cleanup waits for it.\n            const admission = madeNestedMemo.then(() => startNestedCall(runtime, call.id, name, toolArgs, { key, progress: options.progress, abandonOnRestart: !resumes }, callContext));\n            admissions.push(admission);\n            const id = await admission;\n            const settled = await runtime.waitForTask(id, callContext);\n            const stored = (await runtime.snapshot(NestedCallDoc, runtime.taskId, key, callContext))?.result;\n            // A copy the tool may change; a nested call the scheduler faulted or orphaned stored none.\n            return stored === undefined\n                ? fallbackResult(id, name, settled.state.outcome)\n                : copyJson(stored);\n        },\n    };\n    let result;\n    let ending = COMPLETED;\n    // Execution time of this attempt; a rerun after recovery measures only itself.\n    let durationMs;\n    try {\n        // Built for this call, so a rerun after recovery gets the conversation's environment at that time.\n        const env = await runtime.env(context);\n        const startedAt = performance.now();\n        try {\n            result = await tool.execute(args, { ...api, env }, context);\n        }\n        finally {\n            durationMs = Math.round(performance.now() - startedAt);\n        }\n    }\n    catch (error) {\n        if (runtime.signal.aborted) {\n            ended = true;\n            for (const waiter of await progress.stop())\n                waiter.reject(error);\n            throw error;\n        }\n        result = { isError: true, diagnostics: [toolDiagnostic(\"tool_error\", errorMessage(error))] };\n        // A throw, from `execute()` or from building the environment, ends the task `failed`, which cancels what the call\n        // owned; it no longer supervises it. The error text is already in the result.\n        ending = { status: \"failed\", message: `Tool ${call.name} threw` };\n    }\n    ended = true;\n    // No admission starts after `ended`; let those underway commit, so settlement aborts and lists their calls.\n    await Promise.allSettled(admissions);\n    reported.output.end();\n    // Details still waiting for a progress commit settle with the terminal commit, the final flush.\n    const pending = await progress.stop();\n    try {\n        const settled = await finalResult(runtime, input, call, tool, result, reported, context);\n        await settle(runtime, input, call, ending, () => settled, context, durationMs);\n    }\n    catch (error) {\n        for (const waiter of pending)\n            waiter.reject(error);\n        throw error;\n    }\n    for (const waiter of pending)\n        waiter.resolve();\n}\n/**\n * Throttled commits of what the tool reported into its slot, in `pi.live.tools` or `pi.live.nestedTools`, each writing\n * only what changed since the last one; none when `enabled` is false.\n */\nfunction publishProgress(runtime, reported, enabled, context) {\n    let written = { text: \"\", details: undefined, diagnostics: 0 };\n    return new Progress(async () => {\n        if (!enabled)\n            return 0;\n        // Capture everything synchronously: the tool keeps reporting while the commit is in flight.\n        const snapshot = reported.output.snapshot();\n        const current = { text: snapshot.text, details: reported.details, diagnostics: reported.diagnostics.length };\n        const added = reported.diagnostics.slice(written.diagnostics, current.diagnostics);\n        const detailsChanged = current.details !== written.details;\n        // What the commit writes, as Chord diffs the string: an append, a trim plus an append of what follows the shared\n        // part, or the whole window when its bounded overlap search finds nothing.\n        let bytes = 0;\n        if (snapshot.text !== written.text) {\n            const shared = snapshot.text.startsWith(written.text)\n                ? written.text.length\n                : overlap(written.text, snapshot.text, 65_536);\n            bytes += utf8ByteLength(snapshot.text.slice(shared));\n        }\n        if (detailsChanged)\n            bytes += utf8ByteLength(JSON.stringify(current.details ?? null));\n        if (added.length > 0)\n            bytes += utf8ByteLength(JSON.stringify(added));\n        await runtime.commit(async (tx) => {\n            const slot = toolSlot(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId);\n            if (slot === undefined)\n                return undefined;\n            // REMINDER: assign `output` as one string field. Chord then diffs it into an append, or a trim plus an\n            // append for a sliding tail; replacing the slot object would record the whole window on every commit.\n            if ((slot.output ?? \"\") !== snapshot.text)\n                slot.output = snapshot.text;\n            if (snapshot.droppedBytes > 0)\n                slot.droppedBytes = snapshot.droppedBytes;\n            if (snapshot.droppedLines > 0)\n                slot.droppedLines = snapshot.droppedLines;\n            // Diff details leaf by leaf and append new diagnostics, so each commit writes only what changed.\n            if (detailsChanged && current.details !== undefined) {\n                assignJson(slot, \"details\", current.details);\n            }\n            if (added.length > 0) {\n                if (slot.diagnostics === undefined)\n                    slot.diagnostics = [];\n                for (const diagnostic of added)\n                    slot.diagnostics.push(diagnostic);\n            }\n            return undefined;\n        }, context);\n        written = current;\n        return bytes;\n    }, (error) => {\n        // Rejections after an abort mark or close are expected; the committed state stays consistent.\n        if (!runtime.signal.aborted)\n            runtime.report(error);\n    }, runtime.settings.progress.outputIntervalMs);\n}\n/**\n * The settled result: the tool's result with the retained output and last details as fallbacks, its diagnostics after\n * those reported through the api, `afterTool` applied, explicit text bounded, and `structuredOutput` checked against the\n * tool's schema, with the Harness's diagnostics last. A nested call whose `structuredOutput` breaks the contract gets an\n * error result without it; a model-issued call only loses it, and the break is reported to the host.\n */\nasync function finalResult(runtime, input, call, tool, result, reported, context) {\n    const harness = [];\n    const retained = result.output === undefined ? reported.output.snapshot() : undefined;\n    const output = retained === undefined ? result.output : retained.text === \"\" ? [] : [{ type: \"text\", text: retained.text }];\n    let final = {\n        ...result,\n        output,\n        details: result.details === undefined ? reported.details : result.details,\n        diagnostics: [...reported.diagnostics, ...(result.diagnostics ?? [])],\n    };\n    await runtime.hooks.each(\"afterTool\", async (hook) => {\n        final = (await hook(call, final, runtime, context)) ?? final;\n    });\n    // The retained output's truncation applies only while afterTool kept that output.\n    if (retained !== undefined && retained.droppedBytes > 0 && final.output === output) {\n        harness.push(truncated(retained, reported.limits.retain));\n    }\n    const bounded = boundContent(final.output ?? [], reported.limits);\n    if (bounded.droppedBytes > 0)\n        harness.push(truncated(bounded, reported.limits.retain));\n    const broken = structuredOutputError(tool, final);\n    if (broken !== undefined) {\n        const { structuredOutput: _dropped, ...rest } = final;\n        if (input.kind === \"nested\") {\n            final = { ...rest, isError: true };\n            harness.push(toolDiagnostic(\"invalid_structured_output\", broken));\n        }\n        else {\n            // The model never sees structured output, so its call stands; the host learns of the broken tool.\n            final = rest;\n            runtime.report(new Error(broken));\n        }\n    }\n    // Programs get the tool's own value: without a schema, its output. The model reads only `output`, so model-issued\n    // calls skip both.\n    if (input.kind === \"nested\" && tool.structuredOutputSchema === undefined) {\n        final = { ...final, structuredOutput: outputValue(bounded.content) };\n    }\n    // A schema tool's error result without structured output has its text only in the output, which programs never\n    // get: it becomes an error diagnostic, as a thrown error's message does, unless one says what went wrong already.\n    if (input.kind === \"nested\" &&\n        tool.structuredOutputSchema !== undefined &&\n        final.isError === true &&\n        final.structuredOutput === undefined &&\n        ![...(final.diagnostics ?? []), ...harness].some((diagnostic) => diagnostic.severity === \"error\")) {\n        const text = bounded.content.flatMap((item) => (item.type === \"text\" ? [item.text] : [])).join(\"\\n\");\n        if (text !== \"\")\n            harness.push(toolDiagnostic(\"tool_error\", text));\n    }\n    return { ...final, output: bounded.content, diagnostics: [...(final.diagnostics ?? []), ...harness] };\n}\nconst structuredValidators = new WeakMap();\n/** Why a result's `structuredOutput` breaks the tool's contract, or `undefined` when it keeps it. */\nfunction structuredOutputError(tool, result) {\n    const schema = tool.structuredOutputSchema;\n    const value = result.structuredOutput;\n    if (schema === undefined) {\n        return value === undefined\n            ? undefined\n            : `Tool ${tool.name} returned structuredOutput but declares no structuredOutputSchema`;\n    }\n    if (value === undefined) {\n        return result.isError === true ? undefined : `Tool ${tool.name} returned no structuredOutput`;\n    }\n    let validator = structuredValidators.get(schema);\n    if (validator === undefined) {\n        validator = Compile(schema);\n        structuredValidators.set(schema, validator);\n    }\n    if (validator.Check(value))\n        return undefined;\n    const [first] = validator.Errors(value);\n    const path = first?.instancePath.replace(/^\\//, \"\").replace(/\\//g, \".\") || \"root\";\n    return `Tool ${tool.name} returned structuredOutput that does not match its schema: ${path}: ${first?.message ?? \"invalid\"}`;\n}\n/**\n * Commit the tool's terminal state and mark its slot done. A model-issued call appends its result entry and ends with\n * the entry ID; a nested call writes its result to the caller's `NestedCallDoc`, records its usage, and ends with a\n * small receipt. Nested calls this call left running are aborted first, so they report into their slots before the\n * slots below the call leave `pi.live`. `build` receives the slot so interruption and abort can report the durable\n * partial output.\n */\nasync function settle(runtime, input, call, ending, build, context, durationMs) {\n    // A crash in between leaves the call in `execute`: a safe rerun reattaches to the calls, an interruption ends here.\n    // Every live nested call the task owns, also those an earlier attempt made and this one never called again.\n    const nestedIds = (await runtime.ownedTasks(context))\n        .filter((record) => record.kind === ToolTask.definition.name && record.input.kind === \"nested\")\n        .map((record) => record.id);\n    // Read before the settling commit: no admission starts after `ended`, and those underway were awaited.\n    const madeNested = (await runtime.memo(MADE_NESTED_CALLS, context)) === true;\n    // Mark them all before waiting for any: one may run until a sibling is cancelled.\n    await Promise.all(nestedIds.map((id) => runtime.abortOwned(id, context)));\n    await runtime.commit(async (tx) => {\n        const conversationId = runtime.conversationId;\n        const live = await tx.doc(LiveDoc, conversationId);\n        const slot = toolSlot(live, runtime.taskId);\n        const result = build(slot);\n        let settled;\n        if (input.kind === \"nested\") {\n            const nested = nestedResult(runtime.taskId, result, durationMs);\n            if (nested.usage !== undefined)\n                await recordUsage(tx, conversationId, \"tools\", call.name, nested.usage);\n            // The caller is never terminal before its owned nested calls, so its document is open; another task in it is a\n            // bug, not a race.\n            const state = await tx.doc(NestedCallDoc, input.parent, input.key, null);\n            if (state.taskId !== runtime.taskId)\n                throw new Error(`Nested call ${call.id} is not in its caller's index`);\n            state.result = nested;\n            if (slot !== undefined && \"parentTaskId\" in slot) {\n                finishSlot(slot);\n                slot.summary = summaryOf(nested, result.output ?? []);\n            }\n            settled = { kind: \"nested\" };\n        }\n        else {\n            const timing = { timestamp: runtime.now(), durationMs };\n            const entry = await appendToolResult(tx, conversationId, call, result, timing);\n            if (slot !== undefined && !(\"parentTaskId\" in slot)) {\n                finishSlot(slot);\n                slot.entry = entry.id;\n            }\n            // Tools build control objects freely; drop keys set to undefined so the task result is strict JSON.\n            const control = result.control === undefined || ending.status !== \"completed\"\n                ? {}\n                : { control: copyJson(result.control, { omitUndefinedProperties: true }) };\n            settled = { kind: \"model\", entryId: entry.id, ...control };\n        }\n        // A call that made no nested calls, in any attempt, has no slots below it; skipping the scan keeps many leaves\n        // linear. Committed before the read: no nested call is admitted after `ended`.\n        if (madeNested)\n            removeNestedSlots(live, runtime.taskId);\n        if (ending.status === \"aborted\")\n            return { status: \"terminal\", outcome: { status: \"aborted\", result: settled } };\n        if (ending.status === \"failed\") {\n            const error = { message: ending.message };\n            return { status: \"terminal\", outcome: { status: \"failed\", error, result: settled } };\n        }\n        return { status: \"terminal\", outcome: { status: \"completed\", result: settled } };\n    }, context);\n}\n/**\n * A nested call's result, as stored and returned: strict JSON, without `output`, which only the model reads, and\n * without `control`, which only model-issued calls apply.\n */\nfunction nestedResult(taskId, result, durationMs) {\n    const nested = {\n        taskId,\n        structuredOutput: result.structuredOutput,\n        isError: result.isError ?? false,\n        details: result.details,\n        diagnostics: result.diagnostics ?? [],\n        usage: result.usage,\n        durationMs,\n    };\n    return copyJson(nested, {\n        omitUndefinedProperties: true,\n    });\n}\n/**\n * Create nested call `key` of the call `parentCallId` in one commit: its tool task, owned by the calling task, its slot,\n * and its `NestedCallDoc`. A key already made returns that call's task when it names the same tool and arguments.\n */\nasync function startNestedCall(runtime, parentCallId, name, args, options, context) {\n    const key = options.key;\n    const call = {\n        type: \"toolCall\",\n        id: `${parentCallId}/${key}`,\n        name,\n        arguments: copyJson(args, { omitUndefinedProperties: true }),\n    };\n    let id;\n    await runtime.commit(async (tx) => {\n        // Opened, or created empty for a key not made yet.\n        const state = await tx.doc(NestedCallDoc, runtime.taskId, key, null);\n        const existing = state.taskId;\n        if (existing !== undefined) {\n            const input = (await tx.task(existing))?.input;\n            const same = input?.kind === \"nested\" &&\n                input.call.name === name &&\n                jsonEqual(input.call.arguments, call.arguments);\n            if (!same)\n                throw new Error(`Nested call ${call.id} was already made with another tool or other arguments`);\n            id = existing;\n            return undefined;\n        }\n        const input = {\n            kind: \"nested\",\n            parent: runtime.taskId,\n            parentCallId,\n            key,\n            call,\n            ...(options.progress === false ? { progress: false } : {}),\n        };\n        const created = await tx.createTask(ToolTask, input, {\n            ownership: { kind: \"task\", taskId: runtime.taskId },\n            abandonOnRestart: options.abandonOnRestart,\n        });\n        state.taskId = created;\n        const live = await tx.doc(LiveDoc, runtime.conversationId);\n        live.nestedTools ??= [];\n        const slot = {\n            callId: call.id,\n            parentCallId,\n            parentTaskId: runtime.taskId,\n            name,\n            taskId: created,\n            arguments: call.arguments,\n            status: \"pending\",\n        };\n        live.nestedTools.push(slot);\n        id = created;\n        return undefined;\n    }, context);\n    return id;\n}\n/**\n * What programs get of a tool's output when it declares no schema: one text item as its string, one image as itself,\n * nothing as `\"\"`, and anything else as the content list.\n */\nfunction outputValue(output) {\n    if (output.length === 0)\n        return \"\";\n    if (output.length > 1)\n        return output;\n    const [only] = output;\n    return only.type === \"text\" ? only.text : only;\n}\n/** What the caller gets for a nested call without a stored result: one the scheduler faulted or orphaned. */\nfunction fallbackResult(taskId, name, outcome) {\n    const message = outcome.status === \"faulted\"\n        ? `Tool ${name} failed: ${outcome.error.message}`\n        : outcome.status === \"orphaned\"\n            ? `Tool ${name} could not resume: ${outcome.reason}`\n            : `Tool ${name} ended without a result`;\n    const error = harnessError(outcome.status, message);\n    return { taskId, isError: true, diagnostics: error.diagnostics ?? [] };\n}\nconst COMPLETED = { status: \"completed\" };\n/** An error result from the slot's durable partial output, details, and diagnostics. */\nfunction fromSlot(slot, code, message) {\n    const diagnostics = [...(slot?.diagnostics ?? [])];\n    const droppedBytes = slot?.droppedBytes ?? 0;\n    if (droppedBytes > 0)\n        diagnostics.push(truncated({ droppedBytes, droppedLines: slot?.droppedLines ?? 0 }));\n    diagnostics.push(toolDiagnostic(code, message));\n    return {\n        output: slot?.output === undefined || slot.output === \"\" ? [] : [{ type: \"text\", text: slot.output }],\n        isError: true,\n        ...(slot?.details === undefined ? {} : { details: slot.details }),\n        diagnostics,\n    };\n}\n/** An error result the Harness writes itself: no content and one `error` diagnostic with `code`. */\nexport function harnessError(code, message) {\n    return { output: [], isError: true, diagnostics: [toolDiagnostic(code, message)] };\n}\nfunction toolDiagnostic(code, message) {\n    return { severity: \"error\", code, message };\n}\n/** The Harness's truncation diagnostic; `retain` is unknown when rebuilt from a slot after recovery. */\nfunction truncated(dropped, retain) {\n    const kept = retain === undefined ? \"\" : ` to its ${retain === \"head\" ? \"beginning\" : \"end\"}`;\n    return {\n        severity: \"warn\",\n        code: \"truncated\",\n        message: `Output truncated${kept}: ${dropped.droppedLines} lines, ${dropped.droppedBytes} bytes dropped`,\n    };\n}\n/** Error text a nested call's summary keeps. */\nconst MAX_SUMMARY_ERROR_CHARS = 500;\n/** How a nested call ended, for its slot: error text, from its diagnostics or else its `output`, bounded. */\nfunction summaryOf(result, output) {\n    const error = result.isError ? errorTextOf(result, output).slice(0, MAX_SUMMARY_ERROR_CHARS) : \"\";\n    return {\n        isError: result.isError,\n        ...(result.durationMs === undefined ? {} : { durationMs: result.durationMs }),\n        ...(result.usage === undefined ? {} : { usage: result.usage }),\n        ...(error === \"\" ? {} : { error }),\n    };\n}\n/** The error messages of a nested result, else the text items of its output, joined with newlines. */\nfunction errorTextOf(result, output) {\n    const errors = result.diagnostics.filter((diagnostic) => diagnostic.severity === \"error\");\n    if (errors.length > 0)\n        return errors.map((diagnostic) => diagnostic.message).join(\"\\n\");\n    return output.flatMap((item) => (item.type === \"text\" ? [item.text] : [])).join(\"\\n\");\n}\n/**\n * Append a `pi.tool-result` entry. The content ends with the rendered diagnostics, so the stored message is exactly\n * what the model sees; `data` keeps the structured list. A result's usage is added to `pi.usage` in the same commit.\n */\nexport async function appendToolResult(tx, conversationId, call, result, meta) {\n    const { timestamp, durationMs } = meta;\n    const diagnostics = [...(result.diagnostics ?? [])];\n    const content = [...(result.output ?? [])];\n    if (diagnostics.length > 0)\n        content.push({ type: \"text\", text: renderDiagnostics(diagnostics) });\n    const message = {\n        role: \"toolResult\",\n        toolCallId: call.id,\n        toolName: call.name,\n        content,\n        ...(result.details === undefined ? {} : { details: result.details }),\n        ...(result.usage === undefined ? {} : { usage: result.usage }),\n        isError: result.isError ?? false,\n        ...(durationMs === undefined ? {} : { durationMs }),\n        timestamp,\n    };\n    if (result.usage !== undefined)\n        await recordUsage(tx, conversationId, \"tools\", call.name, result.usage);\n    return tx.appendEntry(ToolResultEntry, conversationId, { model: [message], data: { diagnostics } });\n}\nfunction renderDiagnostics(diagnostics) {\n    return `<harness>\\n${diagnostics.map((diagnostic) => `[${diagnostic.severity}] ${diagnostic.message}`).join(\"\\n\")}\\n</harness>`;\n}\n/**\n * Bound the text of result content. When the joined text exceeds the limits, the text items are replaced by one bounded\n * item at the position of the first (head) or last (tail) text item; other content is kept.\n */\nfunction boundContent(content, limits) {\n    const texts = content.filter((item) => item.type === \"text\");\n    const bounded = boundOutput(texts.map((item) => item.text).join(\"\"), limits);\n    if (bounded.droppedBytes === 0)\n        return { content, droppedBytes: 0, droppedLines: 0 };\n    const keep = limits.retain === \"head\" ? texts[0] : texts.at(-1);\n    const result = [];\n    for (const item of content) {\n        if (item.type !== \"text\")\n            result.push(item);\n        else if (item === keep)\n            result.push({ ...item, text: bounded.text });\n    }\n    return { content: result, droppedBytes: bounded.droppedBytes, droppedLines: bounded.droppedLines };\n}\n/**\n * Explicit nested call keys are path segments of the call ID, so IDs of different nested calls never collide, and are\n * never plain positive integers, which default keys use. `__proto__` stays reserved, as it was when keys indexed a JSON object.\n */\nfunction checkKey(key) {\n    if (key === \"\" || key.includes(\"/\") || key === \"__proto__\" || /^[1-9][0-9]*$/.test(key)) {\n        throw new Error(`Nested call key ${JSON.stringify(key)} must be non-empty, without \"/\", not \"__proto__\", and not a positive integer`);\n    }\n}\n/** Structural JSON equality; object key order does not matter. */\nfunction jsonEqual(a, b) {\n    if (a === b)\n        return true;\n    if (typeof a !== \"object\" || typeof b !== \"object\" || a === null || b === null)\n        return false;\n    if (Array.isArray(a) || Array.isArray(b)) {\n        return (Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((item, i) => jsonEqual(item, b[i])));\n    }\n    const keys = Object.keys(a);\n    return (keys.length === Object.keys(b).length && keys.every((key) => Object.hasOwn(b, key) && jsonEqual(a[key], b[key])));\n}\n//# sourceMappingURL=tool.js.map","import { copyJson } from \"@earendil-works/chord\";\nimport { isContextOverflow } from \"@earendil-works/pi-ai/utils/overflow\";\nimport { isRetryableAssistantError, retryDelayMs } from \"@earendil-works/pi-ai/utils/retry\";\nimport { getCurrentTools } from \"@earendil-works/pi-ai/utils/transcript\";\nimport { AssistantEntry, ResetEntry, SystemEntry, UserEntry } from \"../entries.js\";\nimport { defineTask } from \"../tasks.js\";\nimport { addTools } from \"./agent.js\";\nimport { createCompaction, estimateContext, selectCut } from \"./compaction.js\";\nimport { applyBoundary, prepareBoundary } from \"./inbox.js\";\nimport { assignJson } from \"./json.js\";\nimport { endRun, LiveDoc } from \"./live.js\";\nimport { planSystemEntries, renderSections, replaySections } from \"./prompt.js\";\nimport { ensureProviderSessionId } from \"./provider.js\";\nimport { appendToolResult, harnessError, ToolTask } from \"./tool.js\";\nimport { recordUsage } from \"./usage.js\";\nconst DEFAULT_POLL_AFTER_MS = 5000;\n/**\n * Built-in generation task: prepares the positional system prompt and tool loadout, requests or polls the model,\n * retries, and classifies the response. The run's inputs live in `pi.live.run`.\n */\nexport const GenerationTask = defineTask({\n    name: \"pi.generation\",\n    version: 1,\n    initial: () => ({ phase: \"prepare\", attempt: 1 }),\n    phases: {\n        /**\n         * Render the system prompt and tool loadout and append the positional `pi.system` entries they need, then move to\n         * `request`. The agent and settings resolved here are fixed for this request. Only the Harness writes model\n         * context to a busy conversation, so the context read here is still current at the commit; display-only entries\n         * may land meanwhile.\n         */\n        prepare: async (task, runtime, context) => {\n            const { conversationId } = runtime;\n            const agent = await runtime.agent(context);\n            const settings = runtime.settings;\n            const { model, thinkingLevel } = agent;\n            const resolved = model === undefined ? undefined : runtime.models.getModel(model.provider, model.modelId);\n            if (model === undefined || resolved === undefined)\n                return failNoModel(runtime, model, context);\n            const { attempt, compacted, overflow, threshold: blocked } = task.state.checkpoint;\n            if (compacted !== undefined && overflow !== undefined) {\n                const [outcome] = await runtime.outcomes([compacted], context);\n                if (outcome?.status !== \"completed\" || outcome.result.entryId === undefined) {\n                    return failModelError(runtime, overflow, context);\n                }\n            }\n            // A threshold compaction that found nothing to compact or was declined leaves a request that may still fit. One\n            // that failed left a context it judged too large: sending it would at best leave no room for the answer.\n            if (compacted !== undefined && blocked === true) {\n                const [outcome] = await runtime.outcomes([compacted], context);\n                if (outcome !== undefined && outcome.status !== \"completed\") {\n                    return failModelError(runtime, compactionFailure(outcome), context);\n                }\n            }\n            const view = await runtime.context(conversationId, context);\n            const shown = replaySections(view.messages);\n            const report = (error) => runtime.report(error);\n            let env;\n            try {\n                env = await runtime.env(context);\n            }\n            catch (error) {\n                if (context.abortSignal?.aborted)\n                    throw error;\n                report(error);\n            }\n            const input = { conversationId, agent, env, shown: Object.fromEntries(shown), read: runtime };\n            const desired = await renderSections(agent.sections, input, shown, report, context);\n            const entries = planSystemEntries(view, desired, agent.tools, runtime.now());\n            const threshold = compacted === undefined\n                ? thresholdCompaction(view, entries, resolved.contextWindow, settings.compaction)\n                : undefined;\n            if (threshold === \"blocking\") {\n                // Compact first and prepare again; the transcript is unchanged until the compaction appends.\n                await runtime.commit(async (tx) => {\n                    const child = await createCompaction(tx, conversationId, { reason: \"threshold\" }, runtime.taskId);\n                    const checkpoint = { phase: \"prepare\", attempt, compacted: child, threshold: true };\n                    return { status: \"waiting\", checkpoint, on: [child], policy: \"allSettled\" };\n                }, context);\n                return;\n            }\n            await runtime.commit(async (tx) => {\n                let cutoff = (await tx.scanEntries({ conversationId }, 1)).items[0]?.id;\n                for (const entry of entries)\n                    cutoff = (await tx.appendEntry(SystemEntry, conversationId, entry)).id;\n                if (cutoff === undefined)\n                    throw new Error(`Conversation ${conversationId} has no entries to send`);\n                // Checked in this commit, so a compaction admitted during preparation counts.\n                if (threshold === \"background\" && (await tx.doc(LiveDoc, conversationId)).compactions === undefined) {\n                    await createCompaction(tx, conversationId, { reason: \"threshold\" });\n                }\n                const request = {\n                    attempt,\n                    ...(compacted === undefined ? {} : { compacted }),\n                    model,\n                    thinkingLevel,\n                    streamOptions: settings.stream,\n                    cutoff,\n                };\n                return { status: \"running\", checkpoint: { phase: \"request\", ...request } };\n            }, context);\n        },\n        request: async (task, runtime, context) => {\n            const { attempt, compacted, model: ref, thinkingLevel, streamOptions, cutoff } = task.state.checkpoint;\n            const conversationId = runtime.conversationId;\n            await runtime.commit(async (tx) => {\n                const live = await tx.doc(LiveDoc, conversationId);\n                await convertPartial(tx, live, conversationId);\n                live.generation = { attempt };\n                return undefined;\n            }, context);\n            const model = runtime.models.getModel(ref.provider, ref.modelId);\n            if (model === undefined)\n                return failNoModel(runtime, ref, context);\n            const view = await runtime.context(conversationId, context, { at: cutoff });\n            let messages = view.messages;\n            await runtime.hooks.each(\"beforeRequest\", async (hook) => {\n                const replaced = await hook({ messages }, runtime, context);\n                if (replaced !== undefined)\n                    messages = replaced.messages;\n            });\n            const options = {\n                ...streamOptions,\n                signal: runtime.signal,\n                sessionId: await ensureProviderSessionId(runtime, context),\n                ...(thinkingLevel === \"off\" ? {} : { reasoning: thinkingLevel }),\n            };\n            const message = await streamResponse(runtime, model, messages, options, attempt, context);\n            const request = { attempt, compacted, model: ref, cutoff, messages: view.messages };\n            await classify(runtime, request, message, context);\n        },\n        retry: async (task, runtime, context) => {\n            const { attempt, compacted, until } = task.state.checkpoint;\n            await runtime.sleep(until, context);\n            await runtime.commit(async (tx) => {\n                (await tx.doc(LiveDoc, runtime.conversationId)).generation = { attempt: attempt + 1 };\n                const checkpoint = {\n                    phase: \"prepare\",\n                    attempt: attempt + 1,\n                    ...(compacted === undefined ? {} : { compacted }),\n                };\n                return { status: \"running\", checkpoint };\n            }, context);\n        },\n        poll: async (task, runtime, context) => {\n            const { attempt, compacted, model: ref, cutoff, handle, pollAt } = task.state.checkpoint;\n            const model = runtime.models.getModel(ref.provider, ref.modelId);\n            if (model === undefined)\n                return failNoModel(runtime, ref, context);\n            await runtime.sleep(pollAt, context);\n            const message = await runtime.models.fetchDeferred(model, handle, { signal: runtime.signal });\n            const request = { attempt, compacted, model: ref, cutoff, pollAt };\n            await classify(runtime, request, message, context);\n        },\n        tools: async (task, runtime, context) => {\n            const { assistant, tools, pending } = task.state.checkpoint;\n            const [next, ...rest] = pending;\n            if (next === undefined)\n                return finishToolRound(runtime, assistant, tools, context);\n            // Sequential round: start the next call and wait for it.\n            await runtime.commit(async (tx) => {\n                const live = await tx.doc(LiveDoc, runtime.conversationId);\n                const taskId = await createToolTask(tx, runtime, assistant, next);\n                const slot = live.tools?.find((slot) => slot.callId === next && slot.taskId === undefined);\n                if (slot !== undefined)\n                    slot.taskId = taskId;\n                const checkpoint = {\n                    phase: \"tools\",\n                    assistant,\n                    tools: [...tools, taskId],\n                    pending: rest,\n                };\n                return { status: \"waiting\", checkpoint, on: [taskId], policy: \"allSettled\" };\n            }, context);\n        },\n    },\n    abort: async (task, runtime, context) => {\n        const checkpoint = task.state.checkpoint;\n        if (checkpoint.phase === \"poll\") {\n            const model = runtime.models.getModel(checkpoint.model.provider, checkpoint.model.modelId);\n            if (model !== undefined) {\n                try {\n                    await runtime.models.cancelDeferred(model, checkpoint.handle, { signal: runtime.signal });\n                }\n                catch (error) {\n                    runtime.report(error);\n                }\n            }\n        }\n        const conversationId = runtime.conversationId;\n        // Runs after the round's tool tasks are terminal; calls never started get `aborted` results (spec §8.5).\n        const unstarted = checkpoint.phase === \"tools\"\n            ? await readCalls(runtime, checkpoint.assistant, checkpoint.pending, context)\n            : [];\n        await runtime.commit(async (tx) => {\n            const live = await tx.doc(LiveDoc, conversationId);\n            await convertPartial(tx, live, conversationId);\n            for (const call of unstarted) {\n                const result = harnessError(\"aborted\", `Tool ${call.name} was aborted`);\n                await appendToolResult(tx, conversationId, call, result, { timestamp: runtime.now() });\n            }\n            endRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"aborted\" });\n            return { status: \"terminal\", outcome: { status: \"aborted\" } };\n        }, context);\n    },\n});\n/** The calls `callIds` of the assistant entry, in the given order. */\nasync function readCalls(runtime, assistant, callIds, context) {\n    const message = (await runtime.entry(AssistantEntry, assistant, context))?.model?.[0];\n    const calls = message?.role === \"assistant\" ? message.content.filter((content) => content.type === \"toolCall\") : [];\n    return callIds.flatMap((id) => calls.filter((call) => call.id === id).slice(0, 1));\n}\n/** A tool task for call `callId`, owned by the generation. */\nfunction createToolTask(tx, runtime, assistant, callId) {\n    return tx.createTask(ToolTask, { kind: \"model\", assistant, callId }, { ownership: { kind: \"task\", taskId: runtime.taskId } });\n}\n/**\n * Which threshold compaction preparation starts before its request (spec §8.3): `blocking` above\n * `contextWindow - reserveTokens`, `background` above the background threshold, and only when range selection finds a\n * cut. The caller starts a background one only while no compaction is listed.\n */\nfunction thresholdCompaction(view, planned, contextWindow, policy) {\n    if (!policy.enabled || contextWindow <= 0)\n        return undefined;\n    const tokens = estimateContext(view, planned.flatMap((entry) => entry.model ?? []));\n    const blocking = contextWindow - policy.reserveTokens;\n    const background = blocking - policy.backgroundTokens;\n    const over = tokens > blocking ? \"blocking\" : policy.backgroundTokens > 0 && tokens > background ? \"background\" : undefined;\n    if (over === undefined || selectCut(view, policy.keepRecentTokens) === undefined)\n        return undefined;\n    return over;\n}\n/** Error text for a generation whose blocking compaction ended without completing. */\nfunction compactionFailure(outcome) {\n    switch (outcome.status) {\n        case \"failed\":\n        case \"faulted\":\n            return `Compaction failed: ${outcome.error.message}`;\n        case \"orphaned\":\n            return `Compaction failed: ${outcome.reason}`;\n        case \"aborted\":\n            return \"Compaction was aborted\";\n    }\n}\n/** Settle the run's inputs `unanswered` with `model_error` and fail with `text`. */\nasync function failModelError(runtime, text, context) {\n    await runtime.commit(async (tx) => {\n        const live = await tx.doc(LiveDoc, runtime.conversationId);\n        endRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"model_error\", detail: text });\n        return {\n            status: \"terminal\",\n            outcome: { status: \"failed\", error: { message: text, detail: { reason: \"model_error\" } } },\n        };\n    }, context);\n}\n/** Settle the run's inputs `unanswered` with `no_model` and fail. */\nasync function failNoModel(runtime, ref, context) {\n    const message = ref === undefined ? \"No model is configured\" : `Model ${ref.provider}/${ref.modelId} is not available`;\n    await runtime.commit(async (tx) => {\n        const live = await tx.doc(LiveDoc, runtime.conversationId);\n        endRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"no_model\" });\n        return { status: \"terminal\", outcome: { status: \"failed\", error: { message, detail: { reason: \"no_model\" } } } };\n    }, context);\n}\n/**\n * Append a committed partial left by an interrupted, aborted, faulted, or orphaned attempt as an aborted assistant\n * entry; the caller replaces or removes `generation`.\n */\nexport async function convertPartial(tx, live, conversationId) {\n    const partial = live.generation?.message;\n    if (partial === undefined)\n        return;\n    const message = copyJson(partial);\n    await appendAssistant(tx, conversationId, { ...message, stopReason: \"aborted\" });\n}\n/**\n * Stream one request and return the terminal message. Partials commit as trailing writes at most every\n * `progress.partialIntervalMs` (default 100 ms) with one commit in flight; `finally` stops the throttle and awaits that\n * commit, so no stale partial lands after the outcome.\n */\nasync function streamResponse(runtime, model, messages, options, attempt, context) {\n    const interval = runtime.settings.progress.partialIntervalMs;\n    let pending;\n    let timer;\n    let inFlight;\n    let stopped = false;\n    const flush = () => {\n        timer = undefined;\n        const partial = pending;\n        pending = undefined;\n        if (partial === undefined || stopped)\n            return;\n        inFlight = (async () => {\n            // Copy synchronously: the provider keeps mutating its partial.\n            const message = copyJson(partial, { omitUndefinedProperties: true });\n            await runtime.commit(async (tx) => {\n                const live = await tx.doc(LiveDoc, runtime.conversationId);\n                live.generation ??= { attempt };\n                assignJson(live.generation, \"message\", message);\n                return undefined;\n            }, context);\n        })()\n            .catch((error) => {\n            // Rejections after an abort mark or close are expected; the committed state stays consistent.\n            if (!runtime.signal.aborted)\n                runtime.report(error);\n        })\n            .finally(() => {\n            inFlight = undefined;\n            if (pending !== undefined && !stopped)\n                timer = setTimeout(flush, interval);\n        });\n    };\n    try {\n        const events = runtime.models.streamSimple(model, { messages: [...messages] }, options);\n        for await (const event of events) {\n            // A partial without content, such as pi-ai's opening `start` event, shows nothing; a deferred response\n            // never gets past it, so it never leaves a partial.\n            if (event.type === \"done\" || event.type === \"error\" || event.partial.content.length === 0)\n                continue;\n            pending = event.partial;\n            if (timer === undefined && inFlight === undefined)\n                timer = setTimeout(flush, interval);\n        }\n        return await events.result();\n    }\n    finally {\n        stopped = true;\n        clearTimeout(timer);\n        await inFlight;\n    }\n}\n/** Classify a terminal provider message in one commit that also clears the partial. */\nasync function classify(runtime, request, message, context) {\n    // An abort mark or close: the abort invocation or the reopened run handles the committed state.\n    runtime.signal.throwIfAborted();\n    const conversationId = runtime.conversationId;\n    const { attempt, compacted, model: ref, cutoff } = request;\n    if (message.stopReason === \"deferred\" && message.deferred !== undefined) {\n        const handle = message.deferred;\n        const pollAt = Math.max(runtime.now() + (handle.pollAfterMs ?? DEFAULT_POLL_AFTER_MS), request.pollAt === undefined ? Number.NEGATIVE_INFINITY : request.pollAt + 1);\n        await runtime.commit(async (tx) => {\n            (await tx.doc(LiveDoc, conversationId)).generation = { attempt, deferred: { pollAt } };\n            const checkpoint = {\n                phase: \"poll\",\n                attempt,\n                ...(compacted === undefined ? {} : { compacted }),\n                model: ref,\n                cutoff,\n                handle,\n                pollAt,\n            };\n            return { status: \"running\", checkpoint };\n        }, context);\n        return;\n    }\n    await runtime.hooks.each(\"afterResponse\", (hook) => hook(message, runtime, context));\n    const calls = message.content.filter((content) => content.type === \"toolCall\");\n    if (message.stopReason === \"toolUse\" && calls.length > 0) {\n        return startToolRound(runtime, request, message, calls, context);\n    }\n    if (message.stopReason === \"stop\" || message.stopReason === \"length\" || message.stopReason === \"toolUse\") {\n        return answer(runtime, message, context);\n    }\n    // The retry and compaction policies govern the next attempt, so they are read now rather than pinned at preparation.\n    const settings = runtime.settings;\n    const overflow = message.stopReason === \"error\" && isContextOverflow(message);\n    if (overflow && compacted === undefined && settings.compaction.enabled) {\n        const policy = settings.compaction;\n        const view = await runtime.context(conversationId, context, { at: cutoff });\n        if (selectCut(view, policy.keepRecentTokens) !== undefined) {\n            const text = message.errorMessage ?? \"Context overflow\";\n            await runtime.commit(async (tx) => {\n                const live = await tx.doc(LiveDoc, conversationId);\n                await appendAssistant(tx, conversationId, message);\n                delete live.generation;\n                const child = await createCompaction(tx, conversationId, { reason: \"overflow\" }, runtime.taskId);\n                const checkpoint = { phase: \"prepare\", attempt, compacted: child, overflow: text };\n                return { status: \"waiting\", checkpoint, on: [child], policy: \"allSettled\" };\n            }, context);\n            return;\n        }\n    }\n    const policy = settings.retry;\n    // An overflow is never retried: only a compaction can make the next request fit.\n    const retry = message.stopReason === \"error\" &&\n        !overflow &&\n        isRetryableAssistantError(message) &&\n        policy.enabled &&\n        attempt <= policy.maxRetries;\n    const until = retry ? runtime.now() + retryDelayMs(policy, attempt) : 0;\n    await runtime.commit(async (tx) => {\n        const live = await tx.doc(LiveDoc, conversationId);\n        await appendAssistant(tx, conversationId, message);\n        if (retry) {\n            live.generation = { attempt, retry: { at: until, error: message.errorMessage ?? \"\" } };\n            const checkpoint = {\n                phase: \"retry\",\n                attempt,\n                ...(compacted === undefined ? {} : { compacted }),\n                until,\n            };\n            return { status: \"running\", checkpoint };\n        }\n        const text = message.errorMessage ?? `Model response ended with stop reason ${message.stopReason}`;\n        endRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"model_error\", detail: text });\n        return {\n            status: \"terminal\",\n            outcome: { status: \"failed\", error: { message: text, detail: { reason: \"model_error\" } } },\n        };\n    }, context);\n}\n/**\n * A final answer; the final boundary places queued items (spec §6). The first `onYield` continuation appends a user\n * message and hands the run to a successor generation, but only when the boundary selected no user item and no reset.\n * Otherwise the run's inputs settle `done`, and selected user items start the next run.\n */\nasync function answer(runtime, message, context) {\n    let continuation;\n    await runtime.hooks.each(\"onYield\", async (hook) => {\n        if (continuation !== undefined)\n            return;\n        continuation = (await hook(message, runtime, context))?.continue;\n    });\n    const conversationId = runtime.conversationId;\n    await runtime.commit(async (tx) => {\n        // Queue modes are read on the Session line, when the boundary is decided.\n        const boundary = await prepareBoundary(tx, conversationId, runtime.settings);\n        const live = await tx.doc(LiveDoc, conversationId);\n        const entry = await appendAssistant(tx, conversationId, message);\n        const result = { status: \"terminal\", outcome: { status: \"completed\", result: { entryId: entry.id } } };\n        const { users, reset } = await applyBoundary(tx, boundary, \"final\", runtime.now());\n        if (continuation !== undefined && users.length === 0 && !reset) {\n            const user = { role: \"user\", content: continuation, timestamp: runtime.now() };\n            await tx.appendEntry(UserEntry, conversationId, { model: [user] });\n            handOver(live, runtime.taskId, await createGeneration(tx, conversationId));\n            delete live.generation;\n            return result;\n        }\n        endRun(tx, live, runtime.taskId, { status: \"done\", answer: entry.id });\n        if (users.length > 0)\n            await startRun(tx, conversationId, live, users);\n        return result;\n    }, context);\n}\n/**\n * Append the tool-calling answer and start its tool round in one commit (spec §8.3). A call to a tool the request did\n * not offer gets its `tool_unavailable` result here; every other call gets a tool task owned by the generation, only the\n * first one now when the round is sequential. The generation then waits for them in its `tools` phase, keeping the run.\n */\nasync function startToolRound(runtime, request, message, calls, context) {\n    const conversationId = runtime.conversationId;\n    const messages = request.messages ?? (await runtime.context(conversationId, context, { at: request.cutoff })).messages;\n    const offered = new Set(getCurrentTools(messages).map((tool) => tool.name));\n    // Read as the round starts; a tool is resolved as its tool task resolves it.\n    const tools = (await runtime.agent(context)).tools;\n    const sequential = runtime.settings.toolExecution === \"sequential\" ||\n        calls.some((call) => offered.has(call.name) && tools.find((tool) => tool.name === call.name)?.executionMode === \"sequential\");\n    await runtime.commit(async (tx) => {\n        const live = await tx.doc(LiveDoc, conversationId);\n        const entry = await appendAssistant(tx, conversationId, message);\n        const slots = [];\n        const tools = [];\n        const pending = [];\n        for (const call of calls) {\n            if (!offered.has(call.name)) {\n                const unavailable = harnessError(\"tool_unavailable\", `Tool ${call.name} is not available`);\n                const result = await appendToolResult(tx, conversationId, call, unavailable, { timestamp: runtime.now() });\n                slots.push({ callId: call.id, name: call.name, status: \"done\", entry: result.id });\n                continue;\n            }\n            if (sequential && tools.length > 0) {\n                pending.push(call.id);\n                slots.push({ callId: call.id, name: call.name, status: \"pending\" });\n                continue;\n            }\n            const taskId = await createToolTask(tx, runtime, entry.id, call.id);\n            tools.push(taskId);\n            slots.push({ callId: call.id, name: call.name, taskId, status: \"pending\" });\n        }\n        delete live.generation;\n        live.tools = slots;\n        const checkpoint = { phase: \"tools\", assistant: entry.id, tools, pending };\n        return { status: \"waiting\", checkpoint, on: tools, policy: \"allSettled\" };\n    }, context);\n}\n/**\n * The round's tools are terminal: apply their controls and either end the run at the final boundary (`terminate`,\n * `handoff`, or a queued reset) or hand it to the next generation at the `postTools` boundary (spec §8.5).\n */\nasync function finishToolRound(runtime, assistant, tools, context) {\n    const conversationId = runtime.conversationId;\n    const controls = new Map();\n    const outcomes = await runtime.outcomes(tools, context);\n    tools.forEach((id, index) => {\n        const outcome = outcomes[index];\n        // Version 1 results have no kind; every result a generation's round reads is a model-issued call's.\n        controls.set(id, outcome.status === \"completed\" && outcome.result.kind !== \"nested\" ? outcome.result.control : undefined);\n    });\n    const slots = (await runtime.snapshot(LiveDoc, conversationId, context))?.tools ?? [];\n    const results = slots.flatMap((slot) => (slot.entry === undefined ? [] : [slot.entry]));\n    await runtime.hooks.each(\"afterTools\", (hook) => hook(assistant, results, runtime, context));\n    // Every call of the round, including those answered without a task, must ask to terminate.\n    const terminate = slots.length > 0 &&\n        slots.every((slot) => slot.taskId !== undefined && controls.get(slot.taskId)?.terminate === true);\n    const added = [...controls.values()].flatMap((control) => control?.addTools ?? []);\n    // The last handoff in call order wins.\n    const handoff = [...controls.values()].findLast((control) => control?.handoff !== undefined)?.handoff;\n    await runtime.commit(async (tx) => {\n        const boundary = await prepareBoundary(tx, conversationId, runtime.settings);\n        if (added.length > 0)\n            await addTools(tx, conversationId, added);\n        const live = await tx.doc(LiveDoc, conversationId);\n        const now = runtime.now();\n        if (terminate || handoff !== undefined) {\n            if (handoff !== undefined) {\n                const message = { role: \"user\", content: handoff, timestamp: now };\n                const entry = await tx.appendEntry(ResetEntry, conversationId, { head: \"self\", model: [message] });\n                boundary.head = entry.id;\n            }\n            const { users } = await applyBoundary(tx, boundary, \"final\", now);\n            endRun(tx, live, runtime.taskId, { status: \"done\", answer: assistant });\n            if (users.length > 0)\n                await startRun(tx, conversationId, live, users);\n        }\n        else {\n            const { users, reset } = await applyBoundary(tx, boundary, \"postTools\", now);\n            if (reset) {\n                // The queued reset cut the run's context before an answer.\n                endRun(tx, live, runtime.taskId, { status: \"unanswered\", reason: \"reset\" });\n                if (users.length > 0)\n                    await startRun(tx, conversationId, live, users);\n            }\n            else {\n                delete live.tools;\n                delete live.nestedTools;\n                if (live.run?.taskId === runtime.taskId)\n                    live.run.inputs.push(...users);\n                handOver(live, runtime.taskId, await createGeneration(tx, conversationId));\n            }\n        }\n        return { status: \"terminal\", outcome: { status: \"completed\", result: { entryId: assistant } } };\n    }, context);\n}\n/**\n * Append a provider result and add its usage to `pi.usage` in the same commit.\n * REMINDER: every built-in writer of assistant entries goes through here, so the usage ledger stays complete.\n */\nasync function appendAssistant(tx, conversationId, message) {\n    await recordUsage(tx, conversationId, \"models\", `${message.provider}/${message.model}`, message.usage);\n    return tx.appendEntry(AssistantEntry, conversationId, { model: [message] });\n}\n/** Start a run for `inputs`, placed input submissions: a new generation takes `pi.live.run`. */\nexport async function startRun(tx, conversationId, live, inputs) {\n    live.run = { taskId: await createGeneration(tx, conversationId), inputs };\n}\n/** A generation owned by its conversation. */\nfunction createGeneration(tx, conversationId) {\n    return tx.createTask(GenerationTask, {}, { ownership: { kind: \"conversation\" }, conversationId });\n}\n/** Hand run control from `from` to `to`; the run's inputs move with it. */\nexport function handOver(live, from, to) {\n    if (live.run?.taskId === from)\n        live.run.taskId = to;\n}\n//# sourceMappingURL=generation.js.map","import { defineDoc } from \"../documents.js\";\nimport { convertPartial } from \"./generation.js\";\nexport const LiveDoc = defineDoc({\n    kind: \"pi.live\",\n    version: 1,\n    scope: \"conversation\",\n    history: \"latest\",\n    fork: \"initial\",\n    initial: () => ({}),\n    // REMINDER: a complete base whenever nothing runs (spec §8.2): no generation and no running tool slot. That holds\n    // while idle, in the commit handing a generation over to its tool round, and between tools, so the delta chain\n    // spans at most one generation or the overlapping execution of one round's tools. A slot holds output only while\n    // running, so every base is small; a nested call's result lives in its caller's task documents, never here. Do not\n    // add a delta-count bound; the tool output benchmark checks this rule.\n    checkpointWhen: (value) => value.generation === undefined &&\n        !(value.tools ?? []).some((slot) => slot.status === \"running\") &&\n        !(value.nestedTools ?? []).some((slot) => slot.status === \"running\"),\n});\n/** Built-in task kinds that can own `pi.live.run`. */\nconst RUN_TASK_KINDS = new Set([\"pi.generation\"]);\nconst TOOL_TASK_KIND = \"pi.tool\";\nconst COMPACTION_TASK_KIND = \"pi.compaction\";\n/**\n * End the run owned by `taskId`: settle each of its inputs and remove `run`. Always removes `generation`, `tools`, and\n * `nestedTools`, whose presentation belongs to the ending run.\n */\nexport function endRun(tx, live, taskId, settlement) {\n    if (live.run?.taskId === taskId) {\n        for (const id of live.run.inputs)\n            tx.settleSubmission(id, settlement);\n        delete live.run;\n    }\n    delete live.generation;\n    delete live.tools;\n    delete live.nestedTools;\n}\n/** Add the status of a compaction task created in this commit; statuses stay in task ID order. */\nexport function addCompactionStatus(live, status) {\n    live.compactions ??= [];\n    live.compactions.push(status);\n}\n/** The status of compaction task `taskId`, if listed. */\nexport function compactionStatus(live, taskId) {\n    return live.compactions?.find((status) => status.taskId === taskId);\n}\n/** Remove the status of compaction task `taskId`, and the list once empty. */\nexport function removeCompactionStatus(live, taskId) {\n    const statuses = live.compactions;\n    if (statuses === undefined)\n        return;\n    const index = statuses.findIndex((status) => status.taskId === taskId);\n    if (index >= 0)\n        statuses.splice(index, 1);\n    if (statuses.length === 0)\n        delete live.compactions;\n}\n/** Remove the status of compaction task `taskId` and record that it failed with `error`. */\nexport function failCompactionStatus(live, taskId, error) {\n    const status = compactionStatus(live, taskId);\n    if (status !== undefined)\n        live.compactionFailure = { taskId: status.taskId, reason: status.reason, error };\n    removeCompactionStatus(live, taskId);\n}\n/**\n * The slot of tool task `taskId`, model-issued or nested, if `pi.live` still lists it. Nested slots are found by binary\n * search: a tool may make thousands of nested calls, each of which looks up its slot in several commits, and every\n * element a search reads costs a node in the draft's change tracker. Their task IDs ascend: each slot is appended in\n * the commit that creates its task, task IDs ascend in commit order, and removal keeps the order.\n */\nexport function toolSlot(live, taskId) {\n    const slot = live.tools?.find((each) => each.taskId === taskId);\n    if (slot !== undefined || live.nestedTools === undefined)\n        return slot;\n    const nested = live.nestedTools;\n    let low = 0;\n    let high = nested.length - 1;\n    while (low <= high) {\n        const middle = (low + high) >>> 1;\n        const candidate = nested[middle];\n        if (candidate.taskId === taskId)\n            return candidate;\n        if (candidate.taskId < taskId)\n            low = middle + 1;\n        else\n            high = middle - 1;\n    }\n    return undefined;\n}\n/**\n * Mark a slot done and clear its running output; the caller sets a model-issued call's result `entry`, or a nested\n * call's `summary`. Neither is set when the task faulted or was orphaned.\n */\nexport function finishSlot(slot) {\n    slot.status = \"done\";\n    clearProgress(slot);\n}\n/** Remove the nested slots below tool task `taskId`, transitively; the list holds parents before their children. */\nexport function removeNestedSlots(live, taskId) {\n    const nested = live.nestedTools;\n    if (nested === undefined)\n        return;\n    const removed = new Set([taskId]);\n    for (const slot of nested)\n        if (removed.has(slot.parentTaskId))\n            removed.add(slot.taskId);\n    for (let index = nested.length - 1; index >= 0; index--) {\n        if (removed.has(nested[index].parentTaskId))\n            nested.splice(index, 1);\n    }\n    if (nested.length === 0)\n        delete live.nestedTools;\n}\n/** Remove what a tool published while running; its result entry or a rerun replaces it. */\nexport function clearProgress(slot) {\n    delete slot.output;\n    delete slot.droppedBytes;\n    delete slot.droppedLines;\n    delete slot.details;\n    delete slot.diagnostics;\n}\n/**\n * Harness cleanup for a terminal outcome the scheduler writes itself (`faulted` or `orphaned`). A run task ends its\n * run; a tool task's slot is marked done without an entry, and context derivation synthesizes the missing result; a\n * compaction task's status is removed and its failure recorded.\n * Ignores other kinds so it never creates `pi.live` elsewhere. The scheduler calls this without knowing task kinds;\n * the Harness passes it in (spec §5.4).\n * REMINDER: a committed generation partial becomes an aborted assistant entry here, exactly as in the generation abort\n * handler, so the transcript keeps what the model produced and `pi.usage` counts its spend. The scheduler's commit has\n * no task scope, so that entry has no `byTaskId`. Faults come from task bugs\n * or malformed provider data (a non-JSON value in a response), or a commit the Storage rejected without effect; an\n * uncertain storage failure poisons the Session instead and writes no outcome.\n */\nexport async function settleSchedulerOutcome(tx, record, outcome) {\n    if (record.kind === TOOL_TASK_KIND) {\n        const live = await tx.doc(LiveDoc, record.conversationId);\n        const slot = toolSlot(live, record.id);\n        if (slot !== undefined)\n            finishSlot(slot);\n        removeNestedSlots(live, record.id);\n        return;\n    }\n    if (record.kind === COMPACTION_TASK_KIND) {\n        const error = outcome.status === \"faulted\" ? outcome.error.message : outcome.reason;\n        failCompactionStatus(await tx.doc(LiveDoc, record.conversationId), record.id, error);\n        return;\n    }\n    if (!RUN_TASK_KINDS.has(record.kind))\n        return;\n    const live = await tx.doc(LiveDoc, record.conversationId);\n    if (live.run?.taskId !== record.id)\n        return;\n    await convertPartial(tx, live, record.conversationId);\n    endRun(tx, live, record.id, outcome.status === \"faulted\"\n        ? { status: \"unanswered\", reason: \"faulted\", detail: outcome.error.message }\n        : { status: \"unanswered\", reason: outcome.reason });\n}\n//# sourceMappingURL=live.js.map","import { SessionFailed } from \"../errors.js\";\n/** Pending waits by key. Each settles once: through `resolve`, `rejectAll`, or cancellation of its context. */\nexport class Waiters {\n    #sets = new Map();\n    add(key, context) {\n        const signal = context.abortSignal;\n        if (signal?.aborted)\n            return Promise.reject(signal.reason);\n        const waiter = Promise.withResolvers();\n        const set = this.#sets.get(key) ?? new Set();\n        this.#sets.set(key, set.add(waiter));\n        if (signal !== undefined) {\n            const onAbort = () => {\n                set.delete(waiter);\n                if (set.size === 0 && this.#sets.get(key) === set)\n                    this.#sets.delete(key);\n                waiter.reject(signal.reason);\n            };\n            signal.addEventListener(\"abort\", onAbort, { once: true });\n            const detach = () => signal.removeEventListener(\"abort\", onAbort);\n            waiter.promise.then(detach, detach);\n        }\n        return waiter.promise;\n    }\n    keys() {\n        return [...this.#sets.keys()];\n    }\n    resolve(key, value) {\n        const set = this.#sets.get(key);\n        this.#sets.delete(key);\n        for (const waiter of set ?? [])\n            waiter.resolve(value);\n    }\n    rejectAll(error) {\n        const sets = [...this.#sets.values()];\n        this.#sets.clear();\n        for (const set of sets)\n            for (const waiter of set)\n                waiter.reject(error);\n    }\n}\n/** Every item of a paginated scan, in page order. */\nexport async function scanAll(scan) {\n    const items = [];\n    let cursor;\n    do {\n        const page = await scan(cursor);\n        items.push(...page.items);\n        cursor = page.next;\n    } while (cursor !== undefined);\n    return items;\n}\n/** What a closed Harness rejects with: `SessionFailed` with the cause when it closed because the Session failed. */\nexport function closedError(session) {\n    const failure = session.failure;\n    return failure === undefined ? new Error(\"Harness is closed\") : new SessionFailed(failure.error);\n}\n//# sourceMappingURL=util.js.map","import { copyJson } from \"@earendil-works/chord\";\nimport { ConversationBusy } from \"../errors.js\";\nimport { startRun } from \"./generation.js\";\nimport { appendInput, applyBoundary, hasQueuedReset, InboxDoc, isDisplayOnly, isStale, pickInputEntry, prepareBoundary, removeInboxItem, } from \"./inbox.js\";\nimport { LiveDoc } from \"./live.js\";\nimport { closedError, Waiters } from \"./util.js\";\n/** Admission, waits, and withdrawal of the durable submissions of one Harness. */\nexport class Submissions {\n    #session;\n    #storage;\n    #now;\n    /** Read at each admission, on the Session line. */\n    #queueModes;\n    /** Enable task scheduling; submitting or waiting asks for progress. */\n    #resume;\n    #waiters = new Waiters();\n    #closed = false;\n    constructor(session, storage, now, queueModes, resume) {\n        this.#session = session;\n        this.#storage = storage;\n        this.#now = now;\n        this.#queueModes = queueModes;\n        this.#resume = resume;\n        session.observeCommits((publication) => this.#observe(publication));\n        session.subscribeClose(() => {\n            this.#closed = true;\n            this.#waiters.rejectAll(closedError(this.#session));\n        });\n    }\n    /** Admit a submission in one commit; see `admitSubmission()`. */\n    async submit(conversationId, draft, context) {\n        this.#resume();\n        const id = await this.#session.commitWith((tx) => admitSubmission(tx, conversationId, draft, this.#now(), this.#queueModes()), context);\n        return new SubmissionHandle(id, this);\n    }\n    /** Handle for an existing submission, or `undefined`. */\n    async get(id, context) {\n        const record = await this.#session.readOnLine(() => this.#storage.submission(id, context));\n        return record === undefined ? undefined : new SubmissionHandle(record.id, this);\n    }\n    async status(id, context) {\n        const record = await this.#session.readOnLine(() => this.#storage.submission(id, context));\n        if (record === undefined)\n            throw new Error(`Submission ${id} does not exist`);\n        return record;\n    }\n    async wait(id, context) {\n        this.#resume();\n        // Check and register on the line so no settling publication falls between them.\n        const found = await this.#session.readOnLine(async () => {\n            const record = await this.#storage.submission(id, context);\n            if (record === undefined)\n                throw new Error(`Submission ${id} does not exist`);\n            if (isSettled(record))\n                return { promise: Promise.resolve(record) };\n            // Close rejects registered waiters synchronously and may begin during the read.\n            if (this.#closed)\n                throw closedError(this.#session);\n            return { promise: this.#waiters.add(id, context) };\n        });\n        return found.promise;\n    }\n    /** Withdraw a queued submission and remove its inbox item; placed inputs and settled submissions are reported. */\n    abort(id, context, conversationId) {\n        return this.#session.commitWith(async (tx) => {\n            const record = await tx.submission(id);\n            if (record === undefined || (conversationId !== undefined && record.conversationId !== conversationId)) {\n                return \"not_found\";\n            }\n            if (record.status === \"queued\") {\n                tx.settleSubmission(id, { status: \"unanswered\", reason: \"aborted\" });\n                await removeInboxItem(tx, record.conversationId, id);\n                return \"aborted\";\n            }\n            return record.status === \"placed\" ? \"already_placed\" : \"settled\";\n        }, context);\n    }\n    #observe(publication) {\n        for (const change of publication.changes) {\n            if (change.type !== \"submission\" || !isSettled(change.value))\n                continue;\n            this.#waiters.resolve(change.value.id, change.value);\n        }\n    }\n}\nclass SubmissionHandle {\n    id;\n    #submissions;\n    constructor(id, submissions) {\n        this.id = id;\n        this.#submissions = submissions;\n    }\n    status(context) {\n        return this.#submissions.status(this.id, context);\n    }\n    wait(context) {\n        return this.#submissions.wait(this.id, context);\n    }\n    async abort(context) {\n        const result = await this.#submissions.abort(this.id, context);\n        if (result === \"not_found\")\n            throw new Error(`Submission ${this.id} does not exist`);\n        return result;\n    }\n}\nfunction isSettled(record) {\n    return record.status === \"done\" || record.status === \"unanswered\";\n}\n/** Reject an input entry an untyped caller got wrong: its kind must be a non-empty string outside the `pi.` prefix. */\nfunction checkInputEntry(entry) {\n    const { kind } = entry;\n    if (typeof kind !== \"string\" || kind.length === 0 || kind.startsWith(\"pi.\")) {\n        throw new TypeError(`An input entry's kind must be a non-empty string not starting with \"pi.\", got ${String(kind)}`);\n    }\n}\n/**\n * Admit a submission inside a commit (spec §6); `Conversation.submit()` and conversation-owned compactions share it. A\n * known request ID returns its existing submission without writing. A display-only write (only `kind` and `data`) is\n * appended and settled `done` at once, busy or not, as it changes nothing the model sees; only behind a queued reset it\n * queues, so it lands after the reset instead of before it in the context the reset ends. A busy conversation queues anything else in\n * `pi.inbox`, or rejects `whenBusy: \"reject\"` input with `ConversationBusy`. An idle conversation with queued items\n * queues it behind them and runs a final boundary. Otherwise idle input places its entry (`pi.user`, or the input's\n * own) and starts a run, and an idle write appends its entry and settles `done`, or `stale` when its head reaches\n * before the active range.\n */\nexport async function admitSubmission(tx, conversationId, draft, now, queueModes) {\n    if (draft.type === \"input\" && draft.entry !== undefined)\n        checkInputEntry(draft.entry);\n    if (draft.requestId !== undefined) {\n        const existing = await tx.submissionByRequest(conversationId, draft.requestId);\n        if (existing !== undefined) {\n            if (existing.type !== draft.type) {\n                throw new Error(`Request ${draft.requestId} already identifies a submission of type ${existing.type}`);\n            }\n            return existing.id;\n        }\n    }\n    const requestId = draft.requestId === undefined ? {} : { requestId: draft.requestId };\n    if (draft.type === \"write\" &&\n        isDisplayOnly(draft.entry) &&\n        !hasQueuedReset((await tx.doc(InboxDoc, conversationId)).items)) {\n        const entry = await tx.appendEntry(conversationId, draft.entry);\n        const write = { conversationId, ...requestId, type: \"write\", status: \"done\", entry: entry.id };\n        return (await tx.createSubmission(write)).id;\n    }\n    const live = await tx.doc(LiveDoc, conversationId);\n    const busy = live.run !== undefined;\n    if (busy && draft.type === \"input\" && draft.whenBusy === \"reject\")\n        throw new ConversationBusy(conversationId);\n    // A boundary reads the table, so it is prepared before the first table write; a busy one needs none.\n    const boundary = busy ? undefined : await prepareBoundary(tx, conversationId, queueModes);\n    if (boundary === undefined || boundary.inbox.items.length > 0) {\n        const { id } = await tx.createSubmission({\n            conversationId,\n            ...requestId,\n            type: draft.type,\n            status: \"queued\",\n        });\n        // Hosts may leave optional fields `undefined`; drafts take strict JSON.\n        const value = copyJson(draft.type === \"write\" ? draft.entry : draft.content, {\n            omitUndefinedProperties: true,\n        });\n        const items = (boundary?.inbox ?? (await tx.doc(InboxDoc, conversationId))).items;\n        if (draft.type === \"write\")\n            items.push({ id, mode: \"write\", entry: value });\n        else {\n            const mode = draft.whenBusy === \"steer\" ? \"steer\" : \"followUp\";\n            const content = value;\n            const entry = draft.entry === undefined ? {} : { entry: pickInputEntry(draft.entry) };\n            items.push({ id, mode, content, ...entry });\n        }\n        if (boundary === undefined)\n            return id;\n        const { users } = await applyBoundary(tx, boundary, \"final\", now);\n        if (users.length > 0)\n            await startRun(tx, conversationId, live, users);\n        return id;\n    }\n    if (draft.type === \"write\") {\n        if (isStale(boundary, draft.entry)) {\n            const stale = { status: \"unanswered\", reason: \"stale\" };\n            return (await tx.createSubmission({ conversationId, ...requestId, type: \"write\", ...stale })).id;\n        }\n        const entry = await tx.appendEntry(conversationId, draft.entry);\n        const write = { conversationId, ...requestId, type: \"write\", status: \"done\", entry: entry.id };\n        return (await tx.createSubmission(write)).id;\n    }\n    const entry = await appendInput(tx, conversationId, draft.content, draft.entry, now);\n    const input = { conversationId, ...requestId, type: \"input\", status: \"placed\", entry: entry.id };\n    const { id } = await tx.createSubmission(input);\n    await startRun(tx, conversationId, live, [id]);\n    return id;\n}\n//# sourceMappingURL=submissions.js.map","import { calculateContextTokens, estimateMessageTokens } from \"@earendil-works/pi-ai/utils/estimate\";\nimport { isRetryableAssistantError, retryDelayMs } from \"@earendil-works/pi-ai/utils/retry\";\nimport { CompactionEntry } from \"../entries.js\";\nimport { defineTask } from \"../tasks.js\";\nimport { orderToolResults } from \"./context.js\";\nimport { addCompactionStatus, compactionStatus, failCompactionStatus, LiveDoc, removeCompactionStatus, } from \"./live.js\";\nimport { ensureProviderSessionId } from \"./provider.js\";\nimport { admitSubmission } from \"./submissions.js\";\nimport { recordUsage } from \"./usage.js\";\n/** Longest tool result text a serialized summary source keeps. */\nconst TOOL_RESULT_MAX_CHARS = 2000;\nconst SUMMARY_PREFIX = \"The conversation history before this point was compacted into the following summary:\\n\\n<summary>\\n\";\nconst SUMMARY_SUFFIX = \"\\n</summary>\";\nconst SUMMARIZATION_SYSTEM_PROMPT = `You are a context summarization assistant. Your task is to read a conversation between a user and an AI assistant, then produce a structured summary following the exact format specified.\n\nDo NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`;\nconst SUMMARIZATION_PROMPT = `The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work. If the conversation starts with an earlier summary, preserve its information and fold the newer messages into it.\n\nUse this EXACT format:\n\n## Goal\n[What is the user trying to accomplish? Can be multiple items if the session covers different tasks.]\n\n## Constraints & Preferences\n- [Any constraints, preferences, or requirements mentioned by user]\n- [Or \"(none)\" if none were mentioned]\n\n## Progress\n### Done\n- [x] [Completed tasks/changes]\n\n### In Progress\n- [ ] [Current work]\n\n### Blocked\n- [Issues preventing progress, if any]\n\n## Key Decisions\n- **[Decision]**: [Brief rationale]\n\n## Next Steps\n1. [Ordered list of what should happen next]\n\n## Critical Context\n- [Any data, examples, or references needed to continue]\n- [Or \"(none)\" if not applicable]\n\nKeep each section concise. Preserve exact file paths, function names, and error messages.`;\n/**\n * Built-in compaction task (spec §8.7): select an old prefix of the model context, summarize it, and place a summary\n * entry whose `head` is the first kept entry. A compaction the generation owns blocks it and appends directly; a\n * conversation-owned one places its summary through a write submission.\n */\nexport const CompactionTask = defineTask({\n    name: \"pi.compaction\",\n    version: 1,\n    initial: () => ({ phase: \"select\" }),\n    phases: {\n        select: async (task, runtime, context) => {\n            const { conversationId } = runtime;\n            const agent = await runtime.agent(context);\n            const settings = runtime.settings;\n            const ref = agent.model;\n            const model = ref === undefined ? undefined : runtime.models.getModel(ref.provider, ref.modelId);\n            if (ref === undefined || model === undefined)\n                return failNoModel(runtime, ref, context);\n            const policy = settings.compaction;\n            const view = await runtime.context(conversationId, context);\n            const cut = selectCut(view, policy.keepRecentTokens);\n            if (cut === undefined)\n                return complete(runtime, context);\n            const firstKept = view.entries[cut].id;\n            const { reason, instructions } = task.input;\n            const compaction = {\n                reason,\n                entries: view.entries.slice(0, cut),\n                messages: summarizedMessages(view, cut),\n                firstKept,\n                ...(instructions === undefined ? {} : { instructions }),\n            };\n            let decision;\n            await runtime.hooks.each(\"beforeCompact\", async (hook) => {\n                if (decision === undefined)\n                    decision = await hook(compaction, runtime, context);\n            });\n            if (decision !== undefined && \"decline\" in decision)\n                return complete(runtime, context);\n            if (decision !== undefined)\n                return place(runtime, firstKept, decision.summary, context);\n            const request = {\n                attempt: 1,\n                model: ref,\n                thinkingLevel: agent.thinkingLevel,\n                streamOptions: settings.stream,\n                maxTokens: Math.min(Math.floor(0.8 * policy.reserveTokens), model.maxTokens > 0 ? model.maxTokens : Number.POSITIVE_INFINITY),\n                tail: view.entries.reduce((tail, entry) => (entry.id > tail ? entry.id : tail), firstKept),\n                firstKept,\n            };\n            await runtime.commit(() => ({ status: \"running\", checkpoint: { phase: \"summarize\", ...request } }), context);\n        },\n        summarize: async (task, runtime, context) => {\n            const { phase: _, ...request } = task.state.checkpoint;\n            const { model: ref, thinkingLevel, streamOptions, maxTokens, tail, firstKept, attempt } = request;\n            const model = runtime.models.getModel(ref.provider, ref.modelId);\n            if (model === undefined)\n                return failNoModel(runtime, ref, context);\n            // The context at `tail` is immutable, so this is the range `select` chose.\n            const view = await runtime.context(runtime.conversationId, context, { at: tail });\n            const cut = view.entries.findIndex((entry) => entry.id === firstKept);\n            const now = runtime.now();\n            const messages = [\n                { role: \"system\", content: SUMMARIZATION_SYSTEM_PROMPT, timestamp: now },\n                {\n                    role: \"user\",\n                    content: [{ type: \"text\", text: summaryPrompt(summarizedMessages(view, cut), task.input.instructions) }],\n                    timestamp: now,\n                },\n            ];\n            const { deferred: _deferred, ...forwarded } = streamOptions;\n            const options = {\n                ...forwarded,\n                cacheRetention: \"none\",\n                maxTokens,\n                signal: runtime.signal,\n                sessionId: await ensureProviderSessionId(runtime, context),\n                ...(thinkingLevel === \"off\" ? {} : { reasoning: thinkingLevel }),\n            };\n            const message = await runtime.models.completeSimple(model, { messages }, options);\n            // An abort mark or close: the abort invocation or the reopened task handles the committed state.\n            runtime.signal.throwIfAborted();\n            const summary = summaryText(message);\n            const policy = runtime.settings.retry;\n            const retry = message.stopReason === \"error\" &&\n                isRetryableAssistantError(message) &&\n                policy.enabled &&\n                attempt <= policy.maxRetries;\n            const until = retry ? runtime.now() + retryDelayMs(policy, attempt) : 0;\n            await runtime.commit(async (tx, current) => {\n                await recordUsage(tx, runtime.conversationId, \"models\", `${message.provider}/${message.model}`, message.usage);\n                const live = await tx.doc(LiveDoc, runtime.conversationId);\n                if (summary !== undefined)\n                    return placeSummary(tx, runtime, current, live, firstKept, summary);\n                if (retry) {\n                    const status = compactionStatus(live, runtime.taskId);\n                    if (status !== undefined)\n                        status.retry = { at: until, error: message.errorMessage ?? \"\" };\n                    return { status: \"running\", checkpoint: { phase: \"retry\", ...request, until } };\n                }\n                const text = summaryFailure(message);\n                failCompactionStatus(live, runtime.taskId, text);\n                return {\n                    status: \"terminal\",\n                    outcome: { status: \"failed\", error: { message: text, detail: { reason: \"model_error\" } } },\n                };\n            }, context);\n        },\n        retry: async (task, runtime, context) => {\n            const { phase: _, until, ...request } = task.state.checkpoint;\n            await runtime.sleep(until, context);\n            const attempt = request.attempt + 1;\n            await runtime.commit(async (tx) => {\n                const status = compactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId);\n                if (status !== undefined) {\n                    status.attempt = attempt;\n                    delete status.retry;\n                }\n                return { status: \"running\", checkpoint: { phase: \"summarize\", ...request, attempt } };\n            }, context);\n        },\n    },\n    abort: async (_task, runtime, context) => {\n        await runtime.commit(async (tx) => {\n            removeCompactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId);\n            return { status: \"terminal\", outcome: { status: \"aborted\" } };\n        }, context);\n    },\n});\n/**\n * Create a compaction task with its status in this commit. `owner` is the generation that waits for it (a blocking\n * compaction); without one it is conversation-owned, and `background` unless it is manual.\n */\nexport async function createCompaction(tx, conversationId, input, owner) {\n    const ownership = owner === undefined ? { kind: \"conversation\" } : { kind: \"task\", taskId: owner };\n    const background = owner === undefined && input.reason !== \"manual\";\n    const taskId = await tx.createTask(CompactionTask, input, { ownership, conversationId, background });\n    const status = { taskId, reason: input.reason, blocking: owner !== undefined, attempt: 1 };\n    addCompactionStatus(await tx.doc(LiveDoc, conversationId), status);\n    return taskId;\n}\n/**\n * Index in `view.entries` of the first entry a summary keeps, or `undefined` when there is nothing to compact\n * (spec §8.7). Walks back from the tail until `keepRecentTokens` are kept, then cuts at the first candidate at or after\n * that entry: an entry whose contribution starts with a user or assistant message, never a tool result, and never a\n * user entry that a result of the preceding assistant's calls still follows.\n */\nexport function selectCut(view, keepRecentTokens) {\n    const { contributions } = view;\n    const start = view.head === undefined ? 0 : 1;\n    const candidates = [];\n    for (let index = start; index < contributions.length; index++) {\n        if (isCandidate(contributions, index))\n            candidates.push(index);\n    }\n    let kept = 0;\n    let cut;\n    for (let index = contributions.length - 1; index >= start; index--) {\n        for (const message of contributions[index])\n            kept += estimateMessageTokens(message);\n        if (kept < keepRecentTokens)\n            continue;\n        cut = candidates.find((candidate) => candidate >= index) ?? candidates.at(-1);\n        break;\n    }\n    if (cut === undefined)\n        return undefined;\n    for (let index = start; index < cut; index++)\n        if (contributions[index].length > 0)\n            return cut;\n    return undefined;\n}\nfunction isCandidate(contributions, index) {\n    const first = contributions[index][0];\n    if (first?.role === \"assistant\")\n        return true;\n    if (first?.role !== \"user\")\n        return false;\n    // A result of the preceding assistant's calls that follows this entry, before the next assistant, belongs before it.\n    let calls = new Set();\n    for (let before = index - 1; before >= 0; before--) {\n        const assistant = contributions[before].findLast((message) => message.role === \"assistant\");\n        if (assistant === undefined)\n            continue;\n        calls = new Set(assistant.content.flatMap((content) => (content.type === \"toolCall\" ? [content.id] : [])));\n        break;\n    }\n    if (calls.size === 0)\n        return true;\n    for (let after = index; after < contributions.length; after++) {\n        for (const [position, message] of contributions[after].entries()) {\n            if (message.role === \"assistant\" && (after > index || position > 0))\n                return true;\n            if (message.role === \"toolResult\" && calls.has(message.toolCallId))\n                return false;\n        }\n    }\n    return true;\n}\n/** Model messages of the entries before `cut`: the head marker first, ordered like model context (spec §2.1). */\nexport function summarizedMessages(view, cut) {\n    return orderToolResults(view.contributions.slice(0, cut).flat());\n}\n/**\n * Size of a request over `view` followed by `extra` (spec §8.3): the usage of the newest assistant appended after the\n * head marker, whose request included the marker, plus estimates of the messages after it; without one, estimates of\n * every message.\n */\nexport function estimateContext(view, extra) {\n    let measured;\n    const after = view.head?.id ?? Number.NEGATIVE_INFINITY;\n    for (let index = view.entries.length - 1; index >= 0 && measured === undefined; index--) {\n        if (view.entries[index].id <= after)\n            continue;\n        measured = view.contributions[index].findLast((message) => message.role === \"assistant\" && calculateContextTokens(message.usage) > 0);\n    }\n    const from = measured === undefined ? 0 : view.messages.lastIndexOf(measured) + 1;\n    let tokens = measured === undefined ? 0 : calculateContextTokens(measured.usage);\n    for (const message of view.messages.slice(from))\n        tokens += estimateMessageTokens(message);\n    for (const message of extra)\n        tokens += estimateMessageTokens(message);\n    return tokens;\n}\n/** The summary of a clean `stop` with text and no tool call; anything else is not a summary. */\nfunction summaryText(message) {\n    if (message.stopReason !== \"stop\" || message.content.some((content) => content.type === \"toolCall\"))\n        return undefined;\n    const text = message.content\n        .flatMap((content) => (content.type === \"text\" ? [content.text] : []))\n        .join(\"\\n\")\n        .trim();\n    return text.length === 0 ? undefined : text;\n}\nfunction summaryFailure(message) {\n    if (message.stopReason === \"error\" || message.stopReason === \"aborted\") {\n        return `Summarization failed: ${message.errorMessage ?? message.stopReason}`;\n    }\n    if (message.stopReason === \"length\")\n        return \"Summarization hit the token limit; the summary is incomplete\";\n    if (message.content.some((content) => content.type === \"toolCall\"))\n        return \"Summarization attempted to call a tool\";\n    return \"Summarization produced no text\";\n}\n/** The summarizer's user message: the serialized conversation, the prompt, and any instructions. */\nfunction summaryPrompt(messages, instructions) {\n    const focus = instructions === undefined ? \"\" : `\\n\\nAdditional focus: ${instructions}`;\n    return `<conversation>\\n${serializeConversation(messages)}\\n</conversation>\\n\\n${SUMMARIZATION_PROMPT}${focus}`;\n}\n/**\n * Messages as plain text, so the summarizer reads a transcript instead of continuing it. System messages are omitted.\n * Thinking is omitted too: providers return summaries of the real reasoning, and replayed thinking is often not part of\n * the live context (a block that does not match its request is dropped), so including it can make the request larger\n * than the context it summarizes. Visible text, tool calls, and tool results record what happened.\n */\nexport function serializeConversation(messages) {\n    const parts = [];\n    for (const message of messages) {\n        if (message.role === \"user\") {\n            const text = contentText(message.content);\n            if (text.length > 0)\n                parts.push(`[User]: ${text}`);\n        }\n        else if (message.role === \"assistant\") {\n            const text = message.content.flatMap((content) => (content.type === \"text\" ? [content.text] : []));\n            const calls = message.content.flatMap((content) => content.type === \"toolCall\"\n                ? [\n                    `${content.name}(${Object.entries(content.arguments)\n                        .map(([key, value]) => `${key}=${JSON.stringify(value)}`)\n                        .join(\", \")})`,\n                ]\n                : []);\n            if (text.length > 0)\n                parts.push(`[Assistant]: ${text.join(\"\\n\")}`);\n            if (calls.length > 0)\n                parts.push(`[Assistant tool calls]: ${calls.join(\"; \")}`);\n        }\n        else if (message.role === \"toolResult\") {\n            const text = contentText(message.content);\n            if (text.length > 0)\n                parts.push(`[Tool result]: ${truncate(text, TOOL_RESULT_MAX_CHARS)}`);\n        }\n    }\n    return parts.join(\"\\n\\n\");\n}\nfunction contentText(content) {\n    if (typeof content === \"string\")\n        return content;\n    return content\n        .flatMap((block) => (block.type === \"text\" && block.text !== undefined ? [block.text] : []))\n        .join(\"\\n\");\n}\nfunction truncate(text, maxChars) {\n    if (text.length <= maxChars)\n        return text;\n    return `${text.slice(0, maxChars)}\\n\\n[... ${text.length - maxChars} more characters truncated]`;\n}\n/** Place a summary supplied by a hook in its own commit. */\nasync function place(runtime, firstKept, summary, context) {\n    await runtime.commit(async (tx, current) => placeSummary(tx, runtime, current, await tx.doc(LiveDoc, runtime.conversationId), firstKept, summary), context);\n}\n/**\n * Place the summary entry and complete (spec §8.7). A blocking compaction, owned by its generation, appends it: the\n * generation holds the run and waits. A conversation-owned one admits it as a write submission, placed at once when\n * idle, otherwise at the next boundary, or settled `stale`.\n * REMINDER: nothing else may append to a busy conversation, so every non-blocking summary goes through admission.\n */\nasync function placeSummary(tx, runtime, current, live, firstKept, summary) {\n    removeCompactionStatus(live, runtime.taskId);\n    delete live.compactionFailure;\n    const text = `${SUMMARY_PREFIX}${summary}${SUMMARY_SUFFIX}`;\n    const entry = {\n        kind: CompactionEntry.kind,\n        head: firstKept,\n        model: [{ role: \"user\", content: [{ type: \"text\", text }], timestamp: runtime.now() }],\n        data: { reason: current.input.reason },\n    };\n    const result = current.owner === undefined\n        ? {\n            submissionId: await admitSubmission(tx, runtime.conversationId, { type: \"write\", requestId: `compaction:${runtime.taskId}`, entry }, runtime.now(), runtime.settings),\n        }\n        : { entryId: (await tx.appendEntry(runtime.conversationId, entry)).id };\n    return { status: \"terminal\", outcome: { status: \"completed\", result } };\n}\n/** Remove the status and complete without a summary. */\nasync function complete(runtime, context) {\n    await runtime.commit(async (tx) => {\n        removeCompactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId);\n        return { status: \"terminal\", outcome: { status: \"completed\", result: {} } };\n    }, context);\n}\nasync function failNoModel(runtime, ref, context) {\n    const message = ref === undefined ? \"No model is configured\" : `Model ${ref.provider}/${ref.modelId} is not available`;\n    await runtime.commit(async (tx) => {\n        failCompactionStatus(await tx.doc(LiveDoc, runtime.conversationId), runtime.taskId, message);\n        return { status: \"terminal\", outcome: { status: \"failed\", error: { message, detail: { reason: \"no_model\" } } } };\n    }, context);\n}\n//# sourceMappingURL=compaction.js.map","/** Identity function that types an extension. */\nexport function defineExtension(extension) {\n    return extension;\n}\n/** Identity function that types a tool: `args` from `parameters`, details from what it reports. */\nexport function defineTool(tool) {\n    return tool;\n}\n/** A prompt section; tagged unless `tag` is false. */\nexport function section(key, render, options) {\n    return options?.tag === undefined ? { key, render } : { key, render, tag: options.tag };\n}\n/** Hook handlers for tasks with `task`'s name. */\nexport function hook(task, handlers) {\n    return { task: task.definition.name, handlers };\n}\n/** Wrap the tool named like `tool` wherever the wrapping extension is selected. */\nexport function wrapTool(tool, wrapper) {\n    return { tool: tool.name, wrap: wrapper };\n}\n/** Wrap the section `key` wherever the wrapping extension is selected. */\nexport function wrapSection(key, wrapper) {\n    return { section: key, wrap: wrapper };\n}\n//# sourceMappingURL=define.js.map","import { replicatedState } from \"@earendil-works/chord\";\nimport { withoutAbortSignal } from \"@earendil-works/chord/context\";\nimport { applyImmutable } from \"@earendil-works/chord/delta\";\nimport { CommittedStateSource, CommittedWatch } from \"../session/observation.js\";\nimport { contained } from \"../session/session.js\";\nimport { AgentDoc } from \"./agent.js\";\nimport { activeEntries, captureContextBounds } from \"./context.js\";\nimport { InboxDoc } from \"./inbox.js\";\nimport { LiveDoc } from \"./live.js\";\nimport { ProviderDoc } from \"./provider.js\";\nimport { UsageDoc } from \"./usage.js\";\nimport { closedError } from \"./util.js\";\nconst MOUNTED = [\n    AgentDoc,\n    LiveDoc,\n    InboxDoc,\n    ProviderDoc,\n    UsageDoc,\n];\nconst MOUNTED_KINDS = new Set(MOUNTED.map((token) => token.definition.kind));\nconst VIEWS = new WeakMap();\n/** The view mounts of a Harness, for adapters built on them. */\nexport function conversationViews(harness) {\n    const views = VIEWS.get(harness);\n    if (views === undefined)\n        throw new Error(\"Not a Harness\");\n    return views;\n}\n/**\n * The Harness's conversation view mounts: at most one per conversation, built on the Session line by its first\n * observer and dropped with its last. Each mount advances from the Session's commit publications, which are durable.\n */\nexport class ConversationViews {\n    #session;\n    #storage;\n    #mounts = new Map();\n    #closed = false;\n    constructor(session, storage) {\n        this.#session = session;\n        this.#storage = storage;\n        VIEWS.set(session, this);\n        session.observeCommits((publication, context) => {\n            for (const [id, mount] of this.#mounts)\n                advance(id, mount, publication, context, (error) => this.report(error));\n        });\n        session.subscribeClose(() => {\n            this.#closed = true;\n            for (const mount of this.#mounts.values())\n                for (const observer of [...mount.observers]) {\n                    contained(() => observer.closeSession(this.#session.failure), (error) => this.report(error));\n                }\n            this.#mounts.clear();\n        });\n    }\n    /** Report an observer's listener error through the Harness. */\n    report(error) {\n        this.#session.report(error);\n    }\n    /** A disposable read-only Chord state of the view. */\n    async state(id, context) {\n        const { observer, detach } = await this.attach(id, (value, release) => new CommittedStateSource(value, release), context);\n        try {\n            return replicatedState(observer, { onError: (error) => this.#session.report(error) });\n        }\n        catch (error) {\n            detach();\n            throw error;\n        }\n    }\n    /** A serialized exact-frame watch of the view; cancelling `context` stops it. */\n    async watch(id, context) {\n        const { observer } = await this.attach(id, (value, release) => new CommittedWatch(value, release, (error) => this.#session.report(error)), context);\n        const signal = context.abortSignal;\n        if (signal?.aborted) {\n            observer.cancel();\n            throw signal.reason;\n        }\n        if (signal !== undefined)\n            observer.observeCancellation(signal);\n        return observer;\n    }\n    /**\n     * Register an observer created from the current revision, atomically on the Session line: it sees every later\n     * publication and nothing earlier. `create` may read committed Storage, still on the line. `release` drops it, and\n     * the mount with its last observer.\n     */\n    attach(id, create, context) {\n        return this.#session.readOnLine(async () => {\n            const mount = this.#mounts.get(id) ?? (await this.#build(id, context));\n            const detach = () => {\n                mount.observers.delete(observer);\n                if (mount.observers.size === 0 && this.#mounts.get(id) === mount)\n                    this.#mounts.delete(id);\n            };\n            const observer = await create(mount.value, detach, this.#storage);\n            // Close or cancellation may begin while the mount hydrates; register nothing then.\n            if (this.#closed)\n                throw closedError(this.#session);\n            context.abortSignal?.throwIfAborted();\n            this.#mounts.set(id, mount);\n            mount.observers.add(observer);\n            return { observer, detach };\n        });\n    }\n    async #build(id, context) {\n        const conversation = await this.#storage.conversation(id, context);\n        if (conversation === undefined)\n            throw new Error(`Conversation ${id} does not exist`);\n        const bounds = await captureContextBounds(this.#storage, id, context);\n        const entries = await activeEntries(this.#storage, id, bounds, context);\n        const docs = {};\n        const incarnations = new Map();\n        for (const token of MOUNTED) {\n            const loaded = await this.#session.conversationDocumentOnLine(token, id, context);\n            if (loaded === undefined)\n                continue;\n            docs[token.definition.kind] = loaded.value;\n            incarnations.set(token.definition.kind, { id: loaded.record.id, version: loaded.version });\n        }\n        return { value: { conversation, entries, docs }, docs: incarnations, observers: new Set() };\n    }\n}\n/**\n * Derive the mount's operations from one publication, apply them, and hand the revision to every observer; one that\n * throws is reported through `report`, and the others still get it.\n */\nfunction advance(id, mount, publication, context, report) {\n    const docOps = [];\n    const entryOps = [];\n    let entries = mount.value.entries;\n    // Entry writes are published in ID order.\n    for (const change of publication.changes) {\n        if (change.type === \"entry\" && change.value.conversationId === id) {\n            const entry = change.value;\n            const value = entry;\n            if (entry.head === undefined) {\n                entryOps.push([\"p\", [\"entries\"], entries.length, 0, [value]]);\n                entries = [...entries, entry];\n                continue;\n            }\n            // A head marker keeps the non-head entries from its head, which are always a suffix, and goes in front.\n            const target = entry.head;\n            let kept = entries.findIndex((candidate) => candidate.head === undefined && candidate.id >= target);\n            if (kept < 0)\n                kept = entries.length;\n            entryOps.push([\"p\", [\"entries\"], 0, kept, [value]]);\n            entries = [entry, ...entries.slice(kept)];\n            continue;\n        }\n        if (change.type !== \"document\" || change.conversationId !== id)\n            continue;\n        const kind = change.record.kind;\n        if (!MOUNTED_KINDS.has(kind) || change.record.key !== undefined)\n            continue;\n        const path = [\"docs\", kind];\n        const mounted = mount.docs.get(kind);\n        if (change.value === null) {\n            if (mounted?.id !== change.record.id)\n                continue;\n            mount.docs.delete(kind);\n            docOps.push([\"d\", path]);\n        }\n        else if (mounted?.id === change.record.id && mounted.version === change.version) {\n            for (const op of change.ops)\n                docOps.push(prefixed(op, path));\n        }\n        else {\n            mount.docs.set(kind, { id: change.record.id, version: change.version });\n            docOps.push([\"s\", path, change.value]);\n        }\n    }\n    const before = mount.value;\n    const ops = [...docOps, ...entryOps];\n    const frameContext = withoutAbortSignal(context);\n    if (ops.length > 0) {\n        const value = docOps.length === 0 ? mount.value : applyImmutable(mount.value, docOps);\n        mount.value = entries === value.entries ? value : { ...value, entries };\n        for (const observer of [...mount.observers]) {\n            contained(() => observer.advance?.(mount.value, ops, frameContext), report);\n        }\n    }\n    for (const observer of [...mount.observers]) {\n        contained(() => observer.publication?.(before, mount.value, ops, publication, frameContext), report);\n    }\n}\n/** `op` moved under `prefix`; a root replacement becomes a set of the prefix. */\nfunction prefixed(op, prefix) {\n    const at = (path) => [...prefix, ...path];\n    switch (op[0]) {\n        case \"r\":\n            return [\"s\", prefix, op[1]];\n        case \"p\":\n            return [\"p\", at(op[1]), op[2], op[3], op[4]];\n        case \"m\":\n            return [\"m\", at(op[1]), op[2]];\n        case \"s\":\n            return [\"s\", at(op[1]), op[2]];\n        case \"d\":\n            return [\"d\", at(op[1])];\n        case \"a\":\n            return [\"a\", at(op[1]), op[2]];\n        case \"t\":\n            return [\"t\", at(op[1]), op[2]];\n    }\n}\n//# sourceMappingURL=view.js.map","import { CommittedWatch } from \"../session/observation.js\";\nimport { AgentDoc } from \"./agent.js\";\nimport { NestedCallDoc } from \"./tool.js\";\nimport { UsageDoc } from \"./usage.js\";\nimport { scanAll } from \"./util.js\";\nimport { conversationViews } from \"./view.js\";\nfunction parts(view) {\n    return {\n        live: (view.docs[\"pi.live\"] ?? {}),\n        inbox: view.docs[\"pi.inbox\"],\n        agent: view.docs[\"pi.agent\"],\n        usage: view.docs[\"pi.usage\"],\n    };\n}\nfunction snapshotOf(view) {\n    const { live, inbox, agent, usage } = parts(view);\n    return {\n        type: \"snapshot\",\n        entries: view.entries,\n        ...(live.run === undefined ? {} : { run: { inputs: live.run.inputs } }),\n        ...(live.generation === undefined ? {} : { generation: live.generation }),\n        tools: live.tools ?? [],\n        nestedTools: live.nestedTools ?? [],\n        compactions: live.compactions ?? [],\n        ...(live.compactionFailure === undefined ? {} : { compactionFailure: live.compactionFailure }),\n        inbox: queued(inbox),\n        agent: agent ?? AgentDoc.definition.initial(),\n        usage: usage ?? UsageDoc.definition.initial(),\n    };\n}\nfunction queued(inbox) {\n    return (inbox?.items ?? []).map((item) => ({ id: item.id, mode: item.mode }));\n}\n/**\n * Experimental: attach to one conversation's agent events (spec §9.4). The snapshot and the registration for later\n * commits are captured atomically on the Session line; overflow replaces undelivered batches with one snapshot.\n */\nexport async function watchEvents(harness, conversationId, context) {\n    const views = conversationViews(harness);\n    let watch;\n    let snapshot;\n    await views.attach(conversationId, async (initial, release, storage) => {\n        // Generations whose held outcome already ended their turn, read on the line with the snapshot.\n        const query = { conversationId, kind: \"pi.generation\", status: \"completing\" };\n        const completing = await scanAll((cursor) => storage.scanTasks(query, 100, cursor, context));\n        const held = new Set(completing.map((record) => record.id));\n        let current = initial;\n        snapshot = snapshotOf(initial);\n        // Batches are the watch's values; an overflow delivers a snapshot of the newest view instead.\n        watch = new CommittedWatch([], release, (error) => views.report(error), () => [snapshotOf(current)]);\n        return {\n            publication: (before, after, ops, publication, commitContext) => {\n                current = after;\n                const events = translate(conversationId, before, after, ops, publication, held);\n                if (events.length > 0)\n                    watch.advance(events, [], commitContext);\n            },\n            closeSession: (failure) => watch.closeSession(failure),\n        };\n    }, context);\n    // Like a watch, the acquisition context governs the stream's lifetime.\n    const signal = context.abortSignal;\n    if (signal?.aborted) {\n        watch.cancel();\n        throw signal.reason;\n    }\n    if (signal !== undefined)\n        watch.observeCancellation(signal);\n    return {\n        snapshot,\n        start: (listener) => watch.start((events, _ops, deliveryContext) => listener(events, deliveryContext)),\n        stop: () => watch.stop(),\n        closed: watch.closed,\n    };\n}\n/** The tool result for `callId` among `entries`. */\nfunction resultOf(entries, callId) {\n    return entries.find((entry) => {\n        const message = entry.model?.[0];\n        return message?.role === \"toolResult\" && message.toolCallId === callId;\n    });\n}\n/** Every event one publication causes, in the order of spec §9.4. */\nfunction translate(conversationId, before, after, viewOps, publication, held) {\n    const entries = [];\n    const tasks = new Map();\n    const submissions = [];\n    // Nested results this commit stored, by nested task ID; read now, since the caller's documents may retire next.\n    const nestedResults = new Map();\n    for (const change of publication.changes) {\n        if (change.type === \"document\" &&\n            change.record.kind === NestedCallDoc.definition.kind &&\n            change.value !== null &&\n            change.conversationId === conversationId) {\n            const state = change.value;\n            if (state.taskId !== undefined && state.result !== undefined) {\n                nestedResults.set(state.taskId, state.result);\n            }\n        }\n        if (change.type === \"entry\" && change.value.conversationId === conversationId)\n            entries.push(change.value);\n        if (change.type === \"task\" && change.value.conversationId === conversationId)\n            tasks.set(change.value.id, change.value);\n        if (change.type === \"submission\" && change.value.conversationId === conversationId) {\n            submissions.push(change.value);\n        }\n    }\n    if (viewOps.length === 0 && entries.length === 0 && tasks.size === 0 && submissions.length === 0)\n        return [];\n    // Entries are appended in ID order; submission records are published in the order the commit first touched them.\n    submissions.sort((a, b) => a.id - b.id);\n    const was = parts(before);\n    const now = parts(after);\n    const events = [];\n    // Progress: tool starts, the in-flight message, tool updates, retry and deferred state.\n    const slotsBefore = new Map((was.live.tools ?? []).map((slot) => [slot.callId, slot]));\n    const slots = now.live.tools ?? [];\n    const nestedBefore = new Map((was.live.nestedTools ?? []).map((slot) => [slot.taskId, slot]));\n    const nested = now.live.nestedTools ?? [];\n    for (const slot of [...slots, ...nested]) {\n        const previous = \"parentCallId\" in slot ? nestedBefore.get(slot.taskId) : slotsBefore.get(slot.callId);\n        if (slot.status !== \"running\" || previous?.status === \"running\")\n            continue;\n        // A nested slot carries the arguments the call runs with; a model-issued call's are in its intent checkpoint.\n        const checkpoint = slot.taskId === undefined ? undefined : tasks.get(slot.taskId)?.state.checkpoint;\n        const args = \"parentCallId\" in slot\n            ? slot.arguments\n            : (checkpoint?.arguments ?? {});\n        events.push({ type: \"tool_execution_start\", ...callOf(slot), args });\n    }\n    const partialBefore = was.live.generation?.message;\n    const partial = now.live.generation?.message;\n    if (partial !== undefined && partialBefore === undefined)\n        events.push({ type: \"message_start\", message: partial });\n    else if (partial !== undefined && partial !== partialBefore) {\n        events.push({ type: \"message_update\", usage: partial.usage, changes: messageChanges(viewOps, partial) });\n    }\n    for (const [index, slot] of slots.entries()) {\n        const previous = slotsBefore.get(slot.callId);\n        if (slot.status !== \"running\" || previous?.status !== \"running\")\n            continue;\n        const update = toolUpdate(viewOps, [\"tools\", index], slot, previous);\n        if (update === undefined)\n            continue;\n        events.push({ type: \"tool_execution_update\", ...callOf(slot), ...update });\n    }\n    for (const [index, slot] of nested.entries()) {\n        const previous = nestedBefore.get(slot.taskId);\n        if (slot.status !== \"running\" || previous?.status !== \"running\")\n            continue;\n        const update = toolUpdate(viewOps, [\"nestedTools\", index], slot, previous);\n        if (update === undefined)\n            continue;\n        events.push({ type: \"tool_execution_update\", ...callOf(slot), ...update });\n    }\n    const generation = now.live.generation;\n    const generationBefore = was.live.generation;\n    if (generation?.retry !== undefined && generationBefore?.retry === undefined) {\n        const { at, error } = generation.retry;\n        events.push({ type: \"auto_retry_start\", attempt: generation.attempt, at, errorMessage: error });\n    }\n    if (generationBefore?.retry !== undefined && generation?.retry === undefined) {\n        events.push({ type: \"auto_retry_end\", attempt: generationBefore.attempt });\n    }\n    if (generation?.deferred !== undefined && generation.deferred.pollAt !== generationBefore?.deferred?.pollAt) {\n        events.push({ type: \"deferred_poll\", pollAt: generation.deferred.pollAt });\n    }\n    // Tools that end in this commit: a slot that becomes done, one created done (a call not offered), or an unfinished\n    // one that vanishes because its run ended. A done slot that vanishes ended earlier.\n    const toolEnds = [];\n    const endTool = (slot, entryId) => {\n        const entry = entries.find((candidate) => candidate.id === entryId);\n        toolEnds.push({ type: \"tool_execution_end\", ...callOf(slot), ...(entry === undefined ? {} : { entry }) });\n    };\n    for (const previous of slotsBefore.values()) {\n        if (previous.status === \"done\")\n            continue;\n        const slot = slots.find((candidate) => candidate.callId === previous.callId);\n        if (slot?.status === \"done\")\n            endTool(slot, slot.entry);\n        // A slot whose run ended in this commit may have had its result appended with it, as for unstarted calls.\n        else if (slot === undefined)\n            endTool(previous, resultOf(entries, previous.callId)?.id);\n    }\n    for (const slot of slots) {\n        if (slot.status === \"done\" && !slotsBefore.has(slot.callId))\n            endTool(slot, slot.entry);\n    }\n    // Nested calls that end in this commit, the same way, children before the calls that made them: the lists hold\n    // parents first, so walk them backwards.\n    const endNested = (slot) => {\n        const result = nestedResults.get(slot.taskId);\n        events.push({ type: \"tool_execution_end\", ...callOf(slot), ...(result === undefined ? {} : { result }) });\n    };\n    const nestedNow = new Map(nested.map((slot) => [slot.taskId, slot]));\n    for (const previous of [...nestedBefore.values()].reverse()) {\n        if (previous.status === \"done\")\n            continue;\n        const slot = nestedNow.get(previous.taskId);\n        if (slot?.status === \"done\" || slot === undefined)\n            endNested(slot ?? previous);\n    }\n    for (const slot of [...nested].reverse()) {\n        if (slot.status === \"done\" && !nestedBefore.has(slot.taskId))\n            endNested(slot);\n    }\n    // Entries in append order; a tool's end directly precedes its result's message, as in the coding agent.\n    let assistantAppended = false;\n    for (const entry of entries) {\n        events.push(...toolEnds.filter((end) => end.entry === entry));\n        const message = entry.model?.[0];\n        if (message === undefined) {\n            events.push({ type: \"entry_appended\", entry });\n            continue;\n        }\n        // A streamed answer already started with its first partial.\n        const streamed = message.role === \"assistant\" && partialBefore !== undefined && !assistantAppended;\n        if (message.role === \"assistant\")\n            assistantAppended = true;\n        if (!streamed)\n            events.push({ type: \"message_start\", message });\n        events.push({ type: \"message_end\", entry });\n    }\n    // Ends without a result entry: a faulted or orphaned tool, or one whose run ended.\n    events.push(...toolEnds.filter((end) => end.entry === undefined));\n    // Compaction ends, task failures, then turn and run ends.\n    const compactionsBefore = was.live.compactions ?? [];\n    const compactions = now.live.compactions ?? [];\n    const failure = now.live.compactionFailure;\n    for (const { taskId, reason } of compactionsBefore) {\n        if (!compactions.some((status) => status.taskId === taskId)) {\n            const error = failure?.taskId === taskId ? failure.error : undefined;\n            events.push({ type: \"compaction_end\", taskId, reason, ...(error === undefined ? {} : { error }) });\n        }\n    }\n    // A generation's turn ends when its outcome is committed: at a `completing` hold or at terminal, whichever comes\n    // first, so a successor created at the hold starts after it.\n    let turnEnded = false;\n    for (const task of tasks.values()) {\n        const status = task.state.status;\n        if (task.kind === \"pi.generation\" && status === \"completing\" && !held.has(task.id)) {\n            held.add(task.id);\n            turnEnded = true;\n        }\n        if (status !== \"terminal\")\n            continue;\n        if (task.kind === \"pi.generation\" && !held.delete(task.id))\n            turnEnded = true;\n        const outcome = task.state.outcome;\n        if (outcome.status === \"faulted\" || outcome.status === \"orphaned\") {\n            const message = outcome.status === \"faulted\" ? outcome.error.message : outcome.reason;\n            events.push({ type: \"task_failed\", taskId: task.id, kind: task.kind, message });\n        }\n    }\n    if (turnEnded)\n        events.push({ type: \"turn_end\" });\n    const run = now.live.run;\n    const runBefore = was.live.run;\n    const runChanged = run?.inputs[0] !== runBefore?.inputs[0];\n    if (runBefore !== undefined && runChanged)\n        events.push({ type: \"run_end\", inputs: runBefore.inputs });\n    // Submissions, document state, then what began.\n    for (const record of submissions)\n        events.push({ type: \"submission\", record });\n    if (now.inbox !== was.inbox)\n        events.push({ type: \"inbox_update\", items: queued(now.inbox) });\n    // A retired document reads as its initial value, as in a snapshot.\n    if (now.agent !== was.agent) {\n        events.push({ type: \"agent_changed\", agent: now.agent ?? AgentDoc.definition.initial() });\n    }\n    if (now.usage !== was.usage)\n        events.push({ type: \"usage_changed\", usage: now.usage ?? UsageDoc.definition.initial() });\n    for (const { taskId, reason, blocking } of compactions) {\n        if (!compactionsBefore.some((status) => status.taskId === taskId)) {\n            events.push({ type: \"compaction_start\", taskId, reason, blocking });\n        }\n    }\n    if (run !== undefined && runChanged)\n        events.push({ type: \"run_start\", inputs: run.inputs });\n    if (run !== undefined && run.taskId !== runBefore?.taskId && tasks.get(run.taskId)?.kind === \"pi.generation\") {\n        events.push({ type: \"turn_start\" });\n    }\n    return events;\n}\nconst PARTIAL_PATH = [\"docs\", \"pi.live\", \"generation\", \"message\"];\n/** Translate the view operations on the in-flight message into message changes (spec §9.4). */\nfunction messageChanges(viewOps, message) {\n    const changes = [];\n    // A block sent whole already holds every later change to it in this batch.\n    const whole = new Set();\n    for (const op of viewOps) {\n        // View operations never replace the root.\n        const path = op[1];\n        if (!startsWith(path, PARTIAL_PATH)) {\n            // The whole message or generation was replaced.\n            if (startsWith(PARTIAL_PATH, path))\n                return [{ type: \"message\", message }];\n            continue;\n        }\n        const rest = path.slice(PARTIAL_PATH.length);\n        if (rest[0] === \"usage\")\n            continue;\n        if (rest[0] !== \"content\")\n            return [{ type: \"message\", message }];\n        if (rest.length === 1) {\n            if (op[0] !== \"p\" || op[3] !== 0)\n                return [{ type: \"message\", message }];\n            for (const [offset, block] of op[4].entries()) {\n                const type = block.type === \"text\" ? \"text_start\" : block.type === \"thinking\" ? \"thinking_start\" : \"toolcall_start\";\n                changes.push({ type, contentIndex: op[2] + offset, block });\n            }\n            continue;\n        }\n        const contentIndex = rest[1];\n        const field = rest[2];\n        if (whole.has(contentIndex))\n            continue;\n        if (op[0] === \"a\" && rest.length === 3 && (field === \"text\" || field === \"thinking\")) {\n            changes.push({ type: field === \"text\" ? \"text_delta\" : \"thinking_delta\", contentIndex, delta: op[2] });\n        }\n        else if (op[0] === \"a\" && field === \"arguments\") {\n            changes.push({ type: \"toolcall_delta\", contentIndex, path: rest.slice(3), delta: op[2] });\n        }\n        else {\n            whole.add(contentIndex);\n            changes.push({ type: \"block\", contentIndex, block: message.content[contentIndex] });\n        }\n    }\n    return changes;\n}\n/** The identifying fields of a slot's tool events. */\nfunction callOf(slot) {\n    return {\n        toolCallId: slot.callId,\n        toolName: slot.name,\n        ...(slot.taskId === undefined ? {} : { taskId: slot.taskId }),\n        ...(\"parentCallId\" in slot ? { parentToolCallId: slot.parentCallId, parentTaskId: slot.parentTaskId } : {}),\n    };\n}\n/** Output, details, and diagnostics changes of a running slot at `at` in `pi.live`, from the view operations on it. */\nfunction toolUpdate(viewOps, at, slot, previous) {\n    const outputPath = [\"docs\", \"pi.live\", ...at, \"output\"];\n    let trimStart = 0;\n    let append = \"\";\n    let set = false;\n    for (const op of viewOps) {\n        if (!startsWith(op[1], outputPath))\n            continue;\n        if (op[0] === \"t\")\n            trimStart += op[2];\n        else if (op[0] === \"a\")\n            append += op[2];\n        else\n            set = true;\n    }\n    let output;\n    if (set || (slot.output !== previous.output && trimStart === 0 && append === \"\"))\n        output = { set: slot.output ?? \"\" };\n    else if (trimStart > 0 || append !== \"\") {\n        output = { ...(trimStart > 0 ? { trimStart } : {}), ...(append === \"\" ? {} : { append }) };\n    }\n    // A safe replay clears a running slot's progress: removed details send `null`, removed diagnostics `[]`.\n    const update = {\n        ...(output === undefined ? {} : { output }),\n        ...(slot.details === previous.details ? {} : { details: slot.details ?? null }),\n        ...(slot.diagnostics === previous.diagnostics ? {} : { diagnostics: slot.diagnostics ?? [] }),\n    };\n    return Object.keys(update).length === 0 ? undefined : update;\n}\nfunction startsWith(path, prefix) {\n    return prefix.length <= path.length && prefix.every((segment, index) => path[index] === segment);\n}\n//# sourceMappingURL=events.js.map","import { INSTRUCTIONS_KEY } from \"./agent.js\";\nimport { CompactionTask } from \"./compaction.js\";\nimport { GenerationTask } from \"./generation.js\";\nimport { ToolTask } from \"./tool.js\";\nconst SECTION_KEY = /^[a-z][a-z0-9_-]*$/;\n/** Built-in task definitions every registry holds; they are not an extension and cannot be removed or replaced. */\nexport const BUILTIN_TASKS = [GenerationTask, ToolTask, CompactionTask];\n/** Immutable published registry state. */\nclass RegistryState {\n    #extensions;\n    #byName;\n    #tasks;\n    constructor(extensions) {\n        this.#extensions = extensions;\n        this.#byName = new Map(extensions.map((extension) => [extension.name, extension]));\n        const tasks = new Map();\n        for (const task of BUILTIN_TASKS)\n            tasks.set(task.definition.name, task);\n        for (const extension of extensions) {\n            for (const task of extension.tasks ?? []) {\n                const name = task.definition.name;\n                if (tasks.has(name))\n                    throw new Error(`Task ${name} of extension ${extension.name} is already installed`);\n                tasks.set(name, task);\n            }\n        }\n        this.#tasks = tasks;\n    }\n    installed() {\n        return this.#extensions;\n    }\n    extension(name) {\n        return this.#byName.get(name);\n    }\n    tools() {\n        return this.#extensions.flatMap((extension) => (extension.tools ?? []).map((tool) => ({ extension, tool })));\n    }\n    sections() {\n        return this.#extensions.flatMap((extension) => (extension.sections ?? []).map((section) => ({ extension, section })));\n    }\n    tasks() {\n        return [...this.#tasks.values()];\n    }\n    task(name) {\n        return this.#tasks.get(name);\n    }\n}\nclass RegistryImpl {\n    #current = new RegistryState([]);\n    #listeners = new Set();\n    snapshot() {\n        return this.#current;\n    }\n    subscribe(listener) {\n        this.#listeners.add(listener);\n        return () => this.#listeners.delete(listener);\n    }\n    install(extension) {\n        validateExtension(extension);\n        const current = this.#current.installed();\n        const index = current.findIndex((installed) => installed.name === extension.name);\n        const next = index < 0 ? [...current, extension] : current.map((installed, at) => (at === index ? extension : installed));\n        this.#publish(next);\n    }\n    uninstall(extension) {\n        const current = this.#current.installed();\n        if (!current.some((installed) => installed.name === extension.name))\n            return;\n        this.#publish(current.filter((installed) => installed.name !== extension.name));\n    }\n    /** Build and validate the next state, which throws on a task name collision, then publish it synchronously. */\n    #publish(extensions) {\n        this.#current = new RegistryState(extensions);\n        for (const listener of [...this.#listeners])\n            listener();\n    }\n}\n/** Unique tool names and section keys within one extension; valid, unreserved section keys. */\nfunction validateExtension(extension) {\n    const tools = new Set();\n    for (const tool of extension.tools ?? []) {\n        if (tools.has(tool.name))\n            throw new Error(`Extension ${extension.name} has two tools named ${tool.name}`);\n        tools.add(tool.name);\n    }\n    const sections = new Set();\n    for (const { key } of extension.sections ?? []) {\n        if (!SECTION_KEY.test(key))\n            throw new TypeError(`Section key ${JSON.stringify(key)} must match ${SECTION_KEY}`);\n        if (key === INSTRUCTIONS_KEY)\n            throw new Error(`Section key ${key} is reserved for the agent's instructions`);\n        if (sections.has(key))\n            throw new Error(`Extension ${extension.name} has two sections with key ${key}`);\n        sections.add(key);\n    }\n}\n/** Create an application-owned registry holding only the built-in tasks. */\nexport function createRegistry() {\n    return new RegistryImpl();\n}\n//# sourceMappingURL=registry.js.map","import { copyJson } from \"@earendil-works/chord\";\nimport { awaitWithContext, withAbortSignal } from \"@earendil-works/chord/context\";\nimport { errorMessage } from \"../errors.js\";\nimport { agentHooks } from \"./agent.js\";\nimport { readContextFrom } from \"./context.js\";\nimport { closedError, scanAll, Waiters } from \"./util.js\";\nconst SCAN_PAGE_SIZE = 256;\n/** Longest delay `setTimeout` supports; longer sleeps wait in several steps. */\nconst MAX_TIMER_DELAY = 2_147_483_647;\nconst LIVE_STATUSES = [\"pending\", \"running\", \"waiting\", \"completing\"];\nfunction conversationNode(id) {\n    return `c${id}`;\n}\nfunction conversationOf(node) {\n    return Number(node.slice(1));\n}\n/** The node a task hangs from: its owner task, or its conversation. */\nfunction parentNode(node) {\n    return node.owner ?? conversationNode(node.conversationId);\n}\n/**\n * Durable task scheduler of one Harness.\n *\n * `#live` mirrors every committed non-terminal task record: pending, running, waiting, and completing. The synchronous\n * commit listener updates it on the Session line, so code running on the line reads exactly the committed state from it.\n *\n * Tasks and conversations form one ownership tree (spec §5.5): a task's parent is its owner task, or its conversation;\n * a conversation's parent is its owner task, if any. Walks up that tree decide what reaches one task: a cancelling\n * owner, a scope. `#below` lists the tree downward around live work, so what lies below one node is a walk down from\n * it: a task's live ordinary owned work, which holds its outcome as `completing` and delays its abort handler, a\n * scope's tasks, a cascade's reach. No pass visits every live task; the sets below hold each pass's candidates.\n *\n * The ownership indexes are bounded by live work: an owner edge and an ended task's ownership fields are kept only while\n * something is listed below them in `#below`, so only the chains above live tasks are known, whole. Work that appears\n * later below a dropped node finds it unknown and loads its chain from storage again.\n *\n * Invariant: every task transition is decided and written by one callback serialized on the Session line. That covers\n * reservation, marks, runtime commits, finalization, and the synchronous step before each phase, which applies the\n * precedence rules and writes a fault or handover. Handlers and joins run off the line. An invocation ends inside the\n * step that decides its end, so a runtime commit it queued either lands before that decision or is rejected.\n */\nexport class TaskScheduler {\n    #session;\n    #storage;\n    #registry;\n    #models;\n    #agent;\n    #settings;\n    #env;\n    #now;\n    #report;\n    #settleOutcome;\n    #withdrawInputs;\n    #conversation;\n    #context;\n    #live = new Map();\n    /**\n     * Context range last read through a task runtime, per conversation: a later read, by any of its tasks, scans only\n     * newer entries. `idleSince` is the Harness time it was first seen idle. Derived and never persisted; dropped at the\n     * first idle check after `settings.contextRetentionMs` of idleness, and at close.\n     */\n    #contexts = new Map();\n    /** Timer for the earliest expiry of an idle context, only where timers can be unreferenced (see `#scheduleExpiry`). */\n    #expiry;\n    #invocations = new Map();\n    #taskWaiters = new Waiters();\n    /** Idle waiters by conversation; `undefined` waits for the whole Harness. */\n    #idleWaiters = new Waiters();\n    /** Definition whose migration failed per task; retried only once the registry resolves another definition. */\n    #failedMigrations = new Map();\n    /** Owner task of each known conversation, `null` when ownerless. */\n    #edges = new Map();\n    /** Ownership fields of the known terminal tasks, which walks pass through. */\n    #settled = new Map();\n    /**\n     * Ended tasks and conversations found unneeded, dropped by `#sweep()` at the end of the commit's publication unless\n     * needed again by then: a chain load installs nodes before the work below them is listed.\n     */\n    #dropQueue = new Set();\n    /**\n     * The tree downward around live work: each node's child nodes that are live tasks or have nodes listed below them.\n     * A conversation's parent is its owner task; ownerless ones with work are in `#roots`.\n     */\n    #below = new Map();\n    #roots = new Set();\n    /** Known tasks whose chain may not be loaded; every other known task's chain is, and stays, loaded. */\n    #unloaded = new Set();\n    /** Live tasks with cancellation intent, the sources of abort cascades (spec §5.4). */\n    #intent = new Set();\n    /** Live tasks that are not `completing`, the candidates of a reservation pass; ones found waiting leave it. */\n    #runnable = new Set();\n    /** `completing` tasks the next finalize pass checks: those that started holding, and holders of ended work. */\n    #finalizeChecks = new Set();\n    /** Live waiting tasks by each task in their `on`. */\n    #waiters = new Map();\n    /**\n     * `failFast` waiters the next reconcile checks for a failed task in `on`: at open, when they start waiting, and when\n     * one of their tasks fails.\n     */\n    #failFastChecks = new Set();\n    /**\n     * Live tasks with `abandonOnRestart` found at open, from an earlier Harness. The first reservation pass abort-marks\n     * them with reason `restart`, so nothing of them or below them runs a phase again.\n     */\n    #abandoned = new Set();\n    #reconcileScheduled = false;\n    #sweepScheduled = false;\n    #cascadePending = false;\n    #unsubscribeRegistry = () => { };\n    #enabled = false;\n    #closing = false;\n    #dirty = false;\n    #draining = false;\n    constructor(options) {\n        this.#session = options.session;\n        this.#storage = options.storage;\n        this.#registry = options.registry;\n        this.#models = options.models;\n        this.#agent = options.agent;\n        this.#settings = options.settings;\n        this.#env = options.env;\n        this.#now = options.now;\n        this.#report = options.report;\n        this.#settleOutcome = options.settleOutcome;\n        this.#withdrawInputs = options.withdrawInputs;\n        this.#conversation = options.conversation;\n        this.#context = options.context;\n    }\n    /** Load live tasks and change surviving `running` tasks back to `pending`. Dispatches nothing. */\n    async open(context) {\n        this.#session.observeCommits((publication) => this.#observe(publication));\n        this.#session.subscribeClose(() => this.#seal());\n        this.#unsubscribeRegistry = this.#registry.subscribe(() => this.#kick());\n        await this.#session.commitWith(async (tx) => {\n            // Every table read before the first write.\n            const scans = [];\n            for (const status of LIVE_STATUSES) {\n                scans.push(await scanAll((cursor) => tx.scanTasks({ status }, SCAN_PAGE_SIZE, cursor)));\n            }\n            for (const records of scans) {\n                for (const record of records) {\n                    this.#track(undefined, record);\n                    if (record.abandonOnRestart === true)\n                        this.#abandoned.add(record.id);\n                    if (record.state.status === \"running\") {\n                        tx.setTask(withState(record, { status: \"pending\", checkpoint: record.state.checkpoint }));\n                    }\n                    if (record.state.status === \"waiting\" && record.state.policy === \"failFast\") {\n                        this.#failFastChecks.add(record.id);\n                    }\n                }\n            }\n        }, context);\n        // Derive abort marks a crash left unapplied below cancelled owners, and finalize held outcomes.\n        this.#cascadePending = true;\n        this.#scheduleReconcile();\n    }\n    /** Enable scheduling. Idempotent; the kick does nothing once closing. */\n    resume() {\n        this.#enabled = true;\n        this.#kick();\n    }\n    /**\n     * Signal every invocation and wait for them; writes nothing. Close calls this after every close listener has run, so\n     * waits, watches, and streams a task holds end with the Session's reason, not as cancelled by its signal.\n     */\n    async join() {\n        for (const invocation of this.#invocations.values())\n            invocation.controller.abort();\n        await Promise.allSettled([...this.#invocations.values()].map((invocation) => invocation.done));\n    }\n    /**\n     * Commit the abort mark, or settle a task that no registered definition can take as `orphaned` when nothing it owns\n     * is live, then join the run invocation seen on the line; the commit listener signalled it. The abort invocation\n     * starts once the task's ordinary owned work is gone. A `completing` task is only marked. A request replaces a\n     * `restart` mark, so a task abandoned after a restart that waits for its definition is orphaned; with `keepRestart`,\n     * as for an owner's own cleanup, such a task keeps its mark and waits on.\n     */\n    async abort(id, context, keepRestart = false) {\n        const marked = await this.#session.commitWith(async (tx) => {\n            const current = await tx.task(id);\n            if (current === undefined)\n                throw new Error(`Task ${id} does not exist`);\n            if (current.state.status === \"terminal\")\n                return { result: \"terminal\" };\n            const invocation = this.#invocations.get(id);\n            // A restart-marked task has no run invocation; it only waits for its abort.\n            if (keepRestart && current.abortReason === \"restart\")\n                return { result: \"marked\" };\n            if (invocation === undefined && current.state.status !== \"completing\") {\n                await this.#loadScopes(false);\n                if (!this.#hasOwnedLive(id)) {\n                    const resolution = this.#resolve(current, this.#registry.snapshot());\n                    if (resolution.kind === \"blocked\") {\n                        await this.#terminate(tx, current, { status: \"orphaned\", reason: resolution.reason });\n                        return { result: \"marked\" };\n                    }\n                }\n            }\n            if (!current.abortRequested || current.abortReason !== undefined)\n                tx.setTask(withAbortMark(current));\n            return { result: \"marked\", run: invocation?.mode === \"run\" ? invocation : undefined };\n        }, context);\n        // The commit listener signalled the run; join it. A run that ignores its signal can outlive a failed Session,\n        // which ends the wait instead.\n        if (marked.run !== undefined) {\n            await awaitWithContext(Promise.race([marked.run.done, this.#session.failed]), context);\n        }\n        return marked.result;\n    }\n    async waitForTask(id, context) {\n        // Check and register on the line so no terminal publication falls between them.\n        const found = await this.#session.readOnLine(async () => {\n            if (this.#closing)\n                throw closedError(this.#session);\n            if (this.#live.has(id))\n                return { promise: this.#taskWaiters.add(id, context) };\n            const record = await this.#storage.task(id, context);\n            if (record === undefined)\n                throw new Error(`Task ${id} does not exist`);\n            return { promise: Promise.resolve(record) };\n        });\n        return found.promise;\n    }\n    /**\n     * Resolve when ordinary traversal from the conversation, or from every ownerless conversation, reaches no live\n     * non-background task.\n     */\n    waitForIdle(conversationId, context) {\n        if (this.#closing)\n            return Promise.reject(closedError(this.#session));\n        if (this.#idle(conversationId))\n            return Promise.resolve();\n        this.#scheduleReconcile();\n        return this.#idleWaiters.add(conversationId, context);\n    }\n    /**\n     * `Conversation.abort()`: in one commit, withdraw the queued inputs and mark every live non-background task that\n     * ordinary traversal from the conversation reaches; resolves once the scope is idle. With `background`, traversal\n     * crosses background boundaries, and the wait also covers every task it reached.\n     */\n    async abortConversation(conversationId, background, context) {\n        const reached = await this.#session.commitWith(async (tx) => {\n            const queued = await this.#loadScopes(true);\n            const scope = { conversation: conversationId };\n            const reached = [];\n            const walk = this.#walkDown(conversationNode(conversationId), { crossBackground: background });\n            for (const { node, live } of walk) {\n                if (live === undefined || (node.background && !background))\n                    continue;\n                reached.push(live.id);\n                if (!live.abortRequested || live.abortReason !== undefined)\n                    tx.setTask(withAbortMark(live));\n            }\n            for (const id of queued) {\n                if (this.#inScope({ conversation: id }, scope, background) === true)\n                    await this.#withdrawInputs(tx, id);\n            }\n            return reached;\n        }, context);\n        if (background)\n            for (const id of reached)\n                await this.waitForTask(id, context);\n        await this.waitForIdle(conversationId, context);\n    }\n    // ─── Scheduling ────────────────────────────────────────────────────────\n    #observe(publication) {\n        const updated = [];\n        const failed = [];\n        let changed = false;\n        // Edges first, so the tasks a commit creates in a new conversation hang from it.\n        for (const change of publication.changes) {\n            if (change.type === \"conversation\" && !this.#edges.has(change.value.id)) {\n                this.#setEdge(change.value.id, change.value.owner?.taskId ?? null);\n            }\n        }\n        for (const change of publication.changes) {\n            if (change.type !== \"task\")\n                continue;\n            changed = true;\n            const record = change.value;\n            const previous = this.#live.get(record.id);\n            if (failedOutcome(record) && (previous === undefined || !failedOutcome(previous)))\n                failed.push(record.id);\n            this.#track(previous, record);\n            if (record.state.status === \"terminal\") {\n                this.#failedMigrations.delete(record.id);\n                this.#failFastChecks.delete(record.id);\n                this.#taskWaiters.resolve(record.id, record);\n                // Its owner may finalize now.\n                this.#scheduleReconcile();\n                continue;\n            }\n            if (record.abortRequested && previous?.abortRequested !== true) {\n                this.#cascadePending = true;\n                // Signal a run invocation of the newly marked task; its next step ends it.\n                const invocation = this.#invocations.get(record.id);\n                if (invocation?.mode === \"run\")\n                    invocation.controller.abort();\n            }\n            // A request replacing a `restart` mark upgrades the marks of the work below.\n            if (previous?.abortReason !== undefined && record.abortReason === undefined)\n                this.#cascadePending = true;\n            const status = record.state.status;\n            if (status === \"completing\" && previous?.state.status !== \"completing\") {\n                if (cancellationIntent(record))\n                    this.#cascadePending = true;\n                this.#scheduleReconcile();\n            }\n            if (status === \"waiting\" && record.state.policy === \"failFast\" && previous?.state.status !== \"waiting\") {\n                this.#failFastChecks.add(record.id);\n                this.#scheduleReconcile();\n            }\n            // Its owners and place never change: what is above it is checked once, when it becomes live.\n            if (previous === undefined)\n                updated.push(record);\n        }\n        for (const id of failed) {\n            for (const waiter of this.#waiters.get(id) ?? []) {\n                const state = this.#live.get(waiter)?.state;\n                if (state?.status === \"waiting\" && state.policy === \"failFast\") {\n                    this.#failFastChecks.add(waiter);\n                    this.#scheduleReconcile();\n                }\n            }\n        }\n        for (const change of publication.changes) {\n            // A queued input below a cancelled owner is withdrawn, even after its cascade.\n            if (change.type !== \"submission\" || change.value.status !== \"queued\" || change.value.type !== \"input\")\n                continue;\n            // Only an owner with cancellation intent withdraws it; a later intent's mark runs the cascade then.\n            if (this.#intent.size === 0)\n                continue;\n            const conversation = change.value.conversationId;\n            if (!this.#known(conversationNode(conversation)) || this.#belowCancelled({ conversation })) {\n                this.#cascadePending = true;\n            }\n        }\n        for (const record of updated) {\n            // Work created below a cancelled owner, even after its cascade, is aborted too.\n            if (this.#unloaded.has(record.id))\n                this.#scheduleReconcile();\n            else if (!record.background && !record.abortRequested && this.#belowCancelled(parentOf(record))) {\n                this.#cascadePending = true;\n            }\n        }\n        // A cascade that a reservation or step found pending runs with the next commit of any kind.\n        if (this.#cascadePending)\n            this.#scheduleReconcile();\n        this.#sweep();\n        if (!changed)\n            return;\n        this.#settleIdle();\n        this.#kick();\n    }\n    /**\n     * `settings.contextRetentionMs`, or 0 when the host's settings throw. Kept contexts are only a cache, so dropping them\n     * is safe, while a throw here would escape commit listeners, reconciliation, and the expiry timer.\n     */\n    #contextRetentionMs() {\n        try {\n            return this.#settings().contextRetentionMs;\n        }\n        catch (error) {\n            this.#report(error);\n            return 0;\n        }\n    }\n    /** Resolve idle waiters, and drop each kept context whose conversation has been idle for the retention period. */\n    #settleIdle() {\n        for (const conversationId of this.#idleWaiters.keys()) {\n            if (this.#idle(conversationId))\n                this.#idleWaiters.resolve(conversationId);\n        }\n        const now = this.#now();\n        const retention = this.#contextRetentionMs();\n        for (const [conversationId, kept] of this.#contexts) {\n            if (kept.idleSince !== undefined && now - kept.idleSince >= retention) {\n                this.#contexts.delete(conversationId);\n            }\n            else if (!this.#idle(conversationId)) {\n                kept.idleSince = undefined;\n            }\n            else if (retention > 0) {\n                kept.idleSince ??= now;\n            }\n            else {\n                this.#contexts.delete(conversationId);\n            }\n        }\n        this.#scheduleExpiry();\n    }\n    /**\n     * Run `#settleIdle()` when the earliest idle context expires. The timer is unreferenced, so it never keeps the process\n     * alive. Where timers cannot be unreferenced, as in Cloudflare Workers, none is kept: a pending timer could keep a\n     * Durable Object from being evicted, and eviction frees the contexts. There, task changes alone check expiry.\n     */\n    #scheduleExpiry() {\n        const retention = this.#contextRetentionMs();\n        let at;\n        for (const kept of this.#contexts.values()) {\n            if (kept.idleSince !== undefined && (at === undefined || kept.idleSince + retention < at)) {\n                at = kept.idleSince + retention;\n            }\n        }\n        if (this.#expiry !== undefined && this.#expiry.at === at)\n            return;\n        if (this.#expiry !== undefined)\n            clearTimeout(this.#expiry.timer);\n        this.#expiry = undefined;\n        if (at === undefined || this.#closing)\n            return;\n        const timer = setTimeout(() => {\n            this.#expiry = undefined;\n            this.#settleIdle();\n        }, Math.min(Math.max(0, at - this.#now()), MAX_TIMER_DELAY));\n        const unref = timer.unref;\n        if (typeof unref !== \"function\") {\n            clearTimeout(timer);\n            return;\n        }\n        unref.call(timer);\n        this.#expiry = { at, timer };\n    }\n    // ─── Ownership ───────────────────────────────────────────────────────────\n    #scheduleReconcile() {\n        if (this.#reconcileScheduled || this.#closing)\n            return;\n        this.#reconcileScheduled = true;\n        queueMicrotask(() => void this.#reconcile());\n    }\n    /**\n     * One commit that applies what committed records imply: abort marks below live owners with cancellation intent\n     * (spec §5.4), `failFast` marks (spec §5.5), withdrawn queued inputs below cancelled owners, and the final terminal\n     * record of every `completing` task whose ordinary owned work is gone. The durable records are the intent, so this\n     * also repairs whatever a crash left unapplied. Resolves idle waiters that the loaded edges decide.\n     */\n    async #reconcile() {\n        this.#reconcileScheduled = false;\n        const cascade = this.#cascadePending;\n        this.#cascadePending = false;\n        const checks = [...this.#failFastChecks];\n        this.#failFastChecks.clear();\n        try {\n            await this.#session.commitWith(async (tx) => {\n                if (this.#closing)\n                    return;\n                const queued = await this.#loadScopes(cascade);\n                // A cascade from an abandoned owner passes its `restart` reason on; any other intent marks, or upgrades a\n                // `restart` mark, as a request. Collected first, so a request wins over a `restart` mark of the same pass.\n                const marks = new Map();\n                const mark = (record, reason) => {\n                    const staged = marks.get(record.id);\n                    if (staged !== undefined && staged.reason === undefined)\n                        return;\n                    if (record.abortRequested && (record.abortReason === undefined || reason !== undefined))\n                        return;\n                    marks.set(record.id, { record, reason });\n                };\n                // Every live foreground task below a live owner with cancellation intent, which is its nearest one: a walk down\n                // from each owner with intent does not enter another, whose own walk covers what is below it. Derived again on\n                // every pass, as loading edges can reveal a cancelled owner.\n                for (const id of this.#intent) {\n                    const owner = this.#live.get(id);\n                    // Only an owner abandoned after a restart, and nothing else, passes its reason on.\n                    const restart = owner.abortReason === \"restart\" && !failedOutcome(owner);\n                    for (const { node, live } of this.#walkDown(id, { enter: (below) => !this.#intent.has(below) })) {\n                        if (live !== undefined && !node.background)\n                            mark(live, restart ? \"restart\" : undefined);\n                    }\n                }\n                for (const id of checks) {\n                    const waiter = this.#live.get(id);\n                    if (waiter?.state.status !== \"waiting\" || !(await this.#anyFailed(waiter.state.on)))\n                        continue;\n                    // Every other live task: the failed one keeps its own outcome.\n                    for (const member of waiter.state.on) {\n                        const record = this.#live.get(member);\n                        if (record !== undefined && !failedOutcome(record))\n                            mark(record, undefined);\n                    }\n                }\n                for (const { record, reason } of marks.values())\n                    tx.setTask(withAbortMark(record, reason));\n                for (const id of queued)\n                    if (this.#belowCancelled({ conversation: id }))\n                        await this.#withdrawInputs(tx, id);\n                await this.#finalize(tx);\n            }, this.#context);\n        }\n        catch (error) {\n            // No extension code runs in this commit: a throw is a storage failure, a host callback, or a bug. None is fixed by\n            // running the pass again, so it fails the Session, which reports it.\n            this.#failSession(error);\n        }\n        this.#settleIdle();\n    }\n    /** Whether any of `ids` holds or ended with an outcome other than `completed`. */\n    async #anyFailed(ids) {\n        for (const id of ids) {\n            const record = this.#live.get(id) ?? (await this.#storage.task(id, this.#context));\n            if (record !== undefined && failedOutcome(record))\n                return true;\n        }\n        return false;\n    }\n    /**\n     * Write the terminal record of every `completing` task without live ordinary owned work. Finalizing one can free its\n     * owner, so this repeats over the commit's candidates until nothing changes. A held scheduler outcome gets its\n     * Harness cleanup here.\n     */\n    async #finalize(tx) {\n        // A worklist: the tasks that started holding, and the holders of work that ended. Finalizing one can free the\n        // nearest live task above it, which goes on the list. Tasks finalized here have no live work below them, so walks\n        // down skip them.\n        // In rounds: the holders the tasks of one round free are checked once, in the next, so a holder of many tasks that\n        // end together is walked once, not once per task.\n        let round = [...this.#finalizeChecks];\n        this.#finalizeChecks.clear();\n        const done = new Set();\n        const overlay = overlayOf(tx);\n        while (round.length > 0) {\n            const next = new Set();\n            for (const id of round) {\n                const record = overlay.tasks.get(id) ?? this.#live.get(id);\n                if (record?.state.status !== \"completing\" || done.has(id))\n                    continue;\n                if (this.#hasOwnedLive(id, overlay, done))\n                    continue;\n                const outcome = record.state.outcome;\n                const terminal = withState(record, { status: \"terminal\", outcome });\n                tx.setTask(terminal);\n                overlay.tasks.set(id, terminal);\n                done.add(id);\n                // REMINDER: only the scheduler writes `faulted` and `orphaned` (spec §5.4); their cleanup waits for this commit.\n                if (outcome.status === \"faulted\" || outcome.status === \"orphaned\") {\n                    await this.#settleOutcome(tx, record, outcome);\n                }\n                const above = this.#nearestLiveAbove(record, overlay);\n                if (above?.state.status === \"completing\")\n                    next.add(above.id);\n            }\n            round = [...next];\n        }\n    }\n    /**\n     * Load the owner chains of the tasks in `#unloaded` and, with `queued`, of every conversation with queued inputs,\n     * on the Session line; returns the latter. Reads committed Storage directly, so it may run inside a commit callback.\n     */\n    async #loadScopes(queued) {\n        for (const id of [...this.#unloaded]) {\n            // An earlier load in this loop may have passed it.\n            if (this.#unloaded.has(id))\n                await this.#loadChain({ task: id });\n        }\n        if (!queued)\n            return [];\n        const submissions = await scanAll((cursor) => this.#storage.scanSubmissions({ status: \"queued\" }, SCAN_PAGE_SIZE, cursor, this.#context));\n        const inputs = submissions.filter((submission) => submission.type === \"input\");\n        const conversations = [...new Set(inputs.map((submission) => submission.conversationId))];\n        for (const id of conversations)\n            await this.#loadChain({ conversation: id });\n        return conversations;\n    }\n    /**\n     * Load the owner edges and task nodes from `start` up to its ownerless root. A known task outside `#unloaded` ends the\n     * walk, as its chain is loaded; the `#unloaded` tasks passed have a loaded chain afterwards. Loading a node can reveal\n     * a cancelled owner, so it makes the next reconcile derive cascade marks.\n     */\n    async #loadChain(start, overlay) {\n        const passed = [];\n        let at = start;\n        while (at !== undefined) {\n            if (\"task\" in at) {\n                const id = at.task;\n                let node = this.#live.get(id) ?? this.#settled.get(id);\n                // Created in this commit: the load from its own record covers what is above it.\n                if (node === undefined && overlay?.tasks.has(id) === true)\n                    break;\n                if (node !== undefined && !this.#unloaded.has(id))\n                    break;\n                if (node === undefined) {\n                    const record = await this.#storage.task(id, this.#context);\n                    if (record === undefined)\n                        return;\n                    node = nodeOf(record);\n                    if (record.state.status === \"terminal\")\n                        this.#settle(id, node);\n                    // A loaded node can reveal a cancelling owner: the next reconcile derives marks again.\n                    this.#scheduleReconcile();\n                }\n                passed.push(id);\n                at = parentOf(node);\n            }\n            else {\n                let edge = this.#edge(at.conversation, overlay);\n                if (edge === undefined) {\n                    const record = await this.#storage.conversation(at.conversation, this.#context);\n                    edge = record?.owner?.taskId ?? null;\n                    this.#setEdge(at.conversation, edge);\n                    // A loaded node can reveal a cancelling owner: the next reconcile derives marks again.\n                    this.#scheduleReconcile();\n                }\n                at = edge === null ? undefined : { task: edge };\n            }\n        }\n        for (const id of passed)\n            this.#unloaded.delete(id);\n    }\n    #setEdge(conversationId, owner) {\n        this.#edges.set(conversationId, owner);\n        // The conversation now hangs from its owner, or is a root; with nothing below it, it waits for the sweep.\n        this.#relist(conversationNode(conversationId));\n        this.#dropIfUnneeded(conversationNode(conversationId));\n    }\n    /** Know a terminal task a chain load read, so walks pass through it; its own chain is not loaded yet. */\n    #settle(id, node) {\n        this.#settled.set(id, node);\n        this.#unloaded.add(id);\n        this.#relist(id);\n        this.#dropIfUnneeded(id);\n    }\n    /** Queue an ended task or a conversation for the sweep when nothing is listed below it. */\n    #dropIfUnneeded(node) {\n        if (typeof node !== \"string\" && this.#live.has(node))\n            return;\n        if (this.#below.has(node))\n            return;\n        this.#dropQueue.add(node);\n        this.#scheduleSweep();\n    }\n    /**\n     * Sweep in a job of its own on the Session line, after the operation underway: a rejected commit, one with nothing to\n     * write, and a read publish nothing, so the sweep at the end of `#observe` would not run for what they loaded.\n     */\n    #scheduleSweep() {\n        if (this.#sweepScheduled || this.#closing)\n            return;\n        this.#sweepScheduled = true;\n        this.#session\n            .readOnLine(async () => {\n            this.#sweepScheduled = false;\n            this.#sweep();\n        })\n            // Rejected only once the Session is closing or failed, when nothing is kept anyway.\n            .catch(() => { });\n    }\n    /**\n     * Drop the queued nodes that are still unneeded: not live, nothing listed below. Runs once a publication is fully\n     * tracked, and as a job of its own on the line, never inside an operation: work a commit creates below a chain its\n     * own callback loaded keeps that chain. A flat loop: unlisting already queued every node on the way up that lost its\n     * last listed node.\n     */\n    #sweep() {\n        for (const node of this.#dropQueue) {\n            if (this.#below.has(node))\n                continue;\n            if (typeof node === \"string\") {\n                this.#edges.delete(conversationOf(node));\n                this.#roots.delete(conversationOf(node));\n            }\n            else if (!this.#live.has(node)) {\n                this.#settled.delete(node);\n                this.#unloaded.delete(node);\n            }\n        }\n        this.#dropQueue.clear();\n    }\n    /**\n     * Bring the scheduler's sets in line with a task's committed record. A task that ended may free the nearest live task\n     * above it: one holding its outcome finalizes, an abort-marked one runs its abort handler; its waiters may run.\n     */\n    #track(previous, record) {\n        const id = record.id;\n        if (previous?.state.status === \"waiting\")\n            for (const on of previous.state.on)\n                deleteFrom(this.#waiters, on, id);\n        if (record.state.status === \"terminal\") {\n            const node = nodeOf(record);\n            this.#live.delete(id);\n            this.#intent.delete(id);\n            this.#runnable.delete(id);\n            this.#finalizeChecks.delete(id);\n            this.#settled.set(id, node);\n            // Before anything is forgotten: the walk up to the task it held passes the ended tasks between them. Its chain is\n            // loaded, as every commit that ends a task loads the chains of `#unloaded` first.\n            this.#release(node);\n            for (const waiter of this.#waiters.get(id) ?? [])\n                this.#runnable.add(waiter);\n            this.#relist(id);\n            this.#dropIfUnneeded(id);\n            return;\n        }\n        this.#live.set(id, record);\n        if (previous === undefined) {\n            if (!this.#known(parentNode(record)))\n                this.#unloaded.add(id);\n            this.#relist(id);\n        }\n        if (cancellationIntent(record))\n            this.#intent.add(id);\n        else\n            this.#intent.delete(id);\n        if (record.state.status === \"completing\") {\n            this.#runnable.delete(id);\n            this.#finalizeChecks.add(id);\n        }\n        else {\n            this.#runnable.add(id);\n        }\n        if (record.state.status === \"waiting\")\n            for (const on of record.state.on)\n                addTo(this.#waiters, on, id);\n    }\n    /** The nearest live task above ended ordinary work may be free now: one holding its outcome, or an aborting one. */\n    #release(node, overlay) {\n        const above = this.#nearestLiveAbove(node, overlay);\n        if (above?.state.status === \"completing\")\n            this.#finalizeChecks.add(above.id);\n        else if (above?.abortRequested === true)\n            this.#runnable.add(above.id);\n        return above;\n    }\n    /**\n     * List `start` under its parent node in `#below` while it is a live task or has nodes listed below it, and unlist it\n     * otherwise; then its parent, as far up as that changes. So `#below` holds exactly the tree around live work; a\n     * parent that loses its last listed node is queued for the sweep. A loop, as ownership chains can be deeper than the\n     * call stack.\n     */\n    #relist(start) {\n        let node = start;\n        for (;;) {\n            const needed = (typeof node !== \"string\" && this.#live.has(node)) || this.#below.has(node);\n            let parent;\n            if (typeof node === \"string\") {\n                parent = this.#edges.get(conversationOf(node));\n            }\n            else {\n                const known = this.#live.get(node) ?? this.#settled.get(node);\n                if (known === undefined)\n                    return;\n                parent = parentNode(known);\n            }\n            if (parent === undefined)\n                return;\n            if (parent === null) {\n                const root = conversationOf(node);\n                if (needed)\n                    this.#roots.add(root);\n                else\n                    this.#roots.delete(root);\n                return;\n            }\n            if ((this.#below.get(parent)?.has(node) === true) === needed)\n                return;\n            if (needed) {\n                const first = !this.#below.has(parent);\n                addTo(this.#below, parent, node);\n                if (!first)\n                    return;\n            }\n            else {\n                deleteFrom(this.#below, parent, node);\n                if (this.#below.has(parent))\n                    return;\n                this.#dropIfUnneeded(parent);\n            }\n            node = parent;\n        }\n    }\n    /**\n     * The nearest live task above ended ordinary work `node`, in the overlay's view: the one that work held, if any. Work\n     * at or below a background task holds nothing above it.\n     */\n    #nearestLiveAbove(node, overlay) {\n        for (let current = node; !current.background;) {\n            const owner = current.owner ?? this.#edge(current.conversationId, overlay);\n            if (owner === undefined || owner === null)\n                return undefined;\n            const record = overlay?.tasks.get(owner) ?? this.#live.get(owner);\n            if (record !== undefined && record.state.status !== \"terminal\")\n                return record;\n            const above = record ?? this.#settled.get(owner);\n            if (above === undefined)\n                return undefined;\n            current = above;\n        }\n        return undefined;\n    }\n    /** Whether the chain above `node` is loaded, without walking: known tasks outside `#unloaded` have a loaded chain. */\n    #known(node) {\n        if (typeof node !== \"string\") {\n            return (this.#live.has(node) || this.#settled.has(node)) && !this.#unloaded.has(node);\n        }\n        const owner = this.#edges.get(conversationOf(node));\n        return owner === null || (owner !== undefined && this.#known(owner));\n    }\n    /** Owner task of a conversation, `null` when ownerless, `undefined` while not loaded. */\n    #edge(id, overlay) {\n        return overlay?.edges.has(id) === true ? overlay.edges.get(id) : this.#edges.get(id);\n    }\n    #node(id, overlay) {\n        return overlay?.tasks.get(id) ?? this.#live.get(id) ?? this.#settled.get(id);\n    }\n    /** Walk up from `start`: owner tasks and conversations, ending at an ownerless root or an edge not loaded yet. */\n    *#above(start, overlay) {\n        let at = start;\n        while (at !== undefined) {\n            if (\"task\" in at) {\n                const node = this.#node(at.task, overlay);\n                if (node === undefined) {\n                    yield { unknown: true };\n                    return;\n                }\n                yield { task: at.task, node };\n                at = parentOf(node);\n            }\n            else {\n                yield { conversation: at.conversation };\n                const edge = this.#edge(at.conversation, overlay);\n                if (edge === undefined) {\n                    yield { unknown: true };\n                    return;\n                }\n                at = edge === null ? undefined : { task: edge };\n            }\n        }\n    }\n    /**\n     * The tasks below `start` that a walk down reaches: those `#below` lists and, under an overlay, the commit's new tasks,\n     * with its candidates in place of committed records. Background tasks are reached but not entered, unless\n     * `crossBackground`, and neither are the tasks `enter` rejects. A loop, as chains can be deeper than the call stack.\n     */\n    *#walkDown(start, options = {}) {\n        const { overlay, crossBackground = false, enter } = options;\n        const links = overlay === undefined ? undefined : this.#links(overlay);\n        const pending = [start];\n        for (let at = pending.pop(); at !== undefined; at = pending.pop()) {\n            for (const children of [this.#below.get(at), links?.get(at)]) {\n                for (const child of children ?? []) {\n                    if (typeof child === \"string\") {\n                        pending.push(child);\n                        continue;\n                    }\n                    const record = overlay?.tasks.get(child) ?? this.#live.get(child);\n                    const node = record ?? this.#settled.get(child);\n                    if (node === undefined)\n                        continue;\n                    const live = record !== undefined && record.state.status !== \"terminal\" ? record : undefined;\n                    yield { id: child, node, live };\n                    if ((crossBackground || !node.background) && (enter === undefined || enter(child)))\n                        pending.push(child);\n                }\n            }\n        }\n    }\n    /**\n     * The links walks down need for the commit's new tasks: each one under its parent node, then each node above it that\n     * `#below` does not list yet, until one it lists, a live task (always listed), or the chain's end.\n     */\n    #links(overlay) {\n        if (overlay.links !== undefined)\n            return overlay.links;\n        const links = new Map();\n        for (const record of overlay.tasks.values()) {\n            if (this.#live.has(record.id) || this.#settled.has(record.id))\n                continue;\n            let child = record.id;\n            let parent = parentNode(record);\n            while (parent !== undefined && parent !== null && links.get(parent)?.has(child) !== true) {\n                addTo(links, parent, child);\n                if (typeof parent !== \"string\" && (this.#live.has(parent) || overlay.tasks.has(parent)))\n                    break;\n                let above;\n                if (typeof parent === \"string\") {\n                    above = this.#edge(conversationOf(parent), overlay);\n                }\n                else {\n                    const fields = this.#settled.get(parent);\n                    above = fields === undefined ? undefined : parentNode(fields);\n                }\n                if (above !== undefined && above !== null && this.#below.get(above)?.has(parent) === true)\n                    break;\n                child = parent;\n                parent = above;\n            }\n        }\n        overlay.links = links;\n        return links;\n    }\n    /**\n     * The live ordinary owned work of `owner` (spec §5.5): the live non-background tasks below it that a walk down reaches\n     * without entering a background task; with `first`, only the first. Candidates in `overlay` replace committed records;\n     * the walk does not enter tasks in `done`, which have none. Owner chains must be loaded.\n     */\n    #ownedLive(owner, options = {}) {\n        const { overlay, first = false, done } = options;\n        const found = [];\n        const walk = this.#walkDown(owner, {\n            ...(overlay === undefined ? {} : { overlay }),\n            ...(done === undefined ? {} : { enter: (id) => !done.has(id) }),\n        });\n        for (const { id, node, live } of walk) {\n            if (live === undefined || node.background)\n                continue;\n            found.push(id);\n            if (first)\n                break;\n        }\n        return found;\n    }\n    #hasOwnedLive(owner, overlay, done) {\n        const options = {\n            first: true,\n            ...(overlay === undefined ? {} : { overlay }),\n            ...(done === undefined ? {} : { done }),\n        };\n        return this.#ownedLive(owner, options).length > 0;\n    }\n    /**\n     * Whether ordinary traversal from `scope` reaches `start`: walking up reaches the scope's conversation, or an\n     * ownerless one for `roots`, without crossing a background owner, unless `crossBackground`. `undefined` while an\n     * edge is not loaded.\n     */\n    #inScope(start, scope, crossBackground = false) {\n        for (const step of this.#above(start)) {\n            if (\"unknown\" in step)\n                return undefined;\n            if (\"conversation\" in step) {\n                if (\"conversation\" in scope && step.conversation === scope.conversation)\n                    return true;\n            }\n            else if (step.node.background && !crossBackground) {\n                return false;\n            }\n        }\n        return \"roots\" in scope;\n    }\n    /**\n     * Whether a live owner's cancellation intent reaches `start`: walking up finds an owner with intent before a\n     * background owner without it. Terminal owners never cascade (spec §5.4).\n     */\n    #belowCancelled(start) {\n        return this.#cancellingOwner(start) !== undefined;\n    }\n    /** The nearest live owner above `start` whose cancellation intent reaches it, if any; see `#belowCancelled`. */\n    #cancellingOwner(start) {\n        // Nothing cancels, the common case: no walk.\n        if (this.#intent.size === 0)\n            return undefined;\n        for (const step of this.#above(start)) {\n            if (\"unknown\" in step)\n                return undefined;\n            if (!(\"task\" in step))\n                continue;\n            const live = this.#live.get(step.task);\n            if (live !== undefined && cancellationIntent(live))\n                return live;\n            if (step.node.background)\n                return undefined;\n        }\n        return undefined;\n    }\n    /** Fail the Session, which reports it, for a throw in one of the scheduler's own commits; ignored once closing. */\n    #failSession(error) {\n        if (!this.#closing)\n            this.#session.fail(error);\n    }\n    /** Close listener: runs synchronously once admission is sealed, before `join()`, or when the Session fails. */\n    #seal() {\n        this.#closing = true;\n        try {\n            this.#unsubscribeRegistry();\n        }\n        catch (error) {\n            this.#report(error);\n        }\n        const error = closedError(this.#session);\n        this.#taskWaiters.rejectAll(error);\n        this.#idleWaiters.rejectAll(error);\n        this.#contexts.clear();\n        if (this.#expiry !== undefined)\n            clearTimeout(this.#expiry.timer);\n        this.#expiry = undefined;\n    }\n    #kick() {\n        this.#dirty = true;\n        if (this.#draining || !this.#enabled || this.#closing)\n            return;\n        this.#draining = true;\n        // Never commit synchronously from a commit or registry listener.\n        queueMicrotask(() => void this.#drain());\n    }\n    async #drain() {\n        try {\n            while (this.#dirty && this.#enabled && !this.#closing) {\n                this.#dirty = false;\n                for (const reservation of await this.#reserve())\n                    this.#start(reservation);\n            }\n        }\n        catch (error) {\n            // As in `#reconcile()`: the reservation commit runs no extension code.\n            this.#failSession(error);\n        }\n        finally {\n            this.#draining = false;\n            // A wakeup that arrived after the loop's last check still needs its pass.\n            if (this.#dirty)\n                this.#kick();\n        }\n    }\n    /**\n     * Reserve every eligible task in one commit; orphan abort-marked tasks no definition can take, unless abandoned after\n     * a restart. The first pass after open only abort-marks the abandoned tasks, so later passes see the marks.\n     */\n    async #reserve() {\n        const reservations = [];\n        let abandoned = [];\n        try {\n            await this.#session.commitWith(async (tx) => {\n                if (!this.#enabled || this.#closing)\n                    return;\n                for (const id of this.#abandoned) {\n                    const record = this.#live.get(id);\n                    if (record !== undefined && !record.abortRequested)\n                        tx.setTask(withAbortMark(record, \"restart\"));\n                }\n                if (this.#abandoned.size > 0) {\n                    abandoned = [...this.#abandoned];\n                    return;\n                }\n                await this.#loadScopes(false);\n                // Taken once per pass, and only when some task is a candidate.\n                let snapshot;\n                for (const id of [...this.#runnable]) {\n                    const record = this.#live.get(id);\n                    if (record === undefined || record.state.status === \"completing\" || this.#invocations.has(id)) {\n                        this.#runnable.delete(id);\n                        continue;\n                    }\n                    // It returns once what it waits for ends, its record changes, or the work below it ends.\n                    if (this.#waitingOn(record, true).length > 0) {\n                        this.#runnable.delete(id);\n                        continue;\n                    }\n                    const runnable = record;\n                    const mode = record.abortRequested ? \"abort\" : \"run\";\n                    // Work below an owner with cancellation intent waits for its cascade mark instead of running a phase; schedule\n                    // the cascade, which may not have run yet.\n                    if (mode === \"run\" && !record.background && this.#belowCancelled(parentOf(record))) {\n                        this.#cascadePending = true;\n                        this.#scheduleReconcile();\n                        continue;\n                    }\n                    snapshot ??= this.#registry.snapshot();\n                    const resolution = this.#resolve(runnable, snapshot);\n                    if (resolution.kind === \"blocked\") {\n                        // An abandoned task waits for its definition, so its abort handler can clean up.\n                        if (mode === \"abort\" && record.abortReason === undefined) {\n                            await this.#terminate(tx, record, { status: \"orphaned\", reason: resolution.reason });\n                        }\n                        continue;\n                    }\n                    if (resolution.record !== runnable || record.state.status !== \"running\") {\n                        tx.setTask(withState(resolution.record, {\n                            status: \"running\",\n                            checkpoint: resolution.record.state.checkpoint,\n                        }));\n                    }\n                    // Registered on the line, so marks and later reservations see it and close joins it; `#end` makes it a\n                    // candidate again.\n                    this.#runnable.delete(id);\n                    const invocation = this.#createInvocation(record, mode);\n                    reservations.push({ invocation, task: resolution.task, snapshot });\n                }\n            }, this.#context);\n        }\n        catch (error) {\n            for (const { invocation } of reservations) {\n                this.#invocations.delete(invocation.taskId);\n                this.#runnable.add(invocation.taskId);\n                invocation.finish();\n            }\n            throw error;\n        }\n        // Marked, or already marked or gone: done with them. Reserve again, now seeing the marks.\n        for (const id of abandoned)\n            this.#abandoned.delete(id);\n        if (abandoned.length > 0)\n            this.#dirty = true;\n        return reservations;\n    }\n    /**\n     * Live tasks a task waits for before its next invocation: its live ordinary owned work when abort-marked, since\n     * abort runs bottom-up, otherwise the live part of the `on` of a wait.\n     */\n    #waitingOn(record, first = false) {\n        if (record.abortRequested)\n            return this.#ownedLive(record.id, { first });\n        if (record.state.status !== \"waiting\")\n            return [];\n        if (!first)\n            return record.state.on.filter((id) => this.#live.has(id));\n        const live = record.state.on.find((id) => this.#live.has(id));\n        return live === undefined ? [] : [live];\n    }\n    /** Resolve the record's definition by kind, migrating an older stored version. */\n    #resolve(record, snapshot) {\n        const fit = this.#fit(record, snapshot.task(record.kind));\n        if (\"reason\" in fit)\n            return { kind: \"blocked\", reason: fit.reason };\n        if (!fit.migrates)\n            return { kind: \"ready\", task: fit.task, record };\n        const definition = erased(fit.task);\n        try {\n            if (definition.migrate === undefined)\n                throw missingMigration(record, definition);\n            const migrated = definition.migrate(record.input, record.state.checkpoint, record.version);\n            const state = { ...record.state, checkpoint: copyJson(migrated.checkpoint) };\n            const migratedRecord = { ...record, version: definition.version, input: copyJson(migrated.input), state };\n            return { kind: \"ready\", task: fit.task, record: migratedRecord };\n        }\n        catch (error) {\n            this.#failedMigrations.set(record.id, { task: fit.task, error });\n            this.#report(error);\n            return { kind: \"blocked\", reason: \"migration_failed\" };\n        }\n    }\n    #fit(record, task) {\n        if (task === undefined)\n            return { reason: \"missing_task\" };\n        const version = task.definition.version;\n        if (version === record.version)\n            return { task, migrates: false };\n        if (version < record.version)\n            return { reason: \"task_too_old\" };\n        const failed = this.#failedMigrations.get(record.id);\n        if (failed?.task === task)\n            return { reason: \"migration_failed\", error: failed.error };\n        return { task, migrates: true };\n    }\n    /** Sizes of the ownership indexes, for tests that bound the scheduler's memory. */\n    get indexSizes() {\n        let below = 0;\n        for (const children of this.#below.values())\n            below += children.size;\n        return {\n            live: this.#live.size,\n            settled: this.#settled.size,\n            edges: this.#edges.size,\n            below,\n            roots: this.#roots.size,\n            unloaded: this.#unloaded.size,\n            dropQueue: this.#dropQueue.size,\n        };\n    }\n    /**\n     * Scheduling state and every live task with its derived state, read on the Session line. Runs no task code: a\n     * pending migration shows as `ready` with `migrates`, and only a migration the scheduler already tried, or one that\n     * cannot exist, shows as failed.\n     */\n    async inspect(snapshot) {\n        await this.#loadScopes(false);\n        const tasks = [];\n        for (const record of this.#live.values())\n            tasks.push({ record, state: this.#inspectTask(record, snapshot) });\n        const scheduling = this.#closing ? \"closing\" : this.#enabled ? \"running\" : \"paused\";\n        return { scheduling, tasks };\n    }\n    #inspectTask(record, snapshot) {\n        if (this.#invocations.has(record.id))\n            return { kind: \"running\" };\n        if (record.state.status === \"completing\")\n            return { kind: \"completing\" };\n        const on = this.#waitingOn(record);\n        if (on.length > 0)\n            return { kind: \"waiting\", on };\n        const fit = this.#fit(record, snapshot.task(record.kind));\n        if (\"reason\" in fit)\n            return { kind: \"blocked\", ...fit };\n        if (fit.migrates && fit.task.definition.migrate === undefined) {\n            return { kind: \"blocked\", reason: \"migration_failed\", error: missingMigration(record, erased(fit.task)) };\n        }\n        return { kind: \"ready\", migrates: fit.migrates };\n    }\n    #createInvocation(record, mode) {\n        const controller = new AbortController();\n        const { promise: done, resolve: finish } = Promise.withResolvers();\n        const invocation = {\n            taskId: record.id,\n            conversationId: record.conversationId,\n            mode,\n            controller,\n            context: withAbortSignal(controller.signal, this.#context),\n            watches: new Set(),\n            ended: false,\n            done,\n            finish: () => finish(),\n        };\n        this.#invocations.set(record.id, invocation);\n        return invocation;\n    }\n    #start(reservation) {\n        const invocation = reservation.invocation;\n        void (async () => {\n            try {\n                if (invocation.mode === \"run\")\n                    await this.#run(reservation);\n                else\n                    await this.#runAbort(reservation);\n            }\n            catch (error) {\n                this.#report(error);\n            }\n            finally {\n                this.#end(invocation);\n                invocation.finish();\n                this.#kick();\n            }\n        })();\n    }\n    /** Run phase handlers, each preceded by a step that decides on the line whether the invocation continues. */\n    async #run(reservation) {\n        const invocation = reservation.invocation;\n        const state = { task: reservation.task, snapshot: reservation.snapshot, reported: undefined };\n        const phase = { snapshot: () => state.snapshot, task: () => state.task, agent: undefined };\n        const runtime = this.#runtime(invocation, phase);\n        let previous;\n        for (;;) {\n            const current = await this.#step(invocation, (tx, current) => this.#decide(tx, current, previous, state));\n            // Close may seal between the decision and dispatch.\n            if (current === undefined || this.#closing)\n                return;\n            const checkpoint = current.state.checkpoint;\n            // Each phase handler resolves its agent afresh, at first use.\n            phase.agent = undefined;\n            try {\n                await erased(state.task).phases[checkpoint.phase](current, runtime, invocation.context);\n                previous = { checkpoint };\n            }\n            catch (error) {\n                previous = { checkpoint, failure: { error } };\n            }\n        }\n    }\n    /**\n     * Precedence rules for a run invocation, on the line. Rules 1 (terminal, `completing`, or `waiting`) and 2 (closing)\n     * are applied by `#step`. Returns whether the invocation continues with the next phase.\n     */\n    #decide(tx, current, previous, state) {\n        // 3. abort mark: end; a fresh abort invocation starts once the task's ordinary owned work is gone.\n        if (current.abortRequested)\n            return false;\n        // An owner's cancellation intent ends it too, before its cascade marks it; reservation then holds it back.\n        if (!current.background && this.#belowCancelled(parentOf(current))) {\n            this.#cascadePending = true;\n            this.#scheduleReconcile();\n            return false;\n        }\n        if (previous === undefined)\n            return true;\n        // 4. uncaught error.\n        if (previous.failure !== undefined)\n            return { fault: previous.failure.error };\n        // 6. no durable progress.\n        if (jsonEqual(current.state.checkpoint, previous.checkpoint)) {\n            const message = `Task ${current.kind} phase ${previous.checkpoint.phase} returned without durable progress`;\n            return { fault: new Error(message) };\n        }\n        // 5. progress: refresh the snapshot; hand over to a replacement definition that can take the task.\n        state.snapshot = this.#registry.snapshot();\n        const next = state.snapshot.task(current.kind);\n        if (next !== state.task) {\n            if (next !== undefined && canReserve(next, current)) {\n                tx.setTask(withState(current, { status: \"pending\", checkpoint: current.state.checkpoint }));\n                return false;\n            }\n            if (state.reported === undefined || state.reported.task !== next) {\n                state.reported = { task: next };\n                const cause = next === undefined ? \"missing_task\" : \"incompatible_task\";\n                this.#report(new Error(`Task ${current.id} keeps running under its old ${current.kind} definition`, { cause }));\n            }\n        }\n        return true;\n    }\n    /** Run the abort handler once; rules 1, 2, and 4 apply, and returning without an outcome faults. */\n    async #runAbort(reservation) {\n        const invocation = reservation.invocation;\n        const current = this.#live.get(invocation.taskId);\n        if (current === undefined || this.#closing)\n            return;\n        let failure;\n        try {\n            const phase = { snapshot: () => reservation.snapshot, task: () => reservation.task, agent: undefined };\n            const runtime = this.#runtime(invocation, phase);\n            await erased(reservation.task).abort(current, runtime, invocation.context);\n        }\n        catch (error) {\n            failure = { error };\n        }\n        const message = `Abort handler of task ${invocation.taskId} returned without a terminal outcome`;\n        await this.#step(invocation, () => ({ fault: failure?.error ?? new Error(message) }));\n    }\n    /**\n     * One synchronous decision on the Session line. A task that is no longer running (rule 1: terminal, `completing`, or\n     * `waiting`) or a closing Harness (rule 2) ends the invocation without a write; otherwise `decide` may stage a write\n     * and returns whether the invocation continues. Ending happens inside the callback, before a fault's Harness\n     * cleanup. A rejected step, such as admission after close, also ends the invocation.\n     */\n    async #step(invocation, decide) {\n        try {\n            return await this.#session.commitWith(async (tx) => {\n                const found = this.#live.get(invocation.taskId);\n                const current = found?.state.status === \"running\" ? found : undefined;\n                const decision = current !== undefined && !this.#closing ? decide(tx, current) : false;\n                if (decision === true)\n                    return current;\n                this.#end(invocation);\n                if (decision !== false) {\n                    const message = errorMessage(decision.fault);\n                    await this.#terminate(tx, current, { status: \"faulted\", error: { message } });\n                }\n                return undefined;\n            }, this.#context);\n        }\n        catch (error) {\n            // The step writes the scheduler's own decision, a fault or a terminal record; a throw there would otherwise\n            // leave the task running, to be reserved and run again.\n            this.#end(invocation);\n            this.#failSession(error);\n            return undefined;\n        }\n    }\n    /**\n     * Write an outcome the scheduler decided. While the task's ordinary owned work is live it holds as `completing` and\n     * its Harness cleanup waits for the final commit (spec §5.5, rule 4); otherwise it is terminal with its cleanup.\n     */\n    async #terminate(tx, record, outcome) {\n        await this.#loadScopes(false);\n        if (this.#hasOwnedLive(record.id, overlayOf(tx))) {\n            tx.setTask(withState(record, { status: \"completing\", outcome }));\n            return;\n        }\n        tx.setTask(withState(record, { status: \"terminal\", outcome }));\n        await this.#settleOutcome(tx, record, outcome);\n    }\n    /**\n     * Replace a running task's state with what it committed. A terminal state holds as `completing` while ordinary owned\n     * work is live, judged on the commit's candidates, so work the same commit creates below the task counts. A wait is\n     * validated first.\n     */\n    async #commitState(tx, invocation, current, next) {\n        if (next.status === \"waiting\")\n            await this.#validateWait(tx, invocation, current, next.on, next.policy);\n        if (next.status === \"terminal\") {\n            const overlay = overlayOf(tx);\n            await this.#loadScopes(false);\n            for (const record of overlay.tasks.values())\n                await this.#loadChain(parentOf(record), overlay);\n            if (this.#hasOwnedLive(current.id, overlay)) {\n                tx.setTask(withState(current, { status: \"completing\", outcome: next.outcome }));\n                return;\n            }\n        }\n        tx.setTask(withState(current, next));\n    }\n    /**\n     * A wait names existing tasks, and `failFast` only tasks the waiter owns. It may not close a cycle in the wait-for\n     * graph, whose edges run from each task to what it waits on and to its live ordinary owned work (spec §5.5); waiting\n     * on itself or on an owner holding it are the shortest such cycles. An abort handler cannot wait.\n     *\n     * Invariant: the wait-for graph is acyclic. Only a wait adds an edge between existing tasks, as a new task has only\n     * incoming edges, so checking each wait maintains it.\n     */\n    async #validateWait(tx, invocation, current, on, policy) {\n        if (invocation.mode === \"abort\")\n            throw new Error(`Abort handler of task ${current.id} cannot wait`);\n        const overlay = overlayOf(tx);\n        const targets = [];\n        for (const id of on) {\n            const member = overlay.tasks.get(id) ?? this.#live.get(id) ?? (await this.#storage.task(id, this.#context));\n            if (member === undefined)\n                throw new Error(`Task ${id} does not exist`);\n            if (policy === \"failFast\" && member.owner !== current.id) {\n                throw new Error(`Task ${current.id} can wait failFast only on tasks it owns; ${id} is not one`);\n            }\n            // A live child already holds the waiter (task-owned tasks are never background): waiting on it adds no edge. A\n            // terminal task has no edges.\n            if (member.state.status !== \"terminal\" && member.owner !== current.id)\n                targets.push(id);\n        }\n        if (targets.length === 0)\n            return;\n        const cycle = await this.#waitCycle(current.id, targets, overlay);\n        if (cycle !== undefined) {\n            throw new Error(`Task ${current.id} cannot wait on ${cycle[0]}: ${[current.id, ...cycle].join(\" -> \")} is a wait cycle`);\n        }\n    }\n    /**\n     * The path from a member of `on` back to `task` in the wait-for graph, if the wait would close a cycle (spec §5.1).\n     * An edge X -> Y means X cannot settle before Y: Y is in the `on` of waiting X that is not abort-marked, or Y is live\n     * ordinary owned work of X,\n     * which holds X as `completing`. Each task is visited once and each subtree walked once, so a check is bounded by the\n     * live work it reaches.\n     */\n    async #waitCycle(task, on, overlay) {\n        // Owned work is found by walks down, which need the chains of every live task loaded.\n        await this.#loadScopes(false);\n        const from = new Map();\n        const walked = new Set();\n        const pending = [];\n        const reach = (id, via) => {\n            if (from.has(id))\n                return;\n            from.set(id, via);\n            pending.push(id);\n        };\n        const path = (end) => {\n            const steps = [];\n            for (let at = end; at !== undefined; at = from.get(at))\n                steps.unshift(at);\n            return steps;\n        };\n        for (const id of on)\n            reach(id, undefined);\n        for (let id = pending.pop(); id !== undefined; id = pending.pop()) {\n            if (id === task)\n                return path(id);\n            const record = overlay.tasks.get(id) ?? this.#live.get(id);\n            if (record === undefined || record.state.status === \"terminal\")\n                continue;\n            // An abort-marked task waits only for its owned work, as abort runs bottom-up (`#waitingOn`).\n            if (record.state.status === \"waiting\" && !record.abortRequested) {\n                for (const member of record.state.on)\n                    reach(member, id);\n            }\n            if (walked.has(id))\n                continue;\n            walked.add(id);\n            // Below a walked task the walk does not go again: its own walk covered what lies below.\n            const found = [];\n            const walk = this.#walkDown(id, { overlay, enter: (below) => !walked.has(below) });\n            for (const { id: below, node, live } of walk) {\n                if (live === undefined || node.background)\n                    continue;\n                found.push(below);\n                reach(below, id);\n            }\n            for (const below of found)\n                walked.add(below);\n        }\n        return undefined;\n    }\n    /** End an invocation: its runtime operations reject from now on, its signal aborts, its watches stop, and its task is free. */\n    #end(invocation) {\n        if (invocation.ended)\n            return;\n        invocation.ended = true;\n        if (this.#invocations.get(invocation.taskId) === invocation) {\n            this.#invocations.delete(invocation.taskId);\n            if (this.#live.has(invocation.taskId))\n                this.#runnable.add(invocation.taskId);\n        }\n        for (const watch of invocation.watches)\n            void watch.stop();\n        // Pending waits bound to the invocation, such as a tool's waitForTask(), reject with it.\n        invocation.controller.abort(endedError(invocation));\n    }\n    /** No live non-background task in the scope; a task whose owner edges are not loaded yet counts as inside. */\n    #idle(conversationId) {\n        const scope = conversationId === undefined ? { roots: true } : { conversation: conversationId };\n        // Tasks whose chain is not loaded are not listed below their scope yet; one counts as inside unless its walk up\n        // decides otherwise.\n        for (const id of this.#unloaded) {\n            const record = this.#live.get(id);\n            if (record !== undefined && !record.background && this.#inScope(parentOf(record), scope) !== false)\n                return false;\n        }\n        const starts = conversationId === undefined ? this.#roots : [conversationId];\n        for (const start of starts) {\n            for (const { node, live } of this.#walkDown(conversationNode(start))) {\n                if (live !== undefined && !node.background)\n                    return false;\n            }\n        }\n        return true;\n    }\n    // ─── Invocation runtime ──────────────────────────────────────────────────\n    #runtime(invocation, phase) {\n        // Resolved at most once per phase handler, at first use, with the invocation's context; fixed for the phase.\n        const agent = () => {\n            if (invocation.ended)\n                return Promise.reject(endedError(invocation));\n            if (phase.agent === undefined) {\n                phase.agent = this.#agent(invocation.conversationId, phase.snapshot(), invocation.context);\n                // A caller that stops waiting must not leave the shared resolution's failure unobserved.\n                phase.agent.catch(() => { });\n            }\n            return phase.agent;\n        };\n        const hooks = {\n            each: async (name, invoke) => {\n                for (const handlers of agentHooks(await agent(), phase.task().definition.name)) {\n                    const handler = handlers[name];\n                    if (typeof handler !== \"function\")\n                        continue;\n                    try {\n                        await invoke(handler.bind(handlers));\n                    }\n                    catch (error) {\n                        if (invocation.controller.signal.aborted)\n                            throw error;\n                        this.#report(error);\n                    }\n                }\n            },\n        };\n        const settings = this.#settings;\n        return {\n            taskId: invocation.taskId,\n            conversationId: invocation.conversationId,\n            signal: invocation.controller.signal,\n            models: this.#models,\n            agent: (context) => invocation.ended ? Promise.reject(endedError(invocation)) : awaitWithContext(agent(), context),\n            get settings() {\n                return settings();\n            },\n            env: (context) => this.#read(invocation, () => this.#env(invocation.conversationId, context)),\n            hooks: hooks,\n            get registry() {\n                return phase.snapshot();\n            },\n            commit: (change, context) => this.#gated(invocation, async (tx, current) => {\n                const next = await change(tx, current);\n                if (next !== undefined)\n                    await this.#commitState(tx, invocation, current, next);\n            }, context),\n            memo: ((name, ...rest) => {\n                if (rest.length === 1) {\n                    return this.#read(invocation, async () => memoOf(this.#live.get(invocation.taskId), name));\n                }\n                const candidate = rest[0];\n                return this.#gated(invocation, (tx, current) => {\n                    const winner = memoOf(current, name);\n                    if (winner !== undefined)\n                        return winner;\n                    tx.setTask({ ...current, memos: { ...current.memos, [name]: candidate } });\n                    return candidate;\n                }, rest[1]);\n            }),\n            sleep: (until, context) => this.#sleep(invocation, until, context),\n            watchDoc: ((...args) => this.#watchDoc(invocation, args)),\n            snapshot: ((...args) => this.#read(invocation, () => sessionMethod(this.#session, \"snapshot\")(...args))),\n            snapshotAsOf: ((...args) => this.#read(invocation, () => sessionMethod(this.#session, \"snapshotAsOf\")(...args))),\n            getTask: ((id, context) => this.#read(invocation, () => this.#session.readOnLine(() => this.#storage.task(id, context)))),\n            waitForTask: ((id, context) => this.#read(invocation, () => this.waitForTask(id, withAbortSignal(invocation.controller.signal, context)))),\n            ownedTasks: (context) => this.#read(invocation, () => this.#session.readOnLine(async () => {\n                // The step that ends the invocation may have run on the line before this.\n                if (invocation.ended)\n                    throw endedError(invocation);\n                context.abortSignal?.throwIfAborted();\n                // Every live task is listed under its parent node, its owner task when it has one.\n                const owned = [];\n                for (const node of this.#below.get(invocation.taskId) ?? []) {\n                    const record = typeof node === \"string\" ? undefined : this.#live.get(node);\n                    if (record?.owner === invocation.taskId)\n                        owned.push(record);\n                }\n                // Copies, as from storage: the scheduler reads its own.\n                return owned\n                    .sort((a, b) => a.id - b.id)\n                    .map((record) => copyJson(record));\n            })),\n            abortOwned: (id, context) => this.#read(invocation, async () => {\n                const bound = withAbortSignal(invocation.controller.signal, context);\n                const record = await this.#session.readOnLine(() => this.#storage.task(id, bound));\n                if (record?.owner !== invocation.taskId) {\n                    throw new Error(`Task ${id} is not owned by task ${invocation.taskId}`);\n                }\n                if (record.state.status === \"terminal\")\n                    return;\n                await this.abort(id, bound, true);\n                await this.waitForTask(id, bound);\n            }),\n            outcomes: ((ids, context) => this.#read(invocation, () => this.#session.readOnLine(async () => {\n                const outcomes = [];\n                for (const id of ids) {\n                    const state = (await this.#storage.task(id, context))?.state;\n                    if (state?.status !== \"terminal\")\n                        throw new Error(`Task ${id} is not terminal`);\n                    outcomes.push(state.outcome);\n                }\n                return outcomes;\n            }))),\n            conversation: (id, context) => this.#read(invocation, () => this.#conversation(id, {\n                signal: invocation.controller.signal,\n                check: () => {\n                    if (invocation.ended)\n                        throw endedError(invocation);\n                },\n            }, context)),\n            entry: ((...args) => {\n                const [token, id, context] = args.length === 2\n                    ? [undefined, args[0], args[1]]\n                    : [args[0], args[1], args[2]];\n                return this.#read(invocation, async () => {\n                    const found = await this.#session.readOnLine(() => this.#storage.entry(invocation.conversationId, id, context));\n                    const entry = found?.entry;\n                    return token === undefined || entry?.kind === token.kind ? entry : undefined;\n                });\n            }),\n            context: (conversationId, context, options) => this.#read(invocation, async () => {\n                const { view, range } = await readContextFrom(this.#session, this.#storage, conversationId, context, options?.at, this.#contexts.get(conversationId)?.range);\n                // Keep it unless the invocation ended or a concurrent read already kept a newer range.\n                const kept = this.#contexts.get(conversationId);\n                if (range !== undefined &&\n                    !this.#closing &&\n                    !invocation.ended &&\n                    (kept === undefined || kept.range.bounds.tail <= range.bounds.tail)) {\n                    // A read of another, idle conversation starts or continues its retention period.\n                    if (!this.#idle(conversationId)) {\n                        this.#contexts.set(conversationId, { range, idleSince: undefined });\n                    }\n                    else if (this.#contextRetentionMs() > 0) {\n                        this.#contexts.set(conversationId, { range, idleSince: kept?.idleSince ?? this.#now() });\n                        this.#scheduleExpiry();\n                    }\n                }\n                return view;\n            }),\n            now: () => {\n                if (invocation.ended)\n                    throw endedError(invocation);\n                return this.#now();\n            },\n            report: (error) => {\n                if (invocation.ended)\n                    throw endedError(invocation);\n                this.#report(error);\n            },\n        };\n    }\n    /** Run a committed-state read unless the invocation has ended. */\n    async #read(invocation, read) {\n        if (invocation.ended)\n            throw endedError(invocation);\n        return read();\n    }\n    /** Commit after rereading the task on the line and gating the invocation. */\n    #gated(invocation, change, context) {\n        if (invocation.ended)\n            return Promise.reject(endedError(invocation));\n        return this.#session.commitWith(async (tx) => {\n            if (invocation.ended)\n                throw endedError(invocation);\n            if (this.#closing)\n                throw closedError(this.#session);\n            const found = this.#live.get(invocation.taskId);\n            if (found === undefined)\n                throw new Error(`Task ${invocation.taskId} is terminal`);\n            if (found.state.status !== \"running\")\n                throw new Error(`Task ${invocation.taskId} is ${found.state.status}`);\n            const current = found;\n            if (invocation.mode === \"run\" && current.abortRequested) {\n                throw new Error(`Task ${invocation.taskId} has a durable abort mark`);\n            }\n            return change(tx, current);\n        }, context, { conversationId: invocation.conversationId, taskId: invocation.taskId });\n    }\n    /** Wait until the Harness clock reaches `until`, rechecking it after every timer. */\n    async #sleep(invocation, until, context) {\n        if (invocation.ended)\n            throw endedError(invocation);\n        const signals = [invocation.controller.signal];\n        if (context.abortSignal !== undefined)\n            signals.push(context.abortSignal);\n        const signal = AbortSignal.any(signals);\n        for (;;) {\n            signal.throwIfAborted();\n            const remaining = until - this.#now();\n            if (remaining <= 0)\n                return;\n            await delay(Math.min(remaining, MAX_TIMER_DELAY), signal);\n        }\n    }\n    async #watchDoc(invocation, args) {\n        if (invocation.ended)\n            throw endedError(invocation);\n        const watch = (await sessionMethod(this.#session, \"watchDoc\")(...args));\n        if (watch === undefined)\n            return undefined;\n        if (invocation.ended) {\n            void watch.stop();\n            throw endedError(invocation);\n        }\n        invocation.watches.add(watch);\n        void watch.closed.then(() => invocation.watches.delete(watch));\n        return watch;\n    }\n}\n/** The record with an abort mark: `restart` for an abandonment; without a reason, a request, which replaces `restart`. */\nfunction withAbortMark(record, reason) {\n    const { abortReason: _reason, ...rest } = record;\n    return { ...rest, abortRequested: true, ...(reason === undefined ? {} : { abortReason: reason }) };\n}\n/** A live owner's durable cancellation intent: its abort mark, or a held outcome other than `completed`. */\nfunction cancellationIntent(record) {\n    return record.state.status !== \"terminal\" && (record.abortRequested || failedOutcome(record));\n}\n/** Whether the record holds or ends with an outcome other than `completed`. */\nfunction failedOutcome(record) {\n    const state = record.state;\n    return (state.status === \"completing\" || state.status === \"terminal\") && state.outcome.status !== \"completed\";\n}\nfunction parentOf(node) {\n    return node.owner !== undefined ? { task: node.owner } : { conversation: node.conversationId };\n}\nfunction nodeOf(record) {\n    return {\n        conversationId: record.conversationId,\n        ...(record.owner === undefined ? {} : { owner: record.owner }),\n        background: record.background,\n    };\n}\nfunction overlayOf(tx) {\n    const tasks = new Map(tx.stagedTasks().map((record) => [record.id, record]));\n    const edges = new Map(tx.stagedConversations().map((record) => [record.id, record.owner?.taskId ?? null]));\n    return { tasks, edges };\n}\nfunction addTo(map, key, value) {\n    const values = map.get(key);\n    if (values === undefined)\n        map.set(key, new Set([value]));\n    else\n        values.add(value);\n}\nfunction deleteFrom(map, key, value) {\n    const values = map.get(key);\n    if (values === undefined)\n        return;\n    values.delete(value);\n    if (values.size === 0)\n        map.delete(key);\n}\n/** Own memo entry only; memo names such as `toString` must not resolve to inherited properties. */\nfunction memoOf(record, name) {\n    const memos = record?.memos;\n    return memos !== undefined && Object.hasOwn(memos, name) ? memos[name] : undefined;\n}\n/** Overloaded Session method bound for forwarding an argument list unchanged. */\nfunction sessionMethod(session, name) {\n    return session[name].bind(session);\n}\nfunction missingMigration(record, definition) {\n    return new Error(`Task ${record.kind} version ${definition.version} has no migration from ${record.version}`);\n}\nfunction erased(task) {\n    return task.definition;\n}\nfunction endedError(invocation) {\n    return new Error(`Task ${invocation.taskId} invocation has ended`);\n}\n/** Replace a live record's state; memos disappear once an outcome is decided. */\nfunction withState(record, state) {\n    if (state.status !== \"terminal\" && state.status !== \"completing\")\n        return { ...record, state };\n    const { memos: _memos, ...rest } = record;\n    return { ...rest, state };\n}\n/** Whether a definition can take the task at reservation: same version, or newer with a migration. */\nfunction canReserve(task, record) {\n    const definition = task.definition;\n    return (definition.version === record.version || (definition.version > record.version && definition.migrate !== undefined));\n}\nfunction delay(ms, signal) {\n    return new Promise((resolve, reject) => {\n        const onAbort = () => {\n            clearTimeout(timer);\n            reject(signal.reason);\n        };\n        const timer = setTimeout(() => {\n            signal.removeEventListener(\"abort\", onAbort);\n            resolve();\n        }, ms);\n        signal.addEventListener(\"abort\", onAbort, { once: true });\n    });\n}\n/** Structural equality of two JSON values; object key order is ignored. */\nfunction jsonEqual(left, right) {\n    if (left === right)\n        return true;\n    if (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null)\n        return false;\n    if (Array.isArray(left) || Array.isArray(right)) {\n        if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length)\n            return false;\n        return left.every((value, index) => jsonEqual(value, right[index]));\n    }\n    const keys = Object.keys(left);\n    if (keys.length !== Object.keys(right).length)\n        return false;\n    return keys.every((key) => Object.hasOwn(right, key) && jsonEqual(left[key], right[key]));\n}\n//# sourceMappingURL=scheduler.js.map","import { replicatedState } from \"@earendil-works/chord\";\nimport { withoutAbortSignal } from \"@earendil-works/chord/context\";\nimport { applyImmutable } from \"@earendil-works/chord/delta\";\nimport { CommittedStateSource, CommittedWatch } from \"../session/observation.js\";\nimport { contained } from \"../session/session.js\";\nimport { closedError, scanAll } from \"./util.js\";\nconst LIVE_STATUSES = [\"pending\", \"running\", \"waiting\", \"completing\"];\nconst SCAN_PAGE_SIZE = 256;\n/**\n * The Harness's task graph mount: built on the Session line by its first observer and dropped with its last. It\n * advances from the Session's commit publications, which are durable.\n */\nexport class TaskGraphView {\n    #session;\n    #storage;\n    #mount;\n    #closed = false;\n    constructor(session, storage) {\n        this.#session = session;\n        this.#storage = storage;\n        session.observeCommits((publication, context) => {\n            if (this.#mount !== undefined)\n                advance(this.#mount, publication, context, (error) => session.report(error));\n        });\n        session.subscribeClose(() => {\n            this.#closed = true;\n            for (const observer of [...(this.#mount?.observers ?? [])]) {\n                contained(() => observer.closeSession(this.#session.failure), (error) => session.report(error));\n            }\n            this.#mount = undefined;\n        });\n    }\n    /** A disposable read-only Chord state of the graph. */\n    async state(context) {\n        const { observer, detach } = await this.#attach((value, release) => new CommittedStateSource(value, release), context);\n        try {\n            return replicatedState(observer, { onError: (error) => this.#session.report(error) });\n        }\n        catch (error) {\n            detach();\n            throw error;\n        }\n    }\n    /** A serialized exact-frame watch of the graph; cancelling `context` stops it. */\n    async watch(context) {\n        const { observer } = await this.#attach((value, release) => new CommittedWatch(value, release, (error) => this.#session.report(error)), context);\n        const signal = context.abortSignal;\n        if (signal?.aborted) {\n            observer.cancel();\n            throw signal.reason;\n        }\n        if (signal !== undefined)\n            observer.observeCancellation(signal);\n        return observer;\n    }\n    /** Register an observer created from the current revision, atomically on the Session line. */\n    #attach(create, context) {\n        return this.#session.readOnLine(async () => {\n            const mount = this.#mount ?? { value: await this.#build(context), observers: new Set() };\n            const detach = () => {\n                mount.observers.delete(observer);\n                if (mount.observers.size === 0 && this.#mount === mount)\n                    this.#mount = undefined;\n            };\n            const observer = create(mount.value, detach);\n            // Close or cancellation may begin while the mount builds; register nothing then.\n            if (this.#closed)\n                throw closedError(this.#session);\n            context.abortSignal?.throwIfAborted();\n            this.#mount = mount;\n            mount.observers.add(observer);\n            return { observer, detach };\n        });\n    }\n    async #build(context) {\n        const tasks = {};\n        const records = [];\n        for (const status of LIVE_STATUSES) {\n            records.push(...(await scanAll((cursor) => this.#storage.scanTasks({ status }, SCAN_PAGE_SIZE, cursor, context))));\n        }\n        records.sort((a, b) => a.id - b.id);\n        for (const record of records) {\n            const owned = await scanAll((cursor) => this.#storage.scanConversations({ ownerTaskId: record.id }, SCAN_PAGE_SIZE, cursor, context));\n            const conversations = owned.map((conversation) => conversation.id).sort((a, b) => a - b);\n            tasks[String(record.id)] = nodeOf(record, conversations);\n        }\n        return { tasks };\n    }\n}\n/**\n * Derive the mount's operations from one publication, apply them, and hand the revision to every observer; one that\n * throws is reported through `report`, and the others still get it.\n */\nfunction advance(mount, publication, context, report) {\n    const ops = [];\n    // Nodes this publication set or deleted, over the mount's value.\n    const changed = new Map();\n    const node = (key) => changed.has(key) ? changed.get(key) : mount.value.tasks[key];\n    for (const change of publication.changes) {\n        if (change.type !== \"task\")\n            continue;\n        const record = change.value;\n        const key = String(record.id);\n        const previous = node(key);\n        if (record.state.status === \"terminal\") {\n            if (previous === undefined)\n                continue;\n            ops.push([\"d\", [\"tasks\", key]]);\n            changed.set(key, undefined);\n            continue;\n        }\n        const next = nodeOf(record, previous?.conversations ?? []);\n        if (previous !== undefined && JSON.stringify(next) === JSON.stringify(previous))\n            continue;\n        ops.push([\"s\", [\"tasks\", key], next]);\n        changed.set(key, next);\n    }\n    // After the tasks, so a conversation created with its owner task in one commit finds the owner's node. Change order\n    // within a publication is unspecified, so each owner's list is sorted again.\n    const created = new Map();\n    for (const change of publication.changes) {\n        if (change.type !== \"conversation\" || change.value.owner === undefined)\n            continue;\n        const key = String(change.value.owner.taskId);\n        if (node(key) !== undefined)\n            created.set(key, [...(created.get(key) ?? []), change.value.id]);\n    }\n    for (const [key, ids] of created) {\n        const conversations = [...node(key).conversations, ...ids].sort((a, b) => a - b);\n        ops.push([\"s\", [\"tasks\", key, \"conversations\"], conversations]);\n    }\n    if (ops.length === 0)\n        return;\n    mount.value = applyImmutable(mount.value, ops);\n    const frameContext = withoutAbortSignal(context);\n    for (const observer of [...mount.observers])\n        contained(() => observer.advance(mount.value, ops, frameContext), report);\n}\nfunction nodeOf(record, conversations) {\n    return {\n        id: record.id,\n        kind: record.kind,\n        conversationId: record.conversationId,\n        ...(record.owner === undefined ? {} : { owner: record.owner }),\n        background: record.background,\n        abortRequested: record.abortRequested,\n        state: stateOf(record),\n        conversations,\n    };\n}\nfunction stateOf(record) {\n    const state = record.state;\n    switch (state.status) {\n        case \"pending\":\n        case \"running\":\n            return { status: state.status, phase: phaseOf(state.checkpoint) };\n        case \"waiting\":\n            return { status: \"waiting\", phase: phaseOf(state.checkpoint), on: [...state.on], policy: state.policy };\n        // Terminal records never reach here: they leave the graph.\n        case \"completing\":\n        case \"terminal\":\n            return { status: \"completing\", outcome: state.outcome.status };\n    }\n}\nfunction phaseOf(checkpoint) {\n    return checkpoint.phase;\n}\n//# sourceMappingURL=task-graph.js.map","import { withAbortSignal, withoutAbortSignal } from \"@earendil-works/chord/context\";\nimport { ResetEntry } from \"../entries.js\";\nimport { contained, SessionImpl } from \"../session/session.js\";\nimport { ROOT_CONVERSATION_ID } from \"../types.js\";\nimport { AgentDoc, configure, createAgent, resolveAgent, resolveSettings } from \"./agent.js\";\nimport { createCompaction } from \"./compaction.js\";\nimport { readContext } from \"./context.js\";\nimport { InboxDoc, withdrawQueuedInputs } from \"./inbox.js\";\nimport { LiveDoc, settleSchedulerOutcome } from \"./live.js\";\nimport { ProviderDoc } from \"./provider.js\";\nimport { BUILTIN_TASKS } from \"./registry.js\";\nimport { TaskScheduler } from \"./scheduler.js\";\nimport { Submissions } from \"./submissions.js\";\nimport { TaskGraphView } from \"./task-graph.js\";\nimport { addUsageState, UsageDoc } from \"./usage.js\";\nimport { scanAll } from \"./util.js\";\nimport { ConversationViews } from \"./view.js\";\nconst SCAN_PAGE_SIZE = 256;\n/** Key of the Harness's internal index-size getter, for tests. */\nexport const SCHEDULER_INDEX_SIZES = Symbol.for(\"pi-durable.schedulerIndexSizes\");\nclass ConversationImpl {\n    id;\n    #host;\n    constructor(id, host) {\n        this.id = id;\n        this.#host = host;\n    }\n    agent(context) {\n        return this.#host.harness.resolveAgent(this.id, undefined, context);\n    }\n    configure(change, context) {\n        return this.#host.harness.commitWith((tx) => configure(tx, this.id, change), context);\n    }\n    submit(submission, context) {\n        return this.#host.submissions.submit(this.id, submission, context);\n    }\n    compact(instructions, context) {\n        this.#host.tasks.resume();\n        const input = { reason: \"manual\", ...(instructions === undefined ? {} : { instructions }) };\n        return this.#host.harness.commitWith((tx) => createCompaction(tx, this.id, input), context);\n    }\n    async reset(handoff, context) {\n        const model = handoff === undefined\n            ? {}\n            : { model: [{ role: \"user\", content: handoff, timestamp: this.#host.now() }] };\n        const entry = { kind: ResetEntry.kind, head: \"self\", ...model };\n        await this.#host.submissions.submit(this.id, { type: \"write\", entry }, context);\n    }\n    commit(change, context) {\n        return this.#host.harness.commitWith(change, context, { conversationId: this.id });\n    }\n    context(context, options) {\n        return readContext(this.#host.harness, this.#host.storage, this.id, context, options?.at);\n    }\n    entries(query, limit, cursor, context) {\n        const bounded = {\n            conversationId: this.id,\n            ...(query.minEntryId === undefined ? {} : { minEntryId: query.minEntryId }),\n            ...(query.maxEntryId === undefined ? {} : { maxEntryId: query.maxEntryId }),\n            ...(query.order === undefined ? {} : { order: query.order }),\n        };\n        return this.#host.harness.readOnLine(() => this.#host.storage.scanEntries(bounded, limit, cursor, context));\n    }\n    fork(at, options, context) {\n        return this.#host.create({ kind: \"fork\", parentId: this.id, at, ownership: options.ownership }, options, context);\n    }\n    abort(context, options) {\n        this.#host.tasks.resume();\n        return this.#host.tasks.abortConversation(this.id, options?.background === true, context);\n    }\n    waitForIdle(context) {\n        this.#host.tasks.resume();\n        return this.#host.tasks.waitForIdle(this.id, context);\n    }\n    viewState(context) {\n        return this.#host.views.state(this.id, context);\n    }\n    watch(context) {\n        return this.#host.views.watch(this.id, context);\n    }\n}\n/** Session kernel extended with conversation handles and a registry. */\nclass HarnessImpl extends SessionImpl {\n    #options;\n    #report;\n    #host;\n    #tasks;\n    #submissions;\n    #taskGraph;\n    constructor(rawStorage, options, context) {\n        const report = safeReport(options.onReport);\n        const now = safeNow(options.now, report);\n        // Read at each use, as all settings are, but only this field: it is read on every commit.\n        super(rawStorage, now, () => options.settings?.documentRetentionMs);\n        // Every component reads and writes through the Session's failure guard: `rawStorage` serves only `super()`.\n        const storage = this.storage;\n        this.#options = options;\n        this.#report = report;\n        const settings = () => resolveSettings(options.settings);\n        this.#tasks = new TaskScheduler({\n            session: this,\n            storage,\n            registry: options.registry,\n            models: options.models,\n            agent: (id, snapshot, callContext) => this.resolveAgent(id, snapshot, callContext),\n            settings,\n            env: (id, callContext) => this.buildEnv(id, callContext),\n            now,\n            report: this.#report,\n            settleOutcome: settleSchedulerOutcome,\n            withdrawInputs: withdrawQueuedInputs,\n            conversation: async (id, binding, callContext) => {\n                const record = await this.readOnLine(() => storage.conversation(id, callContext));\n                return record === undefined ? undefined : boundConversation(id, binding, this.#submissions, this.#tasks);\n            },\n            context: withoutAbortSignal(context),\n        });\n        this.#submissions = new Submissions(this, storage, now, settings, () => this.#tasks.resume());\n        this.#taskGraph = new TaskGraphView(this, storage);\n        this.#host = {\n            harness: this,\n            storage,\n            tasks: this.#tasks,\n            submissions: this.#submissions,\n            views: new ConversationViews(this, storage),\n            now,\n            create: (target, createOptions, context) => this.#create(target, createOptions, context),\n        };\n    }\n    /** Resolve a conversation's committed `pi.agent` against `snapshot`, or the current one, and the current settings. */\n    async resolveAgent(id, snapshot, context) {\n        const registry = snapshot ?? this.#options.registry.snapshot();\n        const state = await this.snapshot(AgentDoc, id, context);\n        return resolveAgent(state, registry, resolveSettings(this.#options.settings), this.#report);\n    }\n    /** Build a conversation's environment from its current `cwd`; `undefined` without an `env` option. */\n    async buildEnv(id, context) {\n        const build = this.#options.env;\n        if (build === undefined)\n            return undefined;\n        const cwd = (await this.snapshot(AgentDoc, id, context))?.cwd;\n        return build({ conversationId: id, ...(cwd === undefined ? {} : { cwd }), read: this }, context);\n    }\n    /** Reconcile surviving `running` tasks to `pending`; part of open. */\n    openTasks(context) {\n        return this.#tasks.open(context);\n    }\n    resume() {\n        this.assertUsable();\n        this.#tasks.resume();\n    }\n    getTask(id, context) {\n        return this.readOnLine(() => this.storage.task(id, context));\n    }\n    /** Internal, for tests: sizes of the scheduler's ownership indexes. */\n    get [SCHEDULER_INDEX_SIZES]() {\n        return this.#tasks.indexSizes;\n    }\n    inspect(context) {\n        return this.readOnLine(async () => {\n            const { scheduling, tasks } = await this.#tasks.inspect(this.#options.registry.snapshot());\n            const scan = (status) => scanAll((cursor) => this.storage.scanSubmissions({ status }, SCAN_PAGE_SIZE, cursor, context));\n            const submissions = [...(await scan(\"queued\")), ...(await scan(\"placed\"))].sort((a, b) => a.id - b.id);\n            return { scheduling, tasks, submissions };\n        });\n    }\n    submission(id, context) {\n        return this.#submissions.get(id, context);\n    }\n    abortSubmission(id, context, conversationId) {\n        return this.#submissions.abort(id, context, conversationId);\n    }\n    abortTask(id, context) {\n        return this.#tasks.abort(id, context);\n    }\n    waitForTask(id, context) {\n        this.#tasks.resume();\n        return this.#tasks.waitForTask(id, context);\n    }\n    waitForIdle(context) {\n        this.#tasks.resume();\n        return this.#tasks.waitForIdle(undefined, context);\n    }\n    /** Sum every conversation's committed `pi.usage`. Each document is read at its own point; totals only grow. */\n    async usage(context) {\n        const conversations = await this.readOnLine(() => scanAll((cursor) => this.storage.scanConversations({}, SCAN_PAGE_SIZE, cursor, context)));\n        const total = UsageDoc.definition.initial();\n        for (const { id } of conversations) {\n            const state = await this.snapshot(UsageDoc, id, context);\n            if (state !== undefined)\n                addUsageState(total, state);\n        }\n        return total;\n    }\n    taskGraph(context) {\n        return this.#taskGraph.state(context);\n    }\n    watchTaskGraph(context) {\n        return this.#taskGraph.watch(context);\n    }\n    root(context, options) {\n        return this.#create({ kind: \"root\" }, options ?? {}, context);\n    }\n    async conversation(id, context) {\n        this.assertUsable();\n        const record = await this.readOnLine(() => this.storage.conversation(id, context));\n        return record === undefined ? undefined : new ConversationImpl(record.id, this.#host);\n    }\n    createConversation(options, context) {\n        return this.#create({ kind: \"independent\", ownership: options.ownership }, options, context);\n    }\n    report(error) {\n        this.#report(error);\n    }\n    /** Signal and join task invocations after the close listeners and before Storage closes; writes no task outcome. */\n    beforeClose() {\n        return this.#tasks.join();\n    }\n    async #create(target, options, context) {\n        this.assertUsable();\n        const id = await this.commitWith(async (tx) => {\n            if (target.kind === \"root\" && (await tx.conversation(ROOT_CONVERSATION_ID)) !== undefined) {\n                return ROOT_CONVERSATION_ID;\n            }\n            const record = target.kind === \"root\"\n                ? await tx.createRootConversation()\n                : target.kind === \"fork\"\n                    ? await tx.forkConversation(target.parentId, target.at, { ownership: target.ownership })\n                    : await tx.createConversation({ ownership: target.ownership });\n            if (options.agent !== undefined)\n                await configure(tx, record.id, options.agent);\n            if (options.init !== undefined)\n                await options.init(tx, record.id);\n            return record.id;\n        }, context);\n        return new ConversationImpl(id, this.#host);\n    }\n    /**\n     * The built-in creation hook, in every commit that creates or forks a conversation: empty `pi.live`, `pi.inbox`, and\n     * `pi.usage`, a fresh `pi.provider`, the conversation's `pi.agent` (see `createAgent()`), then\n     * `HarnessOptions.conversationCreated`.\n     */\n    async conversationCreated(tx, record) {\n        await tx.doc(LiveDoc, record.id);\n        await tx.doc(InboxDoc, record.id);\n        await tx.doc(UsageDoc, record.id);\n        await tx.doc(ProviderDoc, record.id);\n        await createAgent(tx, record);\n        await this.#options.conversationCreated?.(tx, record);\n    }\n}\n/** `onReport` that cannot fail: it is the last place an error goes, so its own throw or rejection is dropped. */\nfunction safeReport(onReport) {\n    return (error) => contained(() => onReport?.(error), () => { });\n}\n/**\n * The host clock, falling back to `Date.now` when it throws: a broken clock must not stop commits. The first throw is\n * reported; the clock is read in every task change, so later ones are not.\n */\nexport function safeNow(now, report) {\n    if (now === undefined)\n        return Date.now;\n    let reported = false;\n    return () => {\n        try {\n            return now();\n        }\n        catch (error) {\n            // Set first: a report handler that reads the clock again must not report again.\n            if (!reported) {\n                reported = true;\n                report(error);\n            }\n            return Date.now();\n        }\n    };\n}\n/**\n * Invocation-bound handle for tasks and tools. Every operation, and every operation of a submission it returns, first\n * checks the invocation and runs under its signal, so it rejects once the invocation ends; admitted work stays durable.\n */\nfunction boundConversation(id, binding, submissions, tasks) {\n    const bind = (context) => withAbortSignal(binding.signal, context);\n    const bound = (operation) => {\n        return async (context) => {\n            binding.check();\n            return operation(bind(context));\n        };\n    };\n    return {\n        id,\n        submit: async (draft, context) => {\n            binding.check();\n            const submission = await submissions.submit(id, draft, bind(context));\n            return {\n                id: submission.id,\n                status: bound((callContext) => submission.status(callContext)),\n                wait: bound((callContext) => submission.wait(callContext)),\n                abort: bound((callContext) => submission.abort(callContext)),\n            };\n        },\n        abort: async (context, options) => {\n            binding.check();\n            return tasks.abortConversation(id, options?.background === true, bind(context));\n        },\n        waitForIdle: bound((callContext) => tasks.waitForIdle(id, callContext)),\n    };\n}\nexport const Harness = {\n    /** Open a Harness over storage. The registry may keep changing while the Harness runs. */\n    async open(storage, options, context) {\n        context.abortSignal?.throwIfAborted();\n        const snapshot = options.registry.snapshot();\n        const missing = BUILTIN_TASKS.filter((task) => snapshot.task(task.definition.name) === undefined);\n        if (missing.length > 0) {\n            const names = missing.map((task) => task.definition.name).join(\", \");\n            throw new Error(`Registry lacks built-in tasks ${names}; create it with createRegistry()`);\n        }\n        const harness = new HarnessImpl(storage, options, context);\n        try {\n            await harness.openTasks(context);\n        }\n        catch (error) {\n            // The caller's context may be what failed open: close without it, and rethrow the open error.\n            // A failing Storage close fails the Session, which reports it.\n            await harness.close(withoutAbortSignal(context)).catch(() => { });\n            throw error;\n        }\n        return harness;\n    },\n};\n//# sourceMappingURL=harness.js.map","import { SESSION_FILE_CONTENT_TYPES } from \"../../constants/sessionFiles.mjs\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/services/fileAccess/accessibleFile.ts\nfunction inside(root, filePath) {\n\tconst contained = path.relative(root, filePath);\n\treturn contained !== \"..\" && !contained.startsWith(`..${path.sep}`) && !path.isAbsolute(contained);\n}\n/**\n* Reads one file under an open folder, with byte ranges and a version the reader can pin. A relative\n* path resolves against `cwd`. Both the file and each root are resolved through symlinks first, so a\n* link inside an open folder cannot reach outside it.\n*/\nasync function readAccessibleFile(input) {\n\tconst { range, expectedVersion } = input;\n\tif (!input.path || input.path.includes(\"\\0\")) return Response.json({ error: \"Invalid session file path.\" }, { status: 400 });\n\tlet filePath;\n\ttry {\n\t\tfilePath = await fs.promises.realpath(path.resolve(input.cwd, input.path));\n\t} catch {\n\t\treturn Response.json({ error: \"Session file not found.\" }, { status: 404 });\n\t}\n\tif (!(await Promise.all(input.roots.map((root) => fs.promises.realpath(root).catch(() => void 0)))).some((root) => root !== void 0 && inside(root, filePath))) return Response.json({ error: \"Session file is outside the folders this session may open.\" }, { status: 403 });\n\tlet handle;\n\ttry {\n\t\thandle = await fs.promises.open(filePath, \"r\");\n\t} catch {\n\t\treturn Response.json({ error: \"Session file not found.\" }, { status: 404 });\n\t}\n\ttry {\n\t\tconst stat = await handle.stat();\n\t\tif (!stat.isFile()) return Response.json({ error: \"Session file not found.\" }, { status: 404 });\n\t\tif (stat.size > 26214400) return Response.json({ error: \"Session file is too large.\" }, { status: 413 });\n\t\tconst version = `\"${stat.dev}-${stat.ino}-${stat.size}-${stat.mtimeMs}-${stat.ctimeMs}\"`;\n\t\tconst headers = new Headers({\n\t\t\t\"content-type\": SESSION_FILE_CONTENT_TYPES[path.extname(filePath).toLowerCase()] ?? \"application/octet-stream\",\n\t\t\t\"cache-control\": \"no-store\",\n\t\t\t\"x-content-type-options\": \"nosniff\",\n\t\t\t\"accept-ranges\": \"bytes\",\n\t\t\tetag: version\n\t\t});\n\t\tif (expectedVersion !== void 0 && expectedVersion !== version) return new Response(null, {\n\t\t\tstatus: 412,\n\t\t\theaders\n\t\t});\n\t\tlet start = 0;\n\t\tlet end = stat.size - 1;\n\t\tif (range !== void 0) {\n\t\t\tconst match = /^bytes=(\\d*)-(\\d*)$/u.exec(range);\n\t\t\tif (!match || !match[1] && !match[2] || [match[1], match[2]].some((value) => value !== \"\" && !Number.isSafeInteger(Number(value))) || stat.size === 0) {\n\t\t\t\theaders.set(\"content-range\", `bytes */${stat.size}`);\n\t\t\t\treturn new Response(null, {\n\t\t\t\t\tstatus: 416,\n\t\t\t\t\theaders\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!match[1]) start = Math.max(0, stat.size - Number(match[2]));\n\t\t\telse {\n\t\t\t\tstart = Number(match[1]);\n\t\t\t\tif (match[2]) end = Math.min(Number(match[2]), end);\n\t\t\t}\n\t\t\tif (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start < 0 || start > end) {\n\t\t\t\theaders.set(\"content-range\", `bytes */${stat.size}`);\n\t\t\t\treturn new Response(null, {\n\t\t\t\t\tstatus: 416,\n\t\t\t\t\theaders\n\t\t\t\t});\n\t\t\t}\n\t\t\theaders.set(\"content-range\", `bytes ${start}-${end}/${stat.size}`);\n\t\t}\n\t\tconst bytes = new Uint8Array(Math.max(0, end - start + 1));\n\t\tlet read = 0;\n\t\twhile (read < bytes.length) {\n\t\t\tconst part = await handle.read(bytes, read, bytes.length - read, start + read);\n\t\t\tif (part.bytesRead === 0) return new Response(null, {\n\t\t\t\tstatus: 412,\n\t\t\t\theaders\n\t\t\t});\n\t\t\tread += part.bytesRead;\n\t\t}\n\t\tconst after = await handle.stat();\n\t\tif (after.size !== stat.size || after.mtimeMs !== stat.mtimeMs || after.ctimeMs !== stat.ctimeMs) return new Response(null, {\n\t\t\tstatus: 412,\n\t\t\theaders\n\t\t});\n\t\theaders.set(\"content-length\", String(bytes.length));\n\t\treturn new Response(bytes, {\n\t\t\tstatus: range === void 0 ? 200 : 206,\n\t\t\theaders\n\t\t});\n\t} finally {\n\t\tawait handle.close();\n\t}\n}\n//#endregion\nexport { readAccessibleFile };\n\n//# sourceMappingURL=accessibleFile.mjs.map","import { readAccessibleFile } from \"./accessibleFile.mjs\";\nimport path from \"node:path\";\n//#region src/services/fileAccess/index.ts\nconst PO_FILE_ACCESS_SERVICE = \"po/file-access\";\nfunction createFileAccess() {\n\tconst entries = [];\n\treturn {\n\t\tregister(directory) {\n\t\t\tif (directory.includes(\"\\0\") || !path.isAbsolute(directory)) throw new Error(\"File access opens absolute folders only.\");\n\t\t\tconst entry = path.resolve(directory);\n\t\t\tentries.push(entry);\n\t\t\tlet open = true;\n\t\t\treturn () => {\n\t\t\t\tif (!open) return;\n\t\t\t\topen = false;\n\t\t\t\tentries.splice(entries.indexOf(entry), 1);\n\t\t\t};\n\t\t},\n\t\troots: () => [...new Set(entries)]\n\t};\n}\n/** The session's file access, absent on a host older than this service. */\nfunction readPoFileAccess(context) {\n\treturn context.get(PO_FILE_ACCESS_SERVICE);\n}\n//#endregion\nexport { PO_FILE_ACCESS_SERVICE, createFileAccess, readAccessibleFile, readPoFileAccess };\n\n//# sourceMappingURL=index.mjs.map","//#region src/services/kernel/index.ts\nconst DISPOSED_MESSAGE = \"The kernel is disposed\";\nfunction sameList(left, right) {\n\tif (left === void 0 || left.length !== right.length) return false;\n\treturn left.every((value, index) => value === right[index]);\n}\nfunction describe(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\nfunction createPoKernel(options = {}) {\n\tconst slots = /* @__PURE__ */ new Map();\n\tconst dirty = /* @__PURE__ */ new Set();\n\t/** Slots whose values render differently without the list itself changing. */\n\tconst forced = /* @__PURE__ */ new Set();\n\tlet layers = new Set(options.activeLayers ?? []);\n\tlet sequence = 0;\n\tlet tail = Promise.resolve();\n\tlet scheduled;\n\tlet disposed = false;\n\tconst activeOf = (slot) => [...slot.entries.entries()].sort(([left], [right]) => left - right).filter(([, entry]) => entry.layer === void 0 || layers.has(entry.layer)).map(([, entry]) => entry.value);\n\tconst pushOne = async (slot, force, failures) => {\n\t\tif (slot.disposed) return;\n\t\tconst active = activeOf(slot);\n\t\tif (!force && sameList(slot.pushed, active)) return;\n\t\ttry {\n\t\t\tawait slot.sink(active);\n\t\t\tslot.pushed = active;\n\t\t} catch (error) {\n\t\t\tfailures.push(`${slot.name}: ${describe(error)}`);\n\t\t}\n\t};\n\tconst flush = () => {\n\t\tconst run = tail.catch(() => void 0).then(async () => {\n\t\t\tif (dirty.size === 0) return;\n\t\t\tconst pending = [...dirty];\n\t\t\tconst pendingForced = new Set(forced);\n\t\t\tdirty.clear();\n\t\t\tforced.clear();\n\t\t\tconst failures = [];\n\t\t\tfor (const name of pending) {\n\t\t\t\tconst slot = slots.get(name);\n\t\t\t\tif (slot) await pushOne(slot, pendingForced.has(name), failures);\n\t\t\t}\n\t\t\tif (failures.length > 0) throw new Error(`Kernel slots failed to apply: ${failures.join(\"; \")}`);\n\t\t});\n\t\ttail = run;\n\t\treturn run;\n\t};\n\tconst schedule = () => {\n\t\tif (scheduled) return;\n\t\tscheduled = Promise.resolve().then(() => {\n\t\t\tscheduled = void 0;\n\t\t\treturn flush().catch(() => void 0);\n\t\t});\n\t};\n\tconst markDirty = (name) => {\n\t\tdirty.add(name);\n\t};\n\tconst contribute = (slot, entry) => {\n\t\tif (disposed) throw new Error(DISPOSED_MESSAGE);\n\t\tconst state = slots.get(slot);\n\t\tif (!state) throw new Error(`Unknown kernel slot: ${slot}. Defined slots: ${[...slots.keys()].join(\", \") || \"none\"}`);\n\t\tconst key = sequence++;\n\t\tstate.entries.set(key, entry);\n\t\tmarkDirty(slot);\n\t\tschedule();\n\t\tlet removed = false;\n\t\treturn { dispose() {\n\t\t\tif (removed) return;\n\t\t\tremoved = true;\n\t\t\tstate.entries.delete(key);\n\t\t\tmarkDirty(slot);\n\t\t\tschedule();\n\t\t} };\n\t};\n\treturn {\n\t\tget activeLayers() {\n\t\t\treturn [...layers];\n\t\t},\n\t\tget slots() {\n\t\t\treturn [...slots.keys()];\n\t\t},\n\t\tdefineSlot(name, sink) {\n\t\t\tif (disposed) throw new Error(DISPOSED_MESSAGE);\n\t\t\tif (slots.has(name)) throw new Error(`Kernel slot already defined: ${name}`);\n\t\t\tconst state = {\n\t\t\t\tname,\n\t\t\t\tsink,\n\t\t\t\tentries: /* @__PURE__ */ new Map(),\n\t\t\t\tpushed: void 0,\n\t\t\t\tdisposed: false\n\t\t\t};\n\t\t\tslots.set(name, state);\n\t\t\tlet removed = false;\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tcontribute: (entry) => contribute(name, entry),\n\t\t\t\tdispose() {\n\t\t\t\t\tif (removed) return;\n\t\t\t\t\tremoved = true;\n\t\t\t\t\tstate.disposed = true;\n\t\t\t\t\tslots.delete(name);\n\t\t\t\t\tdirty.delete(name);\n\t\t\t\t\tforced.delete(name);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tcontribute,\n\t\tasync setActiveLayers(next) {\n\t\t\tif (disposed) throw new Error(DISPOSED_MESSAGE);\n\t\t\tlayers = new Set(next);\n\t\t\tfor (const name of slots.keys()) markDirty(name);\n\t\t\tawait flush();\n\t\t},\n\t\tasync refresh(slot) {\n\t\t\tif (disposed) throw new Error(DISPOSED_MESSAGE);\n\t\t\tif (slot === void 0) for (const name of slots.keys()) {\n\t\t\t\tmarkDirty(name);\n\t\t\t\tforced.add(name);\n\t\t\t}\n\t\t\telse if (slots.has(slot)) {\n\t\t\t\tmarkDirty(slot);\n\t\t\t\tforced.add(slot);\n\t\t\t}\n\t\t\tawait flush();\n\t\t},\n\t\tactiveValues(slot) {\n\t\t\tconst state = slots.get(slot);\n\t\t\treturn state ? activeOf(state) : [];\n\t\t},\n\t\tcontributions(slot) {\n\t\t\tconst state = slots.get(slot);\n\t\t\treturn state ? [...state.entries.values()] : [];\n\t\t},\n\t\tdispose() {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tfor (const state of slots.values()) state.disposed = true;\n\t\t\tslots.clear();\n\t\t\tdirty.clear();\n\t\t}\n\t};\n}\n//#endregion\nexport { createPoKernel };\n\n//# sourceMappingURL=index.mjs.map","//#region src/services/serverHost/index.ts\nfunction createPoServerHost(options) {\n\tconst { scope, context } = options;\n\tconst notice = (message) => context.onNotice(message);\n\tconst mounts = [];\n\tconst channels = [];\n\tconst methods = /* @__PURE__ */ new Set();\n\tlet disposed = false;\n\tconst changed = () => options.onChange?.(mounts.map((mount) => mount.basePath));\n\tconst channelsChanged = () => options.onChannelsChange?.(channels.map((mount) => mount.channel.frameType));\n\tconst noop = {\n\t\tmounted: false,\n\t\tdispose: () => void 0\n\t};\n\tconst registerApi = (api) => {\n\t\tif (disposed) {\n\t\t\tnotice(`package API '${api.basePath}' is skipped: the server host is already disposed.`);\n\t\t\treturn noop;\n\t\t}\n\t\tif (mounts.find((mount) => mount.basePath === api.basePath) !== void 0) {\n\t\t\tnotice(`package API '${api.basePath}' is skipped: another package already claims it.`);\n\t\t\treturn noop;\n\t\t}\n\t\tif (api.publicRoutes !== void 0 && scope !== \"global\") {\n\t\t\tnotice(`package API '${api.basePath}' is skipped: public routes are accepted at global scope only.`);\n\t\t\treturn noop;\n\t\t}\n\t\tif (api.publicRoutes?.paths.some((path) => !path.startsWith(\"/\")) === true) {\n\t\t\tnotice(`package API '${api.basePath}' is skipped: every public route path must start with '/'.`);\n\t\t\treturn noop;\n\t\t}\n\t\tlet handler;\n\t\ttry {\n\t\t\thandler = api.start(context);\n\t\t} catch (error) {\n\t\t\tnotice(`package API '${api.basePath}' did not start (${String(error)}); it is skipped.`);\n\t\t\treturn noop;\n\t\t}\n\t\tconst mount = {\n\t\t\tbasePath: api.basePath,\n\t\t\thandler,\n\t\t\tpublicRoutes: api.publicRoutes\n\t\t};\n\t\tmounts.push(mount);\n\t\tchanged();\n\t\tlet released = false;\n\t\treturn {\n\t\t\tmounted: true,\n\t\t\tdispose: () => {\n\t\t\t\tif (released) return;\n\t\t\t\treleased = true;\n\t\t\t\tconst index = mounts.indexOf(mount);\n\t\t\t\tif (index >= 0) mounts.splice(index, 1);\n\t\t\t\ttry {\n\t\t\t\t\thandler.close();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tnotice(`package API '${mount.basePath}' did not close cleanly (${String(error)}).`);\n\t\t\t\t}\n\t\t\t\tchanged();\n\t\t\t}\n\t\t};\n\t};\n\tconst registerChannel = (channel) => {\n\t\tif (disposed) {\n\t\t\tnotice(`hub channel '${channel.frameType}' is skipped: the server host is already disposed.`);\n\t\t\treturn noop;\n\t\t}\n\t\tif (options.mountChannel !== void 0) {\n\t\t\tlet registration;\n\t\t\ttry {\n\t\t\t\tregistration = options.mountChannel(channel);\n\t\t\t} catch (error) {\n\t\t\t\tnotice(`hub channel '${channel.frameType}' did not mount (${String(error)}); it is skipped.`);\n\t\t\t\treturn noop;\n\t\t\t}\n\t\t\tif (registration.mounted !== true) return registration;\n\t\t\tconst mount = {\n\t\t\t\tchannel,\n\t\t\t\tregistration\n\t\t\t};\n\t\t\tchannels.push(mount);\n\t\t\tchannelsChanged();\n\t\t\tlet released = false;\n\t\t\treturn {\n\t\t\t\tmounted: true,\n\t\t\t\tdispose: () => {\n\t\t\t\t\tif (released) return;\n\t\t\t\t\treleased = true;\n\t\t\t\t\tconst index = channels.indexOf(mount);\n\t\t\t\t\tif (index >= 0) channels.splice(index, 1);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tregistration.dispose();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tnotice(`hub channel '${channel.frameType}' did not close cleanly (${String(error)}).`);\n\t\t\t\t\t}\n\t\t\t\t\tchannelsChanged();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tconst channelHost = options.channelHostFor?.(channel) ?? options.channelHost;\n\t\tif (!channelHost) {\n\t\t\tnotice(`hub channel '${channel.frameType}' is skipped: this server host has no channel capability.`);\n\t\t\treturn noop;\n\t\t}\n\t\tif (channels.some((mount) => mount.channel.frameType === channel.frameType)) {\n\t\t\tnotice(`hub channel '${channel.frameType}' is skipped: another package already claims it.`);\n\t\t\treturn noop;\n\t\t}\n\t\tlet source;\n\t\ttry {\n\t\t\tsource = channel.start(channelHost);\n\t\t} catch (error) {\n\t\t\tnotice(`hub channel '${channel.frameType}' did not start (${String(error)}); it is skipped.`);\n\t\t\treturn noop;\n\t\t}\n\t\tconst mount = {\n\t\t\tchannel,\n\t\t\tsource\n\t\t};\n\t\tchannels.push(mount);\n\t\tchannelsChanged();\n\t\tlet released = false;\n\t\treturn {\n\t\t\tmounted: true,\n\t\t\tdispose: () => {\n\t\t\t\tif (released) return;\n\t\t\t\treleased = true;\n\t\t\t\tconst index = channels.indexOf(mount);\n\t\t\t\tif (index >= 0) channels.splice(index, 1);\n\t\t\t\ttry {\n\t\t\t\t\tsource.close();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tnotice(`hub channel '${channel.frameType}' did not close cleanly (${String(error)}).`);\n\t\t\t\t}\n\t\t\t\tchannelsChanged();\n\t\t\t}\n\t\t};\n\t};\n\tconst registerMethod = (definition, handler) => {\n\t\tif (disposed || !options.pluginRegistry) {\n\t\t\tnotice(`plugin method '${definition.service}.${definition.method}' is skipped: this host has no plugin dispatcher.`);\n\t\t\treturn noop;\n\t\t}\n\t\tconst mount = scope === \"global\" ? { scope: \"global\" } : scope === \"workspace\" && context.workspaceId ? {\n\t\t\tscope: \"workspace\",\n\t\t\tworkspaceId: context.workspaceId\n\t\t} : scope === \"session\" && context.sessionId ? {\n\t\t\tscope: \"session\",\n\t\t\tsessionId: context.sessionId\n\t\t} : void 0;\n\t\tif (!mount) {\n\t\t\tnotice(`plugin method '${definition.service}.${definition.method}' is skipped: this host has no mount identity.`);\n\t\t\treturn noop;\n\t\t}\n\t\ttry {\n\t\t\tconst release = options.pluginRegistry.register(mount, definition, handler);\n\t\t\tlet released = false;\n\t\t\tconst dispose = () => {\n\t\t\t\tif (released) return;\n\t\t\t\treleased = true;\n\t\t\t\tmethods.delete(dispose);\n\t\t\t\trelease();\n\t\t\t};\n\t\t\tmethods.add(dispose);\n\t\t\treturn {\n\t\t\t\tmounted: true,\n\t\t\t\tdispose\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tnotice(`plugin method '${definition.service}.${definition.method}' did not mount (${String(error)}).`);\n\t\t\treturn noop;\n\t\t}\n\t};\n\treturn {\n\t\tscope,\n\t\tcontext,\n\t\tregisterApi,\n\t\tregisterChannel,\n\t\tregisterMethod,\n\t\tmounted: () => mounts.map((mount) => mount.basePath),\n\t\tmountedChannels: () => channels.map((mount) => mount.channel.frameType),\n\t\thandlerFor: (basePath) => mounts.find((mount) => mount.basePath === basePath)?.handler,\n\t\tpublicRoutesFor: (basePath) => mounts.find((mount) => mount.basePath === basePath)?.publicRoutes,\n\t\tdispose: () => {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tfor (const release of [...methods].reverse()) release();\n\t\t\tfor (const mount of channels.splice(0).reverse()) try {\n\t\t\t\tif (mount.registration !== void 0) mount.registration.dispose();\n\t\t\t\telse mount.source?.close();\n\t\t\t} catch (error) {\n\t\t\t\tnotice(`hub channel '${mount.channel.frameType}' did not close cleanly (${String(error)}).`);\n\t\t\t}\n\t\t\tfor (const mount of mounts.splice(0).reverse()) try {\n\t\t\t\tmount.handler.close();\n\t\t\t} catch (error) {\n\t\t\t\tnotice(`package API '${mount.basePath}' did not close cleanly (${String(error)}).`);\n\t\t\t}\n\t\t\tchannelsChanged();\n\t\t\tchanged();\n\t\t}\n\t};\n}\n//#endregion\nexport { createPoServerHost };\n\n//# sourceMappingURL=index.mjs.map","import { guardedImport } from \"./liveImport.mjs\";\n//#region src/server/serverPackages.ts\n/** Pure pre-model metadata from initially admitted session packages, never from retained candidates. */\nfunction selectedServerProviderOverrides(packages, environment) {\n\treturn packages.flatMap(({ declaration, plugin, initiallyEligible }) => initiallyEligible === false || !declaration.scopes.includes(\"session\") ? [] : plugin.providerOverrides?.({ environment }) ?? []);\n}\nfunction ownedBy(owners, majorMode, activeLayers) {\n\treturn owners.some((owner) => owner.majorMode === majorMode && (owner.layer === \"default\" || activeLayers.includes(owner.layer)));\n}\n/** A module's default export is a server plugin when it is a named cordis object plugin. */\nfunction isServerPlugin(value) {\n\treturn typeof value === \"object\" && value !== null && typeof value.apply === \"function\" && typeof value.name === \"string\";\n}\nasync function loadPackageEntries(scope, entries, options, importUrl) {\n\tconst packages = [];\n\tfor (const declaration of entries) {\n\t\tif (!declaration.scopes.includes(scope)) continue;\n\t\tconst eligible = ownedBy(declaration.owners, options.majorMode, options.activeLayers);\n\t\tif (!(scope === \"session\" && options.retainCandidates === true) && !eligible) continue;\n\t\ttry {\n\t\t\tconst imported = await importUrl(declaration);\n\t\t\tif (!isServerPlugin(imported?.default)) throw new Error(\"default export is not a server plugin\");\n\t\t\tpackages.push({\n\t\t\t\tdeclaration,\n\t\t\t\tplugin: imported.default,\n\t\t\t\t...scope === \"session\" && options.retainCandidates ? {\n\t\t\t\t\tretained: true,\n\t\t\t\t\tinitiallyEligible: eligible\n\t\t\t\t} : {}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst message = `Server package '${declaration.packageName}' could not load (${error instanceof Error ? error.message : String(error)})`;\n\t\t\tif (declaration.required && eligible) throw new Error(message, { cause: error });\n\t\t\toptions.onNotice?.(message);\n\t\t}\n\t}\n\treturn packages;\n}\n/**\n* Live reader: imports each package's built entry from its content-addressed URL.\n*\n* Applies the scope, ownership and `required` rules of each entry. Each import is bounded and a URL that\n* timed out or threw is poisoned (see `guardedImport`); a poisoned required package fails\n* exactly as a load failure does. A URL is imported once per process, so the same content is the\n* same plugin object, which is how a scope tells an unchanged package from a changed one.\n*/\nasync function loadServerPackages(scope, options) {\n\tconst importer = options.importer ?? ((url) => import(url));\n\tconst urls = new Map(options.entries.map((entry) => [entry, entry.url]));\n\tconst packages = await loadPackageEntries(scope, options.entries, options, (declaration) => guardedImport(urls.get(declaration), importer, options));\n\treturn {\n\t\tentries: options.entries,\n\t\tpackages\n\t};\n}\n//#endregion\nexport { loadServerPackages, selectedServerProviderOverrides };\n\n//# sourceMappingURL=serverPackages.mjs.map","//#region src/schemas/packageApi.ts\nconst PO_API_SCOPES = [\n\t\"global\",\n\t\"workspace\",\n\t\"session\"\n];\n/** Canonical public prefix. Scope selection never falls through to a parent. */\nfunction poApiMountPath(mount) {\n\tif (mount.scope === \"global\") return \"/api/plugins\";\n\tif (mount.scope === \"workspace\") return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/plugins`;\n\tif (!mount.workspaceId) throw new Error(\"A session API path requires its workspace identity.\");\n\treturn `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/sessions/${encodeURIComponent(mount.sessionId)}/plugins`;\n}\n/** Only canonical resource paths may select a protocol listener. */\nfunction parsePoSocketPath(pathname) {\n\tif (pathname === \"/api/ws\") return { scope: \"global\" };\n\tconst match = /^\\/api\\/workspaces\\/([^/]+)(?:\\/sessions\\/([^/]+))?\\/ws$/u.exec(pathname);\n\tif (!match) return void 0;\n\ttry {\n\t\tconst workspaceId = decodeURIComponent(match[1]);\n\t\treturn match[2] === void 0 ? {\n\t\t\tscope: \"workspace\",\n\t\t\tworkspaceId\n\t\t} : {\n\t\t\tscope: \"session\",\n\t\t\tworkspaceId,\n\t\t\tsessionId: decodeURIComponent(match[2])\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The segment an API is mounted under, below this prefix. */\nconst PO_API_ROUTE_PREFIX = \"/api/plugins\";\n/** Selects the hub API bundle that owns the named cockpit session. */\nconst PO_HUB_API_SESSION_QUERY_PARAM = \"hubSession\";\n/** Trusted caller headers written only by the cockpit-to-session proxy. */\nconst PO_API_CALLER_LOCALITY_HEADER = \"x-po-api-caller-locality\";\nconst PO_API_CALLER_DEVICE_ID_HEADER = \"x-po-api-caller-device-id\";\nconst PO_API_CALLER_STEP_UP_HEADER = \"x-po-api-caller-step-up\";\nconst PO_API_CALLER_HEADERS = [\n\tPO_API_CALLER_LOCALITY_HEADER,\n\tPO_API_CALLER_DEVICE_ID_HEADER,\n\tPO_API_CALLER_STEP_UP_HEADER\n];\n/** Reads the proxy-authenticated caller identity, rejecting partial or contradictory stamps. */\nfunction poApiCallerFrom(headers) {\n\tconst locality = headers.get(PO_API_CALLER_LOCALITY_HEADER);\n\tconst deviceId = headers.get(PO_API_CALLER_DEVICE_ID_HEADER);\n\tconst stepUp = headers.get(PO_API_CALLER_STEP_UP_HEADER);\n\tif (locality === \"local\") return deviceId === null && stepUp === \"not-required\" ? {\n\t\tlocality,\n\t\tstepUp\n\t} : void 0;\n\tif (locality === \"remote\" && deviceId !== null && deviceId !== \"\" && (stepUp === \"not-required\" || stepUp === \"verified\" || stepUp === \"unavailable\")) return {\n\t\tlocality,\n\t\tdeviceId,\n\t\tstepUp\n\t};\n}\n/** Why shareFile rejects while the host has no public tunnel origin. */\nconst PO_SHARE_FILE_REMOTE_OFF_MESSAGE = \"Remote access is off, so Po cannot share files with remote MCP servers. Turn it on and retry.\";\n//#endregion\nexport { PO_API_CALLER_DEVICE_ID_HEADER, PO_API_CALLER_HEADERS, PO_API_CALLER_LOCALITY_HEADER, PO_API_CALLER_STEP_UP_HEADER, PO_API_ROUTE_PREFIX, PO_API_SCOPES, PO_HUB_API_SESSION_QUERY_PARAM, PO_SHARE_FILE_REMOTE_OFF_MESSAGE, parsePoSocketPath, poApiCallerFrom, poApiMountPath };\n\n//# sourceMappingURL=packageApi.mjs.map","//#region src/schemas/home.ts\nconst HOME_PAGE_LIMIT = 50;\nconst HOME_ENTITY_LIMIT = 1e3;\nconst HOME_KINDS = [\n\t\"decision\",\n\t\"failure\",\n\t\"blocked\",\n\t\"running\",\n\t\"queued\",\n\t\"paused\",\n\t\"completed\"\n];\nfunction record(input) {\n\treturn input !== null && typeof input === \"object\" && !Array.isArray(input);\n}\nfunction text(input, limit = 256) {\n\treturn typeof input === \"string\" && input.trim().length > 0 && input.length <= limit;\n}\nfunction timestamp(input) {\n\treturn text(input, 64) && Number.isFinite(Date.parse(input));\n}\nfunction coverage(input) {\n\treturn input === \"ready\" || input === \"partial\" || input === \"unavailable\";\n}\nfunction parseHomeContribution(input) {\n\tif (!record(input) || input.version !== 1 || !text(input.label, 80) || !text(input.source, 128)) return null;\n\tif (input.destination !== void 0 && !text(input.destination, 128)) return null;\n\treturn {\n\t\tversion: 1,\n\t\tlabel: input.label,\n\t\tsource: input.source,\n\t\t...input.destination === void 0 ? {} : { destination: input.destination }\n\t};\n}\nfunction parseHomeEntity(input) {\n\tif (!record(input) || !text(input.id, 512) || !text(input.sessionId) || !text(input.title, 160)) return null;\n\tif (!HOME_KINDS.includes(input.kind) || !timestamp(input.updatedAt)) return null;\n\tif (input.detail !== void 0 && !text(input.detail, 320)) return null;\n\tif (input.relatedSessionIds !== void 0 && (!Array.isArray(input.relatedSessionIds) || input.relatedSessionIds.length > 64 || !input.relatedSessionIds.every((id) => text(id)))) return null;\n\treturn {\n\t\tid: input.id,\n\t\tkind: input.kind,\n\t\ttitle: input.title,\n\t\tupdatedAt: input.updatedAt,\n\t\tsessionId: input.sessionId,\n\t\t...input.detail === void 0 ? {} : { detail: input.detail },\n\t\t...input.relatedSessionIds === void 0 ? {} : { relatedSessionIds: input.relatedSessionIds }\n\t};\n}\n/** Reject a malformed source, rather than turning invalid records into a healthy count. */\nfunction parseHomeProjection(input) {\n\tif (!record(input) || !coverage(input.coverage) || !Array.isArray(input.entities) || input.entities.length > 1e3) return null;\n\tconst entities = [];\n\tfor (const value of input.entities) {\n\t\tconst entity = parseHomeEntity(value);\n\t\tif (entity === null) return null;\n\t\tentities.push(entity);\n\t}\n\tif (input.coverage === \"unavailable\" && entities.length > 0) return null;\n\treturn {\n\t\tcoverage: input.coverage,\n\t\tentities\n\t};\n}\nfunction parseHomeCounts(input) {\n\tif (!record(input)) return null;\n\tconst counts = {};\n\tfor (const kind of HOME_KINDS) {\n\t\tconst count = input[kind];\n\t\tif (!Number.isSafeInteger(count) || count < 0) return null;\n\t\tcounts[kind] = count;\n\t}\n\treturn counts;\n}\nfunction parseHomeSnapshot(input) {\n\tif (!record(input) || input.version !== 1 || !timestamp(input.observedAt) || !Array.isArray(input.items) || input.items.length > 50 || !Array.isArray(input.sources) || input.sources.length > 5e3 || !Number.isSafeInteger(input.total) || input.total < 0 || !record(input.counts)) return null;\n\tconst counts = parseHomeCounts(input.counts);\n\tif (counts === null || counts.decision + counts.failure + counts.blocked + counts.paused !== input.total || input.items.length > input.total) return null;\n\tconst items = [];\n\tfor (const value of input.items) {\n\t\tconst entity = parseHomeEntity(value);\n\t\tif (entity === null || ![\n\t\t\t\"decision\",\n\t\t\t\"failure\",\n\t\t\t\"blocked\",\n\t\t\t\"paused\"\n\t\t].includes(entity.kind) || !record(value) || !text(value.source, 128) || value.workspaceId !== void 0 && !text(value.workspaceId)) return null;\n\t\tconst { relatedSessionIds: _related, ...publicEntity } = entity;\n\t\titems.push({\n\t\t\t...publicEntity,\n\t\t\tsource: value.source,\n\t\t\t...value.workspaceId === void 0 ? {} : { workspaceId: value.workspaceId }\n\t\t});\n\t}\n\tconst sources = [];\n\tfor (const value of input.sources) {\n\t\tif (!record(value) || !text(value.source, 128) || !coverage(value.coverage) || value.workspaceId !== void 0 && !text(value.workspaceId)) return null;\n\t\tconst sourceCounts = value.counts === void 0 ? void 0 : parseHomeCounts(value.counts);\n\t\tif (sourceCounts === null) return null;\n\t\tsources.push({\n\t\t\tsource: value.source,\n\t\t\tcoverage: value.coverage,\n\t\t\t...sourceCounts === void 0 ? {} : { counts: sourceCounts },\n\t\t\t...value.workspaceId === void 0 ? {} : { workspaceId: value.workspaceId }\n\t\t});\n\t}\n\tif (input.nextOffset !== void 0 && (!Number.isSafeInteger(input.nextOffset) || input.nextOffset <= 0 || input.nextOffset >= input.total)) return null;\n\treturn {\n\t\tversion: 1,\n\t\tobservedAt: input.observedAt,\n\t\titems,\n\t\tsources,\n\t\ttotal: input.total,\n\t\tcounts,\n\t\t...input.nextOffset === void 0 ? {} : { nextOffset: input.nextOffset }\n\t};\n}\n//#endregion\nexport { HOME_ENTITY_LIMIT, HOME_KINDS, HOME_PAGE_LIMIT, parseHomeContribution, parseHomeEntity, parseHomeProjection, parseHomeSnapshot };\n\n//# sourceMappingURL=home.mjs.map","import { pluginApiUrl } from \"../apiPaths/index.mjs\";\n//#region src/web/services/apiClient/index.ts\n/**\n* The typed call surface a cockpit plugin reaches its own API through.\n*\n* A route is declared once as data, and the build supplies the two facts the\n* declaration deliberately omits: which scopes the package mounts at, and under\n* which base path. So a page names a route and a session, never a URL.\n*\n* The shape is dictated by the transport rather than by taste. Over a tunnel\n* every request is resealed and relayed, and the relay honours only a method, a\n* set of headers and a buffered body against a root-relative target. Anything\n* this surface accepted beyond that would be silently discarded at exactly the\n* moment it mattered, so it accepts nothing beyond that.\n*/\n/** Names the type a route answers with. Returns nothing; only its type is read. */\nfunction apiResponse() {}\n/** Identity with inference, so a route table keeps its literal types. */\nfunction defineApiRoutes(routes) {\n\treturn routes;\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** The body a route answered, or undefined when it sent none or sent non-JSON. */\nasync function readBody(response) {\n\tconst text = await response.text();\n\tif (text === \"\") return void 0;\n\ttry {\n\t\treturn JSON.parse(text);\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* The message a route reported, or an empty string.\n*\n* Empty rather than invented: callers own the words their users read, and a\n* generic sentence from here would appear in a dozen packages that each already\n* have their own.\n*/\nfunction errorOf(data) {\n\treturn isRecord(data) && typeof data.error === \"string\" ? data.error : \"\";\n}\n/** Anything the sealed transport can carry verbatim; everything else becomes JSON. */\nfunction encodeBody(body) {\n\tif (body === void 0) return {};\n\tif (typeof body === \"string\" || body instanceof Blob || body instanceof ArrayBuffer || ArrayBuffer.isView(body) || body instanceof URLSearchParams) return { body };\n\treturn {\n\t\tbody: JSON.stringify(body),\n\t\tcontentType: \"application/json\"\n\t};\n}\n/**\n* One route, as the page calls it.\n*\n* A streaming route is returned as a plain object with no call signature, not\n* merely typed as one. The type stops an author; the missing function stops a\n* cast, a JavaScript caller, and a generic helper that iterates the client.\n* Calling one over a tunnel would buffer forever rather than fail, and that is\n* too quiet a way to lose an afternoon.\n*/\nfunction methodFor(spec, address, options) {\n\tconst basePath = spec.host === true ? void 0 : options.basePath;\n\tconst url = (init) => pluginApiUrl(address, basePath, spec.path, init?.query, init?.params);\n\tconst call = async (init) => {\n\t\tconst encoded = encodeBody(init?.body);\n\t\tconst headers = {\n\t\t\t...encoded.contentType === void 0 ? {} : { \"content-type\": encoded.contentType },\n\t\t\t...init?.headers\n\t\t};\n\t\tlet response;\n\t\ttry {\n\t\t\tresponse = await options.transport(url(init), {\n\t\t\t\tmethod: spec.method,\n\t\t\t\t...init?.signal === void 0 ? {} : { signal: init.signal },\n\t\t\t\t...Object.keys(headers).length === 0 ? {} : { headers },\n\t\t\t\t...encoded.body === void 0 ? {} : { body: encoded.body }\n\t\t\t});\n\t\t} catch {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\tstatus: 0,\n\t\t\t\terror: \"\",\n\t\t\t\tdata: void 0\n\t\t\t};\n\t\t}\n\t\tif (spec.raw === true) {\n\t\t\tif (!response.ok) return {\n\t\t\t\tok: false,\n\t\t\t\tstatus: response.status,\n\t\t\t\terror: \"\",\n\t\t\t\tdata: void 0,\n\t\t\t\tresponse\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tstatus: response.status,\n\t\t\t\tdata: void 0,\n\t\t\t\tresponse\n\t\t\t};\n\t\t}\n\t\tlet data;\n\t\ttry {\n\t\t\tdata = await readBody(response);\n\t\t} catch {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\tstatus: response.status,\n\t\t\t\terror: \"\",\n\t\t\t\tdata: void 0,\n\t\t\t\tresponse\n\t\t\t};\n\t\t}\n\t\tif (!response.ok) return {\n\t\t\tok: false,\n\t\t\tstatus: response.status,\n\t\t\terror: errorOf(data),\n\t\t\tdata,\n\t\t\tresponse\n\t\t};\n\t\treturn {\n\t\t\tok: true,\n\t\t\tstatus: response.status,\n\t\t\tdata,\n\t\t\tresponse\n\t\t};\n\t};\n\tif (spec.stream === true) return {\n\t\turl,\n\t\tspec\n\t};\n\treturn Object.assign(call, {\n\t\turl,\n\t\tspec\n\t});\n}\nfunction scopeClient(routes, address, options) {\n\tconst client = {};\n\tfor (const [key, spec] of Object.entries(routes)) client[key] = methodFor(spec, address, options);\n\treturn client;\n}\n/**\n* Binds a route table to one package's mount.\n*\n* Only the scopes named in `options.scopes` get an accessor, so the returned\n* value describes exactly what this package serves and nothing else.\n*/\nfunction createApiClient(routes, options) {\n\tconst wide = options;\n\tconst accessors = {};\n\tfor (const scope of options.scopes) {\n\t\tif (scope === \"global\") accessors.global = scopeClient(routes, { scope: \"global\" }, wide);\n\t\tif (scope === \"workspace\") accessors.workspace = (workspaceId) => scopeClient(routes, {\n\t\t\tscope: \"workspace\",\n\t\t\tworkspaceId\n\t\t}, wide);\n\t\tif (scope === \"session\") accessors.session = (sessionId) => scopeClient(routes, wide.sessionAddress(sessionId), wide);\n\t}\n\treturn accessors;\n}\n//#endregion\nexport { apiResponse, createApiClient, defineApiRoutes };\n\n//# sourceMappingURL=index.mjs.map","const e=1,t=`k`,n=12,r=4,i=8,a=2**32,o=`po/sealed/c2s/v1`,s=`po/sealed/s2c/v1`;function c(e){return e===`c2s`?o:s}function l(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.v===1&&typeof t.n==`string`&&typeof t.c==`string`}const u=`x-po-channel-key`,d=`x-po-sealed`;function f(e){switch(e){case`version`:return`The other end is speaking a different envelope version.`;case`malformed`:return`A sealed message was not shaped like one.`;case`replay`:return`A sealed message arrived out of order or twice.`;case`auth`:return`A sealed message failed its authentication tag, so it was altered in transit.`;case`exhausted`:return`This channel reached its message limit and must be re-established.`}}export{o as CLIENT_TO_SERVER_INFO,a as MAX_MESSAGES_PER_KEY,n as NONCE_BYTES,i as NONCE_COUNTER_BYTES,r as NONCE_PREFIX_BYTES,d as SEALED_BODY_HEADER,u as SEALED_CLIENT_KEY_HEADER,t as SEALED_KEY_PARAM,e as SEALED_VERSION,s as SERVER_TO_CLIENT_INFO,f as describeSealedFailure,c as infoFor,l as isSealedEnvelope};\n//# sourceMappingURL=sealedChannel.mjs.map","import path from \"node:path\";\n//#region src/services/openSessionRegistry/openSessionRecords.ts\nconst REGISTRY_FILE = \"open-sessions.json\";\n/** The id becomes a journal filename, so it is constrained exactly as SQLite storage constrains it. */\nconst SESSION_ID_PATTERN = /^[A-Za-z0-9_-]+$/u;\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction optionalText(value) {\n\treturn typeof value === \"string\" && value !== \"\" ? value : void 0;\n}\n/**\n* Reads one entry, or nothing.\n*\n* The file is editable by hand and its session id is joined into a journal\n* path, so it is a trust boundary rather than trusted state this process wrote.\n* A bad entry is dropped instead of narrowing the whole file to nothing. A legacy\n* `artifact` (the worktree's pinned sync generation) is ignored: sessions compose live.\n*/\nfunction parseRecord(value) {\n\tif (!isRecord(value)) return void 0;\n\tconst { sessionId, workspaceId, cwd, name, createdAt } = value;\n\tif (typeof sessionId !== \"string\" || !SESSION_ID_PATTERN.test(sessionId)) return void 0;\n\tif (typeof workspaceId !== \"string\" || workspaceId === \"\") return void 0;\n\tif (typeof cwd !== \"string\" || !path.isAbsolute(cwd)) return void 0;\n\tif (typeof name !== \"string\" || typeof createdAt !== \"string\") return void 0;\n\tconst parentSessionId = optionalText(value.parentSessionId);\n\tconst sessionProvenance = optionalText(value.sessionProvenance);\n\tconst repoRoot = optionalText(value.repoRoot);\n\tconst groupingRoot = optionalText(value.groupingRoot);\n\tif (value.repoRoot !== void 0 && (!repoRoot || !path.isAbsolute(repoRoot))) return void 0;\n\tif (value.groupingRoot !== void 0 && (!groupingRoot || !path.isAbsolute(groupingRoot))) return void 0;\n\treturn {\n\t\tsessionId,\n\t\tworkspaceId,\n\t\tcwd,\n\t\t...repoRoot === void 0 ? {} : { repoRoot },\n\t\t...groupingRoot === void 0 ? {} : { groupingRoot },\n\t\tname,\n\t\tcreatedAt,\n\t\t...parentSessionId === void 0 ? {} : { parentSessionId },\n\t\t...sessionProvenance === void 0 ? {} : { sessionProvenance },\n\t\t...Array.isArray(value.groups) ? { groups: value.groups.filter((group) => typeof group === \"string\") } : {}\n\t};\n}\n/** Parses registry file text; unusable content is reported and dropped. */\nfunction parseOpenSessionRecords(raw, filePath, notice) {\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\tnotice(`open sessions at ${filePath} are not valid JSON; none will be restored`);\n\t\treturn [];\n\t}\n\tif (!Array.isArray(parsed)) {\n\t\tnotice(`open sessions at ${filePath} are not a list; none will be restored`);\n\t\treturn [];\n\t}\n\tconst records = [];\n\tfor (const entry of parsed) {\n\t\tconst record = parseRecord(entry);\n\t\tif (record === void 0) notice(`open sessions at ${filePath} contain an unusable entry; skipping it`);\n\t\telse records.push(record);\n\t}\n\treturn records;\n}\nfunction serializeOpenSessionRecords(records) {\n\treturn `${JSON.stringify(records, void 0, 2)}\\n`;\n}\nfunction assertOpenSessionRecord(record) {\n\tif (!SESSION_ID_PATTERN.test(record.sessionId)) throw new Error(`Invalid session id '${record.sessionId}'.`);\n\tfor (const directory of [\n\t\trecord.cwd,\n\t\trecord.repoRoot,\n\t\trecord.groupingRoot\n\t]) if (directory !== void 0 && !path.isAbsolute(directory)) throw new Error(\"Session directories must be absolute.\");\n}\n//#endregion\nexport { REGISTRY_FILE, SESSION_ID_PATTERN, assertOpenSessionRecord, parseOpenSessionRecords, serializeOpenSessionRecords };\n\n//# sourceMappingURL=openSessionRecords.mjs.map","import { REGISTRY_FILE, assertOpenSessionRecord, parseOpenSessionRecords, serializeOpenSessionRecords } from \"./openSessionRecords.mjs\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/services/openSessionRegistry/sync.ts\n/**\n* The sessions the cockpit had open, so a server restart can offer them back.\n*\n* Journals already survive a restart; what does not is the knowledge of which\n* of them were open rather than merely finished. Without that, a restart either\n* loses every session or revives every thread ever recorded.\n*\n* @deprecated Node-only sync shim; use createOpenSessionRegistryAsync. Removed in M2.\n*/\nfunction createOpenSessionRegistry(options) {\n\tconst notice = options.onNotice ?? (() => {});\n\tconst filePath = path.join(options.directory, REGISTRY_FILE);\n\tconst load = () => {\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = fs.readFileSync(filePath, \"utf8\");\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\treturn parseOpenSessionRecords(raw, filePath, notice);\n\t};\n\tlet current = load();\n\tconst persist = (next) => {\n\t\tconst temporary = `${filePath}.${String(process.pid)}.tmp`;\n\t\ttry {\n\t\t\tfs.mkdirSync(options.directory, {\n\t\t\t\trecursive: true,\n\t\t\t\tmode: 448\n\t\t\t});\n\t\t\tconst descriptor = fs.openSync(temporary, \"w\", 384);\n\t\t\ttry {\n\t\t\t\tfs.writeFileSync(descriptor, serializeOpenSessionRecords(next));\n\t\t\t\tfs.fsyncSync(descriptor);\n\t\t\t} finally {\n\t\t\t\tfs.closeSync(descriptor);\n\t\t\t}\n\t\t\tfs.renameSync(temporary, filePath);\n\t\t\tcurrent = next;\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tnotice(`${filePath} could not be saved: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\ttry {\n\t\t\t\tfs.rmSync(temporary, { force: true });\n\t\t\t} catch {}\n\t\t\treturn false;\n\t\t}\n\t};\n\treturn {\n\t\tlist: () => current,\n\t\tadd(record) {\n\t\t\tassertOpenSessionRecord(record);\n\t\t\treturn persist([...current.filter((held) => held.sessionId !== record.sessionId), record]);\n\t\t},\n\t\tremove(sessionId) {\n\t\t\tconst next = current.filter((held) => held.sessionId !== sessionId);\n\t\t\tif (next.length === current.length) return;\n\t\t\tpersist(next);\n\t\t}\n\t};\n}\n//#endregion\nexport { createOpenSessionRegistry };\n\n//# sourceMappingURL=sync.mjs.map","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { PoServerBundleOwner } from '@agimon-ai/po-core/serverPlugin';\n\nimport type { ExtensionComposition } from '../cli/extensionAssembler';\n\nexport interface DeclaredMcpPlugin {\n  readonly packageName: string;\n  readonly packageDir: string;\n  readonly entry: string;\n  readonly dist: string;\n  readonly ui?: { readonly dist: string; readonly widgets: readonly string[] };\n}\n\nfunction packageRootOf(entry: string): string {\n  let directory = path.dirname(fs.realpathSync(entry));\n  for (;;) {\n    if (fs.existsSync(path.join(directory, 'package.json'))) return directory;\n    const parent = path.dirname(directory);\n    if (parent === directory) throw new Error(`No package manifest owns ${entry}`);\n    directory = parent;\n  }\n}\n\nfunction packagePath(packageDir: string, field: string, value: unknown): string {\n  if (typeof value !== 'string' || !value.startsWith('./') || value.includes('..'))\n    throw new Error(`poMcp ${field} in ${packageDir} must be a package-relative ./path with no '..'.`);\n  return value;\n}\n\nfunction declaredMcpPlugin(packageDir: string, manifest: Record<string, unknown>): DeclaredMcpPlugin | undefined {\n  const value = manifest.poMcp;\n  if (value === undefined) return undefined;\n  if (typeof value !== 'object' || value === null || Array.isArray(value))\n    throw new Error(`poMcp manifest in ${packageDir} must be an object.`);\n  const declaration = value as Record<string, unknown>;\n  if (!Array.isArray(declaration.scopes) || declaration.scopes.length !== 1 || declaration.scopes[0] !== 'session')\n    throw new Error(`poMcp scopes in ${packageDir} must be exactly ['session'].`);\n  const packageName = manifest.name;\n  if (typeof packageName !== 'string' || packageName === '') throw new Error(`Package in ${packageDir} has no name.`);\n  let ui: DeclaredMcpPlugin['ui'];\n  if (declaration.ui !== undefined) {\n    const value = declaration.ui as { dist?: unknown; widgets?: unknown } | null;\n    if (\n      typeof value !== 'object' ||\n      value === null ||\n      !Array.isArray(value.widgets) ||\n      value.widgets.some((key: unknown) => typeof key !== 'string' || !key.startsWith(`${packageName}/`)) ||\n      new Set(value.widgets).size !== value.widgets.length\n    )\n      throw new Error(`Invalid MCP widget manifest in ${packageDir}`);\n    ui = { dist: packagePath(packageDir, 'ui.dist', value.dist), widgets: value.widgets as string[] };\n  }\n  return {\n    packageName,\n    packageDir,\n    ...(ui === undefined ? {} : { ui }),\n    entry: packagePath(packageDir, 'entry', declaration.entry),\n    dist: packagePath(packageDir, 'dist', declaration.dist),\n  };\n}\n\n/** One MCP plugin a composition set selects, with the built entry a host imports. */\nexport interface McpPluginCandidate {\n  readonly declaration: DeclaredMcpPlugin;\n  /** Absolute, symlink-resolved path of the package's built `dist` entry. */\n  readonly module: string;\n  /** Every major mode and layer that admitted the package. */\n  readonly owners: readonly PoServerBundleOwner[];\n}\n\n/**\n * The MCP plugins the given compositions select, in first-selection order.\n *\n * A package that two different directories claim is ambiguous, and a built\n * entry that resolves outside its package is refused.\n */\nexport function mcpPluginCandidates(compositions: readonly ExtensionComposition[]): McpPluginCandidate[] {\n  const packages = new Map<string, { declaration: DeclaredMcpPlugin; owners: PoServerBundleOwner[] }>();\n  for (const composition of compositions) {\n    const majorMode = composition.majorMode?.name;\n    if (!majorMode) throw new Error('An MCP bundle composition needs its major mode');\n    for (const root of new Set(composition.packageEntries.map(packageRootOf))) {\n      const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as Record<string, unknown>;\n      const declaration = declaredMcpPlugin(root, manifest);\n      if (declaration === undefined) continue;\n      const previous = packages.get(declaration.packageName);\n      if (previous && previous.declaration.packageDir !== root)\n        throw new Error(`Ambiguous MCP bundle package: ${declaration.packageName}`);\n      const candidate = previous ?? { declaration, owners: [] };\n      const layers = composition.selections\n        .filter(\n          (selection) => selection.outcome === 'resolved' && selection.path && packageRootOf(selection.path) === root,\n        )\n        .map((selection) => selection.layer);\n      for (const layer of new Set(layers.length > 0 ? layers : ['default'])) {\n        if (!candidate.owners.some((owner) => owner.majorMode === majorMode && owner.layer === layer))\n          candidate.owners.push({ majorMode, layer });\n      }\n      packages.set(declaration.packageName, candidate);\n    }\n  }\n  return [...packages.values()].map(({ declaration, owners }) => {\n    const module = fs.realpathSync(path.resolve(declaration.packageDir, declaration.dist));\n    const relative = path.relative(declaration.packageDir, module);\n    if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))\n      throw new Error(`MCP entry escapes package: ${declaration.packageName}`);\n    return { declaration, module, owners };\n  });\n}\n","import path from 'node:path';\n\n/**\n * Matrix selection shared by the Pi and compatibility parsers.\n *\n * Both frontends pick the same three axes (profile, domains, major mode) out of\n * the same environment variables with the same defaults. They used to hold two\n * copies of that logic, and the copies drifted: the inline `--name=value` forms\n * and the strict value reader existed in the compatibility parser only, so\n * `./pi.sh --profile=x` silently forwarded an unknown flag to Pi. One copy here\n * is what keeps them honest.\n */\n\n/**\n * One variable per axis.\n *\n * These used to come in pairs, `PO_PI_*` for what the caller selected and\n * `PO_*` for what the harness resolved and published, with the second\n * outranking the first. A nested run still inherits its launcher's choice under\n * one name, because the launcher projects into the child environment and\n * overwrites the same key. Two names for one value only ever meant two ways to\n * disagree.\n */\nexport const PO_PROFILE_ENV = 'PO_PROFILE';\nexport const PO_DOMAINS_ENV = 'PO_DOMAINS';\nexport const PO_MAJOR_MODE_ENV = 'PO_MAJOR_MODE';\nexport const PO_ADDITIONAL_DIRECTORIES_ENV = 'PO_ADDITIONAL_DIRS';\nexport const PO_PRESET_ENV = 'PO_PRESET';\n\n/** Removed spelling of the major mode axis, reported rather than honored. */\nexport const REMOVED_PO_LAYER_ENV = 'PO_LAYER';\n\n/**\n * The whole retired namespace, reported rather than ignored.\n *\n * A prefix scan rather than a constant per variable: there were 28 of them, and\n * a list maintained by hand is a list that misses one. A stale\n * `export AGENT_HARNESS_MAJOR_MODE=dev` in a shell profile would otherwise\n * silently start the session on `copilot`.\n */\nconst RETIRED_ENV_PREFIX = 'AGENT_HARNESS_';\nconst CURRENT_ENV_PREFIX = 'PO_';\n\nexport const PROFILE_OPTION = '--profile';\nexport const DOMAIN_OPTION = '--domain';\nexport const DOMAINS_OPTION = '--domains';\n/**\n * The major mode flag.\n *\n * Not `--mode`: Pi owns that one for its output mode, and for a value outside\n * `text|json|rpc` it consumes both tokens and ignores them without a\n * diagnostic. A synced `pi --mode dev` would have failed silently.\n */\nexport const MAJOR_MODE_OPTION = '--major-mode';\nexport const ADD_DIRECTORY_OPTION = '--add-dir';\nexport const REMOVED_LAYER_OPTION = '--layer';\nexport const REMOVED_LAYERS_OPTION = '--layers';\nexport const REMOVED_TARGET_OPTION = '--target';\n\nexport const DEFAULT_MAJOR_MODE = 'copilot';\nexport const DEFAULT_DOMAIN = 'default';\n\nconst CSV_DELIMITER = ',';\nconst OPTION_PREFIX = '--';\n\nexport interface OptionMatch {\n  value: string;\n  /** Index of the last argument consumed, for the caller's loop cursor. */\n  nextIndex: number;\n  /** True for `--name=value`. Callers that re-emit an option preserve the form. */\n  inline: boolean;\n}\n\n/**\n * Reads `--name value` or `--name=value`, returning undefined for anything else.\n *\n * A value starting with `--` is rejected rather than consumed, so\n * `--profile --explain` reports a missing value instead of swallowing the next\n * flag. In compatibility mode this is also what stops the `--` provider\n * delimiter being taken as a matrix value.\n */\nexport function readOption(args: string[], index: number, name: string): OptionMatch | undefined {\n  // Callers walk `args` by index, so this is always in range.\n  const arg = args[index]!;\n  if (arg === name) {\n    const value = args[index + 1];\n    if (!value || value.startsWith(OPTION_PREFIX)) throw new Error(`${name} requires a value`);\n    return { value, nextIndex: index + 1, inline: false };\n  }\n  const inlinePrefix = `${name}=`;\n  if (!arg.startsWith(inlinePrefix)) return undefined;\n  const value = arg.slice(inlinePrefix.length);\n  if (!value) throw new Error(`${name} requires a value`);\n  return { value, nextIndex: index, inline: true };\n}\n\n/** Matches `--name` or `--name=value`, for reporting options that were removed. */\nexport function matchesOption(arg: string, name: string): boolean {\n  return arg === name || arg.startsWith(`${name}=`);\n}\n\nexport function parseCsv(value: string): string[] {\n  return value\n    .split(CSV_DELIMITER)\n    .map((item) => item.trim())\n    .filter(Boolean);\n}\n\nexport function parseRequiredCsv(value: string, option: string): string[] {\n  const values = parseCsv(value);\n  if (values.length === 0) throw new Error(`${option} requires a value`);\n  return values;\n}\n\nexport function parseMajorMode(value: string, source: string): string {\n  const majorMode = value.trim();\n  if (!majorMode) throw new Error(`${source} requires a value`);\n  if (majorMode.includes(CSV_DELIMITER)) throw new Error(`${source} accepts one major mode name`);\n  return majorMode;\n}\n\nexport function parseProfileValue(value: string, source: string): string {\n  if (value.includes(CSV_DELIMITER)) throw new Error(`${source} accepts one profile name`);\n  if (!value.trim()) throw new Error(`${source} requires a value`);\n  return value;\n}\n\n/**\n * Reports any variable left over from the retired `AGENT_HARNESS_*` namespace.\n *\n * Called before anything reads the environment, so a stale export fails the\n * session instead of being quietly outvoted by a default. Both prefixes are\n * built from the constants above rather than written inline, because a\n * search-and-replace over this repository is exactly what retired the old one.\n */\nexport function assertNoRetiredEnvironment(environment: NodeJS.ProcessEnv): void {\n  const stale = Object.keys(environment)\n    .filter((key) => key.startsWith(RETIRED_ENV_PREFIX))\n    .sort();\n  if (stale.length === 0) return;\n  const replacements = stale.map((key) => `${key} -> ${CURRENT_ENV_PREFIX}${key.slice(RETIRED_ENV_PREFIX.length)}`);\n  throw new Error(\n    `The ${RETIRED_ENV_PREFIX}* environment was replaced by ${CURRENT_ENV_PREFIX}*. Unset or rename: ${replacements.join(', ')}`,\n  );\n}\n\n/**\n * The major mode a nested run inherits from its launcher, or the default.\n *\n * The removed spelling throws rather than being ignored. A stale\n * `export PO_LAYER=dev` left in a shell profile would otherwise silently\n * select `copilot`, which is the exact confusion the rename removed.\n */\nexport function resolveInheritedMajorMode(\n  environment: NodeJS.ProcessEnv,\n  defaultMajorMode: string = DEFAULT_MAJOR_MODE,\n): string {\n  assertNoRetiredEnvironment(environment);\n  if (environment[REMOVED_PO_LAYER_ENV]) {\n    throw new Error(`${REMOVED_PO_LAYER_ENV} was replaced by ${PO_MAJOR_MODE_ENV}`);\n  }\n  const inherited = environment[PO_MAJOR_MODE_ENV];\n  return parseMajorMode(inherited || defaultMajorMode, inherited ? PO_MAJOR_MODE_ENV : 'defaultMajorMode');\n}\n\n/** The profile a run inherits from its environment, validated once up front. */\nexport function resolveInheritedProfile(environment: NodeJS.ProcessEnv): string | undefined {\n  const inherited = environment[PO_PROFILE_ENV] || undefined;\n  if (inherited?.includes(CSV_DELIMITER)) throw new Error(`${PO_PROFILE_ENV} accepts one profile name`);\n  return inherited;\n}\n\n/** Directories inherited from the launcher environment. */\nexport function resolveAdditionalDirectories(environment: NodeJS.ProcessEnv, baseDirectory: string): string[] {\n  return (environment[PO_ADDITIONAL_DIRECTORIES_ENV] ?? '')\n    .split(path.delimiter)\n    .filter(Boolean)\n    .map((directory) => path.resolve(baseDirectory, directory));\n}\n","import { t as createDirectoryWithMode } from \"./atomicJson-Dj3rlZbD.mjs\";\nimport { f as parsePoConfig } from \"./configPolicy-BIQmQv2-.mjs\";\nimport path from \"node:path\";\nimport { createSerialRunner, nodeHost, readTextIfExists, writeFileAtomic } from \"@agimon-ai/po-core/platform\";\nimport { randomUUID } from \"node:crypto\";\nimport { parseDocument } from \"yaml\";\nimport fs from \"node:fs/promises\";\n//#region src/services/configWriter/core.ts\n/**\n* Pure half of the Po config writer.\n*\n* Writes into the global Po config file, one key path at a time.\n*\n* Extracted from po-file-edit, which owned the only writer in the repo and had\n* it hard-coded to `editor.command`. Several extensions now edit their own\n* settings from the config panel, and every one of them needs the same four\n* properties: keep the user's comments, never publish a file the parser would\n* reject, never leave a half-written file behind, and apply a set of related\n* edits together.\n*\n* That last one is not a convenience. `voice.adapters.<engine>.model` accepts a\n* path or an id but not both, so switching between them is a set and an unset\n* that must land in the same write, or the file is briefly invalid.\n*\n* Atomicity is the same rename trick as `atomicJson` next door, and carries\n* the same caveat across processes: it prevents torn reads, not lost updates.\n* Two sessions with the panel open still clobber each other, because the rename\n* only publishes what the caller already computed. Within one process every\n* read-modify-write of a file is queued per path, so concurrent edits compose.\n*\n* AVOID:\n* - Treating this as a lock\n* - Writing an empty string; the parser rejects blank values, so clearing a key\n*   means removing it\n*/\n/**\n* The global file holds machine-wide credentials-adjacent settings and lives in\n* the user's home, so it stays private.\n*/\nconst PRIVATE_FILE_MODE = 384;\nconst PRIVATE_DIRECTORY_MODE = 448;\n/**\n* The repository file is committed to git and read by everyone who checks the\n* project out, so it takes the modes `init.ts` already seeds it with. Writing it\n* private would produce a 0600 file in a working tree, which is both wrong and\n* invisible until someone else clones.\n*/\nconst REPOSITORY_FILE_MODE = 420;\nconst REPOSITORY_DIRECTORY_MODE = 493;\n/** The permissions a scope's file and its parent directory are created with. */\nfunction modesForScope(scope) {\n\treturn scope === \"repository\" ? {\n\t\tfile: REPOSITORY_FILE_MODE,\n\t\tdirectory: REPOSITORY_DIRECTORY_MODE\n\t} : {\n\t\tfile: PRIVATE_FILE_MODE,\n\t\tdirectory: PRIVATE_DIRECTORY_MODE\n\t};\n}\nfunction isEmptyCollection(value) {\n\tif (value === null || typeof value !== \"object\") return false;\n\tconst items = value.items;\n\treturn Array.isArray(items) && items.length === 0;\n}\n/** Drops ancestors of a removed key that are now empty, deepest first. */\nfunction pruneEmptyAncestors(document, keyPath) {\n\tfor (let depth = keyPath.length - 1; depth > 0; depth -= 1) {\n\t\tconst ancestor = keyPath.slice(0, depth);\n\t\tif (!document.hasIn(ancestor)) continue;\n\t\tif (!isEmptyCollection(document.getIn(ancestor, true))) return;\n\t\tdocument.deleteIn(ancestor);\n\t}\n}\n/** One queue per config file, shared by the async writer and the Node shim. */\nconst configWrites = createSerialRunner();\n/**\n* Applies every edit to the file's current text as one document mutation and\n* returns the text to publish.\n* Throws, having changed nothing, when the source does not parse or the result\n* would not validate.\n*\n* Validation runs against the serialized result rather than each edit, so a pair\n* of edits only valid together is accepted, and a single edit that breaks an\n* invariant elsewhere is still caught.\n*/\nfunction applyPoConfigEdits(content, filePath, edits, options = {}) {\n\tconst document = parseDocument(content, { keepSourceTokens: true });\n\tif (document.errors.length > 0) throw new Error(`Could not parse Po config at ${filePath}`);\n\tfor (const edit of edits) {\n\t\tconst keyPath = [...edit.keyPath];\n\t\tif (edit.value !== void 0) {\n\t\t\tdocument.setIn(keyPath, edit.value);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!document.hasIn(keyPath)) continue;\n\t\tdocument.deleteIn(keyPath);\n\t\tif (options.prune !== false) pruneEmptyAncestors(document, keyPath);\n\t}\n\tconst output = document.toString();\n\tparsePoConfig(output, filePath);\n\treturn output;\n}\n//#endregion\n//#region src/services/configWriter/sync.ts\nasync function readIfPresent(filePath) {\n\ttry {\n\t\treturn await fs.readFile(filePath, \"utf8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && \"code\" in error && error.code === \"ENOENT\") return \"\";\n\t\tthrow error;\n\t}\n}\n/**\n* Applies every edit as one document mutation, or throws having written nothing.\n*\n* @deprecated Node-only shim over node:fs; use writePoConfigValuesAsync. Removed in M2.\n*/\nasync function writePoConfigValues(filePath, edits, options = {}) {\n\tif (edits.length === 0) return;\n\tawait configWrites.forKey(path.resolve(filePath))(async () => {\n\t\tconst output = applyPoConfigEdits(await readIfPresent(filePath), filePath, edits, options);\n\t\tconst modes = modesForScope(options.scope ?? \"global\");\n\t\tawait fs.mkdir(path.dirname(filePath), {\n\t\t\tmode: modes.directory,\n\t\t\trecursive: true\n\t\t});\n\t\tconst temporaryPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;\n\t\ttry {\n\t\t\tawait fs.writeFile(temporaryPath, output, {\n\t\t\t\tencoding: \"utf8\",\n\t\t\t\tmode: modes.file\n\t\t\t});\n\t\t\tawait fs.rename(temporaryPath, filePath);\n\t\t} catch (error) {\n\t\t\tawait fs.rm(temporaryPath, { force: true });\n\t\t\tthrow error;\n\t\t}\n\t});\n}\n/** @deprecated Node-only shim over node:fs; use setPoConfigValueAsync. Removed in M2. */\nasync function setPoConfigValue(filePath, keyPath, value, options = {}) {\n\tawait writePoConfigValues(filePath, [{\n\t\tkeyPath,\n\t\tvalue\n\t}], options);\n}\n/** @deprecated Node-only shim over node:fs; use unsetPoConfigValueAsync. Removed in M2. */\nasync function unsetPoConfigValue(filePath, keyPath, options = {}) {\n\tawait writePoConfigValues(filePath, [{ keyPath }], options);\n}\n//#endregion\n//#region src/services/configWriter/index.ts\n/**\n* Applies every edit as one document mutation over a FileSystem, or throws\n* having written nothing. Concurrent calls for one file in this process are\n* queued, so each reads what the previous one wrote.\n*/\nasync function writePoConfigValuesAsync(fs, filePath, edits, context, options = {}) {\n\tif (edits.length === 0) return;\n\tawait configWrites.forKey(path.resolve(filePath))(async () => {\n\t\tconst output = applyPoConfigEdits(await readTextIfExists(fs, filePath, context) ?? \"\", filePath, edits, options);\n\t\tconst modes = modesForScope(options.scope ?? \"global\");\n\t\tawait createDirectoryWithMode(fs, path.dirname(filePath), modes.directory, context);\n\t\tawait writeFileAtomic(fs, filePath, output, context);\n\t\tawait nodeHost.setMode(filePath, modes.file);\n\t});\n}\nasync function setPoConfigValueAsync(fs, filePath, keyPath, value, context, options = {}) {\n\tawait writePoConfigValuesAsync(fs, filePath, [{\n\t\tkeyPath,\n\t\tvalue\n\t}], context, options);\n}\nasync function unsetPoConfigValueAsync(fs, filePath, keyPath, context, options = {}) {\n\tawait writePoConfigValuesAsync(fs, filePath, [{ keyPath }], context, options);\n}\n//#endregion\nexport { unsetPoConfigValue as a, setPoConfigValue as i, unsetPoConfigValueAsync as n, writePoConfigValues as o, writePoConfigValuesAsync as r, setPoConfigValueAsync as t };\n\n//# sourceMappingURL=configWriter-C-UadpFY.mjs.map","import { n as writePrivateAtomicJsonAsync } from \"./atomicJson-Dj3rlZbD.mjs\";\nimport { t as writePrivateAtomicJson } from \"./sync-BJ8gCP9s.mjs\";\nimport path from \"node:path\";\nimport { createSerialRunner, nodeHost, readTextIfExists } from \"@agimon-ai/po-core/platform\";\nimport fs from \"node:fs\";\nimport { piAgentDirectory } from \"@agimon-ai/po-core/piSettings\";\n//#region src/services/imageSettings/index.ts\nconst IMAGE_SETTINGS_KEY = \"images\";\nconst IMAGE_AUTO_RESIZE_KEY = \"autoResize\";\nconst IMAGE_MAX_DIMENSION_KEY = \"maxDimension\";\n/** Pi's own cap, from its resize core; also the largest value worth writing. */\nconst DEFAULT_IMAGE_MAX_DIMENSION = 2e3;\n/** Below this a screenshot stops being readable, which is what reads are for. */\nconst MIN_IMAGE_MAX_DIMENSION = 256;\nfunction clampImageMaxDimension(value) {\n\tconst rounded = Math.round(value);\n\tif (rounded < 256) return 256;\n\tif (rounded > 2e3) return DEFAULT_IMAGE_MAX_DIMENSION;\n\treturn rounded;\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** Resolves the effective limits, defaulting anything absent or unusable. */\nfunction parsePiImageSettings(config) {\n\tconst images = config[IMAGE_SETTINGS_KEY];\n\tif (!isRecord(images)) return {\n\t\tautoResize: true,\n\t\tmaxDimension: DEFAULT_IMAGE_MAX_DIMENSION\n\t};\n\tconst autoResize = images[IMAGE_AUTO_RESIZE_KEY];\n\tconst maxDimension = images[IMAGE_MAX_DIMENSION_KEY];\n\treturn {\n\t\tautoResize: typeof autoResize === \"boolean\" ? autoResize : true,\n\t\tmaxDimension: typeof maxDimension === \"number\" && Number.isFinite(maxDimension) ? clampImageMaxDimension(maxDimension) : DEFAULT_IMAGE_MAX_DIMENSION\n\t};\n}\n/**\n* Folds a change into the `images` object of a settings document, leaving every\n* other key of that document, and of `images` itself, as it was.\n*/\nfunction applyPiImageSettings(config, update) {\n\tconst existing = config[IMAGE_SETTINGS_KEY];\n\tconst images = isRecord(existing) ? { ...existing } : {};\n\tif (update.autoResize !== void 0) images[IMAGE_AUTO_RESIZE_KEY] = update.autoResize;\n\tif (update.maxDimension !== void 0) images[IMAGE_MAX_DIMENSION_KEY] = clampImageMaxDimension(update.maxDimension);\n\treturn {\n\t\t...config,\n\t\t[IMAGE_SETTINGS_KEY]: images\n\t};\n}\n//#endregion\n//#region src/services/piConfig/core.ts\nconst SETTINGS_FILE_NAME = \"settings.json\";\nconst CONFIG_DIR_NAME = \".pi\";\nconst LEGACY_CONFIG_DIR_NAME = \"pi\";\n/** An explicit home other than the real one is isolated from the process environment. */\nfunction defaultAgentDirectory(homeDirectory) {\n\treturn piAgentDirectory(homeDirectory === nodeHost.homeDirectory() ? process.env : {}, homeDirectory);\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction mergeConfig(base, override) {\n\tconst result = { ...base };\n\tfor (const [key, value] of Object.entries(override)) {\n\t\tconst current = result[key];\n\t\tresult[key] = isObject(current) && isObject(value) ? mergeConfig(current, value) : value;\n\t}\n\treturn result;\n}\n/** Parses one settings file; `undefined` text means the file is missing. */\nfunction configFromText(text, filePath) {\n\tif (text === void 0) return {};\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch (error) {\n\t\tthrow new Error(`Could not parse Pi settings at ${filePath}`, { cause: error });\n\t}\n\tif (!isObject(parsed)) throw new Error(`Pi settings at ${filePath} must be a JSON object`);\n\treturn parsed;\n}\nfunction projectIsTrusted(value) {\n\treturn typeof value === \"function\" ? value() : value;\n}\nfunction piConfigPaths(repoRoot, homeDirectory = nodeHost.homeDirectory(), agentDirectory = defaultAgentDirectory(homeDirectory)) {\n\treturn {\n\t\tcanonicalUser: path.join(agentDirectory, SETTINGS_FILE_NAME),\n\t\tcanonicalProject: path.join(repoRoot, CONFIG_DIR_NAME, SETTINGS_FILE_NAME),\n\t\tlegacyUser: [path.join(homeDirectory, CONFIG_DIR_NAME, SETTINGS_FILE_NAME)],\n\t\tlegacyProject: [path.join(repoRoot, LEGACY_CONFIG_DIR_NAME, SETTINGS_FILE_NAME)]\n\t};\n}\n/** The user and project files to read, lowest precedence first. */\nfunction layerPaths(options) {\n\tconst paths = piConfigPaths(options.repoRoot, options.homeDirectory);\n\treturn {\n\t\tuser: [\n\t\t\t...paths.legacyUser,\n\t\t\t...options.userConfigPaths ?? [],\n\t\t\tpaths.canonicalUser\n\t\t],\n\t\tproject: [\n\t\t\t...paths.legacyProject,\n\t\t\t...options.projectConfigPaths ?? [],\n\t\t\tpaths.canonicalProject\n\t\t]\n\t};\n}\nfunction composePiConfig(options, user, trustedProject) {\n\treturn [\n\t\toptions.defaults ?? {},\n\t\tuser,\n\t\toptions.overlay ?? {},\n\t\ttrustedProject,\n\t\toptions.environment ?? {},\n\t\toptions.cli ?? {},\n\t\toptions.programmatic ?? {}\n\t].reduce(mergeConfig, {});\n}\n/**\n* Where the image limits are read from and written to.\n*\n* The user layer only. Pi merges a trusted project settings.json over it, but\n* these limits describe one machine's tolerance for image payloads rather than\n* one repository's, and the cockpit page that writes them has no repository\n* scope to offer. The legacy user path is still read, because a machine that\n* has not been migrated still answers from it.\n*/\nfunction userSettingsPaths(homeDirectory) {\n\treturn {\n\t\tlegacy: path.join(homeDirectory, CONFIG_DIR_NAME, SETTINGS_FILE_NAME),\n\t\tcanonical: path.join(defaultAgentDirectory(homeDirectory), SETTINGS_FILE_NAME)\n\t};\n}\n/** The file a change lands in; Pi's own settings toggle writes the same one. */\nfunction piImageSettingsPath(homeDirectory = nodeHost.homeDirectory()) {\n\treturn userSettingsPaths(homeDirectory).canonical;\n}\n//#endregion\n//#region src/services/piConfig/sync.ts\nfunction readConfig$1(filePath) {\n\treturn configFromText(fs.existsSync(filePath) ? fs.readFileSync(filePath, \"utf8\") : void 0, filePath);\n}\nasync function readConfigAsync(filePath) {\n\tlet text;\n\ttry {\n\t\ttext = await fs.promises.readFile(filePath, \"utf8\");\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") return {};\n\t\tthrow new Error(`Could not parse Pi settings at ${filePath}`, { cause: error });\n\t}\n\treturn configFromText(text, filePath);\n}\nfunction readConfigPaths$1(paths) {\n\treturn paths.reduce((config, filePath) => mergeConfig(config, readConfig$1(filePath)), {});\n}\nasync function readConfigPathsAsync(paths) {\n\treturn (await Promise.all(paths.map(readConfigAsync))).reduce(mergeConfig, {});\n}\n/** @deprecated Node-only sync shim; use readPiConfig. Removed in M2. */\nfunction loadPiConfig(options) {\n\tconst paths = layerPaths(options);\n\treturn composePiConfig(options, readConfigPaths$1(paths.user), projectIsTrusted(options.isProjectTrusted) ? readConfigPaths$1(paths.project) : {});\n}\n/** @deprecated Node-only shim over node:fs; use readPiConfig. Removed in M2. */\nasync function loadPiConfigAsync(options) {\n\tconst paths = layerPaths(options);\n\tconst [user, trustedProject] = await Promise.all([readConfigPathsAsync(paths.user), projectIsTrusted(options.isProjectTrusted) ? readConfigPathsAsync(paths.project) : Promise.resolve({})]);\n\treturn composePiConfig(options, user, trustedProject);\n}\n/** @deprecated Node-only sync shim; use readPiImageSettings. Removed in M2. */\nfunction loadPiImageSettings(homeDirectory = nodeHost.homeDirectory()) {\n\tconst paths = userSettingsPaths(homeDirectory);\n\treturn parsePiImageSettings(readConfigPaths$1([paths.legacy, paths.canonical]));\n}\n/**\n* Writes the changed keys back and reports the limits that now apply.\n*\n* Read-modify-write on Pi's own file, so a save races a concurrent Pi settings\n* save rather than merging with it. Pi writes only the fields its UI touched,\n* as this does, which keeps the window to the one setting being changed on\n* both sides at once.\n*\n* @deprecated Node-only sync shim; use savePiImageSettingsAsync. Removed in M2.\n*/\nfunction savePiImageSettings(update, homeDirectory = nodeHost.homeDirectory()) {\n\tconst paths = userSettingsPaths(homeDirectory);\n\twritePrivateAtomicJson(paths.canonical, applyPiImageSettings(readConfig$1(paths.canonical), update));\n\treturn loadPiImageSettings(homeDirectory);\n}\n//#endregion\n//#region src/services/piConfig/index.ts\n/** Image settings saves in this process are queued per file, so none reads a stale document. */\nconst imageSettingsWrites = createSerialRunner();\nasync function readConfig(fs, filePath, context) {\n\treturn configFromText(await readTextIfExists(fs, filePath, context), filePath);\n}\nasync function readConfigPaths(fs, paths, context) {\n\treturn (await Promise.all(paths.map((filePath) => readConfig(fs, filePath, context)))).reduce(mergeConfig, {});\n}\n/** Loads the layered Pi settings over a FileSystem. A missing file contributes nothing. */\nasync function readPiConfig(fs, options, context) {\n\tconst paths = layerPaths(options);\n\tconst [user, trustedProject] = await Promise.all([readConfigPaths(fs, paths.user, context), projectIsTrusted(options.isProjectTrusted) ? readConfigPaths(fs, paths.project, context) : Promise.resolve({})]);\n\treturn composePiConfig(options, user, trustedProject);\n}\nasync function readPiImageSettings(fs, context, homeDirectory = nodeHost.homeDirectory()) {\n\tconst paths = userSettingsPaths(homeDirectory);\n\treturn parsePiImageSettings(await readConfigPaths(fs, [paths.legacy, paths.canonical], context));\n}\n/**\n* Writes the changed keys back and reports the limits that now apply.\n*\n* Read-modify-write on Pi's own file, so a save races a concurrent Pi settings\n* save rather than merging with it. Pi writes only the fields its UI touched,\n* as this does, which keeps the window to the one setting being changed on\n* both sides at once. Saves from this process are queued.\n*/\nasync function savePiImageSettingsAsync(fs, update, context, homeDirectory = nodeHost.homeDirectory()) {\n\tconst paths = userSettingsPaths(homeDirectory);\n\tawait imageSettingsWrites.forKey(path.resolve(paths.canonical))(async () => {\n\t\tconst current = await readConfig(fs, paths.canonical, context);\n\t\tawait writePrivateAtomicJsonAsync(fs, paths.canonical, applyPiImageSettings(current, update), context);\n\t});\n\treturn readPiImageSettings(fs, context, homeDirectory);\n}\n//#endregion\nexport { loadPiConfigAsync as a, piConfigPaths as c, MIN_IMAGE_MAX_DIMENSION as d, clampImageMaxDimension as f, loadPiConfig as i, piImageSettingsPath as l, readPiImageSettings as n, loadPiImageSettings as o, parsePiImageSettings as p, savePiImageSettingsAsync as r, savePiImageSettings as s, readPiConfig as t, DEFAULT_IMAGE_MAX_DIMENSION as u };\n\n//# sourceMappingURL=piConfig-Bq36PQFF.mjs.map","import { c as configScopeOf } from \"./configPolicy-BIQmQv2-.mjs\";\nimport { o as globalPoConfigPath, p as repositoryPoConfigPath } from \"./core-Cd_sGFB4.mjs\";\nimport { o as loadPoConfigLayers } from \"./config-COovzKkv.mjs\";\nimport { r as writePoConfigValuesAsync } from \"./configWriter-C-UadpFY.mjs\";\nimport { p as defaultDomainsForMajorMode, s as loadDomains } from \"./domains-BGgj0mjd.mjs\";\nimport { n as readPiImageSettings, r as savePiImageSettingsAsync, u as DEFAULT_IMAGE_MAX_DIMENSION } from \"./piConfig-Bq36PQFF.mjs\";\nimport { i as loadMajorModesConfig } from \"./majorModes-D-R9rBjJ.mjs\";\nimport { l as loadProfiles } from \"./profiles-DHW98Cn4.mjs\";\nimport { BACKGROUND_CONTEXT } from \"@agimon-ai/po-core/platform\";\nimport { apiResponse, defineApiRoutes } from \"@agimon-ai/po-core/web\";\n//#region src/constants/settings.ts\nconst SELECTION_KEYS = {\n\tmajorMode: [\"selection\", \"majorMode\"],\n\tdomains: [\"selection\", \"domains\"],\n\tprofile: [\"selection\", \"profile\"]\n};\n//#endregion\n//#region src/types/apiRoutes.ts\n/**\n* This package's routes, as data.\n*\n* No scope and no base path. The build reads both off\n* `src/extensions/(backend)/api/settings/`, so the mount is stated once, by the\n* folder that creates it. `settings` is the host's own API: it answers at\n* `/api/settings` and `/api/workspaces/<id>/settings`, beside `/plugins` rather\n* than under it, and the client knows that from the base path alone.\n*\n* This is the one file the mount's dispatcher and, once the client crosses the\n* package boundary, the cockpit both read, so a path cannot move on one side\n* alone.\n*/\nvar apiRoutes_default = defineApiRoutes({\n\t/** The mount itself: the selected keys and the hash of each file they came from. */\n\tconfig: {\n\t\tmethod: \"GET\",\n\t\tpath: \"/\",\n\t\t/** Repeatable. The page also sends `repoRoot`, which the mount ignores: it serves one repository. */\n\t\tquery: [\"key\"],\n\t\tresponse: apiResponse()\n\t},\n\tvalue: {\n\t\tmethod: \"PUT\",\n\t\tpath: \"/value\",\n\t\tresponse: apiResponse()\n\t},\n\trepositories: {\n\t\tmethod: \"GET\",\n\t\tpath: \"/repositories\",\n\t\tresponse: apiResponse()\n\t},\n\t/** The workspace this mount was bound to; a global mount has none and answers 404. */\n\trepository: {\n\t\tmethod: \"GET\",\n\t\tpath: \"/repository\",\n\t\tresponse: apiResponse()\n\t},\n\tselection: {\n\t\tmethod: \"PUT\",\n\t\tpath: \"/repository/selection\",\n\t\tresponse: apiResponse()\n\t},\n\t/** Pi's own image limits, served by the global mount only. */\n\timages: {\n\t\tmethod: \"GET\",\n\t\tpath: \"/images\",\n\t\tresponse: apiResponse()\n\t},\n\t/** The same path as `images`; the method is the whole of the difference. */\n\tsaveImages: {\n\t\tmethod: \"PUT\",\n\t\tpath: \"/images\",\n\t\tresponse: apiResponse()\n\t}\n});\n//#endregion\n//#region src/services/settings/index.ts\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction describe(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** The display form of a config value; a record has no single-line form, so it has none. */\nfunction displayValue(value) {\n\tif (typeof value === \"string\") return value;\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (Array.isArray(value)) return value.map((entry) => displayValue(entry) ?? \"\").join(\", \");\n}\nfunction pathFor(scope, repoRoot, homeDirectory) {\n\treturn scope === \"repository\" ? repositoryPoConfigPath(repoRoot) : globalPoConfigPath(homeDirectory);\n}\nfunction parseWrite(body) {\n\tif (!isRecord(body)) return void 0;\n\tconst { repoRoot, scope, expectedHash } = body;\n\tif (typeof repoRoot !== \"string\" || scope !== \"global\" && scope !== \"repository\") return void 0;\n\tif (scope === \"repository\" && repoRoot === \"\") return void 0;\n\tif (typeof expectedHash !== \"string\") return void 0;\n\tconst edits = body.edits === void 0 ? [{\n\t\tkeyPath: body.keyPath,\n\t\tvalue: body.value\n\t}] : body.edits;\n\tif (!Array.isArray(edits) || edits.length === 0 || edits.length > 100) return void 0;\n\tconst validated = [];\n\tfor (const edit of edits) {\n\t\tif (!isRecord(edit)) return void 0;\n\t\tconst { keyPath, value } = edit;\n\t\tif (!Array.isArray(keyPath) || keyPath.length === 0 || keyPath.some((part) => typeof part !== \"string\")) return void 0;\n\t\tif (value !== null && typeof value !== \"string\" && (typeof value !== \"number\" || !Number.isFinite(value))) return void 0;\n\t\tvalidated.push({\n\t\t\tkeyPath,\n\t\t\tvalue\n\t\t});\n\t}\n\treturn {\n\t\trepoRoot,\n\t\tscope,\n\t\texpectedHash,\n\t\tedits: validated\n\t};\n}\nfunction configuredSelectionValue(layers, key, effective) {\n\tconst origin = layers.originOf(SELECTION_KEYS[key]);\n\treturn {\n\t\t...effective === void 0 ? {} : { effective },\n\t\t...origin === \"repository\" && effective !== void 0 ? { repository: effective } : {},\n\t\torigin\n\t};\n}\nfunction repositorySettingsView(repository, homeDirectory, environment = process.env) {\n\tconst repoRoot = repository.path;\n\tconst layers = loadPoConfigLayers(repoRoot, homeDirectory, environment);\n\tconst modes = loadMajorModesConfig(repoRoot, homeDirectory, environment);\n\tconst domains = loadDomains(repoRoot, homeDirectory);\n\tconst profiles = loadProfiles(repoRoot, homeDirectory);\n\tconst configured = layers.effective.selection;\n\tconst effectiveMajorMode = configured?.majorMode ?? modes.defaultMajorMode;\n\tconst effectiveDomains = configured?.domains ?? defaultDomainsForMajorMode(effectiveMajorMode, {}, domains.defaultDomains);\n\tconst majorModes = Object.entries(modes.majorMode).map(([name, definition]) => ({\n\t\tname,\n\t\tdescription: definition.description,\n\t\tlayers: definition.layers\n\t})).sort((left, right) => left.name.localeCompare(right.name));\n\tconst domainOptions = [...Object.entries(domains.domains).map(([name, definition]) => ({\n\t\tname,\n\t\t...definition.description ? { description: definition.description } : {}\n\t})), ...Object.entries(domains.aliases).map(([name, expandsTo]) => ({\n\t\tname,\n\t\tdescription: `Alias for ${expandsTo.join(\", \") || \"no domains\"}.`,\n\t\texpandsTo\n\t}))].sort((left, right) => left.name.localeCompare(right.name));\n\treturn {\n\t\trepository,\n\t\thash: layers.repositoryFile.hash,\n\t\tcatalogs: {\n\t\t\tmajorModes,\n\t\t\tdomains: domainOptions,\n\t\t\tprofiles: profiles.map((profile) => ({ name: profile.name }))\n\t\t},\n\t\tselection: {\n\t\t\tmajorMode: configuredSelectionValue(layers, \"majorMode\", effectiveMajorMode),\n\t\t\tdomains: configuredSelectionValue(layers, \"domains\", effectiveDomains),\n\t\t\tprofile: configuredSelectionValue(layers, \"profile\", configured?.profile)\n\t\t}\n\t};\n}\nfunction parseSelectionChanges(value) {\n\tif (!isRecord(value)) return void 0;\n\tconst keys = Object.keys(value);\n\tif (keys.length === 0 || keys.some((key) => !Object.hasOwn(SELECTION_KEYS, key))) return void 0;\n\tconst changes = {};\n\tif (Object.hasOwn(value, \"majorMode\")) {\n\t\tif (value.majorMode !== null && (typeof value.majorMode !== \"string\" || value.majorMode.trim() === \"\")) return void 0;\n\t\tchanges.majorMode = value.majorMode === null ? null : value.majorMode.trim();\n\t}\n\tif (Object.hasOwn(value, \"domains\")) {\n\t\tif (value.domains !== null && (!Array.isArray(value.domains) || value.domains.some((name) => typeof name !== \"string\" || name.trim() === \"\"))) return;\n\t\tchanges.domains = value.domains === null ? null : [...new Set(value.domains.map((name) => name.trim()))];\n\t}\n\tif (Object.hasOwn(value, \"profile\")) {\n\t\tif (value.profile !== null && (typeof value.profile !== \"string\" || value.profile.trim() === \"\")) return void 0;\n\t\tchanges.profile = value.profile === null ? null : value.profile.trim();\n\t}\n\treturn changes;\n}\nfunction parseSelectionWrite(value) {\n\tif (!isRecord(value) || typeof value.repositoryId !== \"string\" || typeof value.expectedHash !== \"string\") return void 0;\n\tconst changes = parseSelectionChanges(value.changes);\n\treturn changes === void 0 ? void 0 : {\n\t\trepositoryId: value.repositoryId,\n\t\texpectedHash: value.expectedHash,\n\t\tchanges\n\t};\n}\nfunction validateSelectionChanges(view, changes) {\n\tif (changes.majorMode !== void 0 && changes.majorMode !== null) {\n\t\tif (!view.catalogs.majorModes.some((mode) => mode.name === changes.majorMode)) return `Unknown major mode '${changes.majorMode}'.`;\n\t}\n\tif (changes.domains !== void 0 && changes.domains !== null) {\n\t\tconst known = new Set(view.catalogs.domains.map((domain) => domain.name));\n\t\tconst unknown = changes.domains.find((domain) => !known.has(domain));\n\t\tif (unknown !== void 0) return `Unknown domain '${unknown}'.`;\n\t}\n\tif (changes.profile !== void 0 && changes.profile !== null) {\n\t\tif (!view.catalogs.profiles.some((profile) => profile.name === changes.profile)) return `Unknown profile '${changes.profile}'.`;\n\t}\n}\nfunction selectionEdits(changes) {\n\treturn Object.entries(changes).map(([key, value]) => ({\n\t\tkeyPath: SELECTION_KEYS[key],\n\t\t...value === null ? {} : { value }\n\t}));\n}\nfunction configView(context, keys) {\n\tconst root = context.scope === \"workspace\" ? context.workspaceRoot : void 0;\n\tconst layers = loadPoConfigLayers(root, context.homeDirectory, context.environment);\n\tconst values = {};\n\tfor (const key of keys) {\n\t\tconst keyPath = key.split(\".\");\n\t\tconst value = displayValue(layers.valueAt(keyPath));\n\t\tvalues[key] = {\n\t\t\t...value === void 0 ? {} : { value },\n\t\t\torigin: layers.originOf(keyPath),\n\t\t\tscope: configScopeOf(keyPath)\n\t\t};\n\t}\n\treturn {\n\t\trepoRoot: root ?? \"\",\n\t\tvalues,\n\t\thashes: {\n\t\t\tglobal: layers.globalFile.hash,\n\t\t\trepository: layers.repositoryFile.hash\n\t\t}\n\t};\n}\n//#endregion\n//#region src/services/settingsApi/index.ts\n/**\n* Config handlers are bound to their mount. Request paths cannot choose a different repository.\n* Writes and image settings go through the host's FileSystem.\n*/\nconst createSettingsApi = (fs) => ({\n\tbasePath: \"settings\",\n\tstart(context) {\n\t\tif (context.scope === \"session\") throw new Error(\"Configuration settings require a global or workspace mount.\");\n\t\tconst { homeDirectory } = context;\n\t\tconst repository = () => context.scope === \"workspace\" && context.workspaceId && context.workspaceRoot ? {\n\t\t\tid: context.workspaceId,\n\t\t\tname: context.workspaceRoot.split(\"/\").at(-1) ?? context.workspaceId,\n\t\t\tpath: context.workspaceRoot,\n\t\t\tactive: context.repositories?.().find((entry) => entry.id === context.workspaceId)?.active ?? false\n\t\t} : void 0;\n\t\tconst io = BACKGROUND_CONTEXT;\n\t\tconst imageView = async () => ({\n\t\t\t...await readPiImageSettings(fs, io, homeDirectory),\n\t\t\tminDimension: 256,\n\t\t\tmaxAllowedDimension: DEFAULT_IMAGE_MAX_DIMENSION\n\t\t});\n\t\tlet writes = Promise.resolve();\n\t\tlet closed = false;\n\t\tconst dispatch = async (request) => {\n\t\t\tif (closed) return Response.json({ error: \"Configuration mount is closed.\" }, { status: 503 });\n\t\t\tconst url = new URL(request.url);\n\t\t\t/**\n\t\t\t* Whether this request addresses one declared route.\n\t\t\t*\n\t\t\t* The table owns both halves of the comparison, so the path this mount\n\t\t\t* answers and the path the client asks for cannot drift apart: there is\n\t\t\t* one spelling of each, in `src/types/apiRoutes`.\n\t\t\t*/\n\t\t\tconst addresses = (route) => url.pathname === route.path && request.method === route.method;\n\t\t\tconst currentRepository = repository();\n\t\t\tif (addresses(apiRoutes_default.config)) return Response.json(configView(context, url.searchParams.getAll(\"key\")));\n\t\t\tif (addresses(apiRoutes_default.repositories)) return Response.json({ repositories: context.repositories?.() ?? [] });\n\t\t\tif (addresses(apiRoutes_default.repository)) return currentRepository ? Response.json(repositorySettingsView(currentRepository, homeDirectory, context.environment)) : Response.json({ error: \"Choose a workspace.\" }, { status: 404 });\n\t\t\tif (url.pathname === apiRoutes_default.images.path && context.scope === \"global\") {\n\t\t\t\tif (request.method === apiRoutes_default.images.method) return Response.json(await imageView());\n\t\t\t\tif (request.method === apiRoutes_default.saveImages.method) {\n\t\t\t\t\tconst body = await request.json();\n\t\t\t\t\tif (!isRecord(body) || body.autoResize !== void 0 && typeof body.autoResize !== \"boolean\" || body.maxDimension !== void 0 && (typeof body.maxDimension !== \"number\" || !Number.isFinite(body.maxDimension))) return Response.json({ error: \"Invalid image settings.\" }, { status: 400 });\n\t\t\t\t\tawait savePiImageSettingsAsync(fs, {\n\t\t\t\t\t\t...typeof body.autoResize === \"boolean\" ? { autoResize: body.autoResize } : {},\n\t\t\t\t\t\t...typeof body.maxDimension === \"number\" ? { maxDimension: body.maxDimension } : {}\n\t\t\t\t\t}, io, homeDirectory);\n\t\t\t\t\tcontext.configurationChanged?.();\n\t\t\t\t\treturn Response.json(await imageView());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (addresses(apiRoutes_default.selection)) {\n\t\t\t\tconst body = parseSelectionWrite(await request.json());\n\t\t\t\tif (!body) return Response.json({ error: \"A selection write needs typed changes and a file hash.\" }, { status: 400 });\n\t\t\t\tif (!currentRepository || body.repositoryId !== currentRepository.id) return Response.json({ error: \"Workspace not found in this mount.\" }, { status: 404 });\n\t\t\t\tconst before = repositorySettingsView(currentRepository, homeDirectory, context.environment);\n\t\t\t\tif (before.hash !== body.expectedHash) return Response.json({\n\t\t\t\t\terror: \"The repository config changed since it was read.\",\n\t\t\t\t\thash: before.hash\n\t\t\t\t}, { status: 409 });\n\t\t\t\tconst invalid = validateSelectionChanges(before, body.changes);\n\t\t\t\tif (invalid) return Response.json({ error: invalid }, { status: 422 });\n\t\t\t\tawait writePoConfigValuesAsync(fs, repositoryPoConfigPath(currentRepository.path), selectionEdits(body.changes), io, { scope: \"repository\" });\n\t\t\t\tcontext.configurationChanged?.();\n\t\t\t\treturn Response.json(repositorySettingsView(currentRepository, homeDirectory, context.environment));\n\t\t\t}\n\t\t\tif (addresses(apiRoutes_default.value)) {\n\t\t\t\tconst body = parseWrite(await request.json());\n\t\t\t\tif (!body) return Response.json({ error: \"A save requires a scope, key, value and file hash.\" }, { status: 400 });\n\t\t\t\tconst scope = context.scope === \"global\" ? \"global\" : \"repository\";\n\t\t\t\tif (body.scope !== scope || scope === \"repository\" && body.repoRoot !== currentRepository?.path) return Response.json({ error: \"The write targets a different mount.\" }, { status: 403 });\n\t\t\t\tif (body.edits.some((edit) => {\n\t\t\t\t\tconst allowed = configScopeOf(edit.keyPath);\n\t\t\t\t\treturn allowed !== \"both\" && allowed !== scope;\n\t\t\t\t})) return Response.json({ error: \"This key cannot be set at this scope.\" }, { status: 409 });\n\t\t\t\tconst before = configView(context, []);\n\t\t\t\tif (before.hashes[scope] !== body.expectedHash) return Response.json({\n\t\t\t\t\terror: \"The config changed since it was read.\",\n\t\t\t\t\thash: before.hashes[scope]\n\t\t\t\t}, { status: 409 });\n\t\t\t\tconst target = pathFor(scope, currentRepository?.path ?? \"\", homeDirectory);\n\t\t\t\tawait writePoConfigValuesAsync(fs, target, body.edits.map(({ keyPath, value }) => ({\n\t\t\t\t\tkeyPath,\n\t\t\t\t\t...value === null ? {} : { value }\n\t\t\t\t})), io, { scope });\n\t\t\t\tcontext.configurationChanged?.();\n\t\t\t\treturn Response.json(configView(context, body.edits.map((edit) => edit.keyPath.join(\".\"))));\n\t\t\t}\n\t\t\treturn Response.json({ error: \"Configuration route not found.\" }, { status: 404 });\n\t\t};\n\t\tconst guarded = async (request) => {\n\t\t\ttry {\n\t\t\t\treturn await dispatch(request);\n\t\t\t} catch (error) {\n\t\t\t\treturn Response.json({ error: describe(error) }, { status: error instanceof SyntaxError ? 400 : 422 });\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tfetch(request) {\n\t\t\t\tif (request.method === \"GET\" || request.method === \"HEAD\") return guarded(request);\n\t\t\t\tconst result = writes.then(() => guarded(request));\n\t\t\t\twrites = result.catch(() => void 0);\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tclose() {\n\t\t\t\tclosed = true;\n\t\t\t}\n\t\t};\n\t}\n});\n//#endregion\nexport { createSettingsApi as t };\n\n//# sourceMappingURL=settingsApi-CRSCi4JR.mjs.map","import { Type } from \"typebox\";\n//#region src/schemas/config.ts\n/**\n* Configuration surfaces, contributed by every extension that owns settings.\n*\n* Po settings live in one YAML file but are owned by many extensions, and for\n* a long time the only way to change any of them was to edit that file by hand.\n* The one exception, an editor-command prompt, asked for a value with no way to\n* see what a valid one looked like.\n*\n* So configuration is published rather than centralised: an extension describes\n* its own fields, one renderer draws them all, and the extension still performs\n* every write. Nothing here knows what a voice model or an editor command is.\n*\n* Deliberately the same shape as the mode and footer contracts next door, since\n* the problem is the same one: several extensions sharing one surface. The UI\n* hub invokes an owner's registered action directly, because unlike a status\n* strip this surface is written to as well as read.\n*/\n/** Canonical Cordis key for the session-owned Po configuration service. */\nconst PO_CONFIG_SERVICE = \"po/config\";\n/** Matches the leader contract's source rule: package names, addressable and spoof-checkable. */\nconst ConfigSourceSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 128,\n\tpattern: \"^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$\"\n});\nconst ConfigIdSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 128,\n\tpattern: \"^[a-z0-9][a-z0-9._:-]*$\"\n});\n/**\n* How ready a value is to be used, as opposed to whether it is merely set.\n* `blocked` covers a choice that needs something else first, such as a model\n* whose engine is not installed.\n*/\nconst ConfigStatusSchema = Type.Union([\n\tType.Literal(\"ready\"),\n\tType.Literal(\"available\"),\n\tType.Literal(\"blocked\")\n]);\nconst ConfigFieldKindSchema = Type.Union([\n\tType.Literal(\"text\"),\n\tType.Literal(\"enum\"),\n\tType.Literal(\"choice\"),\n\tType.Literal(\"info\")\n]);\n/**\n* A key the renderer offers on the focused field, sent back verbatim as an\n* action. Owners use this for confirmations, so the pending question survives a\n* panel that is closed and reopened.\n*/\nconst ConfigActionSchema = Type.Object({\n\tkey: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 1\n\t}),\n\tlabel: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 24\n\t}),\n\taction: ConfigIdSchema\n}, { additionalProperties: false });\nconst ConfigChoiceSchema = Type.Object({\n\tid: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 256\n\t}),\n\tlabel: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t}),\n\t/** Right-aligned by the renderer. Sizes, ids, anything narrow. */\n\tdetail: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t})),\n\t/** Groups entries under a heading the cursor skips over. */\n\tgroup: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 48\n\t})),\n\tstatus: Type.Optional(ConfigStatusSchema),\n\tstatusText: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t})),\n\t/**\n\t* What enter does on this entry. Carrying it per-entry is what lets one list\n\t* hold both an installed model that only needs selecting and an absent one\n\t* that needs fetching, without the renderer knowing the difference.\n\t*/\n\taction: Type.Optional(ConfigIdSchema)\n}, { additionalProperties: false });\n/**\n* One line of a multi-step operation.\n*\n* Published as a list rather than a single \"current step\" string so the panel can\n* show what already ran alongside what is left. During an install that is the\n* difference between \"something is happening\" and knowing a package manager\n* already finished and a download is now underway.\n*/\nconst ConfigStepSchema = Type.Object({\n\tlabel: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t}),\n\tstate: Type.Union([\n\t\tType.Literal(\"pending\"),\n\t\tType.Literal(\"satisfied\"),\n\t\tType.Literal(\"running\"),\n\t\tType.Literal(\"done\"),\n\t\tType.Literal(\"failed\")\n\t]),\n\tdetail: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 160\n\t}))\n}, { additionalProperties: false });\nconst ConfigProgressSchema = Type.Object({\n\tlabel: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t}),\n\t/** 0 to 1. Omitted when the work has no measurable total. */\n\tratio: Type.Optional(Type.Number({\n\t\tminimum: 0,\n\t\tmaximum: 1\n\t}))\n}, { additionalProperties: false });\nconst ConfigFieldSchema = Type.Object({\n\tid: ConfigIdSchema,\n\tlabel: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 48\n\t}),\n\tkind: ConfigFieldKindSchema,\n\t/** Absent means unset; the renderer shows `placeholder` instead. */\n\tvalue: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 4096\n\t})),\n\tplaceholder: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t})),\n\t/** One line of help for the focused field. */\n\tdetail: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 240\n\t})),\n\t/** The config key this writes, shown under the focused field so the file stays legible. */\n\tkeyPath: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t})),\n\tstatus: Type.Optional(ConfigStatusSchema),\n\t/** Doubles as the error line: a rejected edit comes back as the old value plus this. */\n\tstatusText: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 240\n\t})),\n\tchoices: Type.Optional(Type.Array(ConfigChoiceSchema, { maxItems: 128 })),\n\tactions: Type.Optional(Type.Array(ConfigActionSchema, { maxItems: 4 })),\n\t/** Work is running; the renderer dims the field and offers abort. */\n\tbusy: Type.Optional(Type.Boolean()),\n\tprogress: Type.Optional(ConfigProgressSchema),\n\tsteps: Type.Optional(Type.Array(ConfigStepSchema, { maxItems: 24 })),\n\t/**\n\t* The tail of a running command's terminal output.\n\t*\n\t* A tail rather than the whole scrollback: the field is a few rows of a\n\t* shared pane, and what matters is the question a package manager just\n\t* asked, not what it printed a minute ago.\n\t*/\n\toutput: Type.Optional(Type.Array(Type.String({ maxLength: 512 }), { maxItems: 64 })),\n\t/**\n\t* The command is waiting on the user. The renderer offers a line to type\n\t* into, which comes back as an owner-defined action carrying the text.\n\t*/\n\tawaitingInput: Type.Optional(Type.Boolean())\n}, { additionalProperties: false });\nconst ConfigSectionSchema = Type.Object({\n\tid: ConfigIdSchema,\n\ttitle: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 32\n\t}),\n\tdetail: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t})),\n\torder: Type.Integer({\n\t\tminimum: 0,\n\t\tmaximum: 1e3\n\t}),\n\t/** Section-wide state: readiness, or why a write failed. */\n\tnotice: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 240\n\t})),\n\tnoticeLevel: Type.Optional(Type.Union([Type.Literal(\"info\"), Type.Literal(\"error\")])),\n\tfields: Type.Array(ConfigFieldSchema, { maxItems: 64 })\n}, { additionalProperties: false });\nconst ConfigSourceRefSchema = Type.Object({\n\tsource: ConfigSourceSchema,\n\tgeneration: Type.String({ minLength: 1 })\n}, { additionalProperties: false });\nType.Object({\n\t...ConfigSourceRefSchema.properties,\n\tsections: Type.Array(ConfigSectionSchema, { maxItems: 32 })\n}, { additionalProperties: false });\nconst CONFIG_ACTION = {\n\tset: \"set\",\n\tclear: \"clear\"\n};\n//#endregion\nexport { CONFIG_ACTION, ConfigActionSchema, ConfigChoiceSchema, ConfigFieldKindSchema, ConfigFieldSchema, ConfigProgressSchema, ConfigSectionSchema, ConfigSourceSchema, ConfigStatusSchema, ConfigStepSchema, PO_CONFIG_SERVICE };\n\n//# sourceMappingURL=runtimeConfig.mjs.map","//#region src/services/toolCost/index.ts\n/** Mirrors the wire shape MCP advertises, so both estimates stay comparable. */\nfunction schemaPayload(entry) {\n\treturn JSON.stringify({\n\t\tname: entry.name,\n\t\t...entry.description === void 0 ? {} : { description: entry.description },\n\t\t...entry.parameters === void 0 ? {} : { parameters: entry.parameters }\n\t});\n}\nfunction promptPayload(entry) {\n\treturn [entry.promptSnippet ?? \"\", ...entry.promptGuidelines ?? []].filter(Boolean).join(\"\\n\");\n}\nfunction tokensForTool(entry, countTokens) {\n\tconst schemaTokens = countTokens(schemaPayload(entry));\n\tconst prompt = promptPayload(entry);\n\tconst promptTokens = prompt.length === 0 ? 0 : countTokens(prompt);\n\treturn {\n\t\tschemaTokens,\n\t\tpromptTokens,\n\t\ttotalTokens: schemaTokens + promptTokens\n\t};\n}\n/**\n* Every tool in a source, and what the source costs in total.\n*\n* An inactive tool is still priced: it is in the composition, and the point of\n* the figure is to show what the composition costs. Whether the model may call\n* it is a separate question from whether it is being paid for.\n*/\nfunction tokensForSource(source, countTokens) {\n\tconst tools = /* @__PURE__ */ new Map();\n\tlet totalTokens = 0;\n\tfor (const entry of source.tools) {\n\t\tconst cost = tokensForTool(entry, countTokens);\n\t\ttools.set(entry.name, cost);\n\t\ttotalTokens += cost.totalTokens;\n\t}\n\treturn {\n\t\ttools,\n\t\ttotalTokens\n\t};\n}\n//#endregion\nexport { tokensForSource, tokensForTool };\n\n//# sourceMappingURL=index.mjs.map","import { tokensForTool } from \"./src/services/toolCost/index.mjs\";\n//#region src/services/contextProjection/index.ts\n/**\n* What the session is carrying, and what carrying it costs.\n*\n* Grouped by the mode that admitted each package rather than by where the tool\n* came from, because a mode is the thing a reader can switch off. The mechanism\n* (extension, MCP server, plugin) orders rows inside a group instead, so the\n* expensive thing is still easy to find.\n*\n* Schemas never travel. Only names, kinds, owners and integer counts do, which\n* keeps the payload small enough to republish whenever the composition changes.\n*/\nconst CONTEXT_PROJECTION_VERSION = 1;\n/** Journal entry the cockpit reads; mirrored by CONTEXT_ENTRY_TYPE in po-web. */\nconst PO_CONTEXT_ENTRY_TYPE = \"po-context\";\n/** Session selection and transition journal identities, not transport channels. */\nconst PO_CONFIG_ENTRY_TYPE = \"po:config:v1\";\nconst PO_CONFIG_TRANSITION_ENTRY_TYPE = \"po:transition:v1\";\n/** The tokenizer these counts came from, so a reader can judge them. */\nconst CONTEXT_PROJECTION_ESTIMATOR = \"gpt-tokenizer\";\n/** Everything the runtime could not attribute lands here rather than vanishing. */\nconst CORE_GROUP = \"core\";\n/** Pi's own tools have no package; the runtime itself is the owner. */\nconst CORE_OWNER = \"pi\";\nconst KIND_ORDER = {\n\tmajor: 0,\n\tminor: 1,\n\tdomain: 2,\n\tshared: 3,\n\tcore: 4\n};\nconst SOURCE_ORDER = {\n\textension: 0,\n\tmcp: 1,\n\tplugin: 2,\n\tcore: 3\n};\nfunction skillSource(group) {\n\tif (group === \"plugins\") return \"plugin\";\n\tif (group === \"extensions\") return \"extension\";\n\treturn \"core\";\n}\nfunction byRow(left, right) {\n\treturn SOURCE_ORDER[left.source] - SOURCE_ORDER[right.source] || left.name.localeCompare(right.name);\n}\nfunction projectContext(input) {\n\tconst buckets = /* @__PURE__ */ new Map();\n\tconst declare = (id, label, kind) => {\n\t\tif (!buckets.has(id)) buckets.set(id, {\n\t\t\tkind,\n\t\t\tlabel,\n\t\t\titems: []\n\t\t});\n\t};\n\tif (input.majorMode) declare(input.majorMode, input.majorMode, \"major\");\n\tfor (const group of input.groups) declare(group.id, group.label, group.kind);\n\tfor (const domain of input.domains) declare(domain, domain, \"domain\");\n\tconst place = (owner, item, conditional) => {\n\t\tconst attributed = conditional ?? input.attribution[owner];\n\t\tconst id = attributed?.mode ?? CORE_GROUP;\n\t\tconst kind = attributed?.kind ?? \"core\";\n\t\tdeclare(id, attributed && \"label\" in attributed ? attributed.label ?? id : id, kind);\n\t\tbuckets.get(id)?.items.push(item);\n\t};\n\tfor (const source of input.sources) {\n\t\tconst owner = source.kind === \"extension\" ? source.packageName ?? source.key : source.kind === \"mcp\" ? source.key.slice(4) : CORE_OWNER;\n\t\tfor (const tool of source.tools) {\n\t\t\tconst cost = tokensForTool(tool, input.countTokens);\n\t\t\tconst item = {\n\t\t\t\tname: tool.name,\n\t\t\t\titemKind: \"tool\",\n\t\t\t\tsource: source.kind === \"core\" ? \"core\" : source.kind,\n\t\t\t\towner,\n\t\t\t\ttokens: cost.totalTokens,\n\t\t\t\tactive: tool.active\n\t\t\t};\n\t\t\tif (source.kind === \"core\") {\n\t\t\t\tdeclare(CORE_GROUP, CORE_GROUP, \"core\");\n\t\t\t\tbuckets.get(CORE_GROUP)?.items.push(item);\n\t\t\t} else place(owner, item, tool.contextAttribution);\n\t\t}\n\t}\n\tfor (const skill of input.skills) place(skill.owner, {\n\t\tname: skill.name,\n\t\titemKind: \"skill\",\n\t\tsource: skillSource(skill.group),\n\t\towner: skill.owner,\n\t\ttokens: skill.promptTokens ?? 0,\n\t\tactive: true\n\t}, skill.contextAttribution);\n\tconst groups = [...buckets.entries()].map(([id, bucket]) => {\n\t\tconst items = [...bucket.items].sort(byRow);\n\t\treturn {\n\t\t\tid,\n\t\t\tlabel: bucket.label,\n\t\t\tkind: bucket.kind,\n\t\t\titems,\n\t\t\ttokens: items.reduce((total, item) => total + (item.active ? item.tokens : 0), 0),\n\t\t\tinactiveTokens: items.reduce((total, item) => total + (item.active ? 0 : item.tokens), 0)\n\t\t};\n\t}).sort((left, right) => KIND_ORDER[left.kind] - KIND_ORDER[right.kind] || left.label.localeCompare(right.label));\n\treturn {\n\t\tversion: 1,\n\t\trevision: input.revision,\n\t\tselection: {\n\t\t\tmajorMode: input.majorMode,\n\t\t\tdomains: [...input.domains],\n\t\t\t...input.profile === void 0 ? {} : { profile: input.profile }\n\t\t},\n\t\tgroups,\n\t\ttotalTokens: groups.reduce((total, group) => total + group.tokens, 0),\n\t\tinactiveTokens: groups.reduce((total, group) => total + group.inactiveTokens, 0),\n\t\t...input.systemPrompt === void 0 ? {} : { systemPrompt: input.systemPrompt },\n\t\testimator: CONTEXT_PROJECTION_ESTIMATOR\n\t};\n}\n//#endregion\nexport { CONTEXT_PROJECTION_ESTIMATOR, CONTEXT_PROJECTION_VERSION, PO_CONFIG_ENTRY_TYPE, PO_CONFIG_TRANSITION_ENTRY_TYPE, PO_CONTEXT_ENTRY_TYPE, projectContext };\n\n//# sourceMappingURL=contextProjection.mjs.map","import { Type } from \"typebox\";\n//#region src/schemas/backgroundWork.ts\n/** Cordis service that owns pull-based background-work contributions for sessions. */\nconst PO_BACKGROUND_WORK_SERVICE = \"po/background-work\";\n/**\n* Snapshot invalidation only. Consumers must reread the authoritative service snapshot\n* and must not infer current work from the event payload.\n*/\nconst PO_BACKGROUND_WORK_CHANGED_EVENT = \"po/background-work/changed\";\nconst BackgroundProviderWorkItemSchema = Type.Object({\n\tid: Type.String({ minLength: 1 }),\n\tsessionId: Type.String({ minLength: 1 }),\n\tlabel: Type.Optional(Type.String({ minLength: 1 })),\n\tstatus: Type.Optional(Type.String({ minLength: 1 }))\n}, { additionalProperties: false });\nconst BackgroundWorkItemSchema = Type.Object({\n\t...BackgroundProviderWorkItemSchema.properties,\n\tprovider: Type.String({ minLength: 1 })\n}, { additionalProperties: false });\n/** Runners and subagents whose ownership keeps a settled session open. */\nconst BACKGROUND_WORK_HOLDING_PROVIDERS = [\n\t\"po-runner\",\n\t\"team-direct-runs\",\n\t\"po-task\",\n\t\"po-codemode-background\"\n];\n/** Missing runner status retains ownership until completion admission succeeds. */\nfunction holdsSettledSession(item) {\n\tif (!BACKGROUND_WORK_HOLDING_PROVIDERS.includes(item.provider)) return false;\n\treturn item.provider !== \"po-runner\" || item.status === void 0 || item.status === \"running\";\n}\n/** How long a settled session waits on running commands before they stop holding it. */\nconst BACKGROUND_RUNNER_DEADLINE_MS = 3e5;\n/** Pending completions and subagents still hold after the running-command deadline. */\nfunction holdsSettledSessionAfterRunnerDeadline(item) {\n\treturn holdsSettledSession(item) && !(item.provider === \"po-runner\" && item.status === \"running\");\n}\n/** Reads the active host-owned background-work coordination service. */\nfunction readPoBackgroundWorkService(ctx) {\n\treturn ctx.get(PO_BACKGROUND_WORK_SERVICE);\n}\n//#endregion\nexport { BACKGROUND_RUNNER_DEADLINE_MS, BACKGROUND_WORK_HOLDING_PROVIDERS, BackgroundProviderWorkItemSchema, BackgroundWorkItemSchema, PO_BACKGROUND_WORK_CHANGED_EVENT, PO_BACKGROUND_WORK_SERVICE, holdsSettledSession, holdsSettledSessionAfterRunnerDeadline, readPoBackgroundWorkService };\n\n//# sourceMappingURL=backgroundWork.mjs.map","//#region src/schemas/hubChannel.ts\n/** Compact host-wide session attention, published over the existing direct event bus. */\nconst PO_SESSION_ATTENTION_EVENT = \"po.session.attention\";\n/**\n* Provenance of a session a workflow step opened.\n*\n* The step's conversation belongs to the workflow that ran it and is read in\n* that workflow's view, so the session rail leaves such sessions out.\n*/\nconst WORKFLOW_STEP_SESSION_PROVENANCE = \"workflow\";\n/**\n* Provenance of a session opened to launch workflows for its parent.\n*\n* It picks and starts work, then closes; the runs it started belong to its\n* parent. Like a detached helper, it takes no row in the session rail.\n*/\nconst WORKFLOW_DISPATCHER_SESSION_PROVENANCE = \"workflow-dispatcher\";\n/** Provenance of a conversation an external MCP client opened and drives. */\nconst REMOTE_CONVERSATION_SESSION_PROVENANCE = \"remote-conversation\";\n/** Provenance of the host-wide Voice conversation that relays between the person and other sessions. */\nconst VOICE_ORCHESTRATOR_SESSION_PROVENANCE = \"voice-orchestrator\";\n//#endregion\nexport { PO_SESSION_ATTENTION_EVENT, REMOTE_CONVERSATION_SESSION_PROVENANCE, VOICE_ORCHESTRATOR_SESSION_PROVENANCE, WORKFLOW_DISPATCHER_SESSION_PROVENANCE, WORKFLOW_STEP_SESSION_PROVENANCE };\n\n//# sourceMappingURL=hubChannel.mjs.map","import { Type } from \"typebox\";\nimport { Check } from \"typebox/value\";\n//#region src/schemas/notification.ts\n/** Provider-owned Cordis service for caller-authored notification requests. */\nconst PO_NOTIFICATION_SERVICE = \"po/notification\";\n/** Custom session entry type used to publish normalized notification data. */\nconst PO_NOTIFICATION_ENTRY_TYPE = \"po-notification\";\nconst PO_NOTIFICATION_ENTRY_VERSION = 1;\nconst MAX_PO_NOTIFICATION_TITLE_CHARACTERS = 128;\nconst MAX_PO_NOTIFICATION_SUBTITLE_CHARACTERS = 256;\nconst MAX_PO_NOTIFICATION_BODY_CHARACTERS = 4096;\nconst PoNotificationLevelSchema = Type.Union([\n\tType.Literal(\"info\"),\n\tType.Literal(\"warning\"),\n\tType.Literal(\"error\")\n]);\nconst PoNotificationRequestSchema = Type.Object({\n\ttitle: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t})),\n\tsubtitle: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 256\n\t})),\n\tbody: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: MAX_PO_NOTIFICATION_BODY_CHARACTERS\n\t}),\n\tlevel: Type.Optional(PoNotificationLevelSchema)\n}, { additionalProperties: false });\nconst NormalizablePoNotificationRequestSchema = Type.Object({\n\ttitle: Type.Optional(Type.String()),\n\tsubtitle: Type.Optional(Type.String()),\n\tbody: Type.String(),\n\tlevel: Type.Optional(PoNotificationLevelSchema)\n}, { additionalProperties: false });\nconst PoNotificationEntryDataSchema = Type.Object({\n\tversion: Type.Literal(1),\n\ttitle: Type.String({ maxLength: 128 }),\n\tsubtitle: Type.String({ maxLength: 256 }),\n\tbody: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: MAX_PO_NOTIFICATION_BODY_CHARACTERS\n\t}),\n\tlevel: PoNotificationLevelSchema\n}, { additionalProperties: false });\nfunction replaceControlCharacters(text) {\n\treturn Array.from(text, (character) => {\n\t\tconst codePoint = character.codePointAt(0);\n\t\treturn codePoint !== void 0 && (codePoint < 32 || codePoint === 127) ? \" \" : character;\n\t}).join(\"\");\n}\nfunction normalizeText(text, maximum) {\n\tconst normalized = replaceControlCharacters(text).replace(/\\s+/gu, \" \").trim();\n\tif (!normalized) return void 0;\n\tlet truncated = \"\";\n\tfor (const character of normalized) {\n\t\tif (truncated.length + character.length > maximum) break;\n\t\ttruncated += character;\n\t}\n\treturn truncated;\n}\n/** Normalize caller-owned notification text into a validated request. */\nfunction normalizePoNotificationRequest(request) {\n\tif (!Check(NormalizablePoNotificationRequestSchema, request)) return void 0;\n\tconst body = normalizeText(request.body, MAX_PO_NOTIFICATION_BODY_CHARACTERS);\n\tif (!body) return void 0;\n\tconst title = request.title && normalizeText(request.title, 128);\n\tconst subtitle = request.subtitle && normalizeText(request.subtitle, 256);\n\tconst normalized = {\n\t\tbody,\n\t\t...title ? { title } : {},\n\t\t...subtitle ? { subtitle } : {},\n\t\t...request.level ? { level: request.level } : {}\n\t};\n\treturn Object.freeze(normalized);\n}\n/** Builds normalized, versioned data for a Po notification session entry. */\nfunction createPoNotificationEntryData(request) {\n\tconst normalized = normalizePoNotificationRequest(request);\n\tif (!normalized) return void 0;\n\treturn Object.freeze({\n\t\tversion: 1,\n\t\ttitle: normalized.title ?? \"\",\n\t\tsubtitle: normalized.subtitle ?? \"\",\n\t\tbody: normalized.body,\n\t\tlevel: normalized.level ?? \"info\"\n\t});\n}\nfunction isPoNotificationRequest(value) {\n\treturn Check(PoNotificationRequestSchema, value);\n}\nfunction isPoNotificationEntryData(value) {\n\treturn Check(PoNotificationEntryDataSchema, value);\n}\nfunction readPoNotificationService(context) {\n\treturn context.get(PO_NOTIFICATION_SERVICE);\n}\nfunction requirePoNotificationService(context) {\n\tconst service = readPoNotificationService(context);\n\tif (!service) throw new Error(\"Po notification is unavailable. Load a notification provider.\");\n\treturn service;\n}\n//#endregion\nexport { MAX_PO_NOTIFICATION_BODY_CHARACTERS, MAX_PO_NOTIFICATION_SUBTITLE_CHARACTERS, MAX_PO_NOTIFICATION_TITLE_CHARACTERS, PO_NOTIFICATION_ENTRY_TYPE, PO_NOTIFICATION_ENTRY_VERSION, PO_NOTIFICATION_SERVICE, PoNotificationEntryDataSchema, PoNotificationLevelSchema, PoNotificationRequestSchema, createPoNotificationEntryData, isPoNotificationEntryData, isPoNotificationRequest, normalizePoNotificationRequest, readPoNotificationService, requirePoNotificationService };\n\n//# sourceMappingURL=notification.mjs.map","//#region src/schemas/sessionProtocol.ts\n/** Presentation frame a session emits after its groups change: `{ type, groups: string[] }`. */\nconst SESSION_GROUPS_CHANGED_FRAME = \"session_groups_changed\";\nconst MAX_SESSION_GROUPS = 8;\nconst MAX_SESSION_GROUP_LENGTH = 32;\n/**\n* Trims, drops blanks, and deduplicates group names (case-sensitive, first spelling wins).\n* Throws when the input is not a string list or breaks a limit, so callers never store a guess.\n*/\nfunction normalizeSessionGroups(groups) {\n\tif (!Array.isArray(groups) || groups.some((group) => typeof group !== \"string\")) throw new Error(\"Session groups must be a list of names.\");\n\tconst names = [...new Set(groups.map((group) => group.trim()).filter((group) => group !== \"\"))];\n\tif (names.length > 8) throw new Error(`A session can belong to at most 8 groups.`);\n\tconst long = names.find((group) => group.length > 32);\n\tif (long !== void 0) throw new Error(`Group name '${long}' is longer than 32 characters.`);\n\treturn names;\n}\n//#endregion\nexport { MAX_SESSION_GROUPS, MAX_SESSION_GROUP_LENGTH, SESSION_GROUPS_CHANGED_FRAME, normalizeSessionGroups };\n\n//# sourceMappingURL=sessionProtocol.mjs.map","//#region src/constants/agentSettled.ts\n/** Journal entry the direct harness appends when an agent run settles; the hub reads it back. */\nconst AGENT_SETTLED_ENTRY_TYPE = \"po.agent-settled\";\n//#endregion\nexport { AGENT_SETTLED_ENTRY_TYPE };\n\n//# sourceMappingURL=agentSettled.mjs.map","import { Type } from \"typebox\";\nimport { Check } from \"typebox/value\";\n//#region src/schemas/pluginProtocol.ts\n/** The address is always exact. A workspace call never resolves to a global service. */\nconst PoPluginMountSchema = Type.Union([\n\tType.Object({ scope: Type.Literal(\"global\") }, { additionalProperties: false }),\n\tType.Object({\n\t\tscope: Type.Literal(\"workspace\"),\n\t\tworkspaceId: Type.String({ minLength: 1 })\n\t}, { additionalProperties: false }),\n\tType.Object({\n\t\tscope: Type.Literal(\"session\"),\n\t\tsessionId: Type.String({ minLength: 1 })\n\t}, { additionalProperties: false })\n]);\nconst PoPluginCallSchema = Type.Object({\n\tmount: PoPluginMountSchema,\n\tservice: Type.String({ minLength: 1 }),\n\tmethod: Type.String({ minLength: 1 }),\n\tinput: Type.Unknown()\n}, { additionalProperties: false });\nfunction definePoPluginMethod(definition) {\n\tif (!definition.service || !definition.method) throw new Error(\"Plugin service and method must be named.\");\n\treturn definition;\n}\nfunction poPluginMountKey(mount) {\n\tif (!Check(PoPluginMountSchema, mount)) throw new Error(\"Invalid plugin mount.\");\n\tswitch (mount.scope) {\n\t\tcase \"global\": return \"global\";\n\t\tcase \"workspace\": return `workspace:${mount.workspaceId}`;\n\t\tcase \"session\": return `session:${mount.sessionId}`;\n\t}\n}\nvar PoPluginCallError = class extends Error {\n\tcode;\n\tconstructor(code, message) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.name = \"PoPluginCallError\";\n\t}\n};\n/** Transport-neutral dispatch, shared by Chord server services and client capability hosts. */\nfunction createPoPluginRegistry() {\n\tconst handlers = /* @__PURE__ */ new Map();\n\tlet disposed = false;\n\tconst keyOf = (mount, service, method, direction) => `${poPluginMountKey(mount)}\\0${direction}\\0${service}\\0${method}`;\n\treturn {\n\t\tregister(mount, definition, handler) {\n\t\t\tif (disposed) throw new Error(\"Plugin registry is disposed.\");\n\t\t\tif (mount.scope !== definition.scope) throw new Error(`Method '${definition.service}.${definition.method}' requires ${definition.scope} scope.`);\n\t\t\tconst key = keyOf(mount, definition.service, definition.method, definition.direction);\n\t\t\tif (handlers.has(key)) throw new Error(`Plugin method '${definition.service}.${definition.method}' is already mounted.`);\n\t\t\tconst entry = {\n\t\t\t\tdefinition,\n\t\t\t\thandler\n\t\t\t};\n\t\t\thandlers.set(key, entry);\n\t\t\treturn () => {\n\t\t\t\tif (handlers.get(key) === entry) handlers.delete(key);\n\t\t\t};\n\t\t},\n\t\tasync invoke(value, direction, caller = {}) {\n\t\t\tif (disposed) throw new Error(\"Plugin registry is disposed.\");\n\t\t\tif (!Check(PoPluginCallSchema, value)) throw new PoPluginCallError(\"INVALID_CALL\", \"Invalid plugin call.\");\n\t\t\tconst call = value;\n\t\t\tconst entry = handlers.get(keyOf(call.mount, call.service, call.method, direction));\n\t\t\tif (!entry) throw new PoPluginCallError(\"METHOD_NOT_FOUND\", `Plugin method '${call.service}.${call.method}' is not mounted at this scope.`);\n\t\t\tif (!Check(entry.definition.input, call.input)) throw new PoPluginCallError(\"INVALID_INPUT\", `Invalid input for '${call.service}.${call.method}'.`);\n\t\t\tconst output = await entry.handler(call.input, caller);\n\t\t\tif (!Check(entry.definition.output, output)) throw new PoPluginCallError(\"INVALID_OUTPUT\", `Invalid output from '${call.service}.${call.method}'.`);\n\t\t\treturn output;\n\t\t},\n\t\tdispose() {\n\t\t\tdisposed = true;\n\t\t\thandlers.clear();\n\t\t}\n\t};\n}\nasync function invokePoPluginMethod(transport, mount, definition, input) {\n\tif (mount.scope !== definition.scope) throw new Error(`Method '${definition.service}.${definition.method}' requires ${definition.scope} scope.`);\n\tif (!Check(definition.input, input)) throw new PoPluginCallError(\"INVALID_INPUT\", `Invalid input for '${definition.service}.${definition.method}'.`);\n\tconst output = await transport({\n\t\tmount,\n\t\tservice: definition.service,\n\t\tmethod: definition.method,\n\t\tinput\n\t});\n\tif (!Check(definition.output, output)) throw new PoPluginCallError(\"INVALID_OUTPUT\", `Invalid output from '${definition.service}.${definition.method}'.`);\n\treturn output;\n}\n//#endregion\nexport { PoPluginCallError, PoPluginCallSchema, PoPluginMountSchema, createPoPluginRegistry, definePoPluginMethod, invokePoPluginMethod, poPluginMountKey };\n\n//# sourceMappingURL=pluginProtocol.mjs.map","import { BACKGROUND_CONTEXT } from \"@earendil-works/chord/context\";\n//#region src/services/sessionGitStatus/index.ts\nconst GIT_TIMEOUT_SECONDS = 5;\nconst BRANCH_HEAD_PREFIX = \"# branch.head \";\nconst BRANCH_OID_PREFIX = \"# branch.oid \";\nconst DETACHED_HEAD = \"(detached)\";\nconst SHORT_OID_LENGTH = 7;\n/**\n* Reads the branch and dirty flag for a session cwd with one `git status` call.\n* Resolves undefined when the cwd is not a git work tree, git is unavailable, or the\n* environment has no shell (the edge), which the session summary documents as \"no git status\".\n*/\nasync function readSessionGitStatus(shell, cwd) {\n\tlet stdout = \"\";\n\tconst result = await shell.exec([\n\t\t\"git\",\n\t\t\"status\",\n\t\t\"--porcelain=v2\",\n\t\t\"--branch\",\n\t\t\"--untracked-files=no\"\n\t], {\n\t\tcwd,\n\t\ttimeout: GIT_TIMEOUT_SECONDS,\n\t\tonOutput: (text, _context, info) => {\n\t\t\tif (info.stream === \"stdout\") stdout += text;\n\t\t}\n\t}, BACKGROUND_CONTEXT).catch(() => void 0);\n\tif (!result?.ok || result.value.exitCode !== 0) return void 0;\n\tlet head;\n\tlet oid;\n\tlet dirty = false;\n\tfor (const line of stdout.split(\"\\n\")) if (line.startsWith(BRANCH_HEAD_PREFIX)) head = line.slice(14).trim();\n\telse if (line.startsWith(BRANCH_OID_PREFIX)) oid = line.slice(13).trim();\n\telse if (line !== \"\" && !line.startsWith(\"#\")) dirty = true;\n\tconst branch = head === DETACHED_HEAD ? oid?.slice(0, SHORT_OID_LENGTH) : head;\n\treturn branch ? {\n\t\tbranch,\n\t\tdirty\n\t} : void 0;\n}\n//#endregion\nexport { readSessionGitStatus };\n\n//# sourceMappingURL=index.mjs.map","import { SessionMetadataDoc } from \"./src/services/durableSession/docs.mjs\";\nimport { PROFILE_ICON_MIME_TYPES } from \"./src/schemas/profileIdentity.mjs\";\nimport { PO_SESSION_ATTENTION_EVENT } from \"./src/schemas/hubChannel.mjs\";\nimport { parseHomeProjection } from \"./src/schemas/home.mjs\";\nimport \"./src/schemas/notification.mjs\";\nimport \"./src/schemas/sessionProtocol.mjs\";\nimport \"./src/constants/agentSettled.mjs\";\nimport { createPoPluginRegistry } from \"./src/schemas/pluginProtocol.mjs\";\nimport \"./pluginProtocol.mjs\";\nimport { createPoServerHost } from \"./src/services/serverHost/index.mjs\";\nimport { PoServerScope } from \"./src/server/serverScope.mjs\";\nimport \"./serverPlugin.mjs\";\nimport { readSessionGitStatus } from \"./src/services/sessionGitStatus/index.mjs\";\nimport crypto from \"node:crypto\";\nimport { BACKGROUND_CONTEXT } from \"@earendil-works/chord/context\";\n//#region src/server/headlessHub.ts\nconst AUTHORIZATION_HEADER = \"authorization\";\nconst CHANNEL_PRIORITY = {\n\tglobal: 0,\n\tworkspace: 1,\n\tsession: 2\n};\nconst ICON_VERSION_LENGTH = 12;\nconst ICON_DATA_URL = /^data:([a-z/+.-]+);base64,([A-Za-z0-9+/=]+)$/u;\n/** A rail line, not a log: a longer label is cut to this. */\nconst MAX_ACTIVITY_LABEL = 80;\n/**\n* When a reopened session last settled, from the marker its runtime journals at every run end.\n* Without it a session with a whole history would read as fresh until its next turn.\n*/\nasync function lastSettledAt(host) {\n\ttry {\n\t\tconst entry = (await host.runtime.readEntries()).entries.findLast((entry) => entry.type === \"custom\" && entry.customType === \"po.agent-settled\");\n\t\tconst data = entry?.type === \"custom\" ? entry.data : void 0;\n\t\treturn typeof data?.timestamp === \"number\" && Number.isFinite(data.timestamp) ? new Date(data.timestamp).toISOString() : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The groups a resumed session was saved with. Sessions from before groups existed have none. */\nasync function storedGroups(host, onNotice) {\n\ttry {\n\t\tconst { groups } = await host.runtime.session.snapshot(SessionMetadataDoc, BACKGROUND_CONTEXT);\n\t\treturn Array.isArray(groups) ? groups.filter((group) => typeof group === \"string\") : [];\n\t} catch (error) {\n\t\tonNotice?.(`Session groups could not be read: ${String(error)}`);\n\t\treturn [];\n\t}\n}\nfunction scopeOf(session) {\n\treturn {\n\t\tsessionId: session.id,\n\t\t...session.workspaceId === void 0 ? {} : { workspaceId: session.workspaceId },\n\t\tcwd: session.cwd,\n\t\t...session.environment === void 0 ? {} : { environment: session.environment },\n\t\t...session.host.sessionContext === void 0 ? {} : { sessionContext: session.host.sessionContext }\n\t};\n}\n/** Owns direct, same-process session and channel state for presentation adapters. */\nfunction createHeadlessHub(options) {\n\tconst readGitStatus = options.readGitStatus ?? ((cwd) => readSessionGitStatus(options.platform.env(cwd), cwd));\n\tconst sessions = /* @__PURE__ */ new Map();\n\tconst pendingSetups = /* @__PURE__ */ new Map();\n\tconst activities = /* @__PURE__ */ new Map();\n\tconst present = (session) => {\n\t\tconst pending = pendingSetups.get(session.id);\n\t\tconst activity = activities.get(session.id);\n\t\tif (pending === void 0 && activity === void 0) return session;\n\t\treturn {\n\t\t\t...session,\n\t\t\t...pending === void 0 ? {} : { pendingSetups: pending },\n\t\t\t...activity === void 0 ? {} : { activity }\n\t\t};\n\t};\n\tconst pluginRegistry = createPoPluginRegistry();\n\tconst editPresence = /* @__PURE__ */ new Map();\n\tconst channels = /* @__PURE__ */ new Map();\n\tconst listeners = /* @__PURE__ */ new Set();\n\tconst subscriptions = /* @__PURE__ */ new Set();\n\tconst sessionCleanups = /* @__PURE__ */ new Map();\n\tconst presentationCleanups = /* @__PURE__ */ new Map();\n\t/** Profile icons by session, kept out of summaries because each can be hundreds of kilobytes. */\n\tconst avatarIcons = /* @__PURE__ */ new Map();\n\tconst sessionShutdowns = /* @__PURE__ */ new Map();\n\tconst directEventListeners = /* @__PURE__ */ new Map();\n\tconst directEventLatest = /* @__PURE__ */ new Map();\n\tconst maxDirectEventLatest = 4096;\n\tconst communicationEndpoints = /* @__PURE__ */ new Map();\n\tlet closed = false;\n\t/** The mount table each served global or workspace scope publishes, by mount key. */\n\tconst scopeHosts = /* @__PURE__ */ new Map();\n\tlet globalScope;\n\tconst workspaceScopes = /* @__PURE__ */ new Map();\n\tconst openGlobalScope = () => globalScope ??= PoServerScope.open(\"global\");\n\tconst openWorkspaceScope = (workspaceId) => {\n\t\tlet scope = workspaceScopes.get(workspaceId);\n\t\tif (scope === void 0) {\n\t\t\tscope = openGlobalScope().then((global) => PoServerScope.open(\"workspace\", global));\n\t\t\tworkspaceScopes.set(workspaceId, scope);\n\t\t}\n\t\treturn scope;\n\t};\n\tconst workspaces = /* @__PURE__ */ new Map();\n\tconst worktreeProvisioners = /* @__PURE__ */ new Map();\n\tlet sessionService;\n\tconst mountKey = (mount) => mount.scope === \"global\" ? \"global\" : mount.scope === \"workspace\" ? `workspace:${mount.workspaceId}` : `session:${mount.sessionId}`;\n\tconst belongs = (mount, session) => mount.scope === \"global\" || (mount.scope === \"workspace\" ? session.workspaceId === mount.workspaceId : session.id === mount.sessionId);\n\tconst canClose = (mount, session) => belongs(mount, session) || mount.scope === \"session\" && session.parentSessionId === mount.sessionId;\n\tconst peers = (a, b) => {\n\t\tif (a.sessionProvenance === \"remote-conversation\" || b.sessionProvenance === \"remote-conversation\") return false;\n\t\tconst root = a.host.sessionContext?.checkoutRoot;\n\t\tif (root !== void 0 && root === b.host.sessionContext?.checkoutRoot) return true;\n\t\treturn (a.groups ?? []).some((group) => b.groups?.includes(group) === true);\n\t};\n\tconst canCommunicate = (sourceId, targetId) => {\n\t\tif (closed || sourceId === targetId) return false;\n\t\tconst source = sessions.get(sourceId);\n\t\tconst target = sessions.get(targetId);\n\t\treturn source !== void 0 && target !== void 0 && (source.parentSessionId === target.id || target.parentSessionId === source.id || peers(source, target));\n\t};\n\tconst registerReservedWorktreeProvisioner = (mount, provisioner) => {\n\t\tconst key = mountKey(mount);\n\t\tif (worktreeProvisioners.has(key)) throw new Error(\"A worktree provisioner is already registered.\");\n\t\tworktreeProvisioners.set(key, {\n\t\t\tmount,\n\t\t\tprovisioner\n\t\t});\n\t\treturn () => {\n\t\t\tif (worktreeProvisioners.get(key)?.provisioner === provisioner) worktreeProvisioners.delete(key);\n\t\t};\n\t};\n\tconst worktreeProvisionerFor = (parent) => {\n\t\tlet provisioner;\n\t\tlet priority = -1;\n\t\tfor (const { mount, provisioner: candidate } of worktreeProvisioners.values()) {\n\t\t\tif (!belongs(mount, parent) || CHANNEL_PRIORITY[mount.scope] <= priority) continue;\n\t\t\tprovisioner = candidate;\n\t\t\tpriority = CHANNEL_PRIORITY[mount.scope];\n\t\t}\n\t\treturn provisioner;\n\t};\n\t/**\n\t* A mirror of a session another host runs (a sandbox container) is served only by channels mounted on that session:\n\t* the container's own, merged by the router. Host global and workspace channels would read host-side state the\n\t* mirror has none of (it carries no admitted environment), so they never reach it.\n\t*/\n\tconst reaches = (mount, session) => belongs(mount, session) && (mount.scope === \"session\" || session.host.agentSession === void 0);\n\tconst selectedChannels = (session) => {\n\t\tconst selected = /* @__PURE__ */ new Map();\n\t\tfor (const started of channels.values()) {\n\t\t\tif (!reaches(started.mount, session)) continue;\n\t\t\tconst previous = selected.get(started.channel.frameType);\n\t\t\tif (!previous || CHANNEL_PRIORITY[started.mount.scope] > CHANNEL_PRIORITY[previous.mount.scope]) selected.set(started.channel.frameType, started);\n\t\t}\n\t\treturn [...selected.values()];\n\t};\n\tconst selectedChannel = (session, frameType) => selectedChannels(session).find((started) => started.channel.frameType === frameType);\n\t/**\n\t* One channel serves a session: the narrowest mount that reaches it. A package that\n\t* registers the same channel globally and per workspace would otherwise run two\n\t* sources against one session, and only the narrower one can publish or receive.\n\t*\n\t* Compared by mount scope rather than identity so a channel being started already\n\t* knows which sessions it is taking over.\n\t*/\n\tconst serves = (mount, frameType, session) => {\n\t\tif (!reaches(mount, session)) return false;\n\t\tconst current = selectedChannel(session, frameType);\n\t\treturn current === void 0 || CHANNEL_PRIORITY[mount.scope] >= CHANNEL_PRIORITY[current.mount.scope];\n\t};\n\tconst directEventKey = (frameType, sessionId) => `${frameType}\\0${sessionId}`;\n\tconst directEvents = {\n\t\tpublish(frameType, sessionId, payload) {\n\t\t\tif (closed) return;\n\t\t\tconst key = directEventKey(frameType, sessionId);\n\t\t\tdirectEventLatest.set(key, payload);\n\t\t\twhile (directEventLatest.size > maxDirectEventLatest) {\n\t\t\t\tconst oldest = directEventLatest.keys().next().value;\n\t\t\t\tif (oldest === void 0) break;\n\t\t\t\tdirectEventLatest.delete(oldest);\n\t\t\t}\n\t\t\tconst listeners = directEventListeners.get(key);\n\t\t\tif (listeners === void 0) return;\n\t\t\tfor (const listener of listeners) listener(payload);\n\t\t},\n\t\tsubscribe(frameType, sessionId, listener, options) {\n\t\t\tif (closed) return () => void 0;\n\t\t\tconst key = directEventKey(frameType, sessionId);\n\t\t\tconst listeners = directEventListeners.get(key) ?? /* @__PURE__ */ new Set();\n\t\t\tlisteners.add(listener);\n\t\t\tdirectEventListeners.set(key, listeners);\n\t\t\tif (options?.replayLatest && directEventLatest.has(key)) listener(directEventLatest.get(key));\n\t\t\tlet released = false;\n\t\t\treturn () => {\n\t\t\t\tif (released) return;\n\t\t\t\treleased = true;\n\t\t\t\tlisteners.delete(listener);\n\t\t\t\tif (listeners.size === 0) directEventListeners.delete(key);\n\t\t\t};\n\t\t},\n\t\tclearSession(sessionId) {\n\t\t\tconst suffix = `\\0${sessionId}`;\n\t\t\tfor (const key of directEventLatest.keys()) if (key.endsWith(suffix)) directEventLatest.delete(key);\n\t\t},\n\t\tclose() {\n\t\t\tdirectEventListeners.clear();\n\t\t\tdirectEventLatest.clear();\n\t\t}\n\t};\n\tconst announceCommunicationReady = (sessionId) => {\n\t\tconst current = communicationEndpoints.get(sessionId);\n\t\tif (current?.ready !== true) return;\n\t\tfor (const [peerSessionId, peer] of communicationEndpoints) {\n\t\t\tif (!peer.ready || !canCommunicate(sessionId, peerSessionId)) continue;\n\t\t\tfor (const listener of current.readyListeners) listener(peerSessionId);\n\t\t\tfor (const listener of peer.readyListeners) listener(sessionId);\n\t\t}\n\t};\n\tconst bindCommunication = (sessionId) => {\n\t\tconst existing = communicationEndpoints.get(sessionId);\n\t\tif (existing !== void 0) return existing.endpoint;\n\t\tconst listeners = /* @__PURE__ */ new Map();\n\t\tconst readyListeners = /* @__PURE__ */ new Set();\n\t\tlet endpoint;\n\t\tconst record = {\n\t\t\tlisteners,\n\t\t\treadyListeners,\n\t\t\tready: false,\n\t\t\tget endpoint() {\n\t\t\t\treturn endpoint;\n\t\t\t}\n\t\t};\n\t\tendpoint = {\n\t\t\tsessionId,\n\t\t\tget sessionName() {\n\t\t\t\treturn sessions.get(sessionId)?.name;\n\t\t\t},\n\t\t\tget groups() {\n\t\t\t\treturn sessions.get(sessionId)?.groups ?? [];\n\t\t\t},\n\t\t\tpublish(targetSessionId, type, payload) {\n\t\t\t\tif (!canCommunicate(sessionId, targetSessionId)) return false;\n\t\t\t\tconst target = communicationEndpoints.get(targetSessionId);\n\t\t\t\tif (target?.ready !== true) return false;\n\t\t\t\tfor (const listener of target.listeners.get(type) ?? []) listener(sessionId, payload);\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tsubscribe(type, listener) {\n\t\t\t\tconst current = listeners.get(type) ?? /* @__PURE__ */ new Set();\n\t\t\t\tcurrent.add(listener);\n\t\t\t\tlisteners.set(type, current);\n\t\t\t\treturn () => {\n\t\t\t\t\tcurrent.delete(listener);\n\t\t\t\t\tif (current.size === 0) listeners.delete(type);\n\t\t\t\t};\n\t\t\t},\n\t\t\tonPeerReady(listener) {\n\t\t\t\treadyListeners.add(listener);\n\t\t\t\tif (!record.ready) {\n\t\t\t\t\trecord.ready = true;\n\t\t\t\t\tannounceCommunicationReady(sessionId);\n\t\t\t\t} else for (const [peerSessionId, peer] of communicationEndpoints) if (peer.ready && canCommunicate(sessionId, peerSessionId)) listener(peerSessionId);\n\t\t\t\treturn () => readyListeners.delete(listener);\n\t\t\t},\n\t\t\tdescribePeer(peerSessionId) {\n\t\t\t\tif (!canCommunicate(sessionId, peerSessionId)) return void 0;\n\t\t\t\tconst peer = sessions.get(peerSessionId);\n\t\t\t\tif (peer === void 0) return void 0;\n\t\t\t\tconst own = sessions.get(sessionId).groups ?? [];\n\t\t\t\tconst sharedGroups = (peer.groups ?? []).filter((group) => own.includes(group));\n\t\t\t\tconst profile = peer.profile?.displayName ?? peer.profile?.name;\n\t\t\t\treturn {\n\t\t\t\t\tsessionId: peerSessionId,\n\t\t\t\t\tname: peer.name,\n\t\t\t\t\t...profile === void 0 ? {} : { profile },\n\t\t\t\t\tsharedGroups\n\t\t\t\t};\n\t\t\t},\n\t\t\tlistPeers() {\n\t\t\t\tconst peers = [];\n\t\t\t\tfor (const [peerSessionId, peer] of communicationEndpoints) {\n\t\t\t\t\tif (!peer.ready) continue;\n\t\t\t\t\tconst described = endpoint.describePeer?.(peerSessionId);\n\t\t\t\t\tif (described !== void 0) peers.push(described);\n\t\t\t\t}\n\t\t\t\treturn peers;\n\t\t\t},\n\t\t\tclose() {\n\t\t\t\tif (communicationEndpoints.get(sessionId)?.endpoint !== endpoint) return;\n\t\t\t\tcommunicationEndpoints.delete(sessionId);\n\t\t\t\tlisteners.clear();\n\t\t\t\treadyListeners.clear();\n\t\t\t}\n\t\t};\n\t\tcommunicationEndpoints.set(sessionId, record);\n\t\treturn endpoint;\n\t};\n\tconst queuedEvents = [];\n\tlet publishing = false;\n\tconst emit = (event) => {\n\t\tif (closed) return;\n\t\tqueuedEvents.push(event.kind === \"upsert\" ? {\n\t\t\t...event,\n\t\t\tsession: present(event.session)\n\t\t} : event);\n\t\tif (publishing) return;\n\t\tpublishing = true;\n\t\ttry {\n\t\t\tfor (let index = 0; index < queuedEvents.length; index += 1) for (const listener of listeners) listener(queuedEvents[index]);\n\t\t} finally {\n\t\t\tqueuedEvents.length = 0;\n\t\t\tpublishing = false;\n\t\t}\n\t};\n\tconst sessionScopes = () => [...sessions.values()].map(scopeOf);\n\tconst publish = (frameType, sessionId, payload, connectionId) => {\n\t\tif (!sessions.has(sessionId)) return;\n\t\temit({\n\t\t\tkind: \"channel\",\n\t\t\tframeType,\n\t\t\tsessionId,\n\t\t\tpayload,\n\t\t\t...connectionId === void 0 ? {} : { connectionId }\n\t\t});\n\t};\n\t/**\n\t* Hub-owned calls carry the hub credential, so a session API can tell them from a\n\t* browser call it must not trust. Browser traffic reaches a session API through\n\t* requestApi instead, and keeps the headers its caller sent.\n\t*/\n\tconst hubAuthenticated = (request) => {\n\t\tconst token = options.hubToken?.();\n\t\tif (token === void 0 || token === \"\") return request;\n\t\tconst headers = new Headers(request.headers);\n\t\tif (headers.has(AUTHORIZATION_HEADER)) return request;\n\t\theaders.set(AUTHORIZATION_HEADER, `Bearer ${token}`);\n\t\treturn {\n\t\t\t...request,\n\t\t\theaders\n\t\t};\n\t};\n\tconst reservationsFor = (mount) => {\n\t\tconst reservations = options.sessionReservations;\n\t\tif (!reservations) return void 0;\n\t\tconst check = (parentId) => {\n\t\t\tconst parent = sessions.get(parentId);\n\t\t\tif (!parent || !belongs(mount, parent)) throw new Error(\"Parent session is outside this mount.\");\n\t\t};\n\t\treturn {\n\t\t\tread: (id, parentId) => {\n\t\t\t\tcheck(parentId);\n\t\t\t\treturn reservations.read(id, parentId);\n\t\t\t},\n\t\t\tprepare: (id, parentId, cwd) => {\n\t\t\t\tcheck(parentId);\n\t\t\t\treturn reservations.prepare(id, parentId, cwd);\n\t\t\t},\n\t\t\tcomplete: (id, parentId) => {\n\t\t\t\tcheck(parentId);\n\t\t\t\treturn reservations.complete(id, parentId);\n\t\t\t}\n\t\t};\n\t};\n\tconst channelHost = (frameType, mount) => ({\n\t\thomeDirectory: options.platform.homeDirectory,\n\t\tsessionStorage: options.platform.sessions,\n\t\tsessions: () => sessionScopes().filter((scope) => {\n\t\t\tconst session = sessions.get(scope.sessionId);\n\t\t\treturn session !== void 0 && serves(mount, frameType, session);\n\t\t}),\n\t\tsessionService: {\n\t\t\treservations: reservationsFor(mount),\n\t\t\tcreate: async (request) => {\n\t\t\t\tif (mount.scope === \"workspace\" && request.parentSessionId === void 0) {\n\t\t\t\t\tif (request.reservationId !== void 0) throw new Error(\"A reserved session requires its owning parent.\");\n\t\t\t\t\tif (options.createSession === void 0) throw new Error(\"The cockpit session service cannot create sessions in this host.\");\n\t\t\t\t\treturn options.createSession(request, { workspaceId: mount.workspaceId });\n\t\t\t\t}\n\t\t\t\tif (mount.scope !== \"global\") {\n\t\t\t\t\tconst parent = request.parentSessionId === void 0 ? void 0 : sessions.get(request.parentSessionId);\n\t\t\t\t\tif (!parent || !belongs(mount, parent)) throw new Error(\"Parent session is outside this mount.\");\n\t\t\t\t}\n\t\t\t\treturn sessionService.create(request);\n\t\t\t},\n\t\t\tclose: async (id) => {\n\t\t\t\tconst session = sessions.get(id);\n\t\t\t\tif (session === void 0) {\n\t\t\t\t\tconst shutdown = sessionShutdowns.get(id);\n\t\t\t\t\tif (shutdown !== void 0) {\n\t\t\t\t\t\tif (!canClose(mount, shutdown.session)) throw new Error(\"Session is outside this mount.\");\n\t\t\t\t\t\tawait shutdown.promise;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!canClose(mount, session)) throw new Error(\"Session is outside this mount.\");\n\t\t\t\tawait sessionService.close(id);\n\t\t\t},\n\t\t\tisLive: (id) => sessionService.isLive(id),\n\t\t\t...mount.scope === \"global\" && options.dormantSessions && options.reviveSession ? {\n\t\t\t\tdormant: options.dormantSessions,\n\t\t\t\trevive: options.reviveSession\n\t\t\t} : {},\n\t\t\tregisterReservedWorktreeProvisioner: (provisioner) => registerReservedWorktreeProvisioner(mount, provisioner),\n\t\t\tcanCommunicate: (sourceId, targetId) => {\n\t\t\t\tconst source = sessions.get(sourceId);\n\t\t\t\treturn source !== void 0 && belongs(mount, source) && sessionService.canCommunicate?.(sourceId, targetId) === true;\n\t\t\t}\n\t\t},\n\t\t...mount.scope === \"global\" && options.admitWorkspace ? { admitWorkspace: options.admitWorkspace } : {},\n\t\t...mount.scope === \"global\" ? { workspaces: () => [...workspaces.values()] } : {},\n\t\tdirectEvents: {\n\t\t\tpublish: (type, id, payload) => {\n\t\t\t\tconst session = sessions.get(id);\n\t\t\t\tif (session && serves(mount, frameType, session)) directEvents.publish(type, id, payload);\n\t\t\t},\n\t\t\tsubscribe: (type, id, listener, subscriptionOptions) => {\n\t\t\t\tconst session = sessions.get(id);\n\t\t\t\treturn session && serves(mount, frameType, session) ? directEvents.subscribe(type, id, listener, subscriptionOptions) : () => void 0;\n\t\t\t},\n\t\t\tclose: () => void 0\n\t\t},\n\t\tpublish: (sessionId, payload) => {\n\t\t\tconst session = sessions.get(sessionId);\n\t\t\tif (session && serves(mount, frameType, session)) publish(frameType, sessionId, payload);\n\t\t},\n\t\tpublishToConnection: (connectionId, sessionId, payload) => {\n\t\t\tconst session = sessions.get(sessionId);\n\t\t\tif (connectionId === \"\" || !session || !serves(mount, frameType, session)) return false;\n\t\t\tpublish(frameType, sessionId, payload, connectionId);\n\t\t\treturn true;\n\t\t},\n\t\trequestSessionApi: async (scope, request) => {\n\t\t\tconst session = sessions.get(scope.sessionId);\n\t\t\tif (!session || !belongs(mount, session)) return Response.json({ error: \"Session not found.\" }, { status: 404 });\n\t\t\tif (options.requestSessionApi === void 0) return Response.json({ error: \"Session API unavailable.\" }, { status: 404 });\n\t\t\treturn options.requestSessionApi(scope, hubAuthenticated(request));\n\t\t},\n\t\t...options.computerUse === void 0 ? {} : { computerUse: {\n\t\t\tget available() {\n\t\t\t\treturn options.computerUse.available;\n\t\t\t},\n\t\t\trequest(scope, request) {\n\t\t\t\tconst session = sessions.get(scope.sessionId);\n\t\t\t\tif (!session || !belongs(mount, session)) throw new Error(\"Computer-use session is outside this mount.\");\n\t\t\t\treturn options.computerUse.request(scopeOf(session), request);\n\t\t\t}\n\t\t} },\n\t\tonNotice: (message) => options.onNotice?.(message)\n\t});\n\tconst startChannel = (channel, mount) => {\n\t\tconst key = `${mountKey(mount)}:${channel.frameType}`;\n\t\tif (channels.has(key)) {\n\t\t\toptions.onNotice?.(`hub channel '${channel.frameType}' is already registered`);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tconst displaced = /* @__PURE__ */ new Map();\n\t\t\tfor (const session of sessions.values()) {\n\t\t\t\tif (!belongs(mount, session)) continue;\n\t\t\t\tconst previous = selectedChannel(session, channel.frameType);\n\t\t\t\tif (previous !== void 0) displaced.set(session.id, previous);\n\t\t\t}\n\t\t\tconst source = channel.start(channelHost(channel.frameType, mount));\n\t\t\tconst started = {\n\t\t\t\tchannel,\n\t\t\t\tsource,\n\t\t\t\tmount\n\t\t\t};\n\t\t\tchannels.set(key, started);\n\t\t\tfor (const session of sessions.values()) {\n\t\t\t\tif (selectedChannel(session, channel.frameType) !== started) continue;\n\t\t\t\tdisplaced.get(session.id)?.source.sessionRemoved?.(session.id);\n\t\t\t\tsource.sessionAdded?.(scopeOf(session));\n\t\t\t}\n\t\t\treturn started;\n\t\t} catch (error) {\n\t\t\toptions.onNotice?.(`hub channel '${channel.frameType}' failed (${String(error)})`);\n\t\t\treturn;\n\t\t}\n\t};\n\tconst releaseChannel = (channel, started) => {\n\t\tconst key = `${mountKey(started.mount)}:${channel.frameType}`;\n\t\tif (channels.get(key) !== started) return;\n\t\tconst served = [...sessions.values()].filter((session) => selectedChannel(session, channel.frameType) === started);\n\t\tchannels.delete(key);\n\t\tstarted.source.close();\n\t\tfor (const session of served) selectedChannel(session, channel.frameType)?.source.sessionAdded?.(scopeOf(session));\n\t};\n\tconst receiveMountedChannel = (mount, sessionId, frameType, payload, connectionId) => {\n\t\tif (!connectionId) return false;\n\t\tconst session = sessions.get(sessionId);\n\t\tif (!session || !belongs(mount, session)) return false;\n\t\tconst started = selectedChannel(session, frameType);\n\t\tif (!started?.channel.receive) return false;\n\t\tstarted.channel.receive(scopeOf(session), payload, { connectionId });\n\t\treturn true;\n\t};\n\tconst unregisterSession = (sessionId, closeOptions) => {\n\t\tconst current = sessions.get(sessionId);\n\t\tif (current === void 0) return;\n\t\tconst cleanup = sessionCleanups.get(sessionId);\n\t\tif (cleanup !== void 0) subscriptions.delete(cleanup);\n\t\tcommunicationEndpoints.get(sessionId)?.endpoint.close();\n\t\ttry {\n\t\t\tfor (const { source } of selectedChannels(current)) source.sessionRemoved?.(sessionId);\n\t\t\toptions.computerUse?.forgetSession?.(sessionId);\n\t\t} finally {\n\t\t\tsessions.delete(sessionId);\n\t\t\tpendingSetups.delete(sessionId);\n\t\t\tactivities.delete(sessionId);\n\t\t\tsessionCleanups.delete(sessionId);\n\t\t\tpresentationCleanups.get(sessionId)?.();\n\t\t\tpresentationCleanups.delete(sessionId);\n\t\t\tavatarIcons.delete(sessionId);\n\t\t\tdirectEvents.clearSession?.(sessionId);\n\t\t}\n\t\temit({\n\t\t\tkind: \"removed\",\n\t\t\tsessionId,\n\t\t\t...closeOptions?.keepDormant === true ? { dormant: true } : {}\n\t\t});\n\t};\n\tconst startSessionShutdown = (session, closeOptions) => {\n\t\tconst existing = sessionShutdowns.get(session.id);\n\t\tif (existing !== void 0) return existing.promise;\n\t\tconst { id, workspaceId, parentSessionId } = session;\n\t\tconst shutdown = {\n\t\t\tsession: {\n\t\t\t\tid,\n\t\t\t\tworkspaceId,\n\t\t\t\tparentSessionId\n\t\t\t},\n\t\t\tpromise: Promise.resolve(),\n\t\t\tpending: true\n\t\t};\n\t\tconst promise = Promise.resolve().then(() => closeOptions === void 0 ? options.manager.closeSession(id) : options.manager.closeSession(id, closeOptions));\n\t\tshutdown.promise = promise;\n\t\tsessionShutdowns.set(session.id, shutdown);\n\t\tpromise.then(() => {\n\t\t\tshutdown.pending = false;\n\t\t\tif (sessionShutdowns.get(session.id) === shutdown) sessionShutdowns.delete(session.id);\n\t\t}, () => {\n\t\t\tshutdown.pending = false;\n\t\t});\n\t\treturn promise;\n\t};\n\tconst register = (session) => {\n\t\tif (closed) throw new Error(\"The headless hub is closed.\");\n\t\tif (sessions.has(session.id)) throw new Error(`Session '${session.id}' is already registered.`);\n\t\tif (sessionShutdowns.get(session.id)?.pending) throw new Error(`Session '${session.id}' is still shutting down.`);\n\t\tsessionShutdowns.delete(session.id);\n\t\tlet current = {\n\t\t\t...session,\n\t\t\tupdatedAt: session.updatedAt ?? session.createdAt,\n\t\t\tphase: session.phase ?? \"idle\",\n\t\t\tphaseSince: session.phaseSince ?? session.createdAt,\n\t\t\tpendingMessageCount: session.pendingMessageCount ?? 0,\n\t\t\teverPrompted: session.everPrompted ?? false,\n\t\t\tawaitingInput: session.awaitingInput ?? false\n\t\t};\n\t\tsessions.set(session.id, current);\n\t\tannounceCommunicationReady(session.id);\n\t\tconst sandboxed = session.workspaceId !== void 0 && workspaces.get(session.workspaceId)?.sandbox !== void 0;\n\t\tconst refreshGit = () => {\n\t\t\tif (sandboxed) return;\n\t\t\treadGitStatus(session.cwd).then((git) => {\n\t\t\t\tif (closed || sessions.get(session.id)?.host !== session.host) return;\n\t\t\t\tif (git?.branch === current.git?.branch && git?.dirty === current.git?.dirty) return;\n\t\t\t\tconst { git: _previous, ...rest } = current;\n\t\t\t\tcurrent = git === void 0 ? rest : {\n\t\t\t\t\t...rest,\n\t\t\t\t\tgit\n\t\t\t\t};\n\t\t\t\tsessions.set(session.id, current);\n\t\t\t\temit({\n\t\t\t\t\tkind: \"upsert\",\n\t\t\t\t\tsession: current\n\t\t\t\t});\n\t\t\t}, (error) => options.onNotice?.(`session ${session.id} git status failed (${error instanceof Error ? error.message : String(error)})`));\n\t\t};\n\t\tlet attentionDialog;\n\t\tconst stopPresentation = session.host.onPresentationFrame((frame) => {\n\t\t\tif (sessions.get(session.id)?.host !== session.host) return;\n\t\t\tconst type = typeof frame.type === \"string\" ? frame.type : \"\";\n\t\t\tconst entry = frame.entry;\n\t\t\tif (type === \"entry_appended\" && entry?.customType === \"po-notification\") {\n\t\t\t\temit({\n\t\t\t\t\tkind: \"frame\",\n\t\t\t\t\tsessionId: session.id,\n\t\t\t\t\tframe\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type !== \"agent_start\" && type !== \"agent_settled\" && type !== \"message_end\" && type !== \"session_info_changed\" && type !== \"session_groups_changed\" && type !== \"extension_ui_request\" && type !== \"extension_ui_answered\") return;\n\t\t\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\t\t\tconst phase = type === \"agent_start\" ? \"turn\" : type === \"agent_settled\" ? \"idle\" : current.phase;\n\t\t\tconst phaseChanged = phase !== current.phase;\n\t\t\tconst method = typeof frame.method === \"string\" ? frame.method : \"\";\n\t\t\tconst dialog = type === \"extension_ui_request\" && [\n\t\t\t\t\"select\",\n\t\t\t\t\"confirm\",\n\t\t\t\t\"input\",\n\t\t\t\t\"editor\"\n\t\t\t].includes(method);\n\t\t\tconst awaitingInput = dialog ? true : type === \"extension_ui_answered\" || type === \"agent_settled\" ? false : current.awaitingInput;\n\t\t\tconst groups = type === \"session_groups_changed\" && Array.isArray(frame.groups) ? frame.groups.filter((group) => typeof group === \"string\") : current.groups;\n\t\t\tcurrent = {\n\t\t\t\t...current,\n\t\t\t\tname: type === \"session_info_changed\" && typeof frame.name === \"string\" ? frame.name : current.name,\n\t\t\t\t...groups === void 0 ? {} : { groups },\n\t\t\t\tupdatedAt: now,\n\t\t\t\tphase,\n\t\t\t\tphaseSince: phaseChanged ? now : current.phaseSince,\n\t\t\t\teverPrompted: current.everPrompted || type === \"agent_start\",\n\t\t\t\tawaitingInput,\n\t\t\t\t...type === \"agent_settled\" ? { lastSettledAt: now } : {}\n\t\t\t};\n\t\t\tsessions.set(session.id, current);\n\t\t\temit({\n\t\t\t\tkind: \"upsert\",\n\t\t\t\tsession: current\n\t\t\t});\n\t\t\tif (dialog) attentionDialog = typeof frame.id === \"string\" && typeof frame.title === \"string\" ? {\n\t\t\t\tid: frame.id,\n\t\t\t\ttitle: frame.title,\n\t\t\t\t...typeof frame.message === \"string\" ? { message: frame.message } : {},\n\t\t\t\t...frame.purpose === \"feedback\" ? { purpose: \"feedback\" } : {}\n\t\t\t} : void 0;\n\t\t\telse if (type === \"extension_ui_answered\" || type === \"agent_settled\") attentionDialog = void 0;\n\t\t\tconst attention = {\n\t\t\t\tname: current.name,\n\t\t\t\tphase: current.phase ?? \"idle\",\n\t\t\t\tawaitingInput: current.awaitingInput ?? false,\n\t\t\t\t...current.lastSettledAt === void 0 ? {} : { settledAt: current.lastSettledAt },\n\t\t\t\t...attentionDialog === void 0 ? {} : { dialog: attentionDialog }\n\t\t\t};\n\t\t\tdirectEvents.publish(PO_SESSION_ATTENTION_EVENT, session.id, attention);\n\t\t\tif (type === \"session_groups_changed\") announceCommunicationReady(session.id);\n\t\t\tif (dialog) {\n\t\t\t\tconst text = (key) => typeof frame[key] === \"string\" ? { [key]: frame[key] } : {};\n\t\t\t\temit({\n\t\t\t\t\tkind: \"frame\",\n\t\t\t\t\tsessionId: session.id,\n\t\t\t\t\tframe: {\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\t...text(\"id\"),\n\t\t\t\t\t\tmethod,\n\t\t\t\t\t\t...text(\"title\"),\n\t\t\t\t\t\t...text(\"message\"),\n\t\t\t\t\t\t...frame.purpose === \"feedback\" ? { purpose: \"feedback\" } : {}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (type === \"agent_settled\") refreshGit();\n\t\t});\n\t\tlet registered = false;\n\t\tconst root = () => session.workspaceId && workspaces.get(session.workspaceId)?.root || session.cwd;\n\t\tlet compositionMode;\n\t\tconst applyCompositions = (majorMode) => {\n\t\t\tif (!options.publishSessionCompositions || majorMode === compositionMode) return false;\n\t\t\tcompositionMode = majorMode;\n\t\t\ttry {\n\t\t\t\tconst { webComposition, nativeComposition } = options.publishSessionCompositions(session.id, root(), majorMode);\n\t\t\t\tcurrent = {\n\t\t\t\t\t...current,\n\t\t\t\t\twebComposition,\n\t\t\t\t\tnativeComposition\n\t\t\t\t};\n\t\t\t\treturn true;\n\t\t\t} catch (error) {\n\t\t\t\toptions.onNotice?.(`session ${session.id} plugins for major mode \"${majorMode}\" could not be published (${error instanceof Error ? error.message : String(error)})`);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\tconst applyProfile = (profileName) => {\n\t\t\tlet identity;\n\t\t\tif (profileName && !sandboxed) try {\n\t\t\t\tidentity = options.resolveProfileIdentity?.(root(), profileName);\n\t\t\t} catch (error) {\n\t\t\t\toptions.onNotice?.(`session ${session.id} profile \"${profileName}\" could not be resolved (${error instanceof Error ? error.message : String(error)})`);\n\t\t\t}\n\t\t\tconst icon = identity?.icon;\n\t\t\tif (icon) avatarIcons.set(session.id, icon);\n\t\t\telse avatarIcons.delete(session.id);\n\t\t\tconst profile = profileName ? {\n\t\t\t\tname: profileName,\n\t\t\t\t...identity?.displayName ? { displayName: identity.displayName } : {},\n\t\t\t\t...icon ? { iconVersion: crypto.createHash(\"sha256\").update(icon).digest(\"hex\").slice(0, ICON_VERSION_LENGTH) } : {}\n\t\t\t} : void 0;\n\t\t\tconst previous = current.profile;\n\t\t\tif (previous?.name === profile?.name && previous?.displayName === profile?.displayName && previous?.iconVersion === profile?.iconVersion) return false;\n\t\t\tconst { profile: _previous, ...rest } = current;\n\t\t\tcurrent = profile === void 0 ? rest : {\n\t\t\t\t...rest,\n\t\t\t\tprofile\n\t\t\t};\n\t\t\treturn true;\n\t\t};\n\t\tconst applySelection = (selection) => {\n\t\t\tif (closed || sessions.get(session.id)?.host !== session.host) return;\n\t\t\tconst compositionsChanged = applyCompositions(selection.majorMode);\n\t\t\tconst profileChanged = applyProfile(selection.profile);\n\t\t\tif (!compositionsChanged && !profileChanged) return;\n\t\t\tsessions.set(session.id, current);\n\t\t\tif (registered) emit({\n\t\t\t\tkind: \"upsert\",\n\t\t\t\tsession: current\n\t\t\t});\n\t\t};\n\t\tconst stopSelection = session.host.onSelection?.(applySelection);\n\t\tconst stopBackgroundWork = session.host.onBackgroundWork?.((backgroundWorkActive) => {\n\t\t\tif (closed || sessions.get(session.id)?.host !== session.host) return;\n\t\t\tif (current.backgroundWorkActive === backgroundWorkActive) return;\n\t\t\tcurrent = {\n\t\t\t\t...current,\n\t\t\t\tbackgroundWorkActive\n\t\t\t};\n\t\t\tsessions.set(session.id, current);\n\t\t\tif (registered) emit({\n\t\t\t\tkind: \"upsert\",\n\t\t\t\tsession: current\n\t\t\t});\n\t\t});\n\t\tpresentationCleanups.set(session.id, () => {\n\t\t\tstopPresentation();\n\t\t\tstopSelection?.();\n\t\t\tstopBackgroundWork?.();\n\t\t});\n\t\tfor (const { source } of selectedChannels(current)) source.sessionAdded?.(scopeOf(session));\n\t\tconst active = () => sessions.get(session.id)?.host === session.host && !closed;\n\t\tconst cleanup = () => {\n\t\t\tsubscriptions.delete(cleanup);\n\t\t\tsessionCleanups.delete(session.id);\n\t\t\tif (!active()) return;\n\t\t\tcloseSession(session.id).catch((error) => options.onNotice?.(`session ${session.id} cleanup failed (${error instanceof Error ? error.message : String(error)})`));\n\t\t};\n\t\tsessionCleanups.set(session.id, cleanup);\n\t\tsession.host.runtime.exited.then(cleanup, cleanup);\n\t\tsubscriptions.add(cleanup);\n\t\tregistered = true;\n\t\temit({\n\t\t\tkind: \"upsert\",\n\t\t\tsession: current\n\t\t});\n\t\trefreshGit();\n\t};\n\tconst closeSession = async (sessionId, closeOptions) => {\n\t\tconst pending = sessionShutdowns.get(sessionId);\n\t\tif (pending !== void 0) {\n\t\t\tawait pending.promise;\n\t\t\treturn;\n\t\t}\n\t\tconst session = sessions.get(sessionId);\n\t\tif (session === void 0) return;\n\t\tunregisterSession(sessionId, closeOptions);\n\t\tawait startSessionShutdown(session, closeOptions);\n\t};\n\tconst promptTarget = (sessionId, parentSessionId) => {\n\t\tconst session = closed ? void 0 : sessions.get(sessionId);\n\t\tif (session === void 0) throw new Error(\"The session is not live.\");\n\t\tif (parentSessionId !== void 0 && session.parentSessionId !== parentSessionId) throw new Error(\"Only the parent session can drive this session.\");\n\t\treturn session;\n\t};\n\tsessionService = {\n\t\tcreate: async (request) => {\n\t\t\tif (options.createSession === void 0) throw new Error(\"The cockpit session service cannot create sessions in this host.\");\n\t\t\treturn options.createSession(request);\n\t\t},\n\t\tclose: closeSession,\n\t\tisLive: (sessionId) => !closed && sessions.has(sessionId),\n\t\treadExecutionState: async (sessionId, readOptions) => {\n\t\t\tconst target = promptTarget(sessionId, readOptions?.parentSessionId);\n\t\t\tif (!target.host.readExecutionState) throw new Error(\"The session cannot report execution state.\");\n\t\t\treturn target.host.readExecutionState();\n\t\t},\n\t\tprompt: async (sessionId, text, promptOptions) => {\n\t\t\tpromptOptions?.signal?.throwIfAborted();\n\t\t\tconst { settled } = await promptTarget(sessionId, promptOptions?.parentSessionId).host.runtime.submitPrompt(text);\n\t\t\treturn { settled };\n\t\t},\n\t\tabort: async (sessionId, abortOptions) => {\n\t\t\tawait promptTarget(sessionId, abortOptions?.parentSessionId).host.runtime.abort();\n\t\t},\n\t\tsteer: async (sessionId, message, steerOptions) => {\n\t\t\tawait promptTarget(sessionId, steerOptions?.parentSessionId).host.runtime.steer(message);\n\t\t},\n\t\trelease: async (sessionId, releaseOptions) => {\n\t\t\tpromptTarget(sessionId, releaseOptions?.parentSessionId);\n\t\t\tawait closeSession(sessionId, { keepDormant: true });\n\t\t},\n\t\treservations: options.sessionReservations,\n\t\tprovisionReservedWorktree: async (request) => {\n\t\t\tconst parent = sessions.get(request.parentSessionId);\n\t\t\tconst provisioner = parent === void 0 ? void 0 : worktreeProvisionerFor(parent);\n\t\t\tif (provisioner === void 0) throw new Error(\"Automatic conversation worktree provisioning is unavailable.\");\n\t\t\treturn provisioner(request);\n\t\t},\n\t\tregisterReservedWorktreeProvisioner: (provisioner) => registerReservedWorktreeProvisioner({ scope: \"global\" }, provisioner),\n\t\tcanCommunicate,\n\t\tbindCommunication\n\t};\n\tconst serveScope = async (suppliedContext, packages = []) => {\n\t\tif (closed) throw new Error(\"The headless hub is closed.\");\n\t\tconst context = suppliedContext ?? {\n\t\t\tscope: \"global\",\n\t\t\t...options.hubToken?.() === void 0 ? {} : { hubToken: options.hubToken() },\n\t\t\tsessionService,\n\t\t\tdirectEvents,\n\t\t\tonNotice: (message) => options.onNotice?.(message)\n\t\t};\n\t\tif (context.scope === \"session\") throw new Error(\"Session packages belong to their session host.\");\n\t\tif (context.scope === \"workspace\" && (!context.workspaceId || !context.workspaceRoot)) throw new Error(\"Workspace mounts require an admitted identity and root.\");\n\t\tconst mount = context.scope === \"global\" ? { scope: \"global\" } : {\n\t\t\tscope: \"workspace\",\n\t\t\tworkspaceId: context.workspaceId\n\t\t};\n\t\tconst key = mountKey(mount);\n\t\tif (scopeHosts.has(key)) throw new Error(`The '${key}' scope is already served.`);\n\t\tconst host = createPoServerHost({\n\t\t\tscope: context.scope,\n\t\t\tcontext: {\n\t\t\t\t...context,\n\t\t\t\thomeDirectory: context.homeDirectory ?? options.platform.homeDirectory,\n\t\t\t\tsessionStorage: options.platform.sessions,\n\t\t\t\tsessionService: channelHost(\"\", mount).sessionService,\n\t\t\t\tdirectEvents: channelHost(\"\", mount).directEvents,\n\t\t\t\treceiveChannel: (sessionId, frameType, payload, connectionId) => receiveMountedChannel(mount, sessionId, frameType, payload, connectionId)\n\t\t\t},\n\t\t\tmountChannel: (channel) => {\n\t\t\t\tconst started = startChannel(channel, mount);\n\t\t\t\tif (started === void 0) return {\n\t\t\t\t\tmounted: false,\n\t\t\t\t\tdispose: () => void 0\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tmounted: true,\n\t\t\t\t\tdispose: () => releaseChannel(channel, started)\n\t\t\t\t};\n\t\t\t},\n\t\t\tpluginRegistry\n\t\t});\n\t\tlet scope;\n\t\ttry {\n\t\t\tscope = await (mount.scope === \"global\" ? openGlobalScope() : openWorkspaceScope(mount.workspaceId));\n\t\t\tawait scope.serve({\n\t\t\t\thost,\n\t\t\t\tplatform: options.platform\n\t\t\t});\n\t\t\tscopeHosts.set(key, {\n\t\t\t\thost,\n\t\t\t\tscope\n\t\t\t});\n\t\t\tawait scope.install(packages, { onNotice: (message) => options.onNotice?.(message) });\n\t\t\tif (closed) throw new Error(\"The headless hub was closed while serving a scope.\");\n\t\t\tif (mount.scope === \"workspace\") {\n\t\t\t\tconst workspace = {\n\t\t\t\t\tid: mount.workspaceId,\n\t\t\t\t\troot: context.workspaceRoot,\n\t\t\t\t\tavailable: true\n\t\t\t\t};\n\t\t\t\tworkspaces.set(mount.workspaceId, workspace);\n\t\t\t\temit({\n\t\t\t\t\tkind: \"workspace_upsert\",\n\t\t\t\t\tworkspace\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (scopeHosts.get(key)?.host === host) scopeHosts.delete(key);\n\t\t\thost.dispose();\n\t\t\tif (mount.scope === \"workspace\") workspaceScopes.delete(mount.workspaceId);\n\t\t\telse globalScope = void 0;\n\t\t\tawait scope?.dispose();\n\t\t\tthrow error;\n\t\t}\n\t};\n\tconst installPackages = async (mount, packages) => {\n\t\tif (mount.scope === \"session\") throw new Error(\"Session packages belong to their session host.\");\n\t\tif (closed) throw new Error(\"The headless hub is closed.\");\n\t\tconst served = scopeHosts.get(mountKey(mount));\n\t\tif (served === void 0) throw new Error(`The '${mountKey(mount)}' scope is not served.`);\n\t\tawait served.scope.install(packages, { onNotice: (message) => options.onNotice?.(message) });\n\t};\n\treturn {\n\t\tsessionService,\n\t\tdirectEvents,\n\t\t...options.computerUse === void 0 ? {} : { computerUse: options.computerUse },\n\t\tasync readHome(request, authorizeSession) {\n\t\t\tif (!request || typeof request !== \"object\" || Array.isArray(request) || request.source !== void 0 && (typeof request.source !== \"string\" || request.source.length > 128) || request.workspaceId !== void 0 && (typeof request.workspaceId !== \"string\" || request.workspaceId.length > 256)) throw new Error(\"Invalid Home request.\");\n\t\t\tconst offset = Number.isSafeInteger(request?.offset) && request.offset >= 0 ? request.offset : 0;\n\t\t\tconst limit = Number.isSafeInteger(request?.limit) && request.limit > 0 ? Math.min(request.limit, 50) : 50;\n\t\t\tconst counts = {\n\t\t\t\tdecision: 0,\n\t\t\t\tfailure: 0,\n\t\t\t\tblocked: 0,\n\t\t\t\trunning: 0,\n\t\t\t\tqueued: 0,\n\t\t\t\tpaused: 0,\n\t\t\t\tcompleted: 0\n\t\t\t};\n\t\t\tconst statuses = /* @__PURE__ */ new Map();\n\t\t\tconst entities = /* @__PURE__ */ new Map();\n\t\t\tlet examined = 0;\n\t\t\tlet projectors = 0;\n\t\t\tfor (const session of sessions.values()) {\n\t\t\t\tif (closed || !authorizeSession(session.id) || request.workspaceId !== void 0 && request.workspaceId !== session.workspaceId) continue;\n\t\t\t\tfor (const { channel, source } of selectedChannels(session)) {\n\t\t\t\t\tif (!source.homeFor || request.source !== void 0 && request.source !== channel.frameType) continue;\n\t\t\t\t\tconst key = JSON.stringify([channel.frameType, session.workspaceId]);\n\t\t\t\t\tconst status = statuses.get(key) ?? {\n\t\t\t\t\t\tsource: channel.frameType,\n\t\t\t\t\t\t...session.workspaceId === void 0 ? {} : { workspaceId: session.workspaceId },\n\t\t\t\t\t\tcoverage: \"ready\"\n\t\t\t\t\t};\n\t\t\t\t\tstatuses.set(key, status);\n\t\t\t\t\tif (examined >= 1e3 || projectors++ >= 1e3) {\n\t\t\t\t\t\tstatus.coverage = \"partial\";\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst projection = parseHomeProjection(source.homeFor(scopeOf(session)));\n\t\t\t\t\t\tif (!projection) {\n\t\t\t\t\t\t\tstatus.coverage = \"partial\";\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (projection.coverage === \"partial\" || status.coverage === \"partial\") status.coverage = \"partial\";\n\t\t\t\t\t\telse if (projection.coverage === \"unavailable\") status.coverage = \"unavailable\";\n\t\t\t\t\t\tfor (const entity of projection.entities) {\n\t\t\t\t\t\t\texamined += 1;\n\t\t\t\t\t\t\tif (examined > 1e3) {\n\t\t\t\t\t\t\t\tstatus.coverage = \"partial\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (![entity.sessionId, ...entity.relatedSessionIds ?? []].every((id) => {\n\t\t\t\t\t\t\t\tconst referenced = sessions.get(id);\n\t\t\t\t\t\t\t\treturn referenced !== void 0 && referenced.workspaceId === session.workspaceId && authorizeSession(id);\n\t\t\t\t\t\t\t})) {\n\t\t\t\t\t\t\t\tstatus.coverage = \"partial\";\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst { relatedSessionIds: _related, ...publicEntity } = entity;\n\t\t\t\t\t\t\tconst identity = JSON.stringify([\n\t\t\t\t\t\t\t\tchannel.frameType,\n\t\t\t\t\t\t\t\tsession.workspaceId,\n\t\t\t\t\t\t\t\tentity.id\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\tconst previous = entities.get(identity);\n\t\t\t\t\t\t\tif (!previous || Date.parse(entity.updatedAt) > Date.parse(previous.updatedAt)) entities.set(identity, {\n\t\t\t\t\t\t\t\t...publicEntity,\n\t\t\t\t\t\t\t\tsource: channel.frameType,\n\t\t\t\t\t\t\t\t...session.workspaceId === void 0 ? {} : { workspaceId: session.workspaceId }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tstatus.coverage = \"partial\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const status of statuses.values()) status.counts = {\n\t\t\t\tdecision: 0,\n\t\t\t\tfailure: 0,\n\t\t\t\tblocked: 0,\n\t\t\t\trunning: 0,\n\t\t\t\tqueued: 0,\n\t\t\t\tpaused: 0,\n\t\t\t\tcompleted: 0\n\t\t\t};\n\t\t\tfor (const entity of entities.values()) {\n\t\t\t\tconst status = statuses.get(JSON.stringify([entity.source, entity.workspaceId]));\n\t\t\t\tif (status?.counts) status.counts[entity.kind] += 1;\n\t\t\t}\n\t\t\tconst attention = [...entities.values()].filter((entity) => {\n\t\t\t\tcounts[entity.kind] += 1;\n\t\t\t\treturn [\n\t\t\t\t\t\"decision\",\n\t\t\t\t\t\"failure\",\n\t\t\t\t\t\"blocked\",\n\t\t\t\t\t\"paused\"\n\t\t\t\t].includes(entity.kind);\n\t\t\t}).sort((a, b) => [\n\t\t\t\t\"decision\",\n\t\t\t\t\"failure\",\n\t\t\t\t\"blocked\",\n\t\t\t\t\"paused\"\n\t\t\t].indexOf(a.kind) - [\n\t\t\t\t\"decision\",\n\t\t\t\t\"failure\",\n\t\t\t\t\"blocked\",\n\t\t\t\t\"paused\"\n\t\t\t].indexOf(b.kind) || Date.parse(b.updatedAt) - Date.parse(a.updatedAt) || a.id.localeCompare(b.id) || a.source.localeCompare(b.source));\n\t\t\treturn {\n\t\t\t\tversion: 1,\n\t\t\t\tobservedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t\tsources: [...statuses.values()],\n\t\t\t\tcounts,\n\t\t\t\titems: attention.slice(offset, offset + limit),\n\t\t\t\ttotal: attention.length,\n\t\t\t\t...offset + limit < attention.length ? { nextOffset: offset + limit } : {}\n\t\t\t};\n\t\t},\n\t\tsnapshot: () => [...sessions.values()].map(present),\n\t\tsession: (sessionId) => {\n\t\t\tconst session = sessions.get(sessionId);\n\t\t\treturn session === void 0 ? void 0 : present(session);\n\t\t},\n\t\tsetPendingSessionSetups(sessionId, pending) {\n\t\t\tconst session = sessions.get(sessionId);\n\t\t\tif (!session || JSON.stringify(pendingSetups.get(sessionId) ?? []) === JSON.stringify(pending)) return;\n\t\t\tpendingSetups.set(sessionId, Object.freeze([...pending]));\n\t\t\temit({\n\t\t\t\tkind: \"upsert\",\n\t\t\t\tsession: present(session)\n\t\t\t});\n\t\t},\n\t\tsetSessionActivity(sessionId, activity) {\n\t\t\tconst session = sessions.get(sessionId);\n\t\t\tif (session === void 0) return;\n\t\t\tconst next = activity === void 0 ? void 0 : Object.freeze({\n\t\t\t\tlabel: activity.label.slice(0, MAX_ACTIVITY_LABEL),\n\t\t\t\t...activity.attention === true ? { attention: true } : {},\n\t\t\t\t...activity.since === void 0 ? {} : { since: activity.since }\n\t\t\t});\n\t\t\tif (JSON.stringify(activities.get(sessionId)) === JSON.stringify(next)) return;\n\t\t\tif (next === void 0) activities.delete(sessionId);\n\t\t\telse activities.set(sessionId, next);\n\t\t\temit({\n\t\t\t\tkind: \"upsert\",\n\t\t\t\tsession: present(session)\n\t\t\t});\n\t\t},\n\t\truntime: (sessionId) => sessions.get(sessionId)?.host.runtime,\n\t\tsessionAvatar(sessionId) {\n\t\t\tconst match = ICON_DATA_URL.exec(avatarIcons.get(sessionId) ?? \"\");\n\t\t\tconst mimeType = match?.[1];\n\t\t\tif (match === null || !PROFILE_ICON_MIME_TYPES.includes(mimeType ?? \"\")) return void 0;\n\t\t\treturn {\n\t\t\t\tmimeType,\n\t\t\t\tbytes: Buffer.from(match[2], \"base64\")\n\t\t\t};\n\t\t},\n\t\tonEvent(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => listeners.delete(listener);\n\t\t},\n\t\tregister,\n\t\tnotifySessionRemoved(sessionId) {\n\t\t\temit({\n\t\t\t\tkind: \"removed\",\n\t\t\t\tsessionId\n\t\t\t});\n\t\t},\n\t\tnotifyDormantChanged(sessionId) {\n\t\t\temit({\n\t\t\t\tkind: \"dormant_changed\",\n\t\t\t\tsessionId\n\t\t\t});\n\t\t},\n\t\tserveScope,\n\t\tinstallPackages,\n\t\tsessionParentScope: (workspaceId) => {\n\t\t\tif (closed) return Promise.reject(/* @__PURE__ */ new Error(\"The headless hub is closed.\"));\n\t\t\treturn workspaceId === void 0 ? openGlobalScope() : openWorkspaceScope(workspaceId);\n\t\t},\n\t\tworkspaces: () => [...workspaces.values()],\n\t\tregisterWorkspace(workspace) {\n\t\t\tworkspaces.set(workspace.id, workspace);\n\t\t\temit({\n\t\t\t\tkind: \"workspace_upsert\",\n\t\t\t\tworkspace\n\t\t\t});\n\t\t},\n\t\tadmitWorkspace: async (request) => {\n\t\t\tif (!options.admitWorkspace) throw new Error(\"Workspace admission is unavailable.\");\n\t\t\treturn options.admitWorkspace(request);\n\t\t},\n\t\tasync removeWorkspace(id) {\n\t\t\tif ([...sessions.values()].some((session) => session.workspaceId === id)) throw new Error(\"Workspace still has live sessions.\");\n\t\t\tconst key = mountKey({\n\t\t\t\tscope: \"workspace\",\n\t\t\t\tworkspaceId: id\n\t\t\t});\n\t\t\tconst served = scopeHosts.get(key);\n\t\t\tscopeHosts.delete(key);\n\t\t\tconst scope = workspaceScopes.get(id);\n\t\t\tworkspaceScopes.delete(id);\n\t\t\tif (workspaces.has(id)) {\n\t\t\t\toptions.onWorkspaceRemoved?.(id);\n\t\t\t\tworkspaces.delete(id);\n\t\t\t\temit({\n\t\t\t\t\tkind: \"workspace_removed\",\n\t\t\t\t\tworkspaceId: id\n\t\t\t\t});\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait (await scope)?.dispose();\n\t\t\t} finally {\n\t\t\t\tserved?.host.dispose();\n\t\t\t}\n\t\t},\n\t\tasync unloadWorkspaceScope(id) {\n\t\t\tconst key = mountKey({\n\t\t\t\tscope: \"workspace\",\n\t\t\t\tworkspaceId: id\n\t\t\t});\n\t\t\tconst served = scopeHosts.get(key);\n\t\t\tscopeHosts.delete(key);\n\t\t\tconst scope = workspaceScopes.get(id);\n\t\t\tworkspaceScopes.delete(id);\n\t\t\ttry {\n\t\t\t\tawait (await scope)?.dispose();\n\t\t\t} finally {\n\t\t\t\tserved?.host.dispose();\n\t\t\t}\n\t\t},\n\t\tasync requestApi(mount, basePath, request) {\n\t\t\tif (closed) return Response.json({ error: \"Server is closed.\" }, { status: 503 });\n\t\t\tif (mount.scope === \"session\") {\n\t\t\t\tconst session = sessions.get(mount.sessionId);\n\t\t\t\tif (!session || !options.requestSessionApi) return Response.json({ error: \"Session not found.\" }, { status: 404 });\n\t\t\t\tconst url = new URL(request.url);\n\t\t\t\treturn options.requestSessionApi(scopeOf(session), {\n\t\t\t\t\tbasePath,\n\t\t\t\t\tpath: `${url.pathname}${url.search}`,\n\t\t\t\t\tmethod: request.method,\n\t\t\t\t\theaders: request.headers,\n\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\tbody: request.body === null ? void 0 : new Uint8Array(await request.arrayBuffer())\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst handler = scopeHosts.get(mountKey(mount))?.scope.apiHandler(basePath) ?? (mount.scope === \"workspace\" && !scopeHosts.has(mountKey(mount)) ? options.unservedWorkspaceApi?.(mount.workspaceId, basePath) : void 0);\n\t\t\tif (!handler) return Response.json({ error: `API '${basePath}' is not mounted in ${mountKey(mount)}.` }, { status: 404 });\n\t\t\treturn handler.fetch(request);\n\t\t},\n\t\tpublicApi(basePath) {\n\t\t\tconst served = closed ? void 0 : scopeHosts.get(mountKey({ scope: \"global\" }));\n\t\t\tconst routes = served?.host.publicRoutesFor(basePath);\n\t\t\tconst handler = served?.host.handlerFor(basePath);\n\t\t\treturn routes === void 0 || handler === void 0 ? void 0 : {\n\t\t\t\troutes,\n\t\t\t\thandler\n\t\t\t};\n\t\t},\n\t\tpluginRegistry,\n\t\teditPresence,\n\t\tinvokePlugin: (call, direction, caller) => pluginRegistry.invoke(call, direction, caller),\n\t\tasync create(sessionOptions) {\n\t\t\tconst id = sessionOptions.sessionId;\n\t\t\tif (closed) throw new Error(\"The headless hub is closed.\");\n\t\t\tif (sessions.has(id)) throw new Error(`Session '${id}' is already registered.`);\n\t\t\tif (sessionShutdowns.get(id)?.pending) throw new Error(`Session '${id}' is still shutting down.`);\n\t\t\tconst host = await options.manager.create(sessionOptions);\n\t\t\tconst settledAt = await lastSettledAt(host);\n\t\t\tconst groups = await storedGroups(host, options.onNotice);\n\t\t\tconst session = {\n\t\t\t\tid: sessionOptions.sessionId,\n\t\t\t\tworkspaceId: sessionOptions.workspaceId,\n\t\t\t\twebComposition: sessionOptions.webComposition,\n\t\t\t\tnativeComposition: sessionOptions.nativeComposition,\n\t\t\t\tname: sessionOptions.sessionName,\n\t\t\t\tcwd: sessionOptions.cwd,\n\t\t\t\tcreatedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t\t...sessionOptions.parentSessionId === void 0 ? {} : { parentSessionId: sessionOptions.parentSessionId },\n\t\t\t\t...sessionOptions.sessionProvenance === void 0 ? {} : { sessionProvenance: sessionOptions.sessionProvenance },\n\t\t\t\tenvironment: sessionOptions.environment,\n\t\t\t\t...settledAt === void 0 ? {} : {\n\t\t\t\t\teverPrompted: true,\n\t\t\t\t\tlastSettledAt: settledAt\n\t\t\t\t},\n\t\t\t\tgroups,\n\t\t\t\thost\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tregister(session);\n\t\t\t} catch (error) {\n\t\t\t\tif (sessions.get(id)?.host === host) try {\n\t\t\t\t\tunregisterSession(id);\n\t\t\t\t} catch (cleanupError) {\n\t\t\t\t\toptions.onNotice?.(`Session '${id}' registration rollback failed: ${String(cleanupError)}`);\n\t\t\t\t}\n\t\t\t\tawait Promise.resolve(options.manager.closeSession(id)).catch((closeError) => options.onNotice?.(`Session '${id}' could not be closed after a failed registration: ${String(closeError)}`));\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\treturn session;\n\t\t},\n\t\tcloseSession,\n\t\tasync requestSessionApi(scope, request) {\n\t\t\tif (closed || !sessions.has(scope.sessionId)) return Response.json({ error: \"Session not found.\" }, { status: 404 });\n\t\t\tif (options.requestSessionApi === void 0) return Response.json({ error: \"Session API unavailable.\" }, { status: 404 });\n\t\t\treturn options.requestSessionApi(scope, request);\n\t\t},\n\t\tregisterChannel(channel, mount = { scope: \"global\" }) {\n\t\t\tconst started = startChannel(channel, mount);\n\t\t\tif (started === void 0) return () => void 0;\n\t\t\treturn () => releaseChannel(channel, started);\n\t\t},\n\t\tchannelTypes: () => [...new Set([...channels.values()].map(({ channel }) => channel.frameType))],\n\t\tchannelFrames(sessionId) {\n\t\t\tconst session = sessions.get(sessionId);\n\t\t\tif (session === void 0) return [];\n\t\t\tconst scope = scopeOf(session);\n\t\t\tconst frames = [];\n\t\t\tfor (const { channel, source } of selectedChannels(session)) {\n\t\t\t\tconst type = channel.frameType;\n\t\t\t\tconst payload = source.payloadFor(scope);\n\t\t\t\tif (payload !== void 0) frames.push({\n\t\t\t\t\ttype,\n\t\t\t\t\tsessionId,\n\t\t\t\t\tpayload\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn frames;\n\t\t},\n\t\tchildThread: (sessionId, threadId) => sessions.get(sessionId)?.host.childThread?.(threadId),\n\t\treceiveChannel(sessionId, frameType, payload, connectionId, desktopAuthorized = false, computerUseAuthorized = false) {\n\t\t\tif (connectionId === \"\") return;\n\t\t\tconst session = sessions.get(sessionId);\n\t\t\tconst started = session && selectedChannels(session).find(({ channel }) => channel.frameType === frameType);\n\t\t\tif (session === void 0 || started === void 0) return;\n\t\t\tstarted.channel.receive?.(scopeOf(session), payload, {\n\t\t\t\tconnectionId,\n\t\t\t\t...desktopAuthorized ? { desktopAuthorized: true } : {},\n\t\t\t\t...computerUseAuthorized ? { computerUseAuthorized: true } : {}\n\t\t\t});\n\t\t},\n\t\tdisconnectChannels(connectionId) {\n\t\t\tif (connectionId === \"\") return;\n\t\t\tfor (const { channel } of channels.values()) channel.disconnected?.({ connectionId });\n\t\t},\n\t\tasync close() {\n\t\t\tif (closed) return;\n\t\t\tconst ids = [...sessions.keys()];\n\t\t\tclosed = true;\n\t\t\tdirectEvents.close();\n\t\t\tfor (const unsubscribe of subscriptions) unsubscribe();\n\t\t\tsubscriptions.clear();\n\t\t\tfor (const cleanup of presentationCleanups.values()) cleanup();\n\t\t\tpresentationCleanups.clear();\n\t\t\tconst failures = [];\n\t\t\tpluginRegistry.dispose();\n\t\t\teditPresence.clear();\n\t\t\tworkspaces.clear();\n\t\t\tfor (const { source } of channels.values()) source.close();\n\t\t\tchannels.clear();\n\t\t\tlisteners.clear();\n\t\t\tconst shutdowns = [...sessionShutdowns.values()].filter(({ pending }) => pending).map(({ promise }) => promise);\n\t\t\tfor (const id of ids) {\n\t\t\t\tconst session = sessions.get(id);\n\t\t\t\tif (session !== void 0 && !sessionShutdowns.has(id)) shutdowns.push(startSessionShutdown(session));\n\t\t\t}\n\t\t\tsessions.clear();\n\t\t\tconst outcomes = await Promise.allSettled(shutdowns);\n\t\t\tfor (const outcome of outcomes) if (outcome.status === \"rejected\") failures.push(outcome.reason);\n\t\t\ttry {\n\t\t\t\tawait (await globalScope)?.dispose();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\tfor (const { host } of scopeHosts.values()) try {\n\t\t\t\thost.dispose();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\tscopeHosts.clear();\n\t\t\tworkspaceScopes.clear();\n\t\t\tif (failures.length) throw new AggregateError(failures, \"Mount shutdown failed\");\n\t\t}\n\t};\n}\n//#endregion\nexport { createHeadlessHub };\n\n//# sourceMappingURL=headlessHub.mjs.map","//#region src/server/harnessErrorMessage.ts\nfunction harnessErrorMessage(error, seen = /* @__PURE__ */ new Set()) {\n\tif (typeof error === \"string\") return error;\n\tif (!(error instanceof Error)) return \"Direct harness operation failed\";\n\tif (seen.has(error)) return \"[repeated error]\";\n\tseen.add(error);\n\tconst details = [...error.cause === void 0 ? [] : [harnessErrorMessage(error.cause, seen)], ...error instanceof AggregateError ? error.errors.map((failure) => harnessErrorMessage(failure, seen)) : []];\n\treturn [error.message, ...details].filter(Boolean).join(\": \");\n}\n//#endregion\nexport { harnessErrorMessage };\n\n//# sourceMappingURL=harnessErrorMessage.mjs.map","import { createPoTelemetry } from \"./src/services/poTelemetry/index.mjs\";\n//#region src/services/serverTelemetry/index.ts\nconst SERVICE_NAME = \"po-server\";\nconst PACKAGE_NAME = \"@agimon-ai/po\";\nfunction createServerTelemetry(options = {}) {\n\treturn createPoTelemetry({\n\t\tserviceName: SERVICE_NAME,\n\t\tpackageName: PACKAGE_NAME,\n\t\tcwd: options.cwd,\n\t\tenv: options.env,\n\t\twarn: options.warn,\n\t\tenableLogs: true,\n\t\tenableTraces: true\n\t});\n}\n/** Telemetry is diagnostic and must never interrupt the server's critical path. */\nfunction observe(operation, onNotice) {\n\toperation.catch((error) => onNotice?.(`telemetry failed: ${error instanceof Error ? error.message : String(error)}`));\n}\n//#endregion\nexport { createServerTelemetry, observe };\n\n//# sourceMappingURL=serverTelemetry.mjs.map","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { DatabaseSync } from \"node:sqlite\";\n//#region src/services/sessionMcpActivity/index.ts\nconst PREVIEW_LIMIT = 16384;\nconst PAGE_SIZE = 50;\nconst SECRET_KEY = /password|passphrase|secret|token|authorization|cookie|credential|api[-_]?key|private[-_]?key/iu;\n/** Bounded text previews only. Do not persist binary MCP content or authentication material. */\nfunction sessionMcpPreview(value) {\n\tlet remaining = PREVIEW_LIMIT;\n\tconst seen = /* @__PURE__ */ new WeakSet();\n\tconst clean = (item, depth) => {\n\t\tif (remaining <= 0 || depth > 12) return \"[truncated]\";\n\t\tif (typeof item === \"string\") {\n\t\t\tconst text = item.replace(/Bearer\\s+[^\\s\"']+/giu, \"Bearer [redacted]\").replace(/\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\b/gu, \"[redacted]\").replace(/([?&](?:token|api_key|key|secret|password)=)[^&#\\s\"']*/giu, \"$1[redacted]\").replace(/(https?:\\/\\/)[^\\s/@]+:[^\\s/@]+@/giu, \"$1[redacted]@\");\n\t\t\tconst bounded = text.slice(0, remaining);\n\t\t\tremaining -= bounded.length;\n\t\t\treturn bounded.length < text.length ? `${bounded}\\n[truncated]` : bounded;\n\t\t}\n\t\tif (item === null || typeof item !== \"object\") return item;\n\t\tif (seen.has(item)) return \"[circular]\";\n\t\tseen.add(item);\n\t\tif (Array.isArray(item)) return item.slice(0, 100).map((entry) => clean(entry, depth + 1));\n\t\treturn Object.fromEntries(Object.entries(item).slice(0, 100).map(([key, entry]) => [key, SECRET_KEY.test(key) ? \"[redacted]\" : key === \"data\" && typeof entry === \"string\" ? \"[binary omitted]\" : clean(entry, depth + 1)]));\n\t};\n\ttry {\n\t\tconst text = JSON.stringify(clean(value, 0), null, 2) ?? \"\";\n\t\treturn text.length > PREVIEW_LIMIT ? `${text.slice(0, PREVIEW_LIMIT)}\\n[truncated]` : text;\n\t} catch {\n\t\treturn \"[preview unavailable]\";\n\t}\n}\n/** One process owns this private ledger. Pagination never drops older tool calls. */\nfunction createSessionMcpActivityStore(stateDir) {\n\tfs.mkdirSync(stateDir, {\n\t\trecursive: true,\n\t\tmode: 448\n\t});\n\tconst file = path.join(stateDir, \"session-mcp-activity.sqlite\");\n\tfs.closeSync(fs.openSync(file, \"a\", 384));\n\tconst database = new DatabaseSync(file);\n\tdatabase.exec(`\n    PRAGMA journal_mode = WAL;\n    PRAGMA busy_timeout = 5000;\n    CREATE TABLE IF NOT EXISTS calls (\n      sequence INTEGER PRIMARY KEY AUTOINCREMENT,\n      id TEXT NOT NULL UNIQUE,\n      workspace_id TEXT NOT NULL,\n      session_id TEXT NOT NULL,\n      record TEXT NOT NULL\n    );\n    CREATE INDEX IF NOT EXISTS calls_session ON calls(workspace_id, session_id, sequence);\n  `);\n\tconst unfinished = database.prepare(\"SELECT id, record FROM calls WHERE json_extract(record, '$.status') = 'running'\").all();\n\tconst update = database.prepare(\"UPDATE calls SET record = ? WHERE id = ?\");\n\tfor (const row of unfinished) {\n\t\tconst record = JSON.parse(String(row.record));\n\t\tupdate.run(JSON.stringify({\n\t\t\t...record,\n\t\t\tstatus: \"interrupted\",\n\t\t\tfinishedAt: Date.now()\n\t\t}), String(row.id));\n\t}\n\tlet failure;\n\tconst save = database.prepare(`\n    INSERT INTO calls (id, workspace_id, session_id, record) VALUES (?, ?, ?, ?)\n    ON CONFLICT(id) DO UPDATE SET workspace_id = excluded.workspace_id, session_id = excluded.session_id, record = excluded.record\n  `);\n\treturn {\n\t\trecord(workspaceId, sessionId, clientName, invocation) {\n\t\t\ttry {\n\t\t\t\tconst record = {\n\t\t\t\t\tid: invocation.id,\n\t\t\t\t\ttoolName: invocation.toolName,\n\t\t\t\t\tclientName,\n\t\t\t\t\tstartedAt: invocation.startedAt,\n\t\t\t\t\tfinishedAt: invocation.finishedAt,\n\t\t\t\t\tstatus: invocation.status,\n\t\t\t\t\tinput: sessionMcpPreview(invocation.input),\n\t\t\t\t\t...invocation.output === void 0 ? {} : { output: sessionMcpPreview(invocation.output) }\n\t\t\t\t};\n\t\t\t\tsave.run(invocation.id, workspaceId, sessionId, JSON.stringify(record));\n\t\t\t} catch (error) {\n\t\t\t\tfailure = new Error(\"MCP call history could not be saved. Check the host storage.\", { cause: error });\n\t\t\t\tthrow failure;\n\t\t\t}\n\t\t},\n\t\tread(workspaceId, sessionId, before) {\n\t\t\tif (failure) throw failure;\n\t\t\tconst rows = database.prepare(`SELECT sequence, record FROM calls\n        WHERE workspace_id = ? AND session_id = ? AND sequence < ? ORDER BY sequence DESC LIMIT ?`).all(workspaceId, sessionId, before ?? Number.MAX_SAFE_INTEGER, 51);\n\t\t\tconst calls = rows.slice(0, PAGE_SIZE).map((row) => ({\n\t\t\t\t...JSON.parse(String(row.record)),\n\t\t\t\tsequence: Number(row.sequence)\n\t\t\t}));\n\t\t\tconst count = database.prepare(\"SELECT COUNT(*) AS total FROM calls WHERE workspace_id = ? AND session_id = ?\").get(workspaceId, sessionId);\n\t\t\treturn {\n\t\t\t\tcalls,\n\t\t\t\ttotal: Number(count?.total ?? 0),\n\t\t\t\t...rows.length > PAGE_SIZE ? { nextBefore: calls.at(-1).sequence } : {}\n\t\t\t};\n\t\t},\n\t\tclose() {\n\t\t\tdatabase.close();\n\t\t}\n\t};\n}\n//#endregion\nexport { createSessionMcpActivityStore, sessionMcpPreview };\n\n//# sourceMappingURL=index.mjs.map","import { createHash, randomUUID } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/services/sessionMcpConversations/index.ts\nconst STORE_FILE = \"session-mcp-conversations.json\";\nconst STORE_VERSION = 1;\nconst MAX_BINDINGS = 1e3;\nconst MAX_CONVERSATION_BYTES = 1024;\nconst CONVERSATION_META_KEY = \"openai/session\";\nconst ID_PATTERN = /^[A-Za-z0-9_-]+$/u;\nconst DIGEST_PATTERN = /^[a-f0-9]{64}$/u;\n/** Client metadata is a routing hint within an authenticated registration, never authority. */\nfunction sessionMcpConversationDigest(meta) {\n\tif (typeof meta !== \"object\" || meta === null || Array.isArray(meta)) return void 0;\n\tconst value = meta[CONVERSATION_META_KEY];\n\tif (typeof value !== \"string\" || value.trim() !== value || value.length === 0 || Array.from(value).some((character) => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127) || Buffer.byteLength(value, \"utf8\") > MAX_CONVERSATION_BYTES) return void 0;\n\treturn createHash(\"sha256\").update(JSON.stringify([\"chatgpt\", value])).digest(\"hex\");\n}\nvar SessionMcpConversationError = class extends Error {\n\tcode;\n\tbindingId;\n\tconstructor(code, message, bindingId) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.bindingId = bindingId;\n\t\tthis.name = \"SessionMcpConversationError\";\n\t}\n};\n/** How many id characters name a conversation's managed worktree branch and directory. */\nconst MANAGED_WORKTREE_ID_LENGTH = 12;\nfunction validRecord(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst record = value;\n\treturn typeof record.id === \"string\" && ID_PATTERN.test(record.id) && typeof record.clientId === \"string\" && ID_PATTERN.test(record.clientId) && typeof record.parentSessionId === \"string\" && ID_PATTERN.test(record.parentSessionId) && typeof record.parentWorkspaceId === \"string\" && record.parentWorkspaceId.length > 0 && typeof record.conversationDigest === \"string\" && DIGEST_PATTERN.test(record.conversationDigest) && typeof record.createdAt === \"string\" && Number.isFinite(Date.parse(record.createdAt)) && (record.state === \"pending\" || record.state === \"bound\" || record.state === \"closed\") && (record.setupKind === void 0 || record.setupKind === \"managed-worktree\" || record.setupKind === \"existing-directory\") && (record.failureCode === void 0 || record.failureCode === \"SESSION_WORKTREE_PROVISION_FAILED\" || record.failureCode === \"SESSION_UNAVAILABLE\") && (record.cwd === void 0 || typeof record.cwd === \"string\" && path.isAbsolute(record.cwd) && !record.cwd.includes(\"\\0\")) && (record.workspaceId === void 0 || typeof record.workspaceId === \"string\" && record.workspaceId.length > 0) && (record.state !== \"bound\" || record.cwd !== void 0 && record.workspaceId !== void 0);\n}\n/**\n* Records written before setups carried a provider have none, and recovery refuses a setup it\n* cannot attribute, which left every such conversation stuck. A managed conversation worktree is\n* the only setup named `po-conversation-<first 12 id characters>--`, so a record reserving\n* that directory can be attributed to it. Anything else stays unattributed and refused.\n*/\nfunction withLegacySetupKind(record) {\n\tif (record.setupKind !== void 0 || record.cwd === void 0) return record;\n\tconst managedName = `po-conversation-${record.id.slice(0, MANAGED_WORKTREE_ID_LENGTH)}--`;\n\treturn path.basename(record.cwd).startsWith(managedName) ? {\n\t\t...record,\n\t\tsetupKind: \"managed-worktree\"\n\t} : record;\n}\nfunction routingKey(record) {\n\treturn JSON.stringify([\n\t\trecord.clientId,\n\t\trecord.parentSessionId,\n\t\trecord.conversationDigest\n\t]);\n}\n/** One owning headless host persists these bindings. Corruption never becomes an empty, reusable store. */\nfunction createSessionMcpConversationStore(stateDir) {\n\tconst file = path.join(stateDir, STORE_FILE);\n\tlet failure;\n\tlet current = load();\n\tfunction load() {\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(fs.readFileSync(file, \"utf8\"));\n\t\t\tif (typeof parsed !== \"object\" || parsed === null) throw new Error(\"Invalid store\");\n\t\t\tconst stored = parsed;\n\t\t\tif (stored.version !== STORE_VERSION || !Array.isArray(stored.bindings) || !stored.bindings.every(validRecord)) throw new Error(\"Invalid bindings\");\n\t\t\tconst records = stored.bindings;\n\t\t\tif (records.length > MAX_BINDINGS || new Set(records.map((record) => record.id)).size !== records.length || new Set(records.map(routingKey)).size !== records.length) throw new Error(\"Duplicate or excessive bindings\");\n\t\t\treturn Object.freeze(records.map((record) => Object.freeze(withLegacySetupKind(record))));\n\t\t} catch (error) {\n\t\t\tif (error.code === \"ENOENT\") return [];\n\t\t\tfailure = new SessionMcpConversationError(\"CONVERSATION_STORE_UNAVAILABLE\", \"Conversation bindings could not be loaded. Restore the binding store before using conversation routing.\");\n\t\t\treturn [];\n\t\t}\n\t}\n\tfunction list() {\n\t\tif (failure) throw failure;\n\t\treturn current;\n\t}\n\tfunction persist(next) {\n\t\tlist();\n\t\tconst temporary = `${file}.${randomUUID()}.tmp`;\n\t\ttry {\n\t\t\tfs.mkdirSync(stateDir, {\n\t\t\t\trecursive: true,\n\t\t\t\tmode: 448\n\t\t\t});\n\t\t\tconst descriptor = fs.openSync(temporary, \"wx\", 384);\n\t\t\ttry {\n\t\t\t\tfs.writeFileSync(descriptor, `${JSON.stringify({\n\t\t\t\t\tversion: STORE_VERSION,\n\t\t\t\t\tbindings: next\n\t\t\t\t}, null, 2)}\\n`);\n\t\t\t\tfs.fsyncSync(descriptor);\n\t\t\t} finally {\n\t\t\t\tfs.closeSync(descriptor);\n\t\t\t}\n\t\t\tfs.renameSync(temporary, file);\n\t\t\tcurrent = Object.freeze(next.map((record) => Object.freeze(record)));\n\t\t} catch {\n\t\t\tthrow new SessionMcpConversationError(\"CONVERSATION_STORE_UNAVAILABLE\", \"Conversation bindings could not be saved. No new execution target was admitted.\");\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tfs.rmSync(temporary, { force: true });\n\t\t\t} catch {}\n\t\t}\n\t}\n\tfunction get(id, parentSessionId) {\n\t\tconst record = list().find((entry) => entry.id === id && entry.parentSessionId === parentSessionId);\n\t\tif (!record || record.state === \"closed\") throw new SessionMcpConversationError(\"SESSION_UNAVAILABLE\", \"This conversation binding is unavailable. It will not be recreated automatically.\");\n\t\treturn record;\n\t}\n\tfunction replace(record) {\n\t\tpersist(list().map((entry) => entry.id === record.id ? record : entry));\n\t\treturn get(record.id, record.parentSessionId);\n\t}\n\treturn {\n\t\tlist,\n\t\tget,\n\t\tfind: (clientId, parentSessionId, digest) => list().find((record) => record.clientId === clientId && record.parentSessionId === parentSessionId && record.conversationDigest === digest),\n\t\treserve(clientId, parentSessionId, parentWorkspaceId, digest) {\n\t\t\tconst existing = list().find((record) => record.clientId === clientId && record.parentSessionId === parentSessionId && record.conversationDigest === digest);\n\t\t\tif (existing) return existing;\n\t\t\tif (list().length >= MAX_BINDINGS) throw new SessionMcpConversationError(\"CONVERSATION_LIMIT_REACHED\", \"The conversation binding limit has been reached. Use a dedicated session connection.\");\n\t\t\tconst record = {\n\t\t\t\tid: randomUUID(),\n\t\t\t\tclientId,\n\t\t\t\tparentSessionId,\n\t\t\t\tparentWorkspaceId,\n\t\t\t\tconversationDigest: digest,\n\t\t\t\tcreatedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\t\tstate: \"pending\"\n\t\t\t};\n\t\t\tif (!validRecord(record)) throw new SessionMcpConversationError(\"INVALID_CONVERSATION\", \"Invalid conversation identity.\");\n\t\t\tpersist([...list(), record]);\n\t\t\treturn get(record.id, parentSessionId);\n\t\t},\n\t\tselectSetup(id, parentSessionId, kind) {\n\t\t\tconst record = get(id, parentSessionId);\n\t\t\tif (record.setupKind === kind) return record.failureCode === void 0 ? record : replace({\n\t\t\t\t...record,\n\t\t\t\tfailureCode: void 0\n\t\t\t});\n\t\t\tif (record.setupKind !== void 0 && (record.cwd !== void 0 || record.state === \"bound\")) throw new SessionMcpConversationError(\"SESSION_TARGET_FIXED\", \"An initialized setup cannot change its provider.\", id);\n\t\t\tif (record.setupKind === void 0 && record.cwd !== void 0) throw new SessionMcpConversationError(\"SESSION_TARGET_FIXED\", \"This existing setup has no verified provider. Recover it without changing its ownership.\", id);\n\t\t\treturn replace({\n\t\t\t\t...record,\n\t\t\t\tsetupKind: kind,\n\t\t\t\tfailureCode: void 0\n\t\t\t});\n\t\t},\n\t\tprepare(id, parentSessionId, cwd) {\n\t\t\tconst record = get(id, parentSessionId);\n\t\t\tif (!path.isAbsolute(cwd) || cwd.includes(\"\\0\")) throw new Error(\"A canonical absolute execution directory is required.\");\n\t\t\tif (record.cwd !== void 0 && record.cwd !== cwd) throw new SessionMcpConversationError(\"SESSION_TARGET_FIXED\", \"This conversation already reserved a different execution directory. Recover that setup instead.\", id);\n\t\t\tif (record.cwd === cwd) return record;\n\t\t\treturn replace({\n\t\t\t\t...record,\n\t\t\t\tcwd\n\t\t\t});\n\t\t},\n\t\tfail(id, parentSessionId, code) {\n\t\t\tconst record = get(id, parentSessionId);\n\t\t\tif (record.state !== \"pending\" || record.failureCode === code) return record;\n\t\t\treturn replace({\n\t\t\t\t...record,\n\t\t\t\tfailureCode: code\n\t\t\t});\n\t\t},\n\t\tbind(id, parentSessionId, workspaceId) {\n\t\t\tconst record = get(id, parentSessionId);\n\t\t\tif (!record.cwd || !workspaceId) throw new Error(\"A prepared directory and admitted workspace are required.\");\n\t\t\tif (record.state === \"bound\") {\n\t\t\t\tif (record.workspaceId !== workspaceId) throw new Error(\"The bound workspace cannot change.\");\n\t\t\t\treturn record;\n\t\t\t}\n\t\t\treturn replace({\n\t\t\t\t...record,\n\t\t\t\tstate: \"bound\",\n\t\t\t\tworkspaceId,\n\t\t\t\tfailureCode: void 0\n\t\t\t});\n\t\t},\n\t\trecover(id, parentSessionId) {\n\t\t\tconst record = list().find((entry) => entry.id === id && entry.parentSessionId === parentSessionId);\n\t\t\tif (!record) throw new SessionMcpConversationError(\"SESSION_UNAVAILABLE\", \"This conversation binding is unavailable.\");\n\t\t\treturn replace({\n\t\t\t\t...record,\n\t\t\t\tstate: \"pending\"\n\t\t\t});\n\t\t},\n\t\tcloseSession(sessionId) {\n\t\t\tconst next = list().map((record) => record.id === sessionId || record.parentSessionId === sessionId ? {\n\t\t\t\t...record,\n\t\t\t\tstate: \"closed\"\n\t\t\t} : record);\n\t\t\tif (next.some((record, index) => record !== current[index])) persist(next);\n\t\t},\n\t\tcloseClient(clientId) {\n\t\t\tconst next = list().map((record) => record.clientId === clientId ? {\n\t\t\t\t...record,\n\t\t\t\tstate: \"closed\"\n\t\t\t} : record);\n\t\t\tif (next.some((record, index) => record !== current[index])) persist(next);\n\t\t}\n\t};\n}\n//#endregion\nexport { SessionMcpConversationError, createSessionMcpConversationStore, sessionMcpConversationDigest };\n\n//# sourceMappingURL=index.mjs.map","import fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/services/sessionMcpRegistrationStore/index.ts\nconst DIRECTORY_MODE = 448;\nconst FILE_MODE = 384;\nconst LOOSE_MODE_MASK = 63;\nconst STORE_VERSION = 1;\nconst STORE_FILE = \"session-mcp-registrations.json\";\nfunction validRegistration(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst registration = value;\n\tconst client = registration.client;\n\tconst binding = registration.binding;\n\tconst storedRouting = binding?.routing;\n\treturn typeof registration.verifiedAt === \"number\" && Number.isSafeInteger(registration.verifiedAt) && typeof registration.workspaceId === \"string\" && registration.workspaceId.trim() !== \"\" && typeof registration.secretHash === \"string\" && /^[a-f0-9]{64}$/u.test(registration.secretHash) && typeof client === \"object\" && client !== null && typeof client.clientId === \"string\" && typeof client.name === \"string\" && typeof client.redirectUri === \"string\" && (client.tokenEndpointAuthMethod === \"client_secret_post\" || (client.tokenEndpointAuthMethod === \"api_key\" || client.tokenEndpointAuthMethod === \"url_token\") && client.redirectUri === \"\" && binding?.scope === \"session\") && typeof client.createdAt === \"number\" && typeof binding === \"object\" && binding !== null && typeof binding.clientId === \"string\" && typeof binding.sessionId === \"string\" && typeof binding.audience === \"string\" && (binding.scope === \"session\" || binding.scope === \"restricted\") && (storedRouting === void 0 || storedRouting === \"session\" || storedRouting === \"conversation\") && Array.isArray(binding.tools) && binding.tools.every((name) => typeof name === \"string\") && Array.isArray(binding.skills) && binding.skills.every((name) => typeof name === \"string\") && (binding.toolPrefix === void 0 || typeof binding.toolPrefix === \"string\");\n}\n/** Private, machine-local records for host-approved Session MCP credentials. */\nfunction createSessionMcpRegistrationStore(options) {\n\tconst notice = options.onNotice ?? (() => {});\n\tconst storePath = path.join(options.stateDir, STORE_FILE);\n\tlet current = load();\n\tfunction load() {\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = fs.readFileSync(storePath, \"utf8\");\n\t\t\tif ((fs.statSync(storePath).mode & LOOSE_MODE_MASK) !== 0) fs.chmodSync(storePath, FILE_MODE);\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\ttry {\n\t\t\tconst parsed = JSON.parse(raw);\n\t\t\tif (typeof parsed !== \"object\" || parsed === null || parsed.version !== STORE_VERSION || !Array.isArray(parsed.registrations) || !parsed.registrations.every(validRegistration)) {\n\t\t\t\tnotice(`session MCP registrations at ${storePath} are invalid; none will load`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn [...parsed.registrations];\n\t\t} catch {\n\t\t\tnotice(`session MCP registrations at ${storePath} are not valid JSON; none will load`);\n\t\t\treturn [];\n\t\t}\n\t}\n\tfunction write(next) {\n\t\tconst temporary = `${storePath}.${String(process.pid)}.tmp`;\n\t\ttry {\n\t\t\tfs.mkdirSync(options.stateDir, {\n\t\t\t\trecursive: true,\n\t\t\t\tmode: DIRECTORY_MODE\n\t\t\t});\n\t\t\tfs.writeFileSync(temporary, `${JSON.stringify({\n\t\t\t\tversion: STORE_VERSION,\n\t\t\t\tregistrations: next\n\t\t\t}, void 0, 2)}\\n`, { mode: FILE_MODE });\n\t\t\tfs.renameSync(temporary, storePath);\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tnotice(`session MCP registrations at ${storePath} could not be saved: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\ttry {\n\t\t\t\tfs.rmSync(temporary, { force: true });\n\t\t\t} catch {}\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn {\n\t\tregistrations: () => current,\n\t\tsave(registration) {\n\t\t\tconst next = [...current.filter((held) => held.client.clientId !== registration.client.clientId), registration];\n\t\t\tif (!write(next)) return false;\n\t\t\tcurrent = next;\n\t\t\treturn true;\n\t\t},\n\t\tremove(clientId) {\n\t\t\tconst next = current.filter((held) => held.client.clientId !== clientId);\n\t\t\tif (next.length === current.length) return true;\n\t\t\tif (!write(next)) return false;\n\t\t\tcurrent = next;\n\t\t\treturn true;\n\t\t}\n\t};\n}\n//#endregion\nexport { createSessionMcpRegistrationStore };\n\n//# sourceMappingURL=index.mjs.map","import { ChordError, createHost, isChordError, method } from \"@earendil-works/chord\";\n//#region src/schemas/protocolContracts.ts\n/** Name of the Po server host; every Po contract places its objects on it. */\nconst PO_SERVER_HOST = \"server\";\n/** Chord method specs for a schema table, typed so contracts built from them stay nameable. */\nfunction chordMethods(schemas) {\n\treturn Object.fromEntries(Object.entries(schemas).map(([name, { args, result }]) => [name, result !== void 0 ? method(args, result) : args !== void 0 ? method(args) : method()]));\n}\n/**\n* A Chord link over any ordered text transport. Feed received text to `deliver` and the\n* transport's end to `ended`.\n*/\nfunction createTextLink(port) {\n\tlet handler;\n\tlet queue = [];\n\tconst closeHandlers = /* @__PURE__ */ new Set();\n\tlet closed = false;\n\tconst ended = (reason) => {\n\t\tif (closed) return;\n\t\tclosed = true;\n\t\tqueue = [];\n\t\ttry {\n\t\t\tport.close();\n\t\t} finally {\n\t\t\tfor (const close of closeHandlers) close(reason);\n\t\t\tcloseHandlers.clear();\n\t\t}\n\t};\n\tconst link = {\n\t\tget closed() {\n\t\t\treturn closed;\n\t\t},\n\t\tsend(frame) {\n\t\t\tif (closed) return void 0;\n\t\t\tconst text = JSON.stringify(frame);\n\t\t\tport.send(text);\n\t\t\treturn text.length;\n\t\t},\n\t\treceive(next) {\n\t\t\thandler = next;\n\t\t\tfor (const frame of queue.splice(0)) next(frame);\n\t\t},\n\t\tonClose(close) {\n\t\t\tif (closed) close(\"closed\");\n\t\t\telse closeHandlers.add(close);\n\t\t},\n\t\tclose(reason = \"closed\") {\n\t\t\tif (closed) return;\n\t\t\ttry {\n\t\t\t\tport.send(JSON.stringify({\n\t\t\t\t\tt: \"bye\",\n\t\t\t\t\treason\n\t\t\t\t}));\n\t\t\t} catch {}\n\t\t\tended(reason);\n\t\t}\n\t};\n\treturn {\n\t\tlink,\n\t\tdeliver(text) {\n\t\t\tif (closed) return;\n\t\t\tlet frame;\n\t\t\ttry {\n\t\t\t\tframe = JSON.parse(text);\n\t\t\t\tif (frame === null || typeof frame !== \"object\" || typeof frame.t !== \"string\") throw new TypeError(\"not a frame\");\n\t\t\t} catch {\n\t\t\t\tlink.close(\"protocol error\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (frame.t === \"bye\") {\n\t\t\t\tended(frame.reason ?? \"peer closed\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (handler === void 0) queue.push(frame);\n\t\t\telse handler(frame);\n\t\t},\n\t\tended\n\t};\n}\n/**\n* Whether `error` means this client's code is older than the server's. Chord refuses a changed contract with\n* `contract_mismatch`, which it reports to a client as `upgrade_required`; another protocol version is reported the\n* same way by `createProtocolClient`. Retrying cannot help, only new client code can.\n*/\nfunction isUpdateRequired(error) {\n\treturn isChordError(error, \"contract_mismatch\") || isChordError(error, \"upgrade_required\");\n}\nfunction createProtocolClient(options) {\n\tconst host = createHost({\n\t\tname: options.name ?? \"client\",\n\t\tkind: \"client\",\n\t\tself: { host: true }\n\t});\n\tconst listeners = /* @__PURE__ */ new Set();\n\tlet current;\n\tlet connecting;\n\tlet disposed = false;\n\tlet updateError;\n\tconst emit = (state) => {\n\t\tfor (const listener of Array.from(listeners)) listener({ state });\n\t};\n\tconst reportError = (error) => {\n\t\tif (disposed || updateError !== void 0 || !isUpdateRequired(error)) return;\n\t\tupdateError = error;\n\t\temit(\"update_required\");\n\t\tcurrent?.close();\n\t};\n\treturn {\n\t\thost,\n\t\tget connected() {\n\t\t\treturn current !== void 0 && !current.closed;\n\t\t},\n\t\tget updateRequired() {\n\t\t\treturn updateError !== void 0;\n\t\t},\n\t\tconnect() {\n\t\t\tif (disposed) return Promise.reject(/* @__PURE__ */ new Error(\"The protocol client is disposed.\"));\n\t\t\tif (updateError !== void 0) return Promise.reject(updateError);\n\t\t\tif (current !== void 0 && !current.closed) return Promise.resolve();\n\t\t\tconnecting ??= (async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst link = await options.openLink();\n\t\t\t\t\tif (disposed) {\n\t\t\t\t\t\tlink.close();\n\t\t\t\t\t\tthrow new Error(\"The protocol client is disposed.\");\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = link;\n\t\t\t\t\tlink.onClose(() => {\n\t\t\t\t\t\tif (current !== link) return;\n\t\t\t\t\t\tcurrent = void 0;\n\t\t\t\t\t\temit(\"disconnected\");\n\t\t\t\t\t});\n\t\t\t\t\thost.connect(link, {\n\t\t\t\t\t\tprincipal: { host: PO_SERVER_HOST },\n\t\t\t\t\t\tonProtocolMismatch: ({ local, peer }) => reportError(new ChordError(\"upgrade_required\", `The Po server speaks Chord protocol ${peer}, this client speaks ${local}.`))\n\t\t\t\t\t});\n\t\t\t\t\tif (!link.closed) emit(\"connected\");\n\t\t\t\t} finally {\n\t\t\t\t\tconnecting = void 0;\n\t\t\t\t}\n\t\t\t})();\n\t\t\treturn connecting;\n\t\t},\n\t\tdisconnect() {\n\t\t\tcurrent?.close();\n\t\t},\n\t\treportError,\n\t\tdispose() {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tcurrent?.close();\n\t\t\tlisteners.clear();\n\t\t\thost.close().catch(() => void 0);\n\t\t},\n\t\tonConnectionStateChange(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => listeners.delete(listener);\n\t\t}\n\t};\n}\n//#endregion\nexport { PO_SERVER_HOST, chordMethods, createProtocolClient, createTextLink, isUpdateRequired };\n\n//# sourceMappingURL=protocolContracts.mjs.map","import { PO_SERVER_HOST, chordMethods } from \"./protocolContracts.mjs\";\nimport { Type } from \"typebox\";\nimport { hostNamed, remote } from \"@earendil-works/chord\";\n//#region src/schemas/protocolChannelsContract.ts\nconst Json = Type.Unsafe({});\nconst ChannelFrameSchema = Type.Object({\n\ttype: Type.String({ minLength: 1 }),\n\tpayload: Json\n});\n/** Latest payload per extension channel frame type. */\nconst PoChannelsStateSchema = Type.Record(Type.String(), Json);\n/** A session's extension channels as seen by one connection. */\nconst PoChannelsContract = remote(\"po.channels\", {\n\tversion: 1,\n\thost: hostNamed(PO_SERVER_HOST),\n\tinput: Type.Object({ sessionId: Type.String({ minLength: 1 }) }),\n\tvariants: { default: {\n\t\tstate: { latest: PoChannelsStateSchema },\n\t\tmethods: chordMethods({ receive: { args: ChannelFrameSchema } })\n\t} }\n});\n//#endregion\nexport { ChannelFrameSchema, PoChannelsContract, PoChannelsStateSchema };\n\n//# sourceMappingURL=protocolChannelsContract.mjs.map","import { CURRENT_ROUTE, ITEM_ROUTE } from \"../constants/contextApi.mjs\";\nimport { Type } from \"typebox\";\n//#region src/schemas/httpApiContracts.ts\nconst Text = Type.String();\nconst Optional = Type.Optional;\nconst Strings = Type.Array(Text);\nconst Flag = Type.Boolean();\nconst NumberValue = Type.Number();\nconst ApiErrorSchema = Type.Object({\n\terror: Text,\n\thash: Optional(Text)\n});\nconst ApiOkSchema = Type.Object({ ok: Type.Literal(true) });\nconst Json = Type.Unknown({ description: \"Value whose schema is supplied by the selected runtime contribution.\" });\n/** Common JSON response construction; status and payload remain explicit at the declaration. */\nfunction jsonApiResponses(schema, status = 200) {\n\treturn {\n\t\t[status]: {\n\t\t\tdescription: \"Successful response\",\n\t\t\tcontentType: \"application/json\",\n\t\t\tschema\n\t\t},\n\t\t\"400\": {\n\t\t\tdescription: \"Invalid request\",\n\t\t\tschema: ApiErrorSchema\n\t\t},\n\t\t\"401\": {\n\t\t\tdescription: \"Authentication required\",\n\t\t\tschema: ApiErrorSchema\n\t\t},\n\t\t\"403\": {\n\t\t\tdescription: \"Request is not authorized\",\n\t\t\tschema: ApiErrorSchema\n\t\t},\n\t\t\"404\": {\n\t\t\tdescription: \"Resource or capability unavailable\",\n\t\t\tschema: ApiErrorSchema\n\t\t},\n\t\t\"409\": {\n\t\t\tdescription: \"Conflicting state\",\n\t\t\tschema: ApiErrorSchema\n\t\t},\n\t\t\"422\": {\n\t\t\tdescription: \"Invalid operation\",\n\t\t\tschema: ApiErrorSchema\n\t\t},\n\t\t\"500\": {\n\t\t\tdescription: \"Host operation failed\",\n\t\t\tschema: ApiErrorSchema\n\t\t},\n\t\t\"502\": {\n\t\t\tdescription: \"Provider failed\",\n\t\t\tschema: ApiErrorSchema\n\t\t},\n\t\t\"503\": {\n\t\t\tdescription: \"Service unavailable\",\n\t\t\tschema: ApiErrorSchema\n\t\t}\n\t};\n}\nconst WebCompositionSchema = Type.Object({\n\tid: Text,\n\tscope: Type.Union([\n\t\tType.Literal(\"global\"),\n\t\tType.Literal(\"workspace\"),\n\t\tType.Literal(\"session\")\n\t]),\n\trevision: NumberValue,\n\tmanifestUrl: Text,\n\trawAssetBaseUrl: Text,\n\tverifiedAssetBaseUrl: Text,\n\tpluginEntries: Type.Array(Type.Tuple([Text, Text])),\n\tassetPaths: Strings,\n\tstylePaths: Strings,\n\tchannels: Strings\n});\nconst NativeCompositionSchema = Type.Object({\n\tid: Text,\n\tscope: Type.Union([\n\t\tType.Literal(\"global\"),\n\t\tType.Literal(\"workspace\"),\n\t\tType.Literal(\"session\")\n\t]),\n\trevision: NumberValue,\n\tmanifestUrl: Text,\n\trawAssetBaseUrl: Text,\n\tentryPath: Text,\n\tchannels: Strings,\n\tplugins: Strings\n});\n/** One platform's signed over-the-air app bundle; `fingerprint` names the binaries it runs on. */\nconst NativeAppSchema = Type.Object({\n\tid: Text,\n\trevision: NumberValue,\n\tmanifestUrl: Text,\n\trawAssetBaseUrl: Text,\n\tfingerprint: Text,\n\tbuiltAt: Optional(NumberValue)\n});\n/** A configured template id and the mount whose compositions offer it. */\nconst TemplateDecisionSchema = Type.Object({\n\tid: Optional(Text),\n\tmount: Type.Union([Type.Object({ scope: Type.Literal(\"global\") }), Type.Object({\n\t\tscope: Type.Literal(\"workspace\"),\n\t\tworkspaceId: Text\n\t})])\n});\nconst SessionSummarySchema = Type.Object({\n\tid: Text,\n\tworkspaceId: Optional(Text),\n\twebComposition: Optional(WebCompositionSchema),\n\tnativeComposition: Optional(NativeCompositionSchema),\n\tname: Text,\n\tcwd: Text,\n\tcreatedAt: Text,\n\tupdatedAt: Text,\n\tphase: Type.Union([\n\t\tType.Literal(\"idle\"),\n\t\tType.Literal(\"turn\"),\n\t\tType.Literal(\"compaction\"),\n\t\tType.Literal(\"retry\")\n\t]),\n\tphaseSince: Text,\n\tattach: Type.Literal(\"attached\"),\n\tpendingMessageCount: NumberValue,\n\teverPrompted: Flag,\n\tawaitingInput: Flag,\n\tlastSettledAt: Optional(Text),\n\tgit: Optional(Type.Object({\n\t\tbranch: Text,\n\t\tdirty: Flag\n\t})),\n\tprofile: Optional(Type.Object({\n\t\tname: Text,\n\t\tdisplayName: Optional(Text),\n\t\ticonVersion: Optional(Text)\n\t})),\n\tparentSessionId: Optional(Text),\n\tsessionProvenance: Optional(Text),\n\t/** The line the session's extension published about background work it runs. */\n\tactivity: Optional(Type.Object({\n\t\tlabel: Text,\n\t\tattention: Optional(Flag),\n\t\tsince: Optional(Text)\n\t})),\n\tpendingSetups: Optional(Type.Array(Type.Object({\n\t\tid: Text,\n\t\tname: Text,\n\t\tcreatedAt: Text,\n\t\tcwd: Optional(Text),\n\t\tsetupKind: Optional(Type.Union([Type.Literal(\"managed-worktree\"), Type.Literal(\"existing-directory\")])),\n\t\tstatus: Optional(Type.Union([\n\t\t\tType.Literal(\"provisioning\"),\n\t\t\tType.Literal(\"failed\"),\n\t\t\tType.Literal(\"interrupted\")\n\t\t])),\n\t\terrorCode: Optional(Type.Union([Type.Literal(\"SESSION_WORKTREE_PROVISION_FAILED\"), Type.Literal(\"SESSION_UNAVAILABLE\")]))\n\t}))),\n\tgroups: Optional(Strings),\n\tbackgroundWorkActive: Optional(Flag),\n\t/** Present and true for a recorded session the server has not reopened yet. */\n\tdormant: Optional(Flag)\n});\nconst WorkspaceSchema = Type.Object({\n\tid: Text,\n\troot: Text,\n\tname: Optional(Text),\n\tavailable: Optional(Flag),\n\tsandbox: Optional(Text),\n\t/**\n\t* The sandbox's state, live: `starting` while it starts or sessions move in, `running` once the host is linked,\n\t* `stopping` while it is switched off, `failed` when a start or a switch failed, `unavailable` when its provider\n\t* cannot run it. On a workspace without `sandbox`, `unavailable` means the sandbox provider cannot run it now, so\n\t* it cannot be switched on; absent means nothing stands in the way.\n\t*/\n\tsandboxState: Optional(Type.Union([\n\t\tType.Literal(\"starting\"),\n\t\tType.Literal(\"running\"),\n\t\tType.Literal(\"stopping\"),\n\t\tType.Literal(\"unavailable\"),\n\t\tType.Literal(\"failed\")\n\t])),\n\t/** A plain sentence for `failed` or `unavailable`, such as 'Docker is not running.'. */\n\tsandboxReason: Optional(Text)\n});\nconst SavedSession = Type.Object({\n\tid: Text,\n\tname: Optional(Text),\n\tfirstMessage: Text,\n\tcreatedAt: Text,\n\tupdatedAt: Text\n});\nconst query = (name, schema = Text, required = false) => ({\n\tname,\n\tin: \"query\",\n\trequired,\n\tschema\n});\nconst body = (schema) => ({\n\tcontentType: \"application/json\",\n\trequired: true,\n\tschema\n});\nconst host = (id, path, method, result, extra = {}) => ({\n\tid,\n\tpath,\n\tmethod,\n\tscope: \"global\",\n\tauthentication: \"owner\",\n\tdescription: id,\n\tresponses: jsonApiResponses(result),\n\t...extra\n});\nconst Binary = Type.String({ contentEncoding: \"binary\" });\nhost(\"health\", \"/api/health\", \"GET\", Type.Object({\n\tok: Type.Literal(true),\n\trole: Type.Literal(\"hub\"),\n\tprotocol: Type.Literal(1),\n\tsessions: NumberValue\n}), { authentication: \"none\" }), host(\"telemetry.browser\", \"/api/telemetry/browser\", \"POST\", ApiOkSchema, { body: body(Type.Object({\n\tv: Type.Literal(1),\n\tevents: Type.Array(Type.Object({\n\t\tname: Type.String({ pattern: \"^web\\\\.browser\\\\.[a-z_]{1,40}$\" }),\n\t\tduration_ms: Optional(NumberValue),\n\t\tcount: Optional(NumberValue)\n\t}), { maxItems: 10 })\n})) }), host(\"compositions\", \"/api/compositions\", \"GET\", Type.Object({\n\tglobal: Optional(WebCompositionSchema),\n\tnativeGlobal: Optional(NativeCompositionSchema),\n\t/** App bundles by platform, which a phone loads only when its own fingerprint matches. */\n\tnativeApp: Optional(Type.Record(Text, NativeAppSchema)),\n\tpublicKey: Optional(Text),\n\tshell: Optional(Type.Object({\n\t\tpublicKey: Text,\n\t\trevision: NumberValue\n\t})),\n\ttemplate: Optional(TemplateDecisionSchema),\n\t/** The phone app's `native.template` choice, resolved the same way. */\n\tnativeTemplate: Optional(TemplateDecisionSchema),\n\tworkspaces: Type.Array(Type.Object({\n\t\tid: Text,\n\t\troot: Text,\n\t\t/** `null` for a sandboxed workspace: its plugins run in its sandbox, the host has none for it. */\n\t\twebComposition: Optional(Type.Union([WebCompositionSchema, Type.Null()])),\n\t\tnativeComposition: Optional(Type.Union([NativeCompositionSchema, Type.Null()]))\n\t}))\n})), host(\"directories\", \"/api/directories\", \"GET\", Type.Object({ directories: Strings }), { parameters: [query(\"q\")] }), host(\"directories.children\", \"/api/directories/children\", \"GET\", Type.Object({\n\tpath: Text,\n\tparent: Optional(Text),\n\tdirectories: Strings\n}), { parameters: [query(\"path\")] }), host(\"directories.po\", \"/api/directories/po\", \"GET\", Type.Object({ directories: Strings })), host(\"sessions.list\", \"/api/workspaces/{workspaceId}/sessions\", \"GET\", Type.Object({ sessions: Type.Array(SessionSummarySchema) })), host(\"sessions.create\", \"/api/workspaces/{workspaceId}/sessions\", \"POST\", Type.Object({ sessionId: Text }), {\n\tbody: body(Type.Object({ name: Optional(Text) })),\n\tresponses: jsonApiResponses(Type.Object({ sessionId: Text }), 201)\n}), host(\"sessions.get\", \"/api/workspaces/{workspaceId}/sessions/{sessionId}\", \"GET\", SessionSummarySchema), host(\"sessions.delete\", \"/api/workspaces/{workspaceId}/sessions/{sessionId}\", \"DELETE\", ApiOkSchema), host(\"sessions.history\", \"/api/workspaces/{workspaceId}/sessions/{sessionId}/history\", \"GET\", Type.Object({ sessions: Type.Array(SavedSession) }), { availability: \"Host provides sessionHistory\" }), host(\"sessions.restart\", \"/api/workspaces/{workspaceId}/sessions/{sessionId}/restart\", \"POST\", ApiOkSchema, { availability: \"Host provides restartSession\" }), host(\"sessions.revive\", \"/api/workspaces/{workspaceId}/sessions/{sessionId}/revive\", \"POST\", ApiOkSchema, { availability: \"Host provides reviveSession\" }), host(\"sessions.resume\", \"/api/workspaces/{workspaceId}/sessions/{sessionId}/resume\", \"POST\", Type.Object({ sessionId: Text }), {\n\tavailability: \"Host provides resumeSession\",\n\tbody: body(Type.Object({ targetSessionId: Type.String({ pattern: \"^[A-Za-z0-9_-]+$\" }) }))\n}), host(\"sessions.file\", \"/api/workspaces/{workspaceId}/sessions/{sessionId}/file\", \"GET\", Binary, {\n\tparameters: [query(\"path\", Text, true)],\n\tresponses: {\n\t\t...jsonApiResponses(Binary),\n\t\t\"200\": {\n\t\t\tdescription: \"File bytes, MIME type follows the file extension\",\n\t\t\tcontentType: \"*/*\",\n\t\t\tschema: Binary\n\t\t}\n\t}\n}), host(\"workspaces.list\", \"/api/workspaces\", \"GET\", Type.Object({ workspaces: Type.Array(WorkspaceSchema) })), host(\"workspaces.admit\", \"/api/workspaces\", \"POST\", Type.Object({ workspace: WorkspaceSchema }), {\n\tbody: body(Type.Object({\n\t\troot: Optional(Text),\n\t\tname: Optional(Text)\n\t})),\n\tresponses: jsonApiResponses(Type.Object({ workspace: WorkspaceSchema }), 201)\n}), host(\"workspaces.get\", \"/api/workspaces/{workspaceId}\", \"GET\", Type.Object({ workspace: WorkspaceSchema })), host(\"workspaces.history\", \"/api/workspaces/{workspaceId}/history\", \"GET\", Type.Object({ sessions: Type.Array(SavedSession) }), { availability: \"Host provides workspaceHistory\" }), host(\"workspaces.resume\", \"/api/workspaces/{workspaceId}/resume\", \"POST\", Type.Object({ sessionId: Text }), {\n\tavailability: \"Host provides resumeWorkspaceSession\",\n\tbody: body(Type.Object({ targetSessionId: Type.String({ pattern: \"^[A-Za-z0-9_-]+$\" }) }))\n}), host(\"workspaces.setSandbox\", \"/api/workspaces/{workspaceId}\", \"PATCH\", Type.Object({ workspace: WorkspaceSchema }), {\n\tavailability: \"Host provides setWorkspaceSandbox\",\n\tbody: body(Type.Object({ sandbox: Type.Union([Text, Type.Null()]) }))\n}), host(\"workspaces.remove\", \"/api/workspaces/{workspaceId}\", \"DELETE\", ApiOkSchema);\nconst AuthType = Type.Union([Type.Literal(\"api_key\"), Type.Literal(\"oauth\")]);\nconst Provider = Type.Object({\n\tid: Text,\n\tname: Text,\n\tmethods: Type.Array(Type.Object({\n\t\ttype: AuthType,\n\t\tlabel: Text\n\t})),\n\tauthenticated: Optional(Type.Object({\n\t\ttype: AuthType,\n\t\tsource: Optional(Text)\n\t}))\n});\nconst LoginEvent = Type.Union([\n\tType.Object({\n\t\ttype: Type.Literal(\"info\"),\n\t\tmessage: Text,\n\t\tlinks: Optional(Type.Array(Type.Object({\n\t\t\turl: Text,\n\t\t\tlabel: Optional(Text)\n\t\t})))\n\t}),\n\tType.Object({\n\t\ttype: Type.Literal(\"auth_url\"),\n\t\turl: Text,\n\t\tinstructions: Optional(Text)\n\t}),\n\tType.Object({\n\t\ttype: Type.Literal(\"device_code\"),\n\t\tuserCode: Text,\n\t\tverificationUri: Text,\n\t\tintervalSeconds: Optional(NumberValue),\n\t\texpiresInSeconds: Optional(NumberValue)\n\t}),\n\tType.Object({\n\t\ttype: Type.Literal(\"progress\"),\n\t\tmessage: Text\n\t})\n]);\nconst LoginFlowSchema = Type.Object({\n\tid: Text,\n\tproviderId: Text,\n\tproviderName: Text,\n\ttype: AuthType,\n\tstatus: Type.Union([\n\t\tType.Literal(\"running\"),\n\t\tType.Literal(\"succeeded\"),\n\t\tType.Literal(\"failed\"),\n\t\tType.Literal(\"cancelled\")\n\t]),\n\tevents: Type.Array(LoginEvent),\n\tprompt: Optional(Type.Object({\n\t\tid: Text,\n\t\ttype: Type.Union([\n\t\t\tType.Literal(\"text\"),\n\t\t\tType.Literal(\"secret\"),\n\t\t\tType.Literal(\"select\"),\n\t\t\tType.Literal(\"manual_code\")\n\t\t]),\n\t\tmessage: Text,\n\t\tplaceholder: Optional(Text),\n\t\toptions: Optional(Type.Array(Type.Object({\n\t\t\tid: Text,\n\t\t\tlabel: Text,\n\t\t\tdescription: Optional(Text)\n\t\t})))\n\t})),\n\tremote: Optional(Flag),\n\terror: Optional(Text)\n});\nconst Flow = Type.Object({ flow: LoginFlowSchema });\n[\n\thost(\"providers.list\", \"/providers\", \"GET\", Type.Object({ providers: Type.Array(Provider) })),\n\thost(\"models.list\", \"/models\", \"GET\", Type.Object({ models: Type.Array(Type.Object({\n\t\tvalue: Text,\n\t\tlabel: Text,\n\t\tgroup: Text\n\t})) })),\n\thost(\"providers.logout\", \"/providers/{providerId}\", \"DELETE\", ApiOkSchema),\n\thost(\"logins.create\", \"/logins\", \"POST\", Flow, {\n\t\tbody: body(Type.Object({\n\t\t\tproviderId: Text,\n\t\t\ttype: AuthType\n\t\t})),\n\t\tresponses: jsonApiResponses(Flow, 201)\n\t}),\n\thost(\"logins.get\", \"/logins/{flowId}\", \"GET\", Flow),\n\thost(\"logins.cancel\", \"/logins/{flowId}\", \"DELETE\", Flow),\n\thost(\"logins.answer\", \"/logins/{flowId}/answer\", \"POST\", Flow, { body: body(Type.Object({\n\t\tpromptId: Text,\n\t\tvalue: Text\n\t})) })\n].map((route) => ({\n\t...route,\n\tbasePath: \"po\"\n}));\nconst Source = Type.Union([\n\tType.Literal(\"extension\"),\n\tType.Literal(\"mcp\"),\n\tType.Literal(\"plugin\"),\n\tType.Literal(\"core\")\n]);\nconst Detail = Type.Union([\n\tType.Object({\n\t\titemKind: Type.Literal(\"tool\"),\n\t\tname: Text,\n\t\towner: Text,\n\t\tsource: Source,\n\t\tactive: Flag,\n\t\ttokens: Type.Object({\n\t\t\tschemaTokens: NumberValue,\n\t\t\tpromptTokens: NumberValue,\n\t\t\ttotalTokens: NumberValue\n\t\t}),\n\t\tdescription: Optional(Text),\n\t\tpromptSnippet: Optional(Text),\n\t\tpromptGuidelines: Optional(Strings),\n\t\tparameters: Optional(Json)\n\t}),\n\tType.Object({\n\t\titemKind: Type.Literal(\"skill\"),\n\t\tname: Text,\n\t\towner: Text,\n\t\tsource: Source,\n\t\tactive: Type.Literal(true),\n\t\ttokens: NumberValue,\n\t\tdescription: Text,\n\t\tfilePath: Optional(Text),\n\t\tmodelInvocable: Flag\n\t}),\n\tType.Object({\n\t\titemKind: Type.Literal(\"prompt\"),\n\t\tname: Type.Literal(\"system\"),\n\t\ttokens: NumberValue,\n\t\tstage: Type.Union([Type.Literal(\"base\"), Type.Literal(\"effective\")]),\n\t\ttext: Text\n\t})\n]);\nconst ContextProjection = Type.Object({\n\tversion: Type.Literal(1),\n\trevision: NumberValue,\n\tselection: Type.Object({\n\t\tmajorMode: Text,\n\t\tdomains: Strings,\n\t\tprofile: Optional(Text)\n\t}),\n\tgroups: Type.Array(Type.Object({\n\t\tid: Text,\n\t\tlabel: Text,\n\t\tkind: Type.Union([\n\t\t\tType.Literal(\"major\"),\n\t\t\tType.Literal(\"minor\"),\n\t\t\tType.Literal(\"domain\"),\n\t\t\tType.Literal(\"shared\"),\n\t\t\tType.Literal(\"core\")\n\t\t]),\n\t\titems: Type.Array(Type.Object({\n\t\t\tname: Text,\n\t\t\titemKind: Type.Union([Type.Literal(\"tool\"), Type.Literal(\"skill\")]),\n\t\t\tsource: Source,\n\t\t\towner: Text,\n\t\t\ttokens: NumberValue,\n\t\t\tactive: Flag\n\t\t})),\n\t\ttokens: NumberValue,\n\t\tinactiveTokens: NumberValue\n\t})),\n\ttotalTokens: NumberValue,\n\tinactiveTokens: NumberValue,\n\tsystemPrompt: Optional(Type.Object({\n\t\ttokens: NumberValue,\n\t\tstage: Type.Union([Type.Literal(\"base\"), Type.Literal(\"effective\")])\n\t})),\n\testimator: Type.Literal(\"gpt-tokenizer\")\n});\n({ ...host(\"context.current\", CURRENT_ROUTE, \"GET\", ContextProjection) }), { ...host(\"context.item\", ITEM_ROUTE, \"GET\", Type.Object({\n\trevision: NumberValue,\n\titem: Detail\n}), { parameters: [query(\"kind\", Type.Union([\n\tType.Literal(\"tool\"),\n\tType.Literal(\"skill\"),\n\tType.Literal(\"prompt\")\n]), true), query(\"name\", Text, true)] }) }, { ...host(\"files.complete\", \"/\", \"GET\", Type.Object({ files: Strings }), { parameters: [query(\"q\", Type.String({ maxLength: 256 }))] }) };\n//#endregion\nexport { ApiErrorSchema, ApiOkSchema, LoginFlowSchema, NativeCompositionSchema, SessionSummarySchema, WebCompositionSchema, WorkspaceSchema, jsonApiResponses };\n\n//# sourceMappingURL=httpApiContracts.mjs.map","import { PO_SERVER_HOST, chordMethods } from \"./protocolContracts.mjs\";\nimport { SessionSummarySchema, WorkspaceSchema } from \"./httpApiContracts.mjs\";\nimport { PoPluginCallSchema } from \"./pluginProtocol.mjs\";\nimport { Type } from \"typebox\";\nimport { hostNamed, remote } from \"@earendil-works/chord\";\n//#region src/schemas/protocolHubContract.ts\nconst Text = Type.String();\nconst Json = Type.Unsafe({});\n/** A live session frame every hub client needs (notification entries and agent dialogs) until it is acknowledged. */\nconst HubNoticeSchema = Type.Object({\n\tid: Text,\n\tsessionId: Text,\n\tframe: Type.Record(Text, Json)\n});\nconst HubState = {\n\tsessions: Type.Record(Text, SessionSummarySchema),\n\tworkspaces: Type.Record(Text, WorkspaceSchema),\n\tpending: Type.Array(HubNoticeSchema)\n};\nconst PoHubStateSchema = Type.Object(HubState);\n/** What one connection may see: its sessions, its workspaces, and the notices it has not acknowledged. */\nconst PoHubContract = remote(\"po.hub\", {\n\tversion: 1,\n\thost: hostNamed(PO_SERVER_HOST),\n\tinput: Type.Object({}),\n\tvariants: { default: {\n\t\tstate: HubState,\n\t\tmethods: chordMethods({\n\t\t\treadHome: {\n\t\t\t\targs: Type.Object({\n\t\t\t\t\toffset: Type.Optional(Type.Integer({ minimum: 0 })),\n\t\t\t\t\tlimit: Type.Optional(Type.Integer({ minimum: 1 })),\n\t\t\t\t\tsource: Type.Optional(Text),\n\t\t\t\t\tworkspaceId: Type.Optional(Text)\n\t\t\t\t}),\n\t\t\t\tresult: Type.Unsafe({})\n\t\t\t},\n\t\t\tinvoke: {\n\t\t\t\targs: PoPluginCallSchema,\n\t\t\t\tresult: Json\n\t\t\t},\n\t\t\tackNotice: { args: Type.Object({ id: Text }) }\n\t\t})\n\t} }\n});\n//#endregion\nexport { HubNoticeSchema, PoHubContract, PoHubStateSchema };\n\n//# sourceMappingURL=protocolHubContract.mjs.map","import { PO_SERVER_HOST } from \"./protocolContracts.mjs\";\nimport { Type } from \"typebox\";\nimport { hostNamed, remote } from \"@earendil-works/chord\";\n//#region src/schemas/protocolThreadContract.ts\n/** The thread's latest frame: `transcript_state` while its child runs, `transcript_ready` once it has finished. */\nconst PoThreadFrameSchema = Type.Union([Type.Null(), Type.Intersect([Type.Object({ type: Type.String() }), Type.Record(Type.String(), Type.Unsafe({}))])]);\n/** One child thread of a session, followed only while someone holds it. */\nconst PoThreadContract = remote(\"po.thread\", {\n\tversion: 1,\n\thost: hostNamed(PO_SERVER_HOST),\n\tinput: Type.Object({\n\t\tsessionId: Type.String({ minLength: 1 }),\n\t\tthreadId: Type.String({ minLength: 1 })\n\t}),\n\tvariants: { default: { state: { frame: PoThreadFrameSchema } } }\n});\n//#endregion\nexport { PoThreadContract, PoThreadFrameSchema };\n\n//# sourceMappingURL=protocolThreadContract.mjs.map","import { chordMethods } from \"./protocolContracts.mjs\";\nimport { ChannelFrameSchema, PoChannelsStateSchema } from \"./protocolChannelsContract.mjs\";\nimport { PoHubStateSchema } from \"./protocolHubContract.mjs\";\nimport { PoThreadFrameSchema } from \"./protocolThreadContract.mjs\";\nimport { Type } from \"typebox\";\n//#region src/schemas/sessionApiContracts.ts\nconst Text = Type.String();\nconst NumberValue = Type.Number();\nconst Flag = Type.Boolean();\nconst Json = Type.Unsafe(Type.Unknown({ description: \"Strict JSON application value supplied by the active tool, journal entry, or extension; validated by the Pi codec.\" }));\nconst Optional = Type.Optional;\nconst Strings = Type.Array(Text);\nconst Model = Type.Object({\n\tprovider: Text,\n\tid: Text\n});\nconst Thinking = Type.Union([\n\tType.Literal(\"off\"),\n\tType.Literal(\"minimal\"),\n\tType.Literal(\"low\"),\n\tType.Literal(\"medium\"),\n\tType.Literal(\"high\"),\n\tType.Literal(\"max\"),\n\tType.Literal(\"xhigh\")\n]);\nconst Phase = Type.Union([\n\tType.Literal(\"idle\"),\n\tType.Literal(\"turn\"),\n\tType.Literal(\"compaction\"),\n\tType.Literal(\"retry\")\n]);\nconst Image = Type.Object({\n\ttype: Type.Literal(\"image\"),\n\tdata: Text,\n\tmimeType: Text\n});\nconst TextPart = Type.Object({\n\ttype: Type.Literal(\"text\"),\n\ttext: Text\n});\nconst ThinkingPart = Type.Object({\n\ttype: Type.Literal(\"thinking\"),\n\tthinking: Text,\n\tredacted: Optional(Type.Literal(true))\n});\nconst Content = Type.Union([Image, TextPart]);\nconst Usage = Type.Object({\n\tinput: NumberValue,\n\toutput: NumberValue,\n\tcacheRead: NumberValue,\n\tcacheWrite: NumberValue,\n\ttotal: NumberValue\n});\nconst Message = Type.Object({\n\ttext: Text,\n\timages: Optional(Type.Array(Image))\n});\nconst Lifecycle = Type.Object({\n\trevision: NumberValue,\n\toperation: Type.Union([Type.Null(), Type.Object({\n\t\tid: Text,\n\t\tkind: Type.Union([\n\t\t\tType.Literal(\"run\"),\n\t\t\tType.Literal(\"compaction\"),\n\t\t\tType.Literal(\"navigation\")\n\t\t]),\n\t\tstatus: Type.Union([Type.Literal(\"open\"), Type.Literal(\"aborting\")])\n\t})]),\n\tpaused: Flag,\n\tqueue: Type.Array(Type.Object({\n\t\tid: Text,\n\t\ttext: Text,\n\t\timages: Optional(Type.Array(Image)),\n\t\tdelivery: Type.Union([\n\t\t\tType.Literal(\"steer\"),\n\t\t\tType.Literal(\"followUp\"),\n\t\t\tType.Literal(\"nextRun\")\n\t\t]),\n\t\tscheduling: Type.Union([Type.Literal(\"automatic\"), Type.Literal(\"held\")]),\n\t\tdisposition: Type.Union([Type.Literal(\"pending\"), Type.Literal(\"handoff\")])\n\t}))\n});\nconst Frame = Type.Intersect([Type.Object({ type: Text }), Type.Record(Text, Json)], { description: \"Discriminated extension presentation frame; selected channel schemas describe package payloads.\" });\nconst ProtocolEvent = Type.Object({\n\tsequence: NumberValue,\n\tframe: Frame\n});\nconst SessionServiceStateSchema = Type.Object({\n\tsnapshot: Type.Object({\n\t\tfastMode: Flag,\n\t\tlocked: Flag,\n\t\tlifecycle: Optional(Lifecycle)\n\t}),\n\tpresentation: Optional(Type.Object({\n\t\trevision: NumberValue,\n\t\tdropped: NumberValue,\n\t\tresetRevision: Optional(NumberValue),\n\t\tevents: Type.Array(ProtocolEvent),\n\t\tprojections: Type.Array(ProtocolEvent)\n\t})),\n\tlive: Optional(Type.Object({\n\t\tphase: Phase,\n\t\tmessage: Optional(Type.Object({\n\t\t\trole: Type.Literal(\"assistant\"),\n\t\t\tcontent: Type.Array(Type.Union([TextPart, ThinkingPart])),\n\t\t\tmodel: Text,\n\t\t\ttimestamp: NumberValue\n\t\t})),\n\t\ttools: Type.Record(Text, Type.Object({\n\t\t\ttoolCallId: Text,\n\t\t\ttoolName: Text,\n\t\t\targs: Json,\n\t\t\tpartialResult: Optional(Type.Object({\n\t\t\t\tcontent: Type.Array(Content),\n\t\t\t\tdetails: Optional(Json)\n\t\t\t}))\n\t\t}))\n\t}))\n});\n/** Argument and result schemas of the `po.session` methods; the Chord contract and the API docs both read them. */\nconst SessionMethodSchemas = {\n\treadTranscriptPage: {\n\t\targs: Type.Object({\n\t\t\tcursor: Optional(Text),\n\t\t\tdirection: Optional(Type.Union([Type.Literal(\"older\"), Type.Literal(\"newer\")])),\n\t\t\tlimit: Optional(NumberValue),\n\t\t\tthreadId: Optional(Text)\n\t\t}),\n\t\tresult: Type.Object({\n\t\t\tentries: Type.Array(Json),\n\t\t\tstartCursor: Type.Union([Text, Type.Null()]),\n\t\t\tendCursor: Type.Union([Text, Type.Null()]),\n\t\t\tolderCursor: Type.Union([Text, Type.Null()]),\n\t\t\tnewerCursor: Type.Union([Text, Type.Null()]),\n\t\t\tgeneration: NumberValue,\n\t\t\trevision: NumberValue,\n\t\t\tcontext: Type.Array(Json)\n\t\t})\n\t},\n\tprompt: { args: Type.Union([Text, Type.Object({\n\t\t...Message.properties,\n\t\twaitFor: Optional(Type.Union([Type.Literal(\"accepted\"), Type.Literal(\"settled\")]))\n\t})]) },\n\tsteer: { args: Type.Union([Text, Message]) },\n\tabort: {},\n\tabortOperation: { args: Type.Object({ operationId: Text }) },\n\tsetModel: { args: Model },\n\tsetThinking: { args: Thinking },\n\tsetFastMode: { args: Flag },\n\tsetAgentLock: { args: Flag },\n\tfollowUp: { args: Message },\n\tenqueueAutomatic: {\n\t\targs: Message,\n\t\tresult: Type.Object({ id: Text })\n\t},\n\tremoveQueued: {\n\t\targs: Type.Object({ id: Text }),\n\t\tresult: Type.Union([\n\t\t\tType.Literal(\"removed\"),\n\t\t\tType.Literal(\"in_flight\"),\n\t\t\tType.Literal(\"already_consumed\"),\n\t\t\tType.Literal(\"not_found\")\n\t\t])\n\t},\n\tpromoteQueued: {\n\t\targs: Type.Object({\n\t\t\tid: Text,\n\t\t\toperationId: Optional(Text)\n\t\t}),\n\t\tresult: Type.Union([\n\t\t\tType.Literal(\"promoted\"),\n\t\t\tType.Literal(\"in_flight\"),\n\t\t\tType.Literal(\"target_changed\"),\n\t\t\tType.Literal(\"not_found\")\n\t\t])\n\t},\n\tresumeQueue: {},\n\tclearQueue: { result: Type.Object({\n\t\tsteering: Strings,\n\t\tfollowUp: Strings\n\t}) },\n\trewind: {\n\t\targs: Type.Object({\n\t\t\titemId: Text,\n\t\t\tsummarize: Optional(Flag),\n\t\t\tcustomInstructions: Optional(Text),\n\t\t\treplaceInstructions: Optional(Flag),\n\t\t\tlabel: Optional(Text)\n\t\t}),\n\t\tresult: Type.Object({\n\t\t\teditorText: Optional(Text),\n\t\t\tcancelled: Flag,\n\t\t\taborted: Optional(Flag),\n\t\t\tsummaryEntry: Optional(Type.Object({\n\t\t\t\tid: Text,\n\t\t\t\tparentId: Type.Union([Text, Type.Null()]),\n\t\t\t\ttimestamp: Text,\n\t\t\t\tfromId: Text,\n\t\t\t\tsummary: Text,\n\t\t\t\tdetails: Optional(Json),\n\t\t\t\tusage: Optional(Usage),\n\t\t\t\tfromHook: Optional(Flag)\n\t\t\t}))\n\t\t})\n\t},\n\textensionUiResponse: { args: Type.Union([\n\t\tType.Object({\n\t\t\tid: Text,\n\t\t\tvalue: Text\n\t\t}),\n\t\tType.Object({\n\t\t\tid: Text,\n\t\t\tconfirmed: Flag\n\t\t}),\n\t\tType.Object({\n\t\t\tid: Text,\n\t\t\tcancelled: Type.Literal(true)\n\t\t})\n\t]) },\n\tgetState: { result: Type.Object({\n\t\tmodel: Optional(Model),\n\t\tthinkingLevel: Thinking,\n\t\tfastMode: Flag,\n\t\tagentLocked: Optional(Flag),\n\t\tisStreaming: Flag,\n\t\tisCompacting: Flag,\n\t\tsteeringMode: Type.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")]),\n\t\tfollowUpMode: Type.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")]),\n\t\tsessionId: Text,\n\t\tsessionName: Optional(Text),\n\t\tautoCompactionEnabled: Flag,\n\t\tmessageCount: NumberValue,\n\t\tpendingMessageCount: NumberValue,\n\t\toperationId: Optional(Text),\n\t\texecutionStatus: Optional(Type.Union([Type.Literal(\"open\"), Type.Literal(\"aborting\")])),\n\t\tqueuePaused: Optional(Flag),\n\t\tqueueRevision: Optional(NumberValue)\n\t}) },\n\tgetSessionStats: { result: Type.Object({\n\t\tsessionId: Text,\n\t\ttotalMessages: NumberValue,\n\t\ttokens: Usage,\n\t\tcost: NumberValue,\n\t\tcontextUsage: Optional(Type.Object({\n\t\t\ttokens: Type.Union([NumberValue, Type.Null()]),\n\t\t\tcontextWindow: NumberValue,\n\t\t\tpercent: Type.Union([NumberValue, Type.Null()])\n\t\t}))\n\t}) },\n\tgetCommands: { result: Type.Array(Type.Object({\n\t\tname: Text,\n\t\tdescription: Optional(Text),\n\t\tsource: Type.Union([\n\t\t\tType.Literal(\"extension\"),\n\t\t\tType.Literal(\"prompt\"),\n\t\t\tType.Literal(\"skill\")\n\t\t]),\n\t\tsourceInfo: Optional(Type.Object({\n\t\t\tpath: Text,\n\t\t\tsource: Text,\n\t\t\tscope: Type.Union([\n\t\t\t\tType.Literal(\"user\"),\n\t\t\t\tType.Literal(\"project\"),\n\t\t\t\tType.Literal(\"temporary\")\n\t\t\t]),\n\t\t\torigin: Type.Union([Type.Literal(\"package\"), Type.Literal(\"top-level\")]),\n\t\t\tbaseDir: Optional(Text)\n\t\t}))\n\t})) },\n\tgetAvailableModels: { result: Type.Array(Model) },\n\tgetAvailableThinkingLevels: { result: Type.Array(Thinking) },\n\tcompact: {\n\t\targs: Type.Object({ customInstructions: Optional(Text) }),\n\t\tresult: Json\n\t},\n\tsetName: { args: Text },\n\tsetGroups: { args: Type.Array(Text) }\n};\n/** The `po.session` methods as Chord specs. */\nconst SessionMethods = chordMethods(SessionMethodSchemas);\nconst ErrorSchema = Type.Object({\n\tcode: Text,\n\tmessage: Text\n});\nconst documented = (id, service, member, direction, input, description) => ({\n\tid,\n\tscope: service === \"po.hub\" ? \"global\" : \"session\",\n\tservice,\n\tmember,\n\tdirection,\n\tkind: direction === \"server-to-client\" ? \"state\" : \"method\",\n\tinput,\n\t...direction === \"server-to-client\" ? {} : { errors: ErrorSchema },\n\tdescription\n});\n[\n\t...Object.entries(SessionMethodSchemas).map(([member, { args, result }]) => ({\n\t\tid: `session.${member}`,\n\t\tscope: \"session\",\n\t\tservice: \"po.session\",\n\t\tmember,\n\t\tdirection: \"client-to-server\",\n\t\tkind: \"method\",\n\t\tdescription: `Session ${member}. The Chord call carries the argument; a void result is null.`,\n\t\tinput: Type.Tuple(args === void 0 ? [] : [args]),\n\t\t...result === void 0 ? {} : { output: result },\n\t\terrors: ErrorSchema\n\t})),\n\tdocumented(\"session.state\", \"po.session\", \"state\", \"server-to-client\", SessionServiceStateSchema, \"The `state` member of `po.session`, reconstructed from Chord snapshot and delta frames.\"),\n\tdocumented(\"hub.state\", \"po.hub\", \"state\", \"server-to-client\", PoHubStateSchema, \"Sessions and workspaces this connection may see, and notices it has not acknowledged.\"),\n\tdocumented(\"thread.frame\", \"po.thread\", \"frame\", \"server-to-client\", PoThreadFrameSchema, \"The latest frame of one child thread: transcript_state while it runs, transcript_ready once finished.\"),\n\tdocumented(\"channels.latest\", \"po.channels\", \"latest\", \"server-to-client\", PoChannelsStateSchema, \"The latest payload of each extension channel frame type for one session.\"),\n\tdocumented(\"channels.receive\", \"po.channels\", \"receive\", \"client-to-server\", Type.Tuple([ChannelFrameSchema]), \"Send one extension channel frame to the session.\")\n];\n//#endregion\nexport { SessionMethodSchemas, SessionMethods, SessionServiceStateSchema };\n\n//# sourceMappingURL=sessionApiContracts.mjs.map","import { PO_SERVER_HOST } from \"./protocolContracts.mjs\";\nimport { SessionMethods, SessionServiceStateSchema } from \"./sessionApiContracts.mjs\";\nimport { Type } from \"typebox\";\nimport { hostNamed, remote } from \"@earendil-works/chord\";\n//#region src/schemas/protocolSessionContract.ts\n/** One live session. `alive` turns false when the runtime behind the object exits. */\nconst PoSessionContract = remote(\"po.session\", {\n\tversion: 1,\n\thost: hostNamed(PO_SERVER_HOST),\n\tinput: Type.Object({ sessionId: Type.String({ minLength: 1 }) }),\n\tvariants: { default: {\n\t\tstate: {\n\t\t\tstate: Type.Union([Type.Null(), SessionServiceStateSchema]),\n\t\t\talive: Type.Boolean()\n\t\t},\n\t\tmethods: SessionMethods\n\t} }\n});\n//#endregion\nexport { PoSessionContract };\n\n//# sourceMappingURL=protocolSessionContract.mjs.map","import { INTERNAL_CUSTOM_ENTRY_TYPES } from \"../transcriptPages/index.mjs\";\n//#region src/services/sessionPresentation/index.ts\nconst MAX_EVENTS = 1024;\nconst LIVE_EVENTS = 64;\nconst MAX_BYTES = 8388608;\n/** Retain current UI projections independently of the bounded live-event history. */\nfunction createSessionPresentation() {\n\tlet revision = 0;\n\tlet dropped = 0;\n\tlet resetRevision = 0;\n\tlet bytes = 0;\n\tconst events = [];\n\tconst projections = /* @__PURE__ */ new Map();\n\tlet projectedBytes = 0;\n\tconst removeProjection = (key) => {\n\t\tprojectedBytes -= projections.get(key)?.size ?? 0;\n\t\tprojections.delete(key);\n\t};\n\tconst snapshot = () => ({\n\t\trevision,\n\t\tdropped,\n\t\tresetRevision,\n\t\tevents: events.map((item) => item.event),\n\t\tprojections: [...projections.values()].map((item) => item.event)\n\t});\n\treturn {\n\t\tresetCustomEntries() {\n\t\t\tevents.length = 0;\n\t\t\tbytes = 0;\n\t\t\tfor (const key of projections.keys()) if (key.startsWith(\"custom:\")) removeProjection(key);\n\t\t\tresetRevision = ++revision;\n\t\t\treturn snapshot();\n\t\t},\n\t\trecord(raw) {\n\t\t\tif (typeof raw.type !== \"string\" || raw.type === \"message_update\" || raw.type === \"tool_execution_update\" || raw.type === \"entry_appended\" && raw.entry !== null && typeof raw.entry === \"object\" && \"type\" in raw.entry && raw.entry.type === \"custom\" && \"customType\" in raw.entry && typeof raw.entry.customType === \"string\" && INTERNAL_CUSTOM_ENTRY_TYPES.includes(raw.entry.customType) || raw.type === \"response\" && [\n\t\t\t\t\"get_entries\",\n\t\t\t\t\"get_messages\",\n\t\t\t\t\"get_available_models\"\n\t\t\t].includes(String(raw.command))) return void 0;\n\t\t\tconst encoded = JSON.stringify(raw);\n\t\t\tconst frame = JSON.parse(encoded);\n\t\t\tconst event = {\n\t\t\t\tsequence: ++revision,\n\t\t\t\tframe\n\t\t\t};\n\t\t\tlet key;\n\t\t\tif (frame.type === \"response\" && frame.command === \"get_state\" && frame.success === true) key = \"agent:model\";\n\t\t\tif (frame.type === \"thinking_level_changed\") key = \"agent:thinking\";\n\t\t\tif (frame.type === \"extension_ui_request\") {\n\t\t\t\tif (frame.method === \"setStatus\" && typeof frame.statusKey === \"string\") key = `status:${frame.statusKey}`;\n\t\t\t\telse if (frame.method === \"setWidget\" && typeof frame.widgetKey === \"string\") key = `widget:${frame.widgetKey}`;\n\t\t\t\telse if (typeof frame.id === \"string\" && typeof frame.method === \"string\" && [\n\t\t\t\t\t\"select\",\n\t\t\t\t\t\"confirm\",\n\t\t\t\t\t\"input\",\n\t\t\t\t\t\"editor\"\n\t\t\t\t].includes(frame.method)) key = `dialog:${frame.id}`;\n\t\t\t}\n\t\t\tif (frame.type === \"extension_ui_answered\" && typeof frame.id === \"string\") removeProjection(`dialog:${frame.id}`);\n\t\t\tconst entry = frame.entry;\n\t\t\tif (frame.type === \"entry_appended\" && entry && typeof entry === \"object\" && !Array.isArray(entry) && entry.type === \"custom\" && typeof entry.customType === \"string\" && ![\"po-profile-identity\", \"po.agent-settled\"].includes(entry.customType)) key = `custom:${entry.customType}`;\n\t\t\tconst size = Buffer.byteLength(encoded);\n\t\t\tif (key) {\n\t\t\t\tremoveProjection(key);\n\t\t\t\tprojections.set(key, {\n\t\t\t\t\tevent,\n\t\t\t\t\tsize\n\t\t\t\t});\n\t\t\t\tprojectedBytes += size;\n\t\t\t\twhile (projections.size > MAX_EVENTS || projectedBytes > MAX_BYTES) {\n\t\t\t\t\tconst oldest = projections.keys().next().value;\n\t\t\t\t\tif (oldest === void 0) break;\n\t\t\t\t\tremoveProjection(oldest);\n\t\t\t\t\tdropped += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tevents.push({\n\t\t\t\tevent,\n\t\t\t\tsize\n\t\t\t});\n\t\t\tbytes += size;\n\t\t\twhile (events.length > LIVE_EVENTS || bytes > MAX_BYTES) {\n\t\t\t\tconst removed = events.shift();\n\t\t\t\tif (removed) {\n\t\t\t\t\tbytes -= removed.size;\n\t\t\t\t\tdropped += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn snapshot();\n\t\t}\n\t};\n}\n//#endregion\nexport { createSessionPresentation };\n\n//# sourceMappingURL=index.mjs.map","import { durableTranscriptLane, readTranscriptPage, transcriptCursor } from \"../services/transcriptPages/index.mjs\";\nimport { normalizeSessionGroups } from \"../schemas/sessionProtocol.mjs\";\nimport { OperationCancelledError } from \"../services/telemetry/index.mjs\";\nimport { observe } from \"../../serverTelemetry.mjs\";\nimport { SessionMethodSchemas, SessionServiceStateSchema } from \"../schemas/sessionApiContracts.mjs\";\nimport { PoSessionContract } from \"../schemas/protocolSessionContract.mjs\";\nimport \"../../sessionProtocol.mjs\";\nimport { createSessionPresentation } from \"../services/sessionPresentation/index.mjs\";\nimport { BACKGROUND_CONTEXT, withAbortSignal } from \"@earendil-works/chord/context\";\nimport { Type } from \"typebox\";\nimport { ChordError, copyJson, forbidden, local, opaque, replicatedState } from \"@earendil-works/chord\";\n//#region src/pi/piSessionRuntime.ts\nconst SETTLED = \"agent_settled\";\nconst PROMPT_LATENCY_EVENT = \"po_server.prompt_latency\";\nconst SELECTION_COMMANDS = /* @__PURE__ */ new Set([\n\t\"mode\",\n\t\"domains\",\n\t\"profile\",\n\t\"minor\"\n]);\n/** How each attach frame moves `live.phase`; idle clears `live`. */\nconst LIVE_PHASES = /* @__PURE__ */ new Map([\n\t[\"agent_start\", \"turn\"],\n\t[\"agent_settled\", \"idle\"],\n\t[\"compaction_start\", \"compaction\"],\n\t[\"compaction_end\", \"idle\"],\n\t[\"auto_retry_start\", \"retry\"],\n\t[\"auto_retry_end\", \"turn\"]\n]);\n/**\n* Pi streams partials near 100 Hz; `live` takes at most one write per window, so 15 a second per session.\n* ponytail: tuned on the S7 bench (8 children, 4 bash tails growing 1.6 KB/s each): 18.5 KB/s, p95 64 ms.\n* Output faster than that streams at its own rate; cap tool tails or slow tool writes if real runs exceed 20 KB/s.\n*/\nconst LIVE_WRITE_INTERVAL_MS = 66;\nfunction isSelectionCommand(text) {\n\tconst match = /^\\/(\\S+)/.exec(text);\n\treturn match !== null && SELECTION_COMMANDS.has(match[1]);\n}\nfunction parts(value) {\n\treturn Array.isArray(value) ? value.filter((part) => typeof part === \"object\" && part !== null) : [];\n}\n/** Pi's streaming assistant message, cut to the strict-JSON parts a client renders. */\nfunction liveMessage(message) {\n\tconst content = [];\n\tfor (const part of parts(message.content)) {\n\t\tif (part.type === \"text\" && typeof part.text === \"string\") content.push({\n\t\t\ttype: \"text\",\n\t\t\ttext: part.text\n\t\t});\n\t\tif (part.type === \"thinking\" && typeof part.thinking === \"string\") content.push({\n\t\t\ttype: \"thinking\",\n\t\t\tthinking: part.thinking,\n\t\t\t...part.redacted === true ? { redacted: true } : {}\n\t\t});\n\t}\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent,\n\t\tmodel: typeof message.model === \"string\" ? message.model : \"\",\n\t\ttimestamp: typeof message.timestamp === \"number\" ? message.timestamp : 0\n\t};\n}\nfunction liveResult(result) {\n\tconst content = [];\n\tfor (const part of parts(result.content)) {\n\t\tif (part.type === \"text\" && typeof part.text === \"string\") content.push({\n\t\t\ttype: \"text\",\n\t\t\ttext: part.text\n\t\t});\n\t\tif (part.type === \"image\" && typeof part.data === \"string\" && typeof part.mimeType === \"string\") content.push({\n\t\t\ttype: \"image\",\n\t\t\tdata: part.data,\n\t\t\tmimeType: part.mimeType\n\t\t});\n\t}\n\treturn {\n\t\tcontent,\n\t\t...result.details === void 0 ? {} : { details: copyJson(result.details, { omitUndefinedProperties: true }) }\n\t};\n}\nasync function sessionStats(runtime, sessionId) {\n\tconst stored = await runtime.getSessionStats();\n\tconst { contextUsage } = stored;\n\treturn {\n\t\tsessionId,\n\t\ttotalMessages: stored.messageCount,\n\t\ttokens: {\n\t\t\tinput: stored.usage.input,\n\t\t\toutput: stored.usage.output,\n\t\t\tcacheRead: stored.usage.cacheRead,\n\t\t\tcacheWrite: stored.usage.cacheWrite,\n\t\t\ttotal: stored.usage.totalTokens\n\t\t},\n\t\tcost: stored.usage.cost.total,\n\t\t...contextUsage === void 0 ? {} : { contextUsage }\n\t};\n}\n/** Projects one in-process harness runtime as a Chord session service. */\nfunction createAgentSessionRuntime(options) {\n\tconst presentation = createSessionPresentation();\n\tlet historyGeneration = 0;\n\tconst state = replicatedState({\n\t\tsnapshot: {\n\t\t\tfastMode: false,\n\t\t\tlocked: false\n\t\t},\n\t\tpresentation: {\n\t\t\trevision: 0,\n\t\t\tdropped: 0,\n\t\t\tevents: [],\n\t\t\tprojections: []\n\t\t}\n\t});\n\toptions.runtime.readState().then((runtimeState) => {\n\t\tif (!disposed) state.change(BACKGROUND_CONTEXT, (draft) => {\n\t\t\tdraft.snapshot.fastMode = runtimeState.fastMode === true;\n\t\t\tdraft.snapshot.locked = runtimeState.agentLocked === true;\n\t\t});\n\t}).catch((error) => {\n\t\tif (!disposed) present({\n\t\t\ttype: \"error\",\n\t\t\terror: String(error)\n\t\t});\n\t});\n\tconst present = (frame) => {\n\t\tif (frame.type === \"fast_mode_changed\" && typeof frame.enabled === \"boolean\") state.change(BACKGROUND_CONTEXT, (draft) => {\n\t\t\tdraft.snapshot.fastMode = frame.enabled;\n\t\t});\n\t\tif (frame.type === \"agent_lock_changed\" && typeof frame.locked === \"boolean\") state.change(BACKGROUND_CONTEXT, (draft) => {\n\t\t\tdraft.snapshot.locked = frame.locked;\n\t\t});\n\t\tconst entry = frame.entry;\n\t\tif (frame.type === \"entry_appended\" && typeof entry?.seq === \"number\") frame = {\n\t\t\t...frame,\n\t\t\ttranscriptCursor: transcriptCursor(options.sessionId, options.runtime.laneName, historyGeneration, entry.seq)\n\t\t};\n\t\tconst next = presentation.record(frame);\n\t\tif (next) state.change(BACKGROUND_CONTEXT, (draft) => {\n\t\t\tdraft.presentation = next;\n\t\t});\n\t};\n\tconst settlers = /* @__PURE__ */ new Set();\n\tconst promptFailures = /* @__PURE__ */ new Set();\n\tlet promptLatency;\n\tlet lastToolResultAt;\n\tlet assistantMessageStartedAt;\n\tlet disposed = false;\n\tconst reportPromptLatency = (phase) => {\n\t\tconst active = promptLatency;\n\t\tif (active === void 0 || active.reported.has(phase) || options.telemetry === void 0) return;\n\t\tconst now = Date.now();\n\t\tactive.reported.add(phase);\n\t\tobserve(options.telemetry.recordEvent(PROMPT_LATENCY_EVENT, {\n\t\t\tsession_id: options.sessionId,\n\t\t\tphase,\n\t\t\tduration_ms: now - active.startedAt,\n\t\t\tstage_duration_ms: now - active.lastStageAt\n\t\t}));\n\t\tactive.lastStageAt = now;\n\t};\n\tconst rejectSettlers = (error) => {\n\t\tfor (const waiter of settlers) waiter.reject(error);\n\t\tsettlers.clear();\n\t};\n\tlet pendingMessage;\n\tconst pendingResults = /* @__PURE__ */ new Map();\n\tlet liveCooldown;\n\tconst flushLive = () => {\n\t\tif (pendingMessage === void 0 && pendingResults.size === 0) return;\n\t\tconst message = pendingMessage;\n\t\tconst results = [...pendingResults];\n\t\tpendingMessage = void 0;\n\t\tpendingResults.clear();\n\t\tstate.change(BACKGROUND_CONTEXT, (draft) => {\n\t\t\tconst live = draft.live ??= {\n\t\t\t\tphase: \"turn\",\n\t\t\t\ttools: {}\n\t\t\t};\n\t\t\tif (message) live.message = message;\n\t\t\tfor (const [toolCallId, partialResult] of results) {\n\t\t\t\tconst tool = live.tools[toolCallId];\n\t\t\t\tif (tool) tool.partialResult = partialResult;\n\t\t\t}\n\t\t});\n\t};\n\tconst coolLive = () => {\n\t\tliveCooldown = void 0;\n\t\tif (pendingMessage !== void 0 || pendingResults.size > 0) throttleLive();\n\t};\n\tconst throttleLive = () => {\n\t\tif (liveCooldown !== void 0) return;\n\t\tflushLive();\n\t\tliveCooldown = setTimeout(coolLive, LIVE_WRITE_INTERVAL_MS);\n\t};\n\tconst updateLive = (frame, role) => {\n\t\tconst write = (mutate) => state.change(BACKGROUND_CONTEXT, (draft) => mutate(draft.live ??= {\n\t\t\tphase: \"turn\",\n\t\t\ttools: {}\n\t\t}));\n\t\tconst phase = LIVE_PHASES.get(frame.type);\n\t\tconst live = state.value.live;\n\t\tconst toolCallId = typeof frame.toolCallId === \"string\" ? frame.toolCallId : \"\";\n\t\tif (phase === \"idle\") {\n\t\t\tif (live) state.change(BACKGROUND_CONTEXT, (draft) => {\n\t\t\t\tdelete draft.live;\n\t\t\t});\n\t\t} else if (phase !== void 0) write((next) => {\n\t\t\tnext.phase = phase;\n\t\t});\n\t\telse if (frame.type === \"message_update\" && role === \"assistant\") {\n\t\t\tpendingMessage = liveMessage(frame.message);\n\t\t\tthrottleLive();\n\t\t} else if (frame.type === \"message_start\" && role === \"assistant\") {\n\t\t\tconst message = liveMessage(frame.message);\n\t\t\twrite((next) => {\n\t\t\t\tnext.message = message;\n\t\t\t});\n\t\t} else if (frame.type === \"message_end\" && role === \"assistant\") {\n\t\t\tif (live?.message) write((next) => {\n\t\t\t\tdelete next.message;\n\t\t\t});\n\t\t} else if (frame.type === \"tool_execution_start\" && toolCallId) {\n\t\t\tconst tool = {\n\t\t\t\ttoolCallId,\n\t\t\t\ttoolName: typeof frame.toolName === \"string\" ? frame.toolName : \"\",\n\t\t\t\targs: copyJson(frame.args ?? null, { omitUndefinedProperties: true })\n\t\t\t};\n\t\t\twrite((next) => {\n\t\t\t\tnext.tools[toolCallId] = tool;\n\t\t\t});\n\t\t} else if (frame.type === \"tool_execution_update\" && live?.tools[toolCallId]) {\n\t\t\tpendingResults.set(toolCallId, liveResult(frame.partialResult ?? {}));\n\t\t\tthrottleLive();\n\t\t} else if (frame.type === \"tool_execution_end\" && live?.tools[toolCallId]) write((next) => {\n\t\t\tdelete next.tools[toolCallId];\n\t\t});\n\t};\n\tconst unsubscribePresentation = (options.onPresentationFrame ?? ((listener) => options.runtime.onPresentationFrame(listener)))((frame) => {\n\t\tif (disposed) return;\n\t\tif (frame.type !== \"message_update\" && frame.type !== \"tool_execution_update\") flushLive();\n\t\tconst message = typeof frame.message === \"object\" && frame.message !== null ? frame.message : void 0;\n\t\tif (frame.type === \"message_end\" && message?.role === \"toolResult\") lastToolResultAt = Date.now();\n\t\tif (frame.type === \"message_start\" && message?.role === \"assistant\") {\n\t\t\tconst now = Date.now();\n\t\t\tassistantMessageStartedAt = now;\n\t\t\tif (lastToolResultAt !== void 0 && options.telemetry) observe(options.telemetry.recordEvent(\"po_server.tool_result_to_response\", {\n\t\t\t\tsession_id: options.sessionId,\n\t\t\t\tduration_ms: now - lastToolResultAt\n\t\t\t}));\n\t\t\tlastToolResultAt = void 0;\n\t\t}\n\t\tif (frame.type === \"message_end\" && message?.role === \"assistant\") {\n\t\t\tif (assistantMessageStartedAt !== void 0 && options.telemetry) observe(options.telemetry.recordEvent(\"po_server.assistant_message\", {\n\t\t\t\tsession_id: options.sessionId,\n\t\t\t\tduration_ms: Date.now() - assistantMessageStartedAt\n\t\t\t}));\n\t\t\tassistantMessageStartedAt = void 0;\n\t\t}\n\t\tif (frame.type === \"agent_start\") reportPromptLatency(\"agent_started\");\n\t\telse if (frame.type === \"message_start\" && message?.role === \"assistant\") reportPromptLatency(\"response_started\");\n\t\telse if (frame.type === \"message_update\" && message?.role === \"assistant\") reportPromptLatency(\"first_response\");\n\t\telse if (frame.type === \"message_end\" && message?.role === \"assistant\") reportPromptLatency(\"response_completed\");\n\t\tconst presentStartedAt = performance.now();\n\t\tif (frame.type === \"lifecycle_update\" && frame.lifecycle !== void 0) state.change(BACKGROUND_CONTEXT, (draft) => {\n\t\t\tconst lifecycle = frame.lifecycle;\n\t\t\tif ((draft.snapshot.lifecycle?.revision ?? -1) <= lifecycle.revision) draft.snapshot.lifecycle = lifecycle;\n\t\t});\n\t\tif (frame.type === \"navigation_end\") historyGeneration += 1;\n\t\tpresent(frame);\n\t\tconst presentDurationMs = performance.now() - presentStartedAt;\n\t\tif (options.telemetry && (presentDurationMs >= 50 || frame.type === SETTLED)) observe(options.telemetry.recordEvent(\"po_server.presentation_frame\", {\n\t\t\tsession_id: options.sessionId,\n\t\t\t\"frame.type\": frame.type,\n\t\t\tphase: \"publish\",\n\t\t\tduration_ms: presentDurationMs\n\t\t}));\n\t\tif (frame.type === SETTLED) {\n\t\t\tlastToolResultAt = void 0;\n\t\t\tassistantMessageStartedAt = void 0;\n\t\t\treportPromptLatency(\"settled\");\n\t\t\tpromptLatency = void 0;\n\t\t\tconst waiting = [...settlers];\n\t\t\tsettlers.clear();\n\t\t\tfor (const settle of waiting) settle.resolve();\n\t\t}\n\t\tupdateLive(frame, message?.role);\n\t});\n\tconst terminate = (error) => {\n\t\tif (disposed) return;\n\t\tdisposed = true;\n\t\tfor (const fail of promptFailures) fail(error);\n\t\tpromptFailures.clear();\n\t\trejectSettlers(error);\n\t\tunsubscribePresentation();\n\t\tclearTimeout(liveCooldown);\n\t};\n\tobserve(options.runtime.exited.then(() => terminate(/* @__PURE__ */ new Error(\"The session runtime exited\")), (error) => terminate(error instanceof Error ? error : new Error(String(error)))));\n\tconst requireLive = () => {\n\t\tif (disposed) throw new Error(\"The session runtime is disposed\");\n\t};\n\tconst guardContext = (context) => {\n\t\trequireLive();\n\t\tcontext.abortSignal?.throwIfAborted();\n\t};\n\tconst awaitSettled = () => {\n\t\tlet fail;\n\t\tlet finish;\n\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\tconst waiter = {\n\t\t\t\tresolve: () => {\n\t\t\t\t\tsettlers.delete(waiter);\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t\treject: (error) => {\n\t\t\t\t\tsettlers.delete(waiter);\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t};\n\t\t\tfail = waiter.reject;\n\t\t\tfinish = waiter.resolve;\n\t\t\tsettlers.add(waiter);\n\t\t});\n\t\tobserve(promise);\n\t\treturn {\n\t\t\tpromise,\n\t\t\tresolve: finish,\n\t\t\treject: fail\n\t\t};\n\t};\n\tconst messageArgs = (input) => {\n\t\tconst args = typeof input === \"string\" ? { text: input } : input;\n\t\tif (!args || typeof args.text !== \"string\") throw new Error(\"Prompt message must be a string\");\n\t\tif (args.images !== void 0 && (!Array.isArray(args.images) || !args.images.every((image) => image?.type === \"image\" && typeof image.data === \"string\" && typeof image.mimeType === \"string\"))) throw new Error(\"Invalid message images\");\n\t\treturn {\n\t\t\tmessage: args.text,\n\t\t\t...args.images === void 0 ? {} : { images: args.images }\n\t\t};\n\t};\n\tconst hydrate = async () => {\n\t\tconst lifecycle = await options.runtime.readLifecycle();\n\t\tif (disposed) return;\n\t\tstate.change(BACKGROUND_CONTEXT, (draft) => {\n\t\t\tif ((draft.snapshot.lifecycle?.revision ?? -1) <= lifecycle.revision) draft.snapshot.lifecycle = lifecycle;\n\t\t\tdraft.presentation = presentation.resetCustomEntries();\n\t\t});\n\t};\n\tlet initializing;\n\treturn {\n\t\tstate,\n\t\tasync readTranscriptPage(args, context) {\n\t\t\tguardContext(context);\n\t\t\tif (args.threadId !== void 0) {\n\t\t\t\tif (!options.readThreadTranscript) throw new Error(\"Child transcript reader is unavailable\");\n\t\t\t\treturn options.readThreadTranscript(args.threadId, args, context);\n\t\t\t}\n\t\t\tconst generation = historyGeneration;\n\t\t\tconst revision = state.value.presentation?.revision ?? 0;\n\t\t\tconst started = performance.now();\n\t\t\tconst page = await readTranscriptPage({\n\t\t\t\tsessionId: options.runtime.sessionId,\n\t\t\t\tlaneName: options.runtime.laneName,\n\t\t\t\tlane: durableTranscriptLane((query, limit, cursor, scanContext) => options.runtime.scanEntries(query, limit, cursor, scanContext), (readContext) => options.runtime.readIdentities(readContext))\n\t\t\t}, args, generation, context);\n\t\t\tif (options.telemetry) observe(options.telemetry.recordEvent(\"po_server.transcript_page\", {\n\t\t\t\tsession_id: options.sessionId,\n\t\t\t\tphase: args.direction ?? \"latest\",\n\t\t\t\tduration_ms: performance.now() - started,\n\t\t\t\tcount: page.entries.length\n\t\t\t}));\n\t\t\tif (generation !== historyGeneration) throw new Error(\"STALE_TRANSCRIPT_CURSOR\");\n\t\t\treturn {\n\t\t\t\t...page,\n\t\t\t\trevision\n\t\t\t};\n\t\t},\n\t\tinitialize() {\n\t\t\tinitializing ??= hydrate().catch((error) => {\n\t\t\t\tinitializing = void 0;\n\t\t\t\tthrow error;\n\t\t\t});\n\t\t\treturn initializing;\n\t\t},\n\t\tasync prompt(text, context) {\n\t\t\trequireLive();\n\t\t\tif (context.abortSignal?.aborted) throw new OperationCancelledError({ cause: context.abortSignal.reason });\n\t\t\tconst args = messageArgs(text);\n\t\t\tconst waitFor = typeof text === \"string\" ? \"settled\" : text.waitFor ?? \"settled\";\n\t\t\tif (waitFor !== \"accepted\" && waitFor !== \"settled\") throw new Error(\"Invalid prompt acknowledgement mode\");\n\t\t\tlet projection;\n\t\t\tlet latency;\n\t\t\tlet submitted = false;\n\t\t\tlet failed;\n\t\t\tlet rejectFailure;\n\t\t\tconst failure = new Promise((_resolve, reject) => {\n\t\t\t\trejectFailure = reject;\n\t\t\t});\n\t\t\tconst fail = (error) => {\n\t\t\t\tif (failed !== void 0) return;\n\t\t\t\tfailed = error;\n\t\t\t\tprojection?.reject(error);\n\t\t\t\trejectFailure(error);\n\t\t\t\tif (latency !== void 0 && promptLatency === latency) {\n\t\t\t\t\treportPromptLatency(error instanceof OperationCancelledError ? \"cancelled\" : \"failed\");\n\t\t\t\t\tpromptLatency = void 0;\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst cancel = () => {\n\t\t\t\tif (failed !== void 0) return;\n\t\t\t\tfail(new OperationCancelledError({ cause: context.abortSignal?.reason }));\n\t\t\t\tif (submitted && waitFor === \"settled\") options.runtime.abort().catch(() => void 0);\n\t\t\t};\n\t\t\tconst guardPrompt = () => {\n\t\t\t\tif (failed !== void 0) throw failed;\n\t\t\t\tguardContext(context);\n\t\t\t};\n\t\t\tconst submit = async () => {\n\t\t\t\tguardPrompt();\n\t\t\t\tsubmitted = true;\n\t\t\t\tconst submission = await options.runtime.submitPrompt(args.message, args.images, \"steer\");\n\t\t\t\tobserve(submission.settled);\n\t\t\t\tguardPrompt();\n\t\t\t\treturn submission;\n\t\t\t};\n\t\t\tconst span = (name, callback) => {\n\t\t\t\tconst operation = options.telemetry ? options.telemetry.runInSpan(name, { session_id: options.sessionId }, callback) : callback();\n\t\t\t\tobserve(operation);\n\t\t\t\treturn operation;\n\t\t\t};\n\t\t\tconst run = async () => {\n\t\t\t\tguardPrompt();\n\t\t\t\tconst lifecycle = await options.runtime.readLifecycle();\n\t\t\t\tguardPrompt();\n\t\t\t\tif (lifecycle.operation !== null || settlers.size > 0) {\n\t\t\t\t\tif (isSelectionCommand(args.message)) {\n\t\t\t\t\t\tconst handled = await options.runtime.dispatchCommand(args.message);\n\t\t\t\t\t\tguardPrompt();\n\t\t\t\t\t\tif (handled) return;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (waitFor === \"accepted\" && !options.telemetry) {\n\t\t\t\t\tawait submit();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst startedAt = Date.now();\n\t\t\t\tif (promptLatency === void 0) latency = promptLatency = {\n\t\t\t\t\tstartedAt,\n\t\t\t\t\tlastStageAt: startedAt,\n\t\t\t\t\treported: /* @__PURE__ */ new Set()\n\t\t\t\t};\n\t\t\t\tconst settled = projection = awaitSettled();\n\t\t\t\tlet resolveAdmission;\n\t\t\t\tconst admitted = waitFor === \"accepted\" ? new Promise((resolve) => {\n\t\t\t\t\tresolveAdmission = resolve;\n\t\t\t\t}) : void 0;\n\t\t\t\tconst completion = span(\"po_server.prompt_to_settled\", async () => {\n\t\t\t\t\tconst submission = await span(\"po_server.prompt_admission\", submit);\n\t\t\t\t\tguardPrompt();\n\t\t\t\t\tif (submission.handledCommand) settled.resolve();\n\t\t\t\t\tif (latency !== void 0 && promptLatency === latency) reportPromptLatency(\"accepted\");\n\t\t\t\t\tresolveAdmission?.();\n\t\t\t\t\tawait Promise.all([span(\"po_server.prompt_engine_settlement\", () => submission.settled), span(\"po_server.prompt_projection_settlement\", () => settled.promise)]);\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tconst cause = error instanceof Error ? error : new Error(String(error));\n\t\t\t\t\tfail(cause);\n\t\t\t\t\tthrow cause;\n\t\t\t\t});\n\t\t\t\tif (admitted) await Promise.race([admitted, completion]);\n\t\t\t\telse await completion;\n\t\t\t};\n\t\t\tpromptFailures.add(fail);\n\t\t\tcontext.abortSignal?.addEventListener(\"abort\", cancel, { once: true });\n\t\t\ttry {\n\t\t\t\tawait Promise.race([run(), failure]);\n\t\t\t} catch (error) {\n\t\t\t\tconst cause = error instanceof Error ? error : new Error(String(error));\n\t\t\t\tfail(cause);\n\t\t\t\tthrow cause;\n\t\t\t} finally {\n\t\t\t\tpromptFailures.delete(fail);\n\t\t\t\tcontext.abortSignal?.removeEventListener(\"abort\", cancel);\n\t\t\t}\n\t\t},\n\t\tasync steer(text) {\n\t\t\trequireLive();\n\t\t\tconst args = messageArgs(text);\n\t\t\tawait options.runtime.steer(args.message, args.images);\n\t\t},\n\t\tasync abort() {\n\t\t\trequireLive();\n\t\t\tawait options.runtime.abort((await options.runtime.readLifecycle()).operation?.id);\n\t\t},\n\t\tasync abortOperation(args) {\n\t\t\trequireLive();\n\t\t\tif (!args || typeof args.operationId !== \"string\" || !args.operationId) throw new Error(\"Invalid operation identity\");\n\t\t\tawait options.runtime.abort(args.operationId);\n\t\t},\n\t\tasync setModel(model, context) {\n\t\t\tguardContext(context);\n\t\t\tif (!model || typeof model.provider !== \"string\" || typeof model.id !== \"string\") throw new Error(\"Invalid model\");\n\t\t\tawait options.runtime.setModel(model);\n\t\t},\n\t\tasync setFastMode(enabled, context) {\n\t\t\tguardContext(context);\n\t\t\tif (typeof enabled !== \"boolean\") throw new Error(\"Invalid fast mode\");\n\t\t\tawait options.runtime.setFastMode(enabled);\n\t\t\tstate.change(context, (draft) => {\n\t\t\t\tdraft.snapshot.fastMode = enabled;\n\t\t\t});\n\t\t},\n\t\tasync setAgentLock(locked, context) {\n\t\t\tguardContext(context);\n\t\t\tif (typeof locked !== \"boolean\") throw new Error(\"Invalid agent lock\");\n\t\t\tawait options.runtime.setAgentLock(locked);\n\t\t\tstate.change(context, (draft) => {\n\t\t\t\tdraft.snapshot.locked = locked;\n\t\t\t});\n\t\t},\n\t\tasync setThinking(thinkingLevel, context) {\n\t\t\tguardContext(context);\n\t\t\tif (![\n\t\t\t\t\"off\",\n\t\t\t\t\"minimal\",\n\t\t\t\t\"low\",\n\t\t\t\t\"medium\",\n\t\t\t\t\"high\",\n\t\t\t\t\"xhigh\",\n\t\t\t\t\"max\"\n\t\t\t].includes(thinkingLevel)) throw new Error(\"Invalid thinking level\");\n\t\t\tawait options.runtime.setThinkingLevel(thinkingLevel);\n\t\t},\n\t\tasync followUp(args, context) {\n\t\t\tguardContext(context);\n\t\t\tconst message = messageArgs(args);\n\t\t\tawait options.runtime.followUp(message.message, message.images);\n\t\t},\n\t\tasync enqueueAutomatic(args, context) {\n\t\t\tguardContext(context);\n\t\t\tconst message = messageArgs(args);\n\t\t\treturn options.runtime.enqueueAutomatic(message.message, message.images);\n\t\t},\n\t\tasync removeQueued(args, context) {\n\t\t\tguardContext(context);\n\t\t\tif (!args || typeof args.id !== \"string\" || !args.id) throw new Error(\"Invalid queue identity\");\n\t\t\treturn options.runtime.removeQueued(args.id);\n\t\t},\n\t\tasync promoteQueued(args, context) {\n\t\t\tguardContext(context);\n\t\t\tif (!args || typeof args.id !== \"string\" || !args.id || args.operationId !== void 0 && (typeof args.operationId !== \"string\" || !args.operationId)) throw new Error(\"Invalid queue promotion\");\n\t\t\treturn options.runtime.promoteQueued(args.id, args.operationId);\n\t\t},\n\t\tasync resumeQueue(context) {\n\t\t\tguardContext(context);\n\t\t\tawait options.runtime.resumeQueue();\n\t\t},\n\t\tasync clearQueue(context) {\n\t\t\tguardContext(context);\n\t\t\treturn options.runtime.clearQueue();\n\t\t},\n\t\tasync rewind(args, context) {\n\t\t\tguardContext(context);\n\t\t\tif (!args || typeof args.itemId !== \"string\" || !args.itemId) throw new Error(\"Invalid rewind identity\");\n\t\t\tconst { entries } = await options.runtime.readEntries();\n\t\t\tconst entry = entries.toReversed().find((candidate) => {\n\t\t\t\tif (candidate.type !== \"message\" || typeof candidate.id !== \"string\") return false;\n\t\t\t\tconst message = candidate.message;\n\t\t\t\tif (!message || typeof message !== \"object\" || Array.isArray(message)) return false;\n\t\t\t\tconst record = message;\n\t\t\t\treturn candidate.id === args.itemId || record.id === args.itemId || record.role === \"user\" && typeof record.timestamp === \"number\" && args.itemId === `user-${record.timestamp}`;\n\t\t\t});\n\t\t\tif (!entry) throw new Error(\"The selected message is not in the active session tree.\");\n\t\t\tconst result = await options.runtime.navigateTree(entry.id, {\n\t\t\t\t...args.summarize === void 0 ? {} : { summarize: args.summarize },\n\t\t\t\t...args.customInstructions === void 0 ? {} : { customInstructions: args.customInstructions },\n\t\t\t\t...args.replaceInstructions === void 0 ? {} : { replaceInstructions: args.replaceInstructions },\n\t\t\t\t...args.label === void 0 ? {} : { label: args.label }\n\t\t\t});\n\t\t\tif (!result.cancelled) await hydrate();\n\t\t\treturn result;\n\t\t},\n\t\tasync extensionUiResponse(response, context) {\n\t\t\tguardContext(context);\n\t\t\tif (!response || typeof response.id !== \"string\" || !response.id || !(\"value\" in response && typeof response.value === \"string\" || \"confirmed\" in response && typeof response.confirmed === \"boolean\" || \"cancelled\" in response && response.cancelled === true)) throw new Error(\"Invalid extension UI response\");\n\t\t\tif (!options.respondToExtensionUi?.({\n\t\t\t\t...response,\n\t\t\t\ttype: \"extension_ui_response\"\n\t\t\t})) throw new Error(`No pending extension UI request: ${response.id}`);\n\t\t\tpresent({\n\t\t\t\ttype: \"extension_ui_answered\",\n\t\t\t\tid: response.id\n\t\t\t});\n\t\t\tstate.change(context, () => void 0);\n\t\t},\n\t\tasync getState(context) {\n\t\t\tguardContext(context);\n\t\t\tconst runtimeState = await options.runtime.readState();\n\t\t\treturn {\n\t\t\t\t...runtimeState,\n\t\t\t\tfastMode: runtimeState.fastMode === true\n\t\t\t};\n\t\t},\n\t\tasync getSessionStats(context) {\n\t\t\tguardContext(context);\n\t\t\treturn sessionStats(options.runtime, options.sessionId);\n\t\t},\n\t\tasync getCommands(context) {\n\t\t\tguardContext(context);\n\t\t\treturn options.runtime.listCommands().map(({ name, description }) => ({\n\t\t\t\tname,\n\t\t\t\tdescription,\n\t\t\t\tsource: \"extension\"\n\t\t\t}));\n\t\t},\n\t\tasync getAvailableModels(context) {\n\t\t\tguardContext(context);\n\t\t\treturn (await options.runtime.availableModels()).map((model) => ({\n\t\t\t\tprovider: model.provider,\n\t\t\t\tid: model.id\n\t\t\t}));\n\t\t},\n\t\tasync getAvailableThinkingLevels(context) {\n\t\t\tguardContext(context);\n\t\t\treturn await options.runtime.availableThinkingLevels();\n\t\t},\n\t\tasync compact(args, context) {\n\t\t\tguardContext(context);\n\t\t\tawait options.runtime.compact(args.customInstructions);\n\t\t\treturn null;\n\t\t},\n\t\tasync setName(name, context) {\n\t\t\tguardContext(context);\n\t\t\tif (typeof name !== \"string\" || name.length > 256) throw new Error(\"Invalid session name\");\n\t\t\tawait options.runtime.setName(name);\n\t\t},\n\t\tasync setGroups(groups, context) {\n\t\t\tguardContext(context);\n\t\t\tawait options.runtime.setGroups(normalizeSessionGroups(groups));\n\t\t},\n\t\tasync dispose() {\n\t\t\tterminate(/* @__PURE__ */ new Error(\"The session runtime is disposed\"));\n\t\t}\n\t};\n}\n/** Host-local, shared by every connection: one projected runtime per live session generation. */\nconst SessionStateValue = Type.Union([Type.Null(), SessionServiceStateSchema]);\n/** Host-local, shared by every connection: one projected runtime per live session generation. */\nconst PoSessionCore = local(\"po.session-core\", {\n\tversion: 1,\n\tinput: Type.Object({\n\t\tsessionId: Type.String({ minLength: 1 }),\n\t\tgeneration: Type.Integer({ minimum: 0 })\n\t}),\n\tmembers: {\n\t\truntime: opaque(\"po.agent-session-runtime@1\"),\n\t\tstate: SessionStateValue,\n\t\talive: Type.Boolean()\n\t}\n});\n/** A mirror whose session closed, was replaced, or that this connection may no longer reach. */\nconst MIRROR_GONE = \"This session has closed, or this connection can no longer reach it.\";\nconst MIRROR_UNREACHABLE = \"The sandbox that runs this session is not reachable right now. Try again once it reconnects.\";\n/** A held reference's current value, or `fallback` while it is not live yet. */\nfunction readyValue(readable, fallback) {\n\ttry {\n\t\treturn readable.value;\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n/** Linger keeps a quickly reattaching browser on the same projection. */\nconst SESSION_CORE_LINGER_MS = 3e4;\nfunction contextOf(ctx) {\n\treturn withAbortSignal(ctx.signal, BACKGROUND_CONTEXT);\n}\nfunction untilAborted(signal) {\n\treturn new Promise((resolve) => {\n\t\tif (signal.aborted) resolve();\n\t\telse signal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* Serves `po.session` on `host`. `resolve` returns the session a principal may reach, or\n* undefined to refuse it.\n*/\nfunction serveAgentSessions(host, options) {\n\tconst bindings = /* @__PURE__ */ new Map();\n\tconst keyOf = (sessionId, generation) => `${generation}\\0${sessionId}`;\n\thost.serve(PoSessionCore, ({ sessionId, generation }, _principal, self) => {\n\t\tconst binding = bindings.get(keyOf(sessionId, generation));\n\t\tconst runtimeOptions = binding?.options;\n\t\tif (binding === void 0 || runtimeOptions === void 0) throw forbidden(`No session ${sessionId}`);\n\t\tconst state = self.state(\"state\", SessionStateValue, null);\n\t\tconst alive = self.state(\"alive\", Type.Boolean(), true);\n\t\tconst runtime = self.resource(\"runtime\", {\n\t\t\tversion: 1,\n\t\t\topen: async () => {\n\t\t\t\tconst created = createAgentSessionRuntime(runtimeOptions);\n\t\t\t\ttry {\n\t\t\t\t\tawait created.initialize();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait created.dispose();\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\treturn created;\n\t\t\t},\n\t\t\tclose: (created) => created.dispose()\n\t\t});\n\t\tself.on(\"mirror\", runtime, (created) => created.state, (value, ctx) => state.replace(ctx, value, { diff: true }));\n\t\tconst exited = binding.exited;\n\t\tif (exited !== void 0) self.task(async (ctx) => {\n\t\t\tawait Promise.race([exited, untilAborted(ctx.signal)]);\n\t\t\tif (!ctx.signal.aborted) alive.replace(ctx, false);\n\t\t});\n\t\treturn {\n\t\t\truntime: self.expose(runtime),\n\t\t\tstate,\n\t\t\talive\n\t\t};\n\t}, { linger: SESSION_CORE_LINGER_MS });\n\thost.serve(PoSessionContract, (input, principal, self) => {\n\t\tconst { sessionId } = input;\n\t\tconst binding = options.resolve(sessionId, principal);\n\t\tif (binding === void 0) throw forbidden(`No session ${sessionId}`);\n\t\tconst forward = binding.forward;\n\t\tif (forward !== void 0) {\n\t\t\tconst remote = forward.session;\n\t\t\tconst state = self.state(\"state\", SessionStateValue, { init: () => readyValue(remote.state, null) });\n\t\t\tconst alive = self.state(\"alive\", Type.Boolean(), { init: () => readyValue(remote.alive, true) });\n\t\t\tself.on(\"forward-state\", remote.state, (value, ctx) => state.replace(ctx, value, { diff: true }));\n\t\t\tself.on(\"forward-alive\", remote.alive, (value, ctx) => alive.replace(ctx, value));\n\t\t\tconst exited = binding.exited;\n\t\t\tif (exited !== void 0) self.task(async (ctx) => {\n\t\t\t\tawait Promise.race([exited, untilAborted(ctx.signal)]);\n\t\t\t\tif (!ctx.signal.aborted) alive.replace(ctx, false);\n\t\t\t});\n\t\t\tconst call = (name, args, ctx) => {\n\t\t\t\tif (!binding.permitted()) throw forbidden(MIRROR_GONE);\n\t\t\t\tif (!forward.connected() || remote.status !== \"live\") throw new ChordError(\"unavailable\", MIRROR_UNREACHABLE);\n\t\t\t\tconst method = remote[name];\n\t\t\t\treturn forward.root((remoteCtx) => method.call(remote, ...args, remoteCtx), { signal: ctx.signal });\n\t\t\t};\n\t\t\tconst members = {\n\t\t\t\tvariant: \"default\",\n\t\t\t\tstate,\n\t\t\t\talive\n\t\t\t};\n\t\t\tfor (const [name, schemas] of Object.entries(SessionMethodSchemas)) members[name] = schemas.args === void 0 ? (ctx) => call(name, [], ctx) : (args, ctx) => call(name, [args], ctx);\n\t\t\treturn members;\n\t\t}\n\t\tbindings.set(keyOf(sessionId, binding.generation), binding);\n\t\tconst core = self.get(PoSessionCore, {\n\t\t\tsessionId,\n\t\t\tgeneration: binding.generation\n\t\t});\n\t\tconst live = (ctx) => {\n\t\t\tif (!binding.permitted()) throw forbidden(\"This session belongs to Desktop.\");\n\t\t\tconst runtime = core.runtime;\n\t\t\tif (runtime === void 0) throw new Error(\"The session runtime is not ready.\");\n\t\t\treturn [runtime, contextOf(ctx)];\n\t\t};\n\t\treturn {\n\t\t\tvariant: \"default\",\n\t\t\tstate: core.state,\n\t\t\talive: core.alive,\n\t\t\treadTranscriptPage: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.readTranscriptPage(args, context);\n\t\t\t},\n\t\t\tprompt: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.prompt(args, context);\n\t\t\t},\n\t\t\tsteer: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.steer(args, context);\n\t\t\t},\n\t\t\tabort: (ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.abort(context);\n\t\t\t},\n\t\t\tabortOperation: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.abortOperation(args, context);\n\t\t\t},\n\t\t\tsetModel: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.setModel(args, context);\n\t\t\t},\n\t\t\tsetThinking: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.setThinking(args, context);\n\t\t\t},\n\t\t\tsetFastMode: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.setFastMode(args, context);\n\t\t\t},\n\t\t\tsetAgentLock: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.setAgentLock(args, context);\n\t\t\t},\n\t\t\tfollowUp: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.followUp(args, context);\n\t\t\t},\n\t\t\tenqueueAutomatic: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.enqueueAutomatic(args, context);\n\t\t\t},\n\t\t\tremoveQueued: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.removeQueued(args, context);\n\t\t\t},\n\t\t\tpromoteQueued: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.promoteQueued(args, context);\n\t\t\t},\n\t\t\tresumeQueue: (ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.resumeQueue(context);\n\t\t\t},\n\t\t\tclearQueue: (ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.clearQueue(context);\n\t\t\t},\n\t\t\trewind: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.rewind(args, context);\n\t\t\t},\n\t\t\textensionUiResponse: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.extensionUiResponse(args, context);\n\t\t\t},\n\t\t\tgetState: (ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.getState(context);\n\t\t\t},\n\t\t\tgetSessionStats: (ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.getSessionStats(context);\n\t\t\t},\n\t\t\tgetCommands: (ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.getCommands(context);\n\t\t\t},\n\t\t\tgetAvailableModels: (ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.getAvailableModels(context);\n\t\t\t},\n\t\t\tgetAvailableThinkingLevels: (ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.getAvailableThinkingLevels(context);\n\t\t\t},\n\t\t\tcompact: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.compact(args, context);\n\t\t\t},\n\t\t\tsetName: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.setName(args, context);\n\t\t\t},\n\t\t\tsetGroups: (args, ctx) => {\n\t\t\t\tconst [runtime, context] = live(ctx);\n\t\t\t\treturn runtime.setGroups(args, context);\n\t\t\t}\n\t\t};\n\t});\n}\n//#endregion\nexport { createAgentSessionRuntime, serveAgentSessions };\n\n//# sourceMappingURL=piSessionRuntime.mjs.map","//#region src/server/largeFrameLink.ts\nconst LARGE_FRAME_SIZE = 33554432;\n/** Report encoded sizes without serializing or retaining frame payloads a second time. */\nfunction reportingLargeFrames(link, notice) {\n\tconst provided = /* @__PURE__ */ new Map();\n\tconst consumed = /* @__PURE__ */ new Map();\n\tconst calls = /* @__PURE__ */ new Map();\n\tlink.onClose(() => {\n\t\tprovided.clear();\n\t\tconsumed.clear();\n\t\tcalls.clear();\n\t});\n\treturn {\n\t\tget closed() {\n\t\t\treturn link.closed;\n\t\t},\n\t\tsend(frame) {\n\t\t\tif (frame.t === \"shape\") provided.set(frame.id, frame.contract);\n\t\t\tlet member = \"\";\n\t\t\tif (frame.t === \"state\") member = `${provided.get(frame.hold) ?? frame.hold}.${frame.m}`;\n\t\t\tif (frame.t === \"call\") member = `${consumed.get(frame.hold) ?? frame.hold}.${frame.member}`;\n\t\t\tif (frame.t === \"result\") member = calls.get(frame.id) ?? String(frame.id);\n\t\t\tconst size = link.send(frame);\n\t\t\tif (frame.t === \"result\") calls.delete(frame.id);\n\t\t\tif (frame.t === \"gone\") provided.delete(frame.id);\n\t\t\tif (frame.t === \"release\") consumed.delete(frame.id);\n\t\t\tif (size !== void 0 && size > LARGE_FRAME_SIZE) notice(`large Chord frame: ${frame.t}${member ? ` ${member}` : \"\"}, encoded size ${size} (limit ${LARGE_FRAME_SIZE})`);\n\t\t\treturn size;\n\t\t},\n\t\treceive(handler) {\n\t\t\tlink.receive((frame) => {\n\t\t\t\tif (frame.t === \"shape\") consumed.set(frame.id, frame.contract);\n\t\t\t\tif (frame.t === \"call\") calls.set(frame.id, `${provided.get(frame.hold) ?? frame.hold}.${frame.member}`);\n\t\t\t\tif (frame.t === \"cancel\") calls.delete(frame.id);\n\t\t\t\tif (frame.t === \"release\") provided.delete(frame.id);\n\t\t\t\tif (frame.t === \"gone\") consumed.delete(frame.id);\n\t\t\t\thandler(frame);\n\t\t\t});\n\t\t},\n\t\tonClose: (handler) => link.onClose(handler),\n\t\tclose: (reason) => link.close(reason)\n\t};\n}\n//#endregion\nexport { reportingLargeFrames };\n\n//# sourceMappingURL=largeFrameLink.mjs.map","//#region src/server/threadJournals.ts\nconst POLL_MS = 250;\nfunction keyOf(sessionId, threadId) {\n\treturn `${sessionId}\\n${threadId}`;\n}\n/** Follows child transcripts only while at least one browser thread is subscribed. */\nfunction createThreadJournals(options) {\n\tconst tails = /* @__PURE__ */ new Map();\n\tconst listeners = /* @__PURE__ */ new Set();\n\tlet timer;\n\tconst advance = (tail) => {\n\t\tif (tail.stop) return [];\n\t\tconst thread = options.resolve(tail.sessionId, tail.threadId);\n\t\tif (!thread) return [];\n\t\tconst state = thread.state;\n\t\tif (state) {\n\t\t\ttail.stop = state.subscribe((value) => {\n\t\t\t\tconst frame = {\n\t\t\t\t\ttype: \"transcript_state\",\n\t\t\t\t\tstate: value\n\t\t\t\t};\n\t\t\t\ttail.retained = [frame];\n\t\t\t\tfor (const listener of listeners) listener({\n\t\t\t\t\tsessionId: tail.sessionId,\n\t\t\t\t\tthreadId: tail.threadId,\n\t\t\t\t\tframe\n\t\t\t\t});\n\t\t\t});\n\t\t\ttail.retained = [{\n\t\t\t\ttype: \"transcript_state\",\n\t\t\t\tstate: state.value\n\t\t\t}];\n\t\t} else {\n\t\t\ttail.stop = () => void 0;\n\t\t\ttail.retained = [{ type: \"transcript_ready\" }];\n\t\t}\n\t\treturn tail.retained;\n\t};\n\tconst syncTimer = () => {\n\t\tconst waiting = [...tails.values()].some((tail) => !tail.stop);\n\t\tif (waiting && timer === void 0) timer = setInterval(tick, POLL_MS);\n\t\tif (!waiting && timer !== void 0) {\n\t\t\tclearInterval(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t};\n\tfunction tick() {\n\t\tfor (const tail of tails.values()) for (const frame of advance(tail)) for (const listener of listeners) listener({\n\t\t\tsessionId: tail.sessionId,\n\t\t\tthreadId: tail.threadId,\n\t\t\tframe\n\t\t});\n\t\tsyncTimer();\n\t}\n\treturn {\n\t\tasync readPage(sessionId, threadId, request, context) {\n\t\t\tconst thread = options.resolve(sessionId, threadId);\n\t\t\tif (!thread) throw new Error(\"Child transcript not found\");\n\t\t\tconst { threadId: _threadId, ...query } = request;\n\t\t\treturn thread.readTranscriptPage(query, context.abortSignal);\n\t\t},\n\t\tsubscribe(sessionId, threadId) {\n\t\t\tconst key = keyOf(sessionId, threadId);\n\t\t\tconst tail = tails.get(key) ?? {\n\t\t\t\tsessionId,\n\t\t\t\tthreadId,\n\t\t\t\trefs: 0,\n\t\t\t\tretained: []\n\t\t\t};\n\t\t\tif (!tails.has(key)) tails.set(key, tail);\n\t\t\ttail.refs += 1;\n\t\t\tadvance(tail);\n\t\t\tsyncTimer();\n\t\t\treturn [...tail.retained];\n\t\t},\n\t\tunsubscribe(sessionId, threadId) {\n\t\t\tconst key = keyOf(sessionId, threadId);\n\t\t\tconst tail = tails.get(key);\n\t\t\tif (tail === void 0) return;\n\t\t\ttail.refs -= 1;\n\t\t\tif (tail.refs <= 0) {\n\t\t\t\ttail.stop?.();\n\t\t\t\ttails.delete(key);\n\t\t\t}\n\t\t\tsyncTimer();\n\t\t},\n\t\tonFrame(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => listeners.delete(listener);\n\t\t},\n\t\tclose() {\n\t\t\tif (timer !== void 0) clearInterval(timer);\n\t\t\ttimer = void 0;\n\t\t\tfor (const tail of tails.values()) tail.stop?.();\n\t\t\ttails.clear();\n\t\t\tlisteners.clear();\n\t\t}\n\t};\n}\n//#endregion\nexport { createThreadJournals };\n\n//# sourceMappingURL=threadJournals.mjs.map","import { harnessErrorMessage } from \"./src/server/harnessErrorMessage.mjs\";\nimport { PO_SERVER_HOST } from \"./src/schemas/protocolContracts.mjs\";\nimport { PoChannelsContract, PoChannelsStateSchema } from \"./src/schemas/protocolChannelsContract.mjs\";\nimport { SessionSummarySchema, WorkspaceSchema } from \"./src/schemas/httpApiContracts.mjs\";\nimport { HubNoticeSchema, PoHubContract } from \"./src/schemas/protocolHubContract.mjs\";\nimport { PoThreadContract, PoThreadFrameSchema } from \"./src/schemas/protocolThreadContract.mjs\";\nimport \"./sessionProtocol.mjs\";\nimport { serveAgentSessions } from \"./src/pi/piSessionRuntime.mjs\";\nimport { reportingLargeFrames } from \"./src/server/largeFrameLink.mjs\";\nimport { createThreadJournals } from \"./src/server/threadJournals.mjs\";\nimport { randomUUID } from \"node:crypto\";\nimport { Type } from \"typebox\";\nimport { createHost, forbidden } from \"@earendil-works/chord\";\n//#region src/server/headlessProtocol.ts\nconst MAX_PENDING_NOTICES = 64;\n/** A browser switching back to a thread quickly keeps its tail open. */\nconst THREAD_LINGER_MS = 5e3;\nfunction sessionView(session) {\n\treturn {\n\t\tid: session.id,\n\t\t...session.workspaceId === void 0 ? {} : { workspaceId: session.workspaceId },\n\t\t...session.webComposition === void 0 ? {} : { webComposition: { ...session.webComposition } },\n\t\t...session.nativeComposition === void 0 ? {} : { nativeComposition: { ...session.nativeComposition } },\n\t\tname: session.name,\n\t\tcwd: session.cwd,\n\t\tcreatedAt: session.createdAt,\n\t\tupdatedAt: session.updatedAt ?? session.createdAt,\n\t\tphase: session.phase ?? \"idle\",\n\t\tphaseSince: session.phaseSince ?? session.createdAt,\n\t\tattach: \"attached\",\n\t\tpendingMessageCount: session.pendingMessageCount ?? 0,\n\t\teverPrompted: session.everPrompted ?? false,\n\t\tawaitingInput: session.awaitingInput ?? false,\n\t\t...session.lastSettledAt === void 0 ? {} : { lastSettledAt: session.lastSettledAt },\n\t\t...session.backgroundWorkActive == null ? {} : { backgroundWorkActive: session.backgroundWorkActive },\n\t\t...session.git === void 0 ? {} : { git: {\n\t\t\tbranch: session.git.branch,\n\t\t\tdirty: session.git.dirty\n\t\t} },\n\t\t...session.profile === void 0 ? {} : { profile: {\n\t\t\tname: session.profile.name,\n\t\t\t...session.profile.displayName === void 0 ? {} : { displayName: session.profile.displayName },\n\t\t\t...session.profile.iconVersion === void 0 ? {} : { iconVersion: session.profile.iconVersion }\n\t\t} },\n\t\t...session.parentSessionId === void 0 ? {} : { parentSessionId: session.parentSessionId },\n\t\t...session.sessionProvenance === void 0 ? {} : { sessionProvenance: session.sessionProvenance },\n\t\t...session.groups === void 0 || session.groups.length === 0 ? {} : { groups: [...session.groups] },\n\t\t...session.pendingSetups === void 0 ? {} : { pendingSetups: session.pendingSetups.map((setup) => ({\n\t\t\tid: setup.id,\n\t\t\tname: setup.name,\n\t\t\tcreatedAt: setup.createdAt,\n\t\t\t...setup.cwd === void 0 ? {} : { cwd: setup.cwd },\n\t\t\t...setup.setupKind === void 0 ? {} : { setupKind: setup.setupKind },\n\t\t\t...setup.status === void 0 ? {} : { status: setup.status },\n\t\t\t...setup.errorCode === void 0 ? {} : { errorCode: setup.errorCode }\n\t\t})) },\n\t\t...session.activity === void 0 ? {} : { activity: {\n\t\t\tlabel: session.activity.label,\n\t\t\t...session.activity.attention === true ? { attention: true } : {},\n\t\t\t...session.activity.since === void 0 ? {} : { since: session.activity.since }\n\t\t} }\n\t};\n}\n/**\n* A recorded session with no runtime behind it yet.\n*\n* Carries the same field set as a live session so the rail keys both by id and\n* swaps one for the other in place once the server reopens the journal.\n*/\nfunction dormantView(record) {\n\treturn {\n\t\tid: record.sessionId,\n\t\tworkspaceId: record.workspaceId,\n\t\tname: record.name,\n\t\tcwd: record.cwd,\n\t\tcreatedAt: record.createdAt,\n\t\tupdatedAt: record.createdAt,\n\t\tphase: \"idle\",\n\t\tphaseSince: record.createdAt,\n\t\tattach: \"attached\",\n\t\tpendingMessageCount: 0,\n\t\teverPrompted: false,\n\t\tawaitingInput: false,\n\t\tdormant: true,\n\t\t...record.parentSessionId === void 0 ? {} : { parentSessionId: record.parentSessionId },\n\t\t...record.sessionProvenance === void 0 ? {} : { sessionProvenance: record.sessionProvenance },\n\t\t...record.groups === void 0 || record.groups.length === 0 ? {} : { groups: [...record.groups] }\n\t};\n}\n/** Each restarted session host gets a new generation, so its projection starts fresh. */\nconst generations = /* @__PURE__ */ new WeakMap();\nlet nextGeneration = 0;\nfunction generationOf(host) {\n\tlet generation = generations.get(host);\n\tif (generation === void 0) {\n\t\tgeneration = nextGeneration++;\n\t\tgenerations.set(host, generation);\n\t}\n\treturn generation;\n}\nfunction permitsSession(hub, mount, sessionId, authorize = () => true) {\n\tconst session = hub.session(sessionId);\n\treturn session !== void 0 && authorize(sessionId) && (mount.scope === \"global\" || session.workspaceId === mount.workspaceId && (mount.scope === \"workspace\" || mount.sessionId === sessionId));\n}\nfunction permitsDormant(mount, record) {\n\tif (mount.scope === \"global\") return true;\n\tif (record.workspaceId !== mount.workspaceId) return false;\n\treturn mount.scope === \"workspace\" || mount.sessionId === record.sessionId;\n}\nconst eventsOf = (hub) => ({ subscribe: (listener) => hub.onEvent(listener) });\n/** One Chord host for every browser, native and relayed connection over the process-local hub. */\nfunction createHeadlessProtocol(options) {\n\tconst hub = options.hub;\n\tconst dormantSessions = () => options.dormantSessions === void 0 ? [] : options.dormantSessions();\n\tconst connections = /* @__PURE__ */ new Map();\n\tconst threads = createThreadJournals({ resolve: (sessionId, threadId) => hub.childThread(sessionId, threadId) });\n\tconst host = createHost({\n\t\tname: PO_SERVER_HOST,\n\t\tself: { connectionId: PO_SERVER_HOST },\n\t\tprincipalKey: (principal) => principal.connectionId,\n\t\tonError: (error) => options.onNotice?.(`headless protocol error (${harnessErrorMessage(error)})`)\n\t});\n\tconst connectionOf = (principal) => {\n\t\tconst connection = connections.get(principal.connectionId);\n\t\tif (connection === void 0) throw forbidden(\"This connection has closed.\");\n\t\treturn {\n\t\t\t...connection,\n\t\t\tconnectionId: principal.connectionId\n\t\t};\n\t};\n\tconst reachable = (connection, sessionId) => permitsSession(hub, connection.mount, sessionId, (id) => connection.authorizeSession(id));\n\tconst stopClaims = hub.computerUse?.subscribe?.(() => {\n\t\tfor (const [connectionId, connection] of connections) {\n\t\t\tlet revoked = false;\n\t\t\tfor (const sessionId of connection.sessions) if (!connection.authorizeSession(sessionId)) revoked = true;\n\t\t\tif (!revoked) continue;\n\t\t\tconnection.sessions.clear();\n\t\t\thost.invalidatePrincipal((principal) => principal.connectionId === connectionId);\n\t\t}\n\t});\n\thost.serve(PoHubContract, (_input, principal, self) => {\n\t\tconst connection = connectionOf(principal);\n\t\tconst { mount } = connection;\n\t\tconst visibleSessions = () => {\n\t\t\tconst views = {};\n\t\t\tfor (const session of hub.snapshot()) if (reachable(connection, session.id)) views[session.id] = sessionView(session);\n\t\t\tconst registered = new Set(hub.workspaces().map((workspace) => workspace.id));\n\t\t\tfor (const record of dormantSessions()) if (views[record.sessionId] === void 0 && registered.has(record.workspaceId) && connection.authorizeSession(record.sessionId) && permitsDormant(mount, record)) views[record.sessionId] = dormantView(record);\n\t\t\treturn views;\n\t\t};\n\t\tconst visibleWorkspaces = () => {\n\t\t\tconst views = {};\n\t\t\tfor (const workspace of hub.workspaces()) if (mount.scope === \"global\" || workspace.id === mount.workspaceId) views[workspace.id] = {\n\t\t\t\tid: workspace.id,\n\t\t\t\troot: workspace.root,\n\t\t\t\t...workspace.name === void 0 ? {} : { name: workspace.name },\n\t\t\t\t...workspace.sandbox === void 0 ? {} : { sandbox: workspace.sandbox },\n\t\t\t\t...workspace.sandboxState === void 0 ? {} : { sandboxState: workspace.sandboxState },\n\t\t\t\t...workspace.sandboxReason === void 0 ? {} : { sandboxReason: workspace.sandboxReason },\n\t\t\t\tavailable: workspace.available !== false\n\t\t\t};\n\t\t\treturn views;\n\t\t};\n\t\tconst sessions = self.state(\"sessions\", Type.Record(Type.String(), SessionSummarySchema), { init: visibleSessions });\n\t\tconst workspaces = self.state(\"workspaces\", Type.Record(Type.String(), WorkspaceSchema), { init: visibleWorkspaces });\n\t\tconst pending = self.state(\"pending\", Type.Array(HubNoticeSchema), []);\n\t\tself.on(\"hub\", eventsOf(hub), (event, ctx) => {\n\t\t\tswitch (event.kind) {\n\t\t\t\tcase \"upsert\":\n\t\t\t\tcase \"removed\":\n\t\t\t\tcase \"dormant_changed\":\n\t\t\t\t\tsessions.replace(ctx, visibleSessions(), { diff: true });\n\t\t\t\t\treturn;\n\t\t\t\tcase \"workspace_upsert\":\n\t\t\t\tcase \"workspace_removed\":\n\t\t\t\t\tworkspaces.replace(ctx, visibleWorkspaces(), { diff: true });\n\t\t\t\t\treturn;\n\t\t\t\tcase \"frame\":\n\t\t\t\t\tif (!reachable(connection, event.sessionId)) return;\n\t\t\t\t\tpending.change(ctx, (draft) => {\n\t\t\t\t\t\tdraft.push({\n\t\t\t\t\t\t\tid: randomUUID(),\n\t\t\t\t\t\t\tsessionId: event.sessionId,\n\t\t\t\t\t\t\tframe: event.frame\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (draft.length > MAX_PENDING_NOTICES) draft.splice(0, draft.length - MAX_PENDING_NOTICES);\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\tcase \"channel\": return;\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tvariant: \"default\",\n\t\t\tsessions,\n\t\t\tworkspaces,\n\t\t\tpending,\n\t\t\treadHome: async (request) => {\n\t\t\t\tif (!hub.readHome) throw new Error(\"Home read is unavailable.\");\n\t\t\t\treturn hub.readHome(request, (id) => reachable(connection, id));\n\t\t\t},\n\t\t\tinvoke: async (call, ctx) => {\n\t\t\t\tif (call.mount.scope === \"session\" && !connection.authorizeSession(call.mount.sessionId)) throw forbidden(\"This session belongs to its Desktop instance.\");\n\t\t\t\tif (mount.scope !== \"global\") {\n\t\t\t\t\tif (!(call.mount.scope === \"session\" ? permitsSession(hub, mount, call.mount.sessionId) : mount.scope === \"workspace\" && call.mount.scope === \"workspace\" && call.mount.workspaceId === mount.workspaceId)) throw forbidden(\"Plugin is outside this WebSocket scope.\");\n\t\t\t\t}\n\t\t\t\treturn await hub.invokePlugin(call, \"client-to-server\", {\n\t\t\t\t\tconnectionId: connection.connectionId,\n\t\t\t\t\tsignal: ctx.signal\n\t\t\t\t});\n\t\t\t},\n\t\t\tackNotice: async ({ id }, ctx) => {\n\t\t\t\tpending.change(ctx, (draft) => draft.filter((notice) => notice.id !== id));\n\t\t\t}\n\t\t};\n\t});\n\thost.serve(PoThreadContract, ({ sessionId, threadId }, principal, self) => {\n\t\tconst connection = connectionOf(principal);\n\t\tif (!reachable(connection, sessionId)) throw forbidden(`No session ${sessionId}`);\n\t\tconnection.sessions.add(sessionId);\n\t\tconst tail = self.resource(\"tail\", {\n\t\t\tversion: 1,\n\t\t\topen: () => threads.subscribe(sessionId, threadId),\n\t\t\tclose: () => threads.unsubscribe(sessionId, threadId)\n\t\t});\n\t\tconst frame = self.state(\"frame\", PoThreadFrameSchema, { init: () => tail.value?.at(-1) ?? null });\n\t\tself.on(\"frames\", { subscribe: (listener) => threads.onFrame(listener) }, (event, ctx) => {\n\t\t\tif (event.sessionId === sessionId && event.threadId === threadId) frame.replace(ctx, event.frame, { diff: true });\n\t\t});\n\t\treturn {\n\t\t\tvariant: \"default\",\n\t\t\tframe\n\t\t};\n\t}, { linger: THREAD_LINGER_MS });\n\thost.serve(PoChannelsContract, ({ sessionId }, principal, self) => {\n\t\tconst connection = connectionOf(principal);\n\t\tif (!reachable(connection, sessionId)) throw forbidden(`No session ${sessionId}`);\n\t\tconnection.sessions.add(sessionId);\n\t\tconst visible = (frameType) => frameType !== \"computer_use_state\" || connection.authorizeComputerUse(sessionId);\n\t\tconst latest = self.state(\"latest\", PoChannelsStateSchema, { init: () => {\n\t\t\tconst payloads = {};\n\t\t\tfor (const channelFrame of hub.channelFrames(sessionId)) if (visible(channelFrame.type)) payloads[channelFrame.type] = channelFrame.payload;\n\t\t\treturn payloads;\n\t\t} });\n\t\tself.on(\"hub\", eventsOf(hub), (event, ctx) => {\n\t\t\tif (event.kind !== \"channel\" || event.sessionId !== sessionId || !visible(event.frameType)) return;\n\t\t\tif (event.connectionId !== void 0 && event.connectionId !== connection.connectionId) return;\n\t\t\tlatest.change(ctx, (draft) => {\n\t\t\t\tdraft[event.frameType] = event.payload;\n\t\t\t});\n\t\t});\n\t\treturn {\n\t\t\tvariant: \"default\",\n\t\t\tlatest,\n\t\t\treceive: async ({ type, payload }) => {\n\t\t\t\tif (!connection.authorizeSession(sessionId)) throw forbidden(\"This session belongs to Desktop.\");\n\t\t\t\thub.receiveChannel(sessionId, type, payload, connection.connectionId, connection.authorizeDesktop(), connection.authorizeComputerUse(sessionId));\n\t\t\t}\n\t\t};\n\t});\n\tserveAgentSessions(host, { resolve(sessionId, principal) {\n\t\tconst connection = connectionOf(principal);\n\t\tconst session = hub.session(sessionId);\n\t\tif (!session || !reachable(connection, session.id)) return void 0;\n\t\tconnection.sessions.add(sessionId);\n\t\tconst permitted = () => hub.session(session.id)?.host === session.host && connection.authorizeSession(session.id);\n\t\tconst forward = session.host.agentSession;\n\t\tif (forward !== void 0) return {\n\t\t\tgeneration: generationOf(session.host),\n\t\t\texited: session.host.runtime.exited,\n\t\t\tpermitted,\n\t\t\tforward\n\t\t};\n\t\treturn {\n\t\t\tgeneration: generationOf(session.host),\n\t\t\texited: session.host.runtime.exited,\n\t\t\tpermitted,\n\t\t\toptions: {\n\t\t\t\truntime: session.host.runtime,\n\t\t\t\tonPresentationFrame: (listen) => session.host.onPresentationFrame((frame) => {\n\t\t\t\t\tif (permitted()) listen(frame);\n\t\t\t\t}),\n\t\t\t\trespondToExtensionUi: (frame) => {\n\t\t\t\t\tif (!permitted()) throw forbidden(\"This session belongs to Desktop.\");\n\t\t\t\t\treturn session.host.respondToExtensionUi(frame);\n\t\t\t\t},\n\t\t\t\treadThreadTranscript: (threadId, request, readContext) => {\n\t\t\t\t\tif (!permitted()) throw forbidden(\"This session belongs to Desktop.\");\n\t\t\t\t\treturn threads.readPage(session.id, threadId, request, readContext);\n\t\t\t\t},\n\t\t\t\tsessionId: session.id,\n\t\t\t\tsessionName: session.name,\n\t\t\t\tcwd: session.cwd,\n\t\t\t\ttelemetry: options.telemetry\n\t\t\t}\n\t\t};\n\t} });\n\tlet closing;\n\treturn {\n\t\taccept(link, access = {}) {\n\t\t\tif (closing !== void 0) {\n\t\t\t\tlink.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst connectionId = randomUUID();\n\t\t\tconst authorizeSession = access.authorizeSession ?? ((id) => !hub.computerUse?.ownsSession?.(id));\n\t\t\tconst authorizeDesktop = access.authorizeDesktop ?? (() => false);\n\t\t\tconnections.set(connectionId, {\n\t\t\t\tmount: access.mount ?? { scope: \"global\" },\n\t\t\t\tauthorizeSession,\n\t\t\t\tauthorizeDesktop,\n\t\t\t\tauthorizeComputerUse: access.authorizeComputerUse ?? (() => authorizeDesktop()),\n\t\t\t\tsessions: /* @__PURE__ */ new Set()\n\t\t\t});\n\t\t\tlink.onClose(() => {\n\t\t\t\tconnections.delete(connectionId);\n\t\t\t\thub.disconnectChannels(connectionId);\n\t\t\t});\n\t\t\thost.accept(options.onNotice ? reportingLargeFrames(link, options.onNotice) : link, {\n\t\t\t\tprincipal: { connectionId },\n\t\t\t\tkind: \"client\"\n\t\t\t});\n\t\t},\n\t\tclose() {\n\t\t\tclosing ??= (async () => {\n\t\t\t\tstopClaims?.();\n\t\t\t\tthreads.close();\n\t\t\t\tawait host.close();\n\t\t\t})();\n\t\t\treturn closing;\n\t\t}\n\t};\n}\n//#endregion\nexport { createHeadlessProtocol };\n\n//# sourceMappingURL=headlessProtocol.mjs.map","import { createHash, createHmac, randomBytes, randomInt, timingSafeEqual } from \"node:crypto\";\n//#region src/services/sessionMcpAuthorization/index.ts\nconst ACCESS_TOKEN_TTL_MS = 9e5;\nconst AUTHORIZATION_CODE_TTL_MS = 3e5;\nconst CLIENT_ID_BYTES = 18;\nconst CLIENT_SECRET_BYTES = 32;\nconst DEFAULT_MAX_RECORDS = 1e4;\nconst GRANT_ID_BYTES = 18;\nconst REFRESH_TOKEN_TTL_MS = 2592e6;\nconst TOKEN_BYTES = 32;\nconst URL_TOKEN_HEADER = Buffer.from(\"{\\\"alg\\\":\\\"HS256\\\",\\\"typ\\\":\\\"JWT\\\"}\").toString(\"base64url\");\nconst URL_TOKEN_ISSUER = \"po-session-mcp\";\nconst URL_TOKEN_MAX_LENGTH = 4096;\nvar SessionMcpOAuthError = class extends Error {\n\tcode;\n\tconstructor(code, message) {\n\t\tsuper(message);\n\t\tthis.name = \"SessionMcpOAuthError\";\n\t\tthis.code = code;\n\t}\n};\n/**\n* Conversation routing is mandatory. Legacy registrations are migrated at read time\n* so they cannot continue to share their parent runtime.\n*/\nfunction sessionMcpRouting(value) {\n\tif (value === void 0 || value === \"session\" || value === \"conversation\") return \"conversation\";\n\tthrow new SessionMcpOAuthError(\"invalid_request\", \"Session MCP routing is not supported.\");\n}\nconst SESSION_MCP_TOOL_PREFIX_MAX_LENGTH = 24;\nconst SESSION_MCP_TOOL_PREFIX = /^[a-z0-9]+(?:_[a-z0-9]+)*$/u;\nconst FALLBACK_TOOL_PREFIXES = Object.freeze([\n\t\"alba\",\n\t\"bruno\",\n\t\"cora\",\n\t\"dex\",\n\t\"elio\",\n\t\"fern\",\n\t\"gus\",\n\t\"hana\",\n\t\"ivo\",\n\t\"juno\",\n\t\"kai\",\n\t\"lena\",\n\t\"milo\",\n\t\"nora\",\n\t\"otto\",\n\t\"pia\"\n]);\n/**\n* Remote tool names are `${prefix}_${name}`. The prefix keeps them distinct from\n* the remote agent's native tools and stays inside OpenAI and MCP name rules.\n*/\nfunction sessionMcpToolPrefix(value) {\n\tif (value === void 0) return void 0;\n\tif (typeof value !== \"string\" || value.length > SESSION_MCP_TOOL_PREFIX_MAX_LENGTH || !SESSION_MCP_TOOL_PREFIX.test(value)) throw new SessionMcpOAuthError(\"invalid_request\", `Tool prefix must be 1 to ${SESSION_MCP_TOOL_PREFIX_MAX_LENGTH} lowercase letters or digits, joined by single underscores.`);\n\treturn value;\n}\n/** Normalized session name, or a random readable word when the name is empty or the CLI default. */\nfunction defaultSessionMcpToolPrefix(sessionName) {\n\tconst prefix = sessionName.normalize(\"NFKD\").replace(/\\p{M}/gu, \"\").toLowerCase().replace(/[^a-z0-9]+/gu, \"_\").replace(/^_+|_+$/gu, \"\").slice(0, SESSION_MCP_TOOL_PREFIX_MAX_LENGTH).replace(/_+$/u, \"\");\n\tif (prefix !== \"\" && prefix !== \"untitled\") return prefix;\n\treturn FALLBACK_TOOL_PREFIXES[randomInt(FALLBACK_TOOL_PREFIXES.length)];\n}\nfunction digest(value) {\n\treturn createHash(\"sha256\").update(value).digest();\n}\nfunction tokenKey(value) {\n\treturn digest(value).toString(\"hex\");\n}\nfunction opaque(bytes = TOKEN_BYTES) {\n\treturn randomBytes(bytes).toString(\"base64url\");\n}\nfunction exactSecret(actual, expectedHash) {\n\treturn timingSafeEqual(digest(actual), expectedHash);\n}\nfunction urlTokenSignature(input, key) {\n\treturn createHmac(\"sha256\", key).update(input).digest();\n}\nfunction parseUrlToken(token) {\n\tif (token.length > URL_TOKEN_MAX_LENGTH) return void 0;\n\tconst parts = token.split(\".\");\n\tif (parts.length !== 3) return void 0;\n\tconst [header, payload, encodedSignature] = parts;\n\tif (header !== URL_TOKEN_HEADER || !/^[A-Za-z0-9_-]{1,2048}$/u.test(payload) || !/^[A-Za-z0-9_-]{43}$/u.test(encodedSignature)) return void 0;\n\ttry {\n\t\tconst payloadBytes = Buffer.from(payload, \"base64url\");\n\t\tconst signature = Buffer.from(encodedSignature, \"base64url\");\n\t\tif (payloadBytes.toString(\"base64url\") !== payload || signature.length !== 32 || signature.toString(\"base64url\") !== encodedSignature) return void 0;\n\t\tconst value = JSON.parse(payloadBytes.toString(\"utf8\"));\n\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return void 0;\n\t\tconst claims = value;\n\t\tif (Object.keys(value).sort().join(\",\") !== \"aud,iat,iss,sid,sub\" || claims.iss !== URL_TOKEN_ISSUER || typeof claims.sub !== \"string\" || claims.sub === \"\" || typeof claims.sid !== \"string\" || claims.sid === \"\" || typeof claims.aud !== \"string\" || claims.aud === \"\" || typeof claims.iat !== \"number\" || !Number.isSafeInteger(claims.iat)) return void 0;\n\t\treturn {\n\t\t\tclaims,\n\t\t\tinput: `${header}.${payload}`,\n\t\t\tsignature\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction requireHttpsUrl(value, label, allowQuery) {\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(value);\n\t} catch {\n\t\tthrow new SessionMcpOAuthError(\"invalid_request\", `${label} must be an absolute HTTPS URL.`);\n\t}\n\tif (parsed.protocol !== \"https:\" || parsed.username !== \"\" || parsed.password !== \"\" || parsed.hash !== \"\" || !allowQuery && parsed.search !== \"\") throw new SessionMcpOAuthError(\"invalid_request\", `${label} must be an absolute HTTPS URL without credentials, a query, or a fragment.`);\n\treturn parsed.href;\n}\nfunction requireName(value, label) {\n\tconst normalized = value.trim();\n\tif (normalized === \"\") throw new SessionMcpOAuthError(\"invalid_request\", `${label} must not be empty.`);\n\treturn normalized;\n}\nfunction exactUniqueGrants(values, label) {\n\tif (values.some((value) => value === \"\" || value !== value.trim())) throw new SessionMcpOAuthError(\"invalid_request\", `${label} grants must contain exact non-empty names.`);\n\treturn Object.freeze([...new Set(values)]);\n}\n/** In-memory restricted OAuth authority. It intentionally has no discovery or client registration surface. */\nfunction createSessionMcpAuthorizationService(options = {}) {\n\tconst now = options.now ?? Date.now;\n\tconst codeTtl = options.authorizationCodeTtlMs ?? AUTHORIZATION_CODE_TTL_MS;\n\tconst accessTtl = options.accessTokenTtlMs ?? ACCESS_TOKEN_TTL_MS;\n\tconst refreshTtl = options.refreshTokenTtlMs ?? REFRESH_TOKEN_TTL_MS;\n\tconst maxRecords = options.maxRecords ?? DEFAULT_MAX_RECORDS;\n\tif (!Number.isSafeInteger(maxRecords) || maxRecords < 3) throw new Error(\"Session MCP authorization maxRecords must be a safe integer of at least 3.\");\n\tconst clients = /* @__PURE__ */ new Map();\n\tconst bindings = /* @__PURE__ */ new Map();\n\tconst grants = /* @__PURE__ */ new Map();\n\tconst codes = /* @__PURE__ */ new Map();\n\tconst accessTokens = /* @__PURE__ */ new Map();\n\tconst refreshTokens = /* @__PURE__ */ new Map();\n\tconst consumedRefreshTokens = /* @__PURE__ */ new Map();\n\tconst publicClient = ({ secretHash: _secretHash, ...client }) => client;\n\tconst recordCount = () => grants.size + codes.size + accessTokens.size + refreshTokens.size + consumedRefreshTokens.size;\n\tconst sweep = () => {\n\t\tconst currentTime = now();\n\t\tfor (const [key, value] of codes) if (value.expiresAt <= currentTime) codes.delete(key);\n\t\tfor (const [key, value] of accessTokens) if (value.expiresAt <= currentTime) accessTokens.delete(key);\n\t\tfor (const [key, value] of refreshTokens) if (value.expiresAt <= currentTime) refreshTokens.delete(key);\n\t\tfor (const [key, value] of consumedRefreshTokens) if (value.expiresAt <= currentTime) consumedRefreshTokens.delete(key);\n\t\tconst referencedGrants = /* @__PURE__ */ new Set();\n\t\tfor (const value of codes.values()) referencedGrants.add(value.grant.id);\n\t\tfor (const value of accessTokens.values()) referencedGrants.add(value.grant.id);\n\t\tfor (const value of refreshTokens.values()) referencedGrants.add(value.grant.id);\n\t\tfor (const value of consumedRefreshTokens.values()) referencedGrants.add(value.grantId);\n\t\tfor (const grantId of grants.keys()) if (!referencedGrants.has(grantId)) grants.delete(grantId);\n\t};\n\tconst requireCapacity = (additionalRecords) => {\n\t\tsweep();\n\t\tif (recordCount() + additionalRecords > maxRecords) throw new SessionMcpOAuthError(\"invalid_request\", \"The authorization service is at capacity.\");\n\t};\n\tconst authenticateClient = (clientId, clientSecret) => {\n\t\tconst client = clients.get(clientId);\n\t\tif (client === void 0 || !exactSecret(clientSecret, client.secretHash)) throw new SessionMcpOAuthError(\"invalid_client\", \"Client authentication failed.\");\n\t\treturn client;\n\t};\n\tconst revokeGrant = (grantId) => {\n\t\tif (!grants.delete(grantId)) return false;\n\t\tfor (const [key, value] of codes) if (value.grant.id === grantId) codes.delete(key);\n\t\tfor (const [key, value] of accessTokens) if (value.grant.id === grantId) accessTokens.delete(key);\n\t\tfor (const [key, value] of refreshTokens) if (value.grant.id === grantId) refreshTokens.delete(key);\n\t\treturn true;\n\t};\n\tconst revokeFamily = (familyId, grantId) => {\n\t\trevokeGrant(grantId);\n\t\tfor (const [key, value] of accessTokens) if (value.familyId === familyId) accessTokens.delete(key);\n\t\tfor (const [key, value] of refreshTokens) if (value.familyId === familyId) refreshTokens.delete(key);\n\t};\n\tconst mintTokens = (grant, familyId = opaque(GRANT_ID_BYTES), familyExpiresAt = now() + refreshTtl) => {\n\t\tconst issuedAt = now();\n\t\tconst accessExpiresAt = Math.min(issuedAt + accessTtl, familyExpiresAt);\n\t\tconst accessToken = opaque();\n\t\tconst refreshToken = opaque();\n\t\taccessTokens.set(tokenKey(accessToken), {\n\t\t\tgrant,\n\t\t\tfamilyId,\n\t\t\texpiresAt: accessExpiresAt\n\t\t});\n\t\trefreshTokens.set(tokenKey(refreshToken), {\n\t\t\tgrant,\n\t\t\tfamilyId,\n\t\t\texpiresAt: familyExpiresAt,\n\t\t\tfamilyExpiresAt\n\t\t});\n\t\treturn {\n\t\t\taccessToken,\n\t\t\trefreshToken,\n\t\t\ttokenType: \"Bearer\",\n\t\t\texpiresIn: Math.max(0, Math.floor((accessExpiresAt - issuedAt) / 1e3)),\n\t\t\tgrant\n\t\t};\n\t};\n\treturn {\n\t\tcreateClient(input) {\n\t\t\tconst createdAt = now();\n\t\t\tconst clientId = opaque(CLIENT_ID_BYTES);\n\t\t\tconst clientSecret = opaque(CLIENT_SECRET_BYTES);\n\t\t\tconst urlCredential = input.authMethod === \"url_token\";\n\t\t\tconst headerCredential = input.authMethod === \"api_key\";\n\t\t\tlet redirectUri = \"\";\n\t\t\tif (!urlCredential && !headerCredential) {\n\t\t\t\tif (typeof input.redirectUri !== \"string\") throw new SessionMcpOAuthError(\"invalid_request\", \"Redirect URI must be an absolute HTTPS URL.\");\n\t\t\t\tredirectUri = requireHttpsUrl(input.redirectUri, \"Redirect URI\", true);\n\t\t\t}\n\t\t\tconst client = {\n\t\t\t\tclientId,\n\t\t\t\tname: requireName(input.name, \"Client name\"),\n\t\t\t\tredirectUri,\n\t\t\t\ttokenEndpointAuthMethod: urlCredential ? \"url_token\" : headerCredential ? \"api_key\" : \"client_secret_post\",\n\t\t\t\tcreatedAt,\n\t\t\t\tsecretHash: digest(clientSecret)\n\t\t\t};\n\t\t\tclients.set(clientId, client);\n\t\t\treturn {\n\t\t\t\t...publicClient(client),\n\t\t\t\tclientSecret\n\t\t\t};\n\t\t},\n\t\treadClient(clientId) {\n\t\t\tconst client = clients.get(clientId);\n\t\t\treturn client === void 0 ? void 0 : publicClient(client);\n\t\t},\n\t\tlistClients() {\n\t\t\treturn [...clients.values()].map(publicClient);\n\t\t},\n\t\trevokeClient(clientId) {\n\t\t\tif (!clients.delete(clientId)) return false;\n\t\t\tbindings.delete(clientId);\n\t\t\tfor (const grant of grants.values()) if (grant.clientId === clientId) revokeGrant(grant.id);\n\t\t\treturn true;\n\t\t},\n\t\tcreateAuthorizationBinding(input) {\n\t\t\tif (!clients.has(input.clientId)) throw new SessionMcpOAuthError(\"invalid_client\", \"Unknown local client.\");\n\t\t\tif (bindings.has(input.clientId)) throw new SessionMcpOAuthError(\"invalid_request\", \"Client authorization is already bound.\");\n\t\t\tif (!Number.isSafeInteger(input.sessionGeneration) || input.sessionGeneration < 0) throw new SessionMcpOAuthError(\"invalid_request\", \"Session generation must be a non-negative safe integer.\");\n\t\t\tconst routing = sessionMcpRouting(input.routing);\n\t\t\tconst scope = input.scope ?? \"restricted\";\n\t\t\tif (scope !== \"session\" && scope !== \"restricted\") throw new SessionMcpOAuthError(\"invalid_request\", \"Authorization scope is not supported.\");\n\t\t\tlet tools;\n\t\t\tlet skills;\n\t\t\tif (scope === \"session\") {\n\t\t\t\tif (input.tools !== void 0 || input.skills !== void 0) throw new SessionMcpOAuthError(\"invalid_request\", \"Session scope cannot include capability grants.\");\n\t\t\t\ttools = Object.freeze([]);\n\t\t\t\tskills = Object.freeze([]);\n\t\t\t} else {\n\t\t\t\tif (!Array.isArray(input.tools) || !Array.isArray(input.skills)) throw new SessionMcpOAuthError(\"invalid_request\", \"Restricted scope requires tool and skill grants.\");\n\t\t\t\ttools = exactUniqueGrants(input.tools, \"Tool\");\n\t\t\t\tskills = exactUniqueGrants(input.skills, \"Skill\");\n\t\t\t}\n\t\t\tconst toolPrefix = sessionMcpToolPrefix(input.toolPrefix);\n\t\t\tconst binding = Object.freeze({\n\t\t\t\tclientId: input.clientId,\n\t\t\t\tsessionId: requireName(input.sessionId, \"Session ID\"),\n\t\t\t\tsessionGeneration: input.sessionGeneration,\n\t\t\t\taudience: requireHttpsUrl(input.audience, \"Audience\", false),\n\t\t\t\tscope,\n\t\t\t\trouting,\n\t\t\t\ttools,\n\t\t\t\tskills,\n\t\t\t\t...toolPrefix === void 0 ? {} : { toolPrefix }\n\t\t\t});\n\t\t\tbindings.set(input.clientId, binding);\n\t\t\treturn binding;\n\t\t},\n\t\treadAuthorizationBinding(clientId) {\n\t\t\treturn bindings.get(clientId);\n\t\t},\n\t\tpersistentRegistration(clientId, workspaceId, verifiedAt) {\n\t\t\tconst client = clients.get(clientId);\n\t\t\tconst binding = bindings.get(clientId);\n\t\t\tif (client === void 0 || binding === void 0 || !Number.isSafeInteger(verifiedAt)) return void 0;\n\t\t\tconst { sessionGeneration: _sessionGeneration, ...persistentBinding } = binding;\n\t\t\treturn {\n\t\t\t\tclient: publicClient(client),\n\t\t\t\tsecretHash: client.secretHash.toString(\"hex\"),\n\t\t\t\tworkspaceId: requireName(workspaceId, \"Workspace ID\"),\n\t\t\t\tbinding: persistentBinding,\n\t\t\t\tverifiedAt\n\t\t\t};\n\t\t},\n\t\trestorePersistentRegistration(registration, sessionGeneration) {\n\t\t\tif (bindings.has(registration.client.clientId) || !/^[a-f0-9]{64}$/u.test(registration.secretHash) || !Number.isSafeInteger(sessionGeneration) || sessionGeneration < 0 || registration.client.clientId !== registration.binding.clientId) return false;\n\t\t\ttry {\n\t\t\t\tconst held = clients.get(registration.client.clientId);\n\t\t\t\tif (held && (held.redirectUri !== registration.client.redirectUri || held.tokenEndpointAuthMethod !== registration.client.tokenEndpointAuthMethod || !timingSafeEqual(held.secretHash, Buffer.from(registration.secretHash, \"hex\")))) return false;\n\t\t\t\tif (registration.client.tokenEndpointAuthMethod !== \"client_secret_post\" && registration.client.tokenEndpointAuthMethod !== \"api_key\" && registration.client.tokenEndpointAuthMethod !== \"url_token\" || registration.client.tokenEndpointAuthMethod !== \"client_secret_post\" && (registration.client.redirectUri !== \"\" || registration.binding.scope !== \"session\")) return false;\n\t\t\t\tconst client = {\n\t\t\t\t\tclientId: requireName(registration.client.clientId, \"Client ID\"),\n\t\t\t\t\tname: requireName(registration.client.name, \"Client name\"),\n\t\t\t\t\tredirectUri: registration.client.tokenEndpointAuthMethod === \"client_secret_post\" ? requireHttpsUrl(registration.client.redirectUri, \"Redirect URI\", true) : registration.client.redirectUri,\n\t\t\t\t\ttokenEndpointAuthMethod: registration.client.tokenEndpointAuthMethod,\n\t\t\t\t\tcreatedAt: registration.client.createdAt,\n\t\t\t\t\tsecretHash: Buffer.from(registration.secretHash, \"hex\")\n\t\t\t\t};\n\t\t\t\tconst routing = sessionMcpRouting(registration.binding.routing);\n\t\t\t\tconst toolPrefix = sessionMcpToolPrefix(registration.binding.toolPrefix);\n\t\t\t\tconst scope = registration.binding.scope;\n\t\t\t\tconst tools = scope === \"session\" ? Object.freeze([]) : exactUniqueGrants(registration.binding.tools, \"Tool\");\n\t\t\t\tconst skills = scope === \"session\" ? Object.freeze([]) : exactUniqueGrants(registration.binding.skills, \"Skill\");\n\t\t\t\tif (scope !== \"session\" && scope !== \"restricted\" || scope === \"session\" && (registration.binding.tools.length !== 0 || registration.binding.skills.length !== 0)) throw new SessionMcpOAuthError(\"invalid_request\", \"Stored Session MCP authorization is invalid.\");\n\t\t\t\tclients.set(client.clientId, client);\n\t\t\t\tbindings.set(client.clientId, Object.freeze({\n\t\t\t\t\tclientId: client.clientId,\n\t\t\t\t\tsessionId: requireName(registration.binding.sessionId, \"Session ID\"),\n\t\t\t\t\tsessionGeneration,\n\t\t\t\t\taudience: requireHttpsUrl(registration.binding.audience, \"Audience\", false),\n\t\t\t\t\tscope,\n\t\t\t\t\trouting,\n\t\t\t\t\ttools,\n\t\t\t\t\tskills,\n\t\t\t\t\t...toolPrefix === void 0 ? {} : { toolPrefix }\n\t\t\t\t}));\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\tclients.delete(registration.client.clientId);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tissueAuthorizationCode(input) {\n\t\t\tconst client = clients.get(input.clientId);\n\t\t\tif (client === void 0) throw new SessionMcpOAuthError(\"invalid_client\", \"Unknown local client.\");\n\t\t\tconst binding = bindings.get(input.clientId);\n\t\t\tif (binding === void 0) throw new SessionMcpOAuthError(\"invalid_request\", \"Client authorization has not been preauthorized.\");\n\t\t\tif (client.tokenEndpointAuthMethod !== \"client_secret_post\") throw new SessionMcpOAuthError(\"invalid_client\", \"This client does not support OAuth authorization.\");\n\t\t\tif (input.redirectUri !== client.redirectUri) throw new SessionMcpOAuthError(\"invalid_request\", \"Redirect URI does not exactly match the registered callback.\");\n\t\t\tif (input.codeChallengeMethod !== \"S256\" || !/^[A-Za-z0-9_-]{43}$/u.test(input.codeChallenge)) throw new SessionMcpOAuthError(\"invalid_request\", \"A valid S256 PKCE challenge is required.\");\n\t\t\trequireCapacity(2);\n\t\t\tconst issuedAt = now();\n\t\t\tconst grant = Object.freeze({\n\t\t\t\tid: opaque(GRANT_ID_BYTES),\n\t\t\t\t...binding,\n\t\t\t\tcreatedAt: issuedAt\n\t\t\t});\n\t\t\tconst code = opaque();\n\t\t\tconst expiresAt = issuedAt + codeTtl;\n\t\t\tgrants.set(grant.id, grant);\n\t\t\tcodes.set(tokenKey(code), {\n\t\t\t\tclientId: client.clientId,\n\t\t\t\tredirectUri: client.redirectUri,\n\t\t\t\tchallenge: input.codeChallenge,\n\t\t\t\tgrant,\n\t\t\t\texpiresAt\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tcode,\n\t\t\t\tgrant,\n\t\t\t\texpiresAt\n\t\t\t};\n\t\t},\n\t\texchangeToken(request) {\n\t\t\tif (authenticateClient(request.clientId, request.clientSecret).tokenEndpointAuthMethod !== \"client_secret_post\") throw new SessionMcpOAuthError(\"invalid_client\", \"This client does not support OAuth tokens.\");\n\t\t\tsweep();\n\t\t\tif (request.grantType === \"authorization_code\") {\n\t\t\t\tconst codeKey = tokenKey(request.code);\n\t\t\t\tconst stored = codes.get(codeKey);\n\t\t\t\tif (stored === void 0 || stored.expiresAt <= now() || stored.clientId !== request.clientId || stored.redirectUri !== request.redirectUri || !/^[A-Za-z0-9\\-._~]{43,128}$/u.test(request.codeVerifier) || createHash(\"sha256\").update(request.codeVerifier).digest(\"base64url\") !== stored.challenge || !grants.has(stored.grant.id)) {\n\t\t\t\t\tcodes.delete(codeKey);\n\t\t\t\t\tif (stored !== void 0) revokeGrant(stored.grant.id);\n\t\t\t\t\tthrow new SessionMcpOAuthError(\"invalid_grant\", \"Authorization code is invalid or expired.\");\n\t\t\t\t}\n\t\t\t\trequireCapacity(1);\n\t\t\t\tcodes.delete(codeKey);\n\t\t\t\treturn mintTokens(stored.grant);\n\t\t\t}\n\t\t\tif (request.grantType === \"refresh_token\") {\n\t\t\t\tconst refreshKey = tokenKey(request.refreshToken);\n\t\t\t\tconst replayed = consumedRefreshTokens.get(refreshKey);\n\t\t\t\tif (replayed !== void 0) {\n\t\t\t\t\tif (replayed.clientId === request.clientId && replayed.expiresAt > now()) revokeFamily(replayed.familyId, replayed.grantId);\n\t\t\t\t\tthrow new SessionMcpOAuthError(\"invalid_grant\", \"Refresh token is invalid or expired.\");\n\t\t\t\t}\n\t\t\t\tconst stored = refreshTokens.get(refreshKey);\n\t\t\t\tif (stored === void 0 || stored.expiresAt <= now() || stored.grant.clientId !== request.clientId || !grants.has(stored.grant.id)) {\n\t\t\t\t\trefreshTokens.delete(refreshKey);\n\t\t\t\t\tthrow new SessionMcpOAuthError(\"invalid_grant\", \"Refresh token is invalid or expired.\");\n\t\t\t\t}\n\t\t\t\trequireCapacity(2);\n\t\t\t\trefreshTokens.delete(refreshKey);\n\t\t\t\tconsumedRefreshTokens.set(refreshKey, {\n\t\t\t\t\tclientId: stored.grant.clientId,\n\t\t\t\t\tgrantId: stored.grant.id,\n\t\t\t\t\tfamilyId: stored.familyId,\n\t\t\t\t\texpiresAt: stored.familyExpiresAt\n\t\t\t\t});\n\t\t\t\treturn mintTokens(stored.grant, stored.familyId, stored.familyExpiresAt);\n\t\t\t}\n\t\t\tthrow new SessionMcpOAuthError(\"unsupported_grant_type\", \"Only authorization_code and refresh_token are supported.\");\n\t\t},\n\t\tissueUrlToken(clientId) {\n\t\t\tconst client = clients.get(clientId);\n\t\t\tif (client === void 0 || client.tokenEndpointAuthMethod !== \"url_token\") throw new SessionMcpOAuthError(\"invalid_client\", \"This client does not support signed MCP URLs.\");\n\t\t\tconst binding = bindings.get(clientId);\n\t\t\tif (binding === void 0) throw new SessionMcpOAuthError(\"invalid_request\", \"Client authorization has not been preauthorized.\");\n\t\t\tconst payload = Buffer.from(JSON.stringify({\n\t\t\t\taud: binding.audience,\n\t\t\t\tiat: Math.floor(client.createdAt / 1e3),\n\t\t\t\tiss: URL_TOKEN_ISSUER,\n\t\t\t\tsid: binding.sessionId,\n\t\t\t\tsub: client.clientId\n\t\t\t})).toString(\"base64url\");\n\t\t\tconst input = `${URL_TOKEN_HEADER}.${payload}`;\n\t\t\treturn `${input}.${urlTokenSignature(input, client.secretHash).toString(\"base64url\")}`;\n\t\t},\n\t\tauthenticateUrlToken(token, audience) {\n\t\t\tconst parsed = parseUrlToken(token);\n\t\t\tif (parsed === void 0) return void 0;\n\t\t\tconst client = clients.get(parsed.claims.sub);\n\t\t\tif (client === void 0 || client.tokenEndpointAuthMethod !== \"url_token\") return void 0;\n\t\t\tconst binding = bindings.get(client.clientId);\n\t\t\tif (binding === void 0 || binding.audience !== audience || parsed.claims.aud !== audience || parsed.claims.sid !== binding.sessionId || parsed.claims.iat !== Math.floor(client.createdAt / 1e3)) return void 0;\n\t\t\tconst expected = urlTokenSignature(parsed.input, client.secretHash);\n\t\t\tif (!timingSafeEqual(expected, parsed.signature)) return void 0;\n\t\t\treturn {\n\t\t\t\tid: client.clientId,\n\t\t\t\t...binding,\n\t\t\t\tcreatedAt: client.createdAt,\n\t\t\t\texpiresAt: Number.MAX_SAFE_INTEGER\n\t\t\t};\n\t\t},\n\t\tauthenticateAccessToken(token, audience) {\n\t\t\tsweep();\n\t\t\tconst key = tokenKey(token);\n\t\t\tconst presentedHash = digest(token);\n\t\t\tfor (const client of clients.values()) {\n\t\t\t\tif (client.tokenEndpointAuthMethod !== \"api_key\" || !timingSafeEqual(presentedHash, client.secretHash)) continue;\n\t\t\t\tconst binding = bindings.get(client.clientId);\n\t\t\t\tif (binding === void 0 || binding.audience !== audience) return void 0;\n\t\t\t\treturn {\n\t\t\t\t\tid: client.clientId,\n\t\t\t\t\t...binding,\n\t\t\t\t\tcreatedAt: client.createdAt,\n\t\t\t\t\texpiresAt: Number.MAX_SAFE_INTEGER\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst stored = accessTokens.get(key);\n\t\t\tif (stored === void 0) return void 0;\n\t\t\tif (stored.expiresAt <= now() || !grants.has(stored.grant.id)) {\n\t\t\t\taccessTokens.delete(key);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (stored.grant.audience !== audience) return void 0;\n\t\t\treturn {\n\t\t\t\t...stored.grant,\n\t\t\t\texpiresAt: stored.expiresAt\n\t\t\t};\n\t\t},\n\t\trevokeGrant,\n\t\trevokeSessionGeneration(sessionId, sessionGeneration) {\n\t\t\tlet revoked = 0;\n\t\t\tfor (const grant of grants.values()) if (grant.sessionId === sessionId && grant.sessionGeneration === sessionGeneration && revokeGrant(grant.id)) revoked += 1;\n\t\t\tfor (const [clientId, binding] of bindings) if (binding.sessionId === sessionId && binding.sessionGeneration === sessionGeneration) bindings.delete(clientId);\n\t\t\treturn revoked;\n\t\t},\n\t\trevokeSession(sessionId) {\n\t\t\tlet revoked = 0;\n\t\t\tfor (const grant of grants.values()) if (grant.sessionId === sessionId && revokeGrant(grant.id)) revoked += 1;\n\t\t\tfor (const [clientId, binding] of bindings) if (binding.sessionId === sessionId) bindings.delete(clientId);\n\t\t\treturn revoked;\n\t\t}\n\t};\n}\n//#endregion\nexport { SessionMcpOAuthError, createSessionMcpAuthorizationService, defaultSessionMcpToolPrefix, sessionMcpRouting, sessionMcpToolPrefix };\n\n//# sourceMappingURL=index.mjs.map","//#region rolldown:runtime\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);\nvar __exportAll = (all, symbols) => {\n\tlet target = {};\n\tfor (var name in all) {\n\t\t__defProp(target, name, {\n\t\t\tget: all[name],\n\t\t\tenumerable: true\n\t\t});\n\t}\n\tif (symbols) {\n\t\t__defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\t}\n\treturn target;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\t\tkey = keys[i];\n\t\t\tif (!__hasOwnProp.call(to, key) && key !== except) {\n\t\t\t\t__defProp(to, key, {\n\t\t\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\n\n//#endregion\nexport { __exportAll as n, __toESM as r, __commonJSMin as t };","//#region ../core-internal/src/validators/dialects.ts\n/**\n* Canonical `$schema` URIs per supported dialect (http + https variants, trailing-`#` stripped).\n*/\nconst DRAFT_2020_12_URIS = new Set([\"https://json-schema.org/draft/2020-12/schema\", \"http://json-schema.org/draft/2020-12/schema\"]);\nconst DRAFT_2019_09_URIS = new Set([\"https://json-schema.org/draft/2019-09/schema\", \"http://json-schema.org/draft/2019-09/schema\"]);\nconst DRAFT_07_URIS = new Set([\"https://json-schema.org/draft-07/schema\", \"http://json-schema.org/draft-07/schema\"]);\nconst DRAFT_06_URIS = new Set([\"https://json-schema.org/draft-06/schema\", \"http://json-schema.org/draft-06/schema\"]);\n/**\n* Whether a `$schema` value declares the 2019-09 dialect — the only supported dialect with\n* `$recursiveRef`/`$recursiveAnchor`. Non-throwing (unlike {@linkcode declaredDialect}) so\n* wire-layer callers can consult it for documents whose dialect may be unsupported.\n*/\nfunction declares2019Dialect($schema) {\n\treturn typeof $schema === \"string\" && DRAFT_2019_09_URIS.has($schema.replace(/#$/, \"\"));\n}\n/**\n* Classify a schema's declared `$schema` dialect. No `$schema` (or a non-string one) means\n* 2020-12. Any other dialect throws a plain `Error` with a clear message rather than letting the\n* engine crash on an opaque internal error or silently mis-validate; `remedy` names the calling\n* provider's escape hatch in that message.\n*/\nfunction declaredDialect(schema, remedy) {\n\tif (!(\"$schema\" in schema) || typeof schema.$schema !== \"string\") return \"2020-12\";\n\tconst declared = schema.$schema.replace(/#$/, \"\");\n\tif (DRAFT_2020_12_URIS.has(declared)) return \"2020-12\";\n\tif (DRAFT_2019_09_URIS.has(declared)) return \"2019-09\";\n\tif (DRAFT_07_URIS.has(declared) || DRAFT_06_URIS.has(declared)) return \"draft-7\";\n\tthrow new Error(`JSON Schema declares an unsupported dialect (\"$schema\": \"${schema.$schema.slice(0, 200)}\"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${remedy}`);\n}\n\n//#endregion\nexport { declares2019Dialect as n, declaredDialect as t };\n//# sourceMappingURL=dialects-DoSzNhcb.mjs.map","// Zod 3 compat layer\nimport * as core from \"../core/index.js\";\n/** @deprecated Use the raw string literal codes instead, e.g. \"invalid_type\". */\nexport const ZodIssueCode = {\n    invalid_type: \"invalid_type\",\n    too_big: \"too_big\",\n    too_small: \"too_small\",\n    invalid_format: \"invalid_format\",\n    not_multiple_of: \"not_multiple_of\",\n    unrecognized_keys: \"unrecognized_keys\",\n    invalid_union: \"invalid_union\",\n    invalid_key: \"invalid_key\",\n    invalid_element: \"invalid_element\",\n    invalid_value: \"invalid_value\",\n    custom: \"custom\",\n};\nexport { $brand, config } from \"../core/index.js\";\n/** @deprecated Use `z.config(params)` instead. */\nexport function setErrorMap(map) {\n    core.config({\n        customError: map,\n    });\n}\n/** @deprecated Use `z.config()` instead. */\nexport function getErrorMap() {\n    return core.config().customError;\n}\n/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */\nexport var ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\n","import * as core from \"../core/index.js\";\nimport { ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime } from \"./schemas.js\";\nexport { ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime } from \"./schemas.js\";\nexport function datetime(params) {\n    return core._isoDateTime(ZodISODateTime, params);\n}\nexport function date(params) {\n    return core._isoDate(ZodISODate, params);\n}\nexport function time(params) {\n    return core._isoTime(ZodISOTime, params);\n}\nexport function duration(params) {\n    return core._isoDuration(ZodISODuration, params);\n}\n","import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport function string(params) {\n    return core._coercedString(schemas.ZodString, params);\n}\nexport function number(params) {\n    return core._coercedNumber(schemas.ZodNumber, params);\n}\nexport function boolean(params) {\n    return core._coercedBoolean(schemas.ZodBoolean, params);\n}\nexport function bigint(params) {\n    return core._coercedBigint(schemas.ZodBigInt, params);\n}\nexport function date(params) {\n    return core._coercedDate(schemas.ZodDate, params);\n}\n","import * as z from \"zod/v4\";\n\n//#region src/constants.ts\nconst LATEST_PROTOCOL_VERSION = \"2025-11-25\";\nconst DEFAULT_NEGOTIATED_PROTOCOL_VERSION = \"2025-03-26\";\nconst SUPPORTED_PROTOCOL_VERSIONS = [\n\tLATEST_PROTOCOL_VERSION,\n\t\"2025-06-18\",\n\t\"2025-03-26\",\n\t\"2024-11-05\",\n\t\"2024-10-07\"\n];\n/**\n* `_meta` key associating a message with a 2025-11-25 task.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst RELATED_TASK_META_KEY = \"io.modelcontextprotocol/related-task\";\n/**\n* `_meta` key carrying the MCP protocol version governing a request.\n*\n* For the HTTP transport, the value must match the `MCP-Protocol-Version` header.\n*/\nconst PROTOCOL_VERSION_META_KEY = \"io.modelcontextprotocol/protocolVersion\";\n/**\n* `_meta` key identifying the client software making a request.\n*\n* Clients SHOULD include it on every request; the value is self-reported and\n* intended for display, logging, and debugging — servers should not rely on\n* it for behavior or security decisions.\n*/\nconst CLIENT_INFO_META_KEY = \"io.modelcontextprotocol/clientInfo\";\n/**\n* `_meta` key identifying the server software producing a response.\n*\n* Servers SHOULD include it on every response; the value is self-reported and\n* intended for display, logging, and debugging — clients should not rely on\n* it for behavior or security decisions.\n*/\nconst SERVER_INFO_META_KEY = \"io.modelcontextprotocol/serverInfo\";\n/**\n* `_meta` key carrying the client's capabilities for a request.\n*\n* Capabilities are declared per request rather than once at initialization;\n* servers must not infer capabilities from prior requests.\n*/\nconst CLIENT_CAPABILITIES_META_KEY = \"io.modelcontextprotocol/clientCapabilities\";\n/**\n* `_meta` key carrying the JSON-RPC ID of the `subscriptions/listen` request\n* that opened the stream a notification was delivered on.\n*\n* Stamped by the server on every notification delivered via a\n* `subscriptions/listen` stream (including the leading\n* `notifications/subscriptions/acknowledged`); on stdio, where all messages\n* share one channel, clients use it to correlate notifications with their\n* originating subscription. The value is the listen request's JSON-RPC ID\n* verbatim.\n*/\nconst SUBSCRIPTION_ID_META_KEY = \"io.modelcontextprotocol/subscriptionId\";\n/**\n* `_meta` key carrying the desired log level for a request.\n*\n* When absent, the server must not send `notifications/message` notifications\n* for the request.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months.\n*/\nconst LOG_LEVEL_META_KEY = \"io.modelcontextprotocol/logLevel\";\n/**\n* `_meta` key carrying W3C Trace Context for distributed tracing (SEP-414).\n*\n* When present, the value MUST follow the W3C `traceparent` header format,\n* e.g. `00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01`.\n*\n* @see https://www.w3.org/TR/trace-context/#traceparent-header\n*/\nconst TRACEPARENT_META_KEY = \"traceparent\";\n/**\n* `_meta` key carrying vendor-specific trace state for distributed tracing (SEP-414).\n*\n* When present, the value MUST follow the W3C `tracestate` header format,\n* e.g. `vendor1=value1,vendor2=value2`.\n*\n* @see https://www.w3.org/TR/trace-context/#tracestate-header\n*/\nconst TRACESTATE_META_KEY = \"tracestate\";\n/**\n* `_meta` key carrying cross-cutting propagation values for distributed tracing (SEP-414).\n*\n* When present, the value MUST follow the W3C Baggage header format,\n* e.g. `userId=alice,serverRegion=us-east-1`.\n*\n* @see https://www.w3.org/TR/baggage/\n*/\nconst BAGGAGE_META_KEY = \"baggage\";\nconst JSONRPC_VERSION = \"2.0\";\nconst PARSE_ERROR = -32700;\nconst INVALID_REQUEST = -32600;\nconst METHOD_NOT_FOUND = -32601;\nconst INVALID_PARAMS = -32602;\nconst INTERNAL_ERROR = -32603;\n\n//#endregion\n//#region src/schemas.ts\nconst JSONValueSchema = z.lazy(() => z.union([\n\tz.string(),\n\tz.number(),\n\tz.boolean(),\n\tz.null(),\n\tz.record(z.string(), JSONValueSchema),\n\tz.array(JSONValueSchema)\n]));\nconst JSONObjectSchema = z.record(z.string(), JSONValueSchema);\nconst JSONArraySchema = z.array(JSONValueSchema);\n/**\n* A progress token, used to associate progress notifications with the original request.\n*/\nconst ProgressTokenSchema = z.union([z.string(), z.number().int()]);\n/**\n* An opaque token used to represent a cursor for pagination.\n*/\nconst CursorSchema = z.string();\n/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\nconst TaskMetadataSchema = z.object({ ttl: z.number().optional() });\n/**\n* Metadata for associating messages with a task.\n* Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst RelatedTaskMetadataSchema = z.object({ taskId: z.string() });\nconst RequestMetaSchema = z.looseObject({\n\tprogressToken: ProgressTokenSchema.optional(),\n\t[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()\n});\n/**\n* Common params for any request.\n*/\nconst BaseRequestParamsSchema = z.object({ _meta: RequestMetaSchema.optional() });\n/**\n* Common params for any task-augmented request.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({ task: TaskMetadataSchema.optional() });\nconst RequestSchema = z.object({\n\tmethod: z.string(),\n\tparams: BaseRequestParamsSchema.loose().optional()\n});\nconst NotificationsParamsSchema = z.object({ _meta: RequestMetaSchema.optional() });\nconst NotificationSchema = z.object({\n\tmethod: z.string(),\n\tparams: NotificationsParamsSchema.loose().optional()\n});\n/**\n* The contents of a result's `_meta` field (the 2026-07-28 `ResultMetaObject`).\n* Loose — implementation-specific keys pass through.\n*\n* The serverInfo key identifies the server software producing the response\n* (servers SHOULD include it on every response; the value is self-reported\n* and intended for display, logging, and debugging). The getter defers the\n* `ImplementationSchema` reference, which is declared later in this file.\n*/\nconst ResultMetaObjectSchema = z.looseObject({ get [SERVER_INFO_META_KEY]() {\n\treturn ImplementationSchema.optional().catch(void 0);\n} });\nconst ResultSchema = z.looseObject({ _meta: ResultMetaObjectSchema.optional() });\n/**\n* A uniquely identifying ID for a request in JSON-RPC.\n*/\nconst RequestIdSchema = z.union([z.string(), z.number().int()]);\n/**\n* A request that expects a response.\n*/\nconst JSONRPCRequestSchema = z.object({\n\tjsonrpc: z.literal(JSONRPC_VERSION),\n\tid: RequestIdSchema,\n\t...RequestSchema.shape\n}).strict();\n/**\n* A notification which does not expect a response.\n*/\nconst JSONRPCNotificationSchema = z.object({\n\tjsonrpc: z.literal(JSONRPC_VERSION),\n\t...NotificationSchema.shape\n}).strict();\n/**\n* A successful (non-error) response to a request.\n*/\nconst JSONRPCResultResponseSchema = z.object({\n\tjsonrpc: z.literal(JSONRPC_VERSION),\n\tid: RequestIdSchema,\n\tresult: ResultSchema\n}).strict();\n/**\n* A response to a request that indicates an error occurred.\n*/\nconst JSONRPCErrorResponseSchema = z.object({\n\tjsonrpc: z.literal(JSONRPC_VERSION),\n\tid: RequestIdSchema.optional(),\n\terror: z.object({\n\t\tcode: z.number().int(),\n\t\tmessage: z.string(),\n\t\tdata: z.unknown().optional()\n\t})\n}).strict();\nconst JSONRPCMessageSchema = z.union([\n\tJSONRPCRequestSchema,\n\tJSONRPCNotificationSchema,\n\tJSONRPCResultResponseSchema,\n\tJSONRPCErrorResponseSchema\n]);\nconst JSONRPCResponseSchema = z.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);\n/**\n* A response that indicates success but carries no data.\n*/\nconst EmptyResultSchema = ResultSchema.strict();\nconst CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({\n\trequestId: RequestIdSchema.optional(),\n\treason: z.string().optional()\n});\n/**\n* This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n*\n* The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n*\n* This notification indicates that the result will be unused, so any associated processing SHOULD cease.\n*\n* A client MUST NOT attempt to cancel its {@linkcode InitializeRequest | initialize} request.\n*/\nconst CancelledNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/cancelled\"),\n\tparams: CancelledNotificationParamsSchema\n});\n/**\n* Icon schema for use in {@link Tool | tools}, {@link Prompt | prompts}, {@link Resource | resources}, and {@link Implementation | implementations}.\n*/\nconst IconSchema = z.object({\n\tsrc: z.string(),\n\tmimeType: z.string().optional(),\n\tsizes: z.array(z.string()).optional(),\n\ttheme: z.enum([\"light\", \"dark\"]).optional()\n});\n/**\n* Base schema to add `icons` property.\n*\n*/\nconst IconsSchema = z.object({ icons: z.array(IconSchema).optional() });\n/**\n* Base metadata interface for common properties across {@link Resource | resources}, {@link Tool | tools}, {@link Prompt | prompts}, and {@link Implementation | implementations}.\n*/\nconst BaseMetadataSchema = z.object({\n\tname: z.string(),\n\ttitle: z.string().optional()\n});\n/**\n* Describes the name and version of an MCP implementation.\n*/\nconst ImplementationSchema = BaseMetadataSchema.extend({\n\t...BaseMetadataSchema.shape,\n\t...IconsSchema.shape,\n\tversion: z.string(),\n\twebsiteUrl: z.string().optional(),\n\tdescription: z.string().optional()\n});\nconst FormElicitationCapabilitySchema = z.intersection(z.object({ applyDefaults: z.boolean().optional() }), JSONObjectSchema);\nconst ElicitationCapabilitySchema = z.preprocess((value) => {\n\tif (value && typeof value === \"object\" && !Array.isArray(value) && Object.keys(value).length === 0) return { form: {} };\n\treturn value;\n}, z.intersection(z.object({\n\tform: FormElicitationCapabilitySchema.optional(),\n\turl: JSONObjectSchema.optional()\n}), JSONObjectSchema.optional()));\n/**\n* Task capabilities for clients, indicating which request types support task creation.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst ClientTasksCapabilitySchema = z.looseObject({\n\tlist: JSONObjectSchema.optional(),\n\tcancel: JSONObjectSchema.optional(),\n\trequests: z.looseObject({\n\t\tsampling: z.looseObject({ createMessage: JSONObjectSchema.optional() }).optional(),\n\t\telicitation: z.looseObject({ create: JSONObjectSchema.optional() }).optional()\n\t}).optional()\n});\n/**\n* Task capabilities for servers, indicating which request types support task creation.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst ServerTasksCapabilitySchema = z.looseObject({\n\tlist: JSONObjectSchema.optional(),\n\tcancel: JSONObjectSchema.optional(),\n\trequests: z.looseObject({ tools: z.looseObject({ call: JSONObjectSchema.optional() }).optional() }).optional()\n});\n/**\n* Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.\n*/\nconst ClientCapabilitiesSchema = z.object({\n\texperimental: z.record(z.string(), JSONObjectSchema).optional(),\n\tsampling: z.object({\n\t\tcontext: JSONObjectSchema.optional(),\n\t\ttools: JSONObjectSchema.optional()\n\t}).optional(),\n\telicitation: ElicitationCapabilitySchema.optional(),\n\troots: z.object({ listChanged: z.boolean().optional() }).optional(),\n\ttasks: ClientTasksCapabilitySchema.optional(),\n\textensions: z.record(z.string(), JSONObjectSchema).optional()\n});\nconst InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({\n\tprotocolVersion: z.string(),\n\tcapabilities: ClientCapabilitiesSchema,\n\tclientInfo: ImplementationSchema\n});\n/**\n* This request is sent from the client to the server when it first connects, asking it to begin initialization.\n*/\nconst InitializeRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"initialize\"),\n\tparams: InitializeRequestParamsSchema\n});\n/**\n* Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.\n*/\nconst ServerCapabilitiesSchema = z.object({\n\texperimental: z.record(z.string(), JSONObjectSchema).optional(),\n\tlogging: JSONObjectSchema.optional(),\n\tcompletions: JSONObjectSchema.optional(),\n\tprompts: z.object({ listChanged: z.boolean().optional() }).optional(),\n\tresources: z.object({\n\t\tsubscribe: z.boolean().optional(),\n\t\tlistChanged: z.boolean().optional()\n\t}).optional(),\n\ttools: z.object({ listChanged: z.boolean().optional() }).optional(),\n\ttasks: ServerTasksCapabilitySchema.optional(),\n\textensions: z.record(z.string(), JSONObjectSchema).optional()\n});\n/**\n* After receiving an initialize request from the client, the server sends this response.\n*/\nconst InitializeResultSchema = ResultSchema.extend({\n\tprotocolVersion: z.string(),\n\tcapabilities: ServerCapabilitiesSchema,\n\tserverInfo: ImplementationSchema,\n\tinstructions: z.string().optional()\n});\n/**\n* This notification is sent from the client to the server after initialization has finished.\n*/\nconst InitializedNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/initialized\"),\n\tparams: NotificationsParamsSchema.optional()\n});\n/**\n* A request from the client asking the server to advertise its supported protocol\n* versions, capabilities, and other metadata (protocol revision 2026-07-28). Servers\n* MUST implement `server/discover`. Clients MAY call it but are not required to —\n* version negotiation can also happen inline via the per-request `_meta` envelope.\n*/\nconst DiscoverRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"server/discover\"),\n\tparams: BaseRequestParamsSchema.optional()\n});\n/**\n* The result returned by the server for a `server/discover` request.\n*/\nconst DiscoverResultSchema = ResultSchema.extend({\n\tsupportedVersions: z.array(z.string()),\n\tcapabilities: ServerCapabilitiesSchema,\n\tinstructions: z.string().optional()\n});\n/**\n* A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.\n*/\nconst PingRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"ping\"),\n\tparams: BaseRequestParamsSchema.optional()\n});\nconst ProgressSchema = z.object({\n\tprogress: z.number(),\n\ttotal: z.optional(z.number()),\n\tmessage: z.optional(z.string())\n});\nconst ProgressNotificationParamsSchema = z.object({\n\t...NotificationsParamsSchema.shape,\n\t...ProgressSchema.shape,\n\tprogressToken: ProgressTokenSchema\n});\n/**\n* An out-of-band notification used to inform the receiver of a progress update for a long-running request.\n*\n* @category notifications/progress\n*/\nconst ProgressNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/progress\"),\n\tparams: ProgressNotificationParamsSchema\n});\nconst PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({ cursor: CursorSchema.optional() });\nconst PaginatedRequestSchema = RequestSchema.extend({ params: PaginatedRequestParamsSchema.optional() });\nconst PaginatedResultSchema = ResultSchema.extend({ nextCursor: CursorSchema.optional() });\n/**\n* The contents of a specific resource or sub-resource.\n*/\nconst ResourceContentsSchema = z.object({\n\turi: z.string(),\n\tmimeType: z.optional(z.string()),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\nconst TextResourceContentsSchema = ResourceContentsSchema.extend({ text: z.string() });\n/**\n* A Zod schema for validating Base64 strings that is more performant and\n* robust for very large inputs than the default regex-based check. It avoids\n* stack overflows by using the native `atob` function for validation.\n*/\nconst Base64Schema = z.string().refine((val) => {\n\ttry {\n\t\tatob(val);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}, { message: \"Invalid Base64 string\" });\nconst BlobResourceContentsSchema = ResourceContentsSchema.extend({ blob: Base64Schema });\n/**\n* The sender or recipient of messages and data in a conversation.\n*/\nconst RoleSchema = z.enum([\"user\", \"assistant\"]);\n/**\n* Optional annotations providing clients additional context about a resource.\n*/\nconst AnnotationsSchema = z.object({\n\taudience: z.array(RoleSchema).optional(),\n\tpriority: z.number().min(0).max(1).optional(),\n\tlastModified: z.iso.datetime({ offset: true }).optional()\n});\n/**\n* A known resource that the server is capable of reading.\n*/\nconst ResourceSchema = z.object({\n\t...BaseMetadataSchema.shape,\n\t...IconsSchema.shape,\n\turi: z.string(),\n\tdescription: z.optional(z.string()),\n\tmimeType: z.optional(z.string()),\n\tsize: z.optional(z.number()),\n\tannotations: AnnotationsSchema.optional(),\n\t_meta: z.optional(z.looseObject({}))\n});\n/**\n* A template description for resources available on the server.\n*/\nconst ResourceTemplateSchema = z.object({\n\t...BaseMetadataSchema.shape,\n\t...IconsSchema.shape,\n\turiTemplate: z.string(),\n\tdescription: z.optional(z.string()),\n\tmimeType: z.optional(z.string()),\n\tannotations: AnnotationsSchema.optional(),\n\t_meta: z.optional(z.looseObject({}))\n});\n/**\n* Sent from the client to request a list of resources the server has.\n*/\nconst ListResourcesRequestSchema = PaginatedRequestSchema.extend({ method: z.literal(\"resources/list\") });\n/**\n* The server's response to a {@linkcode ListResourcesRequest | resources/list} request from the client.\n*/\nconst ListResourcesResultSchema = PaginatedResultSchema.extend({ resources: z.array(ResourceSchema) });\n/**\n* Sent from the client to request a list of resource templates the server has.\n*/\nconst ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ method: z.literal(\"resources/templates/list\") });\n/**\n* The server's response to a {@linkcode ListResourceTemplatesRequest | resources/templates/list} request from the client.\n*/\nconst ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({ resourceTemplates: z.array(ResourceTemplateSchema) });\nconst ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({ uri: z.string() });\n/**\n* Parameters for a {@linkcode ReadResourceRequest | resources/read} request.\n*/\nconst ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;\n/**\n* Sent from the client to the server, to read a specific resource URI.\n*/\nconst ReadResourceRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"resources/read\"),\n\tparams: ReadResourceRequestParamsSchema\n});\n/**\n* The server's response to a {@linkcode ReadResourceRequest | resources/read} request from the client.\n*/\nconst ReadResourceResultSchema = ResultSchema.extend({ contents: z.array(z.union([TextResourceContentsSchema, BlobResourceContentsSchema])) });\n/**\n* An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.\n*/\nconst ResourceListChangedNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/resources/list_changed\"),\n\tparams: NotificationsParamsSchema.optional()\n});\nconst SubscribeRequestParamsSchema = ResourceRequestParamsSchema;\n/**\n* Sent from the client to request `resources/updated` notifications from the server whenever a particular resource changes.\n*/\nconst SubscribeRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"resources/subscribe\"),\n\tparams: SubscribeRequestParamsSchema\n});\nconst UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;\n/**\n* Sent from the client to request cancellation of {@linkcode ResourceUpdatedNotification | resources/updated} notifications from the server. This should follow a previous {@linkcode SubscribeRequest | resources/subscribe} request.\n*/\nconst UnsubscribeRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"resources/unsubscribe\"),\n\tparams: UnsubscribeRequestParamsSchema\n});\n/**\n* The set of notification types a client opts in to on a `subscriptions/listen`\n* request. Each type is opt-in; the server MUST NOT send a notification type\n* the client has not explicitly requested here.\n*/\nconst SubscriptionFilterSchema = z.object({\n\ttoolsListChanged: z.boolean().optional(),\n\tpromptsListChanged: z.boolean().optional(),\n\tresourcesListChanged: z.boolean().optional(),\n\tresourceSubscriptions: z.array(z.string()).optional()\n});\nconst SubscriptionsListenRequestParamsSchema = BaseRequestParamsSchema.extend({ notifications: SubscriptionFilterSchema });\n/**\n* Sent from the client to open a long-lived channel for receiving notifications\n* outside the context of a specific request (protocol revision 2026-07-28).\n* Replaces the previous HTTP GET endpoint and `resources/subscribe`.\n*/\nconst SubscriptionsListenRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"subscriptions/listen\"),\n\tparams: SubscriptionsListenRequestParamsSchema\n});\nconst SubscriptionsAcknowledgedNotificationParamsSchema = NotificationsParamsSchema.extend({ notifications: SubscriptionFilterSchema });\n/**\n* Sent by the server as the first message on a `subscriptions/listen` stream\n* to acknowledge that the subscription has been established and report which\n* notification types it agreed to honor (protocol revision 2026-07-28).\n*/\nconst SubscriptionsAcknowledgedNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/subscriptions/acknowledged\"),\n\tparams: SubscriptionsAcknowledgedNotificationParamsSchema\n});\n/**\n* `_meta` for a {@linkcode SubscriptionsListenResult}: the listen request's\n* JSON-RPC ID under the canonical subscription-id key (mirroring the same key\n* on every notification delivered on the stream). Extends\n* {@linkcode ResultMetaObjectSchema}, so the optional serverInfo key is typed\n* here too.\n*/\nconst SubscriptionsListenResultMetaSchema = ResultMetaObjectSchema.extend({ [SUBSCRIPTION_ID_META_KEY]: RequestIdSchema });\n/**\n* The response to a `subscriptions/listen` request, signalling that the\n* subscription has ended gracefully (for example, during server shutdown).\n* Because the listen stream is long-lived, this result is sent only when the\n* server tears the subscription down; an abrupt transport close carries no\n* response. The result body is otherwise empty.\n*/\nconst SubscriptionsListenResultSchema = ResultSchema.extend({ _meta: SubscriptionsListenResultMetaSchema });\n/**\n* Parameters for a {@linkcode ResourceUpdatedNotification | notifications/resources/updated} notification.\n*/\nconst ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({ uri: z.string() });\n/**\n* A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a {@linkcode SubscribeRequest | resources/subscribe} request.\n*/\nconst ResourceUpdatedNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/resources/updated\"),\n\tparams: ResourceUpdatedNotificationParamsSchema\n});\n/**\n* Describes an argument that a prompt can accept.\n*/\nconst PromptArgumentSchema = z.object({\n\tname: z.string(),\n\tdescription: z.optional(z.string()),\n\trequired: z.optional(z.boolean())\n});\n/**\n* A prompt or prompt template that the server offers.\n*/\nconst PromptSchema = z.object({\n\t...BaseMetadataSchema.shape,\n\t...IconsSchema.shape,\n\tdescription: z.optional(z.string()),\n\targuments: z.optional(z.array(PromptArgumentSchema)),\n\t_meta: z.optional(z.looseObject({}))\n});\n/**\n* Sent from the client to request a list of prompts and prompt templates the server has.\n*/\nconst ListPromptsRequestSchema = PaginatedRequestSchema.extend({ method: z.literal(\"prompts/list\") });\n/**\n* The server's response to a {@linkcode ListPromptsRequest | prompts/list} request from the client.\n*/\nconst ListPromptsResultSchema = PaginatedResultSchema.extend({ prompts: z.array(PromptSchema) });\n/**\n* Parameters for a {@linkcode GetPromptRequest | prompts/get} request.\n*/\nconst GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({\n\tname: z.string(),\n\targuments: z.record(z.string(), z.string()).optional()\n});\n/**\n* Used by the client to get a prompt provided by the server.\n*/\nconst GetPromptRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"prompts/get\"),\n\tparams: GetPromptRequestParamsSchema\n});\n/**\n* Text provided to or from an LLM.\n*/\nconst TextContentSchema = z.object({\n\ttype: z.literal(\"text\"),\n\ttext: z.string(),\n\tannotations: AnnotationsSchema.optional(),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* An image provided to or from an LLM.\n*/\nconst ImageContentSchema = z.object({\n\ttype: z.literal(\"image\"),\n\tdata: Base64Schema,\n\tmimeType: z.string(),\n\tannotations: AnnotationsSchema.optional(),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* Audio content provided to or from an LLM.\n*/\nconst AudioContentSchema = z.object({\n\ttype: z.literal(\"audio\"),\n\tdata: Base64Schema,\n\tmimeType: z.string(),\n\tannotations: AnnotationsSchema.optional(),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* A tool call request from an assistant (LLM).\n* Represents the assistant's request to use a tool.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst ToolUseContentSchema = z.object({\n\ttype: z.literal(\"tool_use\"),\n\tname: z.string(),\n\tid: z.string(),\n\tinput: z.record(z.string(), z.unknown()),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* The contents of a resource, embedded into a prompt or tool call result.\n*/\nconst EmbeddedResourceSchema = z.object({\n\ttype: z.literal(\"resource\"),\n\tresource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]),\n\tannotations: AnnotationsSchema.optional(),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* A resource that the server is capable of reading, included in a prompt or tool call result.\n*\n* Note: resource links returned by tools are not guaranteed to appear in the results of {@linkcode ListResourcesRequest | resources/list} requests.\n*/\nconst ResourceLinkSchema = ResourceSchema.extend({ type: z.literal(\"resource_link\") });\n/**\n* A content block that can be used in prompts and tool results.\n*/\nconst ContentBlockSchema = z.union([\n\tTextContentSchema,\n\tImageContentSchema,\n\tAudioContentSchema,\n\tResourceLinkSchema,\n\tEmbeddedResourceSchema\n]);\n/**\n* Describes a message returned as part of a prompt.\n*/\nconst PromptMessageSchema = z.object({\n\trole: RoleSchema,\n\tcontent: ContentBlockSchema\n});\n/**\n* The server's response to a {@linkcode GetPromptRequest | prompts/get} request from the client.\n*/\nconst GetPromptResultSchema = ResultSchema.extend({\n\tdescription: z.string().optional(),\n\tmessages: z.array(PromptMessageSchema)\n});\n/**\n* An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.\n*/\nconst PromptListChangedNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/prompts/list_changed\"),\n\tparams: NotificationsParamsSchema.optional()\n});\n/**\n* Additional properties describing a `Tool` to clients.\n*\n* NOTE: all properties in {@linkcode ToolAnnotations} are **hints**.\n* They are not guaranteed to provide a faithful description of\n* tool behavior (including descriptive properties like `title`).\n*\n* Clients should never make tool use decisions based on `ToolAnnotations`\n* received from untrusted servers.\n*/\nconst ToolAnnotationsSchema = z.object({\n\ttitle: z.string().optional(),\n\treadOnlyHint: z.boolean().optional(),\n\tdestructiveHint: z.boolean().optional(),\n\tidempotentHint: z.boolean().optional(),\n\topenWorldHint: z.boolean().optional()\n});\n/**\n* Execution-related properties for a tool.\n*/\nconst ToolExecutionSchema = z.object({ taskSupport: z.enum([\n\t\"required\",\n\t\"optional\",\n\t\"forbidden\"\n]).optional() });\n/**\n* Definition for a tool the client can call.\n*/\nconst ToolSchema = z.object({\n\t...BaseMetadataSchema.shape,\n\t...IconsSchema.shape,\n\tdescription: z.string().optional(),\n\tinputSchema: z.object({\n\t\ttype: z.literal(\"object\"),\n\t\tproperties: z.record(z.string(), JSONValueSchema).optional(),\n\t\trequired: z.array(z.string()).optional()\n\t}).catchall(z.unknown()),\n\toutputSchema: z.looseObject({ $schema: z.string().optional() }).optional(),\n\tannotations: ToolAnnotationsSchema.optional(),\n\texecution: ToolExecutionSchema.optional(),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* Sent from the client to request a list of tools the server has.\n*/\nconst ListToolsRequestSchema = PaginatedRequestSchema.extend({ method: z.literal(\"tools/list\") });\n/**\n* The server's response to a {@linkcode ListToolsRequest | tools/list} request from the client.\n*/\nconst ListToolsResultSchema = PaginatedResultSchema.extend({ tools: z.array(ToolSchema) });\n/**\n* The server's response to a tool call.\n*/\nconst CallToolResultSchema = ResultSchema.extend({\n\tcontent: z.array(ContentBlockSchema).default([]),\n\tstructuredContent: z.unknown().optional(),\n\tisError: z.boolean().optional()\n});\n/**\n* {@linkcode CallToolResultSchema} extended with backwards compatibility to protocol version 2024-10-07.\n*/\nconst CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({ toolResult: z.unknown() }));\n/**\n* Parameters for a `tools/call` request.\n*/\nconst CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({\n\tname: z.string(),\n\targuments: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* Used by the client to invoke a tool provided by the server.\n*/\nconst CallToolRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"tools/call\"),\n\tparams: CallToolRequestParamsSchema\n});\n/**\n* An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.\n*/\nconst ToolListChangedNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/tools/list_changed\"),\n\tparams: NotificationsParamsSchema.optional()\n});\n/**\n* Base schema for list changed subscription options (without callback).\n* Used internally for Zod validation of `autoRefresh` and `debounceMs`.\n*/\nconst ListChangedOptionsBaseSchema = z.object({\n\tautoRefresh: z.boolean().default(true),\n\tdebounceMs: z.number().int().nonnegative().default(300)\n});\n/**\n* The severity of a log message.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to stderr logging\n* (STDIO servers) or OpenTelemetry.\n*/\nconst LoggingLevelSchema = z.enum([\n\t\"debug\",\n\t\"info\",\n\t\"notice\",\n\t\"warning\",\n\t\"error\",\n\t\"critical\",\n\t\"alert\",\n\t\"emergency\"\n]);\n/**\n* Parameters for a `logging/setLevel` request.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to stderr logging\n* (STDIO servers) or OpenTelemetry.\n*/\nconst SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({ level: LoggingLevelSchema });\n/**\n* A request from the client to the server, to enable or adjust logging.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to stderr logging\n* (STDIO servers) or OpenTelemetry.\n*/\nconst SetLevelRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"logging/setLevel\"),\n\tparams: SetLevelRequestParamsSchema\n});\n/**\n* Parameters for a `notifications/message` notification.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to stderr logging\n* (STDIO servers) or OpenTelemetry.\n*/\nconst LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({\n\tlevel: LoggingLevelSchema,\n\tlogger: z.string().optional(),\n\tdata: z.unknown()\n});\n/**\n* Notification of a log message passed from server to client. If no `logging/setLevel` request has been sent from the client, the server MAY decide which messages to send automatically.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to stderr logging\n* (STDIO servers) or OpenTelemetry.\n*/\nconst LoggingMessageNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/message\"),\n\tparams: LoggingMessageNotificationParamsSchema\n});\n/**\n* Hints to use for model selection.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst ModelHintSchema = z.object({ name: z.string().optional() });\n/**\n* The server's preferences for model selection, requested of the client during sampling.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst ModelPreferencesSchema = z.object({\n\thints: z.array(ModelHintSchema).optional(),\n\tcostPriority: z.number().min(0).max(1).optional(),\n\tspeedPriority: z.number().min(0).max(1).optional(),\n\tintelligencePriority: z.number().min(0).max(1).optional()\n});\n/**\n* Controls tool usage behavior in sampling requests.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst ToolChoiceSchema = z.object({ mode: z.enum([\n\t\"auto\",\n\t\"required\",\n\t\"none\"\n]).optional() });\n/**\n* The result of a tool execution, provided by the user (server).\n* Represents the outcome of invoking a tool requested via `ToolUseContent`.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst ToolResultContentSchema = z.object({\n\ttype: z.literal(\"tool_result\"),\n\ttoolUseId: z.string().describe(\"The unique identifier for the corresponding tool call.\"),\n\tcontent: z.array(ContentBlockSchema),\n\tstructuredContent: z.unknown().optional(),\n\tisError: z.boolean().optional(),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* Basic content types for sampling responses (without tool use).\n* Used for backwards-compatible {@linkcode CreateMessageResult} when tools are not used.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst SamplingContentSchema = z.discriminatedUnion(\"type\", [\n\tTextContentSchema,\n\tImageContentSchema,\n\tAudioContentSchema\n]);\n/**\n* Content block types allowed in sampling messages.\n* This includes text, image, audio, tool use requests, and tool results.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst SamplingMessageContentBlockSchema = z.discriminatedUnion(\"type\", [\n\tTextContentSchema,\n\tImageContentSchema,\n\tAudioContentSchema,\n\tToolUseContentSchema,\n\tToolResultContentSchema\n]);\n/**\n* Describes a message issued to or received from an LLM API.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst SamplingMessageSchema = z.object({\n\trole: RoleSchema,\n\tcontent: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)]),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* Parameters for a `sampling/createMessage` request.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({\n\tmessages: z.array(SamplingMessageSchema),\n\tmodelPreferences: ModelPreferencesSchema.optional(),\n\tsystemPrompt: z.string().optional(),\n\tincludeContext: z.enum([\n\t\t\"none\",\n\t\t\"thisServer\",\n\t\t\"allServers\"\n\t]).optional(),\n\ttemperature: z.number().optional(),\n\tmaxTokens: z.number().int(),\n\tstopSequences: z.array(z.string()).optional(),\n\tmetadata: JSONObjectSchema.optional(),\n\ttools: z.array(ToolSchema).optional(),\n\ttoolChoice: ToolChoiceSchema.optional()\n});\n/**\n* A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst CreateMessageRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"sampling/createMessage\"),\n\tparams: CreateMessageRequestParamsSchema\n});\n/**\n* The client's response to a `sampling/create_message` request from the server.\n* This is the backwards-compatible version that returns single content (no arrays).\n* Used when the request does not include tools.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst CreateMessageResultSchema = ResultSchema.extend({\n\tmodel: z.string(),\n\tstopReason: z.optional(z.enum([\n\t\t\"endTurn\",\n\t\t\"stopSequence\",\n\t\t\"maxTokens\"\n\t]).or(z.string())),\n\trole: RoleSchema,\n\tcontent: SamplingContentSchema\n});\n/**\n* The client's response to a `sampling/create_message` request when tools were provided.\n* This version supports array content for tool use flows.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to calling LLM\n* provider APIs directly.\n*/\nconst CreateMessageResultWithToolsSchema = ResultSchema.extend({\n\tmodel: z.string(),\n\tstopReason: z.optional(z.enum([\n\t\t\"endTurn\",\n\t\t\"stopSequence\",\n\t\t\"maxTokens\",\n\t\t\"toolUse\"\n\t]).or(z.string())),\n\trole: RoleSchema,\n\tcontent: z.union([SamplingMessageContentBlockSchema, z.array(SamplingMessageContentBlockSchema)])\n});\n/**\n* Primitive schema definition for boolean fields.\n*/\nconst BooleanSchemaSchema = z.object({\n\ttype: z.literal(\"boolean\"),\n\ttitle: z.string().optional(),\n\tdescription: z.string().optional(),\n\tdefault: z.boolean().optional()\n});\n/**\n* Primitive schema definition for string fields.\n*/\nconst StringSchemaSchema = z.object({\n\ttype: z.literal(\"string\"),\n\ttitle: z.string().optional(),\n\tdescription: z.string().optional(),\n\tminLength: z.number().optional(),\n\tmaxLength: z.number().optional(),\n\tformat: z.enum([\n\t\t\"email\",\n\t\t\"uri\",\n\t\t\"date\",\n\t\t\"date-time\"\n\t]).optional(),\n\tdefault: z.string().optional()\n});\n/**\n* Primitive schema definition for number fields.\n*/\nconst NumberSchemaSchema = z.object({\n\ttype: z.enum([\"number\", \"integer\"]),\n\ttitle: z.string().optional(),\n\tdescription: z.string().optional(),\n\tminimum: z.number().optional(),\n\tmaximum: z.number().optional(),\n\tdefault: z.number().optional()\n});\n/**\n* Schema for single-selection enumeration without display titles for options.\n*/\nconst UntitledSingleSelectEnumSchemaSchema = z.object({\n\ttype: z.literal(\"string\"),\n\ttitle: z.string().optional(),\n\tdescription: z.string().optional(),\n\tenum: z.array(z.string()),\n\tdefault: z.string().optional()\n});\n/**\n* Schema for single-selection enumeration with display titles for each option.\n*/\nconst TitledSingleSelectEnumSchemaSchema = z.object({\n\ttype: z.literal(\"string\"),\n\ttitle: z.string().optional(),\n\tdescription: z.string().optional(),\n\toneOf: z.array(z.object({\n\t\tconst: z.string(),\n\t\ttitle: z.string()\n\t})),\n\tdefault: z.string().optional()\n});\n/**\n* Use {@linkcode TitledSingleSelectEnumSchema} instead.\n* This interface will be removed in a future version.\n*/\nconst LegacyTitledEnumSchemaSchema = z.object({\n\ttype: z.literal(\"string\"),\n\ttitle: z.string().optional(),\n\tdescription: z.string().optional(),\n\tenum: z.array(z.string()),\n\tenumNames: z.array(z.string()).optional(),\n\tdefault: z.string().optional()\n});\nconst SingleSelectEnumSchemaSchema = z.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);\n/**\n* Schema for multiple-selection enumeration without display titles for options.\n*/\nconst UntitledMultiSelectEnumSchemaSchema = z.object({\n\ttype: z.literal(\"array\"),\n\ttitle: z.string().optional(),\n\tdescription: z.string().optional(),\n\tminItems: z.number().optional(),\n\tmaxItems: z.number().optional(),\n\titems: z.object({\n\t\ttype: z.literal(\"string\"),\n\t\tenum: z.array(z.string())\n\t}),\n\tdefault: z.array(z.string()).optional()\n});\n/**\n* Schema for multiple-selection enumeration with display titles for each option.\n*/\nconst TitledMultiSelectEnumSchemaSchema = z.object({\n\ttype: z.literal(\"array\"),\n\ttitle: z.string().optional(),\n\tdescription: z.string().optional(),\n\tminItems: z.number().optional(),\n\tmaxItems: z.number().optional(),\n\titems: z.object({ anyOf: z.array(z.object({\n\t\tconst: z.string(),\n\t\ttitle: z.string()\n\t})) }),\n\tdefault: z.array(z.string()).optional()\n});\n/**\n* Combined schema for multiple-selection enumeration\n*/\nconst MultiSelectEnumSchemaSchema = z.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);\n/**\n* Primitive schema definition for enum fields.\n*/\nconst EnumSchemaSchema = z.union([\n\tLegacyTitledEnumSchemaSchema,\n\tSingleSelectEnumSchemaSchema,\n\tMultiSelectEnumSchemaSchema\n]);\n/**\n* Union of all primitive schema definitions.\n*/\nconst PrimitiveSchemaDefinitionSchema = z.union([\n\tEnumSchemaSchema,\n\tBooleanSchemaSchema,\n\tStringSchemaSchema,\n\tNumberSchemaSchema\n]);\n/**\n* Parameters for an `elicitation/create` request for form-based elicitation.\n*/\nconst ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({\n\tmode: z.literal(\"form\").optional(),\n\tmessage: z.string(),\n\trequestedSchema: z.object({\n\t\ttype: z.literal(\"object\"),\n\t\tproperties: z.record(z.string(), PrimitiveSchemaDefinitionSchema),\n\t\trequired: z.array(z.string()).optional()\n\t}).catchall(z.unknown())\n});\n/**\n* Parameters for an {@linkcode ElicitRequest | elicitation/create} request for URL-based elicitation.\n*/\nconst ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({\n\tmode: z.literal(\"url\"),\n\tmessage: z.string(),\n\telicitationId: z.string(),\n\turl: z.string().url()\n});\n/**\n* The parameters for a request to elicit additional information from the user via the client.\n*/\nconst ElicitRequestParamsSchema = z.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);\n/**\n* A request from the server to elicit user input via the client.\n* The client should present the message and form fields to the user (form mode)\n* or navigate to a URL (URL mode).\n*/\nconst ElicitRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"elicitation/create\"),\n\tparams: ElicitRequestParamsSchema\n});\n/**\n* Parameters for a {@linkcode ElicitationCompleteNotification | notifications/elicitation/complete} notification.\n*\n* @deprecated Removed from the spec by #2891 (2026-07-28). The client learns the outcome\n* of an out-of-band interaction by retrying the original request; no server-initiated\n* completion signal exists in the 2026-07-28 revision. Kept here for the 2025-era flow\n* only. The 2026-07-28 wire codec excludes this notification.\n* @category notifications/elicitation/complete\n*/\nconst ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({ elicitationId: z.string() });\n/**\n* A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.\n*\n* @deprecated Removed from the spec by #2891 (2026-07-28). The client learns the outcome\n* of an out-of-band interaction by retrying the original request; no server-initiated\n* completion signal exists in the 2026-07-28 revision. Kept here for the 2025-era flow\n* only. The 2026-07-28 wire codec excludes this notification.\n* @category notifications/elicitation/complete\n*/\nconst ElicitationCompleteNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/elicitation/complete\"),\n\tparams: ElicitationCompleteNotificationParamsSchema\n});\n/**\n* The client's response to an {@linkcode ElicitRequest | elicitation/create} request from the server.\n*/\nconst ElicitResultSchema = ResultSchema.extend({\n\taction: z.enum([\n\t\t\"accept\",\n\t\t\"decline\",\n\t\t\"cancel\"\n\t]),\n\tcontent: z.preprocess((val) => val === null ? void 0 : val, z.record(z.string(), z.union([\n\t\tz.string(),\n\t\tz.number(),\n\t\tz.boolean(),\n\t\tz.array(z.string())\n\t])).optional())\n});\n/**\n* A reference to a resource or resource template definition.\n*/\nconst ResourceTemplateReferenceSchema = z.object({\n\ttype: z.literal(\"ref/resource\"),\n\turi: z.string()\n});\n/**\n* Identifies a prompt.\n*/\nconst PromptReferenceSchema = z.object({\n\ttype: z.literal(\"ref/prompt\"),\n\tname: z.string()\n});\n/**\n* Parameters for a {@linkcode CompleteRequest | completion/complete} request.\n*/\nconst CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({\n\tref: z.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),\n\targument: z.object({\n\t\tname: z.string(),\n\t\tvalue: z.string()\n\t}),\n\tcontext: z.object({ arguments: z.record(z.string(), z.string()).optional() }).optional()\n});\n/**\n* A request from the client to the server, to ask for completion options.\n*/\nconst CompleteRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"completion/complete\"),\n\tparams: CompleteRequestParamsSchema\n});\n/**\n* The server's response to a {@linkcode CompleteRequest | completion/complete} request\n*/\nconst CompleteResultSchema = ResultSchema.extend({ completion: z.looseObject({\n\tvalues: z.array(z.string()).max(100),\n\ttotal: z.optional(z.number().int()),\n\thasMore: z.optional(z.boolean())\n}) });\n/**\n* Represents a root directory or file that the server can operate on.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to passing paths via\n* tool parameters, resource URIs, or configuration.\n*/\nconst RootSchema = z.object({\n\turi: z.string().startsWith(\"file://\"),\n\tname: z.string().optional(),\n\t_meta: z.record(z.string(), z.unknown()).optional()\n});\n/**\n* Sent from the server to request a list of root URIs from the client.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to passing paths via\n* tool parameters, resource URIs, or configuration.\n*/\nconst ListRootsRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"roots/list\"),\n\tparams: BaseRequestParamsSchema.optional()\n});\n/**\n* The client's response to a `roots/list` request from the server.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to passing paths via\n* tool parameters, resource URIs, or configuration.\n*/\nconst ListRootsResultSchema = ResultSchema.extend({ roots: z.array(RootSchema) });\n/**\n* A notification from the client to the server, informing it that the list of roots has changed.\n*\n* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n* in the specification for at least twelve months. Migrate to passing paths via\n* tool parameters, resource URIs, or configuration.\n*/\nconst RootsListChangedNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/roots/list_changed\"),\n\tparams: NotificationsParamsSchema.optional()\n});\n/**\n* Task creation parameters, used to ask that the server create a task to represent a request.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst TaskCreationParamsSchema = z.looseObject({\n\tttl: z.number().optional(),\n\tpollInterval: z.number().optional()\n});\n/**\n* The status of a task.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst TaskStatusSchema = z.enum([\n\t\"working\",\n\t\"input_required\",\n\t\"completed\",\n\t\"failed\",\n\t\"cancelled\"\n]);\n/**\n* A pollable state object associated with a request.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst TaskSchema = z.object({\n\ttaskId: z.string(),\n\tstatus: TaskStatusSchema,\n\tttl: z.union([z.number(), z.null()]),\n\tcreatedAt: z.string(),\n\tlastUpdatedAt: z.string(),\n\tpollInterval: z.optional(z.number()),\n\tstatusMessage: z.optional(z.string())\n});\n/**\n* Result returned when a task is created, containing the task data wrapped in a `task` field.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst CreateTaskResultSchema = ResultSchema.extend({ task: TaskSchema });\n/**\n* Parameters for task status notification.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);\n/**\n* A notification sent when a task's status changes.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst TaskStatusNotificationSchema = NotificationSchema.extend({\n\tmethod: z.literal(\"notifications/tasks/status\"),\n\tparams: TaskStatusNotificationParamsSchema\n});\n/**\n* A request to get the state of a specific task.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst GetTaskRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"tasks/get\"),\n\tparams: BaseRequestParamsSchema.extend({ taskId: z.string() })\n});\n/**\n* The response to a {@linkcode GetTaskRequest | tasks/get} request.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst GetTaskResultSchema = ResultSchema.merge(TaskSchema);\n/**\n* A request to get the result of a specific task.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst GetTaskPayloadRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"tasks/result\"),\n\tparams: BaseRequestParamsSchema.extend({ taskId: z.string() })\n});\n/**\n* The response to a `tasks/result` request.\n* The structure matches the result type of the original request.\n* For example, a {@linkcode CallToolRequest | tools/call} task would return the `CallToolResult` structure.\n*\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst GetTaskPayloadResultSchema = ResultSchema.loose();\n/**\n* A request to list tasks.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst ListTasksRequestSchema = PaginatedRequestSchema.extend({ method: z.literal(\"tasks/list\") });\n/**\n* The response to a {@linkcode ListTasksRequest | tasks/list} request.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst ListTasksResultSchema = PaginatedResultSchema.extend({ tasks: z.array(TaskSchema) });\n/**\n* A request to cancel a specific task.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst CancelTaskRequestSchema = RequestSchema.extend({\n\tmethod: z.literal(\"tasks/cancel\"),\n\tparams: BaseRequestParamsSchema.extend({ taskId: z.string() })\n});\n/**\n* The response to a {@linkcode CancelTaskRequest | tasks/cancel} request.\n*\n* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n*/\nconst CancelTaskResultSchema = ResultSchema.merge(TaskSchema);\nconst ClientRequestSchema = z.union([\n\tPingRequestSchema,\n\tInitializeRequestSchema,\n\tDiscoverRequestSchema,\n\tCompleteRequestSchema,\n\tSetLevelRequestSchema,\n\tGetPromptRequestSchema,\n\tListPromptsRequestSchema,\n\tListResourcesRequestSchema,\n\tListResourceTemplatesRequestSchema,\n\tReadResourceRequestSchema,\n\tSubscribeRequestSchema,\n\tUnsubscribeRequestSchema,\n\tSubscriptionsListenRequestSchema,\n\tCallToolRequestSchema,\n\tListToolsRequestSchema\n]);\nconst ClientNotificationSchema = z.union([\n\tCancelledNotificationSchema,\n\tProgressNotificationSchema,\n\tInitializedNotificationSchema,\n\tRootsListChangedNotificationSchema\n]);\nconst ClientResultSchema = z.union([\n\tEmptyResultSchema,\n\tCreateMessageResultSchema,\n\tCreateMessageResultWithToolsSchema,\n\tElicitResultSchema,\n\tListRootsResultSchema\n]);\nconst ServerRequestSchema = z.union([\n\tPingRequestSchema,\n\tCreateMessageRequestSchema,\n\tElicitRequestSchema,\n\tListRootsRequestSchema\n]);\nconst ServerNotificationSchema = z.union([\n\tCancelledNotificationSchema,\n\tProgressNotificationSchema,\n\tLoggingMessageNotificationSchema,\n\tResourceUpdatedNotificationSchema,\n\tResourceListChangedNotificationSchema,\n\tToolListChangedNotificationSchema,\n\tPromptListChangedNotificationSchema,\n\tSubscriptionsAcknowledgedNotificationSchema,\n\tElicitationCompleteNotificationSchema\n]);\nconst ServerResultSchema = z.union([\n\tEmptyResultSchema,\n\tInitializeResultSchema,\n\tDiscoverResultSchema,\n\tCompleteResultSchema,\n\tGetPromptResultSchema,\n\tListPromptsResultSchema,\n\tListResourcesResultSchema,\n\tListResourceTemplatesResultSchema,\n\tReadResourceResultSchema,\n\tCallToolResultSchema,\n\tListToolsResultSchema,\n\tSubscriptionsListenResultSchema\n]);\n\n//#endregion\n//#region src/auth.ts\n/**\n* Reusable URL validation that disallows `javascript:` scheme\n*/\nconst SafeUrlSchema = z.url().superRefine((val, ctx) => {\n\tif (!URL.canParse(val)) {\n\t\tctx.addIssue({\n\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\tmessage: \"URL must be parseable\",\n\t\t\tfatal: true\n\t\t});\n\t\treturn z.NEVER;\n\t}\n}).refine((url) => {\n\tconst u = new URL(url);\n\treturn u.protocol !== \"javascript:\" && u.protocol !== \"data:\" && u.protocol !== \"vbscript:\";\n}, { message: \"URL cannot use javascript:, data:, or vbscript: scheme\" });\n/**\n* RFC 9728 OAuth Protected Resource Metadata\n*/\nconst OAuthProtectedResourceMetadataSchema = z.looseObject({\n\tresource: z.string().url(),\n\tauthorization_servers: z.array(SafeUrlSchema).optional(),\n\tjwks_uri: z.string().url().optional(),\n\tscopes_supported: z.array(z.string()).optional(),\n\tbearer_methods_supported: z.array(z.string()).optional(),\n\tresource_signing_alg_values_supported: z.array(z.string()).optional(),\n\tresource_name: z.string().optional(),\n\tresource_documentation: z.string().optional(),\n\tresource_policy_uri: z.string().url().optional(),\n\tresource_tos_uri: z.string().url().optional(),\n\ttls_client_certificate_bound_access_tokens: z.boolean().optional(),\n\tauthorization_details_types_supported: z.array(z.string()).optional(),\n\tdpop_signing_alg_values_supported: z.array(z.string()).optional(),\n\tdpop_bound_access_tokens_required: z.boolean().optional()\n});\n/**\n* RFC 8414 OAuth 2.0 Authorization Server Metadata\n*/\nconst OAuthMetadataSchema = z.looseObject({\n\tissuer: z.string(),\n\tauthorization_endpoint: SafeUrlSchema,\n\ttoken_endpoint: SafeUrlSchema,\n\tregistration_endpoint: SafeUrlSchema.optional(),\n\tscopes_supported: z.array(z.string()).optional(),\n\tresponse_types_supported: z.array(z.string()),\n\tresponse_modes_supported: z.array(z.string()).optional(),\n\tgrant_types_supported: z.array(z.string()).optional(),\n\ttoken_endpoint_auth_methods_supported: z.array(z.string()).optional(),\n\ttoken_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),\n\tservice_documentation: SafeUrlSchema.optional(),\n\trevocation_endpoint: SafeUrlSchema.optional(),\n\trevocation_endpoint_auth_methods_supported: z.array(z.string()).optional(),\n\trevocation_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),\n\tintrospection_endpoint: z.string().optional(),\n\tintrospection_endpoint_auth_methods_supported: z.array(z.string()).optional(),\n\tintrospection_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),\n\tcode_challenge_methods_supported: z.array(z.string()).optional(),\n\tclient_id_metadata_document_supported: z.boolean().optional(),\n\tauthorization_response_iss_parameter_supported: z.boolean().optional().catch(void 0),\n\tdpop_signing_alg_values_supported: z.array(z.string()).optional()\n});\n/**\n* OpenID Connect Discovery 1.0 Provider Metadata\n*\n* @see https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\n*/\nconst OpenIdProviderMetadataSchema = z.looseObject({\n\tissuer: z.string(),\n\tauthorization_endpoint: SafeUrlSchema,\n\ttoken_endpoint: SafeUrlSchema,\n\tuserinfo_endpoint: SafeUrlSchema.optional(),\n\tjwks_uri: SafeUrlSchema,\n\tregistration_endpoint: SafeUrlSchema.optional(),\n\tscopes_supported: z.array(z.string()).optional(),\n\tresponse_types_supported: z.array(z.string()),\n\tresponse_modes_supported: z.array(z.string()).optional(),\n\tgrant_types_supported: z.array(z.string()).optional(),\n\tacr_values_supported: z.array(z.string()).optional(),\n\tsubject_types_supported: z.array(z.string()),\n\tid_token_signing_alg_values_supported: z.array(z.string()),\n\tid_token_encryption_alg_values_supported: z.array(z.string()).optional(),\n\tid_token_encryption_enc_values_supported: z.array(z.string()).optional(),\n\tuserinfo_signing_alg_values_supported: z.array(z.string()).optional(),\n\tuserinfo_encryption_alg_values_supported: z.array(z.string()).optional(),\n\tuserinfo_encryption_enc_values_supported: z.array(z.string()).optional(),\n\trequest_object_signing_alg_values_supported: z.array(z.string()).optional(),\n\trequest_object_encryption_alg_values_supported: z.array(z.string()).optional(),\n\trequest_object_encryption_enc_values_supported: z.array(z.string()).optional(),\n\ttoken_endpoint_auth_methods_supported: z.array(z.string()).optional(),\n\ttoken_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),\n\tdisplay_values_supported: z.array(z.string()).optional(),\n\tclaim_types_supported: z.array(z.string()).optional(),\n\tclaims_supported: z.array(z.string()).optional(),\n\tservice_documentation: z.string().optional(),\n\tclaims_locales_supported: z.array(z.string()).optional(),\n\tui_locales_supported: z.array(z.string()).optional(),\n\tclaims_parameter_supported: z.boolean().optional(),\n\trequest_parameter_supported: z.boolean().optional(),\n\trequest_uri_parameter_supported: z.boolean().optional(),\n\trequire_request_uri_registration: z.boolean().optional(),\n\top_policy_uri: SafeUrlSchema.optional(),\n\top_tos_uri: SafeUrlSchema.optional(),\n\tclient_id_metadata_document_supported: z.boolean().optional(),\n\tauthorization_response_iss_parameter_supported: z.boolean().optional().catch(void 0)\n});\n/**\n* OpenID Connect Discovery metadata that may include OAuth 2.0 fields\n* This schema represents the real-world scenario where OIDC providers\n* return a mix of OpenID Connect and OAuth 2.0 metadata fields\n*/\nconst OpenIdProviderDiscoveryMetadataSchema = z.object({\n\t...OpenIdProviderMetadataSchema.shape,\n\t...OAuthMetadataSchema.pick({ code_challenge_methods_supported: true }).shape\n});\n/**\n* OAuth 2.1 token response\n*/\nconst OAuthTokensSchema = z.object({\n\taccess_token: z.string(),\n\tid_token: z.string().optional(),\n\ttoken_type: z.string(),\n\texpires_in: z.coerce.number().optional(),\n\tscope: z.string().optional(),\n\trefresh_token: z.string().optional(),\n\tissuer: z.string().optional().catch(void 0)\n}).strip();\n/**\n* RFC 8693 §2.2.1 Token Exchange response for ID-JAG tokens.\n*\n* `token_type` is intentionally optional: per RFC 8693 §2.2.1 it is informational when\n* the issued token is not an access token, and per RFC 6749 §5.1 it is case-insensitive,\n* so strict checking rejects conformant IdPs.\n*/\nconst IdJagTokenExchangeResponseSchema = z.object({\n\tissued_token_type: z.literal(\"urn:ietf:params:oauth:token-type:id-jag\"),\n\taccess_token: z.string(),\n\ttoken_type: z.string().optional(),\n\texpires_in: z.number().optional(),\n\tscope: z.string().optional()\n}).strip();\n/**\n* OAuth 2.1 error response\n*/\nconst OAuthErrorResponseSchema = z.object({\n\terror: z.string(),\n\terror_description: z.string().optional(),\n\terror_uri: z.string().optional()\n});\n/**\n* Optional version of {@linkcode SafeUrlSchema} that allows empty string for backward compatibility on `tos_uri` and `logo_uri`\n*/\nconst OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z.literal(\"\").transform(() => void 0));\n/**\n* RFC 7591 OAuth 2.0 Dynamic Client Registration metadata\n*/\nconst OAuthClientMetadataSchema = z.object({\n\tredirect_uris: z.array(SafeUrlSchema),\n\ttoken_endpoint_auth_method: z.string().optional(),\n\tgrant_types: z.array(z.string()).optional(),\n\tresponse_types: z.array(z.string()).optional(),\n\tapplication_type: z.string().optional(),\n\tclient_name: z.string().optional(),\n\tclient_uri: SafeUrlSchema.optional(),\n\tlogo_uri: OptionalSafeUrlSchema,\n\tscope: z.string().optional(),\n\tcontacts: z.array(z.string()).optional(),\n\ttos_uri: OptionalSafeUrlSchema,\n\tpolicy_uri: z.string().optional(),\n\tjwks_uri: SafeUrlSchema.optional(),\n\tjwks: z.any().optional(),\n\tsoftware_id: z.string().optional(),\n\tsoftware_version: z.string().optional(),\n\tsoftware_statement: z.string().optional()\n}).strip();\n/**\n* RFC 7591 OAuth 2.0 Dynamic Client Registration client information\n*/\nconst OAuthClientInformationSchema = z.object({\n\tclient_id: z.string(),\n\tclient_secret: z.string().optional(),\n\tclient_id_issued_at: z.number().optional(),\n\tclient_secret_expires_at: z.number().optional(),\n\tissuer: z.string().optional().catch(void 0)\n}).strip();\n/**\n* RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata)\n*/\nconst OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);\n/**\n* RFC 7591 OAuth 2.0 Dynamic Client Registration error response\n*/\nconst OAuthClientRegistrationErrorSchema = z.object({\n\terror: z.string(),\n\terror_description: z.string().optional()\n}).strip();\n/**\n* RFC 7009 OAuth 2.0 Token Revocation request\n*/\nconst OAuthTokenRevocationRequestSchema = z.object({\n\ttoken: z.string(),\n\ttoken_type_hint: z.string().optional()\n}).strip();\n\n//#endregion\nexport { EmbeddedResourceSchema as $, TaskMetadataSchema as $n, PrimitiveSchemaDefinitionSchema as $t, ClientRequestSchema as A, SamplingContentSchema as An, PARSE_ERROR as Ar, ListResourceTemplatesRequestSchema as At, CreateMessageResultSchema as B, SingleSelectEnumSchemaSchema as Bn, LoggingLevelSchema as Bt, CallToolResultSchema as C, ResourceUpdatedNotificationParamsSchema as Cn, INTERNAL_ERROR as Cr, JSONRPCResponseSchema as Ct, CancelledNotificationSchema as D, RoleSchema as Dn, LATEST_PROTOCOL_VERSION as Dr, ListChangedOptionsBaseSchema as Dt, CancelledNotificationParamsSchema as E, ResultSchema as En, JSONRPC_VERSION as Er, LegacyTitledEnumSchemaSchema as Et, CompleteRequestSchema as F, ServerRequestSchema as Fn, SUPPORTED_PROTOCOL_VERSIONS as Fr, ListRootsResultSchema as Ft, DiscoverResultSchema as G, SubscriptionsAcknowledgedNotificationParamsSchema as Gn, MultiSelectEnumSchemaSchema as Gt, CreateTaskResultSchema as H, SubscribeRequestParamsSchema as Hn, LoggingMessageNotificationSchema as Ht, CompleteResultSchema as I, ServerResultSchema as In, TRACEPARENT_META_KEY as Ir, ListTasksRequestSchema as It, ElicitRequestSchema as J, SubscriptionsListenRequestSchema as Jn, NumberSchemaSchema as Jt, ElicitRequestFormParamsSchema as K, SubscriptionsAcknowledgedNotificationSchema as Kn, NotificationSchema as Kt, ContentBlockSchema as L, ServerTasksCapabilitySchema as Ln, TRACESTATE_META_KEY as Lr, ListTasksResultSchema as Lt, ClientTasksCapabilitySchema as M, SamplingMessageSchema as Mn, RELATED_TASK_META_KEY as Mr, ListResourcesRequestSchema as Mt, CompatibilityCallToolResultSchema as N, ServerCapabilitiesSchema as Nn, SERVER_INFO_META_KEY as Nr, ListResourcesResultSchema as Nt, ClientCapabilitiesSchema as O, RootSchema as On, LOG_LEVEL_META_KEY as Or, ListPromptsRequestSchema as Ot, CompleteRequestParamsSchema as P, ServerNotificationSchema as Pn, SUBSCRIPTION_ID_META_KEY as Pr, ListRootsRequestSchema as Pt, ElicitationCompleteNotificationSchema as Q, TaskCreationParamsSchema as Qn, PingRequestSchema as Qt, CreateMessageRequestParamsSchema as R, SetLevelRequestParamsSchema as Rn, ListToolsRequestSchema as Rt, CallToolRequestSchema as S, ResourceTemplateSchema as Sn, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as Sr, JSONRPCRequestSchema as St, CancelTaskResultSchema as T, ResultMetaObjectSchema as Tn, INVALID_REQUEST as Tr, JSONValueSchema as Tt, CursorSchema as U, SubscribeRequestSchema as Un, ModelHintSchema as Ut, CreateMessageResultWithToolsSchema as V, StringSchemaSchema as Vn, LoggingMessageNotificationParamsSchema as Vt, DiscoverRequestSchema as W, SubscriptionFilterSchema as Wn, ModelPreferencesSchema as Wt, ElicitResultSchema as X, SubscriptionsListenResultSchema as Xn, PaginatedRequestSchema as Xt, ElicitRequestURLParamsSchema as Y, SubscriptionsListenResultMetaSchema as Yn, PaginatedRequestParamsSchema as Yt, ElicitationCompleteNotificationParamsSchema as Z, TaskAugmentedRequestParamsSchema as Zn, PaginatedResultSchema as Zt, BaseMetadataSchema as _, ResourceLinkSchema as _n, UntitledMultiSelectEnumSchemaSchema as _r, JSONArraySchema as _t, OAuthClientRegistrationErrorSchema as a, PromptListChangedNotificationSchema as an, TextResourceContentsSchema as ar, GetTaskPayloadRequestSchema as at, BooleanSchemaSchema as b, ResourceSchema as bn, CLIENT_CAPABILITIES_META_KEY as br, JSONRPCMessageSchema as bt, OAuthProtectedResourceMetadataSchema as c, PromptSchema as cn, ToolAnnotationsSchema as cr, GetTaskResultSchema as ct, OpenIdProviderDiscoveryMetadataSchema as d, ReadResourceResultSchema as dn, ToolListChangedNotificationSchema as dr, ImageContentSchema as dt, ProgressNotificationParamsSchema as en, TaskSchema as er, EmptyResultSchema as et, OpenIdProviderMetadataSchema as f, RelatedTaskMetadataSchema as fn, ToolResultContentSchema as fr, ImplementationSchema as ft, AudioContentSchema as g, ResourceContentsSchema as gn, UnsubscribeRequestSchema as gr, InitializedNotificationSchema as gt, AnnotationsSchema as h, RequestSchema as hn, UnsubscribeRequestParamsSchema as hr, InitializeResultSchema as ht, OAuthClientMetadataSchema as i, PromptArgumentSchema as in, TextContentSchema as ir, GetPromptResultSchema as it, ClientResultSchema as j, SamplingMessageContentBlockSchema as jn, PROTOCOL_VERSION_META_KEY as jr, ListResourceTemplatesResultSchema as jt, ClientNotificationSchema as k, RootsListChangedNotificationSchema as kn, METHOD_NOT_FOUND as kr, ListPromptsResultSchema as kt, OAuthTokenRevocationRequestSchema as l, ReadResourceRequestParamsSchema as ln, ToolChoiceSchema as lr, IconSchema as lt, SafeUrlSchema as m, RequestMetaSchema as mn, ToolUseContentSchema as mr, InitializeRequestSchema as mt, OAuthClientInformationFullSchema as n, ProgressSchema as nn, TaskStatusNotificationSchema as nr, GetPromptRequestParamsSchema as nt, OAuthErrorResponseSchema as o, PromptMessageSchema as on, TitledMultiSelectEnumSchemaSchema as or, GetTaskPayloadResultSchema as ot, OptionalSafeUrlSchema as p, RequestIdSchema as pn, ToolSchema as pr, InitializeRequestParamsSchema as pt, ElicitRequestParamsSchema as q, SubscriptionsListenRequestParamsSchema as qn, NotificationsParamsSchema as qt, OAuthClientInformationSchema as r, ProgressTokenSchema as rn, TaskStatusSchema as rr, GetPromptRequestSchema as rt, OAuthMetadataSchema as s, PromptReferenceSchema as sn, TitledSingleSelectEnumSchemaSchema as sr, GetTaskRequestSchema as st, IdJagTokenExchangeResponseSchema as t, ProgressNotificationSchema as tn, TaskStatusNotificationParamsSchema as tr, EnumSchemaSchema as tt, OAuthTokensSchema as u, ReadResourceRequestSchema as un, ToolExecutionSchema as ur, IconsSchema as ut, BaseRequestParamsSchema as v, ResourceListChangedNotificationSchema as vn, UntitledSingleSelectEnumSchemaSchema as vr, JSONObjectSchema as vt, CancelTaskRequestSchema as w, ResourceUpdatedNotificationSchema as wn, INVALID_PARAMS as wr, JSONRPCResultResponseSchema as wt, CallToolRequestParamsSchema as x, ResourceTemplateReferenceSchema as xn, CLIENT_INFO_META_KEY as xr, JSONRPCNotificationSchema as xt, BlobResourceContentsSchema as y, ResourceRequestParamsSchema as yn, BAGGAGE_META_KEY as yr, JSONRPCErrorResponseSchema as yt, CreateMessageRequestSchema as z, SetLevelRequestSchema as zn, ListToolsResultSchema as zt };\n//# sourceMappingURL=auth-BNDyLTqp.mjs.map","import { n as __exportAll, r as __toESM, t as __commonJSMin } from \"./chunk-Br0eD_fh.mjs\";\nimport { n as declares2019Dialect } from \"./dialects-DoSzNhcb.mjs\";\nimport { AnnotationsSchema, AudioContentSchema, BAGGAGE_META_KEY, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, INTERNAL_ERROR, INVALID_PARAMS, INVALID_REQUEST, IconSchema, IconsSchema, IdJagTokenExchangeResponseSchema, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArraySchema, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONRPC_VERSION, JSONValueSchema, LATEST_PROTOCOL_VERSION, LOG_LEVEL_META_KEY, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, METHOD_NOT_FOUND, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, OAuthClientInformationFullSchema, OAuthClientInformationSchema, OAuthClientMetadataSchema, OAuthClientRegistrationErrorSchema, OAuthErrorResponseSchema, OAuthMetadataSchema, OAuthProtectedResourceMetadataSchema, OAuthTokenRevocationRequestSchema, OAuthTokensSchema, OpenIdProviderDiscoveryMetadataSchema, OpenIdProviderMetadataSchema, PARSE_ERROR, PROTOCOL_VERSION_META_KEY, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, RELATED_TASK_META_KEY, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultMetaObjectSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SERVER_INFO_META_KEY, SUBSCRIPTION_ID_META_KEY, SUPPORTED_PROTOCOL_VERSIONS, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TRACEPARENT_META_KEY, TRACESTATE_META_KEY, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema } from \"@modelcontextprotocol/core/internal\";\nimport * as z from \"zod/v4\";\n\n//#region ../core-internal/src/errors/crossBundleBrand.ts\n/**\n* Cross-bundle `instanceof` support for the SDK error classes.\n*\n* `@modelcontextprotocol/client` and `@modelcontextprotocol/server` each bundle their\n* own copy of `core-internal`, so an error constructed by one package fails a\n* prototype-identity `instanceof` against the same class re-exported by the other —\n* exactly the check a dual-role process (gateway, host, in-process test) writes.\n*\n* Instead of prototype identity, branded classes stamp every instance with the brand\n* strings of its class chain under a registry symbol (`Symbol.for`, shared across\n* bundles and realms), and resolve `instanceof` via `Symbol.hasInstance` against the\n* brand set. Ordinary prototype-based `instanceof` is kept as a fallback so behavior\n* is unchanged for anything unbranded.\n*\n* A class participates by defining an **own** `mcpBrand` static (via a `static {}`\n* block, so nothing reaches the declaration files — a declared `protected static`\n* field would make the constructor types nominally incompatible across the bundled\n* copies) and (for hierarchy roots) installing {@linkcode brandedHasInstance} as\n* `Symbol.hasInstance`. User-defined subclasses that do not declare their own brand\n* keep plain prototype semantics — a foreign base-class instance never satisfies\n* `instanceof UserSubclass`.\n*\n* Prior art — the same stamp-and-hook shape ships at scale elsewhere: Node core\n* (stream.Writable since 2017, Console via a marker symbol, diagnostics_channel),\n* undici's whole error hierarchy (vendored into Node as fetch), googleapis/gaxios\n* (GaxiosError, Symbol.for marker), AWS SDK v3's ServiceException (which pairs a\n* Symbol.hasInstance override with a static isInstance guard, as we do), and zod v4\n* (Symbol.hasInstance on every schema class for cross-version interop).\n*\n* Contract notes:\n* - Participation criterion: **every error class exported from a public package that\n*   callers are documented to `instanceof` must be branded.** The per-package\n*   errorBrandConformance tests walk the export surfaces and fail naming any\n*   exported Error subclass that has not opted in.\n* - Brands assert **identity, not shape**: brand strings are version-less, so an\n*   instance from one SDK version matches the class of another. Members added to a\n*   branded class in a later version may be absent on a matched instance — read\n*   fields defensively, and treat branded classes as additive-only. The escape\n*   hatch when a release must break a branded class's read contract: change that\n*   class's brand string in the same release, which cleanly severs cross-version\n*   matching for that class. The per-package brand pins make the rename\n*   deliberate: errorSurfacePins.test.ts owns the core-internal brands, and each\n*   package's errorBrandConformance test pins its package-local ones.\n* - Cross-bundle matching requires **both** copies to be at or after the release\n*   that introduced branding; against an older copy, behavior degrades to plain\n*   prototype `instanceof` in both directions.\n* - A consumer re-bundling the SDK with property mangling (`mangle.props`) would\n*   break the brand statics; default esbuild/webpack/terser settings do not.\n*/\n/** Registry symbol — identical across bundled copies and realms. */\nconst BRANDS = Symbol.for(\"mcp.sdk.errorBrands\");\n/**\n* Stamp `instance` with the brand of every class in `ctor`'s chain that declares an\n* own `mcpBrand`. Call once from the hierarchy root's constructor with `new.target` —\n* subclasses inherit the stamping without touching their constructors.\n*\n* Constructor-time only: never stamp arbitrary objects. A stamped non-instance would\n* satisfy `instanceof` while lacking the prototype members (getters like `.status`)\n* that callers reach for after the check.\n*/\nfunction stampErrorBrands(instance, ctor) {\n\tconst brands = /* @__PURE__ */ new Set();\n\tlet current = ctor;\n\twhile (typeof current === \"function\") {\n\t\tconst brand = current.mcpBrand;\n\t\tif (Object.prototype.hasOwnProperty.call(current, \"mcpBrand\") && typeof brand === \"string\") brands.add(brand);\n\t\tcurrent = Object.getPrototypeOf(current);\n\t}\n\tif (brands.size === 0) return;\n\tObject.defineProperty(instance, BRANDS, {\n\t\tvalue: brands,\n\t\tenumerable: false,\n\t\tconfigurable: true\n\t});\n}\n/**\n* `Symbol.hasInstance` implementation for branded hierarchy roots. Matches when the\n* value carries the **own** brand of the class being tested against (cross-bundle\n* path), falling back to ordinary prototype-based `instanceof` otherwise.\n*/\nfunction brandedHasInstance(cls, value) {\n\ttry {\n\t\tif (typeof value === \"object\" && value !== null && Object.prototype.hasOwnProperty.call(cls, \"mcpBrand\") && typeof cls.mcpBrand === \"string\" && Object.prototype.hasOwnProperty.call(value, BRANDS)) {\n\t\t\tconst carried = value[BRANDS];\n\t\t\tif (carried && typeof carried.has === \"function\" && carried.has(cls.mcpBrand)) return true;\n\t\t}\n\t} catch {}\n\treturn Function.prototype[Symbol.hasInstance].call(cls, value);\n}\n\n//#endregion\n//#region ../core-internal/src/auth/errors.ts\n/**\n* OAuth error codes as defined by {@link https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | RFC 6749}\n* and extensions.\n*/\nlet OAuthErrorCode = /* @__PURE__ */ function(OAuthErrorCode$1) {\n\t/**\n\t* The request is missing a required parameter, includes an invalid parameter value,\n\t* includes a parameter more than once, or is otherwise malformed.\n\t*/\n\tOAuthErrorCode$1[\"InvalidRequest\"] = \"invalid_request\";\n\t/**\n\t* Client authentication failed (e.g., unknown client, no client authentication included,\n\t* or unsupported authentication method).\n\t*/\n\tOAuthErrorCode$1[\"InvalidClient\"] = \"invalid_client\";\n\t/**\n\t* The provided authorization grant or refresh token is invalid, expired, revoked,\n\t* does not match the redirection URI used in the authorization request, or was issued to another client.\n\t*/\n\tOAuthErrorCode$1[\"InvalidGrant\"] = \"invalid_grant\";\n\t/**\n\t* The authenticated client is not authorized to use this authorization grant type.\n\t*/\n\tOAuthErrorCode$1[\"UnauthorizedClient\"] = \"unauthorized_client\";\n\t/**\n\t* The authorization grant type is not supported by the authorization server.\n\t*/\n\tOAuthErrorCode$1[\"UnsupportedGrantType\"] = \"unsupported_grant_type\";\n\t/**\n\t* The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.\n\t*/\n\tOAuthErrorCode$1[\"InvalidScope\"] = \"invalid_scope\";\n\t/**\n\t* The resource owner or authorization server denied the request.\n\t*/\n\tOAuthErrorCode$1[\"AccessDenied\"] = \"access_denied\";\n\t/**\n\t* The authorization server encountered an unexpected condition that prevented it from fulfilling the request.\n\t*/\n\tOAuthErrorCode$1[\"ServerError\"] = \"server_error\";\n\t/**\n\t* The authorization server is currently unable to handle the request due to temporary overloading or maintenance.\n\t*/\n\tOAuthErrorCode$1[\"TemporarilyUnavailable\"] = \"temporarily_unavailable\";\n\t/**\n\t* The authorization server does not support obtaining an authorization code using this method.\n\t*/\n\tOAuthErrorCode$1[\"UnsupportedResponseType\"] = \"unsupported_response_type\";\n\t/**\n\t* The authorization server does not support the requested token type.\n\t*/\n\tOAuthErrorCode$1[\"UnsupportedTokenType\"] = \"unsupported_token_type\";\n\t/**\n\t* The access token provided is expired, revoked, malformed, or invalid for other reasons.\n\t*/\n\tOAuthErrorCode$1[\"InvalidToken\"] = \"invalid_token\";\n\t/**\n\t* The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)\n\t*/\n\tOAuthErrorCode$1[\"MethodNotAllowed\"] = \"method_not_allowed\";\n\t/**\n\t* Rate limit exceeded. (Custom, non-standard error based on RFC 6585)\n\t*/\n\tOAuthErrorCode$1[\"TooManyRequests\"] = \"too_many_requests\";\n\t/**\n\t* The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)\n\t*/\n\tOAuthErrorCode$1[\"InvalidClientMetadata\"] = \"invalid_client_metadata\";\n\t/**\n\t* The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)\n\t*/\n\tOAuthErrorCode$1[\"InvalidRedirectUri\"] = \"invalid_redirect_uri\";\n\t/**\n\t* The request requires higher privileges than provided by the access token.\n\t*/\n\tOAuthErrorCode$1[\"InsufficientScope\"] = \"insufficient_scope\";\n\t/**\n\t* The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)\n\t*/\n\tOAuthErrorCode$1[\"InvalidTarget\"] = \"invalid_target\";\n\t/**\n\t* The DPoP proof accompanying the request is invalid, or does not match the key the grant\n\t* (e.g. a refresh token) is bound to. (RFC 9449 §5 / §7.1)\n\t*/\n\tOAuthErrorCode$1[\"InvalidDpopProof\"] = \"invalid_dpop_proof\";\n\t/**\n\t* The server requires a server-supplied nonce in the DPoP proof; retry with the `DPoP-Nonce`\n\t* it returned. (RFC 9449 §8 / §9)\n\t*/\n\tOAuthErrorCode$1[\"UseDpopNonce\"] = \"use_dpop_nonce\";\n\treturn OAuthErrorCode$1;\n}({});\n/**\n* OAuth error class for all OAuth-related errors.\n*/\nvar OAuthError = class OAuthError extends Error {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.OAuthError\" });\n\t}\n\tstatic [Symbol.hasInstance](value) {\n\t\treturn brandedHasInstance(this, value);\n\t}\n\t/**\n\t* Brand-based type guard: equivalent to `value instanceof this`, as an\n\t* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads\n\t* the caller's own brand via `this`, so every branded subclass gets a\n\t* correctly-scoped guard by inheritance. Must be invoked on the class —\n\t* in callback position write `v => SdkError.isInstance(v)`, not\n\t* `.filter(SdkError.isInstance)` (detached calls throw rather than\n\t* silently matching nothing).\n\t*/\n\tstatic isInstance(value) {\n\t\tif (typeof this !== \"function\") throw new TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");\n\t\treturn brandedHasInstance(this, value);\n\t}\n\tconstructor(code, message, errorUri) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.errorUri = errorUri;\n\t\tthis.name = \"OAuthError\";\n\t\tstampErrorBrands(this, new.target);\n\t}\n\t/**\n\t* Converts the error to a standard OAuth error response object.\n\t*/\n\ttoResponseObject() {\n\t\tconst response = {\n\t\t\terror: this.code,\n\t\t\terror_description: this.message\n\t\t};\n\t\tif (this.errorUri) response.error_uri = this.errorUri;\n\t\treturn response;\n\t}\n\t/**\n\t* Creates an {@linkcode OAuthError} from an OAuth error response.\n\t*/\n\tstatic fromResponse(response) {\n\t\treturn new OAuthError(response.error, response.error_description ?? response.error, response.error_uri);\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/errors/sdkErrors.ts\n/**\n* Error codes for SDK errors (local errors that never cross the wire).\n* Unlike {@linkcode ProtocolErrorCode} which uses numeric JSON-RPC codes, `SdkErrorCode` uses\n* descriptive string values for better developer experience.\n*\n* These errors are thrown locally by the SDK and are never serialized as\n* JSON-RPC error responses.\n*/\nlet SdkErrorCode = /* @__PURE__ */ function(SdkErrorCode$1) {\n\t/** Transport is not connected */\n\tSdkErrorCode$1[\"NotConnected\"] = \"NOT_CONNECTED\";\n\t/** Transport is already connected */\n\tSdkErrorCode$1[\"AlreadyConnected\"] = \"ALREADY_CONNECTED\";\n\t/** Protocol is not initialized */\n\tSdkErrorCode$1[\"NotInitialized\"] = \"NOT_INITIALIZED\";\n\t/** Required capability is not supported by the remote side */\n\tSdkErrorCode$1[\"CapabilityNotSupported\"] = \"CAPABILITY_NOT_SUPPORTED\";\n\t/** Request timed out waiting for response */\n\tSdkErrorCode$1[\"RequestTimeout\"] = \"REQUEST_TIMEOUT\";\n\t/** Connection was closed */\n\tSdkErrorCode$1[\"ConnectionClosed\"] = \"CONNECTION_CLOSED\";\n\t/** Failed to send message */\n\tSdkErrorCode$1[\"SendFailed\"] = \"SEND_FAILED\";\n\t/** Response result failed local schema validation */\n\tSdkErrorCode$1[\"InvalidResult\"] = \"INVALID_RESULT\";\n\t/**\n\t* The response carried a `resultType` discriminator (protocol revision\n\t* 2026-07-28) naming a result kind this client cannot consume yet, e.g.\n\t* `input_required`. The kind is carried in `data.resultType`.\n\t*/\n\tSdkErrorCode$1[\"UnsupportedResultType\"] = \"UNSUPPORTED_RESULT_TYPE\";\n\t/**\n\t* The multi-round-trip auto-fulfilment driver exhausted its round cap\n\t* (`inputRequired.maxRounds`) without the server returning a complete\n\t* result. `data.rounds` carries the cap that was hit and\n\t* `data.lastResult` carries the last `input_required` payload received\n\t* (`{ inputRequests, requestState? }`), so callers can inspect or resume\n\t* the flow manually.\n\t*/\n\tSdkErrorCode$1[\"InputRequiredRoundsExceeded\"] = \"INPUT_REQUIRED_ROUNDS_EXCEEDED\";\n\t/**\n\t* The auto-aggregating no-`cursor` `listTools()` / `listPrompts()` /\n\t* `listResources()` / `listResourceTemplates()` walk hit the\n\t* `ClientOptions.listMaxPages` cap without the server's pagination\n\t* converging. `data.method` carries the list verb and\n\t* `data.listMaxPages` the cap that was hit; raise the cap or fall back to\n\t* explicit per-page `{ cursor }` calls.\n\t*/\n\tSdkErrorCode$1[\"ListPaginationExceeded\"] = \"LIST_PAGINATION_EXCEEDED\";\n\t/**\n\t* The spec method being sent does not exist on the negotiated protocol\n\t* version's wire era (e.g. `tasks/get` toward a 2026-07-28 peer, or\n\t* `server/discover` toward a 2025-era peer). Raised locally, before\n\t* anything reaches the transport. The method and era are carried in\n\t* `data.method` / `data.era`.\n\t*/\n\tSdkErrorCode$1[\"MethodNotSupportedByProtocolVersion\"] = \"METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION\";\n\t/**\n\t* Protocol-era negotiation at connect time failed without producing either a\n\t* usable modern (2026-07-28+) era or a definitive legacy fallback signal —\n\t* e.g. the negotiation mode forbids falling back (`pin`), the probe hit a\n\t* network failure, or the server answered the probe with a 5xx (a typed\n\t* connect error, never an era verdict).\n\t*\n\t* Negotiation-phase only: this code is never used once an era is\n\t* established. Auth walls never carry it: a 401/403 rejecting the probe\n\t* uses {@linkcode ClientHttpAuthentication} / {@linkcode ClientHttpForbidden}\n\t* instead, so era-recovery flows keyed on this code (e.g. cached-verdict\n\t* gateways) can never persist a verdict for an unauthorized exchange.\n\t*/\n\tSdkErrorCode$1[\"EraNegotiationFailed\"] = \"ERA_NEGOTIATION_FAILED\";\n\tSdkErrorCode$1[\"ClientHttpNotImplemented\"] = \"CLIENT_HTTP_NOT_IMPLEMENTED\";\n\t/**\n\t* HTTP 401 authentication failure: the transport's re-auth retry still got\n\t* 401 (`Server returned 401 after re-authentication`), or the version\n\t* negotiation probe was rejected 401 with no `authProvider` configured\n\t* (`Version negotiation failed: the server requires authorization (HTTP 401)`).\n\t* Carried on an {@linkcode SdkHttpError} with `status: 401`.\n\t*/\n\tSdkErrorCode$1[\"ClientHttpAuthentication\"] = \"CLIENT_HTTP_AUTHENTICATION\";\n\t/**\n\t* HTTP 403 denial: the step-up re-authorization retry limit was reached,\n\t* or the version negotiation probe was rejected 403\n\t* (`Version negotiation failed: the server denied access (HTTP 403)`).\n\t* Carried on an {@linkcode SdkHttpError} with `status: 403`.\n\t*/\n\tSdkErrorCode$1[\"ClientHttpForbidden\"] = \"CLIENT_HTTP_FORBIDDEN\";\n\tSdkErrorCode$1[\"ClientHttpUnexpectedContent\"] = \"CLIENT_HTTP_UNEXPECTED_CONTENT\";\n\tSdkErrorCode$1[\"ClientHttpFailedToOpenStream\"] = \"CLIENT_HTTP_FAILED_TO_OPEN_STREAM\";\n\tSdkErrorCode$1[\"ClientHttpFailedToTerminateSession\"] = \"CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION\";\n\treturn SdkErrorCode$1;\n}({});\n/**\n* SDK errors are local errors that never cross the wire.\n* They are distinct from {@linkcode ProtocolError} which represents JSON-RPC protocol errors\n* that are serialized and sent as error responses.\n*\n* @example\n* ```ts source=\"./sdkErrors.examples.ts#SdkError_basicUsage\"\n* try {\n*     // Throwing an SDK error\n*     throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');\n* } catch (error) {\n*     // Checking error type by code\n*     if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {\n*         // Handle timeout\n*     }\n* }\n* ```\n*/\nvar SdkError = class extends Error {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.SdkError\" });\n\t}\n\tstatic [Symbol.hasInstance](value) {\n\t\treturn brandedHasInstance(this, value);\n\t}\n\t/**\n\t* Brand-based type guard: equivalent to `value instanceof this`, as an\n\t* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads\n\t* the caller's own brand via `this`, so every branded subclass gets a\n\t* correctly-scoped guard by inheritance. Must be invoked on the class —\n\t* in callback position write `v => SdkError.isInstance(v)`, not\n\t* `.filter(SdkError.isInstance)` (detached calls throw rather than\n\t* silently matching nothing).\n\t*/\n\tstatic isInstance(value) {\n\t\tif (typeof this !== \"function\") throw new TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");\n\t\treturn brandedHasInstance(this, value);\n\t}\n\t/**\n\t* @param code - Stable string code identifying the failure ({@linkcode SdkErrorCode}).\n\t* @param message - Human-readable description.\n\t* @param data - Optional structured payload (for example the HTTP status carried by\n\t* {@linkcode SdkHttpError}). Opaque to the SDK: a `cause` key inside `data` is not\n\t* promoted to `Error.cause`.\n\t* @param options - Standard `ErrorOptions`, forwarded to `Error`. Pass the underlying\n\t* failure as `{ cause }` so it is reachable through the `Error.cause` chain that\n\t* loggers and error trackers walk.\n\t*/\n\tconstructor(code, message, data, options) {\n\t\tsuper(message, options);\n\t\tthis.code = code;\n\t\tthis.data = data;\n\t\tthis.name = \"SdkError\";\n\t\tstampErrorBrands(this, new.target);\n\t}\n};\n/**\n* An {@linkcode SdkError} subclass for HTTP transport failures.\n*\n* Thrown by the streamable HTTP transport when the server responds with a\n* non-OK status code. Narrows {@linkcode SdkError.data | data} to\n* {@linkcode SdkHttpErrorData} so consumers can inspect the HTTP status\n* without unsafe casting.\n*\n* @example\n* ```ts source=\"./sdkErrors.examples.ts#SdkHttpError_basicUsage\"\n* if (error instanceof SdkHttpError) {\n*     console.log(error.status); // number\n*     console.log(error.statusText); // string | undefined\n* }\n* ```\n*/\nvar SdkHttpError = class extends SdkError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.SdkHttpError\" });\n\t}\n\t/**\n\t* @param options - Standard `ErrorOptions`, forwarded to `Error` (see {@linkcode SdkError}).\n\t*/\n\tconstructor(code, message, data, options) {\n\t\tsuper(code, message, data, options);\n\t\tthis.name = \"SdkHttpError\";\n\t}\n\tget status() {\n\t\treturn this.data.status;\n\t}\n\tget statusText() {\n\t\treturn this.data.statusText;\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/shared/authUtils.ts\n/**\n* Utilities for handling OAuth resource URIs.\n*/\n/**\n* Converts a server URL to a resource URL by removing the fragment.\n* {@link https://datatracker.ietf.org/doc/html/rfc8707#section-2 | RFC 8707 section 2}\n* states that resource URIs \"MUST NOT include a fragment component\".\n* Keeps everything else unchanged (scheme, domain, port, path, query).\n*/\nfunction resourceUrlFromServerUrl(url) {\n\tconst resourceURL = typeof url === \"string\" ? new URL(url) : new URL(url.href);\n\tresourceURL.hash = \"\";\n\treturn resourceURL;\n}\n/**\n* Checks if a requested resource URL matches a configured resource URL.\n* A requested resource matches if it has the same scheme, domain, port,\n* and its path starts with the configured resource's path.\n*\n* @param options - The options object\n* @param options.requestedResource - The resource URL being requested\n* @param options.configuredResource - The resource URL that has been configured\n* @returns true if the requested resource matches the configured resource, false otherwise\n*/\nfunction checkResourceAllowed({ requestedResource, configuredResource }) {\n\tconst requested = typeof requestedResource === \"string\" ? new URL(requestedResource) : new URL(requestedResource.href);\n\tconst configured = typeof configuredResource === \"string\" ? new URL(configuredResource) : new URL(configuredResource.href);\n\tif (requested.origin !== configured.origin) return false;\n\tif (requested.pathname.length < configured.pathname.length) return false;\n\tconst requestedPath = requested.pathname.endsWith(\"/\") ? requested.pathname : requested.pathname + \"/\";\n\tconst configuredPath = configured.pathname.endsWith(\"/\") ? configured.pathname : configured.pathname + \"/\";\n\treturn requestedPath.startsWith(configuredPath);\n}\n\n//#endregion\n//#region ../core-internal/src/shared/clientCapabilityRequirements.ts\n/**\n* Inbound request methods whose processing structurally requires a client\n* capability, keyed by method, valued by the capabilities required.\n*\n* Currently empty: none of the request methods served on the 2026-07-28\n* registry unconditionally requires a client capability. Entries appear here\n* when such methods exist — for example requests whose handling embeds\n* elicitation or sampling input requests (the input-request engine), or\n* opt-in subscription delivery. Handler-conditional requirements (a specific\n* tool that needs sampling) are not expressible as a static method table and\n* are enforced at the point the requirement arises instead.\n*/\nconst REQUIRED_CLIENT_CAPABILITIES_BY_METHOD = {};\n/**\n* The client capabilities a request method structurally requires, or\n* `undefined` when the method has no static requirement.\n*/\nfunction requiredClientCapabilitiesForRequest(method) {\n\treturn Object.hasOwn(REQUIRED_CLIENT_CAPABILITIES_BY_METHOD, method) ? REQUIRED_CLIENT_CAPABILITIES_BY_METHOD[method] : void 0;\n}\nfunction isPlainObject$7(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/**\n* Whether a required nested member counts as declared even though it is not\n* spelled out: a bare `elicitation: {}` declaration (no mode sub-capability at\n* all) is read as form support — the pre-mode (2025) meaning of a bare\n* declaration — so an `elicitation.form` requirement treats it as satisfied.\n* Declaring any mode explicitly (for example `elicitation: { url: {} }`)\n* removes the implication.\n*/\nfunction isImpliedCapabilityMember(capability, member, declaredValue) {\n\treturn capability === \"elicitation\" && member === \"form\" && declaredValue[\"form\"] === void 0 && declaredValue[\"url\"] === void 0;\n}\n/**\n* The client capabilities an embedded multi-round-trip input request requires\n* (call site 2 — the outbound input-request leg): a server MUST NOT send an\n* `inputRequests` kind the request's declared client capabilities do not\n* cover. Returns `undefined` for entries whose method is not one of the\n* embedded input-request kinds (those are a server bug handled separately,\n* not a capability question).\n*\n* The requirement is mode-aware where the capability is: URL-mode elicitation\n* requires `elicitation.url`; form-mode (or mode-omitted) elicitation requires\n* `elicitation.form` (modes are sub-capabilities, and a server MUST NOT send a\n* mode the client did not declare); sampling with `tools`/`toolChoice`\n* requires `sampling.tools`. A bare `elicitation: {}` declaration satisfies\n* the form requirement — see {@linkcode missingClientCapabilities}.\n*/\nfunction requiredClientCapabilitiesForInputRequest(entry) {\n\tswitch (entry.method) {\n\t\tcase \"elicitation/create\":\n\t\t\tif (entry.params?.[\"mode\"] === \"url\") return { elicitation: { url: {} } };\n\t\t\treturn { elicitation: { form: {} } };\n\t\tcase \"sampling/createMessage\": {\n\t\t\tconst params = entry.params;\n\t\t\tif (params !== void 0 && (params[\"tools\"] !== void 0 || params[\"toolChoice\"] !== void 0)) return { sampling: { tools: {} } };\n\t\t\treturn { sampling: {} };\n\t\t}\n\t\tcase \"roots/list\": return { roots: {} };\n\t\tdefault: return;\n\t}\n}\n/**\n* Computes the subset of `required` client capabilities the client did not\n* declare. Returns `undefined` when every required capability is declared;\n* otherwise returns an object in the `ClientCapabilities` shape containing\n* exactly the missing capabilities (suitable for\n* `data.requiredCapabilities` on the `-32021` error).\n*\n* A capability counts as declared when its top-level key is present on the\n* declared capabilities; when the requirement names nested members (for\n* example `elicitation: { url: {} }`), each named member must also be present\n* under the declared capability. One lenient reading applies: a bare\n* `elicitation: {}` declaration (no mode sub-capability at all) counts as\n* declaring `elicitation.form` — the pre-mode (2025) meaning of a bare\n* declaration. An absent or empty `declared` value means\n* nothing is declared — every required capability is missing (the structural\n* clean-refusal posture for sessions with no per-request capability view).\n*/\nfunction missingClientCapabilities(required, declared) {\n\tconst missing = {};\n\tfor (const [capability, requirement] of Object.entries(required)) {\n\t\tif (requirement === void 0) continue;\n\t\tconst declaredValue = declared === void 0 ? void 0 : declared[capability];\n\t\tif (declaredValue === void 0) {\n\t\t\tmissing[capability] = requirement;\n\t\t\tcontinue;\n\t\t}\n\t\tif (isPlainObject$7(requirement) && isPlainObject$7(declaredValue)) {\n\t\t\tconst missingMembers = {};\n\t\t\tfor (const [member, memberRequirement] of Object.entries(requirement)) if (memberRequirement !== void 0 && declaredValue[member] === void 0 && !isImpliedCapabilityMember(capability, member, declaredValue)) missingMembers[member] = memberRequirement;\n\t\t\tif (Object.keys(missingMembers).length > 0) missing[capability] = missingMembers;\n\t\t}\n\t}\n\treturn Object.keys(missing).length > 0 ? missing : void 0;\n}\n\n//#endregion\n//#region ../core-internal/src/shared/protocolEras.ts\n/**\n* The first protocol revision of the modern (2026-07-28) era. Revision identifiers\n* are ISO dates, so lexicographic comparison orders them chronologically.\n*/\nconst FIRST_MODERN_PROTOCOL_VERSION = \"2026-07-28\";\n/**\n* Modern-era protocol revisions this SDK can negotiate via `server/discover`.\n* Deliberately separate from {@linkcode SUPPORTED_PROTOCOL_VERSIONS} (the legacy\n* `initialize` list), so adding a revision here can never leak a modern version\n* string into a 2025-era handshake. Internal — not part of the public API surface.\n*/\nconst SUPPORTED_MODERN_PROTOCOL_VERSIONS = [FIRST_MODERN_PROTOCOL_VERSION];\n/** Whether the given protocol revision belongs to the modern (2026-07-28+) era. */\nfunction isModernProtocolVersion(version) {\n\treturn version >= FIRST_MODERN_PROTOCOL_VERSION;\n}\n/** The legacy-era (pre-2026-07-28) subset of a supported-versions list, in the list's own preference order. */\nfunction legacyProtocolVersions(versions) {\n\treturn versions.filter((version) => !isModernProtocolVersion(version));\n}\n/** The modern-era (2026-07-28+) subset of a supported-versions list, in the list's own preference order. */\nfunction modernProtocolVersions(versions) {\n\treturn versions.filter((version) => isModernProtocolVersion(version));\n}\n\n//#endregion\n//#region ../core-internal/src/wire/textFallback.ts\n/**\n* SEP-2106 §4.3 TextContent auto-append, era-agnostic, called from BOTH\n* codecs' {@link WireCodec.projectCallToolResult}: when `structuredContent`\n* is a non-object value (array/primitive/`null`) and the handler authored no\n* `type:'text'` block, append `{type:'text', text: JSON.stringify(value)}`.\n* Object-shaped (or absent) `structuredContent` returns the same reference.\n*\n* Leaf module: imported by both era codec modules, so it must NOT import from\n* `./codec.js` (which value-imports the rev codecs at top level — that would\n* make a runtime cycle and a TDZ hazard for entries that evaluate a rev codec\n* module first).\n*/\nfunction appendTextFallbackForNonObject(result) {\n\tconst sc = result.structuredContent;\n\tif (sc === void 0) return result;\n\tif (!(typeof sc !== \"object\" || sc === null || Array.isArray(sc))) return result;\n\tif (result.content?.some((c) => c.type === \"text\") ?? false) return result;\n\treturn {\n\t\t...result,\n\t\tcontent: [...result.content ?? [], {\n\t\t\ttype: \"text\",\n\t\t\ttext: JSON.stringify(sc)\n\t\t}]\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/wire/resultFamilies.ts\n/**\n* Result-family keys that must never default into a `{content: []}` tools/call\n* success. Shared by the 2025 wire-seam schema and server normalization.\n* Leaf module (like `textFallback.ts`): imported by registry/server paths, so\n* it must NOT import from `./codec.js` — that would close a runtime cycle.\n*/\nconst TOOL_RESULT_FOREIGN_FAMILY_KEYS = [\n\t\"task\",\n\t\"inputRequests\",\n\t\"requestState\"\n];\n/**\n* Single owner of the v1-parity ruling: a plain-object tool result without `content` (and\n* without foreign-family keys) gains `content: []`. Shared by the 2025 wire seam and server-side handler normalization.\n*/\nfunction normalizeContentlessToolResult(value) {\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value) || value.content !== void 0 || TOOL_RESULT_FOREIGN_FAMILY_KEYS.some((key) => key in value)) return value;\n\treturn {\n\t\t...value,\n\t\tcontent: []\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2025-11-25/buildSchemas.ts\n/**\n* Complete frozen 2025-11-25 wire schemas. Self-contained — no imports from\n* the public/neutral types/schemas.ts. The neutral layer is the public-API\n* superset and is free to evolve (e.g., SEP-2106 widening); this file is the\n* 2025 wire-parse contract (Q10-L2 byte-identity) and is BEHAVIOR-FROZEN.\n*\n* This is the era's complete frozen wire-parse contract — both the 2025-only\n* delta (the deprecated task family, the era role unions) AND frozen copies of\n* every era-shared shape (Tool, CallToolResult, Initialize*, ContentBlock,\n* prompts/resources/completion/elicitation, …). The 2026-era codec\n* (`wire/rev2026-07-28/`) is symmetrically self-contained in the same way.\n*\n* The 2025-only delta (the task message surface, restored types-only by #2248\n* for interop with task-capable 2025 peers) is parsed ONLY through this era's\n* registry; the deprecated Task* schemas also live (marked `@deprecated`) in\n* the neutral schema layer so the public types stay nameable without a\n* cross-layer import — nameability is constant, runtime availability is\n* version-keyed — but appear in no API signature. Q1 increment 2 — deletions\n* are physical: the\n* 2026-era REGISTRY has no Task* methods (its frozen building-block copies do\n* carry the deprecated Task* sub-schemas by composition — soft contamination,\n* tracked for anchor-exactness adjudication).\n*\n* The only cross-layer dependency is `import type { JSONObject, JSONValue }`\n* from the neutral types barrel — pure structural type aliases with no parse\n* behavior. No runtime schema is shared with the neutral layer.\n*/\nfunction build$1() {\n\tconst JSONValueSchema$1 = z.lazy(() => z.union([\n\t\tz.string(),\n\t\tz.number(),\n\t\tz.boolean(),\n\t\tz.null(),\n\t\tz.record(z.string(), JSONValueSchema$1),\n\t\tz.array(JSONValueSchema$1)\n\t]));\n\tconst JSONObjectSchema$1 = z.record(z.string(), JSONValueSchema$1);\n\t/**\n\t* A progress token, used to associate progress notifications with the original request.\n\t*/\n\tconst ProgressTokenSchema$1 = z.union([z.string(), z.number().int()]);\n\t/**\n\t* An opaque token used to represent a cursor for pagination.\n\t*/\n\tconst CursorSchema$1 = z.string();\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst TaskMetadataSchema$1 = z.object({ ttl: z.number().optional() });\n\t/**\n\t* Metadata for associating messages with a task.\n\t* Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst RelatedTaskMetadataSchema$1 = z.object({ taskId: z.string() });\n\tconst RequestMetaSchema$1 = z.looseObject({\n\t\tprogressToken: ProgressTokenSchema$1.optional(),\n\t\t\"io.modelcontextprotocol/related-task\": RelatedTaskMetadataSchema$1.optional()\n\t});\n\t/**\n\t* Common params for any request.\n\t*/\n\tconst BaseRequestParamsSchema$1 = z.object({ _meta: RequestMetaSchema$1.optional() });\n\t/**\n\t* Common params for any task-augmented request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskAugmentedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ task: TaskMetadataSchema$1.optional() });\n\tconst RequestSchema$1 = z.object({\n\t\tmethod: z.string(),\n\t\tparams: BaseRequestParamsSchema$1.loose().optional()\n\t});\n\tconst NotificationsParamsSchema$1 = z.object({ _meta: RequestMetaSchema$1.optional() });\n\tconst NotificationSchema$1 = z.object({\n\t\tmethod: z.string(),\n\t\tparams: NotificationsParamsSchema$1.loose().optional()\n\t});\n\tconst ResultSchema$1 = z.looseObject({ _meta: RequestMetaSchema$1.optional() });\n\t/**\n\t* A uniquely identifying ID for a request in JSON-RPC.\n\t*/\n\tconst RequestIdSchema$1 = z.union([z.string(), z.number().int()]);\n\t/**\n\t* A response that indicates success but carries no data.\n\t*/\n\tconst EmptyResultSchema$1 = ResultSchema$1.strict();\n\tconst CancelledNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({\n\t\trequestId: RequestIdSchema$1.optional(),\n\t\treason: z.string().optional()\n\t});\n\t/**\n\t* This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n\t*\n\t* The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n\t*\n\t* This notification indicates that the result will be unused, so any associated processing SHOULD cease.\n\t*\n\t* A client MUST NOT attempt to cancel its {@linkcode InitializeRequest | initialize} request.\n\t*/\n\tconst CancelledNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/cancelled\"),\n\t\tparams: CancelledNotificationParamsSchema$1\n\t});\n\t/**\n\t* Icon schema for use in {@link Tool | tools}, {@link Prompt | prompts}, {@link Resource | resources}, and {@link Implementation | implementations}.\n\t*/\n\tconst IconSchema$1 = z.object({\n\t\tsrc: z.string(),\n\t\tmimeType: z.string().optional(),\n\t\tsizes: z.array(z.string()).optional(),\n\t\ttheme: z.enum([\"light\", \"dark\"]).optional()\n\t});\n\t/**\n\t* Base schema to add `icons` property.\n\t*\n\t*/\n\tconst IconsSchema$1 = z.object({ icons: z.array(IconSchema$1).optional() });\n\t/**\n\t* Base metadata interface for common properties across {@link Resource | resources}, {@link Tool | tools}, {@link Prompt | prompts}, and {@link Implementation | implementations}.\n\t*/\n\tconst BaseMetadataSchema$1 = z.object({\n\t\tname: z.string(),\n\t\ttitle: z.string().optional()\n\t});\n\t/**\n\t* Describes the name and version of an MCP implementation.\n\t*/\n\tconst ImplementationSchema$1 = BaseMetadataSchema$1.extend({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tversion: z.string(),\n\t\twebsiteUrl: z.string().optional(),\n\t\tdescription: z.string().optional()\n\t});\n\tconst FormElicitationCapabilitySchema = z.intersection(z.object({ applyDefaults: z.boolean().optional() }), JSONObjectSchema$1);\n\tconst ElicitationCapabilitySchema = z.preprocess((value) => {\n\t\tif (value && typeof value === \"object\" && !Array.isArray(value) && Object.keys(value).length === 0) return { form: {} };\n\t\treturn value;\n\t}, z.intersection(z.object({\n\t\tform: FormElicitationCapabilitySchema.optional(),\n\t\turl: JSONObjectSchema$1.optional()\n\t}), JSONObjectSchema$1.optional()));\n\t/**\n\t* Task capabilities for clients, indicating which request types support task creation.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst ClientTasksCapabilitySchema$1 = z.looseObject({\n\t\tlist: JSONObjectSchema$1.optional(),\n\t\tcancel: JSONObjectSchema$1.optional(),\n\t\trequests: z.looseObject({\n\t\t\tsampling: z.looseObject({ createMessage: JSONObjectSchema$1.optional() }).optional(),\n\t\t\telicitation: z.looseObject({ create: JSONObjectSchema$1.optional() }).optional()\n\t\t}).optional()\n\t});\n\t/**\n\t* Task capabilities for servers, indicating which request types support task creation.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst ServerTasksCapabilitySchema$1 = z.looseObject({\n\t\tlist: JSONObjectSchema$1.optional(),\n\t\tcancel: JSONObjectSchema$1.optional(),\n\t\trequests: z.looseObject({ tools: z.looseObject({ call: JSONObjectSchema$1.optional() }).optional() }).optional()\n\t});\n\t/**\n\t* Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.\n\t*/\n\tconst ClientCapabilitiesSchema$1 = z.object({\n\t\texperimental: z.record(z.string(), JSONObjectSchema$1).optional(),\n\t\tsampling: z.object({\n\t\t\tcontext: JSONObjectSchema$1.optional(),\n\t\t\ttools: JSONObjectSchema$1.optional()\n\t\t}).optional(),\n\t\telicitation: ElicitationCapabilitySchema.optional(),\n\t\troots: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\ttasks: ClientTasksCapabilitySchema$1.optional(),\n\t\textensions: z.record(z.string(), JSONObjectSchema$1).optional()\n\t});\n\tconst InitializeRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({\n\t\tprotocolVersion: z.string(),\n\t\tcapabilities: ClientCapabilitiesSchema$1,\n\t\tclientInfo: ImplementationSchema$1\n\t});\n\t/**\n\t* This request is sent from the client to the server when it first connects, asking it to begin initialization.\n\t*/\n\tconst InitializeRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"initialize\"),\n\t\tparams: InitializeRequestParamsSchema$1\n\t});\n\t/**\n\t* Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.\n\t*/\n\tconst ServerCapabilitiesSchema$1 = z.object({\n\t\texperimental: z.record(z.string(), JSONObjectSchema$1).optional(),\n\t\tlogging: JSONObjectSchema$1.optional(),\n\t\tcompletions: JSONObjectSchema$1.optional(),\n\t\tprompts: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\tresources: z.object({\n\t\t\tsubscribe: z.boolean().optional(),\n\t\t\tlistChanged: z.boolean().optional()\n\t\t}).optional(),\n\t\ttools: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\ttasks: ServerTasksCapabilitySchema$1.optional(),\n\t\textensions: z.record(z.string(), JSONObjectSchema$1).optional()\n\t});\n\t/**\n\t* After receiving an initialize request from the client, the server sends this response.\n\t*/\n\tconst InitializeResultSchema$1 = ResultSchema$1.extend({\n\t\tprotocolVersion: z.string(),\n\t\tcapabilities: ServerCapabilitiesSchema$1,\n\t\tserverInfo: ImplementationSchema$1,\n\t\tinstructions: z.string().optional()\n\t});\n\t/**\n\t* This notification is sent from the client to the server after initialization has finished.\n\t*/\n\tconst InitializedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/initialized\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\t/**\n\t* A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.\n\t*/\n\tconst PingRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"ping\"),\n\t\tparams: BaseRequestParamsSchema$1.optional()\n\t});\n\tconst ProgressSchema$1 = z.object({\n\t\tprogress: z.number(),\n\t\ttotal: z.optional(z.number()),\n\t\tmessage: z.optional(z.string())\n\t});\n\tconst ProgressNotificationParamsSchema$1 = z.object({\n\t\t...NotificationsParamsSchema$1.shape,\n\t\t...ProgressSchema$1.shape,\n\t\tprogressToken: ProgressTokenSchema$1\n\t});\n\t/**\n\t* An out-of-band notification used to inform the receiver of a progress update for a long-running request.\n\t*\n\t* @category notifications/progress\n\t*/\n\tconst ProgressNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/progress\"),\n\t\tparams: ProgressNotificationParamsSchema$1\n\t});\n\tconst PaginatedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ cursor: CursorSchema$1.optional() });\n\tconst PaginatedRequestSchema$1 = RequestSchema$1.extend({ params: PaginatedRequestParamsSchema$1.optional() });\n\tconst PaginatedResultSchema$1 = ResultSchema$1.extend({ nextCursor: CursorSchema$1.optional() });\n\t/**\n\t* The contents of a specific resource or sub-resource.\n\t*/\n\tconst ResourceContentsSchema$1 = z.object({\n\t\turi: z.string(),\n\t\tmimeType: z.optional(z.string()),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst TextResourceContentsSchema$1 = ResourceContentsSchema$1.extend({ text: z.string() });\n\t/**\n\t* A Zod schema for validating Base64 strings that is more performant and\n\t* robust for very large inputs than the default regex-based check. It avoids\n\t* stack overflows by using the native `atob` function for validation.\n\t*/\n\tconst Base64Schema = z.string().refine((val) => {\n\t\ttry {\n\t\t\tatob(val);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, { message: \"Invalid Base64 string\" });\n\tconst BlobResourceContentsSchema$1 = ResourceContentsSchema$1.extend({ blob: Base64Schema });\n\t/**\n\t* The sender or recipient of messages and data in a conversation.\n\t*/\n\tconst RoleSchema$1 = z.enum([\"user\", \"assistant\"]);\n\t/**\n\t* Optional annotations providing clients additional context about a resource.\n\t*/\n\tconst AnnotationsSchema$1 = z.object({\n\t\taudience: z.array(RoleSchema$1).optional(),\n\t\tpriority: z.number().min(0).max(1).optional(),\n\t\tlastModified: z.iso.datetime({ offset: true }).optional()\n\t});\n\t/**\n\t* A known resource that the server is capable of reading.\n\t*/\n\tconst ResourceSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\turi: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\tmimeType: z.optional(z.string()),\n\t\tsize: z.optional(z.number()),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\t/**\n\t* A template description for resources available on the server.\n\t*/\n\tconst ResourceTemplateSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\turiTemplate: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\tmimeType: z.optional(z.string()),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\t/**\n\t* Sent from the client to request a list of resources the server has.\n\t*/\n\tconst ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"resources/list\") });\n\t/**\n\t* The server's response to a {@linkcode ListResourcesRequest | resources/list} request from the client.\n\t*/\n\tconst ListResourcesResultSchema$1 = PaginatedResultSchema$1.extend({ resources: z.array(ResourceSchema$1) });\n\t/**\n\t* Sent from the client to request a list of resource templates the server has.\n\t*/\n\tconst ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"resources/templates/list\") });\n\t/**\n\t* The server's response to a {@linkcode ListResourceTemplatesRequest | resources/templates/list} request from the client.\n\t*/\n\tconst ListResourceTemplatesResultSchema$1 = PaginatedResultSchema$1.extend({ resourceTemplates: z.array(ResourceTemplateSchema$1) });\n\tconst ResourceRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ uri: z.string() });\n\t/**\n\t* Parameters for a {@linkcode ReadResourceRequest | resources/read} request.\n\t*/\n\tconst ReadResourceRequestParamsSchema$1 = ResourceRequestParamsSchema$1;\n\t/**\n\t* Sent from the client to the server, to read a specific resource URI.\n\t*/\n\tconst ReadResourceRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"resources/read\"),\n\t\tparams: ReadResourceRequestParamsSchema$1\n\t});\n\t/**\n\t* The server's response to a {@linkcode ReadResourceRequest | resources/read} request from the client.\n\t*/\n\tconst ReadResourceResultSchema$1 = ResultSchema$1.extend({ contents: z.array(z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1])) });\n\t/**\n\t* An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.\n\t*/\n\tconst ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/resources/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\tconst SubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;\n\t/**\n\t* Sent from the client to request `resources/updated` notifications from the server whenever a particular resource changes.\n\t*/\n\tconst SubscribeRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"resources/subscribe\"),\n\t\tparams: SubscribeRequestParamsSchema$1\n\t});\n\tconst UnsubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;\n\t/**\n\t* Sent from the client to request cancellation of {@linkcode ResourceUpdatedNotification | resources/updated} notifications from the server. This should follow a previous {@linkcode SubscribeRequest | resources/subscribe} request.\n\t*/\n\tconst UnsubscribeRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"resources/unsubscribe\"),\n\t\tparams: UnsubscribeRequestParamsSchema$1\n\t});\n\t/**\n\t* Parameters for a {@linkcode ResourceUpdatedNotification | notifications/resources/updated} notification.\n\t*/\n\tconst ResourceUpdatedNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ uri: z.string() });\n\t/**\n\t* A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a {@linkcode SubscribeRequest | resources/subscribe} request.\n\t*/\n\tconst ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/resources/updated\"),\n\t\tparams: ResourceUpdatedNotificationParamsSchema$1\n\t});\n\t/**\n\t* Describes an argument that a prompt can accept.\n\t*/\n\tconst PromptArgumentSchema$1 = z.object({\n\t\tname: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\trequired: z.optional(z.boolean())\n\t});\n\t/**\n\t* A prompt or prompt template that the server offers.\n\t*/\n\tconst PromptSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tdescription: z.optional(z.string()),\n\t\targuments: z.optional(z.array(PromptArgumentSchema$1)),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\t/**\n\t* Sent from the client to request a list of prompts and prompt templates the server has.\n\t*/\n\tconst ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"prompts/list\") });\n\t/**\n\t* The server's response to a {@linkcode ListPromptsRequest | prompts/list} request from the client.\n\t*/\n\tconst ListPromptsResultSchema$1 = PaginatedResultSchema$1.extend({ prompts: z.array(PromptSchema$1) });\n\t/**\n\t* Parameters for a {@linkcode GetPromptRequest | prompts/get} request.\n\t*/\n\tconst GetPromptRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({\n\t\tname: z.string(),\n\t\targuments: z.record(z.string(), z.string()).optional()\n\t});\n\t/**\n\t* Used by the client to get a prompt provided by the server.\n\t*/\n\tconst GetPromptRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"prompts/get\"),\n\t\tparams: GetPromptRequestParamsSchema$1\n\t});\n\t/**\n\t* Text provided to or from an LLM.\n\t*/\n\tconst TextContentSchema$1 = z.object({\n\t\ttype: z.literal(\"text\"),\n\t\ttext: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* An image provided to or from an LLM.\n\t*/\n\tconst ImageContentSchema$1 = z.object({\n\t\ttype: z.literal(\"image\"),\n\t\tdata: Base64Schema,\n\t\tmimeType: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Audio content provided to or from an LLM.\n\t*/\n\tconst AudioContentSchema$1 = z.object({\n\t\ttype: z.literal(\"audio\"),\n\t\tdata: Base64Schema,\n\t\tmimeType: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* A tool call request from an assistant (LLM).\n\t* Represents the assistant's request to use a tool.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ToolUseContentSchema$1 = z.object({\n\t\ttype: z.literal(\"tool_use\"),\n\t\tname: z.string(),\n\t\tid: z.string(),\n\t\tinput: z.record(z.string(), z.unknown()),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* The contents of a resource, embedded into a prompt or tool call result.\n\t*/\n\tconst EmbeddedResourceSchema$1 = z.object({\n\t\ttype: z.literal(\"resource\"),\n\t\tresource: z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* A resource that the server is capable of reading, included in a prompt or tool call result.\n\t*\n\t* Note: resource links returned by tools are not guaranteed to appear in the results of {@linkcode ListResourcesRequest | resources/list} requests.\n\t*/\n\tconst ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: z.literal(\"resource_link\") });\n\t/**\n\t* A content block that can be used in prompts and tool results.\n\t*/\n\tconst ContentBlockSchema$1 = z.union([\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1,\n\t\tResourceLinkSchema$1,\n\t\tEmbeddedResourceSchema$1\n\t]);\n\t/**\n\t* Describes a message returned as part of a prompt.\n\t*/\n\tconst PromptMessageSchema$1 = z.object({\n\t\trole: RoleSchema$1,\n\t\tcontent: ContentBlockSchema$1\n\t});\n\t/**\n\t* The server's response to a {@linkcode GetPromptRequest | prompts/get} request from the client.\n\t*/\n\tconst GetPromptResultSchema$1 = ResultSchema$1.extend({\n\t\tdescription: z.string().optional(),\n\t\tmessages: z.array(PromptMessageSchema$1)\n\t});\n\t/**\n\t* An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.\n\t*/\n\tconst PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/prompts/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\t/**\n\t* Additional properties describing a `Tool` to clients.\n\t*\n\t* NOTE: all properties in {@linkcode ToolAnnotations} are **hints**.\n\t* They are not guaranteed to provide a faithful description of\n\t* tool behavior (including descriptive properties like `title`).\n\t*\n\t* Clients should never make tool use decisions based on `ToolAnnotations`\n\t* received from untrusted servers.\n\t*/\n\tconst ToolAnnotationsSchema$1 = z.object({\n\t\ttitle: z.string().optional(),\n\t\treadOnlyHint: z.boolean().optional(),\n\t\tdestructiveHint: z.boolean().optional(),\n\t\tidempotentHint: z.boolean().optional(),\n\t\topenWorldHint: z.boolean().optional()\n\t});\n\t/**\n\t* Execution-related properties for a tool.\n\t*/\n\tconst ToolExecutionSchema$1 = z.object({ taskSupport: z.enum([\n\t\t\"required\",\n\t\t\"optional\",\n\t\t\"forbidden\"\n\t]).optional() });\n\t/**\n\t* Definition for a tool the client can call.\n\t*/\n\tconst ToolSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tdescription: z.string().optional(),\n\t\tinputSchema: z.object({\n\t\t\ttype: z.literal(\"object\"),\n\t\t\tproperties: z.record(z.string(), JSONValueSchema$1).optional(),\n\t\t\trequired: z.array(z.string()).optional()\n\t\t}).catchall(z.unknown()),\n\t\toutputSchema: z.object({\n\t\t\ttype: z.literal(\"object\"),\n\t\t\tproperties: z.record(z.string(), JSONValueSchema$1).optional(),\n\t\t\trequired: z.array(z.string()).optional()\n\t\t}).catchall(z.unknown()).optional(),\n\t\tannotations: ToolAnnotationsSchema$1.optional(),\n\t\texecution: ToolExecutionSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Sent from the client to request a list of tools the server has.\n\t*/\n\tconst ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"tools/list\") });\n\t/**\n\t* The server's response to a {@linkcode ListToolsRequest | tools/list} request from the client.\n\t*/\n\tconst ListToolsResultSchema$1 = PaginatedResultSchema$1.extend({ tools: z.array(ToolSchema$1) });\n\t/**\n\t* The server's response to a tool call.\n\t*/\n\tconst CallToolResultSchema$1 = ResultSchema$1.extend({\n\t\tcontent: z.array(ContentBlockSchema$1),\n\t\tstructuredContent: z.record(z.string(), z.unknown()).optional(),\n\t\tisError: z.boolean().optional()\n\t});\n\t/**\n\t* Parameters for a `tools/call` request.\n\t*/\n\tconst CallToolRequestParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tname: z.string(),\n\t\targuments: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Used by the client to invoke a tool provided by the server.\n\t*/\n\tconst CallToolRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"tools/call\"),\n\t\tparams: CallToolRequestParamsSchema$1\n\t});\n\t/**\n\t* An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.\n\t*/\n\tconst ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/tools/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\t/**\n\t* The severity of a log message.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst LoggingLevelSchema$1 = z.enum([\n\t\t\"debug\",\n\t\t\"info\",\n\t\t\"notice\",\n\t\t\"warning\",\n\t\t\"error\",\n\t\t\"critical\",\n\t\t\"alert\",\n\t\t\"emergency\"\n\t]);\n\t/**\n\t* Parameters for a `logging/setLevel` request.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst SetLevelRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ level: LoggingLevelSchema$1 });\n\t/**\n\t* A request from the client to the server, to enable or adjust logging.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst SetLevelRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"logging/setLevel\"),\n\t\tparams: SetLevelRequestParamsSchema$1\n\t});\n\t/**\n\t* Parameters for a `notifications/message` notification.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst LoggingMessageNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({\n\t\tlevel: LoggingLevelSchema$1,\n\t\tlogger: z.string().optional(),\n\t\tdata: z.unknown()\n\t});\n\t/**\n\t* Notification of a log message passed from server to client. If no `logging/setLevel` request has been sent from the client, the server MAY decide which messages to send automatically.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/message\"),\n\t\tparams: LoggingMessageNotificationParamsSchema$1\n\t});\n\t/**\n\t* Hints to use for model selection.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ModelHintSchema$1 = z.object({ name: z.string().optional() });\n\t/**\n\t* The server's preferences for model selection, requested of the client during sampling.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ModelPreferencesSchema$1 = z.object({\n\t\thints: z.array(ModelHintSchema$1).optional(),\n\t\tcostPriority: z.number().min(0).max(1).optional(),\n\t\tspeedPriority: z.number().min(0).max(1).optional(),\n\t\tintelligencePriority: z.number().min(0).max(1).optional()\n\t});\n\t/**\n\t* Controls tool usage behavior in sampling requests.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ToolChoiceSchema$1 = z.object({ mode: z.enum([\n\t\t\"auto\",\n\t\t\"required\",\n\t\t\"none\"\n\t]).optional() });\n\t/**\n\t* The result of a tool execution, provided by the user (server).\n\t* Represents the outcome of invoking a tool requested via `ToolUseContent`.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ToolResultContentSchema$1 = z.object({\n\t\ttype: z.literal(\"tool_result\"),\n\t\ttoolUseId: z.string().describe(\"The unique identifier for the corresponding tool call.\"),\n\t\tcontent: z.array(ContentBlockSchema$1),\n\t\tstructuredContent: z.object({}).loose().optional(),\n\t\tisError: z.boolean().optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Basic content types for sampling responses (without tool use).\n\t* Used for backwards-compatible {@linkcode CreateMessageResult} when tools are not used.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst SamplingContentSchema$1 = z.discriminatedUnion(\"type\", [\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1\n\t]);\n\t/**\n\t* Content block types allowed in sampling messages.\n\t* This includes text, image, audio, tool use requests, and tool results.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst SamplingMessageContentBlockSchema$1 = z.discriminatedUnion(\"type\", [\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1,\n\t\tToolUseContentSchema$1,\n\t\tToolResultContentSchema$1\n\t]);\n\t/**\n\t* Describes a message issued to or received from an LLM API.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst SamplingMessageSchema$1 = z.object({\n\t\trole: RoleSchema$1,\n\t\tcontent: z.union([SamplingMessageContentBlockSchema$1, z.array(SamplingMessageContentBlockSchema$1)]),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Parameters for a `sampling/createMessage` request.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst CreateMessageRequestParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tmessages: z.array(SamplingMessageSchema$1),\n\t\tmodelPreferences: ModelPreferencesSchema$1.optional(),\n\t\tsystemPrompt: z.string().optional(),\n\t\tincludeContext: z.enum([\n\t\t\t\"none\",\n\t\t\t\"thisServer\",\n\t\t\t\"allServers\"\n\t\t]).optional(),\n\t\ttemperature: z.number().optional(),\n\t\tmaxTokens: z.number().int(),\n\t\tstopSequences: z.array(z.string()).optional(),\n\t\tmetadata: JSONObjectSchema$1.optional(),\n\t\ttools: z.array(ToolSchema$1).optional(),\n\t\ttoolChoice: ToolChoiceSchema$1.optional()\n\t});\n\t/**\n\t* A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst CreateMessageRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"sampling/createMessage\"),\n\t\tparams: CreateMessageRequestParamsSchema$1\n\t});\n\t/**\n\t* The client's response to a `sampling/create_message` request from the server.\n\t* This is the backwards-compatible version that returns single content (no arrays).\n\t* Used when the request does not include tools.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst CreateMessageResultSchema$1 = ResultSchema$1.extend({\n\t\tmodel: z.string(),\n\t\tstopReason: z.optional(z.enum([\n\t\t\t\"endTurn\",\n\t\t\t\"stopSequence\",\n\t\t\t\"maxTokens\"\n\t\t]).or(z.string())),\n\t\trole: RoleSchema$1,\n\t\tcontent: SamplingContentSchema$1\n\t});\n\t/**\n\t* The client's response to a `sampling/create_message` request when tools were provided.\n\t* This version supports array content for tool use flows.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst CreateMessageResultWithToolsSchema$1 = ResultSchema$1.extend({\n\t\tmodel: z.string(),\n\t\tstopReason: z.optional(z.enum([\n\t\t\t\"endTurn\",\n\t\t\t\"stopSequence\",\n\t\t\t\"maxTokens\",\n\t\t\t\"toolUse\"\n\t\t]).or(z.string())),\n\t\trole: RoleSchema$1,\n\t\tcontent: z.union([SamplingMessageContentBlockSchema$1, z.array(SamplingMessageContentBlockSchema$1)])\n\t});\n\t/**\n\t* Primitive schema definition for boolean fields.\n\t*/\n\tconst BooleanSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"boolean\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tdefault: z.boolean().optional()\n\t});\n\t/**\n\t* Primitive schema definition for string fields.\n\t*/\n\tconst StringSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminLength: z.number().optional(),\n\t\tmaxLength: z.number().optional(),\n\t\tformat: z.enum([\n\t\t\t\"email\",\n\t\t\t\"uri\",\n\t\t\t\"date\",\n\t\t\t\"date-time\"\n\t\t]).optional(),\n\t\tdefault: z.string().optional()\n\t});\n\t/**\n\t* Primitive schema definition for number fields.\n\t*/\n\tconst NumberSchemaSchema$1 = z.object({\n\t\ttype: z.enum([\"number\", \"integer\"]),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminimum: z.number().optional(),\n\t\tmaximum: z.number().optional(),\n\t\tdefault: z.number().optional()\n\t});\n\t/**\n\t* Schema for single-selection enumeration without display titles for options.\n\t*/\n\tconst UntitledSingleSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tenum: z.array(z.string()),\n\t\tdefault: z.string().optional()\n\t});\n\t/**\n\t* Schema for single-selection enumeration with display titles for each option.\n\t*/\n\tconst TitledSingleSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\toneOf: z.array(z.object({\n\t\t\tconst: z.string(),\n\t\t\ttitle: z.string()\n\t\t})),\n\t\tdefault: z.string().optional()\n\t});\n\t/**\n\t* Use {@linkcode TitledSingleSelectEnumSchema} instead.\n\t* This interface will be removed in a future version.\n\t*/\n\tconst LegacyTitledEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tenum: z.array(z.string()),\n\t\tenumNames: z.array(z.string()).optional(),\n\t\tdefault: z.string().optional()\n\t});\n\tconst SingleSelectEnumSchemaSchema$1 = z.union([UntitledSingleSelectEnumSchemaSchema$1, TitledSingleSelectEnumSchemaSchema$1]);\n\t/**\n\t* Schema for multiple-selection enumeration without display titles for options.\n\t*/\n\tconst UntitledMultiSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"array\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminItems: z.number().optional(),\n\t\tmaxItems: z.number().optional(),\n\t\titems: z.object({\n\t\t\ttype: z.literal(\"string\"),\n\t\t\tenum: z.array(z.string())\n\t\t}),\n\t\tdefault: z.array(z.string()).optional()\n\t});\n\t/**\n\t* Schema for multiple-selection enumeration with display titles for each option.\n\t*/\n\tconst TitledMultiSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"array\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminItems: z.number().optional(),\n\t\tmaxItems: z.number().optional(),\n\t\titems: z.object({ anyOf: z.array(z.object({\n\t\t\tconst: z.string(),\n\t\t\ttitle: z.string()\n\t\t})) }),\n\t\tdefault: z.array(z.string()).optional()\n\t});\n\t/**\n\t* Combined schema for multiple-selection enumeration\n\t*/\n\tconst MultiSelectEnumSchemaSchema$1 = z.union([UntitledMultiSelectEnumSchemaSchema$1, TitledMultiSelectEnumSchemaSchema$1]);\n\t/**\n\t* Primitive schema definition for enum fields.\n\t*/\n\tconst EnumSchemaSchema$1 = z.union([\n\t\tLegacyTitledEnumSchemaSchema$1,\n\t\tSingleSelectEnumSchemaSchema$1,\n\t\tMultiSelectEnumSchemaSchema$1\n\t]);\n\t/**\n\t* Union of all primitive schema definitions.\n\t*/\n\tconst PrimitiveSchemaDefinitionSchema$1 = z.union([\n\t\tEnumSchemaSchema$1,\n\t\tBooleanSchemaSchema$1,\n\t\tStringSchemaSchema$1,\n\t\tNumberSchemaSchema$1\n\t]);\n\t/**\n\t* Parameters for an `elicitation/create` request for form-based elicitation.\n\t*/\n\tconst ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tmode: z.literal(\"form\").optional(),\n\t\tmessage: z.string(),\n\t\trequestedSchema: z.object({\n\t\t\ttype: z.literal(\"object\"),\n\t\t\tproperties: z.record(z.string(), PrimitiveSchemaDefinitionSchema$1),\n\t\t\trequired: z.array(z.string()).optional()\n\t\t}).catchall(z.unknown())\n\t});\n\t/**\n\t* Parameters for an {@linkcode ElicitRequest | elicitation/create} request for URL-based elicitation.\n\t*/\n\tconst ElicitRequestURLParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tmode: z.literal(\"url\"),\n\t\tmessage: z.string(),\n\t\telicitationId: z.string(),\n\t\turl: z.string().url()\n\t});\n\t/**\n\t* The parameters for a request to elicit additional information from the user via the client.\n\t*/\n\tconst ElicitRequestParamsSchema$1 = z.union([ElicitRequestFormParamsSchema$1, ElicitRequestURLParamsSchema$1]);\n\t/**\n\t* A request from the server to elicit user input via the client.\n\t* The client should present the message and form fields to the user (form mode)\n\t* or navigate to a URL (URL mode).\n\t*/\n\tconst ElicitRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"elicitation/create\"),\n\t\tparams: ElicitRequestParamsSchema$1\n\t});\n\t/**\n\t* Parameters for a {@linkcode ElicitationCompleteNotification | notifications/elicitation/complete} notification.\n\t*\n\t* @category notifications/elicitation/complete\n\t*/\n\tconst ElicitationCompleteNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ elicitationId: z.string() });\n\t/**\n\t* A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.\n\t*\n\t* @category notifications/elicitation/complete\n\t*/\n\tconst ElicitationCompleteNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/elicitation/complete\"),\n\t\tparams: ElicitationCompleteNotificationParamsSchema$1\n\t});\n\t/**\n\t* The client's response to an {@linkcode ElicitRequest | elicitation/create} request from the server.\n\t*/\n\tconst ElicitResultSchema$1 = ResultSchema$1.extend({\n\t\taction: z.enum([\n\t\t\t\"accept\",\n\t\t\t\"decline\",\n\t\t\t\"cancel\"\n\t\t]),\n\t\tcontent: z.preprocess((val) => val === null ? void 0 : val, z.record(z.string(), z.union([\n\t\t\tz.string(),\n\t\t\tz.number(),\n\t\t\tz.boolean(),\n\t\t\tz.array(z.string())\n\t\t])).optional())\n\t});\n\t/**\n\t* A reference to a resource or resource template definition.\n\t*/\n\tconst ResourceTemplateReferenceSchema$1 = z.object({\n\t\ttype: z.literal(\"ref/resource\"),\n\t\turi: z.string()\n\t});\n\t/**\n\t* Identifies a prompt.\n\t*/\n\tconst PromptReferenceSchema$1 = z.object({\n\t\ttype: z.literal(\"ref/prompt\"),\n\t\tname: z.string()\n\t});\n\t/**\n\t* Parameters for a {@linkcode CompleteRequest | completion/complete} request.\n\t*/\n\tconst CompleteRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({\n\t\tref: z.union([PromptReferenceSchema$1, ResourceTemplateReferenceSchema$1]),\n\t\targument: z.object({\n\t\t\tname: z.string(),\n\t\t\tvalue: z.string()\n\t\t}),\n\t\tcontext: z.object({ arguments: z.record(z.string(), z.string()).optional() }).optional()\n\t});\n\t/**\n\t* A request from the client to the server, to ask for completion options.\n\t*/\n\tconst CompleteRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"completion/complete\"),\n\t\tparams: CompleteRequestParamsSchema$1\n\t});\n\t/**\n\t* The server's response to a {@linkcode CompleteRequest | completion/complete} request\n\t*/\n\tconst CompleteResultSchema$1 = ResultSchema$1.extend({ completion: z.looseObject({\n\t\tvalues: z.array(z.string()).max(100),\n\t\ttotal: z.optional(z.number().int()),\n\t\thasMore: z.optional(z.boolean())\n\t}) });\n\t/**\n\t* Represents a root directory or file that the server can operate on.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to passing paths via\n\t* tool parameters, resource URIs, or configuration.\n\t*/\n\tconst RootSchema$1 = z.object({\n\t\turi: z.string().startsWith(\"file://\"),\n\t\tname: z.string().optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Sent from the server to request a list of root URIs from the client.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to passing paths via\n\t* tool parameters, resource URIs, or configuration.\n\t*/\n\tconst ListRootsRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"roots/list\"),\n\t\tparams: BaseRequestParamsSchema$1.optional()\n\t});\n\t/**\n\t* The client's response to a `roots/list` request from the server.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to passing paths via\n\t* tool parameters, resource URIs, or configuration.\n\t*/\n\tconst ListRootsResultSchema$1 = ResultSchema$1.extend({ roots: z.array(RootSchema$1) });\n\t/**\n\t* A notification from the client to the server, informing it that the list of roots has changed.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to passing paths via\n\t* tool parameters, resource URIs, or configuration.\n\t*/\n\tconst RootsListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/roots/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\t/**\n\t* Task creation parameters, used to ask that the server create a task to represent a request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskCreationParamsSchema$1 = z.looseObject({\n\t\tttl: z.number().optional(),\n\t\tpollInterval: z.number().optional()\n\t});\n\t/**\n\t* The status of a task.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskStatusSchema$1 = z.enum([\n\t\t\"working\",\n\t\t\"input_required\",\n\t\t\"completed\",\n\t\t\"failed\",\n\t\t\"cancelled\"\n\t]);\n\t/**\n\t* A pollable state object associated with a request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskSchema$1 = z.object({\n\t\ttaskId: z.string(),\n\t\tstatus: TaskStatusSchema$1,\n\t\tttl: z.union([z.number(), z.null()]),\n\t\tcreatedAt: z.string(),\n\t\tlastUpdatedAt: z.string(),\n\t\tpollInterval: z.optional(z.number()),\n\t\tstatusMessage: z.optional(z.string())\n\t});\n\t/**\n\t* Result returned when a task is created, containing the task data wrapped in a `task` field.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst CreateTaskResultSchema$1 = ResultSchema$1.extend({ task: TaskSchema$1 });\n\t/**\n\t* Parameters for task status notification.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskStatusNotificationParamsSchema$1 = NotificationsParamsSchema$1.merge(TaskSchema$1);\n\t/**\n\t* A notification sent when a task's status changes.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskStatusNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/tasks/status\"),\n\t\tparams: TaskStatusNotificationParamsSchema$1\n\t});\n\t/**\n\t* A request to get the state of a specific task.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst GetTaskRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"tasks/get\"),\n\t\tparams: BaseRequestParamsSchema$1.extend({ taskId: z.string() })\n\t});\n\t/**\n\t* The response to a {@linkcode GetTaskRequest | tasks/get} request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst GetTaskResultSchema$1 = ResultSchema$1.merge(TaskSchema$1);\n\t/**\n\t* A request to get the result of a specific task.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst GetTaskPayloadRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"tasks/result\"),\n\t\tparams: BaseRequestParamsSchema$1.extend({ taskId: z.string() })\n\t});\n\t/**\n\t* The response to a `tasks/result` request.\n\t* The structure matches the result type of the original request.\n\t* For example, a {@linkcode CallToolRequest | tools/call} task would return the `CallToolResult` structure.\n\t*\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst GetTaskPayloadResultSchema$1 = ResultSchema$1.loose();\n\t/**\n\t* A request to list tasks.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"tasks/list\") });\n\t/**\n\t* The response to a {@linkcode ListTasksRequest | tasks/list} request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst ListTasksResultSchema$1 = PaginatedResultSchema$1.extend({ tasks: z.array(TaskSchema$1) });\n\t/**\n\t* A request to cancel a specific task.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst CancelTaskRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"tasks/cancel\"),\n\t\tparams: BaseRequestParamsSchema$1.extend({ taskId: z.string() })\n\t});\n\treturn {\n\t\tJSONValueSchema: JSONValueSchema$1,\n\t\tJSONObjectSchema: JSONObjectSchema$1,\n\t\tProgressTokenSchema: ProgressTokenSchema$1,\n\t\tCursorSchema: CursorSchema$1,\n\t\tTaskMetadataSchema: TaskMetadataSchema$1,\n\t\tRelatedTaskMetadataSchema: RelatedTaskMetadataSchema$1,\n\t\tRequestMetaSchema: RequestMetaSchema$1,\n\t\tBaseRequestParamsSchema: BaseRequestParamsSchema$1,\n\t\tTaskAugmentedRequestParamsSchema: TaskAugmentedRequestParamsSchema$1,\n\t\tRequestSchema: RequestSchema$1,\n\t\tNotificationsParamsSchema: NotificationsParamsSchema$1,\n\t\tNotificationSchema: NotificationSchema$1,\n\t\tResultSchema: ResultSchema$1,\n\t\tRequestIdSchema: RequestIdSchema$1,\n\t\tEmptyResultSchema: EmptyResultSchema$1,\n\t\tCancelledNotificationParamsSchema: CancelledNotificationParamsSchema$1,\n\t\tCancelledNotificationSchema: CancelledNotificationSchema$1,\n\t\tIconSchema: IconSchema$1,\n\t\tIconsSchema: IconsSchema$1,\n\t\tBaseMetadataSchema: BaseMetadataSchema$1,\n\t\tImplementationSchema: ImplementationSchema$1,\n\t\tClientTasksCapabilitySchema: ClientTasksCapabilitySchema$1,\n\t\tServerTasksCapabilitySchema: ServerTasksCapabilitySchema$1,\n\t\tClientCapabilitiesSchema: ClientCapabilitiesSchema$1,\n\t\tInitializeRequestParamsSchema: InitializeRequestParamsSchema$1,\n\t\tInitializeRequestSchema: InitializeRequestSchema$1,\n\t\tServerCapabilitiesSchema: ServerCapabilitiesSchema$1,\n\t\tInitializeResultSchema: InitializeResultSchema$1,\n\t\tInitializedNotificationSchema: InitializedNotificationSchema$1,\n\t\tPingRequestSchema: PingRequestSchema$1,\n\t\tProgressSchema: ProgressSchema$1,\n\t\tProgressNotificationParamsSchema: ProgressNotificationParamsSchema$1,\n\t\tProgressNotificationSchema: ProgressNotificationSchema$1,\n\t\tPaginatedRequestParamsSchema: PaginatedRequestParamsSchema$1,\n\t\tPaginatedRequestSchema: PaginatedRequestSchema$1,\n\t\tPaginatedResultSchema: PaginatedResultSchema$1,\n\t\tResourceContentsSchema: ResourceContentsSchema$1,\n\t\tTextResourceContentsSchema: TextResourceContentsSchema$1,\n\t\tBlobResourceContentsSchema: BlobResourceContentsSchema$1,\n\t\tRoleSchema: RoleSchema$1,\n\t\tAnnotationsSchema: AnnotationsSchema$1,\n\t\tResourceSchema: ResourceSchema$1,\n\t\tResourceTemplateSchema: ResourceTemplateSchema$1,\n\t\tListResourcesRequestSchema: ListResourcesRequestSchema$1,\n\t\tListResourcesResultSchema: ListResourcesResultSchema$1,\n\t\tListResourceTemplatesRequestSchema: ListResourceTemplatesRequestSchema$1,\n\t\tListResourceTemplatesResultSchema: ListResourceTemplatesResultSchema$1,\n\t\tResourceRequestParamsSchema: ResourceRequestParamsSchema$1,\n\t\tReadResourceRequestParamsSchema: ReadResourceRequestParamsSchema$1,\n\t\tReadResourceRequestSchema: ReadResourceRequestSchema$1,\n\t\tReadResourceResultSchema: ReadResourceResultSchema$1,\n\t\tResourceListChangedNotificationSchema: ResourceListChangedNotificationSchema$1,\n\t\tSubscribeRequestParamsSchema: SubscribeRequestParamsSchema$1,\n\t\tSubscribeRequestSchema: SubscribeRequestSchema$1,\n\t\tUnsubscribeRequestParamsSchema: UnsubscribeRequestParamsSchema$1,\n\t\tUnsubscribeRequestSchema: UnsubscribeRequestSchema$1,\n\t\tResourceUpdatedNotificationParamsSchema: ResourceUpdatedNotificationParamsSchema$1,\n\t\tResourceUpdatedNotificationSchema: ResourceUpdatedNotificationSchema$1,\n\t\tPromptArgumentSchema: PromptArgumentSchema$1,\n\t\tPromptSchema: PromptSchema$1,\n\t\tListPromptsRequestSchema: ListPromptsRequestSchema$1,\n\t\tListPromptsResultSchema: ListPromptsResultSchema$1,\n\t\tGetPromptRequestParamsSchema: GetPromptRequestParamsSchema$1,\n\t\tGetPromptRequestSchema: GetPromptRequestSchema$1,\n\t\tTextContentSchema: TextContentSchema$1,\n\t\tImageContentSchema: ImageContentSchema$1,\n\t\tAudioContentSchema: AudioContentSchema$1,\n\t\tToolUseContentSchema: ToolUseContentSchema$1,\n\t\tEmbeddedResourceSchema: EmbeddedResourceSchema$1,\n\t\tResourceLinkSchema: ResourceLinkSchema$1,\n\t\tContentBlockSchema: ContentBlockSchema$1,\n\t\tPromptMessageSchema: PromptMessageSchema$1,\n\t\tGetPromptResultSchema: GetPromptResultSchema$1,\n\t\tPromptListChangedNotificationSchema: PromptListChangedNotificationSchema$1,\n\t\tToolAnnotationsSchema: ToolAnnotationsSchema$1,\n\t\tToolExecutionSchema: ToolExecutionSchema$1,\n\t\tToolSchema: ToolSchema$1,\n\t\tListToolsRequestSchema: ListToolsRequestSchema$1,\n\t\tListToolsResultSchema: ListToolsResultSchema$1,\n\t\tCallToolResultSchema: CallToolResultSchema$1,\n\t\tCallToolRequestParamsSchema: CallToolRequestParamsSchema$1,\n\t\tCallToolRequestSchema: CallToolRequestSchema$1,\n\t\tToolListChangedNotificationSchema: ToolListChangedNotificationSchema$1,\n\t\tLoggingLevelSchema: LoggingLevelSchema$1,\n\t\tSetLevelRequestParamsSchema: SetLevelRequestParamsSchema$1,\n\t\tSetLevelRequestSchema: SetLevelRequestSchema$1,\n\t\tLoggingMessageNotificationParamsSchema: LoggingMessageNotificationParamsSchema$1,\n\t\tLoggingMessageNotificationSchema: LoggingMessageNotificationSchema$1,\n\t\tModelHintSchema: ModelHintSchema$1,\n\t\tModelPreferencesSchema: ModelPreferencesSchema$1,\n\t\tToolChoiceSchema: ToolChoiceSchema$1,\n\t\tToolResultContentSchema: ToolResultContentSchema$1,\n\t\tSamplingContentSchema: SamplingContentSchema$1,\n\t\tSamplingMessageContentBlockSchema: SamplingMessageContentBlockSchema$1,\n\t\tSamplingMessageSchema: SamplingMessageSchema$1,\n\t\tCreateMessageRequestParamsSchema: CreateMessageRequestParamsSchema$1,\n\t\tCreateMessageRequestSchema: CreateMessageRequestSchema$1,\n\t\tCreateMessageResultSchema: CreateMessageResultSchema$1,\n\t\tCreateMessageResultWithToolsSchema: CreateMessageResultWithToolsSchema$1,\n\t\tBooleanSchemaSchema: BooleanSchemaSchema$1,\n\t\tStringSchemaSchema: StringSchemaSchema$1,\n\t\tNumberSchemaSchema: NumberSchemaSchema$1,\n\t\tUntitledSingleSelectEnumSchemaSchema: UntitledSingleSelectEnumSchemaSchema$1,\n\t\tTitledSingleSelectEnumSchemaSchema: TitledSingleSelectEnumSchemaSchema$1,\n\t\tLegacyTitledEnumSchemaSchema: LegacyTitledEnumSchemaSchema$1,\n\t\tSingleSelectEnumSchemaSchema: SingleSelectEnumSchemaSchema$1,\n\t\tUntitledMultiSelectEnumSchemaSchema: UntitledMultiSelectEnumSchemaSchema$1,\n\t\tTitledMultiSelectEnumSchemaSchema: TitledMultiSelectEnumSchemaSchema$1,\n\t\tMultiSelectEnumSchemaSchema: MultiSelectEnumSchemaSchema$1,\n\t\tEnumSchemaSchema: EnumSchemaSchema$1,\n\t\tPrimitiveSchemaDefinitionSchema: PrimitiveSchemaDefinitionSchema$1,\n\t\tElicitRequestFormParamsSchema: ElicitRequestFormParamsSchema$1,\n\t\tElicitRequestURLParamsSchema: ElicitRequestURLParamsSchema$1,\n\t\tElicitRequestParamsSchema: ElicitRequestParamsSchema$1,\n\t\tElicitRequestSchema: ElicitRequestSchema$1,\n\t\tElicitationCompleteNotificationParamsSchema: ElicitationCompleteNotificationParamsSchema$1,\n\t\tElicitationCompleteNotificationSchema: ElicitationCompleteNotificationSchema$1,\n\t\tElicitResultSchema: ElicitResultSchema$1,\n\t\tResourceTemplateReferenceSchema: ResourceTemplateReferenceSchema$1,\n\t\tPromptReferenceSchema: PromptReferenceSchema$1,\n\t\tCompleteRequestParamsSchema: CompleteRequestParamsSchema$1,\n\t\tCompleteRequestSchema: CompleteRequestSchema$1,\n\t\tCompleteResultSchema: CompleteResultSchema$1,\n\t\tRootSchema: RootSchema$1,\n\t\tListRootsRequestSchema: ListRootsRequestSchema$1,\n\t\tListRootsResultSchema: ListRootsResultSchema$1,\n\t\tRootsListChangedNotificationSchema: RootsListChangedNotificationSchema$1,\n\t\tTaskCreationParamsSchema: TaskCreationParamsSchema$1,\n\t\tTaskStatusSchema: TaskStatusSchema$1,\n\t\tTaskSchema: TaskSchema$1,\n\t\tCreateTaskResultSchema: CreateTaskResultSchema$1,\n\t\tTaskStatusNotificationParamsSchema: TaskStatusNotificationParamsSchema$1,\n\t\tTaskStatusNotificationSchema: TaskStatusNotificationSchema$1,\n\t\tGetTaskRequestSchema: GetTaskRequestSchema$1,\n\t\tGetTaskResultSchema: GetTaskResultSchema$1,\n\t\tGetTaskPayloadRequestSchema: GetTaskPayloadRequestSchema$1,\n\t\tGetTaskPayloadResultSchema: GetTaskPayloadResultSchema$1,\n\t\tListTasksRequestSchema: ListTasksRequestSchema$1,\n\t\tListTasksResultSchema: ListTasksResultSchema$1,\n\t\tCancelTaskRequestSchema: CancelTaskRequestSchema$1,\n\t\tCancelTaskResultSchema: ResultSchema$1.merge(TaskSchema$1),\n\t\tClientRequestSchema: z.union([\n\t\t\tPingRequestSchema$1,\n\t\t\tInitializeRequestSchema$1,\n\t\t\tCompleteRequestSchema$1,\n\t\t\tSetLevelRequestSchema$1,\n\t\t\tGetPromptRequestSchema$1,\n\t\t\tListPromptsRequestSchema$1,\n\t\t\tListResourcesRequestSchema$1,\n\t\t\tListResourceTemplatesRequestSchema$1,\n\t\t\tReadResourceRequestSchema$1,\n\t\t\tSubscribeRequestSchema$1,\n\t\t\tUnsubscribeRequestSchema$1,\n\t\t\tCallToolRequestSchema$1,\n\t\t\tListToolsRequestSchema$1,\n\t\t\tGetTaskRequestSchema$1,\n\t\t\tGetTaskPayloadRequestSchema$1,\n\t\t\tListTasksRequestSchema$1,\n\t\t\tCancelTaskRequestSchema$1\n\t\t]),\n\t\tClientNotificationSchema: z.union([\n\t\t\tCancelledNotificationSchema$1,\n\t\t\tProgressNotificationSchema$1,\n\t\t\tInitializedNotificationSchema$1,\n\t\t\tRootsListChangedNotificationSchema$1,\n\t\t\tTaskStatusNotificationSchema$1\n\t\t]),\n\t\tClientResultSchema: z.union([\n\t\t\tEmptyResultSchema$1,\n\t\t\tCreateMessageResultSchema$1,\n\t\t\tCreateMessageResultWithToolsSchema$1,\n\t\t\tElicitResultSchema$1,\n\t\t\tListRootsResultSchema$1,\n\t\t\tGetTaskResultSchema$1,\n\t\t\tListTasksResultSchema$1,\n\t\t\tCreateTaskResultSchema$1\n\t\t]),\n\t\tServerRequestSchema: z.union([\n\t\t\tPingRequestSchema$1,\n\t\t\tCreateMessageRequestSchema$1,\n\t\t\tElicitRequestSchema$1,\n\t\t\tListRootsRequestSchema$1,\n\t\t\tGetTaskRequestSchema$1,\n\t\t\tGetTaskPayloadRequestSchema$1,\n\t\t\tListTasksRequestSchema$1,\n\t\t\tCancelTaskRequestSchema$1\n\t\t]),\n\t\tServerNotificationSchema: z.union([\n\t\t\tCancelledNotificationSchema$1,\n\t\t\tProgressNotificationSchema$1,\n\t\t\tLoggingMessageNotificationSchema$1,\n\t\t\tResourceUpdatedNotificationSchema$1,\n\t\t\tResourceListChangedNotificationSchema$1,\n\t\t\tToolListChangedNotificationSchema$1,\n\t\t\tPromptListChangedNotificationSchema$1,\n\t\t\tTaskStatusNotificationSchema$1,\n\t\t\tElicitationCompleteNotificationSchema$1\n\t\t]),\n\t\tServerResultSchema: z.union([\n\t\t\tEmptyResultSchema$1,\n\t\t\tInitializeResultSchema$1,\n\t\t\tCompleteResultSchema$1,\n\t\t\tGetPromptResultSchema$1,\n\t\t\tListPromptsResultSchema$1,\n\t\t\tListResourcesResultSchema$1,\n\t\t\tListResourceTemplatesResultSchema$1,\n\t\t\tReadResourceResultSchema$1,\n\t\t\tCallToolResultSchema$1,\n\t\t\tListToolsResultSchema$1,\n\t\t\tGetTaskResultSchema$1,\n\t\t\tListTasksResultSchema$1,\n\t\t\tCreateTaskResultSchema$1\n\t\t]),\n\t\tCallToolResultWireSchema: z.unknown().superRefine((value, ctx) => {\n\t\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value) || value.content !== void 0) return;\n\t\t\tfor (const key of TOOL_RESULT_FOREIGN_FAMILY_KEYS) if (key in value) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tmessage: `content is required when the body carries '${key}' — another result family cannot default into an empty tools/call success`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}).transform(normalizeContentlessToolResult).pipe(CallToolResultSchema$1)\n\t};\n}\nlet memo$1;\n/**\n* Builds the era wire-schema set on first call and returns the same object\n* thereafter. Module evaluation stays construction-free so importing the\n* era codec/registry costs nothing until the first validation actually\n* needs a schema; the registry, the codec, and the eager `schemas.ts`\n* shim all pull through this memo, so reference identity holds across\n* every consumer.\n*/\nfunction buildSchemas2025() {\n\treturn memo$1 ??= build$1();\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2025-11-25/legacyWrap.ts\n/**\n* SEP-2106 legacy `outputSchema` wrap helpers (2025-era projection only).\n*\n* The neutral / 2026-07-28 model lets a tool's `outputSchema` carry any JSON\n* Schema root. The 2025-11-25 wire shape requires `type:'object'` at the root,\n* so when an era-blind handler advertises a non-object root, the 2025 codec's\n* `encodeResult('tools/list', …)` projects it down to\n* `{type:'object', properties:{result:<natural>}, required:['result']}`, and\n* `projectCallToolResult` wraps the matching `structuredContent` as\n* `{result:<value>}`. The 2026 codec's projections are the identity.\n*\n* These helpers are wire-layer property — they exist so the projection can\n* live behind {@link WireCodec.encodeResult} / {@link WireCodec.projectCallToolResult}\n* and never be re-derived in shared/ or server-side code.\n*/\n/**\n* Whether a JSON Schema's root is non-object: either an explicit non-object\n* `type`, or a typeless root such as `{anyOf:[…]}`. Object-shaped typeless\n* roots that the schema-conversion layer can prove are objects are stamped\n* `type:'object'` upstream, so they reach this predicate as object roots.\n*/\nfunction isNonObjectJsonSchemaRoot(json) {\n\treturn json[\"type\"] !== \"object\";\n}\n/**\n* Keyword-position keys whose values are instance data (not subschemas). A\n* `{$ref:…}` appearing inside one is a literal value, not a JSON Pointer to\n* rewrite. Only consulted when the current object is in keyword position —\n* a PROPERTY named `default`/`const` (under `properties`/`$defs`/…) is a name\n* position whose value IS a subschema and is recursed into.\n*/\nconst REF_REWRITE_DATA_POSITION_KEYS = new Set([\n\t\"const\",\n\t\"enum\",\n\t\"default\",\n\t\"examples\"\n]);\n/**\n* Keyword-position keys whose value is a name→subschema map. Entries inside\n* such a map are in NAME position: their keys are author-chosen property\n* names (which may collide with JSON Schema keywords), their values are\n* subschemas to recurse into.\n*/\nconst REF_REWRITE_NAME_MAP_KEYS = new Set([\n\t\"properties\",\n\t\"patternProperties\",\n\t\"$defs\",\n\t\"definitions\",\n\t\"dependentSchemas\",\n\t\"dependencies\"\n]);\n/**\n* Whether a subtree's `$id` establishes a new resolution base. A fragment-only\n* `$id` (`\"#item\"`, the draft-07/06 spelling of 2020-12's `$anchor`) does not\n* change the RFC 3986 base URI — same-document pointers inside still resolve\n* against the document root and must be rewritten.\n*/\nfunction establishesNewBase(id) {\n\treturn id !== void 0 && !(typeof id === \"string\" && id.startsWith(\"#\"));\n}\n/**\n* Wrap a non-object output schema in the 2025-era envelope:\n* `{type:'object', properties:{result:<natural>}, required:['result']}`.\n*\n* Same-document `$ref` / `$dynamicRef` JSON Pointers inside the natural schema\n* (e.g. `#/properties/foo` produced by zod for de-duplicated/recursive types)\n* are rewritten to account for the new `#/properties/result` root: bare `#` →\n* `#/properties/result`, `#/…` → `#/properties/result/…`. Cross-document refs\n* (anything not starting with `#`) are left untouched.\n*\n* The rewrite is position-aware: data-valued keywords\n* (`const`/`enum`/`default`/`examples`) in keyword position are NOT descended\n* into; the same names appearing as property names under\n* `properties`/`patternProperties`/`$defs`/`definitions`/`dependentSchemas`/\n* `dependencies` ARE descended into (they're subschemas). The rewrite is also\n* `$id`-scoped: if the natural root carries a base-establishing `$id` no\n* pointer is rewritten (same-document refs inside resolve against the embedded\n* `$id` base, not the wrapper root), and any subtree that establishes its own\n* `$id` is left untouched for the same reason. Fragment-only `$id` (`\"#item\"`,\n* draft-07's anchor spelling) does not establish a base and IS descended into.\n*/\nfunction wrapOutputSchemaForLegacy(natural) {\n\tconst $schema = typeof natural[\"$schema\"] === \"string\" ? natural[\"$schema\"] : void 0;\n\tif (establishesNewBase(natural[\"$id\"])) return {\n\t\t...$schema !== void 0 && { $schema },\n\t\ttype: \"object\",\n\t\tproperties: { result: natural },\n\t\trequired: [\"result\"]\n\t};\n\tconst convertRecursiveRefs = declares2019Dialect(natural[\"$schema\"]) && natural[\"$recursiveAnchor\"] !== true;\n\tconst rewriteRefs = (node, parentIsNameMap) => {\n\t\tif (Array.isArray(node)) return node.map((item) => rewriteRefs(item, false));\n\t\tif (node === null || typeof node !== \"object\") return node;\n\t\tif (!parentIsNameMap && establishesNewBase(node[\"$id\"])) return node;\n\t\tconst out = {};\n\t\tlet convertedRecursion = false;\n\t\tfor (const [k, v] of Object.entries(node)) if (parentIsNameMap) out[k] = rewriteRefs(v, false);\n\t\telse if ((k === \"$ref\" || k === \"$dynamicRef\") && typeof v === \"string\") out[k] = v === \"#\" ? \"#/properties/result\" : v.startsWith(\"#/\") ? `#/properties/result${v.slice(1)}` : v;\n\t\telse if (k === \"$recursiveRef\" && v === \"#\" && convertRecursiveRefs) convertedRecursion = true;\n\t\telse if (REF_REWRITE_DATA_POSITION_KEYS.has(k)) out[k] = v;\n\t\telse if (REF_REWRITE_NAME_MAP_KEYS.has(k)) out[k] = rewriteRefs(v, true);\n\t\telse out[k] = rewriteRefs(v, false);\n\t\tif (convertedRecursion) if (\"$ref\" in out) out[\"allOf\"] = [...Array.isArray(out[\"allOf\"]) ? out[\"allOf\"] : [], { $ref: \"#/properties/result\" }];\n\t\telse out[\"$ref\"] = \"#/properties/result\";\n\t\treturn out;\n\t};\n\treturn {\n\t\t...$schema !== void 0 && { $schema },\n\t\ttype: \"object\",\n\t\tproperties: { result: rewriteRefs(natural, false) },\n\t\trequired: [\"result\"]\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2025-11-25/registry.ts\nconst requestMethodKeys$1 = {\n\tping: null,\n\tinitialize: null,\n\t\"completion/complete\": null,\n\t\"logging/setLevel\": null,\n\t\"prompts/get\": null,\n\t\"prompts/list\": null,\n\t\"resources/list\": null,\n\t\"resources/templates/list\": null,\n\t\"resources/read\": null,\n\t\"resources/subscribe\": null,\n\t\"resources/unsubscribe\": null,\n\t\"tools/call\": null,\n\t\"tools/list\": null,\n\t\"tasks/get\": null,\n\t\"tasks/result\": null,\n\t\"tasks/list\": null,\n\t\"tasks/cancel\": null,\n\t\"sampling/createMessage\": null,\n\t\"elicitation/create\": null,\n\t\"roots/list\": null\n};\nconst notificationMethodKeys$1 = {\n\t\"notifications/cancelled\": null,\n\t\"notifications/progress\": null,\n\t\"notifications/initialized\": null,\n\t\"notifications/roots/list_changed\": null,\n\t\"notifications/tasks/status\": null,\n\t\"notifications/message\": null,\n\t\"notifications/resources/updated\": null,\n\t\"notifications/resources/list_changed\": null,\n\t\"notifications/tools/list_changed\": null,\n\t\"notifications/prompts/list_changed\": null,\n\t\"notifications/elicitation/complete\": null\n};\nconst resultMethodKeys = {\n\tping: null,\n\tinitialize: null,\n\t\"completion/complete\": null,\n\t\"logging/setLevel\": null,\n\t\"prompts/get\": null,\n\t\"prompts/list\": null,\n\t\"resources/list\": null,\n\t\"resources/templates/list\": null,\n\t\"resources/read\": null,\n\t\"resources/subscribe\": null,\n\t\"resources/unsubscribe\": null,\n\t\"tools/call\": null,\n\t\"tools/list\": null,\n\t\"sampling/createMessage\": null,\n\t\"elicitation/create\": null,\n\t\"roots/list\": null\n};\nlet maps$1;\nfunction registryMaps() {\n\tif (maps$1) return maps$1;\n\tconst s = buildSchemas2025();\n\tmaps$1 = {\n\t\trequestSchemas: {\n\t\t\tping: s.PingRequestSchema,\n\t\t\tinitialize: s.InitializeRequestSchema,\n\t\t\t\"completion/complete\": s.CompleteRequestSchema,\n\t\t\t\"logging/setLevel\": s.SetLevelRequestSchema,\n\t\t\t\"prompts/get\": s.GetPromptRequestSchema,\n\t\t\t\"prompts/list\": s.ListPromptsRequestSchema,\n\t\t\t\"resources/list\": s.ListResourcesRequestSchema,\n\t\t\t\"resources/templates/list\": s.ListResourceTemplatesRequestSchema,\n\t\t\t\"resources/read\": s.ReadResourceRequestSchema,\n\t\t\t\"resources/subscribe\": s.SubscribeRequestSchema,\n\t\t\t\"resources/unsubscribe\": s.UnsubscribeRequestSchema,\n\t\t\t\"tools/call\": s.CallToolRequestSchema,\n\t\t\t\"tools/list\": s.ListToolsRequestSchema,\n\t\t\t\"tasks/get\": s.GetTaskRequestSchema,\n\t\t\t\"tasks/result\": s.GetTaskPayloadRequestSchema,\n\t\t\t\"tasks/list\": s.ListTasksRequestSchema,\n\t\t\t\"tasks/cancel\": s.CancelTaskRequestSchema,\n\t\t\t\"sampling/createMessage\": s.CreateMessageRequestSchema,\n\t\t\t\"elicitation/create\": s.ElicitRequestSchema,\n\t\t\t\"roots/list\": s.ListRootsRequestSchema\n\t\t},\n\t\tnotificationSchemas: {\n\t\t\t\"notifications/cancelled\": s.CancelledNotificationSchema,\n\t\t\t\"notifications/progress\": s.ProgressNotificationSchema,\n\t\t\t\"notifications/initialized\": s.InitializedNotificationSchema,\n\t\t\t\"notifications/roots/list_changed\": s.RootsListChangedNotificationSchema,\n\t\t\t\"notifications/tasks/status\": s.TaskStatusNotificationSchema,\n\t\t\t\"notifications/message\": s.LoggingMessageNotificationSchema,\n\t\t\t\"notifications/resources/updated\": s.ResourceUpdatedNotificationSchema,\n\t\t\t\"notifications/resources/list_changed\": s.ResourceListChangedNotificationSchema,\n\t\t\t\"notifications/tools/list_changed\": s.ToolListChangedNotificationSchema,\n\t\t\t\"notifications/prompts/list_changed\": s.PromptListChangedNotificationSchema,\n\t\t\t\"notifications/elicitation/complete\": s.ElicitationCompleteNotificationSchema\n\t\t},\n\t\tresultSchemas: {\n\t\t\tping: s.EmptyResultSchema,\n\t\t\tinitialize: s.InitializeResultSchema,\n\t\t\t\"completion/complete\": s.CompleteResultSchema,\n\t\t\t\"logging/setLevel\": s.EmptyResultSchema,\n\t\t\t\"prompts/get\": s.GetPromptResultSchema,\n\t\t\t\"prompts/list\": s.ListPromptsResultSchema,\n\t\t\t\"resources/list\": s.ListResourcesResultSchema,\n\t\t\t\"resources/templates/list\": s.ListResourceTemplatesResultSchema,\n\t\t\t\"resources/read\": s.ReadResourceResultSchema,\n\t\t\t\"resources/subscribe\": s.EmptyResultSchema,\n\t\t\t\"resources/unsubscribe\": s.EmptyResultSchema,\n\t\t\t\"tools/call\": s.CallToolResultWireSchema,\n\t\t\t\"tools/list\": s.ListToolsResultSchema,\n\t\t\t\"sampling/createMessage\": s.CreateMessageResultWithToolsSchema,\n\t\t\t\"elicitation/create\": s.ElicitResultSchema,\n\t\t\t\"roots/list\": s.ListRootsResultSchema\n\t\t}\n\t};\n\treturn maps$1;\n}\n/**\n* Forces the lazy registry maps (and, through them, the era's schema memo).\n* Warm-up hook for `preloadSchemas()` — no-op once the maps exist.\n*/\nfunction warmRegistryMaps2025() {\n\tregistryMaps();\n}\n/** The 2025-era request-method set (registry membership = the deletion story). */\nfunction hasRequestMethod2025(method) {\n\treturn Object.prototype.hasOwnProperty.call(requestMethodKeys$1, method);\n}\n/** The 2025-era notification-method set. */\nfunction hasNotificationMethod2025(method) {\n\treturn Object.prototype.hasOwnProperty.call(notificationMethodKeys$1, method);\n}\n/** Result-map membership: exactly the era's typed-method subset (no task entries, no 2026-only methods). */\nfunction hasResultMethod(method) {\n\treturn Object.prototype.hasOwnProperty.call(resultMethodKeys, method);\n}\nfunction getResultSchema(method) {\n\treturn hasResultMethod(method) ? registryMaps().resultSchemas[method] : void 0;\n}\nfunction getRequestSchema(method) {\n\treturn hasRequestMethod2025(method) ? registryMaps().requestSchemas[method] : void 0;\n}\nfunction getNotificationSchema(method) {\n\treturn hasNotificationMethod2025(method) ? registryMaps().notificationSchemas[method] : void 0;\n}\n/** Registry method lists (for the spec-method universe and the CI registry-diff oracle). */\nconst rev2025RequestMethods = Object.keys(requestMethodKeys$1);\nconst rev2025NotificationMethods = Object.keys(notificationMethodKeys$1);\n\n//#endregion\n//#region ../core-internal/src/wire/rev2025-11-25/codec.ts\nfunction isPlainObject$6(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/** Tri-state wrap of an optional Zod schema lookup (the function-only contract). */\nfunction triState$1(schema, raw) {\n\tif (schema === void 0) return {\n\t\tok: false,\n\t\treason: \"not-in-era\"\n\t};\n\tconst parsed = schema.safeParse(raw);\n\treturn parsed.success ? {\n\t\tok: true,\n\t\tvalue: parsed.data\n\t} : {\n\t\tok: false,\n\t\treason: \"invalid\",\n\t\tmessage: String(parsed.error)\n\t};\n}\nconst NOT_IN_ERA$1 = {\n\tok: false,\n\treason: \"not-in-era\"\n};\n/** Whether a `tools/list` entry advertises a non-object `outputSchema` root that needs the SEP-2106 legacy wrap. */\nfunction toolNeedsLegacyWrap(t) {\n\treturn isPlainObject$6(t) && isPlainObject$6(t[\"outputSchema\"]) && isNonObjectJsonSchemaRoot(t[\"outputSchema\"]);\n}\n/** The wire→neutral trust boundary: a decoded 2025-era wire result is adopted as the neutral `Result` here (the module's single deliberate assertion). */\nfunction toNeutralResult(value) {\n\treturn value;\n}\nconst rev2025Codec = {\n\tera: \"2025-11-25\",\n\thasRequestMethod: hasRequestMethod2025,\n\thasNotificationMethod: hasNotificationMethod2025,\n\tvalidateRequest: (method, raw) => triState$1(getRequestSchema(method), raw),\n\tvalidateResult: (method, raw) => triState$1(getResultSchema(method), raw),\n\tvalidateNotification: (method, raw) => triState$1(getNotificationSchema(method), raw),\n\thasInputRequestMethod: () => false,\n\tvalidateInputRequest: () => NOT_IN_ERA$1,\n\tvalidateInputResponse: () => NOT_IN_ERA$1,\n\tsamplingResultVariant: ((hasTools, raw) => {\n\t\tconst s = buildSchemas2025();\n\t\treturn triState$1(hasTools ? s.CreateMessageResultWithToolsSchema : s.CreateMessageResultSchema, raw);\n\t}),\n\toutboundEnvelope: (_material) => void 0,\n\tvalidateEnvelopeMeta: (_meta) => [],\n\tprojectCallToolResult(result, advertisedOutputSchema) {\n\t\tconst withText = appendTextFallbackForNonObject(result);\n\t\tconst sc = withText.structuredContent;\n\t\tif (sc === void 0) return withText;\n\t\tconst valueIsNonObject = typeof sc !== \"object\" || sc === null || Array.isArray(sc);\n\t\tconst schemaWrapped = advertisedOutputSchema !== void 0 && isNonObjectJsonSchemaRoot(advertisedOutputSchema);\n\t\tif (!valueIsNonObject && !schemaWrapped) return withText;\n\t\treturn {\n\t\t\t...withText,\n\t\t\tstructuredContent: { result: sc }\n\t\t};\n\t},\n\tdecodeResult(_method, raw) {\n\t\tif (isPlainObject$6(raw) && \"resultType\" in raw) {\n\t\t\tconst stripped = { ...raw };\n\t\t\tdelete stripped[\"resultType\"];\n\t\t\treturn {\n\t\t\t\tkind: \"complete\",\n\t\t\t\tresult: toNeutralResult(stripped)\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tkind: \"complete\",\n\t\t\tresult: toNeutralResult(raw)\n\t\t};\n\t},\n\tencodeResult(method, result) {\n\t\tif (method !== \"tools/list\") return result;\n\t\tconst tools = result.tools;\n\t\tif (!Array.isArray(tools) || !tools.some((t) => toolNeedsLegacyWrap(t))) return result;\n\t\treturn {\n\t\t\t...result,\n\t\t\ttools: tools.map((t) => toolNeedsLegacyWrap(t) ? {\n\t\t\t\t...t,\n\t\t\t\toutputSchema: wrapOutputSchemaForLegacy(t.outputSchema)\n\t\t\t} : t)\n\t\t};\n\t},\n\tencodeErrorCode: (code) => code === -32002 ? -32602 : code,\n\tcheckInboundEnvelope: (_material) => void 0\n};\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/buildSchemas.ts\n/**\n* 2026-era wire schemas (protocol revision 2026-07-28).\n*\n* Fully self-contained — no runtime imports from types/schemas.ts. The\n* neutral types/schemas.ts layer is the public-API superset and is free to\n* evolve; this file is the 2026 wire-parse contract and is BEHAVIOR-FROZEN\n* against the 2026-07-28 anchor. Every era-shared building block (content\n* blocks, resources, prompts, capabilities, notifications, …) that the wire\n* shapes compose is a frozen LOCAL copy — verbatim from the neutral layer at\n* the point this revision was sealed, dependencies first. The only cross-layer\n* dependency is `import type { JSONObject, JSONValue }` from the neutral types\n* barrel — pure structural type aliases with no parse behavior.\n*\n* This module is the only place the per-request `_meta` envelope is modeled.\n* The envelope is wire-only vocabulary: the protocol layer lifts it off\n* inbound requests before any handler runs and surfaces it at\n* `ctx.mcpReq.envelope`; the 2026-era codec enforces its requiredness at\n* dispatch time (`checkInboundEnvelope`) - the former neutral-schema JSDoc\n* deferral (\"enforced per request at dispatch time, not here\") is now\n* discharged by that codec step.\n*\n* No 2025-era traffic ever touches this module, so requiredness here is\n* bare and spec-exact (the shared-schema `.catch` hazards do not apply).\n*\n* SPEC-CURRENCY RE-SEAL (2026-07-17): the 2026-07-28 revision was re-sealed\n* upstream by spec PR #3002 (commit 71e30695, merged 2026-07-15 — after the\n* previous anchor pin f68d864a): the envelope's `clientInfo` demoted from\n* required to SHOULD, and `DiscoverResult.serverInfo` moved from the result\n* body to the new `ResultMetaObject` key\n* `_meta['io.modelcontextprotocol/serverInfo']` (optional on every result).\n* The shapes below are the re-sealed anchor, exactly — no pre-#3002 shape is\n* modeled anywhere (per ruling: the final revision is the only 2026-07-28).\n*/\nfunction build() {\n\tconst JSONValueSchema$1 = z.lazy(() => z.union([\n\t\tz.string(),\n\t\tz.number(),\n\t\tz.boolean(),\n\t\tz.null(),\n\t\tz.record(z.string(), JSONValueSchema$1),\n\t\tz.array(JSONValueSchema$1)\n\t]));\n\tconst JSONObjectSchema$1 = z.record(z.string(), JSONValueSchema$1);\n\t/**\n\t* A progress token, used to associate progress notifications with the original request.\n\t*/\n\tconst ProgressTokenSchema$1 = z.union([z.string(), z.number().int()]);\n\t/**\n\t* An opaque token used to represent a cursor for pagination.\n\t*/\n\tconst CursorSchema$1 = z.string();\n\t/**\n\t* A uniquely identifying ID for a request in JSON-RPC.\n\t*/\n\tconst RequestIdSchema$1 = z.union([z.string(), z.number().int()]);\n\t/**\n\t* The sender or recipient of messages and data in a conversation.\n\t*/\n\tconst RoleSchema$1 = z.enum([\"user\", \"assistant\"]);\n\t/**\n\t* The severity of a log message.\n\t*/\n\tconst LoggingLevelSchema$1 = z.enum([\n\t\t\"debug\",\n\t\t\"info\",\n\t\t\"notice\",\n\t\t\"warning\",\n\t\t\"error\",\n\t\t\"critical\",\n\t\t\"alert\",\n\t\t\"emergency\"\n\t]);\n\t/**\n\t* A Zod schema for validating Base64 strings that is more performant and\n\t* robust for very large inputs than the default regex-based check. It avoids\n\t* stack overflows by using the native `atob` function for validation.\n\t*/\n\tconst Base64Schema = z.string().refine((val) => {\n\t\ttry {\n\t\t\tatob(val);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, { message: \"Invalid Base64 string\" });\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst TaskMetadataSchema$1 = z.object({ ttl: z.number().optional() });\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst RelatedTaskMetadataSchema$1 = z.object({ taskId: z.string() });\n\tconst RequestMetaSchema$1 = z.looseObject({\n\t\tprogressToken: ProgressTokenSchema$1.optional(),\n\t\t\"io.modelcontextprotocol/related-task\": RelatedTaskMetadataSchema$1.optional()\n\t});\n\tconst BaseRequestParamsSchema$1 = z.object({ _meta: RequestMetaSchema$1.optional() });\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst TaskAugmentedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ task: TaskMetadataSchema$1.optional() });\n\tconst NotificationsParamsSchema$1 = z.object({ _meta: RequestMetaSchema$1.optional() });\n\tconst NotificationSchema$1 = z.object({\n\t\tmethod: z.string(),\n\t\tparams: NotificationsParamsSchema$1.loose().optional()\n\t});\n\tconst IconSchema$1 = z.object({\n\t\tsrc: z.string(),\n\t\tmimeType: z.string().optional(),\n\t\tsizes: z.array(z.string()).optional(),\n\t\ttheme: z.enum([\"light\", \"dark\"]).optional()\n\t});\n\tconst IconsSchema$1 = z.object({ icons: z.array(IconSchema$1).optional() });\n\tconst BaseMetadataSchema$1 = z.object({\n\t\tname: z.string(),\n\t\ttitle: z.string().optional()\n\t});\n\tconst ImplementationSchema$1 = BaseMetadataSchema$1.extend({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tversion: z.string(),\n\t\twebsiteUrl: z.string().optional(),\n\t\tdescription: z.string().optional()\n\t});\n\tconst FormElicitationCapabilitySchema = z.intersection(z.object({ applyDefaults: z.boolean().optional() }), JSONObjectSchema$1);\n\tconst ElicitationCapabilitySchema = z.preprocess((value) => {\n\t\tif (value && typeof value === \"object\" && !Array.isArray(value) && Object.keys(value).length === 0) return { form: {} };\n\t\treturn value;\n\t}, z.intersection(z.object({\n\t\tform: FormElicitationCapabilitySchema.optional(),\n\t\turl: JSONObjectSchema$1.optional()\n\t}), JSONObjectSchema$1.optional()));\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst ClientTasksCapabilitySchema$1 = z.looseObject({\n\t\tlist: JSONObjectSchema$1.optional(),\n\t\tcancel: JSONObjectSchema$1.optional(),\n\t\trequests: z.looseObject({\n\t\t\tsampling: z.looseObject({ createMessage: JSONObjectSchema$1.optional() }).optional(),\n\t\t\telicitation: z.looseObject({ create: JSONObjectSchema$1.optional() }).optional()\n\t\t}).optional()\n\t});\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst ServerTasksCapabilitySchema$1 = z.looseObject({\n\t\tlist: JSONObjectSchema$1.optional(),\n\t\tcancel: JSONObjectSchema$1.optional(),\n\t\trequests: z.looseObject({ tools: z.looseObject({ call: JSONObjectSchema$1.optional() }).optional() }).optional()\n\t});\n\tconst ClientCapabilitiesSchema$1 = z.object({\n\t\texperimental: z.record(z.string(), JSONObjectSchema$1).optional(),\n\t\tsampling: z.object({\n\t\t\tcontext: JSONObjectSchema$1.optional(),\n\t\t\ttools: JSONObjectSchema$1.optional()\n\t\t}).optional(),\n\t\telicitation: ElicitationCapabilitySchema.optional(),\n\t\troots: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\ttasks: ClientTasksCapabilitySchema$1.optional(),\n\t\textensions: z.record(z.string(), JSONObjectSchema$1).optional()\n\t});\n\tconst ServerCapabilitiesSchema$1 = z.object({\n\t\texperimental: z.record(z.string(), JSONObjectSchema$1).optional(),\n\t\tlogging: JSONObjectSchema$1.optional(),\n\t\tcompletions: JSONObjectSchema$1.optional(),\n\t\tprompts: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\tresources: z.object({\n\t\t\tsubscribe: z.boolean().optional(),\n\t\t\tlistChanged: z.boolean().optional()\n\t\t}).optional(),\n\t\ttools: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\ttasks: ServerTasksCapabilitySchema$1.optional(),\n\t\textensions: z.record(z.string(), JSONObjectSchema$1).optional()\n\t});\n\tconst ProgressSchema$1 = z.object({\n\t\tprogress: z.number(),\n\t\ttotal: z.optional(z.number()),\n\t\tmessage: z.optional(z.string())\n\t});\n\tconst ProgressNotificationParamsSchema$1 = z.object({\n\t\t...NotificationsParamsSchema$1.shape,\n\t\t...ProgressSchema$1.shape,\n\t\tprogressToken: ProgressTokenSchema$1\n\t});\n\tconst ProgressNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/progress\"),\n\t\tparams: ProgressNotificationParamsSchema$1\n\t});\n\tconst LoggingMessageNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({\n\t\tlevel: LoggingLevelSchema$1,\n\t\tlogger: z.string().optional(),\n\t\tdata: z.unknown()\n\t});\n\tconst LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/message\"),\n\t\tparams: LoggingMessageNotificationParamsSchema$1\n\t});\n\tconst ResourceContentsSchema$1 = z.object({\n\t\turi: z.string(),\n\t\tmimeType: z.optional(z.string()),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst TextResourceContentsSchema$1 = ResourceContentsSchema$1.extend({ text: z.string() });\n\tconst BlobResourceContentsSchema$1 = ResourceContentsSchema$1.extend({ blob: Base64Schema });\n\tconst AnnotationsSchema$1 = z.object({\n\t\taudience: z.array(RoleSchema$1).optional(),\n\t\tpriority: z.number().min(0).max(1).optional(),\n\t\tlastModified: z.iso.datetime({ offset: true }).optional()\n\t});\n\tconst ResourceSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\turi: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\tmimeType: z.optional(z.string()),\n\t\tsize: z.optional(z.number()),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\tconst ResourceTemplateSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\turiTemplate: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\tmimeType: z.optional(z.string()),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\tconst ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/resources/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\tconst ResourceUpdatedNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ uri: z.string() });\n\tconst ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/resources/updated\"),\n\t\tparams: ResourceUpdatedNotificationParamsSchema$1\n\t});\n\tconst PromptArgumentSchema$1 = z.object({\n\t\tname: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\trequired: z.optional(z.boolean())\n\t});\n\tconst PromptSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tdescription: z.optional(z.string()),\n\t\targuments: z.optional(z.array(PromptArgumentSchema$1)),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\tconst PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/prompts/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\tconst TextContentSchema$1 = z.object({\n\t\ttype: z.literal(\"text\"),\n\t\ttext: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst ImageContentSchema$1 = z.object({\n\t\ttype: z.literal(\"image\"),\n\t\tdata: Base64Schema,\n\t\tmimeType: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst AudioContentSchema$1 = z.object({\n\t\ttype: z.literal(\"audio\"),\n\t\tdata: Base64Schema,\n\t\tmimeType: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst ToolUseContentSchema$1 = z.object({\n\t\ttype: z.literal(\"tool_use\"),\n\t\tname: z.string(),\n\t\tid: z.string(),\n\t\tinput: z.record(z.string(), z.unknown()),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst EmbeddedResourceSchema$1 = z.object({\n\t\ttype: z.literal(\"resource\"),\n\t\tresource: z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: z.literal(\"resource_link\") });\n\tconst ContentBlockSchema$1 = z.union([\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1,\n\t\tResourceLinkSchema$1,\n\t\tEmbeddedResourceSchema$1\n\t]);\n\tconst PromptMessageSchema$1 = z.object({\n\t\trole: RoleSchema$1,\n\t\tcontent: ContentBlockSchema$1\n\t});\n\tconst ToolAnnotationsSchema$1 = z.object({\n\t\ttitle: z.string().optional(),\n\t\treadOnlyHint: z.boolean().optional(),\n\t\tdestructiveHint: z.boolean().optional(),\n\t\tidempotentHint: z.boolean().optional(),\n\t\topenWorldHint: z.boolean().optional()\n\t});\n\tconst ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/tools/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\tconst ModelHintSchema$1 = z.object({ name: z.string().optional() });\n\tconst ModelPreferencesSchema$1 = z.object({\n\t\thints: z.array(ModelHintSchema$1).optional(),\n\t\tcostPriority: z.number().min(0).max(1).optional(),\n\t\tspeedPriority: z.number().min(0).max(1).optional(),\n\t\tintelligencePriority: z.number().min(0).max(1).optional()\n\t});\n\tconst ToolChoiceSchema$1 = z.object({ mode: z.enum([\n\t\t\"auto\",\n\t\t\"required\",\n\t\t\"none\"\n\t]).optional() });\n\tconst BooleanSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"boolean\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tdefault: z.boolean().optional()\n\t});\n\tconst StringSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminLength: z.number().optional(),\n\t\tmaxLength: z.number().optional(),\n\t\tformat: z.enum([\n\t\t\t\"email\",\n\t\t\t\"uri\",\n\t\t\t\"date\",\n\t\t\t\"date-time\"\n\t\t]).optional(),\n\t\tdefault: z.string().optional()\n\t});\n\tconst NumberSchemaSchema$1 = z.object({\n\t\ttype: z.enum([\"number\", \"integer\"]),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminimum: z.number().optional(),\n\t\tmaximum: z.number().optional(),\n\t\tdefault: z.number().optional()\n\t});\n\tconst UntitledSingleSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tenum: z.array(z.string()),\n\t\tdefault: z.string().optional()\n\t});\n\tconst TitledSingleSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\toneOf: z.array(z.object({\n\t\t\tconst: z.string(),\n\t\t\ttitle: z.string()\n\t\t})),\n\t\tdefault: z.string().optional()\n\t});\n\tconst LegacyTitledEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tenum: z.array(z.string()),\n\t\tenumNames: z.array(z.string()).optional(),\n\t\tdefault: z.string().optional()\n\t});\n\tconst SingleSelectEnumSchemaSchema$1 = z.union([UntitledSingleSelectEnumSchemaSchema$1, TitledSingleSelectEnumSchemaSchema$1]);\n\tconst UntitledMultiSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"array\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminItems: z.number().optional(),\n\t\tmaxItems: z.number().optional(),\n\t\titems: z.object({\n\t\t\ttype: z.literal(\"string\"),\n\t\t\tenum: z.array(z.string())\n\t\t}),\n\t\tdefault: z.array(z.string()).optional()\n\t});\n\tconst TitledMultiSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"array\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminItems: z.number().optional(),\n\t\tmaxItems: z.number().optional(),\n\t\titems: z.object({ anyOf: z.array(z.object({\n\t\t\tconst: z.string(),\n\t\t\ttitle: z.string()\n\t\t})) }),\n\t\tdefault: z.array(z.string()).optional()\n\t});\n\tconst MultiSelectEnumSchemaSchema$1 = z.union([UntitledMultiSelectEnumSchemaSchema$1, TitledMultiSelectEnumSchemaSchema$1]);\n\tconst EnumSchemaSchema$1 = z.union([\n\t\tLegacyTitledEnumSchemaSchema$1,\n\t\tSingleSelectEnumSchemaSchema$1,\n\t\tMultiSelectEnumSchemaSchema$1\n\t]);\n\tconst PrimitiveSchemaDefinitionSchema$1 = z.union([\n\t\tEnumSchemaSchema$1,\n\t\tBooleanSchemaSchema$1,\n\t\tStringSchemaSchema$1,\n\t\tNumberSchemaSchema$1\n\t]);\n\tconst ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tmode: z.literal(\"form\").optional(),\n\t\tmessage: z.string(),\n\t\trequestedSchema: z.object({\n\t\t\ttype: z.literal(\"object\"),\n\t\t\tproperties: z.record(z.string(), PrimitiveSchemaDefinitionSchema$1),\n\t\t\trequired: z.array(z.string()).optional()\n\t\t}).catchall(z.unknown())\n\t});\n\tconst ResourceTemplateReferenceSchema$1 = z.object({\n\t\ttype: z.literal(\"ref/resource\"),\n\t\turi: z.string()\n\t});\n\tconst PromptReferenceSchema$1 = z.object({\n\t\ttype: z.literal(\"ref/prompt\"),\n\t\tname: z.string()\n\t});\n\tconst RootSchema$1 = z.object({\n\t\turi: z.string().startsWith(\"file://\"),\n\t\tname: z.string().optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst sharedClientCapabilityShape = ClientCapabilitiesSchema$1.shape;\n\tconst ClientCapabilities2026Schema = z.object({\n\t\texperimental: sharedClientCapabilityShape.experimental,\n\t\tsampling: sharedClientCapabilityShape.sampling,\n\t\telicitation: sharedClientCapabilityShape.elicitation,\n\t\troots: sharedClientCapabilityShape.roots,\n\t\textensions: sharedClientCapabilityShape.extensions\n\t});\n\tconst sharedServerCapabilityShape = ServerCapabilitiesSchema$1.shape;\n\tconst ServerCapabilities2026Schema = z.object({\n\t\texperimental: sharedServerCapabilityShape.experimental,\n\t\tlogging: sharedServerCapabilityShape.logging,\n\t\tcompletions: sharedServerCapabilityShape.completions,\n\t\tprompts: sharedServerCapabilityShape.prompts,\n\t\tresources: sharedServerCapabilityShape.resources,\n\t\ttools: sharedServerCapabilityShape.tools,\n\t\textensions: sharedServerCapabilityShape.extensions\n\t});\n\t/**\n\t* The per-request `_meta` envelope carried by every request under protocol revision\n\t* 2026-07-28: the protocol version governing the request, the client implementation\n\t* info, and the client's capabilities — declared per request rather than once at\n\t* initialization — plus the optional log-level opt-in.\n\t*\n\t* This schema models the complete envelope on its own (loose: foreign keys\n\t* pass through - the lift extracts exactly the reserved keys, so enforcement\n\t* never sees extension material). Requiredness is enforced per request at\n\t* dispatch time by the 2026-era codec's `checkInboundEnvelope` step.\n\t*/\n\tconst RequestMetaEnvelopeSchema = z.looseObject({\n\t\tprogressToken: ProgressTokenSchema$1.optional(),\n\t\t[PROTOCOL_VERSION_META_KEY]: z.string(),\n\t\t[CLIENT_INFO_META_KEY]: ImplementationSchema$1.optional(),\n\t\t[CLIENT_CAPABILITIES_META_KEY]: ClientCapabilities2026Schema,\n\t\t[LOG_LEVEL_META_KEY]: LoggingLevelSchema$1.optional()\n\t});\n\t/** 2026-era Tool: anchor-exact — no `execution` (deleted vocabulary). */\n\tconst ToolSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tdescription: z.string().optional(),\n\t\tinputSchema: z.looseObject({\n\t\t\t$schema: z.string().optional(),\n\t\t\ttype: z.literal(\"object\")\n\t\t}),\n\t\toutputSchema: z.looseObject({ $schema: z.string().optional() }).optional(),\n\t\tannotations: ToolAnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/** 2026-era ToolResultContent (anchor-exact: `structuredContent?: unknown`). */\n\tconst ToolResultContentSchema$1 = z.object({\n\t\ttype: z.literal(\"tool_result\"),\n\t\ttoolUseId: z.string(),\n\t\tcontent: z.array(ContentBlockSchema$1),\n\t\tstructuredContent: z.unknown().optional(),\n\t\tisError: z.boolean().optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/** 2026-era sampling content union (composes the forked tool-result shape). */\n\tconst SamplingMessageContentBlockSchema$1 = z.union([\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1,\n\t\tToolUseContentSchema$1,\n\t\tToolResultContentSchema$1\n\t]);\n\t/** 2026-era SamplingMessage (anchor-exact: single block or array). */\n\tconst SamplingMessageSchema$1 = z.object({\n\t\trole: RoleSchema$1,\n\t\tcontent: z.union([SamplingMessageContentBlockSchema$1, z.array(SamplingMessageContentBlockSchema$1)]),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/** Open union per the anchor: 'complete' | 'input_required' | string. */\n\tconst ResultTypeSchema = z.string();\n\t/**\n\t* Result `_meta` (anchor `ResultMetaObject`, added by spec PR #3002):\n\t* loose, with the serverInfo key typed when present; the outbound stamp\n\t* is the encode contract's `stampServerInfoMeta` step.\n\t*/\n\tconst ResultMetaSchema = z.looseObject({ [SERVER_INFO_META_KEY]: ImplementationSchema$1.optional().catch(void 0) });\n\tconst wireMeta = ResultMetaSchema.optional();\n\tfunction wireResult(shape) {\n\t\treturn z.looseObject({\n\t\t\t_meta: wireMeta,\n\t\t\tresultType: ResultTypeSchema.default(\"complete\"),\n\t\t\t...shape\n\t\t});\n\t}\n\tconst ResultSchema$1 = wireResult({});\n\tconst PaginatedResultSchema$1 = wireResult({ nextCursor: CursorSchema$1.optional() });\n\tconst CallToolResultSchema$1 = wireResult({\n\t\tcontent: z.array(ContentBlockSchema$1),\n\t\tstructuredContent: z.unknown().optional(),\n\t\tisError: z.boolean().optional()\n\t});\n\tconst ListToolsResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\ttools: z.array(ToolSchema$1),\n\t\tnextCursor: CursorSchema$1.optional()\n\t});\n\tconst ListPromptsResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\tprompts: z.array(PromptSchema$1),\n\t\tnextCursor: CursorSchema$1.optional()\n\t});\n\tconst GetPromptResultSchema$1 = wireResult({\n\t\tdescription: z.string().optional(),\n\t\tmessages: z.array(PromptMessageSchema$1)\n\t});\n\tconst ListResourcesResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\tresources: z.array(ResourceSchema$1),\n\t\tnextCursor: CursorSchema$1.optional()\n\t});\n\tconst ListResourceTemplatesResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\tresourceTemplates: z.array(ResourceTemplateSchema$1),\n\t\tnextCursor: CursorSchema$1.optional()\n\t});\n\tconst ReadResourceResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\tcontents: z.array(z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]))\n\t});\n\tconst CompleteResultSchema$1 = wireResult({ completion: z.object({\n\t\tvalues: z.array(z.string()).max(100),\n\t\ttotal: z.number().int().optional(),\n\t\thasMore: z.boolean().optional()\n\t}).loose() });\n\t/** CacheableResult (SEP-2549): ttlMs and cacheScope REQUIRED per the anchor. */\n\tconst CacheableResultSchema = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"])\n\t});\n\tconst DiscoverResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0).catch(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]).catch(\"private\"),\n\t\tsupportedVersions: z.array(z.string()),\n\t\tcapabilities: ServerCapabilities2026Schema,\n\t\tinstructions: z.string().optional()\n\t});\n\t/** 2026-era CreateMessageRequestParams (anchor-exact: forked SamplingMessage/Tool, no task augmentation). */\n\tconst CreateMessageRequestParamsSchema$1 = z.object({\n\t\tmessages: z.array(SamplingMessageSchema$1),\n\t\tmodelPreferences: ModelPreferencesSchema$1.optional(),\n\t\tsystemPrompt: z.string().optional(),\n\t\tincludeContext: z.enum([\n\t\t\t\"none\",\n\t\t\t\"thisServer\",\n\t\t\t\"allServers\"\n\t\t]).optional(),\n\t\ttemperature: z.number().optional(),\n\t\tmaxTokens: z.number().int(),\n\t\tstopSequences: z.array(z.string()).optional(),\n\t\tmetadata: JSONObjectSchema$1.optional(),\n\t\ttools: z.array(ToolSchema$1).optional(),\n\t\ttoolChoice: ToolChoiceSchema$1.optional()\n\t});\n\t/** 2026-era embedded sampling request (de-JSON-RPC'd). */\n\tconst CreateMessageRequestSchema$1 = z.object({\n\t\tmethod: z.literal(\"sampling/createMessage\"),\n\t\tparams: CreateMessageRequestParamsSchema$1\n\t});\n\t/**\n\t* 2026-era embedded roots listing request (de-JSON-RPC'd). Embedded input\n\t* requests do NOT carry the per-request `_meta` envelope on this revision —\n\t* the anchor declares a bare optional `_meta` on `params`.\n\t*/\n\tconst ListRootsRequestSchema$1 = z.object({\n\t\tmethod: z.literal(\"roots/list\"),\n\t\tparams: z.object({ _meta: z.record(z.string(), z.unknown()).optional() }).optional()\n\t});\n\t/** 2026-era embedded sampling response (anchor-exact: extends the forked SamplingMessage). */\n\tconst CreateMessageResultSchema$1 = z.object({\n\t\t...SamplingMessageSchema$1.shape,\n\t\tmodel: z.string(),\n\t\tstopReason: z.string().optional()\n\t});\n\t/** 2026-era embedded roots listing response (anchor-exact: bare `roots` array). */\n\tconst ListRootsResultSchema$1 = z.object({ roots: z.array(RootSchema$1) });\n\t/** 2026-era embedded elicitation response (anchor-exact: bare result, restricted content value types). */\n\tconst ElicitResultSchema$1 = z.object({\n\t\taction: z.enum([\n\t\t\t\"accept\",\n\t\t\t\"decline\",\n\t\t\t\"cancel\"\n\t\t]),\n\t\tcontent: z.record(z.string(), z.union([\n\t\t\tz.string(),\n\t\t\tz.number(),\n\t\t\tz.boolean(),\n\t\t\tz.array(z.string())\n\t\t])).optional()\n\t});\n\t/**\n\t* 2026-era URL-mode elicitation params (anchor-exact fork): the draft removed\n\t* `elicitationId` (and the `notifications/elicitation/complete` channel it\n\t* keyed) — the shared schema keeps the field because it is required on the\n\t* frozen 2025-11-25 revision.\n\t*/\n\tconst ElicitRequestURLParamsSchema$1 = z.object({\n\t\tmode: z.literal(\"url\"),\n\t\tmessage: z.string(),\n\t\turl: z.string().url()\n\t});\n\t/** 2026-era elicitation params (form mode is revision-identical; URL mode is the fork above). */\n\tconst ElicitRequestParamsSchema$1 = z.union([ElicitRequestFormParamsSchema$1, ElicitRequestURLParamsSchema$1]);\n\t/** 2026-era embedded elicitation request (de-JSON-RPC'd; see the URL-mode fork above). */\n\tconst ElicitRequestSchema$1 = z.object({\n\t\tmethod: z.literal(\"elicitation/create\"),\n\t\tparams: ElicitRequestParamsSchema$1\n\t});\n\t/** A single embedded input request (one of the three demoted server→client requests). */\n\tconst InputRequestSchema = z.union([\n\t\tCreateMessageRequestSchema$1,\n\t\tListRootsRequestSchema$1,\n\t\tElicitRequestSchema$1\n\t]);\n\t/** A single embedded input response — the BARE result union (never a `{method, result}` wrapper). */\n\tconst InputResponseSchema = z.union([\n\t\tCreateMessageResultSchema$1,\n\t\tListRootsResultSchema$1,\n\t\tElicitResultSchema$1\n\t]);\n\t/** Map of embedded input requests, keyed by server-assigned identifiers. */\n\tconst InputRequestsSchema = z.record(z.string(), InputRequestSchema);\n\t/** Map of embedded input responses, keyed by the corresponding request identifiers. */\n\tconst InputResponsesSchema = z.record(z.string(), InputResponseSchema);\n\t/**\n\t* The wire InputRequiredResult: `resultType: 'input_required'` plus at least\n\t* one of `inputRequests` / `requestState` (the at-least-one rule is enforced\n\t* at the server seam, not by this parse shape).\n\t*/\n\tconst InputRequiredResultSchema = wireResult({\n\t\tinputRequests: InputRequestsSchema.optional(),\n\t\trequestState: z.string().optional()\n\t});\n\t/** The retry-channel members carried by client-initiated requests on this revision. */\n\tconst retryParamsShape = {\n\t\tinputResponses: InputResponsesSchema.optional(),\n\t\trequestState: z.string().optional()\n\t};\n\t/** Anchor InputResponseRequestParams: the retry channel on top of the required request `_meta` envelope. */\n\tconst InputResponseRequestParamsSchema = z.object({\n\t\t_meta: RequestMetaEnvelopeSchema,\n\t\t...retryParamsShape\n\t});\n\t/** Post-lift request `_meta` (progressToken + extension keys; loose). */\n\tconst DispatchRequestMetaSchema = z.looseObject({ progressToken: ProgressTokenSchema$1.optional() });\n\tfunction wireRequest(method, paramsShape) {\n\t\treturn z.object({\n\t\t\tmethod: z.literal(method),\n\t\t\tparams: z.object({\n\t\t\t\t_meta: RequestMetaEnvelopeSchema,\n\t\t\t\t...paramsShape\n\t\t\t})\n\t\t});\n\t}\n\tfunction dispatchRequest(method, paramsShape) {\n\t\treturn z.object({\n\t\t\tmethod: z.literal(method),\n\t\t\tparams: z.object({\n\t\t\t\t_meta: DispatchRequestMetaSchema.optional(),\n\t\t\t\t...paramsShape\n\t\t\t}).optional()\n\t\t});\n\t}\n\tconst callToolParamsShape = {\n\t\tname: z.string(),\n\t\targuments: z.record(z.string(), z.unknown()).optional(),\n\t\t...retryParamsShape\n\t};\n\tconst paginatedParamsShape = { cursor: CursorSchema$1.optional() };\n\tconst CallToolRequestSchema$1 = wireRequest(\"tools/call\", callToolParamsShape);\n\tconst ListToolsRequestSchema$1 = wireRequest(\"tools/list\", paginatedParamsShape);\n\tconst ListPromptsRequestSchema$1 = wireRequest(\"prompts/list\", paginatedParamsShape);\n\tconst GetPromptRequestSchema$1 = wireRequest(\"prompts/get\", {\n\t\tname: z.string(),\n\t\targuments: z.record(z.string(), z.string()).optional(),\n\t\t...retryParamsShape\n\t});\n\tconst ListResourcesRequestSchema$1 = wireRequest(\"resources/list\", paginatedParamsShape);\n\tconst ListResourceTemplatesRequestSchema$1 = wireRequest(\"resources/templates/list\", paginatedParamsShape);\n\tconst ReadResourceRequestSchema$1 = wireRequest(\"resources/read\", {\n\t\turi: z.string(),\n\t\t...retryParamsShape\n\t});\n\tconst completeParamsShape = {\n\t\tref: z.union([PromptReferenceSchema$1, ResourceTemplateReferenceSchema$1]),\n\t\targument: z.object({\n\t\t\tname: z.string(),\n\t\t\tvalue: z.string()\n\t\t}),\n\t\tcontext: z.object({ arguments: z.record(z.string(), z.string()).optional() }).optional()\n\t};\n\tconst CompleteRequestSchema$1 = wireRequest(\"completion/complete\", completeParamsShape);\n\tconst DiscoverRequestSchema$1 = wireRequest(\"server/discover\", {});\n\t/** Anchor SubscriptionFilter (2026-only). */\n\tconst SubscriptionFilterSchema$1 = z.object({\n\t\ttoolsListChanged: z.boolean().optional(),\n\t\tpromptsListChanged: z.boolean().optional(),\n\t\tresourcesListChanged: z.boolean().optional(),\n\t\tresourceSubscriptions: z.array(z.string()).optional()\n\t});\n\tconst subscriptionsListenParamsShape = { notifications: SubscriptionFilterSchema$1 };\n\tconst SubscriptionsListenRequestSchema$1 = wireRequest(\"subscriptions/listen\", subscriptionsListenParamsShape);\n\t/**\n\t* Anchor SubscriptionsListenResultMetaObject — required subscriptionId stamp on\n\t* the graceful-close result. Extends `ResultMetaObject` since spec PR\n\t* #3002 (composed, so the serverInfo key and its leniency stay single-sourced).\n\t*/\n\tconst SubscriptionsListenResultMetaSchema$1 = ResultMetaSchema.extend({ \"io.modelcontextprotocol/subscriptionId\": RequestIdSchema$1 });\n\t/**\n\t* Anchor SubscriptionsListenResult (2026-only). The empty `subscriptions/listen`\n\t* response signalling that the subscription has ended gracefully (server\n\t* shutdown). An abrupt transport close carries no response — the client treats\n\t* stream-close-without-result as a disconnect.\n\t*/\n\tconst SubscriptionsListenResultSchema$1 = z.looseObject({\n\t\t_meta: SubscriptionsListenResultMetaSchema$1,\n\t\tresultType: ResultTypeSchema.default(\"complete\")\n\t});\n\t/** Dispatch (post-lift) request schemas, keyed by method — registry-internal. */\n\tconst dispatchRequestSchemas = {\n\t\t\"tools/call\": dispatchRequest(\"tools/call\", callToolParamsShape),\n\t\t\"tools/list\": dispatchRequest(\"tools/list\", paginatedParamsShape),\n\t\t\"prompts/get\": dispatchRequest(\"prompts/get\", {\n\t\t\tname: z.string(),\n\t\t\targuments: z.record(z.string(), z.string()).optional()\n\t\t}),\n\t\t\"prompts/list\": dispatchRequest(\"prompts/list\", paginatedParamsShape),\n\t\t\"resources/list\": dispatchRequest(\"resources/list\", paginatedParamsShape),\n\t\t\"resources/templates/list\": dispatchRequest(\"resources/templates/list\", paginatedParamsShape),\n\t\t\"resources/read\": dispatchRequest(\"resources/read\", { uri: z.string() }),\n\t\t\"completion/complete\": dispatchRequest(\"completion/complete\", completeParamsShape),\n\t\t\"server/discover\": dispatchRequest(\"server/discover\", {}),\n\t\t\"subscriptions/listen\": dispatchRequest(\"subscriptions/listen\", subscriptionsListenParamsShape)\n\t};\n\t/** Dispatch (post-lift) result schemas, keyed by method — what the funnel\n\t* validates AFTER `decodeResult` consumed `resultType`. */\n\tfunction liftedResult(shape) {\n\t\treturn z.looseObject({\n\t\t\t_meta: wireMeta,\n\t\t\t...shape\n\t\t});\n\t}\n\tconst dispatchResultSchemas = {\n\t\t\"tools/call\": liftedResult({\n\t\t\tcontent: z.array(ContentBlockSchema$1),\n\t\t\tstructuredContent: z.unknown().optional(),\n\t\t\tisError: z.boolean().optional()\n\t\t}),\n\t\t\"tools/list\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\ttools: z.array(ToolSchema$1),\n\t\t\tnextCursor: CursorSchema$1.optional()\n\t\t}),\n\t\t\"prompts/get\": liftedResult({\n\t\t\tdescription: z.string().optional(),\n\t\t\tmessages: z.array(PromptMessageSchema$1)\n\t\t}),\n\t\t\"prompts/list\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\tprompts: z.array(PromptSchema$1),\n\t\t\tnextCursor: CursorSchema$1.optional()\n\t\t}),\n\t\t\"resources/list\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\tresources: z.array(ResourceSchema$1),\n\t\t\tnextCursor: CursorSchema$1.optional()\n\t\t}),\n\t\t\"resources/templates/list\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\tresourceTemplates: z.array(ResourceTemplateSchema$1),\n\t\t\tnextCursor: CursorSchema$1.optional()\n\t\t}),\n\t\t\"resources/read\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\tcontents: z.array(z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]))\n\t\t}),\n\t\t\"completion/complete\": liftedResult({ completion: z.object({\n\t\t\tvalues: z.array(z.string()).max(100),\n\t\t\ttotal: z.number().int().optional(),\n\t\t\thasMore: z.boolean().optional()\n\t\t}).loose() }),\n\t\t\"server/discover\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0).catch(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]).catch(\"private\"),\n\t\t\tsupportedVersions: z.array(z.string()),\n\t\t\tcapabilities: ServerCapabilities2026Schema,\n\t\t\tinstructions: z.string().optional()\n\t\t}),\n\t\t\"subscriptions/listen\": liftedResult({})\n\t};\n\t/**\n\t* Notification `_meta` (anchor `NotificationMetaObject`): loose, with the\n\t* subscriptions/listen demux key typed when present. Only the anchor-exact\n\t* SHAPE is modeled here — listen delivery itself (filter gating, demux,\n\t* teardown) is #14 scope and not implemented by this module.\n\t*/\n\tconst NotificationMetaSchema = z.looseObject({ \"io.modelcontextprotocol/subscriptionId\": RequestIdSchema$1.optional() });\n\t/** Anchor SubscriptionsAcknowledgedNotification (2026-only). */\n\tconst SubscriptionsAcknowledgedNotificationSchema$1 = z.object({\n\t\tmethod: z.literal(\"notifications/subscriptions/acknowledged\"),\n\t\tparams: z.object({\n\t\t\t_meta: NotificationMetaSchema.optional(),\n\t\t\tnotifications: SubscriptionFilterSchema$1\n\t\t})\n\t});\n\t/**\n\t* 2026-era `notifications/cancelled` params (anchor-exact fork): `requestId`\n\t* is REQUIRED on this revision — the shared schema keeps it optional because\n\t* the frozen 2025-11-25 shape declares it optional (task cancellation goes\n\t* through `tasks/cancel` there). Requiredness is bare because no 2025-era\n\t* traffic touches this module.\n\t*/\n\tconst CancelledNotificationParamsSchema$1 = z.object({\n\t\t_meta: NotificationMetaSchema.optional(),\n\t\trequestId: RequestIdSchema$1,\n\t\treason: z.string().optional()\n\t});\n\t/** 2026-era `notifications/cancelled` (see the params fork above). */\n\tconst CancelledNotificationSchema$1 = z.object({\n\t\tmethod: z.literal(\"notifications/cancelled\"),\n\t\tparams: CancelledNotificationParamsSchema$1\n\t});\n\tconst notificationSchemas2026 = {\n\t\t\"notifications/cancelled\": CancelledNotificationSchema$1,\n\t\t\"notifications/progress\": ProgressNotificationSchema$1,\n\t\t\"notifications/message\": LoggingMessageNotificationSchema$1,\n\t\t\"notifications/resources/updated\": ResourceUpdatedNotificationSchema$1,\n\t\t\"notifications/resources/list_changed\": ResourceListChangedNotificationSchema$1,\n\t\t\"notifications/tools/list_changed\": ToolListChangedNotificationSchema$1,\n\t\t\"notifications/prompts/list_changed\": PromptListChangedNotificationSchema$1,\n\t\t\"notifications/subscriptions/acknowledged\": SubscriptionsAcknowledgedNotificationSchema$1\n\t};\n\tconst wireResultResponse = (result) => z.object({\n\t\tjsonrpc: z.literal(\"2.0\"),\n\t\tid: z.union([z.string(), z.number().int()]),\n\t\tresult\n\t}).strict();\n\treturn {\n\t\tJSONValueSchema: JSONValueSchema$1,\n\t\tJSONObjectSchema: JSONObjectSchema$1,\n\t\tProgressTokenSchema: ProgressTokenSchema$1,\n\t\tCursorSchema: CursorSchema$1,\n\t\tRequestIdSchema: RequestIdSchema$1,\n\t\tRoleSchema: RoleSchema$1,\n\t\tLoggingLevelSchema: LoggingLevelSchema$1,\n\t\tTaskMetadataSchema: TaskMetadataSchema$1,\n\t\tRelatedTaskMetadataSchema: RelatedTaskMetadataSchema$1,\n\t\tRequestMetaSchema: RequestMetaSchema$1,\n\t\tBaseRequestParamsSchema: BaseRequestParamsSchema$1,\n\t\tTaskAugmentedRequestParamsSchema: TaskAugmentedRequestParamsSchema$1,\n\t\tNotificationsParamsSchema: NotificationsParamsSchema$1,\n\t\tNotificationSchema: NotificationSchema$1,\n\t\tIconSchema: IconSchema$1,\n\t\tIconsSchema: IconsSchema$1,\n\t\tBaseMetadataSchema: BaseMetadataSchema$1,\n\t\tImplementationSchema: ImplementationSchema$1,\n\t\tClientTasksCapabilitySchema: ClientTasksCapabilitySchema$1,\n\t\tServerTasksCapabilitySchema: ServerTasksCapabilitySchema$1,\n\t\tClientCapabilitiesSchema: ClientCapabilitiesSchema$1,\n\t\tServerCapabilitiesSchema: ServerCapabilitiesSchema$1,\n\t\tProgressSchema: ProgressSchema$1,\n\t\tProgressNotificationParamsSchema: ProgressNotificationParamsSchema$1,\n\t\tProgressNotificationSchema: ProgressNotificationSchema$1,\n\t\tLoggingMessageNotificationParamsSchema: LoggingMessageNotificationParamsSchema$1,\n\t\tLoggingMessageNotificationSchema: LoggingMessageNotificationSchema$1,\n\t\tResourceContentsSchema: ResourceContentsSchema$1,\n\t\tTextResourceContentsSchema: TextResourceContentsSchema$1,\n\t\tBlobResourceContentsSchema: BlobResourceContentsSchema$1,\n\t\tAnnotationsSchema: AnnotationsSchema$1,\n\t\tResourceSchema: ResourceSchema$1,\n\t\tResourceTemplateSchema: ResourceTemplateSchema$1,\n\t\tResourceListChangedNotificationSchema: ResourceListChangedNotificationSchema$1,\n\t\tResourceUpdatedNotificationParamsSchema: ResourceUpdatedNotificationParamsSchema$1,\n\t\tResourceUpdatedNotificationSchema: ResourceUpdatedNotificationSchema$1,\n\t\tPromptArgumentSchema: PromptArgumentSchema$1,\n\t\tPromptSchema: PromptSchema$1,\n\t\tPromptListChangedNotificationSchema: PromptListChangedNotificationSchema$1,\n\t\tTextContentSchema: TextContentSchema$1,\n\t\tImageContentSchema: ImageContentSchema$1,\n\t\tAudioContentSchema: AudioContentSchema$1,\n\t\tToolUseContentSchema: ToolUseContentSchema$1,\n\t\tEmbeddedResourceSchema: EmbeddedResourceSchema$1,\n\t\tResourceLinkSchema: ResourceLinkSchema$1,\n\t\tContentBlockSchema: ContentBlockSchema$1,\n\t\tPromptMessageSchema: PromptMessageSchema$1,\n\t\tToolAnnotationsSchema: ToolAnnotationsSchema$1,\n\t\tToolListChangedNotificationSchema: ToolListChangedNotificationSchema$1,\n\t\tModelHintSchema: ModelHintSchema$1,\n\t\tModelPreferencesSchema: ModelPreferencesSchema$1,\n\t\tToolChoiceSchema: ToolChoiceSchema$1,\n\t\tBooleanSchemaSchema: BooleanSchemaSchema$1,\n\t\tStringSchemaSchema: StringSchemaSchema$1,\n\t\tNumberSchemaSchema: NumberSchemaSchema$1,\n\t\tUntitledSingleSelectEnumSchemaSchema: UntitledSingleSelectEnumSchemaSchema$1,\n\t\tTitledSingleSelectEnumSchemaSchema: TitledSingleSelectEnumSchemaSchema$1,\n\t\tLegacyTitledEnumSchemaSchema: LegacyTitledEnumSchemaSchema$1,\n\t\tSingleSelectEnumSchemaSchema: SingleSelectEnumSchemaSchema$1,\n\t\tUntitledMultiSelectEnumSchemaSchema: UntitledMultiSelectEnumSchemaSchema$1,\n\t\tTitledMultiSelectEnumSchemaSchema: TitledMultiSelectEnumSchemaSchema$1,\n\t\tMultiSelectEnumSchemaSchema: MultiSelectEnumSchemaSchema$1,\n\t\tEnumSchemaSchema: EnumSchemaSchema$1,\n\t\tPrimitiveSchemaDefinitionSchema: PrimitiveSchemaDefinitionSchema$1,\n\t\tElicitRequestFormParamsSchema: ElicitRequestFormParamsSchema$1,\n\t\tResourceTemplateReferenceSchema: ResourceTemplateReferenceSchema$1,\n\t\tPromptReferenceSchema: PromptReferenceSchema$1,\n\t\tRootSchema: RootSchema$1,\n\t\tClientCapabilities2026Schema,\n\t\tServerCapabilities2026Schema,\n\t\tRequestMetaEnvelopeSchema,\n\t\tToolSchema: ToolSchema$1,\n\t\tToolResultContentSchema: ToolResultContentSchema$1,\n\t\tSamplingMessageContentBlockSchema: SamplingMessageContentBlockSchema$1,\n\t\tSamplingMessageSchema: SamplingMessageSchema$1,\n\t\tResultTypeSchema,\n\t\tResultMetaSchema,\n\t\tResultSchema: ResultSchema$1,\n\t\tPaginatedResultSchema: PaginatedResultSchema$1,\n\t\tCallToolResultSchema: CallToolResultSchema$1,\n\t\tListToolsResultSchema: ListToolsResultSchema$1,\n\t\tListPromptsResultSchema: ListPromptsResultSchema$1,\n\t\tGetPromptResultSchema: GetPromptResultSchema$1,\n\t\tListResourcesResultSchema: ListResourcesResultSchema$1,\n\t\tListResourceTemplatesResultSchema: ListResourceTemplatesResultSchema$1,\n\t\tReadResourceResultSchema: ReadResourceResultSchema$1,\n\t\tCompleteResultSchema: CompleteResultSchema$1,\n\t\tCacheableResultSchema,\n\t\tDiscoverResultSchema: DiscoverResultSchema$1,\n\t\tCreateMessageRequestParamsSchema: CreateMessageRequestParamsSchema$1,\n\t\tCreateMessageRequestSchema: CreateMessageRequestSchema$1,\n\t\tListRootsRequestSchema: ListRootsRequestSchema$1,\n\t\tCreateMessageResultSchema: CreateMessageResultSchema$1,\n\t\tListRootsResultSchema: ListRootsResultSchema$1,\n\t\tElicitResultSchema: ElicitResultSchema$1,\n\t\tElicitRequestURLParamsSchema: ElicitRequestURLParamsSchema$1,\n\t\tElicitRequestParamsSchema: ElicitRequestParamsSchema$1,\n\t\tElicitRequestSchema: ElicitRequestSchema$1,\n\t\tInputRequestSchema,\n\t\tInputResponseSchema,\n\t\tInputRequestsSchema,\n\t\tInputResponsesSchema,\n\t\tInputRequiredResultSchema,\n\t\tInputResponseRequestParamsSchema,\n\t\tCallToolRequestSchema: CallToolRequestSchema$1,\n\t\tListToolsRequestSchema: ListToolsRequestSchema$1,\n\t\tListPromptsRequestSchema: ListPromptsRequestSchema$1,\n\t\tGetPromptRequestSchema: GetPromptRequestSchema$1,\n\t\tListResourcesRequestSchema: ListResourcesRequestSchema$1,\n\t\tListResourceTemplatesRequestSchema: ListResourceTemplatesRequestSchema$1,\n\t\tReadResourceRequestSchema: ReadResourceRequestSchema$1,\n\t\tCompleteRequestSchema: CompleteRequestSchema$1,\n\t\tDiscoverRequestSchema: DiscoverRequestSchema$1,\n\t\tSubscriptionFilterSchema: SubscriptionFilterSchema$1,\n\t\tSubscriptionsListenRequestSchema: SubscriptionsListenRequestSchema$1,\n\t\tSubscriptionsListenResultMetaSchema: SubscriptionsListenResultMetaSchema$1,\n\t\tSubscriptionsListenResultSchema: SubscriptionsListenResultSchema$1,\n\t\tdispatchRequestSchemas,\n\t\tdispatchResultSchemas,\n\t\tNotificationMetaSchema,\n\t\tSubscriptionsAcknowledgedNotificationSchema: SubscriptionsAcknowledgedNotificationSchema$1,\n\t\tCancelledNotificationParamsSchema: CancelledNotificationParamsSchema$1,\n\t\tCancelledNotificationSchema: CancelledNotificationSchema$1,\n\t\tnotificationSchemas2026,\n\t\tJSONRPCResultResponseSchema: wireResultResponse(ResultSchema$1),\n\t\tCallToolResultResponseSchema: wireResultResponse(z.union([CallToolResultSchema$1, InputRequiredResultSchema])),\n\t\tListToolsResultResponseSchema: wireResultResponse(ListToolsResultSchema$1),\n\t\tListPromptsResultResponseSchema: wireResultResponse(ListPromptsResultSchema$1),\n\t\tGetPromptResultResponseSchema: wireResultResponse(z.union([GetPromptResultSchema$1, InputRequiredResultSchema])),\n\t\tListResourcesResultResponseSchema: wireResultResponse(ListResourcesResultSchema$1),\n\t\tListResourceTemplatesResultResponseSchema: wireResultResponse(ListResourceTemplatesResultSchema$1),\n\t\tReadResourceResultResponseSchema: wireResultResponse(z.union([ReadResourceResultSchema$1, InputRequiredResultSchema])),\n\t\tCompleteResultResponseSchema: wireResultResponse(CompleteResultSchema$1),\n\t\tDiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1),\n\t\tSubscriptionsListenResultResponseSchema: wireResultResponse(SubscriptionsListenResultSchema$1)\n\t};\n}\nlet memo;\n/**\n* Builds the era wire-schema set on first call and returns the same object\n* thereafter. Module evaluation stays construction-free so importing the\n* era codec/registry costs nothing until the first validation actually\n* needs a schema; the registry, the codec, and the eager `schemas.ts`\n* shim all pull through this memo, so reference identity holds across\n* every consumer.\n*/\nfunction buildSchemas2026() {\n\treturn memo ??= build();\n}\n\n//#endregion\n//#region ../core-internal/src/shared/resultCacheHints.ts\n/**\n* The operations whose results are cacheable on the 2026-07-28 revision (the\n* `CacheableResult` extenders). This list is closed: no other operation's\n* result ever receives cache fields from the SDK.\n*/\nconst CACHEABLE_RESULT_METHODS = [\n\t\"tools/list\",\n\t\"prompts/list\",\n\t\"resources/list\",\n\t\"resources/templates/list\",\n\t\"resources/read\",\n\t\"server/discover\"\n];\n/** Whether the given method's result is cacheable on the 2026-07-28 revision. */\nfunction isCacheableResultMethod(method) {\n\treturn CACHEABLE_RESULT_METHODS.includes(method);\n}\n/**\n* The symbol-keyed carrier for a configured cache hint on a result object.\n* Symbol properties are invisible to JSON serialization, so the carrier can be\n* attached era-blind: only the 2026-era encode seam consumes it.\n*/\nconst RESULT_CACHE_HINT_FALLBACK = Symbol(\"modelcontextprotocol.resultCacheHintFallback\");\n/**\n* Attaches a configured cache hint to a result as the encode-time fallback.\n* Returns the result unchanged when there is nothing to attach. When a more\n* specific hint is already attached, the two hints are combined per field\n* (most-specific-author-wins for each of `ttlMs` and `cacheScope`): the\n* per-registration hint attached by the feature layer keeps every field it\n* sets, and the server-level per-operation hint only fills the fields the\n* more specific hint leaves unset.\n*/\nfunction attachCacheHintFallback(result, hint) {\n\tif (hint === void 0) return result;\n\tconst attached = result[RESULT_CACHE_HINT_FALLBACK];\n\tif (attached === void 0) return {\n\t\t...result,\n\t\t[RESULT_CACHE_HINT_FALLBACK]: hint\n\t};\n\tconst merged = {};\n\tconst ttlMs = attached.ttlMs ?? hint.ttlMs;\n\tif (ttlMs !== void 0) merged.ttlMs = ttlMs;\n\tconst cacheScope = attached.cacheScope ?? hint.cacheScope;\n\tif (cacheScope !== void 0) merged.cacheScope = cacheScope;\n\treturn {\n\t\t...result,\n\t\t[RESULT_CACHE_HINT_FALLBACK]: merged\n\t};\n}\n/** Reads the configured cache-hint fallback attached to a result, if any. */\nfunction cacheHintFallbackOf(result) {\n\treturn result[RESULT_CACHE_HINT_FALLBACK];\n}\n/**\n* Whether a value is a valid `ttlMs`: a non-negative safe integer. Safe\n* integers are required because the wire schemas validate `ttlMs` as an\n* integer within `Number.MIN_SAFE_INTEGER`/`Number.MAX_SAFE_INTEGER`; a value\n* outside that range is treated as invalid here so it falls through to the\n* next author instead of being emitted and rejected downstream.\n*/\nfunction isValidCacheTtlMs(value) {\n\treturn typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0;\n}\n/** Whether a value is a valid `cacheScope`. */\nfunction isValidCacheScope(value) {\n\treturn value === \"public\" || value === \"private\";\n}\n/**\n* Validates a configured cache hint at configuration time. Throws a\n* `RangeError` naming the offending field, so misconfiguration fails at\n* startup/registration rather than silently degrading at encode time.\n*/\nfunction assertValidCacheHint(hint, context) {\n\tif (hint.ttlMs !== void 0 && !isValidCacheTtlMs(hint.ttlMs)) throw new RangeError(`Invalid cache hint for ${context}: ttlMs must be a non-negative safe integer (got ${String(hint.ttlMs)})`);\n\tif (hint.cacheScope !== void 0 && !isValidCacheScope(hint.cacheScope)) throw new RangeError(`Invalid cache hint for ${context}: cacheScope must be 'public' or 'private' (got ${String(hint.cacheScope)})`);\n}\n\n//#endregion\n//#region ../core-internal/src/types/enums.ts\n/**\n* Error codes for protocol errors that cross the wire as JSON-RPC error responses.\n* These follow the JSON-RPC specification and MCP-specific extensions.\n*/\nlet ProtocolErrorCode = /* @__PURE__ */ function(ProtocolErrorCode$1) {\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"ParseError\"] = -32700] = \"ParseError\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"InvalidRequest\"] = -32600] = \"InvalidRequest\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"MethodNotFound\"] = -32601] = \"MethodNotFound\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"InvalidParams\"] = -32602] = \"InvalidParams\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"InternalError\"] = -32603] = \"InternalError\";\n\t/**\n\t* Resource not found.\n\t*\n\t* Receive-tolerated only: the SDK never EMITS `-32002` — `resources/read`\n\t* misses answer `-32602` (Invalid Params) on every protocol revision per\n\t* the 2026-07-28 spec MUST, and a handler-thrown `-32002` is mapped to\n\t* `-32602` at the era encode seam. The member stays importable so clients\n\t* can recognise `-32002` from peers built on earlier SDK releases (the\n\t* spec's \"clients SHOULD also accept `-32002`\" backwards-compatibility\n\t* clause). Throw `ResourceNotFoundError` instead.\n\t*/\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"ResourceNotFound\"] = -32002] = \"ResourceNotFound\";\n\t/**\n\t* Processing the request requires a capability the client did not declare\n\t* in the request's `clientCapabilities` (protocol revision 2026-07-28).\n\t*/\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"MissingRequiredClientCapability\"] = -32021] = \"MissingRequiredClientCapability\";\n\t/**\n\t* The request's protocol version is unknown to the server or unsupported\n\t* by it (protocol revision 2026-07-28).\n\t*/\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"UnsupportedProtocolVersion\"] = -32022] = \"UnsupportedProtocolVersion\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"UrlElicitationRequired\"] = -32042] = \"UrlElicitationRequired\";\n\treturn ProtocolErrorCode$1;\n}({});\n\n//#endregion\n//#region ../core-internal/src/types/errors.ts\n/**\n* Protocol errors are JSON-RPC errors that cross the wire as error responses.\n* They use numeric error codes from the {@linkcode ProtocolErrorCode} enum.\n*\n* `instanceof` on this class (and its subclasses) is brand-matched, so it works\n* across separately bundled copies of the SDK — e.g. an error constructed by\n* `@modelcontextprotocol/client` matches the class re-exported by\n* `@modelcontextprotocol/server` in the same process.\n*/\nvar ProtocolError = class ProtocolError extends Error {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.ProtocolError\" });\n\t}\n\tstatic [Symbol.hasInstance](value) {\n\t\treturn brandedHasInstance(this, value);\n\t}\n\t/**\n\t* Brand-based type guard: equivalent to `value instanceof this`, as an\n\t* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads\n\t* the caller's own brand via `this`, so every branded subclass gets a\n\t* correctly-scoped guard by inheritance. Must be invoked on the class —\n\t* in callback position write `v => SdkError.isInstance(v)`, not\n\t* `.filter(SdkError.isInstance)` (detached calls throw rather than\n\t* silently matching nothing).\n\t*/\n\tstatic isInstance(value) {\n\t\tif (typeof this !== \"function\") throw new TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");\n\t\treturn brandedHasInstance(this, value);\n\t}\n\tconstructor(code, message, data) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.data = data;\n\t\tthis.name = \"ProtocolError\";\n\t\tstampErrorBrands(this, new.target);\n\t}\n\t/**\n\t* Factory method to create the appropriate error type based on the error code and data\n\t*/\n\tstatic fromError(code, message, data) {\n\t\tif (code === ProtocolErrorCode.UrlElicitationRequired && data) {\n\t\t\tconst errorData = data;\n\t\t\tif (errorData.elicitations) return new UrlElicitationRequiredError(errorData.elicitations, message);\n\t\t}\n\t\tif (code === ProtocolErrorCode.UnsupportedProtocolVersion && data) {\n\t\t\tconst errorData = data;\n\t\t\tif (Array.isArray(errorData.supported) && typeof errorData.requested === \"string\") return new UnsupportedProtocolVersionError({\n\t\t\t\tsupported: errorData.supported,\n\t\t\t\trequested: errorData.requested\n\t\t\t}, message);\n\t\t}\n\t\tif (code === ProtocolErrorCode.InvalidParams || code === ProtocolErrorCode.ResourceNotFound) {\n\t\t\tconst errorData = data;\n\t\t\tif (typeof errorData?.uri === \"string\" && (code === ProtocolErrorCode.ResourceNotFound || Object.keys(errorData).length === 1)) return new ResourceNotFoundError(errorData.uri, message);\n\t\t}\n\t\tif (code === ProtocolErrorCode.MissingRequiredClientCapability && data) {\n\t\t\tconst errorData = data;\n\t\t\tif (errorData.requiredCapabilities !== null && typeof errorData.requiredCapabilities === \"object\" && !Array.isArray(errorData.requiredCapabilities)) return new MissingRequiredClientCapabilityError({ requiredCapabilities: errorData.requiredCapabilities }, message);\n\t\t}\n\t\treturn new ProtocolError(code, message, data);\n\t}\n};\n/**\n* Error type for a `resources/read` miss: the requested resource does not\n* exist. The wire code is `-32602` (Invalid Params) on every protocol\n* revision — the spec MUST for revision 2026-07-28, and the value the v1.x\n* SDK has always emitted on earlier revisions. The error data echoes the\n* requested URI.\n*\n* Recognise this error by checking `error.data` is exactly `{ uri: string }`\n* (a `-32602` whose data carries `uri` and nothing else is resource-not-found;\n* any other `-32602` is an ordinary Invalid Params). For backwards compatibility, clients should also\n* accept `-32002` as resource not found — earlier SDK builds emitted that\n* code, and {@linkcode ProtocolError.fromError} reconstructs this class for\n* either code **when `error.data` carries `uri`** (a bare `-32002` without\n* `data.uri` stays a generic {@linkcode ProtocolError}). `instanceof` checks\n* are brand-matched and work across separately bundled copies of the SDK.\n*/\nvar ResourceNotFoundError = class extends ProtocolError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.ResourceNotFoundError\" });\n\t}\n\tconstructor(uri, message = `Resource not found: ${uri}`) {\n\t\tsuper(ProtocolErrorCode.InvalidParams, message, { uri });\n\t}\n\t/** The URI that was requested and not found. */\n\tget uri() {\n\t\treturn this.data.uri;\n\t}\n};\n/**\n* Specialized error type when a tool requires a URL mode elicitation.\n* This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.\n*/\nvar UrlElicitationRequiredError = class extends ProtocolError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.UrlElicitationRequiredError\" });\n\t}\n\tconstructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? \"s\" : \"\"} required`) {\n\t\tsuper(ProtocolErrorCode.UrlElicitationRequired, message, { elicitations });\n\t}\n\tget elicitations() {\n\t\treturn this.data?.elicitations ?? [];\n\t}\n};\n/**\n* Error type for the `-32022` UnsupportedProtocolVersion protocol error (protocol\n* revision 2026-07-28): the request's protocol version is unknown to the server or\n* unsupported by it.\n*\n* The error data lists the protocol versions the receiver supports (`supported`),\n* so the sender can choose a mutually supported version and retry, and echoes the\n* version that was requested (`requested`).\n*/\nvar UnsupportedProtocolVersionError = class extends ProtocolError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.UnsupportedProtocolVersionError\" });\n\t}\n\tconstructor(data, message = `Unsupported protocol version: ${data.requested}`) {\n\t\tsuper(ProtocolErrorCode.UnsupportedProtocolVersion, message, data);\n\t}\n\t/**\n\t* Protocol versions the receiver supports.\n\t*/\n\tget supported() {\n\t\treturn this.data.supported;\n\t}\n\t/**\n\t* The protocol version that was requested.\n\t*/\n\tget requested() {\n\t\treturn this.data.requested;\n\t}\n};\n/**\n* Error type for the `-32021` MissingRequiredClientCapability protocol error\n* (protocol revision 2026-07-28): processing the request requires a capability\n* the client did not declare in the request's `clientCapabilities`.\n*\n* The error data lists the missing capabilities (`requiredCapabilities`) in\n* the `ClientCapabilities` shape, so the client can see exactly what it would\n* have to declare for the request to be served. On HTTP, the response status\n* is `400 Bad Request`.\n*\n* Recognize this error by its code and `data.requiredCapabilities`, or by\n* `instanceof` — checks are brand-matched and work across separately bundled\n* copies of the SDK.\n*/\nvar MissingRequiredClientCapabilityError = class extends ProtocolError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.MissingRequiredClientCapabilityError\" });\n\t}\n\tconstructor(data, message = `Missing required client capabilities: ${Object.keys(data.requiredCapabilities).join(\", \")}`) {\n\t\tsuper(ProtocolErrorCode.MissingRequiredClientCapability, message, data);\n\t}\n\t/**\n\t* The capabilities the server requires from the client to process the\n\t* request (only the missing capabilities are listed).\n\t*/\n\tget requiredCapabilities() {\n\t\treturn this.data.requiredCapabilities;\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/encodeContract.ts\n/** The default cache policy when neither the handler nor configuration provides one. */\nconst DEFAULT_CACHE_TTL_MS = 0;\nconst DEFAULT_CACHE_SCOPE = \"private\";\n/**\n* Request methods whose spec result vocabulary goes beyond `'complete'` on the\n* 2026-07-28 revision: their results may be `input_required` (multi\n* round-trip requests), so a handler-provided `resultType` passes through the\n* stamp untouched. `subscriptions/listen` is NOT in this set: it never emits\n* a JSON-RPC result — termination is stream close (HTTP) or\n* `notifications/cancelled` (stdio) per the spec.\n*/\nconst EXTENDED_RESULT_TYPE_METHODS = [\n\t\"tools/call\",\n\t\"prompts/get\",\n\t\"resources/read\"\n];\n/**\n* Step 1 of the encode contract: ensure the outbound result carries the\n* required `resultType` discriminator.\n*\n* - No handler-provided value → stamp `'complete'`.\n* - Handler-provided `'complete'` → kept as-is.\n* - Handler-provided non-`'complete'` value on a method whose vocabulary\n*   allows it ({@linkcode EXTENDED_RESULT_TYPE_METHODS}) → passes through.\n*   The value is forwarded verbatim — the wire vocabulary is an open union and\n*   the SDK does not validate the string, so emitting a `resultType` the\n*   negotiated revision does not define is the handler author's\n*   responsibility.\n* - Handler-provided non-`'complete'` value on any other method → internal\n*   error (loud): the value would be mis-typed on the wire, and silently\n*   rewriting it would hide a server bug.\n*/\nfunction stampResultType(method, result) {\n\tconst provided = result[\"resultType\"];\n\tif (provided === void 0) return {\n\t\t...result,\n\t\tresultType: \"complete\"\n\t};\n\tif (provided === \"complete\") return result;\n\tif (EXTENDED_RESULT_TYPE_METHODS.includes(method)) return result;\n\tthrow new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned resultType '${String(provided)}', but results of ${method} only support 'complete' on protocol revision 2026-07-28`);\n}\n/**\n* Step 2 of the encode contract: fill the required `ttlMs`/`cacheScope` fields\n* on cacheable results.\n*\n* Applies only when the (post-stamp) `resultType` is `'complete'` and the\n* method is one of the cacheable operations; everything else is returned\n* untouched apart from removing the configured-hint carrier. Field resolution\n* is per field, most specific author first: a valid handler-returned value,\n* then the configured cache hint attached by the server layer, then the\n* defaults. Handler-returned values are validated at encode time (`ttlMs`\n* must be a non-negative integer, `cacheScope` must be `'public'` or\n* `'private'`); invalid values are ignored rather than emitted.\n*/\nfunction fillCacheFields(method, result) {\n\tconst fallback = cacheHintFallbackOf(result);\n\tif (result[\"resultType\"] !== \"complete\" || !isCacheableResultMethod(method)) return fallback === void 0 ? result : stripCacheHintFallback(result);\n\tconst provided = result;\n\tconst ttlMs = isValidCacheTtlMs(provided[\"ttlMs\"]) ? provided[\"ttlMs\"] : resolveTtlMs(fallback);\n\tconst cacheScope = isValidCacheScope(provided[\"cacheScope\"]) ? provided[\"cacheScope\"] : resolveCacheScope(fallback);\n\tconst filled = {\n\t\t...provided,\n\t\tttlMs,\n\t\tcacheScope\n\t};\n\tdelete filled[RESULT_CACHE_HINT_FALLBACK];\n\treturn filled;\n}\nfunction isPlainObject$5(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/**\n* Step 3 of the encode contract: stamp the server's identity into the\n* result's `_meta` under `io.modelcontextprotocol/serverInfo` (spec PR #3002:\n* servers SHOULD include it on every response).\n*\n* - No `serverInfo` supplied (a client instance, or a hand-constructed\n*   protocol object) → identity function.\n* - The result's `_meta` already carries the key → kept as-is (the handler\n*   is the more specific author; mirrors the cache-fill resolution order).\n* - A present-but-non-object `_meta` (a dynamic-caller bug) → kept as-is:\n*   the stamp never rewrites handler material, and the malformed value fails\n*   loudly at the peer instead of being silently replaced here.\n* - Otherwise → the key is added, preserving any other `_meta` entries.\n*\n* Runs for every result regardless of `resultType`: the anchor types\n* `Result._meta` as `ResultMetaObject` on all results, `input_required`\n* included.\n*/\nfunction stampServerInfoMeta(result, serverInfo) {\n\tif (serverInfo === void 0) return result;\n\tconst meta = result[\"_meta\"];\n\tif (meta === void 0) return {\n\t\t...result,\n\t\t_meta: { [SERVER_INFO_META_KEY]: serverInfo }\n\t};\n\tif (!isPlainObject$5(meta)) return result;\n\tif (meta[SERVER_INFO_META_KEY] !== void 0) return result;\n\treturn {\n\t\t...result,\n\t\t_meta: {\n\t\t\t...meta,\n\t\t\t[SERVER_INFO_META_KEY]: serverInfo\n\t\t}\n\t};\n}\nfunction resolveTtlMs(fallback) {\n\treturn fallback !== void 0 && isValidCacheTtlMs(fallback.ttlMs) ? fallback.ttlMs : DEFAULT_CACHE_TTL_MS;\n}\nfunction resolveCacheScope(fallback) {\n\treturn fallback !== void 0 && isValidCacheScope(fallback.cacheScope) ? fallback.cacheScope : DEFAULT_CACHE_SCOPE;\n}\nfunction stripCacheHintFallback(result) {\n\tconst copy = { ...result };\n\tdelete copy[RESULT_CACHE_HINT_FALLBACK];\n\treturn copy;\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/inputRequired.ts\n/**\n* In-band input-request vocabulary of the 2026-07-28 revision (SEP-2322\n* multi round-trip requests), dispatch view.\n*\n* The three former server→client wire requests (`elicitation/create`,\n* `sampling/createMessage`, `roots/list`) are NOT wire request methods on\n* this revision — they are demoted to de-JSON-RPC'd payloads embedded in an\n* `input_required` result. The multi-round-trip driver dispatches those\n* embedded payloads to the client's registered handlers through the normal\n* handler machinery, and these are the schemas that dispatch parses them\n* with: lenient where the anchor's wire-true artifacts are strict (an\n* embedded request never carries the per-request `_meta` envelope), exact\n* where the vocabulary forks (the sampling shapes compose the forked\n* SamplingMessage/Tool payloads).\n*\n* Registry membership is intentionally NOT granted here — these methods stay\n* absent from the 2026-era request registry (a peer sending one as a wire\n* request still gets −32601 by absence). Only the codec's\n* `inputRequestSchema`/`inputResponseSchema` accessors expose them.\n*/\n/** The embedded input-request methods of the 2026-07-28 revision. */\nconst INPUT_REQUEST_METHODS_2026 = [\n\t\"elicitation/create\",\n\t\"sampling/createMessage\",\n\t\"roots/list\"\n];\nlet maps;\nfunction inputSchemaMaps() {\n\tif (maps) return maps;\n\tconst s = buildSchemas2026();\n\tmaps = {\n\t\trequest: {\n\t\t\t\"elicitation/create\": z.object({\n\t\t\t\tmethod: z.literal(\"elicitation/create\"),\n\t\t\t\tparams: s.ElicitRequestParamsSchema\n\t\t\t}),\n\t\t\t\"sampling/createMessage\": z.object({\n\t\t\t\tmethod: z.literal(\"sampling/createMessage\"),\n\t\t\t\tparams: s.CreateMessageRequestParamsSchema\n\t\t\t}),\n\t\t\t\"roots/list\": z.object({\n\t\t\t\tmethod: z.literal(\"roots/list\"),\n\t\t\t\tparams: z.looseObject({}).optional()\n\t\t\t})\n\t\t},\n\t\tresponse: {\n\t\t\t\"elicitation/create\": s.ElicitResultSchema,\n\t\t\t\"sampling/createMessage\": s.CreateMessageResultSchema,\n\t\t\t\"roots/list\": s.ListRootsResultSchema\n\t\t}\n\t};\n\treturn maps;\n}\n/**\n* Forces the lazy embedded-request maps (and, through them, the era's schema\n* memo). Warm-up hook for `preloadSchemas()` — no-op once the maps exist.\n*/\nfunction warmInputSchemaMaps2026() {\n\tinputSchemaMaps();\n}\nfunction isInputRequestMethod2026(method) {\n\treturn INPUT_REQUEST_METHODS_2026.includes(method);\n}\nfunction getInputRequestSchema2026(method) {\n\treturn isInputRequestMethod2026(method) ? inputSchemaMaps().request[method] : void 0;\n}\nfunction getInputResponseSchema2026(method) {\n\treturn isInputRequestMethod2026(method) ? inputSchemaMaps().response[method] : void 0;\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/registry.ts\nconst requestMethodKeys = {\n\t\"tools/call\": null,\n\t\"tools/list\": null,\n\t\"prompts/get\": null,\n\t\"prompts/list\": null,\n\t\"resources/list\": null,\n\t\"resources/templates/list\": null,\n\t\"resources/read\": null,\n\t\"completion/complete\": null,\n\t\"server/discover\": null,\n\t\"subscriptions/listen\": null\n};\nconst notificationMethodKeys = {\n\t\"notifications/cancelled\": null,\n\t\"notifications/progress\": null,\n\t\"notifications/message\": null,\n\t\"notifications/resources/updated\": null,\n\t\"notifications/resources/list_changed\": null,\n\t\"notifications/tools/list_changed\": null,\n\t\"notifications/prompts/list_changed\": null,\n\t\"notifications/subscriptions/acknowledged\": null\n};\n/** The 2026-era request-method set (registry membership = the deletion story). */\nfunction hasRequestMethod2026(method) {\n\treturn Object.prototype.hasOwnProperty.call(requestMethodKeys, method);\n}\n/** The 2026-era notification-method set. */\nfunction hasNotificationMethod2026(method) {\n\treturn Object.prototype.hasOwnProperty.call(notificationMethodKeys, method);\n}\n/** Result-map membership (same key set as the request map on this era). */\nfunction hasResultMethod2026(method) {\n\treturn Object.prototype.hasOwnProperty.call(requestMethodKeys, method);\n}\nfunction getRequestSchema2026(method) {\n\treturn hasRequestMethod2026(method) ? buildSchemas2026().dispatchRequestSchemas[method] : void 0;\n}\nfunction getResultSchema2026(method) {\n\treturn hasResultMethod2026(method) ? buildSchemas2026().dispatchResultSchemas[method] : void 0;\n}\nfunction getNotificationSchema2026(method) {\n\treturn hasNotificationMethod2026(method) ? buildSchemas2026().notificationSchemas2026[method] : void 0;\n}\n/** Registry method lists (for the spec-method universe and the CI registry-diff oracle). */\nconst rev2026RequestMethods = Object.keys(requestMethodKeys);\nconst rev2026NotificationMethods = Object.keys(notificationMethodKeys);\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/codec.ts\nfunction isPlainObject$4(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/** Tri-state wrap of an optional Zod schema lookup (the function-only contract). */\nfunction triState(schema, raw) {\n\tif (schema === void 0) return {\n\t\tok: false,\n\t\treason: \"not-in-era\"\n\t};\n\tconst parsed = schema.safeParse(raw);\n\treturn parsed.success ? {\n\t\tok: true,\n\t\tvalue: parsed.data\n\t} : {\n\t\tok: false,\n\t\treason: \"invalid\",\n\t\tmessage: String(parsed.error)\n\t};\n}\nconst NOT_IN_ERA = {\n\tok: false,\n\treason: \"not-in-era\"\n};\n/**\n* The reserved `_meta` keys an envelope must carry on this era (in reporting\n* order). `clientInfo` is NOT here: spec PR #3002 demoted it to SHOULD, so a\n* request without it is accepted (a present-but-malformed value still fails\n* the envelope schema parse below).\n*/\nconst REQUIRED_ENVELOPE_KEYS = [PROTOCOL_VERSION_META_KEY, CLIENT_CAPABILITIES_META_KEY];\n/** Strip the known deleted-field set from an outbound result (Q1-SD3 iii). */\nfunction enforceDeletedFields(method, result) {\n\tlet next = result;\n\tlet copied = false;\n\tconst copy = () => {\n\t\tif (!copied) {\n\t\t\tnext = { ...next };\n\t\t\tcopied = true;\n\t\t}\n\t\treturn next;\n\t};\n\tconst tools = result.tools;\n\tif (method === \"tools/list\" && Array.isArray(tools) && tools.some((tool) => isPlainObject$4(tool) && \"execution\" in tool)) copy().tools = tools.map((tool) => {\n\t\tif (!isPlainObject$4(tool) || !(\"execution\" in tool)) return tool;\n\t\tconst rest = { ...tool };\n\t\tdelete rest[\"execution\"];\n\t\treturn rest;\n\t});\n\tconst capabilities = result.capabilities;\n\tif (isPlainObject$4(capabilities) && \"tasks\" in capabilities) {\n\t\tconst rest = { ...capabilities };\n\t\tdelete rest[\"tasks\"];\n\t\tcopy().capabilities = rest;\n\t}\n\treturn next;\n}\nconst rev2026Codec = {\n\tera: \"2026-07-28\",\n\thasRequestMethod: hasRequestMethod2026,\n\thasNotificationMethod: hasNotificationMethod2026,\n\thasInputRequestMethod: (method) => getInputRequestSchema2026(method) !== void 0,\n\tvalidateRequest: (method, raw) => triState(getRequestSchema2026(method), raw),\n\tvalidateResult: (method, raw) => triState(getResultSchema2026(method), raw),\n\tvalidateNotification: (method, raw) => triState(getNotificationSchema2026(method), raw),\n\tvalidateInputRequest: (method, raw) => triState(getInputRequestSchema2026(method), raw),\n\tvalidateInputResponse: (method, raw) => triState(getInputResponseSchema2026(method), raw),\n\tsamplingResultVariant: () => NOT_IN_ERA,\n\toutboundEnvelope(material) {\n\t\treturn {\n\t\t\t[PROTOCOL_VERSION_META_KEY]: material.protocolVersion,\n\t\t\t[CLIENT_INFO_META_KEY]: material.clientInfo,\n\t\t\t[CLIENT_CAPABILITIES_META_KEY]: material.clientCapabilities,\n\t\t\t...material.logLevel !== void 0 && { [LOG_LEVEL_META_KEY]: material.logLevel }\n\t\t};\n\t},\n\tvalidateEnvelopeMeta(meta) {\n\t\tconst issues = [];\n\t\tfor (const key of REQUIRED_ENVELOPE_KEYS) if (!(key in meta)) issues.push({\n\t\t\tkey,\n\t\t\tproblem: \"missing\"\n\t\t});\n\t\tconst parsed = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(meta);\n\t\tif (!parsed.success) for (const issue of parsed.error.issues) {\n\t\t\tconst path = issue.path.map(String);\n\t\t\tconst key = path.length > 0 ? path.join(\".\") : \"_meta\";\n\t\t\tif (path.length === 1 && issues.some((existing) => existing.key === key && existing.problem === \"missing\")) continue;\n\t\t\tissues.push({\n\t\t\t\tkey,\n\t\t\t\tproblem: issue.message\n\t\t\t});\n\t\t}\n\t\treturn issues;\n\t},\n\tprojectCallToolResult: (result) => appendTextFallbackForNonObject(result),\n\tinputRequestSchema: getInputRequestSchema2026,\n\tdecodeResult(method, raw) {\n\t\tif (!isPlainObject$4(raw)) return {\n\t\t\tkind: \"invalid\",\n\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: not an object`, { method })\n\t\t};\n\t\tconst rawResultType = raw[\"resultType\"];\n\t\tif (rawResultType === void 0) return {\n\t\t\tkind: \"invalid\",\n\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`, {\n\t\t\t\tmethod,\n\t\t\t\tviolation: \"missing-resultType\"\n\t\t\t})\n\t\t};\n\t\tif (typeof rawResultType !== \"string\") return {\n\t\t\tkind: \"invalid\",\n\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: non-string resultType`, {\n\t\t\t\tmethod,\n\t\t\t\tresultType: rawResultType\n\t\t\t})\n\t\t};\n\t\tif (rawResultType === \"input_required\") {\n\t\t\tconst rawInputRequests = raw[\"inputRequests\"];\n\t\t\tconst inputRequests = isPlainObject$4(rawInputRequests) ? rawInputRequests : {};\n\t\t\tconst requestState = raw[\"requestState\"];\n\t\t\tconst metaParse = raw[\"_meta\"] === void 0 ? void 0 : buildSchemas2026().ResultMetaSchema.safeParse(raw[\"_meta\"]);\n\t\t\tconst meta = metaParse?.success ? metaParse.data : void 0;\n\t\t\tif (Object.keys(inputRequests).length === 0 && typeof requestState !== \"string\") return {\n\t\t\t\tkind: \"invalid\",\n\t\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`, {\n\t\t\t\t\tmethod,\n\t\t\t\t\tviolation: \"input-required-missing-both\"\n\t\t\t\t})\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tkind: \"input_required\",\n\t\t\t\tinputRequests,\n\t\t\t\t...typeof requestState === \"string\" && { requestState },\n\t\t\t\t...meta !== void 0 && { _meta: meta }\n\t\t\t};\n\t\t}\n\t\tif (rawResultType !== \"complete\") return {\n\t\t\tkind: \"invalid\",\n\t\t\terror: new SdkError(SdkErrorCode.UnsupportedResultType, `Unsupported result type '${rawResultType}' for ${method}`, {\n\t\t\t\tresultType: rawResultType,\n\t\t\t\tmethod\n\t\t\t})\n\t\t};\n\t\tconst wireResultSchemas = getWireResultSchemas();\n\t\tconst wireSchema = Object.hasOwn(wireResultSchemas, method) ? wireResultSchemas[method] : void 0;\n\t\tif (wireSchema !== void 0) {\n\t\t\tconst parsed = wireSchema.safeParse(raw);\n\t\t\tif (!parsed.success) return {\n\t\t\t\tkind: \"invalid\",\n\t\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: ${parsed.error}`, { method })\n\t\t\t};\n\t\t}\n\t\tconst lifted = { ...raw };\n\t\tdelete lifted[\"resultType\"];\n\t\treturn {\n\t\t\tkind: \"complete\",\n\t\t\tresult: lifted\n\t\t};\n\t},\n\tencodeResult(method, result, serverInfo) {\n\t\treturn stampServerInfoMeta(fillCacheFields(method, stampResultType(method, enforceDeletedFields(method, result))), serverInfo);\n\t},\n\tencodeErrorCode: (code) => code === -32002 ? -32602 : code,\n\tcheckInboundEnvelope(material) {\n\t\tif (material.envelope === void 0) return \"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)\";\n\t\tconst parsed = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(material.envelope);\n\t\tif (!parsed.success) return `Invalid _meta envelope for protocol revision 2026-07-28: ${parsed.error.issues.map((issue) => issue.message).join(\"; \")}`;\n\t}\n};\n/** Wire-true result wrappers consulted by decode step 2, keyed by method —\n* built once through the era's schema memo on the first decode. */\nlet wireResultSchemasMemo;\nfunction getWireResultSchemas() {\n\tif (wireResultSchemasMemo) return wireResultSchemasMemo;\n\tconst s = buildSchemas2026();\n\twireResultSchemasMemo = {\n\t\t\"tools/call\": s.CallToolResultSchema,\n\t\t\"tools/list\": s.ListToolsResultSchema,\n\t\t\"prompts/get\": s.GetPromptResultSchema,\n\t\t\"prompts/list\": s.ListPromptsResultSchema,\n\t\t\"resources/list\": s.ListResourcesResultSchema,\n\t\t\"resources/templates/list\": s.ListResourceTemplatesResultSchema,\n\t\t\"resources/read\": s.ReadResourceResultSchema,\n\t\t\"completion/complete\": s.CompleteResultSchema,\n\t\t\"server/discover\": s.DiscoverResultSchema\n\t};\n\treturn wireResultSchemasMemo;\n}\n/**\n* Forces the lazy wire-result wrapper map (and, through it, the era's schema\n* memo). Warm-up hook for `preloadSchemas()` — no-op once the map exists.\n*/\nfunction warmWireResultSchemas2026() {\n\tgetWireResultSchemas();\n}\n\n//#endregion\n//#region ../core-internal/src/wire/codec.ts\n/**\n* The modern wire revision literal. Internal only — deliberately NOT a public\n* constant (G-D2-4: no public modern-version constant ships before era-aware\n* list semantics exist).\n*/\nconst MODERN_WIRE_REVISION = \"2026-07-28\";\n/**\n* Era resolution, many-to-one (Q1-SD1): every modern-era revision\n* (`>= 2026-07-28`) → the 2026-era codec; every legacy revision (the five\n* `SUPPORTED_PROTOCOL_VERSIONS`) and `undefined`/unknown → the 2025-era\n* codec (the DV-13 default posture — hand-constructed instances and\n* unclassified traffic are legacy-era). This is the same era predicate the\n* rest of the SDK uses ({@link isModernProtocolVersion}); a pinned modern\n* revision other than the literal '2026-07-28' must still resolve modern.\n*/\nfunction codecForVersion(version) {\n\treturn version !== void 0 && isModernProtocolVersion(version) ? rev2026Codec : rev2025Codec;\n}\n/**\n* The wire era an edge classification names (Q2 — produced at the\n* transport/entry edge; this layer only CONSUMES it). The dispatch funnel no\n* longer resolves a codec FROM the classification: era is instance state, and\n* a classified inbound message is VALIDATED against the instance era — a\n* mismatch is an entry/routing error, never a per-message era switch. The\n* exact `revision` wins over the coarse era flag when both are present.\n*/\nfunction classifiedWireEra(classification) {\n\tif (classification.revision !== void 0) return codecForVersion(classification.revision).era;\n\treturn classification.era === \"modern\" ? rev2026Codec.era : rev2025Codec.era;\n}\n/**\n* The derived spec-method universe: the union of every codec registry. A\n* method in this set is era-gated at dispatch and send time; a method outside\n* it is a consumer-owned extension method (era-blind, schema-explicit).\n* Derived from the registries — never hand-curated (the LEGACY_ONLY_METHODS\n* table class is exactly what registry membership replaces).\n*/\nfunction isSpecRequestMethod(method) {\n\treturn ALL_CODECS.some((codec) => codec.hasRequestMethod(method));\n}\nfunction isSpecNotificationMethod(method) {\n\treturn ALL_CODECS.some((codec) => codec.hasNotificationMethod(method));\n}\n/** The names SEP-2663 re-defines for the Tasks extension on the era that removed them from core. */\nfunction isExtensionReusedRequestMethod(method) {\n\treturn method === \"tasks/get\" || method === \"tasks/cancel\";\n}\nconst ALL_CODECS = [rev2025Codec, rev2026Codec];\n\n//#endregion\n//#region ../core-internal/src/shared/envelope.ts\n/**\n* Per-request `_meta` envelope claim helpers (protocol revision 2026-07-28).\n*\n* Pure, value-returning helpers used by the inbound HTTP classifier\n* (`classifyInboundRequest`): claim detection and envelope validation with\n* self-identifying issues. The envelope schema itself stays the wire layer's\n* single source of truth (`RequestMetaEnvelopeSchema`); this module only maps\n* its outcomes into the shapes the validation ladder emits.\n*\n* Claim detection is deliberately narrow: a message claims the 2026-07-28\n* envelope mechanism if and only if the reserved protocol-version `_meta` key\n* is present in `params._meta`. Other reserved keys (client info, client\n* capabilities, log level), a bare `progressToken`, or unrelated keys under\n* the `io.modelcontextprotocol/` prefix do NOT constitute a claim on their\n* own — but once the claim key is present, a malformed envelope is a\n* validation error, never a silent fall back to legacy handling.\n*\n* The wire-exact envelope schema, the required-key set, and the per-key issue\n* mapping live in the wire layer (the 2026-era codec's `validateEnvelopeMeta`).\n* This module never reaches into a per-revision wire module directly.\n*/\nfunction isPlainObject$3(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/** The `_meta` object of a message's params, when present. */\nfunction requestMetaOf(params) {\n\tif (!isPlainObject$3(params)) return void 0;\n\tconst meta = params[\"_meta\"];\n\treturn isPlainObject$3(meta) ? meta : void 0;\n}\n/**\n* Whether a message's params carry the per-request envelope claim: the\n* reserved protocol-version `_meta` key is present (regardless of whether the\n* rest of the envelope is valid — validation is a separate, later step).\n*/\nfunction hasEnvelopeClaim(params) {\n\tconst meta = requestMetaOf(params);\n\treturn meta !== void 0 && PROTOCOL_VERSION_META_KEY in meta;\n}\n/**\n* The protocol version named by a message's envelope claim, when the claim is\n* present and carries a string value. A present claim with a non-string value\n* still counts as a claim ({@linkcode hasEnvelopeClaim}); it surfaces as a\n* validation issue instead of a version.\n*/\nfunction envelopeClaimVersion(params) {\n\tconst value = requestMetaOf(params)?.[PROTOCOL_VERSION_META_KEY];\n\treturn typeof value === \"string\" ? value : void 0;\n}\n/**\n* Validates a request's `_meta` object as a 2026-07-28 per-request envelope\n* and reports problems as self-identifying issues (which key, what problem).\n*\n* Returns an empty array when the envelope is valid. Missing required keys are\n* reported first (as `problem: 'missing'`), then schema violations inside\n* present keys, in a stable order.\n*/\nfunction validateEnvelopeMeta(meta) {\n\treturn codecForVersion(MODERN_WIRE_REVISION).validateEnvelopeMeta(meta);\n}\n\n//#endregion\n//#region ../core-internal/src/types/schemas.ts\nvar schemas_exports = /* @__PURE__ */ __exportAll({\n\tAnnotationsSchema: () => AnnotationsSchema,\n\tAudioContentSchema: () => AudioContentSchema,\n\tBaseMetadataSchema: () => BaseMetadataSchema,\n\tBaseRequestParamsSchema: () => BaseRequestParamsSchema,\n\tBlobResourceContentsSchema: () => BlobResourceContentsSchema,\n\tBooleanSchemaSchema: () => BooleanSchemaSchema,\n\tCallToolRequestParamsSchema: () => CallToolRequestParamsSchema,\n\tCallToolRequestSchema: () => CallToolRequestSchema,\n\tCallToolResultSchema: () => CallToolResultSchema,\n\tCancelTaskRequestSchema: () => CancelTaskRequestSchema,\n\tCancelTaskResultSchema: () => CancelTaskResultSchema,\n\tCancelledNotificationParamsSchema: () => CancelledNotificationParamsSchema,\n\tCancelledNotificationSchema: () => CancelledNotificationSchema,\n\tClientCapabilitiesSchema: () => ClientCapabilitiesSchema,\n\tClientNotificationSchema: () => ClientNotificationSchema,\n\tClientRequestSchema: () => ClientRequestSchema,\n\tClientResultSchema: () => ClientResultSchema,\n\tClientTasksCapabilitySchema: () => ClientTasksCapabilitySchema,\n\tCompatibilityCallToolResultSchema: () => CompatibilityCallToolResultSchema,\n\tCompleteRequestParamsSchema: () => CompleteRequestParamsSchema,\n\tCompleteRequestSchema: () => CompleteRequestSchema,\n\tCompleteResultSchema: () => CompleteResultSchema,\n\tContentBlockSchema: () => ContentBlockSchema,\n\tCreateMessageRequestParamsSchema: () => CreateMessageRequestParamsSchema,\n\tCreateMessageRequestSchema: () => CreateMessageRequestSchema,\n\tCreateMessageResultSchema: () => CreateMessageResultSchema,\n\tCreateMessageResultWithToolsSchema: () => CreateMessageResultWithToolsSchema,\n\tCreateTaskResultSchema: () => CreateTaskResultSchema,\n\tCursorSchema: () => CursorSchema,\n\tDiscoverRequestSchema: () => DiscoverRequestSchema,\n\tDiscoverResultSchema: () => DiscoverResultSchema,\n\tElicitRequestFormParamsSchema: () => ElicitRequestFormParamsSchema,\n\tElicitRequestParamsSchema: () => ElicitRequestParamsSchema,\n\tElicitRequestSchema: () => ElicitRequestSchema,\n\tElicitRequestURLParamsSchema: () => ElicitRequestURLParamsSchema,\n\tElicitResultSchema: () => ElicitResultSchema,\n\tElicitationCompleteNotificationParamsSchema: () => ElicitationCompleteNotificationParamsSchema,\n\tElicitationCompleteNotificationSchema: () => ElicitationCompleteNotificationSchema,\n\tEmbeddedResourceSchema: () => EmbeddedResourceSchema,\n\tEmptyResultSchema: () => EmptyResultSchema,\n\tEnumSchemaSchema: () => EnumSchemaSchema,\n\tGetPromptRequestParamsSchema: () => GetPromptRequestParamsSchema,\n\tGetPromptRequestSchema: () => GetPromptRequestSchema,\n\tGetPromptResultSchema: () => GetPromptResultSchema,\n\tGetTaskPayloadRequestSchema: () => GetTaskPayloadRequestSchema,\n\tGetTaskPayloadResultSchema: () => GetTaskPayloadResultSchema,\n\tGetTaskRequestSchema: () => GetTaskRequestSchema,\n\tGetTaskResultSchema: () => GetTaskResultSchema,\n\tIconSchema: () => IconSchema,\n\tIconsSchema: () => IconsSchema,\n\tImageContentSchema: () => ImageContentSchema,\n\tImplementationSchema: () => ImplementationSchema,\n\tInitializeRequestParamsSchema: () => InitializeRequestParamsSchema,\n\tInitializeRequestSchema: () => InitializeRequestSchema,\n\tInitializeResultSchema: () => InitializeResultSchema,\n\tInitializedNotificationSchema: () => InitializedNotificationSchema,\n\tJSONArraySchema: () => JSONArraySchema,\n\tJSONObjectSchema: () => JSONObjectSchema,\n\tJSONRPCErrorResponseSchema: () => JSONRPCErrorResponseSchema,\n\tJSONRPCMessageSchema: () => JSONRPCMessageSchema,\n\tJSONRPCNotificationSchema: () => JSONRPCNotificationSchema,\n\tJSONRPCRequestSchema: () => JSONRPCRequestSchema,\n\tJSONRPCResponseSchema: () => JSONRPCResponseSchema,\n\tJSONRPCResultResponseSchema: () => JSONRPCResultResponseSchema,\n\tJSONValueSchema: () => JSONValueSchema,\n\tLegacyTitledEnumSchemaSchema: () => LegacyTitledEnumSchemaSchema,\n\tListChangedOptionsBaseSchema: () => ListChangedOptionsBaseSchema,\n\tListPromptsRequestSchema: () => ListPromptsRequestSchema,\n\tListPromptsResultSchema: () => ListPromptsResultSchema,\n\tListResourceTemplatesRequestSchema: () => ListResourceTemplatesRequestSchema,\n\tListResourceTemplatesResultSchema: () => ListResourceTemplatesResultSchema,\n\tListResourcesRequestSchema: () => ListResourcesRequestSchema,\n\tListResourcesResultSchema: () => ListResourcesResultSchema,\n\tListRootsRequestSchema: () => ListRootsRequestSchema,\n\tListRootsResultSchema: () => ListRootsResultSchema,\n\tListTasksRequestSchema: () => ListTasksRequestSchema,\n\tListTasksResultSchema: () => ListTasksResultSchema,\n\tListToolsRequestSchema: () => ListToolsRequestSchema,\n\tListToolsResultSchema: () => ListToolsResultSchema,\n\tLoggingLevelSchema: () => LoggingLevelSchema,\n\tLoggingMessageNotificationParamsSchema: () => LoggingMessageNotificationParamsSchema,\n\tLoggingMessageNotificationSchema: () => LoggingMessageNotificationSchema,\n\tModelHintSchema: () => ModelHintSchema,\n\tModelPreferencesSchema: () => ModelPreferencesSchema,\n\tMultiSelectEnumSchemaSchema: () => MultiSelectEnumSchemaSchema,\n\tNotificationSchema: () => NotificationSchema,\n\tNotificationsParamsSchema: () => NotificationsParamsSchema,\n\tNumberSchemaSchema: () => NumberSchemaSchema,\n\tPaginatedRequestParamsSchema: () => PaginatedRequestParamsSchema,\n\tPaginatedRequestSchema: () => PaginatedRequestSchema,\n\tPaginatedResultSchema: () => PaginatedResultSchema,\n\tPingRequestSchema: () => PingRequestSchema,\n\tPrimitiveSchemaDefinitionSchema: () => PrimitiveSchemaDefinitionSchema,\n\tProgressNotificationParamsSchema: () => ProgressNotificationParamsSchema,\n\tProgressNotificationSchema: () => ProgressNotificationSchema,\n\tProgressSchema: () => ProgressSchema,\n\tProgressTokenSchema: () => ProgressTokenSchema,\n\tPromptArgumentSchema: () => PromptArgumentSchema,\n\tPromptListChangedNotificationSchema: () => PromptListChangedNotificationSchema,\n\tPromptMessageSchema: () => PromptMessageSchema,\n\tPromptReferenceSchema: () => PromptReferenceSchema,\n\tPromptSchema: () => PromptSchema,\n\tReadResourceRequestParamsSchema: () => ReadResourceRequestParamsSchema,\n\tReadResourceRequestSchema: () => ReadResourceRequestSchema,\n\tReadResourceResultSchema: () => ReadResourceResultSchema,\n\tRelatedTaskMetadataSchema: () => RelatedTaskMetadataSchema,\n\tRequestIdSchema: () => RequestIdSchema,\n\tRequestMetaSchema: () => RequestMetaSchema,\n\tRequestSchema: () => RequestSchema,\n\tResourceContentsSchema: () => ResourceContentsSchema,\n\tResourceLinkSchema: () => ResourceLinkSchema,\n\tResourceListChangedNotificationSchema: () => ResourceListChangedNotificationSchema,\n\tResourceRequestParamsSchema: () => ResourceRequestParamsSchema,\n\tResourceSchema: () => ResourceSchema,\n\tResourceTemplateReferenceSchema: () => ResourceTemplateReferenceSchema,\n\tResourceTemplateSchema: () => ResourceTemplateSchema,\n\tResourceUpdatedNotificationParamsSchema: () => ResourceUpdatedNotificationParamsSchema,\n\tResourceUpdatedNotificationSchema: () => ResourceUpdatedNotificationSchema,\n\tResultMetaObjectSchema: () => ResultMetaObjectSchema,\n\tResultSchema: () => ResultSchema,\n\tRoleSchema: () => RoleSchema,\n\tRootSchema: () => RootSchema,\n\tRootsListChangedNotificationSchema: () => RootsListChangedNotificationSchema,\n\tSamplingContentSchema: () => SamplingContentSchema,\n\tSamplingMessageContentBlockSchema: () => SamplingMessageContentBlockSchema,\n\tSamplingMessageSchema: () => SamplingMessageSchema,\n\tServerCapabilitiesSchema: () => ServerCapabilitiesSchema,\n\tServerNotificationSchema: () => ServerNotificationSchema,\n\tServerRequestSchema: () => ServerRequestSchema,\n\tServerResultSchema: () => ServerResultSchema,\n\tServerTasksCapabilitySchema: () => ServerTasksCapabilitySchema,\n\tSetLevelRequestParamsSchema: () => SetLevelRequestParamsSchema,\n\tSetLevelRequestSchema: () => SetLevelRequestSchema,\n\tSingleSelectEnumSchemaSchema: () => SingleSelectEnumSchemaSchema,\n\tStringSchemaSchema: () => StringSchemaSchema,\n\tSubscribeRequestParamsSchema: () => SubscribeRequestParamsSchema,\n\tSubscribeRequestSchema: () => SubscribeRequestSchema,\n\tSubscriptionFilterSchema: () => SubscriptionFilterSchema,\n\tSubscriptionsAcknowledgedNotificationParamsSchema: () => SubscriptionsAcknowledgedNotificationParamsSchema,\n\tSubscriptionsAcknowledgedNotificationSchema: () => SubscriptionsAcknowledgedNotificationSchema,\n\tSubscriptionsListenRequestParamsSchema: () => SubscriptionsListenRequestParamsSchema,\n\tSubscriptionsListenRequestSchema: () => SubscriptionsListenRequestSchema,\n\tSubscriptionsListenResultMetaSchema: () => SubscriptionsListenResultMetaSchema,\n\tSubscriptionsListenResultSchema: () => SubscriptionsListenResultSchema,\n\tTaskAugmentedRequestParamsSchema: () => TaskAugmentedRequestParamsSchema,\n\tTaskCreationParamsSchema: () => TaskCreationParamsSchema,\n\tTaskMetadataSchema: () => TaskMetadataSchema,\n\tTaskSchema: () => TaskSchema,\n\tTaskStatusNotificationParamsSchema: () => TaskStatusNotificationParamsSchema,\n\tTaskStatusNotificationSchema: () => TaskStatusNotificationSchema,\n\tTaskStatusSchema: () => TaskStatusSchema,\n\tTextContentSchema: () => TextContentSchema,\n\tTextResourceContentsSchema: () => TextResourceContentsSchema,\n\tTitledMultiSelectEnumSchemaSchema: () => TitledMultiSelectEnumSchemaSchema,\n\tTitledSingleSelectEnumSchemaSchema: () => TitledSingleSelectEnumSchemaSchema,\n\tToolAnnotationsSchema: () => ToolAnnotationsSchema,\n\tToolChoiceSchema: () => ToolChoiceSchema,\n\tToolExecutionSchema: () => ToolExecutionSchema,\n\tToolListChangedNotificationSchema: () => ToolListChangedNotificationSchema,\n\tToolResultContentSchema: () => ToolResultContentSchema,\n\tToolSchema: () => ToolSchema,\n\tToolUseContentSchema: () => ToolUseContentSchema,\n\tUnsubscribeRequestParamsSchema: () => UnsubscribeRequestParamsSchema,\n\tUnsubscribeRequestSchema: () => UnsubscribeRequestSchema,\n\tUntitledMultiSelectEnumSchemaSchema: () => UntitledMultiSelectEnumSchemaSchema,\n\tUntitledSingleSelectEnumSchemaSchema: () => UntitledSingleSelectEnumSchemaSchema\n});\n\n//#endregion\n//#region ../core-internal/src/types/guards.ts\n/**\n* Validates and parses an unknown value as a JSON-RPC message.\n*\n* Use this to validate incoming messages in custom transport implementations.\n* Throws if the value does not conform to the JSON-RPC message schema.\n*\n* @param value - The value to validate (typically a parsed JSON object).\n* @returns The validated {@linkcode JSONRPCMessage}.\n* @throws If validation fails.\n*/\nfunction parseJSONRPCMessage(value) {\n\treturn JSONRPCMessageSchema.parse(value);\n}\nconst isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;\nconst isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;\n/**\n* Checks if a value is a valid {@linkcode JSONRPCResultResponse}.\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode JSONRPCResultResponse}, false otherwise.\n*/\nconst isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;\n/**\n* Checks if a value is a valid {@linkcode JSONRPCErrorResponse}.\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode JSONRPCErrorResponse}, false otherwise.\n*/\nconst isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;\n/**\n* Checks if a value is a valid {@linkcode JSONRPCResponse} (either a result or error response).\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode JSONRPCResponse}, false otherwise.\n*/\nconst isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;\n/**\n* Checks if a value is a valid {@linkcode CallToolResult}.\n*\n* This is a consumer-side VALUE check against the neutral model, not a wire\n* validator: a raw wire object that additionally carries wire-only members\n* (e.g. `resultType`) still passes through the loose index signature. Use a\n* transport-level parse to validate raw wire traffic.\n*\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode CallToolResult}, false otherwise.\n*/\nconst isCallToolResult = (value) => {\n\tif (typeof value !== \"object\" || value === null || value.content === void 0) return false;\n\treturn CallToolResultSchema.safeParse(value).success;\n};\n/**\n* Checks whether a value is an input-required result (protocol revision\n* 2026-07-28): the multi-round-trip return shape discriminated by\n* `resultType: 'input_required'`.\n*\n* This is a discriminator check, not a full validator — the at-least-one rule\n* (`inputRequests` or `requestState`) is enforced by the `inputRequired()`\n* builder and re-checked by the server seam for hand-built values.\n*\n* @param value - The value to check.\n* @returns True if the value carries the `input_required` discriminator.\n*/\nconst isInputRequiredResult = (value) => typeof value === \"object\" && value !== null && !Array.isArray(value) && value.resultType === \"input_required\";\n/**\n* Checks if a value is a valid {@linkcode TaskAugmentedRequestParams}.\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode TaskAugmentedRequestParams}, false otherwise.\n*\n* @deprecated Recognizes 2025-11-25 task wire vocabulary, which has no SDK\n* runtime; kept importable for interoperability only.\n*/\nconst isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;\nconst isInitializeRequest = (value) => InitializeRequestSchema.safeParse(value).success;\nconst isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;\nfunction assertCompleteRequestPrompt(request) {\n\tif (request.params.ref.type !== \"ref/prompt\") throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);\n}\nfunction assertCompleteRequestResourceTemplate(request) {\n\tif (request.params.ref.type !== \"ref/resource\") throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);\n}\n\n//#endregion\n//#region ../core-internal/src/shared/mcpParamHeaders.ts\n/** The fixed prefix every custom-parameter header carries. */\nconst MCP_PARAM_HEADER_PREFIX = \"Mcp-Param-\";\n/** The schema-extension property name a tool's `inputSchema` carries. */\nconst X_MCP_HEADER_KEY = \"x-mcp-header\";\n/**\n* RFC 9110 §5.1 `token` syntax (`1*tchar`). Rejects empty, space, control\n* characters (including CR/LF), and the listed delimiters.\n*/\nconst RFC9110_TOKEN = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n/**\n* JSON Schema `type` values the spec admits on an `x-mcp-header` property.\n*\n* The spec text names `integer`, `string`, `boolean` and explicitly excludes\n* `number`. The published conformance referee at the pinned release ships its\n* `http-custom-headers` scenario with two `type: \"number\"` `x-mcp-header`\n* parameters and expects the client to mirror them, so `number` is accepted\n* here so that the conformance gate passes; the discrepancy is tracked\n* upstream. Everything else (`object`, `array`, `null`, absent) is rejected.\n*/\nconst PERMITTED_X_MCP_HEADER_TYPES = new Set([\n\t\"string\",\n\t\"integer\",\n\t\"boolean\",\n\t\"number\"\n]);\n/**\n* Scan a tool's JSON-serialized `inputSchema` for `x-mcp-header` declarations\n* and validate every constraint the spec places on them. Returns either the\n* collected declarations (possibly empty) or the first violated constraint.\n*\n* The walk descends through `properties` at any depth (the spec's \"any nesting\n* depth\" clause). The static-reachability MUST is enforced as a structural\n* sweep: every position the chain MUST NOT pass through (`items`/\n* `additionalProperties`, `oneOf`/`anyOf`/`allOf`/`not`, `if`/`then`/`else`,\n* `$defs`, `$ref` targets within `$defs`) is visited too, and an\n* `x-mcp-header` found anywhere on that path invalidates the schema — \"an\n* annotation anywhere else makes the tool definition invalid\".\n*/\nfunction scanXMcpHeaderDeclarations(inputSchema) {\n\tconst declarations = [];\n\tconst seenLower = /* @__PURE__ */ new Map();\n\tconst visit = (node, path, reachable) => {\n\t\tif (node === null || typeof node !== \"object\") return void 0;\n\t\tconst schema = node;\n\t\tif (X_MCP_HEADER_KEY in schema) {\n\t\t\tif (!reachable || path.length === 0) return `${pathName(path)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;\n\t\t\tconst raw = schema[X_MCP_HEADER_KEY];\n\t\t\tif (typeof raw !== \"string\" || raw.length === 0) return `${pathName(path)}: x-mcp-header MUST be a non-empty string`;\n\t\t\tif (!RFC9110_TOKEN.test(raw)) return `${pathName(path)}: x-mcp-header '${raw}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;\n\t\t\tconst type = typeof schema.type === \"string\" ? schema.type : void 0;\n\t\t\tif (type === void 0 || !PERMITTED_X_MCP_HEADER_TYPES.has(type)) return `${pathName(path)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${type ?? \"<none>\"}`;\n\t\t\tconst lower = raw.toLowerCase();\n\t\t\tconst prior = seenLower.get(lower);\n\t\t\tif (prior !== void 0) return `x-mcp-header '${raw}' is not case-insensitively unique (also declared as '${prior}')`;\n\t\t\tseenLower.set(lower, raw);\n\t\t\tdeclarations.push({\n\t\t\t\tpath,\n\t\t\t\theaderName: raw,\n\t\t\t\ttype\n\t\t\t});\n\t\t}\n\t\tconst properties = schema.properties;\n\t\tif (properties !== null && typeof properties === \"object\") for (const [key, child] of Object.entries(properties)) {\n\t\t\tconst fault$1 = visit(child, [...path, key], reachable);\n\t\t\tif (fault$1 !== void 0) return fault$1;\n\t\t}\n\t\tfor (const k of NON_REACHABLE_SUBSCHEMA_KEYWORDS) {\n\t\t\tconst sub = schema[k];\n\t\t\tif (sub === void 0) continue;\n\t\t\tconst branches = Array.isArray(sub) ? sub : sub !== null && typeof sub === \"object\" && OBJECT_VALUED_SUBSCHEMA_KEYWORDS.has(k) ? Object.values(sub) : [sub];\n\t\t\tfor (const branch of branches) {\n\t\t\t\tconst fault$1 = visit(branch, [...path, `<${k}>`], false);\n\t\t\t\tif (fault$1 !== void 0) return fault$1;\n\t\t\t}\n\t\t}\n\t};\n\tconst fault = visit(inputSchema, [], true);\n\treturn fault === void 0 ? {\n\t\tvalid: true,\n\t\tdeclarations\n\t} : {\n\t\tvalid: false,\n\t\treason: fault\n\t};\n}\n/**\n* JSON Schema keywords whose subschemas the SEP-2243 static-reachability\n* constraint excludes from the `properties`-only chain. An `x-mcp-header`\n* found under any of these invalidates the tool definition.\n*/\nconst NON_REACHABLE_SUBSCHEMA_KEYWORDS = [\n\t\"items\",\n\t\"prefixItems\",\n\t\"contains\",\n\t\"additionalProperties\",\n\t\"unevaluatedProperties\",\n\t\"unevaluatedItems\",\n\t\"propertyNames\",\n\t\"patternProperties\",\n\t\"dependentSchemas\",\n\t\"oneOf\",\n\t\"anyOf\",\n\t\"allOf\",\n\t\"not\",\n\t\"if\",\n\t\"then\",\n\t\"else\",\n\t\"$defs\",\n\t\"definitions\"\n];\n/**\n* Subschema-carrying keywords whose value is a `name → subschema` object\n* (not a single subschema or array of subschemas). The visit branches over\n* `Object.values()` for these.\n*/\nconst OBJECT_VALUED_SUBSCHEMA_KEYWORDS = new Set([\n\t\"patternProperties\",\n\t\"dependentSchemas\",\n\t\"$defs\",\n\t\"definitions\"\n]);\nfunction pathName(path) {\n\treturn path.length === 0 ? \"<root>\" : path.join(\".\");\n}\nconst BASE64_SENTINEL_PREFIX = \"=?base64?\";\nconst BASE64_SENTINEL_SUFFIX = \"?=\";\nconst BASE64_CANONICAL = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\nconst CANONICAL_DECIMAL = /^-?\\d+(\\.\\d+)?$/;\n/**\n* Convert a primitive argument value to its string representation per the\n* spec's type-conversion rules: strings pass through, integers and numbers\n* become their decimal string, booleans become lowercase `'true'` / `'false'`.\n* Non-finite numbers and integers outside the safe range are refused (the\n* caller treats `undefined` as \"do not emit a header for this value\").\n*/\nfunction mcpParamPrimitiveToString(value) {\n\tif (typeof value === \"string\") return value;\n\tif (typeof value === \"boolean\") return value ? \"true\" : \"false\";\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) return void 0;\n\t\tif (Number.isInteger(value) && !Number.isSafeInteger(value)) return void 0;\n\t\treturn String(value);\n\t}\n}\nfunction base64ToUtf8(b64) {\n\tconst bin = atob(b64);\n\tconst bytes = new Uint8Array(bin.length);\n\tfor (let i = 0; i < bin.length; i++) bytes[i] = bin.codePointAt(i);\n\treturn new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes);\n}\n/**\n* Decode an `Mcp-Param-*` header value: when it carries the Base64 sentinel,\n* the payload is decoded as UTF-8; otherwise the value is returned as-is.\n* Returns `undefined` when the sentinel is present but the payload is not\n* canonical Base64 (or not valid UTF-8) — the spec requires servers to reject\n* such values.\n*/\nfunction decodeMcpParamValue(value) {\n\tif (!(value.startsWith(BASE64_SENTINEL_PREFIX) && value.endsWith(BASE64_SENTINEL_SUFFIX))) return value;\n\tconst b64 = value.slice(9, value.length - 2);\n\tif (!BASE64_CANONICAL.test(b64)) return void 0;\n\ttry {\n\t\treturn base64ToUtf8(b64);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction valueAtPath(root, path) {\n\tlet node = root;\n\tfor (const key of path) {\n\t\tif (node === null || typeof node !== \"object\") return void 0;\n\t\tnode = node[key];\n\t}\n\treturn node;\n}\n/**\n* The header/body comparison the server performs at tool-resolution time.\n*\n* For each `x-mcp-header` declaration on the named tool: when the body\n* `arguments` carries a value, the matching `Mcp-Param-{Name}` header MUST be\n* present and decode to an equal value; when the body value is `null` or\n* absent the server MUST NOT expect the header (a present header is ignored).\n* A sentinel-carrying header whose payload is not canonical Base64 / valid\n* UTF-8 is rejected as invalid characters.\n*\n* Integer-typed declarations are compared numerically (the spec's SHOULD —\n* `42.0` and `42` are equal); everything else is compared as decoded strings.\n*\n* Returns `undefined` when every check passes, or an\n* {@linkcode InboundLadderRejection} carrying the same `-32020`\n* (`HeaderMismatch`) shape the inbound classifier emits for the\n* standard-header cross-checks — `400 Bad Request` with the disagreeing pair\n* in `data.mismatch`.\n*/\nfunction validateMcpParamHeaders(declarations, args, headers) {\n\tfor (const decl of declarations) {\n\t\tconst headerKey = `${MCP_PARAM_HEADER_PREFIX}${decl.headerName}`;\n\t\tconst headerValue = headers.get(headerKey);\n\t\tconst bodyRaw = valueAtPath(args, decl.path);\n\t\tif (bodyRaw === void 0 || bodyRaw === null) continue;\n\t\tconst bodyString = mcpParamPrimitiveToString(bodyRaw);\n\t\tif (bodyString === void 0) continue;\n\t\tif (headerValue === null) return paramHeaderMismatchRejection(\"param-header-missing\", headerKey, `the body carries ${pathName(decl.path)}=${JSON.stringify(bodyRaw)} but the ${headerKey} header is absent`);\n\t\tconst decoded = decodeMcpParamValue(headerValue);\n\t\tif (decoded === void 0) return paramHeaderMismatchRejection(\"param-header-invalid-encoding\", headerKey, `the ${headerKey} header carries an invalid Base64 sentinel value`);\n\t\tif (!((decl.type === \"integer\" || decl.type === \"number\") && CANONICAL_DECIMAL.test(decoded) && typeof bodyRaw === \"number\" ? Number(decoded) === bodyRaw : decoded === bodyString)) return paramHeaderMismatchRejection(\"param-header-mismatch\", headerKey, `the ${headerKey} header decodes to ${JSON.stringify(decoded)} but the body carries ${pathName(decl.path)}=${JSON.stringify(bodyRaw)}`);\n\t}\n}\n/**\n* Build the `-32020` (`HeaderMismatch`) rejection for an `Mcp-Param-*`\n* disagreement. Same shape as the inbound classifier's standard-header\n* cross-check mismatch (HTTP `400`, `data.mismatch` naming the disagreeing\n* pair, `settled: true`); only the rung differs because this check runs at the\n* pre-dispatch step against a known tool's schema rather than at the edge.\n*/\nfunction paramHeaderMismatchRejection(cell, header, body) {\n\treturn {\n\t\tkind: \"reject\",\n\t\trung: \"param-header-validation\",\n\t\tcell,\n\t\thttpStatus: 400,\n\t\tcode: HEADER_MISMATCH_ERROR_CODE,\n\t\tmessage: `Bad Request: the request headers and body disagree: ${body}`,\n\t\tdata: { mismatch: {\n\t\t\theader,\n\t\t\tbody\n\t\t} },\n\t\tsettled: true\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/shared/inboundClassification.ts\n/**\n* Inbound HTTP request classification and the inbound validation ladder\n* (protocol revision 2026-07-28).\n*\n* `classifyInboundRequest` is the body-primary era predicate for an HTTP\n* entry that serves both protocol eras on one endpoint. It is evaluated\n* exactly once, at the entry boundary, on the already-parsed request body:\n*\n* - `initialize` is a legacy-era request by definition (the modern era has no\n*   `initialize` handshake) — unless it carries a valid envelope claim naming\n*   a modern revision, in which case the claim wins and the request is\n*   classified like any other enveloped request (the modern era then answers\n*   it with method-not-found, exactly like every other method it does not\n*   define).\n* - A request whose `params._meta` carries the reserved protocol-version key\n*   claims the per-request envelope mechanism and classifies into the era the\n*   named revision belongs to (a malformed envelope behind a present claim is\n*   a validation error, never a silent fall back to legacy handling).\n* - A request without a claim is legacy-era traffic.\n* - The `MCP-Protocol-Version` header is a cross-check only *for\n*   classification*: it never upgrades or downgrades a body-derived\n*   classification, and a disagreement between header and body is an explicit\n*   ladder outcome. Its absence likewise never changes the era — but the spec\n*   requires the header on every modern *request* POST, so a\n*   modern-classified request that omits it is refused one rung later, by\n*   {@linkcode validateStandardRequestHeaders}, not here. Notification POSTs\n*   are exempt (see the next bullet), and that rung enforces presence on\n*   requests only.\n* - Notifications carry no envelope claim of their own under the current\n*   spec, so for notification POSTs without a body claim the modern header is\n*   determinative; the `Mcp-Method` header is validated against the body when\n*   the message classifies modern and is never enforced on legacy traffic.\n*   A notification that does carry a claim is treated body-primary like a\n*   request, and a malformed claim is rejected the same way a request's\n*   malformed claim is — never silently resolved against the header.\n*   The notification-POST header cross-checks here are an SDK-defensive\n*   posture, not a spec requirement: the spec leaves header rules for posted\n*   notifications undefined (core client notifications do not occur over\n*   Streamable HTTP); applying the request rules symmetrically is what an\n*   ecosystem custom-notification POST expects, and the −32020 cells stay\n*   passing for them.\n* - `GET`/`DELETE` (and any other non-`POST` method) are body-less 2025-era\n*   session operations: the modern era is `POST`-only, so they are routed to\n*   legacy serving when it is configured and rejected otherwise.\n* - Array (batch) bodies are classified element-wise: an array containing a\n*   modern-claiming or invalid element is rejected, an all-legacy array is\n*   legacy traffic unchanged, and a single-element array is still an array.\n*\n* The classifier returns plain values (it never throws and never touches a\n* transport): a routing outcome (`legacy`/`modern`) or a ladder rejection\n* carrying the JSON-RPC error to emit and the HTTP status to emit it with.\n* Legacy routing outcomes deliberately carry NO `MessageClassification` —\n* legacy and hand-wired traffic is never classified, which keeps its\n* dispatch behavior byte-identical to today's.\n*\n* Error codes for the modern-path rejection cells follow the published\n* conformance suite (and the spec text it asserts):\n*\n* - A header/body cross-check mismatch (the `MCP-Protocol-Version` header\n*   disagreeing with the body, or the `Mcp-Method` header disagreeing with the\n*   body method) is rejected with `-32020` (`HeaderMismatch`) on HTTP 400.\n* - A request whose protocol-version header names a modern revision but whose\n*   body carries no `_meta` envelope claim — including an envelope present but\n*   missing the required protocol-version key — is rejected with `-32602`\n*   (invalid params) naming the missing key(s), on HTTP 400.\n*\n* Should a future spec revision or conformance release change these\n* assignments, the affected cells are re-derived against that release; the\n* `settled` flag on {@linkcode InboundLadderRejection} stays available to mark\n* a cell provisional again while such a change is in flight.\n*/\n/**\n* The error code emitted for header/body cross-check mismatches: the\n* `MCP-Protocol-Version` header disagreeing with the body's envelope claim (or\n* with the body's classification), and the `Mcp-Method` header disagreeing\n* with the body method.\n*\n* `-32020` is the draft schema's `HEADER_MISMATCH` constant (the SEP-2243\n* `HeaderMismatch` code; the spec requires HTTP 400 for it), as also asserted\n* by the published conformance suite for header-validation failures. It has no\n* {@linkcode ProtocolErrorCode} member because it is not part of the 2025-era\n* wire vocabulary; the validation ladder is its only emitter.\n*/\nconst HEADER_MISMATCH_ERROR_CODE = -32020;\n/**\n* The inbound validation ladder, expressed as data rather than control flow.\n*\n* The edge rungs are evaluated by {@linkcode classifyInboundRequest}; the\n* dispatch rungs are evaluated by the protocol layer once the classified\n* message is injected into a per-request server instance (the era registry\n* gate, the envelope requiredness check, and per-method params validation).\n* The client-capability rung is evaluated by the HTTP entry itself,\n* pre-dispatch, on the validated envelope the classifier produced — see that\n* rung's rationale for the ordering caveat. The order is the precedence: a\n* request that fails several rungs is answered by the earliest one.\n*/\nconst INBOUND_VALIDATION_LADDER = [\n\t{\n\t\trung: \"http-method\",\n\t\torder: 1,\n\t\tevaluatedAt: \"edge\",\n\t\tcodes: [-32e3],\n\t\tconformance: [],\n\t\trationale: \"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read.\"\n\t},\n\t{\n\t\trung: \"jsonrpc-shape\",\n\t\torder: 2,\n\t\tevaluatedAt: \"edge\",\n\t\tcodes: [ProtocolErrorCode.InvalidRequest],\n\t\tconformance: [\"server-stateless\"],\n\t\trationale: \"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic.\"\n\t},\n\t{\n\t\trung: \"era-classification\",\n\t\torder: 3,\n\t\tevaluatedAt: \"edge\",\n\t\tcodes: [HEADER_MISMATCH_ERROR_CODE, ProtocolErrorCode.UnsupportedProtocolVersion],\n\t\tconformance: [\n\t\t\t\"server-stateless\",\n\t\t\t\"http-header-validation\",\n\t\t\t\"http-custom-header-server-validation\"\n\t\t],\n\t\trationale: \"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions.\"\n\t},\n\t{\n\t\trung: \"envelope\",\n\t\torder: 4,\n\t\tevaluatedAt: \"edge\",\n\t\tcodes: [ProtocolErrorCode.InvalidParams],\n\t\tconformance: [\"server-stateless\"],\n\t\trationale: \"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400.\"\n\t},\n\t{\n\t\trung: \"method-registry\",\n\t\torder: 5,\n\t\tevaluatedAt: \"dispatch\",\n\t\tcodes: [ProtocolErrorCode.MethodNotFound],\n\t\tconformance: [\"server-stateless\"],\n\t\trationale: \"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at.\"\n\t},\n\t{\n\t\trung: \"request-params\",\n\t\torder: 6,\n\t\tevaluatedAt: \"dispatch\",\n\t\tcodes: [ProtocolErrorCode.InvalidParams],\n\t\tconformance: [],\n\t\trationale: \"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table.\"\n\t},\n\t{\n\t\trung: \"standard-header-validation\",\n\t\torder: 7,\n\t\tevaluatedAt: \"pre-dispatch\",\n\t\tcodes: [HEADER_MISMATCH_ERROR_CODE],\n\t\tconformance: [\"http-header-validation\"],\n\t\trationale: \"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half — including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted.\"\n\t},\n\t{\n\t\trung: \"client-capabilities\",\n\t\torder: 8,\n\t\tevaluatedAt: \"pre-dispatch\",\n\t\tcodes: [ProtocolErrorCode.MissingRequiredClientCapability],\n\t\tconformance: [\"server-stateless\"],\n\t\trationale: \"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable.\"\n\t},\n\t{\n\t\trung: \"param-header-validation\",\n\t\torder: 9,\n\t\tevaluatedAt: \"pre-dispatch\",\n\t\tcodes: [HEADER_MISMATCH_ERROR_CODE],\n\t\tconformance: [\"http-custom-header-server-validation\"],\n\t\trationale: \"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung.\"\n\t}\n];\n/**\n* HTTP status for ladder-originated JSON-RPC error codes.\n*\n* Keyed on origin, not on the bare code: this table only applies to errors\n* the ladder (or a pre-handler protocol gate) produced. Errors produced by\n* request handlers — whatever their code — stay in-band on HTTP 200, and are\n* never mapped to an HTTP status by this table; in particular `-32603` and\n* domain-specific codes never become a blanket 500. The single exception is\n* `MissingRequiredClientCapability` (-32021) — see\n* {@linkcode httpStatusForErrorCode}.\n*\n* `-32602` (invalid params) deliberately has NO entry: the only invalid-params\n* rejection that maps to HTTP 400 is the classifier's own envelope rung\n* short-circuit, which carries its HTTP status directly. A dispatch- or\n* handler-produced invalid-params error is always in-band.\n*/\nconst LADDER_ERROR_HTTP_STATUS = {\n\t[ProtocolErrorCode.ParseError]: 400,\n\t[ProtocolErrorCode.InvalidRequest]: 400,\n\t[ProtocolErrorCode.MethodNotFound]: 404,\n\t[ProtocolErrorCode.UnsupportedProtocolVersion]: 400,\n\t[ProtocolErrorCode.MissingRequiredClientCapability]: 400,\n\t[HEADER_MISMATCH_ERROR_CODE]: 400\n};\n/**\n* The HTTP status to answer a JSON-RPC error with, keyed on the error's\n* origin. `in-band` errors (anything produced by a request handler) are\n* HTTP 200 — the JSON-RPC error response is the payload, not an HTTP\n* failure — with ONE exception: `MissingRequiredClientCapability` (-32021),\n* whose 400 the spec mandates on the error itself with no origin condition,\n* and which the SDK genuinely produces after dispatch (the `input_required`\n* capability gate). A handler relaying some downstream peer's `-32020`/`-32022`\n* is NOT that peer's spec error and stays in-band like every other handler\n* code. `ladder` errors map through {@linkcode LADDER_ERROR_HTTP_STATUS}.\n*\n* The per-request transport intentionally does NOT delegate to this function:\n* its `?? 400` ladder fallback is only correct for entry-gate codes known to\n* the table, and would wrongly map dispatch-window errors outside it (a\n* window `-32602` must stay in-band on 200). The transport indexes the table\n* directly; keep the two in agreement when editing either.\n*/\nfunction httpStatusForErrorCode(code, origin) {\n\tif (origin === \"in-band\") return code === ProtocolErrorCode.MissingRequiredClientCapability ? 400 : 200;\n\treturn LADDER_ERROR_HTTP_STATUS[code] ?? 400;\n}\nfunction rejection(rung, cell, httpStatus, error, settled) {\n\treturn {\n\t\tkind: \"reject\",\n\t\trung,\n\t\tcell,\n\t\thttpStatus,\n\t\tcode: error.code,\n\t\tmessage: error.message,\n\t\t...error.data !== void 0 && { data: error.data },\n\t\tsettled\n\t};\n}\nfunction crossCheckMismatch(cell, header, body, rung = \"era-classification\") {\n\treturn rejection(rung, cell, 400, new ProtocolError(HEADER_MISMATCH_ERROR_CODE, `Bad Request: the request headers and body disagree: ${body}`, { mismatch: {\n\t\theader,\n\t\tbody\n\t} }), true);\n}\n/**\n* The methods whose body carries a `params.name` / `params.uri` /\n* `params.taskId` value the `Mcp-Name` header must mirror, and which body\n* field supplies it. The core rows come from SEP-2243 § Standard Request\n* Headers (`Required For` column); the `tasks/*` rows come from SEP-2663's\n* Streamable HTTP binding (\"the client MUST set the `Mcp-Name` header to the\n* value of `params.taskId`\" for `tasks/get` / `tasks/update` /\n* `tasks/cancel`, so intermediaries can route every request for a task to the\n* instance holding its state). Shared by the client transport (header\n* emission) and the server ladder (validation) so both sides derive from one\n* table.\n*/\nconst MCP_NAME_HEADER_SOURCE = {\n\t\"tools/call\": \"name\",\n\t\"prompts/get\": \"name\",\n\t\"resources/read\": \"uri\",\n\t\"tasks/get\": \"taskId\",\n\t\"tasks/update\": \"taskId\",\n\t\"tasks/cancel\": \"taskId\"\n};\n/**\n* Resolve the `Mcp-Name` source for one request against\n* {@linkcode MCP_NAME_HEADER_SOURCE}: which body field the header mirrors for\n* `method`, and the string value that field carries in `params`.\n*\n* Returns `undefined` when `method` is off-table (no `Mcp-Name` is emitted or\n* required). Otherwise `value` is the field's string value, or `undefined`\n* when `params` is not a plain object or the field is absent / not a string —\n* the client emits no header then, and the server leaves that body to the\n* rungs further down the ladder.\n*\n* `method` is peer-supplied on the server and caller-supplied on the client,\n* so the table lookup is `Object.hasOwn`-guarded against `Object.prototype`\n* collisions (`constructor`, `toString`, …). Shared by the client transport\n* (emission) and {@linkcode validateStandardRequestHeaders} (validation) so\n* the extraction — not just the table — cannot drift between the two sides.\n*/\nfunction mcpNameSource(method, params) {\n\tconst field = Object.hasOwn(MCP_NAME_HEADER_SOURCE, method) ? MCP_NAME_HEADER_SOURCE[method] : void 0;\n\tif (field === void 0) return;\n\tconst raw = isPlainObject$2(params) ? params[field] : void 0;\n\treturn {\n\t\tfield,\n\t\tvalue: typeof raw === \"string\" ? raw : void 0\n\t};\n}\n/** Strip RFC 9110 optional whitespace (SP / HTAB) around a field value in linear time. */\nfunction stripHttpOws(value) {\n\tlet start = 0;\n\twhile (start < value.length) {\n\t\tconst code = value.codePointAt(start);\n\t\tif (code !== 9 && code !== 32) break;\n\t\tstart += 1;\n\t}\n\tlet end = value.length;\n\twhile (end > start) {\n\t\tconst code = value.codePointAt(end - 1);\n\t\tif (code !== 9 && code !== 32) break;\n\t\tend -= 1;\n\t}\n\treturn start === 0 && end === value.length ? value : value.slice(start, end);\n}\n/**\n* SEP-2243 standard-header server-side validation, evaluated by the HTTP\n* entry on a modern-classified request immediately after\n* {@linkcode classifyInboundRequest} returns a modern route.\n*\n* Returns the `-32020` (`HeaderMismatch`) ladder rejection (HTTP `400`,\n* `standard-header-validation` rung — the same shape\n* {@linkcode classifyInboundRequest} already emits on the edge\n* `era-classification` rung for the `MCP-Protocol-Version` and\n* `Mcp-Method` *mismatch* cells) when:\n*\n* - the required `MCP-Protocol-Version` header is absent (SEP-2243 requires it\n*   on every modern *request* POST, and lists it first among the required\n*   standard headers — so a request missing it *and* `Mcp-Method` is answered\n*   by this cell);\n* - the required `Mcp-Method` header is absent;\n* - the required `Mcp-Name` header is absent on a `tools/call`,\n*   `prompts/get`, `resources/read`, or (per SEP-2663's Streamable HTTP\n*   binding) `tasks/get` / `tasks/update` / `tasks/cancel` request whose\n*   body carries the `params.name` / `params.uri` / `params.taskId` value\n*   the header mirrors;\n* - the `Mcp-Name` header carries an invalid `=?base64?…?=` sentinel; or\n* - the (decoded) `Mcp-Name` value disagrees with the body's\n*   `params.name` / `params.uri` / `params.taskId`.\n*\n* Returns `undefined` (pass) for notifications (the spec table reads\n* \"All requests\"), for methods that have no `Mcp-Name` source, and when the\n* headers agree with the body. Never enforced on legacy traffic — the entry\n* only calls this on a modern route.\n*\n* Kept separate from {@linkcode classifyInboundRequest} so that a body-only\n* call to the classifier (no headers passed) keeps routing a modern request\n* unchanged: the classifier remains a pure body-primary router, and this\n* function is the presence/`Mcp-Name` half of the standard-header rung the\n* entry layers on top. That separation is what lets the missing\n* `MCP-Protocol-Version` cell live here without disturbing the body-primary\n* rule — classification still resolves from the body (a proxy stripping the\n* header must not change the era), and only this rung refuses to serve it.\n*/\nfunction validateStandardRequestHeaders(request, route) {\n\tif (route.messageKind !== \"request\") return;\n\tconst method = route.message.method;\n\tif (request.protocolVersionHeader === void 0) {\n\t\tconst claimed = route.classification.revision;\n\t\treturn crossCheckMismatch(\"version-header-missing\", \"(missing)\", claimed === void 0 ? \"the body carries a modern per-request envelope but the required MCP-Protocol-Version header is absent\" : `the body envelope names protocol version ${claimed} but the required MCP-Protocol-Version header is absent`, \"standard-header-validation\");\n\t}\n\tif (request.mcpMethodHeader === void 0) return crossCheckMismatch(\"method-header-missing\", \"(missing)\", `the body names method ${method} but the required Mcp-Method header is absent`, \"standard-header-validation\");\n\tconst source = mcpNameSource(method, route.message.params);\n\tif (source === void 0) return;\n\tconst { field: sourceField, value: bodyValue } = source;\n\tif (request.mcpNameHeader === void 0) {\n\t\tif (bodyValue === void 0) return;\n\t\treturn crossCheckMismatch(\"name-header-missing\", \"(missing)\", `the body carries params.${sourceField}=\"${bodyValue}\" but the required Mcp-Name header is absent`, \"standard-header-validation\");\n\t}\n\tconst normalizedNameHeader = stripHttpOws(request.mcpNameHeader);\n\tconst decoded = decodeMcpParamValue(normalizedNameHeader);\n\tif (decoded === void 0) return crossCheckMismatch(\"name-header-invalid-encoding\", normalizedNameHeader, \"the Mcp-Name header carries an invalid Base64 sentinel value\", \"standard-header-validation\");\n\tif (bodyValue !== void 0 && decoded !== bodyValue) return crossCheckMismatch(\"name-header-mismatch\", normalizedNameHeader, `the body carries params.${sourceField}=\"${bodyValue}\" but the Mcp-Name header names \"${decoded}\"`, \"standard-header-validation\");\n}\nfunction isPlainObject$2(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\nfunction classificationForClaim(claimedVersion) {\n\tif (claimedVersion === void 0) return { era: \"modern\" };\n\treturn {\n\t\tera: isModernProtocolVersion(claimedVersion) ? \"modern\" : \"legacy\",\n\t\trevision: claimedVersion\n\t};\n}\n/**\n* Whether a request's params carry a per-request envelope claim that is both\n* well-formed and names a modern protocol revision.\n*\n* Used by the `initialize` precedence rule: only such a claim overrides the\n* `initialize` ⇒ legacy-handshake classification — a request carrying a valid\n* modern envelope is a modern request regardless of its method name, and the\n* modern era then answers `initialize` exactly like any other method it does\n* not define (method-not-found). A malformed claim, or one naming a pre-2026\n* revision, keeps the legacy-handshake routing unchanged.\n*\n* Exported on the core internal barrel for the stdio serving entry, which\n* applies the same precedence rule to a connection's opening message; not\n* public API.\n*/\nfunction carriesValidModernEnvelopeClaim(params) {\n\tif (!hasEnvelopeClaim(params)) return false;\n\tconst claimedVersion = envelopeClaimVersion(params);\n\tif (claimedVersion === void 0 || !isModernProtocolVersion(claimedVersion)) return false;\n\tconst meta = requestMetaOf(params);\n\treturn meta !== void 0 && validateEnvelopeMeta(meta).length === 0;\n}\nfunction classifyBatch(body) {\n\tif (body.length === 0) return rejection(\"jsonrpc-shape\", \"empty-batch\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: empty JSON-RPC batch\"), true);\n\tfor (const element of body) {\n\t\tif (hasEnvelopeClaim(isPlainObject$2(element) ? element[\"params\"] : void 0)) return rejection(\"jsonrpc-shape\", \"batch-with-modern-element\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later\"), true);\n\t\tif (!(isJSONRPCRequest(element) || isJSONRPCNotification(element) || isJSONRPCResultResponse(element) || isJSONRPCErrorResponse(element))) return rejection(\"jsonrpc-shape\", \"batch-with-invalid-element\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: JSON-RPC batch contains an invalid message\"), true);\n\t}\n\treturn {\n\t\tkind: \"legacy\",\n\t\treason: \"batch\"\n\t};\n}\nfunction classifyRequestBody(request, body) {\n\tconst params = body.params;\n\tconst method = body.method;\n\tconst headerVersion = request.protocolVersionHeader;\n\tconst headerNamesModern = headerVersion !== void 0 && isModernProtocolVersion(headerVersion);\n\tif (method === \"initialize\" && !carriesValidModernEnvelopeClaim(params)) {\n\t\tif (headerNamesModern) return crossCheckMismatch(\"initialize-with-modern-header\", headerVersion, \"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header\");\n\t\tconst requestedVersion = isPlainObject$2(params) && typeof params[\"protocolVersion\"] === \"string\" ? params[\"protocolVersion\"] : void 0;\n\t\treturn {\n\t\t\tkind: \"legacy\",\n\t\t\treason: \"initialize\",\n\t\t\t...requestedVersion !== void 0 && { requestedVersion }\n\t\t};\n\t}\n\tif (hasEnvelopeClaim(params)) {\n\t\tconst meta = requestMetaOf(params);\n\t\tconst firstIssue = (meta === void 0 ? [] : validateEnvelopeMeta(meta))[0];\n\t\tif (firstIssue !== void 0) return rejection(\"envelope\", \"envelope-invalid\", 400, new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid _meta envelope for protocol revision 2026-07-28: ${firstIssue.key}: ${firstIssue.problem}`, { envelope: firstIssue }), true);\n\t\tconst claimedVersion = envelopeClaimVersion(params);\n\t\tif (headerVersion !== void 0 && claimedVersion !== void 0 && headerVersion !== claimedVersion) return crossCheckMismatch(\"header-body-version-mismatch\", headerVersion, `the body envelope names protocol version ${claimedVersion} but the MCP-Protocol-Version header names ${headerVersion}`);\n\t\tif (request.mcpMethodHeader !== void 0 && request.mcpMethodHeader !== method) return crossCheckMismatch(\"method-header-mismatch\", request.mcpMethodHeader, `the body names method ${method} but the Mcp-Method header names ${request.mcpMethodHeader}`);\n\t\treturn {\n\t\t\tkind: \"modern\",\n\t\t\tmessageKind: \"request\",\n\t\t\tmessage: body,\n\t\t\tclassification: classificationForClaim(claimedVersion)\n\t\t};\n\t}\n\tif (headerNamesModern) {\n\t\tconst meta = requestMetaOf(params);\n\t\tconst missingFromEnvelope = validateEnvelopeMeta(meta ?? {}).filter((issue) => issue.problem === \"missing\").map((issue) => issue.key);\n\t\tconst missing = meta === void 0 ? [\"_meta\"] : missingFromEnvelope.length > 0 ? missingFromEnvelope : [PROTOCOL_VERSION_META_KEY];\n\t\treturn rejection(\"envelope\", \"modern-header-without-claim\", 400, new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params: the MCP-Protocol-Version header names protocol revision ${headerVersion}, but the request is missing the required per-request envelope key(s): ${missing.join(\", \")}`, { envelope: { missing } }), true);\n\t}\n\treturn {\n\t\tkind: \"legacy\",\n\t\treason: \"no-claim\",\n\t\t...headerVersion !== void 0 && { requestedVersion: headerVersion }\n\t};\n}\nfunction classifyNotificationBody(request, body) {\n\tconst params = body.params;\n\tconst method = body.method;\n\tconst headerVersion = request.protocolVersionHeader;\n\tconst headerNamesModern = headerVersion !== void 0 && isModernProtocolVersion(headerVersion);\n\tif (hasEnvelopeClaim(params)) {\n\t\tconst claimedVersion = envelopeClaimVersion(params);\n\t\tif (claimedVersion === void 0) {\n\t\t\tconst meta = requestMetaOf(params);\n\t\t\tconst claimIssue = (meta === void 0 ? [] : validateEnvelopeMeta(meta)).find((issue) => issue.key === PROTOCOL_VERSION_META_KEY) ?? {\n\t\t\t\tkey: PROTOCOL_VERSION_META_KEY,\n\t\t\t\tproblem: \"expected a protocol version string\"\n\t\t\t};\n\t\t\treturn rejection(\"envelope\", \"notification-envelope-invalid\", 400, new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid _meta envelope for protocol revision 2026-07-28: ${claimIssue.key}: ${claimIssue.problem}`, { envelope: claimIssue }), true);\n\t\t}\n\t\tif (headerVersion !== void 0 && headerVersion !== claimedVersion) return crossCheckMismatch(\"notification-header-body-version-mismatch\", headerVersion, `the notification envelope names protocol version ${claimedVersion} but the MCP-Protocol-Version header names ${headerVersion}`);\n\t\tconst classification = classificationForClaim(claimedVersion);\n\t\tif (classification.era === \"modern\" && request.mcpMethodHeader !== void 0 && request.mcpMethodHeader !== method) return crossCheckMismatch(\"notification-method-header-mismatch\", request.mcpMethodHeader, `the notification body names method ${method} but the Mcp-Method header names ${request.mcpMethodHeader}`);\n\t\treturn {\n\t\t\tkind: \"modern\",\n\t\t\tmessageKind: \"notification\",\n\t\t\tmessage: body,\n\t\t\tclassification\n\t\t};\n\t}\n\tif (headerNamesModern) {\n\t\tif (request.mcpMethodHeader !== void 0 && request.mcpMethodHeader !== method) return crossCheckMismatch(\"notification-method-header-mismatch\", request.mcpMethodHeader, `the notification body names method ${method} but the Mcp-Method header names ${request.mcpMethodHeader}`);\n\t\treturn {\n\t\t\tkind: \"modern\",\n\t\t\tmessageKind: \"notification\",\n\t\t\tmessage: body,\n\t\t\tclassification: {\n\t\t\t\tera: \"modern\",\n\t\t\t\trevision: headerVersion\n\t\t\t}\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"legacy\",\n\t\treason: \"notification\",\n\t\t...headerVersion !== void 0 && { requestedVersion: headerVersion }\n\t};\n}\n/**\n* Classifies one inbound HTTP request for dual-era serving.\n*\n* The body-primary predicate, evaluated once at the entry boundary: see the\n* module documentation for the rules. Returns a routing outcome (`legacy` or\n* `modern`) or a ladder rejection; it never throws.\n*/\nfunction classifyInboundRequest(request) {\n\trequest = {\n\t\t...request,\n\t\t...request.protocolVersionHeader !== void 0 && { protocolVersionHeader: stripHttpOws(request.protocolVersionHeader) },\n\t\t...request.mcpMethodHeader !== void 0 && { mcpMethodHeader: stripHttpOws(request.mcpMethodHeader) },\n\t\t...request.mcpNameHeader !== void 0 && { mcpNameHeader: stripHttpOws(request.mcpNameHeader) }\n\t};\n\tif (request.httpMethod.toUpperCase() !== \"POST\") return {\n\t\tkind: \"legacy\",\n\t\treason: \"http-method\"\n\t};\n\tconst body = request.body;\n\tif (Array.isArray(body)) return classifyBatch(body);\n\tif (isJSONRPCResultResponse(body) || isJSONRPCErrorResponse(body)) return {\n\t\tkind: \"legacy\",\n\t\treason: \"response\"\n\t};\n\tif (isPlainObject$2(body) && isJSONRPCRequest(body)) return classifyRequestBody(request, body);\n\tif (isPlainObject$2(body) && isJSONRPCNotification(body)) return classifyNotificationBody(request, body);\n\treturn rejection(\"jsonrpc-shape\", \"invalid-json-rpc-body\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: the request body is not a valid JSON-RPC message\"), true);\n}\n/**\n* The rejection a modern-only endpoint (no legacy serving configured)\n* answers a legacy-classified request with.\n*\n* - Envelope-less requests (including `initialize`) are answered with the\n*   unsupported-protocol-version error carrying the endpoint's supported\n*   versions and echoing the version the request named (when it named one —\n*   `requested` is omitted rather than fabricated when the request named no\n*   version at all), so a legacy client can discover what the endpoint serves\n*   from the error alone.\n* - Posted responses and batch arrays are invalid requests on the modern era.\n* - Non-`POST` methods are not allowed.\n* - Legacy-classified notifications return `undefined`: the caller answers\n*   202 with no body and does not dispatch the notification (accept-and-drop).\n*/\nfunction modernOnlyStrictRejection(route, supportedVersions) {\n\tswitch (route.reason) {\n\t\tcase \"http-method\": return rejection(\"http-method\", \"modern-only-method-not-allowed\", 405, new ProtocolError(-32e3, \"Method not allowed.\"), true);\n\t\tcase \"batch\": return rejection(\"jsonrpc-shape\", \"modern-only-batch-not-supported\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: JSON-RPC batches are not supported by this endpoint\"), true);\n\t\tcase \"response\": return rejection(\"jsonrpc-shape\", \"modern-only-response-post\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: JSON-RPC responses cannot be posted to this endpoint\"), true);\n\t\tcase \"notification\": return;\n\t\tcase \"initialize\":\n\t\tcase \"no-claim\": {\n\t\t\tconst requested = route.requestedVersion;\n\t\t\treturn rejection(\"era-classification\", \"modern-only-missing-envelope\", 400, requested === void 0 ? new ProtocolError(ProtocolErrorCode.UnsupportedProtocolVersion, \"Unsupported protocol version: the request did not name a protocol version\", { supported: [...supportedVersions] }) : new UnsupportedProtocolVersionError({\n\t\t\t\tsupported: [...supportedVersions],\n\t\t\t\trequested\n\t\t\t}), true);\n\t\t}\n\t}\n}\n\n//#endregion\n//#region ../core-internal/src/util/schema.ts\n/**\n* Internal Zod schema utilities for protocol handling.\n* These are used internally by the SDK for protocol message validation.\n*/\n/**\n* Parses data against a Zod schema (synchronous).\n* Returns a discriminated union with success/error.\n*/\nfunction parseSchema(schema, data) {\n\treturn z.safeParse(schema, data);\n}\n/**\n* Union of the declared shape keys across several Zod object schemas.\n*/\nfunction shapeKeys(schemas) {\n\treturn new Set(schemas.flatMap((schema) => Object.keys(schema.shape)));\n}\n\n//#endregion\n//#region ../core-internal/src/util/standardSchema.ts\n/**\n* Standard Schema utilities for user-provided schemas.\n* Supports Zod v4, Valibot, ArkType, and other Standard Schema implementations.\n* @see https://standardschema.dev\n*/\nfunction isStandardSchema(schema) {\n\tif (schema == null) return false;\n\tconst schemaType = typeof schema;\n\tif (schemaType !== \"object\" && schemaType !== \"function\") return false;\n\tif (!(\"~standard\" in schema)) return false;\n\treturn typeof schema[\"~standard\"]?.validate === \"function\";\n}\nlet warnedZodFallback = false;\n/** JSON Schema draft targeted by every conversion; shared so pattern references above stay in lockstep. */\nconst JSON_SCHEMA_CONVERSION_TARGET = \"draft-2020-12\";\n/**\n* Converts a StandardSchema to JSON Schema for use as an MCP tool/prompt schema.\n*\n* MCP requires `type: \"object\"` at the root of tool `inputSchema` and prompt\n* argument schemas; `outputSchema` may have any JSON Schema root (SEP-2106).\n* Zod's discriminated unions emit `{oneOf: [...]}` without a top-level `type`,\n* so for `io: 'input'` this function defaults `type` to `\"object\"` when absent\n* and throws on an explicit non-object `type` (e.g. `z.string()`). For\n* `io: 'output'` a non-object root is returned as-is; the `\"object\"` default is\n* applied only when the root is provably object-shaped.\n*/\nfunction standardSchemaToJsonSchema(schema, io = \"input\") {\n\tconst std = schema[\"~standard\"];\n\tlet result;\n\tif (std.jsonSchema) result = std.jsonSchema[io]({ target: JSON_SCHEMA_CONVERSION_TARGET });\n\telse if (std.vendor === \"zod\") {\n\t\tif (!(\"_zod\" in schema)) throw new Error(\"Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().\");\n\t\tif (!warnedZodFallback) {\n\t\t\twarnedZodFallback = true;\n\t\t\tconsole.warn(\"[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.\");\n\t\t}\n\t\tresult = z.toJSONSchema(schema, {\n\t\t\ttarget: JSON_SCHEMA_CONVERSION_TARGET,\n\t\t\tio\n\t\t});\n\t} else throw new Error(`Schema library \"${std.vendor}\" does not implement StandardJSONSchemaV1 (\\`~standard.jsonSchema\\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);\n\tif (io === \"output\") {\n\t\tif (result.type !== void 0) return result;\n\t\treturn isProvablyObjectShapedRoot(result) ? {\n\t\t\ttype: \"object\",\n\t\t\t...result\n\t\t} : result;\n\t}\n\tif (result.type !== void 0 && result.type !== \"object\") throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(result.type)}). Wrap your schema in z.object({...}) or equivalent.`);\n\treturn {\n\t\ttype: \"object\",\n\t\t...result\n\t};\n}\n/**\n* A typeless JSON Schema root is \"provably object-shaped\" when either it carries object keywords\n* directly (`properties`/`patternProperties`/`additionalProperties`/`required`), or it is a\n* composition (`oneOf`/`anyOf`/`allOf`) whose every member is itself `type:'object'` or recursively\n* provably object-shaped (e.g. a nested `discriminatedUnion`). `$ref` is not followed. Used to\n* decide whether stamping `type:'object'` is safe (redundant-but-valid) versus self-contradictory.\n*/\nfunction isProvablyObjectShapedRoot(schema) {\n\tif (\"properties\" in schema || \"patternProperties\" in schema || \"additionalProperties\" in schema || \"required\" in schema) return true;\n\tfor (const key of [\n\t\t\"oneOf\",\n\t\t\"anyOf\",\n\t\t\"allOf\"\n\t]) {\n\t\tconst members = schema[key];\n\t\tif (Array.isArray(members) && members.length > 0) return members.every((m) => m !== null && typeof m === \"object\" && (m.type === \"object\" || isProvablyObjectShapedRoot(m)));\n\t}\n\treturn false;\n}\nfunction formatIssue(issue) {\n\tif (!issue.path?.length) return issue.message;\n\treturn `${issue.path.map((p) => String(typeof p === \"object\" ? p.key : p)).join(\".\")}: ${issue.message}`;\n}\nasync function validateStandardSchema(schema, data) {\n\tconst result = await schema[\"~standard\"].validate(data);\n\tif (result.issues && result.issues.length > 0) return {\n\t\tsuccess: false,\n\t\terror: result.issues.map((i) => formatIssue(i)).join(\", \")\n\t};\n\treturn {\n\t\tsuccess: true,\n\t\tdata: result.value\n\t};\n}\nfunction zodEmittedPattern(schema) {\n\tconst jsonSchema = z.toJSONSchema(schema, {\n\t\ttarget: JSON_SCHEMA_CONVERSION_TARGET,\n\t\tio: \"input\"\n\t});\n\treturn typeof jsonSchema.pattern === \"string\" ? jsonSchema.pattern : void 0;\n}\nconst DATETIME_FRACTION_DIGITS = /\\\\\\.\\\\d\\{(\\d+)\\}/;\nfunction datetimeReferenceSchemas(pattern) {\n\tconst fractionDigits = DATETIME_FRACTION_DIGITS.exec(pattern);\n\tconst precisions = [\n\t\tvoid 0,\n\t\t-1,\n\t\t0\n\t];\n\tif (fractionDigits) precisions.push(Number(fractionDigits[1]));\n\treturn [false, true].flatMap((local) => [false, true].flatMap((offset) => precisions.map((precision) => z.iso.datetime({\n\t\tlocal,\n\t\toffset,\n\t\tprecision\n\t}))));\n}\nfunction referencePatternsForFormat(format, pattern) {\n\tlet referenceSchemas;\n\tswitch (format) {\n\t\tcase \"email\":\n\t\t\treferenceSchemas = [z.email()];\n\t\t\tbreak;\n\t\tcase \"uri\":\n\t\t\treferenceSchemas = [z.url()];\n\t\t\tbreak;\n\t\tcase \"date\":\n\t\t\treferenceSchemas = [z.iso.date()];\n\t\t\tbreak;\n\t\tcase \"date-time\":\n\t\t\treferenceSchemas = datetimeReferenceSchemas(pattern);\n\t\t\tbreak;\n\t}\n\treturn new Set(referenceSchemas.map((schema) => zodEmittedPattern(schema)).filter((emitted) => emitted !== void 0));\n}\n/** Whether `pattern` is the library's own realization of `format` (droppable) rather than a user customization. */\nfunction isLibraryFormatPattern(format, pattern, vendor) {\n\tif (vendor !== \"zod\") return true;\n\treturn referencePatternsForFormat(format, pattern).has(pattern);\n}\nfunction promptArgumentsFromStandardSchema(schema) {\n\tconst jsonSchema = standardSchemaToJsonSchema(schema, \"input\");\n\tconst properties = jsonSchema.properties || {};\n\tconst required = jsonSchema.required || [];\n\treturn Object.entries(properties).map(([name, prop]) => ({\n\t\tname,\n\t\tdescription: prop?.description,\n\t\trequired: required.includes(name)\n\t}));\n}\n\n//#endregion\n//#region ../core-internal/src/shared/elicitation.ts\nfunction isJsonObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction convertStandardElicitationSchema(schema) {\n\ttry {\n\t\treturn standardSchemaToJsonSchema(schema, \"input\");\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema must describe an object with flat primitive properties: ${detail}`);\n\t}\n}\nconst ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS = new Set([\n\t\"$comment\",\n\t\"deprecated\",\n\t\"description\",\n\t\"examples\",\n\t\"readOnly\",\n\t\"title\",\n\t\"writeOnly\"\n]);\nfunction isAnnotationOnlyJsonSchemaKeyword(key) {\n\treturn ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS.has(key) || key.startsWith(\"x-\");\n}\nconst ROOT_KEYS = new Set([\"$schema\", ...Object.keys(ElicitRequestFormParamsSchema.shape.requestedSchema.shape)]);\nconst PROPERTY_KEYS_BY_TYPE = {\n\tstring: shapeKeys([\n\t\tStringSchemaSchema,\n\t\tUntitledSingleSelectEnumSchemaSchema,\n\t\tTitledSingleSelectEnumSchemaSchema,\n\t\tLegacyTitledEnumSchemaSchema\n\t]),\n\tnumber: shapeKeys([NumberSchemaSchema]),\n\tinteger: shapeKeys([NumberSchemaSchema]),\n\tboolean: shapeKeys([BooleanSchemaSchema]),\n\tarray: shapeKeys([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema])\n};\nconst SUPPORTED_STRING_FORMATS = new Set(StringSchemaSchema.shape.format.unwrap().options);\n/** Walks one property node: keeps grammar keys, drops the library format pattern, rejects unknown constraints. */\nfunction walkProperty(node, path, vendor, unsupported) {\n\tif (!isJsonObject(node)) return node;\n\tconst allowedKeys = typeof node.type === \"string\" && Object.hasOwn(PROPERTY_KEYS_BY_TYPE, node.type) ? PROPERTY_KEYS_BY_TYPE[node.type] : void 0;\n\tif (allowedKeys === void 0) return node;\n\tconst pruned = {};\n\tfor (const [key, value] of Object.entries(node)) if (allowedKeys.has(key) || isAnnotationOnlyJsonSchemaKeyword(key)) pruned[key] = value;\n\telse if (key === \"pattern\" && node.type === \"string\" && typeof node.format === \"string\") {\n\t\tif (!SUPPORTED_STRING_FORMATS.has(node.format)) pruned[key] = value;\n\t\telse if (typeof value !== \"string\" || !isLibraryFormatPattern(node.format, value, vendor)) unsupported.push(`${path}.${key}`);\n\t} else unsupported.push(`${path}.${key}`);\n\treturn pruned;\n}\n/** Walks the schema root: keeps the spec root keys, drops annotations, rejects the rest. */\nfunction walkRequestedSchema(converted, vendor) {\n\tconst pruned = {};\n\tconst unsupported = [];\n\tfor (const [key, value] of Object.entries(converted)) if (key === \"properties\" && isJsonObject(value)) pruned[key] = Object.fromEntries(Object.entries(value).map(([name, node]) => [name, walkProperty(node, `properties.${name}`, vendor, unsupported)]));\n\telse if (ROOT_KEYS.has(key)) pruned[key] = value;\n\telse if (!isAnnotationOnlyJsonSchemaKeyword(key)) unsupported.push(key);\n\tif (unsupported.length > 0) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${unsupported.join(\", \")}`);\n\treturn pruned;\n}\n/** Names the properties that fail value validation, instead of surfacing a raw union dump. */\nfunction describeUnsupportedProperties(pruned, fallback) {\n\tif (!isJsonObject(pruned.properties)) return fallback;\n\tconst offenders = Object.entries(pruned.properties).filter(([, node]) => !parseSchema(PrimitiveSchemaDefinitionSchema, node).success).map(([name]) => `properties.${name}`);\n\treturn offenders.length > 0 ? offenders.join(\", \") : fallback;\n}\nfunction findDroppedConstraintPaths(original, parsed, path = \"\") {\n\tif (Array.isArray(original) && Array.isArray(parsed)) return original.flatMap((item, index) => findDroppedConstraintPaths(item, parsed[index], `${path}[${index}]`));\n\tif (!isJsonObject(original) || !isJsonObject(parsed)) return [];\n\treturn Object.entries(original).flatMap(([key, value]) => {\n\t\tconst childPath = path ? `${path}.${key}` : key;\n\t\tif (!Object.prototype.hasOwnProperty.call(parsed, key)) return isAnnotationOnlyJsonSchemaKeyword(key) ? [] : [childPath];\n\t\treturn findDroppedConstraintPaths(value, parsed[key], childPath);\n\t});\n}\n/** Converts an authoring-friendly elicitation input into its wire-ready form. */\nfunction normalizeElicitInputParams(input) {\n\tif (!isStandardSchema(input.requestedSchema)) return {\n\t\t...input,\n\t\tmode: \"form\",\n\t\trequestedSchema: input.requestedSchema\n\t};\n\tconst vendor = input.requestedSchema[\"~standard\"].vendor;\n\tconst pruned = walkRequestedSchema(convertStandardElicitationSchema(input.requestedSchema), vendor);\n\tconst parsed = parseSchema(ElicitRequestFormParamsSchema.shape.requestedSchema, pruned);\n\tif (!parsed.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${describeUnsupportedProperties(pruned, parsed.error.message)}`);\n\tconst droppedConstraints = findDroppedConstraintPaths(pruned, parsed.data);\n\tif (droppedConstraints.length > 0) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${droppedConstraints.join(\", \")}`);\n\tconst danglingRequired = (parsed.data.required ?? []).filter((key) => !Object.prototype.hasOwnProperty.call(parsed.data.properties, key));\n\tif (danglingRequired.length > 0) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema lists required properties that are not defined in properties: ${danglingRequired.join(\", \")}`);\n\treturn {\n\t\t...input,\n\t\tmode: \"form\",\n\t\trequestedSchema: parsed.data\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/shared/inputRequired.ts\n/**\n* Authoring helpers for multi-round-trip requests (protocol revision\n* 2026-07-28).\n*\n* A handler for one of the multi-round-trip methods (`tools/call`,\n* `prompts/get`, `resources/read`) requests additional client input by\n* returning an {@linkcode InputRequiredResult} instead of a final result. The\n* helpers here build that return value and its embedded requests as NEUTRAL\n* values; only the 2026-07-28 wire codec maps them to/from the wire. The\n* 2025-era codec has no input-required vocabulary — on a 2025-era request the\n* server's legacy shim (on by default) fulfils the embedded requests as real\n* server→client requests and re-enters the handler, so the same return shape\n* serves both eras; `ServerOptions.inputRequired.legacyShim: false` restores\n* the pre-shim loud failure.\n*\n* There is no nominal brand: `resultType: 'input_required'` is the\n* discriminator, and hand-built result literals are equally legal — the\n* server seam re-checks the at-least-one rule for them.\n*/\nfunction buildInputRequired(spec) {\n\tconst hasInputRequests = spec.inputRequests !== void 0 && Object.keys(spec.inputRequests).length > 0;\n\tconst hasRequestState = typeof spec.requestState === \"string\";\n\tif (!hasInputRequests && !hasRequestState) throw new TypeError(\"inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)\");\n\treturn {\n\t\tresultType: \"input_required\",\n\t\t...spec.inputRequests !== void 0 && { inputRequests: spec.inputRequests },\n\t\t...spec.requestState !== void 0 && { requestState: spec.requestState }\n\t};\n}\n/**\n* Builder for the input-required return value of multi-round-trip handlers,\n* with per-kind constructors for the embedded requests\n* (`inputRequired.elicit`, `inputRequired.elicitUrl`,\n* `inputRequired.createMessage`, `inputRequired.listRoots`).\n*\n* @example Write-once tool requesting confirmation\n* ```ts\n* server.registerTool('deploy', { inputSchema: z.object({ env: z.string() }) }, async ({ env }, ctx) => {\n*     const confirmationSchema = z.object({ confirm: z.boolean() });\n*     const confirmed = acceptedContent(ctx.mcpReq.inputResponses, 'confirm', confirmationSchema);\n*     if (confirmed?.confirm !== true) {\n*         return inputRequired({\n*             inputRequests: {\n*                 confirm: inputRequired.elicit({\n*                     message: `Deploy to ${env}?`,\n*                     requestedSchema: confirmationSchema\n*                 })\n*             }\n*         });\n*     }\n*     return { content: [{ type: 'text', text: `deployed to ${env}` }] };\n* });\n* ```\n*/\nconst inputRequired = Object.assign(buildInputRequired, {\n\telicit(params) {\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tmethod: \"elicitation/create\",\n\t\t\t\tparams: normalizeElicitInputParams(params)\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tthrow error instanceof ProtocolError ? new TypeError(error.message, { cause: error }) : error;\n\t\t}\n\t},\n\telicitUrl(params) {\n\t\treturn {\n\t\t\tmethod: \"elicitation/create\",\n\t\t\tparams: {\n\t\t\t\t...params,\n\t\t\t\tmode: \"url\"\n\t\t\t}\n\t\t};\n\t},\n\tcreateMessage(params) {\n\t\treturn {\n\t\t\tmethod: \"sampling/createMessage\",\n\t\t\tparams\n\t\t};\n\t},\n\tlistRoots() {\n\t\treturn { method: \"roots/list\" };\n\t}\n});\nfunction acceptedContent(responses, key, schema) {\n\tconst view = inputResponse(responses, key);\n\tif (view.kind !== \"elicit\" || view.action !== \"accept\" || view.content === void 0) return void 0;\n\tif (schema === void 0) return view.content;\n\tconst outcome = schema[\"~standard\"].validate(view.content);\n\tif (outcome instanceof Promise) throw new TypeError(\"acceptedContent(responses, key, schema) requires a synchronously-validating schema\");\n\treturn outcome.issues === void 0 ? outcome.value : void 0;\n}\n/**\n* Reads one entry of a retried request's `inputResponses`\n* (`ctx.mcpReq.inputResponses`) as a discriminated view, covering\n* decline/cancel detection and the non-elicitation response kinds that\n* {@linkcode acceptedContent} does not surface.\n*\n* The values arrive from the client and are not re-validated here — treat\n* them as untrusted input (validate elicitation content with the\n* schema-aware {@linkcode acceptedContent} overload where it matters).\n*/\nfunction inputResponse(responses, key) {\n\tif (responses === void 0 || typeof responses !== \"object\" || responses === null) return { kind: \"missing\" };\n\tconst entry = responses[key];\n\tif (entry === null || typeof entry !== \"object\" || Array.isArray(entry)) return { kind: \"missing\" };\n\tconst candidate = entry;\n\tif (candidate[\"action\"] === \"accept\" || candidate[\"action\"] === \"decline\" || candidate[\"action\"] === \"cancel\") {\n\t\tconst content = candidate[\"content\"];\n\t\treturn {\n\t\t\tkind: \"elicit\",\n\t\t\taction: candidate[\"action\"],\n\t\t\t...content !== null && typeof content === \"object\" && !Array.isArray(content) && { content }\n\t\t};\n\t}\n\tif (Array.isArray(candidate[\"roots\"])) return {\n\t\tkind: \"roots\",\n\t\troots: candidate[\"roots\"]\n\t};\n\tif (typeof candidate[\"role\"] === \"string\" && candidate[\"content\"] !== void 0) return {\n\t\tkind: \"sampling\",\n\t\tresult: candidate\n\t};\n\treturn { kind: \"missing\" };\n}\n\n//#endregion\n//#region ../core-internal/src/shared/inputRequiredDriver.ts\n/**\n* The multi-round-trip auto-fulfilment driver (protocol revision 2026-07-28).\n*\n* When a request to one of the multi-round-trip methods comes back as\n* `input_required`, the driver fulfils the embedded input requests by\n* dispatching them to the client's already-registered handlers (elicitation,\n* sampling, roots — one generic engine, no per-feature API), then retries the\n* original request with the collected `inputResponses` and a byte-exact echo\n* of `requestState`, on a fresh request id, until the server returns a\n* complete result or the round cap is exhausted.\n*\n* The driver is a LAYER OVER THE MANUAL PATH: each retry is issued with the\n* same primitive a manual caller uses (`allowInputRequired` semantics — the\n* retry hands back the next `input_required` payload instead of recursing),\n* so the loop, the cap, and the pacing live in one place and disabling\n* auto-fulfilment (`inputRequired.autoFulfill: false`) simply skips this\n* module. Timeouts ride the EXISTING knobs: the per-leg `timeout` applies to\n* every wire leg unchanged, and `maxTotalTimeout` bounds the whole flow by\n* shrinking the budget passed to each leg — no new timer system.\n*/\n/**\n* Fixed pacing applied before retrying a requestState-only (load-shedding)\n* leg — a leg that carries no embedded input requests, so nothing slows the\n* loop down naturally. Counted in the same round cap.\n*/\nconst REQUEST_STATE_ONLY_LEG_PACING_MS = 250;\n/**\n* The message both multi-round-trip loops emit when the round cap is\n* exhausted — the client driver as a typed error, the server-side legacy\n* shim as its per-family failure. One formatter so the texts cannot drift\n* (hosts and models read the tool-result copy verbatim).\n*/\nfunction inputRequiredRoundsExceededMessage(method, maxRounds) {\n\treturn `Multi-round-trip request '${method}' still required input after ${maxRounds} rounds (inputRequired.maxRounds)`;\n}\n/**\n* Abortable delay: resolves after `ms`, or rejects with the signal's reason\n* (wrapped in an `SdkError` when it isn't already one) if the signal aborts\n* first. Aborting after resolution is a no-op. Shared with the server-side\n* legacy shim (the pacing semantics must match per era).\n*/\nfunction sleep(ms, signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(signal.reason instanceof SdkError ? signal.reason : new SdkError(SdkErrorCode.RequestTimeout, String(signal.reason)));\n\t\t\treturn;\n\t\t}\n\t\tconst timer = setTimeout(() => {\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\tresolve();\n\t\t}, ms);\n\t\tconst onAbort = () => {\n\t\t\tclearTimeout(timer);\n\t\t\treject(signal?.reason instanceof SdkError ? signal.reason : new SdkError(SdkErrorCode.RequestTimeout, String(signal?.reason)));\n\t\t};\n\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n}\n/**\n* A per-round abort linked to the caller's signal: the embedded sibling\n* dispatches share it, so the first failure (or a caller abort) cancels the\n* others instead of leaving them running. Shared with the server-side legacy\n* shim (the abort-linkage semantics must match per era).\n*/\nfunction linkedRoundAbort(outer) {\n\tconst controller = new AbortController();\n\tconst onOuterAbort = () => controller.abort(outer?.reason);\n\touter?.addEventListener(\"abort\", onOuterAbort, { once: true });\n\tif (outer?.aborted) controller.abort(outer.reason);\n\treturn {\n\t\tsignal: controller.signal,\n\t\tabort: (reason) => controller.abort(reason),\n\t\tdispose: () => outer?.removeEventListener(\"abort\", onOuterAbort)\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/types/specTypeSchema.ts\n/**\n* Explicit allowlist of protocol Zod schemas that correspond to a public spec type in `types.ts`.\n*\n* This intentionally excludes internal helper schemas exported from `schemas.ts` that have no\n* matching public type (e.g. `ListChangedOptionsBaseSchema`, `BaseRequestParamsSchema`,\n* `NotificationsParamsSchema`, `ClientTasksCapabilitySchema`, `ServerTasksCapabilitySchema`).\n* Keeping the list explicit means new public spec types must be added here deliberately, and\n* internals never leak into `SpecTypeName`.\n*\n* `ResourceTemplateSchema` is included; its public type is exported as `ResourceTemplateType`\n* (the bare name collides with the server package's `ResourceTemplate` class), so\n* `SpecTypes['ResourceTemplate']` is structurally equal to `ResourceTemplateType` rather than to\n* a type literally named `ResourceTemplate`.\n*/\nconst SPEC_SCHEMA_KEYS = [\n\t\"AnnotationsSchema\",\n\t\"AudioContentSchema\",\n\t\"BaseMetadataSchema\",\n\t\"BlobResourceContentsSchema\",\n\t\"BooleanSchemaSchema\",\n\t\"CallToolRequestSchema\",\n\t\"CallToolRequestParamsSchema\",\n\t\"CallToolResultSchema\",\n\t\"CancelledNotificationSchema\",\n\t\"CancelledNotificationParamsSchema\",\n\t\"CancelTaskRequestSchema\",\n\t\"CancelTaskResultSchema\",\n\t\"ClientCapabilitiesSchema\",\n\t\"ClientNotificationSchema\",\n\t\"ClientRequestSchema\",\n\t\"ClientResultSchema\",\n\t\"CompatibilityCallToolResultSchema\",\n\t\"CompleteRequestSchema\",\n\t\"CompleteRequestParamsSchema\",\n\t\"CompleteResultSchema\",\n\t\"ContentBlockSchema\",\n\t\"CreateMessageRequestSchema\",\n\t\"CreateMessageRequestParamsSchema\",\n\t\"CreateMessageResultSchema\",\n\t\"CreateMessageResultWithToolsSchema\",\n\t\"CreateTaskResultSchema\",\n\t\"CursorSchema\",\n\t\"DiscoverRequestSchema\",\n\t\"DiscoverResultSchema\",\n\t\"ElicitationCompleteNotificationSchema\",\n\t\"ElicitationCompleteNotificationParamsSchema\",\n\t\"ElicitRequestSchema\",\n\t\"ElicitRequestFormParamsSchema\",\n\t\"ElicitRequestParamsSchema\",\n\t\"ElicitRequestURLParamsSchema\",\n\t\"ElicitResultSchema\",\n\t\"EmbeddedResourceSchema\",\n\t\"EmptyResultSchema\",\n\t\"EnumSchemaSchema\",\n\t\"GetPromptRequestSchema\",\n\t\"GetPromptRequestParamsSchema\",\n\t\"GetPromptResultSchema\",\n\t\"GetTaskPayloadRequestSchema\",\n\t\"GetTaskPayloadResultSchema\",\n\t\"GetTaskRequestSchema\",\n\t\"GetTaskResultSchema\",\n\t\"IconSchema\",\n\t\"IconsSchema\",\n\t\"ImageContentSchema\",\n\t\"ImplementationSchema\",\n\t\"InitializedNotificationSchema\",\n\t\"InitializeRequestSchema\",\n\t\"InitializeRequestParamsSchema\",\n\t\"InitializeResultSchema\",\n\t\"JSONArraySchema\",\n\t\"JSONObjectSchema\",\n\t\"JSONRPCErrorResponseSchema\",\n\t\"JSONRPCMessageSchema\",\n\t\"JSONRPCNotificationSchema\",\n\t\"JSONRPCRequestSchema\",\n\t\"JSONRPCResponseSchema\",\n\t\"JSONRPCResultResponseSchema\",\n\t\"JSONValueSchema\",\n\t\"LegacyTitledEnumSchemaSchema\",\n\t\"ListPromptsRequestSchema\",\n\t\"ListPromptsResultSchema\",\n\t\"ListResourcesRequestSchema\",\n\t\"ListResourcesResultSchema\",\n\t\"ListResourceTemplatesRequestSchema\",\n\t\"ListResourceTemplatesResultSchema\",\n\t\"ListRootsRequestSchema\",\n\t\"ListRootsResultSchema\",\n\t\"ListTasksRequestSchema\",\n\t\"ListTasksResultSchema\",\n\t\"ListToolsRequestSchema\",\n\t\"ListToolsResultSchema\",\n\t\"LoggingLevelSchema\",\n\t\"LoggingMessageNotificationSchema\",\n\t\"LoggingMessageNotificationParamsSchema\",\n\t\"ModelHintSchema\",\n\t\"ModelPreferencesSchema\",\n\t\"MultiSelectEnumSchemaSchema\",\n\t\"NotificationSchema\",\n\t\"NumberSchemaSchema\",\n\t\"PaginatedRequestSchema\",\n\t\"PaginatedRequestParamsSchema\",\n\t\"PaginatedResultSchema\",\n\t\"PingRequestSchema\",\n\t\"PrimitiveSchemaDefinitionSchema\",\n\t\"ProgressSchema\",\n\t\"ProgressNotificationSchema\",\n\t\"ProgressNotificationParamsSchema\",\n\t\"ProgressTokenSchema\",\n\t\"PromptSchema\",\n\t\"PromptArgumentSchema\",\n\t\"PromptListChangedNotificationSchema\",\n\t\"PromptMessageSchema\",\n\t\"PromptReferenceSchema\",\n\t\"ReadResourceRequestSchema\",\n\t\"ReadResourceRequestParamsSchema\",\n\t\"ReadResourceResultSchema\",\n\t\"RelatedTaskMetadataSchema\",\n\t\"RequestSchema\",\n\t\"RequestIdSchema\",\n\t\"RequestMetaSchema\",\n\t\"ResourceSchema\",\n\t\"ResourceContentsSchema\",\n\t\"ResourceLinkSchema\",\n\t\"ResourceListChangedNotificationSchema\",\n\t\"ResourceRequestParamsSchema\",\n\t\"ResourceTemplateSchema\",\n\t\"ResourceTemplateReferenceSchema\",\n\t\"ResourceUpdatedNotificationSchema\",\n\t\"ResourceUpdatedNotificationParamsSchema\",\n\t\"ResultMetaObjectSchema\",\n\t\"ResultSchema\",\n\t\"RoleSchema\",\n\t\"RootSchema\",\n\t\"RootsListChangedNotificationSchema\",\n\t\"SamplingContentSchema\",\n\t\"SamplingMessageSchema\",\n\t\"SamplingMessageContentBlockSchema\",\n\t\"ServerCapabilitiesSchema\",\n\t\"ServerNotificationSchema\",\n\t\"ServerRequestSchema\",\n\t\"ServerResultSchema\",\n\t\"SetLevelRequestSchema\",\n\t\"SetLevelRequestParamsSchema\",\n\t\"SingleSelectEnumSchemaSchema\",\n\t\"StringSchemaSchema\",\n\t\"SubscribeRequestSchema\",\n\t\"SubscribeRequestParamsSchema\",\n\t\"SubscriptionFilterSchema\",\n\t\"SubscriptionsAcknowledgedNotificationSchema\",\n\t\"SubscriptionsAcknowledgedNotificationParamsSchema\",\n\t\"SubscriptionsListenRequestSchema\",\n\t\"SubscriptionsListenRequestParamsSchema\",\n\t\"SubscriptionsListenResultSchema\",\n\t\"SubscriptionsListenResultMetaSchema\",\n\t\"TaskAugmentedRequestParamsSchema\",\n\t\"TaskCreationParamsSchema\",\n\t\"TaskMetadataSchema\",\n\t\"TaskSchema\",\n\t\"TaskStatusSchema\",\n\t\"TaskStatusNotificationSchema\",\n\t\"TaskStatusNotificationParamsSchema\",\n\t\"TextContentSchema\",\n\t\"TextResourceContentsSchema\",\n\t\"TitledMultiSelectEnumSchemaSchema\",\n\t\"TitledSingleSelectEnumSchemaSchema\",\n\t\"ToolSchema\",\n\t\"ToolAnnotationsSchema\",\n\t\"ToolChoiceSchema\",\n\t\"ToolExecutionSchema\",\n\t\"ToolListChangedNotificationSchema\",\n\t\"ToolResultContentSchema\",\n\t\"ToolUseContentSchema\",\n\t\"UnsubscribeRequestSchema\",\n\t\"UnsubscribeRequestParamsSchema\",\n\t\"UntitledMultiSelectEnumSchemaSchema\",\n\t\"UntitledSingleSelectEnumSchemaSchema\"\n];\nconst authSchemas = {\n\tIdJagTokenExchangeResponseSchema,\n\tOAuthClientInformationFullSchema,\n\tOAuthClientInformationSchema,\n\tOAuthClientMetadataSchema,\n\tOAuthClientRegistrationErrorSchema,\n\tOAuthErrorResponseSchema,\n\tOAuthMetadataSchema,\n\tOAuthProtectedResourceMetadataSchema,\n\tOAuthTokenRevocationRequestSchema,\n\tOAuthTokensSchema,\n\tOpenIdProviderDiscoveryMetadataSchema,\n\tOpenIdProviderMetadataSchema\n};\nconst _specTypeSchemas = {};\nconst _isSpecType = {};\nfunction register(key, schema) {\n\tconst name = key.slice(0, -6);\n\t_specTypeSchemas[name] = schema;\n\t_isSpecType[name] = (v) => schema.safeParse(v).success;\n}\nfor (const key of SPEC_SCHEMA_KEYS) register(key, schemas_exports[key]);\nfor (const [key, schema] of Object.entries(authSchemas)) register(key, schema);\n/**\n* Runtime validators for every MCP spec type, keyed by type name.\n*\n* Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for\n* example an extension's custom-method payload that embeds a `CallToolResult`, or a value read from\n* storage that should be a `Tool`.\n*\n* Each entry implements the Standard Schema interface, so it composes with any\n* Standard-Schema-aware library. For a simple boolean check, use {@linkcode isSpecType} instead.\n*\n* @example\n* ```ts source=\"./specTypeSchema.examples.ts#specTypeSchemas_basicUsage\"\n* const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);\n* if (result.issues === undefined) {\n*     // result.value is CallToolResult\n* }\n* ```\n*/\nconst specTypeSchemas = Object.freeze(_specTypeSchemas);\n/**\n* Type predicates for every MCP spec type, keyed by type name.\n*\n* Returns `true` if the value satisfies the schema's input type (`z.input<>`, before defaults and\n* transforms are applied), and narrows to that input type. For schemas with `.default()` or\n* `.preprocess()`, this may accept values that do not structurally match the named output type;\n* for example `isSpecType.CallToolResult({})` is `true` because `content` has a default. Use\n* `specTypeSchemas.X['~standard'].validate(value)` when you need the validated output value.\n*\n* Each guard is a standalone function, so it can be passed directly as a callback.\n*\n* @example\n* ```ts source=\"./specTypeSchema.examples.ts#isSpecType_basicUsage\"\n* if (isSpecType.ContentBlock(value)) {\n*     // value is ContentBlock\n* }\n*\n* const blocks = mixed.filter(isSpecType.ContentBlock);\n* ```\n*/\nconst isSpecType = Object.freeze(_isSpecType);\n\n//#endregion\n//#region ../core-internal/src/wire/bootstrap.ts\nfunction bootstrapOutboundCodec(method) {\n\tswitch (method) {\n\t\tcase \"initialize\":\n\t\tcase \"notifications/initialized\": return codecForVersion(void 0);\n\t\tcase \"server/discover\": return codecForVersion(MODERN_WIRE_REVISION);\n\t\tdefault: return;\n\t}\n}\n\n//#endregion\n//#region ../core-internal/src/shared/protocol.ts\n/**\n* The default request timeout, in milliseconds.\n*/\nconst DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;\n/**\n* The reserved per-request `_meta` envelope keys (protocol revision\n* 2026-07-28). The protocol layer lifts these out of inbound `_meta` before\n* handlers run and surfaces them at `ctx.mcpReq.envelope` — they are\n* wire-level bookkeeping, not handler material.\n*/\nconst RESERVED_ENVELOPE_META_KEYS = [\n\tPROTOCOL_VERSION_META_KEY,\n\tCLIENT_INFO_META_KEY,\n\tCLIENT_CAPABILITIES_META_KEY,\n\tLOG_LEVEL_META_KEY\n];\n/**\n* Top-level params members carrying multi-round-trip driver material\n* (protocol revision 2026-07-28). The spec reserves these names on\n* client-initiated REQUESTS only — notification params keep them untouched\n* (a vendor notification may legitimately use the same names).\n*/\nconst RETRY_PARAMS_KEYS = [\"inputResponses\", \"requestState\"];\n/**\n* Lift wire-only material out of an inbound message so handlers see exactly\n* the 2025-era shape, and surface it for the protocol layer (requests: via\n* `ctx.mcpReq`). What counts as wire-only depends on the message kind: the\n* reserved envelope `_meta` keys are reserved on every message, while the\n* multi-round-trip retry fields (`inputResponses`/`requestState`) are\n* reserved on client-initiated requests only — so notifications get only the\n* envelope lift, and their top-level params stay untouched. Messages without\n* wire-only material are returned unchanged (same reference).\n*/\nfunction liftWireOnlyMaterial(message, kind) {\n\tconst params = message.params;\n\tif (!isPlainObject$1(params)) return {\n\t\tmessage,\n\t\tlifted: {}\n\t};\n\tconst meta = params._meta;\n\tconst envelopeKeys = isPlainObject$1(meta) ? RESERVED_ENVELOPE_META_KEYS.filter((key) => key in meta) : [];\n\tconst retryKeys = kind === \"request\" ? RETRY_PARAMS_KEYS.filter((key) => key in params) : [];\n\tif (envelopeKeys.length === 0 && retryKeys.length === 0) return {\n\t\tmessage,\n\t\tlifted: {}\n\t};\n\tconst lifted = {};\n\tconst nextParams = { ...params };\n\tif (envelopeKeys.length > 0 && isPlainObject$1(meta)) {\n\t\tconst envelope = {};\n\t\tconst nextMeta = { ...meta };\n\t\tfor (const key of envelopeKeys) {\n\t\t\tenvelope[key] = meta[key];\n\t\t\tdelete nextMeta[key];\n\t\t}\n\t\tlifted.envelope = envelope;\n\t\tif (Object.keys(nextMeta).length > 0) nextParams._meta = nextMeta;\n\t\telse delete nextParams._meta;\n\t}\n\tfor (const key of retryKeys) {\n\t\tif (key === \"inputResponses\") lifted.inputResponses = nextParams[key];\n\t\tif (key === \"requestState\") lifted.requestState = nextParams[key];\n\t\tdelete nextParams[key];\n\t}\n\treturn {\n\t\tmessage: {\n\t\t\t...message,\n\t\t\tparams: nextParams\n\t\t},\n\t\tlifted\n\t};\n}\n/**\n* Standard Schema adapter over the era codec's `validateResult` function (the\n* function-only WireCodec contract exposes no schema objects). Used by the\n* spec-method `request()` overload so the request funnel keeps a single\n* `StandardSchemaV1`-shaped validation seam for both spec and explicit-schema\n* paths.\n*\n* Returns `undefined` when the method has no result entry on this era's\n* registry — the caller maps that to the synchronous \"pass a result schema\"\n* TypeError, exactly matching the pre-function-only behavior the\n* typedMapAlignment suite pins (the result map deliberately excludes the\n* `tasks/*` methods, so the spec-method overload refuses them up front).\n*/\nfunction codecResultValidator(codec, method) {\n\tconst probe = codec.validateResult(method, void 0);\n\tif (!probe.ok && probe.reason === \"not-in-era\") return void 0;\n\treturn { \"~standard\": {\n\t\tversion: 1,\n\t\tvendor: \"mcp-wire-codec\",\n\t\tvalidate(value) {\n\t\t\tconst outcome = codec.validateResult(method, value);\n\t\t\tif (outcome.ok) return { value: outcome.value };\n\t\t\treturn { issues: [{ message: outcome.reason === \"invalid\" ? outcome.message : `not-in-era: ${method}` }] };\n\t\t}\n\t} };\n}\n/**\n* Builds the `ctx.mcpReq.requestState` accessor for a resolved value. The\n* `as T` below is the one place {@linkcode RequestStateAccessor}'s\n* caller-asserted typing is implemented — no implementation can produce an\n* arbitrary `T` from a runtime value honestly.\n*/\nfunction requestStateAccessor(value) {\n\treturn () => value;\n}\n/** Shared no-state accessor: the common case allocates nothing per request. */\nconst NO_REQUEST_STATE = requestStateAccessor(void 0);\n/**\n* Returns a context whose `requestState` accessor reads the given value —\n* how the server seam hands a verify hook's decoded payload (or the legacy\n* shim's per-round echo) to the handler without mutating the original\n* context.\n*/\nfunction withRequestStateValue(ctx, value) {\n\treturn {\n\t\t...ctx,\n\t\tmcpReq: {\n\t\t\t...ctx.mcpReq,\n\t\t\trequestState: requestStateAccessor(value)\n\t\t}\n\t};\n}\nlet writeNegotiatedProtocolVersion;\n/**\n* Package-internal write channel for a {@linkcode Protocol} instance's\n* negotiated protocol version, for callers outside the class hierarchy:\n* tests and the (future) modern-era server entry that marks a factory\n* instance modern at binding time. Exported on the core internal barrel\n* only — never public API.\n*/\nfunction setNegotiatedProtocolVersion(instance, version) {\n\twriteNegotiatedProtocolVersion(instance, version);\n}\n/**\n* Implements MCP protocol framing on top of a pluggable transport, including\n* features like request/response linking, notifications, and progress.\n*\n* `Protocol` is abstract; `Client` and `Server` are the concrete role-specific\n* implementations most code should use.\n*/\nvar Protocol = class {\n\t_transport;\n\t_requestMessageId = 0;\n\t_requestHandlers = /* @__PURE__ */ new Map();\n\t/** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */\n\t_customSchemaRequestMethods = /* @__PURE__ */ new Set();\n\t_requestHandlerAbortControllers = /* @__PURE__ */ new Map();\n\t_notificationHandlers = /* @__PURE__ */ new Map();\n\t_responseHandlers = /* @__PURE__ */ new Map();\n\t_progressHandlers = /* @__PURE__ */ new Map();\n\t_timeoutInfo = /* @__PURE__ */ new Map();\n\t_pendingDebouncedNotifications = /* @__PURE__ */ new Set();\n\t/**\n\t* The protocol version negotiated for the current connection (`undefined`\n\t* before negotiation completes), which determines the wire era this\n\t* instance speaks. Set by the SDK's negotiation and initialize paths\n\t* (`Client.connect`, `Server._oninitialize`).\n\t*/\n\t_negotiatedProtocolVersion;\n\tstatic {\n\t\twriteNegotiatedProtocolVersion = (instance, version) => {\n\t\t\tinstance._negotiatedProtocolVersion = version;\n\t\t};\n\t}\n\t_supportedProtocolVersions;\n\t/**\n\t* Callback for when the connection is closed for any reason.\n\t*\n\t* This is invoked when {@linkcode Protocol.close | close()} is called as well.\n\t*/\n\tonclose;\n\t/**\n\t* Callback for when an error occurs.\n\t*\n\t* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.\n\t*/\n\tonerror;\n\t/**\n\t* A handler to invoke for any request types that do not have their own handler installed.\n\t*/\n\tfallbackRequestHandler;\n\t/**\n\t* A handler to invoke for any notification types that do not have their own handler installed.\n\t*/\n\tfallbackNotificationHandler;\n\tconstructor(_options) {\n\t\tthis._options = _options;\n\t\tthis._supportedProtocolVersions = _options?.supportedProtocolVersions ?? SUPPORTED_PROTOCOL_VERSIONS;\n\t\tthis.setNotificationHandler(\"notifications/cancelled\", (notification) => {\n\t\t\tthis._oncancel(notification);\n\t\t});\n\t\tthis.setNotificationHandler(\"notifications/progress\", (notification) => {\n\t\t\tthis._onprogress(notification);\n\t\t});\n\t\tthis.setRequestHandler(\"ping\", (_request) => ({}));\n\t}\n\t/**\n\t* Drop consult for inbound messages whose transport did not classify them\n\t* at the edge — long-lived channels such as stdio, where a role class may\n\t* need to decline traffic the negotiated era has no answer for (the\n\t* client-side inbound-request drop on modern-era connections: the\n\t* 2026-07-28 era has no server→client request channel, and on stdio the\n\t* client must never write JSON-RPC responses).\n\t*\n\t* Consulted ONLY when the transport supplied no\n\t* {@linkcode MessageExtraInfo.classification}: edge-classified traffic\n\t* never reaches the hook. Returning `'drop'` discards the message without\n\t* writing any response (requests are surfaced via `onerror`). The base\n\t* implementation returns `undefined`: unclassified traffic keeps today's\n\t* dispatch path unchanged. Era selection never happens here — era is\n\t* instance state, owned by the serving entry that constructed and\n\t* connected the instance.\n\t*/\n\t_shouldDropInbound(_message) {}\n\t/**\n\t* The per-request `_meta` envelope this instance attaches to every outgoing\n\t* request and notification, when one applies. The base implementation\n\t* returns `undefined` (no envelope — the 2025-era posture, so legacy-era\n\t* outbound traffic is byte-identical to a build without this seam).\n\t* `Client` overrides it on a connection that negotiated a modern (2026-07-28+)\n\t* era to return the reserved protocol-version / client-info /\n\t* client-capabilities keys. User-supplied `_meta` keys take precedence over\n\t* the auto-attached ones.\n\t*/\n\t_outboundMetaEnvelope() {}\n\t/**\n\t* Attach this instance's outbound `_meta` envelope (when one is configured)\n\t* to a request or notification. A no-op when the seam returns `undefined`\n\t* — the message returns by reference, so the legacy-era wire stays\n\t* byte-identical. User-supplied `_meta` keys are spread last so they win\n\t* over the auto-attached envelope keys.\n\t*/\n\t_envelopeOutbound(message) {\n\t\tconst envelope = this._outboundMetaEnvelope();\n\t\tif (envelope === void 0) return message;\n\t\tconst params = message.params ?? {};\n\t\treturn {\n\t\t\t...message,\n\t\t\tparams: {\n\t\t\t\t...params,\n\t\t\t\t_meta: {\n\t\t\t\t\t...envelope,\n\t\t\t\t\t...params._meta\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Extension point for non-`complete` decoded results in the response\n\t* funnel: a result the wire codec discriminated into a kind other than\n\t* `'complete'` or `'invalid'` is handed here for the role class to\n\t* resolve. The base default surfaces it as a typed\n\t* {@linkcode SdkErrorCode.UnsupportedResultType} error (no retry).\n\t*\n\t* Intended consumers (named so the seam stays accountable):\n\t* - the `Client`'s multi-round-trip auto-fulfilment engine, which fulfils\n\t*   `'input_required'` results through the registered\n\t*   elicitation/sampling/roots handlers and retries via `flow.retry`;\n\t* - a future client-side terminal-result handler for\n\t*   `subscriptions/listen`, when the spec defines one.\n\t*\n\t* `Server` instances never receive `input_required` responses on their\n\t* outbound legs and leave the base behavior in place.\n\t*/\n\t_resolveNonCompleteResult(decoded, flow) {\n\t\treturn Promise.reject(new SdkError(SdkErrorCode.UnsupportedResultType, `Unsupported result type '${decoded.kind}' for ${flow.request.method}`, {\n\t\t\tresultType: decoded.kind,\n\t\t\tmethod: flow.request.method\n\t\t}));\n\t}\n\t/**\n\t* Protected accessor for a registered request handler. Used by role\n\t* classes that dispatch synthesized requests through the same stored\n\t* handler chain (e.g. the `Client` fulfilling an embedded multi-round-trip\n\t* input request).\n\t*/\n\t_getRequestHandler(method) {\n\t\treturn this._requestHandlers.get(method);\n\t}\n\tasync _oncancel(notification) {\n\t\tif (notification.params.requestId === void 0) return;\n\t\tthis._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);\n\t}\n\t_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {\n\t\tthis._timeoutInfo.set(messageId, {\n\t\t\ttimeoutId: setTimeout(onTimeout, timeout),\n\t\t\tstartTime: Date.now(),\n\t\t\ttimeout,\n\t\t\tmaxTotalTimeout,\n\t\t\tresetTimeoutOnProgress,\n\t\t\tonTimeout\n\t\t});\n\t}\n\t_resetTimeout(messageId) {\n\t\tconst info = this._timeoutInfo.get(messageId);\n\t\tif (!info) return false;\n\t\tconst totalElapsed = Date.now() - info.startTime;\n\t\tif (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {\n\t\t\tthis._timeoutInfo.delete(messageId);\n\t\t\tthrow new SdkError(SdkErrorCode.RequestTimeout, \"Maximum total timeout exceeded\", {\n\t\t\t\tmaxTotalTimeout: info.maxTotalTimeout,\n\t\t\t\ttotalElapsed\n\t\t\t});\n\t\t}\n\t\tclearTimeout(info.timeoutId);\n\t\tinfo.timeoutId = setTimeout(info.onTimeout, info.timeout);\n\t\treturn true;\n\t}\n\t_cleanupTimeout(messageId) {\n\t\tconst info = this._timeoutInfo.get(messageId);\n\t\tif (info) {\n\t\t\tclearTimeout(info.timeoutId);\n\t\t\tthis._timeoutInfo.delete(messageId);\n\t\t}\n\t}\n\t/**\n\t* Attaches to the given transport, starts it, and starts listening for messages.\n\t*\n\t* The caller assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.\n\t*/\n\tasync connect(transport) {\n\t\tthis._transport = transport;\n\t\tconst _onclose = this.transport?.onclose;\n\t\tthis._transport.onclose = () => {\n\t\t\ttry {\n\t\t\t\t_onclose?.();\n\t\t\t} finally {\n\t\t\t\tthis._onclose();\n\t\t\t}\n\t\t};\n\t\tconst _onerror = this.transport?.onerror;\n\t\tthis._transport.onerror = (error) => {\n\t\t\t_onerror?.(error);\n\t\t\tthis._onerror(error);\n\t\t};\n\t\tconst _onmessage = this._transport?.onmessage;\n\t\tthis._transport.onmessage = (message, extra) => {\n\t\t\t_onmessage?.(message, extra);\n\t\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) this._onresponse(message);\n\t\t\telse if (isJSONRPCRequest(message)) this._onrequest(message, extra);\n\t\t\telse if (isJSONRPCNotification(message)) this._onnotification(message, extra);\n\t\t\telse this._onerror(/* @__PURE__ */ new Error(`Unknown message type: ${JSON.stringify(message)}`));\n\t\t};\n\t\ttransport.setSupportedProtocolVersions?.(this._supportedProtocolVersions);\n\t\tawait this._transport.start();\n\t}\n\t/**\n\t* Transport-close hook. Subclass overrides MUST call `super._onclose()`\n\t* after their own cleanup — base teardown (response-handler settlement,\n\t* timeout clearing, in-flight request abort) does not run otherwise.\n\t*/\n\t_onclose() {\n\t\tconst responseHandlers = this._responseHandlers;\n\t\tthis._responseHandlers = /* @__PURE__ */ new Map();\n\t\tthis._progressHandlers.clear();\n\t\tthis._pendingDebouncedNotifications.clear();\n\t\tfor (const info of this._timeoutInfo.values()) clearTimeout(info.timeoutId);\n\t\tthis._timeoutInfo.clear();\n\t\tconst requestHandlerAbortControllers = this._requestHandlerAbortControllers;\n\t\tthis._requestHandlerAbortControllers = /* @__PURE__ */ new Map();\n\t\tconst error = new SdkError(SdkErrorCode.ConnectionClosed, \"Connection closed\");\n\t\tthis._transport = void 0;\n\t\ttry {\n\t\t\tthis.onclose?.();\n\t\t} finally {\n\t\t\tfor (const handler of responseHandlers.values()) handler(error);\n\t\t\tfor (const controller of requestHandlerAbortControllers.values()) controller.abort(error);\n\t\t}\n\t}\n\t_onerror(error) {\n\t\tthis.onerror?.(error);\n\t}\n\t/**\n\t* Inbound-notification dispatch. Subclass overrides MUST delegate\n\t* unmatched traffic to `super._onnotification(rawNotification, extra)` —\n\t* an override that consumes only what it owns and falls through to base\n\t* dispatch for everything else.\n\t*/\n\t_onnotification(rawNotification, extra) {\n\t\tconst { message: notification } = liftWireOnlyMaterial(rawNotification, \"notification\");\n\t\tconst codec = this._negotiatedWireCodec();\n\t\tif (extra?.classification === void 0 && this._shouldDropInbound(rawNotification) === \"drop\") return;\n\t\tif (extra?.classification !== void 0) {\n\t\t\tconst classified = classifiedWireEra(extra.classification);\n\t\t\tif (classified !== codec.era) {\n\t\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Era mismatch on inbound notification '${notification.method}': classified as ${classified} but this instance serves ${codec.era}`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (isSpecNotificationMethod(notification.method) && !codec.hasNotificationMethod(notification.method)) return;\n\t\tconst handler = this._notificationHandlers.get(notification.method);\n\t\tconst fallback = this.fallbackNotificationHandler;\n\t\tif (handler === void 0 && fallback === void 0) return;\n\t\tPromise.resolve().then(() => handler === void 0 ? fallback(notification) : handler(notification, codec)).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Uncaught error in notification handler: ${error}`)));\n\t}\n\t_onrequest(rawRequest, extra) {\n\t\tconst { message: request, lifted } = liftWireOnlyMaterial(rawRequest, \"request\");\n\t\tconst codec = this._negotiatedWireCodec();\n\t\tif (extra?.classification === void 0 && this._shouldDropInbound(rawRequest) === \"drop\") {\n\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Dropped inbound request '${rawRequest.method}': not servable on this connection's protocol era`));\n\t\t\treturn;\n\t\t}\n\t\tconst capturedTransport = this._transport;\n\t\tconst sendErrorResponse = (code, message, data) => {\n\t\t\tconst errorResponse = {\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: request.id,\n\t\t\t\terror: {\n\t\t\t\t\tcode,\n\t\t\t\t\tmessage,\n\t\t\t\t\t...data !== void 0 && { data }\n\t\t\t\t}\n\t\t\t};\n\t\t\tcapturedTransport?.send(errorResponse).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send an error response: ${error}`)));\n\t\t};\n\t\tif (extra?.classification !== void 0) {\n\t\t\tconst classified = classifiedWireEra(extra.classification);\n\t\t\tif (classified !== codec.era) {\n\t\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Era mismatch on inbound request '${request.method}': classified as ${classified} but this instance serves ${codec.era}`));\n\t\t\t\tconst requested = extra.classification.revision ?? classified;\n\t\t\t\tsendErrorResponse(ProtocolErrorCode.UnsupportedProtocolVersion, `Unsupported protocol version: ${requested}`, {\n\t\t\t\t\tsupported: this._supportedProtocolVersions,\n\t\t\t\t\trequested\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (isSpecRequestMethod(request.method) && !codec.hasRequestMethod(request.method) && !(isExtensionReusedRequestMethod(request.method) && this._customSchemaRequestMethods.has(request.method))) {\n\t\t\tsendErrorResponse(ProtocolErrorCode.MethodNotFound, \"Method not found\");\n\t\t\treturn;\n\t\t}\n\t\tconst handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;\n\t\tif (handler === void 0) {\n\t\t\tsendErrorResponse(ProtocolErrorCode.MethodNotFound, \"Method not found\");\n\t\t\treturn;\n\t\t}\n\t\tconst envelopeError = codec.checkInboundEnvelope(lifted);\n\t\tif (envelopeError !== void 0) {\n\t\t\tsendErrorResponse(ProtocolErrorCode.InvalidParams, envelopeError);\n\t\t\treturn;\n\t\t}\n\t\tconst sendNotification = (notification, options) => this._notificationViaCodec(this._resolveOutboundCodec(notification.method), notification, {\n\t\t\t...options,\n\t\t\trelatedRequestId: request.id\n\t\t});\n\t\tconst sendRequest = (r, resultSchema, options) => this._requestWithSchemaViaCodec(this._resolveOutboundCodec(r.method), r, resultSchema, {\n\t\t\t...options,\n\t\t\trelatedRequestId: request.id\n\t\t});\n\t\tconst abortController = new AbortController();\n\t\tthis._requestHandlerAbortControllers.set(request.id, abortController);\n\t\tconst partitionedInputResponses = lifted.inputResponses === void 0 ? void 0 : partitionInputResponses(lifted.inputResponses);\n\t\tconst baseCtx = {\n\t\t\tsessionId: capturedTransport?.sessionId,\n\t\t\tmcpReq: {\n\t\t\t\tid: request.id,\n\t\t\t\tmethod: request.method,\n\t\t\t\t_meta: request.params?._meta,\n\t\t\t\t...lifted.envelope !== void 0 && { envelope: lifted.envelope },\n\t\t\t\t...partitionedInputResponses !== void 0 && { inputResponses: partitionedInputResponses.accepted },\n\t\t\t\t...partitionedInputResponses !== void 0 && partitionedInputResponses.droppedKeys.length > 0 && { droppedInputResponseKeys: partitionedInputResponses.droppedKeys },\n\t\t\t\trequestState: lifted.requestState === void 0 ? NO_REQUEST_STATE : requestStateAccessor(lifted.requestState),\n\t\t\t\tsignal: abortController.signal,\n\t\t\t\tsend: ((r, schemaOrOptions, maybeOptions) => {\n\t\t\t\t\tconst sendCodec = this._resolveOutboundCodec(r.method);\n\t\t\t\t\tthis._assertOutboundRequestInEra(sendCodec, r.method);\n\t\t\t\t\tif (isStandardSchema(schemaOrOptions)) return sendRequest(r, schemaOrOptions, maybeOptions);\n\t\t\t\t\tconst validate = codecResultValidator(sendCodec, r.method);\n\t\t\t\t\tif (validate === void 0) throw new TypeError(`'${r.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);\n\t\t\t\t\treturn sendRequest(r, validate, schemaOrOptions);\n\t\t\t\t}),\n\t\t\t\tnotify: sendNotification\n\t\t\t},\n\t\t\thttp: extra?.authInfo ? { authInfo: extra.authInfo } : void 0\n\t\t};\n\t\tconst ctx = this.buildContext(baseCtx, extra);\n\t\tPromise.resolve().then(() => handler(request, ctx)).then(async (result) => {\n\t\t\tif (abortController.signal.aborted) return;\n\t\t\tlet encoded;\n\t\t\ttry {\n\t\t\t\tencoded = codec.encodeResult(request.method, result, this._outboundServerInfo());\n\t\t\t} catch (error) {\n\t\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Failed to encode result for ${request.method}: ${error}`));\n\t\t\t\tsendErrorResponse(ProtocolErrorCode.InternalError, \"Internal error\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst response = {\n\t\t\t\tresult: encoded,\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: request.id\n\t\t\t};\n\t\t\tawait capturedTransport?.send(response);\n\t\t}, async (error) => {\n\t\t\tif (abortController.signal.aborted) return;\n\t\t\tconst thrownCode = Number.isSafeInteger(error[\"code\"]) ? error[\"code\"] : ProtocolErrorCode.InternalError;\n\t\t\tconst errorResponse = {\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: request.id,\n\t\t\t\terror: {\n\t\t\t\t\tcode: codec.encodeErrorCode(thrownCode),\n\t\t\t\t\tmessage: error.message ?? \"Internal error\",\n\t\t\t\t\t...error[\"data\"] !== void 0 && { data: error[\"data\"] }\n\t\t\t\t}\n\t\t\t};\n\t\t\tawait capturedTransport?.send(errorResponse);\n\t\t}).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send response: ${error}`))).finally(() => {\n\t\t\tif (this._requestHandlerAbortControllers.get(request.id) === abortController) this._requestHandlerAbortControllers.delete(request.id);\n\t\t});\n\t}\n\t_onprogress(notification) {\n\t\tconst { progressToken, ...params } = notification.params;\n\t\tconst messageId = Number(progressToken);\n\t\tconst handler = this._progressHandlers.get(messageId);\n\t\tif (!handler) {\n\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));\n\t\t\treturn;\n\t\t}\n\t\tconst responseHandler = this._responseHandlers.get(messageId);\n\t\tconst timeoutInfo = this._timeoutInfo.get(messageId);\n\t\tif (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) try {\n\t\t\tthis._resetTimeout(messageId);\n\t\t} catch (error) {\n\t\t\tthis._responseHandlers.delete(messageId);\n\t\t\tthis._progressHandlers.delete(messageId);\n\t\t\tthis._cleanupTimeout(messageId);\n\t\t\tresponseHandler(error);\n\t\t\treturn;\n\t\t}\n\t\thandler(params);\n\t}\n\t/**\n\t* Inbound-response dispatch. Subclass overrides MUST delegate unmatched\n\t* traffic to `super._onresponse(response)` — an override that consumes\n\t* only what it owns and falls through to base dispatch for everything\n\t* else.\n\t*/\n\t_onresponse(response) {\n\t\tconst messageId = Number(response.id);\n\t\tconst handler = this._responseHandlers.get(messageId);\n\t\tif (handler === void 0) {\n\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`));\n\t\t\treturn;\n\t\t}\n\t\tthis._responseHandlers.delete(messageId);\n\t\tthis._cleanupTimeout(messageId);\n\t\tthis._progressHandlers.delete(messageId);\n\t\tif (isJSONRPCResultResponse(response)) handler(response);\n\t\telse handler(ProtocolError.fromError(response.error.code, response.error.message, response.error.data));\n\t}\n\tget transport() {\n\t\treturn this._transport;\n\t}\n\t/**\n\t* Closes the connection.\n\t*/\n\tasync close() {\n\t\tawait this._transport?.close();\n\t}\n\trequest(request, schemaOrOptions, maybeOptions) {\n\t\tconst codec = this._resolveOutboundCodec(request.method);\n\t\tif (isStandardSchema(schemaOrOptions)) {\n\t\t\tif (!isExtensionReusedRequestMethod(request.method)) this._assertOutboundRequestInEra(codec, request.method);\n\t\t\treturn this._requestWithSchemaViaCodec(codec, request, schemaOrOptions, maybeOptions);\n\t\t}\n\t\tthis._assertOutboundRequestInEra(codec, request.method);\n\t\tconst validate = codecResultValidator(codec, request.method);\n\t\tif (validate === void 0) throw new TypeError(`'${request.method}' is not a spec method; pass a result schema as the second argument to request().`);\n\t\treturn this._requestWithSchemaViaCodec(codec, request, validate, schemaOrOptions);\n\t}\n\t/**\n\t* The wire codec for this instance's negotiated era — the phase-2 truth:\n\t* everything an established connection sends and receives resolves\n\t* through it. Legacy until a version has been negotiated.\n\t*/\n\t_negotiatedWireCodec() {\n\t\treturn codecForVersion(this._negotiatedProtocolVersion);\n\t}\n\t/**\n\t* Protected accessor for the instance's negotiated wire codec, for role\n\t* classes (Client/Server/McpServer) routing era-dependent behavior\n\t* through the codec's function-only surface — `samplingResultVariant`,\n\t* `outboundEnvelope`, `projectCallToolResult` — instead of branching on\n\t* the protocol version themselves.\n\t*/\n\t_wireCodec() {\n\t\treturn this._negotiatedWireCodec();\n\t}\n\t/**\n\t* Outbound codec resolution: while the negotiated version is still unset\n\t* (the negotiation window), lifecycle messages are bootstrap-pinned BY\n\t* METHOD — they self-identify their era (`initialize` IS the legacy\n\t* handshake, `server/discover` IS the modern probe). Once a version has\n\t* been negotiated, the instance era is authoritative for everything — a\n\t* negotiated session never re-routes a method onto the other era.\n\t*/\n\t_resolveOutboundCodec(method) {\n\t\tif (this._negotiatedProtocolVersion === void 0) {\n\t\t\tconst pinned = bootstrapOutboundCodec(method);\n\t\t\tif (pinned) return pinned;\n\t\t}\n\t\treturn this._negotiatedWireCodec();\n\t}\n\t/**\n\t* Era gate for outbound requests — deletions are physical in BOTH\n\t* directions: sending a spec method that the resolved era does not define\n\t* dies locally with a typed error before anything reaches the transport.\n\t* Methods outside the spec universe are consumer-owned extension methods\n\t* and stay era-blind.\n\t*/\n\t_assertOutboundRequestInEra(codec, method) {\n\t\tif (isSpecRequestMethod(method) && !codec.hasRequestMethod(method)) throw new SdkError(SdkErrorCode.MethodNotSupportedByProtocolVersion, `Method '${method}' is not supported by the negotiated protocol version (wire era ${codec.era})`, {\n\t\t\tmethod,\n\t\t\tera: codec.era\n\t\t});\n\t}\n\t/**\n\t* Sends a request and waits for a response, using the provided schema for\n\t* validation instead of the era registry's method-keyed entry.\n\t*\n\t* This is the internal implementation used by SDK methods whose result\n\t* schema cannot be expressed as a method-keyed registry entry — the one\n\t* surviving case is `server.createMessage`, whose result schema depends\n\t* on the REQUEST params (tools vs no tools) — and by callers passing\n\t* explicit compatibility schemas. Spec methods are still era-gated here:\n\t* an explicit schema never smuggles a deleted method onto the wire.\n\t*/\n\t_requestWithSchema(request, resultSchema, options) {\n\t\tconst codec = this._resolveOutboundCodec(request.method);\n\t\tthis._assertOutboundRequestInEra(codec, request.method);\n\t\treturn this._requestWithSchemaViaCodec(codec, request, resultSchema, options);\n\t}\n\t/**\n\t* The request funnel proper, keyed by the resolved era codec: the codec\n\t* owns result decoding (raw-first `resultType` discrimination — V-1 —\n\t* and the era's lift posture) before the schema validation step.\n\t*/\n\t_requestWithSchemaViaCodec(codec, request, resultSchema, options) {\n\t\tconst { relatedRequestId, resumptionToken, onresumptiontoken, headers } = options ?? {};\n\t\tconst flowStartedAt = Date.now();\n\t\tlet onAbort;\n\t\tlet cleanupMessageId;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst earlyReject = (error) => {\n\t\t\t\treject(error);\n\t\t\t};\n\t\t\tif (!this._transport) {\n\t\t\t\tearlyReject(/* @__PURE__ */ new Error(\"Not connected\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._options?.enforceStrictCapabilities === true) try {\n\t\t\t\tthis.assertCapabilityForMethod(request.method);\n\t\t\t} catch (error) {\n\t\t\t\tearlyReject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (options?.signal?.aborted) {\n\t\t\t\tconst reason = options.signal.reason;\n\t\t\t\tthrow reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason));\n\t\t\t}\n\t\t\tconst requestAbort = codec.era === MODERN_WIRE_REVISION && this._transport.hasPerRequestStream === true ? new AbortController() : void 0;\n\t\t\tconst messageId = this._requestMessageId++;\n\t\t\tcleanupMessageId = messageId;\n\t\t\tconst jsonrpcRequest = {\n\t\t\t\t...request,\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: messageId\n\t\t\t};\n\t\t\tif (options?.onprogress) {\n\t\t\t\tthis._progressHandlers.set(messageId, options.onprogress);\n\t\t\t\tjsonrpcRequest.params = {\n\t\t\t\t\t...request.params,\n\t\t\t\t\t_meta: {\n\t\t\t\t\t\t...request.params?._meta,\n\t\t\t\t\t\tprogressToken: messageId\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst outbound = this._envelopeOutbound(jsonrpcRequest);\n\t\t\tlet responseReceived = false;\n\t\t\tconst cancel = (reason) => {\n\t\t\t\tif (responseReceived) return;\n\t\t\t\tthis._progressHandlers.delete(messageId);\n\t\t\t\tif (requestAbort === void 0) {\n\t\t\t\t\tif (request.method !== \"initialize\") this._transport?.send(this._envelopeOutbound({\n\t\t\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\t\t\tmethod: \"notifications/cancelled\",\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\trequestId: messageId,\n\t\t\t\t\t\t\treason: String(reason)\n\t\t\t\t\t\t}\n\t\t\t\t\t}), {\n\t\t\t\t\t\trelatedRequestId,\n\t\t\t\t\t\tresumptionToken,\n\t\t\t\t\t\tonresumptiontoken\n\t\t\t\t\t}).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error}`)));\n\t\t\t\t} else requestAbort.abort();\n\t\t\t\treject(reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason)));\n\t\t\t};\n\t\t\tthis._responseHandlers.set(messageId, (response) => {\n\t\t\t\tif (options?.signal?.aborted) return;\n\t\t\t\tresponseReceived = true;\n\t\t\t\tif (response instanceof Error) return reject(response);\n\t\t\t\tlet decoded;\n\t\t\t\ttry {\n\t\t\t\t\tdecoded = codec.decodeResult(request.method, response.result);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn reject(error instanceof Error ? error : new Error(String(error)));\n\t\t\t\t}\n\t\t\t\tif (decoded.kind === \"invalid\") return reject(decoded.error);\n\t\t\t\tif (decoded.kind === \"input_required\") {\n\t\t\t\t\tif (options?.allowInputRequired === true) return resolve(manualInputRequiredValue(decoded));\n\t\t\t\t\tconst flow = {\n\t\t\t\t\t\tcodec,\n\t\t\t\t\t\trequest,\n\t\t\t\t\t\tresultSchema,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\tflowStartedAt,\n\t\t\t\t\t\tretry: (params, legOptions) => this._requestWithSchemaViaCodec(codec, params === void 0 ? { method: request.method } : {\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tparams\n\t\t\t\t\t\t}, resultSchema, legOptions)\n\t\t\t\t\t};\n\t\t\t\t\treturn resolve(this._resolveNonCompleteResult(decoded, flow));\n\t\t\t\t}\n\t\t\t\tconst result = decoded.result;\n\t\t\t\tvalidateStandardSchema(resultSchema, result).then((parseResult) => {\n\t\t\t\t\tif (parseResult.success) resolve(parseResult.data);\n\t\t\t\t\telse reject(new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${request.method}: ${parseResult.error}`));\n\t\t\t\t}, reject);\n\t\t\t});\n\t\t\tonAbort = () => cancel(options?.signal?.reason);\n\t\t\toptions?.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\tconst timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;\n\t\t\tconst timeoutHandler = () => cancel(new SdkError(SdkErrorCode.RequestTimeout, \"Request timed out\", { timeout }));\n\t\t\tthis._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);\n\t\t\tthis._transport.send(outbound, {\n\t\t\t\trelatedRequestId,\n\t\t\t\tresumptionToken,\n\t\t\t\tonresumptiontoken,\n\t\t\t\theaders,\n\t\t\t\trequestSignal: requestAbort?.signal\n\t\t\t}).catch((error) => {\n\t\t\t\tthis._progressHandlers.delete(messageId);\n\t\t\t\treject(error);\n\t\t\t});\n\t\t}).finally(() => {\n\t\t\tif (onAbort) options?.signal?.removeEventListener(\"abort\", onAbort);\n\t\t\tif (cleanupMessageId !== void 0) {\n\t\t\t\tthis._responseHandlers.delete(cleanupMessageId);\n\t\t\t\tthis._cleanupTimeout(cleanupMessageId);\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Emits a notification, which is a one-way message that does not expect a response.\n\t*/\n\tasync notification(notification, options) {\n\t\treturn await this._notificationViaCodec(this._resolveOutboundCodec(notification.method), notification, options);\n\t}\n\t/**\n\t* The notification funnel proper, keyed by the resolved era codec —\n\t* direct sends and related notifications (`ctx.mcpReq.notify`) alike\n\t* resolve through the instance's negotiated era at send time.\n\t*/\n\tasync _notificationViaCodec(codec, notification, options) {\n\t\tif (!this._transport) throw new SdkError(SdkErrorCode.NotConnected, \"Not connected\");\n\t\tif (isSpecNotificationMethod(notification.method) && !codec.hasNotificationMethod(notification.method)) throw new SdkError(SdkErrorCode.MethodNotSupportedByProtocolVersion, `Notification '${notification.method}' is not supported by the negotiated protocol version (wire era ${codec.era})`, {\n\t\t\tmethod: notification.method,\n\t\t\tera: codec.era\n\t\t});\n\t\tthis.assertNotificationCapability(notification.method);\n\t\tconst jsonrpcNotification = this._envelopeOutbound({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\t...notification\n\t\t});\n\t\tif ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && options?.relatedRequestId === void 0) {\n\t\t\tif (this._pendingDebouncedNotifications.has(notification.method)) return;\n\t\t\tthis._pendingDebouncedNotifications.add(notification.method);\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tthis._pendingDebouncedNotifications.delete(notification.method);\n\t\t\t\tif (!this._transport) return;\n\t\t\t\tthis._transport?.send(jsonrpcNotification, options).catch((error) => this._onerror(error));\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tawait this._transport.send(jsonrpcNotification, options);\n\t}\n\tsetRequestHandler(method, schemasOrHandler, maybeHandler) {\n\t\tthis.assertRequestHandlerCapability(method);\n\t\tlet stored;\n\t\tif (typeof schemasOrHandler === \"function\") {\n\t\t\tif (!isSpecRequestMethod(method)) throw new TypeError(`'${method}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);\n\t\t\tstored = (request, ctx) => {\n\t\t\t\tconst dispatchCodec = this._negotiatedWireCodec();\n\t\t\t\tlet outcome = dispatchCodec.validateRequest(method, request);\n\t\t\t\tif (!outcome.ok && outcome.reason === \"not-in-era\") outcome = dispatchCodec.validateInputRequest(method, request);\n\t\t\t\tif (!outcome.ok) {\n\t\t\t\t\tif (outcome.reason === \"not-in-era\") throw new ProtocolError(ProtocolErrorCode.InternalError, `No wire schema for ${method} in the resolved era`);\n\t\t\t\t\tthrow new Error(outcome.message);\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(schemasOrHandler(outcome.value, ctx));\n\t\t\t};\n\t\t} else if (maybeHandler) stored = async (request, ctx) => {\n\t\t\tconst parsed = await validateStandardSchema(schemasOrHandler.params, { ...request.params });\n\t\t\tif (!parsed.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params for ${method}: ${parsed.error}`);\n\t\t\treturn maybeHandler(parsed.data, ctx);\n\t\t};\n\t\telse throw new TypeError(\"setRequestHandler: handler is required\");\n\t\tif (typeof schemasOrHandler === \"function\") this._customSchemaRequestMethods.delete(method);\n\t\telse this._customSchemaRequestMethods.add(method);\n\t\tthis._requestHandlers.set(method, this._wrapHandler(method, stored));\n\t}\n\t/**\n\t* Hook for subclasses to wrap a registered request handler with role-specific\n\t* validation or behavior (e.g. `Server` validates `tools/call` results, `Client`\n\t* validates `elicitation/create` mode and result). Runs for both the 2-arg and\n\t* 3-arg registration paths. The default implementation is identity.\n\t*\n\t* Subclasses overriding this hook avoid redeclaring `setRequestHandler`'s overload set.\n\t*/\n\t_wrapHandler(_method, handler) {\n\t\treturn handler;\n\t}\n\t/**\n\t* Hook for subclasses to supply the implementation identity the 2026-era\n\t* encode seam stamps into outbound result `_meta` under\n\t* `io.modelcontextprotocol/serverInfo` (spec PR #3002: servers SHOULD\n\t* identify themselves on every response). The default is `undefined` — no\n\t* stamp. Only `Server` overrides this: the key identifies the software\n\t* producing a response, and the 2025-era codec never stamps anything\n\t* regardless (the never-stamp guarantee).\n\t*/\n\t_outboundServerInfo() {}\n\t/**\n\t* Removes the request handler for the given method.\n\t*/\n\tremoveRequestHandler(method) {\n\t\tthis._requestHandlers.delete(method);\n\t\tthis._customSchemaRequestMethods.delete(method);\n\t}\n\t/**\n\t* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.\n\t*/\n\tassertCanSetRequestHandler(method) {\n\t\tif (this._requestHandlers.has(method)) throw new Error(`A request handler for ${method} already exists, which would be overridden`);\n\t}\n\tsetNotificationHandler(method, schemasOrHandler, maybeHandler) {\n\t\tif (typeof schemasOrHandler === \"function\") {\n\t\t\tif (!isSpecNotificationMethod(method)) throw new TypeError(`'${method}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);\n\t\t\tthis._notificationHandlers.set(method, (notification, codec) => {\n\t\t\t\tconst outcome = codec.validateNotification(method, notification);\n\t\t\t\tif (!outcome.ok) {\n\t\t\t\t\tif (outcome.reason === \"not-in-era\") throw new ProtocolError(ProtocolErrorCode.InternalError, `No wire schema for ${method} in the resolved era`);\n\t\t\t\t\tthrow new Error(outcome.message);\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(schemasOrHandler(outcome.value));\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!maybeHandler) throw new TypeError(\"setNotificationHandler: handler is required\");\n\t\tthis._notificationHandlers.set(method, async (notification) => {\n\t\t\tconst parsed = await validateStandardSchema(schemasOrHandler.params, { ...notification.params });\n\t\t\tif (!parsed.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params for notification ${method}: ${parsed.error}`);\n\t\t\tawait maybeHandler(parsed.data, notification);\n\t\t});\n\t}\n\t/**\n\t* Removes the notification handler for the given method.\n\t*/\n\tremoveNotificationHandler(method) {\n\t\tthis._notificationHandlers.delete(method);\n\t}\n};\nfunction isPlainObject$1(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\nfunction mergeCapabilities(base, additional) {\n\tconst result = { ...base };\n\tfor (const key in additional) {\n\t\tconst k = key;\n\t\tconst addValue = additional[k];\n\t\tif (addValue === void 0) continue;\n\t\tconst baseValue = result[k];\n\t\tresult[k] = isPlainObject$1(baseValue) && isPlainObject$1(addValue) ? {\n\t\t\t...baseValue,\n\t\t\t...addValue\n\t\t} : addValue;\n\t}\n\treturn result;\n}\n\n//#endregion\n//#region ../core-internal/src/shared/inputRequiredEngine.ts\nfunction isPlainObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* Splits a retried request's `inputResponses` map into the BARE response\n* entries the spec defines and everything else. The spec's embedded responses\n* are the bare result objects (an `ElicitResult`, `CreateMessageResult`, or\n* `ListRootsResult`); a wrapped `{method, result}` envelope (a shape some\n* peers emit) is never accepted as a response — its key is recorded so the\n* handler can re-issue the corresponding input request.\n*/\nfunction partitionInputResponses(inputResponses) {\n\tconst accepted = {};\n\tconst droppedKeys = [];\n\tif (!isPlainObject(inputResponses)) return {\n\t\taccepted,\n\t\tdroppedKeys\n\t};\n\tfor (const [key, entry] of Object.entries(inputResponses)) {\n\t\tif (!isPlainObject(entry) || \"method\" in entry || \"result\" in entry) {\n\t\t\tdroppedKeys.push(key);\n\t\t\tcontinue;\n\t\t}\n\t\taccepted[key] = entry;\n\t}\n\treturn {\n\t\taccepted,\n\t\tdroppedKeys\n\t};\n}\n/**\n* Builds the manual-mode {@linkcode InputRequiredResult} value from the\n* codec's decoded payload — what an `allowInputRequired: true` caller\n* receives instead of the auto-fulfilled complete result.\n*/\nfunction manualInputRequiredValue(decoded) {\n\treturn {\n\t\tresultType: \"input_required\",\n\t\tinputRequests: decoded.inputRequests,\n\t\t...decoded.requestState !== void 0 && { requestState: decoded.requestState },\n\t\t...decoded._meta !== void 0 && { _meta: decoded._meta }\n\t};\n}\n\n//#endregion\n//#region ../../node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js\n/*!\n* content-type\n* Copyright(c) 2015 Douglas Christopher Wilson\n* MIT Licensed\n*/\nvar require_content_type = /* @__PURE__ */ __commonJSMin(((exports) => {\n\t/**\n\t* RegExp to match *( \";\" parameter ) in RFC 7231 sec 3.1.1.1\n\t*\n\t* parameter     = token \"=\" ( token / quoted-string )\n\t* token         = 1*tchar\n\t* tchar         = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\"\n\t*               / \"+\" / \"-\" / \".\" / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n\t*               / DIGIT / ALPHA\n\t*               ; any VCHAR, except delimiters\n\t* quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE\n\t* qdtext        = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text\n\t* obs-text      = %x80-FF\n\t* quoted-pair   = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n\t*/\n\tvar PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *(\"(?:[\\u000b\\u0020\\u0021\\u0023-\\u005b\\u005d-\\u007e\\u0080-\\u00ff]|\\\\[\\u000b\\u0020-\\u00ff])*\"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;\n\t/**\n\t* RegExp to match quoted-pair in RFC 7230 sec 3.2.6\n\t*\n\t* quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n\t* obs-text    = %x80-FF\n\t*/\n\tvar QESC_REGEXP = /\\\\([\\u000b\\u0020-\\u00ff])/g;\n\t/**\n\t* RegExp to match type in RFC 7231 sec 3.1.1.1\n\t*\n\t* media-type = type \"/\" subtype\n\t* type       = token\n\t* subtype    = token\n\t*/\n\tvar TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\texports.parse = parse;\n\t/**\n\t* Parse media type to object.\n\t*\n\t* @param {string|object} string\n\t* @return {Object}\n\t* @public\n\t*/\n\tfunction parse(string) {\n\t\tif (!string) throw new TypeError(\"argument string is required\");\n\t\tvar header = typeof string === \"object\" ? getcontenttype(string) : string;\n\t\tif (typeof header !== \"string\") throw new TypeError(\"argument string is required to be a string\");\n\t\tvar index = header.indexOf(\";\");\n\t\tvar type = index !== -1 ? header.slice(0, index).trim() : header.trim();\n\t\tif (!TYPE_REGEXP.test(type)) throw new TypeError(\"invalid media type\");\n\t\tvar obj = new ContentType(type.toLowerCase());\n\t\tif (index !== -1) {\n\t\t\tvar key;\n\t\t\tvar match;\n\t\t\tvar value;\n\t\t\tPARAM_REGEXP.lastIndex = index;\n\t\t\twhile (match = PARAM_REGEXP.exec(header)) {\n\t\t\t\tif (match.index !== index) throw new TypeError(\"invalid parameter format\");\n\t\t\t\tindex += match[0].length;\n\t\t\t\tkey = match[1].toLowerCase();\n\t\t\t\tvalue = match[2];\n\t\t\t\tif (value.charCodeAt(0) === 34) {\n\t\t\t\t\tvalue = value.slice(1, -1);\n\t\t\t\t\tif (value.indexOf(\"\\\\\") !== -1) value = value.replace(QESC_REGEXP, \"$1\");\n\t\t\t\t}\n\t\t\t\tobj.parameters[key] = value;\n\t\t\t}\n\t\t\tif (index !== header.length) throw new TypeError(\"invalid parameter format\");\n\t\t}\n\t\treturn obj;\n\t}\n\t/**\n\t* Get content-type from req/res objects.\n\t*\n\t* @param {object}\n\t* @return {Object}\n\t* @private\n\t*/\n\tfunction getcontenttype(obj) {\n\t\tvar header;\n\t\tif (typeof obj.getHeader === \"function\") header = obj.getHeader(\"content-type\");\n\t\telse if (typeof obj.headers === \"object\") header = obj.headers && obj.headers[\"content-type\"];\n\t\tif (typeof header !== \"string\") throw new TypeError(\"content-type header is missing from object\");\n\t\treturn header;\n\t}\n\t/**\n\t* Class to represent a content type.\n\t* @private\n\t*/\n\tfunction ContentType(type) {\n\t\tthis.parameters = Object.create(null);\n\t\tthis.type = type;\n\t}\n}));\n\n//#endregion\n//#region ../core-internal/src/shared/mediaType.ts\nvar import_content_type = /* @__PURE__ */ __toESM(require_content_type(), 1);\n/**\n* Extracts the media type (the lowercased `type/subtype` pair, without\n* parameters) from a raw `Content-Type` header value, or `undefined` when the\n* header is missing or empty.\n*\n* Content-Type comparisons must use the parsed media type, never a substring\n* search of the raw header: a value like `text/plain; a=application/json`\n* contains the substring `application/json` but its media type is\n* `text/plain`, and case variants or parameters make naive string comparison\n* wrong in both directions.\n*\n* \"Essence\" is the WHATWG MIME Sniffing standard's term for the bare\n* `type/subtype` pair (https://mimesniff.spec.whatwg.org/#mime-type-essence);\n* the Fetch standard's request classification is defined against it\n* (https://fetch.spec.whatwg.org/#cors-safelisted-request-header).\n*\n* Parsing is RFC 9110 (`content-type` package) first. When the parameter\n* section is malformed (`application/json;`, `application/json; charset=`),\n* browsers and most HTTP stacks still derive the media type from the segment\n* before the first `;` — the fallback matches that widely-implemented\n* behavior, so a header whose media type is unambiguous is not rejected for\n* a sloppy parameter section.\n*/\nfunction mediaTypeEssence(header) {\n\tif (!header) return;\n\ttry {\n\t\treturn import_content_type.parse(header).type;\n\t} catch {\n\t\tconst essence = (header.split(\";\", 1)[0] ?? \"\").trim().toLowerCase();\n\t\tif (essence === \"\" || header.slice(essence.length).includes(\",\")) return;\n\t\treturn essence;\n\t}\n}\n/**\n* Whether a raw `Content-Type` header value denotes `application/json`.\n* Parameters (for example `charset=utf-8`) are allowed and ignored; malformed\n* parameter sections do not reject a header whose media type is unambiguously\n* `application/json` (see `mediaTypeEssence` for the exact grammar).\n*/\nfunction isJsonContentType(header) {\n\tif (header === \"application/json\") return true;\n\treturn mediaTypeEssence(header) === \"application/json\";\n}\n\n//#endregion\n//#region ../core-internal/src/shared/metadataUtils.ts\n/**\n* Utilities for working with {@linkcode BaseMetadata} objects.\n*/\n/**\n* Gets the display name for an object with {@linkcode BaseMetadata}.\n* For tools, the precedence is: `title` → {@linkcode index.ToolAnnotations | annotations}.`title` → `name`\n* For other objects: `title` → `name`\n* This implements the spec requirement: \"if no title is provided, name should be used for display purposes\"\n*/\nfunction getDisplayName(metadata) {\n\tif (metadata.title !== void 0 && metadata.title !== \"\") return metadata.title;\n\tif (\"annotations\" in metadata && metadata.annotations?.title) return metadata.annotations.title;\n\treturn metadata.name;\n}\n\n//#endregion\n//#region ../core-internal/src/shared/stdio.ts\nconst STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;\n/**\n* Buffers a continuous stdio stream into discrete JSON-RPC messages.\n*/\nvar ReadBuffer = class {\n\t_buffer;\n\t_maxBufferSize;\n\tconstructor(options) {\n\t\tthis._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;\n\t}\n\tappend(chunk) {\n\t\tif ((this._buffer?.length ?? 0) + chunk.length > this._maxBufferSize) {\n\t\t\tthis.clear();\n\t\t\tthrow new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);\n\t\t}\n\t\tthis._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;\n\t}\n\treadMessage() {\n\t\twhile (this._buffer) {\n\t\t\tconst index = this._buffer.indexOf(\"\\n\");\n\t\t\tif (index === -1) return null;\n\t\t\tconst line = this._buffer.toString(\"utf8\", 0, index).replace(/\\r$/, \"\");\n\t\t\tthis._buffer = this._buffer.subarray(index + 1);\n\t\t\ttry {\n\t\t\t\treturn deserializeMessage(line);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof SyntaxError) continue;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\tclear() {\n\t\tthis._buffer = void 0;\n\t}\n};\nfunction deserializeMessage(line) {\n\treturn JSONRPCMessageSchema.parse(JSON.parse(line));\n}\nfunction serializeMessage(message) {\n\treturn JSON.stringify(message) + \"\\n\";\n}\n\n//#endregion\n//#region ../core-internal/src/shared/toolNameValidation.ts\n/**\n* Tool name validation utilities according to SEP: Specify Format for Tool Names\n*\n* Tool names SHOULD be between 1 and 128 characters in length (inclusive).\n* Tool names are case-sensitive.\n* Allowed characters: uppercase and lowercase ASCII letters (`A-Z`, `a-z`), digits\n* (`0-9`), underscore (`_`), dash (`-`), and dot (`.`).\n* Tool names SHOULD NOT contain spaces, commas, or other special characters.\n*\n* @see {@link https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986 | SEP-986: Specify Format for Tool Names}\n*/\n/**\n* Regular expression for valid tool names according to SEP-986 specification\n*/\nconst TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;\n/**\n* Validates a tool name according to the SEP specification\n* @param name - The tool name to validate\n* @returns An object containing validation result and any warnings\n*/\nfunction validateToolName(name) {\n\tconst warnings = [];\n\tif (name.length === 0) return {\n\t\tisValid: false,\n\t\twarnings: [\"Tool name cannot be empty\"]\n\t};\n\tif (name.length > 128) return {\n\t\tisValid: false,\n\t\twarnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`]\n\t};\n\tif (name.includes(\" \")) warnings.push(\"Tool name contains spaces, which may cause parsing issues\");\n\tif (name.includes(\",\")) warnings.push(\"Tool name contains commas, which may cause parsing issues\");\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) warnings.push(\"Tool name starts or ends with a dash, which may cause parsing issues in some contexts\");\n\tif (name.startsWith(\".\") || name.endsWith(\".\")) warnings.push(\"Tool name starts or ends with a dot, which may cause parsing issues in some contexts\");\n\tif (!TOOL_NAME_REGEX.test(name)) {\n\t\tconst invalidChars = [...name].filter((char) => !/[A-Za-z0-9._-]/.test(char)).filter((char, index, arr) => arr.indexOf(char) === index);\n\t\twarnings.push(`Tool name contains invalid characters: ${invalidChars.map((c) => `\"${c}\"`).join(\", \")}`, \"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)\");\n\t\treturn {\n\t\t\tisValid: false,\n\t\t\twarnings\n\t\t};\n\t}\n\treturn {\n\t\tisValid: true,\n\t\twarnings\n\t};\n}\n/**\n* Issues warnings for non-conforming tool names\n* @param name - The tool name that triggered the warnings\n* @param warnings - Array of warning messages\n*/\nfunction issueToolNameWarning(name, warnings) {\n\tif (warnings.length > 0) {\n\t\tconsole.warn(`Tool name validation warning for \"${name}\":`);\n\t\tfor (const warning of warnings) console.warn(`  - ${warning}`);\n\t\tconsole.warn(\"Tool registration will proceed, but this may cause compatibility issues.\");\n\t\tconsole.warn(\"Consider updating the tool name to conform to the MCP tool naming standard.\");\n\t\tconsole.warn(\"See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.\");\n\t}\n}\n/**\n* Validates a tool name and issues warnings for non-conforming names\n* @param name - The tool name to validate\n* @returns `true` if the name is valid, `false` otherwise\n*/\nfunction validateAndWarnToolName(name) {\n\tconst result = validateToolName(name);\n\tissueToolNameWarning(name, result.warnings);\n\treturn result.isValid;\n}\n\n//#endregion\n//#region ../core-internal/src/shared/transport.ts\n/**\n* Normalizes `HeadersInit` to a plain `Record<string, string>` for manipulation.\n* Handles `Headers` objects, arrays of tuples, and plain objects.\n*/\nfunction normalizeHeaders(headers) {\n\tif (!headers) return {};\n\tif (headers instanceof Headers) return Object.fromEntries(headers.entries());\n\tif (Array.isArray(headers)) return Object.fromEntries(headers);\n\treturn { ...headers };\n}\n/**\n* Creates a fetch function that includes base `RequestInit` options.\n* This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.\n*\n* @param baseFetch - The base fetch function to wrap (defaults to global `fetch`)\n* @param baseInit - The base `RequestInit` to merge with each request\n* @returns A wrapped fetch function that merges base options with call-specific options\n*/\nfunction createFetchWithInit(baseFetch = fetch, baseInit) {\n\tif (!baseInit) return baseFetch;\n\treturn async (url, init) => {\n\t\treturn baseFetch(url, {\n\t\t\t...baseInit,\n\t\t\t...init,\n\t\t\theaders: init?.headers ? {\n\t\t\t\t...normalizeHeaders(baseInit.headers),\n\t\t\t\t...normalizeHeaders(init.headers)\n\t\t\t} : baseInit.headers\n\t\t});\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/shared/uriTemplate.ts\nconst MAX_TEMPLATE_LENGTH = 1e6;\nconst MAX_VARIABLE_LENGTH = 1e6;\nconst MAX_TEMPLATE_EXPRESSIONS = 1e4;\nconst MAX_REGEX_LENGTH = 1e6;\nvar UriTemplate = class UriTemplate {\n\t/**\n\t* Returns true if the given string contains any URI template expressions.\n\t* A template expression is a sequence of characters enclosed in curly braces,\n\t* like `{foo}` or `{?bar}`.\n\t*/\n\tstatic isTemplate(str) {\n\t\treturn /\\{[^}\\s]+\\}/.test(str);\n\t}\n\tstatic validateLength(str, max, context) {\n\t\tif (str.length > max) throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`);\n\t}\n\ttemplate;\n\tparts;\n\tget variableNames() {\n\t\treturn this.parts.flatMap((part) => typeof part === \"string\" ? [] : part.names);\n\t}\n\tconstructor(template) {\n\t\tUriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, \"Template\");\n\t\tthis.template = template;\n\t\tthis.parts = this.parse(template);\n\t}\n\ttoString() {\n\t\treturn this.template;\n\t}\n\tparse(template) {\n\t\tconst parts = [];\n\t\tlet currentText = \"\";\n\t\tlet i = 0;\n\t\tlet expressionCount = 0;\n\t\twhile (i < template.length) if (template[i] === \"{\") {\n\t\t\tif (currentText) {\n\t\t\t\tparts.push(currentText);\n\t\t\t\tcurrentText = \"\";\n\t\t\t}\n\t\t\tconst end = template.indexOf(\"}\", i);\n\t\t\tif (end === -1) throw new Error(\"Unclosed template expression\");\n\t\t\texpressionCount++;\n\t\t\tif (expressionCount > MAX_TEMPLATE_EXPRESSIONS) throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`);\n\t\t\tconst expr = template.slice(i + 1, end);\n\t\t\tconst operator = this.getOperator(expr);\n\t\t\tconst exploded = expr.includes(\"*\");\n\t\t\tconst names = this.getNames(expr);\n\t\t\tconst name = names[0];\n\t\t\tfor (const name$1 of names) UriTemplate.validateLength(name$1, MAX_VARIABLE_LENGTH, \"Variable name\");\n\t\t\tparts.push({\n\t\t\t\tname,\n\t\t\t\toperator,\n\t\t\t\tnames,\n\t\t\t\texploded\n\t\t\t});\n\t\t\ti = end + 1;\n\t\t} else {\n\t\t\tcurrentText += template[i];\n\t\t\ti++;\n\t\t}\n\t\tif (currentText) parts.push(currentText);\n\t\treturn parts;\n\t}\n\tgetOperator(expr) {\n\t\treturn [\n\t\t\t\"+\",\n\t\t\t\"#\",\n\t\t\t\".\",\n\t\t\t\"/\",\n\t\t\t\"?\",\n\t\t\t\"&\"\n\t\t].find((op) => expr.startsWith(op)) || \"\";\n\t}\n\tgetNames(expr) {\n\t\tconst operator = this.getOperator(expr);\n\t\treturn expr.slice(operator.length).split(\",\").map((name) => name.replace(\"*\", \"\").trim()).filter((name) => name.length > 0);\n\t}\n\tencodeValue(value, operator) {\n\t\tUriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, \"Variable value\");\n\t\tif (operator === \"+\" || operator === \"#\") return encodeURI(value);\n\t\treturn encodeURIComponent(value);\n\t}\n\texpandPart(part, variables) {\n\t\tif (part.operator === \"?\" || part.operator === \"&\") {\n\t\t\tconst pairs = part.names.map((name) => {\n\t\t\t\tconst value$1 = variables[name];\n\t\t\t\tif (value$1 === void 0) return \"\";\n\t\t\t\treturn `${name}=${Array.isArray(value$1) ? value$1.map((v) => this.encodeValue(v, part.operator)).join(\",\") : this.encodeValue(value$1.toString(), part.operator)}`;\n\t\t\t}).filter((pair) => pair.length > 0);\n\t\t\tif (pairs.length === 0) return \"\";\n\t\t\treturn (part.operator === \"?\" ? \"?\" : \"&\") + pairs.join(\"&\");\n\t\t}\n\t\tif (part.names.length > 1) {\n\t\t\tconst values = part.names.map((name) => variables[name]).filter((v) => v !== void 0);\n\t\t\tif (values.length === 0) return \"\";\n\t\t\treturn values.map((v) => Array.isArray(v) ? v[0] : v).join(\",\");\n\t\t}\n\t\tconst value = variables[part.name];\n\t\tif (value === void 0) return \"\";\n\t\tconst encoded = (Array.isArray(value) ? value : [value]).map((v) => this.encodeValue(v, part.operator));\n\t\tswitch (part.operator) {\n\t\t\tcase \"\": return encoded.join(\",\");\n\t\t\tcase \"+\": return encoded.join(\",\");\n\t\t\tcase \"#\": return \"#\" + encoded.join(\",\");\n\t\t\tcase \".\": return \".\" + encoded.join(\".\");\n\t\t\tcase \"/\": return \"/\" + encoded.join(\"/\");\n\t\t\tdefault: return encoded.join(\",\");\n\t\t}\n\t}\n\texpand(variables) {\n\t\tlet result = \"\";\n\t\tlet hasQueryParam = false;\n\t\tfor (const part of this.parts) {\n\t\t\tif (typeof part === \"string\") {\n\t\t\t\tresult += part;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst expanded = this.expandPart(part, variables);\n\t\t\tif (!expanded) continue;\n\t\t\tresult += (part.operator === \"?\" || part.operator === \"&\") && hasQueryParam ? expanded.replace(\"?\", \"&\") : expanded;\n\t\t\tif (part.operator === \"?\" || part.operator === \"&\") hasQueryParam = true;\n\t\t}\n\t\treturn result;\n\t}\n\tescapeRegExp(str) {\n\t\treturn str.replaceAll(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n\t}\n\tpartToRegExp(part) {\n\t\tconst patterns = [];\n\t\tfor (const name$1 of part.names) UriTemplate.validateLength(name$1, MAX_VARIABLE_LENGTH, \"Variable name\");\n\t\tif (part.operator === \"?\" || part.operator === \"&\") {\n\t\t\tfor (let i = 0; i < part.names.length; i++) {\n\t\t\t\tconst name$1 = part.names[i];\n\t\t\t\tconst prefix = i === 0 ? \"\\\\\" + part.operator : \"&\";\n\t\t\t\tpatterns.push({\n\t\t\t\t\tpattern: prefix + this.escapeRegExp(name$1) + \"=([^&]+)\",\n\t\t\t\t\tname: name$1\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn patterns;\n\t\t}\n\t\tlet pattern;\n\t\tconst name = part.name;\n\t\tswitch (part.operator) {\n\t\t\tcase \"\":\n\t\t\t\tpattern = part.exploded ? \"([^/,]+(?:,[^/,]+)*)\" : \"([^/,]+)\";\n\t\t\t\tbreak;\n\t\t\tcase \"+\":\n\t\t\tcase \"#\":\n\t\t\t\tpattern = \"(.+)\";\n\t\t\t\tbreak;\n\t\t\tcase \".\":\n\t\t\t\tpattern = String.raw`\\.([^/,]+)`;\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tpattern = \"/\" + (part.exploded ? \"([^/,]+(?:,[^/,]+)*)\" : \"([^/,]+)\");\n\t\t\t\tbreak;\n\t\t\tdefault: pattern = \"([^/]+)\";\n\t\t}\n\t\tpatterns.push({\n\t\t\tpattern,\n\t\t\tname\n\t\t});\n\t\treturn patterns;\n\t}\n\tmatch(uri) {\n\t\tUriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, \"URI\");\n\t\tlet pattern = \"^\";\n\t\tconst names = [];\n\t\tfor (const part of this.parts) if (typeof part === \"string\") pattern += this.escapeRegExp(part);\n\t\telse {\n\t\t\tconst patterns = this.partToRegExp(part);\n\t\t\tfor (const { pattern: partPattern, name } of patterns) {\n\t\t\t\tpattern += partPattern;\n\t\t\t\tnames.push({\n\t\t\t\t\tname,\n\t\t\t\t\texploded: part.exploded\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tpattern += \"$\";\n\t\tUriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, \"Generated regex pattern\");\n\t\tconst regex = new RegExp(pattern);\n\t\tconst match = uri.match(regex);\n\t\tif (!match) return null;\n\t\tconst result = {};\n\t\tfor (const [i, name_] of names.entries()) {\n\t\t\tconst { name, exploded } = name_;\n\t\t\tconst value = match[i + 1];\n\t\t\tconst cleanName = name.replace(\"*\", \"\");\n\t\t\tresult[cleanName] = exploded && value.includes(\",\") ? value.split(\",\") : value;\n\t\t}\n\t\treturn result;\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/util/inMemory.ts\n/**\n* In-memory transport for creating clients and servers that talk to each other within the same process.\n*\n* Intended for testing and development. For production in-process connections, use\n* `StreamableHTTPClientTransport` against a local server URL.\n*/\nvar InMemoryTransport = class InMemoryTransport {\n\t_otherTransport;\n\t_messageQueue = [];\n\t_closed = false;\n\tonclose;\n\tonerror;\n\tonmessage;\n\tsessionId;\n\t/**\n\t* Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a {@linkcode @modelcontextprotocol/client!client/client.Client | Client} and one to a {@linkcode @modelcontextprotocol/server!server/server.Server | Server}.\n\t*/\n\tstatic createLinkedPair() {\n\t\tconst clientTransport = new InMemoryTransport();\n\t\tconst serverTransport = new InMemoryTransport();\n\t\tclientTransport._otherTransport = serverTransport;\n\t\tserverTransport._otherTransport = clientTransport;\n\t\treturn [clientTransport, serverTransport];\n\t}\n\tasync start() {\n\t\twhile (this._messageQueue.length > 0) {\n\t\t\tconst queuedMessage = this._messageQueue.shift();\n\t\t\tthis.onmessage?.(queuedMessage.message, queuedMessage.extra);\n\t\t}\n\t}\n\tasync close() {\n\t\tif (this._closed) return;\n\t\tthis._closed = true;\n\t\tconst other = this._otherTransport;\n\t\tthis._otherTransport = void 0;\n\t\ttry {\n\t\t\tawait other?.close();\n\t\t} finally {\n\t\t\tthis.onclose?.();\n\t\t}\n\t}\n\t/**\n\t* Sends a message with optional auth info.\n\t* This is useful for testing authentication scenarios.\n\t*/\n\tasync send(message, options) {\n\t\tif (!this._otherTransport) throw new SdkError(SdkErrorCode.NotConnected, \"Not connected\");\n\t\tif (this._otherTransport.onmessage) this._otherTransport.onmessage(message, { authInfo: options?.authInfo });\n\t\telse this._otherTransport._messageQueue.push({\n\t\t\tmessage,\n\t\t\textra: { authInfo: options?.authInfo }\n\t\t});\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/util/zodCompat.ts\n/**\n* Zod-specific helpers for the v1-compat raw-shape shorthand on\n* `registerTool`/`registerPrompt`. Kept separate from `standardSchema.ts` so\n* that file stays library-agnostic per the Standard Schema spec.\n*/\nfunction isZodV4Schema(v) {\n\treturn typeof v === \"object\" && v !== null && \"_zod\" in v;\n}\nfunction looksLikeZodV3(v) {\n\treturn typeof v === \"object\" && v !== null && !(\"_zod\" in v) && \"_def\" in v && typeof v._def?.typeName === \"string\";\n}\n/**\n* Detects a \"raw shape\" — a plain object whose values are Zod field schemas,\n* e.g. `{ name: z.string() }`. Powers the auto-wrap in\n* {@linkcode normalizeRawShapeSchema}, which wraps with `z.object()`, so only\n* Zod values are supported.\n*\n* @internal\n*/\nfunction isZodRawShape(obj) {\n\tif (typeof obj !== \"object\" || obj === null) return false;\n\tif (isStandardSchema(obj)) return false;\n\tconst proto = Object.getPrototypeOf(obj);\n\tif (proto !== Object.prototype && proto !== null) return false;\n\treturn Object.values(obj).every((v) => isZodV4Schema(v));\n}\n/**\n* Accepts either a {@linkcode StandardSchemaWithJSON} or a raw Zod shape\n* `{ field: z.string() }` and returns a {@linkcode StandardSchemaWithJSON}.\n* Raw shapes are wrapped with `z.object()` so the rest of the pipeline sees a\n* uniform schema type; already-wrapped schemas pass through unchanged.\n*\n* @internal\n*/\nfunction normalizeRawShapeSchema(schema) {\n\tif (schema === void 0) return void 0;\n\tif (isZodRawShape(schema)) return z.object(schema);\n\tif (typeof schema === \"object\" && schema !== null && !isStandardSchema(schema) && Object.values(schema).some((v) => looksLikeZodV3(v))) throw new TypeError(\"Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.\");\n\tif (!isStandardSchema(schema)) throw new TypeError(\"inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).\");\n\treturn schema;\n}\n\n//#endregion\n//#region ../core-internal/src/wire/preload.ts\n/**\n* Explicit warm-up entry for the lazy wire-schema layers.\n*\n* The per-revision wire schemas are built lazily: each era's schema set sits\n* behind a memoized factory (`buildSchemas2025`/`buildSchemas2026`), and the\n* registry/codec lookup maps above those factories are memoized the same way.\n* That laziness is the right default on process-per-invocation runtimes (CLI\n* tools, dev servers), where module evaluation IS startup latency and most\n* short-lived processes never validate a message on both eras.\n*\n* On platforms that bill request CPU but not module evaluation — isolate-based\n* edge/serverless runtimes such as Cloudflare Workers — the trade inverts:\n* module-scope work runs during isolate warm-up outside any request, while\n* lazy construction lands inside the first request's billed (and latency\n* budgeted) CPU. `preloadSchemas()` lets deployments on such platforms move\n* the one-time construction cost back to module scope by calling it at module\n* scope themselves. The packages' own workerd shims already do this, so\n* Workers deployments get eager construction automatically.\n*/\n/**\n* Eagerly builds every lazily-constructed wire-schema layer, so that no later\n* validation pays schema-construction cost.\n*\n* Synchronous and idempotent: every layer is a memo, so the first call does\n* all the work and subsequent calls return immediately. Reference identity is\n* unaffected — this forces the same memos every lazy consumer pulls through.\n*\n* Call it at module scope on platforms that bill per-request CPU but not\n* module evaluation (isolate-based edge/serverless runtimes), where deferring\n* construction would move it into the first request of every fresh isolate:\n*\n* ```ts\n* // from '@modelcontextprotocol/server' or '@modelcontextprotocol/client' —\n* // each package bundles its own schema copy, so warm the one(s) you import.\n* preloadSchemas(); // module scope — runs during isolate warm-up\n* ```\n*\n* On Node CLIs and other process-per-invocation runtimes, prefer the lazy\n* default — there, module-scope construction is pure added boot latency.\n*/\nfunction preloadSchemas() {\n\tbuildSchemas2025();\n\tbuildSchemas2026();\n\twarmRegistryMaps2025();\n\twarmInputSchemaMaps2026();\n\twarmWireResultSchemas2026();\n}\n\n//#endregion\n//#region ../core-internal/src/validators/fromJsonSchema.ts\n/**\n* Wrap a raw JSON Schema object as a {@linkcode StandardSchemaWithJSON} so it can be\n* passed to `registerTool` / `registerPrompt`. Use this when you already have JSON\n* Schema (e.g. from TypeBox, or hand-written) and want to register it without going\n* through a Standard Schema library.\n*\n* The callback arguments will be typed `unknown` (raw JSON Schema has no TypeScript\n* types attached). Cast at the call site, or use the generic `fromJsonSchema<MyType>(...)`.\n*\n* @param schema - A JSON Schema object describing the expected shape\n* @param validator - A validator provider. When importing `fromJsonSchema` from\n*   `@modelcontextprotocol/server` or `@modelcontextprotocol/client`, a runtime-appropriate\n*   default is provided automatically (AJV on Node.js, CfWorker on edge runtimes).\n*\n* @example\n* ```ts source=\"./fromJsonSchema.examples.ts#fromJsonSchema_basicUsage\"\n* const inputSchema = fromJsonSchema<{ name: string }>(\n*     { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] },\n*     validator\n* );\n* // Use with server.registerTool('greet', { inputSchema }, handler)\n* ```\n*/\nfunction fromJsonSchema(schema, validator) {\n\tconst check = validator.getValidator(schema);\n\treturn { \"~standard\": {\n\t\tversion: 1,\n\t\tvendor: \"mcp\",\n\t\tjsonSchema: {\n\t\t\tinput: () => schema,\n\t\t\toutput: () => schema\n\t\t},\n\t\tvalidate: (data) => {\n\t\t\tconst result = check(data);\n\t\t\treturn result.valid ? { value: result.data } : { issues: [{ message: result.errorMessage }] };\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { isTaskAugmentedRequestParams as $, promptArgumentsFromStandardSchema as A, LATEST_PROTOCOL_VERSION as At, scanXMcpHeaderDeclarations as B, TRACESTATE_META_KEY as Bt, REQUEST_STATE_ONLY_LEG_PACING_MS as C, CLIENT_CAPABILITIES_META_KEY as Ct, acceptedContent as D, INVALID_PARAMS as Dt, sleep as E, INTERNAL_ERROR as Et, carriesValidModernEnvelopeClaim as F, RELATED_TASK_META_KEY as Ft, isInitializeRequest as G, resourceUrlFromServerUrl as Gt, assertCompleteRequestPrompt as H, requiredClientCapabilitiesForInputRequest as Ht, classifyInboundRequest as I, SERVER_INFO_META_KEY as It, isJSONRPCErrorResponse as J, SdkHttpError as Jt, isInitializedNotification as K, SdkError as Kt, httpStatusForErrorCode as L, SUBSCRIPTION_ID_META_KEY as Lt, validateStandardSchema as M, METHOD_NOT_FOUND as Mt, parseSchema as N, PARSE_ERROR as Nt, inputRequired as O, INVALID_REQUEST as Ot, LADDER_ERROR_HTTP_STATUS as P, PROTOCOL_VERSION_META_KEY as Pt, isJSONRPCResultResponse as Q, modernOnlyStrictRejection as R, SUPPORTED_PROTOCOL_VERSIONS as Rt, specTypeSchemas as S, BAGGAGE_META_KEY as St, linkedRoundAbort as T, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as Tt, assertCompleteRequestResourceTemplate as U, requiredClientCapabilitiesForRequest as Ut, validateMcpParamHeaders as V, missingClientCapabilities as Vt, isCallToolResult as W, checkResourceAllowed as Wt, isJSONRPCRequest as X, OAuthErrorCode as Xt, isJSONRPCNotification as Y, OAuthError as Yt, isJSONRPCResponse as Z, mergeCapabilities as _, normalizeContentlessToolResult as _t, UriTemplate as a, requestMetaOf as at, withRequestStateValue as b, legacyProtocolVersions as bt, ReadBuffer as c, codecForVersion as ct, serializeMessage as d, ResourceNotFoundError as dt, parseJSONRPCMessage as et, getDisplayName as f, UnsupportedProtocolVersionError as ft, Protocol as g, attachCacheHintFallback as gt, DEFAULT_REQUEST_TIMEOUT_MSEC as h, assertValidCacheHint as ht, InMemoryTransport as i, hasEnvelopeClaim as it, standardSchemaToJsonSchema as j, LOG_LEVEL_META_KEY as jt, inputResponse as k, JSONRPC_VERSION as kt, STDIO_DEFAULT_MAX_BUFFER_SIZE as l, MissingRequiredClientCapabilityError as lt, mediaTypeEssence as m, ProtocolErrorCode as mt, preloadSchemas as n, LoggingLevelSchema as nt, createFetchWithInit as o, validateEnvelopeMeta as ot, isJsonContentType as p, UrlElicitationRequiredError as pt, isInputRequiredResult as q, SdkErrorCode as qt, normalizeRawShapeSchema as r, envelopeClaimVersion as rt, validateAndWarnToolName as s, MODERN_WIRE_REVISION as st, fromJsonSchema as t, JSONRPCMessageSchema as tt, deserializeMessage as u, ProtocolError as ut, requestStateAccessor as v, SUPPORTED_MODERN_PROTOCOL_VERSIONS as vt, inputRequiredRoundsExceededMessage as w, CLIENT_INFO_META_KEY as wt, isSpecType as x, modernProtocolVersions as xt, setNegotiatedProtocolVersion as y, isModernProtocolVersion as yt, validateStandardRequestHeaders as z, TRACEPARENT_META_KEY as zt };\n//# sourceMappingURL=src-Cqbh3MYc.mjs.map","import { r as __toESM, t as __commonJSMin } from \"./chunk-Br0eD_fh.mjs\";\nimport { t as declaredDialect } from \"./dialects-DoSzNhcb.mjs\";\n\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js\nvar require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;\n\tvar _CodeOrName = class {};\n\texports._CodeOrName = _CodeOrName;\n\texports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\n\tvar Name = class extends _CodeOrName {\n\t\tconstructor(s) {\n\t\t\tsuper();\n\t\t\tif (!exports.IDENTIFIER.test(s)) throw new Error(\"CodeGen: name must be a valid identifier\");\n\t\t\tthis.str = s;\n\t\t}\n\t\ttoString() {\n\t\t\treturn this.str;\n\t\t}\n\t\temptyStr() {\n\t\t\treturn false;\n\t\t}\n\t\tget names() {\n\t\t\treturn { [this.str]: 1 };\n\t\t}\n\t};\n\texports.Name = Name;\n\tvar _Code = class extends _CodeOrName {\n\t\tconstructor(code) {\n\t\t\tsuper();\n\t\t\tthis._items = typeof code === \"string\" ? [code] : code;\n\t\t}\n\t\ttoString() {\n\t\t\treturn this.str;\n\t\t}\n\t\temptyStr() {\n\t\t\tif (this._items.length > 1) return false;\n\t\t\tconst item = this._items[0];\n\t\t\treturn item === \"\" || item === \"\\\"\\\"\";\n\t\t}\n\t\tget str() {\n\t\t\tvar _a;\n\t\t\treturn (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, \"\");\n\t\t}\n\t\tget names() {\n\t\t\tvar _a;\n\t\t\treturn (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => {\n\t\t\t\tif (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1;\n\t\t\t\treturn names;\n\t\t\t}, {});\n\t\t}\n\t};\n\texports._Code = _Code;\n\texports.nil = new _Code(\"\");\n\tfunction _(strs, ...args) {\n\t\tconst code = [strs[0]];\n\t\tlet i = 0;\n\t\twhile (i < args.length) {\n\t\t\taddCodeArg(code, args[i]);\n\t\t\tcode.push(strs[++i]);\n\t\t}\n\t\treturn new _Code(code);\n\t}\n\texports._ = _;\n\tconst plus = new _Code(\"+\");\n\tfunction str(strs, ...args) {\n\t\tconst expr = [safeStringify(strs[0])];\n\t\tlet i = 0;\n\t\twhile (i < args.length) {\n\t\t\texpr.push(plus);\n\t\t\taddCodeArg(expr, args[i]);\n\t\t\texpr.push(plus, safeStringify(strs[++i]));\n\t\t}\n\t\toptimize(expr);\n\t\treturn new _Code(expr);\n\t}\n\texports.str = str;\n\tfunction addCodeArg(code, arg) {\n\t\tif (arg instanceof _Code) code.push(...arg._items);\n\t\telse if (arg instanceof Name) code.push(arg);\n\t\telse code.push(interpolate(arg));\n\t}\n\texports.addCodeArg = addCodeArg;\n\tfunction optimize(expr) {\n\t\tlet i = 1;\n\t\twhile (i < expr.length - 1) {\n\t\t\tif (expr[i] === plus) {\n\t\t\t\tconst res = mergeExprItems(expr[i - 1], expr[i + 1]);\n\t\t\t\tif (res !== void 0) {\n\t\t\t\t\texpr.splice(i - 1, 3, res);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\texpr[i++] = \"+\";\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}\n\tfunction mergeExprItems(a, b) {\n\t\tif (b === \"\\\"\\\"\") return a;\n\t\tif (a === \"\\\"\\\"\") return b;\n\t\tif (typeof a == \"string\") {\n\t\t\tif (b instanceof Name || a[a.length - 1] !== \"\\\"\") return;\n\t\t\tif (typeof b != \"string\") return `${a.slice(0, -1)}${b}\"`;\n\t\t\tif (b[0] === \"\\\"\") return a.slice(0, -1) + b.slice(1);\n\t\t\treturn;\n\t\t}\n\t\tif (typeof b == \"string\" && b[0] === \"\\\"\" && !(a instanceof Name)) return `\"${a}${b.slice(1)}`;\n\t}\n\tfunction strConcat(c1, c2) {\n\t\treturn c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;\n\t}\n\texports.strConcat = strConcat;\n\tfunction interpolate(x) {\n\t\treturn typeof x == \"number\" || typeof x == \"boolean\" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(\",\") : x);\n\t}\n\tfunction stringify(x) {\n\t\treturn new _Code(safeStringify(x));\n\t}\n\texports.stringify = stringify;\n\tfunction safeStringify(x) {\n\t\treturn JSON.stringify(x).replace(/\\u2028/g, \"\\\\u2028\").replace(/\\u2029/g, \"\\\\u2029\");\n\t}\n\texports.safeStringify = safeStringify;\n\tfunction getProperty(key) {\n\t\treturn typeof key == \"string\" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;\n\t}\n\texports.getProperty = getProperty;\n\tfunction getEsmExportName(key) {\n\t\tif (typeof key == \"string\" && exports.IDENTIFIER.test(key)) return new _Code(`${key}`);\n\t\tthrow new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);\n\t}\n\texports.getEsmExportName = getEsmExportName;\n\tfunction regexpCode(rx) {\n\t\treturn new _Code(rx.toString());\n\t}\n\texports.regexpCode = regexpCode;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js\nvar require_scope = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;\n\tconst code_1 = require_code$1();\n\tvar ValueError = class extends Error {\n\t\tconstructor(name) {\n\t\t\tsuper(`CodeGen: \"code\" for ${name} not defined`);\n\t\t\tthis.value = name.value;\n\t\t}\n\t};\n\tvar UsedValueState;\n\t(function(UsedValueState) {\n\t\tUsedValueState[UsedValueState[\"Started\"] = 0] = \"Started\";\n\t\tUsedValueState[UsedValueState[\"Completed\"] = 1] = \"Completed\";\n\t})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));\n\texports.varKinds = {\n\t\tconst: new code_1.Name(\"const\"),\n\t\tlet: new code_1.Name(\"let\"),\n\t\tvar: new code_1.Name(\"var\")\n\t};\n\tvar Scope = class {\n\t\tconstructor({ prefixes, parent } = {}) {\n\t\t\tthis._names = {};\n\t\t\tthis._prefixes = prefixes;\n\t\t\tthis._parent = parent;\n\t\t}\n\t\ttoName(nameOrPrefix) {\n\t\t\treturn nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);\n\t\t}\n\t\tname(prefix) {\n\t\t\treturn new code_1.Name(this._newName(prefix));\n\t\t}\n\t\t_newName(prefix) {\n\t\t\tconst ng = this._names[prefix] || this._nameGroup(prefix);\n\t\t\treturn `${prefix}${ng.index++}`;\n\t\t}\n\t\t_nameGroup(prefix) {\n\t\t\tvar _a, _b;\n\t\t\tif (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) throw new Error(`CodeGen: prefix \"${prefix}\" is not allowed in this scope`);\n\t\t\treturn this._names[prefix] = {\n\t\t\t\tprefix,\n\t\t\t\tindex: 0\n\t\t\t};\n\t\t}\n\t};\n\texports.Scope = Scope;\n\tvar ValueScopeName = class extends code_1.Name {\n\t\tconstructor(prefix, nameStr) {\n\t\t\tsuper(nameStr);\n\t\t\tthis.prefix = prefix;\n\t\t}\n\t\tsetValue(value, { property, itemIndex }) {\n\t\t\tthis.value = value;\n\t\t\tthis.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`;\n\t\t}\n\t};\n\texports.ValueScopeName = ValueScopeName;\n\tconst line = (0, code_1._)`\\n`;\n\tvar ValueScope = class extends Scope {\n\t\tconstructor(opts) {\n\t\t\tsuper(opts);\n\t\t\tthis._values = {};\n\t\t\tthis._scope = opts.scope;\n\t\t\tthis.opts = {\n\t\t\t\t...opts,\n\t\t\t\t_n: opts.lines ? line : code_1.nil\n\t\t\t};\n\t\t}\n\t\tget() {\n\t\t\treturn this._scope;\n\t\t}\n\t\tname(prefix) {\n\t\t\treturn new ValueScopeName(prefix, this._newName(prefix));\n\t\t}\n\t\tvalue(nameOrPrefix, value) {\n\t\t\tvar _a;\n\t\t\tif (value.ref === void 0) throw new Error(\"CodeGen: ref must be passed in value\");\n\t\t\tconst name = this.toName(nameOrPrefix);\n\t\t\tconst { prefix } = name;\n\t\t\tconst valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;\n\t\t\tlet vs = this._values[prefix];\n\t\t\tif (vs) {\n\t\t\t\tconst _name = vs.get(valueKey);\n\t\t\t\tif (_name) return _name;\n\t\t\t} else vs = this._values[prefix] = /* @__PURE__ */ new Map();\n\t\t\tvs.set(valueKey, name);\n\t\t\tconst s = this._scope[prefix] || (this._scope[prefix] = []);\n\t\t\tconst itemIndex = s.length;\n\t\t\ts[itemIndex] = value.ref;\n\t\t\tname.setValue(value, {\n\t\t\t\tproperty: prefix,\n\t\t\t\titemIndex\n\t\t\t});\n\t\t\treturn name;\n\t\t}\n\t\tgetValue(prefix, keyOrRef) {\n\t\t\tconst vs = this._values[prefix];\n\t\t\tif (!vs) return;\n\t\t\treturn vs.get(keyOrRef);\n\t\t}\n\t\tscopeRefs(scopeName, values = this._values) {\n\t\t\treturn this._reduceValues(values, (name) => {\n\t\t\t\tif (name.scopePath === void 0) throw new Error(`CodeGen: name \"${name}\" has no value`);\n\t\t\t\treturn (0, code_1._)`${scopeName}${name.scopePath}`;\n\t\t\t});\n\t\t}\n\t\tscopeCode(values = this._values, usedValues, getCode) {\n\t\t\treturn this._reduceValues(values, (name) => {\n\t\t\t\tif (name.value === void 0) throw new Error(`CodeGen: name \"${name}\" has no value`);\n\t\t\t\treturn name.value.code;\n\t\t\t}, usedValues, getCode);\n\t\t}\n\t\t_reduceValues(values, valueCode, usedValues = {}, getCode) {\n\t\t\tlet code = code_1.nil;\n\t\t\tfor (const prefix in values) {\n\t\t\t\tconst vs = values[prefix];\n\t\t\t\tif (!vs) continue;\n\t\t\t\tconst nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map();\n\t\t\t\tvs.forEach((name) => {\n\t\t\t\t\tif (nameSet.has(name)) return;\n\t\t\t\t\tnameSet.set(name, UsedValueState.Started);\n\t\t\t\t\tlet c = valueCode(name);\n\t\t\t\t\tif (c) {\n\t\t\t\t\t\tconst def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;\n\t\t\t\t\t\tcode = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`;\n\t\t\t\t\t} else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) code = (0, code_1._)`${code}${c}${this.opts._n}`;\n\t\t\t\t\telse throw new ValueError(name);\n\t\t\t\t\tnameSet.set(name, UsedValueState.Completed);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn code;\n\t\t}\n\t};\n\texports.ValueScope = ValueScope;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js\nvar require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;\n\tconst code_1 = require_code$1();\n\tconst scope_1 = require_scope();\n\tvar code_2 = require_code$1();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"strConcat\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.strConcat;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"getProperty\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.getProperty;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"regexpCode\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.regexpCode;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.Name;\n\t\t}\n\t});\n\tvar scope_2 = require_scope();\n\tObject.defineProperty(exports, \"Scope\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn scope_2.Scope;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"ValueScope\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn scope_2.ValueScope;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"ValueScopeName\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn scope_2.ValueScopeName;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"varKinds\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn scope_2.varKinds;\n\t\t}\n\t});\n\texports.operators = {\n\t\tGT: new code_1._Code(\">\"),\n\t\tGTE: new code_1._Code(\">=\"),\n\t\tLT: new code_1._Code(\"<\"),\n\t\tLTE: new code_1._Code(\"<=\"),\n\t\tEQ: new code_1._Code(\"===\"),\n\t\tNEQ: new code_1._Code(\"!==\"),\n\t\tNOT: new code_1._Code(\"!\"),\n\t\tOR: new code_1._Code(\"||\"),\n\t\tAND: new code_1._Code(\"&&\"),\n\t\tADD: new code_1._Code(\"+\")\n\t};\n\tvar Node = class {\n\t\toptimizeNodes() {\n\t\t\treturn this;\n\t\t}\n\t\toptimizeNames(_names, _constants) {\n\t\t\treturn this;\n\t\t}\n\t};\n\tvar Def = class extends Node {\n\t\tconstructor(varKind, name, rhs) {\n\t\t\tsuper();\n\t\t\tthis.varKind = varKind;\n\t\t\tthis.name = name;\n\t\t\tthis.rhs = rhs;\n\t\t}\n\t\trender({ es5, _n }) {\n\t\t\tconst varKind = es5 ? scope_1.varKinds.var : this.varKind;\n\t\t\tconst rhs = this.rhs === void 0 ? \"\" : ` = ${this.rhs}`;\n\t\t\treturn `${varKind} ${this.name}${rhs};` + _n;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tif (!names[this.name.str]) return;\n\t\t\tif (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};\n\t\t}\n\t};\n\tvar Assign = class extends Node {\n\t\tconstructor(lhs, rhs, sideEffects) {\n\t\t\tsuper();\n\t\t\tthis.lhs = lhs;\n\t\t\tthis.rhs = rhs;\n\t\t\tthis.sideEffects = sideEffects;\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `${this.lhs} = ${this.rhs};` + _n;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tif (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) return;\n\t\t\tthis.rhs = optimizeExpr(this.rhs, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn addExprNames(this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }, this.rhs);\n\t\t}\n\t};\n\tvar AssignOp = class extends Assign {\n\t\tconstructor(lhs, op, rhs, sideEffects) {\n\t\t\tsuper(lhs, rhs, sideEffects);\n\t\t\tthis.op = op;\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `${this.lhs} ${this.op}= ${this.rhs};` + _n;\n\t\t}\n\t};\n\tvar Label = class extends Node {\n\t\tconstructor(label) {\n\t\t\tsuper();\n\t\t\tthis.label = label;\n\t\t\tthis.names = {};\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `${this.label}:` + _n;\n\t\t}\n\t};\n\tvar Break = class extends Node {\n\t\tconstructor(label) {\n\t\t\tsuper();\n\t\t\tthis.label = label;\n\t\t\tthis.names = {};\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `break${this.label ? ` ${this.label}` : \"\"};` + _n;\n\t\t}\n\t};\n\tvar Throw = class extends Node {\n\t\tconstructor(error) {\n\t\t\tsuper();\n\t\t\tthis.error = error;\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `throw ${this.error};` + _n;\n\t\t}\n\t\tget names() {\n\t\t\treturn this.error.names;\n\t\t}\n\t};\n\tvar AnyCode = class extends Node {\n\t\tconstructor(code) {\n\t\t\tsuper();\n\t\t\tthis.code = code;\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `${this.code};` + _n;\n\t\t}\n\t\toptimizeNodes() {\n\t\t\treturn `${this.code}` ? this : void 0;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tthis.code = optimizeExpr(this.code, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn this.code instanceof code_1._CodeOrName ? this.code.names : {};\n\t\t}\n\t};\n\tvar ParentNode = class extends Node {\n\t\tconstructor(nodes = []) {\n\t\t\tsuper();\n\t\t\tthis.nodes = nodes;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn this.nodes.reduce((code, n) => code + n.render(opts), \"\");\n\t\t}\n\t\toptimizeNodes() {\n\t\t\tconst { nodes } = this;\n\t\t\tlet i = nodes.length;\n\t\t\twhile (i--) {\n\t\t\t\tconst n = nodes[i].optimizeNodes();\n\t\t\t\tif (Array.isArray(n)) nodes.splice(i, 1, ...n);\n\t\t\t\telse if (n) nodes[i] = n;\n\t\t\t\telse nodes.splice(i, 1);\n\t\t\t}\n\t\t\treturn nodes.length > 0 ? this : void 0;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tconst { nodes } = this;\n\t\t\tlet i = nodes.length;\n\t\t\twhile (i--) {\n\t\t\t\tconst n = nodes[i];\n\t\t\t\tif (n.optimizeNames(names, constants)) continue;\n\t\t\t\tsubtractNames(names, n.names);\n\t\t\t\tnodes.splice(i, 1);\n\t\t\t}\n\t\t\treturn nodes.length > 0 ? this : void 0;\n\t\t}\n\t\tget names() {\n\t\t\treturn this.nodes.reduce((names, n) => addNames(names, n.names), {});\n\t\t}\n\t};\n\tvar BlockNode = class extends ParentNode {\n\t\trender(opts) {\n\t\t\treturn \"{\" + opts._n + super.render(opts) + \"}\" + opts._n;\n\t\t}\n\t};\n\tvar Root = class extends ParentNode {};\n\tvar Else = class extends BlockNode {};\n\tElse.kind = \"else\";\n\tvar If = class If extends BlockNode {\n\t\tconstructor(condition, nodes) {\n\t\t\tsuper(nodes);\n\t\t\tthis.condition = condition;\n\t\t}\n\t\trender(opts) {\n\t\t\tlet code = `if(${this.condition})` + super.render(opts);\n\t\t\tif (this.else) code += \"else \" + this.else.render(opts);\n\t\t\treturn code;\n\t\t}\n\t\toptimizeNodes() {\n\t\t\tsuper.optimizeNodes();\n\t\t\tconst cond = this.condition;\n\t\t\tif (cond === true) return this.nodes;\n\t\t\tlet e = this.else;\n\t\t\tif (e) {\n\t\t\t\tconst ns = e.optimizeNodes();\n\t\t\t\te = this.else = Array.isArray(ns) ? new Else(ns) : ns;\n\t\t\t}\n\t\t\tif (e) {\n\t\t\t\tif (cond === false) return e instanceof If ? e : e.nodes;\n\t\t\t\tif (this.nodes.length) return this;\n\t\t\t\treturn new If(not(cond), e instanceof If ? [e] : e.nodes);\n\t\t\t}\n\t\t\tif (cond === false || !this.nodes.length) return void 0;\n\t\t\treturn this;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tvar _a;\n\t\t\tthis.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n\t\t\tif (!(super.optimizeNames(names, constants) || this.else)) return;\n\t\t\tthis.condition = optimizeExpr(this.condition, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\tconst names = super.names;\n\t\t\taddExprNames(names, this.condition);\n\t\t\tif (this.else) addNames(names, this.else.names);\n\t\t\treturn names;\n\t\t}\n\t};\n\tIf.kind = \"if\";\n\tvar For = class extends BlockNode {};\n\tFor.kind = \"for\";\n\tvar ForLoop = class extends For {\n\t\tconstructor(iteration) {\n\t\t\tsuper();\n\t\t\tthis.iteration = iteration;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn `for(${this.iteration})` + super.render(opts);\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tif (!super.optimizeNames(names, constants)) return;\n\t\t\tthis.iteration = optimizeExpr(this.iteration, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn addNames(super.names, this.iteration.names);\n\t\t}\n\t};\n\tvar ForRange = class extends For {\n\t\tconstructor(varKind, name, from, to) {\n\t\t\tsuper();\n\t\t\tthis.varKind = varKind;\n\t\t\tthis.name = name;\n\t\t\tthis.from = from;\n\t\t\tthis.to = to;\n\t\t}\n\t\trender(opts) {\n\t\t\tconst varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;\n\t\t\tconst { name, from, to } = this;\n\t\t\treturn `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);\n\t\t}\n\t\tget names() {\n\t\t\treturn addExprNames(addExprNames(super.names, this.from), this.to);\n\t\t}\n\t};\n\tvar ForIter = class extends For {\n\t\tconstructor(loop, varKind, name, iterable) {\n\t\t\tsuper();\n\t\t\tthis.loop = loop;\n\t\t\tthis.varKind = varKind;\n\t\t\tthis.name = name;\n\t\t\tthis.iterable = iterable;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tif (!super.optimizeNames(names, constants)) return;\n\t\t\tthis.iterable = optimizeExpr(this.iterable, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn addNames(super.names, this.iterable.names);\n\t\t}\n\t};\n\tvar Func = class extends BlockNode {\n\t\tconstructor(name, args, async) {\n\t\t\tsuper();\n\t\t\tthis.name = name;\n\t\t\tthis.args = args;\n\t\t\tthis.async = async;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn `${this.async ? \"async \" : \"\"}function ${this.name}(${this.args})` + super.render(opts);\n\t\t}\n\t};\n\tFunc.kind = \"func\";\n\tvar Return = class extends ParentNode {\n\t\trender(opts) {\n\t\t\treturn \"return \" + super.render(opts);\n\t\t}\n\t};\n\tReturn.kind = \"return\";\n\tvar Try = class extends BlockNode {\n\t\trender(opts) {\n\t\t\tlet code = \"try\" + super.render(opts);\n\t\t\tif (this.catch) code += this.catch.render(opts);\n\t\t\tif (this.finally) code += this.finally.render(opts);\n\t\t\treturn code;\n\t\t}\n\t\toptimizeNodes() {\n\t\t\tvar _a, _b;\n\t\t\tsuper.optimizeNodes();\n\t\t\t(_a = this.catch) === null || _a === void 0 || _a.optimizeNodes();\n\t\t\t(_b = this.finally) === null || _b === void 0 || _b.optimizeNodes();\n\t\t\treturn this;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tvar _a, _b;\n\t\t\tsuper.optimizeNames(names, constants);\n\t\t\t(_a = this.catch) === null || _a === void 0 || _a.optimizeNames(names, constants);\n\t\t\t(_b = this.finally) === null || _b === void 0 || _b.optimizeNames(names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\tconst names = super.names;\n\t\t\tif (this.catch) addNames(names, this.catch.names);\n\t\t\tif (this.finally) addNames(names, this.finally.names);\n\t\t\treturn names;\n\t\t}\n\t};\n\tvar Catch = class extends BlockNode {\n\t\tconstructor(error) {\n\t\t\tsuper();\n\t\t\tthis.error = error;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn `catch(${this.error})` + super.render(opts);\n\t\t}\n\t};\n\tCatch.kind = \"catch\";\n\tvar Finally = class extends BlockNode {\n\t\trender(opts) {\n\t\t\treturn \"finally\" + super.render(opts);\n\t\t}\n\t};\n\tFinally.kind = \"finally\";\n\tvar CodeGen = class {\n\t\tconstructor(extScope, opts = {}) {\n\t\t\tthis._values = {};\n\t\t\tthis._blockStarts = [];\n\t\t\tthis._constants = {};\n\t\t\tthis.opts = {\n\t\t\t\t...opts,\n\t\t\t\t_n: opts.lines ? \"\\n\" : \"\"\n\t\t\t};\n\t\t\tthis._extScope = extScope;\n\t\t\tthis._scope = new scope_1.Scope({ parent: extScope });\n\t\t\tthis._nodes = [new Root()];\n\t\t}\n\t\ttoString() {\n\t\t\treturn this._root.render(this.opts);\n\t\t}\n\t\tname(prefix) {\n\t\t\treturn this._scope.name(prefix);\n\t\t}\n\t\tscopeName(prefix) {\n\t\t\treturn this._extScope.name(prefix);\n\t\t}\n\t\tscopeValue(prefixOrName, value) {\n\t\t\tconst name = this._extScope.value(prefixOrName, value);\n\t\t\t(this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set())).add(name);\n\t\t\treturn name;\n\t\t}\n\t\tgetScopeValue(prefix, keyOrRef) {\n\t\t\treturn this._extScope.getValue(prefix, keyOrRef);\n\t\t}\n\t\tscopeRefs(scopeName) {\n\t\t\treturn this._extScope.scopeRefs(scopeName, this._values);\n\t\t}\n\t\tscopeCode() {\n\t\t\treturn this._extScope.scopeCode(this._values);\n\t\t}\n\t\t_def(varKind, nameOrPrefix, rhs, constant) {\n\t\t\tconst name = this._scope.toName(nameOrPrefix);\n\t\t\tif (rhs !== void 0 && constant) this._constants[name.str] = rhs;\n\t\t\tthis._leafNode(new Def(varKind, name, rhs));\n\t\t\treturn name;\n\t\t}\n\t\tconst(nameOrPrefix, rhs, _constant) {\n\t\t\treturn this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);\n\t\t}\n\t\tlet(nameOrPrefix, rhs, _constant) {\n\t\t\treturn this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);\n\t\t}\n\t\tvar(nameOrPrefix, rhs, _constant) {\n\t\t\treturn this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);\n\t\t}\n\t\tassign(lhs, rhs, sideEffects) {\n\t\t\treturn this._leafNode(new Assign(lhs, rhs, sideEffects));\n\t\t}\n\t\tadd(lhs, rhs) {\n\t\t\treturn this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));\n\t\t}\n\t\tcode(c) {\n\t\t\tif (typeof c == \"function\") c();\n\t\t\telse if (c !== code_1.nil) this._leafNode(new AnyCode(c));\n\t\t\treturn this;\n\t\t}\n\t\tobject(...keyValues) {\n\t\t\tconst code = [\"{\"];\n\t\t\tfor (const [key, value] of keyValues) {\n\t\t\t\tif (code.length > 1) code.push(\",\");\n\t\t\t\tcode.push(key);\n\t\t\t\tif (key !== value || this.opts.es5) {\n\t\t\t\t\tcode.push(\":\");\n\t\t\t\t\t(0, code_1.addCodeArg)(code, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcode.push(\"}\");\n\t\t\treturn new code_1._Code(code);\n\t\t}\n\t\tif(condition, thenBody, elseBody) {\n\t\t\tthis._blockNode(new If(condition));\n\t\t\tif (thenBody && elseBody) this.code(thenBody).else().code(elseBody).endIf();\n\t\t\telse if (thenBody) this.code(thenBody).endIf();\n\t\t\telse if (elseBody) throw new Error(\"CodeGen: \\\"else\\\" body without \\\"then\\\" body\");\n\t\t\treturn this;\n\t\t}\n\t\telseIf(condition) {\n\t\t\treturn this._elseNode(new If(condition));\n\t\t}\n\t\telse() {\n\t\t\treturn this._elseNode(new Else());\n\t\t}\n\t\tendIf() {\n\t\t\treturn this._endBlockNode(If, Else);\n\t\t}\n\t\t_for(node, forBody) {\n\t\t\tthis._blockNode(node);\n\t\t\tif (forBody) this.code(forBody).endFor();\n\t\t\treturn this;\n\t\t}\n\t\tfor(iteration, forBody) {\n\t\t\treturn this._for(new ForLoop(iteration), forBody);\n\t\t}\n\t\tforRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {\n\t\t\tconst name = this._scope.toName(nameOrPrefix);\n\t\t\treturn this._for(new ForRange(varKind, name, from, to), () => forBody(name));\n\t\t}\n\t\tforOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {\n\t\t\tconst name = this._scope.toName(nameOrPrefix);\n\t\t\tif (this.opts.es5) {\n\t\t\t\tconst arr = iterable instanceof code_1.Name ? iterable : this.var(\"_arr\", iterable);\n\t\t\t\treturn this.forRange(\"_i\", 0, (0, code_1._)`${arr}.length`, (i) => {\n\t\t\t\t\tthis.var(name, (0, code_1._)`${arr}[${i}]`);\n\t\t\t\t\tforBody(name);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn this._for(new ForIter(\"of\", varKind, name, iterable), () => forBody(name));\n\t\t}\n\t\tforIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {\n\t\t\tif (this.opts.ownProperties) return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody);\n\t\t\tconst name = this._scope.toName(nameOrPrefix);\n\t\t\treturn this._for(new ForIter(\"in\", varKind, name, obj), () => forBody(name));\n\t\t}\n\t\tendFor() {\n\t\t\treturn this._endBlockNode(For);\n\t\t}\n\t\tlabel(label) {\n\t\t\treturn this._leafNode(new Label(label));\n\t\t}\n\t\tbreak(label) {\n\t\t\treturn this._leafNode(new Break(label));\n\t\t}\n\t\treturn(value) {\n\t\t\tconst node = new Return();\n\t\t\tthis._blockNode(node);\n\t\t\tthis.code(value);\n\t\t\tif (node.nodes.length !== 1) throw new Error(\"CodeGen: \\\"return\\\" should have one node\");\n\t\t\treturn this._endBlockNode(Return);\n\t\t}\n\t\ttry(tryBody, catchCode, finallyCode) {\n\t\t\tif (!catchCode && !finallyCode) throw new Error(\"CodeGen: \\\"try\\\" without \\\"catch\\\" and \\\"finally\\\"\");\n\t\t\tconst node = new Try();\n\t\t\tthis._blockNode(node);\n\t\t\tthis.code(tryBody);\n\t\t\tif (catchCode) {\n\t\t\t\tconst error = this.name(\"e\");\n\t\t\t\tthis._currNode = node.catch = new Catch(error);\n\t\t\t\tcatchCode(error);\n\t\t\t}\n\t\t\tif (finallyCode) {\n\t\t\t\tthis._currNode = node.finally = new Finally();\n\t\t\t\tthis.code(finallyCode);\n\t\t\t}\n\t\t\treturn this._endBlockNode(Catch, Finally);\n\t\t}\n\t\tthrow(error) {\n\t\t\treturn this._leafNode(new Throw(error));\n\t\t}\n\t\tblock(body, nodeCount) {\n\t\t\tthis._blockStarts.push(this._nodes.length);\n\t\t\tif (body) this.code(body).endBlock(nodeCount);\n\t\t\treturn this;\n\t\t}\n\t\tendBlock(nodeCount) {\n\t\t\tconst len = this._blockStarts.pop();\n\t\t\tif (len === void 0) throw new Error(\"CodeGen: not in self-balancing block\");\n\t\t\tconst toClose = this._nodes.length - len;\n\t\t\tif (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);\n\t\t\tthis._nodes.length = len;\n\t\t\treturn this;\n\t\t}\n\t\tfunc(name, args = code_1.nil, async, funcBody) {\n\t\t\tthis._blockNode(new Func(name, args, async));\n\t\t\tif (funcBody) this.code(funcBody).endFunc();\n\t\t\treturn this;\n\t\t}\n\t\tendFunc() {\n\t\t\treturn this._endBlockNode(Func);\n\t\t}\n\t\toptimize(n = 1) {\n\t\t\twhile (n-- > 0) {\n\t\t\t\tthis._root.optimizeNodes();\n\t\t\t\tthis._root.optimizeNames(this._root.names, this._constants);\n\t\t\t}\n\t\t}\n\t\t_leafNode(node) {\n\t\t\tthis._currNode.nodes.push(node);\n\t\t\treturn this;\n\t\t}\n\t\t_blockNode(node) {\n\t\t\tthis._currNode.nodes.push(node);\n\t\t\tthis._nodes.push(node);\n\t\t}\n\t\t_endBlockNode(N1, N2) {\n\t\t\tconst n = this._currNode;\n\t\t\tif (n instanceof N1 || N2 && n instanceof N2) {\n\t\t\t\tthis._nodes.pop();\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthrow new Error(`CodeGen: not in block \"${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}\"`);\n\t\t}\n\t\t_elseNode(node) {\n\t\t\tconst n = this._currNode;\n\t\t\tif (!(n instanceof If)) throw new Error(\"CodeGen: \\\"else\\\" without \\\"if\\\"\");\n\t\t\tthis._currNode = n.else = node;\n\t\t\treturn this;\n\t\t}\n\t\tget _root() {\n\t\t\treturn this._nodes[0];\n\t\t}\n\t\tget _currNode() {\n\t\t\tconst ns = this._nodes;\n\t\t\treturn ns[ns.length - 1];\n\t\t}\n\t\tset _currNode(node) {\n\t\t\tconst ns = this._nodes;\n\t\t\tns[ns.length - 1] = node;\n\t\t}\n\t};\n\texports.CodeGen = CodeGen;\n\tfunction addNames(names, from) {\n\t\tfor (const n in from) names[n] = (names[n] || 0) + (from[n] || 0);\n\t\treturn names;\n\t}\n\tfunction addExprNames(names, from) {\n\t\treturn from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;\n\t}\n\tfunction optimizeExpr(expr, names, constants) {\n\t\tif (expr instanceof code_1.Name) return replaceName(expr);\n\t\tif (!canOptimize(expr)) return expr;\n\t\treturn new code_1._Code(expr._items.reduce((items, c) => {\n\t\t\tif (c instanceof code_1.Name) c = replaceName(c);\n\t\t\tif (c instanceof code_1._Code) items.push(...c._items);\n\t\t\telse items.push(c);\n\t\t\treturn items;\n\t\t}, []));\n\t\tfunction replaceName(n) {\n\t\t\tconst c = constants[n.str];\n\t\t\tif (c === void 0 || names[n.str] !== 1) return n;\n\t\t\tdelete names[n.str];\n\t\t\treturn c;\n\t\t}\n\t\tfunction canOptimize(e) {\n\t\t\treturn e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);\n\t\t}\n\t}\n\tfunction subtractNames(names, from) {\n\t\tfor (const n in from) names[n] = (names[n] || 0) - (from[n] || 0);\n\t}\n\tfunction not(x) {\n\t\treturn typeof x == \"boolean\" || typeof x == \"number\" || x === null ? !x : (0, code_1._)`!${par(x)}`;\n\t}\n\texports.not = not;\n\tconst andCode = mappend(exports.operators.AND);\n\tfunction and(...args) {\n\t\treturn args.reduce(andCode);\n\t}\n\texports.and = and;\n\tconst orCode = mappend(exports.operators.OR);\n\tfunction or(...args) {\n\t\treturn args.reduce(orCode);\n\t}\n\texports.or = or;\n\tfunction mappend(op) {\n\t\treturn (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;\n\t}\n\tfunction par(x) {\n\t\treturn x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js\nvar require_util = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst code_1 = require_code$1();\n\tfunction toHash(arr) {\n\t\tconst hash = {};\n\t\tfor (const item of arr) hash[item] = true;\n\t\treturn hash;\n\t}\n\texports.toHash = toHash;\n\tfunction alwaysValidSchema(it, schema) {\n\t\tif (typeof schema == \"boolean\") return schema;\n\t\tif (Object.keys(schema).length === 0) return true;\n\t\tcheckUnknownRules(it, schema);\n\t\treturn !schemaHasRules(schema, it.self.RULES.all);\n\t}\n\texports.alwaysValidSchema = alwaysValidSchema;\n\tfunction checkUnknownRules(it, schema = it.schema) {\n\t\tconst { opts, self } = it;\n\t\tif (!opts.strictSchema) return;\n\t\tif (typeof schema === \"boolean\") return;\n\t\tconst rules = self.RULES.keywords;\n\t\tfor (const key in schema) if (!rules[key]) checkStrictMode(it, `unknown keyword: \"${key}\"`);\n\t}\n\texports.checkUnknownRules = checkUnknownRules;\n\tfunction schemaHasRules(schema, rules) {\n\t\tif (typeof schema == \"boolean\") return !schema;\n\t\tfor (const key in schema) if (rules[key]) return true;\n\t\treturn false;\n\t}\n\texports.schemaHasRules = schemaHasRules;\n\tfunction schemaHasRulesButRef(schema, RULES) {\n\t\tif (typeof schema == \"boolean\") return !schema;\n\t\tfor (const key in schema) if (key !== \"$ref\" && RULES.all[key]) return true;\n\t\treturn false;\n\t}\n\texports.schemaHasRulesButRef = schemaHasRulesButRef;\n\tfunction schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {\n\t\tif (!$data) {\n\t\t\tif (typeof schema == \"number\" || typeof schema == \"boolean\") return schema;\n\t\t\tif (typeof schema == \"string\") return (0, codegen_1._)`${schema}`;\n\t\t}\n\t\treturn (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;\n\t}\n\texports.schemaRefOrVal = schemaRefOrVal;\n\tfunction unescapeFragment(str) {\n\t\treturn unescapeJsonPointer(decodeURIComponent(str));\n\t}\n\texports.unescapeFragment = unescapeFragment;\n\tfunction escapeFragment(str) {\n\t\treturn encodeURIComponent(escapeJsonPointer(str));\n\t}\n\texports.escapeFragment = escapeFragment;\n\tfunction escapeJsonPointer(str) {\n\t\tif (typeof str == \"number\") return `${str}`;\n\t\treturn str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n\t}\n\texports.escapeJsonPointer = escapeJsonPointer;\n\tfunction unescapeJsonPointer(str) {\n\t\treturn str.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n\t}\n\texports.unescapeJsonPointer = unescapeJsonPointer;\n\tfunction eachItem(xs, f) {\n\t\tif (Array.isArray(xs)) for (const x of xs) f(x);\n\t\telse f(xs);\n\t}\n\texports.eachItem = eachItem;\n\tfunction makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) {\n\t\treturn (gen, from, to, toName) => {\n\t\t\tconst res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues(from, to);\n\t\t\treturn toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;\n\t\t};\n\t}\n\texports.mergeEvaluated = {\n\t\tprops: makeMergeEvaluated({\n\t\t\tmergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {\n\t\t\t\tgen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`));\n\t\t\t}),\n\t\t\tmergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => {\n\t\t\t\tif (from === true) gen.assign(to, true);\n\t\t\t\telse {\n\t\t\t\t\tgen.assign(to, (0, codegen_1._)`${to} || {}`);\n\t\t\t\t\tsetEvaluated(gen, to, from);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tmergeValues: (from, to) => from === true ? true : {\n\t\t\t\t...from,\n\t\t\t\t...to\n\t\t\t},\n\t\t\tresultToName: evaluatedPropsToName\n\t\t}),\n\t\titems: makeMergeEvaluated({\n\t\t\tmergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),\n\t\t\tmergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)),\n\t\t\tmergeValues: (from, to) => from === true ? true : Math.max(from, to),\n\t\t\tresultToName: (gen, items) => gen.var(\"items\", items)\n\t\t})\n\t};\n\tfunction evaluatedPropsToName(gen, ps) {\n\t\tif (ps === true) return gen.var(\"props\", true);\n\t\tconst props = gen.var(\"props\", (0, codegen_1._)`{}`);\n\t\tif (ps !== void 0) setEvaluated(gen, props, ps);\n\t\treturn props;\n\t}\n\texports.evaluatedPropsToName = evaluatedPropsToName;\n\tfunction setEvaluated(gen, props, ps) {\n\t\tObject.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));\n\t}\n\texports.setEvaluated = setEvaluated;\n\tconst snippets = {};\n\tfunction useFunc(gen, f) {\n\t\treturn gen.scopeValue(\"func\", {\n\t\t\tref: f,\n\t\t\tcode: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code))\n\t\t});\n\t}\n\texports.useFunc = useFunc;\n\tvar Type;\n\t(function(Type) {\n\t\tType[Type[\"Num\"] = 0] = \"Num\";\n\t\tType[Type[\"Str\"] = 1] = \"Str\";\n\t})(Type || (exports.Type = Type = {}));\n\tfunction getErrorPath(dataProp, dataPropType, jsPropertySyntax) {\n\t\tif (dataProp instanceof codegen_1.Name) {\n\t\t\tconst isNumber = dataPropType === Type.Num;\n\t\t\treturn jsPropertySyntax ? isNumber ? (0, codegen_1._)`\"[\" + ${dataProp} + \"]\"` : (0, codegen_1._)`\"['\" + ${dataProp} + \"']\"` : isNumber ? (0, codegen_1._)`\"/\" + ${dataProp}` : (0, codegen_1._)`\"/\" + ${dataProp}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`;\n\t\t}\n\t\treturn jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : \"/\" + escapeJsonPointer(dataProp);\n\t}\n\texports.getErrorPath = getErrorPath;\n\tfunction checkStrictMode(it, msg, mode = it.opts.strictSchema) {\n\t\tif (!mode) return;\n\t\tmsg = `strict mode: ${msg}`;\n\t\tif (mode === true) throw new Error(msg);\n\t\tit.self.logger.warn(msg);\n\t}\n\texports.checkStrictMode = checkStrictMode;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js\nvar require_names = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst names = {\n\t\tdata: new codegen_1.Name(\"data\"),\n\t\tvalCxt: new codegen_1.Name(\"valCxt\"),\n\t\tinstancePath: new codegen_1.Name(\"instancePath\"),\n\t\tparentData: new codegen_1.Name(\"parentData\"),\n\t\tparentDataProperty: new codegen_1.Name(\"parentDataProperty\"),\n\t\trootData: new codegen_1.Name(\"rootData\"),\n\t\tdynamicAnchors: new codegen_1.Name(\"dynamicAnchors\"),\n\t\tvErrors: new codegen_1.Name(\"vErrors\"),\n\t\terrors: new codegen_1.Name(\"errors\"),\n\t\tthis: new codegen_1.Name(\"this\"),\n\t\tself: new codegen_1.Name(\"self\"),\n\t\tscope: new codegen_1.Name(\"scope\"),\n\t\tjson: new codegen_1.Name(\"json\"),\n\t\tjsonPos: new codegen_1.Name(\"jsonPos\"),\n\t\tjsonLen: new codegen_1.Name(\"jsonLen\"),\n\t\tjsonPart: new codegen_1.Name(\"jsonPart\")\n\t};\n\texports.default = names;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js\nvar require_errors = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst names_1 = require_names();\n\texports.keywordError = { message: ({ keyword }) => (0, codegen_1.str)`must pass \"${keyword}\" keyword validation` };\n\texports.keyword$DataError = { message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`\"${keyword}\" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`\"${keyword}\" keyword is invalid ($data)` };\n\tfunction reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {\n\t\tconst { it } = cxt;\n\t\tconst { gen, compositeRule, allErrors } = it;\n\t\tconst errObj = errorObjectCode(cxt, error, errorPaths);\n\t\tif (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) addError(gen, errObj);\n\t\telse returnErrors(it, (0, codegen_1._)`[${errObj}]`);\n\t}\n\texports.reportError = reportError;\n\tfunction reportExtraError(cxt, error = exports.keywordError, errorPaths) {\n\t\tconst { it } = cxt;\n\t\tconst { gen, compositeRule, allErrors } = it;\n\t\taddError(gen, errorObjectCode(cxt, error, errorPaths));\n\t\tif (!(compositeRule || allErrors)) returnErrors(it, names_1.default.vErrors);\n\t}\n\texports.reportExtraError = reportExtraError;\n\tfunction resetErrorsCount(gen, errsCount) {\n\t\tgen.assign(names_1.default.errors, errsCount);\n\t\tgen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));\n\t}\n\texports.resetErrorsCount = resetErrorsCount;\n\tfunction extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) {\n\t\t/* istanbul ignore if */\n\t\tif (errsCount === void 0) throw new Error(\"ajv implementation error\");\n\t\tconst err = gen.name(\"err\");\n\t\tgen.forRange(\"i\", errsCount, names_1.default.errors, (i) => {\n\t\t\tgen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`);\n\t\t\tgen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));\n\t\t\tgen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`);\n\t\t\tif (it.opts.verbose) {\n\t\t\t\tgen.assign((0, codegen_1._)`${err}.schema`, schemaValue);\n\t\t\t\tgen.assign((0, codegen_1._)`${err}.data`, data);\n\t\t\t}\n\t\t});\n\t}\n\texports.extendErrors = extendErrors;\n\tfunction addError(gen, errObj) {\n\t\tconst err = gen.const(\"err\", errObj);\n\t\tgen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`);\n\t\tgen.code((0, codegen_1._)`${names_1.default.errors}++`);\n\t}\n\tfunction returnErrors(it, errs) {\n\t\tconst { gen, validateName, schemaEnv } = it;\n\t\tif (schemaEnv.$async) gen.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`);\n\t\telse {\n\t\t\tgen.assign((0, codegen_1._)`${validateName}.errors`, errs);\n\t\t\tgen.return(false);\n\t\t}\n\t}\n\tconst E = {\n\t\tkeyword: new codegen_1.Name(\"keyword\"),\n\t\tschemaPath: new codegen_1.Name(\"schemaPath\"),\n\t\tparams: new codegen_1.Name(\"params\"),\n\t\tpropertyName: new codegen_1.Name(\"propertyName\"),\n\t\tmessage: new codegen_1.Name(\"message\"),\n\t\tschema: new codegen_1.Name(\"schema\"),\n\t\tparentSchema: new codegen_1.Name(\"parentSchema\")\n\t};\n\tfunction errorObjectCode(cxt, error, errorPaths) {\n\t\tconst { createErrors } = cxt.it;\n\t\tif (createErrors === false) return (0, codegen_1._)`{}`;\n\t\treturn errorObject(cxt, error, errorPaths);\n\t}\n\tfunction errorObject(cxt, error, errorPaths = {}) {\n\t\tconst { gen, it } = cxt;\n\t\tconst keyValues = [errorInstancePath(it, errorPaths), errorSchemaPath(cxt, errorPaths)];\n\t\textraErrorProps(cxt, error, keyValues);\n\t\treturn gen.object(...keyValues);\n\t}\n\tfunction errorInstancePath({ errorPath }, { instancePath }) {\n\t\tconst instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath;\n\t\treturn [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];\n\t}\n\tfunction errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {\n\t\tlet schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`;\n\t\tif (schemaPath) schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;\n\t\treturn [E.schemaPath, schPath];\n\t}\n\tfunction extraErrorProps(cxt, { params, message }, keyValues) {\n\t\tconst { keyword, data, schemaValue, it } = cxt;\n\t\tconst { opts, propertyName, topSchemaRef, schemaPath } = it;\n\t\tkeyValues.push([E.keyword, keyword], [E.params, typeof params == \"function\" ? params(cxt) : params || (0, codegen_1._)`{}`]);\n\t\tif (opts.messages) keyValues.push([E.message, typeof message == \"function\" ? message(cxt) : message]);\n\t\tif (opts.verbose) keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);\n\t\tif (propertyName) keyValues.push([E.propertyName, propertyName]);\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js\nvar require_boolSchema = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;\n\tconst errors_1 = require_errors();\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst boolError = { message: \"boolean schema is false\" };\n\tfunction topBoolOrEmptySchema(it) {\n\t\tconst { gen, schema, validateName } = it;\n\t\tif (schema === false) falseSchemaError(it, false);\n\t\telse if (typeof schema == \"object\" && schema.$async === true) gen.return(names_1.default.data);\n\t\telse {\n\t\t\tgen.assign((0, codegen_1._)`${validateName}.errors`, null);\n\t\t\tgen.return(true);\n\t\t}\n\t}\n\texports.topBoolOrEmptySchema = topBoolOrEmptySchema;\n\tfunction boolOrEmptySchema(it, valid) {\n\t\tconst { gen, schema } = it;\n\t\tif (schema === false) {\n\t\t\tgen.var(valid, false);\n\t\t\tfalseSchemaError(it);\n\t\t} else gen.var(valid, true);\n\t}\n\texports.boolOrEmptySchema = boolOrEmptySchema;\n\tfunction falseSchemaError(it, overrideAllErrors) {\n\t\tconst { gen, data } = it;\n\t\tconst cxt = {\n\t\t\tgen,\n\t\t\tkeyword: \"false schema\",\n\t\t\tdata,\n\t\t\tschema: false,\n\t\t\tschemaCode: false,\n\t\t\tschemaValue: false,\n\t\t\tparams: {},\n\t\t\tit\n\t\t};\n\t\t(0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js\nvar require_rules = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.getRules = exports.isJSONType = void 0;\n\tconst jsonTypes = new Set([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"integer\",\n\t\t\"boolean\",\n\t\t\"null\",\n\t\t\"object\",\n\t\t\"array\"\n\t]);\n\tfunction isJSONType(x) {\n\t\treturn typeof x == \"string\" && jsonTypes.has(x);\n\t}\n\texports.isJSONType = isJSONType;\n\tfunction getRules() {\n\t\tconst groups = {\n\t\t\tnumber: {\n\t\t\t\ttype: \"number\",\n\t\t\t\trules: []\n\t\t\t},\n\t\t\tstring: {\n\t\t\t\ttype: \"string\",\n\t\t\t\trules: []\n\t\t\t},\n\t\t\tarray: {\n\t\t\t\ttype: \"array\",\n\t\t\t\trules: []\n\t\t\t},\n\t\t\tobject: {\n\t\t\t\ttype: \"object\",\n\t\t\t\trules: []\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\ttypes: {\n\t\t\t\t...groups,\n\t\t\t\tinteger: true,\n\t\t\t\tboolean: true,\n\t\t\t\tnull: true\n\t\t\t},\n\t\t\trules: [\n\t\t\t\t{ rules: [] },\n\t\t\t\tgroups.number,\n\t\t\t\tgroups.string,\n\t\t\t\tgroups.array,\n\t\t\t\tgroups.object\n\t\t\t],\n\t\t\tpost: { rules: [] },\n\t\t\tall: {},\n\t\t\tkeywords: {}\n\t\t};\n\t}\n\texports.getRules = getRules;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js\nvar require_applicability = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;\n\tfunction schemaHasRulesForType({ schema, self }, type) {\n\t\tconst group = self.RULES.types[type];\n\t\treturn group && group !== true && shouldUseGroup(schema, group);\n\t}\n\texports.schemaHasRulesForType = schemaHasRulesForType;\n\tfunction shouldUseGroup(schema, group) {\n\t\treturn group.rules.some((rule) => shouldUseRule(schema, rule));\n\t}\n\texports.shouldUseGroup = shouldUseGroup;\n\tfunction shouldUseRule(schema, rule) {\n\t\tvar _a;\n\t\treturn schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0));\n\t}\n\texports.shouldUseRule = shouldUseRule;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js\nvar require_dataType = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;\n\tconst rules_1 = require_rules();\n\tconst applicability_1 = require_applicability();\n\tconst errors_1 = require_errors();\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tvar DataType;\n\t(function(DataType) {\n\t\tDataType[DataType[\"Correct\"] = 0] = \"Correct\";\n\t\tDataType[DataType[\"Wrong\"] = 1] = \"Wrong\";\n\t})(DataType || (exports.DataType = DataType = {}));\n\tfunction getSchemaTypes(schema) {\n\t\tconst types = getJSONTypes(schema.type);\n\t\tif (types.includes(\"null\")) {\n\t\t\tif (schema.nullable === false) throw new Error(\"type: null contradicts nullable: false\");\n\t\t} else {\n\t\t\tif (!types.length && schema.nullable !== void 0) throw new Error(\"\\\"nullable\\\" cannot be used without \\\"type\\\"\");\n\t\t\tif (schema.nullable === true) types.push(\"null\");\n\t\t}\n\t\treturn types;\n\t}\n\texports.getSchemaTypes = getSchemaTypes;\n\tfunction getJSONTypes(ts) {\n\t\tconst types = Array.isArray(ts) ? ts : ts ? [ts] : [];\n\t\tif (types.every(rules_1.isJSONType)) return types;\n\t\tthrow new Error(\"type must be JSONType or JSONType[]: \" + types.join(\",\"));\n\t}\n\texports.getJSONTypes = getJSONTypes;\n\tfunction coerceAndCheckDataType(it, types) {\n\t\tconst { gen, data, opts } = it;\n\t\tconst coerceTo = coerceToTypes(types, opts.coerceTypes);\n\t\tconst checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));\n\t\tif (checkTypes) {\n\t\t\tconst wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);\n\t\t\tgen.if(wrongType, () => {\n\t\t\t\tif (coerceTo.length) coerceData(it, types, coerceTo);\n\t\t\t\telse reportTypeError(it);\n\t\t\t});\n\t\t}\n\t\treturn checkTypes;\n\t}\n\texports.coerceAndCheckDataType = coerceAndCheckDataType;\n\tconst COERCIBLE = new Set([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"integer\",\n\t\t\"boolean\",\n\t\t\"null\"\n\t]);\n\tfunction coerceToTypes(types, coerceTypes) {\n\t\treturn coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === \"array\" && t === \"array\") : [];\n\t}\n\tfunction coerceData(it, types, coerceTo) {\n\t\tconst { gen, data, opts } = it;\n\t\tconst dataType = gen.let(\"dataType\", (0, codegen_1._)`typeof ${data}`);\n\t\tconst coerced = gen.let(\"coerced\", (0, codegen_1._)`undefined`);\n\t\tif (opts.coerceTypes === \"array\") gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));\n\t\tgen.if((0, codegen_1._)`${coerced} !== undefined`);\n\t\tfor (const t of coerceTo) if (COERCIBLE.has(t) || t === \"array\" && opts.coerceTypes === \"array\") coerceSpecificType(t);\n\t\tgen.else();\n\t\treportTypeError(it);\n\t\tgen.endIf();\n\t\tgen.if((0, codegen_1._)`${coerced} !== undefined`, () => {\n\t\t\tgen.assign(data, coerced);\n\t\t\tassignParentData(it, coerced);\n\t\t});\n\t\tfunction coerceSpecificType(t) {\n\t\t\tswitch (t) {\n\t\t\t\tcase \"string\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${dataType} == \"number\" || ${dataType} == \"boolean\"`).assign(coerced, (0, codegen_1._)`\"\" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`\"\"`);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"number\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${dataType} == \"boolean\" || ${data} === null\n              || (${dataType} == \"string\" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"integer\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${dataType} === \"boolean\" || ${data} === null\n              || (${dataType} === \"string\" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"boolean\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${data} === \"false\" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === \"true\" || ${data} === 1`).assign(coerced, true);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"null\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${data} === \"\" || ${data} === 0 || ${data} === false`);\n\t\t\t\t\tgen.assign(coerced, null);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"array\": gen.elseIf((0, codegen_1._)`${dataType} === \"string\" || ${dataType} === \"number\"\n              || ${dataType} === \"boolean\" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`);\n\t\t\t}\n\t\t}\n\t}\n\tfunction assignParentData({ gen, parentData, parentDataProperty }, expr) {\n\t\tgen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));\n\t}\n\tfunction checkDataType(dataType, data, strictNums, correct = DataType.Correct) {\n\t\tconst EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;\n\t\tlet cond;\n\t\tswitch (dataType) {\n\t\t\tcase \"null\": return (0, codegen_1._)`${data} ${EQ} null`;\n\t\t\tcase \"array\":\n\t\t\t\tcond = (0, codegen_1._)`Array.isArray(${data})`;\n\t\t\t\tbreak;\n\t\t\tcase \"object\":\n\t\t\t\tcond = (0, codegen_1._)`${data} && typeof ${data} == \"object\" && !Array.isArray(${data})`;\n\t\t\t\tbreak;\n\t\t\tcase \"integer\":\n\t\t\t\tcond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`);\n\t\t\t\tbreak;\n\t\t\tcase \"number\":\n\t\t\t\tcond = numCond();\n\t\t\t\tbreak;\n\t\t\tdefault: return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`;\n\t\t}\n\t\treturn correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);\n\t\tfunction numCond(_cond = codegen_1.nil) {\n\t\t\treturn (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == \"number\"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil);\n\t\t}\n\t}\n\texports.checkDataType = checkDataType;\n\tfunction checkDataTypes(dataTypes, data, strictNums, correct) {\n\t\tif (dataTypes.length === 1) return checkDataType(dataTypes[0], data, strictNums, correct);\n\t\tlet cond;\n\t\tconst types = (0, util_1.toHash)(dataTypes);\n\t\tif (types.array && types.object) {\n\t\t\tconst notObj = (0, codegen_1._)`typeof ${data} != \"object\"`;\n\t\t\tcond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`;\n\t\t\tdelete types.null;\n\t\t\tdelete types.array;\n\t\t\tdelete types.object;\n\t\t} else cond = codegen_1.nil;\n\t\tif (types.number) delete types.integer;\n\t\tfor (const t in types) cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));\n\t\treturn cond;\n\t}\n\texports.checkDataTypes = checkDataTypes;\n\tconst typeError = {\n\t\tmessage: ({ schema }) => `must be ${schema}`,\n\t\tparams: ({ schema, schemaValue }) => typeof schema == \"string\" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}`\n\t};\n\tfunction reportTypeError(it) {\n\t\tconst cxt = getTypeErrorContext(it);\n\t\t(0, errors_1.reportError)(cxt, typeError);\n\t}\n\texports.reportTypeError = reportTypeError;\n\tfunction getTypeErrorContext(it) {\n\t\tconst { gen, data, schema } = it;\n\t\tconst schemaCode = (0, util_1.schemaRefOrVal)(it, schema, \"type\");\n\t\treturn {\n\t\t\tgen,\n\t\t\tkeyword: \"type\",\n\t\t\tdata,\n\t\t\tschema: schema.type,\n\t\t\tschemaCode,\n\t\t\tschemaValue: schemaCode,\n\t\t\tparentSchema: schema,\n\t\t\tparams: {},\n\t\t\tit\n\t\t};\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js\nvar require_defaults = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.assignDefaults = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tfunction assignDefaults(it, ty) {\n\t\tconst { properties, items } = it.schema;\n\t\tif (ty === \"object\" && properties) for (const key in properties) assignDefault(it, key, properties[key].default);\n\t\telse if (ty === \"array\" && Array.isArray(items)) items.forEach((sch, i) => assignDefault(it, i, sch.default));\n\t}\n\texports.assignDefaults = assignDefaults;\n\tfunction assignDefault(it, prop, defaultValue) {\n\t\tconst { gen, compositeRule, data, opts } = it;\n\t\tif (defaultValue === void 0) return;\n\t\tconst childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`;\n\t\tif (compositeRule) {\n\t\t\t(0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);\n\t\t\treturn;\n\t\t}\n\t\tlet condition = (0, codegen_1._)`${childData} === undefined`;\n\t\tif (opts.useDefaults === \"empty\") condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === \"\"`;\n\t\tgen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js\nvar require_code = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst names_1 = require_names();\n\tconst util_2 = require_util();\n\tfunction checkReportMissingProp(cxt, prop) {\n\t\tconst { gen, data, it } = cxt;\n\t\tgen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {\n\t\t\tcxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true);\n\t\t\tcxt.error();\n\t\t});\n\t}\n\texports.checkReportMissingProp = checkReportMissingProp;\n\tfunction checkMissingProp({ gen, data, it: { opts } }, properties, missing) {\n\t\treturn (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));\n\t}\n\texports.checkMissingProp = checkMissingProp;\n\tfunction reportMissingProp(cxt, missing) {\n\t\tcxt.setParams({ missingProperty: missing }, true);\n\t\tcxt.error();\n\t}\n\texports.reportMissingProp = reportMissingProp;\n\tfunction hasPropFunc(gen) {\n\t\treturn gen.scopeValue(\"func\", {\n\t\t\tref: Object.prototype.hasOwnProperty,\n\t\t\tcode: (0, codegen_1._)`Object.prototype.hasOwnProperty`\n\t\t});\n\t}\n\texports.hasPropFunc = hasPropFunc;\n\tfunction isOwnProperty(gen, data, property) {\n\t\treturn (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`;\n\t}\n\texports.isOwnProperty = isOwnProperty;\n\tfunction propertyInData(gen, data, property, ownProperties) {\n\t\tconst cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`;\n\t\treturn ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;\n\t}\n\texports.propertyInData = propertyInData;\n\tfunction noPropertyInData(gen, data, property, ownProperties) {\n\t\tconst cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`;\n\t\treturn ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;\n\t}\n\texports.noPropertyInData = noPropertyInData;\n\tfunction allSchemaProperties(schemaMap) {\n\t\treturn schemaMap ? Object.keys(schemaMap).filter((p) => p !== \"__proto__\") : [];\n\t}\n\texports.allSchemaProperties = allSchemaProperties;\n\tfunction schemaProperties(it, schemaMap) {\n\t\treturn allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));\n\t}\n\texports.schemaProperties = schemaProperties;\n\tfunction callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {\n\t\tconst dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;\n\t\tconst valCxt = [\n\t\t\t[names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],\n\t\t\t[names_1.default.parentData, it.parentData],\n\t\t\t[names_1.default.parentDataProperty, it.parentDataProperty],\n\t\t\t[names_1.default.rootData, names_1.default.rootData]\n\t\t];\n\t\tif (it.opts.dynamicRef) valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);\n\t\tconst args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;\n\t\treturn context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;\n\t}\n\texports.callValidateCode = callValidateCode;\n\tconst newRegExp = (0, codegen_1._)`new RegExp`;\n\tfunction usePattern({ gen, it: { opts } }, pattern) {\n\t\tconst u = opts.unicodeRegExp ? \"u\" : \"\";\n\t\tconst { regExp } = opts.code;\n\t\tconst rx = regExp(pattern, u);\n\t\treturn gen.scopeValue(\"pattern\", {\n\t\t\tkey: rx.toString(),\n\t\t\tref: rx,\n\t\t\tcode: (0, codegen_1._)`${regExp.code === \"new RegExp\" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`\n\t\t});\n\t}\n\texports.usePattern = usePattern;\n\tfunction validateArray(cxt) {\n\t\tconst { gen, data, keyword, it } = cxt;\n\t\tconst valid = gen.name(\"valid\");\n\t\tif (it.allErrors) {\n\t\t\tconst validArr = gen.let(\"valid\", true);\n\t\t\tvalidateItems(() => gen.assign(validArr, false));\n\t\t\treturn validArr;\n\t\t}\n\t\tgen.var(valid, true);\n\t\tvalidateItems(() => gen.break());\n\t\treturn valid;\n\t\tfunction validateItems(notValid) {\n\t\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\t\tgen.forRange(\"i\", 0, len, (i) => {\n\t\t\t\tcxt.subschema({\n\t\t\t\t\tkeyword,\n\t\t\t\t\tdataProp: i,\n\t\t\t\t\tdataPropType: util_1.Type.Num\n\t\t\t\t}, valid);\n\t\t\t\tgen.if((0, codegen_1.not)(valid), notValid);\n\t\t\t});\n\t\t}\n\t}\n\texports.validateArray = validateArray;\n\tfunction validateUnion(cxt) {\n\t\tconst { gen, schema, keyword, it } = cxt;\n\t\t/* istanbul ignore if */\n\t\tif (!Array.isArray(schema)) throw new Error(\"ajv implementation error\");\n\t\tif (schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch)) && !it.opts.unevaluated) return;\n\t\tconst valid = gen.let(\"valid\", false);\n\t\tconst schValid = gen.name(\"_valid\");\n\t\tgen.block(() => schema.forEach((_sch, i) => {\n\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\tkeyword,\n\t\t\t\tschemaProp: i,\n\t\t\t\tcompositeRule: true\n\t\t\t}, schValid);\n\t\t\tgen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`);\n\t\t\tif (!cxt.mergeValidEvaluated(schCxt, schValid)) gen.if((0, codegen_1.not)(valid));\n\t\t}));\n\t\tcxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n\t}\n\texports.validateUnion = validateUnion;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js\nvar require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst code_1 = require_code();\n\tconst errors_1 = require_errors();\n\tfunction macroKeywordCode(cxt, def) {\n\t\tconst { gen, keyword, schema, parentSchema, it } = cxt;\n\t\tconst macroSchema = def.macro.call(it.self, schema, parentSchema, it);\n\t\tconst schemaRef = useKeyword(gen, keyword, macroSchema);\n\t\tif (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true);\n\t\tconst valid = gen.name(\"valid\");\n\t\tcxt.subschema({\n\t\t\tschema: macroSchema,\n\t\t\tschemaPath: codegen_1.nil,\n\t\t\terrSchemaPath: `${it.errSchemaPath}/${keyword}`,\n\t\t\ttopSchemaRef: schemaRef,\n\t\t\tcompositeRule: true\n\t\t}, valid);\n\t\tcxt.pass(valid, () => cxt.error(true));\n\t}\n\texports.macroKeywordCode = macroKeywordCode;\n\tfunction funcKeywordCode(cxt, def) {\n\t\tvar _a;\n\t\tconst { gen, keyword, schema, parentSchema, $data, it } = cxt;\n\t\tcheckAsyncKeyword(it, def);\n\t\tconst validateRef = useKeyword(gen, keyword, !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate);\n\t\tconst valid = gen.let(\"valid\");\n\t\tcxt.block$data(valid, validateKeyword);\n\t\tcxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);\n\t\tfunction validateKeyword() {\n\t\t\tif (def.errors === false) {\n\t\t\t\tassignValid();\n\t\t\t\tif (def.modifying) modifyData(cxt);\n\t\t\t\treportErrs(() => cxt.error());\n\t\t\t} else {\n\t\t\t\tconst ruleErrs = def.async ? validateAsync() : validateSync();\n\t\t\t\tif (def.modifying) modifyData(cxt);\n\t\t\t\treportErrs(() => addErrs(cxt, ruleErrs));\n\t\t\t}\n\t\t}\n\t\tfunction validateAsync() {\n\t\t\tconst ruleErrs = gen.let(\"ruleErrs\", null);\n\t\t\tgen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));\n\t\t\treturn ruleErrs;\n\t\t}\n\t\tfunction validateSync() {\n\t\t\tconst validateErrs = (0, codegen_1._)`${validateRef}.errors`;\n\t\t\tgen.assign(validateErrs, null);\n\t\t\tassignValid(codegen_1.nil);\n\t\t\treturn validateErrs;\n\t\t}\n\t\tfunction assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) {\n\t\t\tconst passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;\n\t\t\tconst passSchema = !(\"compile\" in def && !$data || def.schema === false);\n\t\t\tgen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);\n\t\t}\n\t\tfunction reportErrs(errors) {\n\t\t\tvar _a$1;\n\t\t\tgen.if((0, codegen_1.not)((_a$1 = def.valid) !== null && _a$1 !== void 0 ? _a$1 : valid), errors);\n\t\t}\n\t}\n\texports.funcKeywordCode = funcKeywordCode;\n\tfunction modifyData(cxt) {\n\t\tconst { gen, data, it } = cxt;\n\t\tgen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`));\n\t}\n\tfunction addErrs(cxt, errs) {\n\t\tconst { gen } = cxt;\n\t\tgen.if((0, codegen_1._)`Array.isArray(${errs})`, () => {\n\t\t\tgen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);\n\t\t\t(0, errors_1.extendErrors)(cxt);\n\t\t}, () => cxt.error());\n\t}\n\tfunction checkAsyncKeyword({ schemaEnv }, def) {\n\t\tif (def.async && !schemaEnv.$async) throw new Error(\"async keyword in sync schema\");\n\t}\n\tfunction useKeyword(gen, keyword, result) {\n\t\tif (result === void 0) throw new Error(`keyword \"${keyword}\" failed to compile`);\n\t\treturn gen.scopeValue(\"keyword\", typeof result == \"function\" ? { ref: result } : {\n\t\t\tref: result,\n\t\t\tcode: (0, codegen_1.stringify)(result)\n\t\t});\n\t}\n\tfunction validSchemaType(schema, schemaType, allowUndefined = false) {\n\t\treturn !schemaType.length || schemaType.some((st) => st === \"array\" ? Array.isArray(schema) : st === \"object\" ? schema && typeof schema == \"object\" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == \"undefined\");\n\t}\n\texports.validSchemaType = validSchemaType;\n\tfunction validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {\n\t\t/* istanbul ignore if */\n\t\tif (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) throw new Error(\"ajv implementation error\");\n\t\tconst deps = def.dependencies;\n\t\tif (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(\",\")}`);\n\t\tif (def.validateSchema) {\n\t\t\tif (!def.validateSchema(schema[keyword])) {\n\t\t\t\tconst msg = `keyword \"${keyword}\" value is invalid at path \"${errSchemaPath}\": ` + self.errorsText(def.validateSchema.errors);\n\t\t\t\tif (opts.validateSchema === \"log\") self.logger.error(msg);\n\t\t\t\telse throw new Error(msg);\n\t\t\t}\n\t\t}\n\t}\n\texports.validateKeywordUsage = validateKeywordUsage;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js\nvar require_subschema = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tfunction getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {\n\t\tif (keyword !== void 0 && schema !== void 0) throw new Error(\"both \\\"keyword\\\" and \\\"schema\\\" passed, only one allowed\");\n\t\tif (keyword !== void 0) {\n\t\t\tconst sch = it.schema[keyword];\n\t\t\treturn schemaProp === void 0 ? {\n\t\t\t\tschema: sch,\n\t\t\t\tschemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,\n\t\t\t\terrSchemaPath: `${it.errSchemaPath}/${keyword}`\n\t\t\t} : {\n\t\t\t\tschema: sch[schemaProp],\n\t\t\t\tschemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,\n\t\t\t\terrSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`\n\t\t\t};\n\t\t}\n\t\tif (schema !== void 0) {\n\t\t\tif (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) throw new Error(\"\\\"schemaPath\\\", \\\"errSchemaPath\\\" and \\\"topSchemaRef\\\" are required with \\\"schema\\\"\");\n\t\t\treturn {\n\t\t\t\tschema,\n\t\t\t\tschemaPath,\n\t\t\t\ttopSchemaRef,\n\t\t\t\terrSchemaPath\n\t\t\t};\n\t\t}\n\t\tthrow new Error(\"either \\\"keyword\\\" or \\\"schema\\\" must be passed\");\n\t}\n\texports.getSubschema = getSubschema;\n\tfunction extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {\n\t\tif (data !== void 0 && dataProp !== void 0) throw new Error(\"both \\\"data\\\" and \\\"dataProp\\\" passed, only one allowed\");\n\t\tconst { gen } = it;\n\t\tif (dataProp !== void 0) {\n\t\t\tconst { errorPath, dataPathArr, opts } = it;\n\t\t\tdataContextProps(gen.let(\"data\", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true));\n\t\t\tsubschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;\n\t\t\tsubschema.parentDataProperty = (0, codegen_1._)`${dataProp}`;\n\t\t\tsubschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];\n\t\t}\n\t\tif (data !== void 0) {\n\t\t\tdataContextProps(data instanceof codegen_1.Name ? data : gen.let(\"data\", data, true));\n\t\t\tif (propertyName !== void 0) subschema.propertyName = propertyName;\n\t\t}\n\t\tif (dataTypes) subschema.dataTypes = dataTypes;\n\t\tfunction dataContextProps(_nextData) {\n\t\t\tsubschema.data = _nextData;\n\t\t\tsubschema.dataLevel = it.dataLevel + 1;\n\t\t\tsubschema.dataTypes = [];\n\t\t\tit.definedProperties = /* @__PURE__ */ new Set();\n\t\t\tsubschema.parentData = it.data;\n\t\t\tsubschema.dataNames = [...it.dataNames, _nextData];\n\t\t}\n\t}\n\texports.extendSubschemaData = extendSubschemaData;\n\tfunction extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {\n\t\tif (compositeRule !== void 0) subschema.compositeRule = compositeRule;\n\t\tif (createErrors !== void 0) subschema.createErrors = createErrors;\n\t\tif (allErrors !== void 0) subschema.allErrors = allErrors;\n\t\tsubschema.jtdDiscriminator = jtdDiscriminator;\n\t\tsubschema.jtdMetadata = jtdMetadata;\n\t}\n\texports.extendSubschemaMode = extendSubschemaMode;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js\nvar require_fast_deep_equal = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = function equal(a, b) {\n\t\tif (a === b) return true;\n\t\tif (a && b && typeof a == \"object\" && typeof b == \"object\") {\n\t\t\tif (a.constructor !== b.constructor) return false;\n\t\t\tvar length, i, keys;\n\t\t\tif (Array.isArray(a)) {\n\t\t\t\tlength = a.length;\n\t\t\t\tif (length != b.length) return false;\n\t\t\t\tfor (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n\t\t\tif (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n\t\t\tif (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\t\t\tkeys = Object.keys(a);\n\t\t\tlength = keys.length;\n\t\t\tif (length !== Object.keys(b).length) return false;\n\t\t\tfor (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\t\t\tfor (i = length; i-- !== 0;) {\n\t\t\t\tvar key = keys[i];\n\t\t\t\tif (!equal(a[key], b[key])) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn a !== a && b !== b;\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js\nvar require_json_schema_traverse = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tvar traverse = module.exports = function(schema, opts, cb) {\n\t\tif (typeof opts == \"function\") {\n\t\t\tcb = opts;\n\t\t\topts = {};\n\t\t}\n\t\tcb = opts.cb || cb;\n\t\tvar pre = typeof cb == \"function\" ? cb : cb.pre || function() {};\n\t\tvar post = cb.post || function() {};\n\t\t_traverse(opts, pre, post, schema, \"\", schema);\n\t};\n\ttraverse.keywords = {\n\t\tadditionalItems: true,\n\t\titems: true,\n\t\tcontains: true,\n\t\tadditionalProperties: true,\n\t\tpropertyNames: true,\n\t\tnot: true,\n\t\tif: true,\n\t\tthen: true,\n\t\telse: true\n\t};\n\ttraverse.arrayKeywords = {\n\t\titems: true,\n\t\tallOf: true,\n\t\tanyOf: true,\n\t\toneOf: true\n\t};\n\ttraverse.propsKeywords = {\n\t\t$defs: true,\n\t\tdefinitions: true,\n\t\tproperties: true,\n\t\tpatternProperties: true,\n\t\tdependencies: true\n\t};\n\ttraverse.skipKeywords = {\n\t\tdefault: true,\n\t\tenum: true,\n\t\tconst: true,\n\t\trequired: true,\n\t\tmaximum: true,\n\t\tminimum: true,\n\t\texclusiveMaximum: true,\n\t\texclusiveMinimum: true,\n\t\tmultipleOf: true,\n\t\tmaxLength: true,\n\t\tminLength: true,\n\t\tpattern: true,\n\t\tformat: true,\n\t\tmaxItems: true,\n\t\tminItems: true,\n\t\tuniqueItems: true,\n\t\tmaxProperties: true,\n\t\tminProperties: true\n\t};\n\tfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n\t\tif (schema && typeof schema == \"object\" && !Array.isArray(schema)) {\n\t\t\tpre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n\t\t\tfor (var key in schema) {\n\t\t\t\tvar sch = schema[key];\n\t\t\t\tif (Array.isArray(sch)) {\n\t\t\t\t\tif (key in traverse.arrayKeywords) for (var i = 0; i < sch.length; i++) _traverse(opts, pre, post, sch[i], jsonPtr + \"/\" + key + \"/\" + i, rootSchema, jsonPtr, key, schema, i);\n\t\t\t\t} else if (key in traverse.propsKeywords) {\n\t\t\t\t\tif (sch && typeof sch == \"object\") for (var prop in sch) _traverse(opts, pre, post, sch[prop], jsonPtr + \"/\" + key + \"/\" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n\t\t\t\t} else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) _traverse(opts, pre, post, sch, jsonPtr + \"/\" + key, rootSchema, jsonPtr, key, schema);\n\t\t\t}\n\t\t\tpost(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n\t\t}\n\t}\n\tfunction escapeJsonPtr(str) {\n\t\treturn str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js\nvar require_resolve = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;\n\tconst util_1 = require_util();\n\tconst equal = require_fast_deep_equal();\n\tconst traverse = require_json_schema_traverse();\n\tconst SIMPLE_INLINED = new Set([\n\t\t\"type\",\n\t\t\"format\",\n\t\t\"pattern\",\n\t\t\"maxLength\",\n\t\t\"minLength\",\n\t\t\"maxProperties\",\n\t\t\"minProperties\",\n\t\t\"maxItems\",\n\t\t\"minItems\",\n\t\t\"maximum\",\n\t\t\"minimum\",\n\t\t\"uniqueItems\",\n\t\t\"multipleOf\",\n\t\t\"required\",\n\t\t\"enum\",\n\t\t\"const\"\n\t]);\n\tfunction inlineRef(schema, limit = true) {\n\t\tif (typeof schema == \"boolean\") return true;\n\t\tif (limit === true) return !hasRef(schema);\n\t\tif (!limit) return false;\n\t\treturn countKeys(schema) <= limit;\n\t}\n\texports.inlineRef = inlineRef;\n\tconst REF_KEYWORDS = new Set([\n\t\t\"$ref\",\n\t\t\"$recursiveRef\",\n\t\t\"$recursiveAnchor\",\n\t\t\"$dynamicRef\",\n\t\t\"$dynamicAnchor\"\n\t]);\n\tfunction hasRef(schema) {\n\t\tfor (const key in schema) {\n\t\t\tif (REF_KEYWORDS.has(key)) return true;\n\t\t\tconst sch = schema[key];\n\t\t\tif (Array.isArray(sch) && sch.some(hasRef)) return true;\n\t\t\tif (typeof sch == \"object\" && hasRef(sch)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tfunction countKeys(schema) {\n\t\tlet count = 0;\n\t\tfor (const key in schema) {\n\t\t\tif (key === \"$ref\") return Infinity;\n\t\t\tcount++;\n\t\t\tif (SIMPLE_INLINED.has(key)) continue;\n\t\t\tif (typeof schema[key] == \"object\") (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch));\n\t\t\tif (count === Infinity) return Infinity;\n\t\t}\n\t\treturn count;\n\t}\n\tfunction getFullPath(resolver, id = \"\", normalize) {\n\t\tif (normalize !== false) id = normalizeId(id);\n\t\treturn _getFullPath(resolver, resolver.parse(id));\n\t}\n\texports.getFullPath = getFullPath;\n\tfunction _getFullPath(resolver, p) {\n\t\treturn resolver.serialize(p).split(\"#\")[0] + \"#\";\n\t}\n\texports._getFullPath = _getFullPath;\n\tconst TRAILING_SLASH_HASH = /#\\/?$/;\n\tfunction normalizeId(id) {\n\t\treturn id ? id.replace(TRAILING_SLASH_HASH, \"\") : \"\";\n\t}\n\texports.normalizeId = normalizeId;\n\tfunction resolveUrl(resolver, baseId, id) {\n\t\tid = normalizeId(id);\n\t\treturn resolver.resolve(baseId, id);\n\t}\n\texports.resolveUrl = resolveUrl;\n\tconst ANCHOR = /^[a-z_][-a-z0-9._]*$/i;\n\tfunction getSchemaRefs(schema, baseId) {\n\t\tif (typeof schema == \"boolean\") return {};\n\t\tconst { schemaId, uriResolver } = this.opts;\n\t\tconst schId = normalizeId(schema[schemaId] || baseId);\n\t\tconst baseIds = { \"\": schId };\n\t\tconst pathPrefix = getFullPath(uriResolver, schId, false);\n\t\tconst localRefs = {};\n\t\tconst schemaRefs = /* @__PURE__ */ new Set();\n\t\ttraverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {\n\t\t\tif (parentJsonPtr === void 0) return;\n\t\t\tconst fullPath = pathPrefix + jsonPtr;\n\t\t\tlet innerBaseId = baseIds[parentJsonPtr];\n\t\t\tif (typeof sch[schemaId] == \"string\") innerBaseId = addRef.call(this, sch[schemaId]);\n\t\t\taddAnchor.call(this, sch.$anchor);\n\t\t\taddAnchor.call(this, sch.$dynamicAnchor);\n\t\t\tbaseIds[jsonPtr] = innerBaseId;\n\t\t\tfunction addRef(ref) {\n\t\t\t\tconst _resolve = this.opts.uriResolver.resolve;\n\t\t\t\tref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);\n\t\t\t\tif (schemaRefs.has(ref)) throw ambiguos(ref);\n\t\t\t\tschemaRefs.add(ref);\n\t\t\t\tlet schOrRef = this.refs[ref];\n\t\t\t\tif (typeof schOrRef == \"string\") schOrRef = this.refs[schOrRef];\n\t\t\t\tif (typeof schOrRef == \"object\") checkAmbiguosRef(sch, schOrRef.schema, ref);\n\t\t\t\telse if (ref !== normalizeId(fullPath)) if (ref[0] === \"#\") {\n\t\t\t\t\tcheckAmbiguosRef(sch, localRefs[ref], ref);\n\t\t\t\t\tlocalRefs[ref] = sch;\n\t\t\t\t} else this.refs[ref] = fullPath;\n\t\t\t\treturn ref;\n\t\t\t}\n\t\t\tfunction addAnchor(anchor) {\n\t\t\t\tif (typeof anchor == \"string\") {\n\t\t\t\t\tif (!ANCHOR.test(anchor)) throw new Error(`invalid anchor \"${anchor}\"`);\n\t\t\t\t\taddRef.call(this, `#${anchor}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn localRefs;\n\t\tfunction checkAmbiguosRef(sch1, sch2, ref) {\n\t\t\tif (sch2 !== void 0 && !equal(sch1, sch2)) throw ambiguos(ref);\n\t\t}\n\t\tfunction ambiguos(ref) {\n\t\t\treturn /* @__PURE__ */ new Error(`reference \"${ref}\" resolves to more than one schema`);\n\t\t}\n\t}\n\texports.getSchemaRefs = getSchemaRefs;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js\nvar require_validate = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;\n\tconst boolSchema_1 = require_boolSchema();\n\tconst dataType_1 = require_dataType();\n\tconst applicability_1 = require_applicability();\n\tconst dataType_2 = require_dataType();\n\tconst defaults_1 = require_defaults();\n\tconst keyword_1 = require_keyword();\n\tconst subschema_1 = require_subschema();\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst resolve_1 = require_resolve();\n\tconst util_1 = require_util();\n\tconst errors_1 = require_errors();\n\tfunction validateFunctionCode(it) {\n\t\tif (isSchemaObj(it)) {\n\t\t\tcheckKeywords(it);\n\t\t\tif (schemaCxtHasRules(it)) {\n\t\t\t\ttopSchemaObjCode(it);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tvalidateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));\n\t}\n\texports.validateFunctionCode = validateFunctionCode;\n\tfunction validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {\n\t\tif (opts.code.es5) gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {\n\t\t\tgen.code((0, codegen_1._)`\"use strict\"; ${funcSourceUrl(schema, opts)}`);\n\t\t\tdestructureValCxtES5(gen, opts);\n\t\t\tgen.code(body);\n\t\t});\n\t\telse gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));\n\t}\n\tfunction destructureValCxt(opts) {\n\t\treturn (0, codegen_1._)`{${names_1.default.instancePath}=\"\", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;\n\t}\n\tfunction destructureValCxtES5(gen, opts) {\n\t\tgen.if(names_1.default.valCxt, () => {\n\t\t\tgen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);\n\t\t\tgen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`);\n\t\t\tgen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);\n\t\t\tgen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`);\n\t\t\tif (opts.dynamicRef) gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);\n\t\t}, () => {\n\t\t\tgen.var(names_1.default.instancePath, (0, codegen_1._)`\"\"`);\n\t\t\tgen.var(names_1.default.parentData, (0, codegen_1._)`undefined`);\n\t\t\tgen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`);\n\t\t\tgen.var(names_1.default.rootData, names_1.default.data);\n\t\t\tif (opts.dynamicRef) gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);\n\t\t});\n\t}\n\tfunction topSchemaObjCode(it) {\n\t\tconst { schema, opts, gen } = it;\n\t\tvalidateFunction(it, () => {\n\t\t\tif (opts.$comment && schema.$comment) commentKeyword(it);\n\t\t\tcheckNoDefault(it);\n\t\t\tgen.let(names_1.default.vErrors, null);\n\t\t\tgen.let(names_1.default.errors, 0);\n\t\t\tif (opts.unevaluated) resetEvaluated(it);\n\t\t\ttypeAndKeywords(it);\n\t\t\treturnResults(it);\n\t\t});\n\t}\n\tfunction resetEvaluated(it) {\n\t\tconst { gen, validateName } = it;\n\t\tit.evaluated = gen.const(\"evaluated\", (0, codegen_1._)`${validateName}.evaluated`);\n\t\tgen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));\n\t\tgen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));\n\t}\n\tfunction funcSourceUrl(schema, opts) {\n\t\tconst schId = typeof schema == \"object\" && schema[opts.schemaId];\n\t\treturn schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;\n\t}\n\tfunction subschemaCode(it, valid) {\n\t\tif (isSchemaObj(it)) {\n\t\t\tcheckKeywords(it);\n\t\t\tif (schemaCxtHasRules(it)) {\n\t\t\t\tsubSchemaObjCode(it, valid);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t(0, boolSchema_1.boolOrEmptySchema)(it, valid);\n\t}\n\tfunction schemaCxtHasRules({ schema, self }) {\n\t\tif (typeof schema == \"boolean\") return !schema;\n\t\tfor (const key in schema) if (self.RULES.all[key]) return true;\n\t\treturn false;\n\t}\n\tfunction isSchemaObj(it) {\n\t\treturn typeof it.schema != \"boolean\";\n\t}\n\tfunction subSchemaObjCode(it, valid) {\n\t\tconst { schema, gen, opts } = it;\n\t\tif (opts.$comment && schema.$comment) commentKeyword(it);\n\t\tupdateContext(it);\n\t\tcheckAsyncSchema(it);\n\t\tconst errsCount = gen.const(\"_errs\", names_1.default.errors);\n\t\ttypeAndKeywords(it, errsCount);\n\t\tgen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);\n\t}\n\tfunction checkKeywords(it) {\n\t\t(0, util_1.checkUnknownRules)(it);\n\t\tcheckRefsAndKeywords(it);\n\t}\n\tfunction typeAndKeywords(it, errsCount) {\n\t\tif (it.opts.jtd) return schemaKeywords(it, [], false, errsCount);\n\t\tconst types = (0, dataType_1.getSchemaTypes)(it.schema);\n\t\tschemaKeywords(it, types, !(0, dataType_1.coerceAndCheckDataType)(it, types), errsCount);\n\t}\n\tfunction checkRefsAndKeywords(it) {\n\t\tconst { schema, errSchemaPath, opts, self } = it;\n\t\tif (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) self.logger.warn(`$ref: keywords ignored in schema at path \"${errSchemaPath}\"`);\n\t}\n\tfunction checkNoDefault(it) {\n\t\tconst { schema, opts } = it;\n\t\tif (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) (0, util_1.checkStrictMode)(it, \"default is ignored in the schema root\");\n\t}\n\tfunction updateContext(it) {\n\t\tconst schId = it.schema[it.opts.schemaId];\n\t\tif (schId) it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);\n\t}\n\tfunction checkAsyncSchema(it) {\n\t\tif (it.schema.$async && !it.schemaEnv.$async) throw new Error(\"async schema in sync schema\");\n\t}\n\tfunction commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {\n\t\tconst msg = schema.$comment;\n\t\tif (opts.$comment === true) gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);\n\t\telse if (typeof opts.$comment == \"function\") {\n\t\t\tconst schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`;\n\t\t\tconst rootName = gen.scopeValue(\"root\", { ref: schemaEnv.root });\n\t\t\tgen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);\n\t\t}\n\t}\n\tfunction returnResults(it) {\n\t\tconst { gen, schemaEnv, validateName, ValidationError, opts } = it;\n\t\tif (schemaEnv.$async) gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`));\n\t\telse {\n\t\t\tgen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors);\n\t\t\tif (opts.unevaluated) assignEvaluated(it);\n\t\t\tgen.return((0, codegen_1._)`${names_1.default.errors} === 0`);\n\t\t}\n\t}\n\tfunction assignEvaluated({ gen, evaluated, props, items }) {\n\t\tif (props instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.props`, props);\n\t\tif (items instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.items`, items);\n\t}\n\tfunction schemaKeywords(it, types, typeErrors, errsCount) {\n\t\tconst { gen, schema, data, allErrors, opts, self } = it;\n\t\tconst { RULES } = self;\n\t\tif (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {\n\t\t\tgen.block(() => keywordCode(it, \"$ref\", RULES.all.$ref.definition));\n\t\t\treturn;\n\t\t}\n\t\tif (!opts.jtd) checkStrictTypes(it, types);\n\t\tgen.block(() => {\n\t\t\tfor (const group of RULES.rules) groupKeywords(group);\n\t\t\tgroupKeywords(RULES.post);\n\t\t});\n\t\tfunction groupKeywords(group) {\n\t\t\tif (!(0, applicability_1.shouldUseGroup)(schema, group)) return;\n\t\t\tif (group.type) {\n\t\t\t\tgen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));\n\t\t\t\titerateKeywords(it, group);\n\t\t\t\tif (types.length === 1 && types[0] === group.type && typeErrors) {\n\t\t\t\t\tgen.else();\n\t\t\t\t\t(0, dataType_2.reportTypeError)(it);\n\t\t\t\t}\n\t\t\t\tgen.endIf();\n\t\t\t} else iterateKeywords(it, group);\n\t\t\tif (!allErrors) gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);\n\t\t}\n\t}\n\tfunction iterateKeywords(it, group) {\n\t\tconst { gen, schema, opts: { useDefaults } } = it;\n\t\tif (useDefaults) (0, defaults_1.assignDefaults)(it, group.type);\n\t\tgen.block(() => {\n\t\t\tfor (const rule of group.rules) if ((0, applicability_1.shouldUseRule)(schema, rule)) keywordCode(it, rule.keyword, rule.definition, group.type);\n\t\t});\n\t}\n\tfunction checkStrictTypes(it, types) {\n\t\tif (it.schemaEnv.meta || !it.opts.strictTypes) return;\n\t\tcheckContextTypes(it, types);\n\t\tif (!it.opts.allowUnionTypes) checkMultipleTypes(it, types);\n\t\tcheckKeywordTypes(it, it.dataTypes);\n\t}\n\tfunction checkContextTypes(it, types) {\n\t\tif (!types.length) return;\n\t\tif (!it.dataTypes.length) {\n\t\t\tit.dataTypes = types;\n\t\t\treturn;\n\t\t}\n\t\ttypes.forEach((t) => {\n\t\t\tif (!includesType(it.dataTypes, t)) strictTypesError(it, `type \"${t}\" not allowed by context \"${it.dataTypes.join(\",\")}\"`);\n\t\t});\n\t\tnarrowSchemaTypes(it, types);\n\t}\n\tfunction checkMultipleTypes(it, ts) {\n\t\tif (ts.length > 1 && !(ts.length === 2 && ts.includes(\"null\"))) strictTypesError(it, \"use allowUnionTypes to allow union type keyword\");\n\t}\n\tfunction checkKeywordTypes(it, ts) {\n\t\tconst rules = it.self.RULES.all;\n\t\tfor (const keyword in rules) {\n\t\t\tconst rule = rules[keyword];\n\t\t\tif (typeof rule == \"object\" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {\n\t\t\t\tconst { type } = rule.definition;\n\t\t\t\tif (type.length && !type.some((t) => hasApplicableType(ts, t))) strictTypesError(it, `missing type \"${type.join(\",\")}\" for keyword \"${keyword}\"`);\n\t\t\t}\n\t\t}\n\t}\n\tfunction hasApplicableType(schTs, kwdT) {\n\t\treturn schTs.includes(kwdT) || kwdT === \"number\" && schTs.includes(\"integer\");\n\t}\n\tfunction includesType(ts, t) {\n\t\treturn ts.includes(t) || t === \"integer\" && ts.includes(\"number\");\n\t}\n\tfunction narrowSchemaTypes(it, withTypes) {\n\t\tconst ts = [];\n\t\tfor (const t of it.dataTypes) if (includesType(withTypes, t)) ts.push(t);\n\t\telse if (withTypes.includes(\"integer\") && t === \"number\") ts.push(\"integer\");\n\t\tit.dataTypes = ts;\n\t}\n\tfunction strictTypesError(it, msg) {\n\t\tconst schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n\t\tmsg += ` at \"${schemaPath}\" (strictTypes)`;\n\t\t(0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);\n\t}\n\tvar KeywordCxt = class {\n\t\tconstructor(it, def, keyword) {\n\t\t\t(0, keyword_1.validateKeywordUsage)(it, def, keyword);\n\t\t\tthis.gen = it.gen;\n\t\t\tthis.allErrors = it.allErrors;\n\t\t\tthis.keyword = keyword;\n\t\t\tthis.data = it.data;\n\t\t\tthis.schema = it.schema[keyword];\n\t\t\tthis.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;\n\t\t\tthis.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);\n\t\t\tthis.schemaType = def.schemaType;\n\t\t\tthis.parentSchema = it.schema;\n\t\t\tthis.params = {};\n\t\t\tthis.it = it;\n\t\t\tthis.def = def;\n\t\t\tif (this.$data) this.schemaCode = it.gen.const(\"vSchema\", getData(this.$data, it));\n\t\t\telse {\n\t\t\t\tthis.schemaCode = this.schemaValue;\n\t\t\t\tif (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);\n\t\t\t}\n\t\t\tif (\"code\" in def ? def.trackErrors : def.errors !== false) this.errsCount = it.gen.const(\"_errs\", names_1.default.errors);\n\t\t}\n\t\tresult(condition, successAction, failAction) {\n\t\t\tthis.failResult((0, codegen_1.not)(condition), successAction, failAction);\n\t\t}\n\t\tfailResult(condition, successAction, failAction) {\n\t\t\tthis.gen.if(condition);\n\t\t\tif (failAction) failAction();\n\t\t\telse this.error();\n\t\t\tif (successAction) {\n\t\t\t\tthis.gen.else();\n\t\t\t\tsuccessAction();\n\t\t\t\tif (this.allErrors) this.gen.endIf();\n\t\t\t} else if (this.allErrors) this.gen.endIf();\n\t\t\telse this.gen.else();\n\t\t}\n\t\tpass(condition, failAction) {\n\t\t\tthis.failResult((0, codegen_1.not)(condition), void 0, failAction);\n\t\t}\n\t\tfail(condition) {\n\t\t\tif (condition === void 0) {\n\t\t\t\tthis.error();\n\t\t\t\tif (!this.allErrors) this.gen.if(false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.gen.if(condition);\n\t\t\tthis.error();\n\t\t\tif (this.allErrors) this.gen.endIf();\n\t\t\telse this.gen.else();\n\t\t}\n\t\tfail$data(condition) {\n\t\t\tif (!this.$data) return this.fail(condition);\n\t\t\tconst { schemaCode } = this;\n\t\t\tthis.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);\n\t\t}\n\t\terror(append, errorParams, errorPaths) {\n\t\t\tif (errorParams) {\n\t\t\t\tthis.setParams(errorParams);\n\t\t\t\tthis._error(append, errorPaths);\n\t\t\t\tthis.setParams({});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(append, errorPaths);\n\t\t}\n\t\t_error(append, errorPaths) {\n\t\t\t(append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);\n\t\t}\n\t\t$dataError() {\n\t\t\t(0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);\n\t\t}\n\t\treset() {\n\t\t\tif (this.errsCount === void 0) throw new Error(\"add \\\"trackErrors\\\" to keyword definition\");\n\t\t\t(0, errors_1.resetErrorsCount)(this.gen, this.errsCount);\n\t\t}\n\t\tok(cond) {\n\t\t\tif (!this.allErrors) this.gen.if(cond);\n\t\t}\n\t\tsetParams(obj, assign) {\n\t\t\tif (assign) Object.assign(this.params, obj);\n\t\t\telse this.params = obj;\n\t\t}\n\t\tblock$data(valid, codeBlock, $dataValid = codegen_1.nil) {\n\t\t\tthis.gen.block(() => {\n\t\t\t\tthis.check$data(valid, $dataValid);\n\t\t\t\tcodeBlock();\n\t\t\t});\n\t\t}\n\t\tcheck$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {\n\t\t\tif (!this.$data) return;\n\t\t\tconst { gen, schemaCode, schemaType, def } = this;\n\t\t\tgen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid));\n\t\t\tif (valid !== codegen_1.nil) gen.assign(valid, true);\n\t\t\tif (schemaType.length || def.validateSchema) {\n\t\t\t\tgen.elseIf(this.invalid$data());\n\t\t\t\tthis.$dataError();\n\t\t\t\tif (valid !== codegen_1.nil) gen.assign(valid, false);\n\t\t\t}\n\t\t\tgen.else();\n\t\t}\n\t\tinvalid$data() {\n\t\t\tconst { gen, schemaCode, schemaType, def, it } = this;\n\t\t\treturn (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());\n\t\t\tfunction wrong$DataType() {\n\t\t\t\tif (schemaType.length) {\n\t\t\t\t\t/* istanbul ignore if */\n\t\t\t\t\tif (!(schemaCode instanceof codegen_1.Name)) throw new Error(\"ajv implementation error\");\n\t\t\t\t\tconst st = Array.isArray(schemaType) ? schemaType : [schemaType];\n\t\t\t\t\treturn (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;\n\t\t\t\t}\n\t\t\t\treturn codegen_1.nil;\n\t\t\t}\n\t\t\tfunction invalid$DataSchema() {\n\t\t\t\tif (def.validateSchema) {\n\t\t\t\t\tconst validateSchemaRef = gen.scopeValue(\"validate$data\", { ref: def.validateSchema });\n\t\t\t\t\treturn (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`;\n\t\t\t\t}\n\t\t\t\treturn codegen_1.nil;\n\t\t\t}\n\t\t}\n\t\tsubschema(appl, valid) {\n\t\t\tconst subschema = (0, subschema_1.getSubschema)(this.it, appl);\n\t\t\t(0, subschema_1.extendSubschemaData)(subschema, this.it, appl);\n\t\t\t(0, subschema_1.extendSubschemaMode)(subschema, appl);\n\t\t\tconst nextContext = {\n\t\t\t\t...this.it,\n\t\t\t\t...subschema,\n\t\t\t\titems: void 0,\n\t\t\t\tprops: void 0\n\t\t\t};\n\t\t\tsubschemaCode(nextContext, valid);\n\t\t\treturn nextContext;\n\t\t}\n\t\tmergeEvaluated(schemaCxt, toName) {\n\t\t\tconst { it, gen } = this;\n\t\t\tif (!it.opts.unevaluated) return;\n\t\t\tif (it.props !== true && schemaCxt.props !== void 0) it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);\n\t\t\tif (it.items !== true && schemaCxt.items !== void 0) it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);\n\t\t}\n\t\tmergeValidEvaluated(schemaCxt, valid) {\n\t\t\tconst { it, gen } = this;\n\t\t\tif (it.opts.unevaluated && (it.props !== true || it.items !== true)) {\n\t\t\t\tgen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t};\n\texports.KeywordCxt = KeywordCxt;\n\tfunction keywordCode(it, keyword, def, ruleType) {\n\t\tconst cxt = new KeywordCxt(it, def, keyword);\n\t\tif (\"code\" in def) def.code(cxt, ruleType);\n\t\telse if (cxt.$data && def.validate) (0, keyword_1.funcKeywordCode)(cxt, def);\n\t\telse if (\"macro\" in def) (0, keyword_1.macroKeywordCode)(cxt, def);\n\t\telse if (def.compile || def.validate) (0, keyword_1.funcKeywordCode)(cxt, def);\n\t}\n\tconst JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/;\n\tconst RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;\n\tfunction getData($data, { dataLevel, dataNames, dataPathArr }) {\n\t\tlet jsonPointer;\n\t\tlet data;\n\t\tif ($data === \"\") return names_1.default.rootData;\n\t\tif ($data[0] === \"/\") {\n\t\t\tif (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`);\n\t\t\tjsonPointer = $data;\n\t\t\tdata = names_1.default.rootData;\n\t\t} else {\n\t\t\tconst matches = RELATIVE_JSON_POINTER.exec($data);\n\t\t\tif (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`);\n\t\t\tconst up = +matches[1];\n\t\t\tjsonPointer = matches[2];\n\t\t\tif (jsonPointer === \"#\") {\n\t\t\t\tif (up >= dataLevel) throw new Error(errorMsg(\"property/index\", up));\n\t\t\t\treturn dataPathArr[dataLevel - up];\n\t\t\t}\n\t\t\tif (up > dataLevel) throw new Error(errorMsg(\"data\", up));\n\t\t\tdata = dataNames[dataLevel - up];\n\t\t\tif (!jsonPointer) return data;\n\t\t}\n\t\tlet expr = data;\n\t\tconst segments = jsonPointer.split(\"/\");\n\t\tfor (const segment of segments) if (segment) {\n\t\t\tdata = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;\n\t\t\texpr = (0, codegen_1._)`${expr} && ${data}`;\n\t\t}\n\t\treturn expr;\n\t\tfunction errorMsg(pointerType, up) {\n\t\t\treturn `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;\n\t\t}\n\t}\n\texports.getData = getData;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js\nvar require_validation_error = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tvar ValidationError = class extends Error {\n\t\tconstructor(errors) {\n\t\t\tsuper(\"validation failed\");\n\t\t\tthis.errors = errors;\n\t\t\tthis.ajv = this.validation = true;\n\t\t}\n\t};\n\texports.default = ValidationError;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js\nvar require_ref_error = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst resolve_1 = require_resolve();\n\tvar MissingRefError = class extends Error {\n\t\tconstructor(resolver, baseId, ref, msg) {\n\t\t\tsuper(msg || `can't resolve reference ${ref} from id ${baseId}`);\n\t\t\tthis.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);\n\t\t\tthis.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));\n\t\t}\n\t};\n\texports.default = MissingRefError;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js\nvar require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst validation_error_1 = require_validation_error();\n\tconst names_1 = require_names();\n\tconst resolve_1 = require_resolve();\n\tconst util_1 = require_util();\n\tconst validate_1 = require_validate();\n\tvar SchemaEnv = class {\n\t\tconstructor(env) {\n\t\t\tvar _a;\n\t\t\tthis.refs = {};\n\t\t\tthis.dynamicAnchors = {};\n\t\t\tlet schema;\n\t\t\tif (typeof env.schema == \"object\") schema = env.schema;\n\t\t\tthis.schema = env.schema;\n\t\t\tthis.schemaId = env.schemaId;\n\t\t\tthis.root = env.root || this;\n\t\t\tthis.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || \"$id\"]);\n\t\t\tthis.schemaPath = env.schemaPath;\n\t\t\tthis.localRefs = env.localRefs;\n\t\t\tthis.meta = env.meta;\n\t\t\tthis.$async = schema === null || schema === void 0 ? void 0 : schema.$async;\n\t\t\tthis.refs = {};\n\t\t}\n\t};\n\texports.SchemaEnv = SchemaEnv;\n\tfunction compileSchema(sch) {\n\t\tconst _sch = getCompilingSchema.call(this, sch);\n\t\tif (_sch) return _sch;\n\t\tconst rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId);\n\t\tconst { es5, lines } = this.opts.code;\n\t\tconst { ownProperties } = this.opts;\n\t\tconst gen = new codegen_1.CodeGen(this.scope, {\n\t\t\tes5,\n\t\t\tlines,\n\t\t\townProperties\n\t\t});\n\t\tlet _ValidationError;\n\t\tif (sch.$async) _ValidationError = gen.scopeValue(\"Error\", {\n\t\t\tref: validation_error_1.default,\n\t\t\tcode: (0, codegen_1._)`require(\"ajv/dist/runtime/validation_error\").default`\n\t\t});\n\t\tconst validateName = gen.scopeName(\"validate\");\n\t\tsch.validateName = validateName;\n\t\tconst schemaCxt = {\n\t\t\tgen,\n\t\t\tallErrors: this.opts.allErrors,\n\t\t\tdata: names_1.default.data,\n\t\t\tparentData: names_1.default.parentData,\n\t\t\tparentDataProperty: names_1.default.parentDataProperty,\n\t\t\tdataNames: [names_1.default.data],\n\t\t\tdataPathArr: [codegen_1.nil],\n\t\t\tdataLevel: 0,\n\t\t\tdataTypes: [],\n\t\t\tdefinedProperties: /* @__PURE__ */ new Set(),\n\t\t\ttopSchemaRef: gen.scopeValue(\"schema\", this.opts.code.source === true ? {\n\t\t\t\tref: sch.schema,\n\t\t\t\tcode: (0, codegen_1.stringify)(sch.schema)\n\t\t\t} : { ref: sch.schema }),\n\t\t\tvalidateName,\n\t\t\tValidationError: _ValidationError,\n\t\t\tschema: sch.schema,\n\t\t\tschemaEnv: sch,\n\t\t\trootId,\n\t\t\tbaseId: sch.baseId || rootId,\n\t\t\tschemaPath: codegen_1.nil,\n\t\t\terrSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n\t\t\terrorPath: (0, codegen_1._)`\"\"`,\n\t\t\topts: this.opts,\n\t\t\tself: this\n\t\t};\n\t\tlet sourceCode;\n\t\ttry {\n\t\t\tthis._compilations.add(sch);\n\t\t\t(0, validate_1.validateFunctionCode)(schemaCxt);\n\t\t\tgen.optimize(this.opts.code.optimize);\n\t\t\tconst validateCode = gen.toString();\n\t\t\tsourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;\n\t\t\tif (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch);\n\t\t\tconst validate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode)(this, this.scope.get());\n\t\t\tthis.scope.value(validateName, { ref: validate });\n\t\t\tvalidate.errors = null;\n\t\t\tvalidate.schema = sch.schema;\n\t\t\tvalidate.schemaEnv = sch;\n\t\t\tif (sch.$async) validate.$async = true;\n\t\t\tif (this.opts.code.source === true) validate.source = {\n\t\t\t\tvalidateName,\n\t\t\t\tvalidateCode,\n\t\t\t\tscopeValues: gen._values\n\t\t\t};\n\t\t\tif (this.opts.unevaluated) {\n\t\t\t\tconst { props, items } = schemaCxt;\n\t\t\t\tvalidate.evaluated = {\n\t\t\t\t\tprops: props instanceof codegen_1.Name ? void 0 : props,\n\t\t\t\t\titems: items instanceof codegen_1.Name ? void 0 : items,\n\t\t\t\t\tdynamicProps: props instanceof codegen_1.Name,\n\t\t\t\t\tdynamicItems: items instanceof codegen_1.Name\n\t\t\t\t};\n\t\t\t\tif (validate.source) validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);\n\t\t\t}\n\t\t\tsch.validate = validate;\n\t\t\treturn sch;\n\t\t} catch (e) {\n\t\t\tdelete sch.validate;\n\t\t\tdelete sch.validateName;\n\t\t\tif (sourceCode) this.logger.error(\"Error compiling schema, function code:\", sourceCode);\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tthis._compilations.delete(sch);\n\t\t}\n\t}\n\texports.compileSchema = compileSchema;\n\tfunction resolveRef(root, baseId, ref) {\n\t\tvar _a;\n\t\tref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);\n\t\tconst schOrFunc = root.refs[ref];\n\t\tif (schOrFunc) return schOrFunc;\n\t\tlet _sch = resolve.call(this, root, ref);\n\t\tif (_sch === void 0) {\n\t\t\tconst schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];\n\t\t\tconst { schemaId } = this.opts;\n\t\t\tif (schema) _sch = new SchemaEnv({\n\t\t\t\tschema,\n\t\t\t\tschemaId,\n\t\t\t\troot,\n\t\t\t\tbaseId\n\t\t\t});\n\t\t}\n\t\tif (_sch === void 0) return;\n\t\treturn root.refs[ref] = inlineOrCompile.call(this, _sch);\n\t}\n\texports.resolveRef = resolveRef;\n\tfunction inlineOrCompile(sch) {\n\t\tif ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) return sch.schema;\n\t\treturn sch.validate ? sch : compileSchema.call(this, sch);\n\t}\n\tfunction getCompilingSchema(schEnv) {\n\t\tfor (const sch of this._compilations) if (sameSchemaEnv(sch, schEnv)) return sch;\n\t}\n\texports.getCompilingSchema = getCompilingSchema;\n\tfunction sameSchemaEnv(s1, s2) {\n\t\treturn s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;\n\t}\n\tfunction resolve(root, ref) {\n\t\tlet sch;\n\t\twhile (typeof (sch = this.refs[ref]) == \"string\") ref = sch;\n\t\treturn sch || this.schemas[ref] || resolveSchema.call(this, root, ref);\n\t}\n\tfunction resolveSchema(root, ref) {\n\t\tconst p = this.opts.uriResolver.parse(ref);\n\t\tconst refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);\n\t\tlet baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);\n\t\tif (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p, root);\n\t\tconst id = (0, resolve_1.normalizeId)(refPath);\n\t\tconst schOrRef = this.refs[id] || this.schemas[id];\n\t\tif (typeof schOrRef == \"string\") {\n\t\t\tconst sch = resolveSchema.call(this, root, schOrRef);\n\t\t\tif (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\") return;\n\t\t\treturn getJsonPointer.call(this, p, sch);\n\t\t}\n\t\tif (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\") return;\n\t\tif (!schOrRef.validate) compileSchema.call(this, schOrRef);\n\t\tif (id === (0, resolve_1.normalizeId)(ref)) {\n\t\t\tconst { schema } = schOrRef;\n\t\t\tconst { schemaId } = this.opts;\n\t\t\tconst schId = schema[schemaId];\n\t\t\tif (schId) baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n\t\t\treturn new SchemaEnv({\n\t\t\t\tschema,\n\t\t\t\tschemaId,\n\t\t\t\troot,\n\t\t\t\tbaseId\n\t\t\t});\n\t\t}\n\t\treturn getJsonPointer.call(this, p, schOrRef);\n\t}\n\texports.resolveSchema = resolveSchema;\n\tconst PREVENT_SCOPE_CHANGE = new Set([\n\t\t\"properties\",\n\t\t\"patternProperties\",\n\t\t\"enum\",\n\t\t\"dependencies\",\n\t\t\"definitions\"\n\t]);\n\tfunction getJsonPointer(parsedRef, { baseId, schema, root }) {\n\t\tvar _a;\n\t\tif (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== \"/\") return;\n\t\tfor (const part of parsedRef.fragment.slice(1).split(\"/\")) {\n\t\t\tif (typeof schema === \"boolean\") return;\n\t\t\tconst partSchema = schema[(0, util_1.unescapeFragment)(part)];\n\t\t\tif (partSchema === void 0) return;\n\t\t\tschema = partSchema;\n\t\t\tconst schId = typeof schema === \"object\" && schema[this.opts.schemaId];\n\t\t\tif (!PREVENT_SCOPE_CHANGE.has(part) && schId) baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n\t\t}\n\t\tlet env;\n\t\tif (typeof schema != \"boolean\" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {\n\t\t\tconst $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);\n\t\t\tenv = resolveSchema.call(this, root, $ref);\n\t\t}\n\t\tconst { schemaId } = this.opts;\n\t\tenv = env || new SchemaEnv({\n\t\t\tschema,\n\t\t\tschemaId,\n\t\t\troot,\n\t\t\tbaseId\n\t\t});\n\t\tif (env.schema !== env.root.schema) return env;\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json\nvar require_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$id\": \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n\t\t\"description\": \"Meta-schema for $data reference (JSON AnySchema extension proposal)\",\n\t\t\"type\": \"object\",\n\t\t\"required\": [\"$data\"],\n\t\t\"properties\": { \"$data\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"anyOf\": [{ \"format\": \"relative-json-pointer\" }, { \"format\": \"json-pointer\" }]\n\t\t} },\n\t\t\"additionalProperties\": false\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js\nvar require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\t/** @type {(value: string) => boolean} */\n\tconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu);\n\t/** @type {(value: string) => boolean} */\n\tconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u);\n\t/**\n\t* @param {Array<string>} input\n\t* @returns {string}\n\t*/\n\tfunction stringArrayToHexStripped(input) {\n\t\tlet acc = \"\";\n\t\tlet code = 0;\n\t\tlet i = 0;\n\t\tfor (i = 0; i < input.length; i++) {\n\t\t\tcode = input[i].charCodeAt(0);\n\t\t\tif (code === 48) continue;\n\t\t\tif (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) return \"\";\n\t\t\tacc += input[i];\n\t\t\tbreak;\n\t\t}\n\t\tfor (i += 1; i < input.length; i++) {\n\t\t\tcode = input[i].charCodeAt(0);\n\t\t\tif (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) return \"\";\n\t\t\tacc += input[i];\n\t\t}\n\t\treturn acc;\n\t}\n\t/**\n\t* @typedef {Object} GetIPV6Result\n\t* @property {boolean} error - Indicates if there was an error parsing the IPv6 address.\n\t* @property {string} address - The parsed IPv6 address.\n\t* @property {string} [zone] - The zone identifier, if present.\n\t*/\n\t/**\n\t* @param {string} value\n\t* @returns {boolean}\n\t*/\n\tconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u);\n\t/**\n\t* @param {Array<string>} buffer\n\t* @returns {boolean}\n\t*/\n\tfunction consumeIsZone(buffer) {\n\t\tbuffer.length = 0;\n\t\treturn true;\n\t}\n\t/**\n\t* @param {Array<string>} buffer\n\t* @param {Array<string>} address\n\t* @param {GetIPV6Result} output\n\t* @returns {boolean}\n\t*/\n\tfunction consumeHextets(buffer, address, output) {\n\t\tif (buffer.length) {\n\t\t\tconst hex = stringArrayToHexStripped(buffer);\n\t\t\tif (hex !== \"\") address.push(hex);\n\t\t\telse {\n\t\t\t\toutput.error = true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbuffer.length = 0;\n\t\t}\n\t\treturn true;\n\t}\n\t/**\n\t* @param {string} input\n\t* @returns {GetIPV6Result}\n\t*/\n\tfunction getIPV6(input) {\n\t\tlet tokenCount = 0;\n\t\tconst output = {\n\t\t\terror: false,\n\t\t\taddress: \"\",\n\t\t\tzone: \"\"\n\t\t};\n\t\t/** @type {Array<string>} */\n\t\tconst address = [];\n\t\t/** @type {Array<string>} */\n\t\tconst buffer = [];\n\t\tlet endipv6Encountered = false;\n\t\tlet endIpv6 = false;\n\t\tlet consume = consumeHextets;\n\t\tfor (let i = 0; i < input.length; i++) {\n\t\t\tconst cursor = input[i];\n\t\t\tif (cursor === \"[\" || cursor === \"]\") continue;\n\t\t\tif (cursor === \":\") {\n\t\t\t\tif (endipv6Encountered === true) endIpv6 = true;\n\t\t\t\tif (!consume(buffer, address, output)) break;\n\t\t\t\tif (++tokenCount > 7) {\n\t\t\t\t\toutput.error = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (i > 0 && input[i - 1] === \":\") endipv6Encountered = true;\n\t\t\t\taddress.push(\":\");\n\t\t\t\tcontinue;\n\t\t\t} else if (cursor === \"%\") {\n\t\t\t\tif (!consume(buffer, address, output)) break;\n\t\t\t\tconsume = consumeIsZone;\n\t\t\t} else {\n\t\t\t\tbuffer.push(cursor);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (buffer.length) if (consume === consumeIsZone) output.zone = buffer.join(\"\");\n\t\telse if (endIpv6) address.push(buffer.join(\"\"));\n\t\telse address.push(stringArrayToHexStripped(buffer));\n\t\toutput.address = address.join(\"\");\n\t\treturn output;\n\t}\n\t/**\n\t* @typedef {Object} NormalizeIPv6Result\n\t* @property {string} host - The normalized host.\n\t* @property {string} [escapedHost] - The escaped host.\n\t* @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n\t*/\n\t/**\n\t* @param {string} host\n\t* @returns {NormalizeIPv6Result}\n\t*/\n\tfunction normalizeIPv6(host) {\n\t\tif (findToken(host, \":\") < 2) return {\n\t\t\thost,\n\t\t\tisIPV6: false\n\t\t};\n\t\tconst ipv6 = getIPV6(host);\n\t\tif (!ipv6.error) {\n\t\t\tlet newHost = ipv6.address;\n\t\t\tlet escapedHost = ipv6.address;\n\t\t\tif (ipv6.zone) {\n\t\t\t\tnewHost += \"%\" + ipv6.zone;\n\t\t\t\tescapedHost += \"%25\" + ipv6.zone;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\thost: newHost,\n\t\t\t\tisIPV6: true,\n\t\t\t\tescapedHost\n\t\t\t};\n\t\t} else return {\n\t\t\thost,\n\t\t\tisIPV6: false\n\t\t};\n\t}\n\t/**\n\t* @param {string} str\n\t* @param {string} token\n\t* @returns {number}\n\t*/\n\tfunction findToken(str, token) {\n\t\tlet ind = 0;\n\t\tfor (let i = 0; i < str.length; i++) if (str[i] === token) ind++;\n\t\treturn ind;\n\t}\n\t/**\n\t* @param {string} path\n\t* @returns {string}\n\t*\n\t* @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n\t*/\n\tfunction removeDotSegments(path) {\n\t\tlet input = path;\n\t\tconst output = [];\n\t\tlet nextSlash = -1;\n\t\tlet len = 0;\n\t\twhile (len = input.length) {\n\t\t\tif (len === 1) if (input === \".\") break;\n\t\t\telse if (input === \"/\") {\n\t\t\t\toutput.push(\"/\");\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\toutput.push(input);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (len === 2) {\n\t\t\t\tif (input[0] === \".\") {\n\t\t\t\t\tif (input[1] === \".\") break;\n\t\t\t\t\telse if (input[1] === \"/\") {\n\t\t\t\t\t\tinput = input.slice(2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else if (input[0] === \"/\") {\n\t\t\t\t\tif (input[1] === \".\" || input[1] === \"/\") {\n\t\t\t\t\t\toutput.push(\"/\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (len === 3) {\n\t\t\t\tif (input === \"/..\") {\n\t\t\t\t\tif (output.length !== 0) output.pop();\n\t\t\t\t\toutput.push(\"/\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (input[0] === \".\") {\n\t\t\t\tif (input[1] === \".\") {\n\t\t\t\t\tif (input[2] === \"/\") {\n\t\t\t\t\t\tinput = input.slice(3);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else if (input[1] === \"/\") {\n\t\t\t\t\tinput = input.slice(2);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (input[0] === \"/\") {\n\t\t\t\tif (input[1] === \".\") {\n\t\t\t\t\tif (input[2] === \"/\") {\n\t\t\t\t\t\tinput = input.slice(2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (input[2] === \".\") {\n\t\t\t\t\t\tif (input[3] === \"/\") {\n\t\t\t\t\t\t\tinput = input.slice(3);\n\t\t\t\t\t\t\tif (output.length !== 0) output.pop();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((nextSlash = input.indexOf(\"/\", 1)) === -1) {\n\t\t\t\toutput.push(input);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\toutput.push(input.slice(0, nextSlash));\n\t\t\t\tinput = input.slice(nextSlash);\n\t\t\t}\n\t\t}\n\t\treturn output.join(\"\");\n\t}\n\t/**\n\t* @param {import('../types/index').URIComponent} component\n\t* @param {boolean} esc\n\t* @returns {import('../types/index').URIComponent}\n\t*/\n\tfunction normalizeComponentEncoding(component, esc) {\n\t\tconst func = esc !== true ? escape : unescape;\n\t\tif (component.scheme !== void 0) component.scheme = func(component.scheme);\n\t\tif (component.userinfo !== void 0) component.userinfo = func(component.userinfo);\n\t\tif (component.host !== void 0) component.host = func(component.host);\n\t\tif (component.path !== void 0) component.path = func(component.path);\n\t\tif (component.query !== void 0) component.query = func(component.query);\n\t\tif (component.fragment !== void 0) component.fragment = func(component.fragment);\n\t\treturn component;\n\t}\n\t/**\n\t* @param {import('../types/index').URIComponent} component\n\t* @returns {string|undefined}\n\t*/\n\tfunction recomposeAuthority(component) {\n\t\tconst uriTokens = [];\n\t\tif (component.userinfo !== void 0) {\n\t\t\turiTokens.push(component.userinfo);\n\t\t\turiTokens.push(\"@\");\n\t\t}\n\t\tif (component.host !== void 0) {\n\t\t\tlet host = unescape(component.host);\n\t\t\tif (!isIPv4(host)) {\n\t\t\t\tconst ipV6res = normalizeIPv6(host);\n\t\t\t\tif (ipV6res.isIPV6 === true) host = `[${ipV6res.escapedHost}]`;\n\t\t\t\telse host = component.host;\n\t\t\t}\n\t\t\turiTokens.push(host);\n\t\t}\n\t\tif (typeof component.port === \"number\" || typeof component.port === \"string\") {\n\t\t\turiTokens.push(\":\");\n\t\t\turiTokens.push(String(component.port));\n\t\t}\n\t\treturn uriTokens.length ? uriTokens.join(\"\") : void 0;\n\t}\n\tmodule.exports = {\n\t\tnonSimpleDomain,\n\t\trecomposeAuthority,\n\t\tnormalizeComponentEncoding,\n\t\tremoveDotSegments,\n\t\tisIPv4,\n\t\tisUUID,\n\t\tnormalizeIPv6,\n\t\tstringArrayToHexStripped\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js\nvar require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst { isUUID } = require_utils();\n\tconst URN_REG = /([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu;\n\tconst supportedSchemeNames = [\n\t\t\"http\",\n\t\t\"https\",\n\t\t\"ws\",\n\t\t\"wss\",\n\t\t\"urn\",\n\t\t\"urn:uuid\"\n\t];\n\t/** @typedef {supportedSchemeNames[number]} SchemeName */\n\t/**\n\t* @param {string} name\n\t* @returns {name is SchemeName}\n\t*/\n\tfunction isValidSchemeName(name) {\n\t\treturn supportedSchemeNames.indexOf(name) !== -1;\n\t}\n\t/**\n\t* @callback SchemeFn\n\t* @param {import('../types/index').URIComponent} component\n\t* @param {import('../types/index').Options} options\n\t* @returns {import('../types/index').URIComponent}\n\t*/\n\t/**\n\t* @typedef {Object} SchemeHandler\n\t* @property {SchemeName} scheme - The scheme name.\n\t* @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n\t* @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n\t* @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n\t* @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n\t* @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n\t* @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n\t*/\n\t/**\n\t* @param {import('../types/index').URIComponent} wsComponent\n\t* @returns {boolean}\n\t*/\n\tfunction wsIsSecure(wsComponent) {\n\t\tif (wsComponent.secure === true) return true;\n\t\telse if (wsComponent.secure === false) return false;\n\t\telse if (wsComponent.scheme) return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === \"w\" || wsComponent.scheme[0] === \"W\") && (wsComponent.scheme[1] === \"s\" || wsComponent.scheme[1] === \"S\") && (wsComponent.scheme[2] === \"s\" || wsComponent.scheme[2] === \"S\");\n\t\telse return false;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction httpParse(component) {\n\t\tif (!component.host) component.error = component.error || \"HTTP URIs must have a host.\";\n\t\treturn component;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction httpSerialize(component) {\n\t\tconst secure = String(component.scheme).toLowerCase() === \"https\";\n\t\tif (component.port === (secure ? 443 : 80) || component.port === \"\") component.port = void 0;\n\t\tif (!component.path) component.path = \"/\";\n\t\treturn component;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction wsParse(wsComponent) {\n\t\twsComponent.secure = wsIsSecure(wsComponent);\n\t\twsComponent.resourceName = (wsComponent.path || \"/\") + (wsComponent.query ? \"?\" + wsComponent.query : \"\");\n\t\twsComponent.path = void 0;\n\t\twsComponent.query = void 0;\n\t\treturn wsComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction wsSerialize(wsComponent) {\n\t\tif (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === \"\") wsComponent.port = void 0;\n\t\tif (typeof wsComponent.secure === \"boolean\") {\n\t\t\twsComponent.scheme = wsComponent.secure ? \"wss\" : \"ws\";\n\t\t\twsComponent.secure = void 0;\n\t\t}\n\t\tif (wsComponent.resourceName) {\n\t\t\tconst [path, query] = wsComponent.resourceName.split(\"?\");\n\t\t\twsComponent.path = path && path !== \"/\" ? path : void 0;\n\t\t\twsComponent.query = query;\n\t\t\twsComponent.resourceName = void 0;\n\t\t}\n\t\twsComponent.fragment = void 0;\n\t\treturn wsComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction urnParse(urnComponent, options) {\n\t\tif (!urnComponent.path) {\n\t\t\turnComponent.error = \"URN can not be parsed\";\n\t\t\treturn urnComponent;\n\t\t}\n\t\tconst matches = urnComponent.path.match(URN_REG);\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponent.scheme || \"urn\";\n\t\t\turnComponent.nid = matches[1].toLowerCase();\n\t\t\turnComponent.nss = matches[2];\n\t\t\tconst schemeHandler = getSchemeHandler(`${scheme}:${options.nid || urnComponent.nid}`);\n\t\t\turnComponent.path = void 0;\n\t\t\tif (schemeHandler) urnComponent = schemeHandler.parse(urnComponent, options);\n\t\t} else urnComponent.error = urnComponent.error || \"URN can not be parsed.\";\n\t\treturn urnComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction urnSerialize(urnComponent, options) {\n\t\tif (urnComponent.nid === void 0) throw new Error(\"URN without nid cannot be serialized\");\n\t\tconst scheme = options.scheme || urnComponent.scheme || \"urn\";\n\t\tconst nid = urnComponent.nid.toLowerCase();\n\t\tconst schemeHandler = getSchemeHandler(`${scheme}:${options.nid || nid}`);\n\t\tif (schemeHandler) urnComponent = schemeHandler.serialize(urnComponent, options);\n\t\tconst uriComponent = urnComponent;\n\t\tconst nss = urnComponent.nss;\n\t\turiComponent.path = `${nid || options.nid}:${nss}`;\n\t\toptions.skipEscape = true;\n\t\treturn uriComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction urnuuidParse(urnComponent, options) {\n\t\tconst uuidComponent = urnComponent;\n\t\tuuidComponent.uuid = uuidComponent.nss;\n\t\tuuidComponent.nss = void 0;\n\t\tif (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) uuidComponent.error = uuidComponent.error || \"UUID is not valid.\";\n\t\treturn uuidComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction urnuuidSerialize(uuidComponent) {\n\t\tconst urnComponent = uuidComponent;\n\t\turnComponent.nss = (uuidComponent.uuid || \"\").toLowerCase();\n\t\treturn urnComponent;\n\t}\n\tconst http = {\n\t\tscheme: \"http\",\n\t\tdomainHost: true,\n\t\tparse: httpParse,\n\t\tserialize: httpSerialize\n\t};\n\tconst https = {\n\t\tscheme: \"https\",\n\t\tdomainHost: http.domainHost,\n\t\tparse: httpParse,\n\t\tserialize: httpSerialize\n\t};\n\tconst ws = {\n\t\tscheme: \"ws\",\n\t\tdomainHost: true,\n\t\tparse: wsParse,\n\t\tserialize: wsSerialize\n\t};\n\tconst wss = {\n\t\tscheme: \"wss\",\n\t\tdomainHost: ws.domainHost,\n\t\tparse: ws.parse,\n\t\tserialize: ws.serialize\n\t};\n\tconst urn = {\n\t\tscheme: \"urn\",\n\t\tparse: urnParse,\n\t\tserialize: urnSerialize,\n\t\tskipNormalize: true\n\t};\n\tconst urnuuid = {\n\t\tscheme: \"urn:uuid\",\n\t\tparse: urnuuidParse,\n\t\tserialize: urnuuidSerialize,\n\t\tskipNormalize: true\n\t};\n\tconst SCHEMES = {\n\t\thttp,\n\t\thttps,\n\t\tws,\n\t\twss,\n\t\turn,\n\t\t\"urn:uuid\": urnuuid\n\t};\n\tObject.setPrototypeOf(SCHEMES, null);\n\t/**\n\t* @param {string|undefined} scheme\n\t* @returns {SchemeHandler|undefined}\n\t*/\n\tfunction getSchemeHandler(scheme) {\n\t\treturn scheme && (SCHEMES[scheme] || SCHEMES[scheme.toLowerCase()]) || void 0;\n\t}\n\tmodule.exports = {\n\t\twsIsSecure,\n\t\tSCHEMES,\n\t\tisValidSchemeName,\n\t\tgetSchemeHandler\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js\nvar require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();\n\tconst { SCHEMES, getSchemeHandler } = require_schemes();\n\t/**\n\t* @template {import('./types/index').URIComponent|string} T\n\t* @param {T} uri\n\t* @param {import('./types/index').Options} [options]\n\t* @returns {T}\n\t*/\n\tfunction normalize(uri, options) {\n\t\tif (typeof uri === \"string\") uri = serialize(parse(uri, options), options);\n\t\telse if (typeof uri === \"object\") uri = parse(serialize(uri, options), options);\n\t\treturn uri;\n\t}\n\t/**\n\t* @param {string} baseURI\n\t* @param {string} relativeURI\n\t* @param {import('./types/index').Options} [options]\n\t* @returns {string}\n\t*/\n\tfunction resolve(baseURI, relativeURI, options) {\n\t\tconst schemelessOptions = options ? Object.assign({ scheme: \"null\" }, options) : { scheme: \"null\" };\n\t\tconst resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);\n\t\tschemelessOptions.skipEscape = true;\n\t\treturn serialize(resolved, schemelessOptions);\n\t}\n\t/**\n\t* @param {import ('./types/index').URIComponent} base\n\t* @param {import ('./types/index').URIComponent} relative\n\t* @param {import('./types/index').Options} [options]\n\t* @param {boolean} [skipNormalization=false]\n\t* @returns {import ('./types/index').URIComponent}\n\t*/\n\tfunction resolveComponent(base, relative, options, skipNormalization) {\n\t\t/** @type {import('./types/index').URIComponent} */\n\t\tconst target = {};\n\t\tif (!skipNormalization) {\n\t\t\tbase = parse(serialize(base, options), options);\n\t\t\trelative = parse(serialize(relative, options), options);\n\t\t}\n\t\toptions = options || {};\n\t\tif (!options.tolerant && relative.scheme) {\n\t\t\ttarget.scheme = relative.scheme;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {\n\t\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\t\ttarget.host = relative.host;\n\t\t\t\ttarget.port = relative.port;\n\t\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\t\ttarget.query = relative.query;\n\t\t\t} else {\n\t\t\t\tif (!relative.path) {\n\t\t\t\t\ttarget.path = base.path;\n\t\t\t\t\tif (relative.query !== void 0) target.query = relative.query;\n\t\t\t\t\telse target.query = base.query;\n\t\t\t\t} else {\n\t\t\t\t\tif (relative.path[0] === \"/\") target.path = removeDotSegments(relative.path);\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) target.path = \"/\" + relative.path;\n\t\t\t\t\t\telse if (!base.path) target.path = relative.path;\n\t\t\t\t\t\telse target.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t\t}\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t}\n\t\t\t\ttarget.userinfo = base.userinfo;\n\t\t\t\ttarget.host = base.host;\n\t\t\t\ttarget.port = base.port;\n\t\t\t}\n\t\t\ttarget.scheme = base.scheme;\n\t\t}\n\t\ttarget.fragment = relative.fragment;\n\t\treturn target;\n\t}\n\t/**\n\t* @param {import ('./types/index').URIComponent|string} uriA\n\t* @param {import ('./types/index').URIComponent|string} uriB\n\t* @param {import ('./types/index').Options} options\n\t* @returns {boolean}\n\t*/\n\tfunction equal(uriA, uriB, options) {\n\t\tif (typeof uriA === \"string\") {\n\t\t\turiA = unescape(uriA);\n\t\t\turiA = serialize(normalizeComponentEncoding(parse(uriA, options), true), {\n\t\t\t\t...options,\n\t\t\t\tskipEscape: true\n\t\t\t});\n\t\t} else if (typeof uriA === \"object\") uriA = serialize(normalizeComponentEncoding(uriA, true), {\n\t\t\t...options,\n\t\t\tskipEscape: true\n\t\t});\n\t\tif (typeof uriB === \"string\") {\n\t\t\turiB = unescape(uriB);\n\t\t\turiB = serialize(normalizeComponentEncoding(parse(uriB, options), true), {\n\t\t\t\t...options,\n\t\t\t\tskipEscape: true\n\t\t\t});\n\t\t} else if (typeof uriB === \"object\") uriB = serialize(normalizeComponentEncoding(uriB, true), {\n\t\t\t...options,\n\t\t\tskipEscape: true\n\t\t});\n\t\treturn uriA.toLowerCase() === uriB.toLowerCase();\n\t}\n\t/**\n\t* @param {Readonly<import('./types/index').URIComponent>} cmpts\n\t* @param {import('./types/index').Options} [opts]\n\t* @returns {string}\n\t*/\n\tfunction serialize(cmpts, opts) {\n\t\tconst component = {\n\t\t\thost: cmpts.host,\n\t\t\tscheme: cmpts.scheme,\n\t\t\tuserinfo: cmpts.userinfo,\n\t\t\tport: cmpts.port,\n\t\t\tpath: cmpts.path,\n\t\t\tquery: cmpts.query,\n\t\t\tnid: cmpts.nid,\n\t\t\tnss: cmpts.nss,\n\t\t\tuuid: cmpts.uuid,\n\t\t\tfragment: cmpts.fragment,\n\t\t\treference: cmpts.reference,\n\t\t\tresourceName: cmpts.resourceName,\n\t\t\tsecure: cmpts.secure,\n\t\t\terror: \"\"\n\t\t};\n\t\tconst options = Object.assign({}, opts);\n\t\tconst uriTokens = [];\n\t\tconst schemeHandler = getSchemeHandler(options.scheme || component.scheme);\n\t\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);\n\t\tif (component.path !== void 0) if (!options.skipEscape) {\n\t\t\tcomponent.path = escape(component.path);\n\t\t\tif (component.scheme !== void 0) component.path = component.path.split(\"%3A\").join(\":\");\n\t\t} else component.path = unescape(component.path);\n\t\tif (options.reference !== \"suffix\" && component.scheme) uriTokens.push(component.scheme, \":\");\n\t\tconst authority = recomposeAuthority(component);\n\t\tif (authority !== void 0) {\n\t\t\tif (options.reference !== \"suffix\") uriTokens.push(\"//\");\n\t\t\turiTokens.push(authority);\n\t\t\tif (component.path && component.path[0] !== \"/\") uriTokens.push(\"/\");\n\t\t}\n\t\tif (component.path !== void 0) {\n\t\t\tlet s = component.path;\n\t\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) s = removeDotSegments(s);\n\t\t\tif (authority === void 0 && s[0] === \"/\" && s[1] === \"/\") s = \"/%2F\" + s.slice(2);\n\t\t\turiTokens.push(s);\n\t\t}\n\t\tif (component.query !== void 0) uriTokens.push(\"?\", component.query);\n\t\tif (component.fragment !== void 0) uriTokens.push(\"#\", component.fragment);\n\t\treturn uriTokens.join(\"\");\n\t}\n\tconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u;\n\t/**\n\t* @param {string} uri\n\t* @param {import('./types/index').Options} [opts]\n\t* @returns\n\t*/\n\tfunction parse(uri, opts) {\n\t\tconst options = Object.assign({}, opts);\n\t\t/** @type {import('./types/index').URIComponent} */\n\t\tconst parsed = {\n\t\t\tscheme: void 0,\n\t\t\tuserinfo: void 0,\n\t\t\thost: \"\",\n\t\t\tport: void 0,\n\t\t\tpath: \"\",\n\t\t\tquery: void 0,\n\t\t\tfragment: void 0\n\t\t};\n\t\tlet isIP = false;\n\t\tif (options.reference === \"suffix\") if (options.scheme) uri = options.scheme + \":\" + uri;\n\t\telse uri = \"//\" + uri;\n\t\tconst matches = uri.match(URI_PARSE);\n\t\tif (matches) {\n\t\t\tparsed.scheme = matches[1];\n\t\t\tparsed.userinfo = matches[3];\n\t\t\tparsed.host = matches[4];\n\t\t\tparsed.port = parseInt(matches[5], 10);\n\t\t\tparsed.path = matches[6] || \"\";\n\t\t\tparsed.query = matches[7];\n\t\t\tparsed.fragment = matches[8];\n\t\t\tif (isNaN(parsed.port)) parsed.port = matches[5];\n\t\t\tif (parsed.host) if (isIPv4(parsed.host) === false) {\n\t\t\t\tconst ipv6result = normalizeIPv6(parsed.host);\n\t\t\t\tparsed.host = ipv6result.host.toLowerCase();\n\t\t\t\tisIP = ipv6result.isIPV6;\n\t\t\t} else isIP = true;\n\t\t\tif (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) parsed.reference = \"same-document\";\n\t\t\telse if (parsed.scheme === void 0) parsed.reference = \"relative\";\n\t\t\telse if (parsed.fragment === void 0) parsed.reference = \"absolute\";\n\t\t\telse parsed.reference = \"uri\";\n\t\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== parsed.reference) parsed.error = parsed.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t\tconst schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);\n\t\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t\tif (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) try {\n\t\t\t\t\tparsed.host = URL.domainToASCII(parsed.host.toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tparsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {\n\t\t\t\tif (uri.indexOf(\"%\") !== -1) {\n\t\t\t\t\tif (parsed.scheme !== void 0) parsed.scheme = unescape(parsed.scheme);\n\t\t\t\t\tif (parsed.host !== void 0) parsed.host = unescape(parsed.host);\n\t\t\t\t}\n\t\t\t\tif (parsed.path) parsed.path = escape(unescape(parsed.path));\n\t\t\t\tif (parsed.fragment) parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));\n\t\t\t}\n\t\t\tif (schemeHandler && schemeHandler.parse) schemeHandler.parse(parsed, options);\n\t\t} else parsed.error = parsed.error || \"URI can not be parsed.\";\n\t\treturn parsed;\n\t}\n\tconst fastUri = {\n\t\tSCHEMES,\n\t\tnormalize,\n\t\tresolve,\n\t\tresolveComponent,\n\t\tequal,\n\t\tserialize,\n\t\tparse\n\t};\n\tmodule.exports = fastUri;\n\tmodule.exports.default = fastUri;\n\tmodule.exports.fastUri = fastUri;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js\nvar require_uri = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst uri = require_fast_uri();\n\turi.code = \"require(\\\"ajv/dist/runtime/uri\\\").default\";\n\texports.default = uri;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js\nvar require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;\n\tvar validate_1 = require_validate();\n\tObject.defineProperty(exports, \"KeywordCxt\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validate_1.KeywordCxt;\n\t\t}\n\t});\n\tvar codegen_1 = require_codegen();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.Name;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"CodeGen\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.CodeGen;\n\t\t}\n\t});\n\tconst validation_error_1 = require_validation_error();\n\tconst ref_error_1 = require_ref_error();\n\tconst rules_1 = require_rules();\n\tconst compile_1 = require_compile();\n\tconst codegen_2 = require_codegen();\n\tconst resolve_1 = require_resolve();\n\tconst dataType_1 = require_dataType();\n\tconst util_1 = require_util();\n\tconst $dataRefSchema = require_data();\n\tconst uri_1 = require_uri();\n\tconst defaultRegExp = (str, flags) => new RegExp(str, flags);\n\tdefaultRegExp.code = \"new RegExp\";\n\tconst META_IGNORE_OPTIONS = [\n\t\t\"removeAdditional\",\n\t\t\"useDefaults\",\n\t\t\"coerceTypes\"\n\t];\n\tconst EXT_SCOPE_NAMES = new Set([\n\t\t\"validate\",\n\t\t\"serialize\",\n\t\t\"parse\",\n\t\t\"wrapper\",\n\t\t\"root\",\n\t\t\"schema\",\n\t\t\"keyword\",\n\t\t\"pattern\",\n\t\t\"formats\",\n\t\t\"validate$data\",\n\t\t\"func\",\n\t\t\"obj\",\n\t\t\"Error\"\n\t]);\n\tconst removedOptions = {\n\t\terrorDataPath: \"\",\n\t\tformat: \"`validateFormats: false` can be used instead.\",\n\t\tnullable: \"\\\"nullable\\\" keyword is supported by default.\",\n\t\tjsonPointers: \"Deprecated jsPropertySyntax can be used instead.\",\n\t\textendRefs: \"Deprecated ignoreKeywordsWithRef can be used instead.\",\n\t\tmissingRefs: \"Pass empty schema with $id that should be ignored to ajv.addSchema.\",\n\t\tprocessCode: \"Use option `code: {process: (code, schemaEnv: object) => string}`\",\n\t\tsourceCode: \"Use option `code: {source: true}`\",\n\t\tstrictDefaults: \"It is default now, see option `strict`.\",\n\t\tstrictKeywords: \"It is default now, see option `strict`.\",\n\t\tuniqueItems: \"\\\"uniqueItems\\\" keyword is always validated.\",\n\t\tunknownFormats: \"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",\n\t\tcache: \"Map is used as cache, schema object as key.\",\n\t\tserialize: \"Map is used as cache, schema object as key.\",\n\t\tajvErrors: \"It is default now.\"\n\t};\n\tconst deprecatedOptions = {\n\t\tignoreKeywordsWithRef: \"\",\n\t\tjsPropertySyntax: \"\",\n\t\tunicode: \"\\\"minLength\\\"/\\\"maxLength\\\" account for unicode characters by default.\"\n\t};\n\tconst MAX_EXPRESSION = 200;\n\tfunction requiredOptions(o) {\n\t\tvar _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;\n\t\tconst s = o.strict;\n\t\tconst _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;\n\t\tconst optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;\n\t\tconst regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;\n\t\tconst uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;\n\t\treturn {\n\t\t\tstrictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,\n\t\t\tstrictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,\n\t\t\tstrictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : \"log\",\n\t\t\tstrictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : \"log\",\n\t\t\tstrictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,\n\t\t\tcode: o.code ? {\n\t\t\t\t...o.code,\n\t\t\t\toptimize,\n\t\t\t\tregExp\n\t\t\t} : {\n\t\t\t\toptimize,\n\t\t\t\tregExp\n\t\t\t},\n\t\t\tloopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,\n\t\t\tloopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,\n\t\t\tmeta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,\n\t\t\tmessages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,\n\t\t\tinlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,\n\t\t\tschemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : \"$id\",\n\t\t\taddUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,\n\t\t\tvalidateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,\n\t\t\tvalidateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,\n\t\t\tunicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,\n\t\t\tint32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,\n\t\t\turiResolver\n\t\t};\n\t}\n\tvar Ajv = class {\n\t\tconstructor(opts = {}) {\n\t\t\tthis.schemas = {};\n\t\t\tthis.refs = {};\n\t\t\tthis.formats = {};\n\t\t\tthis._compilations = /* @__PURE__ */ new Set();\n\t\t\tthis._loading = {};\n\t\t\tthis._cache = /* @__PURE__ */ new Map();\n\t\t\topts = this.opts = {\n\t\t\t\t...opts,\n\t\t\t\t...requiredOptions(opts)\n\t\t\t};\n\t\t\tconst { es5, lines } = this.opts.code;\n\t\t\tthis.scope = new codegen_2.ValueScope({\n\t\t\t\tscope: {},\n\t\t\t\tprefixes: EXT_SCOPE_NAMES,\n\t\t\t\tes5,\n\t\t\t\tlines\n\t\t\t});\n\t\t\tthis.logger = getLogger(opts.logger);\n\t\t\tconst formatOpt = opts.validateFormats;\n\t\t\topts.validateFormats = false;\n\t\t\tthis.RULES = (0, rules_1.getRules)();\n\t\t\tcheckOptions.call(this, removedOptions, opts, \"NOT SUPPORTED\");\n\t\t\tcheckOptions.call(this, deprecatedOptions, opts, \"DEPRECATED\", \"warn\");\n\t\t\tthis._metaOpts = getMetaSchemaOptions.call(this);\n\t\t\tif (opts.formats) addInitialFormats.call(this);\n\t\t\tthis._addVocabularies();\n\t\t\tthis._addDefaultMetaSchema();\n\t\t\tif (opts.keywords) addInitialKeywords.call(this, opts.keywords);\n\t\t\tif (typeof opts.meta == \"object\") this.addMetaSchema(opts.meta);\n\t\t\taddInitialSchemas.call(this);\n\t\t\topts.validateFormats = formatOpt;\n\t\t}\n\t\t_addVocabularies() {\n\t\t\tthis.addKeyword(\"$async\");\n\t\t}\n\t\t_addDefaultMetaSchema() {\n\t\t\tconst { $data, meta, schemaId } = this.opts;\n\t\t\tlet _dataRefSchema = $dataRefSchema;\n\t\t\tif (schemaId === \"id\") {\n\t\t\t\t_dataRefSchema = { ...$dataRefSchema };\n\t\t\t\t_dataRefSchema.id = _dataRefSchema.$id;\n\t\t\t\tdelete _dataRefSchema.$id;\n\t\t\t}\n\t\t\tif (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);\n\t\t}\n\t\tdefaultMeta() {\n\t\t\tconst { meta, schemaId } = this.opts;\n\t\t\treturn this.opts.defaultMeta = typeof meta == \"object\" ? meta[schemaId] || meta : void 0;\n\t\t}\n\t\tvalidate(schemaKeyRef, data) {\n\t\t\tlet v;\n\t\t\tif (typeof schemaKeyRef == \"string\") {\n\t\t\t\tv = this.getSchema(schemaKeyRef);\n\t\t\t\tif (!v) throw new Error(`no schema with key or ref \"${schemaKeyRef}\"`);\n\t\t\t} else v = this.compile(schemaKeyRef);\n\t\t\tconst valid = v(data);\n\t\t\tif (!(\"$async\" in v)) this.errors = v.errors;\n\t\t\treturn valid;\n\t\t}\n\t\tcompile(schema, _meta) {\n\t\t\tconst sch = this._addSchema(schema, _meta);\n\t\t\treturn sch.validate || this._compileSchemaEnv(sch);\n\t\t}\n\t\tcompileAsync(schema, meta) {\n\t\t\tif (typeof this.opts.loadSchema != \"function\") throw new Error(\"options.loadSchema should be a function\");\n\t\t\tconst { loadSchema } = this.opts;\n\t\t\treturn runCompileAsync.call(this, schema, meta);\n\t\t\tasync function runCompileAsync(_schema, _meta) {\n\t\t\t\tawait loadMetaSchema.call(this, _schema.$schema);\n\t\t\t\tconst sch = this._addSchema(_schema, _meta);\n\t\t\t\treturn sch.validate || _compileAsync.call(this, sch);\n\t\t\t}\n\t\t\tasync function loadMetaSchema($ref) {\n\t\t\t\tif ($ref && !this.getSchema($ref)) await runCompileAsync.call(this, { $ref }, true);\n\t\t\t}\n\t\t\tasync function _compileAsync(sch) {\n\t\t\t\ttry {\n\t\t\t\t\treturn this._compileSchemaEnv(sch);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (!(e instanceof ref_error_1.default)) throw e;\n\t\t\t\t\tcheckLoaded.call(this, e);\n\t\t\t\t\tawait loadMissingSchema.call(this, e.missingSchema);\n\t\t\t\t\treturn _compileAsync.call(this, sch);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction checkLoaded({ missingSchema: ref, missingRef }) {\n\t\t\t\tif (this.refs[ref]) throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);\n\t\t\t}\n\t\t\tasync function loadMissingSchema(ref) {\n\t\t\t\tconst _schema = await _loadSchema.call(this, ref);\n\t\t\t\tif (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema);\n\t\t\t\tif (!this.refs[ref]) this.addSchema(_schema, ref, meta);\n\t\t\t}\n\t\t\tasync function _loadSchema(ref) {\n\t\t\t\tconst p = this._loading[ref];\n\t\t\t\tif (p) return p;\n\t\t\t\ttry {\n\t\t\t\t\treturn await (this._loading[ref] = loadSchema(ref));\n\t\t\t\t} finally {\n\t\t\t\t\tdelete this._loading[ref];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\taddSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) {\n\t\t\tif (Array.isArray(schema)) {\n\t\t\t\tfor (const sch of schema) this.addSchema(sch, void 0, _meta, _validateSchema);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tlet id;\n\t\t\tif (typeof schema === \"object\") {\n\t\t\t\tconst { schemaId } = this.opts;\n\t\t\t\tid = schema[schemaId];\n\t\t\t\tif (id !== void 0 && typeof id != \"string\") throw new Error(`schema ${schemaId} must be string`);\n\t\t\t}\n\t\t\tkey = (0, resolve_1.normalizeId)(key || id);\n\t\t\tthis._checkUnique(key);\n\t\t\tthis.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);\n\t\t\treturn this;\n\t\t}\n\t\taddMetaSchema(schema, key, _validateSchema = this.opts.validateSchema) {\n\t\t\tthis.addSchema(schema, key, true, _validateSchema);\n\t\t\treturn this;\n\t\t}\n\t\tvalidateSchema(schema, throwOrLogError) {\n\t\t\tif (typeof schema == \"boolean\") return true;\n\t\t\tlet $schema;\n\t\t\t$schema = schema.$schema;\n\t\t\tif ($schema !== void 0 && typeof $schema != \"string\") throw new Error(\"$schema must be a string\");\n\t\t\t$schema = $schema || this.opts.defaultMeta || this.defaultMeta();\n\t\t\tif (!$schema) {\n\t\t\t\tthis.logger.warn(\"meta-schema not available\");\n\t\t\t\tthis.errors = null;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst valid = this.validate($schema, schema);\n\t\t\tif (!valid && throwOrLogError) {\n\t\t\t\tconst message = \"schema is invalid: \" + this.errorsText();\n\t\t\t\tif (this.opts.validateSchema === \"log\") this.logger.error(message);\n\t\t\t\telse throw new Error(message);\n\t\t\t}\n\t\t\treturn valid;\n\t\t}\n\t\tgetSchema(keyRef) {\n\t\t\tlet sch;\n\t\t\twhile (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\") keyRef = sch;\n\t\t\tif (sch === void 0) {\n\t\t\t\tconst { schemaId } = this.opts;\n\t\t\t\tconst root = new compile_1.SchemaEnv({\n\t\t\t\t\tschema: {},\n\t\t\t\t\tschemaId\n\t\t\t\t});\n\t\t\t\tsch = compile_1.resolveSchema.call(this, root, keyRef);\n\t\t\t\tif (!sch) return;\n\t\t\t\tthis.refs[keyRef] = sch;\n\t\t\t}\n\t\t\treturn sch.validate || this._compileSchemaEnv(sch);\n\t\t}\n\t\tremoveSchema(schemaKeyRef) {\n\t\t\tif (schemaKeyRef instanceof RegExp) {\n\t\t\t\tthis._removeAllSchemas(this.schemas, schemaKeyRef);\n\t\t\t\tthis._removeAllSchemas(this.refs, schemaKeyRef);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tswitch (typeof schemaKeyRef) {\n\t\t\t\tcase \"undefined\":\n\t\t\t\t\tthis._removeAllSchemas(this.schemas);\n\t\t\t\t\tthis._removeAllSchemas(this.refs);\n\t\t\t\t\tthis._cache.clear();\n\t\t\t\t\treturn this;\n\t\t\t\tcase \"string\": {\n\t\t\t\t\tconst sch = getSchEnv.call(this, schemaKeyRef);\n\t\t\t\t\tif (typeof sch == \"object\") this._cache.delete(sch.schema);\n\t\t\t\t\tdelete this.schemas[schemaKeyRef];\n\t\t\t\t\tdelete this.refs[schemaKeyRef];\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tcase \"object\": {\n\t\t\t\t\tconst cacheKey = schemaKeyRef;\n\t\t\t\t\tthis._cache.delete(cacheKey);\n\t\t\t\t\tlet id = schemaKeyRef[this.opts.schemaId];\n\t\t\t\t\tif (id) {\n\t\t\t\t\t\tid = (0, resolve_1.normalizeId)(id);\n\t\t\t\t\t\tdelete this.schemas[id];\n\t\t\t\t\t\tdelete this.refs[id];\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tdefault: throw new Error(\"ajv.removeSchema: invalid parameter\");\n\t\t\t}\n\t\t}\n\t\taddVocabulary(definitions) {\n\t\t\tfor (const def of definitions) this.addKeyword(def);\n\t\t\treturn this;\n\t\t}\n\t\taddKeyword(kwdOrDef, def) {\n\t\t\tlet keyword;\n\t\t\tif (typeof kwdOrDef == \"string\") {\n\t\t\t\tkeyword = kwdOrDef;\n\t\t\t\tif (typeof def == \"object\") {\n\t\t\t\t\tthis.logger.warn(\"these parameters are deprecated, see docs for addKeyword\");\n\t\t\t\t\tdef.keyword = keyword;\n\t\t\t\t}\n\t\t\t} else if (typeof kwdOrDef == \"object\" && def === void 0) {\n\t\t\t\tdef = kwdOrDef;\n\t\t\t\tkeyword = def.keyword;\n\t\t\t\tif (Array.isArray(keyword) && !keyword.length) throw new Error(\"addKeywords: keyword must be string or non-empty array\");\n\t\t\t} else throw new Error(\"invalid addKeywords parameters\");\n\t\t\tcheckKeyword.call(this, keyword, def);\n\t\t\tif (!def) {\n\t\t\t\t(0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tkeywordMetaschema.call(this, def);\n\t\t\tconst definition = {\n\t\t\t\t...def,\n\t\t\t\ttype: (0, dataType_1.getJSONTypes)(def.type),\n\t\t\t\tschemaType: (0, dataType_1.getJSONTypes)(def.schemaType)\n\t\t\t};\n\t\t\t(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));\n\t\t\treturn this;\n\t\t}\n\t\tgetKeyword(keyword) {\n\t\t\tconst rule = this.RULES.all[keyword];\n\t\t\treturn typeof rule == \"object\" ? rule.definition : !!rule;\n\t\t}\n\t\tremoveKeyword(keyword) {\n\t\t\tconst { RULES } = this;\n\t\t\tdelete RULES.keywords[keyword];\n\t\t\tdelete RULES.all[keyword];\n\t\t\tfor (const group of RULES.rules) {\n\t\t\t\tconst i = group.rules.findIndex((rule) => rule.keyword === keyword);\n\t\t\t\tif (i >= 0) group.rules.splice(i, 1);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\taddFormat(name, format) {\n\t\t\tif (typeof format == \"string\") format = new RegExp(format);\n\t\t\tthis.formats[name] = format;\n\t\t\treturn this;\n\t\t}\n\t\terrorsText(errors = this.errors, { separator = \", \", dataVar = \"data\" } = {}) {\n\t\t\tif (!errors || errors.length === 0) return \"No errors\";\n\t\t\treturn errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg);\n\t\t}\n\t\t$dataMetaSchema(metaSchema, keywordsJsonPointers) {\n\t\t\tconst rules = this.RULES.all;\n\t\t\tmetaSchema = JSON.parse(JSON.stringify(metaSchema));\n\t\t\tfor (const jsonPointer of keywordsJsonPointers) {\n\t\t\t\tconst segments = jsonPointer.split(\"/\").slice(1);\n\t\t\t\tlet keywords = metaSchema;\n\t\t\t\tfor (const seg of segments) keywords = keywords[seg];\n\t\t\t\tfor (const key in rules) {\n\t\t\t\t\tconst rule = rules[key];\n\t\t\t\t\tif (typeof rule != \"object\") continue;\n\t\t\t\t\tconst { $data } = rule.definition;\n\t\t\t\t\tconst schema = keywords[key];\n\t\t\t\t\tif ($data && schema) keywords[key] = schemaOrData(schema);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn metaSchema;\n\t\t}\n\t\t_removeAllSchemas(schemas, regex) {\n\t\t\tfor (const keyRef in schemas) {\n\t\t\t\tconst sch = schemas[keyRef];\n\t\t\t\tif (!regex || regex.test(keyRef)) {\n\t\t\t\t\tif (typeof sch == \"string\") delete schemas[keyRef];\n\t\t\t\t\telse if (sch && !sch.meta) {\n\t\t\t\t\t\tthis._cache.delete(sch.schema);\n\t\t\t\t\t\tdelete schemas[keyRef];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {\n\t\t\tlet id;\n\t\t\tconst { schemaId } = this.opts;\n\t\t\tif (typeof schema == \"object\") id = schema[schemaId];\n\t\t\telse if (this.opts.jtd) throw new Error(\"schema must be object\");\n\t\t\telse if (typeof schema != \"boolean\") throw new Error(\"schema must be object or boolean\");\n\t\t\tlet sch = this._cache.get(schema);\n\t\t\tif (sch !== void 0) return sch;\n\t\t\tbaseId = (0, resolve_1.normalizeId)(id || baseId);\n\t\t\tconst localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);\n\t\t\tsch = new compile_1.SchemaEnv({\n\t\t\t\tschema,\n\t\t\t\tschemaId,\n\t\t\t\tmeta,\n\t\t\t\tbaseId,\n\t\t\t\tlocalRefs\n\t\t\t});\n\t\t\tthis._cache.set(sch.schema, sch);\n\t\t\tif (addSchema && !baseId.startsWith(\"#\")) {\n\t\t\t\tif (baseId) this._checkUnique(baseId);\n\t\t\t\tthis.refs[baseId] = sch;\n\t\t\t}\n\t\t\tif (validateSchema) this.validateSchema(schema, true);\n\t\t\treturn sch;\n\t\t}\n\t\t_checkUnique(id) {\n\t\t\tif (this.schemas[id] || this.refs[id]) throw new Error(`schema with key or id \"${id}\" already exists`);\n\t\t}\n\t\t_compileSchemaEnv(sch) {\n\t\t\tif (sch.meta) this._compileMetaSchema(sch);\n\t\t\telse compile_1.compileSchema.call(this, sch);\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!sch.validate) throw new Error(\"ajv implementation error\");\n\t\t\treturn sch.validate;\n\t\t}\n\t\t_compileMetaSchema(sch) {\n\t\t\tconst currentOpts = this.opts;\n\t\t\tthis.opts = this._metaOpts;\n\t\t\ttry {\n\t\t\t\tcompile_1.compileSchema.call(this, sch);\n\t\t\t} finally {\n\t\t\t\tthis.opts = currentOpts;\n\t\t\t}\n\t\t}\n\t};\n\tAjv.ValidationError = validation_error_1.default;\n\tAjv.MissingRefError = ref_error_1.default;\n\texports.default = Ajv;\n\tfunction checkOptions(checkOpts, options, msg, log = \"error\") {\n\t\tfor (const key in checkOpts) {\n\t\t\tconst opt = key;\n\t\t\tif (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);\n\t\t}\n\t}\n\tfunction getSchEnv(keyRef) {\n\t\tkeyRef = (0, resolve_1.normalizeId)(keyRef);\n\t\treturn this.schemas[keyRef] || this.refs[keyRef];\n\t}\n\tfunction addInitialSchemas() {\n\t\tconst optsSchemas = this.opts.schemas;\n\t\tif (!optsSchemas) return;\n\t\tif (Array.isArray(optsSchemas)) this.addSchema(optsSchemas);\n\t\telse for (const key in optsSchemas) this.addSchema(optsSchemas[key], key);\n\t}\n\tfunction addInitialFormats() {\n\t\tfor (const name in this.opts.formats) {\n\t\t\tconst format = this.opts.formats[name];\n\t\t\tif (format) this.addFormat(name, format);\n\t\t}\n\t}\n\tfunction addInitialKeywords(defs) {\n\t\tif (Array.isArray(defs)) {\n\t\t\tthis.addVocabulary(defs);\n\t\t\treturn;\n\t\t}\n\t\tthis.logger.warn(\"keywords option as map is deprecated, pass array\");\n\t\tfor (const keyword in defs) {\n\t\t\tconst def = defs[keyword];\n\t\t\tif (!def.keyword) def.keyword = keyword;\n\t\t\tthis.addKeyword(def);\n\t\t}\n\t}\n\tfunction getMetaSchemaOptions() {\n\t\tconst metaOpts = { ...this.opts };\n\t\tfor (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt];\n\t\treturn metaOpts;\n\t}\n\tconst noLogs = {\n\t\tlog() {},\n\t\twarn() {},\n\t\terror() {}\n\t};\n\tfunction getLogger(logger) {\n\t\tif (logger === false) return noLogs;\n\t\tif (logger === void 0) return console;\n\t\tif (logger.log && logger.warn && logger.error) return logger;\n\t\tthrow new Error(\"logger must implement log, warn and error methods\");\n\t}\n\tconst KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;\n\tfunction checkKeyword(keyword, def) {\n\t\tconst { RULES } = this;\n\t\t(0, util_1.eachItem)(keyword, (kwd) => {\n\t\t\tif (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`);\n\t\t\tif (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`);\n\t\t});\n\t\tif (!def) return;\n\t\tif (def.$data && !(\"code\" in def || \"validate\" in def)) throw new Error(\"$data keyword must have \\\"code\\\" or \\\"validate\\\" function\");\n\t}\n\tfunction addRule(keyword, definition, dataType) {\n\t\tvar _a;\n\t\tconst post = definition === null || definition === void 0 ? void 0 : definition.post;\n\t\tif (dataType && post) throw new Error(\"keyword with \\\"post\\\" flag cannot have \\\"type\\\"\");\n\t\tconst { RULES } = this;\n\t\tlet ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);\n\t\tif (!ruleGroup) {\n\t\t\truleGroup = {\n\t\t\t\ttype: dataType,\n\t\t\t\trules: []\n\t\t\t};\n\t\t\tRULES.rules.push(ruleGroup);\n\t\t}\n\t\tRULES.keywords[keyword] = true;\n\t\tif (!definition) return;\n\t\tconst rule = {\n\t\t\tkeyword,\n\t\t\tdefinition: {\n\t\t\t\t...definition,\n\t\t\t\ttype: (0, dataType_1.getJSONTypes)(definition.type),\n\t\t\t\tschemaType: (0, dataType_1.getJSONTypes)(definition.schemaType)\n\t\t\t}\n\t\t};\n\t\tif (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before);\n\t\telse ruleGroup.rules.push(rule);\n\t\tRULES.all[keyword] = rule;\n\t\t(_a = definition.implements) === null || _a === void 0 || _a.forEach((kwd) => this.addKeyword(kwd));\n\t}\n\tfunction addBeforeRule(ruleGroup, rule, before) {\n\t\tconst i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);\n\t\tif (i >= 0) ruleGroup.rules.splice(i, 0, rule);\n\t\telse {\n\t\t\truleGroup.rules.push(rule);\n\t\t\tthis.logger.warn(`rule ${before} is not defined`);\n\t\t}\n\t}\n\tfunction keywordMetaschema(def) {\n\t\tlet { metaSchema } = def;\n\t\tif (metaSchema === void 0) return;\n\t\tif (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema);\n\t\tdef.validateSchema = this.compile(metaSchema, true);\n\t}\n\tconst $dataRef = { $ref: \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\" };\n\tfunction schemaOrData(schema) {\n\t\treturn { anyOf: [schema, $dataRef] };\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js\nvar require_id = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst def = {\n\t\tkeyword: \"id\",\n\t\tcode() {\n\t\t\tthrow new Error(\"NOT SUPPORTED: keyword \\\"id\\\", use \\\"$id\\\" for schema ID\");\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js\nvar require_ref = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.callRef = exports.getValidate = void 0;\n\tconst ref_error_1 = require_ref_error();\n\tconst code_1 = require_code();\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst compile_1 = require_compile();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"$ref\",\n\t\tschemaType: \"string\",\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema: $ref, it } = cxt;\n\t\t\tconst { baseId, schemaEnv: env, validateName, opts, self } = it;\n\t\t\tconst { root } = env;\n\t\t\tif (($ref === \"#\" || $ref === \"#/\") && baseId === root.baseId) return callRootRef();\n\t\t\tconst schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);\n\t\t\tif (schOrEnv === void 0) throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);\n\t\t\tif (schOrEnv instanceof compile_1.SchemaEnv) return callValidate(schOrEnv);\n\t\t\treturn inlineRefSchema(schOrEnv);\n\t\t\tfunction callRootRef() {\n\t\t\t\tif (env === root) return callRef(cxt, validateName, env, env.$async);\n\t\t\t\tconst rootName = gen.scopeValue(\"root\", { ref: root });\n\t\t\t\treturn callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);\n\t\t\t}\n\t\t\tfunction callValidate(sch) {\n\t\t\t\tcallRef(cxt, getValidate(cxt, sch), sch, sch.$async);\n\t\t\t}\n\t\t\tfunction inlineRefSchema(sch) {\n\t\t\t\tconst schName = gen.scopeValue(\"schema\", opts.code.source === true ? {\n\t\t\t\t\tref: sch,\n\t\t\t\t\tcode: (0, codegen_1.stringify)(sch)\n\t\t\t\t} : { ref: sch });\n\t\t\t\tconst valid = gen.name(\"valid\");\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tschema: sch,\n\t\t\t\t\tdataTypes: [],\n\t\t\t\t\tschemaPath: codegen_1.nil,\n\t\t\t\t\ttopSchemaRef: schName,\n\t\t\t\t\terrSchemaPath: $ref\n\t\t\t\t}, valid);\n\t\t\t\tcxt.mergeEvaluated(schCxt);\n\t\t\t\tcxt.ok(valid);\n\t\t\t}\n\t\t}\n\t};\n\tfunction getValidate(cxt, sch) {\n\t\tconst { gen } = cxt;\n\t\treturn sch.validate ? gen.scopeValue(\"validate\", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue(\"wrapper\", { ref: sch })}.validate`;\n\t}\n\texports.getValidate = getValidate;\n\tfunction callRef(cxt, v, sch, $async) {\n\t\tconst { gen, it } = cxt;\n\t\tconst { allErrors, schemaEnv: env, opts } = it;\n\t\tconst passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;\n\t\tif ($async) callAsyncRef();\n\t\telse callSyncRef();\n\t\tfunction callAsyncRef() {\n\t\t\tif (!env.$async) throw new Error(\"async schema referenced by sync schema\");\n\t\t\tconst valid = gen.let(\"valid\");\n\t\t\tgen.try(() => {\n\t\t\t\tgen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);\n\t\t\t\taddEvaluatedFrom(v);\n\t\t\t\tif (!allErrors) gen.assign(valid, true);\n\t\t\t}, (e) => {\n\t\t\t\tgen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));\n\t\t\t\taddErrorsFrom(e);\n\t\t\t\tif (!allErrors) gen.assign(valid, false);\n\t\t\t});\n\t\t\tcxt.ok(valid);\n\t\t}\n\t\tfunction callSyncRef() {\n\t\t\tcxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));\n\t\t}\n\t\tfunction addErrorsFrom(source) {\n\t\t\tconst errs = (0, codegen_1._)`${source}.errors`;\n\t\t\tgen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);\n\t\t\tgen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);\n\t\t}\n\t\tfunction addEvaluatedFrom(source) {\n\t\t\tvar _a;\n\t\t\tif (!it.opts.unevaluated) return;\n\t\t\tconst schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;\n\t\t\tif (it.props !== true) if (schEvaluated && !schEvaluated.dynamicProps) {\n\t\t\t\tif (schEvaluated.props !== void 0) it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);\n\t\t\t} else {\n\t\t\t\tconst props = gen.var(\"props\", (0, codegen_1._)`${source}.evaluated.props`);\n\t\t\t\tit.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);\n\t\t\t}\n\t\t\tif (it.items !== true) if (schEvaluated && !schEvaluated.dynamicItems) {\n\t\t\t\tif (schEvaluated.items !== void 0) it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);\n\t\t\t} else {\n\t\t\t\tconst items = gen.var(\"items\", (0, codegen_1._)`${source}.evaluated.items`);\n\t\t\t\tit.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);\n\t\t\t}\n\t\t}\n\t}\n\texports.callRef = callRef;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js\nvar require_core$2 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst id_1 = require_id();\n\tconst ref_1 = require_ref();\n\tconst core = [\n\t\t\"$schema\",\n\t\t\"$id\",\n\t\t\"$defs\",\n\t\t\"$vocabulary\",\n\t\t{ keyword: \"$comment\" },\n\t\t\"definitions\",\n\t\tid_1.default,\n\t\tref_1.default\n\t];\n\texports.default = core;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js\nvar require_limitNumber = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst ops = codegen_1.operators;\n\tconst KWDs = {\n\t\tmaximum: {\n\t\t\tokStr: \"<=\",\n\t\t\tok: ops.LTE,\n\t\t\tfail: ops.GT\n\t\t},\n\t\tminimum: {\n\t\t\tokStr: \">=\",\n\t\t\tok: ops.GTE,\n\t\t\tfail: ops.LT\n\t\t},\n\t\texclusiveMaximum: {\n\t\t\tokStr: \"<\",\n\t\t\tok: ops.LT,\n\t\t\tfail: ops.GTE\n\t\t},\n\t\texclusiveMinimum: {\n\t\t\tokStr: \">\",\n\t\t\tok: ops.GT,\n\t\t\tfail: ops.LTE\n\t\t}\n\t};\n\tconst def = {\n\t\tkeyword: Object.keys(KWDs),\n\t\ttype: \"number\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,\n\t\t\tparams: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { keyword, data, schemaCode } = cxt;\n\t\t\tcxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js\nvar require_multipleOf = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: \"multipleOf\",\n\t\ttype: \"number\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, schemaCode, it } = cxt;\n\t\t\tconst prec = it.opts.multipleOfPrecision;\n\t\t\tconst res = gen.let(\"res\");\n\t\t\tconst invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;\n\t\t\tcxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js\nvar require_ucs2length = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tfunction ucs2length(str) {\n\t\tconst len = str.length;\n\t\tlet length = 0;\n\t\tlet pos = 0;\n\t\tlet value;\n\t\twhile (pos < len) {\n\t\t\tlength++;\n\t\t\tvalue = str.charCodeAt(pos++);\n\t\t\tif (value >= 55296 && value <= 56319 && pos < len) {\n\t\t\t\tvalue = str.charCodeAt(pos);\n\t\t\t\tif ((value & 64512) === 56320) pos++;\n\t\t\t}\n\t\t}\n\t\treturn length;\n\t}\n\texports.default = ucs2length;\n\tucs2length.code = \"require(\\\"ajv/dist/runtime/ucs2length\\\").default\";\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js\nvar require_limitLength = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst ucs2length_1 = require_ucs2length();\n\tconst def = {\n\t\tkeyword: [\"maxLength\", \"minLength\"],\n\t\ttype: \"string\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage({ keyword, schemaCode }) {\n\t\t\t\tconst comp = keyword === \"maxLength\" ? \"more\" : \"fewer\";\n\t\t\t\treturn (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;\n\t\t\t},\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { keyword, data, schemaCode, it } = cxt;\n\t\t\tconst op = keyword === \"maxLength\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n\t\t\tconst len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;\n\t\t\tcxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js\nvar require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst code_1 = require_code();\n\tconst util_1 = require_util();\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: \"pattern\",\n\t\ttype: \"string\",\n\t\tschemaType: \"string\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ schemaCode }) => (0, codegen_1.str)`must match pattern \"${schemaCode}\"`,\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, $data, schema, schemaCode, it } = cxt;\n\t\t\tconst u = it.opts.unicodeRegExp ? \"u\" : \"\";\n\t\t\tif ($data) {\n\t\t\t\tconst { regExp } = it.opts.code;\n\t\t\t\tconst regExpCode = regExp.code === \"new RegExp\" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);\n\t\t\t\tconst valid = gen.let(\"valid\");\n\t\t\t\tgen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));\n\t\t\t\tcxt.fail$data((0, codegen_1._)`!${valid}`);\n\t\t\t} else {\n\t\t\t\tconst regExp = (0, code_1.usePattern)(cxt, schema);\n\t\t\t\tcxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js\nvar require_limitProperties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: [\"maxProperties\", \"minProperties\"],\n\t\ttype: \"object\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage({ keyword, schemaCode }) {\n\t\t\t\tconst comp = keyword === \"maxProperties\" ? \"more\" : \"fewer\";\n\t\t\t\treturn (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;\n\t\t\t},\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { keyword, data, schemaCode } = cxt;\n\t\t\tconst op = keyword === \"maxProperties\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n\t\t\tcxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js\nvar require_required = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst code_1 = require_code();\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"required\",\n\t\ttype: \"object\",\n\t\tschemaType: \"array\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,\n\t\t\tparams: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, schemaCode, data, $data, it } = cxt;\n\t\t\tconst { opts } = it;\n\t\t\tif (!$data && schema.length === 0) return;\n\t\t\tconst useLoop = schema.length >= opts.loopRequired;\n\t\t\tif (it.allErrors) allErrorsMode();\n\t\t\telse exitOnErrorMode();\n\t\t\tif (opts.strictRequired) {\n\t\t\t\tconst props = cxt.parentSchema.properties;\n\t\t\t\tconst { definedProperties } = cxt.it;\n\t\t\t\tfor (const requiredKey of schema) if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) {\n\t\t\t\t\tconst msg = `required property \"${requiredKey}\" is not defined at \"${it.schemaEnv.baseId + it.errSchemaPath}\" (strictRequired)`;\n\t\t\t\t\t(0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction allErrorsMode() {\n\t\t\t\tif (useLoop || $data) cxt.block$data(codegen_1.nil, loopAllRequired);\n\t\t\t\telse for (const prop of schema) (0, code_1.checkReportMissingProp)(cxt, prop);\n\t\t\t}\n\t\t\tfunction exitOnErrorMode() {\n\t\t\t\tconst missing = gen.let(\"missing\");\n\t\t\t\tif (useLoop || $data) {\n\t\t\t\t\tconst valid = gen.let(\"valid\", true);\n\t\t\t\t\tcxt.block$data(valid, () => loopUntilMissing(missing, valid));\n\t\t\t\t\tcxt.ok(valid);\n\t\t\t\t} else {\n\t\t\t\t\tgen.if((0, code_1.checkMissingProp)(cxt, schema, missing));\n\t\t\t\t\t(0, code_1.reportMissingProp)(cxt, missing);\n\t\t\t\t\tgen.else();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction loopAllRequired() {\n\t\t\t\tgen.forOf(\"prop\", schemaCode, (prop) => {\n\t\t\t\t\tcxt.setParams({ missingProperty: prop });\n\t\t\t\t\tgen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction loopUntilMissing(missing, valid) {\n\t\t\t\tcxt.setParams({ missingProperty: missing });\n\t\t\t\tgen.forOf(missing, schemaCode, () => {\n\t\t\t\t\tgen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));\n\t\t\t\t\tgen.if((0, codegen_1.not)(valid), () => {\n\t\t\t\t\t\tcxt.error();\n\t\t\t\t\t\tgen.break();\n\t\t\t\t\t});\n\t\t\t\t}, codegen_1.nil);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js\nvar require_limitItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: [\"maxItems\", \"minItems\"],\n\t\ttype: \"array\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage({ keyword, schemaCode }) {\n\t\t\t\tconst comp = keyword === \"maxItems\" ? \"more\" : \"fewer\";\n\t\t\t\treturn (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;\n\t\t\t},\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { keyword, data, schemaCode } = cxt;\n\t\t\tconst op = keyword === \"maxItems\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n\t\t\tcxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js\nvar require_equal = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst equal = require_fast_deep_equal();\n\tequal.code = \"require(\\\"ajv/dist/runtime/equal\\\").default\";\n\texports.default = equal;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js\nvar require_uniqueItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dataType_1 = require_dataType();\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst equal_1 = require_equal();\n\tconst def = {\n\t\tkeyword: \"uniqueItems\",\n\t\ttype: \"array\",\n\t\tschemaType: \"boolean\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,\n\t\t\tparams: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;\n\t\t\tif (!$data && !schema) return;\n\t\t\tconst valid = gen.let(\"valid\");\n\t\t\tconst itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];\n\t\t\tcxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`);\n\t\t\tcxt.ok(valid);\n\t\t\tfunction validateUniqueItems() {\n\t\t\t\tconst i = gen.let(\"i\", (0, codegen_1._)`${data}.length`);\n\t\t\t\tconst j = gen.let(\"j\");\n\t\t\t\tcxt.setParams({\n\t\t\t\t\ti,\n\t\t\t\t\tj\n\t\t\t\t});\n\t\t\t\tgen.assign(valid, true);\n\t\t\t\tgen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));\n\t\t\t}\n\t\t\tfunction canOptimize() {\n\t\t\t\treturn itemTypes.length > 0 && !itemTypes.some((t) => t === \"object\" || t === \"array\");\n\t\t\t}\n\t\t\tfunction loopN(i, j) {\n\t\t\t\tconst item = gen.name(\"item\");\n\t\t\t\tconst wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);\n\t\t\t\tconst indices = gen.const(\"indices\", (0, codegen_1._)`{}`);\n\t\t\t\tgen.for((0, codegen_1._)`;${i}--;`, () => {\n\t\t\t\t\tgen.let(item, (0, codegen_1._)`${data}[${i}]`);\n\t\t\t\t\tgen.if(wrongType, (0, codegen_1._)`continue`);\n\t\t\t\t\tif (itemTypes.length > 1) gen.if((0, codegen_1._)`typeof ${item} == \"string\"`, (0, codegen_1._)`${item} += \"_\"`);\n\t\t\t\t\tgen.if((0, codegen_1._)`typeof ${indices}[${item}] == \"number\"`, () => {\n\t\t\t\t\t\tgen.assign(j, (0, codegen_1._)`${indices}[${item}]`);\n\t\t\t\t\t\tcxt.error();\n\t\t\t\t\t\tgen.assign(valid, false).break();\n\t\t\t\t\t}).code((0, codegen_1._)`${indices}[${item}] = ${i}`);\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction loopN2(i, j) {\n\t\t\t\tconst eql = (0, util_1.useFunc)(gen, equal_1.default);\n\t\t\t\tconst outer = gen.name(\"outer\");\n\t\t\t\tgen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {\n\t\t\t\t\tcxt.error();\n\t\t\t\t\tgen.assign(valid, false).break(outer);\n\t\t\t\t})));\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js\nvar require_const = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst equal_1 = require_equal();\n\tconst def = {\n\t\tkeyword: \"const\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: \"must be equal to constant\",\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, $data, schemaCode, schema } = cxt;\n\t\t\tif ($data || schema && typeof schema == \"object\") cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);\n\t\t\telse cxt.fail((0, codegen_1._)`${schema} !== ${data}`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js\nvar require_enum = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst equal_1 = require_equal();\n\tconst def = {\n\t\tkeyword: \"enum\",\n\t\tschemaType: \"array\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: \"must be equal to one of the allowed values\",\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, $data, schema, schemaCode, it } = cxt;\n\t\t\tif (!$data && schema.length === 0) throw new Error(\"enum must have non-empty array\");\n\t\t\tconst useLoop = schema.length >= it.opts.loopEnum;\n\t\t\tlet eql;\n\t\t\tconst getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);\n\t\t\tlet valid;\n\t\t\tif (useLoop || $data) {\n\t\t\t\tvalid = gen.let(\"valid\");\n\t\t\t\tcxt.block$data(valid, loopEnum);\n\t\t\t} else {\n\t\t\t\t/* istanbul ignore if */\n\t\t\t\tif (!Array.isArray(schema)) throw new Error(\"ajv implementation error\");\n\t\t\t\tconst vSchema = gen.const(\"vSchema\", schemaCode);\n\t\t\t\tvalid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));\n\t\t\t}\n\t\t\tcxt.pass(valid);\n\t\t\tfunction loopEnum() {\n\t\t\t\tgen.assign(valid, false);\n\t\t\t\tgen.forOf(\"v\", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));\n\t\t\t}\n\t\t\tfunction equalCode(vSchema, i) {\n\t\t\t\tconst sch = schema[i];\n\t\t\t\treturn typeof sch === \"object\" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js\nvar require_validation$2 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst limitNumber_1 = require_limitNumber();\n\tconst multipleOf_1 = require_multipleOf();\n\tconst limitLength_1 = require_limitLength();\n\tconst pattern_1 = require_pattern();\n\tconst limitProperties_1 = require_limitProperties();\n\tconst required_1 = require_required();\n\tconst limitItems_1 = require_limitItems();\n\tconst uniqueItems_1 = require_uniqueItems();\n\tconst const_1 = require_const();\n\tconst enum_1 = require_enum();\n\tconst validation = [\n\t\tlimitNumber_1.default,\n\t\tmultipleOf_1.default,\n\t\tlimitLength_1.default,\n\t\tpattern_1.default,\n\t\tlimitProperties_1.default,\n\t\trequired_1.default,\n\t\tlimitItems_1.default,\n\t\tuniqueItems_1.default,\n\t\t{\n\t\t\tkeyword: \"type\",\n\t\t\tschemaType: [\"string\", \"array\"]\n\t\t},\n\t\t{\n\t\t\tkeyword: \"nullable\",\n\t\t\tschemaType: \"boolean\"\n\t\t},\n\t\tconst_1.default,\n\t\tenum_1.default\n\t];\n\texports.default = validation;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js\nvar require_additionalItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateAdditionalItems = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"additionalItems\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"boolean\", \"object\"],\n\t\tbefore: \"uniqueItems\",\n\t\terror: {\n\t\t\tmessage: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,\n\t\t\tparams: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { parentSchema, it } = cxt;\n\t\t\tconst { items } = parentSchema;\n\t\t\tif (!Array.isArray(items)) {\n\t\t\t\t(0, util_1.checkStrictMode)(it, \"\\\"additionalItems\\\" is ignored when \\\"items\\\" is not an array of schemas\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvalidateAdditionalItems(cxt, items);\n\t\t}\n\t};\n\tfunction validateAdditionalItems(cxt, items) {\n\t\tconst { gen, schema, data, keyword, it } = cxt;\n\t\tit.items = true;\n\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\tif (schema === false) {\n\t\t\tcxt.setParams({ len: items.length });\n\t\t\tcxt.pass((0, codegen_1._)`${len} <= ${items.length}`);\n\t\t} else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\tconst valid = gen.var(\"valid\", (0, codegen_1._)`${len} <= ${items.length}`);\n\t\t\tgen.if((0, codegen_1.not)(valid), () => validateItems(valid));\n\t\t\tcxt.ok(valid);\n\t\t}\n\t\tfunction validateItems(valid) {\n\t\t\tgen.forRange(\"i\", items.length, len, (i) => {\n\t\t\t\tcxt.subschema({\n\t\t\t\t\tkeyword,\n\t\t\t\t\tdataProp: i,\n\t\t\t\t\tdataPropType: util_1.Type.Num\n\t\t\t\t}, valid);\n\t\t\t\tif (!it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t});\n\t\t}\n\t}\n\texports.validateAdditionalItems = validateAdditionalItems;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js\nvar require_items = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateTuple = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst code_1 = require_code();\n\tconst def = {\n\t\tkeyword: \"items\",\n\t\ttype: \"array\",\n\t\tschemaType: [\n\t\t\t\"object\",\n\t\t\t\"array\",\n\t\t\t\"boolean\"\n\t\t],\n\t\tbefore: \"uniqueItems\",\n\t\tcode(cxt) {\n\t\t\tconst { schema, it } = cxt;\n\t\t\tif (Array.isArray(schema)) return validateTuple(cxt, \"additionalItems\", schema);\n\t\t\tit.items = true;\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) return;\n\t\t\tcxt.ok((0, code_1.validateArray)(cxt));\n\t\t}\n\t};\n\tfunction validateTuple(cxt, extraItems, schArr = cxt.schema) {\n\t\tconst { gen, parentSchema, data, keyword, it } = cxt;\n\t\tcheckStrictTuple(parentSchema);\n\t\tif (it.opts.unevaluated && schArr.length && it.items !== true) it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);\n\t\tconst valid = gen.name(\"valid\");\n\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\tschArr.forEach((sch, i) => {\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, sch)) return;\n\t\t\tgen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({\n\t\t\t\tkeyword,\n\t\t\t\tschemaProp: i,\n\t\t\t\tdataProp: i\n\t\t\t}, valid));\n\t\t\tcxt.ok(valid);\n\t\t});\n\t\tfunction checkStrictTuple(sch) {\n\t\t\tconst { opts, errSchemaPath } = it;\n\t\t\tconst l = schArr.length;\n\t\t\tconst fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);\n\t\t\tif (opts.strictTuples && !fullTuple) {\n\t\t\t\tconst msg = `\"${keyword}\" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path \"${errSchemaPath}\"`;\n\t\t\t\t(0, util_1.checkStrictMode)(it, msg, opts.strictTuples);\n\t\t\t}\n\t\t}\n\t}\n\texports.validateTuple = validateTuple;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js\nvar require_prefixItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst items_1 = require_items();\n\tconst def = {\n\t\tkeyword: \"prefixItems\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"array\"],\n\t\tbefore: \"uniqueItems\",\n\t\tcode: (cxt) => (0, items_1.validateTuple)(cxt, \"items\")\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js\nvar require_items2020 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst code_1 = require_code();\n\tconst additionalItems_1 = require_additionalItems();\n\tconst def = {\n\t\tkeyword: \"items\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\tbefore: \"uniqueItems\",\n\t\terror: {\n\t\t\tmessage: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,\n\t\t\tparams: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { schema, parentSchema, it } = cxt;\n\t\t\tconst { prefixItems } = parentSchema;\n\t\t\tit.items = true;\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) return;\n\t\t\tif (prefixItems) (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);\n\t\t\telse cxt.ok((0, code_1.validateArray)(cxt));\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js\nvar require_contains = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"contains\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\tbefore: \"uniqueItems\",\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,\n\t\t\tparams: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, parentSchema, data, it } = cxt;\n\t\t\tlet min;\n\t\t\tlet max;\n\t\t\tconst { minContains, maxContains } = parentSchema;\n\t\t\tif (it.opts.next) {\n\t\t\t\tmin = minContains === void 0 ? 1 : minContains;\n\t\t\t\tmax = maxContains;\n\t\t\t} else min = 1;\n\t\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\t\tcxt.setParams({\n\t\t\t\tmin,\n\t\t\t\tmax\n\t\t\t});\n\t\t\tif (max === void 0 && min === 0) {\n\t\t\t\t(0, util_1.checkStrictMode)(it, `\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (max !== void 0 && min > max) {\n\t\t\t\t(0, util_1.checkStrictMode)(it, `\"minContains\" > \"maxContains\" is always invalid`);\n\t\t\t\tcxt.fail();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\tlet cond = (0, codegen_1._)`${len} >= ${min}`;\n\t\t\t\tif (max !== void 0) cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;\n\t\t\t\tcxt.pass(cond);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tit.items = true;\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tif (max === void 0 && min === 1) validateItems(valid, () => gen.if(valid, () => gen.break()));\n\t\t\telse if (min === 0) {\n\t\t\t\tgen.let(valid, true);\n\t\t\t\tif (max !== void 0) gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount);\n\t\t\t} else {\n\t\t\t\tgen.let(valid, false);\n\t\t\t\tvalidateItemsWithCount();\n\t\t\t}\n\t\t\tcxt.result(valid, () => cxt.reset());\n\t\t\tfunction validateItemsWithCount() {\n\t\t\t\tconst schValid = gen.name(\"_valid\");\n\t\t\t\tconst count = gen.let(\"count\", 0);\n\t\t\t\tvalidateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));\n\t\t\t}\n\t\t\tfunction validateItems(_valid, block) {\n\t\t\t\tgen.forRange(\"i\", 0, len, (i) => {\n\t\t\t\t\tcxt.subschema({\n\t\t\t\t\t\tkeyword: \"contains\",\n\t\t\t\t\t\tdataProp: i,\n\t\t\t\t\t\tdataPropType: util_1.Type.Num,\n\t\t\t\t\t\tcompositeRule: true\n\t\t\t\t\t}, _valid);\n\t\t\t\t\tblock();\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction checkLimits(count) {\n\t\t\t\tgen.code((0, codegen_1._)`${count}++`);\n\t\t\t\tif (max === void 0) gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());\n\t\t\t\telse {\n\t\t\t\t\tgen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());\n\t\t\t\t\tif (min === 1) gen.assign(valid, true);\n\t\t\t\t\telse gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js\nvar require_dependencies = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst code_1 = require_code();\n\texports.error = {\n\t\tmessage: ({ params: { property, depsCount, deps } }) => {\n\t\t\tconst property_ies = depsCount === 1 ? \"property\" : \"properties\";\n\t\t\treturn (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`;\n\t\t},\n\t\tparams: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},\n    missingProperty: ${missingProperty},\n    depsCount: ${depsCount},\n    deps: ${deps}}`\n\t};\n\tconst def = {\n\t\tkeyword: \"dependencies\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\terror: exports.error,\n\t\tcode(cxt) {\n\t\t\tconst [propDeps, schDeps] = splitDependencies(cxt);\n\t\t\tvalidatePropertyDeps(cxt, propDeps);\n\t\t\tvalidateSchemaDeps(cxt, schDeps);\n\t\t}\n\t};\n\tfunction splitDependencies({ schema }) {\n\t\tconst propertyDeps = {};\n\t\tconst schemaDeps = {};\n\t\tfor (const key in schema) {\n\t\t\tif (key === \"__proto__\") continue;\n\t\t\tconst deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;\n\t\t\tdeps[key] = schema[key];\n\t\t}\n\t\treturn [propertyDeps, schemaDeps];\n\t}\n\tfunction validatePropertyDeps(cxt, propertyDeps = cxt.schema) {\n\t\tconst { gen, data, it } = cxt;\n\t\tif (Object.keys(propertyDeps).length === 0) return;\n\t\tconst missing = gen.let(\"missing\");\n\t\tfor (const prop in propertyDeps) {\n\t\t\tconst deps = propertyDeps[prop];\n\t\t\tif (deps.length === 0) continue;\n\t\t\tconst hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);\n\t\t\tcxt.setParams({\n\t\t\t\tproperty: prop,\n\t\t\t\tdepsCount: deps.length,\n\t\t\t\tdeps: deps.join(\", \")\n\t\t\t});\n\t\t\tif (it.allErrors) gen.if(hasProperty, () => {\n\t\t\t\tfor (const depProp of deps) (0, code_1.checkReportMissingProp)(cxt, depProp);\n\t\t\t});\n\t\t\telse {\n\t\t\t\tgen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);\n\t\t\t\t(0, code_1.reportMissingProp)(cxt, missing);\n\t\t\t\tgen.else();\n\t\t\t}\n\t\t}\n\t}\n\texports.validatePropertyDeps = validatePropertyDeps;\n\tfunction validateSchemaDeps(cxt, schemaDeps = cxt.schema) {\n\t\tconst { gen, data, keyword, it } = cxt;\n\t\tconst valid = gen.name(\"valid\");\n\t\tfor (const prop in schemaDeps) {\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) continue;\n\t\t\tgen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tkeyword,\n\t\t\t\t\tschemaProp: prop\n\t\t\t\t}, valid);\n\t\t\t\tcxt.mergeValidEvaluated(schCxt, valid);\n\t\t\t}, () => gen.var(valid, true));\n\t\t\tcxt.ok(valid);\n\t\t}\n\t}\n\texports.validateSchemaDeps = validateSchemaDeps;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js\nvar require_propertyNames = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"propertyNames\",\n\t\ttype: \"object\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\terror: {\n\t\t\tmessage: \"property name must be valid\",\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, data, it } = cxt;\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) return;\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tgen.forIn(\"key\", data, (key) => {\n\t\t\t\tcxt.setParams({ propertyName: key });\n\t\t\t\tcxt.subschema({\n\t\t\t\t\tkeyword: \"propertyNames\",\n\t\t\t\t\tdata: key,\n\t\t\t\t\tdataTypes: [\"string\"],\n\t\t\t\t\tpropertyName: key,\n\t\t\t\t\tcompositeRule: true\n\t\t\t\t}, valid);\n\t\t\t\tgen.if((0, codegen_1.not)(valid), () => {\n\t\t\t\t\tcxt.error(true);\n\t\t\t\t\tif (!it.allErrors) gen.break();\n\t\t\t\t});\n\t\t\t});\n\t\t\tcxt.ok(valid);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js\nvar require_additionalProperties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst code_1 = require_code();\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"additionalProperties\",\n\t\ttype: [\"object\"],\n\t\tschemaType: [\"boolean\", \"object\"],\n\t\tallowUndefined: true,\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: \"must NOT have additional properties\",\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, parentSchema, data, errsCount, it } = cxt;\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!errsCount) throw new Error(\"ajv implementation error\");\n\t\t\tconst { allErrors, opts } = it;\n\t\t\tit.props = true;\n\t\t\tif (opts.removeAdditional !== \"all\" && (0, util_1.alwaysValidSchema)(it, schema)) return;\n\t\t\tconst props = (0, code_1.allSchemaProperties)(parentSchema.properties);\n\t\t\tconst patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);\n\t\t\tcheckAdditionalProperties();\n\t\t\tcxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);\n\t\t\tfunction checkAdditionalProperties() {\n\t\t\t\tgen.forIn(\"key\", data, (key) => {\n\t\t\t\t\tif (!props.length && !patProps.length) additionalPropertyCode(key);\n\t\t\t\t\telse gen.if(isAdditional(key), () => additionalPropertyCode(key));\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction isAdditional(key) {\n\t\t\t\tlet definedProp;\n\t\t\t\tif (props.length > 8) {\n\t\t\t\t\tconst propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, \"properties\");\n\t\t\t\t\tdefinedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);\n\t\t\t\t} else if (props.length) definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));\n\t\t\t\telse definedProp = codegen_1.nil;\n\t\t\t\tif (patProps.length) definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));\n\t\t\t\treturn (0, codegen_1.not)(definedProp);\n\t\t\t}\n\t\t\tfunction deleteAdditional(key) {\n\t\t\t\tgen.code((0, codegen_1._)`delete ${data}[${key}]`);\n\t\t\t}\n\t\t\tfunction additionalPropertyCode(key) {\n\t\t\t\tif (opts.removeAdditional === \"all\" || opts.removeAdditional && schema === false) {\n\t\t\t\t\tdeleteAdditional(key);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (schema === false) {\n\t\t\t\t\tcxt.setParams({ additionalProperty: key });\n\t\t\t\t\tcxt.error();\n\t\t\t\t\tif (!allErrors) gen.break();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\t\tconst valid = gen.name(\"valid\");\n\t\t\t\t\tif (opts.removeAdditional === \"failing\") {\n\t\t\t\t\t\tapplyAdditionalSchema(key, valid, false);\n\t\t\t\t\t\tgen.if((0, codegen_1.not)(valid), () => {\n\t\t\t\t\t\t\tcxt.reset();\n\t\t\t\t\t\t\tdeleteAdditional(key);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tapplyAdditionalSchema(key, valid);\n\t\t\t\t\t\tif (!allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction applyAdditionalSchema(key, valid, errors) {\n\t\t\t\tconst subschema = {\n\t\t\t\t\tkeyword: \"additionalProperties\",\n\t\t\t\t\tdataProp: key,\n\t\t\t\t\tdataPropType: util_1.Type.Str\n\t\t\t\t};\n\t\t\t\tif (errors === false) Object.assign(subschema, {\n\t\t\t\t\tcompositeRule: true,\n\t\t\t\t\tcreateErrors: false,\n\t\t\t\t\tallErrors: false\n\t\t\t\t});\n\t\t\t\tcxt.subschema(subschema, valid);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js\nvar require_properties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst validate_1 = require_validate();\n\tconst code_1 = require_code();\n\tconst util_1 = require_util();\n\tconst additionalProperties_1 = require_additionalProperties();\n\tconst def = {\n\t\tkeyword: \"properties\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, parentSchema, data, it } = cxt;\n\t\t\tif (it.opts.removeAdditional === \"all\" && parentSchema.additionalProperties === void 0) additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, \"additionalProperties\"));\n\t\t\tconst allProps = (0, code_1.allSchemaProperties)(schema);\n\t\t\tfor (const prop of allProps) it.definedProperties.add(prop);\n\t\t\tif (it.opts.unevaluated && allProps.length && it.props !== true) it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);\n\t\t\tconst properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));\n\t\t\tif (properties.length === 0) return;\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tfor (const prop of properties) {\n\t\t\t\tif (hasDefault(prop)) applyPropertySchema(prop);\n\t\t\t\telse {\n\t\t\t\t\tgen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));\n\t\t\t\t\tapplyPropertySchema(prop);\n\t\t\t\t\tif (!it.allErrors) gen.else().var(valid, true);\n\t\t\t\t\tgen.endIf();\n\t\t\t\t}\n\t\t\t\tcxt.it.definedProperties.add(prop);\n\t\t\t\tcxt.ok(valid);\n\t\t\t}\n\t\t\tfunction hasDefault(prop) {\n\t\t\t\treturn it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;\n\t\t\t}\n\t\t\tfunction applyPropertySchema(prop) {\n\t\t\t\tcxt.subschema({\n\t\t\t\t\tkeyword: \"properties\",\n\t\t\t\t\tschemaProp: prop,\n\t\t\t\t\tdataProp: prop\n\t\t\t\t}, valid);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js\nvar require_patternProperties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst code_1 = require_code();\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst util_2 = require_util();\n\tconst def = {\n\t\tkeyword: \"patternProperties\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, data, parentSchema, it } = cxt;\n\t\t\tconst { opts } = it;\n\t\t\tconst patterns = (0, code_1.allSchemaProperties)(schema);\n\t\t\tconst alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));\n\t\t\tif (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) return;\n\t\t\tconst checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tif (it.props !== true && !(it.props instanceof codegen_1.Name)) it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);\n\t\t\tconst { props } = it;\n\t\t\tvalidatePatternProperties();\n\t\t\tfunction validatePatternProperties() {\n\t\t\t\tfor (const pat of patterns) {\n\t\t\t\t\tif (checkProperties) checkMatchingProperties(pat);\n\t\t\t\t\tif (it.allErrors) validateProperties(pat);\n\t\t\t\t\telse {\n\t\t\t\t\t\tgen.var(valid, true);\n\t\t\t\t\t\tvalidateProperties(pat);\n\t\t\t\t\t\tgen.if(valid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction checkMatchingProperties(pat) {\n\t\t\t\tfor (const prop in checkProperties) if (new RegExp(pat).test(prop)) (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);\n\t\t\t}\n\t\t\tfunction validateProperties(pat) {\n\t\t\t\tgen.forIn(\"key\", data, (key) => {\n\t\t\t\t\tgen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {\n\t\t\t\t\t\tconst alwaysValid = alwaysValidPatterns.includes(pat);\n\t\t\t\t\t\tif (!alwaysValid) cxt.subschema({\n\t\t\t\t\t\t\tkeyword: \"patternProperties\",\n\t\t\t\t\t\t\tschemaProp: pat,\n\t\t\t\t\t\t\tdataProp: key,\n\t\t\t\t\t\t\tdataPropType: util_2.Type.Str\n\t\t\t\t\t\t}, valid);\n\t\t\t\t\t\tif (it.opts.unevaluated && props !== true) gen.assign((0, codegen_1._)`${props}[${key}]`, true);\n\t\t\t\t\t\telse if (!alwaysValid && !it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js\nvar require_not = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"not\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\ttrackErrors: true,\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, it } = cxt;\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\tcxt.fail();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tcxt.subschema({\n\t\t\t\tkeyword: \"not\",\n\t\t\t\tcompositeRule: true,\n\t\t\t\tcreateErrors: false,\n\t\t\t\tallErrors: false\n\t\t\t}, valid);\n\t\t\tcxt.failResult(valid, () => cxt.reset(), () => cxt.error());\n\t\t},\n\t\terror: { message: \"must NOT be valid\" }\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js\nvar require_anyOf = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst def = {\n\t\tkeyword: \"anyOf\",\n\t\tschemaType: \"array\",\n\t\ttrackErrors: true,\n\t\tcode: require_code().validateUnion,\n\t\terror: { message: \"must match a schema in anyOf\" }\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js\nvar require_oneOf = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"oneOf\",\n\t\tschemaType: \"array\",\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: \"must match exactly one schema in oneOf\",\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, parentSchema, it } = cxt;\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!Array.isArray(schema)) throw new Error(\"ajv implementation error\");\n\t\t\tif (it.opts.discriminator && parentSchema.discriminator) return;\n\t\t\tconst schArr = schema;\n\t\t\tconst valid = gen.let(\"valid\", false);\n\t\t\tconst passing = gen.let(\"passing\", null);\n\t\t\tconst schValid = gen.name(\"_valid\");\n\t\t\tcxt.setParams({ passing });\n\t\t\tgen.block(validateOneOf);\n\t\t\tcxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n\t\t\tfunction validateOneOf() {\n\t\t\t\tschArr.forEach((sch, i) => {\n\t\t\t\t\tlet schCxt;\n\t\t\t\t\tif ((0, util_1.alwaysValidSchema)(it, sch)) gen.var(schValid, true);\n\t\t\t\t\telse schCxt = cxt.subschema({\n\t\t\t\t\t\tkeyword: \"oneOf\",\n\t\t\t\t\t\tschemaProp: i,\n\t\t\t\t\t\tcompositeRule: true\n\t\t\t\t\t}, schValid);\n\t\t\t\t\tif (i > 0) gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else();\n\t\t\t\t\tgen.if(schValid, () => {\n\t\t\t\t\t\tgen.assign(valid, true);\n\t\t\t\t\t\tgen.assign(passing, i);\n\t\t\t\t\t\tif (schCxt) cxt.mergeEvaluated(schCxt, codegen_1.Name);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js\nvar require_allOf = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"allOf\",\n\t\tschemaType: \"array\",\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, it } = cxt;\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!Array.isArray(schema)) throw new Error(\"ajv implementation error\");\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tschema.forEach((sch, i) => {\n\t\t\t\tif ((0, util_1.alwaysValidSchema)(it, sch)) return;\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tkeyword: \"allOf\",\n\t\t\t\t\tschemaProp: i\n\t\t\t\t}, valid);\n\t\t\t\tcxt.ok(valid);\n\t\t\t\tcxt.mergeEvaluated(schCxt);\n\t\t\t});\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js\nvar require_if = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"if\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: ({ params }) => (0, codegen_1.str)`must match \"${params.ifClause}\" schema`,\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, parentSchema, it } = cxt;\n\t\t\tif (parentSchema.then === void 0 && parentSchema.else === void 0) (0, util_1.checkStrictMode)(it, \"\\\"if\\\" without \\\"then\\\" and \\\"else\\\" is ignored\");\n\t\t\tconst hasThen = hasSchema(it, \"then\");\n\t\t\tconst hasElse = hasSchema(it, \"else\");\n\t\t\tif (!hasThen && !hasElse) return;\n\t\t\tconst valid = gen.let(\"valid\", true);\n\t\t\tconst schValid = gen.name(\"_valid\");\n\t\t\tvalidateIf();\n\t\t\tcxt.reset();\n\t\t\tif (hasThen && hasElse) {\n\t\t\t\tconst ifClause = gen.let(\"ifClause\");\n\t\t\t\tcxt.setParams({ ifClause });\n\t\t\t\tgen.if(schValid, validateClause(\"then\", ifClause), validateClause(\"else\", ifClause));\n\t\t\t} else if (hasThen) gen.if(schValid, validateClause(\"then\"));\n\t\t\telse gen.if((0, codegen_1.not)(schValid), validateClause(\"else\"));\n\t\t\tcxt.pass(valid, () => cxt.error(true));\n\t\t\tfunction validateIf() {\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tkeyword: \"if\",\n\t\t\t\t\tcompositeRule: true,\n\t\t\t\t\tcreateErrors: false,\n\t\t\t\t\tallErrors: false\n\t\t\t\t}, schValid);\n\t\t\t\tcxt.mergeEvaluated(schCxt);\n\t\t\t}\n\t\t\tfunction validateClause(keyword, ifClause) {\n\t\t\t\treturn () => {\n\t\t\t\t\tconst schCxt = cxt.subschema({ keyword }, schValid);\n\t\t\t\t\tgen.assign(valid, schValid);\n\t\t\t\t\tcxt.mergeValidEvaluated(schCxt, valid);\n\t\t\t\t\tif (ifClause) gen.assign(ifClause, (0, codegen_1._)`${keyword}`);\n\t\t\t\t\telse cxt.setParams({ ifClause: keyword });\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n\tfunction hasSchema(it, keyword) {\n\t\tconst schema = it.schema[keyword];\n\t\treturn schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema);\n\t}\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js\nvar require_thenElse = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: [\"then\", \"else\"],\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\tcode({ keyword, parentSchema, it }) {\n\t\t\tif (parentSchema.if === void 0) (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"if\" is ignored`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js\nvar require_applicator$2 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst additionalItems_1 = require_additionalItems();\n\tconst prefixItems_1 = require_prefixItems();\n\tconst items_1 = require_items();\n\tconst items2020_1 = require_items2020();\n\tconst contains_1 = require_contains();\n\tconst dependencies_1 = require_dependencies();\n\tconst propertyNames_1 = require_propertyNames();\n\tconst additionalProperties_1 = require_additionalProperties();\n\tconst properties_1 = require_properties();\n\tconst patternProperties_1 = require_patternProperties();\n\tconst not_1 = require_not();\n\tconst anyOf_1 = require_anyOf();\n\tconst oneOf_1 = require_oneOf();\n\tconst allOf_1 = require_allOf();\n\tconst if_1 = require_if();\n\tconst thenElse_1 = require_thenElse();\n\tfunction getApplicator(draft2020 = false) {\n\t\tconst applicator = [\n\t\t\tnot_1.default,\n\t\t\tanyOf_1.default,\n\t\t\toneOf_1.default,\n\t\t\tallOf_1.default,\n\t\t\tif_1.default,\n\t\t\tthenElse_1.default,\n\t\t\tpropertyNames_1.default,\n\t\t\tadditionalProperties_1.default,\n\t\t\tdependencies_1.default,\n\t\t\tproperties_1.default,\n\t\t\tpatternProperties_1.default\n\t\t];\n\t\tif (draft2020) applicator.push(prefixItems_1.default, items2020_1.default);\n\t\telse applicator.push(additionalItems_1.default, items_1.default);\n\t\tapplicator.push(contains_1.default);\n\t\treturn applicator;\n\t}\n\texports.default = getApplicator;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js\nvar require_format$2 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: \"format\",\n\t\ttype: [\"number\", \"string\"],\n\t\tschemaType: \"string\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ schemaCode }) => (0, codegen_1.str)`must match format \"${schemaCode}\"`,\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt, ruleType) {\n\t\t\tconst { gen, data, $data, schema, schemaCode, it } = cxt;\n\t\t\tconst { opts, errSchemaPath, schemaEnv, self } = it;\n\t\t\tif (!opts.validateFormats) return;\n\t\t\tif ($data) validate$DataFormat();\n\t\t\telse validateFormat();\n\t\t\tfunction validate$DataFormat() {\n\t\t\t\tconst fmts = gen.scopeValue(\"formats\", {\n\t\t\t\t\tref: self.formats,\n\t\t\t\t\tcode: opts.code.formats\n\t\t\t\t});\n\t\t\t\tconst fDef = gen.const(\"fDef\", (0, codegen_1._)`${fmts}[${schemaCode}]`);\n\t\t\t\tconst fType = gen.let(\"fType\");\n\t\t\t\tconst format = gen.let(\"format\");\n\t\t\t\tgen.if((0, codegen_1._)`typeof ${fDef} == \"object\" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || \"string\"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`\"string\"`).assign(format, fDef));\n\t\t\t\tcxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));\n\t\t\t\tfunction unknownFmt() {\n\t\t\t\t\tif (opts.strictSchema === false) return codegen_1.nil;\n\t\t\t\t\treturn (0, codegen_1._)`${schemaCode} && !${format}`;\n\t\t\t\t}\n\t\t\t\tfunction invalidFmt() {\n\t\t\t\t\tconst callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;\n\t\t\t\t\tconst validData = (0, codegen_1._)`(typeof ${format} == \"function\" ? ${callFormat} : ${format}.test(${data}))`;\n\t\t\t\t\treturn (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction validateFormat() {\n\t\t\t\tconst formatDef = self.formats[schema];\n\t\t\t\tif (!formatDef) {\n\t\t\t\t\tunknownFormat();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (formatDef === true) return;\n\t\t\t\tconst [fmtType, format, fmtRef] = getFormat(formatDef);\n\t\t\t\tif (fmtType === ruleType) cxt.pass(validCondition());\n\t\t\t\tfunction unknownFormat() {\n\t\t\t\t\tif (opts.strictSchema === false) {\n\t\t\t\t\t\tself.logger.warn(unknownMsg());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthrow new Error(unknownMsg());\n\t\t\t\t\tfunction unknownMsg() {\n\t\t\t\t\t\treturn `unknown format \"${schema}\" ignored in schema at path \"${errSchemaPath}\"`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfunction getFormat(fmtDef) {\n\t\t\t\t\tconst code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;\n\t\t\t\t\tconst fmt = gen.scopeValue(\"formats\", {\n\t\t\t\t\t\tkey: schema,\n\t\t\t\t\t\tref: fmtDef,\n\t\t\t\t\t\tcode\n\t\t\t\t\t});\n\t\t\t\t\tif (typeof fmtDef == \"object\" && !(fmtDef instanceof RegExp)) return [\n\t\t\t\t\t\tfmtDef.type || \"string\",\n\t\t\t\t\t\tfmtDef.validate,\n\t\t\t\t\t\t(0, codegen_1._)`${fmt}.validate`\n\t\t\t\t\t];\n\t\t\t\t\treturn [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\tfmtDef,\n\t\t\t\t\t\tfmt\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\tfunction validCondition() {\n\t\t\t\t\tif (typeof formatDef == \"object\" && !(formatDef instanceof RegExp) && formatDef.async) {\n\t\t\t\t\t\tif (!schemaEnv.$async) throw new Error(\"async format in sync schema\");\n\t\t\t\t\t\treturn (0, codegen_1._)`await ${fmtRef}(${data})`;\n\t\t\t\t\t}\n\t\t\t\t\treturn typeof format == \"function\" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js\nvar require_format$1 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst format = [require_format$2().default];\n\texports.default = format;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js\nvar require_metadata = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.contentVocabulary = exports.metadataVocabulary = void 0;\n\texports.metadataVocabulary = [\n\t\t\"title\",\n\t\t\"description\",\n\t\t\"default\",\n\t\t\"deprecated\",\n\t\t\"readOnly\",\n\t\t\"writeOnly\",\n\t\t\"examples\"\n\t];\n\texports.contentVocabulary = [\n\t\t\"contentMediaType\",\n\t\t\"contentEncoding\",\n\t\t\"contentSchema\"\n\t];\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js\nvar require_draft7 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst core_1 = require_core$2();\n\tconst validation_1 = require_validation$2();\n\tconst applicator_1 = require_applicator$2();\n\tconst format_1 = require_format$1();\n\tconst metadata_1 = require_metadata();\n\tconst draft7Vocabularies = [\n\t\tcore_1.default,\n\t\tvalidation_1.default,\n\t\t(0, applicator_1.default)(),\n\t\tformat_1.default,\n\t\tmetadata_1.metadataVocabulary,\n\t\tmetadata_1.contentVocabulary\n\t];\n\texports.default = draft7Vocabularies;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js\nvar require_types = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.DiscrError = void 0;\n\tvar DiscrError;\n\t(function(DiscrError) {\n\t\tDiscrError[\"Tag\"] = \"tag\";\n\t\tDiscrError[\"Mapping\"] = \"mapping\";\n\t})(DiscrError || (exports.DiscrError = DiscrError = {}));\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js\nvar require_discriminator = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst types_1 = require_types();\n\tconst compile_1 = require_compile();\n\tconst ref_error_1 = require_ref_error();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"discriminator\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\terror: {\n\t\t\tmessage: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag \"${tagName}\" must be string` : `value of tag \"${tagName}\" must be in oneOf`,\n\t\t\tparams: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, schema, parentSchema, it } = cxt;\n\t\t\tconst { oneOf } = parentSchema;\n\t\t\tif (!it.opts.discriminator) throw new Error(\"discriminator: requires discriminator option\");\n\t\t\tconst tagName = schema.propertyName;\n\t\t\tif (typeof tagName != \"string\") throw new Error(\"discriminator: requires propertyName\");\n\t\t\tif (schema.mapping) throw new Error(\"discriminator: mapping is not supported\");\n\t\t\tif (!oneOf) throw new Error(\"discriminator: requires oneOf keyword\");\n\t\t\tconst valid = gen.let(\"valid\", false);\n\t\t\tconst tag = gen.const(\"tag\", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);\n\t\t\tgen.if((0, codegen_1._)`typeof ${tag} == \"string\"`, () => validateMapping(), () => cxt.error(false, {\n\t\t\t\tdiscrError: types_1.DiscrError.Tag,\n\t\t\t\ttag,\n\t\t\t\ttagName\n\t\t\t}));\n\t\t\tcxt.ok(valid);\n\t\t\tfunction validateMapping() {\n\t\t\t\tconst mapping = getMapping();\n\t\t\t\tgen.if(false);\n\t\t\t\tfor (const tagValue in mapping) {\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);\n\t\t\t\t\tgen.assign(valid, applyTagSchema(mapping[tagValue]));\n\t\t\t\t}\n\t\t\t\tgen.else();\n\t\t\t\tcxt.error(false, {\n\t\t\t\t\tdiscrError: types_1.DiscrError.Mapping,\n\t\t\t\t\ttag,\n\t\t\t\t\ttagName\n\t\t\t\t});\n\t\t\t\tgen.endIf();\n\t\t\t}\n\t\t\tfunction applyTagSchema(schemaProp) {\n\t\t\t\tconst _valid = gen.name(\"valid\");\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tkeyword: \"oneOf\",\n\t\t\t\t\tschemaProp\n\t\t\t\t}, _valid);\n\t\t\t\tcxt.mergeEvaluated(schCxt, codegen_1.Name);\n\t\t\t\treturn _valid;\n\t\t\t}\n\t\t\tfunction getMapping() {\n\t\t\t\tvar _a;\n\t\t\t\tconst oneOfMapping = {};\n\t\t\t\tconst topRequired = hasRequired(parentSchema);\n\t\t\t\tlet tagRequired = true;\n\t\t\t\tfor (let i = 0; i < oneOf.length; i++) {\n\t\t\t\t\tlet sch = oneOf[i];\n\t\t\t\t\tif ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {\n\t\t\t\t\t\tconst ref = sch.$ref;\n\t\t\t\t\t\tsch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);\n\t\t\t\t\t\tif (sch instanceof compile_1.SchemaEnv) sch = sch.schema;\n\t\t\t\t\t\tif (sch === void 0) throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);\n\t\t\t\t\t}\n\t\t\t\t\tconst propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];\n\t\t\t\t\tif (typeof propSch != \"object\") throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have \"properties/${tagName}\"`);\n\t\t\t\t\ttagRequired = tagRequired && (topRequired || hasRequired(sch));\n\t\t\t\t\taddMappings(propSch, i);\n\t\t\t\t}\n\t\t\t\tif (!tagRequired) throw new Error(`discriminator: \"${tagName}\" must be required`);\n\t\t\t\treturn oneOfMapping;\n\t\t\t\tfunction hasRequired({ required }) {\n\t\t\t\t\treturn Array.isArray(required) && required.includes(tagName);\n\t\t\t\t}\n\t\t\t\tfunction addMappings(sch, i) {\n\t\t\t\t\tif (sch.const) addMapping(sch.const, i);\n\t\t\t\t\telse if (sch.enum) for (const tagValue of sch.enum) addMapping(tagValue, i);\n\t\t\t\t\telse throw new Error(`discriminator: \"properties/${tagName}\" must have \"const\" or \"enum\"`);\n\t\t\t\t}\n\t\t\t\tfunction addMapping(tagValue, i) {\n\t\t\t\t\tif (typeof tagValue != \"string\" || tagValue in oneOfMapping) throw new Error(`discriminator: \"${tagName}\" values must be unique strings`);\n\t\t\t\t\toneOfMapping[tagValue] = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json\nvar require_json_schema_draft_07 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\t\t\"$id\": \"http://json-schema.org/draft-07/schema#\",\n\t\t\"title\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": { \"$ref\": \"#\" }\n\t\t\t},\n\t\t\t\"nonNegativeInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"nonNegativeIntegerDefault0\": { \"allOf\": [{ \"$ref\": \"#/definitions/nonNegativeInteger\" }, { \"default\": 0 }] },\n\t\t\t\"simpleTypes\": { \"enum\": [\n\t\t\t\t\"array\",\n\t\t\t\t\"boolean\",\n\t\t\t\t\"integer\",\n\t\t\t\t\"null\",\n\t\t\t\t\"number\",\n\t\t\t\t\"object\",\n\t\t\t\t\"string\"\n\t\t\t] },\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"type\": \"string\" },\n\t\t\t\t\"uniqueItems\": true,\n\t\t\t\t\"default\": []\n\t\t\t}\n\t\t},\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"$id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$ref\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t},\n\t\t\t\"$comment\": { \"type\": \"string\" },\n\t\t\t\"title\": { \"type\": \"string\" },\n\t\t\t\"description\": { \"type\": \"string\" },\n\t\t\t\"default\": true,\n\t\t\t\"readOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"examples\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"exclusiveMinimum\": 0\n\t\t\t},\n\t\t\t\"maximum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMaximum\": { \"type\": \"number\" },\n\t\t\t\"minimum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMinimum\": { \"type\": \"number\" },\n\t\t\t\"maxLength\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n\t\t\t\"minLength\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": { \"$ref\": \"#\" },\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [{ \"$ref\": \"#\" }, { \"$ref\": \"#/definitions/schemaArray\" }],\n\t\t\t\t\"default\": true\n\t\t\t},\n\t\t\t\"maxItems\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n\t\t\t\"minItems\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"contains\": { \"$ref\": \"#\" },\n\t\t\t\"maxProperties\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n\t\t\t\"minProperties\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n\t\t\t\"required\": { \"$ref\": \"#/definitions/stringArray\" },\n\t\t\t\"additionalProperties\": { \"$ref\": \"#\" },\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#\" },\n\t\t\t\t\"propertyNames\": { \"format\": \"regex\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"anyOf\": [{ \"$ref\": \"#\" }, { \"$ref\": \"#/definitions/stringArray\" }] }\n\t\t\t},\n\t\t\t\"propertyNames\": { \"$ref\": \"#\" },\n\t\t\t\"const\": true,\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true,\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": { \"anyOf\": [{ \"$ref\": \"#/definitions/simpleTypes\" }, {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"$ref\": \"#/definitions/simpleTypes\" },\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}] },\n\t\t\t\"format\": { \"type\": \"string\" },\n\t\t\t\"contentMediaType\": { \"type\": \"string\" },\n\t\t\t\"contentEncoding\": { \"type\": \"string\" },\n\t\t\t\"if\": { \"$ref\": \"#\" },\n\t\t\t\"then\": { \"$ref\": \"#\" },\n\t\t\t\"else\": { \"$ref\": \"#\" },\n\t\t\t\"allOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n\t\t\t\"anyOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n\t\t\t\"oneOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n\t\t\t\"not\": { \"$ref\": \"#\" }\n\t\t},\n\t\t\"default\": true\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js\nvar require_ajv = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;\n\tconst core_1 = require_core$3();\n\tconst draft7_1 = require_draft7();\n\tconst discriminator_1 = require_discriminator();\n\tconst draft7MetaSchema = require_json_schema_draft_07();\n\tconst META_SUPPORT_DATA = [\"/properties\"];\n\tconst META_SCHEMA_ID = \"http://json-schema.org/draft-07/schema\";\n\tvar Ajv = class extends core_1.default {\n\t\t_addVocabularies() {\n\t\t\tsuper._addVocabularies();\n\t\t\tdraft7_1.default.forEach((v) => this.addVocabulary(v));\n\t\t\tif (this.opts.discriminator) this.addKeyword(discriminator_1.default);\n\t\t}\n\t\t_addDefaultMetaSchema() {\n\t\t\tsuper._addDefaultMetaSchema();\n\t\t\tif (!this.opts.meta) return;\n\t\t\tconst metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema;\n\t\t\tthis.addMetaSchema(metaSchema, META_SCHEMA_ID, false);\n\t\t\tthis.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n\t\t}\n\t\tdefaultMeta() {\n\t\t\treturn this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);\n\t\t}\n\t};\n\texports.Ajv = Ajv;\n\tmodule.exports = exports = Ajv;\n\tmodule.exports.Ajv = Ajv;\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Ajv;\n\tvar validate_1 = require_validate();\n\tObject.defineProperty(exports, \"KeywordCxt\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validate_1.KeywordCxt;\n\t\t}\n\t});\n\tvar codegen_1 = require_codegen();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.Name;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"CodeGen\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.CodeGen;\n\t\t}\n\t});\n\tvar validation_error_1 = require_validation_error();\n\tObject.defineProperty(exports, \"ValidationError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validation_error_1.default;\n\t\t}\n\t});\n\tvar ref_error_1 = require_ref_error();\n\tObject.defineProperty(exports, \"MissingRefError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn ref_error_1.default;\n\t\t}\n\t});\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js\nvar require_dynamicAnchor = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.dynamicAnchor = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst compile_1 = require_compile();\n\tconst ref_1 = require_ref();\n\tconst def = {\n\t\tkeyword: \"$dynamicAnchor\",\n\t\tschemaType: \"string\",\n\t\tcode: (cxt) => dynamicAnchor(cxt, cxt.schema)\n\t};\n\tfunction dynamicAnchor(cxt, anchor) {\n\t\tconst { gen, it } = cxt;\n\t\tit.schemaEnv.root.dynamicAnchors[anchor] = true;\n\t\tconst v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;\n\t\tconst validate = it.errSchemaPath === \"#\" ? it.validateName : _getValidate(cxt);\n\t\tgen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));\n\t}\n\texports.dynamicAnchor = dynamicAnchor;\n\tfunction _getValidate(cxt) {\n\t\tconst { schemaEnv, schema, self } = cxt.it;\n\t\tconst { root, baseId, localRefs, meta } = schemaEnv.root;\n\t\tconst { schemaId } = self.opts;\n\t\tconst sch = new compile_1.SchemaEnv({\n\t\t\tschema,\n\t\t\tschemaId,\n\t\t\troot,\n\t\t\tbaseId,\n\t\t\tlocalRefs,\n\t\t\tmeta\n\t\t});\n\t\tcompile_1.compileSchema.call(self, sch);\n\t\treturn (0, ref_1.getValidate)(cxt, sch);\n\t}\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js\nvar require_dynamicRef = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.dynamicRef = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst ref_1 = require_ref();\n\tconst def = {\n\t\tkeyword: \"$dynamicRef\",\n\t\tschemaType: \"string\",\n\t\tcode: (cxt) => dynamicRef(cxt, cxt.schema)\n\t};\n\tfunction dynamicRef(cxt, ref) {\n\t\tconst { gen, keyword, it } = cxt;\n\t\tif (ref[0] !== \"#\") throw new Error(`\"${keyword}\" only supports hash fragment reference`);\n\t\tconst anchor = ref.slice(1);\n\t\tif (it.allErrors) _dynamicRef();\n\t\telse {\n\t\t\tconst valid = gen.let(\"valid\", false);\n\t\t\t_dynamicRef(valid);\n\t\t\tcxt.ok(valid);\n\t\t}\n\t\tfunction _dynamicRef(valid) {\n\t\t\tif (it.schemaEnv.root.dynamicAnchors[anchor]) {\n\t\t\t\tconst v = gen.let(\"_v\", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);\n\t\t\t\tgen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));\n\t\t\t} else _callRef(it.validateName, valid)();\n\t\t}\n\t\tfunction _callRef(validate, valid) {\n\t\t\treturn valid ? () => gen.block(() => {\n\t\t\t\t(0, ref_1.callRef)(cxt, validate);\n\t\t\t\tgen.let(valid, true);\n\t\t\t}) : () => (0, ref_1.callRef)(cxt, validate);\n\t\t}\n\t}\n\texports.dynamicRef = dynamicRef;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js\nvar require_recursiveAnchor = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dynamicAnchor_1 = require_dynamicAnchor();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"$recursiveAnchor\",\n\t\tschemaType: \"boolean\",\n\t\tcode(cxt) {\n\t\t\tif (cxt.schema) (0, dynamicAnchor_1.dynamicAnchor)(cxt, \"\");\n\t\t\telse (0, util_1.checkStrictMode)(cxt.it, \"$recursiveAnchor: false is ignored\");\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js\nvar require_recursiveRef = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dynamicRef_1 = require_dynamicRef();\n\tconst def = {\n\t\tkeyword: \"$recursiveRef\",\n\t\tschemaType: \"string\",\n\t\tcode: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/index.js\nvar require_dynamic = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dynamicAnchor_1 = require_dynamicAnchor();\n\tconst dynamicRef_1 = require_dynamicRef();\n\tconst recursiveAnchor_1 = require_recursiveAnchor();\n\tconst recursiveRef_1 = require_recursiveRef();\n\tconst dynamic = [\n\t\tdynamicAnchor_1.default,\n\t\tdynamicRef_1.default,\n\t\trecursiveAnchor_1.default,\n\t\trecursiveRef_1.default\n\t];\n\texports.default = dynamic;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js\nvar require_dependentRequired = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dependencies_1 = require_dependencies();\n\tconst def = {\n\t\tkeyword: \"dependentRequired\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\terror: dependencies_1.error,\n\t\tcode: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js\nvar require_dependentSchemas = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dependencies_1 = require_dependencies();\n\tconst def = {\n\t\tkeyword: \"dependentSchemas\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\tcode: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt)\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js\nvar require_limitContains = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: [\"maxContains\", \"minContains\"],\n\t\ttype: \"array\",\n\t\tschemaType: \"number\",\n\t\tcode({ keyword, parentSchema, it }) {\n\t\t\tif (parentSchema.contains === void 0) (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"contains\" is ignored`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/next.js\nvar require_next = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dependentRequired_1 = require_dependentRequired();\n\tconst dependentSchemas_1 = require_dependentSchemas();\n\tconst limitContains_1 = require_limitContains();\n\tconst next = [\n\t\tdependentRequired_1.default,\n\t\tdependentSchemas_1.default,\n\t\tlimitContains_1.default\n\t];\n\texports.default = next;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js\nvar require_unevaluatedProperties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst names_1 = require_names();\n\tconst def = {\n\t\tkeyword: \"unevaluatedProperties\",\n\t\ttype: \"object\",\n\t\tschemaType: [\"boolean\", \"object\"],\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: \"must NOT have unevaluated properties\",\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, data, errsCount, it } = cxt;\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!errsCount) throw new Error(\"ajv implementation error\");\n\t\t\tconst { allErrors, props } = it;\n\t\t\tif (props instanceof codegen_1.Name) gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn(\"key\", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));\n\t\t\telse if (props !== true) gen.forIn(\"key\", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));\n\t\t\tit.props = true;\n\t\t\tcxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);\n\t\t\tfunction unevaluatedPropCode(key) {\n\t\t\t\tif (schema === false) {\n\t\t\t\t\tcxt.setParams({ unevaluatedProperty: key });\n\t\t\t\t\tcxt.error();\n\t\t\t\t\tif (!allErrors) gen.break();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!(0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\t\tconst valid = gen.name(\"valid\");\n\t\t\t\t\tcxt.subschema({\n\t\t\t\t\t\tkeyword: \"unevaluatedProperties\",\n\t\t\t\t\t\tdataProp: key,\n\t\t\t\t\t\tdataPropType: util_1.Type.Str\n\t\t\t\t\t}, valid);\n\t\t\t\t\tif (!allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction unevaluatedDynamic(evaluatedProps, key) {\n\t\t\t\treturn (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`;\n\t\t\t}\n\t\t\tfunction unevaluatedStatic(evaluatedProps, key) {\n\t\t\t\tconst ps = [];\n\t\t\t\tfor (const p in evaluatedProps) if (evaluatedProps[p] === true) ps.push((0, codegen_1._)`${key} !== ${p}`);\n\t\t\t\treturn (0, codegen_1.and)(...ps);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js\nvar require_unevaluatedItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"unevaluatedItems\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"boolean\", \"object\"],\n\t\terror: {\n\t\t\tmessage: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,\n\t\t\tparams: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, data, it } = cxt;\n\t\t\tconst items = it.items || 0;\n\t\t\tif (items === true) return;\n\t\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\t\tif (schema === false) {\n\t\t\t\tcxt.setParams({ len: items });\n\t\t\t\tcxt.fail((0, codegen_1._)`${len} > ${items}`);\n\t\t\t} else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\tconst valid = gen.var(\"valid\", (0, codegen_1._)`${len} <= ${items}`);\n\t\t\t\tgen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));\n\t\t\t\tcxt.ok(valid);\n\t\t\t}\n\t\t\tit.items = true;\n\t\t\tfunction validateItems(valid, from) {\n\t\t\t\tgen.forRange(\"i\", from, len, (i) => {\n\t\t\t\t\tcxt.subschema({\n\t\t\t\t\t\tkeyword: \"unevaluatedItems\",\n\t\t\t\t\t\tdataProp: i,\n\t\t\t\t\t\tdataPropType: util_1.Type.Num\n\t\t\t\t\t}, valid);\n\t\t\t\t\tif (!it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js\nvar require_unevaluated$1 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst unevaluatedProperties_1 = require_unevaluatedProperties();\n\tconst unevaluatedItems_1 = require_unevaluatedItems();\n\tconst unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];\n\texports.default = unevaluated;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json\nvar require_schema$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$vocabulary\": {\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/core\": true,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/applicator\": true,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/validation\": true,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/meta-data\": true,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/format\": false,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/content\": true\n\t\t},\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Core and Validation specifications meta-schema\",\n\t\t\"allOf\": [\n\t\t\t{ \"$ref\": \"meta/core\" },\n\t\t\t{ \"$ref\": \"meta/applicator\" },\n\t\t\t{ \"$ref\": \"meta/validation\" },\n\t\t\t{ \"$ref\": \"meta/meta-data\" },\n\t\t\t{ \"$ref\": \"meta/format\" },\n\t\t\t{ \"$ref\": \"meta/content\" }\n\t\t],\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"definitions\": {\n\t\t\t\t\"$comment\": \"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.\",\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"$comment\": \"\\\"dependencies\\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\\"dependentSchemas\\\" and \\\"dependentRequired\\\"\",\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"anyOf\": [{ \"$recursiveRef\": \"#\" }, { \"$ref\": \"meta/validation#/$defs/stringArray\" }] }\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json\nvar require_applicator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/applicator\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/applicator\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Applicator vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"additionalItems\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"unevaluatedItems\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"items\": { \"anyOf\": [{ \"$recursiveRef\": \"#\" }, { \"$ref\": \"#/$defs/schemaArray\" }] },\n\t\t\t\"contains\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"unevaluatedProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\t\"propertyNames\": { \"format\": \"regex\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependentSchemas\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" }\n\t\t\t},\n\t\t\t\"propertyNames\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"if\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"then\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"else\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"allOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"anyOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"oneOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"not\": { \"$recursiveRef\": \"#\" }\n\t\t},\n\t\t\"$defs\": { \"schemaArray\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"minItems\": 1,\n\t\t\t\"items\": { \"$recursiveRef\": \"#\" }\n\t\t} }\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json\nvar require_content$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/content\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/content\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Content vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"contentMediaType\": { \"type\": \"string\" },\n\t\t\t\"contentEncoding\": { \"type\": \"string\" },\n\t\t\t\"contentSchema\": { \"$recursiveRef\": \"#\" }\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json\nvar require_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/core\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/core\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Core vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"$id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\",\n\t\t\t\t\"$comment\": \"Non-empty fragments not allowed.\",\n\t\t\t\t\"pattern\": \"^[^#]*#?$\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$anchor\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"pattern\": \"^[A-Za-z][-A-Za-z0-9.:_]*$\"\n\t\t\t},\n\t\t\t\"$ref\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t},\n\t\t\t\"$recursiveRef\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t},\n\t\t\t\"$recursiveAnchor\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"$vocabulary\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"propertyNames\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"format\": \"uri\"\n\t\t\t\t},\n\t\t\t\t\"additionalProperties\": { \"type\": \"boolean\" }\n\t\t\t},\n\t\t\t\"$comment\": { \"type\": \"string\" },\n\t\t\t\"$defs\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json\nvar require_format = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/format\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/format\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Format vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": { \"format\": { \"type\": \"string\" } }\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json\nvar require_meta_data$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/meta-data\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/meta-data\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Meta-data vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"title\": { \"type\": \"string\" },\n\t\t\t\"description\": { \"type\": \"string\" },\n\t\t\t\"default\": true,\n\t\t\t\"deprecated\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"readOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"writeOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"examples\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json\nvar require_validation$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/validation\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/validation\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Validation vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"exclusiveMinimum\": 0\n\t\t\t},\n\t\t\t\"maximum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMaximum\": { \"type\": \"number\" },\n\t\t\t\"minimum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMinimum\": { \"type\": \"number\" },\n\t\t\t\"maxLength\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minLength\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"maxItems\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minItems\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxContains\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minContains\": {\n\t\t\t\t\"$ref\": \"#/$defs/nonNegativeInteger\",\n\t\t\t\t\"default\": 1\n\t\t\t},\n\t\t\t\"maxProperties\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minProperties\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"required\": { \"$ref\": \"#/$defs/stringArray\" },\n\t\t\t\"dependentRequired\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#/$defs/stringArray\" }\n\t\t\t},\n\t\t\t\"const\": true,\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t},\n\t\t\t\"type\": { \"anyOf\": [{ \"$ref\": \"#/$defs/simpleTypes\" }, {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"$ref\": \"#/$defs/simpleTypes\" },\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}] }\n\t\t},\n\t\t\"$defs\": {\n\t\t\t\"nonNegativeInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"nonNegativeIntegerDefault0\": {\n\t\t\t\t\"$ref\": \"#/$defs/nonNegativeInteger\",\n\t\t\t\t\"default\": 0\n\t\t\t},\n\t\t\t\"simpleTypes\": { \"enum\": [\n\t\t\t\t\"array\",\n\t\t\t\t\"boolean\",\n\t\t\t\t\"integer\",\n\t\t\t\t\"null\",\n\t\t\t\t\"number\",\n\t\t\t\t\"object\",\n\t\t\t\t\"string\"\n\t\t\t] },\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"type\": \"string\" },\n\t\t\t\t\"uniqueItems\": true,\n\t\t\t\t\"default\": []\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/index.js\nvar require_json_schema_2019_09 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst metaSchema = require_schema$1();\n\tconst applicator = require_applicator$1();\n\tconst content = require_content$1();\n\tconst core = require_core$1();\n\tconst format = require_format();\n\tconst metadata = require_meta_data$1();\n\tconst validation = require_validation$1();\n\tconst META_SUPPORT_DATA = [\"/properties\"];\n\tfunction addMetaSchema2019($data) {\n\t\t[\n\t\t\tmetaSchema,\n\t\t\tapplicator,\n\t\t\tcontent,\n\t\t\tcore,\n\t\t\twith$data(this, format),\n\t\t\tmetadata,\n\t\t\twith$data(this, validation)\n\t\t].forEach((sch) => this.addMetaSchema(sch, void 0, false));\n\t\treturn this;\n\t\tfunction with$data(ajv, sch) {\n\t\t\treturn $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;\n\t\t}\n\t}\n\texports.default = addMetaSchema2019;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/2019.js\nvar require__2019 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2019 = void 0;\n\tconst core_1 = require_core$3();\n\tconst draft7_1 = require_draft7();\n\tconst dynamic_1 = require_dynamic();\n\tconst next_1 = require_next();\n\tconst unevaluated_1 = require_unevaluated$1();\n\tconst discriminator_1 = require_discriminator();\n\tconst json_schema_2019_09_1 = require_json_schema_2019_09();\n\tconst META_SCHEMA_ID = \"https://json-schema.org/draft/2019-09/schema\";\n\tvar Ajv2019 = class extends core_1.default {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper({\n\t\t\t\t...opts,\n\t\t\t\tdynamicRef: true,\n\t\t\t\tnext: true,\n\t\t\t\tunevaluated: true\n\t\t\t});\n\t\t}\n\t\t_addVocabularies() {\n\t\t\tsuper._addVocabularies();\n\t\t\tthis.addVocabulary(dynamic_1.default);\n\t\t\tdraft7_1.default.forEach((v) => this.addVocabulary(v));\n\t\t\tthis.addVocabulary(next_1.default);\n\t\t\tthis.addVocabulary(unevaluated_1.default);\n\t\t\tif (this.opts.discriminator) this.addKeyword(discriminator_1.default);\n\t\t}\n\t\t_addDefaultMetaSchema() {\n\t\t\tsuper._addDefaultMetaSchema();\n\t\t\tconst { $data, meta } = this.opts;\n\t\t\tif (!meta) return;\n\t\t\tjson_schema_2019_09_1.default.call(this, $data);\n\t\t\tthis.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n\t\t}\n\t\tdefaultMeta() {\n\t\t\treturn this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);\n\t\t}\n\t};\n\texports.Ajv2019 = Ajv2019;\n\tmodule.exports = exports = Ajv2019;\n\tmodule.exports.Ajv2019 = Ajv2019;\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Ajv2019;\n\tvar validate_1 = require_validate();\n\tObject.defineProperty(exports, \"KeywordCxt\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validate_1.KeywordCxt;\n\t\t}\n\t});\n\tvar codegen_1 = require_codegen();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.Name;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"CodeGen\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.CodeGen;\n\t\t}\n\t});\n\tvar validation_error_1 = require_validation_error();\n\tObject.defineProperty(exports, \"ValidationError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validation_error_1.default;\n\t\t}\n\t});\n\tvar ref_error_1 = require_ref_error();\n\tObject.defineProperty(exports, \"MissingRefError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn ref_error_1.default;\n\t\t}\n\t});\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft2020.js\nvar require_draft2020 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst core_1 = require_core$2();\n\tconst validation_1 = require_validation$2();\n\tconst applicator_1 = require_applicator$2();\n\tconst dynamic_1 = require_dynamic();\n\tconst next_1 = require_next();\n\tconst unevaluated_1 = require_unevaluated$1();\n\tconst format_1 = require_format$1();\n\tconst metadata_1 = require_metadata();\n\tconst draft2020Vocabularies = [\n\t\tdynamic_1.default,\n\t\tcore_1.default,\n\t\tvalidation_1.default,\n\t\t(0, applicator_1.default)(true),\n\t\tformat_1.default,\n\t\tmetadata_1.metadataVocabulary,\n\t\tmetadata_1.contentVocabulary,\n\t\tnext_1.default,\n\t\tunevaluated_1.default\n\t];\n\texports.default = draft2020Vocabularies;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json\nvar require_schema = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$vocabulary\": {\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/core\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/applicator\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/unevaluated\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/validation\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/meta-data\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/format-annotation\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/content\": true\n\t\t},\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Core and Validation specifications meta-schema\",\n\t\t\"allOf\": [\n\t\t\t{ \"$ref\": \"meta/core\" },\n\t\t\t{ \"$ref\": \"meta/applicator\" },\n\t\t\t{ \"$ref\": \"meta/unevaluated\" },\n\t\t\t{ \"$ref\": \"meta/validation\" },\n\t\t\t{ \"$ref\": \"meta/meta-data\" },\n\t\t\t{ \"$ref\": \"meta/format-annotation\" },\n\t\t\t{ \"$ref\": \"meta/content\" }\n\t\t],\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"$comment\": \"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.\",\n\t\t\"properties\": {\n\t\t\t\"definitions\": {\n\t\t\t\t\"$comment\": \"\\\"definitions\\\" has been replaced by \\\"$defs\\\".\",\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\t\"deprecated\": true,\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"$comment\": \"\\\"dependencies\\\" has been split and replaced by \\\"dependentSchemas\\\" and \\\"dependentRequired\\\" in order to serve their differing semantics.\",\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"anyOf\": [{ \"$dynamicRef\": \"#meta\" }, { \"$ref\": \"meta/validation#/$defs/stringArray\" }] },\n\t\t\t\t\"deprecated\": true,\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"$recursiveAnchor\": {\n\t\t\t\t\"$comment\": \"\\\"$recursiveAnchor\\\" has been replaced by \\\"$dynamicAnchor\\\".\",\n\t\t\t\t\"$ref\": \"meta/core#/$defs/anchorString\",\n\t\t\t\t\"deprecated\": true\n\t\t\t},\n\t\t\t\"$recursiveRef\": {\n\t\t\t\t\"$comment\": \"\\\"$recursiveRef\\\" has been replaced by \\\"$dynamicRef\\\".\",\n\t\t\t\t\"$ref\": \"meta/core#/$defs/uriReferenceString\",\n\t\t\t\t\"deprecated\": true\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json\nvar require_applicator = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/applicator\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/applicator\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Applicator vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"prefixItems\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"items\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"contains\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\t\"propertyNames\": { \"format\": \"regex\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependentSchemas\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"propertyNames\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"if\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"then\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"else\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"allOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"anyOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"oneOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"not\": { \"$dynamicRef\": \"#meta\" }\n\t\t},\n\t\t\"$defs\": { \"schemaArray\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"minItems\": 1,\n\t\t\t\"items\": { \"$dynamicRef\": \"#meta\" }\n\t\t} }\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json\nvar require_unevaluated = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/unevaluated\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/unevaluated\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Unevaluated applicator vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"unevaluatedItems\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"unevaluatedProperties\": { \"$dynamicRef\": \"#meta\" }\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json\nvar require_content = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/content\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/content\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Content vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"contentEncoding\": { \"type\": \"string\" },\n\t\t\t\"contentMediaType\": { \"type\": \"string\" },\n\t\t\t\"contentSchema\": { \"$dynamicRef\": \"#meta\" }\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json\nvar require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/core\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/core\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Core vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"$id\": {\n\t\t\t\t\"$ref\": \"#/$defs/uriReferenceString\",\n\t\t\t\t\"$comment\": \"Non-empty fragments not allowed.\",\n\t\t\t\t\"pattern\": \"^[^#]*#?$\"\n\t\t\t},\n\t\t\t\"$schema\": { \"$ref\": \"#/$defs/uriString\" },\n\t\t\t\"$ref\": { \"$ref\": \"#/$defs/uriReferenceString\" },\n\t\t\t\"$anchor\": { \"$ref\": \"#/$defs/anchorString\" },\n\t\t\t\"$dynamicRef\": { \"$ref\": \"#/$defs/uriReferenceString\" },\n\t\t\t\"$dynamicAnchor\": { \"$ref\": \"#/$defs/anchorString\" },\n\t\t\t\"$vocabulary\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"propertyNames\": { \"$ref\": \"#/$defs/uriString\" },\n\t\t\t\t\"additionalProperties\": { \"type\": \"boolean\" }\n\t\t\t},\n\t\t\t\"$comment\": { \"type\": \"string\" },\n\t\t\t\"$defs\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" }\n\t\t\t}\n\t\t},\n\t\t\"$defs\": {\n\t\t\t\"anchorString\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"pattern\": \"^[A-Za-z_][-A-Za-z0-9._]*$\"\n\t\t\t},\n\t\t\t\"uriString\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"uriReferenceString\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json\nvar require_format_annotation = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/format-annotation\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/format-annotation\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Format vocabulary meta-schema for annotation results\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": { \"format\": { \"type\": \"string\" } }\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json\nvar require_meta_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/meta-data\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/meta-data\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Meta-data vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"title\": { \"type\": \"string\" },\n\t\t\t\"description\": { \"type\": \"string\" },\n\t\t\t\"default\": true,\n\t\t\t\"deprecated\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"readOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"writeOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"examples\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json\nvar require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/validation\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/validation\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Validation vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"type\": { \"anyOf\": [{ \"$ref\": \"#/$defs/simpleTypes\" }, {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"$ref\": \"#/$defs/simpleTypes\" },\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}] },\n\t\t\t\"const\": true,\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"exclusiveMinimum\": 0\n\t\t\t},\n\t\t\t\"maximum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMaximum\": { \"type\": \"number\" },\n\t\t\t\"minimum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMinimum\": { \"type\": \"number\" },\n\t\t\t\"maxLength\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minLength\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"maxItems\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minItems\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxContains\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minContains\": {\n\t\t\t\t\"$ref\": \"#/$defs/nonNegativeInteger\",\n\t\t\t\t\"default\": 1\n\t\t\t},\n\t\t\t\"maxProperties\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minProperties\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"required\": { \"$ref\": \"#/$defs/stringArray\" },\n\t\t\t\"dependentRequired\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#/$defs/stringArray\" }\n\t\t\t}\n\t\t},\n\t\t\"$defs\": {\n\t\t\t\"nonNegativeInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"nonNegativeIntegerDefault0\": {\n\t\t\t\t\"$ref\": \"#/$defs/nonNegativeInteger\",\n\t\t\t\t\"default\": 0\n\t\t\t},\n\t\t\t\"simpleTypes\": { \"enum\": [\n\t\t\t\t\"array\",\n\t\t\t\t\"boolean\",\n\t\t\t\t\"integer\",\n\t\t\t\t\"null\",\n\t\t\t\t\"number\",\n\t\t\t\t\"object\",\n\t\t\t\t\"string\"\n\t\t\t] },\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"type\": \"string\" },\n\t\t\t\t\"uniqueItems\": true,\n\t\t\t\t\"default\": []\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js\nvar require_json_schema_2020_12 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst metaSchema = require_schema();\n\tconst applicator = require_applicator();\n\tconst unevaluated = require_unevaluated();\n\tconst content = require_content();\n\tconst core = require_core();\n\tconst format = require_format_annotation();\n\tconst metadata = require_meta_data();\n\tconst validation = require_validation();\n\tconst META_SUPPORT_DATA = [\"/properties\"];\n\tfunction addMetaSchema2020($data) {\n\t\t[\n\t\t\tmetaSchema,\n\t\t\tapplicator,\n\t\t\tunevaluated,\n\t\t\tcontent,\n\t\t\tcore,\n\t\t\twith$data(this, format),\n\t\t\tmetadata,\n\t\t\twith$data(this, validation)\n\t\t].forEach((sch) => this.addMetaSchema(sch, void 0, false));\n\t\treturn this;\n\t\tfunction with$data(ajv, sch) {\n\t\t\treturn $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;\n\t\t}\n\t}\n\texports.default = addMetaSchema2020;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/2020.js\nvar require__2020 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;\n\tconst core_1 = require_core$3();\n\tconst draft2020_1 = require_draft2020();\n\tconst discriminator_1 = require_discriminator();\n\tconst json_schema_2020_12_1 = require_json_schema_2020_12();\n\tconst META_SCHEMA_ID = \"https://json-schema.org/draft/2020-12/schema\";\n\tvar Ajv2020 = class extends core_1.default {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper({\n\t\t\t\t...opts,\n\t\t\t\tdynamicRef: true,\n\t\t\t\tnext: true,\n\t\t\t\tunevaluated: true\n\t\t\t});\n\t\t}\n\t\t_addVocabularies() {\n\t\t\tsuper._addVocabularies();\n\t\t\tdraft2020_1.default.forEach((v) => this.addVocabulary(v));\n\t\t\tif (this.opts.discriminator) this.addKeyword(discriminator_1.default);\n\t\t}\n\t\t_addDefaultMetaSchema() {\n\t\t\tsuper._addDefaultMetaSchema();\n\t\t\tconst { $data, meta } = this.opts;\n\t\t\tif (!meta) return;\n\t\t\tjson_schema_2020_12_1.default.call(this, $data);\n\t\t\tthis.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n\t\t}\n\t\tdefaultMeta() {\n\t\t\treturn this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);\n\t\t}\n\t};\n\texports.Ajv2020 = Ajv2020;\n\tmodule.exports = exports = Ajv2020;\n\tmodule.exports.Ajv2020 = Ajv2020;\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Ajv2020;\n\tvar validate_1 = require_validate();\n\tObject.defineProperty(exports, \"KeywordCxt\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validate_1.KeywordCxt;\n\t\t}\n\t});\n\tvar codegen_1 = require_codegen();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.Name;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"CodeGen\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.CodeGen;\n\t\t}\n\t});\n\tvar validation_error_1 = require_validation_error();\n\tObject.defineProperty(exports, \"ValidationError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validation_error_1.default;\n\t\t}\n\t});\n\tvar ref_error_1 = require_ref_error();\n\tObject.defineProperty(exports, \"MissingRefError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn ref_error_1.default;\n\t\t}\n\t});\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js\nvar require_formats = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.formatNames = exports.fastFormats = exports.fullFormats = void 0;\n\tfunction fmtDef(validate, compare) {\n\t\treturn {\n\t\t\tvalidate,\n\t\t\tcompare\n\t\t};\n\t}\n\texports.fullFormats = {\n\t\tdate: fmtDef(date, compareDate),\n\t\ttime: fmtDef(getTime(true), compareTime),\n\t\t\"date-time\": fmtDef(getDateTime(true), compareDateTime),\n\t\t\"iso-time\": fmtDef(getTime(), compareIsoTime),\n\t\t\"iso-date-time\": fmtDef(getDateTime(), compareIsoDateTime),\n\t\tduration: /^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/,\n\t\turi,\n\t\t\"uri-reference\": /^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4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1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))$/i,\n\t\tregex,\n\t\tuuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\n\t\t\"json-pointer\": /^(?:\\/(?:[^~/]|~0|~1)*)*$/,\n\t\t\"json-pointer-uri-fragment\": /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\n\t\t\"relative-json-pointer\": /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,\n\t\tbyte,\n\t\tint32: {\n\t\t\ttype: \"number\",\n\t\t\tvalidate: validateInt32\n\t\t},\n\t\tint64: {\n\t\t\ttype: \"number\",\n\t\t\tvalidate: validateInt64\n\t\t},\n\t\tfloat: {\n\t\t\ttype: \"number\",\n\t\t\tvalidate: validateNumber\n\t\t},\n\t\tdouble: {\n\t\t\ttype: \"number\",\n\t\t\tvalidate: validateNumber\n\t\t},\n\t\tpassword: true,\n\t\tbinary: true\n\t};\n\texports.fastFormats = {\n\t\t...exports.fullFormats,\n\t\tdate: fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/, compareDate),\n\t\ttime: fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i, compareTime),\n\t\t\"date-time\": fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i, compareDateTime),\n\t\t\"iso-time\": fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i, compareIsoTime),\n\t\t\"iso-date-time\": fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i, compareIsoDateTime),\n\t\turi: /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n\t\t\"uri-reference\": /^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n\t\temail: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i\n\t};\n\texports.formatNames = Object.keys(exports.fullFormats);\n\tfunction isLeapYear(year) {\n\t\treturn year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n\t}\n\tconst DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\n\tconst DAYS = [\n\t\t0,\n\t\t31,\n\t\t28,\n\t\t31,\n\t\t30,\n\t\t31,\n\t\t30,\n\t\t31,\n\t\t31,\n\t\t30,\n\t\t31,\n\t\t30,\n\t\t31\n\t];\n\tfunction date(str) {\n\t\tconst matches = DATE.exec(str);\n\t\tif (!matches) return false;\n\t\tconst year = +matches[1];\n\t\tconst month = +matches[2];\n\t\tconst day = +matches[3];\n\t\treturn month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);\n\t}\n\tfunction compareDate(d1, d2) {\n\t\tif (!(d1 && d2)) return void 0;\n\t\tif (d1 > d2) return 1;\n\t\tif (d1 < d2) return -1;\n\t\treturn 0;\n\t}\n\tconst TIME = /^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i;\n\tfunction getTime(strictTimeZone) {\n\t\treturn function time(str) {\n\t\t\tconst matches = TIME.exec(str);\n\t\t\tif (!matches) return false;\n\t\t\tconst hr = +matches[1];\n\t\t\tconst min = +matches[2];\n\t\t\tconst sec = +matches[3];\n\t\t\tconst tz = matches[4];\n\t\t\tconst tzSign = matches[5] === \"-\" ? -1 : 1;\n\t\t\tconst tzH = +(matches[6] || 0);\n\t\t\tconst tzM = +(matches[7] || 0);\n\t\t\tif (tzH > 23 || tzM > 59 || strictTimeZone && !tz) return false;\n\t\t\tif (hr <= 23 && min <= 59 && sec < 60) return true;\n\t\t\tconst utcMin = min - tzM * tzSign;\n\t\t\tconst utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);\n\t\t\treturn (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;\n\t\t};\n\t}\n\tfunction compareTime(s1, s2) {\n\t\tif (!(s1 && s2)) return void 0;\n\t\tconst t1 = (/* @__PURE__ */ new Date(\"2020-01-01T\" + s1)).valueOf();\n\t\tconst t2 = (/* @__PURE__ */ new Date(\"2020-01-01T\" + s2)).valueOf();\n\t\tif (!(t1 && t2)) return void 0;\n\t\treturn t1 - t2;\n\t}\n\tfunction compareIsoTime(t1, t2) {\n\t\tif (!(t1 && t2)) return void 0;\n\t\tconst a1 = TIME.exec(t1);\n\t\tconst a2 = TIME.exec(t2);\n\t\tif (!(a1 && a2)) return void 0;\n\t\tt1 = a1[1] + a1[2] + a1[3];\n\t\tt2 = a2[1] + a2[2] + a2[3];\n\t\tif (t1 > t2) return 1;\n\t\tif (t1 < t2) return -1;\n\t\treturn 0;\n\t}\n\tconst DATE_TIME_SEPARATOR = /t|\\s/i;\n\tfunction getDateTime(strictTimeZone) {\n\t\tconst time = getTime(strictTimeZone);\n\t\treturn function date_time(str) {\n\t\t\tconst dateTime = str.split(DATE_TIME_SEPARATOR);\n\t\t\treturn dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);\n\t\t};\n\t}\n\tfunction compareDateTime(dt1, dt2) {\n\t\tif (!(dt1 && dt2)) return void 0;\n\t\tconst d1 = new Date(dt1).valueOf();\n\t\tconst d2 = new Date(dt2).valueOf();\n\t\tif (!(d1 && d2)) return void 0;\n\t\treturn d1 - d2;\n\t}\n\tfunction compareIsoDateTime(dt1, dt2) {\n\t\tif (!(dt1 && dt2)) return void 0;\n\t\tconst [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);\n\t\tconst [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);\n\t\tconst res = compareDate(d1, d2);\n\t\tif (res === void 0) return void 0;\n\t\treturn res || compareTime(t1, t2);\n\t}\n\tconst NOT_URI_FRAGMENT = /\\/|:/;\n\tconst URI = /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\\?(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;\n\tfunction uri(str) {\n\t\treturn NOT_URI_FRAGMENT.test(str) && URI.test(str);\n\t}\n\tconst BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;\n\tfunction byte(str) {\n\t\tBYTE.lastIndex = 0;\n\t\treturn BYTE.test(str);\n\t}\n\tconst MIN_INT32 = -(2 ** 31);\n\tconst MAX_INT32 = 2 ** 31 - 1;\n\tfunction validateInt32(value) {\n\t\treturn Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;\n\t}\n\tfunction validateInt64(value) {\n\t\treturn Number.isInteger(value);\n\t}\n\tfunction validateNumber() {\n\t\treturn true;\n\t}\n\tconst Z_ANCHOR = /[^\\\\]\\\\Z/;\n\tfunction regex(str) {\n\t\tif (Z_ANCHOR.test(str)) return false;\n\t\ttry {\n\t\t\tnew RegExp(str);\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js\nvar require_limit = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.formatLimitDefinition = void 0;\n\tconst ajv_1 = require_ajv();\n\tconst codegen_1 = require_codegen();\n\tconst ops = codegen_1.operators;\n\tconst KWDs = {\n\t\tformatMaximum: {\n\t\t\tokStr: \"<=\",\n\t\t\tok: ops.LTE,\n\t\t\tfail: ops.GT\n\t\t},\n\t\tformatMinimum: {\n\t\t\tokStr: \">=\",\n\t\t\tok: ops.GTE,\n\t\t\tfail: ops.LT\n\t\t},\n\t\tformatExclusiveMaximum: {\n\t\t\tokStr: \"<\",\n\t\t\tok: ops.LT,\n\t\t\tfail: ops.GTE\n\t\t},\n\t\tformatExclusiveMinimum: {\n\t\t\tokStr: \">\",\n\t\t\tok: ops.GT,\n\t\t\tfail: ops.LTE\n\t\t}\n\t};\n\tconst error = {\n\t\tmessage: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`,\n\t\tparams: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`\n\t};\n\texports.formatLimitDefinition = {\n\t\tkeyword: Object.keys(KWDs),\n\t\ttype: \"string\",\n\t\tschemaType: \"string\",\n\t\t$data: true,\n\t\terror,\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, schemaCode, keyword, it } = cxt;\n\t\t\tconst { opts, self } = it;\n\t\t\tif (!opts.validateFormats) return;\n\t\t\tconst fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, \"format\");\n\t\t\tif (fCxt.$data) validate$DataFormat();\n\t\t\telse validateFormat();\n\t\t\tfunction validate$DataFormat() {\n\t\t\t\tconst fmts = gen.scopeValue(\"formats\", {\n\t\t\t\t\tref: self.formats,\n\t\t\t\t\tcode: opts.code.formats\n\t\t\t\t});\n\t\t\t\tconst fmt = gen.const(\"fmt\", (0, codegen_1._)`${fmts}[${fCxt.schemaCode}]`);\n\t\t\t\tcxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof ${fmt} != \"object\"`, (0, codegen_1._)`${fmt} instanceof RegExp`, (0, codegen_1._)`typeof ${fmt}.compare != \"function\"`, compareCode(fmt)));\n\t\t\t}\n\t\t\tfunction validateFormat() {\n\t\t\t\tconst format = fCxt.schema;\n\t\t\t\tconst fmtDef = self.formats[format];\n\t\t\t\tif (!fmtDef || fmtDef === true) return;\n\t\t\t\tif (typeof fmtDef != \"object\" || fmtDef instanceof RegExp || typeof fmtDef.compare != \"function\") throw new Error(`\"${keyword}\": format \"${format}\" does not define \"compare\" function`);\n\t\t\t\tconst fmt = gen.scopeValue(\"formats\", {\n\t\t\t\t\tkey: format,\n\t\t\t\t\tref: fmtDef,\n\t\t\t\t\tcode: opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : void 0\n\t\t\t\t});\n\t\t\t\tcxt.fail$data(compareCode(fmt));\n\t\t\t}\n\t\t\tfunction compareCode(fmt) {\n\t\t\t\treturn (0, codegen_1._)`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;\n\t\t\t}\n\t\t},\n\t\tdependencies: [\"format\"]\n\t};\n\tconst formatLimitPlugin = (ajv) => {\n\t\tajv.addKeyword(exports.formatLimitDefinition);\n\t\treturn ajv;\n\t};\n\texports.default = formatLimitPlugin;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js\nvar require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst formats_1 = require_formats();\n\tconst limit_1 = require_limit();\n\tconst codegen_1 = require_codegen();\n\tconst fullName = new codegen_1.Name(\"fullFormats\");\n\tconst fastName = new codegen_1.Name(\"fastFormats\");\n\tconst formatsPlugin = (ajv, opts = { keywords: true }) => {\n\t\tif (Array.isArray(opts)) {\n\t\t\taddFormats(ajv, opts, formats_1.fullFormats, fullName);\n\t\t\treturn ajv;\n\t\t}\n\t\tconst [formats, exportName] = opts.mode === \"fast\" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];\n\t\taddFormats(ajv, opts.formats || formats_1.formatNames, formats, exportName);\n\t\tif (opts.keywords) (0, limit_1.default)(ajv);\n\t\treturn ajv;\n\t};\n\tformatsPlugin.get = (name, mode = \"full\") => {\n\t\tconst f = (mode === \"fast\" ? formats_1.fastFormats : formats_1.fullFormats)[name];\n\t\tif (!f) throw new Error(`Unknown format \"${name}\"`);\n\t\treturn f;\n\t};\n\tfunction addFormats(ajv, list, fs, exportName) {\n\t\tvar _a;\n\t\tvar _b;\n\t\t(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 || (_b.formats = (0, codegen_1._)`require(\"ajv-formats/dist/formats\").${exportName}`);\n\t\tfor (const f of list) ajv.addFormat(f, fs[f]);\n\t}\n\tmodule.exports = exports = formatsPlugin;\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = formatsPlugin;\n}));\n\n//#endregion\n//#region ../core-internal/src/validators/ajvProvider.ts\nvar import_ajv = require_ajv();\nvar import__2019 = require__2019();\nvar import__2020 = require__2020();\nvar import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);\n/** `ajv-formats` default export, normalised through the CJS/ESM interop wrapper. */\nconst addFormats = import_dist.default;\nfunction createDefaultAjvInstance(engineClass) {\n\tconst ajv = new engineClass({\n\t\tstrict: false,\n\t\tvalidateFormats: true,\n\t\tvalidateSchema: false,\n\t\tallErrors: true\n\t});\n\taddFormats(ajv);\n\treturn ajv;\n}\n/**\n* AJV-backed JSON Schema validator. See `@modelcontextprotocol/{client,server}/validators/ajv`\n* for the customisation entry point (re-exports `Ajv` and `addFormats` from the bundled copy).\n*\n* Default dispatches on the schema's declared dialect: no `$schema` or 2020-12 → `Ajv2020`\n* (SEP-1613); 2019-09 → `Ajv2019`; draft-07 or draft-06 → the classic draft-07 `Ajv` class\n* (draft-07's changes over draft-06 are additive, so one engine covers both). Known draft-07 deviation: classic Ajv\n* evaluates keywords adjacent to `$ref` (stricter than draft-07's ignore-siblings rule, matching\n* v1's default engine), while the cfworker provider ignores them per spec.\n* Schemas declaring any other `$schema` are\n* rejected with a plain `Error`; pass a pre-configured Ajv instance to validate\n* other dialects. The SDK bundles ajv internally but does not re-export `Ajv2020` (its type\n* graph tips downstream declaration bundling — see #2339). To construct a custom 2020-12\n* instance, add `ajv` to your own dependencies (matching the SDK's pinned version) and\n* `import { Ajv2020 } from 'ajv/dist/2020.js'` — `new Ajv(...)` is the draft-07 class and would\n* silently downgrade dialect.\n*\n* @example Use with default configuration\n* ```ts source=\"./ajvProvider.examples.ts#AjvJsonSchemaValidator_default\"\n* const validator = new AjvJsonSchemaValidator();\n* ```\n*\n* @example Use with a custom AJV instance\n* ```ts source=\"./ajvProvider.examples.ts#AjvJsonSchemaValidator_customInstance\"\n* // import { Ajv2020 } from 'ajv/dist/2020.js';\n* const ajv = new Ajv2020({ strict: false, validateSchema: false, allErrors: true });\n* const validator = new AjvJsonSchemaValidator(ajv);\n* ```\n*\n* @example Register ajv-formats\n* ```ts source=\"./ajvProvider.examples.ts#AjvJsonSchemaValidator_withFormats\"\n* // import { Ajv2020 } from 'ajv/dist/2020.js';\n* const ajv = new Ajv2020({ strict: false, validateSchema: false, allErrors: true });\n* addFormats(ajv);\n* const validator = new AjvJsonSchemaValidator(ajv);\n* ```\n*/\nvar AjvJsonSchemaValidator = class {\n\t_ajv;\n\t/** Lazy classic (draft-07) engine, built on the first draft-07/draft-06-declared schema. */\n\t_ajvDraft7;\n\t/** Lazy 2019-09 engine, built on the first 2019-09-declared schema. */\n\t_ajv2019;\n\t/** True iff the constructor received a caller-supplied engine; the `$schema` dispatch is skipped. */\n\t_userAjv;\n\t/**\n\t* @param ajv - Optional pre-configured AJV-compatible instance. When supplied, this instance is\n\t* used for **every** schema regardless of its declared `$schema` (the caller owns dialect\n\t* choice). When omitted, the provider constructs per-dialect engines (`Ajv2020`, `Ajv2019`,\n\t* and the classic draft-07 `Ajv` for draft-07/06-declared schemas) with\n\t* `strict: false`, `validateFormats: true`, `validateSchema: false`, `allErrors: true`, and\n\t* `ajv-formats` registered — **lazily, on the first {@linkcode getValidator} call needing each**, so\n\t* constructing the provider (e.g. as the default validator of a `Client`/`Server` that never\n\t* validates a JSON Schema) does not pay the ajv + ajv-formats instantiation cost. The parameter\n\t* is typed structurally so consumers who don't pass an instance need not have `ajv` installed.\n\t*/\n\tconstructor(ajv) {\n\t\tthis._userAjv = ajv !== void 0;\n\t\tthis._ajv = ajv;\n\t}\n\t/** The underlying 2020-12 engine — the default instance is created on first use. */\n\tget ajv() {\n\t\treturn this._ajv ??= createDefaultAjvInstance(import__2020.Ajv2020);\n\t}\n\t/**\n\t* Pick the engine for a schema's declared dialect. A caller-supplied engine is used for\n\t* every schema — do not second-guess by `$schema` (bring-your-own-validator means\n\t* bring-your-own-dialect). Otherwise: no `$schema` or 2020-12 → `Ajv2020`; 2019-09 →\n\t* `Ajv2019`; draft-07 or draft-06 → classic `Ajv`; anything else → `Error`.\n\t*/\n\t_engineFor(schema) {\n\t\tif (this._userAjv) return this.ajv;\n\t\tconst dialect = declaredDialect(schema, \"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.\");\n\t\tif (dialect === \"2020-12\") return this.ajv;\n\t\tif (dialect === \"2019-09\") return this._ajv2019 ??= createDefaultAjvInstance(import__2019.Ajv2019);\n\t\treturn this._ajvDraft7 ??= createDefaultAjvInstance(import_ajv.Ajv);\n\t}\n\tgetValidator(schema) {\n\t\tconst engine = this._engineFor(schema);\n\t\tconst ajvValidator = \"$id\" in schema && typeof schema.$id === \"string\" ? engine.getSchema(schema.$id) ?? engine.compile(schema) : engine.compile(schema);\n\t\treturn (input) => {\n\t\t\treturn ajvValidator(input) ? {\n\t\t\t\tvalid: true,\n\t\t\t\tdata: input,\n\t\t\t\terrorMessage: void 0\n\t\t\t} : {\n\t\t\t\tvalid: false,\n\t\t\t\tdata: void 0,\n\t\t\t\terrorMessage: engine.errorsText(ajvValidator.errors)\n\t\t\t};\n\t\t};\n\t}\n};\n/**\n* Draft-07 AJV class, re-exported for consumers who need to opt back to the pre-SEP-1613 default.\n* The full v1-equivalent construction is:\n*\n* ```ts\n* const ajv = new Ajv({ strict: false, validateFormats: true, validateSchema: false, allErrors: true });\n* addFormats(ajv);\n* new AjvJsonSchemaValidator(ajv);\n* ```\n*\n* (omitting `validateSchema: false` makes a 2020-12-stamped `$schema` fail with an opaque\n* \"no schema with key or ref …\" engine error; omitting `addFormats` silently drops `format`\n* validation that the v1 default had).\n*\n* The SDK bundles ajv internally but does not re-export `Ajv2020` (its type graph tips downstream\n* declaration bundling — see #2339). To construct a custom 2020-12 instance, add `ajv` to your own\n* dependencies (matching the SDK's pinned version) and `import { Ajv2020 } from 'ajv/dist/2020.js'`.\n*/\nconst Ajv = import_ajv.Ajv;\n\n//#endregion\nexport { AjvJsonSchemaValidator as n, addFormats as r, Ajv as t };\n//# sourceMappingURL=ajvProvider-CEoC__sr.mjs.map","import { A as promptArgumentsFromStandardSchema, At as LATEST_PROTOCOL_VERSION, B as scanXMcpHeaderDeclarations, C as REQUEST_STATE_ONLY_LEG_PACING_MS, Ct as CLIENT_CAPABILITIES_META_KEY, E as sleep, H as assertCompleteRequestPrompt, Ht as requiredClientCapabilitiesForInputRequest, It as SERVER_INFO_META_KEY, Kt as SdkError, Lt as SUBSCRIPTION_ID_META_KEY, M as validateStandardSchema, N as parseSchema, T as linkedRoundAbort, U as assertCompleteRequestResourceTemplate, Vt as missingClientCapabilities, Xt as OAuthErrorCode, Yt as OAuthError, _ as mergeCapabilities, _t as normalizeContentlessToolResult, a as UriTemplate, b as withRequestStateValue, bt as legacyProtocolVersions, ct as codecForVersion, dt as ResourceNotFoundError, g as Protocol, gt as attachCacheHintFallback, ht as assertValidCacheHint, j as standardSchemaToJsonSchema, jt as LOG_LEVEL_META_KEY, lt as MissingRequiredClientCapabilityError, mt as ProtocolErrorCode, nt as LoggingLevelSchema, q as isInputRequiredResult, qt as SdkErrorCode, r as normalizeRawShapeSchema, s as validateAndWarnToolName, st as MODERN_WIRE_REVISION, ut as ProtocolError, v as requestStateAccessor, w as inputRequiredRoundsExceededMessage, xt as modernProtocolVersions, yt as isModernProtocolVersion } from \"./src-Cqbh3MYc.mjs\";\nimport { DefaultJsonSchemaValidator } from \"@modelcontextprotocol/server/_shims\";\n\n//#region src/server/completable.ts\nconst COMPLETABLE_SYMBOL = Symbol.for(\"mcp.completable\");\n/**\n* Wraps a schema to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP.\n*\n* @example\n* ```ts source=\"./completable.examples.ts#completable_basicUsage\"\n* server.registerPrompt(\n*     'review-code',\n*     {\n*         title: 'Code Review',\n*         argsSchema: z.object({\n*             language: completable(z.string().describe('Programming language'), value =>\n*                 ['typescript', 'javascript', 'python', 'rust', 'go'].filter(lang => lang.startsWith(value))\n*             )\n*         })\n*     },\n*     ({ language }) => ({\n*         messages: [\n*             {\n*                 role: 'user' as const,\n*                 content: {\n*                     type: 'text' as const,\n*                     text: `Review this ${language} code.`\n*                 }\n*             }\n*         ]\n*     })\n* );\n* ```\n*\n* @see {@linkcode server/mcp.McpServer.registerPrompt | McpServer.registerPrompt} for using completable schemas in prompt argument definitions\n*/\nfunction completable(schema, complete) {\n\tObject.defineProperty(schema, COMPLETABLE_SYMBOL, {\n\t\tvalue: { complete },\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n\treturn schema;\n}\n/**\n* Checks if a schema is completable (has completion metadata).\n*/\nfunction isCompletable(schema) {\n\treturn !!schema && typeof schema === \"object\" && COMPLETABLE_SYMBOL in schema;\n}\n/**\n* Gets the completer callback from a completable schema, if it exists.\n*/\nfunction getCompleter(schema) {\n\treturn schema[COMPLETABLE_SYMBOL]?.complete;\n}\n\n//#endregion\n//#region src/server/sseKeepAlive.ts\n/** Default interval between SSE keep-alive comment frames. */\nconst DEFAULT_SSE_KEEP_ALIVE_MS = 15e3;\nconst MAX_TIMER_DELAY_MS = 2 ** 31 - 1;\n/** Arms an unref'd timer, or disables keep-alive for invalid delays. */\nfunction armSseKeepAlive(intervalMs, onTick) {\n\tif (!Number.isFinite(intervalMs) || intervalMs < 1) return;\n\tconst timer = setInterval(onTick, Math.min(intervalMs, MAX_TIMER_DELAY_MS));\n\ttimer.unref?.();\n\treturn timer;\n}\n\n//#endregion\n//#region src/server/serverEventBus.ts\n/**\n* A `ServerEventBus` backed by an in-process listener set.\n*\n* `publish()` delivers synchronously to the live listener set (a listener\n* unsubscribing itself mid-dispatch is safe; the entry's listen-router\n* listeners never unsubscribe peers). A throwing listener does not stop\n* delivery to the others.\n*/\nvar InMemoryServerEventBus = class {\n\t_listeners = /* @__PURE__ */ new Set();\n\t/**\n\t* @param onerror - Optional callback for errors thrown by listeners\n\t*   during dispatch.\n\t*/\n\tconstructor(onerror) {\n\t\tthis.onerror = onerror;\n\t}\n\tpublish(event) {\n\t\tfor (const listener of this._listeners) try {\n\t\t\tlistener(event);\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error instanceof Error ? error : new Error(String(error)));\n\t\t}\n\t}\n\tsubscribe(listener) {\n\t\tthis._listeners.add(listener);\n\t\tlet live = true;\n\t\treturn () => {\n\t\t\tif (!live) return;\n\t\t\tlive = false;\n\t\t\tthis._listeners.delete(listener);\n\t\t};\n\t}\n\t/** The number of currently registered listeners (test/introspection only — the routers track capacity via their own open-subscription set). */\n\tget listenerCount() {\n\t\treturn this._listeners.size;\n\t}\n};\n/** Build a {@linkcode ServerNotifier} over a bus. */\nfunction createServerNotifier(bus) {\n\treturn {\n\t\ttoolsChanged: () => bus.publish({ kind: \"tools_list_changed\" }),\n\t\tpromptsChanged: () => bus.publish({ kind: \"prompts_list_changed\" }),\n\t\tresourcesChanged: () => bus.publish({ kind: \"resources_list_changed\" }),\n\t\tresourceUpdated: (uri) => bus.publish({\n\t\t\tkind: \"resource_updated\",\n\t\t\turi\n\t\t})\n\t};\n}\n/**\n* Whether a `subscriptions/listen` filter accepts a given change event.\n*\n* Pure: no I/O, no mutation. The filter governs ONLY the four\n* subscription-gated change types — non-gated notifications never reach the\n* bus and are not modeled here.\n*\n* `resource_updated` matches only when `resourceSubscriptions` is present and\n* contains the event's URI exactly (per the spec: \"for these resource URIs\").\n*/\nfunction listenFilterAccepts(filter, event) {\n\tswitch (event.kind) {\n\t\tcase \"tools_list_changed\": return filter.toolsListChanged === true;\n\t\tcase \"prompts_list_changed\": return filter.promptsListChanged === true;\n\t\tcase \"resources_list_changed\": return filter.resourcesListChanged === true;\n\t\tcase \"resource_updated\": return filter.resourceSubscriptions !== void 0 && filter.resourceSubscriptions.includes(event.uri);\n\t}\n}\n/**\n* The honored subset of a requested filter: keeps only the fields the client\n* explicitly opted in to (drops `false` and absent fields), narrowed against\n* the server's declared capabilities when supplied. The serving entry sends\n* this back in `notifications/subscriptions/acknowledged` so the ack reflects\n* what the server can actually deliver.\n*\n* - `toolsListChanged` is honored only when `capabilities.tools.listChanged`\n*   is advertised; likewise `promptsListChanged` / `resourcesListChanged`.\n* - `resourceSubscriptions` is honored only when\n*   `capabilities.resources.subscribe` is advertised.\n*\n* `capabilities` is optional on this pure helper for test convenience only —\n* both wired routers REQUIRE capabilities at the call site (the HTTP router's\n* `serve()` takes a required parameter; `StdioListenRouter.serve()` throws\n* before `setServerCapabilities()` was called), so the fail-open\n* `undefined → honor everything` branch is never reachable on a wired entry.\n*/\nfunction honoredSubset(requested, capabilities) {\n\tconst honored = {};\n\tconst allow = (bit) => capabilities === void 0 || bit === true;\n\tif (requested.toolsListChanged === true && allow(capabilities?.tools?.listChanged)) honored.toolsListChanged = true;\n\tif (requested.promptsListChanged === true && allow(capabilities?.prompts?.listChanged)) honored.promptsListChanged = true;\n\tif (requested.resourcesListChanged === true && allow(capabilities?.resources?.listChanged)) honored.resourcesListChanged = true;\n\tif (requested.resourceSubscriptions !== void 0 && requested.resourceSubscriptions.length > 0 && allow(capabilities?.resources?.subscribe)) honored.resourceSubscriptions = [...requested.resourceSubscriptions];\n\treturn honored;\n}\n/** Map a {@linkcode ServerEvent} onto its wire notification `{method, params}`. */\nfunction serverEventToNotification(event) {\n\tswitch (event.kind) {\n\t\tcase \"tools_list_changed\": return { method: \"notifications/tools/list_changed\" };\n\t\tcase \"prompts_list_changed\": return { method: \"notifications/prompts/list_changed\" };\n\t\tcase \"resources_list_changed\": return { method: \"notifications/resources/list_changed\" };\n\t\tcase \"resource_updated\": return {\n\t\t\tmethod: \"notifications/resources/updated\",\n\t\t\tparams: { uri: event.uri }\n\t\t};\n\t}\n}\n\n//#endregion\n//#region src/server/listenRouter.ts\n/** Default capacity guard: refuse a new subscription when this many are already open. */\nconst DEFAULT_MAX_SUBSCRIPTIONS = 1024;\nfunction jsonRpcError(id, code, message) {\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode,\n\t\t\tmessage\n\t\t},\n\t\tid\n\t}, { status: 200 });\n}\n/** Stamp the subscription id onto a notification's `_meta`. Non-mutating. */\nfunction stampSubscriptionId(notification, subscriptionId) {\n\treturn {\n\t\tmethod: notification.method,\n\t\tparams: {\n\t\t\t...notification.params,\n\t\t\t_meta: {\n\t\t\t\t...notification.params?._meta,\n\t\t\t\t[SUBSCRIPTION_ID_META_KEY]: subscriptionId\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* Read the requested filter off a `subscriptions/listen` request body.\n* Returns the validated filter, or `undefined` when `params.notifications`\n* is absent or fails the schema (the caller answers `-32602` — the spec\n* marks `notifications` REQUIRED on the listen request).\n*/\nfunction parseListenFilter(message) {\n\tconst outcome = codecForVersion(MODERN_WIRE_REVISION).validateRequest(\"subscriptions/listen\", message);\n\treturn outcome.ok ? outcome.value.params?.notifications : void 0;\n}\nfunction createListenRouter(options) {\n\tconst { bus, onerror } = options;\n\tconst maxSubscriptions = options.maxSubscriptions ?? DEFAULT_MAX_SUBSCRIPTIONS;\n\tconst keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;\n\tconst open = /* @__PURE__ */ new Set();\n\tfunction serve(message, signal, capabilities, serverInfo) {\n\t\tif (open.size >= maxSubscriptions) {\n\t\t\tonerror?.(/* @__PURE__ */ new Error(`subscriptions/listen refused: subscription limit reached (${maxSubscriptions})`));\n\t\t\treturn jsonRpcError(message.id, -32603, \"Subscription limit reached\");\n\t\t}\n\t\tconst filter = parseListenFilter(message);\n\t\tif (filter === void 0) return jsonRpcError(message.id, -32602, \"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter\");\n\t\tconst honored = honoredSubset(filter, capabilities);\n\t\tconst subscriptionId = message.id;\n\t\tconst encoder = new TextEncoder();\n\t\tlet controller;\n\t\tlet closed = false;\n\t\tlet unsubscribe;\n\t\tlet keepAliveTimer;\n\t\tlet abortCleanup;\n\t\tconst writeFrame = (frame) => {\n\t\t\tif (closed) return;\n\t\t\ttry {\n\t\t\t\tcontroller.enqueue(encoder.encode(frame));\n\t\t\t} catch (error) {\n\t\t\t\tonerror?.(error instanceof Error ? error : new Error(String(error)));\n\t\t\t}\n\t\t};\n\t\tconst writeNotification = (method, params) => {\n\t\t\twriteFrame(`event: message\\ndata: ${JSON.stringify({\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tmethod,\n\t\t\t\tparams\n\t\t\t})}\\n\\n`);\n\t\t};\n\t\tconst teardown = (graceful) => {\n\t\t\tif (closed) return;\n\t\t\tif (graceful) writeFrame(`event: message\\ndata: ${JSON.stringify({\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: subscriptionId,\n\t\t\t\tresult: {\n\t\t\t\t\tresultType: \"complete\",\n\t\t\t\t\t_meta: {\n\t\t\t\t\t\t[SUBSCRIPTION_ID_META_KEY]: subscriptionId,\n\t\t\t\t\t\t[SERVER_INFO_META_KEY]: serverInfo\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})}\\n\\n`);\n\t\t\tclosed = true;\n\t\t\ttry {\n\t\t\t\tunsubscribe?.();\n\t\t\t} catch (error) {\n\t\t\t\tonerror?.(error instanceof Error ? error : new Error(String(error)));\n\t\t\t}\n\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\tabortCleanup?.();\n\t\t\topen.delete(teardown);\n\t\t\ttry {\n\t\t\t\tcontroller.close();\n\t\t\t} catch {}\n\t\t};\n\t\tconst readable = new ReadableStream({\n\t\t\tstart(streamController) {\n\t\t\t\tcontroller = streamController;\n\t\t\t\tconst ack = stampSubscriptionId({\n\t\t\t\t\tmethod: \"notifications/subscriptions/acknowledged\",\n\t\t\t\t\tparams: { notifications: honored }\n\t\t\t\t}, subscriptionId);\n\t\t\t\twriteNotification(ack.method, ack.params);\n\t\t\t\tif (Object.keys(honored).length === 0) {\n\t\t\t\t\tteardown(true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tunsubscribe = bus.subscribe((event) => {\n\t\t\t\t\tif (closed || !listenFilterAccepts(honored, event)) return;\n\t\t\t\t\tconst note = stampSubscriptionId(serverEventToNotification(event), subscriptionId);\n\t\t\t\t\twriteNotification(note.method, note.params);\n\t\t\t\t});\n\t\t\t\tkeepAliveTimer = armSseKeepAlive(keepAliveMs, () => writeFrame(\": keepalive\\n\\n\"));\n\t\t\t\topen.add(teardown);\n\t\t\t},\n\t\t\tcancel() {\n\t\t\t\tteardown(false);\n\t\t\t}\n\t\t});\n\t\tif (signal !== void 0) if (signal.aborted) teardown(false);\n\t\telse {\n\t\t\tconst onAbort = () => teardown(false);\n\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\tabortCleanup = () => signal.removeEventListener(\"abort\", onAbort);\n\t\t}\n\t\treturn new Response(readable, {\n\t\t\tstatus: 200,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\tConnection: \"keep-alive\",\n\t\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\tserve,\n\t\tcloseAll() {\n\t\t\tfor (const teardown of open) teardown(true);\n\t\t},\n\t\tget openCount() {\n\t\t\treturn open.size;\n\t\t}\n\t};\n}\nconst CHANGE_NOTIFICATION_METHODS = new Set([\n\t\"notifications/tools/list_changed\",\n\t\"notifications/prompts/list_changed\",\n\t\"notifications/resources/list_changed\",\n\t\"notifications/resources/updated\"\n]);\n/**\n* Per-connection listen state for the stdio entry. One instance is held by\n* `serveStdio` for the connection lifetime; it routes inbound\n* `subscriptions/listen` / `notifications/cancelled` and rewrites outbound\n* change notifications onto the active subscriptions. No bus — the long-lived\n* pinned instance's existing `send*ListChanged()` calls feed straight into\n* `routeOutbound()`.\n*/\nvar StdioListenRouter = class {\n\t/** Active subscriptions, keyed by the listen request's JSON-RPC id verbatim. */\n\t_subs = /* @__PURE__ */ new Map();\n\t/**\n\t* The serving instance's declared capabilities. Filled in by the entry\n\t* once the modern instance is constructed (the router is created before\n\t* the instance exists), so the acknowledged filter is narrowed against\n\t* what the server can actually deliver.\n\t*/\n\t_serverCapabilities;\n\t/**\n\t* The serving instance's identity, stamped onto the graceful-close\n\t* results' `_meta` (the spec's `SubscriptionsListenResultMetaObject` extends\n\t* `ResultMetaObject`). Handed over together with the capabilities.\n\t*/\n\t_serverInfo;\n\tconstructor(_maxSubscriptions = DEFAULT_MAX_SUBSCRIPTIONS, serverCapabilities, serverInfo) {\n\t\tthis._maxSubscriptions = _maxSubscriptions;\n\t\tthis._serverCapabilities = serverCapabilities;\n\t\tthis._serverInfo = serverInfo;\n\t}\n\t/**\n\t* Record the serving instance's declared capabilities and identity once\n\t* it has been constructed. Called by `serveStdio`'s connect path;\n\t* subsequent `serve()` calls narrow the honored filter against the\n\t* capabilities, and `teardownAll()` stamps the identity.\n\t*/\n\tsetServerCapabilities(capabilities, serverInfo) {\n\t\tthis._serverCapabilities = capabilities;\n\t\tif (serverInfo !== void 0) this._serverInfo = serverInfo;\n\t}\n\t/** Whether `id` is an active listen subscription on this connection. */\n\thas(id) {\n\t\treturn this._subs.has(id);\n\t}\n\t/**\n\t* Serve one inbound `subscriptions/listen` request: registers the\n\t* subscription and returns the stamped acknowledged notification (or, on\n\t* capacity / params rejection, the in-band JSON-RPC error response).\n\t*\n\t* @throws when called before {@linkcode setServerCapabilities} (or the\n\t* constructor) has supplied the serving instance's capabilities. Honoring a\n\t* filter without knowing the server's advertised capabilities would fail\n\t* open (deliver unadvertised types); the entry guarantees capabilities are\n\t* set before any listen request is routed here.\n\t*/\n\tserve(message) {\n\t\tif (this._serverCapabilities === void 0) throw new Error(\"StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities\");\n\t\tif (this._subs.size >= this._maxSubscriptions) return {\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid: message.id,\n\t\t\terror: {\n\t\t\t\tcode: -32603,\n\t\t\t\tmessage: \"Subscription limit reached\"\n\t\t\t}\n\t\t};\n\t\tconst filter = parseListenFilter(message);\n\t\tif (filter === void 0) return {\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid: message.id,\n\t\t\terror: {\n\t\t\t\tcode: -32602,\n\t\t\t\tmessage: \"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter\"\n\t\t\t}\n\t\t};\n\t\tconst honored = honoredSubset(filter, this._serverCapabilities);\n\t\tthis._subs.set(message.id, honored);\n\t\treturn stampSubscriptionId({\n\t\t\tmethod: \"notifications/subscriptions/acknowledged\",\n\t\t\tparams: { notifications: honored }\n\t\t}, message.id);\n\t}\n\t/**\n\t* Tear down one subscription (inbound `notifications/cancelled`). Returns\n\t* `true` when a subscription was removed. After this call NOTHING further\n\t* is delivered for that subscription id (the post-cancel hardening).\n\t*/\n\tcancel(id) {\n\t\treturn this._subs.delete(id);\n\t}\n\t/**\n\t* Route an outbound notification through the active subscriptions.\n\t*\n\t* - For a subscription-gated change notification, returns one stamped copy\n\t*   per subscription that opted in to it (an empty array means it is\n\t*   dropped — the modern era never delivers an un-requested change type).\n\t* - For any other outbound message, returns `'passthrough'` (the entry\n\t*   forwards it as-is).\n\t*/\n\trouteOutbound(message) {\n\t\tif (!CHANGE_NOTIFICATION_METHODS.has(message.method)) return \"passthrough\";\n\t\tconst uriParam = message.params?.[\"uri\"];\n\t\tconst uri = typeof uriParam === \"string\" ? uriParam : void 0;\n\t\tconst event = notificationToServerEvent(message.method, uri);\n\t\tconst out = [];\n\t\tfor (const [subscriptionId, filter] of this._subs) if (listenFilterAccepts(filter, event)) out.push(stampSubscriptionId({\n\t\t\tmethod: message.method,\n\t\t\tparams: message.params ?? {}\n\t\t}, subscriptionId));\n\t\treturn out;\n\t}\n\t/**\n\t* Server-side graceful teardown of every active subscription: returns the\n\t* empty `subscriptions/listen` JSON-RPC result for each subscription id —\n\t* the spec's graceful-close signal, `_meta` carrying the subscription id\n\t* and the serving instance's identity — for the entry to emit before\n\t* closing the wire. Clears the set so nothing further is delivered.\n\t*/\n\tteardownAll() {\n\t\tconst out = [];\n\t\tfor (const id of this._subs.keys()) out.push({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid,\n\t\t\tresult: {\n\t\t\t\tresultType: \"complete\",\n\t\t\t\t_meta: {\n\t\t\t\t\t[SUBSCRIPTION_ID_META_KEY]: id,\n\t\t\t\t\t...this._serverInfo !== void 0 && { [SERVER_INFO_META_KEY]: this._serverInfo }\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis._subs.clear();\n\t\treturn out;\n\t}\n};\nfunction notificationToServerEvent(method, uri) {\n\tswitch (method) {\n\t\tcase \"notifications/tools/list_changed\": return { kind: \"tools_list_changed\" };\n\t\tcase \"notifications/prompts/list_changed\": return { kind: \"prompts_list_changed\" };\n\t\tcase \"notifications/resources/list_changed\": return { kind: \"resources_list_changed\" };\n\t\tdefault: return {\n\t\t\tkind: \"resource_updated\",\n\t\t\turi: uri ?? \"\"\n\t\t};\n\t}\n}\n\n//#endregion\n//#region src/server/middleware/bearerAuth.ts\nfunction comparableResource(value) {\n\tconst text = String(value);\n\tconst hash = text.indexOf(\"#\");\n\treturn (hash === -1 ? text : text.slice(0, hash)).replace(/\\/$/, \"\");\n}\nfunction sameResource(reported, expected) {\n\tif (!reported) return false;\n\treturn comparableResource(reported) === comparableResource(expected);\n}\nfunction headerQuotedValue(value) {\n\treturn value.replaceAll(/[\\\\\"]/g, String.raw`\\$&`).replaceAll(/[^\\u0020-\\u007E]/g, \" \");\n}\n/**\n* Build a `WWW-Authenticate: Bearer …` challenge header value (RFC 6750).\n*\n* The single formatter behind every challenge this package emits — the\n* bearer-auth 401/403 answers and the per-operation scope-challenge 403 — so\n* all challenges from one server agree on parameter order and quoting. Every\n* parameter value is emitted as an HTTP quoted-string with `\\` and `\"`\n* escaped and non-printable characters replaced.\n*/\nfunction buildWwwAuthenticateHeader(errorCode, description, requiredScopes, resourceMetadataUrl) {\n\tlet header = `Bearer error=\"${headerQuotedValue(errorCode)}\", error_description=\"${headerQuotedValue(description)}\"`;\n\tif (requiredScopes.length > 0) header += `, scope=\"${headerQuotedValue(requiredScopes.join(\" \"))}\"`;\n\tif (resourceMetadataUrl) header += `, resource_metadata=\"${headerQuotedValue(resourceMetadataUrl)}\"`;\n\treturn header;\n}\n/**\n* Validate a raw `Authorization` header value as a Bearer token and return\n* the verified {@link AuthInfo}.\n*\n* The runtime-neutral core of Bearer authentication: it parses the header,\n* runs the verifier, compares the token's resource with `expectedResource`,\n* enforces `requiredScopes`, and rejects tokens without an\n* expiration or past it. On any failure it throws an {@link OAuthError} —\n* pass that to {@link bearerAuthChallengeResponse} for the matching HTTP\n* answer, or use {@link requireBearerAuth} to get both steps as one call.\n*\n* Framework adapters build on this: `requireBearerAuth` from\n* `@modelcontextprotocol/express` feeds it `req.headers.authorization`.\n*/\nasync function verifyBearerToken(authorizationHeader, options) {\n\tconst { verifier, requiredScopes = [], expectedResource } = options;\n\tif (!authorizationHeader) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Missing Authorization header\");\n\tconst [type, token] = authorizationHeader.split(\" \");\n\tif (type?.toLowerCase() !== \"bearer\" || !token) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Invalid Authorization header format, expected 'Bearer TOKEN'\");\n\tconst authInfo = await verifier.verifyAccessToken(token);\n\tif (expectedResource !== void 0 && !sameResource(authInfo.resource, expectedResource)) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Token was not issued for this resource\");\n\tif (requiredScopes.length > 0) {\n\t\tif (!requiredScopes.every((scope) => authInfo.scopes.includes(scope))) throw new OAuthError(OAuthErrorCode.InsufficientScope, \"Insufficient scope\");\n\t}\n\tif (typeof authInfo.expiresAt !== \"number\" || Number.isNaN(authInfo.expiresAt)) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Token has no expiration time\");\n\telse if (authInfo.expiresAt < Date.now() / 1e3) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Token has expired\");\n\tif (options.resourceMetadataUrl !== void 0 && authInfo.resourceMetadataUrl === void 0) return {\n\t\t...authInfo,\n\t\tresourceMetadataUrl: options.resourceMetadataUrl\n\t};\n\treturn authInfo;\n}\n/**\n* Build the HTTP answer for a Bearer authentication failure.\n*\n* Maps an {@link OAuthError} to its status — `401` for `invalid_token` and\n* `403` for `insufficient_scope` (both carrying the `WWW-Authenticate: Bearer …`\n* challenge, with `resource_metadata` when configured so clients can discover\n* the Authorization Server), `500` for `server_error`, `400` for anything\n* else. A non-`OAuthError` value answers `500 server_error`. The body is the\n* OAuth error JSON.\n*/\nfunction bearerAuthChallengeResponse(error, options) {\n\tconst { requiredScopes = [], resourceMetadataUrl } = options ?? {};\n\tif (!(error instanceof OAuthError)) {\n\t\tconst serverError = new OAuthError(OAuthErrorCode.ServerError, \"Internal Server Error\");\n\t\treturn Response.json(serverError.toResponseObject(), { status: 500 });\n\t}\n\tswitch (error.code) {\n\t\tcase OAuthErrorCode.InvalidToken: {\n\t\t\tconst challenge = buildWwwAuthenticateHeader(error.code, error.message, requiredScopes, resourceMetadataUrl);\n\t\t\treturn Response.json(error.toResponseObject(), {\n\t\t\t\tstatus: 401,\n\t\t\t\theaders: { \"WWW-Authenticate\": challenge }\n\t\t\t});\n\t\t}\n\t\tcase OAuthErrorCode.InsufficientScope: {\n\t\t\tconst challenge = buildWwwAuthenticateHeader(error.code, error.message, requiredScopes, resourceMetadataUrl);\n\t\t\treturn Response.json(error.toResponseObject(), {\n\t\t\t\tstatus: 403,\n\t\t\t\theaders: { \"WWW-Authenticate\": challenge }\n\t\t\t});\n\t\t}\n\t\tcase OAuthErrorCode.ServerError: return Response.json(error.toResponseObject(), { status: 500 });\n\t\tdefault: return Response.json(error.toResponseObject(), { status: 400 });\n\t}\n}\n/**\n* Require a valid Bearer token on web-standard requests.\n*\n* The framework-free counterpart of `requireBearerAuth` from\n* `@modelcontextprotocol/express`, for hosts whose HTTP surface is a\n* `fetch(request)` handler — Cloudflare Workers, Deno, Bun, Hono. The\n* returned gate resolves to the verified {@link AuthInfo}, or to the\n* ready-to-return challenge `Response` when the request must be refused.\n*\n* @example\n* ```ts source=\"./bearerAuth.examples.ts#requireBearerAuth_fetchGate\"\n* const gate = requireBearerAuth({ verifier, requiredScopes: ['mcp'] });\n*\n* async function fetchHandler(request: Request): Promise<Response> {\n*     const auth: AuthInfo | Response = await gate(request);\n*     if (auth instanceof Response) return auth;\n*     return handler.fetch(request, { authInfo: auth });\n* }\n* ```\n*/\nfunction requireBearerAuth(options) {\n\tconst { verifier, requiredScopes = [], resourceMetadataUrl, expectedResource } = options;\n\tconst resolved = {\n\t\tverifier,\n\t\trequiredScopes,\n\t\tresourceMetadataUrl,\n\t\texpectedResource\n\t};\n\treturn async (request) => {\n\t\tconst [authorizationHeader] = (request.headers.get(\"authorization\") ?? \"\").split(\",\");\n\t\ttry {\n\t\t\treturn await verifyBearerToken(authorizationHeader || void 0, resolved);\n\t\t} catch (error) {\n\t\t\treturn bearerAuthChallengeResponse(error, resolved);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/server/middleware/oauthMetadata.ts\nfunction checkIssuerUrl(issuer, allowInsecure) {\n\tif (issuer.protocol !== \"https:\" && issuer.hostname !== \"localhost\" && issuer.hostname !== \"127.0.0.1\" && !allowInsecure) throw new Error(\"Issuer URL must be HTTPS\");\n\tif (issuer.hash) throw new Error(`Issuer URL must not have a fragment: ${issuer}`);\n\tif (issuer.search) throw new Error(`Issuer URL must not have a query string: ${issuer}`);\n}\n/**\n* Derive the RFC 9728 Protected Resource Metadata document from\n* {@link AuthMetadataOptions}, validating the Authorization Server issuer URL\n* (HTTPS required outside localhost) in the process.\n*\n* `oauthMetadataResponse` and the Express `mcpAuthMetadataRouter` both build\n* on this; use it directly when serving the document through your own\n* routing — or call it once at startup to fail fast on a misconfigured\n* issuer before any request arrives.\n*/\nfunction buildOAuthProtectedResourceMetadata(options) {\n\tcheckIssuerUrl(new URL(options.oauthMetadata.issuer), options.dangerouslyAllowInsecureIssuerUrl);\n\treturn {\n\t\tresource: options.resourceServerUrl.href,\n\t\tauthorization_servers: [options.oauthMetadata.issuer],\n\t\tscopes_supported: options.scopesSupported,\n\t\tresource_name: options.resourceName,\n\t\tresource_documentation: options.serviceDocumentationUrl?.href\n\t};\n}\n/**\n* Builds the RFC 9728 Protected Resource Metadata URL for a given MCP server\n* URL by inserting `/.well-known/oauth-protected-resource` ahead of the path.\n*\n* @example\n* ```ts\n* getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp'))\n* // → 'https://api.example.com/.well-known/oauth-protected-resource/mcp'\n* ```\n*/\nfunction getOAuthProtectedResourceMetadataUrl(serverUrl) {\n\tconst metadataUrl = new URL(serverUrl);\n\tmetadataUrl.pathname = protectedResourceMetadataPath(serverUrl);\n\tmetadataUrl.hash = \"\";\n\treturn metadataUrl.href;\n}\n/** The RFC 9728 path-aware well-known path for a resource URL. */\nfunction protectedResourceMetadataPath(resourceServerUrl) {\n\tconst rsPath = stripTrailingSlash(resourceServerUrl.pathname);\n\treturn `/.well-known/oauth-protected-resource${rsPath === \"/\" ? \"\" : rsPath}`;\n}\nfunction stripTrailingSlash(path) {\n\treturn path.length > 1 && path.endsWith(\"/\") ? path.slice(0, -1) : path;\n}\nconst ALLOWED_METHODS = \"GET, HEAD, OPTIONS\";\nfunction metadataDocumentResponse(request, metadata) {\n\tif (request.method === \"OPTIONS\") {\n\t\tconst requestedHeaders = request.headers.get(\"access-control-request-headers\");\n\t\treturn new Response(null, {\n\t\t\tstatus: 204,\n\t\t\theaders: {\n\t\t\t\t\"Access-Control-Allow-Origin\": \"*\",\n\t\t\t\t\"Access-Control-Allow-Methods\": ALLOWED_METHODS,\n\t\t\t\t...requestedHeaders === null ? {} : {\n\t\t\t\t\t\"Access-Control-Allow-Headers\": requestedHeaders,\n\t\t\t\t\tVary: \"Access-Control-Request-Headers\"\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\tif (request.method !== \"GET\" && request.method !== \"HEAD\") {\n\t\tconst error = new OAuthError(OAuthErrorCode.MethodNotAllowed, `The method ${request.method} is not allowed for this endpoint`);\n\t\treturn Response.json(error.toResponseObject(), {\n\t\t\tstatus: 405,\n\t\t\theaders: {\n\t\t\t\tAllow: ALLOWED_METHODS,\n\t\t\t\t\"Access-Control-Allow-Origin\": \"*\"\n\t\t\t}\n\t\t});\n\t}\n\tconst response = Response.json(metadata, { headers: { \"Access-Control-Allow-Origin\": \"*\" } });\n\treturn request.method === \"HEAD\" ? new Response(null, {\n\t\tstatus: response.status,\n\t\theaders: response.headers\n\t}) : response;\n}\n/**\n* Serve the two OAuth discovery documents an MCP server acting as a Resource\n* Server exposes, from a web-standard `fetch(request)` handler:\n*\n*  - `/.well-known/oauth-protected-resource[/<path>]` — RFC 9728 Protected\n*    Resource Metadata, derived from the supplied options (path-aware: the\n*    resource URL's path is reflected in the route).\n*  - `/.well-known/oauth-authorization-server` — RFC 8414 Authorization\n*    Server Metadata, passed through verbatim.\n*\n* Returns the matched document `Response` (JSON with permissive CORS, `405`\n* with an `Allow` header for non-GET methods, `204` for CORS preflight), or\n* `undefined` when the request path is neither well-known route — fall\n* through to your own routing. The framework-free counterpart of\n* `mcpAuthMetadataRouter` from `@modelcontextprotocol/express`; pair it with\n* `requireBearerAuth` and `getOAuthProtectedResourceMetadataUrl` so\n* unauthenticated clients can discover the AS from the `401` challenge.\n*\n* @example\n* ```ts source=\"./oauthMetadata.examples.ts#oauthMetadataResponse_fetchHandler\"\n* async function fetchHandler(request: Request): Promise<Response> {\n*     return oauthMetadataResponse(request, options) ?? serveMcp(request);\n* }\n* ```\n*/\nfunction oauthMetadataResponse(request, options) {\n\tconst requestPath = stripTrailingSlash(new URL(request.url).pathname);\n\tif (requestPath === protectedResourceMetadataPath(options.resourceServerUrl)) return metadataDocumentResponse(request, buildOAuthProtectedResourceMetadata(options));\n\tif (requestPath === \"/.well-known/oauth-authorization-server\") {\n\t\tbuildOAuthProtectedResourceMetadata(options);\n\t\treturn metadataDocumentResponse(request, options.oauthMetadata);\n\t}\n}\n\n//#endregion\n//#region src/server/scopeChallenge.ts\n/** @internal */\nfunction supportsScopeChallengeResolver(transport) {\n\treturn typeof transport === \"object\" && transport !== null && \"setScopeChallengeResolver\" in transport && typeof transport.setScopeChallengeResolver === \"function\";\n}\nfunction assertScope(scope, location) {\n\tif (typeof scope !== \"string\" || !/^[\\u0021\\u0023-\\u005B\\u005D-\\u007E]+$/.test(scope)) throw new TypeError(`${location} must satisfy the OAuth scope-token grammar`);\n}\nfunction validateScopeChallenge(challenge) {\n\tif (challenge === null || typeof challenge !== \"object\" || !Array.isArray(challenge.scopes) || challenge.scopes.length === 0) throw new TypeError(\"scope challenge must contain at least one scope\");\n\tfor (const [index, scope] of challenge.scopes.entries()) assertScope(scope, `scope challenge scopes[${index}]`);\n\tif (challenge.errorDescription !== void 0 && typeof challenge.errorDescription !== \"string\") throw new TypeError(\"scope challenge errorDescription must be a string\");\n\tif (challenge.errorDescription !== void 0 && !/^[\\u0020-\\u0021\\u0023-\\u005B\\u005D-\\u007E]+$/.test(challenge.errorDescription)) throw new TypeError(\"scope challenge errorDescription must satisfy the RFC 6750 error-description grammar\");\n\treturn challenge;\n}\n/**\n* Creates a handler that requires every supplied scope exactly.\n*\n* Requests without authentication are left to the server's authentication gate.\n*/\nfunction requireScopes(...scopes) {\n\tif (scopes.length === 0) throw new TypeError(\"requireScopes must contain at least one scope\");\n\tfor (const [index, scope] of scopes.entries()) assertScope(scope, `requireScopes scope[${index}]`);\n\tconst requiredScopes = [...scopes];\n\treturn ({ authInfo }) => {\n\t\tif (authInfo === void 0) return;\n\t\tconst activeScopes = new Set(authInfo.scopes);\n\t\tif (requiredScopes.every((scope) => activeScopes.has(scope))) return;\n\t\treturn { scopes: requiredScopes };\n\t};\n}\n/** @internal */\nasync function findScopeChallenge(requests, authInfo, resolve) {\n\tfor (const request of requests) {\n\t\tconst challenge = await resolve({\n\t\t\trequest,\n\t\t\t...authInfo !== void 0 && { authInfo }\n\t\t});\n\t\tif (challenge !== void 0) return validateScopeChallenge(challenge);\n\t}\n}\n/**\n* The RFC 9728 Protected Resource Metadata URL to advertise on a scope\n* challenge, derived from the verified {@link AuthInfo}: the URL the\n* authentication gate stamped (`authInfo.resourceMetadataUrl`, set by the\n* bearer-auth helpers from their `resourceMetadataUrl` option), falling back\n* to the well-known location for an HTTP(S) RFC 8707 `resource` identifier, or\n* `undefined` when neither is available (the `resource_metadata` parameter is\n* then omitted, matching the bearer-auth challenges).\n*\n* @internal\n*/\nfunction scopeChallengeResourceMetadataUrl(authInfo) {\n\tif (authInfo?.resourceMetadataUrl !== void 0) return authInfo.resourceMetadataUrl;\n\tif (authInfo?.resource?.protocol === \"https:\" || authInfo?.resource?.protocol === \"http:\") return getOAuthProtectedResourceMetadataUrl(authInfo.resource);\n}\n/** @internal */\nfunction createScopeChallengeResponse(challenge, resourceMetadataUrl) {\n\treturn bearerAuthChallengeResponse(new OAuthError(OAuthErrorCode.InsufficientScope, challenge.errorDescription ?? \"Insufficient scope\"), {\n\t\trequiredScopes: [...challenge.scopes],\n\t\tresourceMetadataUrl\n\t});\n}\n\n//#endregion\n//#region src/server/legacyInputRequiredShim.ts\n/**\n* Default handler re-entries per originating request — tighter than the\n* client driver's 10 because the shim holds a live wire request open.\n*/\nconst DEFAULT_LEGACY_SHIM_MAX_ROUNDS = 8;\n/** Default per-leg timeout: legs are human-paced, so the 60s protocol default is wrong. */\nconst DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS = 6e5;\n/** Resolves and validates `ServerOptions.inputRequired`, failing loudly at construction time. */\nfunction resolveLegacyShimOptions(options) {\n\tif (options?.maxRounds !== void 0 && (!Number.isInteger(options.maxRounds) || options.maxRounds < 1)) throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${options.maxRounds})`);\n\tif (options?.roundTimeoutMs !== void 0 && (!Number.isFinite(options.roundTimeoutMs) || options.roundTimeoutMs <= 0)) throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${options.roundTimeoutMs})`);\n\treturn {\n\t\tmaxRounds: options?.maxRounds ?? DEFAULT_LEGACY_SHIM_MAX_ROUNDS,\n\t\troundTimeoutMs: options?.roundTimeoutMs ?? DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS,\n\t\tlegacyShim: options?.legacyShim ?? true\n\t};\n}\n/**\n* Validates one `inputRequests` entry: malformed or unknown kinds are server\n* bugs and fail loudly on both eras. Shared by the modern seam's capability\n* check and the shim's gate.\n*/\nfunction coerceEmbeddedInputRequest(method, key, entry) {\n\tif (entry === null || typeof entry !== \"object\" || typeof entry.method !== \"string\") throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an invalid input request '${key}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);\n\tconst embedded = entry;\n\tconst required = requiredClientCapabilitiesForInputRequest(embedded);\n\tif (required === void 0) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input request '${key}' of kind '${embedded.method}', which is not an embedded request the 2026-07-28 revision defines`);\n\treturn {\n\t\tembedded,\n\t\trequired\n\t};\n}\n/**\n* The 2025-11-25 URL-mode wire shape requires an `elicitationId`; the 2026\n* in-band shape has none, so URL legs mint one (CSPRNG-backed, with a\n* getRandomValues fallback for runtimes without `randomUUID`).\n*/\nfunction syntheticElicitationId() {\n\tconst webCrypto = globalThis.crypto;\n\tif (webCrypto?.randomUUID !== void 0) return webCrypto.randomUUID();\n\tconst bytes = new Uint8Array(16);\n\twebCrypto.getRandomValues(bytes);\n\tbytes[6] = bytes[6] & 15 | 64;\n\tbytes[8] = bytes[8] & 63 | 128;\n\tconst hex = [...bytes].map((byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n/** Per-family surfacing: tools/call → isError result (the 2025 idiom); prompts/resources → JSON-RPC error. */\nfunction legacyShimFailure(method, message) {\n\tif (method === \"tools/call\") return {\n\t\tcontent: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: message\n\t\t}],\n\t\tisError: true\n\t};\n\tthrow new ProtocolError(ProtocolErrorCode.InternalError, message);\n}\n/** The fulfilment loop — see the module doc for the contract. */\nvar LegacyInputRequiredShim = class {\n\tconstructor(_host) {\n\t\tthis._host = _host;\n\t}\n\tasync fulfill(method, handler, request, ctx, firstResult) {\n\t\tconst { maxRounds, roundTimeoutMs } = this._host;\n\t\tconst outerSignal = ctx.mcpReq.signal;\n\t\tlet current = firstResult;\n\t\tlet round = 0;\n\t\twhile (true) {\n\t\t\tround += 1;\n\t\t\tif (round > maxRounds) return legacyShimFailure(method, inputRequiredRoundsExceededMessage(method, maxRounds));\n\t\t\tconst inputRequests = current.inputRequests;\n\t\t\tconst hasInputRequests = inputRequests != null && Object.keys(inputRequests).length > 0;\n\t\t\tconst requestState = typeof current.requestState === \"string\" ? current.requestState : void 0;\n\t\t\tif (!hasInputRequests && requestState === void 0) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);\n\t\t\tlet responses;\n\t\t\tif (hasInputRequests) {\n\t\t\t\tconst declared = this._host.resolvedClientCapabilities(ctx);\n\t\t\t\tconst coerced = [];\n\t\t\t\tfor (const [key, entry] of Object.entries(inputRequests)) {\n\t\t\t\t\tconst { embedded, required } = coerceEmbeddedInputRequest(method, key, entry);\n\t\t\t\t\tif (embedded.method !== \"roots/list\" && embedded.params === void 0) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input request '${key}' of kind '${embedded.method}' without params`);\n\t\t\t\t\tif (missingClientCapabilities(required, declared) !== void 0) return legacyShimFailure(method, `Cannot request input '${key}' (${embedded.method}): the client on this 2025-era connection did not declare the required capability${declared === void 0 ? \" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)\" : \"\"}`);\n\t\t\t\t\tcoerced.push([key, embedded]);\n\t\t\t\t}\n\t\t\t\tconst roundAbort = linkedRoundAbort(outerSignal);\n\t\t\t\ttry {\n\t\t\t\t\tconst legOptions = {\n\t\t\t\t\t\trelatedRequestId: ctx.mcpReq.id,\n\t\t\t\t\t\ttimeout: roundTimeoutMs,\n\t\t\t\t\t\tresetTimeoutOnProgress: true,\n\t\t\t\t\t\tonprogress: () => {},\n\t\t\t\t\t\tsignal: roundAbort.signal\n\t\t\t\t\t};\n\t\t\t\t\tconst fulfilled = await Promise.all(coerced.map(async ([key, embedded]) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn [key, await this._dispatchLeg(embedded, legOptions)];\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\troundAbort.abort(error);\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t\tresponses = Object.fromEntries(fulfilled);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (outerSignal.aborted) throw error;\n\t\t\t\t\treturn legacyShimFailure(method, `Fulfilling input required by '${method}' failed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t\t} finally {\n\t\t\t\t\troundAbort.dispose();\n\t\t\t\t}\n\t\t\t} else await sleep(REQUEST_STATE_ONLY_LEG_PACING_MS, outerSignal);\n\t\t\tlet ctxNext = {\n\t\t\t\t...ctx,\n\t\t\t\tmcpReq: {\n\t\t\t\t\t...ctx.mcpReq,\n\t\t\t\t\tinputResponses: responses,\n\t\t\t\t\tdroppedInputResponseKeys: void 0,\n\t\t\t\t\trequestState: requestStateAccessor(requestState)\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (requestState !== void 0) {\n\t\t\t\tconst decoded = await this._host.verifyRequestState(requestState, ctxNext, method);\n\t\t\t\tif (decoded !== void 0) ctxNext = withRequestStateValue(ctxNext, decoded);\n\t\t\t}\n\t\t\tconst next = await handler(request, ctxNext);\n\t\t\tif (!isInputRequiredResult(next)) return next;\n\t\t\tcurrent = next;\n\t\t}\n\t}\n\t/** Routes one embedded request through the host's existing 2025-era senders (gate already ran). */\n\tasync _dispatchLeg(embedded, options) {\n\t\tswitch (embedded.method) {\n\t\t\tcase \"elicitation/create\": {\n\t\t\t\tlet params = embedded.params;\n\t\t\t\tif (params.mode === \"url\" && params.elicitationId === void 0) params = {\n\t\t\t\t\t...params,\n\t\t\t\t\telicitationId: syntheticElicitationId()\n\t\t\t\t};\n\t\t\t\treturn await this._host.sendElicitation(params, options);\n\t\t\t}\n\t\t\tcase \"sampling/createMessage\": return await this._host.sendSampling(embedded.params, options);\n\t\t\tcase \"roots/list\": return await this._host.listRoots(embedded.params, options);\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/server/server.ts\n/**\n* The request methods whose 2026-07-28 result vocabulary includes\n* `input_required` (the multi round-trip methods). Returning an\n* input-required result from any other handler is a server bug.\n*/\nconst INPUT_REQUIRED_CAPABLE_METHODS = new Set([\n\t\"tools/call\",\n\t\"prompts/get\",\n\t\"resources/read\"\n]);\nlet writeClientIdentity;\nlet installDiscoverHandler;\nlet readServerIdentity;\n/**\n* Package-internal: backfills the connection-scoped client-identity fields of a\n* per-request server instance from the request's validated `_meta` envelope, so the\n* (deprecated) {@linkcode Server.getClientCapabilities} / {@linkcode Server.getClientVersion}\n* accessors keep answering on instances that never see an `initialize` handshake.\n* Not public API.\n*/\nfunction seedClientIdentityFromEnvelope(server, identity) {\n\twriteClientIdentity(server, identity);\n}\n/**\n* Package-internal: installs the modern-only `server/discover` handler on an instance\n* the HTTP entry has marked as serving the 2026-07-28 era, and makes sure the modern\n* revisions the entry serves appear in the instance's supported-versions list (so the\n* discover advertisement and version-mismatch errors name them). Idempotent.\n* Hand-constructed instances are unaffected: nothing else calls this, so they keep\n* answering `-32601` unless their own supported-versions list opts into a modern\n* revision. Not public API.\n*/\nfunction installModernOnlyHandlers(server, servedModernVersions) {\n\tinstallDiscoverHandler(server, servedModernVersions);\n}\n/**\n* Package-internal: the instance's implementation identity, for the serving\n* entries to stamp onto entry-built results (the `subscriptions/listen`\n* graceful-close result — built outside the encode seam, but the spec's\n* `SubscriptionsListenResultMetaObject` extends `ResultMetaObject`, so it carries\n* the serverInfo SHOULD like every other result). Not public API.\n*/\nfunction serverIdentityOf(server) {\n\treturn readServerIdentity(server);\n}\n/**\n* An MCP server on top of a pluggable transport.\n*\n* This server will automatically respond to the initialization flow as initiated from the client.\n*\n* @deprecated Use {@linkcode server/mcp.McpServer | McpServer} instead for the high-level API. Only use `Server` for advanced use cases.\n*/\nvar Server = class extends Protocol {\n\t_clientCapabilities;\n\t_clientVersion;\n\tstatic {\n\t\twriteClientIdentity = (server, identity) => {\n\t\t\tif (identity.clientCapabilities !== void 0) server._clientCapabilities = identity.clientCapabilities;\n\t\t\tif (identity.clientInfo !== void 0) server._clientVersion = identity.clientInfo;\n\t\t};\n\t\tinstallDiscoverHandler = (server, servedModernVersions) => {\n\t\t\tconst missing = servedModernVersions.filter((version) => !server._supportedProtocolVersions.includes(version));\n\t\t\tif (missing.length > 0) server._supportedProtocolVersions = [...server._supportedProtocolVersions, ...missing];\n\t\t\tserver.setRequestHandler(\"server/discover\", () => server._ondiscover());\n\t\t};\n\t\treadServerIdentity = (server) => server._serverInfo;\n\t}\n\t_capabilities;\n\t_instructions;\n\t_jsonSchemaValidator;\n\t_cacheHints;\n\t_requestStateVerify;\n\t_inputRequiredServing;\n\t_legacyShim;\n\t/** Lazily-built legacy shim; the loop lives in legacyInputRequiredShim.ts behind a narrow host contract. */\n\t_legacyInputRequiredShim() {\n\t\treturn this._legacyShim ??= new LegacyInputRequiredShim({\n\t\t\tmaxRounds: this._inputRequiredServing.maxRounds,\n\t\t\troundTimeoutMs: this._inputRequiredServing.roundTimeoutMs,\n\t\t\tresolvedClientCapabilities: (ctx) => this._inputRequestCapabilityView(ctx),\n\t\t\tverifyRequestState: (state, ctx, method) => this._verifyRequestState(state, ctx, method),\n\t\t\tsendElicitation: (params, options) => this._sendElicitationLeg(params, options, { validateAcceptedContent: false }),\n\t\t\tsendSampling: (params, options) => this.createMessage(params, options),\n\t\t\tlistRoots: (params, options) => this.listRoots(params, options)\n\t\t});\n\t}\n\t/**\n\t* Callback for when initialization has fully completed (i.e., the client has sent an `notifications/initialized` notification).\n\t*/\n\toninitialized;\n\t/**\n\t* Initializes this server with the given name and version information.\n\t*/\n\tconstructor(_serverInfo, options) {\n\t\tsuper(options);\n\t\tthis._serverInfo = _serverInfo;\n\t\tthis._capabilities = options?.capabilities ? { ...options.capabilities } : {};\n\t\tthis._instructions = options?.instructions;\n\t\tthis._jsonSchemaValidator = options?.jsonSchemaValidator ?? new DefaultJsonSchemaValidator();\n\t\tthis._requestStateVerify = options?.requestState?.verify;\n\t\tthis._inputRequiredServing = resolveLegacyShimOptions(options?.inputRequired);\n\t\tif (options?.cacheHints !== void 0) {\n\t\t\tfor (const [operation, hint] of Object.entries(options.cacheHints)) if (hint !== void 0) assertValidCacheHint(hint, `cacheHints['${operation}']`);\n\t\t\tthis._cacheHints = options.cacheHints;\n\t\t}\n\t\tthis.setRequestHandler(\"initialize\", (request) => this._oninitialize(request));\n\t\tthis.setNotificationHandler(\"notifications/initialized\", () => this.oninitialized?.());\n\t\tif (modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler(\"server/discover\", () => this._ondiscover());\n\t\tif (this._capabilities.logging) this._registerLoggingHandler();\n\t}\n\t/** Attaches to the given transport; rejects while this instance is connected to another one. */\n\tasync connect(transport) {\n\t\tif (this.transport !== void 0) throw new SdkError(SdkErrorCode.AlreadyConnected, \"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.\");\n\t\tawait super.connect(transport);\n\t}\n\t/**\n\t* Registers the built-in `logging/setLevel` request handler.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).\n\t* Remains functional during the deprecation window (at least twelve months).\n\t* Migrate to stderr logging (STDIO servers) or OpenTelemetry.\n\t*/\n\t_registerLoggingHandler() {\n\t\tthis.setRequestHandler(\"logging/setLevel\", async (request, ctx) => {\n\t\t\tconst transportSessionId = ctx.sessionId || ctx.http?.req?.headers.get(\"mcp-session-id\") || void 0;\n\t\t\tconst { level } = request.params;\n\t\t\tconst parseResult = parseSchema(LoggingLevelSchema, level);\n\t\t\tif (parseResult.success) this._loggingLevels.set(transportSessionId, parseResult.data);\n\t\t\treturn {};\n\t\t});\n\t}\n\tbuildContext(ctx, transportInfo) {\n\t\tconst hasHttpInfo = ctx.http || transportInfo?.request || transportInfo?.closeSSEStream || transportInfo?.closeStandaloneSSEStream;\n\t\treturn {\n\t\t\t...ctx,\n\t\t\tmcpReq: {\n\t\t\t\t...ctx.mcpReq,\n\t\t\t\tlog: (level, data, logger) => {\n\t\t\t\t\tif (!this._capabilities.logging) return Promise.resolve();\n\t\t\t\t\tlet threshold;\n\t\t\t\t\tif (this._servedModernEra()) {\n\t\t\t\t\t\tthreshold = ctx.mcpReq.envelope?.[LOG_LEVEL_META_KEY];\n\t\t\t\t\t\tif (threshold === void 0) return Promise.resolve();\n\t\t\t\t\t} else threshold = this._loggingLevels.get(ctx.sessionId) ?? this._loggingLevels.get(void 0);\n\t\t\t\t\tif (threshold !== void 0 && this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(threshold)) return Promise.resolve();\n\t\t\t\t\treturn ctx.mcpReq.notify({\n\t\t\t\t\t\tmethod: \"notifications/message\",\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tlevel,\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\tlogger\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\telicitInput: (params, options) => this.elicitInput(params, options),\n\t\t\t\trequestSampling: (params, options) => this.createMessage(params, options)\n\t\t\t},\n\t\t\thttp: hasHttpInfo ? {\n\t\t\t\t...ctx.http,\n\t\t\t\treq: transportInfo?.request,\n\t\t\t\tcloseSSE: transportInfo?.closeSSEStream,\n\t\t\t\tcloseStandaloneSSE: transportInfo?.closeStandaloneSSEStream\n\t\t\t} : void 0\n\t\t};\n\t}\n\t_loggingLevels = /* @__PURE__ */ new Map();\n\tLOG_LEVEL_SEVERITY = new Map(LoggingLevelSchema.options.map((level, index) => [level, index]));\n\tisMessageIgnored = (level, sessionId) => {\n\t\tconst currentLevel = this._loggingLevels.get(sessionId);\n\t\treturn currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;\n\t};\n\t/**\n\t* Registers new capabilities. This can only be called before connecting to a transport.\n\t*\n\t* The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).\n\t*/\n\tregisterCapabilities(capabilities) {\n\t\tif (this.transport) throw new SdkError(SdkErrorCode.AlreadyConnected, \"Cannot register capabilities after connecting to transport\");\n\t\tconst hadLogging = !!this._capabilities.logging;\n\t\tthis._capabilities = mergeCapabilities(this._capabilities, capabilities);\n\t\tif (!hadLogging && this._capabilities.logging) this._registerLoggingHandler();\n\t}\n\t/**\n\t* Enforces server-side validation for `tools/call` results regardless of how the\n\t* handler was registered, attaches the configured per-operation cache hint\n\t* (when one exists) so the 2026-07-28 encode seam can fill `ttlMs`/`cacheScope`\n\t* for results that do not provide their own, and owns the multi-round-trip\n\t* seam: on the methods whose 2026-07-28 result vocabulary includes\n\t* `input_required` (`tools/call`, `prompts/get`, `resources/read`) an\n\t* input-required return skips result-schema validation and is checked\n\t* against the served era, the at-least-one rule, and the request's own\n\t* declared client capabilities; on every other method an input-required\n\t* return is a server bug and fails loudly. The hint rides a symbol-keyed\n\t* property that is never serialized, so 2025-era responses are unaffected.\n\t*/\n\t_wrapHandler(method, handler) {\n\t\tif (method !== \"tools/call\") {\n\t\t\tconst cacheHint = this._cacheHints?.[method];\n\t\t\tconst isInputRequiredCapable = INPUT_REQUIRED_CAPABLE_METHODS.has(method);\n\t\t\tif (cacheHint === void 0 && !isInputRequiredCapable) return async (request, ctx) => {\n\t\t\t\tconst result = await handler(request, ctx);\n\t\t\t\tif (isInputRequiredResult(result)) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);\n\t\t\t\treturn result;\n\t\t\t};\n\t\t\treturn async (request, ctx) => {\n\t\t\t\tconst result = isInputRequiredCapable ? await this._invokeInputRequiredCapableHandler(method, handler, request, ctx) : await handler(request, ctx);\n\t\t\t\tif (isInputRequiredResult(result)) {\n\t\t\t\t\tif (!isInputRequiredCapable) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\treturn cacheHint === void 0 ? result : attachCacheHintFallback(result, cacheHint);\n\t\t\t};\n\t\t}\n\t\treturn async (request, ctx) => {\n\t\t\tconst codec = codecForVersion(this._negotiatedProtocolVersion);\n\t\t\tconst validatedRequest = codec.validateRequest(\"tools/call\", request);\n\t\t\tif (!validatedRequest.ok) throw new ProtocolError(validatedRequest.reason === \"not-in-era\" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validatedRequest.reason === \"not-in-era\" ? \"No wire schema for tools/call in the resolved era\" : `Invalid tools/call request: ${validatedRequest.message}`);\n\t\t\tconst result = await this._invokeInputRequiredCapableHandler(\"tools/call\", handler, request, ctx);\n\t\t\tif (isInputRequiredResult(result)) return result;\n\t\t\tconst normalizedResult = normalizeContentlessToolResult(result);\n\t\t\tconst validationResult = codec.validateResult(\"tools/call\", normalizedResult);\n\t\t\tif (!validationResult.ok) throw new ProtocolError(validationResult.reason === \"not-in-era\" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validationResult.reason === \"not-in-era\" ? \"No wire schema for tools/call in the resolved era\" : `Invalid tools/call result: ${validationResult.message}`);\n\t\t\treturn validationResult.value;\n\t\t};\n\t}\n\t/**\n\t* Whether this instance is bound to a 2026-07-28-or-later protocol\n\t* revision. Era is instance state — a serving entry (`createMcpHandler`,\n\t* `serveStdio`) marks the instance modern at construction; a 2025-era\n\t* `initialize` handshake binds it legacy. The multi-round-trip seam reads\n\t* this directly: there is no per-request era consult.\n\t*/\n\t_servedModernEra() {\n\t\treturn this._negotiatedProtocolVersion !== void 0 && isModernProtocolVersion(this._negotiatedProtocolVersion);\n\t}\n\t/**\n\t* Invokes a handler for one of the multi-round-trip methods and applies\n\t* the input-required seam:\n\t*\n\t* - a `UrlElicitationRequiredError` (or any 2025-style server→client\n\t*   request idiom) escaping the handler on a request served on the\n\t*   2026-07-28 era fails LOUDLY with a clear steer to\n\t*   `inputRequired.elicitUrl(...)` — the `-32042` error never reaches the\n\t*   2026-07-28 wire and the throw is not silently converted. Requests\n\t*   served on the 2025 era keep today's `-32042` behavior byte-exact (the\n\t*   error is rethrown unchanged).\n\t* - an input-required RETURN toward a 2026-07-28 request must satisfy\n\t*   the at-least-one rule, and every embedded request must be covered by\n\t*   the capabilities declared on the request's envelope (violations\n\t*   answer the typed `-32021` error). Toward a 2025-era request the\n\t*   return is fulfilled by the default-on legacy shim, whose own gate\n\t*   consults the initialize-declared capabilities and surfaces\n\t*   violations per family; `inputRequired.legacyShim: false` restores\n\t*   the pre-shim loud failure.\n\t*/\n\tasync _invokeInputRequiredCapableHandler(method, handler, request, ctx) {\n\t\tconst servedModern = this._servedModernEra();\n\t\tconst rawRequestState = ctx.mcpReq.requestState();\n\t\tif (rawRequestState !== void 0 && typeof rawRequestState !== \"string\") throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"Invalid or expired requestState\", { reason: \"invalid_request_state\" });\n\t\tlet ctxForHandler = ctx;\n\t\tif (typeof rawRequestState === \"string\") {\n\t\t\tconst decoded = await this._verifyRequestState(rawRequestState, ctx, method);\n\t\t\tif (decoded !== void 0) ctxForHandler = withRequestStateValue(ctx, decoded);\n\t\t}\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await handler(request, ctxForHandler);\n\t\t} catch (error) {\n\t\t\tif (error instanceof ProtocolError && error.code === ProtocolErrorCode.UrlElicitationRequired) {\n\t\t\t\tif (!servedModern) throw error;\n\t\t\t\tthrow new ProtocolError(ProtocolErrorCode.InternalError, `URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tif (!isInputRequiredResult(result)) return result;\n\t\tif (!servedModern) {\n\t\t\tif (!this._inputRequiredServing.legacyShim) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion ?? LATEST_PROTOCOL_VERSION}, which has no input_required vocabulary`);\n\t\t\treturn await this._legacyInputRequiredShim().fulfill(method, handler, request, ctxForHandler, result);\n\t\t}\n\t\tconst inputRequests = result.inputRequests;\n\t\tconst hasInputRequests = inputRequests != null && Object.keys(inputRequests).length > 0;\n\t\tconst hasRequestState = typeof result.requestState === \"string\";\n\t\tif (!hasInputRequests && !hasRequestState) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);\n\t\tif (hasInputRequests) {\n\t\t\tconst declared = this._inputRequestCapabilityView(ctx);\n\t\t\tfor (const [key, entry] of Object.entries(inputRequests)) {\n\t\t\t\tconst { embedded, required } = coerceEmbeddedInputRequest(method, key, entry);\n\t\t\t\tconst missing = missingClientCapabilities(required, declared);\n\t\t\t\tif (missing !== void 0) throw new MissingRequiredClientCapabilityError({ requiredCapabilities: missing }, `Cannot request input '${key}' (${embedded.method}): the request's client capabilities do not declare the required capability`);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Runs the configured `requestState.verify` hook and returns its\n\t* resolved value (`undefined` when unconfigured or the hook returns\n\t* nothing). Deny-on-error: any hook failure answers the frozen `-32602`;\n\t* the reason goes to `onerror` only.\n\t*/\n\tasync _verifyRequestState(state, ctx, method) {\n\t\tif (this._requestStateVerify === void 0) return;\n\t\ttry {\n\t\t\treturn await this._requestStateVerify(state, ctx);\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(`requestState verification rejected ${method}: ${error instanceof Error ? error.message : String(error)}`));\n\t\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, \"Invalid or expired requestState\", { reason: \"invalid_request_state\" });\n\t\t}\n\t}\n\t/**\n\t* The per-request resolved client-capabilities view: the request's own\n\t* `_meta` envelope on the 2026 era; the `initialize`-declared state on a\n\t* 2025-era connection. Per-request instances that never saw an\n\t* initialize (stateless legacy) hold nothing, so gates refuse there.\n\t*/\n\t_inputRequestCapabilityView(ctx) {\n\t\treturn this._servedModernEra() ? ctx.mcpReq.envelope?.[CLIENT_CAPABILITIES_META_KEY] : this._clientCapabilities;\n\t}\n\t/**\n\t* Guard for the push-style server→client request APIs ({@linkcode createMessage},\n\t* {@linkcode elicitInput}, {@linkcode listRoots}, {@linkcode ping}) on a\n\t* modern-era instance: the 2026-07-28 revision has no server→client request\n\t* channel, so the call fails before any wire traffic with a typed error\n\t* whose message steers to `inputRequired(...)`. The base era gate would\n\t* also reject it; this guard runs first to carry the steer.\n\t*/\n\t_assertPushApiInServedEra(method) {\n\t\tif (this._servedModernEra()) throw new SdkError(SdkErrorCode.MethodNotSupportedByProtocolVersion, `Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${method}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`, {\n\t\t\tmethod,\n\t\t\tera: \"2026-07-28\"\n\t\t});\n\t}\n\tassertCapabilityForMethod(method) {\n\t\tswitch (method) {\n\t\t\tcase \"sampling/createMessage\":\n\t\t\t\tif (!this._clientCapabilities?.sampling) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support sampling (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"elicitation/create\":\n\t\t\t\tif (!this._clientCapabilities?.elicitation) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support elicitation (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"roots/list\":\n\t\t\t\tif (!this._clientCapabilities?.roots) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support listing roots (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"ping\": break;\n\t\t}\n\t}\n\tassertNotificationCapability(method) {\n\t\tswitch (method) {\n\t\t\tcase \"notifications/message\":\n\t\t\t\tif (!this._capabilities.logging) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support logging (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/resources/updated\":\n\t\t\tcase \"notifications/resources/list_changed\":\n\t\t\t\tif (!this._capabilities.resources) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support notifying about resources (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/tools/list_changed\":\n\t\t\t\tif (!this._capabilities.tools) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support notifying of tool list changes (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/prompts/list_changed\":\n\t\t\t\tif (!this._capabilities.prompts) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support notifying of prompt list changes (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/elicitation/complete\":\n\t\t\t\tif (!this._clientCapabilities?.elicitation?.url) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support URL elicitation (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/cancelled\": break;\n\t\t\tcase \"notifications/progress\": break;\n\t\t}\n\t}\n\tassertRequestHandlerCapability(method) {\n\t\tswitch (method) {\n\t\t\tcase \"completion/complete\":\n\t\t\t\tif (!this._capabilities.completions) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support completions (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"logging/setLevel\":\n\t\t\t\tif (!this._capabilities.logging) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support logging (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"prompts/get\":\n\t\t\tcase \"prompts/list\":\n\t\t\t\tif (!this._capabilities.prompts) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support prompts (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"resources/list\":\n\t\t\tcase \"resources/templates/list\":\n\t\t\tcase \"resources/read\":\n\t\t\t\tif (!this._capabilities.resources) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support resources (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"tools/call\":\n\t\t\tcase \"tools/list\":\n\t\t\t\tif (!this._capabilities.tools) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support tools (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"ping\":\n\t\t\tcase \"initialize\": break;\n\t\t}\n\t}\n\tasync _oninitialize(request) {\n\t\tconst requestedVersion = request.params.protocolVersion;\n\t\tthis._clientCapabilities = request.params.capabilities;\n\t\tthis._clientVersion = request.params.clientInfo;\n\t\tconst legacyVersions = legacyProtocolVersions(this._supportedProtocolVersions);\n\t\tconst protocolVersion = legacyVersions.includes(requestedVersion) ? requestedVersion : legacyVersions[0] ?? LATEST_PROTOCOL_VERSION;\n\t\tthis._negotiatedProtocolVersion = protocolVersion;\n\t\tthis.transport?.setProtocolVersion?.(protocolVersion);\n\t\treturn {\n\t\t\tprotocolVersion,\n\t\t\tcapabilities: this.getCapabilities(),\n\t\t\tserverInfo: this._serverInfo,\n\t\t\t...this._instructions && { instructions: this._instructions }\n\t\t};\n\t}\n\t/**\n\t* Answers `server/discover` (protocol revision 2026-07-28). `supportedVersions`\n\t* lists only modern revisions (2025-era versions are negotiated via `initialize`);\n\t* the capabilities are advertised as-is, listChanged/subscribe bits included\n\t* (see {@linkcode discoverAdvertisedCapabilities}).\n\t*/\n\t_ondiscover() {\n\t\treturn {\n\t\t\tsupportedVersions: modernProtocolVersions(this._supportedProtocolVersions),\n\t\t\tcapabilities: discoverAdvertisedCapabilities(this.getCapabilities()),\n\t\t\t...this._instructions && { instructions: this._instructions }\n\t\t};\n\t}\n\t/**\n\t* The identity the 2026-era encode seam stamps into every outbound\n\t* result's `_meta` under `io.modelcontextprotocol/serverInfo` (spec PR\n\t* #3002: servers SHOULD identify themselves on every response).\n\t*/\n\t_outboundServerInfo() {\n\t\treturn this._serverInfo;\n\t}\n\t/**\n\t* After initialization has completed, this will be populated with the client's reported capabilities.\n\t*\n\t* @deprecated Read client identity from the per-request handler context instead: on\n\t* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's\n\t* declared capabilities, while on 2025-era connections this accessor keeps returning the\n\t* `initialize`-scoped value. The accessor remains functional — instances serving the\n\t* 2026-07-28 era are backfilled per request from the validated envelope.\n\t*/\n\tgetClientCapabilities() {\n\t\treturn this._clientCapabilities;\n\t}\n\t/**\n\t* After initialization has completed, this will be populated with information about the client's name and version.\n\t*\n\t* @deprecated Read client identity from the per-request handler context instead: on\n\t* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's\n\t* name and version, while on 2025-era connections this accessor keeps returning the\n\t* `initialize`-scoped value. The accessor remains functional — instances serving the\n\t* 2026-07-28 era are backfilled per request from the validated envelope.\n\t*/\n\tgetClientVersion() {\n\t\treturn this._clientVersion;\n\t}\n\t/**\n\t* After initialization has completed, this will be populated with the protocol version negotiated\n\t* with the client (the version the server responded with during the initialize handshake), or\n\t* `undefined` before initialization.\n\t*\n\t* @deprecated Read the protocol revision from the per-request handler context instead: on\n\t* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` names the revision the\n\t* request was sent for, while on 2025-era connections this accessor keeps returning the\n\t* `initialize`-negotiated version. The accessor remains functional — instances serving the\n\t* 2026-07-28 era report that revision.\n\t*/\n\tgetNegotiatedProtocolVersion() {\n\t\treturn this._negotiatedProtocolVersion;\n\t}\n\t/**\n\t* Project a `tools/call` result through this instance's negotiated wire\n\t* codec — the era-agnostic SEP-2106 §4.3 TextContent auto-append, plus on\n\t* the 2025 era the `{result:…}` wrap when `structuredContent` is a\n\t* non-object value or the advertised `outputSchema` had a non-object root.\n\t* Identity for object-shaped `structuredContent` on the 2026 era.\n\t*\n\t* `McpServer`'s built-in `tools/call` handler routes through this method.\n\t* Low-level `setRequestHandler('tools/call', …)` authors call it\n\t* themselves so the projection lives in one place (the codec) and the\n\t* server-side handler stays era-blind.\n\t*\n\t* This is the only codec function exposed on `Server` — the full\n\t* `WireCodec` is intentionally not part of the public surface.\n\t*/\n\tprojectCallToolResult(result, advertisedOutputSchema) {\n\t\treturn this._wireCodec().projectCallToolResult(result, advertisedOutputSchema);\n\t}\n\t/**\n\t* Returns the current server capabilities.\n\t*/\n\tgetCapabilities() {\n\t\treturn this._capabilities;\n\t}\n\t/**\n\t* Sends a `ping` request to the connected client.\n\t*\n\t* @deprecated The 2026-07-28 protocol removed ping; it throws on a 2026-07-28-era instance.\n\t* If your factory serves both eras, this only works on the legacy path.\n\t*/\n\tasync ping() {\n\t\tthis._assertPushApiInServedEra(\"ping\");\n\t\treturn this.request({ method: \"ping\" });\n\t}\n\tasync createMessage(params, options) {\n\t\tthis._assertPushApiInServedEra(\"sampling/createMessage\");\n\t\tif ((params.tools || params.toolChoice) && !this._clientCapabilities?.sampling?.tools) throw new SdkError(SdkErrorCode.CapabilityNotSupported, \"Client does not support sampling tools capability.\");\n\t\tif (params.messages.length > 0) {\n\t\t\tconst lastMessage = params.messages.at(-1);\n\t\t\tconst lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];\n\t\t\tconst hasToolResults = lastContent.some((c) => c.type === \"tool_result\");\n\t\t\tconst previousMessage = params.messages.length > 1 ? params.messages.at(-2) : void 0;\n\t\t\tconst previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];\n\t\t\tconst hasPreviousToolUse = previousContent.some((c) => c.type === \"tool_use\");\n\t\t\tif (hasToolResults) {\n\t\t\t\tif (lastContent.some((c) => c.type !== \"tool_result\")) throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"The last message must contain only tool_result content if any is present\");\n\t\t\t\tif (!hasPreviousToolUse) throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"tool_result blocks are not matching any tool_use from the previous message\");\n\t\t\t}\n\t\t\tif (hasPreviousToolUse) {\n\t\t\t\tconst toolUseIds = new Set(previousContent.filter((c) => c.type === \"tool_use\").map((c) => c.id));\n\t\t\t\tconst toolResultIds = new Set(lastContent.filter((c) => c.type === \"tool_result\").map((c) => c.toolUseId));\n\t\t\t\tif (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"ids of tool_result blocks and tool_use blocks from previous message do not match\");\n\t\t\t}\n\t\t}\n\t\tconst hasTools = Boolean(params.tools || params.toolChoice);\n\t\tconst wide = await this.request({\n\t\t\tmethod: \"sampling/createMessage\",\n\t\t\tparams\n\t\t}, options);\n\t\tconst outcome = this._wireCodec().samplingResultVariant(hasTools, wide);\n\t\tif (!outcome.ok) throw new SdkError(SdkErrorCode.InvalidResult, `Invalid sampling/createMessage result: ${outcome.reason === \"invalid\" ? outcome.message : outcome.reason}`);\n\t\treturn outcome.value;\n\t}\n\t/**\n\t* Creates an elicitation request for the given parameters.\n\t* For backwards compatibility, `mode` may be omitted for form requests and will default to `\"form\"`.\n\t* @param params The parameters for the elicitation request.\n\t* @param options Optional request options.\n\t* @returns The result of the elicitation request.\n\t*\n\t* @deprecated Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip)\n\t* instead. The 2025 push-style server-to-client request model is replaced by input_required\n\t* results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the\n\t* legacy path.\n\t*/\n\tasync elicitInput(params, options) {\n\t\tthis._assertPushApiInServedEra(\"elicitation/create\");\n\t\tswitch (params.mode ?? \"form\") {\n\t\t\tcase \"url\":\n\t\t\t\tif (!this._clientCapabilities?.elicitation?.url) throw new SdkError(SdkErrorCode.CapabilityNotSupported, \"Client does not support url elicitation.\");\n\t\t\t\tbreak;\n\t\t\tcase \"form\":\n\t\t\t\tif (!this._clientCapabilities?.elicitation?.form) throw new SdkError(SdkErrorCode.CapabilityNotSupported, \"Client does not support form elicitation.\");\n\t\t\t\tbreak;\n\t\t}\n\t\treturn this._sendElicitationLeg(params, options);\n\t}\n\t/**\n\t* The capability-check-free core of {@linkcode elicitInput}. The shim\n\t* uses it because its gate differs from the public checks: a bare\n\t* `elicitation: {}` counts as form support (the pre-mode rule), and\n\t* accepted content passes through unvalidated for parity with the\n\t* modern client driver (handlers validate via the schema-aware\n\t* `acceptedContent` overload and can re-ask).\n\t*/\n\tasync _sendElicitationLeg(params, options, behavior) {\n\t\tconst mode = params.mode ?? \"form\";\n\t\tconst validateAcceptedContent = behavior?.validateAcceptedContent ?? true;\n\t\tswitch (mode) {\n\t\t\tcase \"url\": {\n\t\t\t\tconst urlParams = params;\n\t\t\t\treturn this.request({\n\t\t\t\t\tmethod: \"elicitation/create\",\n\t\t\t\t\tparams: urlParams\n\t\t\t\t}, options);\n\t\t\t}\n\t\t\tcase \"form\": {\n\t\t\t\tconst formParams = params.mode === \"form\" ? params : {\n\t\t\t\t\t...params,\n\t\t\t\t\tmode: \"form\"\n\t\t\t\t};\n\t\t\t\tconst result = await this.request({\n\t\t\t\t\tmethod: \"elicitation/create\",\n\t\t\t\t\tparams: formParams\n\t\t\t\t}, options);\n\t\t\t\tif (validateAcceptedContent && result.action === \"accept\" && result.content && formParams.requestedSchema) try {\n\t\t\t\t\tconst validationResult = this._jsonSchemaValidator.getValidator(formParams.requestedSchema)(result.content);\n\t\t\t\t\tif (!validationResult.valid) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (error instanceof ProtocolError) throw error;\n\t\t\t\t\tthrow new ProtocolError(ProtocolErrorCode.InternalError, `Error validating elicitation response: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`\n\t* notification for the specified elicitation ID.\n\t*\n\t* The notification (and the `elicitationId` it references) exists only on protocol revision\n\t* 2025-11-25 — the 2026-07-28 revision removed both. On a connection negotiated at 2026-07-28 the\n\t* returned callback rejects with a typed local error before anything reaches the transport\n\t* (the method is not part of that revision's wire registry).\n\t*\n\t* @param elicitationId The ID of the elicitation to mark as complete.\n\t* @param options Optional notification options. Useful when the completion notification should be related to a prior request.\n\t* @returns A function that emits the completion notification when awaited.\n\t*/\n\tcreateElicitationCompletionNotifier(elicitationId, options) {\n\t\tif (!this._clientCapabilities?.elicitation?.url) throw new SdkError(SdkErrorCode.CapabilityNotSupported, \"Client does not support URL elicitation (required for notifications/elicitation/complete)\");\n\t\treturn () => this.notification({\n\t\t\tmethod: \"notifications/elicitation/complete\",\n\t\t\tparams: { elicitationId }\n\t\t}, options);\n\t}\n\t/**\n\t* Requests the list of roots from the client.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).\n\t* Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,\n\t* or migrate to passing paths via tool parameters, resource URIs, or configuration. The 2025\n\t* push-style server-to-client request model is replaced by input_required results in the\n\t* 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.\n\t*/\n\tasync listRoots(params, options) {\n\t\tthis._assertPushApiInServedEra(\"roots/list\");\n\t\treturn this.request({\n\t\t\tmethod: \"roots/list\",\n\t\t\tparams\n\t\t}, options);\n\t}\n\t/**\n\t* Sends a logging message to the client, if connected.\n\t* Note: You only need to send the parameters object, not the entire JSON-RPC message.\n\t* @see {@linkcode LoggingMessageNotification}\n\t* @param params\n\t* @param sessionId Optional for stateless transports and backward compatibility.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).\n\t* Remains functional during the deprecation window (at least twelve months).\n\t* Migrate to stderr logging (STDIO servers) or OpenTelemetry.\n\t*/\n\tasync sendLoggingMessage(params, sessionId) {\n\t\tif (this._capabilities.logging && !this.isMessageIgnored(params.level, sessionId)) return this.notification({\n\t\t\tmethod: \"notifications/message\",\n\t\t\tparams\n\t\t});\n\t}\n\tasync sendResourceUpdated(params) {\n\t\treturn this.notification({\n\t\t\tmethod: \"notifications/resources/updated\",\n\t\t\tparams\n\t\t});\n\t}\n\tasync sendResourceListChanged() {\n\t\treturn this.notification({ method: \"notifications/resources/list_changed\" });\n\t}\n\tasync sendToolListChanged() {\n\t\treturn this.notification({ method: \"notifications/tools/list_changed\" });\n\t}\n\tasync sendPromptListChanged() {\n\t\treturn this.notification({ method: \"notifications/prompts/list_changed\" });\n\t}\n};\n/**\n* The capability set a server advertises on `server/discover`. Pure — never\n* mutates the input; the legacy `initialize` advertisement is untouched.\n*\n* The serving entries serve `subscriptions/listen` themselves, so the\n* `listChanged` and `resources.subscribe` capability bits are advertised\n* as-is: a modern-era client uses them to decide which notification types to\n* request on its listen filter.\n*/\nfunction discoverAdvertisedCapabilities(capabilities) {\n\treturn { ...capabilities };\n}\n\n//#endregion\n//#region src/server/mcp.ts\nfunction toolInputElementCount(value, max) {\n\tlet count = 0;\n\tconst stack = [value];\n\twhile (stack.length > 0) {\n\t\tconst node = stack.pop();\n\t\tif (node === null || typeof node !== \"object\") continue;\n\t\tif (Array.isArray(node)) for (const child of node) {\n\t\t\tif (++count > max) return count;\n\t\t\tif (child !== null && typeof child === \"object\") stack.push(child);\n\t\t}\n\t\telse for (const key in node) {\n\t\t\tif (!Object.prototype.hasOwnProperty.call(node, key)) continue;\n\t\t\tif (++count > max) return count;\n\t\t\tconst child = node[key];\n\t\t\tif (child !== null && typeof child === \"object\") stack.push(child);\n\t\t}\n\t}\n\treturn count;\n}\nfunction resolveMaxToolInputElements(value) {\n\tif (value === void 0 || value === Infinity) return void 0;\n\tif (typeof value !== \"number\" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);\n\treturn value;\n}\n/**\n* High-level MCP server that provides a simpler API for working with resources, tools, and prompts.\n* For advanced usage (like sending notifications or setting custom request handlers), use the underlying\n* {@linkcode Server} instance available via the {@linkcode McpServer.server | server} property.\n*\n* @example\n* ```ts source=\"./mcp.examples.ts#McpServer_basicUsage\"\n* const server = new McpServer({\n*     name: 'my-server',\n*     version: '1.0.0'\n* });\n* ```\n*/\nvar McpServer = class {\n\t/**\n\t* The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.\n\t*/\n\tserver;\n\t_maxToolInputElements;\n\t_registeredResources = {};\n\t_registeredResourceTemplates = {};\n\t_registeredTools = {};\n\t_registeredPrompts = {};\n\t/** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */\n\t_toolInputSchemaJson = {};\n\t/**\n\t* The JSON-serialized `inputSchema` of a registered tool, or `undefined`\n\t* when no such tool is registered. Used by the HTTP entry's pre-dispatch\n\t* SEP-2243 `Mcp-Param-*` validation step (which needs the same JSON Schema\n\t* `tools/list` would emit, before dispatch reaches the handler).\n\t*\n\t* @internal\n\t*/\n\ttoolInputSchemaJson(name) {\n\t\tconst tool = this._registeredTools[name];\n\t\tif (tool === void 0 || !tool.enabled) return void 0;\n\t\tif (Object.hasOwn(this._toolInputSchemaJson, name)) return this._toolInputSchemaJson[name];\n\t\tif (tool.inputSchema === void 0) return EMPTY_OBJECT_JSON_SCHEMA;\n\t\ttry {\n\t\t\tconst json = standardSchemaToJsonSchema(tool.inputSchema, \"input\");\n\t\t\tthis._toolInputSchemaJson[name] = json;\n\t\t\treturn json;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\tconstructor(serverInfo, options) {\n\t\tthis.server = new Server(serverInfo, options);\n\t\tthis._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);\n\t\tif (options?.capabilities?.tools) this.setToolRequestHandlers();\n\t\tif (options?.capabilities?.resources) this.setResourceRequestHandlers();\n\t\tif (options?.capabilities?.prompts) this.setPromptRequestHandlers();\n\t}\n\t/**\n\t* Attaches to the given transport, starts it, and starts listening for messages.\n\t*\n\t* The `server` object assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.\n\t*\n\t* @example\n\t* ```ts source=\"./mcp.examples.ts#McpServer_connect_stdio\"\n\t* const server = new McpServer({ name: 'my-server', version: '1.0.0' });\n\t* const transport = new StdioServerTransport();\n\t* await server.connect(transport);\n\t* ```\n\t*/\n\tasync connect(transport) {\n\t\tif (supportsScopeChallengeResolver(transport)) transport.setScopeChallengeResolver((context) => this.resolveScopeChallenge(context));\n\t\treturn await this.server.connect(transport);\n\t}\n\t/**\n\t* Closes the connection.\n\t*/\n\tasync close() {\n\t\tawait this.server.close();\n\t}\n\t/** @internal */\n\tresolveScopeChallenge = (context) => {\n\t\tswitch (context.request.method) {\n\t\t\tcase \"tools/call\": {\n\t\t\t\tconst toolName = context.request.params?.name;\n\t\t\t\tif (typeof toolName !== \"string\") return;\n\t\t\t\tconst tool = this._registeredTools[toolName];\n\t\t\t\tif (tool === void 0 || !tool.enabled) return;\n\t\t\t\treturn tool.scopeChallenge?.(context);\n\t\t\t}\n\t\t\tcase \"resources/read\": {\n\t\t\t\tconst resourceUri = context.request.params?.uri;\n\t\t\t\tif (typeof resourceUri !== \"string\") return;\n\t\t\t\tlet uri;\n\t\t\t\ttry {\n\t\t\t\t\turi = new URL(resourceUri);\n\t\t\t\t} catch {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst resource = this._registeredResources[uri.toString()];\n\t\t\t\tif (resource !== void 0) return resource.enabled ? resource.scopeChallenge?.(context) : void 0;\n\t\t\t\tfor (const template of Object.values(this._registeredResourceTemplates)) if (template.resourceTemplate.uriTemplate.match(uri.toString())) return template.enabled ? template.scopeChallenge?.(context) : void 0;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"prompts/get\": {\n\t\t\t\tconst promptName = context.request.params?.name;\n\t\t\t\tif (typeof promptName !== \"string\") return;\n\t\t\t\tconst prompt = this._registeredPrompts[promptName];\n\t\t\t\tif (prompt === void 0 || !prompt.enabled) return;\n\t\t\t\treturn prompt.scopeChallenge?.(context);\n\t\t\t}\n\t\t\tdefault: return;\n\t\t}\n\t};\n\t_toolHandlersInitialized = false;\n\tsetToolRequestHandlers() {\n\t\tif (this._toolHandlersInitialized) return;\n\t\tthis.server.assertCanSetRequestHandler(\"tools/list\");\n\t\tthis.server.assertCanSetRequestHandler(\"tools/call\");\n\t\tthis.server.registerCapabilities({ tools: { listChanged: this.server.getCapabilities().tools?.listChanged ?? true } });\n\t\tthis.server.setRequestHandler(\"tools/list\", () => ({ tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name, tool]) => {\n\t\t\tconst toolDefinition = {\n\t\t\t\tname,\n\t\t\t\ttitle: tool.title,\n\t\t\t\tdescription: tool.description,\n\t\t\t\tinputSchema: tool.inputSchema ? convertListedInputSchema(name, tool.inputSchema) : EMPTY_OBJECT_JSON_SCHEMA,\n\t\t\t\tannotations: tool.annotations,\n\t\t\t\ticons: tool.icons,\n\t\t\t\texecution: tool.execution,\n\t\t\t\t_meta: tool._meta\n\t\t\t};\n\t\t\tif (tool.outputSchema) toolDefinition.outputSchema = standardSchemaToJsonSchema(tool.outputSchema, \"output\");\n\t\t\treturn toolDefinition;\n\t\t}) }));\n\t\tthis.server.setRequestHandler(\"tools/call\", async (request, ctx) => {\n\t\t\tconst tool = this._registeredTools[request.params.name];\n\t\t\tif (!tool) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Tool ${request.params.name} not found`);\n\t\t\tif (!tool.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);\n\t\t\ttry {\n\t\t\t\tconst args = await this.validateToolInput(tool, request.params.arguments, request.params.name);\n\t\t\t\tconst result = await this.executeToolHandler(tool, args, ctx);\n\t\t\t\tawait this.validateToolOutput(tool, result, request.params.name);\n\t\t\t\tif (isInputRequiredResult(result)) return result;\n\t\t\t\treturn this.server.projectCallToolResult(result, tool.outputSchemaJson);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof ProtocolError && error.code === ProtocolErrorCode.UrlElicitationRequired) throw error;\n\t\t\t\treturn this.createToolError(error instanceof Error ? error.message : String(error));\n\t\t\t}\n\t\t});\n\t\tthis._toolHandlersInitialized = true;\n\t}\n\t/**\n\t* Creates a tool error result.\n\t*\n\t* @param errorMessage - The error message.\n\t* @returns The tool error result.\n\t*/\n\tcreateToolError(errorMessage) {\n\t\treturn {\n\t\t\tcontent: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: errorMessage\n\t\t\t}],\n\t\t\tisError: true\n\t\t};\n\t}\n\t/**\n\t* Validates tool input arguments against the tool's input schema.\n\t*/\n\tasync validateToolInput(tool, args, toolName) {\n\t\tif (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);\n\t\tif (!tool.inputSchema) return;\n\t\tconst parseResult = await validateStandardSchema(tool.inputSchema, args ?? {});\n\t\tif (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);\n\t\treturn parseResult.data;\n\t}\n\t/**\n\t* Validates tool output against the tool's output schema.\n\t*/\n\tasync validateToolOutput(tool, result, toolName) {\n\t\tif (!tool.outputSchema) return;\n\t\tif (isInputRequiredResult(result)) return;\n\t\tif (result.isError) return;\n\t\tif (result.structuredContent === void 0) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`);\n\t\tconst parseResult = await validateStandardSchema(tool.outputSchema, result.structuredContent);\n\t\tif (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${parseResult.error}`);\n\t}\n\t/**\n\t* Executes a tool handler.\n\t*/\n\tasync executeToolHandler(tool, args, ctx) {\n\t\treturn tool.executor(args, ctx);\n\t}\n\t_completionHandlerInitialized = false;\n\tsetCompletionRequestHandler() {\n\t\tif (this._completionHandlerInitialized) return;\n\t\tthis.server.assertCanSetRequestHandler(\"completion/complete\");\n\t\tthis.server.registerCapabilities({ completions: {} });\n\t\tthis.server.setRequestHandler(\"completion/complete\", async (request) => {\n\t\t\tswitch (request.params.ref.type) {\n\t\t\t\tcase \"ref/prompt\":\n\t\t\t\t\tassertCompleteRequestPrompt(request);\n\t\t\t\t\treturn this.handlePromptCompletion(request, request.params.ref);\n\t\t\t\tcase \"ref/resource\":\n\t\t\t\t\tassertCompleteRequestResourceTemplate(request);\n\t\t\t\t\treturn this.handleResourceCompletion(request, request.params.ref);\n\t\t\t\tdefault: throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`);\n\t\t\t}\n\t\t});\n\t\tthis._completionHandlerInitialized = true;\n\t}\n\tasync handlePromptCompletion(request, ref) {\n\t\tconst prompt = this._registeredPrompts[ref.name];\n\t\tif (!prompt) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Prompt ${ref.name} not found`);\n\t\tif (!prompt.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Prompt ${ref.name} disabled`);\n\t\tif (!prompt.argsSchema) return EMPTY_COMPLETION_RESULT;\n\t\tconst field = unwrapOptionalSchema(getSchemaShape(prompt.argsSchema)?.[request.params.argument.name]);\n\t\tif (!isCompletable(field)) return EMPTY_COMPLETION_RESULT;\n\t\tconst completer = getCompleter(field);\n\t\tif (!completer) return EMPTY_COMPLETION_RESULT;\n\t\treturn createCompletionResult(await completer(request.params.argument.value, request.params.context));\n\t}\n\tasync handleResourceCompletion(request, ref) {\n\t\tconst template = Object.values(this._registeredResourceTemplates).find((t) => t.resourceTemplate.uriTemplate.toString() === ref.uri);\n\t\tif (!template) {\n\t\t\tif (this._registeredResources[ref.uri]) return EMPTY_COMPLETION_RESULT;\n\t\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`);\n\t\t}\n\t\tconst completer = template.resourceTemplate.completeCallback(request.params.argument.name);\n\t\tif (!completer) return EMPTY_COMPLETION_RESULT;\n\t\treturn createCompletionResult(await completer(request.params.argument.value, request.params.context));\n\t}\n\t_resourceHandlersInitialized = false;\n\tsetResourceRequestHandlers() {\n\t\tif (this._resourceHandlersInitialized) return;\n\t\tthis.server.assertCanSetRequestHandler(\"resources/list\");\n\t\tthis.server.assertCanSetRequestHandler(\"resources/templates/list\");\n\t\tthis.server.assertCanSetRequestHandler(\"resources/read\");\n\t\tthis.server.registerCapabilities({ resources: { listChanged: this.server.getCapabilities().resources?.listChanged ?? true } });\n\t\tthis.server.setRequestHandler(\"resources/list\", async (_request, ctx) => {\n\t\t\tconst resources = Object.entries(this._registeredResources).filter(([_, resource]) => resource.enabled).map(([uri, resource]) => ({\n\t\t\t\turi,\n\t\t\t\tname: resource.name,\n\t\t\t\t...resource.metadata\n\t\t\t}));\n\t\t\tconst templateResources = [];\n\t\t\tfor (const template of Object.values(this._registeredResourceTemplates)) {\n\t\t\t\tif (!template.resourceTemplate.listCallback) continue;\n\t\t\t\tconst result = await template.resourceTemplate.listCallback(ctx);\n\t\t\t\tfor (const resource of result.resources) templateResources.push({\n\t\t\t\t\t...template.metadata,\n\t\t\t\t\t...resource\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn { resources: [...resources, ...templateResources] };\n\t\t});\n\t\tthis.server.setRequestHandler(\"resources/templates/list\", async () => {\n\t\t\treturn { resourceTemplates: Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({\n\t\t\t\tname,\n\t\t\t\turiTemplate: template.resourceTemplate.uriTemplate.toString(),\n\t\t\t\t...template.metadata\n\t\t\t})) };\n\t\t});\n\t\tthis.server.setRequestHandler(\"resources/read\", async (request, ctx) => {\n\t\t\tlet uri;\n\t\t\ttry {\n\t\t\t\turi = new URL(request.params.uri);\n\t\t\t} catch {\n\t\t\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource URI ${request.params.uri} is invalid`, {\n\t\t\t\t\turi: request.params.uri,\n\t\t\t\t\treason: \"invalid_uri\"\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst resource = this._registeredResources[uri.toString()];\n\t\t\tif (resource) {\n\t\t\t\tif (!resource.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource ${uri} disabled`);\n\t\t\t\treturn attachCacheHintFallback(await resource.readCallback(uri, ctx), resource.cacheHint);\n\t\t\t}\n\t\t\tfor (const template of Object.values(this._registeredResourceTemplates)) {\n\t\t\t\tconst variables = template.resourceTemplate.uriTemplate.match(uri.toString());\n\t\t\t\tif (variables) {\n\t\t\t\t\tif (!template.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource template ${template.resourceTemplate.uriTemplate} disabled`);\n\t\t\t\t\treturn attachCacheHintFallback(await template.readCallback(uri, variables, ctx), template.cacheHint);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new ResourceNotFoundError(request.params.uri);\n\t\t});\n\t\tthis._resourceHandlersInitialized = true;\n\t}\n\t_promptHandlersInitialized = false;\n\tsetPromptRequestHandlers() {\n\t\tif (this._promptHandlersInitialized) return;\n\t\tthis.server.assertCanSetRequestHandler(\"prompts/list\");\n\t\tthis.server.assertCanSetRequestHandler(\"prompts/get\");\n\t\tthis.server.registerCapabilities({ prompts: { listChanged: this.server.getCapabilities().prompts?.listChanged ?? true } });\n\t\tthis.server.setRequestHandler(\"prompts/list\", () => ({ prompts: Object.entries(this._registeredPrompts).filter(([, prompt]) => prompt.enabled).map(([name, prompt]) => {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\ttitle: prompt.title,\n\t\t\t\tdescription: prompt.description,\n\t\t\t\targuments: prompt.argsSchema ? promptArgumentsFromStandardSchema(prompt.argsSchema) : void 0,\n\t\t\t\ticons: prompt.icons,\n\t\t\t\t_meta: prompt._meta\n\t\t\t};\n\t\t}) }));\n\t\tthis.server.setRequestHandler(\"prompts/get\", async (request, ctx) => {\n\t\t\tconst prompt = this._registeredPrompts[request.params.name];\n\t\t\tif (!prompt) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Prompt ${request.params.name} not found`);\n\t\t\tif (!prompt.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`);\n\t\t\treturn prompt.handler(request.params.arguments, ctx);\n\t\t});\n\t\tthis._promptHandlersInitialized = true;\n\t}\n\tregisterResource(name, uriOrTemplate, config, readCallback) {\n\t\tconst { cacheHint, scopeChallenge, ...resourceMetadata } = config;\n\t\tconst metadata = resourceMetadata;\n\t\tif (cacheHint !== void 0) assertValidCacheHint(cacheHint, `resource ${name}`);\n\t\tif (typeof uriOrTemplate === \"string\") {\n\t\t\tif (this._registeredResources[uriOrTemplate]) throw new Error(`Resource ${uriOrTemplate} is already registered`);\n\t\t\tconst registeredResource = this._createRegisteredResource(name, config.title, uriOrTemplate, metadata, scopeChallenge, readCallback);\n\t\t\tif (cacheHint !== void 0) registeredResource.cacheHint = cacheHint;\n\t\t\tthis.setResourceRequestHandlers();\n\t\t\tthis.sendResourceListChanged();\n\t\t\treturn registeredResource;\n\t\t} else {\n\t\t\tif (this._registeredResourceTemplates[name]) throw new Error(`Resource template ${name} is already registered`);\n\t\t\tconst registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config.title, uriOrTemplate, metadata, scopeChallenge, readCallback);\n\t\t\tif (cacheHint !== void 0) registeredResourceTemplate.cacheHint = cacheHint;\n\t\t\tthis.setResourceRequestHandlers();\n\t\t\tthis.sendResourceListChanged();\n\t\t\treturn registeredResourceTemplate;\n\t\t}\n\t}\n\t_createRegisteredResource(name, title, uri, metadata, scopeChallenge, readCallback) {\n\t\tconst registeredResource = {\n\t\t\tname,\n\t\t\ttitle,\n\t\t\tmetadata,\n\t\t\treadCallback,\n\t\t\tscopeChallenge,\n\t\t\tenabled: true,\n\t\t\tdisable: () => registeredResource.update({ enabled: false }),\n\t\t\tenable: () => registeredResource.update({ enabled: true }),\n\t\t\tremove: () => registeredResource.update({ uri: null }),\n\t\t\tupdate: (updates) => {\n\t\t\t\tif (updates.uri !== void 0 && updates.uri !== uri) {\n\t\t\t\t\tdelete this._registeredResources[uri];\n\t\t\t\t\tif (updates.uri) this._registeredResources[updates.uri] = registeredResource;\n\t\t\t\t}\n\t\t\t\tif (updates.name !== void 0) registeredResource.name = updates.name;\n\t\t\t\tif (updates.title !== void 0) registeredResource.title = updates.title;\n\t\t\t\tif (updates.metadata !== void 0) registeredResource.metadata = updates.metadata;\n\t\t\t\tif (updates.callback !== void 0) registeredResource.readCallback = updates.callback;\n\t\t\t\tif (updates.scopeChallenge !== void 0) registeredResource.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;\n\t\t\t\tif (updates.enabled !== void 0) registeredResource.enabled = updates.enabled;\n\t\t\t\tthis.sendResourceListChanged();\n\t\t\t}\n\t\t};\n\t\tthis._registeredResources[uri] = registeredResource;\n\t\treturn registeredResource;\n\t}\n\t_createRegisteredResourceTemplate(name, title, template, metadata, scopeChallenge, readCallback) {\n\t\tconst registeredResourceTemplate = {\n\t\t\tresourceTemplate: template,\n\t\t\ttitle,\n\t\t\tmetadata,\n\t\t\treadCallback,\n\t\t\tscopeChallenge,\n\t\t\tenabled: true,\n\t\t\tdisable: () => registeredResourceTemplate.update({ enabled: false }),\n\t\t\tenable: () => registeredResourceTemplate.update({ enabled: true }),\n\t\t\tremove: () => registeredResourceTemplate.update({ name: null }),\n\t\t\tupdate: (updates) => {\n\t\t\t\tif (updates.name !== void 0 && updates.name !== name) {\n\t\t\t\t\tdelete this._registeredResourceTemplates[name];\n\t\t\t\t\tif (updates.name) this._registeredResourceTemplates[updates.name] = registeredResourceTemplate;\n\t\t\t\t}\n\t\t\t\tif (updates.title !== void 0) registeredResourceTemplate.title = updates.title;\n\t\t\t\tif (updates.template !== void 0) registeredResourceTemplate.resourceTemplate = updates.template;\n\t\t\t\tif (updates.metadata !== void 0) registeredResourceTemplate.metadata = updates.metadata;\n\t\t\t\tif (updates.callback !== void 0) registeredResourceTemplate.readCallback = updates.callback;\n\t\t\t\tif (updates.scopeChallenge !== void 0) registeredResourceTemplate.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;\n\t\t\t\tif (updates.enabled !== void 0) registeredResourceTemplate.enabled = updates.enabled;\n\t\t\t\tthis.sendResourceListChanged();\n\t\t\t}\n\t\t};\n\t\tthis._registeredResourceTemplates[name] = registeredResourceTemplate;\n\t\tconst variableNames = template.uriTemplate.variableNames;\n\t\tif (Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v))) this.setCompletionRequestHandler();\n\t\treturn registeredResourceTemplate;\n\t}\n\t_createRegisteredPrompt(name, title, description, argsSchema, callback, icons, scopeChallenge, _meta) {\n\t\tlet currentArgsSchema = argsSchema;\n\t\tlet currentCallback = callback;\n\t\tconst registeredPrompt = {\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\targsSchema,\n\t\t\ticons,\n\t\t\tscopeChallenge,\n\t\t\t_meta,\n\t\t\thandler: createPromptHandler(name, argsSchema, callback),\n\t\t\tenabled: true,\n\t\t\tdisable: () => registeredPrompt.update({ enabled: false }),\n\t\t\tenable: () => registeredPrompt.update({ enabled: true }),\n\t\t\tremove: () => registeredPrompt.update({ name: null }),\n\t\t\tupdate: (updates) => {\n\t\t\t\tif (updates.name !== void 0 && updates.name !== name) {\n\t\t\t\t\tdelete this._registeredPrompts[name];\n\t\t\t\t\tif (updates.name) this._registeredPrompts[updates.name] = registeredPrompt;\n\t\t\t\t}\n\t\t\t\tif (updates.title !== void 0) registeredPrompt.title = updates.title;\n\t\t\t\tif (updates.description !== void 0) registeredPrompt.description = updates.description;\n\t\t\t\tif (updates.icons !== void 0) registeredPrompt.icons = updates.icons;\n\t\t\t\tif (updates.scopeChallenge !== void 0) registeredPrompt.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;\n\t\t\t\tif (updates._meta !== void 0) registeredPrompt._meta = updates._meta;\n\t\t\t\tlet needsHandlerRegen = false;\n\t\t\t\tif (updates.argsSchema !== void 0) {\n\t\t\t\t\tregisteredPrompt.argsSchema = updates.argsSchema;\n\t\t\t\t\tcurrentArgsSchema = updates.argsSchema;\n\t\t\t\t\tneedsHandlerRegen = true;\n\t\t\t\t}\n\t\t\t\tif (updates.callback !== void 0) {\n\t\t\t\t\tcurrentCallback = updates.callback;\n\t\t\t\t\tneedsHandlerRegen = true;\n\t\t\t\t}\n\t\t\t\tif (needsHandlerRegen) registeredPrompt.handler = createPromptHandler(name, currentArgsSchema, currentCallback);\n\t\t\t\tif (updates.enabled !== void 0) registeredPrompt.enabled = updates.enabled;\n\t\t\t\tthis.sendPromptListChanged();\n\t\t\t}\n\t\t};\n\t\tthis._registeredPrompts[name] = registeredPrompt;\n\t\tif (argsSchema) {\n\t\t\tconst shape = getSchemaShape(argsSchema);\n\t\t\tif (shape) {\n\t\t\t\tif (Object.values(shape).some((field) => {\n\t\t\t\t\treturn isCompletable(unwrapOptionalSchema(field));\n\t\t\t\t})) this.setCompletionRequestHandler();\n\t\t\t}\n\t\t}\n\t\treturn registeredPrompt;\n\t}\n\t_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {\n\t\tvalidateAndWarnToolName(name);\n\t\tlet currentHandler = handler;\n\t\tlet outputSchemaJson;\n\t\tconst registeredTool = {\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tinputSchema,\n\t\t\toutputSchema,\n\t\t\tget outputSchemaJson() {\n\t\t\t\treturn outputSchemaJson ??= convertOutputSchemaJson(registeredTool.outputSchema);\n\t\t\t},\n\t\t\tset outputSchemaJson(value) {\n\t\t\t\toutputSchemaJson = value;\n\t\t\t},\n\t\t\tannotations,\n\t\t\ticons,\n\t\t\texecution,\n\t\t\tscopeChallenge,\n\t\t\t_meta,\n\t\t\thandler,\n\t\t\texecutor: createToolExecutor(inputSchema, handler),\n\t\t\tenabled: true,\n\t\t\tdisable: () => registeredTool.update({ enabled: false }),\n\t\t\tenable: () => registeredTool.update({ enabled: true }),\n\t\t\tremove: () => registeredTool.update({ name: null }),\n\t\t\tupdate: (updates) => {\n\t\t\t\tif (updates.name !== void 0 && updates.name !== name) {\n\t\t\t\t\tif (typeof updates.name === \"string\") validateAndWarnToolName(updates.name);\n\t\t\t\t\tdelete this._registeredTools[name];\n\t\t\t\t\tdelete this._toolInputSchemaJson[name];\n\t\t\t\t\tif (updates.name) {\n\t\t\t\t\t\tdelete this._toolInputSchemaJson[updates.name];\n\t\t\t\t\t\tthis._registeredTools[updates.name] = registeredTool;\n\t\t\t\t\t\tname = updates.name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (updates.title !== void 0) registeredTool.title = updates.title;\n\t\t\t\tif (updates.description !== void 0) registeredTool.description = updates.description;\n\t\t\t\tlet needsExecutorRegen = false;\n\t\t\t\tif (updates.paramsSchema !== void 0) {\n\t\t\t\t\tregisteredTool.inputSchema = updates.paramsSchema;\n\t\t\t\t\tdelete this._toolInputSchemaJson[name];\n\t\t\t\t\tneedsExecutorRegen = true;\n\t\t\t\t}\n\t\t\t\tif (updates.callback !== void 0) {\n\t\t\t\t\tregisteredTool.handler = updates.callback;\n\t\t\t\t\tcurrentHandler = updates.callback;\n\t\t\t\t\tneedsExecutorRegen = true;\n\t\t\t\t}\n\t\t\t\tif (needsExecutorRegen) registeredTool.executor = createToolExecutor(registeredTool.inputSchema, currentHandler);\n\t\t\t\tif (updates.outputSchema !== void 0) {\n\t\t\t\t\tregisteredTool.outputSchema = updates.outputSchema;\n\t\t\t\t\tregisteredTool.outputSchemaJson = convertOutputSchemaJson(updates.outputSchema);\n\t\t\t\t}\n\t\t\t\tif (updates.annotations !== void 0) registeredTool.annotations = updates.annotations;\n\t\t\t\tif (updates.icons !== void 0) registeredTool.icons = updates.icons;\n\t\t\t\tif (updates.scopeChallenge !== void 0) registeredTool.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;\n\t\t\t\tif (updates._meta !== void 0) registeredTool._meta = updates._meta;\n\t\t\t\tif (updates.enabled !== void 0) registeredTool.enabled = updates.enabled;\n\t\t\t\tthis.sendToolListChanged();\n\t\t\t}\n\t\t};\n\t\tthis._registeredTools[name] = registeredTool;\n\t\tthis.setToolRequestHandlers();\n\t\tthis.sendToolListChanged();\n\t\treturn registeredTool;\n\t}\n\tregisterTool(name, config, cb) {\n\t\tif (this._registeredTools[name]) throw new Error(`Tool ${name} is already registered`);\n\t\tconst { title, description, inputSchema, outputSchema, annotations, icons, scopeChallenge, _meta } = config;\n\t\treturn this._createRegisteredTool(name, title, description, normalizeRawShapeSchema(inputSchema), normalizeRawShapeSchema(outputSchema), annotations, icons, void 0, scopeChallenge, _meta, cb);\n\t}\n\tregisterPrompt(name, config, cb) {\n\t\tif (this._registeredPrompts[name]) throw new Error(`Prompt ${name} is already registered`);\n\t\tconst { title, description, argsSchema, icons, scopeChallenge, _meta } = config;\n\t\tconst registeredPrompt = this._createRegisteredPrompt(name, title, description, normalizeRawShapeSchema(argsSchema), cb, icons, scopeChallenge, _meta);\n\t\tthis.setPromptRequestHandlers();\n\t\tthis.sendPromptListChanged();\n\t\treturn registeredPrompt;\n\t}\n\t/**\n\t* Checks if the server is connected to a transport.\n\t* @returns `true` if the server is connected\n\t*/\n\tisConnected() {\n\t\treturn this.server.transport !== void 0;\n\t}\n\t/**\n\t* Sends a logging message to the client, if connected.\n\t* Note: You only need to send the parameters object, not the entire JSON-RPC message.\n\t* @see {@linkcode LoggingMessageNotification}\n\t* @param params\n\t* @param sessionId Optional for stateless transports and backward compatibility.\n\t*\n\t* @example\n\t* ```ts source=\"./mcp.examples.ts#McpServer_sendLoggingMessage_basic\"\n\t* await server.sendLoggingMessage({\n\t*     level: 'info',\n\t*     data: 'Processing complete'\n\t* });\n\t* ```\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).\n\t* Remains functional during the deprecation window (at least twelve months).\n\t* Migrate to stderr logging (STDIO servers) or OpenTelemetry.\n\t*/\n\tasync sendLoggingMessage(params, sessionId) {\n\t\treturn this.server.sendLoggingMessage(params, sessionId);\n\t}\n\t/**\n\t* Sends a resource list changed event to the client, if connected.\n\t*/\n\tsendResourceListChanged() {\n\t\tif (this.isConnected()) this.server.sendResourceListChanged();\n\t}\n\t/**\n\t* Sends a tool list changed event to the client, if connected.\n\t*/\n\tsendToolListChanged() {\n\t\tif (this.isConnected()) this.server.sendToolListChanged();\n\t}\n\t/**\n\t* Sends a prompt list changed event to the client, if connected.\n\t*/\n\tsendPromptListChanged() {\n\t\tif (this.isConnected()) this.server.sendPromptListChanged();\n\t}\n};\n/**\n* A resource template combines a URI pattern with optional functionality to enumerate\n* all resources matching that pattern.\n*/\nvar ResourceTemplate = class {\n\t_uriTemplate;\n\tconstructor(uriTemplate, _callbacks) {\n\t\tthis._callbacks = _callbacks;\n\t\tthis._uriTemplate = typeof uriTemplate === \"string\" ? new UriTemplate(uriTemplate) : uriTemplate;\n\t}\n\t/**\n\t* Gets the URI template pattern.\n\t*/\n\tget uriTemplate() {\n\t\treturn this._uriTemplate;\n\t}\n\t/**\n\t* Gets the list callback, if one was provided.\n\t*/\n\tget listCallback() {\n\t\treturn this._callbacks.list;\n\t}\n\t/**\n\t* Gets the callback for completing a specific URI template variable, if one was provided.\n\t*/\n\tcompleteCallback(variable) {\n\t\treturn this._callbacks.complete?.[variable];\n\t}\n};\n/**\n* Creates an executor that invokes the handler with the appropriate arguments.\n* When `inputSchema` is defined, the handler is called with `(args, ctx)`.\n* When `inputSchema` is undefined, the handler is called with just `(ctx)`.\n*/\nfunction createToolExecutor(inputSchema, handler) {\n\tif (inputSchema) {\n\t\tconst callback$1 = handler;\n\t\treturn async (args, ctx) => callback$1(args, ctx);\n\t}\n\tconst callback = handler;\n\treturn async (_args, ctx) => callback(ctx);\n}\nconst EMPTY_OBJECT_JSON_SCHEMA = {\n\ttype: \"object\",\n\tproperties: {}\n};\n/** Converts a tool's `inputSchema` for `tools/list` and warns on an invalid SEP-2243 `x-mcp-header` declaration. */\nfunction convertListedInputSchema(name, inputSchema) {\n\tconst json = standardSchemaToJsonSchema(inputSchema, \"input\");\n\tconst scan = scanXMcpHeaderDeclarations(json);\n\tif (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);\n\treturn json;\n}\n/**\n* Convert a registered `outputSchema` to JSON Schema, memoised on {@link RegisteredTool.outputSchemaJson}\n* so `tools/call` passes the SAME advertised schema to the wire codec's `projectCallToolResult` that\n* `tools/list` emits (and that the 2025 codec's `encodeResult('tools/list', …)` may wrap). A conversion\n* failure yields `undefined` so the failure surfaces where it always has (`tools/list`).\n*/\nfunction convertOutputSchemaJson(outputSchema) {\n\tif (outputSchema === void 0) return void 0;\n\ttry {\n\t\treturn standardSchemaToJsonSchema(outputSchema, \"output\");\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* Creates a type-safe prompt handler that captures the schema and callback in a closure.\n* This eliminates the need for type assertions at the call site.\n*/\nfunction createPromptHandler(name, argsSchema, callback) {\n\tif (argsSchema) {\n\t\tconst typedCallback = callback;\n\t\treturn async (args, ctx) => {\n\t\t\tconst parseResult = await validateStandardSchema(argsSchema, args ?? {});\n\t\t\tif (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name}: ${parseResult.error}`);\n\t\t\treturn typedCallback(parseResult.data, ctx);\n\t\t};\n\t} else {\n\t\tconst typedCallback = callback;\n\t\treturn async (_args, ctx) => {\n\t\t\treturn typedCallback(ctx);\n\t\t};\n\t}\n}\nfunction createCompletionResult(suggestions) {\n\treturn { completion: {\n\t\tvalues: suggestions.map(String).slice(0, 100),\n\t\ttotal: suggestions.length,\n\t\thasMore: suggestions.length > 100\n\t} };\n}\nconst EMPTY_COMPLETION_RESULT = { completion: {\n\tvalues: [],\n\thasMore: false\n} };\n/** @internal Gets the shape of a Zod object schema */\nfunction getSchemaShape(schema) {\n\tconst candidate = schema;\n\tif (candidate.shape && typeof candidate.shape === \"object\") return candidate.shape;\n}\n/** @internal Checks if a Zod schema is optional */\nfunction isOptionalSchema(schema) {\n\treturn schema?.type === \"optional\";\n}\n/** @internal Unwraps an optional Zod schema */\nfunction unwrapOptionalSchema(schema) {\n\tif (!isOptionalSchema(schema)) return schema;\n\treturn schema.def?.innerType ?? schema;\n}\n\n//#endregion\nexport { armSseKeepAlive as C, DEFAULT_SSE_KEEP_ALIVE_MS as S, isCompletable as T, DEFAULT_MAX_SUBSCRIPTIONS as _, seedClientIdentityFromEnvelope as a, InMemoryServerEventBus as b, findScopeChallenge as c, buildOAuthProtectedResourceMetadata as d, getOAuthProtectedResourceMetadataUrl as f, verifyBearerToken as g, requireBearerAuth as h, installModernOnlyHandlers as i, requireScopes as l, bearerAuthChallengeResponse as m, ResourceTemplate as n, serverIdentityOf as o, oauthMetadataResponse as p, Server as r, createScopeChallengeResponse as s, McpServer as t, scopeChallengeResourceMetadataUrl as u, StdioListenRouter as v, completable as w, createServerNotifier as x, createListenRouter as y };\n//# sourceMappingURL=mcp-DIH4cS6P.mjs.map","import { C as armSseKeepAlive, S as DEFAULT_SSE_KEEP_ALIVE_MS, T as isCompletable, _ as DEFAULT_MAX_SUBSCRIPTIONS, a as seedClientIdentityFromEnvelope, b as InMemoryServerEventBus, c as findScopeChallenge, d as buildOAuthProtectedResourceMetadata, f as getOAuthProtectedResourceMetadataUrl, g as verifyBearerToken, h as requireBearerAuth, i as installModernOnlyHandlers, l as requireScopes, m as bearerAuthChallengeResponse, n as ResourceTemplate, o as serverIdentityOf, p as oauthMetadataResponse, r as Server, s as createScopeChallengeResponse, t as McpServer, u as scopeChallengeResourceMetadataUrl, w as completable, x as createServerNotifier, y as createListenRouter } from \"./mcp-DIH4cS6P.mjs\";\nimport { $ as isTaskAugmentedRequestParams, At as LATEST_PROTOCOL_VERSION, B as scanXMcpHeaderDeclarations, Bt as TRACESTATE_META_KEY, Ct as CLIENT_CAPABILITIES_META_KEY, D as acceptedContent, Dt as INVALID_PARAMS, Et as INTERNAL_ERROR, Ft as RELATED_TASK_META_KEY, G as isInitializeRequest, Gt as resourceUrlFromServerUrl, H as assertCompleteRequestPrompt, I as classifyInboundRequest, It as SERVER_INFO_META_KEY, J as isJSONRPCErrorResponse, Jt as SdkHttpError, K as isInitializedNotification, Kt as SdkError, L as httpStatusForErrorCode, Lt as SUBSCRIPTION_ID_META_KEY, Mt as METHOD_NOT_FOUND, Nt as PARSE_ERROR, O as inputRequired, Ot as INVALID_REQUEST, P as LADDER_ERROR_HTTP_STATUS, Pt as PROTOCOL_VERSION_META_KEY, Q as isJSONRPCResultResponse, R as modernOnlyStrictRejection, Rt as SUPPORTED_PROTOCOL_VERSIONS, S as specTypeSchemas, St as BAGGAGE_META_KEY, Tt as DEFAULT_NEGOTIATED_PROTOCOL_VERSION, U as assertCompleteRequestResourceTemplate, Ut as requiredClientCapabilitiesForRequest, V as validateMcpParamHeaders, Vt as missingClientCapabilities, W as isCallToolResult, Wt as checkResourceAllowed, X as isJSONRPCRequest, Xt as OAuthErrorCode, Y as isJSONRPCNotification, Yt as OAuthError, Z as isJSONRPCResponse, _ as mergeCapabilities, a as UriTemplate, at as requestMetaOf, c as ReadBuffer, d as serializeMessage, dt as ResourceNotFoundError, et as parseJSONRPCMessage, f as getDisplayName, ft as UnsupportedProtocolVersionError, g as Protocol, h as DEFAULT_REQUEST_TIMEOUT_MSEC, i as InMemoryTransport, jt as LOG_LEVEL_META_KEY, k as inputResponse, kt as JSONRPC_VERSION, l as STDIO_DEFAULT_MAX_BUFFER_SIZE, lt as MissingRequiredClientCapabilityError, m as mediaTypeEssence, mt as ProtocolErrorCode, n as preloadSchemas, o as createFetchWithInit, p as isJsonContentType, pt as UrlElicitationRequiredError, q as isInputRequiredResult, qt as SdkErrorCode, t as fromJsonSchema$1, tt as JSONRPCMessageSchema, u as deserializeMessage, ut as ProtocolError, vt as SUPPORTED_MODERN_PROTOCOL_VERSIONS, wt as CLIENT_INFO_META_KEY, x as isSpecType, y as setNegotiatedProtocolVersion, z as validateStandardRequestHeaders, zt as TRACEPARENT_META_KEY } from \"./src-Cqbh3MYc.mjs\";\nimport { DefaultJsonSchemaValidator } from \"@modelcontextprotocol/server/_shims\";\n\n//#region src/server/perRequestTransport.ts\n/**\n* The per-request micro-transport: a real, connected `Transport` whose whole\n* lifetime is one HTTP exchange. See the module documentation for the\n* response shapes it produces.\n*/\nvar PerRequestHTTPServerTransport = class {\n\tonclose;\n\tonerror;\n\tonmessage;\n\t_classification;\n\t_responseMode;\n\t_started = false;\n\t_used = false;\n\t_closed = false;\n\t_terminalDelivered = false;\n\t/**\n\t* `true` only while the inbound message is being delivered synchronously\n\t* to the connected protocol layer. The pre-handler gates (the era\n\t* registry gate, the edge→instance handoff check, the missing-handler\n\t* rejection) answer inside this window; request handlers always run\n\t* after it (the protocol layer defers them to a microtask). An error\n\t* sent inside the window is therefore ladder-originated, and an error\n\t* sent after it is handler-produced.\n\t*/\n\t_dispatchWindowOpen = false;\n\t_requestId;\n\t_deferredResponse;\n\t_sse;\n\t_abortCleanup;\n\t_keepAliveMs;\n\tconstructor(options) {\n\t\tthis._classification = options.classification;\n\t\tthis._responseMode = options.responseMode ?? \"auto\";\n\t\tthis._keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;\n\t}\n\tasync start() {\n\t\tif (this._started) throw new Error(\"PerRequestHTTPServerTransport is already started\");\n\t\tthis._started = true;\n\t}\n\t/**\n\t* Serves the single exchange: delivers the classified message to the\n\t* connected server instance and resolves with the HTTP response.\n\t*\n\t* Throws when called a second time (the transport is strictly\n\t* single-use), or before a server has been connected to the transport.\n\t* The returned promise rejects with a connection-closed error when the\n\t* transport is closed before a response was produced (for example because\n\t* the client disconnected).\n\t*/\n\tasync handleMessage(message, extra) {\n\t\tif (this._used) throw new Error(\"PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request\");\n\t\tif (!this._started || this.onmessage === void 0) throw new Error(\"PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message\");\n\t\tif (this._closed) throw new Error(\"PerRequestHTTPServerTransport is closed\");\n\t\tthis._used = true;\n\t\tconst signal = extra?.request?.signal;\n\t\tif (signal?.aborted) {\n\t\t\tawait this.close();\n\t\t\tthrow new SdkError(SdkErrorCode.ConnectionClosed, \"The request was aborted before it could be handled\");\n\t\t}\n\t\tconst messageExtra = {\n\t\t\tclassification: this._classification,\n\t\t\t...extra?.request !== void 0 && { request: extra.request },\n\t\t\t...extra?.authInfo !== void 0 && { authInfo: extra.authInfo }\n\t\t};\n\t\tif (isJSONRPCRequest(message)) {\n\t\t\tthis._requestId = message.id;\n\t\t\tlet resolve;\n\t\t\tlet reject;\n\t\t\tconst promise = new Promise((promiseResolve, promiseReject) => {\n\t\t\t\tresolve = promiseResolve;\n\t\t\t\treject = promiseReject;\n\t\t\t});\n\t\t\tthis._deferredResponse = {\n\t\t\t\tpromise,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t\tsettled: false\n\t\t\t};\n\t\t\tif (signal !== void 0) {\n\t\t\t\tconst onAbort = () => void this.close();\n\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\tthis._abortCleanup = () => signal.removeEventListener(\"abort\", onAbort);\n\t\t\t}\n\t\t\tthis._dispatchWindowOpen = true;\n\t\t\ttry {\n\t\t\t\tthis.onmessage(message, messageExtra);\n\t\t\t} finally {\n\t\t\t\tthis._dispatchWindowOpen = false;\n\t\t\t}\n\t\t\tif (this._responseMode === \"sse\" && !this._closed && !this._deferredResponse.settled) this.upgradeToSse();\n\t\t\treturn promise;\n\t\t}\n\t\tthis.onmessage(message, messageExtra);\n\t\treturn new Response(null, { status: 202 });\n\t}\n\tasync send(message, options) {\n\t\tif (this._closed) return;\n\t\tconst isResponse = isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message);\n\t\tconst relatedId = isResponse ? message.id : options?.relatedRequestId;\n\t\tif (this._requestId === void 0 || relatedId === void 0 || relatedId !== this._requestId) {\n\t\t\tif (isResponse) this.onerror?.(/* @__PURE__ */ new Error(`Received a response for an unknown request id: ${String(message.id)}`));\n\t\t\treturn;\n\t\t}\n\t\tif (isResponse) {\n\t\t\tif (this._terminalDelivered) return;\n\t\t\tthis._terminalDelivered = true;\n\t\t\tconst errorCode = isJSONRPCErrorResponse(message) ? message.error.code : void 0;\n\t\t\tconst ladderStatus = errorCode !== void 0 && (this._dispatchWindowOpen || errorCode === ProtocolErrorCode.MissingRequiredClientCapability) ? LADDER_ERROR_HTTP_STATUS[errorCode] : void 0;\n\t\t\tif (ladderStatus !== void 0 && this._sse === void 0) {\n\t\t\t\tthis.settleResponse(Response.json(message, {\n\t\t\t\t\tstatus: ladderStatus,\n\t\t\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t\t\t}));\n\t\t\t\tqueueMicrotask(() => void this.close());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._sse !== void 0 || this._responseMode === \"sse\") {\n\t\t\t\tif (this._sse === void 0) this.upgradeToSse();\n\t\t\t\tthis.writeMessageFrame(message);\n\t\t\t\tthis.finalizeStream();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.settleResponse(Response.json(message, {\n\t\t\t\tstatus: 200,\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t\t}));\n\t\t\tqueueMicrotask(() => void this.close());\n\t\t\treturn;\n\t\t}\n\t\tif (this._responseMode === \"json\") return;\n\t\tif (this._sse === void 0) this.upgradeToSse();\n\t\tthis.writeMessageFrame(message);\n\t}\n\t/**\n\t* Writes an SSE comment frame (a keep-alive heartbeat). Dropped when the\n\t* exchange is not currently streaming.\n\t*/\n\twriteCommentFrame(comment) {\n\t\tif (this._closed || this._sse === void 0 || this._sse.closed) return;\n\t\tconst frame = comment.split(\"\\n\").map((line) => `: ${line}`).join(\"\\n\");\n\t\tthis.writeFrame(`${frame}\\n\\n`);\n\t}\n\tasync close() {\n\t\tif (this._closed) return;\n\t\tthis._closed = true;\n\t\tthis._abortCleanup?.();\n\t\tthis._abortCleanup = void 0;\n\t\tif (this._sse?.keepAliveTimer !== void 0) clearInterval(this._sse.keepAliveTimer);\n\t\tif (this._sse !== void 0 && !this._sse.closed) {\n\t\t\tthis._sse.closed = true;\n\t\t\ttry {\n\t\t\t\tthis._sse.controller.close();\n\t\t\t} catch {}\n\t\t}\n\t\tif (this._deferredResponse !== void 0 && !this._deferredResponse.settled) {\n\t\t\tthis._deferredResponse.settled = true;\n\t\t\tthis._deferredResponse.reject(new SdkError(SdkErrorCode.ConnectionClosed, \"Connection closed before a response was produced\"));\n\t\t}\n\t\tthis.onclose?.();\n\t}\n\tsettleResponse(response) {\n\t\tif (this._deferredResponse === void 0 || this._deferredResponse.settled) return;\n\t\tthis._deferredResponse.settled = true;\n\t\tthis._deferredResponse.resolve(response);\n\t}\n\tupgradeToSse() {\n\t\tlet controller;\n\t\tconst readable = new ReadableStream({\n\t\t\tstart: (streamController) => {\n\t\t\t\tcontroller = streamController;\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tthis.close();\n\t\t\t}\n\t\t});\n\t\tthis._sse = {\n\t\t\tcontroller,\n\t\t\tencoder: new TextEncoder(),\n\t\t\tclosed: false\n\t\t};\n\t\tthis._sse.keepAliveTimer = armSseKeepAlive(this._keepAliveMs, () => this.writeCommentFrame(\"keepalive\"));\n\t\tthis.settleResponse(new Response(readable, {\n\t\t\tstatus: 200,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\tConnection: \"keep-alive\",\n\t\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t\t}\n\t\t}));\n\t}\n\tfinalizeStream() {\n\t\tif (this._sse?.keepAliveTimer !== void 0) clearInterval(this._sse.keepAliveTimer);\n\t\tif (this._sse !== void 0 && !this._sse.closed) {\n\t\t\tthis._sse.closed = true;\n\t\t\ttry {\n\t\t\t\tthis._sse.controller.close();\n\t\t\t} catch {}\n\t\t}\n\t\tqueueMicrotask(() => void this.close());\n\t}\n\twriteMessageFrame(message) {\n\t\tthis.writeFrame(`event: message\\ndata: ${JSON.stringify(message)}\\n\\n`);\n\t}\n\twriteFrame(frame) {\n\t\tif (this._sse === void 0 || this._sse.closed) return;\n\t\ttry {\n\t\t\tthis._sse.controller.enqueue(this._sse.encoder.encode(frame));\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(`Failed to write to the response stream: ${error}`));\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/server/invoke.ts\n/**\n* Serves one classified inbound message on the given server instance and\n* returns the HTTP response for the exchange.\n*\n* The instance is connected to a fresh single-exchange transport, the message\n* is injected through the normal transport message path, and whatever the\n* dispatch layer produces (the handler result, a protocol-level rejection, or\n* streamed related messages followed by the result) is captured as the\n* returned `Response`. For request exchanges, teardown rides the transport's\n* close chain once the terminal response has been delivered; notification\n* exchanges resolve with the 202 response immediately and do NOT run the\n* close chain — the transport stays connected until the caller closes it or\n* drops the per-request instance, which is the caller's choice either way.\n*/\nasync function invoke(server, message, ctx) {\n\tconst transport = new PerRequestHTTPServerTransport({\n\t\tclassification: ctx.classification,\n\t\t...ctx.responseMode !== void 0 && { responseMode: ctx.responseMode },\n\t\t...ctx.keepAliveMs !== void 0 && { keepAliveMs: ctx.keepAliveMs }\n\t});\n\tawait server.connect(transport);\n\treturn transport.handleMessage(message, {\n\t\t...ctx.request !== void 0 && { request: ctx.request },\n\t\t...ctx.authInfo !== void 0 && { authInfo: ctx.authInfo }\n\t});\n}\n\n//#endregion\n//#region src/server/requestBody.ts\n/** Default upper bound, in bytes, on a request body read by the HTTP entry points (4 MiB). */\nconst DEFAULT_MAX_REQUEST_BODY_SIZE = 4 * 1024 * 1024;\n/** Upper bound on the number of messages accepted in one JSON-RPC batch array. */\nconst MAX_BATCH_SIZE = 100;\n/** The message answered with 413 for a request body over `maxBytes`. */\nfunction requestBodyTooLargeMessage(maxBytes) {\n\treturn `Payload Too Large: Request body must not exceed ${maxBytes} bytes`;\n}\n/**\n* Resolves a `maxRequestBodySize` option to the bound to apply: the default when\n* omitted, otherwise the value itself, which must be a positive finite number of\n* bytes (a `RangeError` is thrown at configuration time for anything else).\n*/\nfunction resolveMaxRequestBodySize(value) {\n\tif (value === void 0) return DEFAULT_MAX_REQUEST_BODY_SIZE;\n\tif (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0) throw new RangeError(`maxRequestBodySize must be a positive number of bytes, got ${String(value)}`);\n\treturn value;\n}\n/**\n* Reads a request body as text, up to `maxBytes` (default\n* {@linkcode DEFAULT_MAX_REQUEST_BODY_SIZE}). A declared `Content-Length` over the\n* limit is refused without reading anything; otherwise the read stops as soon as\n* more than the limit has arrived. Stream failures propagate.\n*/\nasync function readRequestBody(request, maxBytes = DEFAULT_MAX_REQUEST_BODY_SIZE) {\n\tif (Number(request.headers.get(\"content-length\")) > maxBytes) return { tooLarge: true };\n\tif (request.body === null) return {\n\t\ttooLarge: false,\n\t\ttext: \"\"\n\t};\n\tconst reader = request.body.getReader();\n\tconst decoder = new TextDecoder();\n\tlet received = 0;\n\tlet text = \"\";\n\ttry {\n\t\tfor (;;) {\n\t\t\tconst { done, value } = await reader.read();\n\t\t\tif (done) break;\n\t\t\treceived += value.byteLength;\n\t\t\tif (received > maxBytes) return { tooLarge: true };\n\t\t\ttext += decoder.decode(value, { stream: true });\n\t\t}\n\t} finally {\n\t\treader.releaseLock();\n\t}\n\treturn {\n\t\ttooLarge: false,\n\t\ttext: text + decoder.decode()\n\t};\n}\n\n//#endregion\n//#region src/server/streamableHttp.ts\n/**\n* Server transport for Web Standards Streamable HTTP: this implements the MCP Streamable HTTP transport specification\n* using Web Standard APIs (`Request`, `Response`, `ReadableStream`).\n*\n* This transport works on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc.\n*\n* In stateful mode:\n* - Session ID is generated and included in response headers\n* - Session ID is always included in initialization responses\n* - Requests with invalid session IDs are rejected with `404 Not Found`\n* - Non-initialization requests without a session ID are rejected with `400 Bad Request`\n* - State is maintained in-memory (connections, message history)\n*\n* In stateless mode:\n* - No Session ID is included in any responses\n* - No session validation is performed\n*\n* @example Stateful setup\n* ```ts source=\"./streamableHttp.examples.ts#WebStandardStreamableHTTPServerTransport_stateful\"\n* const server = new McpServer({ name: 'my-server', version: '1.0.0' });\n*\n* const transport = new WebStandardStreamableHTTPServerTransport({\n*     sessionIdGenerator: () => crypto.randomUUID()\n* });\n*\n* await server.connect(transport);\n* ```\n*\n* @example Stateless setup\n* ```ts source=\"./streamableHttp.examples.ts#WebStandardStreamableHTTPServerTransport_stateless\"\n* const transport = new WebStandardStreamableHTTPServerTransport({\n*     sessionIdGenerator: undefined\n* });\n* ```\n*\n* @example Hono.js\n* ```ts source=\"./streamableHttp.examples.ts#WebStandardStreamableHTTPServerTransport_hono\"\n* app.all('/mcp', async c => {\n*     // Stateless example: create a server and a transport per request.\n*     const server = new McpServer({ name: 'my-server', version: '1.0.0' });\n*     const transport = new WebStandardStreamableHTTPServerTransport({ sessionIdGenerator: undefined });\n*     await server.connect(transport);\n*     return transport.handleRequest(c.req.raw);\n* });\n* ```\n*\n* @example Cloudflare Workers\n* ```ts source=\"./streamableHttp.examples.ts#WebStandardStreamableHTTPServerTransport_workers\"\n* const worker = {\n*     async fetch(request: Request): Promise<Response> {\n*         // Stateless example: create a server and a transport per request.\n*         const server = new McpServer({ name: 'my-server', version: '1.0.0' });\n*         const transport = new WebStandardStreamableHTTPServerTransport({ sessionIdGenerator: undefined });\n*         await server.connect(transport);\n*         return transport.handleRequest(request);\n*     }\n* };\n* ```\n*/\nvar WebStandardStreamableHTTPServerTransport = class {\n\tsessionIdGenerator;\n\t_started = false;\n\t_hasHandledRequest = false;\n\t_closed = false;\n\t_streamMapping = /* @__PURE__ */ new Map();\n\t_requestToStreamMapping = /* @__PURE__ */ new Map();\n\t_requestResponseMap = /* @__PURE__ */ new Map();\n\t_initialized = false;\n\t_enableJsonResponse = false;\n\t_standaloneSseStreamId = \"_GET_stream\";\n\t_eventStore;\n\t_onsessioninitialized;\n\t_onsessionclosed;\n\t_allowedHosts;\n\t_allowedOrigins;\n\t_enableDnsRebindingProtection;\n\t_retryInterval;\n\t_supportedProtocolVersions;\n\t_keepAliveMs;\n\t_maxRequestBodySize;\n\t_scopeChallengeResolver;\n\tsessionId;\n\tonclose;\n\tonerror;\n\tonmessage;\n\tconstructor(options = {}) {\n\t\tthis.sessionIdGenerator = options.sessionIdGenerator;\n\t\tthis._enableJsonResponse = options.enableJsonResponse ?? false;\n\t\tthis._eventStore = options.eventStore;\n\t\tthis._onsessioninitialized = options.onsessioninitialized;\n\t\tthis._onsessionclosed = options.onsessionclosed;\n\t\tthis._allowedHosts = options.allowedHosts;\n\t\tthis._allowedOrigins = options.allowedOrigins;\n\t\tthis._enableDnsRebindingProtection = options.enableDnsRebindingProtection ?? false;\n\t\tthis._retryInterval = options.retryInterval;\n\t\tthis._supportedProtocolVersions = options.supportedProtocolVersions ?? SUPPORTED_PROTOCOL_VERSIONS;\n\t\tthis._keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;\n\t\tthis._maxRequestBodySize = resolveMaxRequestBodySize(options.maxRequestBodySize);\n\t}\n\tstartKeepAlive(controller, encoder) {\n\t\tif (this._closed) return void 0;\n\t\tconst timer = armSseKeepAlive(this._keepAliveMs, () => {\n\t\t\ttry {\n\t\t\t\tcontroller.enqueue(encoder.encode(\": keepalive\\n\\n\"));\n\t\t\t} catch {\n\t\t\t\tif (timer !== void 0) clearInterval(timer);\n\t\t\t}\n\t\t});\n\t\treturn timer;\n\t}\n\t/** Sets the scope challenge resolver for parsed JSON-RPC requests. */\n\tsetScopeChallengeResolver(resolver) {\n\t\tthis._scopeChallengeResolver = resolver;\n\t}\n\t/**\n\t* Starts the transport. This is required by the {@linkcode Transport} interface but is a no-op\n\t* for the Streamable HTTP transport as connections are managed per-request.\n\t*/\n\tasync start() {\n\t\tif (this._started) throw new Error(\"Transport already started\");\n\t\tthis._started = true;\n\t}\n\t/**\n\t* Sets the supported protocol versions for header validation.\n\t* Called by the server during {@linkcode server/server.Server.connect | connect()} to pass its supported versions.\n\t*/\n\tsetSupportedProtocolVersions(versions) {\n\t\tthis._supportedProtocolVersions = versions;\n\t}\n\t/**\n\t* Helper to create a JSON error response\n\t*/\n\tcreateJsonErrorResponse(status, code, message, options) {\n\t\tconst error = {\n\t\t\tcode,\n\t\t\tmessage\n\t\t};\n\t\tif (options?.data !== void 0) error.data = options.data;\n\t\treturn Response.json({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\terror,\n\t\t\tid: null\n\t\t}, {\n\t\t\tstatus,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t...options?.headers\n\t\t\t}\n\t\t});\n\t}\n\tasync _checkScopeChallenge(messages, authInfo) {\n\t\tif (!this._scopeChallengeResolver) return;\n\t\tconst challenge = await findScopeChallenge(messages.filter((message) => isJSONRPCRequest(message)), authInfo, this._scopeChallengeResolver);\n\t\treturn challenge === void 0 ? void 0 : createScopeChallengeResponse(challenge, scopeChallengeResourceMetadataUrl(authInfo));\n\t}\n\t/**\n\t* Validates request headers for DNS rebinding protection.\n\t* @returns Error response if validation fails, `undefined` if validation passes.\n\t*/\n\tvalidateRequestHeaders(req) {\n\t\tif (!this._enableDnsRebindingProtection) return;\n\t\tif (this._allowedHosts && this._allowedHosts.length > 0) {\n\t\t\tconst hostHeader = req.headers.get(\"host\");\n\t\t\tif (!hostHeader || !this._allowedHosts.includes(hostHeader)) {\n\t\t\t\tconst error = `Invalid Host header: ${hostHeader}`;\n\t\t\t\tthis.onerror?.(new Error(error));\n\t\t\t\treturn this.createJsonErrorResponse(403, -32e3, error);\n\t\t\t}\n\t\t}\n\t\tif (this._allowedOrigins && this._allowedOrigins.length > 0) {\n\t\t\tconst originHeader = req.headers.get(\"origin\");\n\t\t\tif (originHeader && !this._allowedOrigins.includes(originHeader)) {\n\t\t\t\tconst error = `Invalid Origin header: ${originHeader}`;\n\t\t\t\tthis.onerror?.(new Error(error));\n\t\t\t\treturn this.createJsonErrorResponse(403, -32e3, error);\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Handles an incoming HTTP request, whether `GET`, `POST`, or `DELETE`\n\t* Returns a `Response` object (Web Standard)\n\t*/\n\tasync handleRequest(req, options) {\n\t\tif (this._closed) return this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\tif (!this.sessionIdGenerator && this._hasHandledRequest) throw new Error(\"Stateless transport cannot be reused across requests. Create a new transport per request.\");\n\t\tthis._hasHandledRequest = true;\n\t\tconst validationError = this.validateRequestHeaders(req);\n\t\tif (validationError) return validationError;\n\t\tswitch (req.method) {\n\t\t\tcase \"POST\": return this.handlePostRequest(req, options);\n\t\t\tcase \"GET\": return this.handleGetRequest(req);\n\t\t\tcase \"DELETE\": return this.handleDeleteRequest(req);\n\t\t\tdefault: return this.handleUnsupportedRequest();\n\t\t}\n\t}\n\t/**\n\t* Returns true if the client's protocol version supports empty SSE data in\n\t* priming events (the fix shipped with protocol version `2025-11-25`).\n\t*\n\t* The version is checked for membership in this transport instance's\n\t* supported protocol versions rather than with an open-ended\n\t* `>= '2025-11-25'` comparison: the value may come from an `initialize`\n\t* request body, which (unlike the `MCP-Protocol-Version` header) is not\n\t* validated against `supportedProtocolVersions` before reaching this\n\t* check. An unknown future version string must not silently enable\n\t* behavior reserved for versions this transport actually supports.\n\t*/\n\tsupportsEmptySSEData(protocolVersion) {\n\t\treturn this._supportedProtocolVersions.includes(protocolVersion) && protocolVersion >= \"2025-11-25\";\n\t}\n\t/**\n\t* Writes a priming event to establish resumption capability.\n\t* Only sends if `eventStore` is configured (opt-in for resumability) and\n\t* the client's protocol version supports empty SSE data (a supported\n\t* version that is >= `2025-11-25`).\n\t*/\n\tasync writePrimingEvent(controller, encoder, streamId, protocolVersion) {\n\t\tif (!this._eventStore) return;\n\t\tif (!this.supportsEmptySSEData(protocolVersion)) return;\n\t\tconst primingEventId = await this._eventStore.storeEvent(streamId, {});\n\t\tlet primingEvent = `id: ${primingEventId}\\ndata: \\n\\n`;\n\t\tif (this._retryInterval !== void 0) primingEvent = `id: ${primingEventId}\\nretry: ${this._retryInterval}\\ndata: \\n\\n`;\n\t\tcontroller.enqueue(encoder.encode(primingEvent));\n\t}\n\t/**\n\t* Handles `GET` requests for SSE stream\n\t*/\n\tasync handleGetRequest(req) {\n\t\tif (!req.headers.get(\"accept\")?.includes(\"text/event-stream\")) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Not Acceptable: Client must accept text/event-stream\"));\n\t\t\treturn this.createJsonErrorResponse(406, -32e3, \"Not Acceptable: Client must accept text/event-stream\");\n\t\t}\n\t\tconst sessionError = this.validateSession(req);\n\t\tif (sessionError) return sessionError;\n\t\tconst protocolError = this.validateProtocolVersion(req);\n\t\tif (protocolError) return protocolError;\n\t\tif (this._eventStore) {\n\t\t\tconst lastEventId = req.headers.get(\"last-event-id\");\n\t\t\tif (lastEventId) return this.replayEvents(lastEventId);\n\t\t}\n\t\tif (this._streamMapping.get(this._standaloneSseStreamId) !== void 0) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Conflict: Only one SSE stream is allowed per session\"));\n\t\t\treturn this.createJsonErrorResponse(409, -32e3, \"Conflict: Only one SSE stream is allowed per session\");\n\t\t}\n\t\tconst encoder = new TextEncoder();\n\t\tlet streamController;\n\t\tlet keepAliveTimer;\n\t\tconst readable = new ReadableStream({\n\t\t\tstart: (controller) => {\n\t\t\t\tstreamController = controller;\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\tif (this._streamMapping.get(this._standaloneSseStreamId)?.controller === streamController) this._streamMapping.delete(this._standaloneSseStreamId);\n\t\t\t}\n\t\t});\n\t\tconst headers = {\n\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\tConnection: \"keep-alive\",\n\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t};\n\t\tif (this.sessionId !== void 0) headers[\"mcp-session-id\"] = this.sessionId;\n\t\tthis._streamMapping.set(this._standaloneSseStreamId, {\n\t\t\tcontroller: streamController,\n\t\t\tencoder,\n\t\t\tcleanup: () => {\n\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\tthis._streamMapping.delete(this._standaloneSseStreamId);\n\t\t\t\ttry {\n\t\t\t\t\tstreamController.close();\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t});\n\t\tkeepAliveTimer = this.startKeepAlive(streamController, encoder);\n\t\treturn new Response(readable, { headers });\n\t}\n\t/**\n\t* Replays events that would have been sent after the specified event ID\n\t* Only used when resumability is enabled\n\t*/\n\tasync replayEvents(lastEventId) {\n\t\tif (!this._eventStore) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Event store not configured\"));\n\t\t\treturn this.createJsonErrorResponse(400, -32e3, \"Event store not configured\");\n\t\t}\n\t\ttry {\n\t\t\tlet streamId;\n\t\t\tif (this._eventStore.getStreamIdForEventId) {\n\t\t\t\tstreamId = await this._eventStore.getStreamIdForEventId(lastEventId);\n\t\t\t\tif (!streamId) {\n\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Invalid event ID format\"));\n\t\t\t\t\treturn this.createJsonErrorResponse(400, -32e3, \"Invalid event ID format\");\n\t\t\t\t}\n\t\t\t\tif (this._streamMapping.get(streamId) !== void 0) {\n\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Conflict: Stream already has an active connection\"));\n\t\t\t\t\treturn this.createJsonErrorResponse(409, -32e3, \"Conflict: Stream already has an active connection\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst headers = {\n\t\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\tConnection: \"keep-alive\",\n\t\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t\t};\n\t\t\tif (this.sessionId !== void 0) headers[\"mcp-session-id\"] = this.sessionId;\n\t\t\tconst encoder = new TextEncoder();\n\t\t\tlet streamController;\n\t\t\tlet keepAliveTimer;\n\t\t\tlet cancelled = false;\n\t\t\tlet replayedStreamId;\n\t\t\tconst readable = new ReadableStream({\n\t\t\t\tstart: (controller) => {\n\t\t\t\t\tstreamController = controller;\n\t\t\t\t},\n\t\t\t\tcancel: () => {\n\t\t\t\t\tcancelled = true;\n\t\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\t\tif (replayedStreamId !== void 0 && this._streamMapping.get(replayedStreamId)?.controller === streamController) this._streamMapping.delete(replayedStreamId);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst replayedEventIds = /* @__PURE__ */ new Set();\n\t\t\treplayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, { send: async (eventId, message) => {\n\t\t\t\treplayedEventIds.add(eventId);\n\t\t\t\tif (!this.writeSSEEvent(streamController, encoder, message, eventId)) try {\n\t\t\t\t\tstreamController.close();\n\t\t\t\t} catch {}\n\t\t\t} });\n\t\t\tif (this._closed || cancelled) {\n\t\t\t\ttry {\n\t\t\t\t\tstreamController.close();\n\t\t\t\t} catch {}\n\t\t\t\treturn this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\t\t}\n\t\t\tthis._streamMapping.get(replayedStreamId)?.cleanup();\n\t\t\tthis._streamMapping.set(replayedStreamId, {\n\t\t\t\tcontroller: streamController,\n\t\t\t\tencoder,\n\t\t\t\treplayedEventIds,\n\t\t\t\tcleanup: () => {\n\t\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\t\tthis._streamMapping.delete(replayedStreamId);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tstreamController.close();\n\t\t\t\t\t} catch {}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (replayedStreamId !== this._standaloneSseStreamId) {\n\t\t\t\tif (![...this._requestToStreamMapping.values()].includes(replayedStreamId)) {\n\t\t\t\t\tthis._streamMapping.delete(replayedStreamId);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tstreamController.close();\n\t\t\t\t\t} catch {}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._streamMapping.get(replayedStreamId)?.controller === streamController) keepAliveTimer = this.startKeepAlive(streamController, encoder);\n\t\t\treturn new Response(readable, { headers });\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error);\n\t\t\treturn this.createJsonErrorResponse(500, -32e3, \"Error replaying events\");\n\t\t}\n\t}\n\t/**\n\t* Writes an event to an SSE stream via controller with proper formatting\n\t*/\n\twriteSSEEvent(controller, encoder, message, eventId) {\n\t\ttry {\n\t\t\tlet eventData = `event: message\\n`;\n\t\t\tif (eventId) eventData += `id: ${eventId}\\n`;\n\t\t\teventData += `data: ${JSON.stringify(message)}\\n\\n`;\n\t\t\tcontroller.enqueue(encoder.encode(eventData));\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error);\n\t\t\treturn false;\n\t\t}\n\t}\n\t/**\n\t* Handles unsupported requests (`PUT`, `PATCH`, etc.)\n\t*/\n\thandleUnsupportedRequest() {\n\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Method not allowed.\"));\n\t\treturn Response.json({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\terror: {\n\t\t\t\tcode: -32e3,\n\t\t\t\tmessage: \"Method not allowed.\"\n\t\t\t},\n\t\t\tid: null\n\t\t}, {\n\t\t\tstatus: 405,\n\t\t\theaders: {\n\t\t\t\tAllow: \"GET, POST, DELETE\",\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Handles `POST` requests containing JSON-RPC messages\n\t*/\n\tasync handlePostRequest(req, options) {\n\t\ttry {\n\t\t\tconst acceptHeader = req.headers.get(\"accept\");\n\t\t\tif (!acceptHeader?.includes(\"application/json\") || !acceptHeader.includes(\"text/event-stream\")) {\n\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Not Acceptable: Client must accept both application/json and text/event-stream\"));\n\t\t\t\treturn this.createJsonErrorResponse(406, -32e3, \"Not Acceptable: Client must accept both application/json and text/event-stream\");\n\t\t\t}\n\t\t\tif (!isJsonContentType(req.headers.get(\"content-type\"))) {\n\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Unsupported Media Type: Content-Type must be application/json\"));\n\t\t\t\treturn this.createJsonErrorResponse(415, -32e3, \"Unsupported Media Type: Content-Type must be application/json\");\n\t\t\t}\n\t\t\tconst request = req;\n\t\t\tlet rawMessage;\n\t\t\tif (options?.parsedBody === void 0) try {\n\t\t\t\tconst body = await readRequestBody(req, this._maxRequestBodySize);\n\t\t\t\tif (body.tooLarge) {\n\t\t\t\t\tconst message = requestBodyTooLargeMessage(this._maxRequestBodySize);\n\t\t\t\t\tthis.onerror?.(new Error(message));\n\t\t\t\t\treturn this.createJsonErrorResponse(413, -32e3, message);\n\t\t\t\t}\n\t\t\t\trawMessage = JSON.parse(body.text);\n\t\t\t} catch (error) {\n\t\t\t\tthis.onerror?.(error);\n\t\t\t\treturn this.createJsonErrorResponse(400, -32700, \"Parse error: Invalid JSON\");\n\t\t\t}\n\t\t\telse rawMessage = options.parsedBody;\n\t\t\tif (Array.isArray(rawMessage) && rawMessage.length > MAX_BATCH_SIZE) {\n\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(`Invalid Request: Batch must not exceed ${MAX_BATCH_SIZE} messages`));\n\t\t\t\treturn this.createJsonErrorResponse(400, -32600, `Invalid Request: Batch must not exceed ${MAX_BATCH_SIZE} messages`);\n\t\t\t}\n\t\t\tlet messages;\n\t\t\ttry {\n\t\t\t\tmessages = Array.isArray(rawMessage) ? rawMessage.map((msg) => JSONRPCMessageSchema.parse(msg)) : [JSONRPCMessageSchema.parse(rawMessage)];\n\t\t\t} catch (error) {\n\t\t\t\tthis.onerror?.(error);\n\t\t\t\treturn this.createJsonErrorResponse(400, -32700, \"Parse error: Invalid JSON-RPC message\");\n\t\t\t}\n\t\t\tif (this._closed) return this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\t\tconst isInitializationRequest = messages.some((element) => isInitializeRequest(element));\n\t\t\tif (isInitializationRequest) {\n\t\t\t\tif (this._initialized && this.sessionId !== void 0) {\n\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Invalid Request: Server already initialized\"));\n\t\t\t\t\treturn this.createJsonErrorResponse(400, -32600, \"Invalid Request: Server already initialized\");\n\t\t\t\t}\n\t\t\t\tif (messages.length > 1) {\n\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Invalid Request: Only one initialization request is allowed\"));\n\t\t\t\t\treturn this.createJsonErrorResponse(400, -32600, \"Invalid Request: Only one initialization request is allowed\");\n\t\t\t\t}\n\t\t\t\tthis.sessionId = this.sessionIdGenerator?.();\n\t\t\t\tthis._initialized = true;\n\t\t\t\tif (this.sessionId && this._onsessioninitialized) await Promise.resolve(this._onsessioninitialized(this.sessionId));\n\t\t\t}\n\t\t\tif (!isInitializationRequest) {\n\t\t\t\tconst sessionError = this.validateSession(req);\n\t\t\t\tif (sessionError) return sessionError;\n\t\t\t\tconst protocolError = this.validateProtocolVersion(req);\n\t\t\t\tif (protocolError) return protocolError;\n\t\t\t}\n\t\t\tif (this._closed) return this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\t\tlet scopeChallengeResponse;\n\t\t\ttry {\n\t\t\t\tscopeChallengeResponse = await this._checkScopeChallenge(messages, options?.authInfo);\n\t\t\t} catch (error) {\n\t\t\t\tthis.onerror?.(error);\n\t\t\t\treturn this.createJsonErrorResponse(500, -32603, \"Internal server error\");\n\t\t\t}\n\t\t\tif (scopeChallengeResponse) return scopeChallengeResponse;\n\t\t\tif (!messages.some((element) => isJSONRPCRequest(element))) {\n\t\t\t\tfor (const message of messages) this.onmessage?.(message, {\n\t\t\t\t\tauthInfo: options?.authInfo,\n\t\t\t\t\trequest\n\t\t\t\t});\n\t\t\t\treturn new Response(null, { status: 202 });\n\t\t\t}\n\t\t\tconst streamId = crypto.randomUUID();\n\t\t\tconst initRequest = messages.find((m) => isInitializeRequest(m));\n\t\t\tconst clientProtocolVersion = initRequest ? initRequest.params.protocolVersion : req.headers.get(\"mcp-protocol-version\") ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;\n\t\t\tif (this._enableJsonResponse) return new Promise((resolve) => {\n\t\t\t\tthis._streamMapping.set(streamId, {\n\t\t\t\t\tresolveJson: resolve,\n\t\t\t\t\tcleanup: () => {\n\t\t\t\t\t\tthis._streamMapping.delete(streamId);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tfor (const message of messages) if (isJSONRPCRequest(message)) this._requestToStreamMapping.set(message.id, streamId);\n\t\t\t\tfor (const message of messages) this.onmessage?.(message, {\n\t\t\t\t\tauthInfo: options?.authInfo,\n\t\t\t\t\trequest\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst encoder = new TextEncoder();\n\t\t\tlet streamController;\n\t\t\tlet keepAliveTimer;\n\t\t\tconst readable = new ReadableStream({\n\t\t\t\tstart: (controller) => {\n\t\t\t\t\tstreamController = controller;\n\t\t\t\t},\n\t\t\t\tcancel: () => {\n\t\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\t\tif (this._streamMapping.get(streamId)?.controller === streamController) this._streamMapping.delete(streamId);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst headers = {\n\t\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\tConnection: \"keep-alive\",\n\t\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t\t};\n\t\t\tif (this.sessionId !== void 0) headers[\"mcp-session-id\"] = this.sessionId;\n\t\t\tfor (const message of messages) if (isJSONRPCRequest(message)) {\n\t\t\t\tthis._streamMapping.set(streamId, {\n\t\t\t\t\tcontroller: streamController,\n\t\t\t\t\tencoder,\n\t\t\t\t\tcleanup: () => {\n\t\t\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\t\t\tthis._streamMapping.delete(streamId);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tstreamController.close();\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis._requestToStreamMapping.set(message.id, streamId);\n\t\t\t}\n\t\t\tawait this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion);\n\t\t\tfor (const message of messages) {\n\t\t\t\tlet closeSSEStream;\n\t\t\t\tlet closeStandaloneSSEStream;\n\t\t\t\tif (isJSONRPCRequest(message) && this._eventStore && this.supportsEmptySSEData(clientProtocolVersion)) {\n\t\t\t\t\tcloseSSEStream = () => {\n\t\t\t\t\t\tthis.closeSSEStream(message.id);\n\t\t\t\t\t};\n\t\t\t\t\tcloseStandaloneSSEStream = () => {\n\t\t\t\t\t\tthis.closeStandaloneSSEStream();\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tthis.onmessage?.(message, {\n\t\t\t\t\tauthInfo: options?.authInfo,\n\t\t\t\t\trequest,\n\t\t\t\t\tcloseSSEStream,\n\t\t\t\t\tcloseStandaloneSSEStream\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (this._streamMapping.get(streamId)?.controller === streamController) keepAliveTimer = this.startKeepAlive(streamController, encoder);\n\t\t\treturn new Response(readable, {\n\t\t\t\tstatus: 200,\n\t\t\t\theaders\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error);\n\t\t\treturn this.createJsonErrorResponse(400, -32700, \"Parse error\", { data: String(error) });\n\t\t}\n\t}\n\t/**\n\t* Handles `DELETE` requests to terminate sessions\n\t*/\n\tasync handleDeleteRequest(req) {\n\t\tconst sessionError = this.validateSession(req);\n\t\tif (sessionError) return sessionError;\n\t\tconst protocolError = this.validateProtocolVersion(req);\n\t\tif (protocolError) return protocolError;\n\t\ttry {\n\t\t\tawait Promise.resolve(this._onsessionclosed?.(this.sessionId));\n\t\t\treturn new Response(null, { status: 200 });\n\t\t} finally {\n\t\t\tawait this.close();\n\t\t}\n\t}\n\t/**\n\t* Validates session ID for non-initialization requests.\n\t* Returns `Response` error if invalid, `undefined` otherwise\n\t*/\n\tvalidateSession(req) {\n\t\tif (this.sessionIdGenerator === void 0) return;\n\t\tif (!this._initialized) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Bad Request: Server not initialized\"));\n\t\t\treturn this.createJsonErrorResponse(400, -32e3, \"Bad Request: Server not initialized\");\n\t\t}\n\t\tconst sessionId = req.headers.get(\"mcp-session-id\");\n\t\tif (!sessionId) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Bad Request: Mcp-Session-Id header is required\"));\n\t\t\treturn this.createJsonErrorResponse(400, -32e3, \"Bad Request: Mcp-Session-Id header is required\");\n\t\t}\n\t\tif (sessionId !== this.sessionId) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Session not found\"));\n\t\t\treturn this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\t}\n\t}\n\t/**\n\t* Validates the `MCP-Protocol-Version` header on incoming requests.\n\t*\n\t* For initialization: Version negotiation handles unknown versions gracefully\n\t* (server responds with its supported version).\n\t*\n\t* For subsequent requests with `MCP-Protocol-Version` header:\n\t* - Accept if in supported list\n\t* - 400 if unsupported\n\t*\n\t* For HTTP requests without the `MCP-Protocol-Version` header:\n\t* - Accept and default to the version negotiated at initialization\n\t*/\n\tvalidateProtocolVersion(req) {\n\t\tconst protocolVersion = req.headers.get(\"mcp-protocol-version\");\n\t\tif (protocolVersion !== null && !this._supportedProtocolVersions.includes(protocolVersion)) {\n\t\t\tconst error = `Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${this._supportedProtocolVersions.join(\", \")})`;\n\t\t\tthis.onerror?.(new Error(error));\n\t\t\treturn this.createJsonErrorResponse(400, -32e3, error);\n\t\t}\n\t}\n\tasync close() {\n\t\tif (this._closed) return;\n\t\tthis._closed = true;\n\t\tfor (const { cleanup } of this._streamMapping.values()) cleanup();\n\t\tthis._streamMapping.clear();\n\t\tthis._requestResponseMap.clear();\n\t\tthis.onclose?.();\n\t}\n\t/**\n\t* Close an SSE stream for a specific request, triggering client reconnection.\n\t* Use this to implement polling behavior during long-running operations -\n\t* client will reconnect after the retry interval specified in the priming event.\n\t*/\n\tcloseSSEStream(requestId) {\n\t\tconst streamId = this._requestToStreamMapping.get(requestId);\n\t\tif (!streamId) return;\n\t\tconst stream = this._streamMapping.get(streamId);\n\t\tif (stream) stream.cleanup();\n\t}\n\t/**\n\t* Close the standalone `GET` SSE stream, triggering client reconnection.\n\t* Use this to implement polling behavior for server-initiated notifications.\n\t*/\n\tcloseStandaloneSSEStream() {\n\t\tconst stream = this._streamMapping.get(this._standaloneSseStreamId);\n\t\tif (stream) stream.cleanup();\n\t}\n\tasync send(message, options) {\n\t\tlet requestId = options?.relatedRequestId;\n\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) requestId = message.id;\n\t\tif (requestId === void 0) {\n\t\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) throw new Error(\"Cannot send a response on a standalone SSE stream unless resuming a previous client request\");\n\t\t\tlet eventId;\n\t\t\tif (this._eventStore) eventId = await this._eventStore.storeEvent(this._standaloneSseStreamId, message);\n\t\t\tconst standaloneSse = this._streamMapping.get(this._standaloneSseStreamId);\n\t\t\tif (standaloneSse === void 0) return;\n\t\t\tif (standaloneSse.controller && standaloneSse.encoder && (eventId === void 0 || !standaloneSse.replayedEventIds?.has(eventId))) this.writeSSEEvent(standaloneSse.controller, standaloneSse.encoder, message, eventId);\n\t\t\treturn;\n\t\t}\n\t\tconst streamId = this._requestToStreamMapping.get(requestId);\n\t\tif (!streamId) throw new Error(`No connection established for request ID: ${String(requestId)}`);\n\t\tlet stream = this._streamMapping.get(streamId);\n\t\tif (!this._enableJsonResponse) {\n\t\t\tlet eventId;\n\t\t\tif (this._eventStore) {\n\t\t\t\teventId = await this._eventStore.storeEvent(streamId, message);\n\t\t\t\tstream = this._streamMapping.get(streamId);\n\t\t\t}\n\t\t\tif (stream?.controller && stream?.encoder && (eventId === void 0 || !stream.replayedEventIds?.has(eventId))) this.writeSSEEvent(stream.controller, stream.encoder, message, eventId);\n\t\t}\n\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {\n\t\t\tthis._requestResponseMap.set(requestId, message);\n\t\t\tconst relatedIds = [...this._requestToStreamMapping.entries()].filter(([_, sid]) => sid === streamId).map(([id]) => id);\n\t\t\tif (relatedIds.every((id) => this._requestResponseMap.has(id))) {\n\t\t\t\tif (!stream) {\n\t\t\t\t\tif (this._enableJsonResponse) throw new Error(`No connection established for request ID: ${String(requestId)}`);\n\t\t\t\t\tif (!this._eventStore) {\n\t\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(`Response for request ID ${String(requestId)} is undeliverable: per-request stream is disconnected and no eventStore is configured`));\n\t\t\t\t\t\tfor (const id of relatedIds) {\n\t\t\t\t\t\t\tthis._requestResponseMap.delete(id);\n\t\t\t\t\t\t\tthis._requestToStreamMapping.delete(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const id of relatedIds) {\n\t\t\t\t\t\tthis._requestResponseMap.delete(id);\n\t\t\t\t\t\tthis._requestToStreamMapping.delete(id);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this._enableJsonResponse && stream.resolveJson) {\n\t\t\t\t\tconst headers = { \"Content-Type\": \"application/json\" };\n\t\t\t\t\tif (this.sessionId !== void 0) headers[\"mcp-session-id\"] = this.sessionId;\n\t\t\t\t\tconst responses = relatedIds.map((id) => this._requestResponseMap.get(id));\n\t\t\t\t\tif (responses.length === 1) stream.resolveJson(Response.json(responses[0], {\n\t\t\t\t\t\tstatus: 200,\n\t\t\t\t\t\theaders\n\t\t\t\t\t}));\n\t\t\t\t\telse stream.resolveJson(Response.json(responses, {\n\t\t\t\t\t\tstatus: 200,\n\t\t\t\t\t\theaders\n\t\t\t\t\t}));\n\t\t\t\t\tstream.cleanup();\n\t\t\t\t} else stream.cleanup();\n\t\t\t\tfor (const id of relatedIds) {\n\t\t\t\t\tthis._requestResponseMap.delete(id);\n\t\t\t\t\tthis._requestToStreamMapping.delete(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/server/createMcpHandler.ts\n/**\n* The JSON-RPC id to echo on an entry-built error response: the body's `id`\n* when the body is a single JSON-RPC request whose id is a string or number,\n* `null` otherwise. Error responses must carry the id of the request they\n* correspond to whenever it could be read; `null` is reserved for the cases\n* where no single request id is determinable — unparseable bodies, body-less\n* methods, notifications, posted responses and batch arrays.\n*/\nfunction echoableRequestId(body) {\n\tif (body === null || typeof body !== \"object\" || Array.isArray(body)) return null;\n\tconst { method, id } = body;\n\tif (typeof method !== \"string\") return null;\n\treturn typeof id === \"string\" || typeof id === \"number\" ? id : null;\n}\nfunction jsonRpcErrorResponse(httpStatus, code, message, data, id = null) {\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode,\n\t\t\tmessage,\n\t\t\t...data !== void 0 && { data }\n\t\t},\n\t\tid\n\t}, { status: httpStatus });\n}\nfunction rejectionResponse(rejection, id = null) {\n\treturn jsonRpcErrorResponse(rejection.httpStatus, rejection.code, rejection.message, rejection.data, id);\n}\nfunction toError(value) {\n\treturn value instanceof Error ? value : new Error(String(value));\n}\nfunction internalServerErrorResponse(id = null) {\n\treturn jsonRpcErrorResponse(500, -32603, \"Internal server error\", void 0, id);\n}\n/** Throws when the factory returned an instance that is still connected to another exchange. */\nfunction assertNotServing(server) {\n\tif (server.transport !== void 0) throw new Error(\"The factory returned an instance that is still serving another request. Return a new instance for each request.\");\n}\n/**\n* The entry's default legacy serving (`legacy: 'stateless'`): per-request\n* stateless serving of 2025-era traffic using the same factory as the modern\n* path. Exported as a standalone building block for hand-wired compositions\n* (for example mounting legacy stateless serving on its own route next to a\n* strict modern endpoint).\n*\n* Each POST is served by a fresh instance from the factory connected to a\n* fresh streamable HTTP transport constructed with only\n* `sessionIdGenerator: undefined` — the established stateless idiom, unchanged.\n* Because serving is per-request and stateless, GET and DELETE (2025 session\n* operations) are answered with `405` / `Method not allowed.`, exactly like the\n* canonical stateless example.\n*\n* The optional `onerror` callback receives factory and serving failures on\n* this leg (reporting only — the response stays the 500 internal-error body).\n* The entry passes its own `onerror` here when expanding the default, so\n* legacy-leg failures are never silently swallowed.\n*/\nfunction createLegacyStatelessFallback(factory, onerror, keepAliveMs, maxRequestBodySize) {\n\treturn async (request, options) => {\n\t\tif (request.method.toUpperCase() !== \"POST\") return jsonRpcErrorResponse(405, -32e3, \"Method not allowed.\");\n\t\ttry {\n\t\t\tconst product = await factory({\n\t\t\t\tera: \"legacy\",\n\t\t\t\t...options?.authInfo !== void 0 && { authInfo: options.authInfo },\n\t\t\t\trequestInfo: request\n\t\t\t});\n\t\t\tconst transport = new WebStandardStreamableHTTPServerTransport({\n\t\t\t\tsessionIdGenerator: void 0,\n\t\t\t\t...keepAliveMs !== void 0 && { keepAliveMs },\n\t\t\t\t...maxRequestBodySize !== void 0 && { maxRequestBodySize }\n\t\t\t});\n\t\t\tawait product.connect(transport);\n\t\t\tconst teardown = () => {\n\t\t\t\ttransport.close().catch(() => {});\n\t\t\t\tproduct.close().catch(() => {});\n\t\t\t};\n\t\t\trequest.signal?.addEventListener(\"abort\", teardown, { once: true });\n\t\t\tconst response = await transport.handleRequest(request, {\n\t\t\t\t...options?.authInfo !== void 0 && { authInfo: options.authInfo },\n\t\t\t\t...options?.parsedBody !== void 0 && { parsedBody: options.parsedBody }\n\t\t\t});\n\t\t\tif (response.body === null || mediaTypeEssence(response.headers.get(\"content-type\")) !== \"text/event-stream\") {\n\t\t\t\tteardown();\n\t\t\t\treturn response;\n\t\t\t}\n\t\t\tconst reader = response.body.getReader();\n\t\t\tlet toreDown = false;\n\t\t\tconst completeExchange = () => {\n\t\t\t\tif (!toreDown) {\n\t\t\t\t\ttoreDown = true;\n\t\t\t\t\tteardown();\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst monitoredBody = new ReadableStream({\n\t\t\t\tpull: async (controller) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\tcompleteExchange();\n\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (value !== void 0) controller.enqueue(value);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tcompleteExchange();\n\t\t\t\t\t\tcontroller.error(error);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcancel: (reason) => {\n\t\t\t\t\tcompleteExchange();\n\t\t\t\t\treturn reader.cancel(reason).catch(() => {});\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn new Response(monitoredBody, {\n\t\t\t\tstatus: response.status,\n\t\t\t\tstatusText: response.statusText,\n\t\t\t\theaders: response.headers\n\t\t\t});\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tonerror?.(toError(error));\n\t\t\t} catch {}\n\t\t\treturn internalServerErrorResponse(echoableRequestId(options?.parsedBody));\n\t\t}\n\t};\n}\nfunction legacyStatelessFallback(factory, onerror, options) {\n\treturn createLegacyStatelessFallback(factory, onerror, void 0, resolveMaxRequestBodySize(options?.maxRequestBodySize));\n}\n/**\n* Read the SEP-2243 standard request headers off the inbound request.\n*\n* Both halves of the standard-header story need them — the body-primary\n* classifier for its cross-check cells, and\n* {@linkcode validateStandardRequestHeaders} for the presence half — and a\n* header read at one site but not the other is precisely how a required header\n* goes unenforced: that divergence is what let a modern POST omitting\n* `MCP-Protocol-Version` be served. Read them here once so a header added to\n* {@linkcode InboundHttpRequest} reaches both sites together.\n*/\nfunction standardHeadersOf(request) {\n\treturn {\n\t\tprotocolVersionHeader: request.headers.get(\"mcp-protocol-version\") ?? void 0,\n\t\tmcpMethodHeader: request.headers.get(\"mcp-method\") ?? void 0,\n\t\tmcpNameHeader: request.headers.get(\"mcp-name\") ?? void 0\n\t};\n}\n/**\n* The entry's classification step: read the request body exactly once (unless\n* a pre-parsed body is supplied) and classify the request with\n* {@linkcode classifyInboundRequest}. This is the single code path behind both\n* {@linkcode createMcpHandler}'s routing and the exported\n* {@linkcode isLegacyRequest} predicate, so the two can never disagree.\n*\n* Pass `needsForward: false` when the caller never reads `forwardRequest` —\n* the body-preserving clone is then skipped and `forwardRequest` is the\n* (consumed) input request.\n*/\nasync function classifyEntryRequest(request, providedParsedBody, needsForward = true, maxRequestBodySize = DEFAULT_MAX_REQUEST_BODY_SIZE) {\n\tconst httpMethod = request.method.toUpperCase();\n\tlet body;\n\tlet parsedBody = providedParsedBody;\n\tlet forwardRequest = request;\n\tlet unparseable = false;\n\tif (httpMethod === \"POST\") {\n\t\tif (parsedBody === void 0) {\n\t\t\tif (needsForward) forwardRequest = request.clone();\n\t\t\tlet bodyText;\n\t\t\ttry {\n\t\t\t\tconst read = await readRequestBody(request, maxRequestBodySize);\n\t\t\t\tif (read.tooLarge) return { step: \"body-too-large\" };\n\t\t\t\tbodyText = read.text;\n\t\t\t} catch {\n\t\t\t\treturn { step: \"unreadable-body\" };\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tbody = bodyText.length === 0 ? void 0 : JSON.parse(bodyText);\n\t\t\t} catch {\n\t\t\t\tunparseable = true;\n\t\t\t}\n\t\t\tif (!unparseable && body !== void 0) parsedBody = body;\n\t\t} else body = parsedBody;\n\t\tif (unparseable || body === void 0) return {\n\t\t\tstep: \"no-json-body\",\n\t\t\tforwardRequest\n\t\t};\n\t}\n\treturn {\n\t\tstep: \"classified\",\n\t\toutcome: classifyInboundRequest({\n\t\t\thttpMethod,\n\t\t\t...standardHeadersOf(request),\n\t\t\t...body !== void 0 && { body }\n\t\t}),\n\t\tbody,\n\t\tparsedBody,\n\t\tforwardRequest\n\t};\n}\n/**\n* Whether {@linkcode createMcpHandler} would route this request to its legacy\n* (2025-era) serving rather than the modern (2026-07-28) path.\n*\n* Call it with just the request: `await isLegacyRequest(request)`. For a\n* `POST` the body is read from an internal clone, so the request you pass\n* stays fully readable for whichever handler you route it to — no second\n* argument is needed. (In a Node `(req, res)` handler, build that `Request`\n* with `toWebRequest(req)` from `@modelcontextprotocol/node`; behind a body\n* parser, which has already drained the Node stream, build it as\n* `toWebRequest(req, req.body)` so the bytes come from the parsed body —\n* either way the predicate still takes just the request.) The optional\n* `parsedBody` is a perf escape hatch for a body you already hold parsed:\n* pass it and the predicate classifies from the value directly, reading and\n* cloning nothing. It is needed, not just faster, when the request's own\n* body was already read — the internal clone is then impossible (cloning a\n* used body throws a `TypeError`), so such a single-argument call rejects\n* instead of guessing.\n*\n* This is the entry's own classification step exported as a predicate — it\n* runs exactly the code `createMcpHandler` runs to make the routing decision,\n* not a re-implementation — so a hand-wired composition that branches on it\n* can never disagree with the entry. It is classification only: hand-wired\n* compositions must validate Content-Type themselves (415 for POSTs whose\n* media type is not `application/json`, via {@linkcode isJsonContentType})\n* before dispatching either leg — routing the legacy leg into the SDK\n* transports gets their built-in check, but a custom modern leg has none. Use it to keep an existing legacy\n* deployment (for example a sessionful streamable HTTP wiring) serving 2025\n* traffic next to a strict modern endpoint, now that the entry has no\n* handler-valued `legacy` option:\n*\n* ```ts\n* import { createMcpHandler, isLegacyRequest } from '@modelcontextprotocol/server';\n*\n* const modern = createMcpHandler(factory, { legacy: 'reject' });\n*\n* export default {\n*     async fetch(request: Request): Promise<Response> {\n*         if (await isLegacyRequest(request)) {\n*             // e.g. an existing sessionful WebStandardStreamableHTTPServerTransport wiring\n*             return myExistingLegacyHandler(request);\n*         }\n*         return modern.fetch(request);\n*     }\n* };\n* ```\n*\n* Semantics (identical to the entry's routing):\n*\n* - Returns `true` only for requests with no per-request `_meta` envelope\n*   claim: claim-less POSTs (including the `initialize` handshake and 2025-era\n*   notification POSTs without a modern protocol-version header), body-less\n*   GET/DELETE session operations, all-legacy JSON-RPC batch arrays, posted\n*   JSON-RPC responses, and POSTs whose body is empty or not valid JSON.\n* - Returns `false` for everything the modern path answers, including its\n*   validation-ladder rejections: a request carrying the envelope claim (even\n*   one naming a revision the endpoint does not serve — the modern path\n*   answers it with the unsupported-protocol-version error), a malformed\n*   envelope behind a present claim (answered `-32602`), a request whose\n*   `MCP-Protocol-Version` header names a modern revision but that lacks the\n*   envelope (`-32602`), header/body mismatches (`-32020`), and a POST body\n*   over the size limit (413). Consumers\n*   routing on the predicate must send `false` traffic to the modern handler,\n*   never to a legacy handler — the modern path owns those error answers.\n* - `server/discover` probes sent by negotiating clients always carry the\n*   envelope claim, so they are never legacy; a hand-built claim-less POST to\n*   a method named `server/discover` has no claim and classifies legacy,\n*   exactly as the entry itself routes it.\n*/\nasync function isLegacyRequest(request, parsedBody, options) {\n\tconst maxRequestBodySize = resolveMaxRequestBodySize(options?.maxRequestBodySize);\n\tconst classified = await classifyEntryRequest(parsedBody === void 0 && request.method.toUpperCase() === \"POST\" ? request.clone() : request, parsedBody, false, maxRequestBodySize);\n\treturn classified.step === \"no-json-body\" || classified.step === \"classified\" && classified.outcome.kind === \"legacy\";\n}\n/**\n* Creates an HTTP handler that serves the 2026-07-28 protocol revision from a\n* per-request server factory and, by default, falls back to old-school\n* stateless serving for 2025-era traffic. Pass `legacy: 'reject'` for a\n* modern-only strict endpoint.\n*\n* Mounting: `handler.fetch` is the web-standard face (Cloudflare Workers,\n* Deno, Bun, Hono's `c.req.raw`); for Express/Fastify/plain `node:http`, wrap\n* the handler once with `toNodeHandler(handler)` from\n* `@modelcontextprotocol/node`. When mounting bare on a fetch-native runtime,\n* put Origin/Host validation in front of the handler — the entry itself is\n* deliberately validation-free:\n*\n* ```ts\n* import { hostHeaderValidationResponse, originValidationResponse, localhostAllowedHostnames, localhostAllowedOrigins } from '@modelcontextprotocol/server';\n*\n* export default {\n*     async fetch(request: Request): Promise<Response> {\n*         const rejected =\n*             hostHeaderValidationResponse(request, localhostAllowedHostnames()) ??\n*             originValidationResponse(request, localhostAllowedOrigins());\n*         return rejected ?? handler.fetch(request);\n*     }\n* };\n* ```\n*\n* Use ONE factory for both legs: the same tools/resources/prompts definition\n* backs the modern path and the stateless legacy fallback, so the two eras can\n* never drift apart. To keep an existing legacy deployment (for example a\n* sessionful streamable HTTP wiring) serving 2025 traffic instead of the\n* stateless fallback, route in user land with {@linkcode isLegacyRequest} in\n* front of a strict handler — see that predicate's documentation for the\n* pattern. Power users composing transport-neutral routing can also use the\n* exported building blocks directly: {@linkcode classifyInboundRequest} for\n* the era decision and `PerRequestHTTPServerTransport` for single-exchange\n* serving — such compositions must reject POSTs whose Content-Type media type\n* is not `application/json` (415) before parsing the body, using\n* {@linkcode isJsonContentType}; neither building block performs this\n* validation itself.\n*\n* The entry performs no token verification: `authInfo` given to `fetch` is\n* passed through to handlers and the factory as-is and is never derived from\n* request headers.\n*/\nfunction createMcpHandler(factory, options = {}) {\n\tconst { legacy, onerror, responseMode } = options;\n\tconst maxRequestBodySize = resolveMaxRequestBodySize(options.maxRequestBodySize);\n\tif (typeof legacy === \"function\") throw new TypeError(\"The 'legacy' option only accepts 'stateless' or 'reject', not a handler function. To serve 2025-era traffic with your own handler, route in user land with the exported isLegacyRequest(request) predicate in front of a strict (legacy: 'reject') handler.\");\n\t/** Modern per-request instances with an exchange still in flight (close() tears these down). */\n\tconst inflight = /* @__PURE__ */ new Set();\n\tlet closed = false;\n\tconst reportError = (error) => {\n\t\ttry {\n\t\t\tonerror?.(error);\n\t\t} catch {}\n\t};\n\tconst bus = options.bus ?? new InMemoryServerEventBus(reportError);\n\tconst notify = createServerNotifier(bus);\n\tconst listenRouter = createListenRouter({\n\t\tbus,\n\t\tmaxSubscriptions: options.maxSubscriptions ?? DEFAULT_MAX_SUBSCRIPTIONS,\n\t\tkeepAliveMs: options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS,\n\t\tonerror: reportError\n\t});\n\tif (responseMode === \"json\") console.warn(\"responseMode: 'json' drops mid-call notifications. subscriptions/listen streams are always served over SSE regardless; other notifications emitted before a result are dropped.\");\n\tconst legacyHandler = legacy === \"reject\" ? void 0 : createLegacyStatelessFallback(factory, reportError, options.keepAliveMs, maxRequestBodySize);\n\tasync function serveModern(route, request, authInfo) {\n\t\tconst claimedRevision = route.classification.revision;\n\t\tif (claimedRevision === void 0 || !SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(claimedRevision)) {\n\t\t\tconst error = new UnsupportedProtocolVersionError({\n\t\t\t\tsupported: [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],\n\t\t\t\trequested: claimedRevision ?? \"unknown\"\n\t\t\t});\n\t\t\treportError(error);\n\t\t\treturn jsonRpcErrorResponse(400, error.code, error.message, error.data, echoableRequestId(route.message));\n\t\t}\n\t\tconst stdHeaderRejection = validateStandardRequestHeaders({\n\t\t\thttpMethod: request.method,\n\t\t\t...standardHeadersOf(request)\n\t\t}, route);\n\t\tif (stdHeaderRejection !== void 0) {\n\t\t\treportError(/* @__PURE__ */ new Error(`Rejected inbound request (${stdHeaderRejection.cell}): ${stdHeaderRejection.message}`));\n\t\t\treturn rejectionResponse(stdHeaderRejection, echoableRequestId(route.message));\n\t\t}\n\t\tconst meta = route.messageKind === \"request\" ? requestMetaOf(route.message.params) : void 0;\n\t\tconst declaredClientCapabilities = meta?.[CLIENT_CAPABILITIES_META_KEY];\n\t\tif (route.messageKind === \"request\") {\n\t\t\tconst required = requiredClientCapabilitiesForRequest(route.message.method);\n\t\t\tif (required !== void 0) {\n\t\t\t\tconst missing = missingClientCapabilities(required, declaredClientCapabilities);\n\t\t\t\tif (missing !== void 0) {\n\t\t\t\t\tconst error = new MissingRequiredClientCapabilityError({ requiredCapabilities: missing });\n\t\t\t\t\treportError(error);\n\t\t\t\t\treturn jsonRpcErrorResponse(httpStatusForErrorCode(error.code, \"ladder\"), error.code, error.message, error.data, route.message.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst product = await factory({\n\t\t\tera: \"modern\",\n\t\t\t...authInfo !== void 0 && { authInfo },\n\t\t\trequestInfo: request\n\t\t});\n\t\tconst server = product instanceof McpServer ? product.server : product;\n\t\tassertNotServing(server);\n\t\tif (route.messageKind === \"request\" && route.message.method === \"subscriptions/listen\") {\n\t\t\tconst capabilities = server.getCapabilities();\n\t\t\tconst serverInfo = serverIdentityOf(server);\n\t\t\tproduct.close().catch(reportError);\n\t\t\treturn listenRouter.serve(route.message, request.signal, capabilities, serverInfo);\n\t\t}\n\t\tif (route.messageKind === \"request\" && route.message.method === \"tools/call\" && product instanceof McpServer) {\n\t\t\tconst callParams = route.message.params;\n\t\t\tconst toolName = typeof callParams?.name === \"string\" ? callParams.name : void 0;\n\t\t\tconst inputSchema = toolName === void 0 ? void 0 : product.toolInputSchemaJson(toolName);\n\t\t\tif (inputSchema !== void 0) {\n\t\t\t\tconst scan = scanXMcpHeaderDeclarations(inputSchema);\n\t\t\t\tif (scan.valid && scan.declarations.length > 0) {\n\t\t\t\t\tconst rejection = validateMcpParamHeaders(scan.declarations, callParams?.arguments, request.headers);\n\t\t\t\t\tif (rejection !== void 0) {\n\t\t\t\t\t\tproduct.close().catch(reportError);\n\t\t\t\t\t\treportError(/* @__PURE__ */ new Error(`Rejected inbound request (${rejection.cell}): ${rejection.message}`));\n\t\t\t\t\t\treturn rejectionResponse(rejection, route.message.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (route.messageKind === \"request\" && product instanceof McpServer) try {\n\t\t\tconst challenge = await findScopeChallenge([route.message], authInfo, (context) => product.resolveScopeChallenge(context));\n\t\t\tif (challenge !== void 0) {\n\t\t\t\tproduct.close().catch(reportError);\n\t\t\t\treturn createScopeChallengeResponse(challenge, scopeChallengeResourceMetadataUrl(authInfo));\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tproduct.close().catch(reportError);\n\t\t\treportError(toError(error));\n\t\t\treturn internalServerErrorResponse(route.message.id);\n\t\t}\n\t\tassertNotServing(server);\n\t\tsetNegotiatedProtocolVersion(server, claimedRevision);\n\t\tinstallModernOnlyHandlers(server, SUPPORTED_MODERN_PROTOCOL_VERSIONS);\n\t\tif (meta !== void 0) seedClientIdentityFromEnvelope(server, {\n\t\t\tclientInfo: meta[CLIENT_INFO_META_KEY],\n\t\t\tclientCapabilities: declaredClientCapabilities\n\t\t});\n\t\tconst previousOnClose = server.onclose;\n\t\tinflight.add(server);\n\t\tconst onExchangeClose = () => {\n\t\t\tinflight.delete(server);\n\t\t\tif (server.onclose === onExchangeClose) server.onclose = previousOnClose;\n\t\t\tpreviousOnClose?.();\n\t\t};\n\t\tserver.onclose = onExchangeClose;\n\t\ttry {\n\t\t\tconst response = await invoke(product, route.message, {\n\t\t\t\tclassification: route.classification,\n\t\t\t\trequest,\n\t\t\t\t...authInfo !== void 0 && { authInfo },\n\t\t\t\t...responseMode !== void 0 && { responseMode },\n\t\t\t\t...options.keepAliveMs !== void 0 && { keepAliveMs: options.keepAliveMs }\n\t\t\t});\n\t\t\tif (route.messageKind === \"notification\") queueMicrotask(() => void server.close().catch(() => {}));\n\t\t\treturn response;\n\t\t} catch (error) {\n\t\t\tif (error instanceof SdkError && error.code === SdkErrorCode.ConnectionClosed) return new Response(null, { status: 499 });\n\t\t\tawait server.close().catch(() => {});\n\t\t\tinflight.delete(server);\n\t\t\treportError(toError(error));\n\t\t\treturn internalServerErrorResponse(echoableRequestId(route.message));\n\t\t}\n\t}\n\tasync function serveLegacyRoute(route, forwardRequest, authInfo, parsedBody) {\n\t\tif (legacyHandler !== void 0) return legacyHandler(forwardRequest, {\n\t\t\t...authInfo !== void 0 && { authInfo },\n\t\t\t...parsedBody !== void 0 && { parsedBody }\n\t\t});\n\t\tconst strict = modernOnlyStrictRejection(route, SUPPORTED_MODERN_PROTOCOL_VERSIONS);\n\t\tif (strict === void 0) return new Response(null, { status: 202 });\n\t\treportError(/* @__PURE__ */ new Error(`Rejected 2025-era request on a modern-only endpoint (${strict.cell}): ${strict.message}`));\n\t\treturn rejectionResponse(strict, echoableRequestId(parsedBody));\n\t}\n\tasync function handle(request, requestOptions) {\n\t\tconst authInfo = requestOptions?.authInfo;\n\t\tif (request.method.toUpperCase() === \"POST\" && !isJsonContentType(request.headers.get(\"content-type\"))) {\n\t\t\treportError(/* @__PURE__ */ new Error(\"Unsupported Media Type: Content-Type must be application/json\"));\n\t\t\treturn jsonRpcErrorResponse(415, -32e3, \"Unsupported Media Type: Content-Type must be application/json\");\n\t\t}\n\t\tconst classified = await classifyEntryRequest(request, requestOptions?.parsedBody, true, maxRequestBodySize);\n\t\tif (classified.step === \"unreadable-body\") return jsonRpcErrorResponse(400, -32700, \"Parse error: the request body could not be read\");\n\t\tif (classified.step === \"body-too-large\") return jsonRpcErrorResponse(413, -32e3, requestBodyTooLargeMessage(maxRequestBodySize));\n\t\tif (classified.step === \"no-json-body\") {\n\t\t\tif (legacyHandler !== void 0) return legacyHandler(classified.forwardRequest, { ...authInfo !== void 0 && { authInfo } });\n\t\t\treturn jsonRpcErrorResponse(400, -32700, \"Parse error: the request body is not valid JSON\");\n\t\t}\n\t\tconst { outcome, body, parsedBody, forwardRequest } = classified;\n\t\ttry {\n\t\t\tswitch (outcome.kind) {\n\t\t\t\tcase \"reject\":\n\t\t\t\t\treportError(/* @__PURE__ */ new Error(`Rejected inbound request (${outcome.cell}): ${outcome.message}`));\n\t\t\t\t\treturn rejectionResponse(outcome, echoableRequestId(body));\n\t\t\t\tcase \"modern\": return await serveModern(outcome, request, authInfo);\n\t\t\t\tcase \"legacy\": return await serveLegacyRoute(outcome, forwardRequest, authInfo, parsedBody);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treportError(toError(error));\n\t\t\treturn internalServerErrorResponse(echoableRequestId(body));\n\t\t}\n\t}\n\tconst fetchFace = async (request, requestOptions) => {\n\t\tif (closed) throw new Error(\"This MCP handler has been closed\");\n\t\ttry {\n\t\t\treturn await handle(request, requestOptions);\n\t\t} catch (error) {\n\t\t\treportError(toError(error));\n\t\t\treturn internalServerErrorResponse(echoableRequestId(requestOptions?.parsedBody));\n\t\t}\n\t};\n\treturn {\n\t\tfetch: fetchFace,\n\t\tnotify,\n\t\tbus,\n\t\tclose: async () => {\n\t\t\tclosed = true;\n\t\t\tlistenRouter.closeAll();\n\t\t\tconst closing = [...inflight].map((server) => server.close().catch(() => {}));\n\t\t\tinflight.clear();\n\t\t\tawait Promise.all(closing);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/server/middleware/hostHeaderValidation.ts\n/**\n* Parse and validate a `Host` header against an allowlist of hostnames (port-agnostic).\n*\n* - Input host header may include a port (e.g. `localhost:3000`) or IPv6 brackets (e.g. `[::1]:3000`).\n* - Allowlist items should be hostnames only (no ports). For IPv6, include brackets (e.g. `[::1]`).\n*/\nfunction validateHostHeader(hostHeader, allowedHostnames) {\n\tif (!hostHeader) return {\n\t\tok: false,\n\t\terrorCode: \"missing_host\",\n\t\tmessage: \"Missing Host header\"\n\t};\n\tlet hostname;\n\ttry {\n\t\thostname = new URL(`http://${hostHeader}`).hostname;\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\terrorCode: \"invalid_host_header\",\n\t\t\tmessage: `Invalid Host header: ${hostHeader}`,\n\t\t\thostHeader\n\t\t};\n\t}\n\tif (!allowedHostnames.includes(hostname)) return {\n\t\tok: false,\n\t\terrorCode: \"invalid_host\",\n\t\tmessage: `Invalid Host: ${hostname}`,\n\t\thostHeader,\n\t\thostname\n\t};\n\treturn {\n\t\tok: true,\n\t\thostname\n\t};\n}\n/**\n* Convenience allowlist for `localhost` DNS rebinding protection.\n*/\nfunction localhostAllowedHostnames() {\n\treturn [\n\t\t\"localhost\",\n\t\t\"127.0.0.1\",\n\t\t\"[::1]\"\n\t];\n}\n/**\n* Web-standard `Request` helper for DNS rebinding protection.\n* @example\n* ```ts source=\"./hostHeaderValidation.examples.ts#hostHeaderValidationResponse_basicUsage\"\n* const result = validateHostHeader(req.headers.get('host'), ['localhost']);\n* ```\n*/\nfunction hostHeaderValidationResponse(req, allowedHostnames) {\n\tconst result = validateHostHeader(req.headers.get(\"host\"), allowedHostnames);\n\tif (result.ok) return void 0;\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode: -32e3,\n\t\t\tmessage: result.message\n\t\t},\n\t\tid: null\n\t}, {\n\t\tstatus: 403,\n\t\theaders: { \"Content-Type\": \"application/json\" }\n\t});\n}\n\n//#endregion\n//#region src/server/middleware/originValidation.ts\n/**\n* Validate an `Origin` header against an allowlist of hostnames (port-agnostic).\n*\n* - A missing/empty `Origin` header passes: non-browser clients do not send one,\n*   and only browser-originated requests carry the header this check defends against.\n* - Allowlist items are hostnames only (no scheme, no port), the same convention as\n*   `validateHostHeader`. For IPv6, include brackets (e.g. `[::1]`).\n* - A browser extension's origin carries its extension ID as the hostname; list the\n*   ID to allow one extension. An allowlist item of the form `<scheme>://*`\n*   (lowercase, e.g. `moz-extension://*`) allows every origin of that scheme, which\n*   Firefox needs because its extension IDs differ on every install.\n*   `http://*` and `https://*` are not honoured: list websites by hostname.\n* - Any present value that cannot be parsed as an origin URL — including the literal\n*   `null` origin browsers send for opaque contexts — is rejected (deny on failure).\n*/\nfunction validateOriginHeader(originHeader, allowedOriginHostnames) {\n\tif (originHeader === null || originHeader === void 0 || originHeader === \"\") return { ok: true };\n\tlet hostname;\n\tlet scheme;\n\ttry {\n\t\tconst url = new URL(originHeader);\n\t\thostname = url.hostname;\n\t\tscheme = url.protocol;\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\terrorCode: \"invalid_origin_header\",\n\t\t\tmessage: `Invalid Origin header: ${originHeader}`,\n\t\t\toriginHeader\n\t\t};\n\t}\n\tif (hostname === \"\") return {\n\t\tok: false,\n\t\terrorCode: \"invalid_origin_header\",\n\t\tmessage: `Invalid Origin header: ${originHeader}`,\n\t\toriginHeader\n\t};\n\tif (!(scheme !== \"http:\" && scheme !== \"https:\" && allowedOriginHostnames.includes(`${scheme}//*`)) && !allowedOriginHostnames.includes(hostname)) return {\n\t\tok: false,\n\t\terrorCode: \"invalid_origin\",\n\t\tmessage: `Invalid Origin: ${hostname}`,\n\t\toriginHeader,\n\t\thostname\n\t};\n\treturn {\n\t\tok: true,\n\t\torigin: originHeader,\n\t\thostname\n\t};\n}\n/**\n* Convenience allowlist of localhost-class origin hostnames, mirroring\n* `localhostAllowedHostnames`.\n*/\nfunction localhostAllowedOrigins() {\n\treturn [\n\t\t\"localhost\",\n\t\t\"127.0.0.1\",\n\t\t\"[::1]\"\n\t];\n}\n/**\n* Web-standard `Request` helper for Origin validation: returns a `403` JSON-RPC\n* error response when the request's `Origin` header is not allowed, and\n* `undefined` when the request may proceed.\n*\n* ```ts\n* const rejected = originValidationResponse(request, localhostAllowedOrigins());\n* if (rejected) return rejected;\n* ```\n*/\nfunction originValidationResponse(req, allowedOriginHostnames) {\n\tconst result = validateOriginHeader(req.headers.get(\"origin\"), allowedOriginHostnames);\n\tif (result.ok) return void 0;\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode: -32e3,\n\t\t\tmessage: result.message\n\t\t},\n\t\tid: null\n\t}, {\n\t\tstatus: 403,\n\t\theaders: { \"Content-Type\": \"application/json\" }\n\t});\n}\n\n//#endregion\n//#region src/server/requestStateCodec.ts\nconst PREFIX = \"v1.\";\nfunction bytesToBase64Url(bytes) {\n\tlet bin = \"\";\n\tfor (const b of bytes) bin += String.fromCodePoint(b);\n\treturn btoa(bin).replaceAll(\"+\", \"-\").replaceAll(\"/\", \"_\").replace(/=+$/, \"\");\n}\nfunction constantTimeTagEqual(a, b) {\n\tif (a.length !== b.length) return false;\n\tlet r = 0;\n\tfor (let i = 0; i < a.length; i++) r |= a.codePointAt(i) ^ b.codePointAt(i);\n\treturn r === 0;\n}\nfunction base64UrlToBytes(s) {\n\tconst b64 = s.replaceAll(\"-\", \"+\").replaceAll(\"_\", \"/\");\n\tconst bin = atob(b64);\n\tconst bytes = new Uint8Array(bin.length);\n\tfor (let i = 0; i < bin.length; i++) bytes[i] = bin.codePointAt(i);\n\treturn bytes;\n}\n/**\n* Create an opt-in HMAC-SHA256 codec for the multi-round-trip `requestState`\n* (protocol revision 2026-07-28).\n*\n* `requestState` round-trips through the client and is attacker-controlled\n* input on re-entry. The SDK applies no protection of its own; this helper is\n* the convenience implementation of the spec's integrity MUST so authors don't\n* hand-roll HMAC. Wire shape:\n*\n*     \"v1.\" b64url({\"p\":<payload>,\"exp\":<unixSeconds>,\"b\":<bindTag>?}) \".\" b64url(mac)\n*\n* where `bindTag` is `b64url(HMAC(key, \"mcp.requestState.bind:\" + bind(ctx))[:16])`\n* — the binding value is never embedded raw.\n*\n* The codec is **signed, not encrypted**: the body is integrity-protected but\n* the client can base64url-decode it and read the payload (`p`) in clear. Do\n* not put secrets in the payload; use an AEAD construction if confidentiality\n* is required. The handler reads its payload back via the typed\n* `ctx.mcpReq.requestState<T>()` accessor — the seam has already run `verify`\n* (integrity proven, payload decoded) by the time the handler is entered.\n*\n* Verification is fail-closed and constant-time (WebCrypto `subtle.verify` for\n* the body MAC; a fixed-length XOR-accumulator compare for the bind tag).\n* See `examples/mrtr/server.ts` for a worked end-to-end example.\n*\n* Design comparison (mcp.d `secureRequestState`, the peer SDK's reference\n* implementation): mcp.d additionally offers an AES-256-GCM encrypted mode and\n* derives independent cipher / bind-HMAC sub-keys from the operator secret via\n* HKDF-SHA256, with an auto-generated per-process ephemeral key when none is\n* supplied. This codec deliberately ships only the signed mode and a single\n* keyed HMAC (domain-separated by input prefix) — HKDF sub-key derivation and\n* an encrypted mode are intentionally out of scope for the initial release.\n*/\nfunction createRequestStateCodec(options) {\n\tconst subtle = globalThis.crypto?.subtle;\n\tif (subtle === void 0) throw new TypeError(\"createRequestStateCodec requires the Web Crypto API (globalThis.crypto.subtle); see https://ts.sdk.modelcontextprotocol.io/v2/troubleshooting for the Node.js polyfill instructions\");\n\tconst keyBytes = typeof options.key === \"string\" ? new TextEncoder().encode(options.key) : Uint8Array.from(options.key);\n\tif (keyBytes.byteLength < 32) throw new RangeError(`createRequestStateCodec: key must be at least 32 bytes (got ${keyBytes.byteLength})`);\n\tconst ttlSeconds = options.ttlSeconds ?? 600;\n\tif (!Number.isFinite(ttlSeconds)) throw new RangeError(\"createRequestStateCodec: ttlSeconds must be a finite number\");\n\tconst bind = options.bind;\n\tlet cryptoKey;\n\tconst importedKey = () => cryptoKey ??= subtle.importKey(\"raw\", keyBytes, {\n\t\tname: \"HMAC\",\n\t\thash: \"SHA-256\"\n\t}, false, [\"sign\", \"verify\"]);\n\tconst utf8 = new TextEncoder();\n\tconst BIND_LABEL = \"mcp.requestState.bind:\";\n\tconst bindTag = async (value) => {\n\t\treturn bytesToBase64Url(new Uint8Array(await subtle.sign(\"HMAC\", await importedKey(), utf8.encode(BIND_LABEL + value))).slice(0, 16));\n\t};\n\treturn {\n\t\tasync mint(payload, ctx) {\n\t\t\tconst envelope = {\n\t\t\t\tp: payload,\n\t\t\t\texp: Math.floor(Date.now() / 1e3) + ttlSeconds\n\t\t\t};\n\t\t\tif (bind !== void 0) {\n\t\t\t\tif (ctx === void 0) throw new TypeError(\"createRequestStateCodec: mint() requires ctx when a bind callback is configured\");\n\t\t\t\tenvelope.b = await bindTag(bind(ctx));\n\t\t\t}\n\t\t\tconst body = bytesToBase64Url(utf8.encode(JSON.stringify(envelope)));\n\t\t\treturn `${PREFIX}${body}.${bytesToBase64Url(new Uint8Array(await subtle.sign(\"HMAC\", await importedKey(), utf8.encode(PREFIX + body))))}`;\n\t\t},\n\t\tasync verify(state, ctx) {\n\t\t\tconst dot = state.lastIndexOf(\".\");\n\t\t\tif (!state.startsWith(PREFIX) || dot <= 3) throw new Error(\"malformed\");\n\t\t\tconst body = state.slice(3, dot);\n\t\t\tlet macBytes;\n\t\t\ttry {\n\t\t\t\tmacBytes = base64UrlToBytes(state.slice(dot + 1));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\"malformed\");\n\t\t\t}\n\t\t\tif (!await subtle.verify(\"HMAC\", await importedKey(), macBytes, utf8.encode(PREFIX + body))) throw new Error(\"mac\");\n\t\t\tlet envelope;\n\t\t\ttry {\n\t\t\t\tenvelope = JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(base64UrlToBytes(body)));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\"malformed\");\n\t\t\t}\n\t\t\tif (typeof envelope.exp !== \"number\" || envelope.exp < Math.floor(Date.now() / 1e3)) throw new Error(\"expired\");\n\t\t\tif (bind !== void 0) {\n\t\t\t\tconst expected = await bindTag(bind(ctx));\n\t\t\t\tif (envelope.b === void 0 || !constantTimeTagEqual(envelope.b, expected)) throw new Error(\"bind\");\n\t\t\t} else if (envelope.b !== void 0) throw new Error(\"bind\");\n\t\t\treturn envelope.p;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/fromJsonSchema.ts\nlet _defaultValidator;\nfunction fromJsonSchema(schema, validator) {\n\treturn fromJsonSchema$1(schema, validator ?? (_defaultValidator ??= new DefaultJsonSchemaValidator()));\n}\n\n//#endregion\nexport { BAGGAGE_META_KEY, CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, DEFAULT_MAX_REQUEST_BODY_SIZE, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, DEFAULT_REQUEST_TIMEOUT_MSEC, INTERNAL_ERROR, INVALID_PARAMS, INVALID_REQUEST, InMemoryServerEventBus, InMemoryTransport, JSONRPC_VERSION, LATEST_PROTOCOL_VERSION, LOG_LEVEL_META_KEY, METHOD_NOT_FOUND, McpServer, MissingRequiredClientCapabilityError, OAuthError, OAuthErrorCode, PARSE_ERROR, PROTOCOL_VERSION_META_KEY, PerRequestHTTPServerTransport, Protocol, ProtocolError, ProtocolErrorCode, RELATED_TASK_META_KEY, ReadBuffer, ResourceNotFoundError, ResourceTemplate, SERVER_INFO_META_KEY, STDIO_DEFAULT_MAX_BUFFER_SIZE, SUBSCRIPTION_ID_META_KEY, SUPPORTED_PROTOCOL_VERSIONS, SdkError, SdkErrorCode, SdkHttpError, Server, TRACEPARENT_META_KEY, TRACESTATE_META_KEY, UnsupportedProtocolVersionError, UriTemplate, UrlElicitationRequiredError, WebStandardStreamableHTTPServerTransport, acceptedContent, assertCompleteRequestPrompt, assertCompleteRequestResourceTemplate, bearerAuthChallengeResponse, buildOAuthProtectedResourceMetadata, checkResourceAllowed, classifyInboundRequest, completable, createFetchWithInit, createMcpHandler, createRequestStateCodec, deserializeMessage, fromJsonSchema, getDisplayName, getOAuthProtectedResourceMetadataUrl, hostHeaderValidationResponse, inputRequired, inputResponse, isCallToolResult, isCompletable, isInitializeRequest, isInitializedNotification, isInputRequiredResult, isJSONRPCErrorResponse, isJSONRPCNotification, isJSONRPCRequest, isJSONRPCResponse, isJSONRPCResultResponse, isJsonContentType, isLegacyRequest, isSpecType, isTaskAugmentedRequestParams, legacyStatelessFallback, localhostAllowedHostnames, localhostAllowedOrigins, mergeCapabilities, oauthMetadataResponse, originValidationResponse, parseJSONRPCMessage, preloadSchemas, readRequestBody, requireBearerAuth, requireScopes, resourceUrlFromServerUrl, serializeMessage, specTypeSchemas, validateHostHeader, validateOriginHeader, verifyBearerToken };\n//# sourceMappingURL=index.mjs.map","import { isPoHeadlessToolBusyError } from \"../schemas/headless.mjs\";\nimport { SessionMcpConversationError, sessionMcpConversationDigest } from \"../services/sessionMcpConversations/index.mjs\";\nimport { randomUUID } from \"node:crypto\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport { ProtocolError, ProtocolErrorCode, Server, createMcpHandler } from \"@modelcontextprotocol/server\";\n//#region src/server/sessionMcpHandler.ts\n/** Stable transport tools stay available when a conversation changes its MCP composition. */\nconst SESSION_MCP_EXTRA_TOOLS = [\n\t{\n\t\tname: \"load_extra_tools\",\n\t\ttitle: \"Load extra tools\",\n\t\tdescription: \"List Po tools and skills added or changed in this conversation after your tool list loaded, for example after a mode change. Takes {}. Empty means nothing was added or changed. Run a returned tool with use_extra_tools.\",\n\t\tinputSchema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {},\n\t\t\tadditionalProperties: false\n\t\t},\n\t\tannotations: { readOnlyHint: true },\n\t\t_meta: { ui: { visibility: [\"model\"] } }\n\t},\n\t{\n\t\tname: \"use_extra_tools\",\n\t\ttitle: \"Use extra tools\",\n\t\tdescription: \"Run a Po tool returned by load_extra_tools, in the session's host repository. Pass { name, arguments }. Check isError in the result.\",\n\t\tinputSchema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tname: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Exact name returned by load_extra_tools, including any prefix.\"\n\t\t\t\t},\n\t\t\t\targuments: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tdescription: \"Arguments object matching that tool's input schema. Defaults to {}.\"\n\t\t\t\t}\n\t\t\t},\n\t\t\trequired: [\"name\"],\n\t\t\tadditionalProperties: false\n\t\t},\n\t\t_meta: { ui: { visibility: [\"model\"] } }\n\t},\n\t{\n\t\tname: \"session_capabilities\",\n\t\ttitle: \"Session capabilities\",\n\t\tdescription: \"List every Po tool and skill this connection is granted now, with input schemas. Takes {}. This is an inventory and does not add tools to your tool list. Call it once when a tool seems missing or the session mode changed.\",\n\t\tinputSchema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {},\n\t\t\tadditionalProperties: false\n\t\t},\n\t\tannotations: { readOnlyHint: true },\n\t\t_meta: { ui: { visibility: [\"model\"] } }\n\t}\n];\nfunction presentationMeta(meta, presentation) {\n\tif (presentation === \"app\" || meta === void 0) return meta;\n\treturn Object.fromEntries(Object.entries(meta).filter(([key]) => key !== \"ui\" && !key.startsWith(\"openai/\") || key === \"openai/fileParams\").filter(([key]) => key !== \"po/widget\" && key !== \"po/toolName\"));\n}\nfunction publicTool(tool) {\n\treturn {\n\t\tname: tool.name,\n\t\ttitle: tool.label,\n\t\tdescription: tool.description,\n\t\tinputSchema: tool.parameters,\n\t\t...tool.annotations === void 0 ? {} : { annotations: tool.annotations },\n\t\t...tool.outputSchema === void 0 ? {} : { outputSchema: tool.outputSchema },\n\t\t_meta: {\n\t\t\t...tool._meta,\n\t\t\tui: {\n\t\t\t\t...tool._meta?.ui,\n\t\t\t\tvisibility: tool._meta?.ui?.visibility ?? [\"model\"]\n\t\t\t}\n\t\t}\n\t};\n}\nfunction grantedExtraTools(grant) {\n\treturn grant.scope === \"session\" ? SESSION_MCP_EXTRA_TOOLS : SESSION_MCP_EXTRA_TOOLS.filter((tool) => grant.tools.includes(tool.name));\n}\nfunction extraTools(baseline, tools, presentTool) {\n\treturn tools.map(publicTool).map(presentTool).filter((tool) => !SESSION_MCP_EXTRA_TOOLS.some((wrapper) => wrapper.name === tool.name) && !isDeepStrictEqual(baseline.tools.find((original) => original.name === tool.name), tool));\n}\n/** Remote agents see `${prefix}_${name}`; grants, baselines, and history keep internal names. */\nfunction sessionMcpWireName(prefix, name) {\n\treturn prefix === void 0 ? name : `${prefix}_${name}`;\n}\n/** Strips the prefix exactly once. A bare name on a prefixed connection maps to nothing. */\nfunction sessionMcpInternalName(prefix, wire) {\n\tif (prefix === void 0) return wire;\n\tconst head = `${prefix}_`;\n\treturn wire.startsWith(head) && wire.length > head.length ? wire.slice(head.length) : void 0;\n}\nfunction wireTool(prefix, tool) {\n\treturn prefix === void 0 ? tool : {\n\t\t...tool,\n\t\tname: sessionMcpWireName(prefix, tool.name)\n\t};\n}\n/** Kept at or under 512 characters with a 24-character prefix. */\nfunction sessionMcpInstructions(prefix) {\n\treturn (prefix === void 0 ? \"\" : `Tool names here start with '${prefix}_'. `) + \"Use only this Po session; tools run in its host repository, not locally. Call load_context first and after selection changes. session_capabilities lists granted tools; load_extra_tools lists additions or changes, run with use_extra_tools; load_skill loads guidance. Inspect before editing; follow repository checks. Assume no UI, downloads, or notifications. Read saved logs, do not relaunch work. Saving a plan does not authorize implementation.\";\n}\nfunction toolArguments(name, value, wire) {\n\tconst invalid = (problem) => new SessionMcpConversationError(\"TOOL_ARGUMENTS_INVALID\", `Invalid arguments for '${wire(name)}': ${problem}`);\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) throw invalid(\"pass a JSON object.\");\n\tconst args = value;\n\tconst keys = Object.keys(args);\n\tif (name !== \"use_extra_tools\") {\n\t\tif (keys.length !== 0) throw invalid(`it takes no arguments. Remove: ${keys.join(\", \")}. Call it with {}.`);\n\t\treturn args;\n\t}\n\tconst unexpected = keys.filter((key) => key !== \"name\" && key !== \"arguments\");\n\tif (unexpected.length !== 0) throw invalid(`unexpected keys: ${unexpected.join(\", \")}. Pass { \"name\": string, \"arguments\"?: object }.`);\n\tif (typeof args.name !== \"string\" || args.name.trim() === \"\") throw invalid(`\"name\" must be a tool name returned by ${wire(\"load_extra_tools\")}.`);\n\tif (args.arguments !== void 0 && (typeof args.arguments !== \"object\" || args.arguments === null || Array.isArray(args.arguments))) throw invalid(\"\\\"arguments\\\" must be an object.\");\n\treturn args;\n}\nconst LOCAL_AGENT_UNLOCKED_NOTICE = \"The Po user unlocked the local agent in this session, so it may also act here. Check state before you edit.\";\nfunction jsonError(status, message, authenticate = false, resourceMetadataUrl) {\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode: -32e3,\n\t\t\tmessage\n\t\t},\n\t\tid: null\n\t}, {\n\t\tstatus,\n\t\theaders: {\n\t\t\t\"cache-control\": \"no-store\",\n\t\t\t...authenticate ? { \"www-authenticate\": resourceMetadataUrl === void 0 ? \"Bearer\" : `Bearer resource_metadata=\"${resourceMetadataUrl}\"` } : {}\n\t\t}\n\t});\n}\nfunction bearerToken(request) {\n\tconst authorization = request.headers.get(\"authorization\");\n\treturn (authorization === null ? void 0 : /^Bearer ([A-Za-z0-9_-]+)$/iu.exec(authorization))?.[1];\n}\nfunction currentUrl(request) {\n\ttry {\n\t\tconst url = new URL(request.url);\n\t\treturn url.search === \"\" && url.hash === \"\" ? url.href : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction grantedSurface(grant, surface) {\n\tconst snapshot = surface.readSurface();\n\tif (snapshot.tools.some((tool) => SESSION_MCP_EXTRA_TOOLS.some((wrapper) => wrapper.name === tool.name))) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, \"A session tool conflicts with a reserved remote tool name.\");\n\tconst toolNames = new Set(grant.tools);\n\tconst skillNames = new Set(grant.skills);\n\tconst tools = grant.scope === \"session\" ? snapshot.tools : snapshot.tools.filter((tool) => toolNames.has(tool.name));\n\tconst resourceUris = new Set(tools.map((tool) => tool._meta?.ui?.resourceUri));\n\treturn {\n\t\tsnapshot,\n\t\ttools,\n\t\tskills: grant.scope === \"session\" ? snapshot.skills : snapshot.skills.filter((skill) => skillNames.has(skill.name)),\n\t\tuiResources: (snapshot.uiResources ?? []).filter((resource) => resourceUris.has(resource.uri))\n\t};\n}\n/** Identity is supplied by the approved tool descriptor, never by upstream result metadata. */\nfunction widgetResult(tool, result, prefix) {\n\tconst widget = tool?._meta?.[\"po/widget\"];\n\treturn typeof widget !== \"string\" ? result : {\n\t\t...result,\n\t\t_meta: {\n\t\t\t...result._meta,\n\t\t\t\"po/widget\": widget,\n\t\t\t\"po/toolName\": sessionMcpWireName(prefix, tool.name)\n\t\t}\n\t};\n}\n/** Creates a stateless Streamable HTTP MCP request handler for session capabilities. */\nfunction createSessionMcpHttpHandler(options) {\n\tconst audience = new URL(options.audience);\n\tif (audience.protocol !== \"https:\" || audience.username !== \"\" || audience.password !== \"\" || audience.search !== \"\" || audience.hash !== \"\") throw new Error(\"Session MCP audience must be an absolute HTTPS URL without credentials, a query, or a fragment.\");\n\tconst exactAudience = audience.href;\n\tif (options.pathToken !== void 0 && !/^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$/u.test(options.pathToken)) throw new Error(\"Session MCP path token must be a compact JWT.\");\n\tconst presentation = options.presentation ?? \"pure\";\n\tconst resourceAudience = presentation === \"app\" ? exactAudience.replace(/\\/mcp$/u, \"/mcp-app\") : exactAudience;\n\tconst presentTool = (tool) => ({\n\t\t...tool,\n\t\t_meta: presentationMeta(tool._meta, presentation)\n\t});\n\tconst baselineKey = (clientId) => JSON.stringify([presentation, clientId]);\n\tconst exactResource = options.pathToken === void 0 ? resourceAudience : `${resourceAudience}/${options.pathToken}`;\n\tconst authenticate = options.pathToken === void 0 ? options.authorization.authenticateAccessToken : options.authorization.authenticateUrlToken;\n\tconst operations = options.operations ?? /* @__PURE__ */ new Map();\n\tconst baselines = options.baselines ?? /* @__PURE__ */ new Map();\n\tconst operationOwner = (grant, requestId) => JSON.stringify([\n\t\tgrant.clientId,\n\t\tgrant.sessionId,\n\t\tgrant.sessionGeneration,\n\t\tgrant.id,\n\t\trequestId\n\t]);\n\treturn async (request) => {\n\t\tif (currentUrl(request) !== exactResource) return jsonError(404, \"MCP resource not found.\");\n\t\tconst token = options.pathToken ?? bearerToken(request);\n\t\tif (token === void 0) return jsonError(401, \"A Bearer access token is required.\", true, options.resourceMetadataUrl);\n\t\tconst grant = authenticate(token, exactAudience);\n\t\tif (grant === void 0) return options.pathToken === void 0 ? jsonError(401, \"The Bearer access token is invalid or expired.\", true, options.resourceMetadataUrl) : jsonError(401, \"The signed MCP URL is invalid or revoked.\");\n\t\tconst prefix = grant.toolPrefix;\n\t\tconst wire = (name) => sessionMcpWireName(prefix, name);\n\t\t/** Names a wrapper as the next call only when this grant can use it. */\n\t\tconst nextCall = (tool, text) => grantedExtraTools(grant).some((wrapper) => wrapper.name === tool) ? ` Call ${wire(tool)}${text}` : \"\";\n\t\tconst surfaceChanged = () => new SessionMcpConversationError(\"SESSION_TOOL_SURFACE_CHANGED\", `The session tools changed before this call ran.${nextCall(\"session_capabilities\", \", then retry.\")}`);\n\t\tconst authorizeOperation = async () => {\n\t\t\tconst activeGrant = authenticate(token, exactAudience);\n\t\t\tif (activeGrant === void 0 || activeGrant.id !== grant.id) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, \"The session grant is no longer active.\");\n\t\t\tconst target = await options.resolveSession(activeGrant.sessionId);\n\t\t\tconst recheckedGrant = authenticate(token, exactAudience);\n\t\t\tif (recheckedGrant === void 0 || recheckedGrant.id !== activeGrant.id || target === void 0 || target.generation !== recheckedGrant.sessionGeneration) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, \"The session grant is no longer active.\");\n\t\t\treturn {\n\t\t\t\tgrant: recheckedGrant,\n\t\t\t\ttarget\n\t\t\t};\n\t\t};\n\t\ttry {\n\t\t\tawait authorizeOperation();\n\t\t} catch {\n\t\t\treturn options.pathToken === void 0 ? jsonError(401, \"The session grant is no longer active.\", true, options.resourceMetadataUrl) : jsonError(401, \"The signed MCP URL is invalid or revoked.\");\n\t\t}\n\t\tconst server = new Server({\n\t\t\tname: options.serverName ?? \"po-session\",\n\t\t\tversion: options.serverVersion ?? \"1.0.0\"\n\t\t}, {\n\t\t\tcapabilities: {\n\t\t\t\ttools: {},\n\t\t\t\tresources: {}\n\t\t\t},\n\t\t\tinstructions: sessionMcpInstructions(prefix)\n\t\t});\n\t\tserver.setNotificationHandler(\"notifications/cancelled\", async (notification) => {\n\t\t\tconst active = await authorizeOperation();\n\t\t\tif (notification.params.requestId === void 0) return;\n\t\t\tconst owner = operationOwner(active.grant, notification.params.requestId);\n\t\t\tconst conversation = sessionMcpConversationDigest(notification.params._meta);\n\t\t\tif (conversation === void 0) return;\n\t\t\tconst candidates = [...operations.values()].filter((operation) => operation.owner === owner && operation.conversation === conversation);\n\t\t\tif (candidates.length === 1) candidates[0].controller.abort();\n\t\t});\n\t\tserver.setRequestHandler(\"tools/list\", async () => {\n\t\t\tconst active = await authorizeOperation();\n\t\t\tawait options.onVerified?.(active.grant);\n\t\t\tconst { tools, skills } = grantedSurface(active.grant, active.target.toolSurface);\n\t\t\tconst parentTools = tools.map(publicTool).map(presentTool);\n\t\t\tconst wrappers = grantedExtraTools(active.grant);\n\t\t\tconst baseline = structuredClone({\n\t\t\t\ttools: parentTools,\n\t\t\t\tskills: skills.map(({ name, description }) => ({\n\t\t\t\t\tname,\n\t\t\t\t\tdescription\n\t\t\t\t}))\n\t\t\t});\n\t\t\tawait authorizeOperation();\n\t\t\tbaselines.set(baselineKey(active.grant.clientId), baseline);\n\t\t\treturn { tools: [...parentTools, ...wrappers].map((tool) => wireTool(prefix, presentTool(tool))) };\n\t\t});\n\t\tserver.setRequestHandler(\"tools/call\", async (message, ctx) => {\n\t\t\tconst conversation = sessionMcpConversationDigest(ctx.mcpReq._meta ?? message.params._meta);\n\t\t\tconst owner = operationOwner(grant, ctx.mcpReq.id);\n\t\t\tconst key = JSON.stringify([owner, conversation]);\n\t\t\tif (operations.has(key)) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, \"A tool call with this request identity is already active.\");\n\t\t\tif (options.operations !== void 0 && operations.size >= 1024) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Too many active MCP tool calls. Retry later.\");\n\t\t\tconst controller = new AbortController();\n\t\t\toperations.set(key, {\n\t\t\t\tcontroller,\n\t\t\t\towner,\n\t\t\t\tconversation\n\t\t\t});\n\t\t\tconst signal = AbortSignal.any([\n\t\t\t\trequest.signal,\n\t\t\t\tctx.mcpReq.signal,\n\t\t\t\tcontroller.signal\n\t\t\t]);\n\t\t\tconst invocationId = randomUUID();\n\t\t\tlet skillAccessOpen = true;\n\t\t\tlet widgetTool;\n\t\t\tlet invocation;\n\t\t\tlet fileTransfer = false;\n\t\t\tconst publishInvocation = () => {\n\t\t\t\tif (invocation?.sessionId === void 0) return;\n\t\t\t\ttry {\n\t\t\t\t\toptions.onInvocation?.(fileTransfer ? {\n\t\t\t\t\t\t...invocation,\n\t\t\t\t\t\tinput: { redacted: \"file transfer\" },\n\t\t\t\t\t\t...invocation.output === void 0 ? {} : { output: { redacted: \"file transfer\" } }\n\t\t\t\t\t} : { ...invocation });\n\t\t\t\t} catch {\n\t\t\t\t\toptions.onNotice?.(\"session MCP call history could not be saved\");\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst completeInvocation = (result) => {\n\t\t\t\tif (invocation !== void 0) {\n\t\t\t\t\tinvocation = {\n\t\t\t\t\t\t...invocation,\n\t\t\t\t\t\tstatus: signal.aborted ? \"cancelled\" : result.isError ? \"failed\" : \"succeeded\",\n\t\t\t\t\t\tfinishedAt: Date.now(),\n\t\t\t\t\t\toutput: result.structuredContent ?? result.content\n\t\t\t\t\t};\n\t\t\t\t\tpublishInvocation();\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...result,\n\t\t\t\t\t_meta: presentationMeta(result._meta, presentation)\n\t\t\t\t};\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tconst parent = await authorizeOperation();\n\t\t\t\tconst requested = sessionMcpInternalName(prefix, message.params.name);\n\t\t\t\tinvocation = {\n\t\t\t\t\tid: invocationId,\n\t\t\t\t\tparentSessionId: parent.grant.sessionId,\n\t\t\t\t\tclientId: parent.grant.clientId,\n\t\t\t\t\tconversationDigest: conversation,\n\t\t\t\t\ttoolName: requested ?? message.params.name,\n\t\t\t\t\tstartedAt: Date.now(),\n\t\t\t\t\tstatus: \"running\",\n\t\t\t\t\tinput: { redacted: \"pending tool authorization\" }\n\t\t\t\t};\n\t\t\t\tconst wrapper = grantedExtraTools(parent.grant).some((tool) => tool.name === requested);\n\t\t\t\tconst advertised = wrapper ? void 0 : grantedSurface(parent.grant, parent.target.toolSurface).tools.find((tool) => tool.name === requested);\n\t\t\t\tif (!wrapper && !advertised) throw new SessionMcpConversationError(\"TOOL_NOT_AVAILABLE\", `Tool '${message.params.name}' is not available on this connection.` + (prefix === void 0 ? \"\" : ` Tool names here start with '${prefix}_'.`) + nextCall(\"session_capabilities\", \" for the current list.\"));\n\t\t\t\tconst transferName = requested === \"use_extra_tools\" && typeof message.params.arguments?.name === \"string\" ? sessionMcpInternalName(prefix, message.params.arguments.name) : requested;\n\t\t\t\tfileTransfer = grantedSurface(parent.grant, parent.target.toolSurface).tools.some((tool) => tool.name === transferName && tool._meta?.[\"po/fileTransfer\"] === true);\n\t\t\t\tpublishInvocation();\n\t\t\t\twidgetTool = advertised;\n\t\t\t\tconst wrapperArgs = wrapper ? toolArguments(requested, message.params.arguments ?? {}, wire) : void 0;\n\t\t\t\tawait options.onVerified?.(parent.grant);\n\t\t\t\toptions.onNotice?.(`session MCP invocation id=${invocationId} lifecycle=started`);\n\t\t\t\tconst resolveTarget = async (reserve) => {\n\t\t\t\t\tconst active = await authorizeOperation();\n\t\t\t\t\tif (!conversation) throw new SessionMcpConversationError(\"CONVERSATION_ID_REQUIRED\", \"This connection requires conversation metadata. Use a compatible ChatGPT conversation and retry.\");\n\t\t\t\t\tif (!options.resolveConversation) throw new SessionMcpConversationError(\"CONVERSATION_ROUTING_UNAVAILABLE\", \"Conversation routing is unavailable in this host.\");\n\t\t\t\t\tsignal.throwIfAborted();\n\t\t\t\t\tconst target = await options.resolveConversation(active.grant, conversation, reserve, signal);\n\t\t\t\t\tawait authorizeOperation();\n\t\t\t\t\tsignal.throwIfAborted();\n\t\t\t\t\treturn {\n\t\t\t\t\t\tgrant: active.grant,\n\t\t\t\t\t\ttarget\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tif (wrapper && !conversation) throw new SessionMcpConversationError(\"CONVERSATION_ID_REQUIRED\", \"This connection requires conversation metadata. Use a compatible ChatGPT conversation and retry.\");\n\t\t\t\tif ((requested === \"load_extra_tools\" || requested === \"use_extra_tools\") && !baselines.has(baselineKey(parent.grant.clientId))) throw new SessionMcpConversationError(\"SESSION_MCP_BASELINE_REQUIRED\", \"Refresh this MCP connection tool catalog before loading or using extra tools.\");\n\t\t\t\tconst active = await resolveTarget(true);\n\t\t\t\tinvocation = {\n\t\t\t\t\t...invocation,\n\t\t\t\t\tsessionId: active.target.sessionId ?? parent.grant.sessionId\n\t\t\t\t};\n\t\t\t\tpublishInvocation();\n\t\t\t\tconst { snapshot, tools, skills } = grantedSurface(active.grant, active.target.toolSurface);\n\t\t\t\tconst baseline = baselines.get(baselineKey(parent.grant.clientId));\n\t\t\t\tconst extras = wrapper && baseline ? extraTools(baseline, tools, presentTool) : [];\n\t\t\t\tif (requested === \"session_capabilities\" && wrapper) {\n\t\t\t\t\tconst capabilities = {\n\t\t\t\t\t\tsessionId: active.target.sessionId ?? parent.grant.sessionId,\n\t\t\t\t\t\tgeneration: active.target.generation,\n\t\t\t\t\t\trevision: snapshot.revision,\n\t\t\t\t\t\tbaseline: baseline === void 0 ? \"missing\" : \"available\",\n\t\t\t\t\t\tinventory: \"active_surface\",\n\t\t\t\t\t\tdiscovery: \"unknown\",\n\t\t\t\t\t\ttools: [...tools.map(publicTool).map(presentTool), ...grantedExtraTools(active.grant)].map((tool) => wireTool(prefix, presentTool(tool))),\n\t\t\t\t\t\tskills: skills.map(({ name, description }) => ({\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t})),\n\t\t\t\t\t\t...active.target.agentLocked === void 0 ? {} : { localAgent: active.target.agentLocked() ? \"locked\" : \"unlocked\" }\n\t\t\t\t\t};\n\t\t\t\t\tconst current = await resolveTarget(false);\n\t\t\t\t\tif (current.target.toolSurface !== active.target.toolSurface || current.target.generation !== active.target.generation || current.target.sessionId !== active.target.sessionId || current.target.toolSurface.readSurface().revision !== snapshot.revision) throw surfaceChanged();\n\t\t\t\t\toptions.onNotice?.(`session MCP invocation id=${invocationId} lifecycle=succeeded`);\n\t\t\t\t\treturn completeInvocation({\n\t\t\t\t\t\tcontent: [{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: JSON.stringify(capabilities)\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tstructuredContent: capabilities,\n\t\t\t\t\t\tisError: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (requested === \"load_extra_tools\" && wrapper) {\n\t\t\t\t\tconst discovery = {\n\t\t\t\t\t\ttools: extras.map((tool) => wireTool(prefix, presentTool(tool))),\n\t\t\t\t\t\tskills: (tools.some((tool) => tool.name === \"load_skill\") ? skills : []).map(({ name, description }) => ({\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t})).filter((skill) => !isDeepStrictEqual(baseline.skills.find((original) => original.name === skill.name), skill))\n\t\t\t\t\t};\n\t\t\t\t\tconst current = await resolveTarget(false);\n\t\t\t\t\tif (current.target.toolSurface !== active.target.toolSurface || current.target.generation !== active.target.generation || current.target.sessionId !== active.target.sessionId || current.target.toolSurface.readSurface().revision !== snapshot.revision) throw surfaceChanged();\n\t\t\t\t\toptions.onNotice?.(`session MCP invocation id=${invocationId} lifecycle=succeeded`);\n\t\t\t\t\treturn completeInvocation({\n\t\t\t\t\t\tcontent: [{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: JSON.stringify(discovery)\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tstructuredContent: discovery,\n\t\t\t\t\t\tisError: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst name = wrapper ? sessionMcpInternalName(prefix, wrapperArgs.name) : requested;\n\t\t\t\tconst selected = tools.find((tool) => tool.name === name);\n\t\t\t\tif (name === void 0 || wrapper && (!extras.some((tool) => tool.name === name) || !selected)) throw new SessionMcpConversationError(\"TOOL_NOT_AVAILABLE\", `Extra tool '${wrapperArgs?.name ?? message.params.name}' is not available.` + nextCall(\"load_extra_tools\", \" and pass a name it returns.\"));\n\t\t\t\tif (!wrapper && (!selected || !isDeepStrictEqual(selected.parameters, advertised.parameters) || !isDeepStrictEqual(selected.outputSchema, advertised.outputSchema) || !isDeepStrictEqual(selected.annotations, advertised.annotations) || !isDeepStrictEqual(selected._meta, advertised._meta))) throw new SessionMcpConversationError(\"SESSION_TOOL_SURFACE_CHANGED\", `This tool changed or was removed after your tool list loaded.${nextCall(\"load_extra_tools\", grantedExtraTools(grant).some((tool) => tool.name === \"use_extra_tools\") ? \", and if it lists the tool, run it with \" + wire(\"use_extra_tools\") + \".\" : \", then refresh the connection to call a returned tool.\")}`);\n\t\t\t\tfileTransfer ||= selected?._meta?.[\"po/fileTransfer\"] === true;\n\t\t\t\twidgetTool = wrapper ? void 0 : selected;\n\t\t\t\tconst recheck = async () => {\n\t\t\t\t\tconst current = await resolveTarget(false);\n\t\t\t\t\tif (current.target.toolSurface !== active.target.toolSurface || current.target.generation !== active.target.generation || current.target.sessionId !== active.target.sessionId) throw surfaceChanged();\n\t\t\t\t\tif (wrapper) {\n\t\t\t\t\t\tif (!grantedExtraTools(current.grant).some((tool) => tool.name === requested)) throw surfaceChanged();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst currentAdvertised = grantedSurface(current.grant, parent.target.toolSurface).tools.find((tool) => tool.name === requested);\n\t\t\t\t\t\tif (!currentAdvertised || !isDeepStrictEqual(currentAdvertised, advertised)) throw surfaceChanged();\n\t\t\t\t\t}\n\t\t\t\t\treturn current;\n\t\t\t\t};\n\t\t\t\tconst authorizedSkills = async () => {\n\t\t\t\t\tif (!skillAccessOpen) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Remote skill access is no longer active.\");\n\t\t\t\t\tsignal.throwIfAborted();\n\t\t\t\t\tconst current = await recheck();\n\t\t\t\t\tsignal.throwIfAborted();\n\t\t\t\t\treturn grantedSurface(current.grant, current.target.toolSurface);\n\t\t\t\t};\n\t\t\t\tconst mcpSkills = {\n\t\t\t\t\tasync list() {\n\t\t\t\t\t\tconst { skills } = await authorizedSkills();\n\t\t\t\t\t\treturn skills.map(({ name, description }) => ({\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t}));\n\t\t\t\t\t},\n\t\t\t\t\tasync read(name) {\n\t\t\t\t\t\tconst current = await authorizedSkills();\n\t\t\t\t\t\tconst skill = current.skills.find((candidate) => candidate.name === name);\n\t\t\t\t\t\tif (!skill) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Skill '${name}' is not granted or active on this connection.${nextCall(\"session_capabilities\", \" to see available skills.\")} Continue without it if unavailable.`);\n\t\t\t\t\t\tconst text = await active.target.toolSurface.readSkill(current.snapshot.revision, skill.uri);\n\t\t\t\t\t\tsignal.throwIfAborted();\n\t\t\t\t\t\tif ((await authorizedSkills()).snapshot.revision !== current.snapshot.revision) throw surfaceChanged();\n\t\t\t\t\t\treturn text;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tinvocation = {\n\t\t\t\t\t...invocation,\n\t\t\t\t\ttoolName: name,\n\t\t\t\t\tinput: wrapper ? wrapperArgs.arguments ?? {} : message.params.arguments ?? {}\n\t\t\t\t};\n\t\t\t\tpublishInvocation();\n\t\t\t\tlet result;\n\t\t\t\ttry {\n\t\t\t\t\tresult = await active.target.toolSurface.invokeTool({\n\t\t\t\t\t\trevision: snapshot.revision,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\targuments: wrapper ? wrapperArgs.arguments ?? {} : message.params.arguments ?? {},\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t\tmcpSkills,\n\t\t\t\t\t\tauthorize: async () => {\n\t\t\t\t\t\t\tconst current = await recheck();\n\t\t\t\t\t\t\tif (wrapper) {\n\t\t\t\t\t\t\t\tconst currentTool = grantedSurface(current.grant, current.target.toolSurface).tools.find((tool) => tool.name === name);\n\t\t\t\t\t\t\t\tif (!currentTool || !isDeepStrictEqual(currentTool, selected)) throw surfaceChanged();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (signal.aborted || error instanceof ProtocolError || error instanceof SessionMcpConversationError) throw error;\n\t\t\t\t\tif (isPoHeadlessToolBusyError(error)) throw new SessionMcpConversationError(\"SESSION_BUSY\", `The session stayed busy for 30 seconds, so ${wire(name)} did not start. Wait for the current turn to finish, then retry once.`);\n\t\t\t\t\tthrow new SessionMcpConversationError(\"TOOL_CALL_FAILED\", `${wire(name)} did not return a result: ${error instanceof Error ? error.message : \"unknown error\"}. If the tool changes files or state, inspect before retrying.`);\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tawait recheck();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!(error instanceof SessionMcpConversationError)) throw error;\n\t\t\t\t\tthrow new SessionMcpConversationError(\"SESSION_RESULT_WITHHELD\", \"The call may have run, but its result was withheld because the session tools or grants changed. Inspect state before retrying.\");\n\t\t\t\t}\n\t\t\t\toptions.onNotice?.(`session MCP invocation id=${invocationId} lifecycle=succeeded`);\n\t\t\t\tconst content = result.content.length === 0 && result.structuredContent !== void 0 ? [{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: JSON.stringify(result.structuredContent)\n\t\t\t\t}] : result.content;\n\t\t\t\treturn completeInvocation(widgetResult(wrapper ? void 0 : selected, {\n\t\t\t\t\tcontent: active.target.agentLocked?.() === false ? [...content, {\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: LOCAL_AGENT_UNLOCKED_NOTICE\n\t\t\t\t\t}] : content,\n\t\t\t\t\t...result.structuredContent === void 0 ? {} : { structuredContent: result.structuredContent },\n\t\t\t\t\t...result._meta === void 0 ? {} : { _meta: result._meta },\n\t\t\t\t\tisError: result.isError ?? false\n\t\t\t\t}, prefix));\n\t\t\t} catch (error) {\n\t\t\t\tconst cause = error instanceof SessionMcpConversationError ? error.code : signal.aborted ? \"aborted\" : error instanceof ProtocolError ? `mcp_${String(error.code)}` : error instanceof Error ? error.name : \"unknown\";\n\t\t\t\toptions.onNotice?.(`session MCP invocation id=${invocationId} lifecycle=failed cause=${cause}`);\n\t\t\t\tif (invocation !== void 0) {\n\t\t\t\t\tinvocation = {\n\t\t\t\t\t\t...invocation,\n\t\t\t\t\t\tstatus: signal.aborted ? \"cancelled\" : \"failed\",\n\t\t\t\t\t\tfinishedAt: Date.now(),\n\t\t\t\t\t\toutput: {\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\tmessage: fileTransfer ? \"File transfer failed.\" : error instanceof Error ? error.message : \"Tool call failed.\"\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tpublishInvocation();\n\t\t\t\t}\n\t\t\t\tif (!(error instanceof SessionMcpConversationError)) throw error;\n\t\t\t\tconst failure = widgetResult(widgetTool, {\n\t\t\t\t\tcontent: [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: error.message\n\t\t\t\t\t}],\n\t\t\t\t\tisError: true,\n\t\t\t\t\tstructuredContent: {\n\t\t\t\t\t\tcode: error.code,\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\t...error.bindingId === void 0 ? {} : { bindingId: error.bindingId }\n\t\t\t\t\t}\n\t\t\t\t}, prefix);\n\t\t\t\treturn {\n\t\t\t\t\t...failure,\n\t\t\t\t\t_meta: presentationMeta(failure._meta, presentation)\n\t\t\t\t};\n\t\t\t} finally {\n\t\t\t\tskillAccessOpen = false;\n\t\t\t\toperations.delete(key);\n\t\t\t}\n\t\t});\n\t\tserver.setRequestHandler(\"resources/list\", async () => {\n\t\t\tconst active = await authorizeOperation();\n\t\t\tconst { uiResources } = grantedSurface(active.grant, active.target.toolSurface);\n\t\t\treturn { resources: presentation === \"app\" ? [...uiResources] : [] };\n\t\t});\n\t\tserver.setRequestHandler(\"resources/read\", async (message, ctx) => {\n\t\t\tconst conversation = sessionMcpConversationDigest(ctx.mcpReq._meta ?? message.params._meta);\n\t\t\tconst active = await authorizeOperation();\n\t\t\tconst { snapshot, skills, uiResources } = grantedSurface(active.grant, active.target.toolSurface);\n\t\t\tconst skill = skills.find((candidate) => candidate.uri === message.params.uri);\n\t\t\tif (skill !== void 0) {\n\t\t\t\tif (!conversation) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Use ${wire(\"load_skill\")} with conversation metadata to read target-session guidance.`);\n\t\t\t\tif (!options.resolveConversation) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Conversation routing is unavailable in this host.\");\n\t\t\t\tconst text = await (await options.resolveConversation(active.grant, conversation, false, request.signal)).toolSurface.readSkill(snapshot.revision, skill.uri);\n\t\t\t\tawait authorizeOperation();\n\t\t\t\treturn { contents: [{\n\t\t\t\t\turi: skill.uri,\n\t\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\t\ttext\n\t\t\t\t}] };\n\t\t\t}\n\t\t\tconst resource = uiResources.find((candidate) => candidate.uri === message.params.uri);\n\t\t\tif (presentation === \"app\" && resource !== void 0 && active.target.toolSurface.readUiResource !== void 0) {\n\t\t\t\trequest.signal.throwIfAborted();\n\t\t\t\tconst text = await active.target.toolSurface.readUiResource(snapshot.revision, resource.uri);\n\t\t\t\trequest.signal.throwIfAborted();\n\t\t\t\tconst current = await authorizeOperation();\n\t\t\t\tconst after = grantedSurface(current.grant, current.target.toolSurface);\n\t\t\t\tif (current.target.toolSurface !== active.target.toolSurface || after.snapshot.revision !== snapshot.revision || !isDeepStrictEqual(after.uiResources.find((candidate) => candidate.uri === resource.uri), resource)) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, \"The session UI resource surface has changed.\");\n\t\t\t\treturn { contents: [{\n\t\t\t\t\t...resource,\n\t\t\t\t\ttext\n\t\t\t\t}] };\n\t\t\t}\n\t\t\tif (message.params.uri.startsWith(\"ui:\")) throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"UI resource is not granted or active.\");\n\t\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, `Use ${wire(\"load_skill\")} with conversation metadata to read target-session guidance.`);\n\t\t});\n\t\tconst handler = createMcpHandler(() => server, { legacy: \"reject\" });\n\t\ttry {\n\t\t\treturn await handler.fetch(request, { authInfo: {\n\t\t\t\ttoken,\n\t\t\t\tclientId: grant.clientId,\n\t\t\t\tscopes: grant.scope === \"session\" ? [\"session\"] : [...grant.tools.map((name) => `tool:${name}`), ...grant.skills.map((name) => `skill:${name}`)],\n\t\t\t\texpiresAt: Math.floor(grant.expiresAt / 1e3),\n\t\t\t\tresource: new URL(exactResource)\n\t\t\t} });\n\t\t} catch {\n\t\t\treturn jsonError(500, \"Internal MCP server error.\");\n\t\t}\n\t};\n}\n//#endregion\nexport { SESSION_MCP_EXTRA_TOOLS, createSessionMcpHttpHandler, sessionMcpInternalName, sessionMcpWireName };\n\n//# sourceMappingURL=sessionMcpHandler.mjs.map","import { REMOTE_CONVERSATION_SESSION_PROVENANCE } from \"../schemas/hubChannel.mjs\";\nimport { SessionMcpConversationError } from \"../services/sessionMcpConversations/index.mjs\";\nimport { SessionMcpOAuthError, createSessionMcpAuthorizationService, defaultSessionMcpToolPrefix, sessionMcpRouting, sessionMcpToolPrefix } from \"../services/sessionMcpAuthorization/index.mjs\";\nimport { SESSION_MCP_EXTRA_TOOLS, createSessionMcpHttpHandler } from \"./sessionMcpHandler.mjs\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/server/sessionMcpRoutes.ts\nconst AUTHORIZATION_SERVER_DISCOVERY = \"/.well-known/oauth-authorization-server\";\nconst AUTHORIZE_ROUTE = \"/oauth/authorize\";\nconst TOKEN_ROUTE = \"/oauth/token\";\nconst SESSION_MCP_PATTERN = /^\\/api\\/workspaces\\/([^/]+)\\/sessions\\/([^/]+)\\/mcp(?:-app)?$/u;\nconst SESSION_MCP_URL_TOKEN_PATTERN = /^\\/api\\/workspaces\\/([^/]+)\\/sessions\\/([^/]+)\\/mcp(?:-app)?\\/([A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+)$/u;\nconst SESSION_MCP_ACTIVITY_PATTERN = /^\\/api\\/workspaces\\/([^/]+)\\/sessions\\/([^/]+)\\/mcp\\/activity$/u;\nconst SESSION_MCP_CONFIG_PATTERN = /^\\/api\\/workspaces\\/([^/]+)\\/sessions\\/([^/]+)\\/mcp\\/config$/u;\nconst SESSION_MCP_CLIENTS_PATTERN = /^\\/api\\/workspaces\\/([^/]+)\\/sessions\\/([^/]+)\\/mcp\\/clients(?:\\/([^/]+))?$/u;\nconst SESSION_MCP_CONVERSATIONS_PATTERN = /^\\/api\\/workspaces\\/([^/]+)\\/sessions\\/([^/]+)\\/mcp\\/conversations(?:\\/([^/]+))?$/u;\n/**\n* An OAuth resource as it can be logged: the URL with any URL-token segment and every query value\n* redacted, so a mismatch in origin, path, trailing slash or query is visible without a secret.\n*/\nfunction describeResource(resource) {\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(resource);\n\t} catch {\n\t\treturn \"a resource that is not a URL\";\n\t}\n\tconst token = SESSION_MCP_URL_TOKEN_PATTERN.exec(parsed.pathname);\n\tconst pathname = token === null ? parsed.pathname : parsed.pathname.slice(0, -token[3].length) + \"<token>\";\n\tconst query = [...parsed.searchParams.keys()].map((key) => `${key}=<redacted>`).join(\"&\");\n\treturn `${parsed.origin}${pathname}${query === \"\" ? \"\" : `?${query}`}${parsed.hash === \"\" ? \"\" : \"#<redacted>\"}`;\n}\nfunction redactUrlCredentials(text) {\n\treturn text.replace(/([a-z][a-z0-9+.-]*:\\/\\/)[^\\s/?#]*@/giu, \"$1***@\");\n}\nconst PROTECTED_RESOURCE_PATTERN = /^\\/\\.well-known\\/oauth-protected-resource(\\/api\\/workspaces\\/[^/]+\\/sessions\\/[^/]+\\/mcp(?:-app)?)$/u;\nfunction json(status, value) {\n\treturn Response.json(value, {\n\t\tstatus,\n\t\theaders: { \"cache-control\": \"no-store\" }\n\t});\n}\nfunction oauthError(error) {\n\tif (error instanceof SessionMcpOAuthError) return json(error.code === \"invalid_client\" ? 401 : 400, {\n\t\terror: error.code,\n\t\terror_description: error.message\n\t});\n\treturn json(400, {\n\t\terror: \"invalid_request\",\n\t\terror_description: \"The OAuth request was invalid.\"\n\t});\n}\nfunction trustedOrigin(value) {\n\tif (value === void 0) return void 0;\n\ttry {\n\t\tconst url = new URL(value);\n\t\treturn url.protocol === \"https:\" && url.pathname === \"/\" && url.search === \"\" && url.hash === \"\" ? url.origin : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction sessionPath(workspaceId, sessionId) {\n\treturn `/api/workspaces/${encodeURIComponent(workspaceId)}/sessions/${encodeURIComponent(sessionId)}/mcp`;\n}\nfunction parseStringArray(value) {\n\treturn Array.isArray(value) && value.every((entry) => typeof entry === \"string\") ? value : void 0;\n}\nfunction defaultClientName(origin) {\n\treturn `ChatGPT · ${new URL(origin).hostname}`;\n}\nfunction formString(form, name) {\n\tconst value = form.get(name);\n\treturn typeof value === \"string\" ? value : \"\";\n}\nfunction publicClient(client, binding) {\n\treturn {\n\t\tclientId: client.clientId,\n\t\tname: client.name,\n\t\tredirectUri: client.redirectUri,\n\t\ttokenEndpointAuthMethod: client.tokenEndpointAuthMethod,\n\t\tcreatedAt: client.createdAt,\n\t\tscope: binding.scope,\n\t\trouting: sessionMcpRouting(binding.routing),\n\t\ttools: binding.tools,\n\t\tskills: binding.skills,\n\t\taudience: binding.audience,\n\t\t...binding.toolPrefix === void 0 ? {} : { toolPrefix: binding.toolPrefix }\n\t};\n}\n/** Canonicalizes an intended directory without creating it or accepting symlink aliases. */\nfunction executionDirectory(value) {\n\tif (!path.isAbsolute(value) || value.includes(\"\\0\") || value.length > 4096) throw new SessionMcpConversationError(\"INVALID_EXECUTION_DIRECTORY\", \"Choose an absolute execution directory.\");\n\tlet ancestor = path.resolve(value);\n\tconst suffix = [];\n\tfor (;;) try {\n\t\treturn path.join(fs.realpathSync(ancestor), ...suffix);\n\t} catch (error) {\n\t\tif (error.code !== \"ENOENT\" || path.dirname(ancestor) === ancestor) throw new SessionMcpConversationError(\"INVALID_EXECUTION_DIRECTORY\", \"The execution directory cannot be resolved.\");\n\t\tsuffix.unshift(path.basename(ancestor));\n\t\tancestor = path.dirname(ancestor);\n\t}\n}\nfunction overlappingDirectories(left, right) {\n\tconst contained = (root, target) => {\n\t\tconst relative = path.relative(root, target);\n\t\treturn relative === \"\" || !path.isAbsolute(relative) && relative !== \"..\" && !relative.startsWith(`..${path.sep}`);\n\t};\n\treturn contained(left, right) || contained(right, left);\n}\n/** Routes the process-local session MCP authority and revokes every grant with its live incarnation. */\nfunction createSessionMcpRoutes(options) {\n\tconst authorization = options.authorization ?? createSessionMcpAuthorizationService();\n\tconst incarnations = /* @__PURE__ */ new Map();\n\tlet nextGeneration = 1;\n\tlet publishPending = () => {};\n\tconst revokeIncarnation = (sessionId, generation) => {\n\t\tauthorization.revokeSessionGeneration(sessionId, generation);\n\t};\n\tconst abortOperations = (operations) => {\n\t\tfor (const operation of operations.values()) operation.controller.abort();\n\t\toperations.clear();\n\t};\n\tconst register = (session) => {\n\t\tconst current = incarnations.get(session.id);\n\t\tif (current?.host === session.host) return false;\n\t\tif (current !== void 0) {\n\t\t\trevokeIncarnation(session.id, current.generation);\n\t\t\tabortOperations(current.operations);\n\t\t}\n\t\tincarnations.set(session.id, {\n\t\t\thost: session.host,\n\t\t\tgeneration: nextGeneration++,\n\t\t\thandlers: /* @__PURE__ */ new Map(),\n\t\t\tbaselines: /* @__PURE__ */ new Map(),\n\t\t\toperations: /* @__PURE__ */ new Map()\n\t\t});\n\t\treturn true;\n\t};\n\tfor (const session of options.headlessHub.snapshot()) register(session);\n\tconst unsubscribe = options.headlessHub.onEvent((event) => {\n\t\tif (event.kind === \"upsert\" && register(event.session)) publishPending();\n\t\tif (event.kind === \"removed\") {\n\t\t\tconst current = incarnations.get(event.sessionId);\n\t\t\tif (current !== void 0) {\n\t\t\t\trevokeIncarnation(event.sessionId, current.generation);\n\t\t\t\tabortOperations(current.operations);\n\t\t\t}\n\t\t\tincarnations.delete(event.sessionId);\n\t\t}\n\t});\n\tlet observedOrigin;\n\tlet observedOriginRevision;\n\tlet originObserved = false;\n\tconst origin = () => {\n\t\tconst current = trustedOrigin(options.publicOrigin());\n\t\tconst revision = options.publicOriginRevision?.();\n\t\tif (originObserved && current !== observedOrigin || revision !== void 0 && observedOriginRevision !== void 0 && revision !== observedOriginRevision) {\n\t\t\tfor (const client of authorization.listClients()) {\n\t\t\t\tauthorization.revokeClient(client.clientId);\n\t\t\t\toptions.registrationStore?.remove(client.clientId);\n\t\t\t}\n\t\t\tfor (const incarnation of incarnations.values()) {\n\t\t\t\tincarnation.handlers.clear();\n\t\t\t\tincarnation.baselines.clear();\n\t\t\t\tabortOperations(incarnation.operations);\n\t\t\t}\n\t\t}\n\t\tobservedOrigin = current;\n\t\tobservedOriginRevision = revision;\n\t\toriginObserved = true;\n\t\trestorePersistedRegistrations(current);\n\t\treturn current;\n\t};\n\tconst target = (workspaceId, sessionId) => {\n\t\tif (options.headlessHub.computerUse?.ownsSession?.(sessionId)) return void 0;\n\t\tconst session = options.headlessHub.session(sessionId);\n\t\tconst incarnation = incarnations.get(sessionId);\n\t\treturn session !== void 0 && session.workspaceId === workspaceId && incarnation?.host === session.host ? {\n\t\t\tsession,\n\t\t\tgeneration: incarnation.generation\n\t\t} : void 0;\n\t};\n\tconst restorePersistedRegistrations = (configuredOrigin) => {\n\t\tif (configuredOrigin === void 0) return;\n\t\tfor (const registration of options.registrationStore?.registrations() ?? []) {\n\t\t\tconst audience = `${configuredOrigin}${sessionPath(registration.workspaceId, registration.binding.sessionId)}`;\n\t\t\tif (registration.binding.audience !== audience) {\n\t\t\t\toptions.registrationStore?.remove(registration.client.clientId);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = target(registration.workspaceId, registration.binding.sessionId);\n\t\t\tif (resolved !== void 0) authorization.restorePersistentRegistration(registration, resolved.generation);\n\t\t}\n\t};\n\tconst requireStore = () => {\n\t\tif (!options.conversationStore) throw new SessionMcpConversationError(\"CONVERSATION_ROUTING_UNAVAILABLE\", \"Persistent conversation routing is unavailable.\");\n\t\treturn options.conversationStore;\n\t};\n\tpublishPending = () => {\n\t\tif (!options.conversationStore) return;\n\t\ttry {\n\t\t\tconst records = options.conversationStore.list();\n\t\t\tfor (const parent of options.headlessHub.snapshot()) options.headlessHub.setPendingSessionSetups?.(parent.id, records.filter((record) => record.parentSessionId === parent.id && record.state === \"pending\").map((record) => ({\n\t\t\t\tid: record.id,\n\t\t\t\tname: `conversation ${record.id.slice(0, 8)}`,\n\t\t\t\tcreatedAt: record.createdAt,\n\t\t\t\tstatus: provision.has(record.id) || recoveries.has(record.id) ? \"provisioning\" : record.failureCode === void 0 ? \"interrupted\" : \"failed\",\n\t\t\t\t...record.setupKind === void 0 ? {} : { setupKind: record.setupKind },\n\t\t\t\t...record.failureCode === void 0 ? {} : { errorCode: record.failureCode },\n\t\t\t\t...record.cwd === void 0 ? {} : { cwd: record.cwd }\n\t\t\t})));\n\t\t} catch (error) {\n\t\t\toptions.onNotice?.(error instanceof Error ? error.message : \"Conversation bindings are unavailable.\");\n\t\t}\n\t};\n\tconst readReservation = (id, parentSessionId) => {\n\t\torigin();\n\t\tconst record = requireStore().get(id, parentSessionId);\n\t\tconst binding = authorization.readAuthorizationBinding(record.clientId);\n\t\tconst parent = target(record.parentWorkspaceId, parentSessionId);\n\t\tif (!parent || binding?.routing !== \"conversation\" || binding.sessionId !== parentSessionId || binding.sessionGeneration !== parent.generation) throw new SessionMcpConversationError(\"SESSION_UNAVAILABLE\", \"The connection that owns this setup is no longer active.\", id);\n\t\treturn {\n\t\t\trecord,\n\t\t\tparent\n\t\t};\n\t};\n\tconst reservations = {\n\t\tread(id, parentSessionId) {\n\t\t\tconst { record } = readReservation(id, parentSessionId);\n\t\t\treturn {\n\t\t\t\tsessionId: record.id,\n\t\t\t\t...record.cwd === void 0 ? {} : { cwd: record.cwd }\n\t\t\t};\n\t\t},\n\t\tasync prepare(id, parentSessionId, suppliedDirectory) {\n\t\t\tconst { record, parent } = readReservation(id, parentSessionId);\n\t\t\tconst cwd = executionDirectory(suppliedDirectory);\n\t\t\tif ([\n\t\t\t\toptions.headlessHub.workspaces().find((workspace) => workspace.id === parent.session.workspaceId)?.root ?? parent.session.cwd,\n\t\t\t\t...options.headlessHub.snapshot().filter((session) => session.id !== id).map((session) => session.cwd),\n\t\t\t\t...requireStore().list().filter((entry) => entry.id !== id && entry.state !== \"closed\" && entry.cwd !== void 0).map((entry) => entry.cwd)\n\t\t\t].some((directory) => overlappingDirectories(cwd, executionDirectory(directory)))) throw new SessionMcpConversationError(\"EXECUTION_DIRECTORY_SHARED\", \"Choose a separate checkout, not a directory shared with another session.\", id);\n\t\t\tif (record.state === \"bound\" && record.cwd !== cwd) throw new SessionMcpConversationError(\"SESSION_TARGET_FIXED\", \"An initialized session cannot change its directory.\", id);\n\t\t\trequireStore().prepare(id, parentSessionId, cwd);\n\t\t\tpublishPending();\n\t\t\treturn {\n\t\t\t\tsessionId: id,\n\t\t\t\tcwd\n\t\t\t};\n\t\t},\n\t\tasync complete(id, parentSessionId) {\n\t\t\tconst { record } = readReservation(id, parentSessionId);\n\t\t\tconst child = options.headlessHub.session(id);\n\t\t\tif (!record.cwd || !child?.workspaceId || child.parentSessionId !== parentSessionId || record.setupKind === \"managed-worktree\" && child.workspaceId !== record.parentWorkspaceId || executionDirectory(child.cwd) !== record.cwd || options.isSessionPersisted?.(id, child.cwd) === false) throw new SessionMcpConversationError(\"SESSION_SETUP_INCOMPLETE\", \"The reserved session is not durably ready. Recover the existing setup instead of creating another checkout.\", id);\n\t\t\trequireStore().bind(id, parentSessionId, child.workspaceId);\n\t\t\tpublishPending();\n\t\t\treturn {\n\t\t\t\tsessionId: id,\n\t\t\t\tworkspaceId: child.workspaceId,\n\t\t\t\tcwd: child.cwd\n\t\t\t};\n\t\t}\n\t};\n\tconst provision = /* @__PURE__ */ new Map();\n\tconst recoveries = /* @__PURE__ */ new Map();\n\tconst setupDirectory = async (id, parentSessionId, directory) => {\n\t\tconst canonical = executionDirectory(directory);\n\t\tif (!fs.statSync(canonical).isDirectory()) throw new Error(\"The execution directory is not a directory.\");\n\t\tconst { record: current } = readReservation(id, parentSessionId);\n\t\tif (provision.has(id) && current.setupKind === \"managed-worktree\") throw new SessionMcpConversationError(\"SESSION_TARGET_FIXED\", \"This setup belongs to a managed worktree.\", id);\n\t\tif (requireStore().selectSetup(id, parentSessionId, \"existing-directory\").setupKind !== \"existing-directory\") throw new SessionMcpConversationError(\"SESSION_TARGET_FIXED\", \"This setup belongs to a managed worktree.\", id);\n\t\tconst prepared = await reservations.prepare(id, parentSessionId, canonical);\n\t\tconst pending = provision.get(id);\n\t\tif (pending) return pending;\n\t\tconst setup = (async () => {\n\t\t\tif (!options.headlessHub.session(id)) {\n\t\t\t\tif (requireStore().get(id, parentSessionId).state === \"bound\" || options.isSessionPersisted?.(id, prepared.cwd)) throw new SessionMcpConversationError(\"SESSION_UNAVAILABLE\", \"Resume the existing session in Po. It will not be recreated automatically.\", id);\n\t\t\t\tif (!fs.statSync(prepared.cwd).isDirectory()) throw new Error(\"The execution directory is not a directory.\");\n\t\t\t\tawait options.headlessHub.sessionService.create({\n\t\t\t\t\tcwd: prepared.cwd,\n\t\t\t\t\tname: `conversation ${id.slice(0, 8)}`,\n\t\t\t\t\tparentSessionId,\n\t\t\t\t\tsessionProvenance: REMOTE_CONVERSATION_SESSION_PROVENANCE,\n\t\t\t\t\treservationId: id\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn reservations.complete(id, parentSessionId);\n\t\t})();\n\t\tprovision.set(id, setup);\n\t\tpublishPending();\n\t\ttry {\n\t\t\treturn await setup;\n\t\t} catch (error) {\n\t\t\trequireStore().fail(id, parentSessionId, \"SESSION_UNAVAILABLE\");\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (provision.get(id) === setup) provision.delete(id);\n\t\t\tpublishPending();\n\t\t}\n\t};\n\tconst provisionConversationWorktree = async (record, signal) => {\n\t\tconst pending = provision.get(record.id);\n\t\tif (pending) return pending;\n\t\treadReservation(record.id, record.parentSessionId);\n\t\trequireStore().selectSetup(record.id, record.parentSessionId, \"managed-worktree\");\n\t\tconst setup = (async () => {\n\t\t\ttry {\n\t\t\t\tconst child = await options.headlessHub.sessionService.provisionReservedWorktree?.({\n\t\t\t\t\treservationId: record.id,\n\t\t\t\t\tparentSessionId: record.parentSessionId,\n\t\t\t\t\tsignal\n\t\t\t\t});\n\t\t\t\tif (child === void 0 || child.sessionId !== record.id) throw new Error(\"Automatic worktree provisioning did not create the reserved session.\");\n\t\t\t\treturn child;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof SessionMcpConversationError) throw error;\n\t\t\t\toptions.onNotice?.(`session MCP worktree provisioning failed for reservation ${record.id}: ${error instanceof Error ? redactUrlCredentials(error.message) : \"Automatic worktree provisioning failed.\"}`);\n\t\t\t\tthrow new SessionMcpConversationError(\"SESSION_WORKTREE_PROVISION_FAILED\", \"An automatic worktree could not be created for this conversation. Resolve the host Git setup, then retry.\", record.id);\n\t\t\t}\n\t\t})();\n\t\tprovision.set(record.id, setup);\n\t\tpublishPending();\n\t\ttry {\n\t\t\treturn await setup;\n\t\t} catch (error) {\n\t\t\trequireStore().fail(record.id, record.parentSessionId, \"SESSION_WORKTREE_PROVISION_FAILED\");\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (provision.get(record.id) === setup) provision.delete(record.id);\n\t\t\tpublishPending();\n\t\t}\n\t};\n\tconst publicRoutes = async (request) => {\n\t\tconst url = new URL(request.url);\n\t\tconst configuredOrigin = origin();\n\t\tconst signedMcpMatch = SESSION_MCP_URL_TOKEN_PATTERN.exec(url.pathname);\n\t\tconst mcpMatch = SESSION_MCP_PATTERN.exec(url.pathname) ?? signedMcpMatch;\n\t\tif (mcpMatch !== null) {\n\t\t\tif (configuredOrigin === void 0) return json(503, { error: \"Session MCP public origin is unavailable.\" });\n\t\t\tconst workspaceId = decodeURIComponent(mcpMatch[1]);\n\t\t\tconst sessionId = decodeURIComponent(mcpMatch[2]);\n\t\t\tconst pathToken = signedMcpMatch?.[3];\n\t\t\tconst canonicalPath = sessionPath(workspaceId, sessionId);\n\t\t\tconst presentation = url.pathname.startsWith(`${canonicalPath}-app`) ? \"app\" : \"pure\";\n\t\t\tconst basePath = presentation === \"app\" ? `${canonicalPath}-app` : canonicalPath;\n\t\t\tconst exactPath = pathToken === void 0 ? basePath : `${basePath}/${pathToken}`;\n\t\t\tif (url.pathname !== exactPath || url.search !== \"\") return json(404, { error: \"Not found.\" });\n\t\t\tconst audience = `${configuredOrigin}${canonicalPath}`;\n\t\t\tconst resource = `${configuredOrigin}${exactPath}`;\n\t\t\tconst incarnation = target(workspaceId, sessionId) === void 0 ? void 0 : incarnations.get(sessionId);\n\t\t\tconst handlers = incarnation?.handlers;\n\t\t\tconst handler = (pathToken === void 0 ? handlers?.get(resource) : void 0) ?? createSessionMcpHttpHandler({\n\t\t\t\taudience,\n\t\t\t\tpresentation,\n\t\t\t\tbaselines: incarnation?.baselines ?? /* @__PURE__ */ new Map(),\n\t\t\t\tauthorization,\n\t\t\t\tonNotice: options.onNotice,\n\t\t\t\tonInvocation: (invocation) => {\n\t\t\t\t\tif (invocation.sessionId === void 0 || invocation.conversationDigest === void 0) return;\n\t\t\t\t\tconst conversation = options.conversationStore?.find(invocation.clientId, invocation.parentSessionId, invocation.conversationDigest);\n\t\t\t\t\tif (conversation?.state !== \"bound\" || conversation.id !== invocation.sessionId || conversation.workspaceId === void 0) return;\n\t\t\t\t\toptions.activityStore?.record(conversation.workspaceId, conversation.id, authorization.readClient(invocation.clientId)?.name ?? \"remote agent\", invocation);\n\t\t\t\t},\n\t\t\t\t...pathToken === void 0 ? {} : {\n\t\t\t\t\tpathToken,\n\t\t\t\t\toperations: incarnation?.operations\n\t\t\t\t},\n\t\t\t\tresolveConversation: async (grant, digest, reserve, signal) => {\n\t\t\t\t\tconst store = requireStore();\n\t\t\t\t\tlet record = reserve ? store.reserve(grant.clientId, sessionId, workspaceId, digest) : store.find(grant.clientId, sessionId, digest);\n\t\t\t\t\tif (!record) throw new SessionMcpConversationError(\"SESSION_UNAVAILABLE\", \"This conversation binding is unavailable. It will not be recreated automatically.\");\n\t\t\t\t\tconst restoring = recoveries.get(record.id);\n\t\t\t\t\tif (restoring) await restoring;\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst existing = record.workspaceId === void 0 ? void 0 : target(record.workspaceId, record.id);\n\t\t\t\t\t\tif (record.state === \"closed\" || record.state === \"bound\" && !existing) {\n\t\t\t\t\t\t\tif (options.headlessHub.session(record.id) || !record.cwd || options.isSessionPersisted?.(record.id, record.cwd) !== false) throw new SessionMcpConversationError(\"SESSION_UNAVAILABLE\", \"The bound session is unavailable. Resume it in Po; no other session will be used.\", record.id);\n\t\t\t\t\t\t\tif (record.setupKind === void 0 && record.cwd !== void 0) throw new SessionMcpConversationError(\"SESSION_TARGET_FIXED\", \"This existing setup has no verified provider. Recover it without changing its ownership.\", record.id);\n\t\t\t\t\t\t\trecord = store.recover(record.id, sessionId);\n\t\t\t\t\t\t\tconst recovery = record.setupKind === \"existing-directory\" && record.cwd ? setupDirectory(record.id, sessionId, record.cwd) : provisionConversationWorktree(record, signal);\n\t\t\t\t\t\t\trecoveries.set(record.id, recovery);\n\t\t\t\t\t\t\tpublishPending();\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait recovery;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\tif (recoveries.get(record.id) === recovery) recoveries.delete(record.id);\n\t\t\t\t\t\t\t\tpublishPending();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trecord = store.find(grant.clientId, sessionId, digest);\n\t\t\t\t\tif (record.state === \"pending\") {\n\t\t\t\t\t\tpublishPending();\n\t\t\t\t\t\tif (record.workspaceId !== void 0 && options.isSessionPersisted?.(record.id, record.cwd) !== false) throw new SessionMcpConversationError(\"SESSION_UNAVAILABLE\", \"The bound session is unavailable. Resume it in Po; no other session will be used.\", record.id);\n\t\t\t\t\t\tconst pending = provision.get(record.id);\n\t\t\t\t\t\tif (pending) await pending;\n\t\t\t\t\t\telse if (record.setupKind === \"existing-directory\" && record.cwd) await setupDirectory(record.id, sessionId, record.cwd);\n\t\t\t\t\t\telse await provisionConversationWorktree(record, signal);\n\t\t\t\t\t\trecord = store.find(grant.clientId, sessionId, digest);\n\t\t\t\t\t\tif (!record || record.state !== \"bound\") throw new SessionMcpConversationError(\"SESSION_WORKTREE_PROVISION_FAILED\", \"The automatic worktree setup did not complete. Retry after resolving the host Git setup.\");\n\t\t\t\t\t}\n\t\t\t\t\tconst child = record.workspaceId === void 0 ? void 0 : target(record.workspaceId, record.id);\n\t\t\t\t\tif (!child || child.session.parentSessionId !== sessionId || executionDirectory(child.session.cwd) !== record.cwd || !fs.existsSync(child.session.cwd)) throw new SessionMcpConversationError(\"SESSION_UNAVAILABLE\", \"The bound session is unavailable. Resume it in Po; no other session will be used.\", record.id);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsessionId: record.id,\n\t\t\t\t\t\tgeneration: child.generation,\n\t\t\t\t\t\ttoolSurface: child.session.host.mcpSurface,\n\t\t\t\t\t\tagentLocked: () => child.session.host.runtime.agentLocked()\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\tonVerified: (grant) => {\n\t\t\t\t\tif (options.registrationStore === void 0) return;\n\t\t\t\t\tconst active = target(workspaceId, sessionId);\n\t\t\t\t\tif (active === void 0 || grant.sessionGeneration !== active.generation || grant.clientId === \"\") throw new Error(\"The session grant is no longer active.\");\n\t\t\t\t\tif (authorization.readClient(grant.clientId)?.tokenEndpointAuthMethod !== \"client_secret_post\") return;\n\t\t\t\t\tconst registration = authorization.persistentRegistration(grant.clientId, workspaceId, Date.now());\n\t\t\t\t\tif (registration === void 0 || !options.registrationStore.save(registration)) throw new Error(\"The verified Session MCP client could not be saved.\");\n\t\t\t\t},\n\t\t\t\t...pathToken === void 0 ? { resourceMetadataUrl: `${configuredOrigin}/.well-known/oauth-protected-resource${basePath}` } : {},\n\t\t\t\tresolveSession: (grantedSessionId) => {\n\t\t\t\t\tif (grantedSessionId !== sessionId) return void 0;\n\t\t\t\t\tconst resolved = target(workspaceId, sessionId);\n\t\t\t\t\treturn resolved === void 0 ? void 0 : {\n\t\t\t\t\t\tsessionId,\n\t\t\t\t\t\tgeneration: resolved.generation,\n\t\t\t\t\t\ttoolSurface: resolved.session.host.mcpSurface,\n\t\t\t\t\t\tagentLocked: () => resolved.session.host.runtime.agentLocked()\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (pathToken === void 0) handlers?.set(resource, handler);\n\t\t\treturn handler(new Request(resource, request));\n\t\t}\n\t\tconst protectedMatch = PROTECTED_RESOURCE_PATTERN.exec(url.pathname);\n\t\tif (protectedMatch !== null && request.method === \"GET\") {\n\t\t\tif (configuredOrigin === void 0) return json(503, { error: \"Session MCP public origin is unavailable.\" });\n\t\t\treturn json(200, {\n\t\t\t\tresource: `${configuredOrigin}${protectedMatch[1]}`,\n\t\t\t\tauthorization_servers: [configuredOrigin],\n\t\t\t\tbearer_methods_supported: [\"header\"]\n\t\t\t});\n\t\t}\n\t\tif (url.pathname === AUTHORIZATION_SERVER_DISCOVERY && request.method === \"GET\") {\n\t\t\tif (configuredOrigin === void 0) return json(503, { error: \"Session MCP public origin is unavailable.\" });\n\t\t\treturn json(200, {\n\t\t\t\tissuer: configuredOrigin,\n\t\t\t\tauthorization_endpoint: `${configuredOrigin}${AUTHORIZE_ROUTE}`,\n\t\t\t\ttoken_endpoint: `${configuredOrigin}${TOKEN_ROUTE}`,\n\t\t\t\tresponse_types_supported: [\"code\"],\n\t\t\t\tgrant_types_supported: [\"authorization_code\", \"refresh_token\"],\n\t\t\t\tcode_challenge_methods_supported: [\"S256\"],\n\t\t\t\ttoken_endpoint_auth_methods_supported: [\"client_secret_post\"]\n\t\t\t});\n\t\t}\n\t\tif (url.pathname === AUTHORIZE_ROUTE && request.method === \"GET\") {\n\t\t\tif (configuredOrigin === void 0) return json(503, { error: \"Session MCP public origin is unavailable.\" });\n\t\t\tconst clientId = url.searchParams.get(\"client_id\") ?? \"\";\n\t\t\tconst client = authorization.readClient(clientId);\n\t\t\tconst binding = authorization.readAuthorizationBinding(clientId);\n\t\t\tconst redirectUri = url.searchParams.get(\"redirect_uri\") ?? \"\";\n\t\t\tif (client === void 0 || client.tokenEndpointAuthMethod !== \"client_secret_post\" || binding === void 0 || redirectUri !== client.redirectUri) return oauthError(new SessionMcpOAuthError(\"invalid_client\", \"Unknown client or callback.\"));\n\t\t\tconst callback = new URL(client.redirectUri);\n\t\t\tconst state = url.searchParams.get(\"state\");\n\t\t\ttry {\n\t\t\t\tconst boundSession = options.headlessHub.session(binding.sessionId);\n\t\t\t\tconst boundIncarnation = incarnations.get(binding.sessionId);\n\t\t\t\tconst expectedAudience = boundSession?.workspaceId === void 0 ? void 0 : `${configuredOrigin}${sessionPath(boundSession.workspaceId, binding.sessionId)}`;\n\t\t\t\tif (expectedAudience === void 0 || binding.audience !== expectedAudience || boundIncarnation?.host !== boundSession?.host || binding.sessionGeneration !== boundIncarnation?.generation) {\n\t\t\t\t\tauthorization.revokeClient(clientId);\n\t\t\t\t\tthrow new SessionMcpOAuthError(\"invalid_grant\", \"The preauthorized session is no longer active.\");\n\t\t\t\t}\n\t\t\t\tif (url.searchParams.get(\"response_type\") !== \"code\") throw new SessionMcpOAuthError(\"invalid_request\", \"Only the code response type is supported.\");\n\t\t\t\tconst resource = url.searchParams.get(\"resource\");\n\t\t\t\tif (url.searchParams.getAll(\"resource\").length > 1 || resource !== null && resource !== binding.audience && resource !== `${binding.audience}-app`) {\n\t\t\t\t\toptions.onNotice?.(`session MCP authorize refused: client ${clientId} is bound to session ${binding.sessionId}, expecting ${binding.audience} but the connector asked for ${describeResource(resource ?? \"\")}`);\n\t\t\t\t\tthrow new SessionMcpOAuthError(\"invalid_request\", \"The requested resource is not preauthorized. The connector's MCP URL must be the session URL this client was created for.\");\n\t\t\t\t}\n\t\t\t\tconst code = authorization.issueAuthorizationCode({\n\t\t\t\t\tclientId,\n\t\t\t\t\tredirectUri,\n\t\t\t\t\tcodeChallenge: url.searchParams.get(\"code_challenge\") ?? \"\",\n\t\t\t\t\tcodeChallengeMethod: url.searchParams.get(\"code_challenge_method\")\n\t\t\t\t});\n\t\t\t\tcallback.searchParams.set(\"code\", code.code);\n\t\t\t} catch (error) {\n\t\t\t\tcallback.searchParams.set(\"error\", error instanceof SessionMcpOAuthError ? error.code : \"invalid_request\");\n\t\t\t\tcallback.searchParams.set(\"error_description\", error instanceof Error ? error.message : \"The OAuth request was invalid.\");\n\t\t\t}\n\t\t\tif (state !== null) callback.searchParams.set(\"state\", state);\n\t\t\treturn new Response(null, {\n\t\t\t\tstatus: 302,\n\t\t\t\theaders: {\n\t\t\t\t\tlocation: callback.href,\n\t\t\t\t\t\"cache-control\": \"no-store\"\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (url.pathname === TOKEN_ROUTE && request.method === \"POST\") try {\n\t\t\tconst form = await request.formData();\n\t\t\tconst grantType = formString(form, \"grant_type\");\n\t\t\tconst clientId = formString(form, \"client_id\");\n\t\t\tconst clientSecret = formString(form, \"client_secret\");\n\t\t\tconst resource = form.get(\"resource\");\n\t\t\tconst binding = authorization.readAuthorizationBinding(clientId);\n\t\t\tif (form.getAll(\"resource\").length > 1 || resource !== null && (typeof resource !== \"string\" || resource !== binding?.audience && resource !== `${binding?.audience}-app`)) throw new SessionMcpOAuthError(\"invalid_request\", \"The requested resource is not preauthorized.\");\n\t\t\tconst result = grantType === \"authorization_code\" ? authorization.exchangeToken({\n\t\t\t\tgrantType,\n\t\t\t\tclientId,\n\t\t\t\tclientSecret,\n\t\t\t\tcode: formString(form, \"code\"),\n\t\t\t\tredirectUri: formString(form, \"redirect_uri\"),\n\t\t\t\tcodeVerifier: formString(form, \"code_verifier\")\n\t\t\t}) : grantType === \"refresh_token\" ? authorization.exchangeToken({\n\t\t\t\tgrantType,\n\t\t\t\tclientId,\n\t\t\t\tclientSecret,\n\t\t\t\trefreshToken: formString(form, \"refresh_token\")\n\t\t\t}) : (() => {\n\t\t\t\tthrow new SessionMcpOAuthError(\"unsupported_grant_type\", \"The grant type is not supported.\");\n\t\t\t})();\n\t\t\treturn json(200, {\n\t\t\t\taccess_token: result.accessToken,\n\t\t\t\trefresh_token: result.refreshToken,\n\t\t\t\ttoken_type: result.tokenType,\n\t\t\t\texpires_in: result.expiresIn\n\t\t\t});\n\t\t} catch (error) {\n\t\t\treturn oauthError(error);\n\t\t}\n\t};\n\tpublishPending();\n\treturn {\n\t\treservations,\n\t\tcloseSessionBinding(sessionId) {\n\t\t\toptions.conversationStore?.closeSession(sessionId);\n\t\t\tpublishPending();\n\t\t},\n\t\thandlePublic: publicRoutes,\n\t\tasync handleHost(request) {\n\t\t\tconst url = new URL(request.url);\n\t\t\torigin();\n\t\t\tconst configMatch = SESSION_MCP_CONFIG_PATTERN.exec(url.pathname);\n\t\t\tconst match = SESSION_MCP_CLIENTS_PATTERN.exec(url.pathname);\n\t\t\tconst conversationMatch = SESSION_MCP_CONVERSATIONS_PATTERN.exec(url.pathname);\n\t\t\tconst activityMatch = SESSION_MCP_ACTIVITY_PATTERN.exec(url.pathname);\n\t\t\tif (configMatch === null && match === null && conversationMatch === null && activityMatch === null) return void 0;\n\t\t\tconst routeMatch = configMatch ?? match ?? conversationMatch ?? activityMatch;\n\t\t\tconst workspaceId = decodeURIComponent(routeMatch[1]);\n\t\t\tconst sessionId = decodeURIComponent(routeMatch[2]);\n\t\t\tconst clientId = match?.[3] === void 0 ? void 0 : decodeURIComponent(match[3]);\n\t\t\tconst resolved = target(workspaceId, sessionId);\n\t\t\tif (activityMatch !== null) {\n\t\t\t\tif (request.method !== \"GET\") return json(405, { error: \"Method not allowed.\" });\n\t\t\t\tconst beforeText = url.searchParams.get(\"before\");\n\t\t\t\tconst before = beforeText === null ? void 0 : Number(beforeText);\n\t\t\t\tif ([...url.searchParams.keys()].some((key) => key !== \"before\") || before !== void 0 && (!Number.isSafeInteger(before) || before <= 0)) return json(400, { error: \"Invalid history cursor.\" });\n\t\t\t\tif (options.headlessHub.computerUse?.ownsSession?.(sessionId)) return json(404, { error: \"Session not found.\" });\n\t\t\t\tif (!options.activityStore) return json(503, { error: \"MCP call history is unavailable in this host.\" });\n\t\t\t\ttry {\n\t\t\t\t\tconst conversation = options.conversationStore?.list().find((entry) => entry.id === sessionId && entry.state === \"bound\" && entry.workspaceId === workspaceId);\n\t\t\t\t\tif (conversation === void 0) return json(200, {\n\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\tavailable: false,\n\t\t\t\t\t\ttools: [],\n\t\t\t\t\t\tcalls: [],\n\t\t\t\t\t\ttotal: 0\n\t\t\t\t\t});\n\t\t\t\t\tconst history = options.activityStore.read(workspaceId, sessionId, before);\n\t\t\t\t\tconst parent = target(conversation.parentWorkspaceId, conversation.parentSessionId);\n\t\t\t\t\tconst bindings = authorization.listClients().flatMap((client) => {\n\t\t\t\t\t\tconst binding = authorization.readAuthorizationBinding(client.clientId);\n\t\t\t\t\t\treturn binding !== void 0 && client.clientId === conversation.clientId && binding.sessionId === conversation.parentSessionId && binding.sessionGeneration === parent?.generation ? [{\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\tbinding\n\t\t\t\t\t\t}] : [];\n\t\t\t\t\t});\n\t\t\t\t\tlet available = false;\n\t\t\t\t\tlet tools = [];\n\t\t\t\t\tif (resolved !== void 0 && bindings.length > 0) try {\n\t\t\t\t\t\ttools = [...resolved.session.host.mcpSurface.readSurface().tools.map((tool) => ({\n\t\t\t\t\t\t\tname: tool.name,\n\t\t\t\t\t\t\tlabel: tool.label,\n\t\t\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\t\t\tinputSchema: tool.parameters\n\t\t\t\t\t\t})), ...SESSION_MCP_EXTRA_TOOLS.map((tool) => ({\n\t\t\t\t\t\t\tname: tool.name,\n\t\t\t\t\t\t\tlabel: tool.title ?? tool.name,\n\t\t\t\t\t\t\tdescription: tool.description ?? \"\",\n\t\t\t\t\t\t\tinputSchema: tool.inputSchema\n\t\t\t\t\t\t}))].flatMap((tool) => {\n\t\t\t\t\t\t\tconst connections = bindings.filter(({ binding }) => binding.scope === \"session\" || binding.tools.includes(tool.name)).map(({ client }) => client.name);\n\t\t\t\t\t\t\treturn connections.length === 0 ? [] : [{\n\t\t\t\t\t\t\t\t...tool,\n\t\t\t\t\t\t\t\tconnections\n\t\t\t\t\t\t\t}];\n\t\t\t\t\t\t});\n\t\t\t\t\t\tavailable = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tavailable = false;\n\t\t\t\t\t}\n\t\t\t\t\tconst toolPrefix = bindings[0]?.binding.toolPrefix;\n\t\t\t\t\treturn json(200, {\n\t\t\t\t\t\t...history,\n\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\tavailable,\n\t\t\t\t\t\ttools,\n\t\t\t\t\t\t...toolPrefix === void 0 ? {} : { toolPrefix }\n\t\t\t\t\t});\n\t\t\t\t} catch {\n\t\t\t\t\treturn json(503, { error: \"MCP call history could not be read. Check the host storage.\" });\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (resolved === void 0) return json(404, { error: \"Session not found.\" });\n\t\t\tif (conversationMatch !== null) {\n\t\t\t\tconst id = conversationMatch[3] === void 0 ? void 0 : decodeURIComponent(conversationMatch[3]);\n\t\t\t\ttry {\n\t\t\t\t\tif (request.method === \"GET\" && id === void 0) return json(200, { conversations: requireStore().list().filter((record) => record.parentSessionId === sessionId && record.state !== \"closed\").map(({ conversationDigest: _digest, clientId: _clientId, ...record }) => record) });\n\t\t\t\t\tif (id !== void 0 && request.method === \"DELETE\") {\n\t\t\t\t\t\tif (requireStore().get(id, sessionId).state !== \"pending\" || options.headlessHub.session(id)) return json(409, { error: \"Remove the existing session instead.\" });\n\t\t\t\t\t\trequireStore().closeSession(id);\n\t\t\t\t\t\tpublishPending();\n\t\t\t\t\t\treturn json(200, { ok: true });\n\t\t\t\t\t}\n\t\t\t\t\tif (id !== void 0 && request.method === \"POST\") {\n\t\t\t\t\t\tconst body = await request.json();\n\t\t\t\t\t\tif (typeof body !== \"object\" || body === null || !(\"cwd\" in body) || typeof body.cwd !== \"string\") return json(400, { error: \"An execution directory is required.\" });\n\t\t\t\t\t\treturn json(200, { session: await setupDirectory(id, sessionId, body.cwd) });\n\t\t\t\t\t}\n\t\t\t\t\treturn json(405, { error: \"Method not allowed.\" });\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn json(409, {\n\t\t\t\t\t\terror: error instanceof SessionMcpConversationError ? error.message : \"Session setup failed. Recover the existing setup before retrying.\",\n\t\t\t\t\t\t...error instanceof SessionMcpConversationError ? { code: error.code } : {}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (configMatch !== null) {\n\t\t\t\tif (request.method !== \"GET\") return json(405, { error: \"Method not allowed.\" });\n\t\t\t\tconst configuredOrigin = origin();\n\t\t\t\tif (configuredOrigin === void 0) return json(503, { error: \"Session MCP public origin is unavailable.\" });\n\t\t\t\tlet surface;\n\t\t\t\ttry {\n\t\t\t\t\tsurface = resolved.session.host.mcpSurface.readSurface();\n\t\t\t\t} catch {\n\t\t\t\t\treturn json(409, { error: \"The session capability surface is not ready.\" });\n\t\t\t\t}\n\t\t\t\tif (surface.tools.some((tool) => SESSION_MCP_EXTRA_TOOLS.some((wrapper) => wrapper.name === tool.name))) return json(409, { error: \"The session capability surface contains a reserved remote tool name.\" });\n\t\t\t\treturn json(200, {\n\t\t\t\t\taudience: `${configuredOrigin}${sessionPath(workspaceId, sessionId)}`,\n\t\t\t\t\tmcpUrl: `${configuredOrigin}${sessionPath(workspaceId, sessionId)}`,\n\t\t\t\t\tmcpAppUrl: `${configuredOrigin}${sessionPath(workspaceId, sessionId)}-app`,\n\t\t\t\t\tauthorizationEndpoint: `${configuredOrigin}${AUTHORIZE_ROUTE}`,\n\t\t\t\t\ttokenEndpoint: `${configuredOrigin}${TOKEN_ROUTE}`,\n\t\t\t\t\ttools: [...surface.tools.map(({ name, label, description }) => ({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tdescription\n\t\t\t\t\t})), ...SESSION_MCP_EXTRA_TOOLS.map(({ name, title, description }) => ({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tlabel: title ?? name,\n\t\t\t\t\t\tdescription\n\t\t\t\t\t}))],\n\t\t\t\t\tskills: surface.skills\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (clientId === void 0 && request.method === \"GET\") return json(200, { clients: authorization.listClients().flatMap((client) => {\n\t\t\t\tconst binding = authorization.readAuthorizationBinding(client.clientId);\n\t\t\t\treturn binding?.sessionId === sessionId ? [publicClient(client, binding)] : [];\n\t\t\t}) });\n\t\t\tif (clientId === void 0 && request.method === \"POST\") {\n\t\t\t\tconst configuredOrigin = origin();\n\t\t\t\tif (configuredOrigin === void 0) return json(503, { error: \"Session MCP public origin is unavailable.\" });\n\t\t\t\tlet body;\n\t\t\t\ttry {\n\t\t\t\t\tbody = await request.json();\n\t\t\t\t} catch {\n\t\t\t\t\treturn json(400, { error: \"Invalid client request.\" });\n\t\t\t\t}\n\t\t\t\tif (typeof body !== \"object\" || body === null) return json(400, { error: \"Invalid client request.\" });\n\t\t\t\tconst input = body;\n\t\t\t\tif (!options.conversationStore || !options.registrationStore) return json(503, { error: \"Mandatory conversation routing requires persistent host state.\" });\n\t\t\t\tif (input.routing !== void 0 && input.routing !== \"session\" && input.routing !== \"conversation\") return json(400, { error: \"Session MCP routing is not supported.\" });\n\t\t\t\tconst routing = sessionMcpRouting(input.routing);\n\t\t\t\tif (input.toolPrefix !== void 0 && typeof input.toolPrefix !== \"string\") return json(400, { error: \"Tool prefix must be a string.\" });\n\t\t\t\tconst toolPrefix = input.toolPrefix?.trim() || defaultSessionMcpToolPrefix(resolved.session.name);\n\t\t\t\ttry {\n\t\t\t\t\tsessionMcpToolPrefix(toolPrefix);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn json(400, { error: error.message });\n\t\t\t\t}\n\t\t\t\tconst requestedScope = input.scope;\n\t\t\t\tif (requestedScope !== void 0 && requestedScope !== \"session\" && requestedScope !== \"restricted\") return json(400, { error: \"Authorization scope is not supported.\" });\n\t\t\t\tconst scope = requestedScope === \"session\" ? \"session\" : \"restricted\";\n\t\t\t\tconst hasTools = Object.hasOwn(input, \"tools\");\n\t\t\t\tconst hasSkills = Object.hasOwn(input, \"skills\");\n\t\t\t\tconst tools = parseStringArray(input.tools);\n\t\t\t\tconst skills = parseStringArray(input.skills);\n\t\t\t\tconst authMethod = input.authMethod;\n\t\t\t\tconst apiKey = authMethod === \"api_key\";\n\t\t\t\tconst urlToken = authMethod === \"url_token\";\n\t\t\t\tconst nonOAuthCredential = apiKey || urlToken;\n\t\t\t\tif (authMethod !== void 0 && authMethod !== \"oauth\" && !nonOAuthCredential) return json(400, { error: \"Authentication method is not supported.\" });\n\t\t\t\tif (nonOAuthCredential && (scope !== \"session\" || Object.hasOwn(input, \"redirectUri\"))) return json(400, { error: \"Signed URLs and API keys require session scope and no redirectUri.\" });\n\t\t\t\tif (!nonOAuthCredential && typeof input.redirectUri !== \"string\") return json(400, { error: \"A redirectUri is required.\" });\n\t\t\t\tif (scope === \"session\" && (hasTools || hasSkills)) return json(400, { error: \"Session scope cannot include capability grants.\" });\n\t\t\t\tif (scope === \"restricted\" && (typeof input.name !== \"string\" || !tools || !skills)) return json(400, { error: \"Restricted scope requires a name, tools, and skills.\" });\n\t\t\t\tif (scope === \"restricted\") {\n\t\t\t\t\tlet surface;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsurface = resolved.session.host.mcpSurface.readSurface();\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn json(409, { error: \"The session capability surface is not ready.\" });\n\t\t\t\t\t}\n\t\t\t\t\tif (surface.tools.some((tool) => SESSION_MCP_EXTRA_TOOLS.some((wrapper) => wrapper.name === tool.name))) return json(409, { error: \"The session capability surface contains a reserved remote tool name.\" });\n\t\t\t\t\tconst activeTools = /* @__PURE__ */ new Set([...surface.tools.map((tool) => tool.name), ...SESSION_MCP_EXTRA_TOOLS.map((tool) => tool.name)]);\n\t\t\t\t\tconst activeSkills = new Set(surface.skills.map((skill) => skill.name));\n\t\t\t\t\tif (tools.some((name) => !activeTools.has(name)) || skills.some((name) => !activeSkills.has(name))) return json(400, { error: \"Every requested grant must be active in the session.\" });\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst client = authorization.createClient(urlToken ? {\n\t\t\t\t\t\tname: defaultClientName(configuredOrigin),\n\t\t\t\t\t\tauthMethod: \"url_token\"\n\t\t\t\t\t} : apiKey ? {\n\t\t\t\t\t\tname: typeof input.name === \"string\" ? input.name : \"API key\",\n\t\t\t\t\t\tauthMethod: \"api_key\"\n\t\t\t\t\t} : {\n\t\t\t\t\t\tname: scope === \"session\" ? defaultClientName(configuredOrigin) : input.name,\n\t\t\t\t\t\tredirectUri: input.redirectUri\n\t\t\t\t\t});\n\t\t\t\t\tconst audience = `${configuredOrigin}${sessionPath(workspaceId, sessionId)}`;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst binding = scope === \"session\" ? authorization.createAuthorizationBinding({\n\t\t\t\t\t\t\tclientId: client.clientId,\n\t\t\t\t\t\t\tsessionId,\n\t\t\t\t\t\t\tsessionGeneration: resolved.generation,\n\t\t\t\t\t\t\taudience,\n\t\t\t\t\t\t\tscope: \"session\",\n\t\t\t\t\t\t\trouting,\n\t\t\t\t\t\t\ttoolPrefix\n\t\t\t\t\t\t}) : authorization.createAuthorizationBinding({\n\t\t\t\t\t\t\tclientId: client.clientId,\n\t\t\t\t\t\t\tsessionId,\n\t\t\t\t\t\t\tsessionGeneration: resolved.generation,\n\t\t\t\t\t\t\taudience,\n\t\t\t\t\t\t\tscope: \"restricted\",\n\t\t\t\t\t\t\trouting,\n\t\t\t\t\t\t\ttoolPrefix,\n\t\t\t\t\t\t\ttools: [...new Set(tools)],\n\t\t\t\t\t\t\tskills: [...new Set(skills)]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconst connectionUrl = urlToken ? `${audience}/${authorization.issueUrlToken(client.clientId)}` : void 0;\n\t\t\t\t\t\tif (nonOAuthCredential) {\n\t\t\t\t\t\t\tconst registration = authorization.persistentRegistration(client.clientId, workspaceId, Date.now());\n\t\t\t\t\t\t\tif (registration === void 0 || !options.registrationStore.save(registration)) {\n\t\t\t\t\t\t\t\tauthorization.revokeClient(client.clientId);\n\t\t\t\t\t\t\t\treturn json(500, { error: \"Session MCP credential could not be saved.\" });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn json(201, { client: {\n\t\t\t\t\t\t\t...publicClient(client, binding),\n\t\t\t\t\t\t\t...connectionUrl === void 0 ? { clientSecret: client.clientSecret } : {\n\t\t\t\t\t\t\t\tconnectionUrl,\n\t\t\t\t\t\t\t\tmcpAppConnectionUrl: `${audience}-app${connectionUrl.slice(audience.length)}`\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} });\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tauthorization.revokeClient(client.clientId);\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn oauthError(error);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (clientId !== void 0 && request.method === \"DELETE\") {\n\t\t\t\tif (authorization.readAuthorizationBinding(clientId)?.sessionId !== sessionId) return json(404, { error: \"Client not found.\" });\n\t\t\t\tif (options.registrationStore !== void 0 && !options.registrationStore.remove(clientId)) return json(500, { error: \"Client revocation could not be saved.\" });\n\t\t\t\tauthorization.revokeClient(clientId);\n\t\t\t\tfor (const presentation of [\"pure\", \"app\"]) incarnations.get(sessionId)?.baselines.delete(JSON.stringify([presentation, clientId]));\n\t\t\t\toptions.conversationStore?.closeClient(clientId);\n\t\t\t\tpublishPending();\n\t\t\t\treturn json(200, { ok: true });\n\t\t\t}\n\t\t\treturn json(405, { error: \"Method not allowed.\" });\n\t\t},\n\t\tclose() {\n\t\t\tunsubscribe();\n\t\t\tfor (const [sessionId, incarnation] of incarnations) {\n\t\t\t\trevokeIncarnation(sessionId, incarnation.generation);\n\t\t\t\tabortOperations(incarnation.operations);\n\t\t\t}\n\t\t\tincarnations.clear();\n\t\t\toptions.activityStore?.close();\n\t\t}\n\t};\n}\nfunction isPublicSessionMcpRoute(method, pathname) {\n\treturn SESSION_MCP_PATTERN.test(pathname) || SESSION_MCP_URL_TOKEN_PATTERN.test(pathname) || method === \"GET\" && PROTECTED_RESOURCE_PATTERN.test(pathname) || method === \"GET\" && (pathname === AUTHORIZATION_SERVER_DISCOVERY || pathname === AUTHORIZE_ROUTE) || method === \"POST\" && pathname === TOKEN_ROUTE;\n}\nfunction isSessionMcpHostRoute(pathname) {\n\treturn SESSION_MCP_ACTIVITY_PATTERN.test(pathname) || SESSION_MCP_CONFIG_PATTERN.test(pathname) || SESSION_MCP_CLIENTS_PATTERN.test(pathname) || SESSION_MCP_CONVERSATIONS_PATTERN.test(pathname);\n}\n/**\n* The Session MCP management a sealed remote device may reach, which is what Settings uses:\n* the config, listing and creating a session's clients, and revoking one. Creating and\n* revoking are step-up gated. Activity and conversations stay on the host.\n*/\nfunction isSessionMcpPhoneRoute(method, pathname) {\n\tif (method === \"GET\" && SESSION_MCP_CONFIG_PATTERN.test(pathname)) return true;\n\tconst clients = SESSION_MCP_CLIENTS_PATTERN.exec(pathname);\n\tif (clients === null) return false;\n\treturn clients[3] === void 0 ? method === \"GET\" || method === \"POST\" : method === \"DELETE\";\n}\n//#endregion\nexport { createSessionMcpRoutes, isPublicSessionMcpRoute, isSessionMcpHostRoute, isSessionMcpPhoneRoute };\n\n//# sourceMappingURL=sessionMcpRoutes.mjs.map","'use strict';\n\nconst BINARY_TYPES = ['nodebuffer', 'arraybuffer', 'fragments'];\nconst hasBlob = typeof Blob !== 'undefined';\n\nif (hasBlob) BINARY_TYPES.push('blob');\n\nmodule.exports = {\n  BINARY_TYPES,\n  CLOSE_TIMEOUT: 30000,\n  EMPTY_BUFFER: Buffer.alloc(0),\n  GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',\n  hasBlob,\n  kForOnEventAttribute: Symbol('kIsForOnEventAttribute'),\n  kListener: Symbol('kListener'),\n  kStatusCode: Symbol('status-code'),\n  kWebSocket: Symbol('websocket'),\n  NOOP: () => {}\n};\n","export default {};\nthrow new Error(`Could not resolve \"bufferutil\" imported by \"ws\". Is it installed?`)","'use strict';\n\nconst { EMPTY_BUFFER } = require('./constants');\n\nconst FastBuffer = Buffer[Symbol.species];\n\n/**\n * Merges an array of buffers into a new buffer.\n *\n * @param {Buffer[]} list The array of buffers to concat\n * @param {Number} totalLength The total length of buffers in the list\n * @return {Buffer} The resulting buffer\n * @public\n */\nfunction concat(list, totalLength) {\n  if (list.length === 0) return EMPTY_BUFFER;\n  if (list.length === 1) return list[0];\n\n  const target = Buffer.allocUnsafe(totalLength);\n  let offset = 0;\n\n  for (let i = 0; i < list.length; i++) {\n    const buf = list[i];\n    target.set(buf, offset);\n    offset += buf.length;\n  }\n\n  if (offset < totalLength) {\n    return new FastBuffer(target.buffer, target.byteOffset, offset);\n  }\n\n  return target;\n}\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nfunction _mask(source, mask, output, offset, length) {\n  for (let i = 0; i < length; i++) {\n    output[offset + i] = source[i] ^ mask[i & 3];\n  }\n}\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nfunction _unmask(buffer, mask) {\n  for (let i = 0; i < buffer.length; i++) {\n    buffer[i] ^= mask[i & 3];\n  }\n}\n\n/**\n * Converts a buffer to an `ArrayBuffer`.\n *\n * @param {Buffer} buf The buffer to convert\n * @return {ArrayBuffer} Converted buffer\n * @public\n */\nfunction toArrayBuffer(buf) {\n  if (buf.length === buf.buffer.byteLength) {\n    return buf.buffer;\n  }\n\n  return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);\n}\n\n/**\n * Converts `data` to a `Buffer`.\n *\n * @param {*} data The data to convert\n * @return {Buffer} The buffer\n * @throws {TypeError}\n * @public\n */\nfunction toBuffer(data) {\n  toBuffer.readOnly = true;\n\n  if (Buffer.isBuffer(data)) return data;\n\n  let buf;\n\n  if (data instanceof ArrayBuffer) {\n    buf = new FastBuffer(data);\n  } else if (ArrayBuffer.isView(data)) {\n    buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength);\n  } else {\n    buf = Buffer.from(data);\n    toBuffer.readOnly = false;\n  }\n\n  return buf;\n}\n\nmodule.exports = {\n  concat,\n  mask: _mask,\n  toArrayBuffer,\n  toBuffer,\n  unmask: _unmask\n};\n\n/* istanbul ignore else  */\nif (!process.env.WS_NO_BUFFER_UTIL) {\n  try {\n    const bufferUtil = require('bufferutil');\n\n    module.exports.mask = function (source, mask, output, offset, length) {\n      if (length < 48) _mask(source, mask, output, offset, length);\n      else bufferUtil.mask(source, mask, output, offset, length);\n    };\n\n    module.exports.unmask = function (buffer, mask) {\n      if (buffer.length < 32) _unmask(buffer, mask);\n      else bufferUtil.unmask(buffer, mask);\n    };\n  } catch (e) {\n    // Continue regardless of the error.\n  }\n}\n","'use strict';\n\nconst kDone = Symbol('kDone');\nconst kRun = Symbol('kRun');\n\n/**\n * A very simple job queue with adjustable concurrency. Adapted from\n * https://github.com/STRML/async-limiter\n */\nclass Limiter {\n  /**\n   * Creates a new `Limiter`.\n   *\n   * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed\n   *     to run concurrently\n   */\n  constructor(concurrency) {\n    this[kDone] = () => {\n      this.pending--;\n      this[kRun]();\n    };\n    this.concurrency = concurrency || Infinity;\n    this.jobs = [];\n    this.pending = 0;\n  }\n\n  /**\n   * Adds a job to the queue.\n   *\n   * @param {Function} job The job to run\n   * @public\n   */\n  add(job) {\n    this.jobs.push(job);\n    this[kRun]();\n  }\n\n  /**\n   * Removes a job from the queue and runs it if possible.\n   *\n   * @private\n   */\n  [kRun]() {\n    if (this.pending === this.concurrency) return;\n\n    if (this.jobs.length) {\n      const job = this.jobs.shift();\n\n      this.pending++;\n      job(this[kDone]);\n    }\n  }\n}\n\nmodule.exports = Limiter;\n","'use strict';\n\nconst zlib = require('zlib');\n\nconst bufferUtil = require('./buffer-util');\nconst Limiter = require('./limiter');\nconst { kStatusCode } = require('./constants');\n\nconst FastBuffer = Buffer[Symbol.species];\nconst TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);\nconst kPerMessageDeflate = Symbol('permessage-deflate');\nconst kTotalLength = Symbol('total-length');\nconst kCallback = Symbol('callback');\nconst kBuffers = Symbol('buffers');\nconst kError = Symbol('error');\n\n//\n// We limit zlib concurrency, which prevents severe memory fragmentation\n// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913\n// and https://github.com/websockets/ws/issues/1202\n//\n// Intentionally global; it's the global thread pool that's an issue.\n//\nlet zlibLimiter;\n\n/**\n * permessage-deflate implementation.\n */\nclass PerMessageDeflate {\n  /**\n   * Creates a PerMessageDeflate instance.\n   *\n   * @param {Object} [options] Configuration options\n   * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support\n   *     for, or request, a custom client window size\n   * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/\n   *     acknowledge disabling of client context takeover\n   * @param {Number} [options.concurrencyLimit=10] The number of concurrent\n   *     calls to zlib\n   * @param {Boolean} [options.isServer=false] Create the instance in either\n   *     server or client mode\n   * @param {Number} [options.maxPayload=0] The maximum allowed message length\n   * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the\n   *     use of a custom server window size\n   * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept\n   *     disabling of server context takeover\n   * @param {Number} [options.threshold=1024] Size (in bytes) below which\n   *     messages should not be compressed if context takeover is disabled\n   * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on\n   *     deflate\n   * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on\n   *     inflate\n   */\n  constructor(options) {\n    this._options = options || {};\n    this._threshold =\n      this._options.threshold !== undefined ? this._options.threshold : 1024;\n    this._maxPayload = this._options.maxPayload | 0;\n    this._isServer = !!this._options.isServer;\n    this._deflate = null;\n    this._inflate = null;\n\n    this.params = null;\n\n    if (!zlibLimiter) {\n      const concurrency =\n        this._options.concurrencyLimit !== undefined\n          ? this._options.concurrencyLimit\n          : 10;\n      zlibLimiter = new Limiter(concurrency);\n    }\n  }\n\n  /**\n   * @type {String}\n   */\n  static get extensionName() {\n    return 'permessage-deflate';\n  }\n\n  /**\n   * Create an extension negotiation offer.\n   *\n   * @return {Object} Extension parameters\n   * @public\n   */\n  offer() {\n    const params = {};\n\n    if (this._options.serverNoContextTakeover) {\n      params.server_no_context_takeover = true;\n    }\n    if (this._options.clientNoContextTakeover) {\n      params.client_no_context_takeover = true;\n    }\n    if (this._options.serverMaxWindowBits) {\n      params.server_max_window_bits = this._options.serverMaxWindowBits;\n    }\n    if (this._options.clientMaxWindowBits) {\n      params.client_max_window_bits = this._options.clientMaxWindowBits;\n    } else if (this._options.clientMaxWindowBits == null) {\n      params.client_max_window_bits = true;\n    }\n\n    return params;\n  }\n\n  /**\n   * Accept an extension negotiation offer/response.\n   *\n   * @param {Array} configurations The extension negotiation offers/reponse\n   * @return {Object} Accepted configuration\n   * @public\n   */\n  accept(configurations) {\n    configurations = this.normalizeParams(configurations);\n\n    this.params = this._isServer\n      ? this.acceptAsServer(configurations)\n      : this.acceptAsClient(configurations);\n\n    return this.params;\n  }\n\n  /**\n   * Releases all resources used by the extension.\n   *\n   * @public\n   */\n  cleanup() {\n    if (this._inflate) {\n      this._inflate.close();\n      this._inflate = null;\n    }\n\n    if (this._deflate) {\n      const callback = this._deflate[kCallback];\n\n      this._deflate.close();\n      this._deflate = null;\n\n      if (callback) {\n        callback(\n          new Error(\n            'The deflate stream was closed while data was being processed'\n          )\n        );\n      }\n    }\n  }\n\n  /**\n   *  Accept an extension negotiation offer.\n   *\n   * @param {Array} offers The extension negotiation offers\n   * @return {Object} Accepted configuration\n   * @private\n   */\n  acceptAsServer(offers) {\n    const opts = this._options;\n    const accepted = offers.find((params) => {\n      if (\n        (opts.serverNoContextTakeover === false &&\n          params.server_no_context_takeover) ||\n        (params.server_max_window_bits &&\n          (opts.serverMaxWindowBits === false ||\n            (typeof opts.serverMaxWindowBits === 'number' &&\n              opts.serverMaxWindowBits > params.server_max_window_bits))) ||\n        (typeof opts.clientMaxWindowBits === 'number' &&\n          (typeof params.client_max_window_bits === 'number'\n            ? opts.clientMaxWindowBits > params.client_max_window_bits\n            : !params.client_max_window_bits))\n      ) {\n        return false;\n      }\n\n      return true;\n    });\n\n    if (!accepted) {\n      throw new Error('None of the extension offers can be accepted');\n    }\n\n    if (opts.serverNoContextTakeover) {\n      accepted.server_no_context_takeover = true;\n    }\n    if (opts.clientNoContextTakeover) {\n      accepted.client_no_context_takeover = true;\n    }\n    if (typeof opts.serverMaxWindowBits === 'number') {\n      accepted.server_max_window_bits = opts.serverMaxWindowBits;\n    }\n    if (typeof opts.clientMaxWindowBits === 'number') {\n      accepted.client_max_window_bits = opts.clientMaxWindowBits;\n    } else if (\n      accepted.client_max_window_bits === true ||\n      opts.clientMaxWindowBits === false\n    ) {\n      delete accepted.client_max_window_bits;\n    }\n\n    return accepted;\n  }\n\n  /**\n   * Accept the extension negotiation response.\n   *\n   * @param {Array} response The extension negotiation response\n   * @return {Object} Accepted configuration\n   * @private\n   */\n  acceptAsClient(response) {\n    const params = response[0];\n\n    if (\n      this._options.clientNoContextTakeover === false &&\n      params.client_no_context_takeover\n    ) {\n      throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n    }\n\n    if (!params.client_max_window_bits) {\n      if (typeof this._options.clientMaxWindowBits === 'number') {\n        params.client_max_window_bits = this._options.clientMaxWindowBits;\n      }\n    } else if (\n      this._options.clientMaxWindowBits === false ||\n      (typeof this._options.clientMaxWindowBits === 'number' &&\n        params.client_max_window_bits > this._options.clientMaxWindowBits)\n    ) {\n      throw new Error(\n        'Unexpected or invalid parameter \"client_max_window_bits\"'\n      );\n    }\n\n    return params;\n  }\n\n  /**\n   * Normalize parameters.\n   *\n   * @param {Array} configurations The extension negotiation offers/reponse\n   * @return {Array} The offers/response with normalized parameters\n   * @private\n   */\n  normalizeParams(configurations) {\n    configurations.forEach((params) => {\n      Object.keys(params).forEach((key) => {\n        let value = params[key];\n\n        if (value.length > 1) {\n          throw new Error(`Parameter \"${key}\" must have only a single value`);\n        }\n\n        value = value[0];\n\n        if (key === 'client_max_window_bits') {\n          if (value !== true) {\n            const num = +value;\n            if (!Number.isInteger(num) || num < 8 || num > 15) {\n              throw new TypeError(\n                `Invalid value for parameter \"${key}\": ${value}`\n              );\n            }\n            value = num;\n          } else if (!this._isServer) {\n            throw new TypeError(\n              `Invalid value for parameter \"${key}\": ${value}`\n            );\n          }\n        } else if (key === 'server_max_window_bits') {\n          const num = +value;\n          if (!Number.isInteger(num) || num < 8 || num > 15) {\n            throw new TypeError(\n              `Invalid value for parameter \"${key}\": ${value}`\n            );\n          }\n          value = num;\n        } else if (\n          key === 'client_no_context_takeover' ||\n          key === 'server_no_context_takeover'\n        ) {\n          if (value !== true) {\n            throw new TypeError(\n              `Invalid value for parameter \"${key}\": ${value}`\n            );\n          }\n        } else {\n          throw new Error(`Unknown parameter \"${key}\"`);\n        }\n\n        params[key] = value;\n      });\n    });\n\n    return configurations;\n  }\n\n  /**\n   * Decompress data. Concurrency limited.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @public\n   */\n  decompress(data, fin, callback) {\n    zlibLimiter.add((done) => {\n      this._decompress(data, fin, (err, result) => {\n        done();\n        callback(err, result);\n      });\n    });\n  }\n\n  /**\n   * Compress data. Concurrency limited.\n   *\n   * @param {(Buffer|String)} data Data to compress\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @public\n   */\n  compress(data, fin, callback) {\n    zlibLimiter.add((done) => {\n      this._compress(data, fin, (err, result) => {\n        done();\n        callback(err, result);\n      });\n    });\n  }\n\n  /**\n   * Decompress data.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @private\n   */\n  _decompress(data, fin, callback) {\n    const endpoint = this._isServer ? 'client' : 'server';\n\n    if (!this._inflate) {\n      const key = `${endpoint}_max_window_bits`;\n      const windowBits =\n        typeof this.params[key] !== 'number'\n          ? zlib.Z_DEFAULT_WINDOWBITS\n          : this.params[key];\n\n      this._inflate = zlib.createInflateRaw({\n        ...this._options.zlibInflateOptions,\n        windowBits\n      });\n      this._inflate[kPerMessageDeflate] = this;\n      this._inflate[kTotalLength] = 0;\n      this._inflate[kBuffers] = [];\n      this._inflate.on('error', inflateOnError);\n      this._inflate.on('data', inflateOnData);\n    }\n\n    this._inflate[kCallback] = callback;\n\n    this._inflate.write(data);\n    if (fin) this._inflate.write(TRAILER);\n\n    this._inflate.flush(() => {\n      const err = this._inflate[kError];\n\n      if (err) {\n        this._inflate.close();\n        this._inflate = null;\n        callback(err);\n        return;\n      }\n\n      const data = bufferUtil.concat(\n        this._inflate[kBuffers],\n        this._inflate[kTotalLength]\n      );\n\n      if (this._inflate._readableState.endEmitted) {\n        this._inflate.close();\n        this._inflate = null;\n      } else {\n        this._inflate[kTotalLength] = 0;\n        this._inflate[kBuffers] = [];\n\n        if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n          this._inflate.reset();\n        }\n      }\n\n      callback(null, data);\n    });\n  }\n\n  /**\n   * Compress data.\n   *\n   * @param {(Buffer|String)} data Data to compress\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @private\n   */\n  _compress(data, fin, callback) {\n    const endpoint = this._isServer ? 'server' : 'client';\n\n    if (!this._deflate) {\n      const key = `${endpoint}_max_window_bits`;\n      const windowBits =\n        typeof this.params[key] !== 'number'\n          ? zlib.Z_DEFAULT_WINDOWBITS\n          : this.params[key];\n\n      this._deflate = zlib.createDeflateRaw({\n        ...this._options.zlibDeflateOptions,\n        windowBits\n      });\n\n      this._deflate[kTotalLength] = 0;\n      this._deflate[kBuffers] = [];\n\n      this._deflate.on('data', deflateOnData);\n    }\n\n    this._deflate[kCallback] = callback;\n\n    this._deflate.write(data);\n    this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {\n      if (!this._deflate) {\n        //\n        // The deflate stream was closed while data was being processed.\n        //\n        return;\n      }\n\n      let data = bufferUtil.concat(\n        this._deflate[kBuffers],\n        this._deflate[kTotalLength]\n      );\n\n      if (fin) {\n        data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);\n      }\n\n      //\n      // Ensure that the callback will not be called again in\n      // `PerMessageDeflate#cleanup()`.\n      //\n      this._deflate[kCallback] = null;\n\n      this._deflate[kTotalLength] = 0;\n      this._deflate[kBuffers] = [];\n\n      if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n        this._deflate.reset();\n      }\n\n      callback(null, data);\n    });\n  }\n}\n\nmodule.exports = PerMessageDeflate;\n\n/**\n * The listener of the `zlib.DeflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction deflateOnData(chunk) {\n  this[kBuffers].push(chunk);\n  this[kTotalLength] += chunk.length;\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction inflateOnData(chunk) {\n  this[kTotalLength] += chunk.length;\n\n  if (\n    this[kPerMessageDeflate]._maxPayload < 1 ||\n    this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload\n  ) {\n    this[kBuffers].push(chunk);\n    return;\n  }\n\n  this[kError] = new RangeError('Max payload size exceeded');\n  this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';\n  this[kError][kStatusCode] = 1009;\n  this.removeListener('data', inflateOnData);\n\n  //\n  // The choice to employ `zlib.reset()` over `zlib.close()` is dictated by the\n  // fact that in Node.js versions prior to 13.10.0, the callback for\n  // `zlib.flush()` is not called if `zlib.close()` is used. Utilizing\n  // `zlib.reset()` ensures that either the callback is invoked or an error is\n  // emitted.\n  //\n  this.reset();\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'error'` event.\n *\n * @param {Error} err The emitted error\n * @private\n */\nfunction inflateOnError(err) {\n  //\n  // There is no need to call `Zlib#close()` as the handle is automatically\n  // closed when an error is emitted.\n  //\n  this[kPerMessageDeflate]._inflate = null;\n\n  if (this[kError]) {\n    this[kCallback](this[kError]);\n    return;\n  }\n\n  err[kStatusCode] = 1007;\n  this[kCallback](err);\n}\n","export default {};\nthrow new Error(`Could not resolve \"utf-8-validate\" imported by \"ws\". Is it installed?`)","'use strict';\n\nconst { isUtf8 } = require('buffer');\n\nconst { hasBlob } = require('./constants');\n\n//\n// Allowed token characters:\n//\n// '!', '#', '$', '%', '&', ''', '*', '+', '-',\n// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'\n//\n// tokenChars[32] === 0 // ' '\n// tokenChars[33] === 1 // '!'\n// tokenChars[34] === 0 // '\"'\n// ...\n//\n// prettier-ignore\nconst tokenChars = [\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31\n  0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63\n  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127\n];\n\n/**\n * Checks if a status code is allowed in a close frame.\n *\n * @param {Number} code The status code\n * @return {Boolean} `true` if the status code is valid, else `false`\n * @public\n */\nfunction isValidStatusCode(code) {\n  return (\n    (code >= 1000 &&\n      code <= 1014 &&\n      code !== 1004 &&\n      code !== 1005 &&\n      code !== 1006) ||\n    (code >= 3000 && code <= 4999)\n  );\n}\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction _isValidUTF8(buf) {\n  const len = buf.length;\n  let i = 0;\n\n  while (i < len) {\n    if ((buf[i] & 0x80) === 0) {\n      // 0xxxxxxx\n      i++;\n    } else if ((buf[i] & 0xe0) === 0xc0) {\n      // 110xxxxx 10xxxxxx\n      if (\n        i + 1 === len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i] & 0xfe) === 0xc0 // Overlong\n      ) {\n        return false;\n      }\n\n      i += 2;\n    } else if ((buf[i] & 0xf0) === 0xe0) {\n      // 1110xxxx 10xxxxxx 10xxxxxx\n      if (\n        i + 2 >= len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i + 2] & 0xc0) !== 0x80 ||\n        (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong\n        (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)\n      ) {\n        return false;\n      }\n\n      i += 3;\n    } else if ((buf[i] & 0xf8) === 0xf0) {\n      // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n      if (\n        i + 3 >= len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i + 2] & 0xc0) !== 0x80 ||\n        (buf[i + 3] & 0xc0) !== 0x80 ||\n        (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong\n        (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||\n        buf[i] > 0xf4 // > U+10FFFF\n      ) {\n        return false;\n      }\n\n      i += 4;\n    } else {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/**\n * Determines whether a value is a `Blob`.\n *\n * @param {*} value The value to be tested\n * @return {Boolean} `true` if `value` is a `Blob`, else `false`\n * @private\n */\nfunction isBlob(value) {\n  return (\n    hasBlob &&\n    typeof value === 'object' &&\n    typeof value.arrayBuffer === 'function' &&\n    typeof value.type === 'string' &&\n    typeof value.stream === 'function' &&\n    (value[Symbol.toStringTag] === 'Blob' ||\n      value[Symbol.toStringTag] === 'File')\n  );\n}\n\nmodule.exports = {\n  isBlob,\n  isValidStatusCode,\n  isValidUTF8: _isValidUTF8,\n  tokenChars\n};\n\nif (isUtf8) {\n  module.exports.isValidUTF8 = function (buf) {\n    return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);\n  };\n} /* istanbul ignore else  */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {\n  try {\n    const isValidUTF8 = require('utf-8-validate');\n\n    module.exports.isValidUTF8 = function (buf) {\n      return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);\n    };\n  } catch (e) {\n    // Continue regardless of the error.\n  }\n}\n","'use strict';\n\nconst { Writable } = require('stream');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst {\n  BINARY_TYPES,\n  EMPTY_BUFFER,\n  kStatusCode,\n  kWebSocket\n} = require('./constants');\nconst { concat, toArrayBuffer, unmask } = require('./buffer-util');\nconst { isValidStatusCode, isValidUTF8 } = require('./validation');\n\nconst FastBuffer = Buffer[Symbol.species];\n\nconst GET_INFO = 0;\nconst GET_PAYLOAD_LENGTH_16 = 1;\nconst GET_PAYLOAD_LENGTH_64 = 2;\nconst GET_MASK = 3;\nconst GET_DATA = 4;\nconst INFLATING = 5;\nconst DEFER_EVENT = 6;\n\n/**\n * HyBi Receiver implementation.\n *\n * @extends Writable\n */\nclass Receiver extends Writable {\n  /**\n   * Creates a Receiver instance.\n   *\n   * @param {Object} [options] Options object\n   * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether\n   *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted\n   *     multiple times in the same tick\n   * @param {String} [options.binaryType=nodebuffer] The type for binary data\n   * @param {Object} [options.extensions] An object containing the negotiated\n   *     extensions\n   * @param {Boolean} [options.isServer=false] Specifies whether to operate in\n   *     client or server mode\n   * @param {Number} [options.maxBufferedChunks=0] The maximum number of\n   *     buffered data chunks\n   * @param {Number} [options.maxFragments=0] The maximum number of message\n   *     fragments\n   * @param {Number} [options.maxPayload=0] The maximum allowed message length\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   */\n  constructor(options = {}) {\n    super();\n\n    this._allowSynchronousEvents =\n      options.allowSynchronousEvents !== undefined\n        ? options.allowSynchronousEvents\n        : true;\n    this._binaryType = options.binaryType || BINARY_TYPES[0];\n    this._extensions = options.extensions || {};\n    this._isServer = !!options.isServer;\n    this._maxBufferedChunks = options.maxBufferedChunks | 0;\n    this._maxFragments = options.maxFragments | 0;\n    this._maxPayload = options.maxPayload | 0;\n    this._skipUTF8Validation = !!options.skipUTF8Validation;\n    this[kWebSocket] = undefined;\n\n    this._bufferedBytes = 0;\n    this._buffers = [];\n\n    this._compressed = false;\n    this._payloadLength = 0;\n    this._mask = undefined;\n    this._fragmented = 0;\n    this._masked = false;\n    this._fin = false;\n    this._opcode = 0;\n\n    this._totalPayloadLength = 0;\n    this._messageLength = 0;\n    this._numFragments = 0;\n    this._fragments = [];\n\n    this._errored = false;\n    this._loop = false;\n    this._state = GET_INFO;\n  }\n\n  /**\n   * Implements `Writable.prototype._write()`.\n   *\n   * @param {Buffer} chunk The chunk of data to write\n   * @param {String} encoding The character encoding of `chunk`\n   * @param {Function} cb Callback\n   * @private\n   */\n  _write(chunk, encoding, cb) {\n    if (this._opcode === 0x08 && this._state == GET_INFO) return cb();\n\n    if (\n      this._maxBufferedChunks > 0 &&\n      this._buffers.length >= this._maxBufferedChunks\n    ) {\n      cb(\n        this.createError(\n          RangeError,\n          'Too many buffered chunks',\n          false,\n          1008,\n          'WS_ERR_TOO_MANY_BUFFERED_PARTS'\n        )\n      );\n      return;\n    }\n\n    this._bufferedBytes += chunk.length;\n    this._buffers.push(chunk);\n    this.startLoop(cb);\n  }\n\n  /**\n   * Consumes `n` bytes from the buffered data.\n   *\n   * @param {Number} n The number of bytes to consume\n   * @return {Buffer} The consumed bytes\n   * @private\n   */\n  consume(n) {\n    this._bufferedBytes -= n;\n\n    if (n === this._buffers[0].length) return this._buffers.shift();\n\n    if (n < this._buffers[0].length) {\n      const buf = this._buffers[0];\n      this._buffers[0] = new FastBuffer(\n        buf.buffer,\n        buf.byteOffset + n,\n        buf.length - n\n      );\n\n      return new FastBuffer(buf.buffer, buf.byteOffset, n);\n    }\n\n    const dst = Buffer.allocUnsafe(n);\n\n    do {\n      const buf = this._buffers[0];\n      const offset = dst.length - n;\n\n      if (n >= buf.length) {\n        dst.set(this._buffers.shift(), offset);\n      } else {\n        dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);\n        this._buffers[0] = new FastBuffer(\n          buf.buffer,\n          buf.byteOffset + n,\n          buf.length - n\n        );\n      }\n\n      n -= buf.length;\n    } while (n > 0);\n\n    return dst;\n  }\n\n  /**\n   * Starts the parsing loop.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  startLoop(cb) {\n    this._loop = true;\n\n    do {\n      switch (this._state) {\n        case GET_INFO:\n          this.getInfo(cb);\n          break;\n        case GET_PAYLOAD_LENGTH_16:\n          this.getPayloadLength16(cb);\n          break;\n        case GET_PAYLOAD_LENGTH_64:\n          this.getPayloadLength64(cb);\n          break;\n        case GET_MASK:\n          this.getMask();\n          break;\n        case GET_DATA:\n          this.getData(cb);\n          break;\n        case INFLATING:\n        case DEFER_EVENT:\n          this._loop = false;\n          return;\n      }\n    } while (this._loop);\n\n    if (!this._errored) cb();\n  }\n\n  /**\n   * Reads the first two bytes of a frame.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  getInfo(cb) {\n    if (this._bufferedBytes < 2) {\n      this._loop = false;\n      return;\n    }\n\n    const buf = this.consume(2);\n\n    if ((buf[0] & 0x30) !== 0x00) {\n      const error = this.createError(\n        RangeError,\n        'RSV2 and RSV3 must be clear',\n        true,\n        1002,\n        'WS_ERR_UNEXPECTED_RSV_2_3'\n      );\n\n      cb(error);\n      return;\n    }\n\n    const compressed = (buf[0] & 0x40) === 0x40;\n\n    if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n      const error = this.createError(\n        RangeError,\n        'RSV1 must be clear',\n        true,\n        1002,\n        'WS_ERR_UNEXPECTED_RSV_1'\n      );\n\n      cb(error);\n      return;\n    }\n\n    this._fin = (buf[0] & 0x80) === 0x80;\n    this._opcode = buf[0] & 0x0f;\n    this._payloadLength = buf[1] & 0x7f;\n\n    if (this._opcode === 0x00) {\n      if (compressed) {\n        const error = this.createError(\n          RangeError,\n          'RSV1 must be clear',\n          true,\n          1002,\n          'WS_ERR_UNEXPECTED_RSV_1'\n        );\n\n        cb(error);\n        return;\n      }\n\n      if (!this._fragmented) {\n        const error = this.createError(\n          RangeError,\n          'invalid opcode 0',\n          true,\n          1002,\n          'WS_ERR_INVALID_OPCODE'\n        );\n\n        cb(error);\n        return;\n      }\n\n      this._opcode = this._fragmented;\n    } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n      if (this._fragmented) {\n        const error = this.createError(\n          RangeError,\n          `invalid opcode ${this._opcode}`,\n          true,\n          1002,\n          'WS_ERR_INVALID_OPCODE'\n        );\n\n        cb(error);\n        return;\n      }\n\n      this._compressed = compressed;\n    } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n      if (!this._fin) {\n        const error = this.createError(\n          RangeError,\n          'FIN must be set',\n          true,\n          1002,\n          'WS_ERR_EXPECTED_FIN'\n        );\n\n        cb(error);\n        return;\n      }\n\n      if (compressed) {\n        const error = this.createError(\n          RangeError,\n          'RSV1 must be clear',\n          true,\n          1002,\n          'WS_ERR_UNEXPECTED_RSV_1'\n        );\n\n        cb(error);\n        return;\n      }\n\n      if (\n        this._payloadLength > 0x7d ||\n        (this._opcode === 0x08 && this._payloadLength === 1)\n      ) {\n        const error = this.createError(\n          RangeError,\n          `invalid payload length ${this._payloadLength}`,\n          true,\n          1002,\n          'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'\n        );\n\n        cb(error);\n        return;\n      }\n    } else {\n      const error = this.createError(\n        RangeError,\n        `invalid opcode ${this._opcode}`,\n        true,\n        1002,\n        'WS_ERR_INVALID_OPCODE'\n      );\n\n      cb(error);\n      return;\n    }\n\n    if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n    this._masked = (buf[1] & 0x80) === 0x80;\n\n    if (this._isServer) {\n      if (!this._masked) {\n        const error = this.createError(\n          RangeError,\n          'MASK must be set',\n          true,\n          1002,\n          'WS_ERR_EXPECTED_MASK'\n        );\n\n        cb(error);\n        return;\n      }\n    } else if (this._masked) {\n      const error = this.createError(\n        RangeError,\n        'MASK must be clear',\n        true,\n        1002,\n        'WS_ERR_UNEXPECTED_MASK'\n      );\n\n      cb(error);\n      return;\n    }\n\n    if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n    else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n    else this.haveLength(cb);\n  }\n\n  /**\n   * Gets extended payload length (7+16).\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  getPayloadLength16(cb) {\n    if (this._bufferedBytes < 2) {\n      this._loop = false;\n      return;\n    }\n\n    this._payloadLength = this.consume(2).readUInt16BE(0);\n    this.haveLength(cb);\n  }\n\n  /**\n   * Gets extended payload length (7+64).\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  getPayloadLength64(cb) {\n    if (this._bufferedBytes < 8) {\n      this._loop = false;\n      return;\n    }\n\n    const buf = this.consume(8);\n    const num = buf.readUInt32BE(0);\n\n    //\n    // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n    // if payload length is greater than this number.\n    //\n    if (num > Math.pow(2, 53 - 32) - 1) {\n      const error = this.createError(\n        RangeError,\n        'Unsupported WebSocket frame: payload length > 2^53 - 1',\n        false,\n        1009,\n        'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'\n      );\n\n      cb(error);\n      return;\n    }\n\n    this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);\n    this.haveLength(cb);\n  }\n\n  /**\n   * Payload length has been read.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  haveLength(cb) {\n    if (this._payloadLength && this._opcode < 0x08) {\n      this._totalPayloadLength += this._payloadLength;\n      if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {\n        const error = this.createError(\n          RangeError,\n          'Max payload size exceeded',\n          false,\n          1009,\n          'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n        );\n\n        cb(error);\n        return;\n      }\n    }\n\n    if (this._masked) this._state = GET_MASK;\n    else this._state = GET_DATA;\n  }\n\n  /**\n   * Reads mask bytes.\n   *\n   * @private\n   */\n  getMask() {\n    if (this._bufferedBytes < 4) {\n      this._loop = false;\n      return;\n    }\n\n    this._mask = this.consume(4);\n    this._state = GET_DATA;\n  }\n\n  /**\n   * Reads data bytes.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  getData(cb) {\n    let data = EMPTY_BUFFER;\n\n    if (this._payloadLength) {\n      if (this._bufferedBytes < this._payloadLength) {\n        this._loop = false;\n        return;\n      }\n\n      data = this.consume(this._payloadLength);\n\n      if (\n        this._masked &&\n        (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0\n      ) {\n        unmask(data, this._mask);\n      }\n    }\n\n    if (this._opcode > 0x07) {\n      this.controlMessage(data, cb);\n      return;\n    }\n\n    if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {\n      const error = this.createError(\n        RangeError,\n        'Too many message fragments',\n        false,\n        1008,\n        'WS_ERR_TOO_MANY_BUFFERED_PARTS'\n      );\n\n      cb(error);\n      return;\n    }\n\n    if (this._compressed) {\n      this._state = INFLATING;\n      this.decompress(data, cb);\n      return;\n    }\n\n    if (data.length) {\n      //\n      // This message is not compressed so its length is the sum of the payload\n      // length of all fragments.\n      //\n      this._messageLength = this._totalPayloadLength;\n      this._fragments.push(data);\n    }\n\n    this.dataMessage(cb);\n  }\n\n  /**\n   * Decompresses data.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Function} cb Callback\n   * @private\n   */\n  decompress(data, cb) {\n    const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n    perMessageDeflate.decompress(data, this._fin, (err, buf) => {\n      if (err) return cb(err);\n\n      if (buf.length) {\n        this._messageLength += buf.length;\n        if (this._messageLength > this._maxPayload && this._maxPayload > 0) {\n          const error = this.createError(\n            RangeError,\n            'Max payload size exceeded',\n            false,\n            1009,\n            'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n          );\n\n          cb(error);\n          return;\n        }\n\n        this._fragments.push(buf);\n      }\n\n      this.dataMessage(cb);\n      if (this._state === GET_INFO) this.startLoop(cb);\n    });\n  }\n\n  /**\n   * Handles a data message.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  dataMessage(cb) {\n    if (!this._fin) {\n      this._state = GET_INFO;\n      return;\n    }\n\n    const messageLength = this._messageLength;\n    const fragments = this._fragments;\n\n    this._totalPayloadLength = 0;\n    this._messageLength = 0;\n    this._fragmented = 0;\n    this._numFragments = 0;\n    this._fragments = [];\n\n    if (this._opcode === 2) {\n      let data;\n\n      if (this._binaryType === 'nodebuffer') {\n        data = concat(fragments, messageLength);\n      } else if (this._binaryType === 'arraybuffer') {\n        data = toArrayBuffer(concat(fragments, messageLength));\n      } else if (this._binaryType === 'blob') {\n        data = new Blob(fragments);\n      } else {\n        data = fragments;\n      }\n\n      if (this._allowSynchronousEvents) {\n        this.emit('message', data, true);\n        this._state = GET_INFO;\n      } else {\n        this._state = DEFER_EVENT;\n        setImmediate(() => {\n          this.emit('message', data, true);\n          this._state = GET_INFO;\n          this.startLoop(cb);\n        });\n      }\n    } else {\n      const buf = concat(fragments, messageLength);\n\n      if (!this._skipUTF8Validation && !isValidUTF8(buf)) {\n        const error = this.createError(\n          Error,\n          'invalid UTF-8 sequence',\n          true,\n          1007,\n          'WS_ERR_INVALID_UTF8'\n        );\n\n        cb(error);\n        return;\n      }\n\n      if (this._state === INFLATING || this._allowSynchronousEvents) {\n        this.emit('message', buf, false);\n        this._state = GET_INFO;\n      } else {\n        this._state = DEFER_EVENT;\n        setImmediate(() => {\n          this.emit('message', buf, false);\n          this._state = GET_INFO;\n          this.startLoop(cb);\n        });\n      }\n    }\n  }\n\n  /**\n   * Handles a control message.\n   *\n   * @param {Buffer} data Data to handle\n   * @return {(Error|RangeError|undefined)} A possible error\n   * @private\n   */\n  controlMessage(data, cb) {\n    if (this._opcode === 0x08) {\n      if (data.length === 0) {\n        this._loop = false;\n        this.emit('conclude', 1005, EMPTY_BUFFER);\n        this.end();\n      } else {\n        const code = data.readUInt16BE(0);\n\n        if (!isValidStatusCode(code)) {\n          const error = this.createError(\n            RangeError,\n            `invalid status code ${code}`,\n            true,\n            1002,\n            'WS_ERR_INVALID_CLOSE_CODE'\n          );\n\n          cb(error);\n          return;\n        }\n\n        const buf = new FastBuffer(\n          data.buffer,\n          data.byteOffset + 2,\n          data.length - 2\n        );\n\n        if (!this._skipUTF8Validation && !isValidUTF8(buf)) {\n          const error = this.createError(\n            Error,\n            'invalid UTF-8 sequence',\n            true,\n            1007,\n            'WS_ERR_INVALID_UTF8'\n          );\n\n          cb(error);\n          return;\n        }\n\n        this._loop = false;\n        this.emit('conclude', code, buf);\n        this.end();\n      }\n\n      this._state = GET_INFO;\n      return;\n    }\n\n    if (this._allowSynchronousEvents) {\n      this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);\n      this._state = GET_INFO;\n    } else {\n      this._state = DEFER_EVENT;\n      setImmediate(() => {\n        this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);\n        this._state = GET_INFO;\n        this.startLoop(cb);\n      });\n    }\n  }\n\n  /**\n   * Builds an error object.\n   *\n   * @param {function(new:Error|RangeError)} ErrorCtor The error constructor\n   * @param {String} message The error message\n   * @param {Boolean} prefix Specifies whether or not to add a default prefix to\n   *     `message`\n   * @param {Number} statusCode The status code\n   * @param {String} errorCode The exposed error code\n   * @return {(Error|RangeError)} The error\n   * @private\n   */\n  createError(ErrorCtor, message, prefix, statusCode, errorCode) {\n    this._loop = false;\n    this._errored = true;\n\n    const err = new ErrorCtor(\n      prefix ? `Invalid WebSocket frame: ${message}` : message\n    );\n\n    Error.captureStackTrace(err, this.createError);\n    err.code = errorCode;\n    err[kStatusCode] = statusCode;\n    return err;\n  }\n}\n\nmodule.exports = Receiver;\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Duplex\" }] */\n\n'use strict';\n\nconst { Duplex } = require('stream');\nconst { randomFillSync } = require('crypto');\nconst {\n  types: { isUint8Array }\n} = require('util');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst { EMPTY_BUFFER, kWebSocket, NOOP } = require('./constants');\nconst { isBlob, isValidStatusCode } = require('./validation');\nconst { mask: applyMask, toBuffer } = require('./buffer-util');\n\nconst kByteLength = Symbol('kByteLength');\nconst maskBuffer = Buffer.alloc(4);\nconst RANDOM_POOL_SIZE = 8 * 1024;\nlet randomPool;\nlet randomPoolPointer = RANDOM_POOL_SIZE;\n\nconst DEFAULT = 0;\nconst DEFLATING = 1;\nconst GET_BLOB_DATA = 2;\n\n/**\n * HyBi Sender implementation.\n */\nclass Sender {\n  /**\n   * Creates a Sender instance.\n   *\n   * @param {Duplex} socket The connection socket\n   * @param {Object} [extensions] An object containing the negotiated extensions\n   * @param {Function} [generateMask] The function used to generate the masking\n   *     key\n   */\n  constructor(socket, extensions, generateMask) {\n    this._extensions = extensions || {};\n\n    if (generateMask) {\n      this._generateMask = generateMask;\n      this._maskBuffer = Buffer.alloc(4);\n    }\n\n    this._socket = socket;\n\n    this._firstFragment = true;\n    this._compress = false;\n\n    this._bufferedBytes = 0;\n    this._queue = [];\n    this._state = DEFAULT;\n    this.onerror = NOOP;\n    this[kWebSocket] = undefined;\n  }\n\n  /**\n   * Frames a piece of data according to the HyBi WebSocket protocol.\n   *\n   * @param {(Buffer|String)} data The data to frame\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @return {(Buffer|String)[]} The framed data\n   * @public\n   */\n  static frame(data, options) {\n    let mask;\n    let merge = false;\n    let offset = 2;\n    let skipMasking = false;\n\n    if (options.mask) {\n      mask = options.maskBuffer || maskBuffer;\n\n      if (options.generateMask) {\n        options.generateMask(mask);\n      } else {\n        if (randomPoolPointer === RANDOM_POOL_SIZE) {\n          /* istanbul ignore else  */\n          if (randomPool === undefined) {\n            //\n            // This is lazily initialized because server-sent frames must not\n            // be masked so it may never be used.\n            //\n            randomPool = Buffer.alloc(RANDOM_POOL_SIZE);\n          }\n\n          randomFillSync(randomPool, 0, RANDOM_POOL_SIZE);\n          randomPoolPointer = 0;\n        }\n\n        mask[0] = randomPool[randomPoolPointer++];\n        mask[1] = randomPool[randomPoolPointer++];\n        mask[2] = randomPool[randomPoolPointer++];\n        mask[3] = randomPool[randomPoolPointer++];\n      }\n\n      skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0;\n      offset = 6;\n    }\n\n    let dataLength;\n\n    if (typeof data === 'string') {\n      if (\n        (!options.mask || skipMasking) &&\n        options[kByteLength] !== undefined\n      ) {\n        dataLength = options[kByteLength];\n      } else {\n        data = Buffer.from(data);\n        dataLength = data.length;\n      }\n    } else {\n      dataLength = data.length;\n      merge = options.mask && options.readOnly && !skipMasking;\n    }\n\n    let payloadLength = dataLength;\n\n    if (dataLength >= 65536) {\n      offset += 8;\n      payloadLength = 127;\n    } else if (dataLength > 125) {\n      offset += 2;\n      payloadLength = 126;\n    }\n\n    const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);\n\n    target[0] = options.fin ? options.opcode | 0x80 : options.opcode;\n    if (options.rsv1) target[0] |= 0x40;\n\n    target[1] = payloadLength;\n\n    if (payloadLength === 126) {\n      target.writeUInt16BE(dataLength, 2);\n    } else if (payloadLength === 127) {\n      target[2] = target[3] = 0;\n      target.writeUIntBE(dataLength, 4, 6);\n    }\n\n    if (!options.mask) return [target, data];\n\n    target[1] |= 0x80;\n    target[offset - 4] = mask[0];\n    target[offset - 3] = mask[1];\n    target[offset - 2] = mask[2];\n    target[offset - 1] = mask[3];\n\n    if (skipMasking) return [target, data];\n\n    if (merge) {\n      applyMask(data, mask, target, offset, dataLength);\n      return [target];\n    }\n\n    applyMask(data, mask, data, 0, dataLength);\n    return [target, data];\n  }\n\n  /**\n   * Sends a close message to the other peer.\n   *\n   * @param {Number} [code] The status code component of the body\n   * @param {(String|Buffer)} [data] The message component of the body\n   * @param {Boolean} [mask=false] Specifies whether or not to mask the message\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  close(code, data, mask, cb) {\n    let buf;\n\n    if (code === undefined) {\n      buf = EMPTY_BUFFER;\n    } else if (typeof code !== 'number' || !isValidStatusCode(code)) {\n      throw new TypeError('First argument must be a valid error code number');\n    } else if (data === undefined || !data.length) {\n      buf = Buffer.allocUnsafe(2);\n      buf.writeUInt16BE(code, 0);\n    } else {\n      const length = Buffer.byteLength(data);\n\n      if (length > 123) {\n        throw new RangeError('The message must not be greater than 123 bytes');\n      }\n\n      buf = Buffer.allocUnsafe(2 + length);\n      buf.writeUInt16BE(code, 0);\n\n      if (typeof data === 'string') {\n        buf.write(data, 2);\n      } else if (isUint8Array(data)) {\n        buf.set(data, 2);\n      } else {\n        throw new TypeError('Second argument must be a string or a Uint8Array');\n      }\n    }\n\n    const options = {\n      [kByteLength]: buf.length,\n      fin: true,\n      generateMask: this._generateMask,\n      mask,\n      maskBuffer: this._maskBuffer,\n      opcode: 0x08,\n      readOnly: false,\n      rsv1: false\n    };\n\n    if (this._state !== DEFAULT) {\n      this.enqueue([this.dispatch, buf, false, options, cb]);\n    } else {\n      this.sendFrame(Sender.frame(buf, options), cb);\n    }\n  }\n\n  /**\n   * Sends a ping message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  ping(data, mask, cb) {\n    let byteLength;\n    let readOnly;\n\n    if (typeof data === 'string') {\n      byteLength = Buffer.byteLength(data);\n      readOnly = false;\n    } else if (isBlob(data)) {\n      byteLength = data.size;\n      readOnly = false;\n    } else {\n      data = toBuffer(data);\n      byteLength = data.length;\n      readOnly = toBuffer.readOnly;\n    }\n\n    if (byteLength > 125) {\n      throw new RangeError('The data size must not be greater than 125 bytes');\n    }\n\n    const options = {\n      [kByteLength]: byteLength,\n      fin: true,\n      generateMask: this._generateMask,\n      mask,\n      maskBuffer: this._maskBuffer,\n      opcode: 0x09,\n      readOnly,\n      rsv1: false\n    };\n\n    if (isBlob(data)) {\n      if (this._state !== DEFAULT) {\n        this.enqueue([this.getBlobData, data, false, options, cb]);\n      } else {\n        this.getBlobData(data, false, options, cb);\n      }\n    } else if (this._state !== DEFAULT) {\n      this.enqueue([this.dispatch, data, false, options, cb]);\n    } else {\n      this.sendFrame(Sender.frame(data, options), cb);\n    }\n  }\n\n  /**\n   * Sends a pong message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  pong(data, mask, cb) {\n    let byteLength;\n    let readOnly;\n\n    if (typeof data === 'string') {\n      byteLength = Buffer.byteLength(data);\n      readOnly = false;\n    } else if (isBlob(data)) {\n      byteLength = data.size;\n      readOnly = false;\n    } else {\n      data = toBuffer(data);\n      byteLength = data.length;\n      readOnly = toBuffer.readOnly;\n    }\n\n    if (byteLength > 125) {\n      throw new RangeError('The data size must not be greater than 125 bytes');\n    }\n\n    const options = {\n      [kByteLength]: byteLength,\n      fin: true,\n      generateMask: this._generateMask,\n      mask,\n      maskBuffer: this._maskBuffer,\n      opcode: 0x0a,\n      readOnly,\n      rsv1: false\n    };\n\n    if (isBlob(data)) {\n      if (this._state !== DEFAULT) {\n        this.enqueue([this.getBlobData, data, false, options, cb]);\n      } else {\n        this.getBlobData(data, false, options, cb);\n      }\n    } else if (this._state !== DEFAULT) {\n      this.enqueue([this.dispatch, data, false, options, cb]);\n    } else {\n      this.sendFrame(Sender.frame(data, options), cb);\n    }\n  }\n\n  /**\n   * Sends a data message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Object} options Options object\n   * @param {Boolean} [options.binary=false] Specifies whether `data` is binary\n   *     or text\n   * @param {Boolean} [options.compress=false] Specifies whether or not to\n   *     compress `data`\n   * @param {Boolean} [options.fin=false] Specifies whether the fragment is the\n   *     last one\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  send(data, options, cb) {\n    const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n    let opcode = options.binary ? 2 : 1;\n    let rsv1 = options.compress;\n\n    let byteLength;\n    let readOnly;\n\n    if (typeof data === 'string') {\n      byteLength = Buffer.byteLength(data);\n      readOnly = false;\n    } else if (isBlob(data)) {\n      byteLength = data.size;\n      readOnly = false;\n    } else {\n      data = toBuffer(data);\n      byteLength = data.length;\n      readOnly = toBuffer.readOnly;\n    }\n\n    if (this._firstFragment) {\n      this._firstFragment = false;\n      if (\n        rsv1 &&\n        perMessageDeflate &&\n        perMessageDeflate.params[\n          perMessageDeflate._isServer\n            ? 'server_no_context_takeover'\n            : 'client_no_context_takeover'\n        ]\n      ) {\n        rsv1 = byteLength >= perMessageDeflate._threshold;\n      }\n      this._compress = rsv1;\n    } else {\n      rsv1 = false;\n      opcode = 0;\n    }\n\n    if (options.fin) this._firstFragment = true;\n\n    const opts = {\n      [kByteLength]: byteLength,\n      fin: options.fin,\n      generateMask: this._generateMask,\n      mask: options.mask,\n      maskBuffer: this._maskBuffer,\n      opcode,\n      readOnly,\n      rsv1\n    };\n\n    if (isBlob(data)) {\n      if (this._state !== DEFAULT) {\n        this.enqueue([this.getBlobData, data, this._compress, opts, cb]);\n      } else {\n        this.getBlobData(data, this._compress, opts, cb);\n      }\n    } else if (this._state !== DEFAULT) {\n      this.enqueue([this.dispatch, data, this._compress, opts, cb]);\n    } else {\n      this.dispatch(data, this._compress, opts, cb);\n    }\n  }\n\n  /**\n   * Gets the contents of a blob as binary data.\n   *\n   * @param {Blob} blob The blob\n   * @param {Boolean} [compress=false] Specifies whether or not to compress\n   *     the data\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  getBlobData(blob, compress, options, cb) {\n    this._bufferedBytes += options[kByteLength];\n    this._state = GET_BLOB_DATA;\n\n    blob\n      .arrayBuffer()\n      .then((arrayBuffer) => {\n        if (this._socket.destroyed) {\n          const err = new Error(\n            'The socket was closed while the blob was being read'\n          );\n\n          //\n          // `callCallbacks` is called in the next tick to ensure that errors\n          // that might be thrown in the callbacks behave like errors thrown\n          // outside the promise chain.\n          //\n          process.nextTick(callCallbacks, this, err, cb);\n          return;\n        }\n\n        this._bufferedBytes -= options[kByteLength];\n        const data = toBuffer(arrayBuffer);\n\n        if (!compress) {\n          this._state = DEFAULT;\n          this.sendFrame(Sender.frame(data, options), cb);\n          this.dequeue();\n        } else {\n          this.dispatch(data, compress, options, cb);\n        }\n      })\n      .catch((err) => {\n        //\n        // `onError` is called in the next tick for the same reason that\n        // `callCallbacks` above is.\n        //\n        process.nextTick(onError, this, err, cb);\n      });\n  }\n\n  /**\n   * Dispatches a message.\n   *\n   * @param {(Buffer|String)} data The message to send\n   * @param {Boolean} [compress=false] Specifies whether or not to compress\n   *     `data`\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  dispatch(data, compress, options, cb) {\n    if (!compress) {\n      this.sendFrame(Sender.frame(data, options), cb);\n      return;\n    }\n\n    const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n    this._bufferedBytes += options[kByteLength];\n    this._state = DEFLATING;\n    perMessageDeflate.compress(data, options.fin, (_, buf) => {\n      if (this._socket.destroyed) {\n        const err = new Error(\n          'The socket was closed while data was being compressed'\n        );\n\n        callCallbacks(this, err, cb);\n        return;\n      }\n\n      this._bufferedBytes -= options[kByteLength];\n      this._state = DEFAULT;\n      options.readOnly = false;\n      this.sendFrame(Sender.frame(buf, options), cb);\n      this.dequeue();\n    });\n  }\n\n  /**\n   * Executes queued send operations.\n   *\n   * @private\n   */\n  dequeue() {\n    while (this._state === DEFAULT && this._queue.length) {\n      const params = this._queue.shift();\n\n      this._bufferedBytes -= params[3][kByteLength];\n      Reflect.apply(params[0], this, params.slice(1));\n    }\n  }\n\n  /**\n   * Enqueues a send operation.\n   *\n   * @param {Array} params Send operation parameters.\n   * @private\n   */\n  enqueue(params) {\n    this._bufferedBytes += params[3][kByteLength];\n    this._queue.push(params);\n  }\n\n  /**\n   * Sends a frame.\n   *\n   * @param {(Buffer | String)[]} list The frame to send\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  sendFrame(list, cb) {\n    if (list.length === 2) {\n      this._socket.cork();\n      this._socket.write(list[0]);\n      this._socket.write(list[1], cb);\n      this._socket.uncork();\n    } else {\n      this._socket.write(list[0], cb);\n    }\n  }\n}\n\nmodule.exports = Sender;\n\n/**\n * Calls queued callbacks with an error.\n *\n * @param {Sender} sender The `Sender` instance\n * @param {Error} err The error to call the callbacks with\n * @param {Function} [cb] The first callback\n * @private\n */\nfunction callCallbacks(sender, err, cb) {\n  if (typeof cb === 'function') cb(err);\n\n  for (let i = 0; i < sender._queue.length; i++) {\n    const params = sender._queue[i];\n    const callback = params[params.length - 1];\n\n    if (typeof callback === 'function') callback(err);\n  }\n}\n\n/**\n * Handles a `Sender` error.\n *\n * @param {Sender} sender The `Sender` instance\n * @param {Error} err The error\n * @param {Function} [cb] The first pending callback\n * @private\n */\nfunction onError(sender, err, cb) {\n  callCallbacks(sender, err, cb);\n  sender.onerror(err);\n}\n","'use strict';\n\nconst { kForOnEventAttribute, kListener } = require('./constants');\n\nconst kCode = Symbol('kCode');\nconst kData = Symbol('kData');\nconst kError = Symbol('kError');\nconst kMessage = Symbol('kMessage');\nconst kReason = Symbol('kReason');\nconst kTarget = Symbol('kTarget');\nconst kType = Symbol('kType');\nconst kWasClean = Symbol('kWasClean');\n\n/**\n * Class representing an event.\n */\nclass Event {\n  /**\n   * Create a new `Event`.\n   *\n   * @param {String} type The name of the event\n   * @throws {TypeError} If the `type` argument is not specified\n   */\n  constructor(type) {\n    this[kTarget] = null;\n    this[kType] = type;\n  }\n\n  /**\n   * @type {*}\n   */\n  get target() {\n    return this[kTarget];\n  }\n\n  /**\n   * @type {String}\n   */\n  get type() {\n    return this[kType];\n  }\n}\n\nObject.defineProperty(Event.prototype, 'target', { enumerable: true });\nObject.defineProperty(Event.prototype, 'type', { enumerable: true });\n\n/**\n * Class representing a close event.\n *\n * @extends Event\n */\nclass CloseEvent extends Event {\n  /**\n   * Create a new `CloseEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {Number} [options.code=0] The status code explaining why the\n   *     connection was closed\n   * @param {String} [options.reason=''] A human-readable string explaining why\n   *     the connection was closed\n   * @param {Boolean} [options.wasClean=false] Indicates whether or not the\n   *     connection was cleanly closed\n   */\n  constructor(type, options = {}) {\n    super(type);\n\n    this[kCode] = options.code === undefined ? 0 : options.code;\n    this[kReason] = options.reason === undefined ? '' : options.reason;\n    this[kWasClean] = options.wasClean === undefined ? false : options.wasClean;\n  }\n\n  /**\n   * @type {Number}\n   */\n  get code() {\n    return this[kCode];\n  }\n\n  /**\n   * @type {String}\n   */\n  get reason() {\n    return this[kReason];\n  }\n\n  /**\n   * @type {Boolean}\n   */\n  get wasClean() {\n    return this[kWasClean];\n  }\n}\n\nObject.defineProperty(CloseEvent.prototype, 'code', { enumerable: true });\nObject.defineProperty(CloseEvent.prototype, 'reason', { enumerable: true });\nObject.defineProperty(CloseEvent.prototype, 'wasClean', { enumerable: true });\n\n/**\n * Class representing an error event.\n *\n * @extends Event\n */\nclass ErrorEvent extends Event {\n  /**\n   * Create a new `ErrorEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {*} [options.error=null] The error that generated this event\n   * @param {String} [options.message=''] The error message\n   */\n  constructor(type, options = {}) {\n    super(type);\n\n    this[kError] = options.error === undefined ? null : options.error;\n    this[kMessage] = options.message === undefined ? '' : options.message;\n  }\n\n  /**\n   * @type {*}\n   */\n  get error() {\n    return this[kError];\n  }\n\n  /**\n   * @type {String}\n   */\n  get message() {\n    return this[kMessage];\n  }\n}\n\nObject.defineProperty(ErrorEvent.prototype, 'error', { enumerable: true });\nObject.defineProperty(ErrorEvent.prototype, 'message', { enumerable: true });\n\n/**\n * Class representing a message event.\n *\n * @extends Event\n */\nclass MessageEvent extends Event {\n  /**\n   * Create a new `MessageEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {*} [options.data=null] The message content\n   */\n  constructor(type, options = {}) {\n    super(type);\n\n    this[kData] = options.data === undefined ? null : options.data;\n  }\n\n  /**\n   * @type {*}\n   */\n  get data() {\n    return this[kData];\n  }\n}\n\nObject.defineProperty(MessageEvent.prototype, 'data', { enumerable: true });\n\n/**\n * This provides methods for emulating the `EventTarget` interface. It's not\n * meant to be used directly.\n *\n * @mixin\n */\nconst EventTarget = {\n  /**\n   * Register an event listener.\n   *\n   * @param {String} type A string representing the event type to listen for\n   * @param {(Function|Object)} handler The listener to add\n   * @param {Object} [options] An options object specifies characteristics about\n   *     the event listener\n   * @param {Boolean} [options.once=false] A `Boolean` indicating that the\n   *     listener should be invoked at most once after being added. If `true`,\n   *     the listener would be automatically removed when invoked.\n   * @public\n   */\n  addEventListener(type, handler, options = {}) {\n    for (const listener of this.listeners(type)) {\n      if (\n        !options[kForOnEventAttribute] &&\n        listener[kListener] === handler &&\n        !listener[kForOnEventAttribute]\n      ) {\n        return;\n      }\n    }\n\n    let wrapper;\n\n    if (type === 'message') {\n      wrapper = function onMessage(data, isBinary) {\n        const event = new MessageEvent('message', {\n          data: isBinary ? data : data.toString()\n        });\n\n        event[kTarget] = this;\n        callListener(handler, this, event);\n      };\n    } else if (type === 'close') {\n      wrapper = function onClose(code, message) {\n        const event = new CloseEvent('close', {\n          code,\n          reason: message.toString(),\n          wasClean: this._closeFrameReceived && this._closeFrameSent\n        });\n\n        event[kTarget] = this;\n        callListener(handler, this, event);\n      };\n    } else if (type === 'error') {\n      wrapper = function onError(error) {\n        const event = new ErrorEvent('error', {\n          error,\n          message: error.message\n        });\n\n        event[kTarget] = this;\n        callListener(handler, this, event);\n      };\n    } else if (type === 'open') {\n      wrapper = function onOpen() {\n        const event = new Event('open');\n\n        event[kTarget] = this;\n        callListener(handler, this, event);\n      };\n    } else {\n      return;\n    }\n\n    wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];\n    wrapper[kListener] = handler;\n\n    if (options.once) {\n      this.once(type, wrapper);\n    } else {\n      this.on(type, wrapper);\n    }\n  },\n\n  /**\n   * Remove an event listener.\n   *\n   * @param {String} type A string representing the event type to remove\n   * @param {(Function|Object)} handler The listener to remove\n   * @public\n   */\n  removeEventListener(type, handler) {\n    for (const listener of this.listeners(type)) {\n      if (listener[kListener] === handler && !listener[kForOnEventAttribute]) {\n        this.removeListener(type, listener);\n        break;\n      }\n    }\n  }\n};\n\nmodule.exports = {\n  CloseEvent,\n  ErrorEvent,\n  Event,\n  EventTarget,\n  MessageEvent\n};\n\n/**\n * Call an event listener\n *\n * @param {(Function|Object)} listener The listener to call\n * @param {*} thisArg The value to use as `this`` when calling the listener\n * @param {Event} event The event to pass to the listener\n * @private\n */\nfunction callListener(listener, thisArg, event) {\n  if (typeof listener === 'object' && listener.handleEvent) {\n    listener.handleEvent.call(listener, event);\n  } else {\n    listener.call(thisArg, event);\n  }\n}\n","'use strict';\n\nconst { tokenChars } = require('./validation');\n\n/**\n * Adds an offer to the map of extension offers or a parameter to the map of\n * parameters.\n *\n * @param {Object} dest The map of extension offers or parameters\n * @param {String} name The extension or parameter name\n * @param {(Object|Boolean|String)} elem The extension parameters or the\n *     parameter value\n * @private\n */\nfunction push(dest, name, elem) {\n  if (dest[name] === undefined) dest[name] = [elem];\n  else dest[name].push(elem);\n}\n\n/**\n * Parses the `Sec-WebSocket-Extensions` header into an object.\n *\n * @param {String} header The field value of the header\n * @return {Object} The parsed object\n * @public\n */\nfunction parse(header) {\n  const offers = Object.create(null);\n  let params = Object.create(null);\n  let mustUnescape = false;\n  let isEscaping = false;\n  let inQuotes = false;\n  let extensionName;\n  let paramName;\n  let start = -1;\n  let code = -1;\n  let end = -1;\n  let i = 0;\n\n  for (; i < header.length; i++) {\n    code = header.charCodeAt(i);\n\n    if (extensionName === undefined) {\n      if (end === -1 && tokenChars[code] === 1) {\n        if (start === -1) start = i;\n      } else if (\n        i !== 0 &&\n        (code === 0x20 /* ' ' */ || code === 0x09) /* '\\t' */\n      ) {\n        if (end === -1 && start !== -1) end = i;\n      } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {\n        if (start === -1) {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n\n        if (end === -1) end = i;\n        const name = header.slice(start, end);\n        if (code === 0x2c) {\n          push(offers, name, params);\n          params = Object.create(null);\n        } else {\n          extensionName = name;\n        }\n\n        start = end = -1;\n      } else {\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      }\n    } else if (paramName === undefined) {\n      if (end === -1 && tokenChars[code] === 1) {\n        if (start === -1) start = i;\n      } else if (code === 0x20 || code === 0x09) {\n        if (end === -1 && start !== -1) end = i;\n      } else if (code === 0x3b || code === 0x2c) {\n        if (start === -1) {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n\n        if (end === -1) end = i;\n        push(params, header.slice(start, end), true);\n        if (code === 0x2c) {\n          push(offers, extensionName, params);\n          params = Object.create(null);\n          extensionName = undefined;\n        }\n\n        start = end = -1;\n      } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {\n        paramName = header.slice(start, i);\n        start = end = -1;\n      } else {\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      }\n    } else {\n      //\n      // The value of a quoted-string after unescaping must conform to the\n      // token ABNF, so only token characters are valid.\n      // Ref: https://tools.ietf.org/html/rfc6455#section-9.1\n      //\n      if (isEscaping) {\n        if (tokenChars[code] !== 1) {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n        if (start === -1) start = i;\n        else if (!mustUnescape) mustUnescape = true;\n        isEscaping = false;\n      } else if (inQuotes) {\n        if (tokenChars[code] === 1) {\n          if (start === -1) start = i;\n        } else if (code === 0x22 /* '\"' */ && start !== -1) {\n          inQuotes = false;\n          end = i;\n        } else if (code === 0x5c /* '\\' */) {\n          isEscaping = true;\n        } else {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n      } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {\n        inQuotes = true;\n      } else if (end === -1 && tokenChars[code] === 1) {\n        if (start === -1) start = i;\n      } else if (start !== -1 && (code === 0x20 || code === 0x09)) {\n        if (end === -1) end = i;\n      } else if (code === 0x3b || code === 0x2c) {\n        if (start === -1) {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n\n        if (end === -1) end = i;\n        let value = header.slice(start, end);\n        if (mustUnescape) {\n          value = value.replace(/\\\\/g, '');\n          mustUnescape = false;\n        }\n        push(params, paramName, value);\n        if (code === 0x2c) {\n          push(offers, extensionName, params);\n          params = Object.create(null);\n          extensionName = undefined;\n        }\n\n        paramName = undefined;\n        start = end = -1;\n      } else {\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      }\n    }\n  }\n\n  if (start === -1 || inQuotes || code === 0x20 || code === 0x09) {\n    throw new SyntaxError('Unexpected end of input');\n  }\n\n  if (end === -1) end = i;\n  const token = header.slice(start, end);\n  if (extensionName === undefined) {\n    push(offers, token, params);\n  } else {\n    if (paramName === undefined) {\n      push(params, token, true);\n    } else if (mustUnescape) {\n      push(params, paramName, token.replace(/\\\\/g, ''));\n    } else {\n      push(params, paramName, token);\n    }\n    push(offers, extensionName, params);\n  }\n\n  return offers;\n}\n\n/**\n * Builds the `Sec-WebSocket-Extensions` header field value.\n *\n * @param {Object} extensions The map of extensions and parameters to format\n * @return {String} A string representing the given object\n * @public\n */\nfunction format(extensions) {\n  return Object.keys(extensions)\n    .map((extension) => {\n      let configurations = extensions[extension];\n      if (!Array.isArray(configurations)) configurations = [configurations];\n      return configurations\n        .map((params) => {\n          return [extension]\n            .concat(\n              Object.keys(params).map((k) => {\n                let values = params[k];\n                if (!Array.isArray(values)) values = [values];\n                return values\n                  .map((v) => (v === true ? k : `${k}=${v}`))\n                  .join('; ');\n              })\n            )\n            .join('; ');\n        })\n        .join(', ');\n    })\n    .join(', ');\n}\n\nmodule.exports = { format, parse };\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Duplex|Readable$\", \"caughtErrors\": \"none\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst https = require('https');\nconst http = require('http');\nconst net = require('net');\nconst tls = require('tls');\nconst { randomBytes, createHash } = require('crypto');\nconst { Duplex, Readable } = require('stream');\nconst { URL } = require('url');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst Receiver = require('./receiver');\nconst Sender = require('./sender');\nconst { isBlob } = require('./validation');\n\nconst {\n  BINARY_TYPES,\n  CLOSE_TIMEOUT,\n  EMPTY_BUFFER,\n  GUID,\n  kForOnEventAttribute,\n  kListener,\n  kStatusCode,\n  kWebSocket,\n  NOOP\n} = require('./constants');\nconst {\n  EventTarget: { addEventListener, removeEventListener }\n} = require('./event-target');\nconst { format, parse } = require('./extension');\nconst { toBuffer } = require('./buffer-util');\n\nconst kAborted = Symbol('kAborted');\nconst protocolVersions = [8, 13];\nconst readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];\nconst subprotocolRegex = /^[!#$%&'*+\\-.0-9A-Z^_`|a-z~]+$/;\n\n/**\n * Class representing a WebSocket.\n *\n * @extends EventEmitter\n */\nclass WebSocket extends EventEmitter {\n  /**\n   * Create a new `WebSocket`.\n   *\n   * @param {(String|URL)} address The URL to which to connect\n   * @param {(String|String[])} [protocols] The subprotocols\n   * @param {Object} [options] Connection options\n   */\n  constructor(address, protocols, options) {\n    super();\n\n    this._binaryType = BINARY_TYPES[0];\n    this._closeCode = 1006;\n    this._closeFrameReceived = false;\n    this._closeFrameSent = false;\n    this._closeMessage = EMPTY_BUFFER;\n    this._closeTimer = null;\n    this._errorEmitted = false;\n    this._extensions = {};\n    this._paused = false;\n    this._protocol = '';\n    this._readyState = WebSocket.CONNECTING;\n    this._receiver = null;\n    this._sender = null;\n    this._socket = null;\n\n    if (address !== null) {\n      this._bufferedAmount = 0;\n      this._isServer = false;\n      this._redirects = 0;\n\n      if (protocols === undefined) {\n        if (!options || options.protocols === undefined) {\n          protocols = [];\n        } else if (Array.isArray(options.protocols)) {\n          protocols = options.protocols;\n        } else {\n          protocols = [options.protocols];\n        }\n      } else if (!Array.isArray(protocols)) {\n        if (typeof protocols === 'object' && protocols !== null) {\n          options = protocols;\n\n          if (options.protocols === undefined) {\n            protocols = [];\n          } else if (Array.isArray(options.protocols)) {\n            protocols = options.protocols;\n          } else {\n            protocols = [options.protocols];\n          }\n        } else {\n          protocols = [protocols];\n        }\n      }\n\n      initAsClient(this, address, protocols, options);\n    } else {\n      this._autoPong = options.autoPong;\n      this._closeTimeout = options.closeTimeout;\n      this._isServer = true;\n    }\n  }\n\n  /**\n   * For historical reasons, the custom \"nodebuffer\" type is used by the default\n   * instead of \"blob\".\n   *\n   * @type {String}\n   */\n  get binaryType() {\n    return this._binaryType;\n  }\n\n  set binaryType(type) {\n    if (!BINARY_TYPES.includes(type)) return;\n\n    this._binaryType = type;\n\n    //\n    // Allow to change `binaryType` on the fly.\n    //\n    if (this._receiver) this._receiver._binaryType = type;\n  }\n\n  /**\n   * @type {Number}\n   */\n  get bufferedAmount() {\n    if (!this._socket) return this._bufferedAmount;\n\n    return this._socket._writableState.length + this._sender._bufferedBytes;\n  }\n\n  /**\n   * @type {String}\n   */\n  get extensions() {\n    return Object.keys(this._extensions).join();\n  }\n\n  /**\n   * @type {Boolean}\n   */\n  get isPaused() {\n    return this._paused;\n  }\n\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onclose() {\n    return null;\n  }\n\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onerror() {\n    return null;\n  }\n\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onopen() {\n    return null;\n  }\n\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onmessage() {\n    return null;\n  }\n\n  /**\n   * @type {String}\n   */\n  get protocol() {\n    return this._protocol;\n  }\n\n  /**\n   * @type {Number}\n   */\n  get readyState() {\n    return this._readyState;\n  }\n\n  /**\n   * @type {String}\n   */\n  get url() {\n    return this._url;\n  }\n\n  /**\n   * Set up the socket and the internal resources.\n   *\n   * @param {Duplex} socket The network socket between the server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Object} options Options object\n   * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether\n   *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted\n   *     multiple times in the same tick\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Number} [options.maxBufferedChunks=0] The maximum number of\n   *     buffered data chunks\n   * @param {Number} [options.maxFragments=0] The maximum number of message\n   *     fragments\n   * @param {Number} [options.maxPayload=0] The maximum allowed message size\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   * @private\n   */\n  setSocket(socket, head, options) {\n    const receiver = new Receiver({\n      allowSynchronousEvents: options.allowSynchronousEvents,\n      binaryType: this.binaryType,\n      extensions: this._extensions,\n      isServer: this._isServer,\n      maxBufferedChunks: options.maxBufferedChunks,\n      maxFragments: options.maxFragments,\n      maxPayload: options.maxPayload,\n      skipUTF8Validation: options.skipUTF8Validation\n    });\n\n    const sender = new Sender(socket, this._extensions, options.generateMask);\n\n    this._receiver = receiver;\n    this._sender = sender;\n    this._socket = socket;\n\n    receiver[kWebSocket] = this;\n    sender[kWebSocket] = this;\n    socket[kWebSocket] = this;\n\n    receiver.on('conclude', receiverOnConclude);\n    receiver.on('drain', receiverOnDrain);\n    receiver.on('error', receiverOnError);\n    receiver.on('message', receiverOnMessage);\n    receiver.on('ping', receiverOnPing);\n    receiver.on('pong', receiverOnPong);\n\n    sender.onerror = senderOnError;\n\n    //\n    // These methods may not be available if `socket` is just a `Duplex`.\n    //\n    if (socket.setTimeout) socket.setTimeout(0);\n    if (socket.setNoDelay) socket.setNoDelay();\n\n    if (head.length > 0) socket.unshift(head);\n\n    socket.on('close', socketOnClose);\n    socket.on('data', socketOnData);\n    socket.on('end', socketOnEnd);\n    socket.on('error', socketOnError);\n\n    this._readyState = WebSocket.OPEN;\n    this.emit('open');\n  }\n\n  /**\n   * Emit the `'close'` event.\n   *\n   * @private\n   */\n  emitClose() {\n    if (!this._socket) {\n      this._readyState = WebSocket.CLOSED;\n      this.emit('close', this._closeCode, this._closeMessage);\n      return;\n    }\n\n    if (this._extensions[PerMessageDeflate.extensionName]) {\n      this._extensions[PerMessageDeflate.extensionName].cleanup();\n    }\n\n    this._receiver.removeAllListeners();\n    this._readyState = WebSocket.CLOSED;\n    this.emit('close', this._closeCode, this._closeMessage);\n  }\n\n  /**\n   * Start a closing handshake.\n   *\n   *          +----------+   +-----------+   +----------+\n   *     - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n   *    |     +----------+   +-----------+   +----------+     |\n   *          +----------+   +-----------+         |\n   * CLOSING  |ws.close()|<--|close frame|<--+-----+       CLOSING\n   *          +----------+   +-----------+   |\n   *    |           |                        |   +---+        |\n   *                +------------------------+-->|fin| - - - -\n   *    |         +---+                      |   +---+\n   *     - - - - -|fin|<---------------------+\n   *              +---+\n   *\n   * @param {Number} [code] Status code explaining why the connection is closing\n   * @param {(String|Buffer)} [data] The reason why the connection is\n   *     closing\n   * @public\n   */\n  close(code, data) {\n    if (this.readyState === WebSocket.CLOSED) return;\n    if (this.readyState === WebSocket.CONNECTING) {\n      const msg = 'WebSocket was closed before the connection was established';\n      abortHandshake(this, this._req, msg);\n      return;\n    }\n\n    if (this.readyState === WebSocket.CLOSING) {\n      if (\n        this._closeFrameSent &&\n        (this._closeFrameReceived || this._receiver._writableState.errorEmitted)\n      ) {\n        this._socket.end();\n      }\n\n      return;\n    }\n\n    this._sender.close(code, data, !this._isServer, (err) => {\n      //\n      // This error is handled by the `'error'` listener on the socket. We only\n      // want to know if the close frame has been sent here.\n      //\n      if (err) return;\n\n      this._closeFrameSent = true;\n\n      if (\n        this._closeFrameReceived ||\n        this._receiver._writableState.errorEmitted\n      ) {\n        this._socket.end();\n      }\n    });\n\n    this._readyState = WebSocket.CLOSING;\n    setCloseTimer(this);\n  }\n\n  /**\n   * Pause the socket.\n   *\n   * @public\n   */\n  pause() {\n    if (\n      this.readyState === WebSocket.CONNECTING ||\n      this.readyState === WebSocket.CLOSED\n    ) {\n      return;\n    }\n\n    this._paused = true;\n    this._socket.pause();\n  }\n\n  /**\n   * Send a ping.\n   *\n   * @param {*} [data] The data to send\n   * @param {Boolean} [mask] Indicates whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when the ping is sent\n   * @public\n   */\n  ping(data, mask, cb) {\n    if (this.readyState === WebSocket.CONNECTING) {\n      throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n    }\n\n    if (typeof data === 'function') {\n      cb = data;\n      data = mask = undefined;\n    } else if (typeof mask === 'function') {\n      cb = mask;\n      mask = undefined;\n    }\n\n    if (typeof data === 'number') data = data.toString();\n\n    if (this.readyState !== WebSocket.OPEN) {\n      sendAfterClose(this, data, cb);\n      return;\n    }\n\n    if (mask === undefined) mask = !this._isServer;\n    this._sender.ping(data || EMPTY_BUFFER, mask, cb);\n  }\n\n  /**\n   * Send a pong.\n   *\n   * @param {*} [data] The data to send\n   * @param {Boolean} [mask] Indicates whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when the pong is sent\n   * @public\n   */\n  pong(data, mask, cb) {\n    if (this.readyState === WebSocket.CONNECTING) {\n      throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n    }\n\n    if (typeof data === 'function') {\n      cb = data;\n      data = mask = undefined;\n    } else if (typeof mask === 'function') {\n      cb = mask;\n      mask = undefined;\n    }\n\n    if (typeof data === 'number') data = data.toString();\n\n    if (this.readyState !== WebSocket.OPEN) {\n      sendAfterClose(this, data, cb);\n      return;\n    }\n\n    if (mask === undefined) mask = !this._isServer;\n    this._sender.pong(data || EMPTY_BUFFER, mask, cb);\n  }\n\n  /**\n   * Resume the socket.\n   *\n   * @public\n   */\n  resume() {\n    if (\n      this.readyState === WebSocket.CONNECTING ||\n      this.readyState === WebSocket.CLOSED\n    ) {\n      return;\n    }\n\n    this._paused = false;\n    if (!this._receiver._writableState.needDrain) this._socket.resume();\n  }\n\n  /**\n   * Send a data message.\n   *\n   * @param {*} data The message to send\n   * @param {Object} [options] Options object\n   * @param {Boolean} [options.binary] Specifies whether `data` is binary or\n   *     text\n   * @param {Boolean} [options.compress] Specifies whether or not to compress\n   *     `data`\n   * @param {Boolean} [options.fin=true] Specifies whether the fragment is the\n   *     last one\n   * @param {Boolean} [options.mask] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when data is written out\n   * @public\n   */\n  send(data, options, cb) {\n    if (this.readyState === WebSocket.CONNECTING) {\n      throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n    }\n\n    if (typeof options === 'function') {\n      cb = options;\n      options = {};\n    }\n\n    if (typeof data === 'number') data = data.toString();\n\n    if (this.readyState !== WebSocket.OPEN) {\n      sendAfterClose(this, data, cb);\n      return;\n    }\n\n    const opts = {\n      binary: typeof data !== 'string',\n      mask: !this._isServer,\n      compress: true,\n      fin: true,\n      ...options\n    };\n\n    if (!this._extensions[PerMessageDeflate.extensionName]) {\n      opts.compress = false;\n    }\n\n    this._sender.send(data || EMPTY_BUFFER, opts, cb);\n  }\n\n  /**\n   * Forcibly close the connection.\n   *\n   * @public\n   */\n  terminate() {\n    if (this.readyState === WebSocket.CLOSED) return;\n    if (this.readyState === WebSocket.CONNECTING) {\n      const msg = 'WebSocket was closed before the connection was established';\n      abortHandshake(this, this._req, msg);\n      return;\n    }\n\n    if (this._socket) {\n      this._readyState = WebSocket.CLOSING;\n      this._socket.destroy();\n    }\n  }\n}\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CONNECTING', {\n  enumerable: true,\n  value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CONNECTING', {\n  enumerable: true,\n  value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'OPEN', {\n  enumerable: true,\n  value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'OPEN', {\n  enumerable: true,\n  value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSING', {\n  enumerable: true,\n  value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSING', {\n  enumerable: true,\n  value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSED', {\n  enumerable: true,\n  value: readyStates.indexOf('CLOSED')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSED', {\n  enumerable: true,\n  value: readyStates.indexOf('CLOSED')\n});\n\n[\n  'binaryType',\n  'bufferedAmount',\n  'extensions',\n  'isPaused',\n  'protocol',\n  'readyState',\n  'url'\n].forEach((property) => {\n  Object.defineProperty(WebSocket.prototype, property, { enumerable: true });\n});\n\n//\n// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.\n// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface\n//\n['open', 'error', 'close', 'message'].forEach((method) => {\n  Object.defineProperty(WebSocket.prototype, `on${method}`, {\n    enumerable: true,\n    get() {\n      for (const listener of this.listeners(method)) {\n        if (listener[kForOnEventAttribute]) return listener[kListener];\n      }\n\n      return null;\n    },\n    set(handler) {\n      for (const listener of this.listeners(method)) {\n        if (listener[kForOnEventAttribute]) {\n          this.removeListener(method, listener);\n          break;\n        }\n      }\n\n      if (typeof handler !== 'function') return;\n\n      this.addEventListener(method, handler, {\n        [kForOnEventAttribute]: true\n      });\n    }\n  });\n});\n\nWebSocket.prototype.addEventListener = addEventListener;\nWebSocket.prototype.removeEventListener = removeEventListener;\n\nmodule.exports = WebSocket;\n\n/**\n * Initialize a WebSocket client.\n *\n * @param {WebSocket} websocket The client to initialize\n * @param {(String|URL)} address The URL to which to connect\n * @param {Array} protocols The subprotocols\n * @param {Object} [options] Connection options\n * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether any\n *     of the `'message'`, `'ping'`, and `'pong'` events can be emitted multiple\n *     times in the same tick\n * @param {Boolean} [options.autoPong=true] Specifies whether or not to\n *     automatically send a pong in response to a ping\n * @param {Number} [options.closeTimeout=30000] Duration in milliseconds to wait\n *     for the closing handshake to finish after `websocket.close()` is called\n * @param {Function} [options.finishRequest] A function which can be used to\n *     customize the headers of each http request before it is sent\n * @param {Boolean} [options.followRedirects=false] Whether or not to follow\n *     redirects\n * @param {Function} [options.generateMask] The function used to generate the\n *     masking key\n * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the\n *     handshake request\n * @param {Number} [options.maxBufferedChunks=262144] The maximum number of\n *     buffered data chunks\n * @param {Number} [options.maxFragments=16384] The maximum number of message\n *     fragments\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n *     size\n * @param {Number} [options.maxRedirects=10] The maximum number of redirects\n *     allowed\n * @param {String} [options.origin] Value of the `Origin` or\n *     `Sec-WebSocket-Origin` header\n * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable\n *     permessage-deflate\n * @param {Number} [options.protocolVersion=13] Value of the\n *     `Sec-WebSocket-Version` header\n * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n *     not to skip UTF-8 validation for text and close messages\n * @private\n */\nfunction initAsClient(websocket, address, protocols, options) {\n  const opts = {\n    allowSynchronousEvents: true,\n    autoPong: true,\n    closeTimeout: CLOSE_TIMEOUT,\n    protocolVersion: protocolVersions[1],\n    maxBufferedChunks: 256 * 1024,\n    maxFragments: 16 * 1024,\n    maxPayload: 100 * 1024 * 1024,\n    skipUTF8Validation: false,\n    perMessageDeflate: true,\n    followRedirects: false,\n    maxRedirects: 10,\n    ...options,\n    socketPath: undefined,\n    hostname: undefined,\n    protocol: undefined,\n    protocols: undefined,\n    timeout: undefined,\n    method: 'GET',\n    host: undefined,\n    path: undefined,\n    port: undefined\n  };\n\n  websocket._autoPong = opts.autoPong;\n  websocket._closeTimeout = opts.closeTimeout;\n\n  if (!protocolVersions.includes(opts.protocolVersion)) {\n    throw new RangeError(\n      `Unsupported protocol version: ${opts.protocolVersion} ` +\n        `(supported versions: ${protocolVersions.join(', ')})`\n    );\n  }\n\n  let parsedUrl;\n\n  if (address instanceof URL) {\n    parsedUrl = address;\n  } else {\n    try {\n      parsedUrl = new URL(address);\n    } catch {\n      throw new SyntaxError(`Invalid URL: ${address}`);\n    }\n  }\n\n  if (parsedUrl.protocol === 'http:') {\n    parsedUrl.protocol = 'ws:';\n  } else if (parsedUrl.protocol === 'https:') {\n    parsedUrl.protocol = 'wss:';\n  }\n\n  websocket._url = parsedUrl.href;\n\n  const isSecure = parsedUrl.protocol === 'wss:';\n  const isIpcUrl = parsedUrl.protocol === 'ws+unix:';\n  let invalidUrlMessage;\n\n  if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) {\n    invalidUrlMessage =\n      'The URL\\'s protocol must be one of \"ws:\", \"wss:\", ' +\n      '\"http:\", \"https:\", or \"ws+unix:\"';\n  } else if (isIpcUrl && !parsedUrl.pathname) {\n    invalidUrlMessage = \"The URL's pathname is empty\";\n  } else if (parsedUrl.hash) {\n    invalidUrlMessage = 'The URL contains a fragment identifier';\n  }\n\n  if (invalidUrlMessage) {\n    const err = new SyntaxError(invalidUrlMessage);\n\n    if (websocket._redirects === 0) {\n      throw err;\n    } else {\n      emitErrorAndClose(websocket, err);\n      return;\n    }\n  }\n\n  const defaultPort = isSecure ? 443 : 80;\n  const key = randomBytes(16).toString('base64');\n  const request = isSecure ? https.request : http.request;\n  const protocolSet = new Set();\n  let perMessageDeflate;\n\n  opts.createConnection =\n    opts.createConnection || (isSecure ? tlsConnect : netConnect);\n  opts.defaultPort = opts.defaultPort || defaultPort;\n  opts.port = parsedUrl.port || defaultPort;\n  opts.host = parsedUrl.hostname.startsWith('[')\n    ? parsedUrl.hostname.slice(1, -1)\n    : parsedUrl.hostname;\n  opts.headers = {\n    ...opts.headers,\n    'Sec-WebSocket-Version': opts.protocolVersion,\n    'Sec-WebSocket-Key': key,\n    Connection: 'Upgrade',\n    Upgrade: 'websocket'\n  };\n  opts.path = parsedUrl.pathname + parsedUrl.search;\n  opts.timeout = opts.handshakeTimeout;\n\n  if (opts.perMessageDeflate) {\n    perMessageDeflate = new PerMessageDeflate({\n      ...opts.perMessageDeflate,\n      isServer: false,\n      maxPayload: opts.maxPayload\n    });\n    opts.headers['Sec-WebSocket-Extensions'] = format({\n      [PerMessageDeflate.extensionName]: perMessageDeflate.offer()\n    });\n  }\n  if (protocols.length) {\n    for (const protocol of protocols) {\n      if (\n        typeof protocol !== 'string' ||\n        !subprotocolRegex.test(protocol) ||\n        protocolSet.has(protocol)\n      ) {\n        throw new SyntaxError(\n          'An invalid or duplicated subprotocol was specified'\n        );\n      }\n\n      protocolSet.add(protocol);\n    }\n\n    opts.headers['Sec-WebSocket-Protocol'] = protocols.join(',');\n  }\n  if (opts.origin) {\n    if (opts.protocolVersion < 13) {\n      opts.headers['Sec-WebSocket-Origin'] = opts.origin;\n    } else {\n      opts.headers.Origin = opts.origin;\n    }\n  }\n  if (parsedUrl.username || parsedUrl.password) {\n    opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;\n  }\n\n  if (isIpcUrl) {\n    const parts = opts.path.split(':');\n\n    opts.socketPath = parts[0];\n    opts.path = parts[1];\n  }\n\n  let req;\n\n  if (opts.followRedirects) {\n    if (websocket._redirects === 0) {\n      websocket._originalIpc = isIpcUrl;\n      websocket._originalSecure = isSecure;\n      websocket._originalHostOrSocketPath = isIpcUrl\n        ? opts.socketPath\n        : parsedUrl.host;\n\n      const headers = options && options.headers;\n\n      //\n      // Shallow copy the user provided options so that headers can be changed\n      // without mutating the original object.\n      //\n      options = { ...options, headers: {} };\n\n      if (headers) {\n        for (const [key, value] of Object.entries(headers)) {\n          options.headers[key.toLowerCase()] = value;\n        }\n      }\n    } else if (websocket.listenerCount('redirect') === 0) {\n      const isSameHost = isIpcUrl\n        ? websocket._originalIpc\n          ? opts.socketPath === websocket._originalHostOrSocketPath\n          : false\n        : websocket._originalIpc\n          ? false\n          : parsedUrl.host === websocket._originalHostOrSocketPath;\n\n      if (!isSameHost || (websocket._originalSecure && !isSecure)) {\n        //\n        // Match curl 7.77.0 behavior and drop the following headers. These\n        // headers are also dropped when following a redirect to a subdomain.\n        //\n        delete opts.headers.authorization;\n        delete opts.headers.cookie;\n\n        if (!isSameHost) delete opts.headers.host;\n\n        opts.auth = undefined;\n      }\n    }\n\n    //\n    // Match curl 7.77.0 behavior and make the first `Authorization` header win.\n    // If the `Authorization` header is set, then there is nothing to do as it\n    // will take precedence.\n    //\n    if (opts.auth && !options.headers.authorization) {\n      options.headers.authorization =\n        'Basic ' + Buffer.from(opts.auth).toString('base64');\n    }\n\n    req = websocket._req = request(opts);\n\n    if (websocket._redirects) {\n      //\n      // Unlike what is done for the `'upgrade'` event, no early exit is\n      // triggered here if the user calls `websocket.close()` or\n      // `websocket.terminate()` from a listener of the `'redirect'` event. This\n      // is because the user can also call `request.destroy()` with an error\n      // before calling `websocket.close()` or `websocket.terminate()` and this\n      // would result in an error being emitted on the `request` object with no\n      // `'error'` event listeners attached.\n      //\n      websocket.emit('redirect', websocket.url, req);\n    }\n  } else {\n    req = websocket._req = request(opts);\n  }\n\n  if (opts.timeout) {\n    req.on('timeout', () => {\n      abortHandshake(websocket, req, 'Opening handshake has timed out');\n    });\n  }\n\n  req.on('error', (err) => {\n    if (req === null || req[kAborted]) return;\n\n    req = websocket._req = null;\n    emitErrorAndClose(websocket, err);\n  });\n\n  req.on('response', (res) => {\n    const location = res.headers.location;\n    const statusCode = res.statusCode;\n\n    if (\n      location &&\n      opts.followRedirects &&\n      statusCode >= 300 &&\n      statusCode < 400\n    ) {\n      if (++websocket._redirects > opts.maxRedirects) {\n        abortHandshake(websocket, req, 'Maximum redirects exceeded');\n        return;\n      }\n\n      req.abort();\n\n      let addr;\n\n      try {\n        addr = new URL(location, address);\n      } catch (e) {\n        const err = new SyntaxError(`Invalid URL: ${location}`);\n        emitErrorAndClose(websocket, err);\n        return;\n      }\n\n      initAsClient(websocket, addr, protocols, options);\n    } else if (!websocket.emit('unexpected-response', req, res)) {\n      abortHandshake(\n        websocket,\n        req,\n        `Unexpected server response: ${res.statusCode}`\n      );\n    }\n  });\n\n  req.on('upgrade', (res, socket, head) => {\n    websocket.emit('upgrade', res);\n\n    //\n    // The user may have closed the connection from a listener of the\n    // `'upgrade'` event.\n    //\n    if (websocket.readyState !== WebSocket.CONNECTING) return;\n\n    req = websocket._req = null;\n\n    const upgrade = res.headers.upgrade;\n\n    if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') {\n      abortHandshake(websocket, socket, 'Invalid Upgrade header');\n      return;\n    }\n\n    const digest = createHash('sha1')\n      .update(key + GUID)\n      .digest('base64');\n\n    if (res.headers['sec-websocket-accept'] !== digest) {\n      abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');\n      return;\n    }\n\n    const serverProt = res.headers['sec-websocket-protocol'];\n    let protError;\n\n    if (serverProt !== undefined) {\n      if (!protocolSet.size) {\n        protError = 'Server sent a subprotocol but none was requested';\n      } else if (!protocolSet.has(serverProt)) {\n        protError = 'Server sent an invalid subprotocol';\n      }\n    } else if (protocolSet.size) {\n      protError = 'Server sent no subprotocol';\n    }\n\n    if (protError) {\n      abortHandshake(websocket, socket, protError);\n      return;\n    }\n\n    if (serverProt) websocket._protocol = serverProt;\n\n    const secWebSocketExtensions = res.headers['sec-websocket-extensions'];\n\n    if (secWebSocketExtensions !== undefined) {\n      if (!perMessageDeflate) {\n        const message =\n          'Server sent a Sec-WebSocket-Extensions header but no extension ' +\n          'was requested';\n        abortHandshake(websocket, socket, message);\n        return;\n      }\n\n      let extensions;\n\n      try {\n        extensions = parse(secWebSocketExtensions);\n      } catch (err) {\n        const message = 'Invalid Sec-WebSocket-Extensions header';\n        abortHandshake(websocket, socket, message);\n        return;\n      }\n\n      const extensionNames = Object.keys(extensions);\n\n      if (\n        extensionNames.length !== 1 ||\n        extensionNames[0] !== PerMessageDeflate.extensionName\n      ) {\n        const message = 'Server indicated an extension that was not requested';\n        abortHandshake(websocket, socket, message);\n        return;\n      }\n\n      try {\n        perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);\n      } catch (err) {\n        const message = 'Invalid Sec-WebSocket-Extensions header';\n        abortHandshake(websocket, socket, message);\n        return;\n      }\n\n      websocket._extensions[PerMessageDeflate.extensionName] =\n        perMessageDeflate;\n    }\n\n    websocket.setSocket(socket, head, {\n      allowSynchronousEvents: opts.allowSynchronousEvents,\n      generateMask: opts.generateMask,\n      maxBufferedChunks: opts.maxBufferedChunks,\n      maxFragments: opts.maxFragments,\n      maxPayload: opts.maxPayload,\n      skipUTF8Validation: opts.skipUTF8Validation\n    });\n  });\n\n  if (opts.finishRequest) {\n    opts.finishRequest(req, websocket);\n  } else {\n    req.end();\n  }\n}\n\n/**\n * Emit the `'error'` and `'close'` events.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {Error} The error to emit\n * @private\n */\nfunction emitErrorAndClose(websocket, err) {\n  websocket._readyState = WebSocket.CLOSING;\n  //\n  // The following assignment is practically useless and is done only for\n  // consistency.\n  //\n  websocket._errorEmitted = true;\n  websocket.emit('error', err);\n  websocket.emitClose();\n}\n\n/**\n * Create a `net.Socket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {net.Socket} The newly created socket used to start the connection\n * @private\n */\nfunction netConnect(options) {\n  options.path = options.socketPath;\n  return net.connect(options);\n}\n\n/**\n * Create a `tls.TLSSocket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {tls.TLSSocket} The newly created socket used to start the connection\n * @private\n */\nfunction tlsConnect(options) {\n  options.path = undefined;\n\n  if (!options.servername && options.servername !== '') {\n    options.servername = net.isIP(options.host) ? '' : options.host;\n  }\n\n  return tls.connect(options);\n}\n\n/**\n * Abort the handshake and emit an error.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to\n *     abort or the socket to destroy\n * @param {String} message The error message\n * @private\n */\nfunction abortHandshake(websocket, stream, message) {\n  websocket._readyState = WebSocket.CLOSING;\n\n  const err = new Error(message);\n  Error.captureStackTrace(err, abortHandshake);\n\n  if (stream.setHeader) {\n    stream[kAborted] = true;\n    stream.abort();\n\n    if (stream.socket && !stream.socket.destroyed) {\n      //\n      // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if\n      // called after the request completed. See\n      // https://github.com/websockets/ws/issues/1869.\n      //\n      stream.socket.destroy();\n    }\n\n    process.nextTick(emitErrorAndClose, websocket, err);\n  } else {\n    stream.destroy(err);\n    stream.once('error', websocket.emit.bind(websocket, 'error'));\n    stream.once('close', websocket.emitClose.bind(websocket));\n  }\n}\n\n/**\n * Handle cases where the `ping()`, `pong()`, or `send()` methods are called\n * when the `readyState` attribute is `CLOSING` or `CLOSED`.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {*} [data] The data to send\n * @param {Function} [cb] Callback\n * @private\n */\nfunction sendAfterClose(websocket, data, cb) {\n  if (data) {\n    const length = isBlob(data) ? data.size : toBuffer(data).length;\n\n    //\n    // The `_bufferedAmount` property is used only when the peer is a client and\n    // the opening handshake fails. Under these circumstances, in fact, the\n    // `setSocket()` method is not called, so the `_socket` and `_sender`\n    // properties are set to `null`.\n    //\n    if (websocket._socket) websocket._sender._bufferedBytes += length;\n    else websocket._bufferedAmount += length;\n  }\n\n  if (cb) {\n    const err = new Error(\n      `WebSocket is not open: readyState ${websocket.readyState} ` +\n        `(${readyStates[websocket.readyState]})`\n    );\n    process.nextTick(cb, err);\n  }\n}\n\n/**\n * The listener of the `Receiver` `'conclude'` event.\n *\n * @param {Number} code The status code\n * @param {Buffer} reason The reason for closing\n * @private\n */\nfunction receiverOnConclude(code, reason) {\n  const websocket = this[kWebSocket];\n\n  websocket._closeFrameReceived = true;\n  websocket._closeMessage = reason;\n  websocket._closeCode = code;\n\n  if (websocket._socket[kWebSocket] === undefined) return;\n\n  websocket._socket.removeListener('data', socketOnData);\n  process.nextTick(resume, websocket._socket);\n\n  if (code === 1005) websocket.close();\n  else websocket.close(code, reason);\n}\n\n/**\n * The listener of the `Receiver` `'drain'` event.\n *\n * @private\n */\nfunction receiverOnDrain() {\n  const websocket = this[kWebSocket];\n\n  if (!websocket.isPaused) websocket._socket.resume();\n}\n\n/**\n * The listener of the `Receiver` `'error'` event.\n *\n * @param {(RangeError|Error)} err The emitted error\n * @private\n */\nfunction receiverOnError(err) {\n  const websocket = this[kWebSocket];\n\n  if (websocket._socket[kWebSocket] !== undefined) {\n    websocket._socket.removeListener('data', socketOnData);\n\n    //\n    // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See\n    // https://github.com/websockets/ws/issues/1940.\n    //\n    process.nextTick(resume, websocket._socket);\n\n    websocket.close(err[kStatusCode]);\n  }\n\n  if (!websocket._errorEmitted) {\n    websocket._errorEmitted = true;\n    websocket.emit('error', err);\n  }\n}\n\n/**\n * The listener of the `Receiver` `'finish'` event.\n *\n * @private\n */\nfunction receiverOnFinish() {\n  this[kWebSocket].emitClose();\n}\n\n/**\n * The listener of the `Receiver` `'message'` event.\n *\n * @param {Buffer|ArrayBuffer|Buffer[])} data The message\n * @param {Boolean} isBinary Specifies whether the message is binary or not\n * @private\n */\nfunction receiverOnMessage(data, isBinary) {\n  this[kWebSocket].emit('message', data, isBinary);\n}\n\n/**\n * The listener of the `Receiver` `'ping'` event.\n *\n * @param {Buffer} data The data included in the ping frame\n * @private\n */\nfunction receiverOnPing(data) {\n  const websocket = this[kWebSocket];\n\n  if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);\n  websocket.emit('ping', data);\n}\n\n/**\n * The listener of the `Receiver` `'pong'` event.\n *\n * @param {Buffer} data The data included in the pong frame\n * @private\n */\nfunction receiverOnPong(data) {\n  this[kWebSocket].emit('pong', data);\n}\n\n/**\n * Resume a readable stream\n *\n * @param {Readable} stream The readable stream\n * @private\n */\nfunction resume(stream) {\n  stream.resume();\n}\n\n/**\n * The `Sender` error event handler.\n *\n * @param {Error} The error\n * @private\n */\nfunction senderOnError(err) {\n  const websocket = this[kWebSocket];\n\n  if (websocket.readyState === WebSocket.CLOSED) return;\n  if (websocket.readyState === WebSocket.OPEN) {\n    websocket._readyState = WebSocket.CLOSING;\n    setCloseTimer(websocket);\n  }\n\n  //\n  // `socket.end()` is used instead of `socket.destroy()` to allow the other\n  // peer to finish sending queued data. There is no need to set a timer here\n  // because `CLOSING` means that it is already set or not needed.\n  //\n  this._socket.end();\n\n  if (!websocket._errorEmitted) {\n    websocket._errorEmitted = true;\n    websocket.emit('error', err);\n  }\n}\n\n/**\n * Set a timer to destroy the underlying raw socket of a WebSocket.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @private\n */\nfunction setCloseTimer(websocket) {\n  websocket._closeTimer = setTimeout(\n    websocket._socket.destroy.bind(websocket._socket),\n    websocket._closeTimeout\n  );\n}\n\n/**\n * The listener of the socket `'close'` event.\n *\n * @private\n */\nfunction socketOnClose() {\n  const websocket = this[kWebSocket];\n\n  this.removeListener('close', socketOnClose);\n  this.removeListener('data', socketOnData);\n  this.removeListener('end', socketOnEnd);\n\n  websocket._readyState = WebSocket.CLOSING;\n\n  //\n  // The close frame might not have been received or the `'end'` event emitted,\n  // for example, if the socket was destroyed due to an error. Ensure that the\n  // `receiver` stream is closed after writing any remaining buffered data to\n  // it. If the readable side of the socket is in flowing mode then there is no\n  // buffered data as everything has been already written. If instead, the\n  // socket is paused, any possible buffered data will be read as a single\n  // chunk.\n  //\n  if (\n    !this._readableState.endEmitted &&\n    !websocket._closeFrameReceived &&\n    !websocket._receiver._writableState.errorEmitted &&\n    this._readableState.length !== 0\n  ) {\n    const chunk = this.read(this._readableState.length);\n\n    websocket._receiver.write(chunk);\n  }\n\n  websocket._receiver.end();\n\n  this[kWebSocket] = undefined;\n\n  clearTimeout(websocket._closeTimer);\n\n  if (\n    websocket._receiver._writableState.finished ||\n    websocket._receiver._writableState.errorEmitted\n  ) {\n    websocket.emitClose();\n  } else {\n    websocket._receiver.on('error', receiverOnFinish);\n    websocket._receiver.on('finish', receiverOnFinish);\n  }\n}\n\n/**\n * The listener of the socket `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction socketOnData(chunk) {\n  if (!this[kWebSocket]._receiver.write(chunk)) {\n    this.pause();\n  }\n}\n\n/**\n * The listener of the socket `'end'` event.\n *\n * @private\n */\nfunction socketOnEnd() {\n  const websocket = this[kWebSocket];\n\n  websocket._readyState = WebSocket.CLOSING;\n  websocket._receiver.end();\n  this.end();\n}\n\n/**\n * The listener of the socket `'error'` event.\n *\n * @private\n */\nfunction socketOnError() {\n  const websocket = this[kWebSocket];\n\n  this.removeListener('error', socketOnError);\n  this.on('error', NOOP);\n\n  if (websocket) {\n    websocket._readyState = WebSocket.CLOSING;\n    this.destroy();\n  }\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^WebSocket$\" }] */\n'use strict';\n\nconst WebSocket = require('./websocket');\nconst { Duplex } = require('stream');\n\n/**\n * Emits the `'close'` event on a stream.\n *\n * @param {Duplex} stream The stream.\n * @private\n */\nfunction emitClose(stream) {\n  stream.emit('close');\n}\n\n/**\n * The listener of the `'end'` event.\n *\n * @private\n */\nfunction duplexOnEnd() {\n  if (!this.destroyed && this._writableState.finished) {\n    this.destroy();\n  }\n}\n\n/**\n * The listener of the `'error'` event.\n *\n * @param {Error} err The error\n * @private\n */\nfunction duplexOnError(err) {\n  this.removeListener('error', duplexOnError);\n  this.destroy();\n  if (this.listenerCount('error') === 0) {\n    // Do not suppress the throwing behavior.\n    this.emit('error', err);\n  }\n}\n\n/**\n * Wraps a `WebSocket` in a duplex stream.\n *\n * @param {WebSocket} ws The `WebSocket` to wrap\n * @param {Object} [options] The options for the `Duplex` constructor\n * @return {Duplex} The duplex stream\n * @public\n */\nfunction createWebSocketStream(ws, options) {\n  let terminateOnDestroy = true;\n\n  const duplex = new Duplex({\n    ...options,\n    autoDestroy: false,\n    emitClose: false,\n    objectMode: false,\n    writableObjectMode: false\n  });\n\n  ws.on('message', function message(msg, isBinary) {\n    const data =\n      !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;\n\n    if (!duplex.push(data)) ws.pause();\n  });\n\n  ws.once('error', function error(err) {\n    if (duplex.destroyed) return;\n\n    // Prevent `ws.terminate()` from being called by `duplex._destroy()`.\n    //\n    // - If the `'error'` event is emitted before the `'open'` event, then\n    //   `ws.terminate()` is a noop as no socket is assigned.\n    // - Otherwise, the error is re-emitted by the listener of the `'error'`\n    //   event of the `Receiver` object. The listener already closes the\n    //   connection by calling `ws.close()`. This allows a close frame to be\n    //   sent to the other peer. If `ws.terminate()` is called right after this,\n    //   then the close frame might not be sent.\n    terminateOnDestroy = false;\n    duplex.destroy(err);\n  });\n\n  ws.once('close', function close() {\n    if (duplex.destroyed) return;\n\n    duplex.push(null);\n  });\n\n  duplex._destroy = function (err, callback) {\n    if (ws.readyState === ws.CLOSED) {\n      callback(err);\n      process.nextTick(emitClose, duplex);\n      return;\n    }\n\n    let called = false;\n\n    ws.once('error', function error(err) {\n      called = true;\n      callback(err);\n    });\n\n    ws.once('close', function close() {\n      if (!called) callback(err);\n      process.nextTick(emitClose, duplex);\n    });\n\n    if (terminateOnDestroy) ws.terminate();\n  };\n\n  duplex._final = function (callback) {\n    if (ws.readyState === ws.CONNECTING) {\n      ws.once('open', function open() {\n        duplex._final(callback);\n      });\n      return;\n    }\n\n    // If the value of the `_socket` property is `null` it means that `ws` is a\n    // client websocket and the handshake failed. In fact, when this happens, a\n    // socket is never assigned to the websocket. Wait for the `'error'` event\n    // that will be emitted by the websocket.\n    if (ws._socket === null) return;\n\n    if (ws._socket._writableState.finished) {\n      callback();\n      if (duplex._readableState.endEmitted) duplex.destroy();\n    } else {\n      ws._socket.once('finish', function finish() {\n        // `duplex` is not destroyed here because the `'end'` event will be\n        // emitted on `duplex` after this `'finish'` event. The EOF signaling\n        // `null` chunk is, in fact, pushed when the websocket emits `'close'`.\n        callback();\n      });\n      ws.close();\n    }\n  };\n\n  duplex._read = function () {\n    if (ws.isPaused) ws.resume();\n  };\n\n  duplex._write = function (chunk, encoding, callback) {\n    if (ws.readyState === ws.CONNECTING) {\n      ws.once('open', function open() {\n        duplex._write(chunk, encoding, callback);\n      });\n      return;\n    }\n\n    ws.send(chunk, callback);\n  };\n\n  duplex.on('end', duplexOnEnd);\n  duplex.on('error', duplexOnError);\n  return duplex;\n}\n\nmodule.exports = createWebSocketStream;\n","'use strict';\n\nconst { tokenChars } = require('./validation');\n\n/**\n * Parses the `Sec-WebSocket-Protocol` header into a set of subprotocol names.\n *\n * @param {String} header The field value of the header\n * @return {Set} The subprotocol names\n * @public\n */\nfunction parse(header) {\n  const protocols = new Set();\n  let start = -1;\n  let end = -1;\n  let i = 0;\n\n  for (i; i < header.length; i++) {\n    const code = header.charCodeAt(i);\n\n    if (end === -1 && tokenChars[code] === 1) {\n      if (start === -1) start = i;\n    } else if (\n      i !== 0 &&\n      (code === 0x20 /* ' ' */ || code === 0x09) /* '\\t' */\n    ) {\n      if (end === -1 && start !== -1) end = i;\n    } else if (code === 0x2c /* ',' */) {\n      if (start === -1) {\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      }\n\n      if (end === -1) end = i;\n\n      const protocol = header.slice(start, end);\n\n      if (protocols.has(protocol)) {\n        throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n      }\n\n      protocols.add(protocol);\n      start = end = -1;\n    } else {\n      throw new SyntaxError(`Unexpected character at index ${i}`);\n    }\n  }\n\n  if (start === -1 || end !== -1) {\n    throw new SyntaxError('Unexpected end of input');\n  }\n\n  const protocol = header.slice(start, i);\n\n  if (protocols.has(protocol)) {\n    throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n  }\n\n  protocols.add(protocol);\n  return protocols;\n}\n\nmodule.exports = { parse };\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Duplex$\", \"caughtErrors\": \"none\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst http = require('http');\nconst { Duplex } = require('stream');\nconst { createHash } = require('crypto');\n\nconst extension = require('./extension');\nconst PerMessageDeflate = require('./permessage-deflate');\nconst subprotocol = require('./subprotocol');\nconst WebSocket = require('./websocket');\nconst { CLOSE_TIMEOUT, GUID, kWebSocket } = require('./constants');\n\nconst keyRegex = /^[+/0-9A-Za-z]{22}==$/;\n\nconst RUNNING = 0;\nconst CLOSING = 1;\nconst CLOSED = 2;\n\n/**\n * Class representing a WebSocket server.\n *\n * @extends EventEmitter\n */\nclass WebSocketServer extends EventEmitter {\n  /**\n   * Create a `WebSocketServer` instance.\n   *\n   * @param {Object} options Configuration options\n   * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether\n   *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted\n   *     multiple times in the same tick\n   * @param {Boolean} [options.autoPong=true] Specifies whether or not to\n   *     automatically send a pong in response to a ping\n   * @param {Number} [options.backlog=511] The maximum length of the queue of\n   *     pending connections\n   * @param {Boolean} [options.clientTracking=true] Specifies whether or not to\n   *     track clients\n   * @param {Number} [options.closeTimeout=30000] Duration in milliseconds to\n   *     wait for the closing handshake to finish after `websocket.close()` is\n   *     called\n   * @param {Function} [options.handleProtocols] A hook to handle protocols\n   * @param {String} [options.host] The hostname where to bind the server\n   * @param {Number} [options.maxBufferedChunks=262144] The maximum number of\n   *     buffered data chunks\n   * @param {Number} [options.maxFragments=16384] The maximum number of message\n   *     fragments\n   * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n   *     size\n   * @param {Boolean} [options.noServer=false] Enable no server mode\n   * @param {String} [options.path] Accept only connections matching this path\n   * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable\n   *     permessage-deflate\n   * @param {Number} [options.port] The port where to bind the server\n   * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S\n   *     server to use\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   * @param {Function} [options.verifyClient] A hook to reject connections\n   * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`\n   *     class to use. It must be the `WebSocket` class or class that extends it\n   * @param {Function} [callback] A listener for the `listening` event\n   */\n  constructor(options, callback) {\n    super();\n\n    options = {\n      allowSynchronousEvents: true,\n      autoPong: true,\n      maxBufferedChunks: 256 * 1024,\n      maxFragments: 16 * 1024,\n      maxPayload: 100 * 1024 * 1024,\n      skipUTF8Validation: false,\n      perMessageDeflate: false,\n      handleProtocols: null,\n      clientTracking: true,\n      closeTimeout: CLOSE_TIMEOUT,\n      verifyClient: null,\n      noServer: false,\n      backlog: null, // use default (511 as implemented in net.js)\n      server: null,\n      host: null,\n      path: null,\n      port: null,\n      WebSocket,\n      ...options\n    };\n\n    if (\n      (options.port == null && !options.server && !options.noServer) ||\n      (options.port != null && (options.server || options.noServer)) ||\n      (options.server && options.noServer)\n    ) {\n      throw new TypeError(\n        'One and only one of the \"port\", \"server\", or \"noServer\" options ' +\n          'must be specified'\n      );\n    }\n\n    if (options.port != null) {\n      this._server = http.createServer((req, res) => {\n        const body = http.STATUS_CODES[426];\n\n        res.writeHead(426, {\n          'Content-Length': body.length,\n          'Content-Type': 'text/plain'\n        });\n        res.end(body);\n      });\n      this._server.listen(\n        options.port,\n        options.host,\n        options.backlog,\n        callback\n      );\n    } else if (options.server) {\n      this._server = options.server;\n    }\n\n    if (this._server) {\n      const emitConnection = this.emit.bind(this, 'connection');\n\n      this._removeListeners = addListeners(this._server, {\n        listening: this.emit.bind(this, 'listening'),\n        error: this.emit.bind(this, 'error'),\n        upgrade: (req, socket, head) => {\n          this.handleUpgrade(req, socket, head, emitConnection);\n        }\n      });\n    }\n\n    if (options.perMessageDeflate === true) options.perMessageDeflate = {};\n    if (options.clientTracking) {\n      this.clients = new Set();\n      this._shouldEmitClose = false;\n    }\n\n    this.options = options;\n    this._state = RUNNING;\n  }\n\n  /**\n   * Returns the bound address, the address family name, and port of the server\n   * as reported by the operating system if listening on an IP socket.\n   * If the server is listening on a pipe or UNIX domain socket, the name is\n   * returned as a string.\n   *\n   * @return {(Object|String|null)} The address of the server\n   * @public\n   */\n  address() {\n    if (this.options.noServer) {\n      throw new Error('The server is operating in \"noServer\" mode');\n    }\n\n    if (!this._server) return null;\n    return this._server.address();\n  }\n\n  /**\n   * Stop the server from accepting new connections and emit the `'close'` event\n   * when all existing connections are closed.\n   *\n   * @param {Function} [cb] A one-time listener for the `'close'` event\n   * @public\n   */\n  close(cb) {\n    if (this._state === CLOSED) {\n      if (cb) {\n        this.once('close', () => {\n          cb(new Error('The server is not running'));\n        });\n      }\n\n      process.nextTick(emitClose, this);\n      return;\n    }\n\n    if (cb) this.once('close', cb);\n\n    if (this._state === CLOSING) return;\n    this._state = CLOSING;\n\n    if (this.options.noServer || this.options.server) {\n      if (this._server) {\n        this._removeListeners();\n        this._removeListeners = this._server = null;\n      }\n\n      if (this.clients) {\n        if (!this.clients.size) {\n          process.nextTick(emitClose, this);\n        } else {\n          this._shouldEmitClose = true;\n        }\n      } else {\n        process.nextTick(emitClose, this);\n      }\n    } else {\n      const server = this._server;\n\n      this._removeListeners();\n      this._removeListeners = this._server = null;\n\n      //\n      // The HTTP/S server was created internally. Close it, and rely on its\n      // `'close'` event.\n      //\n      server.close(() => {\n        emitClose(this);\n      });\n    }\n  }\n\n  /**\n   * See if a given request should be handled by this server instance.\n   *\n   * @param {http.IncomingMessage} req Request object to inspect\n   * @return {Boolean} `true` if the request is valid, else `false`\n   * @public\n   */\n  shouldHandle(req) {\n    if (this.options.path) {\n      const index = req.url.indexOf('?');\n      const pathname = index !== -1 ? req.url.slice(0, index) : req.url;\n\n      if (pathname !== this.options.path) return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Handle a HTTP Upgrade request.\n   *\n   * @param {http.IncomingMessage} req The request object\n   * @param {Duplex} socket The network socket between the server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Function} cb Callback\n   * @public\n   */\n  handleUpgrade(req, socket, head, cb) {\n    socket.on('error', socketOnError);\n\n    const key = req.headers['sec-websocket-key'];\n    const upgrade = req.headers.upgrade;\n    const version = +req.headers['sec-websocket-version'];\n\n    if (req.method !== 'GET') {\n      const message = 'Invalid HTTP method';\n      abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);\n      return;\n    }\n\n    if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') {\n      const message = 'Invalid Upgrade header';\n      abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n      return;\n    }\n\n    if (key === undefined || !keyRegex.test(key)) {\n      const message = 'Missing or invalid Sec-WebSocket-Key header';\n      abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n      return;\n    }\n\n    if (version !== 13 && version !== 8) {\n      const message = 'Missing or invalid Sec-WebSocket-Version header';\n      abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, {\n        'Sec-WebSocket-Version': '13, 8'\n      });\n      return;\n    }\n\n    if (!this.shouldHandle(req)) {\n      abortHandshake(socket, 400);\n      return;\n    }\n\n    const secWebSocketProtocol = req.headers['sec-websocket-protocol'];\n    let protocols = new Set();\n\n    if (secWebSocketProtocol !== undefined) {\n      try {\n        protocols = subprotocol.parse(secWebSocketProtocol);\n      } catch (err) {\n        const message = 'Invalid Sec-WebSocket-Protocol header';\n        abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n        return;\n      }\n    }\n\n    const secWebSocketExtensions = req.headers['sec-websocket-extensions'];\n    const extensions = {};\n\n    if (\n      this.options.perMessageDeflate &&\n      secWebSocketExtensions !== undefined\n    ) {\n      const perMessageDeflate = new PerMessageDeflate({\n        ...this.options.perMessageDeflate,\n        isServer: true,\n        maxPayload: this.options.maxPayload\n      });\n\n      try {\n        const offers = extension.parse(secWebSocketExtensions);\n\n        if (offers[PerMessageDeflate.extensionName]) {\n          perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);\n          extensions[PerMessageDeflate.extensionName] = perMessageDeflate;\n        }\n      } catch (err) {\n        const message =\n          'Invalid or unacceptable Sec-WebSocket-Extensions header';\n        abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n        return;\n      }\n    }\n\n    //\n    // Optionally call external client verification handler.\n    //\n    if (this.options.verifyClient) {\n      const info = {\n        origin:\n          req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],\n        secure: !!(req.socket.authorized || req.socket.encrypted),\n        req\n      };\n\n      if (this.options.verifyClient.length === 2) {\n        this.options.verifyClient(info, (verified, code, message, headers) => {\n          if (!verified) {\n            return abortHandshake(socket, code || 401, message, headers);\n          }\n\n          this.completeUpgrade(\n            extensions,\n            key,\n            protocols,\n            req,\n            socket,\n            head,\n            cb\n          );\n        });\n        return;\n      }\n\n      if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);\n    }\n\n    this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n  }\n\n  /**\n   * Upgrade the connection to WebSocket.\n   *\n   * @param {Object} extensions The accepted extensions\n   * @param {String} key The value of the `Sec-WebSocket-Key` header\n   * @param {Set} protocols The subprotocols\n   * @param {http.IncomingMessage} req The request object\n   * @param {Duplex} socket The network socket between the server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Function} cb Callback\n   * @throws {Error} If called more than once with the same socket\n   * @private\n   */\n  completeUpgrade(extensions, key, protocols, req, socket, head, cb) {\n    //\n    // Destroy the socket if the client has already sent a FIN packet.\n    //\n    if (!socket.readable || !socket.writable) return socket.destroy();\n\n    if (socket[kWebSocket]) {\n      throw new Error(\n        'server.handleUpgrade() was called more than once with the same ' +\n          'socket, possibly due to a misconfiguration'\n      );\n    }\n\n    if (this._state > RUNNING) return abortHandshake(socket, 503);\n\n    const digest = createHash('sha1')\n      .update(key + GUID)\n      .digest('base64');\n\n    const headers = [\n      'HTTP/1.1 101 Switching Protocols',\n      'Upgrade: websocket',\n      'Connection: Upgrade',\n      `Sec-WebSocket-Accept: ${digest}`\n    ];\n\n    const ws = new this.options.WebSocket(null, undefined, this.options);\n\n    if (protocols.size) {\n      //\n      // Optionally call external protocol selection handler.\n      //\n      const protocol = this.options.handleProtocols\n        ? this.options.handleProtocols(protocols, req)\n        : protocols.values().next().value;\n\n      if (protocol) {\n        headers.push(`Sec-WebSocket-Protocol: ${protocol}`);\n        ws._protocol = protocol;\n      }\n    }\n\n    if (extensions[PerMessageDeflate.extensionName]) {\n      const params = extensions[PerMessageDeflate.extensionName].params;\n      const value = extension.format({\n        [PerMessageDeflate.extensionName]: [params]\n      });\n      headers.push(`Sec-WebSocket-Extensions: ${value}`);\n      ws._extensions = extensions;\n    }\n\n    //\n    // Allow external modification/inspection of handshake headers.\n    //\n    this.emit('headers', headers, req);\n\n    socket.write(headers.concat('\\r\\n').join('\\r\\n'));\n    socket.removeListener('error', socketOnError);\n\n    ws.setSocket(socket, head, {\n      allowSynchronousEvents: this.options.allowSynchronousEvents,\n      maxBufferedChunks: this.options.maxBufferedChunks,\n      maxFragments: this.options.maxFragments,\n      maxPayload: this.options.maxPayload,\n      skipUTF8Validation: this.options.skipUTF8Validation\n    });\n\n    if (this.clients) {\n      this.clients.add(ws);\n      ws.on('close', () => {\n        this.clients.delete(ws);\n\n        if (this._shouldEmitClose && !this.clients.size) {\n          process.nextTick(emitClose, this);\n        }\n      });\n    }\n\n    cb(ws, req);\n  }\n}\n\nmodule.exports = WebSocketServer;\n\n/**\n * Add event listeners on an `EventEmitter` using a map of <event, listener>\n * pairs.\n *\n * @param {EventEmitter} server The event emitter\n * @param {Object.<String, Function>} map The listeners to add\n * @return {Function} A function that will remove the added listeners when\n *     called\n * @private\n */\nfunction addListeners(server, map) {\n  for (const event of Object.keys(map)) server.on(event, map[event]);\n\n  return function removeListeners() {\n    for (const event of Object.keys(map)) {\n      server.removeListener(event, map[event]);\n    }\n  };\n}\n\n/**\n * Emit a `'close'` event on an `EventEmitter`.\n *\n * @param {EventEmitter} server The event emitter\n * @private\n */\nfunction emitClose(server) {\n  server._state = CLOSED;\n  server.emit('close');\n}\n\n/**\n * Handle socket errors.\n *\n * @private\n */\nfunction socketOnError() {\n  this.destroy();\n}\n\n/**\n * Close the connection when preconditions are not fulfilled.\n *\n * @param {Duplex} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} [message] The HTTP response body\n * @param {Object} [headers] Additional HTTP response headers\n * @private\n */\nfunction abortHandshake(socket, code, message, headers) {\n  //\n  // The socket is writable unless the user destroyed or ended it before calling\n  // `server.handleUpgrade()` or in the `verifyClient` function, which is a user\n  // error. Handling this does not make much sense as the worst that can happen\n  // is that some of the data written by the user might be discarded due to the\n  // call to `socket.end()` below, which triggers an `'error'` event that in\n  // turn causes the socket to be destroyed.\n  //\n  message = message || http.STATUS_CODES[code];\n  headers = {\n    Connection: 'close',\n    'Content-Type': 'text/html',\n    'Content-Length': Buffer.byteLength(message),\n    ...headers\n  };\n\n  socket.once('finish', socket.destroy);\n\n  socket.end(\n    `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\\r\\n` +\n      Object.keys(headers)\n        .map((h) => `${h}: ${headers[h]}`)\n        .join('\\r\\n') +\n      '\\r\\n\\r\\n' +\n      message\n  );\n}\n\n/**\n * Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least\n * one listener for it, otherwise call `abortHandshake()`.\n *\n * @param {WebSocketServer} server The WebSocket server\n * @param {http.IncomingMessage} req The request object\n * @param {Duplex} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} message The HTTP response body\n * @param {Object} [headers] The HTTP response headers\n * @private\n */\nfunction abortHandshakeOrEmitwsClientError(\n  server,\n  req,\n  socket,\n  code,\n  message,\n  headers\n) {\n  if (server.listenerCount('wsClientError')) {\n    const err = new Error(message);\n    Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);\n\n    server.emit('wsClientError', err, socket, req);\n  } else {\n    abortHandshake(socket, code, message, headers);\n  }\n}\n","import createWebSocketStream from './lib/stream.js';\nimport extension from './lib/extension.js';\nimport PerMessageDeflate from './lib/permessage-deflate.js';\nimport Receiver from './lib/receiver.js';\nimport Sender from './lib/sender.js';\nimport subprotocol from './lib/subprotocol.js';\nimport WebSocket from './lib/websocket.js';\nimport WebSocketServer from './lib/websocket-server.js';\n\nexport {\n  createWebSocketStream,\n  extension,\n  PerMessageDeflate,\n  Receiver,\n  Sender,\n  subprotocol,\n  WebSocket,\n  WebSocketServer\n};\n\nexport default WebSocket;\n","import \"./src/constants/contextApi.mjs\";\nimport { isPoSessionSetupError } from \"./src/schemas/headless.mjs\";\nimport { normalizeSessionGroups } from \"./src/schemas/sessionProtocol.mjs\";\nimport { harnessErrorMessage } from \"./src/server/harnessErrorMessage.mjs\";\nimport { readContextDetail } from \"./contextDetailStore.mjs\";\nimport { observe } from \"./serverTelemetry.mjs\";\nimport { PO_API_CALLER_HEADERS, PO_API_CALLER_LOCALITY_HEADER, PO_API_CALLER_STEP_UP_HEADER, parsePoSocketPath } from \"./src/schemas/packageApi.mjs\";\nimport \"./packageApi.mjs\";\nimport { SESSION_FILES_API } from \"./src/constants/sessionFiles.mjs\";\nimport { writeSessionAttachment } from \"./src/services/sessionAttachments/index.mjs\";\nimport { createSessionMcpActivityStore } from \"./src/services/sessionMcpActivity/index.mjs\";\nimport { createSessionMcpConversationStore } from \"./src/services/sessionMcpConversations/index.mjs\";\nimport { createSessionMcpRegistrationStore } from \"./src/services/sessionMcpRegistrationStore/index.mjs\";\nimport { createContextApi } from \"./runtimeContextApi.mjs\";\nimport { createHeadlessProtocol } from \"./headlessProtocol.mjs\";\nimport { createSessionMcpRoutes, isPublicSessionMcpRoute, isSessionMcpHostRoute } from \"./src/server/sessionMcpRoutes.mjs\";\nimport { createHash, timingSafeEqual } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { BACKGROUND_CONTEXT } from \"@earendil-works/chord/context\";\nimport { createServer } from \"node:http\";\nimport { webSocketLink } from \"@earendil-works/chord\";\nimport { Readable } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport { WebSocketServer } from \"ws\";\n//#region src/server/headlessServer.ts\n/**\n* The canonical public shape of a package API request, as dispatch reads it.\n*\n* Groups: workspace id, session id, plugin base path, and the remainder handed\n* to the package. `settings` is the host's own API and sits beside `plugins`\n* rather than under it.\n*\n* Exported so the browser's URL construction can be pinned against it. The two\n* are written independently, in halves of this package that may not import each\n* other, and a disagreement between them is not a 404 from the route: the\n* service worker answers an unrecognised path out of the signed bundle cache,\n* so the symptom appears nowhere near the cause.\n*/\nconst PO_PACKAGE_API_PATH_PATTERN = /^\\/api(?:\\/workspaces\\/([^/]+)(?:\\/sessions\\/([^/]+))?)?\\/(?:plugins\\/([^/]+)|settings)(?:\\/(.*))?$/u;\nconst HEALTH_ROLE = \"hub\";\nconst PROTOCOL_VERSION = 1;\nconst MAX_BODY_BYTES = 8388608;\n/** Body and WebSocket frame cap for package public routes. */\nconst PUBLIC_MAX_BYTES = 1048576;\nconst PUBLIC_PLUGIN_PATH = /^\\/api\\/plugins\\/([^/]+)(\\/.*)?$/u;\nconst LOOPBACK_HOST = /^(?:127\\.0\\.0\\.1|localhost|\\[::1\\])(?::\\d+)?$/iu;\nconst LOOPBACK_PEERS = /* @__PURE__ */ new Set([\n\t\"127.0.0.1\",\n\t\"::1\",\n\t\"::ffff:127.0.0.1\"\n]);\nconst EXTENSION_ORIGIN_PREFIX = \"chrome-extension://\";\n/**\n* Headers that mark a forwarded request. The remote runtime's forward always attaches the host token\n* and sealed requests carry caller stamps, so a public route answers any of these with 404.\n*/\nconst FORWARDED_MARKERS = [\n\t\"x-po-token\",\n\t...PO_API_CALLER_HEADERS,\n\t\"forwarded\",\n\t\"x-forwarded-for\",\n\t\"x-forwarded-host\",\n\t\"cf-connecting-ip\",\n\t\"cf-ray\"\n];\nconst DIRECTORY_SUGGESTION_LIMIT = 12;\nconst DIRECTORY_CHILDREN_LIMIT = 500;\nconst HOME_PREFIX = \"~\";\nconst WORKSPACE_NAME_MAX_LENGTH = 80;\nconst WORKSPACE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9 ._-]*$/u;\n/** Restart closes the session host, which aborts a running turn, so it waits for idle. */\nconst RESTART_WHILE_RUNNING_ERROR = \"The session is running a turn. Stop it or wait for it to finish before reloading extensions.\";\nfunction sessionView(session) {\n\treturn {\n\t\tid: session.id,\n\t\tworkspaceId: session.workspaceId,\n\t\twebComposition: session.webComposition,\n\t\tnativeComposition: session.nativeComposition,\n\t\tname: session.name,\n\t\tcwd: session.cwd,\n\t\tcreatedAt: session.createdAt,\n\t\tupdatedAt: session.updatedAt ?? session.createdAt,\n\t\tphase: session.phase ?? \"idle\",\n\t\tphaseSince: session.phaseSince ?? session.createdAt,\n\t\tattach: \"attached\",\n\t\tpendingMessageCount: session.pendingMessageCount ?? 0,\n\t\teverPrompted: session.everPrompted ?? false,\n\t\tawaitingInput: session.awaitingInput ?? false,\n\t\t...session.lastSettledAt === void 0 ? {} : { lastSettledAt: session.lastSettledAt },\n\t\t...session.backgroundWorkActive === void 0 ? {} : { backgroundWorkActive: session.backgroundWorkActive },\n\t\t...session.git === void 0 ? {} : { git: { ...session.git } },\n\t\t...session.profile === void 0 ? {} : { profile: { ...session.profile } },\n\t\t...session.parentSessionId === void 0 ? {} : { parentSessionId: session.parentSessionId },\n\t\t...session.sessionProvenance === void 0 ? {} : { sessionProvenance: session.sessionProvenance },\n\t\t...session.groups === void 0 || session.groups.length === 0 ? {} : { groups: [...session.groups] },\n\t\t...session.pendingSetups === void 0 ? {} : { pendingSetups: session.pendingSetups },\n\t\t...session.activity === void 0 ? {} : { activity: { ...session.activity } }\n\t};\n}\n/** The dormant counterpart of `sessionView`; same shape, no runtime behind it. */\nfunction dormantView(record) {\n\treturn {\n\t\tid: record.sessionId,\n\t\tworkspaceId: record.workspaceId,\n\t\tname: record.name,\n\t\tcwd: record.cwd,\n\t\tcreatedAt: record.createdAt,\n\t\tupdatedAt: record.createdAt,\n\t\tphase: \"idle\",\n\t\tphaseSince: record.createdAt,\n\t\tattach: \"detached\",\n\t\tpendingMessageCount: 0,\n\t\teverPrompted: false,\n\t\tawaitingInput: false,\n\t\tdormant: true,\n\t\t...record.parentSessionId === void 0 ? {} : { parentSessionId: record.parentSessionId },\n\t\t...record.sessionProvenance === void 0 ? {} : { sessionProvenance: record.sessionProvenance },\n\t\t...record.groups === void 0 || record.groups.length === 0 ? {} : { groups: [...record.groups] }\n\t};\n}\nfunction json(response, status, value) {\n\tconst body = JSON.stringify(value);\n\tresponse.writeHead(status, {\n\t\t\"content-type\": \"application/json; charset=utf-8\",\n\t\t\"content-length\": Buffer.byteLength(body)\n\t});\n\tresponse.end(body);\n}\nconst tokenDigest = (value) => createHash(\"sha256\").update(value).digest();\n/** Compares fixed-length digests, so neither the length nor the content of the token leaks through timing. */\nfunction tokenMatches(candidate, token) {\n\treturn typeof candidate === \"string\" && timingSafeEqual(tokenDigest(candidate), tokenDigest(token));\n}\nfunction authorized(request, token) {\n\tif (token === void 0) return true;\n\tconst authorization = request.headers.authorization;\n\tif (authorization?.startsWith(\"Bearer \") && tokenMatches(authorization.slice(7), token)) return true;\n\tconst header = request.headers[\"x-po-token\"];\n\tif (typeof header === \"string\" && tokenMatches(header, token)) return true;\n\ttry {\n\t\treturn tokenMatches(new URL(request.url ?? \"/\", \"http://po.local\").searchParams.get(\"token\"), token);\n\t} catch {\n\t\treturn false;\n\t}\n}\n/** Why a public route refuses a request before authentication: 404 when forwarded, 403 when not local. */\nfunction publicRefusal(request) {\n\tif (FORWARDED_MARKERS.some((name) => request.headers[name] !== void 0)) return 404;\n\tconst origin = request.headers.origin;\n\tif (!LOOPBACK_HOST.test(request.headers.host ?? \"\") || !LOOPBACK_PEERS.has(request.socket.remoteAddress ?? \"\") || origin !== void 0 && !origin.startsWith(EXTENSION_ORIGIN_PREFIX)) return 403;\n}\n/** Headers a public route sees: never Host, and never the host token or caller stamps. */\nfunction publicHeaders(request, token) {\n\tconst headers = new Headers();\n\tfor (const [name, value] of Object.entries(request.headers)) {\n\t\tif (value === void 0 || name === \"host\") continue;\n\t\tconst joined = Array.isArray(value) ? value.join(\", \") : value;\n\t\tif (name === \"authorization\" && token !== void 0 && joined.startsWith(\"Bearer \") && tokenMatches(joined.slice(7), token)) continue;\n\t\theaders.set(name, joined);\n\t}\n\treturn headers;\n}\n/** Adapts an accepted `ws` socket. Its default binary type delivers every frame as one Buffer. */\nfunction apiSocket(client) {\n\treturn {\n\t\tget isOpen() {\n\t\t\treturn client.readyState === client.OPEN;\n\t\t},\n\t\tsend: (data) => client.send(data),\n\t\tclose: (code, reason) => client.close(code, reason),\n\t\tonMessage: (listener) => {\n\t\t\tclient.on(\"message\", (data, isBinary) => {\n\t\t\t\tconst bytes = data;\n\t\t\t\tlistener(isBinary ? bytes : bytes.toString(\"utf8\"));\n\t\t\t});\n\t\t},\n\t\tonClose: (listener) => {\n\t\t\tclient.on(\"close\", (code, reason) => listener(code, reason.toString(\"utf8\")));\n\t\t}\n\t};\n}\nfunction requestPath(request) {\n\treturn new URL(request.url ?? \"/\", \"http://po.local\");\n}\nfunction parseTranscriptRequest(url) {\n\tconst request = {};\n\tconst cursor = url.searchParams.get(\"cursor\");\n\tconst direction = url.searchParams.get(\"direction\");\n\tconst limit = url.searchParams.get(\"limit\");\n\tif (cursor !== null) request.cursor = cursor;\n\tif (direction !== null) {\n\t\tif (direction !== \"older\" && direction !== \"newer\") throw new Error(\"Invalid transcript direction\");\n\t\trequest.direction = direction;\n\t}\n\tif (limit !== null) {\n\t\tif (!/^\\d+$/u.test(limit)) throw new Error(\"Invalid transcript page limit\");\n\t\tconst parsed = Number(limit);\n\t\tif (!Number.isSafeInteger(parsed) || parsed < 1 || parsed > 100) throw new Error(\"Invalid transcript page limit\");\n\t\trequest.limit = parsed;\n\t}\n\treturn request;\n}\n/** Expands a leading `~` the way a shell would, so typed paths match what the user sees in a terminal. */\nfunction expandHome(value) {\n\tif (value === HOME_PREFIX) return os.homedir();\n\treturn value.startsWith(`${HOME_PREFIX}${path.sep}`) ? path.join(os.homedir(), value.slice(2)) : value;\n}\n/**\n* Validates an add-workspace request. A name alone asks for a new default folder,\n* so it must be safe to use as one folder name.\n*/\nfunction parseWorkspaceAdmission(body) {\n\tif (typeof body !== \"object\" || body === null) return { error: \"A workspace root or name is required.\" };\n\tconst record = body;\n\tif (record.root !== void 0 && typeof record.root !== \"string\") return { error: \"The workspace root must be text.\" };\n\tif (record.name !== void 0 && typeof record.name !== \"string\") return { error: \"The workspace name must be text.\" };\n\tconst root = typeof record.root === \"string\" && record.root.trim() !== \"\" ? expandHome(record.root.trim()) : void 0;\n\tconst name = typeof record.name === \"string\" && record.name.trim() !== \"\" ? record.name.trim() : void 0;\n\tif (root === void 0 && name === void 0) return { error: \"A workspace root or name is required.\" };\n\tif (root !== void 0 && !path.isAbsolute(root)) return { error: `Use a full folder path, such as ~/${root}, or pick a suggestion.` };\n\tif (name !== void 0 && (name.length > WORKSPACE_NAME_MAX_LENGTH || !WORKSPACE_NAME_PATTERN.test(name) || name.includes(\"..\"))) return { error: `Workspace names use letters, numbers, spaces, dots, dashes, or underscores (up to ${String(WORKSPACE_NAME_MAX_LENGTH)} characters).` };\n\treturn {\n\t\t...root === void 0 ? {} : { root },\n\t\t...name === void 0 ? {} : { name }\n\t};\n}\nasync function directorySuggestions(query, sessions) {\n\tconst typed = expandHome(query.trim());\n\tif (typed === \"\") return [];\n\tconst matches = (value) => value.toLowerCase().includes(typed.toLowerCase());\n\tconst known = [.../* @__PURE__ */ new Set([process.cwd(), ...sessions.map((session) => session.cwd)])].filter(matches);\n\tconst candidates = path.isAbsolute(typed) ? [typed] : typed.includes(path.sep) ? [path.resolve(process.cwd(), typed)] : [path.join(path.dirname(process.cwd()), typed), path.join(process.cwd(), typed)];\n\tconst completed = [];\n\tfor (const candidate of candidates) {\n\t\tconst drilling = typed.endsWith(path.sep);\n\t\tconst parent = drilling ? candidate : path.dirname(candidate);\n\t\tconst partial = drilling ? \"\" : path.basename(candidate).toLowerCase();\n\t\ttry {\n\t\t\tconst entries = await fs.promises.readdir(parent, { withFileTypes: true });\n\t\t\tcompleted.push(...entries.filter((entry) => entry.isDirectory() && entry.name.toLowerCase().includes(partial)).map((entry) => path.join(parent, entry.name)));\n\t\t} catch {}\n\t}\n\treturn [.../* @__PURE__ */ new Set([...known, ...completed.sort((left, right) => left.localeCompare(right))])].slice(0, DIRECTORY_SUGGESTION_LIMIT);\n}\n/**\n* Lists the visible child directories of one folder for the workspace folder browser.\n* Resolves undefined for a relative, missing, or unreadable path.\n*/\nasync function directoryChildren(requested) {\n\tconst directory = requested === null || requested.trim() === \"\" ? os.homedir() : expandHome(requested.trim());\n\tif (!path.isAbsolute(directory)) return void 0;\n\tconst resolved = path.resolve(directory);\n\tlet entries;\n\ttry {\n\t\tentries = await fs.promises.readdir(resolved, { withFileTypes: true });\n\t} catch {\n\t\treturn;\n\t}\n\tconst directories = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(\".\")).map((entry) => path.join(resolved, entry.name)).sort((left, right) => left.localeCompare(right)).slice(0, DIRECTORY_CHILDREN_LIMIT);\n\tconst parent = path.dirname(resolved);\n\treturn {\n\t\tpath: resolved,\n\t\t...parent === resolved ? {} : { parent },\n\t\tdirectories\n\t};\n}\nconst PO_FOLDER_SCAN_DEPTH = 3;\nconst PO_FOLDER_SCAN_VISIT_LIMIT = 2e3;\nconst PO_FOLDER_LIMIT = 20;\nconst PO_FOLDER_SKIP = /* @__PURE__ */ new Set([\"node_modules\", \"Library\"]);\n/**\n* Folders under home that already hold a `.po` folder, for first-run onboarding.\n* Home itself is skipped: its `.po` is Po's own home, not a workspace.\n*/\nasync function poFolders() {\n\tconst found = [];\n\tlet level = [os.homedir()];\n\tlet visited = 0;\n\tfor (let depth = 1; depth <= PO_FOLDER_SCAN_DEPTH && level.length > 0; depth++) {\n\t\tconst next = [];\n\t\tfor (const parent of level) {\n\t\t\tif (visited++ >= PO_FOLDER_SCAN_VISIT_LIMIT || found.length >= PO_FOLDER_LIMIT) return found;\n\t\t\tlet entries;\n\t\t\ttry {\n\t\t\t\tentries = await fs.promises.readdir(parent, { withFileTypes: true });\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (!entry.isDirectory() || entry.name.startsWith(\".\") || PO_FOLDER_SKIP.has(entry.name)) continue;\n\t\t\t\tconst child = path.join(parent, entry.name);\n\t\t\t\tif (fs.existsSync(path.join(child, \".po\"))) found.push(child);\n\t\t\t\telse next.push(child);\n\t\t\t}\n\t\t}\n\t\tlevel = next;\n\t}\n\treturn found.slice(0, PO_FOLDER_LIMIT);\n}\nvar RequestBodyTooLargeError = class extends Error {\n\tconstructor() {\n\t\tsuper(\"Request body is too large.\");\n\t}\n};\nasync function readBody(request, limit = MAX_BODY_BYTES) {\n\tconst chunks = [];\n\tlet size = 0;\n\tfor await (const chunk of request) {\n\t\tconst buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);\n\t\tsize += buffer.byteLength;\n\t\tif (size > limit) throw new RequestBodyTooLargeError();\n\t\tchunks.push(buffer);\n\t}\n\treturn Buffer.concat(chunks);\n}\nfunction parseJson(body) {\n\tif (body.byteLength === 0) return {};\n\treturn JSON.parse(Buffer.from(body).toString(\"utf8\"));\n}\nfunction webRequest(request, url, signal) {\n\tconst headers = new Headers();\n\tfor (const [name, value] of Object.entries(request.headers)) if (value !== void 0) headers.set(name, Array.isArray(value) ? value.join(\", \") : value);\n\treturn new Request(url, {\n\t\tmethod: request.method,\n\t\theaders,\n\t\tsignal,\n\t\t...request.method === \"GET\" || request.method === \"HEAD\" ? {} : {\n\t\t\tbody: Readable.toWeb(request),\n\t\t\tduplex: \"half\"\n\t\t}\n\t});\n}\nasync function writeResponse(response, result) {\n\tresponse.writeHead(result.status, Object.fromEntries(result.headers.entries()));\n\tif (result.body === null) {\n\t\tresponse.end();\n\t\treturn;\n\t}\n\tawait pipeline(Readable.fromWeb(result.body), response);\n}\n/**\n* Client-neutral HTTP and WebSocket boundary for the process-local headless hub.\n* It deliberately delegates every session operation to HeadlessHub, so transport\n* clients cannot create a second session backend or bypass its lifecycle.\n*/\nasync function serveHeadlessServer(options) {\n\tconst clients = /* @__PURE__ */ new Set();\n\tconst desktopAuthorized = (request) => {\n\t\tconst proof = request.headers[\"x-po-desktop\"];\n\t\treturn typeof proof === \"string\" && options.headlessHub.computerUse?.authorize?.(new Headers({ \"x-po-desktop\": proof })) === true;\n\t};\n\tconst computerUseAuthorized = (sessionId, request) => {\n\t\tif (desktopAuthorized(request)) return true;\n\t\tif (!authorized(request, options.token)) return false;\n\t\tconst headers = new Headers();\n\t\tfor (const [name, value] of Object.entries(request.headers)) if (value !== void 0) headers.set(name, Array.isArray(value) ? value.join(\", \") : value);\n\t\treturn options.headlessHub.computerUse?.authorizeSession?.(sessionId, headers) === true;\n\t};\n\tconst activationAuthorized = (request) => {\n\t\tif (!authorized(request, options.token)) return false;\n\t\tconst headers = new Headers();\n\t\tfor (const [name, value] of Object.entries(request.headers)) if (value !== void 0) headers.set(name, Array.isArray(value) ? value.join(\", \") : value);\n\t\treturn options.headlessHub.computerUse?.authorizeActivation?.(headers) === true;\n\t};\n\tconst pendingAuthorized = (sessionId, request) => {\n\t\tif (!authorized(request, options.token)) return false;\n\t\tconst headers = new Headers();\n\t\tfor (const [name, value] of Object.entries(request.headers)) if (value !== void 0) headers.set(name, Array.isArray(value) ? value.join(\", \") : value);\n\t\treturn options.headlessHub.computerUse?.authorizePending?.(sessionId, headers) === true;\n\t};\n\tconst recordingAuthorized = (sessionId, request) => {\n\t\tif (!authorized(request, options.token)) return false;\n\t\tconst headers = new Headers();\n\t\tfor (const [name, value] of Object.entries(request.headers)) if (value !== void 0) headers.set(name, Array.isArray(value) ? value.join(\", \") : value);\n\t\treturn options.headlessHub.computerUse?.authorizeRecording?.(sessionId, headers) === true;\n\t};\n\tlet closed = false;\n\tconst webSockets = new WebSocketServer({\n\t\tnoServer: true,\n\t\t...options.webSocketMaxPayload === void 0 ? {} : { maxPayload: options.webSocketMaxPayload }\n\t});\n\tconst publicRoutes = options.publicRoutes !== false;\n\tconst publicSockets = new WebSocketServer({\n\t\tnoServer: true,\n\t\tmaxPayload: PUBLIC_MAX_BYTES\n\t});\n\t/** A declared public route of a global API; every other plugin path keeps the host token. */\n\tconst publicRouteFor = (url) => {\n\t\tif (!publicRoutes) return void 0;\n\t\tconst match = PUBLIC_PLUGIN_PATH.exec(url.pathname);\n\t\tif (match === null) return void 0;\n\t\tlet basePath;\n\t\ttry {\n\t\t\tbasePath = decodeURIComponent(match[1]);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tconst api = options.headlessHub.publicApi(basePath);\n\t\tconst routePath = match[2] ?? \"/\";\n\t\tconst declared = api?.routes.paths.some((prefix) => routePath === prefix || routePath.startsWith(prefix.endsWith(\"/\") ? prefix : `${prefix}/`));\n\t\treturn api === void 0 || declared !== true ? void 0 : {\n\t\t\tpath: routePath,\n\t\t\t...api\n\t\t};\n\t};\n\t/** The request a public route sees, without the host's own `token` query parameter. */\n\tconst publicRequest = (request, url, route, body) => {\n\t\tconst target = new URL(`http://po.local${route.path}${url.search}`);\n\t\ttarget.searchParams.delete(\"token\");\n\t\treturn new Request(target, {\n\t\t\tmethod: request.method,\n\t\t\theaders: publicHeaders(request, options.token),\n\t\t\t...body === void 0 ? {} : { body: Buffer.from(body) }\n\t\t});\n\t};\n\tconst servePublicRoute = async (request, response, url, route) => {\n\t\tconst refusal = publicRefusal(request);\n\t\tif (refusal !== void 0) {\n\t\t\tjson(response, refusal, { error: refusal === 404 ? \"Not found.\" : \"Forbidden.\" });\n\t\t\treturn;\n\t\t}\n\t\tlet body;\n\t\tif (request.method !== \"GET\" && request.method !== \"HEAD\") try {\n\t\t\tbody = await readBody(request, PUBLIC_MAX_BYTES);\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof RequestBodyTooLargeError)) throw error;\n\t\t\tjson(response, 413, { error: error.message });\n\t\t\treturn;\n\t\t}\n\t\tconst forwarded = publicRequest(request, url, route, body);\n\t\tif (!await route.routes.authenticate(forwarded.clone())) {\n\t\t\tjson(response, 401, { error: \"Unauthorized.\" });\n\t\t\treturn;\n\t\t}\n\t\tawait writeResponse(response, await route.handler.fetch(forwarded));\n\t};\n\tconst upgradePublicRoute = async (request, socket, head, route) => {\n\t\tconst refuse = (status) => {\n\t\t\tsocket.write(`HTTP/1.1 ${status}\\r\\n\\r\\n`);\n\t\t\tsocket.destroy();\n\t\t};\n\t\tconst refusal = publicRefusal(request);\n\t\tconst upgrade = route.handler.upgrade?.bind(route.handler);\n\t\tif (refusal === 404 || upgrade === void 0) return refuse(\"404 Not Found\");\n\t\tif (refusal === 403) return refuse(\"403 Forbidden\");\n\t\tconst forwarded = publicRequest(request, requestPath(request), route);\n\t\tif (!await route.routes.authenticate(forwarded.clone())) return refuse(\"401 Unauthorized\");\n\t\tif (closed || socket.destroyed) {\n\t\t\tsocket.destroy();\n\t\t\treturn;\n\t\t}\n\t\tpublicSockets.handleUpgrade(request, socket, head, (client) => {\n\t\t\tconst entry = { socket: client };\n\t\t\tclients.add(entry);\n\t\t\tclient.on(\"close\", () => clients.delete(entry));\n\t\t\tclient.on(\"error\", (error) => options.onNotice?.(`Public socket failed: ${error.message}`));\n\t\t\ttry {\n\t\t\t\tupgrade(forwarded, apiSocket(client));\n\t\t\t} catch (error) {\n\t\t\t\toptions.onNotice?.(`Public socket handler failed: ${harnessErrorMessage(error)}`);\n\t\t\t\tclient.close(1011);\n\t\t\t}\n\t\t});\n\t};\n\t/**\n\t* A recorded session is dormant exactly while the hub has no session for its\n\t* id, so reviving one needs no bookkeeping beyond the hub itself.\n\t*/\n\tconst dormant = () => (options.dormantSessions?.() ?? []).filter((record) => options.headlessHub.session(record.sessionId) === void 0);\n\tconst protocol = createHeadlessProtocol({\n\t\thub: options.headlessHub,\n\t\ttelemetry: options.telemetry,\n\t\tonNotice: options.onNotice,\n\t\tdormantSessions: dormant\n\t});\n\tconst sessionMcpStateDir = options.sessionMcpStateDir ?? fs.mkdtempSync(path.join(os.tmpdir(), \"po-session-mcp-\"));\n\tconst sessionMcp = createSessionMcpRoutes({\n\t\theadlessHub: options.headlessHub,\n\t\tpublicOrigin: options.sessionMcpPublicOrigin ?? (() => void 0),\n\t\tpublicOriginRevision: options.sessionMcpPublicOriginRevision,\n\t\tonNotice: options.onNotice,\n\t\tisSessionPersisted: options.isSessionPersisted,\n\t\tactivityStore: createSessionMcpActivityStore(sessionMcpStateDir),\n\t\tconversationStore: createSessionMcpConversationStore(sessionMcpStateDir),\n\t\tregistrationStore: createSessionMcpRegistrationStore({\n\t\t\tstateDir: sessionMcpStateDir,\n\t\t\tonNotice: options.onNotice\n\t\t})\n\t});\n\t/** Sessions being restarted, keyed by id, settled once the reopen succeeds or fails. */\n\tconst restarting = /* @__PURE__ */ new Map();\n\t/**\n\t* Stores already-normalized groups where a session keeps them: the journal of a live\n\t* session, which announces the change itself, or the record of a dormant one.\n\t*/\n\tconst writeGroups = async (sessionId, groups) => {\n\t\tconst runtime = options.headlessHub.runtime(sessionId);\n\t\tif (runtime !== void 0) {\n\t\t\tawait runtime.setGroups(groups);\n\t\t\treturn true;\n\t\t}\n\t\tconst record = dormant().find((candidate) => candidate.sessionId === sessionId);\n\t\tif (record === void 0 || options.setDormantGroups === void 0) return false;\n\t\tawait options.setDormantGroups(record, groups);\n\t\toptions.headlessHub.notifyDormantChanged(sessionId);\n\t\treturn true;\n\t};\n\tconst server = createServer((request, response) => {\n\t\thandleRequest(request, response).catch((error) => {\n\t\t\tif (response.headersSent) {\n\t\t\t\tresponse.destroy();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\toptions.onNotice?.(`Headless request failed: ${harnessErrorMessage(error)}`);\n\t\t\tif (isPoSessionSetupError(error)) json(response, 422, { error: error.message });\n\t\t\telse json(response, 500, { error: \"Internal server error.\" });\n\t\t});\n\t});\n\tasync function handleRequest(request, response) {\n\t\tconst url = requestPath(request);\n\t\tif (url.pathname === \"/api/health\" && request.method === \"GET\") {\n\t\t\tjson(response, 200, {\n\t\t\t\tok: true,\n\t\t\t\trole: HEALTH_ROLE,\n\t\t\t\tprotocol: PROTOCOL_VERSION,\n\t\t\t\tsessions: options.headlessHub.snapshot().length\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst publicRoute = publicRouteFor(url);\n\t\tif (publicRoute !== void 0) {\n\t\t\tawait servePublicRoute(request, response, url, publicRoute);\n\t\t\treturn;\n\t\t}\n\t\tconst scopedSession = /^\\/api\\/workspaces\\/[^/]+\\/sessions\\/([^/]+)(?:\\/|$)/u.exec(url.pathname)?.[1];\n\t\tif (scopedSession && options.headlessHub.computerUse?.ownsSession?.(decodeURIComponent(scopedSession)) && !computerUseAuthorized(decodeURIComponent(scopedSession), request) && !(request.method === \"GET\" && url.pathname.endsWith(\"/plugins/computer-use/artifact\") && recordingAuthorized(decodeURIComponent(scopedSession), request)) && !(request.method === \"POST\" && url.pathname.endsWith(\"/plugins/computer-use/activate\") && activationAuthorized(request)) && !(url.pathname.endsWith(\"/plugins/computer-use/activate\") && (request.method === \"GET\" && (pendingAuthorized(decodeURIComponent(scopedSession), request) || recordingAuthorized(decodeURIComponent(scopedSession), request)) || request.method === \"DELETE\" && pendingAuthorized(decodeURIComponent(scopedSession), request)))) {\n\t\t\tjson(response, 404, { error: \"This session belongs to its Desktop instance.\" });\n\t\t\treturn;\n\t\t}\n\t\tif (publicRoutes && isPublicSessionMcpRoute(request.method ?? \"GET\", url.pathname)) {\n\t\t\tconst sessionMcpAbort = new AbortController();\n\t\t\tconst abortSessionMcp = () => {\n\t\t\t\tif (!response.writableEnded) sessionMcpAbort.abort();\n\t\t\t};\n\t\t\tresponse.once(\"close\", abortSessionMcp);\n\t\t\tconst publicSessionMcp = await sessionMcp.handlePublic(webRequest(request, url, sessionMcpAbort.signal));\n\t\t\tif (publicSessionMcp !== void 0) {\n\t\t\t\ttry {\n\t\t\t\t\tawait writeResponse(response, publicSessionMcp);\n\t\t\t\t} finally {\n\t\t\t\t\tresponse.off(\"close\", abortSessionMcp);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresponse.off(\"close\", abortSessionMcp);\n\t\t}\n\t\tif (!authorized(request, options.token)) {\n\t\t\tjson(response, 401, { error: \"Unauthorized.\" });\n\t\t\treturn;\n\t\t}\n\t\tconst reopening = scopedSession === void 0 ? void 0 : restarting.get(decodeURIComponent(scopedSession));\n\t\tif (reopening !== void 0 && options.headlessHub.session(decodeURIComponent(scopedSession)) === void 0) await reopening;\n\t\tif (isSessionMcpHostRoute(url.pathname)) {\n\t\t\tconst hostSessionMcp = await sessionMcp.handleHost(webRequest(request, url));\n\t\t\tif (hostSessionMcp !== void 0) {\n\t\t\t\tawait writeResponse(response, hostSessionMcp);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (url.pathname === \"/api/remote\" || url.pathname.startsWith(\"/api/remote/\")) {\n\t\t\tconst headers = new Headers();\n\t\t\tfor (const [name, value] of Object.entries(request.headers)) if (value !== void 0 && name !== \"authorization\" && name !== \"x-po-token\") headers.set(name, Array.isArray(value) ? value.join(\", \") : value);\n\t\t\tawait writeResponse(response, await options.headlessHub.requestApi({ scope: \"global\" }, \"remote\", new Request(`http://po.local${url.pathname.slice(11)}${url.search}`, {\n\t\t\t\tmethod: request.method,\n\t\t\t\theaders,\n\t\t\t\t...request.method === \"GET\" || request.method === \"HEAD\" ? {} : { body: Buffer.from(await readBody(request)) }\n\t\t\t})));\n\t\t\treturn;\n\t\t}\n\t\tif (url.pathname === \"/api/telemetry/browser\" && request.method === \"POST\") {\n\t\t\tconst body = JSON.parse(new TextDecoder().decode(await readBody(request)));\n\t\t\tif (body.v !== 1 || !Array.isArray(body.events) || body.events.length > 10) {\n\t\t\t\tjson(response, 400, { error: \"Invalid browser telemetry batch.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const event of body.events) {\n\t\t\t\tif (!event || typeof event !== \"object\" || typeof event.name !== \"string\" || !/^web\\.browser\\.[a-z_]{1,40}$/u.test(event.name)) continue;\n\t\t\t\tif (options.telemetry) observe(options.telemetry.recordEvent(event.name, {\n\t\t\t\t\t...typeof event.duration_ms === \"number\" && Number.isFinite(event.duration_ms) && event.duration_ms >= 0 ? { duration_ms: event.duration_ms } : {},\n\t\t\t\t\t...typeof event.count === \"number\" && Number.isFinite(event.count) && event.count >= 0 ? { count: event.count } : {}\n\t\t\t\t}));\n\t\t\t}\n\t\t\tjson(response, 200, { ok: true });\n\t\t\treturn;\n\t\t}\n\t\tif (url.pathname === \"/api/compositions\" && request.method === \"GET\") {\n\t\t\tjson(response, 200, options.compositions?.() ?? { workspaces: [] });\n\t\t\treturn;\n\t\t}\n\t\tif ((url.pathname.startsWith(\"/api/web-plugins/\") || url.pathname === \"/bundle-manifest.json\" || url.pathname.startsWith(\"/bundle-assets/\")) && options.requestAsset) {\n\t\t\tconst result = await options.requestAsset(new Request(url, { method: request.method }));\n\t\t\tif (result) {\n\t\t\t\tawait writeResponse(response, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (url.pathname === \"/api/directories/children\" && request.method === \"GET\") {\n\t\t\tconst listing = await directoryChildren(url.searchParams.get(\"path\"));\n\t\t\tif (listing === void 0) json(response, 404, { error: \"That folder cannot be read.\" });\n\t\t\telse json(response, 200, listing);\n\t\t\treturn;\n\t\t}\n\t\tif (url.pathname === \"/api/directories/po\" && request.method === \"GET\") {\n\t\t\tjson(response, 200, { directories: await poFolders() });\n\t\t\treturn;\n\t\t}\n\t\tif (url.pathname === \"/api/directories\" && request.method === \"GET\") {\n\t\t\tjson(response, 200, { directories: await directorySuggestions(url.searchParams.get(\"q\") ?? \"\", options.headlessHub.snapshot()) });\n\t\t\treturn;\n\t\t}\n\t\tif (url.pathname === \"/api/sessions\" && request.method === \"POST\") {\n\t\t\tconst body = parseJson(await readBody(request));\n\t\t\tif (!body || typeof body !== \"object\" || !(\"cwd\" in body) || typeof body.cwd !== \"string\" || !body.cwd.trim() || \"name\" in body && typeof body.name !== \"string\") {\n\t\t\t\tjson(response, 400, { error: \"A session needs a working directory and an optional name.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tjson(response, 201, { sessionId: (await options.headlessHub.sessionService.create({\n\t\t\t\tcwd: body.cwd,\n\t\t\t\tname: \"name\" in body ? String(body.name) : path.basename(body.cwd)\n\t\t\t})).sessionId });\n\t\t\treturn;\n\t\t}\n\t\tconst workspaceSessions = /^\\/api\\/workspaces\\/([^/]+)\\/sessions$/u.exec(url.pathname);\n\t\tif (workspaceSessions) {\n\t\t\tconst workspaceId = decodeURIComponent(workspaceSessions[1]);\n\t\t\tconst workspace = options.headlessHub.workspaces().find((entry) => entry.id === workspaceId);\n\t\t\tif (!workspace) {\n\t\t\t\tjson(response, 404, { error: \"Workspace not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (request.method === \"GET\") {\n\t\t\t\tjson(response, 200, { sessions: [...options.headlessHub.snapshot().filter((session) => session.workspaceId === workspaceId && (!options.headlessHub.computerUse?.ownsSession?.(session.id) || computerUseAuthorized(session.id, request))).map(sessionView), ...dormant().filter((record) => record.workspaceId === workspaceId && (!options.headlessHub.computerUse?.ownsSession?.(record.sessionId) || computerUseAuthorized(record.sessionId, request))).map(dormantView)] });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (request.method === \"POST\") {\n\t\t\t\tif (workspace.available === false) {\n\t\t\t\t\tjson(response, 409, { error: \"Workspace is unavailable.\" });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst body = parseJson(await readBody(request));\n\t\t\t\tif (!body || typeof body !== \"object\" || \"name\" in body && typeof body.name !== \"string\") {\n\t\t\t\t\tjson(response, 400, { error: \"A session accepts an optional name.\" });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tjson(response, 201, { sessionId: (await options.headlessHub.sessionService.create({\n\t\t\t\t\tcwd: workspace.root,\n\t\t\t\t\tname: \"name\" in body ? String(body.name) : path.basename(workspace.root)\n\t\t\t\t})).sessionId });\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconst groupMatch = /^\\/api\\/session-groups\\/([^/]+)$/u.exec(url.pathname);\n\t\tif (groupMatch && (request.method === \"PATCH\" || request.method === \"DELETE\")) {\n\t\t\tconst from = decodeURIComponent(groupMatch[1]);\n\t\t\tlet to = [];\n\t\t\tif (request.method === \"PATCH\") {\n\t\t\t\tconst body = parseJson(await readBody(request));\n\t\t\t\tconst name = body && typeof body === \"object\" && \"name\" in body ? body.name : void 0;\n\t\t\t\tif (typeof name !== \"string\" || name.trim() === \"\") {\n\t\t\t\t\tjson(response, 400, { error: \"A group needs a new name.\" });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tto = [name];\n\t\t\t}\n\t\t\tconst members = [...options.headlessHub.snapshot().map((session) => ({\n\t\t\t\tid: session.id,\n\t\t\t\tgroups: session.groups ?? []\n\t\t\t})), ...dormant().map((record) => ({\n\t\t\t\tid: record.sessionId,\n\t\t\t\tgroups: record.groups ?? []\n\t\t\t}))].filter((member) => member.groups.includes(from) && (!options.headlessHub.computerUse?.ownsSession?.(member.id) || computerUseAuthorized(member.id, request)));\n\t\t\tlet updates;\n\t\t\ttry {\n\t\t\t\tupdates = members.map((member) => ({\n\t\t\t\t\tid: member.id,\n\t\t\t\t\tgroups: normalizeSessionGroups(member.groups.flatMap((group) => group === from ? to : [group]))\n\t\t\t\t}));\n\t\t\t} catch (error) {\n\t\t\t\tjson(response, 400, { error: error instanceof Error ? error.message : String(error) });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const update of updates) await writeGroups(update.id, update.groups);\n\t\t\tjson(response, 200, { sessions: updates.length });\n\t\t\treturn;\n\t\t}\n\t\tif (url.pathname === \"/api/workspaces\") {\n\t\t\tif (request.method === \"GET\") {\n\t\t\t\tjson(response, 200, { workspaces: options.headlessHub.workspaces() });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (request.method === \"POST\") {\n\t\t\t\tconst admission = parseWorkspaceAdmission(parseJson(await readBody(request)));\n\t\t\t\tif (\"error\" in admission) {\n\t\t\t\t\tjson(response, 400, admission);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet workspace;\n\t\t\t\ttry {\n\t\t\t\t\tworkspace = await options.headlessHub.admitWorkspace(admission);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tjson(response, 422, { error: error instanceof Error ? error.message : String(error) });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tjson(response, 201, { workspace });\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconst workspaceHistoryMatch = /^\\/api\\/workspaces\\/([^/]+)\\/history$/u.exec(url.pathname);\n\t\tif (workspaceHistoryMatch && request.method === \"GET\" && options.workspaceHistory) {\n\t\t\tconst workspaceId = decodeURIComponent(workspaceHistoryMatch[1]);\n\t\t\tconst workspace = options.headlessHub.workspaces().find((entry) => entry.id === workspaceId);\n\t\t\tif (!workspace) {\n\t\t\t\tjson(response, 404, { error: \"Workspace not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (workspace.available === false) {\n\t\t\t\tjson(response, 409, { error: \"Workspace is unavailable.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tjson(response, 200, { sessions: await options.workspaceHistory(workspaceId) });\n\t\t\treturn;\n\t\t}\n\t\tconst workspaceResumeMatch = /^\\/api\\/workspaces\\/([^/]+)\\/resume$/u.exec(url.pathname);\n\t\tif (workspaceResumeMatch && request.method === \"POST\" && options.resumeWorkspaceSession) {\n\t\t\tconst workspaceId = decodeURIComponent(workspaceResumeMatch[1]);\n\t\t\tconst workspace = options.headlessHub.workspaces().find((entry) => entry.id === workspaceId);\n\t\t\tif (!workspace) {\n\t\t\t\tjson(response, 404, { error: \"Workspace not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (workspace.available === false) {\n\t\t\t\tjson(response, 409, { error: \"Workspace is unavailable.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst body = parseJson(await readBody(request));\n\t\t\tconst targetSessionId = body && typeof body === \"object\" && \"targetSessionId\" in body ? body.targetSessionId : void 0;\n\t\t\tif (typeof targetSessionId !== \"string\" || !/^[A-Za-z0-9_-]+$/u.test(targetSessionId)) {\n\t\t\t\tjson(response, 400, { error: \"Invalid target session id.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tjson(response, 200, { sessionId: await options.resumeWorkspaceSession(workspaceId, targetSessionId) });\n\t\t\treturn;\n\t\t}\n\t\tconst workspaceMatch = /^\\/api\\/workspaces\\/([^/]+)$/u.exec(url.pathname);\n\t\tif (workspaceMatch && request.method === \"GET\") {\n\t\t\tconst workspace = options.headlessHub.workspaces().find((entry) => entry.id === decodeURIComponent(workspaceMatch[1]));\n\t\t\tjson(response, workspace ? 200 : 404, workspace ? { workspace } : { error: \"Workspace not found.\" });\n\t\t\treturn;\n\t\t}\n\t\tif (workspaceMatch && request.method === \"PATCH\" && options.setWorkspaceSandbox) {\n\t\t\tconst id = decodeURIComponent(workspaceMatch[1]);\n\t\t\tconst body = parseJson(await readBody(request));\n\t\t\tconst sandbox = body && typeof body === \"object\" && \"sandbox\" in body ? body.sandbox : void 0;\n\t\t\tif (sandbox !== null && (typeof sandbox !== \"string\" || sandbox.trim() === \"\")) {\n\t\t\t\tjson(response, 400, { error: \"The sandbox must be a provider id, or null to run locally.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!options.headlessHub.workspaces().some((workspace) => workspace.id === id)) {\n\t\t\t\tjson(response, 404, { error: \"Workspace not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst result = await options.setWorkspaceSandbox(id, sandbox);\n\t\t\tjson(response, \"error\" in result ? 409 : 200, result);\n\t\t\treturn;\n\t\t}\n\t\tif (workspaceMatch && request.method === \"DELETE\") {\n\t\t\tconst id = decodeURIComponent(workspaceMatch[1]);\n\t\t\tif (!options.headlessHub.workspaces().some((workspace) => workspace.id === id)) {\n\t\t\t\tjson(response, 404, { error: \"Workspace not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (options.headlessHub.snapshot().some((session) => session.workspaceId === id) || dormant().some((session) => session.workspaceId === id)) {\n\t\t\t\tjson(response, 409, { error: \"Workspace still has sessions.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait options.headlessHub.removeWorkspace(id);\n\t\t\tjson(response, 200, { ok: true });\n\t\t\treturn;\n\t\t}\n\t\tconst pluginMatch = PO_PACKAGE_API_PATH_PATTERN.exec(url.pathname);\n\t\tif (pluginMatch !== null && request.method !== \"CONNECT\") {\n\t\t\tconst workspaceId = pluginMatch[1] === void 0 ? void 0 : decodeURIComponent(pluginMatch[1]);\n\t\t\tconst sessionId = pluginMatch[2] === void 0 ? void 0 : decodeURIComponent(pluginMatch[2]);\n\t\t\tif (workspaceId !== void 0 && !options.headlessHub.workspaces().some((entry) => entry.id === workspaceId)) {\n\t\t\t\tjson(response, 404, { error: \"Workspace not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (sessionId !== void 0 && options.headlessHub.session(sessionId)?.workspaceId !== workspaceId) {\n\t\t\t\tif (dormant().some((record) => record.sessionId === sessionId && record.workspaceId === workspaceId) && pluginMatch[3] === \"context\" && request.method === \"GET\") {\n\t\t\t\t\tconst detail = await createContextApi({\n\t\t\t\t\t\tsessionId,\n\t\t\t\t\t\tenvironment: process.env\n\t\t\t\t\t}).fetch(new Request(`http://po.local/${pluginMatch[4] ?? \"\"}${url.search}`));\n\t\t\t\t\tconst body = await detail.json();\n\t\t\t\t\tif (readContextDetail(sessionId, process.env) === void 0) json(response, 404, { error: \"This session is stopped. Wake it to read this item.\" });\n\t\t\t\t\telse json(response, detail.status, body);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tjson(response, 404, { error: \"Session not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst mount = sessionId !== void 0 ? {\n\t\t\t\tscope: \"session\",\n\t\t\t\tsessionId\n\t\t\t} : workspaceId !== void 0 ? {\n\t\t\t\tscope: \"workspace\",\n\t\t\t\tworkspaceId\n\t\t\t} : { scope: \"global\" };\n\t\t\tconst basePath = pluginMatch[3] === void 0 ? \"settings\" : decodeURIComponent(pluginMatch[3]);\n\t\t\tif (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(basePath)) {\n\t\t\t\tjson(response, 400, { error: \"Invalid package API base path.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (pluginMatch[3] === \"settings\" || sessionId !== void 0 && basePath === \"settings\") {\n\t\t\t\tjson(response, 404, { error: \"Not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst headers = new Headers();\n\t\t\tconst trustedCaller = options.token !== void 0 && authorized(request, options.token);\n\t\t\tfor (const [name, value] of Object.entries(request.headers)) if (value !== void 0 && ![\n\t\t\t\t\"host\",\n\t\t\t\t\"authorization\",\n\t\t\t\t\"x-po-token\"\n\t\t\t].includes(name) && (trustedCaller || !PO_API_CALLER_HEADERS.includes(name))) headers.set(name, Array.isArray(value) ? value.join(\", \") : value);\n\t\t\tif (!trustedCaller) {\n\t\t\t\theaders.set(PO_API_CALLER_LOCALITY_HEADER, \"local\");\n\t\t\t\theaders.set(PO_API_CALLER_STEP_UP_HEADER, \"not-required\");\n\t\t\t}\n\t\t\tconst abort = new AbortController();\n\t\t\tconst disconnected = () => {\n\t\t\t\tif (!response.writableEnded) abort.abort();\n\t\t\t};\n\t\t\tresponse.once(\"close\", disconnected);\n\t\t\ttry {\n\t\t\t\tconst started = performance.now();\n\t\t\t\tconst attributes = {\n\t\t\t\t\tscope: mount.scope,\n\t\t\t\t\t\"plugin.name\": basePath,\n\t\t\t\t\t\"http.operation\": request.method,\n\t\t\t\t\t...mount.scope === \"workspace\" ? { \"workspace.id\": mount.workspaceId } : {},\n\t\t\t\t\t...mount.scope === \"session\" ? { \"session.id\": mount.sessionId } : {}\n\t\t\t\t};\n\t\t\t\tconst dispatch = async () => options.headlessHub.requestApi(mount, basePath, new Request(`http://po.local/${pluginMatch[4] ?? \"\"}${url.search}`, {\n\t\t\t\t\tmethod: request.method,\n\t\t\t\t\theaders,\n\t\t\t\t\tsignal: abort.signal,\n\t\t\t\t\t...request.method === \"GET\" || request.method === \"HEAD\" ? {} : { body: Buffer.from(await readBody(request)) }\n\t\t\t\t}));\n\t\t\t\tconst result = options.telemetry ? await options.telemetry.runInSpan(\"po_server.plugin.request\", attributes, dispatch) : await dispatch();\n\t\t\t\tif (options.telemetry) observe(options.telemetry.recordEvent(\"po_server.plugin.response\", {\n\t\t\t\t\t...attributes,\n\t\t\t\t\tstatus: result.status,\n\t\t\t\t\tdurationMs: performance.now() - started\n\t\t\t\t}), options.onNotice);\n\t\t\t\tawait writeResponse(response, result);\n\t\t\t} finally {\n\t\t\t\tresponse.off(\"close\", disconnected);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst sessionMatch = /^\\/api\\/workspaces\\/([^/]+)\\/sessions\\/([^/]+)(?:\\/(.*))?$/u.exec(url.pathname);\n\t\tif (sessionMatch === null) {\n\t\t\tjson(response, 404, { error: \"Not found.\" });\n\t\t\treturn;\n\t\t}\n\t\tconst sessionId = decodeURIComponent(sessionMatch[2]);\n\t\tconst workspaceId = decodeURIComponent(sessionMatch[1]);\n\t\tconst session = options.headlessHub.session(sessionId);\n\t\tconst suffix = sessionMatch[3] === void 0 ? \"\" : `/${sessionMatch[3]}`;\n\t\tif (suffix === \"/transcript\" && request.method === \"GET\" && options.readDormantTranscript) {\n\t\t\tconst record = dormant().find((candidate) => candidate.sessionId === sessionId && candidate.workspaceId === workspaceId);\n\t\t\tif (record === void 0) {\n\t\t\t\tjson(response, 404, { error: \"Dormant session not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet transcriptRequest;\n\t\t\ttry {\n\t\t\t\ttranscriptRequest = parseTranscriptRequest(url);\n\t\t\t} catch (error) {\n\t\t\t\tjson(response, 400, { error: error instanceof Error ? error.message : \"Invalid transcript request.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tjson(response, 200, await options.readDormantTranscript(record, transcriptRequest, BACKGROUND_CONTEXT));\n\t\t\t} catch (error) {\n\t\t\t\tconst status = (error instanceof Error ? error.message : String(error)) === \"STALE_TRANSCRIPT_CURSOR\" ? 409 : 422;\n\t\t\t\tjson(response, status, { error: status === 409 ? \"STALE_TRANSCRIPT_CURSOR\" : \"Saved transcript is unavailable.\" });\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"/groups\" && request.method === \"PUT\") {\n\t\t\tif (!(session?.workspaceId === workspaceId || dormant().some((candidate) => candidate.sessionId === sessionId && candidate.workspaceId === workspaceId))) {\n\t\t\t\tjson(response, 404, { error: \"Session not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst body = parseJson(await readBody(request));\n\t\t\tlet groups;\n\t\t\ttry {\n\t\t\t\tgroups = normalizeSessionGroups(body && typeof body === \"object\" && \"groups\" in body ? body.groups : void 0);\n\t\t\t} catch (error) {\n\t\t\t\tjson(response, 400, { error: error instanceof Error ? error.message : String(error) });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!await writeGroups(sessionId, groups)) {\n\t\t\t\tjson(response, 404, { error: \"Session not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tjson(response, 200, { groups });\n\t\t\treturn;\n\t\t}\n\t\tif (sessionMatch[3] === \"revive\" && request.method === \"POST\" && options.reviveSession) {\n\t\t\tconst record = dormant().find((candidate) => candidate.sessionId === sessionId && candidate.workspaceId === workspaceId);\n\t\t\tif (record === void 0) {\n\t\t\t\tjson(response, 404, { error: \"Dormant session not found.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait options.reviveSession(record);\n\t\t\tjson(response, 200, { ok: true });\n\t\t\treturn;\n\t\t}\n\t\tif (session === void 0 || session.workspaceId !== workspaceId) {\n\t\t\tconst record = dormant().find((candidate) => candidate.sessionId === sessionId && candidate.workspaceId === workspaceId);\n\t\t\tif (suffix === \"\" && request.method === \"DELETE\" && record !== void 0 && options.removeDormantSession !== void 0) {\n\t\t\t\tsessionMcp.closeSessionBinding(record.sessionId);\n\t\t\t\tawait options.headlessHub.closeSession(record.sessionId, { keepDormant: true });\n\t\t\t\tawait options.removeDormantSession(record);\n\t\t\t\toptions.headlessHub.notifySessionRemoved(record.sessionId);\n\t\t\t\tjson(response, 200, { ok: true });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tjson(response, 404, { error: \"Session not found.\" });\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"\" && request.method === \"GET\") {\n\t\t\tjson(response, 200, sessionView(session));\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"\" && request.method === \"DELETE\") {\n\t\t\tsessionMcp.closeSessionBinding(sessionId);\n\t\t\tawait options.headlessHub.closeSession(sessionId, options.removeSessionFiles ? { keepDormant: true } : void 0);\n\t\t\tif (options.removeSessionFiles) {\n\t\t\t\tawait options.removeSessionFiles(sessionId);\n\t\t\t\toptions.headlessHub.notifySessionRemoved(sessionId);\n\t\t\t}\n\t\t\tjson(response, 200, { ok: true });\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"/history\" && request.method === \"GET\" && options.sessionHistory) {\n\t\t\tjson(response, 200, { sessions: await options.sessionHistory(session) });\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"/avatar\" && request.method === \"GET\") {\n\t\t\tconst avatar = options.headlessHub.sessionAvatar(sessionId);\n\t\t\tif (avatar === void 0) {\n\t\t\t\tjson(response, 404, { error: \"This session has no avatar.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst current = url.searchParams.get(\"v\") === session.profile?.iconVersion;\n\t\t\tresponse.writeHead(200, {\n\t\t\t\t\"content-type\": avatar.mimeType,\n\t\t\t\t\"content-length\": String(avatar.bytes.byteLength),\n\t\t\t\t\"cache-control\": current ? \"private, max-age=31536000, immutable\" : \"no-store\",\n\t\t\t\t\"x-content-type-options\": \"nosniff\"\n\t\t\t});\n\t\t\tresponse.end(avatar.bytes);\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"/file\" && request.method === \"GET\") {\n\t\t\tconst forwarded = new Headers();\n\t\t\tfor (const name of [\"range\", \"if-match\"]) {\n\t\t\t\tconst value = request.headers[name];\n\t\t\t\tif (typeof value === \"string\") forwarded.set(name, value);\n\t\t\t}\n\t\t\tconst target = new URL(\"http://po.local/\");\n\t\t\tconst requested = url.searchParams.get(\"path\");\n\t\t\tif (requested !== null) target.searchParams.set(\"path\", requested);\n\t\t\tawait writeResponse(response, await options.headlessHub.requestApi({\n\t\t\t\tscope: \"session\",\n\t\t\t\tsessionId\n\t\t\t}, SESSION_FILES_API, new Request(target, { headers: forwarded })));\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"/attachments\" && request.method === \"POST\") {\n\t\t\tlet bytes;\n\t\t\ttry {\n\t\t\t\tbytes = await readBody(request);\n\t\t\t} catch (error) {\n\t\t\t\tif (!(error instanceof RequestBodyTooLargeError)) throw error;\n\t\t\t\tjson(response, 413, { error: \"The attachment exceeds the 8 MB upload limit.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tjson(response, 201, await writeSessionAttachment(sessionId, url.searchParams.get(\"name\") ?? \"file\", bytes));\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"/restart\" && request.method === \"POST\" && options.restartSession) {\n\t\t\tif ((session.phase ?? \"idle\") !== \"idle\") {\n\t\t\t\tjson(response, 409, { error: RESTART_WHILE_RUNNING_ERROR });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst restart = options.restartSession(session);\n\t\t\tconst settled = restart.then(() => void 0, () => void 0);\n\t\t\trestarting.set(sessionId, settled);\n\t\t\ttry {\n\t\t\t\tawait restart;\n\t\t\t} finally {\n\t\t\t\tif (restarting.get(sessionId) === settled) restarting.delete(sessionId);\n\t\t\t}\n\t\t\tjson(response, 200, { ok: true });\n\t\t\treturn;\n\t\t}\n\t\tif (suffix === \"/resume\" && request.method === \"POST\" && options.resumeSession) {\n\t\t\tconst body = parseJson(await readBody(request));\n\t\t\tconst targetSessionId = body && typeof body === \"object\" && \"targetSessionId\" in body ? body.targetSessionId : void 0;\n\t\t\tif (typeof targetSessionId !== \"string\" || !/^[A-Za-z0-9_-]+$/u.test(targetSessionId)) {\n\t\t\t\tjson(response, 400, { error: \"Invalid target session id.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (options.headlessHub.computerUse?.ownsSession?.(targetSessionId) && !computerUseAuthorized(targetSessionId, request)) {\n\t\t\t\tjson(response, 404, { error: \"This session belongs to its Desktop instance.\" });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tjson(response, 200, { sessionId: await options.resumeSession(session, targetSessionId) });\n\t\t\treturn;\n\t\t}\n\t\tjson(response, 404, { error: \"Not found.\" });\n\t}\n\t/** Checks one connection request against its mount; the result says why it may not connect. */\n\tconst accessFor = (request) => {\n\t\tconst mount = parsePoSocketPath(requestPath(request).pathname);\n\t\tif (!mount) return 404;\n\t\tif (!authorized(request, options.token)) return 401;\n\t\tif (mount.scope !== \"global\" && (!options.headlessHub.workspaces().some((entry) => entry.id === mount.workspaceId && entry.available !== false) || mount.scope === \"session\" && options.headlessHub.session(mount.sessionId)?.workspaceId !== mount.workspaceId)) return 404;\n\t\treturn {\n\t\t\tmount,\n\t\t\tauthorizeSession: (id) => !options.headlessHub.computerUse?.ownsSession?.(id) || computerUseAuthorized(id, request),\n\t\t\tauthorizeComputerUse: (id) => computerUseAuthorized(id, request),\n\t\t\tauthorizeDesktop: () => desktopAuthorized(request)\n\t\t};\n\t};\n\tserver.on(\"upgrade\", (request, socket, head) => {\n\t\tconst publicRoute = publicRouteFor(requestPath(request));\n\t\tif (publicRoute !== void 0) {\n\t\t\tupgradePublicRoute(request, socket, head, publicRoute).catch((error) => {\n\t\t\t\toptions.onNotice?.(`Public socket upgrade failed: ${harnessErrorMessage(error)}`);\n\t\t\t\tsocket.destroy();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst access = accessFor(request);\n\t\tif (typeof access === \"number\" || closed) {\n\t\t\tif (access === 401) socket.write(\"HTTP/1.1 401 Unauthorized\\r\\n\\r\\n\");\n\t\t\telse if (access === 404) socket.write(\"HTTP/1.1 404 Not Found\\r\\n\\r\\n\");\n\t\t\tsocket.destroy();\n\t\t\treturn;\n\t\t}\n\t\twebSockets.handleUpgrade(request, socket, head, (client) => {\n\t\t\tconst entry = { socket: client };\n\t\t\tclients.add(entry);\n\t\t\tclient.on(\"close\", () => clients.delete(entry));\n\t\t\tclient.on(\"error\", (error) => options.onNotice?.(`Protocol socket failed: ${error.message}`));\n\t\t\tprotocol.accept(webSocketLink(client, { acceptPacked: false }), access);\n\t\t});\n\t});\n\tawait new Promise((resolve, reject) => {\n\t\tserver.once(\"error\", reject);\n\t\tserver.listen(options.port, options.host ?? \"127.0.0.1\", () => resolve());\n\t});\n\tconst address = server.address();\n\tif (address === null || typeof address === \"string\") {\n\t\tawait new Promise((resolve) => server.close(() => resolve()));\n\t\tthrow new Error(\"The headless server did not expose a TCP address.\");\n\t}\n\treturn {\n\t\turl: `http://${options.host ?? \"127.0.0.1\"}:${address.port}`,\n\t\tsessionReservations: sessionMcp.reservations,\n\t\tacceptProtocol(pathname, link, headers) {\n\t\t\tconst access = accessFor({\n\t\t\t\turl: pathname,\n\t\t\t\theaders: {\n\t\t\t\t\t...headers,\n\t\t\t\t\t...options.token === void 0 ? {} : { \"x-po-token\": options.token }\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (typeof access === \"number\" || closed) {\n\t\t\t\tlink.close(access === 401 ? \"unauthorized\" : \"not found\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tprotocol.accept(link, access);\n\t\t\treturn true;\n\t\t},\n\t\tasync close() {\n\t\t\tif (closed) return;\n\t\t\tclosed = true;\n\t\t\tfor (const client of clients) client.socket.terminate();\n\t\t\tclients.clear();\n\t\t\tsessionMcp.close();\n\t\t\tif (options.sessionMcpStateDir === void 0) await fs.promises.rm(sessionMcpStateDir, {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true\n\t\t\t});\n\t\t\tawait protocol.close();\n\t\t\twebSockets.close();\n\t\t\tpublicSockets.close();\n\t\t\tserver.closeAllConnections();\n\t\t\tawait new Promise((resolve, reject) => server.close((error) => error === void 0 ? resolve() : reject(error)));\n\t\t}\n\t};\n}\n//#endregion\nexport { PO_PACKAGE_API_PATH_PATTERN, RESTART_WHILE_RUNNING_ERROR, serveHeadlessServer };\n\n//# sourceMappingURL=headlessServer.mjs.map","import { Type } from \"typebox\";\n//#region src/schemas/agentModel.ts\n/**\n* The custom session entry the runtime journals when the agent's model changes\n* without a client having asked for it.\n*\n* Pi reports a thinking-level switch on the wire as `thinking_level_changed`,\n* so a cockpit can follow that field from the frame alone. It has no matching\n* event for the model: `model_select` is delivered to extensions inside the\n* agent process and never leaves it. A client therefore learns about a model\n* an extension chose (plan mode applying its configured planning model) only\n* by asking for `get_state`, which nothing prompts it to do.\n*\n* This entry closes that gap on the road the minor-mode projection already\n* uses: it rides Pi's `entry_appended` frames, so any RPC client sees the\n* change live and on replay without a new protocol.\n*/\nconst PO_AGENT_MODEL_ENTRY_TYPE = \"po-agent-model\";\nconst AgentModelProjectionSchema = Type.Object({\n\tprovider: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t}),\n\tid: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 256\n\t})\n}, { additionalProperties: false });\n//#endregion\nexport { AgentModelProjectionSchema, PO_AGENT_MODEL_ENTRY_TYPE };\n\n//# sourceMappingURL=agentModel.mjs.map","//#region src/systems/child/types/childSession.ts\nconst PO_CHILD_SESSION_HOOKS_SERVICE = \"po/child-session-hooks\";\n/**\n* Additional child hooks from any package. `po/child-session-hooks` admits one provider, so\n* observers register here instead; they run after that provider and see its patched result.\n*/\nconst PO_CHILD_SESSION_HOOK_REGISTRY_SERVICE = \"po/child-session-hook-registry\";\n/** Optional display names for in-process child runs, keyed by run id. Absent without a team layer. */\nconst PO_CHILD_SESSION_LABELS_SERVICE = \"po/child-session-labels\";\nconst PO_CHILD_SESSION_SERVICE = \"po/child-session\";\n/** Optional session-owned MCP dispatcher. Children borrow it without owning its connections. */\nconst PO_CHILD_SESSION_MCP_TOOL_SERVICE = \"po/child-session-mcp-tool\";\n/** Custom message type of an attributed child input; its details carry `{ sender }`. */\nconst PO_CHILD_INPUT_CUSTOM_TYPE = \"po-input\";\nfunction readPoChildSessionHookRegistry(context) {\n\treturn context.get(PO_CHILD_SESSION_HOOK_REGISTRY_SERVICE);\n}\nfunction readPoChildSessionLabels(context) {\n\treturn context.get(PO_CHILD_SESSION_LABELS_SERVICE);\n}\nfunction readPoChildSessionService(context) {\n\treturn context.get(PO_CHILD_SESSION_SERVICE);\n}\nfunction requirePoChildSessionService(context) {\n\tconst service = readPoChildSessionService(context);\n\tif (!service) throw new Error(\"The Po child-session service is unavailable.\");\n\treturn service;\n}\n//#endregion\nexport { PO_CHILD_INPUT_CUSTOM_TYPE, PO_CHILD_SESSION_HOOKS_SERVICE, PO_CHILD_SESSION_HOOK_REGISTRY_SERVICE, PO_CHILD_SESSION_LABELS_SERVICE, PO_CHILD_SESSION_MCP_TOOL_SERVICE, PO_CHILD_SESSION_SERVICE, readPoChildSessionHookRegistry, readPoChildSessionLabels, readPoChildSessionService, requirePoChildSessionService };\n\n//# sourceMappingURL=childSession.mjs.map","import { Type } from \"typebox\";\nimport { Check, Errors } from \"typebox/value\";\n//#region src/schemas/protocol.ts\nconst PO_PROTOCOL_ERROR_CODE = {\n\taborted: \"ABORTED\",\n\tinvalidMessage: \"INVALID_MESSAGE\",\n\tproviderError: \"PROVIDER_ERROR\",\n\ttimeout: \"TIMEOUT\"\n};\nconst DEFAULT_PROTOCOL_TIMEOUT_MS = 5e3;\nconst DEFAULT_DUPLICATE_WINDOW = 256;\nconst ProtocolErrorSchema = Type.Object({\n\tcode: Type.String({ minLength: 1 }),\n\tmessage: Type.String({ minLength: 1 }),\n\tretryable: Type.Optional(Type.Boolean())\n}, { additionalProperties: false });\nvar PoProtocolError = class extends Error {\n\tcode;\n\tretryable;\n\tconstructor(payload) {\n\t\tsuper(payload.message);\n\t\tthis.name = \"PoProtocolError\";\n\t\tthis.code = payload.code;\n\t\tthis.retryable = payload.retryable ?? false;\n\t}\n};\nvar PoProtocolValidationError = class extends PoProtocolError {\n\tconstructor(channel, details) {\n\t\tsuper({\n\t\t\tcode: PO_PROTOCOL_ERROR_CODE.invalidMessage,\n\t\t\tmessage: `Invalid message on ${channel}: ${details}`\n\t\t});\n\t\tthis.name = \"PoProtocolValidationError\";\n\t}\n};\nconst EnvelopeBaseSchema = Type.Object({\n\tprotocol: Type.String({ minLength: 1 }),\n\tversion: Type.Literal(1),\n\tkind: Type.String({ minLength: 1 }),\n\tmessageId: Type.String({ minLength: 1 }),\n\tcorrelationId: Type.Optional(Type.String({ minLength: 1 })),\n\tsource: Type.String({ minLength: 1 }),\n\tsessionId: Type.String({ minLength: 1 })\n}, { additionalProperties: false });\nfunction envelopeSchema(payload) {\n\treturn Type.Object({\n\t\t...EnvelopeBaseSchema.properties,\n\t\tpayload\n\t}, { additionalProperties: false });\n}\nfunction protocolName(channel) {\n\tconst match = /^(po:[^:]+(?::[^:]+)*):v\\d+:/.exec(channel);\n\tif (!match) throw new Error(`Invalid Po protocol channel: ${channel}`);\n\treturn match[1];\n}\n/** Up to three field-level problems, e.g. `/ must have required properties path`. */\nfunction validationDetails(schema, value) {\n\treturn Errors(schema, value).filter((error) => !(error.keyword === \"boolean\" && error.schemaPath.endsWith(\"/additionalProperties\"))).slice(0, 3).map((error) => {\n\t\tconst extra = error.keyword === \"additionalProperties\" ? `: ${(error.params.additionalProperties ?? []).join(\", \")}` : \"\";\n\t\treturn `${error.instancePath || \"/\"} ${error.message}${extra}`;\n\t}).join(\"; \");\n}\nfunction assertValid(channel, schema, value) {\n\tif (!Check(schema, value)) throw new PoProtocolValidationError(channel, validationDetails(schema, value));\n}\nfunction asProtocolError(error) {\n\tif (error instanceof PoProtocolError) return {\n\t\tcode: error.code,\n\t\tmessage: error.message,\n\t\tretryable: error.retryable\n\t};\n\treturn {\n\t\tcode: PO_PROTOCOL_ERROR_CODE.providerError,\n\t\tmessage: error instanceof Error ? error.message : String(error)\n\t};\n}\nfunction defineNotification(definition) {\n\tprotocolName(definition.channel);\n\treturn definition;\n}\nfunction defineRequestReply(definition) {\n\tconst protocol = protocolName(definition.channels.request);\n\tfor (const channel of [definition.channels.response, definition.channels.error]) if (protocolName(channel) !== protocol) throw new Error(\"Request/reply channels must share one protocol\");\n\treturn {\n\t\trequestChannel: definition.channels.request,\n\t\tresponseChannel: definition.channels.response,\n\t\terrorChannel: definition.channels.error,\n\t\trequestKind: definition.kinds.request,\n\t\tresponseKind: definition.kinds.response,\n\t\trequest: definition.request,\n\t\tresponse: definition.response\n\t};\n}\nconst defineJob = defineRequestReply;\nfunction createProtocolRuntime(options) {\n\tconst timeoutDefault = options.defaultTimeoutMs ?? DEFAULT_PROTOCOL_TIMEOUT_MS;\n\tconst duplicateWindow = options.duplicateWindow ?? DEFAULT_DUPLICATE_WINDOW;\n\tconst createMessageId = options.createMessageId ?? (() => `${options.source}:${crypto.randomUUID()}`);\n\tconst rethrowAsync = (error) => {\n\t\tqueueMicrotask(() => {\n\t\t\tthrow error instanceof Error ? error : new Error(String(error));\n\t\t});\n\t};\n\tfunction duplicateGuard() {\n\t\tconst handled = /* @__PURE__ */ new Set();\n\t\treturn (messageId) => {\n\t\t\tif (handled.has(messageId)) return false;\n\t\t\thandled.add(messageId);\n\t\t\tif (handled.size > duplicateWindow) handled.delete(handled.values().next().value);\n\t\t\treturn true;\n\t\t};\n\t}\n\tfunction base(channel, kind, messageId = createMessageId(), correlationId) {\n\t\treturn {\n\t\t\tprotocol: protocolName(channel),\n\t\t\tversion: 1,\n\t\t\tkind,\n\t\t\tmessageId,\n\t\t\t...correlationId ? { correlationId } : {},\n\t\t\tsource: options.source,\n\t\t\tsessionId: options.sessionId\n\t\t};\n\t}\n\treturn {\n\t\tnotify(definition, payload) {\n\t\t\tassertValid(definition.channel, definition.payload, payload);\n\t\t\toptions.bus.emit(definition.channel, {\n\t\t\t\t...base(definition.channel, definition.kind),\n\t\t\t\tpayload\n\t\t\t});\n\t\t},\n\t\tonNotification(definition, handler) {\n\t\t\tconst schema = envelopeSchema(definition.payload);\n\t\t\tconst remember = duplicateGuard();\n\t\t\treturn options.bus.on(definition.channel, (message) => {\n\t\t\t\tassertValid(definition.channel, schema, message);\n\t\t\t\tconst envelope = message;\n\t\t\t\tif (envelope.sessionId !== options.sessionId) return;\n\t\t\t\tif (!remember(envelope.messageId)) return;\n\t\t\t\tPromise.resolve(handler(envelope.payload, envelope)).catch(rethrowAsync);\n\t\t\t});\n\t\t},\n\t\trequest(definition, payload, requestOptions = {}) {\n\t\t\tassertValid(definition.requestChannel, definition.request, payload);\n\t\t\tconst messageId = createMessageId();\n\t\t\tconst responseSchema = envelopeSchema(definition.response);\n\t\t\tconst errorSchema = envelopeSchema(ProtocolErrorSchema);\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tlet settled = false;\n\t\t\t\tconst cleanups = [];\n\t\t\t\tconst finish = (action) => {\n\t\t\t\t\tif (settled) return;\n\t\t\t\t\tsettled = true;\n\t\t\t\t\tfor (const cleanup of cleanups.splice(0)) cleanup();\n\t\t\t\t\taction();\n\t\t\t\t};\n\t\t\t\tcleanups.push(options.bus.on(definition.responseChannel, (message) => {\n\t\t\t\t\tassertValid(definition.responseChannel, responseSchema, message);\n\t\t\t\t\tconst envelope = message;\n\t\t\t\t\tif (envelope.sessionId !== options.sessionId) return;\n\t\t\t\t\tif (envelope.correlationId !== messageId) return;\n\t\t\t\t\tif (requestOptions.expectedSource && envelope.source !== requestOptions.expectedSource) return;\n\t\t\t\t\tfinish(() => resolve(envelope.payload));\n\t\t\t\t}), options.bus.on(definition.errorChannel, (message) => {\n\t\t\t\t\tassertValid(definition.errorChannel, errorSchema, message);\n\t\t\t\t\tconst envelope = message;\n\t\t\t\t\tif (envelope.sessionId !== options.sessionId) return;\n\t\t\t\t\tif (envelope.correlationId !== messageId) return;\n\t\t\t\t\tif (requestOptions.expectedSource && envelope.source !== requestOptions.expectedSource) return;\n\t\t\t\t\tfinish(() => reject(new PoProtocolError(envelope.payload)));\n\t\t\t\t}));\n\t\t\t\tconst timer = setTimeout(() => finish(() => reject(new PoProtocolError({\n\t\t\t\t\tcode: PO_PROTOCOL_ERROR_CODE.timeout,\n\t\t\t\t\tmessage: `Timed out waiting for ${definition.responseKind}`\n\t\t\t\t}))), requestOptions.timeoutMs ?? timeoutDefault);\n\t\t\t\tcleanups.push(() => clearTimeout(timer));\n\t\t\t\tif (requestOptions.signal) {\n\t\t\t\t\tconst abort = () => finish(() => reject(new PoProtocolError({\n\t\t\t\t\t\tcode: PO_PROTOCOL_ERROR_CODE.aborted,\n\t\t\t\t\t\tmessage: \"Request aborted\"\n\t\t\t\t\t})));\n\t\t\t\t\trequestOptions.signal.addEventListener(\"abort\", abort, { once: true });\n\t\t\t\t\tcleanups.push(() => requestOptions.signal?.removeEventListener(\"abort\", abort));\n\t\t\t\t\tif (requestOptions.signal.aborted) return abort();\n\t\t\t\t}\n\t\t\t\toptions.bus.emit(definition.requestChannel, {\n\t\t\t\t\t...base(definition.requestChannel, definition.requestKind, messageId),\n\t\t\t\t\tpayload\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\tprovide(definition, handler) {\n\t\t\tconst requestSchema = envelopeSchema(definition.request);\n\t\t\tconst remember = duplicateGuard();\n\t\t\treturn options.bus.on(definition.requestChannel, (message) => {\n\t\t\t\tassertValid(definition.requestChannel, requestSchema, message);\n\t\t\t\tconst envelope = message;\n\t\t\t\tif (envelope.sessionId !== options.sessionId) return;\n\t\t\t\tif (!remember(envelope.messageId)) return;\n\t\t\t\tPromise.resolve().then(() => handler(envelope.payload, envelope)).then((payload) => {\n\t\t\t\t\tassertValid(definition.responseChannel, definition.response, payload);\n\t\t\t\t\toptions.bus.emit(definition.responseChannel, {\n\t\t\t\t\t\t...base(definition.responseChannel, definition.responseKind, createMessageId(), envelope.messageId),\n\t\t\t\t\t\tpayload\n\t\t\t\t\t});\n\t\t\t\t}, (error) => {\n\t\t\t\t\toptions.bus.emit(definition.errorChannel, {\n\t\t\t\t\t\t...base(definition.errorChannel, \"error\", createMessageId(), envelope.messageId),\n\t\t\t\t\t\tpayload: asProtocolError(error)\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\nexport { PO_PROTOCOL_ERROR_CODE, PoProtocolError, PoProtocolValidationError, ProtocolErrorSchema, createProtocolRuntime, defineJob, defineNotification, defineRequestReply, validationDetails };\n\n//# sourceMappingURL=runtimeProtocol.mjs.map","//#region src/services/skillPrompt/index.ts\n/** Pi's `<available_skills>` block: '' for no visible skills, otherwise led by a blank line. */\nfunction formatSkillsForSystemPrompt(skills) {\n\tconst escape = (text) => text.replaceAll(\"&\", \"&amp;\").replaceAll(\"<\", \"&lt;\").replaceAll(\">\", \"&gt;\").replaceAll(\"\\\"\", \"&quot;\");\n\tconst visible = skills.filter((skill) => !skill.disableModelInvocation);\n\treturn visible.length ? `\\n\\n<available_skills>\\n${visible.map((skill) => `<skill><name>${escape(skill.name)}</name><description>${escape(skill.description)}</description><location>${escape(skill.filePath)}</location></skill>`).join(\"\\n\")}\\n</available_skills>` : \"\";\n}\n//#endregion\nexport { formatSkillsForSystemPrompt };\n\n//# sourceMappingURL=index.mjs.map","import { Type } from \"typebox\";\n//#region src/schemas/mcpStatus.ts\n/** Session-scoped MCP status service owned by po-mcp. */\nconst PO_MCP_STATUS_SERVICE = \"po/mcp-status\";\n/**\n* Connection state of one downstream MCP server.\n*\n* `not-connected` is the startup state: tools restored from the previous run's\n* catalog exist before any socket opens, and their server has not reported yet.\n* `disabled` comes from configuration rather than the connection stream, since a\n* disabled server is never dialled at all.\n*/\nconst McpServerStateSchema = Type.Union([\n\tType.Literal(\"not-connected\"),\n\tType.Literal(\"connecting\"),\n\tType.Literal(\"connected\"),\n\tType.Literal(\"degraded\"),\n\tType.Literal(\"needs-auth\"),\n\tType.Literal(\"failed\"),\n\tType.Literal(\"closed\"),\n\tType.Literal(\"disabled\")\n]);\nconst McpServerSnapshotSchema = Type.Object({\n\tname: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t}),\n\tstate: McpServerStateSchema,\n\t/**\n\t* Pi tool names registered for this server, exactly as registered.\n\t*\n\t* Published rather than derived: a consumer that reverse-engineers the link from\n\t* tool-name prefixes cannot attribute anything under an unprefixed naming scheme,\n\t* and guesses wrong whenever two servers share a prefix.\n\t*/\n\ttools: Type.Array(Type.String({ minLength: 1 })),\n\tresourceCount: Type.Integer({ minimum: 0 }),\n\t/** Why the server is in `failed` or `needs-auth`; absent otherwise. */\n\terror: Type.Optional(Type.String({ maxLength: 512 }))\n}, { additionalProperties: false });\nconst McpStatusSnapshotSchema = Type.Object({ servers: Type.Array(McpServerSnapshotSchema) }, { additionalProperties: false });\nfunction readPoMcpStatus(context) {\n\treturn context.get(PO_MCP_STATUS_SERVICE);\n}\n//#endregion\nexport { McpServerSnapshotSchema, McpServerStateSchema, McpStatusSnapshotSchema, PO_MCP_STATUS_SERVICE, readPoMcpStatus };\n\n//# sourceMappingURL=mcpStatus.mjs.map","import { createPoKernel } from \"../../../services/kernel/index.mjs\";\nimport { PO_HEADLESS_HOST_SERVICE, PO_SEARCH_SKILLS_TOOL, isPoHeadlessPromptAdmissionError, isPoHeadlessToolModelVisible, readPoHeadlessOwner } from \"../../../schemas/headless.mjs\";\nimport { readPoMcpStatus } from \"../../../schemas/mcpStatus.mjs\";\nimport \"../../../../mcpStatus.mjs\";\nimport { formatSkillsForSystemPrompt } from \"../../../services/skillPrompt/index.mjs\";\nimport { Service } from \"@deepseek-ai/cordis\";\n//#region src/systems/main/adapters/headlessHost.ts\nfunction sameStrings(left, right) {\n\treturn left.length === right.length && left.every((value, index) => value === right[index]);\n}\nfunction sameValues(left, right) {\n\treturn left.length === right.length && left.every((value, index) => value === right[index]);\n}\nfunction sameSelection(left, right) {\n\treturn left.majorMode === right.majorMode && left.profile === right.profile && sameStrings(left.activeLayers, right.activeLayers) && sameStrings(left.domains, right.domains) && JSON.stringify(left.state ?? {}) === JSON.stringify(right.state ?? {});\n}\n/**\n* Maps one typed headless resource to the exact skill shape installed in AgentHarness.\n*\n* Prefers the resource's own `description` and `path`. The fallbacks below are what\n* every skill used to get, and they are only good enough for explicit invocation,\n* which matches on name: `po-headless://` is not a path any tool can open, and\n* \"Headless skill from <source>\" gives the model nothing to select on. A skill is\n* only advertised in the prompt once it carries a real path.\n*/\nfunction headlessHarnessSkill(resource) {\n\treturn {\n\t\tname: resource.name,\n\t\tdescription: resource.description ?? `Headless skill from ${resource.source}`,\n\t\tcontent: resource.text,\n\t\tfilePath: resource.path ?? `po-headless://${resource.source}/${resource.name}`\n\t};\n}\nfunction escapeXml(value) {\n\treturn value.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\");\n}\nconst FLAT_SKILL_LIMIT = 20;\nfunction uniqueSkills(resources) {\n\treturn resources.filter((skill, index, all) => skill.kind === \"skill\" && all.findLastIndex((entry) => entry.kind === \"skill\" && entry.name === skill.name) === index);\n}\n/** The searchable catalog. Pinned skills are listed in the system prompt instead. */\nfunction activeSkills(resources) {\n\treturn uniqueSkills(resources).filter((skill) => skill.pinned !== true);\n}\n/** Exactly the summaries emitted in the system prompt, also used for context billing. */\nfunction systemPromptSkills(resources, hasLoader) {\n\treturn uniqueSkills(resources).filter((skill) => skill.path !== void 0 && (!hasLoader || skill.pinned === true));\n}\n/** Skill discovery prose follows the applied catalog, including selection changes. */\nfunction describeSkillTool(tool, resources) {\n\tif (tool.name !== \"load_skill\" && tool.name !== \"search_skills\") return tool.description;\n\tconst listed = activeSkills(resources);\n\tif (tool.name === \"load_skill\" && listed.length > FLAT_SKILL_LIMIT) return `${tool.description}\\nUse ${PO_SEARCH_SKILLS_TOOL} to find available skill names.`;\n\tif (listed.length === 0) return tool.description;\n\treturn [\n\t\ttool.description,\n\t\t\"\",\n\t\t\"<available_skills>\",\n\t\t...listed.flatMap((skill) => tool.name === \"search_skills\" ? [`  <name>${escapeXml(skill.name)}</name>`] : [\n\t\t\t\"  <skill>\",\n\t\t\t`    <name>${escapeXml(skill.name)}</name>`,\n\t\t\t`    <description>${escapeXml(headlessHarnessSkill(skill).description)}</description>`,\n\t\t\t\"  </skill>\"\n\t\t]),\n\t\t\"</available_skills>\"\n\t].join(\"\\n\");\n}\n/** Retains packages and their state; only kernel-computed active contributions change. */\nvar HeadlessHost = class extends Service {\n\tkernel = createPoKernel();\n\tselectionListeners = /* @__PURE__ */ new Set();\n\trestrictions = [];\n\trestrictionsChanged = false;\n\tcontributionsChanged = false;\n\toptions;\n\tselectionOverrides;\n\tapplied;\n\trequested;\n\tapplying;\n\trefreshing = false;\n\trequestedRevision = 0;\n\tappliedRevision = 0;\n\trecoveryRevision = 0;\n\tready = false;\n\tdisposed = false;\n\tfailure;\n\ttail = Promise.resolve();\n\tactiveSources = /* @__PURE__ */ new Set();\n\tavailableSources = /* @__PURE__ */ new Set();\n\ttools = /* @__PURE__ */ new Map();\n\tresources = [];\n\tresolvedResources = [];\n\tresourceDeclarations = /* @__PURE__ */ new WeakMap();\n\tcommands = /* @__PURE__ */ new Map();\n\thooks = [];\n\tactivities = /* @__PURE__ */ new Map();\n\tconstructor(context, options) {\n\t\tsuper(context, PO_HEADLESS_HOST_SERVICE);\n\t\tthis.options = options;\n\t\tthis.selectionOverrides = new Set(options.selectionOverrides);\n\t\tthis.applied = structuredClone(options.selection);\n\t\tthis.requested = this.applied;\n\t\tthis.applying = this.applied;\n\t\tcontext.effect(() => () => this.close(), \"headless host lifetime\");\n\t\tthis.kernel.defineSlot(\"restrictions\", (entries) => {\n\t\t\tthis.restrictionsChanged = true;\n\t\t\tthis.restrictions = entries.map((entry) => entry.value).filter((restriction) => this.matches(restriction.when));\n\t\t});\n\t\tconst applyTools = async (entries) => {\n\t\t\tconst next = /* @__PURE__ */ new Map();\n\t\t\tfor (const entry of this.selected(entries)) {\n\t\t\t\tif (!this.allowsTool(entry.value.name)) continue;\n\t\t\t\tif (!next.has(entry.value.name)) next.set(entry.value.name, entry);\n\t\t\t}\n\t\t\tconst tools = [...next.values()].map((entry) => ({\n\t\t\t\t...entry.value,\n\t\t\t\texecute: async (id, parameters, signal, onUpdate, execution) => {\n\t\t\t\t\tthis.assertReady();\n\t\t\t\t\tif (this.tools.get(entry.value.name) !== entry || !this.activeSources.has(entry.source)) throw new Error(`Tool '${entry.value.name}' is no longer active`);\n\t\t\t\t\treturn entry.value.execute(id, parameters, signal, onUpdate, execution?.toolContinuation ? {\n\t\t\t\t\t\t...this.context,\n\t\t\t\t\t\ttoolContinuation: execution.toolContinuation\n\t\t\t\t\t} : this.context);\n\t\t\t\t}\n\t\t\t}));\n\t\t\tawait this.options.applyTools(tools);\n\t\t\tthis.tools = next;\n\t\t};\n\t\tthis.kernel.defineSlot(\"tools\", applyTools);\n\t\tthis.kernel.defineSlot(\"resources\", async (entries) => {\n\t\t\tconst searchable = this.listSkills().length > FLAT_SKILL_LIMIT;\n\t\t\tthis.resources = this.selected(entries);\n\t\t\tthis.resolvedResources = await this.resolveResources(this.applying);\n\t\t\tawait this.options.applyResources(this.resolvedResources);\n\t\t\tif (searchable !== this.listSkills().length > FLAT_SKILL_LIMIT) await applyTools(this.kernel.activeValues(\"tools\"));\n\t\t});\n\t\tthis.kernel.defineSlot(\"commands\", (entries) => {\n\t\t\tconst next = /* @__PURE__ */ new Map();\n\t\t\tfor (const entry of this.selected(entries)) if (!next.has(entry.value.name)) next.set(entry.value.name, entry);\n\t\t\tthis.commands = next;\n\t\t});\n\t\tthis.kernel.defineSlot(\"hooks\", (entries) => {\n\t\t\tthis.hooks = this.selected(entries);\n\t\t});\n\t\tthis.kernel.defineSlot(\"activities\", async (entries) => {\n\t\t\tconst desired = new Set(this.selected(entries));\n\t\t\tfor (const [entry, stop] of [...this.activities].reverse()) {\n\t\t\t\tif (desired.has(entry)) continue;\n\t\t\t\tawait stop();\n\t\t\t\tthis.activities.delete(entry);\n\t\t\t}\n\t\t\tfor (const entry of desired) {\n\t\t\t\tif (this.activities.has(entry)) continue;\n\t\t\t\ttry {\n\t\t\t\t\tconst stop = await entry.value.start(this.options.context(this.applying));\n\t\t\t\t\tthis.activities.set(entry, stop);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (this.options.candidates.some((candidate) => candidate.packageName === entry.source && candidate.required)) throw error;\n\t\t\t\t\tthis.options.onError?.(error, \"activity\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\tget context() {\n\t\treturn this.options.context(this.applied);\n\t}\n\tget status() {\n\t\treturn {\n\t\t\trequestedRevision: this.requestedRevision,\n\t\t\tappliedRevision: this.appliedRevision,\n\t\t\tready: this.ready,\n\t\t\t...this.failure === void 0 ? {} : { error: this.failure instanceof Error ? this.failure.message : typeof this.failure === \"string\" ? this.failure : \"Headless selection failed\" }\n\t\t};\n\t}\n\t/**\n\t* The resources the last applied selection resolved to.\n\t*\n\t* `readResources` re-reads them for a live request and refuses while a\n\t* selection is mid-apply. A reader describing the applied composition wants\n\t* the same snapshot `getContextInventory` reports against, and wants it at\n\t* the same moments, so it reads this instead of dispatching.\n\t*/\n\tget appliedResources() {\n\t\treturn this.resolvedResources;\n\t}\n\tget toolSurface() {\n\t\treturn this.options.toolSurface?.();\n\t}\n\treadSkill(name) {\n\t\treturn this.resolvedResources.findLast((entry) => entry.kind === \"skill\" && entry.name === name)?.text;\n\t}\n\tlistSkills() {\n\t\treturn activeSkills(this.resolvedResources).map((resource) => {\n\t\t\tconst { name, description } = headlessHarnessSkill(resource);\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tdescription\n\t\t\t};\n\t\t});\n\t}\n\tinspectCapabilities() {\n\t\tconst ready = this.ready && !this.disposed;\n\t\tconst capabilities = [];\n\t\tif (ready) {\n\t\t\tfor (const entry of this.kernel.activeValues(\"tools\")) {\n\t\t\t\tconst active = this.tools.get(entry.value.name) === entry;\n\t\t\t\tconst discoverable = active && isPoHeadlessToolModelVisible(entry.value);\n\t\t\t\tconst reason = active ? discoverable ? void 0 : \"not-discoverable\" : !this.matches(entry.value.when) ? \"inactive\" : !this.allowsTool(entry.value.name) ? \"restricted\" : \"shadowed\";\n\t\t\t\tcapabilities.push({\n\t\t\t\t\tsource: entry.source,\n\t\t\t\t\tname: entry.value.name,\n\t\t\t\t\tkind: \"tool\",\n\t\t\t\t\twhen: structuredClone(entry.value.when),\n\t\t\t\t\tactive,\n\t\t\t\t\tdiscoverable,\n\t\t\t\t\t...reason ? { reason } : {}\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst resolved = new Map(this.resolvedResources.filter((entry) => entry.kind === \"skill\").map((entry) => [entry.name, entry]));\n\t\t\tfor (const entry of this.kernel.activeValues(\"resources\")) {\n\t\t\t\tif (entry.value.kind !== \"skill\") continue;\n\t\t\t\tconst current = resolved.get(entry.value.name);\n\t\t\t\tconst selected = this.matches(entry.value.when);\n\t\t\t\tconst active = selected && current?.source === entry.source && current.path === entry.value.path && current.text.trim().length > 0;\n\t\t\t\tconst discoverable = active && !!current?.path && !!current.description?.trim();\n\t\t\t\tconst reason = !selected ? \"inactive\" : current && current.source !== entry.source ? \"shadowed\" : !active ? \"unavailable\" : !discoverable ? \"not-discoverable\" : void 0;\n\t\t\t\tcapabilities.push({\n\t\t\t\t\tsource: entry.source,\n\t\t\t\t\tname: entry.value.name,\n\t\t\t\t\tkind: \"skill\",\n\t\t\t\t\twhen: structuredClone(entry.value.when),\n\t\t\t\t\tactive,\n\t\t\t\t\tdiscoverable,\n\t\t\t\t\t...reason ? { reason } : {}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\trevision: this.appliedRevision,\n\t\t\tready,\n\t\t\tcapabilities\n\t\t};\n\t}\n\t/**\n\t* Every tool name this composition's eligible owners declare, including the\n\t* ones a condition or a restriction currently gates out.\n\t*\n\t* `appliedTools` answers what runs now. A merge that places another surface's\n\t* tools beside these needs what is spoken for, so a name a package deliberately\n\t* withheld is not handed to an unreconciled surface instead. Owner\n\t* eligibility stays the outer gate: a package the selection excluded declares\n\t* nothing here.\n\t*/\n\tget declaredToolNames() {\n\t\treturn new Set(this.kernel.activeValues(\"tools\").map((entry) => entry.value.name));\n\t}\n\tgetContextInventory(selection = this.applied, countTokens) {\n\t\tconst currentSources = new Set(this.options.candidates.filter((candidate) => candidate.scopes.includes(\"session\") && candidate.owners.some((owner) => owner.majorMode === selection.majorMode)).map((candidate) => candidate.packageName));\n\t\tconst conditionAttribution = (when) => {\n\t\t\tif (when?.attribution) return when.attribution;\n\t\t\tif (when?.domains?.length === 1) return {\n\t\t\t\tkind: \"domain\",\n\t\t\t\tmode: when.domains[0]\n\t\t\t};\n\t\t\tif (when?.domains && when.domains.length > 1) return {\n\t\t\t\tkind: \"shared\",\n\t\t\t\tmode: \"po:shared\",\n\t\t\t\tlabel: \"shared\"\n\t\t\t};\n\t\t\treturn when?.domain === void 0 ? void 0 : {\n\t\t\t\tkind: \"domain\",\n\t\t\t\tmode: when.domain\n\t\t\t};\n\t\t};\n\t\tconst mcpOwners = /* @__PURE__ */ new Map();\n\t\tfor (const server of readPoMcpStatus(this.ctx)?.getSnapshot().servers ?? []) for (const name of server.tools) mcpOwners.set(name, server.name);\n\t\tconst mcpPackages = /* @__PURE__ */ new Map();\n\t\tconst toolsBySource = /* @__PURE__ */ new Map();\n\t\tfor (const contribution of this.kernel.contributions(\"tools\")) {\n\t\t\tif (!currentSources.has(contribution.source)) continue;\n\t\t\tconst tool = contribution.value.value;\n\t\t\tif (!isPoHeadlessToolModelVisible(tool)) continue;\n\t\t\tconst contextAttribution = conditionAttribution(tool.when);\n\t\t\tconst entry = {\n\t\t\t\tname: tool.name,\n\t\t\t\tdescription: describeSkillTool(tool, this.resolvedResources),\n\t\t\t\tparameters: tool.parameters,\n\t\t\t\t...tool.promptSnippet === void 0 ? {} : { promptSnippet: tool.promptSnippet },\n\t\t\t\t...tool.promptGuidelines === void 0 ? {} : { promptGuidelines: tool.promptGuidelines },\n\t\t\t\tactive: this.tools.get(tool.name) === contribution.value,\n\t\t\t\t...contextAttribution === void 0 ? {} : { contextAttribution }\n\t\t\t};\n\t\t\tconst server = mcpOwners.get(tool.name);\n\t\t\tconst source = server === void 0 ? contribution.source : `mcp:${server}`;\n\t\t\tif (server !== void 0) mcpPackages.set(server, contribution.source);\n\t\t\tconst tools = toolsBySource.get(source);\n\t\t\tif (tools) tools.push(entry);\n\t\t\telse toolsBySource.set(source, [entry]);\n\t\t}\n\t\tconst sources = [...toolsBySource].map(([source, tools]) => ({\n\t\t\tkey: source,\n\t\t\tlabel: mcpPackages.has(source.slice(4)) ? `${source.slice(4)} · mcp` : `${source} · extension`,\n\t\t\tkind: mcpPackages.has(source.slice(4)) ? \"mcp\" : \"extension\",\n\t\t\tpackageName: mcpPackages.get(source.slice(4)) ?? source,\n\t\t\ttools\n\t\t}));\n\t\tconst listedSkills = systemPromptSkills(this.resolvedResources, [...this.tools.values()].some(({ value }) => value.name === \"load_skill\" && isPoHeadlessToolModelVisible(value)));\n\t\tconst framingTokens = countTokens === void 0 ? 0 : countTokens(formatSkillsForSystemPrompt([]));\n\t\tconst skills = this.resolvedResources.flatMap((resource) => {\n\t\t\tif (resource.kind !== \"skill\") return [];\n\t\t\tconst skill = headlessHarnessSkill(resource);\n\t\t\tconst contextAttribution = conditionAttribution(this.resourceDeclarations.get(resource)?.when);\n\t\t\treturn [{\n\t\t\t\tname: skill.name,\n\t\t\t\tdescription: skill.description,\n\t\t\t\tgroup: \"extensions\",\n\t\t\t\towner: resource.source,\n\t\t\t\tmodelInvocable: true,\n\t\t\t\tbody: skill.content,\n\t\t\t\t...countTokens === void 0 ? {} : { promptTokens: listedSkills.includes(resource) ? Math.max(0, countTokens(formatSkillsForSystemPrompt([skill])) - framingTokens) : 0 },\n\t\t\t\t...contextAttribution === void 0 ? {} : { contextAttribution }\n\t\t\t}];\n\t\t});\n\t\tconst attribution = {};\n\t\tfor (const candidate of this.options.candidates) {\n\t\t\tconst owner = candidate.owners.find((entry) => entry.majorMode === selection.majorMode && (entry.layer === \"default\" || selection.activeLayers.includes(entry.layer))) ?? candidate.owners.find((entry) => entry.majorMode === selection.majorMode);\n\t\t\tif (owner && attribution[candidate.packageName] === void 0) attribution[candidate.packageName] = {\n\t\t\t\tkind: \"major\",\n\t\t\t\tmode: selection.majorMode,\n\t\t\t\tlayer: owner.layer\n\t\t\t};\n\t\t}\n\t\tfor (const [server, source] of mcpPackages) if (attribution[source]) attribution[server] = attribution[source];\n\t\treturn {\n\t\t\tsources,\n\t\t\tskills,\n\t\t\tattribution\n\t\t};\n\t}\n\tsetAvailableSources(sources) {\n\t\tthis.availableSources = new Set(sources);\n\t}\n\tmatches(when) {\n\t\treturn Object.entries(when?.state ?? {}).every(([key, value]) => this.applying.state?.[key]?.includes(value)) && (when?.domain === void 0 || this.applying.domains.includes(when.domain)) && (when?.domains === void 0 || when.domains.some((domain) => this.applying.domains.includes(domain)));\n\t}\n\tselected(entries) {\n\t\treturn entries.filter(({ value }) => this.matches(value.when));\n\t}\n\tassertActive(source) {\n\t\tthis.assertReady();\n\t\tif (source !== void 0 && !this.activeSources.has(source)) throw new Error(`Contribution owner '${source}' is inactive`);\n\t}\n\tsubscribeSelection(listener) {\n\t\tthis.selectionListeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.selectionListeners.delete(listener);\n\t\t};\n\t}\n\t/** Shared by package reconciliation and the final Pi/package merge. */\n\tallowsTool(name) {\n\t\tconst allowed = this.options.allowedTools?.(this.applying);\n\t\treturn (name !== \"search_skills\" || this.listSkills().length > FLAT_SKILL_LIMIT) && (allowed === void 0 || allowed.includes(name)) && this.restrictions.every((restriction) => (restriction.allowedTools === void 0 || restriction.allowedTools.includes(name)) && !restriction.excludedTools?.includes(name));\n\t}\n\tregisterToolRestriction(restriction) {\n\t\treturn this.add(\"restrictions\", restriction);\n\t}\n\teligible(entry, selection) {\n\t\treturn entry.scopes.includes(\"session\") && entry.owners.some((owner) => owner.majorMode === selection.majorMode && (owner.layer === \"default\" || selection.activeLayers.includes(owner.layer)));\n\t}\n\tchangeSelection(change, options) {\n\t\tconst apply = (change) => {\n\t\t\tthis.selectionOverrides.add(change.axis);\n\t\t\tif (change.axis === \"majorMode\") return this.select({ majorMode: change.majorMode });\n\t\t\tif (change.axis === \"domains\") return this.select({ domains: change.domains });\n\t\t\tif (change.axis === \"profile\") return this.select({ profile: change.profile });\n\t\t\treturn this.select({ state: {\n\t\t\t\t...this.requested.state,\n\t\t\t\t[change.key]: [...change.values]\n\t\t\t} });\n\t\t};\n\t\treturn this.options.scheduleSelection?.(change, apply, options) ?? apply(change);\n\t}\n\tasync refreshChangedSelection(previous, selection, previousValues) {\n\t\tconst majorChanged = previous.majorMode !== selection.majorMode || !sameStrings(previous.activeLayers, selection.activeLayers);\n\t\tconst domainsChanged = !sameStrings(previous.domains, selection.domains);\n\t\tconst profileChanged = previous.profile !== selection.profile;\n\t\tconst stateChanged = JSON.stringify(previous.state ?? {}) !== JSON.stringify(selection.state ?? {});\n\t\tif (this.appliedRevision === 0) return;\n\t\tconst refresh = async (slot) => {\n\t\t\tif (sameValues(previousValues.get(slot) ?? [], this.kernel.activeValues(slot))) await this.kernel.refresh(slot);\n\t\t};\n\t\tif (stateChanged) await refresh(\"restrictions\");\n\t\tif (majorChanged || domainsChanged || stateChanged || this.restrictionsChanged) await refresh(\"tools\");\n\t\tif (majorChanged || domainsChanged || profileChanged || stateChanged) await refresh(\"resources\");\n\t\tif (domainsChanged || stateChanged) {\n\t\t\tawait refresh(\"commands\");\n\t\t\tawait refresh(\"hooks\");\n\t\t\tawait refresh(\"activities\");\n\t\t}\n\t}\n\t/** Refresh inherited defaults only at turn admission, keeping explicit session axes. */\n\tasync inheritSelection(selection) {\n\t\tconst patch = {\n\t\t\t...!this.selectionOverrides.has(\"majorMode\") && selection.majorMode !== void 0 ? { majorMode: selection.majorMode } : {},\n\t\t\t...!this.selectionOverrides.has(\"domains\") && selection.domains !== void 0 ? { domains: selection.domains } : {},\n\t\t\t...!this.selectionOverrides.has(\"profile\") && Object.hasOwn(selection, \"profile\") ? { profile: selection.profile } : {}\n\t\t};\n\t\tif ((patch.majorMode === void 0 || patch.majorMode === this.requested.majorMode) && (patch.domains === void 0 || sameStrings(patch.domains, this.requested.domains)) && (!Object.hasOwn(patch, \"profile\") || patch.profile === this.requested.profile)) return;\n\t\tawait this.select(patch);\n\t}\n\tasync select(patch) {\n\t\tif (this.disposed) throw new Error(\"The headless host is disposed\");\n\t\tconst requested = structuredClone({\n\t\t\t...this.requested,\n\t\t\t...patch\n\t\t});\n\t\tthis.requested = requested;\n\t\tconst revision = ++this.requestedRevision;\n\t\tthis.ready = false;\n\t\tconst apply = async () => {\n\t\t\tif (this.disposed) throw new Error(\"The headless host is disposed\");\n\t\t\tconst selection = structuredClone(await this.options.resolveSelection?.(requested) ?? requested);\n\t\t\tawait this.options.validateSelection?.(selection);\n\t\t\tif (revision === this.requestedRevision) this.requested = selection;\n\t\t\tconst eligible = this.options.candidates.filter((entry) => this.eligible(entry, selection));\n\t\t\tconst missing = eligible.find((entry) => entry.required && !this.availableSources.has(entry.packageName));\n\t\t\tif (missing) throw new Error(`Required headless package '${missing.packageName}' is unavailable`);\n\t\t\tthis.applying = selection;\n\t\t\tthis.refreshing = true;\n\t\t\tlet compositionChanged = false;\n\t\t\ttry {\n\t\t\t\tconst previousValues = new Map(this.kernel.slots.map((slot) => [slot, this.kernel.activeValues(slot)]));\n\t\t\t\tawait this.kernel.setActiveLayers(eligible.map((entry) => entry.packageName));\n\t\t\t\tawait this.refreshChangedSelection(this.applied, selection, previousValues);\n\t\t\t\tcompositionChanged = this.failure !== void 0 || this.appliedRevision === 0 || !sameSelection(this.applied, selection) || this.restrictionsChanged || this.contributionsChanged || !sameValues(previousValues.get(\"tools\") ?? [], this.kernel.activeValues(\"tools\")) || !sameValues(previousValues.get(\"resources\") ?? [], this.kernel.activeValues(\"resources\"));\n\t\t\t\tthis.restrictionsChanged = false;\n\t\t\t\tthis.contributionsChanged = false;\n\t\t\t} finally {\n\t\t\t\tthis.refreshing = false;\n\t\t\t}\n\t\t\tif (this.disposed) throw new Error(\"The headless host is disposed\");\n\t\t\tthis.activeSources = new Set(eligible.map((entry) => entry.packageName));\n\t\t\tthis.applied = selection;\n\t\t\tthis.appliedRevision = revision;\n\t\t\tthis.failure = void 0;\n\t\t\tthis.ready = revision === this.requestedRevision;\n\t\t\ttry {\n\t\t\t\tfor (const listener of this.selectionListeners) await listener(selection);\n\t\t\t} catch (error) {\n\t\t\t\tif (isPoHeadlessPromptAdmissionError(error)) this.recoveryRevision = revision;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tif (compositionChanged) await this.options.onApplied?.(selection, revision);\n\t\t};\n\t\tconst result = this.tail.catch(() => void 0).then(apply);\n\t\tthis.tail = result.catch((error) => {\n\t\t\tthis.failure = error;\n\t\t\tthis.ready = false;\n\t\t\tif (!this.disposed) this.options.onError?.(error, \"apply\");\n\t\t});\n\t\tawait result;\n\t\tawait this.settled();\n\t\tif (this.failure !== void 0) throw this.failure;\n\t\tthis.assertReady();\n\t}\n\t/** Drain selections, including ones queued by selection listeners. */\n\tasync settled() {\n\t\tlet pending;\n\t\tdo {\n\t\t\tpending = this.tail;\n\t\t\tawait pending;\n\t\t} while (pending !== this.tail);\n\t}\n\tassertReady() {\n\t\tif (this.disposed || !this.ready) throw new Error(\"Headless dispatch is blocked until selection is coherently applied\");\n\t}\n\tadd(slot, value) {\n\t\tconst owner = readPoHeadlessOwner(this.ctx);\n\t\tif (!owner) throw new Error(\"A headless contribution must have descriptor-owned package identity\");\n\t\tthis.ready = false;\n\t\tthis.contributionsChanged = true;\n\t\tconst registration = this.kernel.contribute(slot, {\n\t\t\tsource: owner.packageName,\n\t\t\tlayer: owner.packageName,\n\t\t\tvalue: {\n\t\t\t\tsource: owner.packageName,\n\t\t\t\tvalue\n\t\t\t}\n\t\t});\n\t\tlet disposed = false;\n\t\tconst dispose = () => {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tthis.ready = false;\n\t\t\tthis.contributionsChanged = true;\n\t\t\tregistration.dispose();\n\t\t\tif (this.appliedRevision > 0 && !this.disposed && !this.refreshing) this.select({}).catch(() => void 0);\n\t\t};\n\t\tthis.ctx.effect(() => dispose, `headless ${slot} contribution`);\n\t\tif (this.appliedRevision > 0 && !this.refreshing) this.select({}).catch(() => void 0);\n\t\treturn { dispose };\n\t}\n\tregisterTool(tool) {\n\t\treturn this.add(\"tools\", tool);\n\t}\n\tregisterResource(resource) {\n\t\treturn this.add(\"resources\", resource);\n\t}\n\tregisterCommand(command) {\n\t\treturn this.add(\"commands\", command);\n\t}\n\tregisterHook(hook) {\n\t\treturn this.add(\"hooks\", hook);\n\t}\n\tregisterActivity(activity) {\n\t\treturn this.add(\"activities\", activity);\n\t}\n\tcanRecoverSelection() {\n\t\treturn !this.disposed && !this.ready && !this.refreshing && !this.contributionsChanged && !this.restrictionsChanged && this.recoveryRevision === this.requestedRevision && this.appliedRevision === this.requestedRevision && isPoHeadlessPromptAdmissionError(this.failure);\n\t}\n\tlistCommands() {\n\t\tconst recovering = this.canRecoverSelection();\n\t\tif (!recovering) this.assertReady();\n\t\treturn [...this.commands.values()].filter(({ source, value }) => !recovering || value.selectionRecovery === true && this.activeSources.has(source) && this.availableSources.has(source)).map(({ value }) => ({\n\t\t\tname: value.name,\n\t\t\tdescription: value.description\n\t\t}));\n\t}\n\tasync dispatchCommand(name, args) {\n\t\tconst command = this.commands.get(name);\n\t\tif (!this.canRecoverSelection() || command?.value.selectionRecovery !== true) this.assertReady();\n\t\tif (!command || !this.activeSources.has(command.source) || !this.availableSources.has(command.source)) throw new Error(`Command '${name}' is inactive or unknown`);\n\t\tawait command.value.execute(args, this.context);\n\t}\n\tasync dispatchHook(event, payload, signal) {\n\t\tthis.assertReady();\n\t\tsignal?.throwIfAborted();\n\t\tconst results = [];\n\t\tconst revision = this.appliedRevision;\n\t\tlet current = payload;\n\t\tfor (const hook of this.hooks.filter((entry) => entry.value.event === event)) {\n\t\t\tthis.assertReady();\n\t\t\tsignal?.throwIfAborted();\n\t\t\tif (!this.hooks.includes(hook)) continue;\n\t\t\tlet result;\n\t\t\ttry {\n\t\t\t\tresult = await hook.value.handle(current, signal ? {\n\t\t\t\t\t...this.context,\n\t\t\t\t\tsignal\n\t\t\t\t} : this.context);\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t} catch (error) {\n\t\t\t\tif (isPoHeadlessPromptAdmissionError(error)) throw error;\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\tthis.options.onError?.(error, \"hook\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (event === \"session_start\") {\n\t\t\t\tawait this.tail;\n\t\t\t\tthis.assertReady();\n\t\t\t}\n\t\t\tresults.push(result);\n\t\t\tif (result && typeof result === \"object\" && !Array.isArray(result)) {\n\t\t\t\tconst patch = result;\n\t\t\t\tconst fields = event === \"context\" ? [\"messages\", \"systemPrompt\"] : event === \"tool_call\" ? [\"args\"] : event === \"tool_result\" ? [\n\t\t\t\t\t\"content\",\n\t\t\t\t\t\"details\",\n\t\t\t\t\t\"isError\",\n\t\t\t\t\t\"usage\"\n\t\t\t\t] : event === \"before_agent_start\" ? [\"systemPrompt\"] : event === \"before_provider_request\" ? [\"payload\"] : [];\n\t\t\t\tfor (const field of fields) {\n\t\t\t\t\tif (event === \"before_agent_start\" && typeof patch[field] !== \"string\") continue;\n\t\t\t\t\tif (patch[field] !== void 0) current = {\n\t\t\t\t\t\t...current,\n\t\t\t\t\t\t[field]: patch[field]\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (event === \"tool_call\" && patch.block !== void 0) break;\n\t\t\t\tif (event === \"session_before_compact\" && (patch.cancel !== void 0 || patch.decline !== void 0 || patch.compaction !== void 0)) break;\n\t\t\t}\n\t\t}\n\t\tif (event === \"before_agent_start\" || event === \"context\" || event === \"tool_call\") {\n\t\t\tthis.assertReady();\n\t\t\tif (revision !== this.appliedRevision) throw new Error(event === \"before_agent_start\" ? \"Selection changed while preparing the system prompt\" : `Selection changed while dispatching ${event}`);\n\t\t}\n\t\treturn results;\n\t}\n\tasync resolveResources(selection) {\n\t\tconst context = this.options.context(selection);\n\t\tconst result = [];\n\t\tfor (const resource of this.resources) {\n\t\t\tlet value;\n\t\t\ttry {\n\t\t\t\tvalue = await resource.value.read(context);\n\t\t\t} catch (error) {\n\t\t\t\tthis.options.onError?.(new Error(`Could not read headless resource '${resource.source}/${resource.value.name}'`, { cause: error }), \"resource\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = {\n\t\t\t\tsource: resource.source,\n\t\t\t\tname: resource.value.name,\n\t\t\t\tkind: resource.value.kind,\n\t\t\t\t...resource.value.description === void 0 ? {} : { description: resource.value.description },\n\t\t\t\t...resource.value.path === void 0 ? {} : { path: resource.value.path },\n\t\t\t\t...resource.value.pinned === true ? { pinned: true } : {},\n\t\t\t\ttext: value\n\t\t\t};\n\t\t\tthis.resourceDeclarations.set(resolved, resource.value);\n\t\t\tresult.push(resolved);\n\t\t}\n\t\treturn result;\n\t}\n\tasync readResources() {\n\t\tthis.assertReady();\n\t\tconst revision = this.appliedRevision;\n\t\tconst result = await this.resolveResources(this.applied);\n\t\tthis.assertReady();\n\t\tif (revision !== this.appliedRevision) throw new Error(\"Selection changed while reading resources\");\n\t\treturn result;\n\t}\n\tasync close() {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.ready = false;\n\t\tthis.selectionListeners.clear();\n\t\tawait this.tail.catch(() => void 0);\n\t\tconst failures = [];\n\t\tfor (const stop of [...this.activities.values()].reverse()) try {\n\t\t\tawait stop();\n\t\t} catch (error) {\n\t\t\tfailures.push(error);\n\t\t}\n\t\tthis.activities.clear();\n\t\tthis.kernel.dispose();\n\t\tif (failures.length) throw new AggregateError(failures, \"Headless activities failed to stop\");\n\t}\n};\n//#endregion\nexport { HeadlessHost, describeSkillTool, headlessHarnessSkill, systemPromptSkills };\n\n//# sourceMappingURL=headlessHost.mjs.map","import { Type } from \"typebox\";\n//#region src/schemas/workflow.ts\nconst PO_WORKFLOW_LAUNCH_SERVICE = \"po/workflow-launch\";\nconst PO_WORKFLOW_DEFINITION_SOURCES_SERVICE = \"po/workflow-definition-sources\";\nconst PO_WORKFLOW_RUNS_SERVICE = \"po/workflow-runs\";\nconst PO_WORKFLOW_CONTEXT_SERVICE = \"po/workflow-context\";\n/** A source-relative definition, never an arbitrary host path. */\nconst PoWorkflowDefinitionRefSchema = Type.Object({\n\tsource: Type.String({ minLength: 1 }),\n\tkey: Type.String({\n\t\tminLength: 1,\n\t\tpattern: \"^(?!/)(?!.*\\\\\\\\)(?!.*:)(?!.*[\\\\u0000-\\\\u001f\\\\u007f])(?!.*(?:^|/)\\\\.{1,2}(?:/|$))[^/]+(?:/[^/]+)*$\"\n\t})\n}, { additionalProperties: false });\n/** Registration receipt. runId fences a runKey that can be reused later. */\nconst PoWorkflowRunRefSchema = Type.Object({\n\trunId: Type.String({ minLength: 1 }),\n\townerSessionId: Type.String({ minLength: 1 }),\n\trunKey: Type.String({ minLength: 1 }),\n\tregistryWorkspace: Type.String({ minLength: 1 })\n}, { additionalProperties: false });\nfunction readPoWorkflowLaunchService(context) {\n\treturn context.get(PO_WORKFLOW_LAUNCH_SERVICE);\n}\nfunction readPoWorkflowDefinitionSourcesService(context) {\n\treturn context.get(PO_WORKFLOW_DEFINITION_SOURCES_SERVICE);\n}\nfunction readPoWorkflowRunsService(context) {\n\treturn context.get(PO_WORKFLOW_RUNS_SERVICE);\n}\nfunction readPoWorkflowContextService(context) {\n\treturn context.get(PO_WORKFLOW_CONTEXT_SERVICE);\n}\n//#endregion\nexport { PO_WORKFLOW_CONTEXT_SERVICE, PO_WORKFLOW_DEFINITION_SOURCES_SERVICE, PO_WORKFLOW_LAUNCH_SERVICE, PO_WORKFLOW_RUNS_SERVICE, PoWorkflowDefinitionRefSchema, PoWorkflowRunRefSchema, readPoWorkflowContextService, readPoWorkflowDefinitionSourcesService, readPoWorkflowLaunchService, readPoWorkflowRunsService };\n\n//# sourceMappingURL=workflow.mjs.map","import { defineDoc } from \"@earendil-works/pi-durable\";\n//#region src/services/durableSubagents/docs.ts\n/** This session's child runs by run ID, and the child conversations of reported runs dropped past the cap. */\nconst SubagentsDoc = defineDoc({\n\tkind: \"po.subagents.identity\",\n\tversion: 1,\n\tscope: \"session\",\n\tinitial: () => ({\n\t\truns: {},\n\t\tretired: []\n\t})\n});\n//#endregion\nexport { SubagentsDoc };\n\n//# sourceMappingURL=docs.mjs.map","import { defineTask } from \"@earendil-works/pi-durable\";\n//#region src/services/durableSubagents/tasks.ts\n/**\n* Owns a child conversation so it outlives the parent's turns. A background task that finishes at once: the\n* parent's Esc and idle waits stop at it, while the child keeps working and resumes with the Harness.\n*/\nconst SubagentAnchorTask = defineTask({\n\tname: \"po.subagents.anchor\",\n\tversion: 1,\n\tinitial: () => ({ phase: \"done\" }),\n\tphases: { done: (_anchor, runtime, context) => runtime.commit(() => ({\n\t\tstatus: \"terminal\",\n\t\toutcome: {\n\t\t\tstatus: \"completed\",\n\t\t\tresult: null\n\t\t}\n\t}), context) },\n\tabort: (_anchor, runtime, context) => runtime.commit(() => ({\n\t\tstatus: \"terminal\",\n\t\toutcome: { status: \"aborted\" }\n\t}), context)\n});\n//#endregion\nexport { SubagentAnchorTask };\n\n//# sourceMappingURL=tasks.mjs.map","import { SubagentAnchorTask } from \"./tasks.mjs\";\nimport { defineExtension } from \"@earendil-works/pi-durable\";\n//#region src/services/durableSubagents/extension.ts\n/** Installed in every Harness so a live anchor's definition resolves after a restart. */\nconst SubagentsExtension = defineExtension({\n\tname: \"po.subagents\",\n\ttasks: [SubagentAnchorTask]\n});\n//#endregion\nexport { SubagentsExtension };\n\n//# sourceMappingURL=extension.mjs.map","import { SubagentsDoc } from \"./docs.mjs\";\nimport { SubagentAnchorTask } from \"./tasks.mjs\";\nimport { SubagentsExtension } from \"./extension.mjs\";\n//#region src/services/durableSubagents/index.ts\n/**\n* Creates one run's child conversation, owned by a background anchor of `parent`, and records the run, in one\n* commit. A fresh child starts as a copy of the parent's agent; a fork also keeps its history through `forkAt`.\n*/\nasync function createSubagentConversation(harness, parent, launch, context) {\n\tconst { id, stored } = await parent.commit(async (tx) => {\n\t\tconst anchor = await tx.createTask(SubagentAnchorTask, null, {\n\t\t\townership: { kind: \"conversation\" },\n\t\t\tbackground: true\n\t\t});\n\t\tconst ownership = {\n\t\t\tkind: \"task\",\n\t\t\ttaskId: anchor\n\t\t};\n\t\tconst child = launch.forkAt === void 0 ? await tx.createConversation({ ownership }) : await tx.forkConversation(parent.id, launch.forkAt, { ownership });\n\t\tconst runs = (await tx.doc(SubagentsDoc)).runs;\n\t\tif (Object.hasOwn(runs, launch.runId)) throw new Error(`Child run '${launch.runId}' already exists.`);\n\t\tconst record = {\n\t\t\tconversationId: child.id,\n\t\t\tanchorTaskId: anchor,\n\t\t\tinputRequestId: `subagent:${anchor}:1`,\n\t\t\trequest: launch.request,\n\t\t\treported: false\n\t\t};\n\t\truns[launch.runId] = record;\n\t\treturn {\n\t\t\tid: child.id,\n\t\t\tstored: record\n\t\t};\n\t}, context);\n\tconst conversation = await harness.conversation(id, context);\n\tif (!conversation) throw new Error(`Child conversation ${id} is unavailable.`);\n\treturn {\n\t\tconversation,\n\t\tstored\n\t};\n}\nasync function readSubagents(harness, context) {\n\treturn (await harness.snapshot(SubagentsDoc, context))?.runs ?? {};\n}\nconst MAX_REPORTED_RUNS = 256;\n/**\n* Marks a run reported and drops the request only a re-attach needed, keeping its agent, task and outcome. Returns\n* the run's child conversation, or nothing when the run was already reported or is unknown.\n*/\nasync function markSubagentReported(harness, runId, context, outcome, maxReported = MAX_REPORTED_RUNS) {\n\treturn harness.commit(async (tx) => {\n\t\tconst doc = await tx.doc(SubagentsDoc);\n\t\tconst run = doc.runs[runId];\n\t\tif (!run || run.reported) return void 0;\n\t\trun.reported = true;\n\t\tif (typeof run.request?.agent === \"string\") run.agent = run.request.agent;\n\t\tif (typeof run.request?.task === \"string\") run.task = run.request.task;\n\t\tif (outcome) run.state = outcome.state;\n\t\trun.request = null;\n\t\tconst reported = Object.entries(doc.runs).filter(([, stored]) => stored.reported);\n\t\tconst dropped = reported.slice(0, Math.max(0, reported.length - maxReported));\n\t\tif (dropped.length > 0) {\n\t\t\tdoc.retired = [...doc.retired ?? [], ...dropped.map(([, stored]) => stored.conversationId)];\n\t\t\tfor (const [id] of dropped) delete doc.runs[id];\n\t\t}\n\t\treturn run.conversationId;\n\t}, context);\n}\n/**\n* Stops a run nothing could re-attach, before the Harness resumes: its child would otherwise run on without a\n* launcher. Only marks its live tasks and withdraws its queued inputs, so scheduling stays paused, then reports it\n* failed. Returns its child conversation, or nothing for an unknown or reported run.\n*/\nasync function abandonSubagent(harness, runId, context) {\n\tconst run = (await readSubagents(harness, context))[runId];\n\tif (!run || run.reported) return void 0;\n\tconst { tasks, submissions } = await harness.inspect(context);\n\tfor (const submission of submissions) if (submission.conversationId === run.conversationId && submission.status === \"queued\") await harness.abortSubmission(submission.id, context, submission.conversationId);\n\tfor (const task of tasks) if (task.record.conversationId === run.conversationId) await harness.abortTask(task.record.id, context);\n\treturn markSubagentReported(harness, runId, context, { state: \"failed\" });\n}\n/** Child conversations of this session; their launcher reports what they spend, not the parent. */\nasync function subagentConversations(harness, context) {\n\tconst doc = await harness.snapshot(SubagentsDoc, context);\n\treturn [...Object.values(doc?.runs ?? {}).map((run) => run.conversationId), ...doc?.retired ?? []].map((id) => id);\n}\n//#endregion\nexport { SubagentsExtension, abandonSubagent, createSubagentConversation, markSubagentReported, readSubagents, subagentConversations };\n\n//# sourceMappingURL=index.mjs.map","import { BACKGROUND_CONTEXT, withAbortSignal } from \"@earendil-works/chord/context\";\nimport { Value } from \"typebox/value\";\n//#region src/services/toolContinuation/index.ts\n/** The array is an envelope. Its ordinary string-command stages are admitted separately. */\nfunction isBashSequenceEnvelope(toolName, args) {\n\treturn toolName === \"bash\" && typeof args === \"object\" && args !== null && Array.isArray(args.command);\n}\n/** Retains policy, not an execution lane or an originating tool-call abort signal. */\nfunction createToolContinuation(options) {\n\tconst detached = (value) => JSON.parse(JSON.stringify(value));\n\tconst context = (signal) => {\n\t\tconst signals = [options.lifecycleSignal, signal].filter((item) => item !== void 0);\n\t\tconst combined = signals.length ? AbortSignal.any(signals) : void 0;\n\t\tcombined?.throwIfAborted();\n\t\toptions.assertAvailable();\n\t\treturn combined ? withAbortSignal(combined, BACKGROUND_CONTEXT) : BACKGROUND_CONTEXT;\n\t};\n\tconst validate = (request) => {\n\t\tif (request.toolName !== options.toolName || typeof request.toolCallId !== \"string\" || !request.toolCallId.trim()) throw new Error(\"Tool continuation identity is invalid.\");\n\t\tconst args = request.toolName === \"bash\" && typeof request.args.command === \"string\" ? {\n\t\t\t...request.args,\n\t\t\tcommand: [request.args.command]\n\t\t} : request.args;\n\t\tif (!Value.Check(options.parameters, args) || isBashSequenceEnvelope(request.toolName, request.args)) throw new Error(\"Tool continuation requires valid single-command arguments.\");\n\t};\n\treturn {\n\t\tasync admit(request) {\n\t\t\tconst execution = context(request.signal);\n\t\t\tvalidate(request);\n\t\t\tawait options.authorize?.();\n\t\t\tcontext(request.signal);\n\t\t\tconst args = detached(request.args);\n\t\t\tconst patch = await options.beforeTool?.({\n\t\t\t\ttoolCallId: request.toolCallId,\n\t\t\t\ttoolName: options.toolName,\n\t\t\t\targs\n\t\t\t}, execution);\n\t\t\tcontext(request.signal);\n\t\t\tif (patch?.block) throw new Error(patch.block.reason);\n\t\t\tconst admitted = detached(patch?.args ?? args);\n\t\t\tvalidate({\n\t\t\t\t...request,\n\t\t\t\targs: admitted\n\t\t\t});\n\t\t\tawait options.authorize?.();\n\t\t\tcontext(request.signal);\n\t\t\treturn admitted;\n\t\t},\n\t\tasync finalize(request) {\n\t\t\tconst execution = context(request.signal);\n\t\t\tvalidate(request);\n\t\t\tawait options.authorize?.();\n\t\t\tcontext(request.signal);\n\t\t\tconst result = detached(request.result);\n\t\t\tconst patch = await options.afterTool?.({\n\t\t\t\ttoolCallId: request.toolCallId,\n\t\t\t\ttoolName: options.toolName,\n\t\t\t\targs: detached(request.args),\n\t\t\t\tcontent: result.content,\n\t\t\t\t...result.details === void 0 ? {} : { details: result.details },\n\t\t\t\tisError: result.isError === true\n\t\t\t}, execution);\n\t\t\tcontext(request.signal);\n\t\t\tif (patch?.terminate) throw new Error(\"Tool result policy terminated the continuation.\");\n\t\t\tconst rewritten = patch && (\"content\" in patch || \"details\" in patch || \"isError\" in patch);\n\t\t\tconst { structuredContent, _meta, ...publicResult } = result;\n\t\t\treturn detached({\n\t\t\t\t...publicResult,\n\t\t\t\t...rewritten ? {} : {\n\t\t\t\t\tstructuredContent,\n\t\t\t\t\t_meta\n\t\t\t\t},\n\t\t\t\t...patch?.content === void 0 ? {} : { content: patch.content },\n\t\t\t\t...patch && \"details\" in patch ? { details: patch.details } : {},\n\t\t\t\t...patch?.isError === void 0 ? {} : { isError: patch.isError }\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\nexport { createToolContinuation, isBashSequenceEnvelope };\n\n//# sourceMappingURL=index.mjs.map","import { DurableNavigationDoc } from \"./docs.mjs\";\n//#region src/services/durableNavigation/index.ts\n/** Select the initial conversation without overwriting a previously persisted selection. */\nasync function initializeDurableNavigation(session, conversationId, context) {\n\treturn session.commit(async (tx) => {\n\t\tif (!await tx.conversation(conversationId)) throw new Error(\"Initial conversation does not exist\");\n\t\tconst navigation = await tx.doc(DurableNavigationDoc);\n\t\tnavigation.activeConversationId ??= conversationId;\n\t\treturn navigation.activeConversationId;\n\t}, context);\n}\n/**\n* Fork the selected history, retaining its abandoned tail. A head marker alone cannot rewind.\n* The caller must settle active work and prepare any summary before entering this transaction.\n* Expected selection guards against a stale asynchronous summary switching a newer selection.\n*/\nasync function navigateDurableConversation(session, expectedConversationId, targetId, context, options) {\n\treturn session.commit(async (tx) => {\n\t\tconst navigation = await tx.doc(DurableNavigationDoc);\n\t\tif (navigation.activeConversationId !== expectedConversationId) throw new Error(\"The active conversation changed during navigation\");\n\t\tconst next = targetId === null ? await tx.createConversation({ ownership: { kind: \"ownerless\" } }) : await tx.forkConversation(expectedConversationId, targetId, { ownership: { kind: \"ownerless\" } });\n\t\tif (options?.summary) await tx.appendEntry(next.id, options.summary);\n\t\tnavigation.activeConversationId = next.id;\n\t\treturn next.id;\n\t}, context);\n}\n//#endregion\nexport { initializeDurableNavigation, navigateDurableConversation };\n\n//# sourceMappingURL=index.mjs.map","import { defineDoc } from \"@earendil-works/pi-durable\";\n//#region src/services/durableQueue/docs.ts\n/** Po's inputs held outside pi.inbox: paused inputs, explicitly queued inputs, and abort intent. */\nconst HeldQueueDoc = defineDoc({\n\tkind: \"po.queue.held\",\n\tversion: 1,\n\tscope: \"session\",\n\tinitial: () => ({ json: \"{\\\"revision\\\":0,\\\"paused\\\":false,\\\"held\\\":[]}\" })\n});\n//#endregion\nexport { HeldQueueDoc };\n\n//# sourceMappingURL=docs.mjs.map","import { HeldQueueDoc } from \"./docs.mjs\";\nimport { CompactionTask, GenerationTask, InboxDoc, LiveDoc, UserEntry } from \"@earendil-works/pi-durable\";\n//#region src/services/durableQueue/index.ts\n/** pi-durable deduplicates by request ID, so a held input can be handed over again after a crash. */\nconst heldRequestId = (id) => `po.queue:${id}`;\n/** The pi.inbox content of a held or freshly submitted input. */\nfunction heldContent(message, images) {\n\tif (typeof message !== \"string\") {\n\t\tif (message.role !== \"user\") throw new Error(\"Only user messages can admit an agent run\");\n\t\treturn message.content;\n\t}\n\treturn images?.length ? [{\n\t\ttype: \"text\",\n\t\ttext: message\n\t}, ...images] : message;\n}\n/** Appends the entry an input is placed as: `entry`'s kind and data, or `pi.user`, as pi-durable's own boundary does. */\nfunction appendInput(tx, conversationId, content, entry, now) {\n\tconst model = [{\n\t\trole: \"user\",\n\t\tcontent,\n\t\ttimestamp: now\n\t}];\n\treturn entry ? tx.appendEntry(conversationId, {\n\t\tkind: entry.kind,\n\t\t...entry.data === void 0 ? {} : { data: entry.data },\n\t\tmodel\n\t}) : tx.appendEntry(UserEntry, conversationId, { model });\n}\n/**\n* Promotes one explicitly queued input to steer its operation, or starts it from idle, in one commit with only public\n* Tx operations: target validation and the move from held to pi.inbox happen on the same Session mutation line.\n*\n* Mirrors pi-durable `harness/inbox.d.ts:42-52` (`prepareBoundary`/`applyBoundary` at `final`) and `admitSubmission`\n* in `harness/submissions.js`, which pi-durable does not export. Re-run the promote tests on every pi-durable upgrade.\n*/\nasync function admitSelected(tx, conversationId, selection, modes, replay) {\n\tconst doc = await tx.doc(HeldQueueDoc);\n\tconst record = JSON.parse(doc.json);\n\tconst requestId = heldRequestId(selection.id);\n\tconst accepted = await tx.submissionByRequest(conversationId, requestId);\n\tif (accepted && accepted.type !== \"input\") throw new Error(`Request ${requestId} already identifies a submission of type ${accepted.type}`);\n\tif (accepted && replay) return accepted.id;\n\tif (accepted) return accepted.status === \"queued\" ? \"in_flight\" : \"not_found\";\n\tconst index = record.held.findIndex((q) => q.id === selection.id && q.explicitQueue);\n\tif (index === -1) return \"not_found\";\n\tconst q = record.held[index];\n\tconst live = await tx.doc(LiveDoc, conversationId);\n\tconst task = live.run ? await tx.task(live.run.taskId) : void 0;\n\tif ((live.run ? String(live.run.inputs[0]) : void 0) !== selection.operationId || task?.abortRequested || live.run && record.abortOperationId === selection.operationId) return \"target_changed\";\n\tif (!live.run) {\n\t\tlet page = await tx.scanTasks({\n\t\t\tconversationId,\n\t\t\tkind: CompactionTask.definition.name,\n\t\t\tbackground: false\n\t\t}, 128);\n\t\twhile (true) {\n\t\t\tif (page.items.some((task) => task.state.status !== \"terminal\")) return \"target_changed\";\n\t\t\tif (!page.next) break;\n\t\t\tpage = await tx.scanTasks({\n\t\t\t\tconversationId,\n\t\t\t\tkind: CompactionTask.definition.name,\n\t\t\t\tbackground: false\n\t\t\t}, 128, page.next);\n\t\t}\n\t}\n\tconst content = heldContent(q.message ?? q.text, q.images);\n\tconst inbox = await tx.doc(InboxDoc, conversationId);\n\tlet head = live.run ? void 0 : (await tx.latestHeadMarker(conversationId))?.head;\n\tconst now = Date.now();\n\tlet id;\n\tif (!live.run && inbox.items.length === 0) {\n\t\tconst entry = await appendInput(tx, conversationId, content, q.entry, now);\n\t\tid = (await tx.createSubmission({\n\t\t\tconversationId,\n\t\t\trequestId,\n\t\t\ttype: \"input\",\n\t\t\tstatus: \"placed\",\n\t\t\tentry: entry.id\n\t\t})).id;\n\t\tlive.run = {\n\t\t\ttaskId: await tx.createTask(GenerationTask, {}, {\n\t\t\t\townership: { kind: \"conversation\" },\n\t\t\t\tconversationId\n\t\t\t}),\n\t\t\tinputs: [id]\n\t\t};\n\t} else {\n\t\tid = (await tx.createSubmission({\n\t\t\tconversationId,\n\t\t\trequestId,\n\t\t\ttype: \"input\",\n\t\t\tstatus: \"queued\"\n\t\t})).id;\n\t\tinbox.items.push({\n\t\t\tid,\n\t\t\tmode: \"steer\",\n\t\t\tcontent: JSON.parse(JSON.stringify(content)),\n\t\t\t...q.entry ? { entry: JSON.parse(JSON.stringify(q.entry)) } : {}\n\t\t});\n\t\tif (!live.run) {\n\t\t\tconst writes = inbox.items.flatMap((item, index) => item.mode === \"write\" ? [index] : []);\n\t\t\tconst pick = (mode) => {\n\t\t\t\tconst indexes = inbox.items.flatMap((item, index) => item.mode === mode ? [index] : []);\n\t\t\t\treturn (mode === \"steer\" ? modes.steeringMode : modes.followUpMode) === \"all\" ? indexes : indexes.slice(0, 1);\n\t\t\t};\n\t\t\tconst users = [...pick(\"steer\"), ...pick(\"followUp\")].sort((a, b) => a - b);\n\t\t\tfor (const index of writes) {\n\t\t\t\tconst item = inbox.items[index];\n\t\t\t\tif (item.mode !== \"write\") continue;\n\t\t\t\tconst draft = item.entry;\n\t\t\t\tif (typeof draft.head === \"number\" && head !== void 0 && draft.head < head) {\n\t\t\t\t\ttx.settleSubmission(item.id, {\n\t\t\t\t\t\tstatus: \"unanswered\",\n\t\t\t\t\t\treason: \"stale\"\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst entry = await tx.appendEntry(conversationId, draft);\n\t\t\t\tif (draft.head !== void 0) head = draft.head === \"self\" ? entry.id : draft.head;\n\t\t\t\ttx.placeSubmission(item.id, entry.id);\n\t\t\t}\n\t\t\tconst inputs = [];\n\t\t\tfor (const index of users) {\n\t\t\t\tconst item = inbox.items[index];\n\t\t\t\tif (item.mode === \"write\") continue;\n\t\t\t\tconst entry = await appendInput(tx, conversationId, item.content, item.entry, now);\n\t\t\t\ttx.placeSubmission(item.id, entry.id);\n\t\t\t\tinputs.push(item.id);\n\t\t\t}\n\t\t\tfor (const index of [...writes, ...users].sort((a, b) => b - a)) inbox.items.splice(index, 1);\n\t\t\tif (inputs.length) live.run = {\n\t\t\t\ttaskId: await tx.createTask(GenerationTask, {}, {\n\t\t\t\t\townership: { kind: \"conversation\" },\n\t\t\t\t\tconversationId\n\t\t\t\t}),\n\t\t\t\tinputs\n\t\t\t};\n\t\t}\n\t}\n\trecord.held.splice(index, 1);\n\trecord.revision++;\n\tdoc.json = JSON.stringify(record);\n\treturn id;\n}\n//#endregion\nexport { admitSelected, heldContent, heldRequestId };\n\n//# sourceMappingURL=index.mjs.map","class FifoQueue {\n    incoming = [];\n    outgoing = [];\n    get length() {\n        return this.incoming.length + this.outgoing.length;\n    }\n    enqueue(value) {\n        this.incoming.push(value);\n    }\n    dequeue() {\n        if (this.outgoing.length === 0) {\n            while (this.incoming.length > 0) {\n                this.outgoing.push(this.incoming.pop());\n            }\n        }\n        return this.outgoing.pop();\n    }\n}\n// Generic event stream class for async iteration\nexport class EventStream {\n    queue = new FifoQueue();\n    waiting = new FifoQueue();\n    done = false;\n    finalResultPromise;\n    resolveFinalResult;\n    isComplete;\n    extractResult;\n    constructor(isComplete, extractResult) {\n        this.isComplete = isComplete;\n        this.extractResult = extractResult;\n        this.finalResultPromise = new Promise((resolve) => {\n            this.resolveFinalResult = resolve;\n        });\n    }\n    push(event) {\n        if (this.done)\n            return;\n        if (this.isComplete(event)) {\n            this.done = true;\n            this.resolveFinalResult(this.extractResult(event));\n        }\n        // Deliver to waiting consumer or queue it\n        const waiter = this.waiting.dequeue();\n        if (waiter) {\n            waiter({ value: event, done: false });\n        }\n        else {\n            this.queue.enqueue(event);\n        }\n    }\n    end(result) {\n        this.done = true;\n        if (result !== undefined) {\n            this.resolveFinalResult(result);\n        }\n        // Notify all waiting consumers that we're done\n        while (this.waiting.length > 0) {\n            const waiter = this.waiting.dequeue();\n            waiter({ value: undefined, done: true });\n        }\n    }\n    async *[Symbol.asyncIterator]() {\n        while (true) {\n            if (this.queue.length > 0) {\n                yield this.queue.dequeue();\n            }\n            else if (this.done) {\n                return;\n            }\n            else {\n                const result = await new Promise((resolve) => this.waiting.enqueue(resolve));\n                if (result.done)\n                    return;\n                yield result.value;\n            }\n        }\n    }\n    result() {\n        return this.finalResultPromise;\n    }\n}\n/**\n * Event stream of one assistant response. It also times the response: the final message (`done` or `error` event, or\n * the result passed to `end()`) gets `durationMs`, measured with a monotonic clock from the stream's creation, unless\n * the message already has one or its `timestamp` predates the stream. A stream that forwards a response which started\n * elsewhere, such as a deferred result fetched later, therefore leaves it untimed.\n */\nexport class AssistantMessageEventStream extends EventStream {\n    #startedAt = Date.now();\n    #startedAtMonotonic = performance.now();\n    constructor() {\n        super((event) => event.type === \"done\" || event.type === \"error\", (event) => {\n            if (event.type === \"done\") {\n                return event.message;\n            }\n            else if (event.type === \"error\") {\n                return event.error;\n            }\n            throw new Error(\"Unexpected event type for final result\");\n        });\n    }\n    push(event) {\n        if (event.type === \"done\")\n            this.#time(event.message);\n        else if (event.type === \"error\")\n            this.#time(event.error);\n        super.push(event);\n    }\n    end(result) {\n        if (result !== undefined)\n            this.#time(result);\n        super.end(result);\n    }\n    #time(message) {\n        if (this.done || message.durationMs !== undefined || message.timestamp < this.#startedAt)\n            return;\n        message.durationMs = Math.max(0, Math.round(performance.now() - this.#startedAtMonotonic));\n    }\n}\n/** Factory function for AssistantMessageEventStream (for use in extensions) */\nexport function createAssistantMessageEventStream() {\n    return new AssistantMessageEventStream();\n}\n//# sourceMappingURL=event-stream.js.map","import { AssistantMessageEventStream } from \"../utils/event-stream.js\";\nfunction createSetupErrorMessage(model, error, timestamp) {\n    return {\n        role: \"assistant\",\n        content: [],\n        api: model.api,\n        provider: model.provider,\n        model: model.id,\n        usage: {\n            input: 0,\n            output: 0,\n            cacheRead: 0,\n            cacheWrite: 0,\n            totalTokens: 0,\n            cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n        },\n        stopReason: \"error\",\n        errorMessage: error instanceof Error ? error.message : String(error),\n        timestamp,\n    };\n}\nfunction hasResult(source) {\n    return typeof source.result === \"function\";\n}\nasync function forwardStream(target, source) {\n    for await (const event of source) {\n        target.push(event);\n    }\n    target.end(hasResult(source) ? await source.result() : undefined);\n}\n/**\n * Returns a stream synchronously while running async setup (auth resolution,\n * lazy module loading) behind it. Setup failures terminate the stream with an\n * error event.\n */\nexport function lazyStream(model, setup) {\n    const startedAt = Date.now();\n    const outer = new AssistantMessageEventStream();\n    setup()\n        .then((inner) => forwardStream(outer, inner))\n        .catch((error) => {\n        const message = createSetupErrorMessage(model, error, startedAt);\n        outer.push({ type: \"error\", reason: \"error\", error: message });\n        outer.end(message);\n    });\n    return outer;\n}\nexport function lazyApi(load, capabilities) {\n    const api = {\n        stream: (model, context, options) => lazyStream(model, async () => (await load()).stream(model, context, options)),\n        streamSimple: (model, context, options) => lazyStream(model, async () => (await load()).streamSimple(model, context, options)),\n    };\n    if (capabilities?.fetchDeferred) {\n        api.fetchDeferred = (model, handle, options) => lazyStream(model, async () => {\n            const implementation = await load();\n            if (!implementation.fetchDeferred)\n                throw new Error(\"API does not support deferred responses\");\n            return implementation.fetchDeferred(model, handle, options);\n        });\n    }\n    if (capabilities?.cancelDeferred) {\n        api.cancelDeferred = async (model, handle, options) => {\n            const implementation = await load();\n            if (!implementation.cancelDeferred)\n                throw new Error(\"API cannot cancel deferred responses\");\n            await implementation.cancelDeferred(model, handle, options);\n        };\n    }\n    return api;\n}\n//# sourceMappingURL=lazy.js.map","var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {\n    if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n        return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n            return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n        });\n    }\n    return path;\n};\n// Variable specifier so browser bundlers do not try to resolve node builtins.\nconst importNodeModule = (specifier) => import(__rewriteRelativeImportExtension(specifier));\nfunction getProcessEnv() {\n    const proc = globalThis.process;\n    return proc?.env;\n}\n/**\n * Default auth context: env vars from `process.env` (undefined in browsers),\n * file existence via node:fs (always false in browsers).\n */\nexport function defaultProviderAuthContext() {\n    return {\n        async env(name) {\n            const value = getProcessEnv()?.[name];\n            return typeof value === \"string\" && value.trim().length > 0 ? value : undefined;\n        },\n        async fileExists(path) {\n            try {\n                const fs = (await importNodeModule(\"node:fs/promises\"));\n                let resolved = path;\n                if (resolved.startsWith(\"~\")) {\n                    const os = (await importNodeModule(\"node:os\"));\n                    resolved = os.homedir() + resolved.slice(1);\n                }\n                await fs.access(resolved);\n                return true;\n            }\n            catch {\n                return false;\n            }\n        },\n    };\n}\n//# sourceMappingURL=context.js.map","function abortReason(signal) {\n    if (signal.reason !== undefined)\n        return signal.reason;\n    const error = new Error(\"The operation was aborted\");\n    error.name = \"AbortError\";\n    return error;\n}\n/** Create an operation-local signal for public APIs whose signal is optional. */\nexport function operationSignal(signal) {\n    return signal ?? new AbortController().signal;\n}\n/**\n * Stop waiting for an operation when its signal aborts while continuing to\n * observe the abandoned promise so a later rejection is always handled.\n */\nexport function raceWithAbortSignal(operation, signal) {\n    if (signal.aborted) {\n        void operation.catch(() => { });\n        return Promise.reject(abortReason(signal));\n    }\n    return new Promise((resolve, reject) => {\n        let settled = false;\n        const cleanup = () => signal.removeEventListener(\"abort\", onAbort);\n        const onAbort = () => {\n            if (settled)\n                return;\n            settled = true;\n            cleanup();\n            reject(abortReason(signal));\n        };\n        signal.addEventListener(\"abort\", onAbort, { once: true });\n        void operation.then((value) => {\n            if (settled)\n                return;\n            settled = true;\n            cleanup();\n            resolve(value);\n        }, (error) => {\n            if (settled)\n                return;\n            settled = true;\n            cleanup();\n            reject(error);\n        });\n        if (signal.aborted)\n            onAbort();\n    });\n}\n//# sourceMappingURL=abort.js.map","import { operationSignal, raceWithAbortSignal } from \"../utils/abort.js\";\n/**\n * Default in-memory credential store. Apps inject persistent stores.\n * Keyed by `Provider.id`, one credential per provider; see `CredentialStore`.\n * Writes are serialized per provider through a promise chain.\n */\nexport class InMemoryCredentialStore {\n    credentials = new Map();\n    chains = new Map();\n    /** Serialize tasks per provider id without releasing the chain before active work settles. */\n    enqueue(providerId, task, options) {\n        const signal = operationSignal(options?.signal);\n        const previous = this.chains.get(providerId) ?? Promise.resolve();\n        const queued = (async () => {\n            await previous.catch(() => { });\n            signal.throwIfAborted();\n            return task();\n        })();\n        const tail = queued.catch(() => { });\n        this.chains.set(providerId, tail);\n        void tail.then(() => {\n            if (this.chains.get(providerId) === tail)\n                this.chains.delete(providerId);\n        });\n        return raceWithAbortSignal(queued, signal);\n    }\n    async read(providerId, options) {\n        options?.signal?.throwIfAborted();\n        return this.credentials.get(providerId);\n    }\n    async list(options) {\n        options?.signal?.throwIfAborted();\n        return [...this.credentials].map(([providerId, credential]) => ({ providerId, type: credential.type }));\n    }\n    modify(providerId, fn, options) {\n        return this.enqueue(providerId, async () => {\n            const current = this.credentials.get(providerId);\n            const next = await fn(current);\n            options?.signal?.throwIfAborted();\n            if (next !== undefined)\n                this.credentials.set(providerId, next);\n            return next ?? current;\n        }, options);\n    }\n    delete(providerId, options) {\n        return this.enqueue(providerId, async () => {\n            this.credentials.delete(providerId);\n        }, options);\n    }\n}\n//# sourceMappingURL=credential-store.js.map","export function formatThrownValue(value) {\n    if (value instanceof Error)\n        return value.message || value.name;\n    if (typeof value === \"string\")\n        return value;\n    return String(value);\n}\nexport function extractDiagnosticError(error) {\n    if (!(error instanceof Error))\n        return { name: \"ThrownValue\", message: formatThrownValue(error) };\n    const code = error.code;\n    return {\n        name: error.name || undefined,\n        message: error.message || error.name,\n        stack: error.stack,\n        code: typeof code === \"string\" || typeof code === \"number\" ? code : undefined,\n    };\n}\nexport function createAssistantMessageDiagnostic(type, error, details) {\n    return { type, timestamp: Date.now(), error: extractDiagnosticError(error), details };\n}\nexport function appendAssistantMessageDiagnostic(message, diagnostic) {\n    message.diagnostics = [...(message.diagnostics ?? []), diagnostic];\n}\n//# sourceMappingURL=diagnostics.js.map","import { formatThrownValue } from \"./diagnostics.js\";\nexport class ModelsError extends Error {\n    code;\n    constructor(code, message, options) {\n        super(withCauseDetail(message, options?.cause), options);\n        this.name = \"ModelsError\";\n        this.code = code;\n    }\n}\n/** Callers surface `error.message` only, so keep the underlying reason in it. */\nfunction withCauseDetail(message, cause) {\n    if (cause === undefined || cause === null)\n        return message;\n    const detail = formatThrownValue(cause).trim();\n    if (!detail || message.includes(detail))\n        return message;\n    return `${message}: ${detail}`;\n}\n//# sourceMappingURL=models-error.js.map","import { operationSignal, raceWithAbortSignal } from \"../utils/abort.js\";\nimport { ModelsError } from \"../utils/models-error.js\";\nexport { ModelsError } from \"../utils/models-error.js\";\n/**\n * Auth resolution shared by all operations in a `Models` collection.\n * A stored credential owns the provider: ambient/env is consulted only when\n * nothing is stored. No silent env fallback after a failed refresh or for a\n * credential type without a matching handler.\n */\nexport function resolveProviderAuth(provider, credentials, authContext, overrides) {\n    const signal = operationSignal(overrides?.signal);\n    return raceWithAbortSignal(resolveProviderAuthWithSignal(provider, credentials, authContext, overrides, signal), signal);\n}\nasync function resolveProviderAuthWithSignal(provider, credentials, authContext, overrides, signal) {\n    signal.throwIfAborted();\n    const requestAuthContext = overrides?.env ? overlayEnvAuthContext(authContext, overrides.env) : authContext;\n    if (overrides?.apiKey !== undefined && provider.auth.apiKey) {\n        return resolveApiKey(requestAuthContext, provider.auth.apiKey, provider.id, {\n            type: \"api_key\",\n            key: overrides.apiKey,\n            env: overrides.env,\n        }, signal);\n    }\n    const stored = await readCredential(credentials, provider.id, signal);\n    if (stored) {\n        if (stored.type === \"oauth\" && provider.auth.oauth) {\n            return resolveStoredOAuth(credentials, provider.id, provider.auth.oauth, stored, signal, overrides?.minOAuthValidityMs);\n        }\n        if (stored.type === \"api_key\" && provider.auth.apiKey) {\n            const credential = overrides?.env ? { ...stored, env: { ...stored.env, ...overrides.env } } : stored;\n            return resolveApiKey(requestAuthContext, provider.auth.apiKey, provider.id, credential, signal);\n        }\n        return undefined;\n    }\n    // Ambient (env vars, AWS profiles, ADC files).\n    return provider.auth.apiKey\n        ? resolveApiKey(requestAuthContext, provider.auth.apiKey, provider.id, undefined, signal)\n        : undefined;\n}\nfunction overlayEnvAuthContext(base, env) {\n    return {\n        env: async (name) => env[name] || (await base.env(name)),\n        fileExists: (path) => base.fileExists(path),\n    };\n}\nconst DEFAULT_OAUTH_MINIMUM_VALIDITY_MS = 5 * 60 * 1000;\nconst DEFAULT_OAUTH_REFRESH_TIMEOUT_MS = 15_000;\n/**\n * Refresh a stored OAuth credential under the credential-store lock and persist\n * the result before the lock is released. `needsRefresh` is re-checked under\n * the lock, so concurrent callers and processes refresh only once.\n *\n * `signal` cancels only the wait for the lock. Once a refresh starts, the\n * provider may already have rotated the refresh token, so the refresh and its\n * persistence ignore `signal` and are bounded only by a timeout. Otherwise a\n * cancelled caller could discard the only valid refresh token. Callers that\n * must return promptly on cancellation race this promise with their signal.\n *\n * Resolves with the stored OAuth credential after the operation, or undefined\n * when the provider no longer has an OAuth credential.\n */\nexport async function refreshStoredOAuthCredential(credentials, providerId, oauth, needsRefresh, signal) {\n    let post;\n    const lockWait = new AbortController();\n    const cancelLockWait = () => lockWait.abort(signal.reason);\n    signal.addEventListener(\"abort\", cancelLockWait, { once: true });\n    if (signal.aborted)\n        cancelLockWait();\n    try {\n        post = await credentials.modify(providerId, async (current) => {\n            signal.removeEventListener(\"abort\", cancelLockWait);\n            signal.throwIfAborted();\n            if (current?.type !== \"oauth\")\n                return undefined; // logged out meanwhile\n            if (!needsRefresh(current))\n                return undefined; // another process/request refreshed\n            try {\n                return await oauth.refresh(current, AbortSignal.timeout(DEFAULT_OAUTH_REFRESH_TIMEOUT_MS));\n            }\n            catch (error) {\n                throw new ModelsError(\"oauth\", `OAuth refresh failed for ${providerId}`, { cause: error });\n            }\n        }, { signal: lockWait.signal });\n    }\n    catch (error) {\n        if (error instanceof ModelsError)\n            throw error;\n        signal.throwIfAborted();\n        throw new ModelsError(\"auth\", `Credential store modify failed for ${providerId}`, { cause: error });\n    }\n    finally {\n        signal.removeEventListener(\"abort\", cancelLockWait);\n    }\n    return post?.type === \"oauth\" ? post : undefined;\n}\n/**\n * OAuth resolution with double-checked locking: tokens with less than five\n * minutes remaining are refreshed through `refreshStoredOAuthCredential`.\n */\nasync function resolveStoredOAuth(credentials, providerId, oauth, stored, signal, minOAuthValidityMs) {\n    const minimumValidityMs = Math.max(DEFAULT_OAUTH_MINIMUM_VALIDITY_MS, minOAuthValidityMs ?? 0);\n    const expiresSoon = (credential) => Date.now() + minimumValidityMs >= credential.expires;\n    let credential = stored;\n    if (expiresSoon(credential)) {\n        // Optimistic check said expired; the authoritative check runs under the lock.\n        const post = await refreshStoredOAuthCredential(credentials, providerId, oauth, expiresSoon, signal);\n        if (!post)\n            return undefined; // logged out meanwhile\n        credential = post;\n        // The normal five-minute window triggers a refresh but does not impose a\n        // provider contract. Explicit callers (such as bearer-token export) do\n        // require the requested minimum after the refresh.\n        if (minOAuthValidityMs !== undefined && expiresSoon(credential)) {\n            throw new ModelsError(\"oauth\", `OAuth refresh returned a token that expires too soon for ${providerId}`);\n        }\n    }\n    try {\n        return { auth: await oauth.toAuth(credential), source: \"OAuth\" };\n    }\n    catch (error) {\n        throw new ModelsError(\"oauth\", `OAuth auth derivation failed for ${providerId}`, { cause: error });\n    }\n}\nasync function resolveApiKey(authContext, apiKey, providerId, credential, signal) {\n    try {\n        return await apiKey.resolve({ ctx: authContext, credential, signal });\n    }\n    catch (error) {\n        throw new ModelsError(\"auth\", `API key auth failed for provider ${providerId}`, { cause: error });\n    }\n}\nasync function readCredential(credentials, providerId, signal) {\n    try {\n        return await credentials.read(providerId, { signal });\n    }\n    catch (error) {\n        throw new ModelsError(\"auth\", `Credential store read failed for ${providerId}`, { cause: error });\n    }\n}\n//# sourceMappingURL=resolve.js.map","export class InMemoryModelsStore {\n    entries = new Map();\n    async read(providerId, options) {\n        options?.signal?.throwIfAborted();\n        const entry = this.entries.get(providerId);\n        return entry ? structuredClone(entry) : undefined;\n    }\n    async write(providerId, entry, options) {\n        options?.signal?.throwIfAborted();\n        this.entries.set(providerId, structuredClone(entry));\n    }\n    async delete(providerId, options) {\n        options?.signal?.throwIfAborted();\n        this.entries.delete(providerId);\n    }\n}\n//# sourceMappingURL=models-store.js.map","import { ModelsError } from \"./models-error.js\";\n/** The type of a model. Models without `type` are chat models. */\nexport function getModelType(model) {\n    return model.type ?? \"chat\";\n}\n/** Runtime-checked model type narrowing, including legacy chat models without `type`. */\nexport function isModelType(model, type) {\n    return getModelType(model) === type;\n}\nexport function assertChatModel(model) {\n    if (!isModelType(model, \"chat\")) {\n        throw new ModelsError(\"provider\", `Model ${model.provider}/${model.id} is not a chat model`);\n    }\n}\nexport function assertImageModel(model) {\n    if (!isModelType(model, \"image\")) {\n        throw new ModelsError(\"provider\", `Model ${model.provider}/${model.id} is not an image model`);\n    }\n}\nexport function assertClassifierModel(model) {\n    if (!isModelType(model, \"classifier\")) {\n        throw new ModelsError(\"provider\", `Model ${model.provider}/${model.id} is not a classifier model`);\n    }\n}\n/** Rejects classifier images for models whose catalog entry does not accept image input. */\nexport function assertClassifierInputSupported(model, context) {\n    if (context.images?.length && !model.input.includes(\"image\")) {\n        throw new ModelsError(\"provider\", `Model ${model.provider}/${model.id} does not accept image input`);\n    }\n}\nexport function imageErrorResult(model, error, aborted = false) {\n    return {\n        api: model.api,\n        provider: model.provider,\n        model: model.id,\n        output: [],\n        stopReason: aborted ? \"aborted\" : \"error\",\n        errorMessage: error instanceof Error ? error.message : String(error),\n        timestamp: Date.now(),\n    };\n}\nexport function classifierErrorResult(model, error, aborted = false) {\n    return {\n        api: model.api,\n        provider: model.provider,\n        model: model.id,\n        answers: {},\n        stopReason: aborted ? \"aborted\" : \"error\",\n        errorMessage: error instanceof Error ? error.message : String(error),\n        timestamp: Date.now(),\n    };\n}\n//# sourceMappingURL=model-operations.js.map","import { lazyStream } from \"./api/lazy.js\";\nimport { defaultProviderAuthContext as defaultAuthContext } from \"./auth/context.js\";\nimport { InMemoryCredentialStore } from \"./auth/credential-store.js\";\nimport { ModelsError, refreshStoredOAuthCredential, resolveProviderAuth, } from \"./auth/resolve.js\";\nimport { InMemoryModelsStore } from \"./models-store.js\";\nimport { operationSignal, raceWithAbortSignal } from \"./utils/abort.js\";\nimport { assertChatModel, assertClassifierInputSupported, assertClassifierModel, assertImageModel, classifierErrorResult, getModelType, imageErrorResult, isModelType, } from \"./utils/model-operations.js\";\nimport { normalizeContext } from \"./utils/transcript.js\";\nexport { ModelsError } from \"./auth/resolve.js\";\nexport { getModelType, isModelType } from \"./utils/model-operations.js\";\nconst KNOWN_MODEL_TYPES = { chat: true, image: true, classifier: true };\n/** Models from stores and remote sources may have types that only newer versions know. */\nfunction hasKnownModelType(model) {\n    return Object.hasOwn(KNOWN_MODEL_TYPES, getModelType(model));\n}\n/** Drops stored models whose type this version does not know. */\nfunction withKnownModelTypes(entry) {\n    return { ...entry, models: entry.models.filter(hasKnownModelType) };\n}\nfunction mergeHeaders(base, override) {\n    if (!base && !override)\n        return undefined;\n    const merged = { ...base };\n    for (const [name, value] of Object.entries(override ?? {})) {\n        const lowerName = name.toLowerCase();\n        for (const existingName of Object.keys(merged)) {\n            if (existingName.toLowerCase() === lowerName)\n                delete merged[existingName];\n        }\n        merged[name] = value;\n    }\n    return merged;\n}\nclass ModelsImpl {\n    providers = new Map();\n    credentials;\n    modelsStore;\n    authContext;\n    refreshGenerations = new Map();\n    refreshControllers = new Map();\n    publicationChains = new Map();\n    constructor(options) {\n        this.credentials = options?.credentials ?? new InMemoryCredentialStore();\n        this.modelsStore = options?.modelsStore ?? new InMemoryModelsStore();\n        this.authContext = options?.authContext ?? defaultAuthContext();\n    }\n    setProvider(provider) {\n        this.supersedeProviderRefresh(provider.id);\n        this.providers.set(provider.id, provider);\n    }\n    deleteProvider(id) {\n        this.supersedeProviderRefresh(id);\n        this.providers.delete(id);\n    }\n    clearProviders() {\n        for (const id of new Set([...this.providers.keys(), ...this.refreshControllers.keys()])) {\n            this.supersedeProviderRefresh(id);\n        }\n        this.providers.clear();\n    }\n    getProviders() {\n        return Array.from(this.providers.values());\n    }\n    getProvider(id) {\n        return this.providers.get(id);\n    }\n    getModels(provider) {\n        if (provider !== undefined) {\n            const entry = this.providers.get(provider);\n            if (!entry)\n                return [];\n            try {\n                return entry.getModels();\n            }\n            catch {\n                return [];\n            }\n        }\n        const models = [];\n        for (const entry of this.providers.values()) {\n            try {\n                models.push(...entry.getModels());\n            }\n            catch {\n                // Best-effort: ill-behaved providers yield no models.\n            }\n        }\n        return models;\n    }\n    getAllModels(provider) {\n        if (provider !== undefined) {\n            const entry = this.providers.get(provider);\n            if (!entry)\n                return [];\n            try {\n                return entry.getAllModels?.() ?? entry.getModels();\n            }\n            catch {\n                return [];\n            }\n        }\n        const models = [];\n        for (const entry of this.providers.values()) {\n            try {\n                models.push(...(entry.getAllModels?.() ?? entry.getModels()));\n            }\n            catch {\n                // Best-effort: ill-behaved providers yield no models.\n            }\n        }\n        return models;\n    }\n    getModelsOfType(type, provider) {\n        return this.getAllModels(provider).filter((model) => isModelType(model, type));\n    }\n    getModel(provider, id) {\n        return this.getModels(provider).find((model) => model.id === id);\n    }\n    getModelOfType(type, provider, id) {\n        return this.getModelsOfType(type, provider).find((model) => model.id === id);\n    }\n    supersedeProviderRefresh(providerId) {\n        const generation = (this.refreshGenerations.get(providerId) ?? 0) + 1;\n        this.refreshGenerations.set(providerId, generation);\n        const previous = this.refreshControllers.get(providerId);\n        if (previous) {\n            this.refreshControllers.delete(providerId);\n            previous.abort();\n        }\n        return generation;\n    }\n    beginProviderRefresh(providerId) {\n        const generation = this.supersedeProviderRefresh(providerId);\n        const controller = new AbortController();\n        this.refreshControllers.set(providerId, controller);\n        return { generation, controller };\n    }\n    publishProviderModels(providerId, generation, signal, publication) {\n        const previous = this.publicationChains.get(providerId) ?? Promise.resolve();\n        const queued = (async () => {\n            await previous.catch(() => { });\n            if (signal.aborted || this.refreshGenerations.get(providerId) !== generation)\n                return false;\n            if (publication.persist === null) {\n                await this.modelsStore.delete(providerId, { signal });\n            }\n            else if (publication.persist !== undefined) {\n                await this.modelsStore.write(providerId, structuredClone(publication.persist), { signal });\n            }\n            if (signal.aborted || this.refreshGenerations.get(providerId) !== generation)\n                return false;\n            publication.update?.();\n            return true;\n        })();\n        const tail = queued.catch(() => { });\n        this.publicationChains.set(providerId, tail);\n        void tail.then(() => {\n            if (this.publicationChains.get(providerId) === tail)\n                this.publicationChains.delete(providerId);\n        });\n        return raceWithAbortSignal(queued, signal);\n    }\n    async runProviderRefreshPhase(provider, credential, allowNetwork, force, generation, signal) {\n        const stored = await this.modelsStore.read(provider.id, { signal });\n        await provider.refreshModels({\n            credential,\n            stored: stored ? withKnownModelTypes(structuredClone(stored)) : undefined,\n            publish: (publication) => this.publishProviderModels(provider.id, generation, signal, publication),\n            allowNetwork,\n            force: allowNetwork ? force : undefined,\n            signal,\n            baseUrl: provider.baseUrl,\n        });\n    }\n    async refresh(options = {}) {\n        const allowNetwork = options.allowNetwork ?? true;\n        const callerSignal = operationSignal(options.signal);\n        const errors = new Map();\n        if (callerSignal.aborted)\n            return { aborted: true, errors };\n        const selected = options.providers ? new Set(options.providers) : undefined;\n        const refreshable = Array.from(this.providers.values()).filter((provider) => provider.refreshModels !== undefined && (!selected || selected.has(provider.id)));\n        const refresh = Promise.all(refreshable.map(async (provider) => {\n            const { generation, controller } = this.beginProviderRefresh(provider.id);\n            const signal = AbortSignal.any([callerSignal, controller.signal]);\n            const operation = (async () => {\n                let storedCredential;\n                let credentialError;\n                try {\n                    storedCredential = await this.readCredential(provider.id, signal);\n                }\n                catch (error) {\n                    credentialError = error;\n                }\n                // Restore cached provider state before auth resolution or network access.\n                await this.runProviderRefreshPhase(provider, storedCredential, false, undefined, generation, signal);\n                if (credentialError !== undefined)\n                    throw credentialError;\n                if (!allowNetwork || signal.aborted)\n                    return;\n                const credential = await this.resolveRefreshCredential(provider, storedCredential, signal);\n                if (!credential)\n                    return;\n                await this.runProviderRefreshPhase(provider, credential, true, options.force, generation, signal);\n            })();\n            try {\n                await raceWithAbortSignal(operation, signal);\n            }\n            catch (error) {\n                if (!signal.aborted) {\n                    errors.set(provider.id, error instanceof Error\n                        ? error\n                        : new ModelsError(\"model_source\", `Model refresh failed for ${provider.id}`, { cause: error }));\n                }\n            }\n            finally {\n                if (this.refreshControllers.get(provider.id) === controller) {\n                    this.refreshControllers.delete(provider.id);\n                }\n            }\n        }));\n        try {\n            await raceWithAbortSignal(refresh, callerSignal);\n        }\n        catch (error) {\n            if (!callerSignal.aborted)\n                throw error;\n        }\n        return { aborted: callerSignal.aborted, errors: new Map(errors) };\n    }\n    async resolveRefreshCredential(provider, stored, signal) {\n        if (stored?.type === \"oauth\") {\n            const oauth = provider.auth.oauth;\n            if (!oauth)\n                return undefined;\n            if (Date.now() < stored.expires)\n                return stored;\n            if (signal.aborted)\n                return undefined;\n            // A refresh that has started survives cancellation or a superseding model refresh, so a\n            // rotated refresh token is always persisted. A newer refresh then sees the fresh credential.\n            return refreshStoredOAuthCredential(this.credentials, provider.id, oauth, (current) => Date.now() >= current.expires, signal);\n        }\n        const apiKey = provider.auth.apiKey;\n        if (!apiKey)\n            return undefined;\n        const credential = stored?.type === \"api_key\" ? stored : undefined;\n        const result = await apiKey.resolve({ ctx: this.authContext, credential, signal });\n        if (!result)\n            return undefined;\n        return { type: \"api_key\", key: result.auth.apiKey, env: result.env };\n    }\n    async readCredential(providerId, signal) {\n        try {\n            return await this.credentials.read(providerId, { signal });\n        }\n        catch (error) {\n            throw new ModelsError(\"auth\", `Credential store read failed for ${providerId}`, { cause: error });\n        }\n    }\n    async checkProviderAuth(provider, credential, signal) {\n        if (credential?.type === \"oauth\") {\n            return provider.auth.oauth ? { source: \"OAuth\", type: \"oauth\" } : undefined;\n        }\n        const apiKey = provider.auth.apiKey;\n        if (!apiKey)\n            return undefined;\n        if (apiKey.check) {\n            try {\n                return await apiKey.check({\n                    ctx: this.authContext,\n                    credential: credential?.type === \"api_key\" ? credential : undefined,\n                    signal,\n                });\n            }\n            catch (error) {\n                throw new ModelsError(\"auth\", `API key auth check failed for provider ${provider.id}`, { cause: error });\n            }\n        }\n        const resolution = await resolveProviderAuth(provider, this.credentials, this.authContext, { signal });\n        return resolution ? { source: resolution.source, type: \"api_key\" } : undefined;\n    }\n    checkAuth(providerId, options) {\n        const signal = operationSignal(options?.signal);\n        const check = (async () => {\n            signal.throwIfAborted();\n            const provider = this.providers.get(providerId);\n            if (!provider)\n                return undefined;\n            return this.checkProviderAuth(provider, await this.readCredential(providerId, signal), signal);\n        })();\n        return raceWithAbortSignal(check, signal);\n    }\n    async getAuthenticatedProviders(providerId, signal) {\n        signal.throwIfAborted();\n        const providers = providerId\n            ? [this.providers.get(providerId)].filter((entry) => entry !== undefined)\n            : this.getProviders();\n        const checks = await Promise.all(providers.map(async (provider) => {\n            const credential = await this.readCredential(provider.id, signal);\n            return { provider, credential, auth: await this.checkProviderAuth(provider, credential, signal) };\n        }));\n        return checks.filter((entry) => entry.auth !== undefined);\n    }\n    getAvailable(providerId, options) {\n        const signal = operationSignal(options?.signal);\n        const available = (async () => {\n            const providers = await this.getAuthenticatedProviders(providerId, signal);\n            return providers.flatMap(({ provider, credential }) => {\n                const models = provider.getModels();\n                return provider.filterModels?.(models, credential) ?? models;\n            });\n        })();\n        return raceWithAbortSignal(available, signal);\n    }\n    async getAvailableOfType(type, providerId, options) {\n        return (await this.getAllAvailable(providerId, options)).filter((model) => isModelType(model, type));\n    }\n    getAllAvailable(providerId, options) {\n        const signal = operationSignal(options?.signal);\n        const available = (async () => {\n            const providers = await this.getAuthenticatedProviders(providerId, signal);\n            return providers.flatMap(({ provider, credential }) => {\n                const models = provider.getAllModels?.() ?? provider.getModels();\n                if (provider.filterAllModels)\n                    return provider.filterAllModels(models, credential);\n                if (!provider.filterModels)\n                    return models;\n                const availableChatIds = new Set(provider.filterModels(provider.getModels(), credential).map((model) => model.id));\n                return models.filter((model) => !isModelType(model, \"chat\") || availableChatIds.has(model.id));\n            });\n        })();\n        return raceWithAbortSignal(available, signal);\n    }\n    async getAuth(providerOrModel, overrides) {\n        const signal = operationSignal(overrides?.signal);\n        const providerId = typeof providerOrModel === \"string\" ? providerOrModel : providerOrModel.provider;\n        const provider = this.providers.get(providerId);\n        if (!provider)\n            return undefined;\n        const result = await resolveProviderAuth(provider, this.credentials, this.authContext, { ...overrides, signal });\n        if (!result || typeof providerOrModel === \"string\" || !providerOrModel.headers)\n            return result;\n        return {\n            ...result,\n            auth: {\n                ...result.auth,\n                headers: mergeHeaders(result.auth.headers, providerOrModel.headers),\n            },\n        };\n    }\n    async login(providerId, type, interaction, options) {\n        const signal = operationSignal(interaction.signal);\n        signal.throwIfAborted();\n        const provider = this.providers.get(providerId);\n        if (!provider)\n            throw new ModelsError(\"provider\", `Unknown provider: ${providerId}`);\n        const method = type === \"oauth\" ? provider.auth.oauth : provider.auth.apiKey;\n        if (!method?.login) {\n            throw new ModelsError(\"auth\", `${provider.name} does not support ${type} login`);\n        }\n        const loginOperation = method.login({ ...interaction, signal }, options);\n        const credential = await raceWithAbortSignal(loginOperation, signal);\n        let mutationStarted = false;\n        let markMutationStarted;\n        const started = new Promise((resolve) => {\n            markMutationStarted = resolve;\n        });\n        const mutation = this.credentials.modify(providerId, async () => {\n            mutationStarted = true;\n            markMutationStarted?.();\n            return credential;\n        }, { signal });\n        void mutation.catch(() => { });\n        try {\n            await new Promise((resolve, reject) => {\n                const onAbort = () => {\n                    if (!mutationStarted)\n                        reject(signal.reason);\n                };\n                signal.addEventListener(\"abort\", onAbort, { once: true });\n                void Promise.race([started, mutation]).then(() => {\n                    signal.removeEventListener(\"abort\", onAbort);\n                    resolve();\n                }, (error) => {\n                    signal.removeEventListener(\"abort\", onAbort);\n                    reject(error);\n                });\n                if (signal.aborted)\n                    onAbort();\n            });\n            await mutation;\n        }\n        catch (error) {\n            signal.throwIfAborted();\n            throw new ModelsError(\"auth\", `Credential store modify failed for ${providerId}`, { cause: error });\n        }\n        return credential;\n    }\n    async logout(providerId, options) {\n        const signal = operationSignal(options?.signal);\n        signal.throwIfAborted();\n        try {\n            await this.credentials.delete(providerId, { signal });\n        }\n        catch (error) {\n            signal.throwIfAborted();\n            throw new ModelsError(\"auth\", `Credential store delete failed for ${providerId}`, { cause: error });\n        }\n    }\n    requireProvider(model) {\n        const provider = this.providers.get(model.provider);\n        if (!provider) {\n            throw new ModelsError(\"provider\", `Unknown provider: ${model.provider}`);\n        }\n        return provider;\n    }\n    requireChatProvider(model) {\n        assertChatModel(model);\n        return this.requireProvider(model);\n    }\n    async applyAuth(model, options) {\n        this.requireProvider(model);\n        const resolution = await this.getAuth(model, {\n            apiKey: options?.apiKey,\n            env: options?.env,\n            signal: options?.signal,\n        });\n        if (!resolution) {\n            throw new ModelsError(\"auth\", `Provider is not configured: ${model.provider}`);\n        }\n        const auth = resolution.auth;\n        // Explicit request options win per-field; the Models-only transform runs last.\n        const apiKey = options?.apiKey ?? auth.apiKey;\n        let headers = mergeHeaders(auth.headers, options?.headers);\n        if (options?.transformHeaders)\n            headers = await options.transformHeaders(headers ?? {});\n        const env = resolution.env || options?.env ? { ...(resolution.env ?? {}), ...(options?.env ?? {}) } : undefined;\n        const requestModel = auth.baseUrl ? { ...model, baseUrl: auth.baseUrl } : model;\n        const { transformHeaders: _transformHeaders, ...providerOptions } = options ?? {};\n        const requestOptions = { ...providerOptions, apiKey, headers, env };\n        return { requestModel, requestOptions };\n    }\n    stream(model, context, options) {\n        const transcript = normalizeContext(context);\n        return lazyStream(model, async () => {\n            const provider = this.requireChatProvider(model);\n            const { requestModel, requestOptions } = await this.applyAuth(model, options);\n            return provider.stream(requestModel, transcript, requestOptions);\n        });\n    }\n    async complete(model, context, options) {\n        return this.stream(model, context, options).result();\n    }\n    streamSimple(model, context, options) {\n        const transcript = normalizeContext(context);\n        return lazyStream(model, async () => {\n            const provider = this.requireChatProvider(model);\n            const { requestModel, requestOptions } = await this.applyAuth(model, options);\n            return provider.streamSimple(requestModel, transcript, requestOptions);\n        });\n    }\n    async completeSimple(model, context, options) {\n        return this.streamSimple(model, context, options).result();\n    }\n    streamDeferred(model, handle, options) {\n        return lazyStream(model, async () => {\n            const provider = this.requireChatProvider(model);\n            if (!provider.fetchDeferred) {\n                throw new ModelsError(\"provider\", `Provider ${model.provider} does not support deferred responses`);\n            }\n            const { requestModel, requestOptions } = await this.applyAuth(model, options);\n            return provider.fetchDeferred(requestModel, handle, requestOptions);\n        });\n    }\n    async fetchDeferred(model, handle, options) {\n        return this.streamDeferred(model, handle, options).result();\n    }\n    async cancelDeferred(model, handle, options) {\n        const provider = this.requireChatProvider(model);\n        if (!provider.cancelDeferred) {\n            throw new ModelsError(\"provider\", `Provider ${model.provider} does not support deferred responses`);\n        }\n        const { requestModel, requestOptions } = await this.applyAuth(model, options);\n        await provider.cancelDeferred(requestModel, handle, requestOptions);\n    }\n    async generateImages(model, context, options) {\n        try {\n            assertImageModel(model);\n            const provider = this.requireProvider(model);\n            if (!provider.generateImages) {\n                throw new ModelsError(\"provider\", `Provider ${model.provider} does not support image generation`);\n            }\n            const { requestModel, requestOptions } = await this.applyAuth(model, options);\n            return await provider.generateImages(requestModel, context, requestOptions);\n        }\n        catch (error) {\n            return imageErrorResult(model, error, options?.signal?.aborted);\n        }\n    }\n    async classify(model, context, options) {\n        try {\n            assertClassifierModel(model);\n            assertClassifierInputSupported(model, context);\n            const provider = this.requireProvider(model);\n            if (!provider.classify) {\n                throw new ModelsError(\"provider\", `Provider ${model.provider} does not support classification`);\n            }\n            const { requestModel, requestOptions } = await this.applyAuth(model, options);\n            return await provider.classify(requestModel, context, requestOptions);\n        }\n        catch (error) {\n            return classifierErrorResult(model, error, options?.signal?.aborted);\n        }\n    }\n}\nexport function createModels(options) {\n    return new ModelsImpl(options);\n}\n/**\n * Builds a provider from parts. Built-in provider factories and models.json\n * custom providers both go through this. A single `api` streams all chat\n * models; an `api` map dispatches on `model.api`, and a model whose api has\n * no entry produces a stream error. One-shot operation maps dispatch on\n * `model.api` the same way. At least one concrete implementation across\n * `api`/`images`/`classifiers` is required; empty maps are rejected.\n */\nexport function createProvider(input) {\n    const single = input.api && typeof input.api.stream === \"function\"\n        ? input.api\n        : undefined;\n    const byApi = single || !input.api ? undefined : input.api;\n    const images = input.images;\n    const classifiers = input.classifiers;\n    const streams = single ? [single] : Object.values(byApi ?? {}).filter((entry) => entry !== undefined);\n    const imageImplementations = Object.values(images ?? {}).filter((entry) => entry !== undefined);\n    const classifierImplementations = Object.values(classifiers ?? {}).filter((entry) => entry !== undefined);\n    if (streams.length === 0 && imageImplementations.length === 0 && classifierImplementations.length === 0) {\n        throw new Error(`Provider ${input.id}: at least one of \"api\", \"images\", or \"classifiers\" is required.`);\n    }\n    const baselineModels = input.models;\n    let dynamicModels = [];\n    const fetchModels = input.fetchModels;\n    const currentModels = () => {\n        const merged = [...baselineModels];\n        for (const model of dynamicModels) {\n            const index = merged.findIndex((entry) => getModelType(entry) === getModelType(model) && entry.id === model.id);\n            if (index >= 0)\n                merged[index] = model;\n            else\n                merged.push(model);\n        }\n        return merged;\n    };\n    const apiFor = (model) => single ?? byApi?.[model.api];\n    const dispatch = (model, run) => {\n        const streams = apiFor(model);\n        if (!streams) {\n            return lazyStream(model, async () => {\n                throw new ModelsError(\"stream\", `Provider ${input.id} has no API implementation for \"${model.api}\"`);\n            });\n        }\n        return run(streams);\n    };\n    const provider = {\n        id: input.id,\n        name: input.name ?? input.id,\n        baseUrl: input.baseUrl,\n        headers: input.headers,\n        auth: input.auth,\n        getModels: () => currentModels().filter((model) => isModelType(model, \"chat\")),\n        getAllModels: currentModels,\n        refreshModels: fetchModels\n            ? async (context) => {\n                if (context.stored) {\n                    const restored = context.stored.models\n                        .filter((model) => model.provider === input.id)\n                        .map((model) => model);\n                    if (!(await context.publish({\n                        update: () => {\n                            dynamicModels = restored;\n                        },\n                    }))) {\n                        return;\n                    }\n                }\n                if (!context.allowNetwork || context.signal.aborted)\n                    return;\n                const fetched = await fetchModels(context);\n                if (context.signal.aborted)\n                    return;\n                const refreshed = fetched.filter(hasKnownModelType);\n                await context.publish({\n                    persist: { models: refreshed, checkedAt: Date.now() },\n                    update: () => {\n                        dynamicModels = refreshed;\n                    },\n                });\n            }\n            : undefined,\n        filterModels: input.filterModels,\n        filterAllModels: input.filterAllModels,\n        stream: (model, context, options) => dispatch(model, (streams) => streams.stream(model, context, options)),\n        streamSimple: (model, context, options) => dispatch(model, (streams) => streams.streamSimple(model, context, options)),\n    };\n    if (streams.some((entry) => entry.fetchDeferred !== undefined)) {\n        provider.fetchDeferred = (model, handle, options) => lazyStream(model, async () => {\n            const implementation = apiFor(model);\n            if (!implementation?.fetchDeferred) {\n                throw new ModelsError(\"provider\", `Provider ${input.id} does not support deferred responses for \"${model.api}\"`);\n            }\n            return implementation.fetchDeferred(model, handle, options);\n        });\n    }\n    if (streams.some((entry) => entry.cancelDeferred !== undefined)) {\n        provider.cancelDeferred = async (model, handle, options) => {\n            const implementation = apiFor(model);\n            if (!implementation?.cancelDeferred) {\n                throw new ModelsError(\"provider\", `Provider ${input.id} cannot cancel deferred responses for \"${model.api}\"`);\n            }\n            await implementation.cancelDeferred(model, handle, options);\n        };\n    }\n    if (images && imageImplementations.length > 0) {\n        provider.generateImages = async (model, context, options) => {\n            const implementation = images[model.api];\n            if (!implementation) {\n                return imageErrorResult(model, new ModelsError(\"provider\", `Provider ${input.id} has no image generation implementation for \"${model.api}\"`));\n            }\n            return implementation.generateImages(model, context, options);\n        };\n    }\n    if (classifiers && classifierImplementations.length > 0) {\n        provider.classify = async (model, context, options) => {\n            const implementation = classifiers[model.api];\n            if (!implementation) {\n                return classifierErrorResult(model, new ModelsError(\"provider\", `Provider ${input.id} has no classifier implementation for \"${model.api}\"`));\n            }\n            return implementation.classify(model, context, options);\n        };\n    }\n    return provider;\n}\n/**\n * Runtime-checked narrowing for dynamically looked-up models:\n *\n * ```ts\n * const model = models.getModel(\"anthropic\", \"claude-opus-4-7\");\n * if (model && hasApi(model, \"anthropic-messages\")) {\n *   // model: Model<\"anthropic-messages\">, stream options fully typed\n * }\n * ```\n *\n * Non-chat models never match, even when their api id equals `api`.\n */\nexport function hasApi(model, api) {\n    return isModelType(model, \"chat\") && model.api === api;\n}\nexport function calculateCost(model, usage) {\n    const inputTokens = usage.input + usage.cacheRead + usage.cacheWrite;\n    let rates = model.cost;\n    let matchedThreshold = -1;\n    for (const tier of model.cost.tiers ?? []) {\n        if (inputTokens > tier.inputTokensAbove && tier.inputTokensAbove > matchedThreshold) {\n            rates = tier;\n            matchedThreshold = tier.inputTokensAbove;\n        }\n    }\n    // Anthropic charges 2x base input for 1h cache writes.\n    const longWrite = usage.cacheWrite1h ?? 0;\n    const shortWrite = usage.cacheWrite - longWrite;\n    usage.cost.input = (rates.input / 1000000) * usage.input;\n    usage.cost.output = (rates.output / 1000000) * usage.output;\n    usage.cost.cacheRead = (rates.cacheRead / 1000000) * usage.cacheRead;\n    usage.cost.cacheWrite = (rates.cacheWrite * shortWrite + rates.input * 2 * longWrite) / 1000000;\n    usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite;\n    return usage.cost;\n}\nconst EXTENDED_THINKING_LEVELS = [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"];\nexport function getSupportedThinkingLevels(model) {\n    if (!model.reasoning)\n        return [\"off\"];\n    return EXTENDED_THINKING_LEVELS.filter((level) => {\n        const mapped = model.thinkingLevelMap?.[level];\n        if (mapped === null)\n            return false;\n        if (level === \"xhigh\" || level === \"max\")\n            return mapped !== undefined;\n        return true;\n    });\n}\nexport function clampThinkingLevel(model, level) {\n    const availableLevels = getSupportedThinkingLevels(model);\n    if (availableLevels.includes(level))\n        return level;\n    const requestedIndex = EXTENDED_THINKING_LEVELS.indexOf(level);\n    if (requestedIndex === -1)\n        return availableLevels[0] ?? \"off\";\n    for (let i = requestedIndex; i < EXTENDED_THINKING_LEVELS.length; i++) {\n        const candidate = EXTENDED_THINKING_LEVELS[i];\n        if (availableLevels.includes(candidate))\n            return candidate;\n    }\n    for (let i = requestedIndex - 1; i >= 0; i--) {\n        const candidate = EXTENDED_THINKING_LEVELS[i];\n        if (availableLevels.includes(candidate))\n            return candidate;\n    }\n    return availableLevels[0] ?? \"off\";\n}\n/**\n * Check if two models are equal by comparing their type, id, and provider.\n * Returns false if either model is null or undefined.\n */\nexport function modelsAreEqual(a, b) {\n    if (!a || !b)\n        return false;\n    return getModelType(a) === getModelType(b) && a.id === b.id && a.provider === b.provider;\n}\n//# sourceMappingURL=models.js.map","import { PoHeadlessToolBusyError } from \"../schemas/headless.mjs\";\nimport { AgentLockDoc, FastModeDoc, IdentityHistoryDoc, LabelsDoc, SessionIdentityDoc, SessionMetadataDoc } from \"../services/durableSession/docs.mjs\";\nimport \"../schemas/profileIdentity.mjs\";\nimport { projectDurableEntries } from \"../services/transcriptPages/index.mjs\";\nimport { SESSION_GROUPS_CHANGED_FRAME } from \"../schemas/sessionProtocol.mjs\";\nimport { formatSkillsForSystemPrompt } from \"../services/skillPrompt/index.mjs\";\nimport { AGENT_SETTLED_ENTRY_TYPE } from \"../constants/agentSettled.mjs\";\nimport { contextTokensOf, contextUsageOf } from \"../services/contextUsage/index.mjs\";\nimport { initializeDurableNavigation, navigateDurableConversation } from \"../services/durableNavigation/index.mjs\";\nimport { HeldQueueDoc } from \"../services/durableQueue/docs.mjs\";\nimport { admitSelected, heldContent, heldRequestId } from \"../services/durableQueue/index.mjs\";\nimport { SubagentsExtension } from \"../services/durableSubagents/extension.mjs\";\nimport { subagentConversations } from \"../services/durableSubagents/index.mjs\";\nimport { convertToLlm } from \"../services/piMessages/index.mjs\";\nimport { createToolContinuation, isBashSequenceEnvelope } from \"../services/toolContinuation/index.mjs\";\nimport { randomUUID } from \"node:crypto\";\nimport { BACKGROUND_CONTEXT, awaitWithContext, withAbortSignal } from \"@earendil-works/chord/context\";\nimport { AgentDoc, CompactionTask, DEFAULT_COMPACTION_POLICY, GenerationTask, Harness, InboxDoc, LiveDoc, ProviderDoc, ToolTask, UsageDoc, createRegistry, hook, watchEvents } from \"@earendil-works/pi-durable\";\nimport { createAssistantMessageEventStream, createModels, getSupportedThinkingLevels } from \"@earendil-works/pi-ai\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport { getCurrentSystemPrompt, getCurrentTools } from \"@earendil-works/pi-ai/utils/transcript\";\n//#region src/server/directHarnessRuntime.ts\nconst AGENT_LOCKED_ERROR = \"The local agent is locked. Unlock it to start a turn.\";\nconst CODEX_API = \"openai-codex-responses\";\nconst CODEX_PROVIDER = \"openai-codex\";\nfunction nativeId(id) {\n\tconst value = Number(id);\n\tif (!Number.isSafeInteger(value) || value < 0 || String(value) !== id) throw new Error(`Invalid durable identifier: ${id}`);\n\treturn value;\n}\nfunction json(value) {\n\treturn JSON.parse(JSON.stringify(value));\n}\nfunction text(message) {\n\tif (typeof message === \"string\") return message;\n\tif (!(\"content\" in message)) return \"summary\" in message ? message.summary : \"output\" in message ? message.output : \"\";\n\treturn typeof message.content === \"string\" ? message.content : message.content.map((p) => p.type === \"text\" ? p.text : \"\").join(\"\");\n}\nfunction fromContent(content) {\n\tconst images = (typeof content === \"string\" ? [{\n\t\ttype: \"text\",\n\t\ttext: content\n\t}] : content).filter((part) => part.type === \"image\");\n\treturn {\n\t\ttext: text({\n\t\t\trole: \"user\",\n\t\t\tcontent,\n\t\t\ttimestamp: 0\n\t\t}),\n\t\t...images.length ? { images } : {}\n\t};\n}\n/** Compatibility projection keeps protocol identities strings and retains fork ancestry. */\nasync function projectDurableConversationEntries(conversation, context, minEntryId) {\n\tconst pages = [];\n\tlet cursor;\n\tdo {\n\t\tconst page = await conversation.entries(minEntryId === void 0 ? {} : { minEntryId }, 256, cursor, context);\n\t\tconst newer = pages.at(-1);\n\t\tif (newer && page.items.length) for (const entry of newer) {\n\t\t\tif (entry.seq !== newer[0].seq) break;\n\t\t\tentry.parentId = String(page.items[0].id);\n\t\t}\n\t\tpages.push(projectDurableEntries(page.items.toReversed()));\n\t\tcursor = page.next;\n\t} while (cursor);\n\treturn pages.reverse().flat();\n}\n/**\n* Runs one prompt and returns the newest assistant text it produced. `hold` keeps the run open\n* across later turns started by intercom delivery: while it resolves true, wait for the lane to\n* go idle and ask again. The returned text is the newest one across all of those turns. With a\n* `requestId` the prompt is admitted once: a later call, such as one after a restart, waits for it.\n*/\nasync function promptForAssistantText(runtime, prompt, hold, requestId) {\n\tconst lane = runtime.lane;\n\tconst receipt = requestId === void 0 ? void 0 : await runtime.harness.commit((tx) => tx.submissionByRequest(lane.id, requestId), BACKGROUND_CONTEXT);\n\tconst before = (await runtime.readEntries()).entries;\n\tconst previous = new Set((receipt?.entry === void 0 ? before : before.filter((e) => Number(e.id) <= receipt.entry)).map((e) => e.id));\n\tif (receipt) {\n\t\tconst settled = await (await runtime.harness.submission(receipt.id, BACKGROUND_CONTEXT))?.wait(BACKGROUND_CONTEXT);\n\t\tif (settled?.status === \"unanswered\" && settled.reason === \"aborted\") throw Object.assign(/* @__PURE__ */ new Error(\"The prompt was stopped before it was answered\"), { name: \"AbortError\" });\n\t} else await (await runtime.submitInternalMessage(prompt, void 0, requestId)).settled;\n\twhile (hold && await hold()) await lane.waitForIdle(BACKGROUND_CONTEXT);\n\treturn (await runtime.readEntries()).entries.toReversed().filter((e) => !previous.has(e.id)).flatMap((e) => e.type === \"message\" && e.message.role === \"assistant\" ? [text(e.message).trim()] : [])[0] || void 0;\n}\nfunction createDirectHarnessRuntime(options) {\n\treturn createLaneRuntime(options, void 0);\n}\n/** The extension holding one lane's tools, prompt and hooks. */\nfunction laneExtensionName(conversationId) {\n\treturn `po.lane-${conversationId}`;\n}\n/** The main lane opens its Harness; a further lane runs on the main lane's Harness as one more conversation. */\nasync function createLaneRuntime(options, attached) {\n\tif (options.initialFastMode !== void 0 && typeof options.initialFastMode !== \"boolean\") throw new Error(\"Initial Fast mode must be a boolean.\");\n\tif (options.initialAgentLocked !== void 0 && typeof options.initialAgentLocked !== \"boolean\") throw new Error(\"Initial agent lock must be a boolean.\");\n\tconst context = options.context ?? BACKGROUND_CONTEXT;\n\tif (options.session && !options.durableStorage) throw new Error(\"A durable Session injection requires its raw durableStorage\");\n\tconst platform = options.platform;\n\tconst storage = attached?.storage ?? (options.durableStorage ? {\n\t\tstorage: options.durableStorage,\n\t\tassertWritable() {},\n\t\trelease: async () => {}\n\t} : await platform.sessions.open({\n\t\tsessionId: options.sessionId,\n\t\tparentSessionId: options.parentSessionId,\n\t\texisting: options.resume\n\t}, context));\n\tlet startupHarness;\n\ttry {\n\t\tconst registry = attached?.registry ?? createRegistry();\n\t\tconst environment = attached ? void 0 : platform.env(options.cwd);\n\t\tconst laneProviderSessions = attached?.laneProviderSessions ?? /* @__PURE__ */ new Set();\n\t\tconst manualCompaction = attached?.manualCompaction ?? {};\n\t\tconst extensionName = attached ? laneExtensionName(attached.conversation.id) : \"po.host\";\n\t\tlet disposed = false;\n\t\tlet quarantined = false;\n\t\tlet failure;\n\t\tlet preparationFailure;\n\t\tconst terminatingCalls = /* @__PURE__ */ new Set();\n\t\tlet fastMode = false;\n\t\tlet agentLocked = false;\n\t\tconst assertUnlocked = () => {\n\t\t\tif (agentLocked) throw new Error(AGENT_LOCKED_ERROR);\n\t\t};\n\t\tlet resources = options.resources ?? {};\n\t\tlet tools = options.tools ?? [];\n\t\tlet activeNames = new Set(options.activeToolNames ?? tools.map((t) => t.name));\n\t\tlet settings = {\n\t\t\textensions: [{ name: \"po.host\" }],\n\t\t\tdocumentRetentionMs: 6e4,\n\t\t\tstream: options.streamOptions,\n\t\t\tretry: options.retry,\n\t\t\tcompaction: options.compaction,\n\t\t\ttoolExecution: options.toolExecution,\n\t\t\tsteeringMode: options.steeringMode,\n\t\t\tfollowUpMode: options.followUpMode\n\t\t};\n\t\tconst listeners = /* @__PURE__ */ new Set();\n\t\tconst eventListeners = /* @__PURE__ */ new Set();\n\t\tconst checkpointBoundaries = /* @__PURE__ */ new Set();\n\t\tconst toolBoundaryQueue = [];\n\t\tlet toolBoundaryDrain;\n\t\tconst flushToolBoundary = () => {\n\t\t\tif (toolBoundaryDrain) return toolBoundaryDrain;\n\t\t\ttoolBoundaryDrain = (async () => {\n\t\t\t\twhile (toolBoundaryQueue.length && !disposed && !disposePromise) await toolBoundaryQueue.shift().run();\n\t\t\t})().finally(() => {\n\t\t\t\ttoolBoundaryDrain = void 0;\n\t\t\t});\n\t\t\treturn toolBoundaryDrain;\n\t\t};\n\t\tconst emit = (frame) => {\n\t\t\tfor (const listener of listeners) try {\n\t\t\t\tlistener(frame);\n\t\t\t} catch (error) {\n\t\t\t\tfor (const other of listeners) if (other !== listener) other({\n\t\t\t\t\ttype: \"handler_error\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\tconst writable = async (work) => {\n\t\t\tif (disposed || quarantined) throw new Error(\"Direct harness writes are unavailable\", { cause: failure });\n\t\t\ttry {\n\t\t\t\tawait storage.assertWritable();\n\t\t\t\treturn await work();\n\t\t\t} catch (error) {\n\t\t\t\tconst code = typeof error === \"object\" && error !== null && \"code\" in error ? error.code : void 0;\n\t\t\t\tif (typeof code === \"string\" && [\n\t\t\t\t\t\"EACCES\",\n\t\t\t\t\t\"EBUSY\",\n\t\t\t\t\t\"EIO\",\n\t\t\t\t\t\"EMFILE\",\n\t\t\t\t\t\"ENFILE\",\n\t\t\t\t\t\"ENOSPC\",\n\t\t\t\t\t\"EPERM\",\n\t\t\t\t\t\"EROFS\"\n\t\t\t\t].includes(code)) {\n\t\t\t\t\tquarantined = true;\n\t\t\t\t\tfailure = error;\n\t\t\t\t\temit({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\tcode: \"storage_quarantined\",\n\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\t\tlet sourceModels;\n\t\tif (options.models) sourceModels = options.models;\n\t\telse {\n\t\t\tif (!options.providers?.length) throw new Error(\"Direct harness requires Models or a Provider\");\n\t\t\tsourceModels = createModels(options.credentials ? { credentials: options.credentials } : void 0);\n\t\t}\n\t\tfor (const provider of options.providers ?? []) {\n\t\t\tconst mutable = sourceModels;\n\t\t\tconst register = mutable.setProvider?.bind(sourceModels) ?? mutable.registerNativeProvider?.bind(sourceModels);\n\t\t\tif (!register) throw new Error(\"Models registry cannot register providers\");\n\t\t\tregister(provider);\n\t\t}\n\t\tconst models = new Proxy(sourceModels, { get(target, key) {\n\t\t\tconst value = Reflect.get(target, key, target);\n\t\t\tif (typeof value !== \"function\") return value;\n\t\t\tif (![\n\t\t\t\t\"stream\",\n\t\t\t\t\"complete\",\n\t\t\t\t\"streamSimple\",\n\t\t\t\t\"completeSimple\",\n\t\t\t\t\"streamDeferred\",\n\t\t\t\t\"fetchDeferred\"\n\t\t\t].includes(String(key))) return value.bind(target);\n\t\t\treturn (...args) => {\n\t\t\t\tconst requestOptions = args[2];\n\t\t\t\tconst lane = typeof requestOptions?.sessionId === \"string\" && laneProviderSessions.has(requestOptions.sessionId);\n\t\t\t\tif (disposed || quarantined || !lane && preparationFailure) throw new Error(\"Model dispatch unavailable\", { cause: preparationFailure });\n\t\t\t\tif (!lane) options.guardModelRequest?.();\n\t\t\t\tconst request = args[1];\n\t\t\t\tif (!lane && ![\"complete\", \"completeSimple\"].includes(String(key)) && request?.tools?.some((t) => !activeNames.has(t.name))) throw new Error(\"Model request contains disabled tools\");\n\t\t\t\tconst usePriority = fastMode && args[0].api === CODEX_API && args[0].provider === CODEX_PROVIDER;\n\t\t\t\tconst originalOnPayload = requestOptions?.onPayload;\n\t\t\t\targs[2] = {\n\t\t\t\t\t...requestOptions,\n\t\t\t\t\tsessionId: lane ? requestOptions.sessionId : key === \"complete\" ? requestOptions?.sessionId ?? sessionId : sessionId,\n\t\t\t\t\t...usePriority ? { serviceTier: \"priority\" } : {},\n\t\t\t\t\tonPayload: async (payload, model) => {\n\t\t\t\t\t\tif (!lane) options.guardModelRequest?.();\n\t\t\t\t\t\tconst original = typeof originalOnPayload === \"function\" ? await originalOnPayload(payload, model) : void 0;\n\t\t\t\t\t\tconst transformed = original === void 0 ? payload : original;\n\t\t\t\t\t\tconst patch = lane ? void 0 : await options.beforePayload?.({\n\t\t\t\t\t\t\tpayload: transformed,\n\t\t\t\t\t\t\tmodel\n\t\t\t\t\t\t}, context);\n\t\t\t\t\t\tconst finalPayload = patch === void 0 ? transformed : patch.payload;\n\t\t\t\t\t\tif (!usePriority) return finalPayload;\n\t\t\t\t\t\tif (typeof finalPayload !== \"object\" || finalPayload === null || Array.isArray(finalPayload)) throw new Error(\"Invalid Codex request payload\");\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...finalPayload,\n\t\t\t\t\t\t\tservice_tier: \"priority\"\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst dispatched = Reflect.apply(value, target, args);\n\t\t\t\tif (![\n\t\t\t\t\t\"stream\",\n\t\t\t\t\t\"streamSimple\",\n\t\t\t\t\t\"fetchDeferred\"\n\t\t\t\t].includes(String(key))) return dispatched;\n\t\t\t\tconst source = dispatched;\n\t\t\t\tconst output = createAssistantMessageEventStream();\n\t\t\t\tconst requestedModel = args[0];\n\t\t\t\tconst signal = args[2].signal;\n\t\t\t\tlet ended = false;\n\t\t\t\tlet current = {\n\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\tcontent: [],\n\t\t\t\t\tapi: requestedModel.api,\n\t\t\t\t\tprovider: requestedModel.provider,\n\t\t\t\t\tmodel: requestedModel.id,\n\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t\tstopReason: \"pending\",\n\t\t\t\t\tusage: {\n\t\t\t\t\t\tinput: 0,\n\t\t\t\t\t\toutput: 0,\n\t\t\t\t\t\tcacheRead: 0,\n\t\t\t\t\t\tcacheWrite: 0,\n\t\t\t\t\t\ttotalTokens: 0,\n\t\t\t\t\t\tcost: {\n\t\t\t\t\t\t\tinput: 0,\n\t\t\t\t\t\t\toutput: 0,\n\t\t\t\t\t\t\tcacheRead: 0,\n\t\t\t\t\t\t\tcacheWrite: 0,\n\t\t\t\t\t\t\ttotal: 0\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst cancel = () => {\n\t\t\t\t\tif (ended) return;\n\t\t\t\t\tended = true;\n\t\t\t\t\tconst cancelled = {\n\t\t\t\t\t\t...current,\n\t\t\t\t\t\tstopReason: \"aborted\",\n\t\t\t\t\t\terrorMessage: \"Agent request aborted\"\n\t\t\t\t\t};\n\t\t\t\t\toutput.push({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\treason: \"aborted\",\n\t\t\t\t\t\terror: cancelled\n\t\t\t\t\t});\n\t\t\t\t\toutput.end();\n\t\t\t\t};\n\t\t\t\tsignal?.addEventListener(\"abort\", cancel, { once: true });\n\t\t\t\tif (signal?.aborted) cancel();\n\t\t\t\t(async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor await (const event of source) {\n\t\t\t\t\t\t\tif (ended) break;\n\t\t\t\t\t\t\tif (\"partial\" in event) current = event.partial;\n\t\t\t\t\t\t\toutput.push(event);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!ended) {\n\t\t\t\t\t\t\tended = true;\n\t\t\t\t\t\t\toutput.end(await source.result());\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (!ended) {\n\t\t\t\t\t\t\tended = true;\n\t\t\t\t\t\t\tconst failed = {\n\t\t\t\t\t\t\t\t...current,\n\t\t\t\t\t\t\t\tstopReason: \"error\",\n\t\t\t\t\t\t\t\terrorMessage: String(error)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\toutput.push({\n\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\treason: \"error\",\n\t\t\t\t\t\t\t\terror: failed\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\toutput.end();\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", cancel);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\treturn output;\n\t\t\t};\n\t\t} });\n\t\tconst resolveToolContext = async (ctx) => typeof options.toolContext === \"function\" ? options.toolContext(ctx) : options.toolContext;\n\t\tconst nativeTool = (tool) => ({\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description,\n\t\t\tparameters: tool.parameters,\n\t\t\tconstrainedSampling: tool.constrainedSampling,\n\t\t\tprepareArguments: tool.prepareArguments ? (args) => tool.prepareArguments(args) : void 0,\n\t\t\treplay: tool.replay ?? \"unsafe\",\n\t\t\texecutionMode: tool.executionMode,\n\t\t\tasync execute(args, api, ctx) {\n\t\t\t\tif (!activeNames.has(tool.name)) throw new Error(`Tool '${tool.name}' is no longer active`);\n\t\t\t\tlet reported = \"\";\n\t\t\t\tconst pending = tool.execute(api.callId, args, (partial) => {\n\t\t\t\t\tconst snapshot = partial.content.map((part) => part.type === \"text\" ? part.text : \"\").join(\"\");\n\t\t\t\t\tconst chunk = snapshot.startsWith(reported) ? snapshot.slice(reported.length) : `\\n${snapshot}`;\n\t\t\t\t\treported = snapshot;\n\t\t\t\t\tif (chunk) api.output(chunk);\n\t\t\t\t\tif (partial.details !== void 0) api.details(json(partial.details), ctx).catch((error) => emit({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t}));\n\t\t\t\t}, await resolveToolContext(ctx), {\n\t\t\t\t\t...options.beforeTool && options.afterTool ? { toolContinuation: createToolContinuation({\n\t\t\t\t\t\ttoolName: tool.name,\n\t\t\t\t\t\tparameters: tool.parameters,\n\t\t\t\t\t\tbeforeTool: options.beforeTool,\n\t\t\t\t\t\tafterTool: options.afterTool,\n\t\t\t\t\t\tassertAvailable() {\n\t\t\t\t\t\t\tassertUnlocked();\n\t\t\t\t\t\t\tif (disposed || disposePromise || quarantined || !activeNames.has(tool.name) || !tools.includes(tool)) throw new Error(`Tool '${tool.name}' is no longer active`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}) } : {},\n\t\t\t\t\tinvocationId: String(api.taskId),\n\t\t\t\t\toperationId: String(api.taskId),\n\t\t\t\t\tturnId: String(api.taskId),\n\t\t\t\t\tgetMemo: (name) => api.memo(name, ctx),\n\t\t\t\t\tsetMemo: async (name, value) => {\n\t\t\t\t\t\tif (value === void 0) throw new Error(\"Durable invocation memos cannot be deleted\");\n\t\t\t\t\t\tawait api.memo(name, value, ctx);\n\t\t\t\t\t}\n\t\t\t\t}, ctx);\n\t\t\t\tconst result = await awaitWithContext(pending, ctx);\n\t\t\t\treturn {\n\t\t\t\t\toutput: result.content,\n\t\t\t\t\tisError: result.isError,\n\t\t\t\t\t...result.details === void 0 ? {} : { details: json(result.details) }\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t\tconst install = () => registry.install({\n\t\t\tname: extensionName,\n\t\t\ttools: tools.map(nativeTool),\n\t\t\tsections: [{\n\t\t\t\tkey: \"po\",\n\t\t\t\ttag: false,\n\t\t\t\tasync render(_input, ctx) {\n\t\t\t\t\tpreparationFailure = void 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn [typeof options.systemPrompt === \"function\" ? await options.systemPrompt(await resolveToolContext(ctx), ctx) : options.systemPrompt ?? \"\", options.systemPrompt === void 0 ? formatSkillsForSystemPrompt(resources.skills ?? []) : \"\"].filter(Boolean).join(\"\\n\\n\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tpreparationFailure = error;\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}],\n\t\t\thooks: [\n\t\t\t\thook(GenerationTask, {\n\t\t\t\t\tasync afterTools(_assistant, _results, api, ctx) {\n\t\t\t\t\t\tconst lane = conversation;\n\t\t\t\t\t\tif (lane.id !== api.conversationId) return;\n\t\t\t\t\t\tawait flushToolBoundary();\n\t\t\t\t\t\tfor (const registration of checkpointBoundaries) {\n\t\t\t\t\t\t\tif (!registration.active || disposed || ctx.abortSignal?.aborted || external) continue;\n\t\t\t\t\t\t\tlet open = true;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait registration.callback({\n\t\t\t\t\t\t\t\t\tsignal: ctx.abortSignal,\n\t\t\t\t\t\t\t\t\tappendMessage: (message) => commitCheckpointMessage(registration, lane, message, ctx, () => open, api.taskId)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\topen = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tasync beforeRequest(request, _api, ctx) {\n\t\t\t\t\t\tassertUnlocked();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst agent = await conversation.agent(ctx);\n\t\t\t\t\t\t\tconst model = agent.model ? models.getModel(agent.model.provider, agent.model.modelId) : void 0;\n\t\t\t\t\t\t\tawait options.beforeModelRequest?.({\n\t\t\t\t\t\t\t\tphase: \"turn\",\n\t\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\t\tprompt: [...request.messages],\n\t\t\t\t\t\t\t\tresources\n\t\t\t\t\t\t\t}, ctx);\n\t\t\t\t\t\t\tconst systemPrompt = getCurrentSystemPrompt(request.messages);\n\t\t\t\t\t\t\tconst contextMessages = options.transformContext ? restoreCustomContextMessages(request.messages, await conversation.context(ctx)) : request.messages.filter((message) => message.role !== \"system\");\n\t\t\t\t\t\t\tconst originalContext = structuredClone(contextMessages);\n\t\t\t\t\t\t\tconst patch = await options.transformContext?.({\n\t\t\t\t\t\t\t\tmessages: contextMessages,\n\t\t\t\t\t\t\t\tsystemPrompt\n\t\t\t\t\t\t\t}, ctx);\n\t\t\t\t\t\t\tlet messages = patch && (patch.systemPrompt !== void 0 && patch.systemPrompt !== systemPrompt || patch.messages !== void 0 && !isDeepStrictEqual(patch.messages, originalContext)) ? [{\n\t\t\t\t\t\t\t\trole: \"system\",\n\t\t\t\t\t\t\t\tcontent: patch.systemPrompt ?? systemPrompt,\n\t\t\t\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t\t\t\t\ttoolsAdded: getCurrentTools(request.messages)\n\t\t\t\t\t\t\t}, ...convertToLlm(patch.messages ?? request.messages.filter((m) => m.role !== \"system\"))] : [...request.messages];\n\t\t\t\t\t\t\tif (options.toProviderMessages) messages = await options.toProviderMessages(messages, ctx);\n\t\t\t\t\t\t\tawait options.beforeModelRequest?.({\n\t\t\t\t\t\t\t\tphase: \"request\",\n\t\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\t\tresources\n\t\t\t\t\t\t\t}, ctx);\n\t\t\t\t\t\t\treturn { messages };\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tpreparationFailure = error;\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\thook(ToolTask, {\n\t\t\t\t\tasync beforeTool(call, _api, ctx) {\n\t\t\t\t\t\tif (isBashSequenceEnvelope(call.name, call.arguments)) {\n\t\t\t\t\t\t\tif (!options.beforeTool || !options.afterTool) throw new Error(\"Bash sequences require retained host policy support.\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst patch = await options.beforeTool?.({\n\t\t\t\t\t\t\ttoolCallId: call.id,\n\t\t\t\t\t\t\ttoolName: call.name,\n\t\t\t\t\t\t\targs: call.arguments\n\t\t\t\t\t\t}, ctx);\n\t\t\t\t\t\tif (patch?.block?.terminate) terminatingCalls.add(call.id);\n\t\t\t\t\t\treturn patch ? {\n\t\t\t\t\t\t\targuments: patch.args,\n\t\t\t\t\t\t\tblock: patch.block?.reason\n\t\t\t\t\t\t} : void 0;\n\t\t\t\t\t},\n\t\t\t\t\tasync afterTool(call, result, _api, ctx) {\n\t\t\t\t\t\tif (isBashSequenceEnvelope(call.name, call.arguments)) return void 0;\n\t\t\t\t\t\tconst patch = await options.afterTool?.({\n\t\t\t\t\t\t\ttoolCallId: call.id,\n\t\t\t\t\t\t\ttoolName: call.name,\n\t\t\t\t\t\t\targs: call.arguments,\n\t\t\t\t\t\t\tcontent: result.output ?? [],\n\t\t\t\t\t\t\tdetails: result.details,\n\t\t\t\t\t\t\tisError: result.isError ?? false,\n\t\t\t\t\t\t\tusage: result.usage\n\t\t\t\t\t\t}, ctx);\n\t\t\t\t\t\tconst { content: patchedOutput, terminate: _terminate, ...patchFields } = patch ?? {};\n\t\t\t\t\t\treturn patch ? {\n\t\t\t\t\t\t\t...result,\n\t\t\t\t\t\t\t...patchFields,\n\t\t\t\t\t\t\t...patchedOutput === void 0 ? {} : { output: patchedOutput },\n\t\t\t\t\t\t\tcontrol: patch.terminate || terminatingCalls.delete(call.id) ? {\n\t\t\t\t\t\t\t\t...result.control,\n\t\t\t\t\t\t\t\tterminate: true\n\t\t\t\t\t\t\t} : result.control\n\t\t\t\t\t\t} : terminatingCalls.delete(call.id) ? {\n\t\t\t\t\t\t\t...result,\n\t\t\t\t\t\t\tcontrol: {\n\t\t\t\t\t\t\t\t...result.control,\n\t\t\t\t\t\t\t\tterminate: true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} : void 0;\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\thook(CompactionTask, { async beforeCompact(input, api, ctx) {\n\t\t\t\t\tconst swapped = manualCompaction.conversationId;\n\t\t\t\t\tif (input.reason === \"threshold\" && swapped !== void 0 && swapped !== String(api.conversationId)) return { decline: true };\n\t\t\t\t\tif (!options.beforeCompaction) return;\n\t\t\t\t\tconst entries = projectDurableEntries(input.entries);\n\t\t\t\t\tconst patch = await options.beforeCompaction({\n\t\t\t\t\t\treason: input.reason,\n\t\t\t\t\t\tcustomInstructions: input.instructions,\n\t\t\t\t\t\tpreparation: {\n\t\t\t\t\t\t\tentries,\n\t\t\t\t\t\t\tmessages: [...input.messages],\n\t\t\t\t\t\t\ttokensBefore: 0,\n\t\t\t\t\t\t\tretainedTail: [],\n\t\t\t\t\t\t\tfirstKeptEntryId: String(input.firstKept),\n\t\t\t\t\t\t\tmessagesToSummarize: [...input.messages],\n\t\t\t\t\t\t\tturnPrefixMessages: [],\n\t\t\t\t\t\t\tisSplitTurn: false,\n\t\t\t\t\t\t\tfileOps: {\n\t\t\t\t\t\t\t\tread: /* @__PURE__ */ new Set(),\n\t\t\t\t\t\t\t\twritten: /* @__PURE__ */ new Set(),\n\t\t\t\t\t\t\t\tedited: /* @__PURE__ */ new Set()\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsettings: {\n\t\t\t\t\t\t\t\tenabled: options.compaction?.enabled ?? DEFAULT_COMPACTION_POLICY.enabled,\n\t\t\t\t\t\t\t\treserveTokens: options.compaction?.reserveTokens ?? DEFAULT_COMPACTION_POLICY.reserveTokens,\n\t\t\t\t\t\t\t\tkeepRecentTokens: options.compaction?.keepRecentTokens ?? DEFAULT_COMPACTION_POLICY.keepRecentTokens\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, ctx);\n\t\t\t\t\tif (patch?.decline) return { decline: true };\n\t\t\t\t\tif (patch?.compaction) return { summary: patch.compaction.summary };\n\t\t\t\t} })\n\t\t\t]\n\t\t});\n\t\tinstall();\n\t\tif (!attached) registry.install(SubagentsExtension);\n\t\tconst harness = attached?.harness ?? await Harness.open(storage.storage, {\n\t\t\tmodels,\n\t\t\tregistry,\n\t\t\tget settings() {\n\t\t\t\treturn settings;\n\t\t\t},\n\t\t\tenv: () => environment,\n\t\t\tonReport: (error) => emit({\n\t\t\t\ttype: \"handler_error\",\n\t\t\t\terror: String(error)\n\t\t\t})\n\t\t}, context);\n\t\tif (!attached) startupHarness = harness;\n\t\tlet conversation;\n\t\tlet sessionId;\n\t\tif (attached) {\n\t\t\tconversation = attached.conversation;\n\t\t\tif (!options.sessionId) throw new Error(\"A lane requires its session identity.\");\n\t\t\tsessionId = options.sessionId;\n\t\t\tawait writable(() => conversation.configure({\n\t\t\t\textensions: [{ name: extensionName }],\n\t\t\t\ttools: tools.filter((t) => activeNames.has(t.name)).map(nativeTool),\n\t\t\t\tmodelTools: null,\n\t\t\t\tinstructions: null,\n\t\t\t\tcwd: options.cwd,\n\t\t\t\t...options.model ? { model: {\n\t\t\t\t\tprovider: options.model.provider,\n\t\t\t\t\tmodelId: options.model.id\n\t\t\t\t} } : {},\n\t\t\t\t...options.thinkingLevel ? { thinkingLevel: options.thinkingLevel } : {}\n\t\t\t}, context));\n\t\t\tconst provider = await harness.snapshot(ProviderDoc, conversation.id, context);\n\t\t\tif (provider) laneProviderSessions.add(provider.sessionId);\n\t\t} else {\n\t\t\tconst root = await harness.root(context, { agent: {\n\t\t\t\tcwd: options.cwd,\n\t\t\t\t...options.model ?? models.getModels()[0] ? { model: {\n\t\t\t\t\tprovider: (options.model ?? models.getModels()[0]).provider,\n\t\t\t\t\tmodelId: (options.model ?? models.getModels()[0]).id\n\t\t\t\t} } : {},\n\t\t\t\t...options.thinkingLevel ? { thinkingLevel: options.thinkingLevel } : {}\n\t\t\t} });\n\t\t\tconst activeId = await initializeDurableNavigation(harness, root.id, context);\n\t\t\tconversation = await harness.conversation(activeId, context);\n\t\t\tconst storedAgent = await harness.snapshot(AgentDoc, conversation.id, context);\n\t\t\tconst initialModel = options.model ?? models.getModels()[0];\n\t\t\tawait conversation.configure({\n\t\t\t\t...!storedAgent?.model && initialModel ? { model: {\n\t\t\t\t\tprovider: initialModel.provider,\n\t\t\t\t\tmodelId: initialModel.id\n\t\t\t\t} } : {},\n\t\t\t\t...!storedAgent?.thinkingLevel && options.thinkingLevel ? { thinkingLevel: options.thinkingLevel } : {},\n\t\t\t\ttools: tools.filter((t) => activeNames.has(t.name)).map(nativeTool)\n\t\t\t}, context);\n\t\t\tconst storedFastMode = await harness.snapshot(FastModeDoc, context);\n\t\t\tfastMode = storedFastMode?.enabled ?? options.initialFastMode ?? false;\n\t\t\tconst storedAgentLock = await harness.snapshot(AgentLockDoc, context);\n\t\t\tagentLocked = storedAgentLock?.locked ?? options.initialAgentLocked ?? false;\n\t\t\tconst mainSessionId = (await harness.snapshot(SessionIdentityDoc, context))?.id || options.sessionId || randomUUID();\n\t\t\tsessionId = mainSessionId;\n\t\t\tconst lane = conversation;\n\t\t\tawait writable(() => harness.commit(async (tx) => {\n\t\t\t\tconst identity = await tx.doc(SessionIdentityDoc);\n\t\t\t\tif (!identity.id) {\n\t\t\t\t\tidentity.id = mainSessionId;\n\t\t\t\t\tidentity.createdAt = Date.now();\n\t\t\t\t\tidentity.parentSessionId = options.parentSessionId ?? \"\";\n\t\t\t\t}\n\t\t\t\tif (!storedAgentLock && options.initialAgentLocked !== void 0) (await tx.doc(AgentLockDoc)).locked = agentLocked;\n\t\t\t\tif (!storedFastMode) {\n\t\t\t\t\t(await tx.doc(FastModeDoc)).enabled = fastMode;\n\t\t\t\t\tif (options.initialFastMode !== void 0) await tx.appendEntry(lane.id, {\n\t\t\t\t\t\tkind: \"po.fast-mode\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tversion: 1,\n\t\t\t\t\t\t\tenabled: fastMode,\n\t\t\t\t\t\t\tsessionId: mainSessionId\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst metadata = await tx.doc(SessionMetadataDoc);\n\t\t\t\tconst fresh = metadata.workspaceRoot === \"\";\n\t\t\t\tmetadata.workspaceRoot ||= options.cwd;\n\t\t\t\tif (options.lane !== void 0) metadata.laneName = options.lane;\n\t\t\t\tif (fresh && options.sessionName !== void 0) metadata.name = options.sessionName;\n\t\t\t}, context));\n\t\t}\n\t\tconst laneName = options.lane ?? \"main\";\n\t\tlet resolveExited;\n\t\tconst exited = new Promise((resolve) => {\n\t\t\tresolveExited = resolve;\n\t\t});\n\t\tlet laneRecord = {\n\t\t\trevision: 0,\n\t\t\tpaused: false,\n\t\t\theld: []\n\t\t};\n\t\tconst readRecord = async () => attached ? structuredClone(laneRecord) : JSON.parse((await harness.snapshot(HeldQueueDoc, context))?.json ?? \"{\\\"revision\\\":0,\\\"paused\\\":false,\\\"held\\\":[]}\");\n\t\tconst changeRecord = async (change) => {\n\t\t\tif (attached) {\n\t\t\t\tconst record = structuredClone(laneRecord);\n\t\t\t\tconst result = change(record);\n\t\t\t\trecord.revision++;\n\t\t\t\tlaneRecord = record;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn writable(() => harness.commit(async (tx) => {\n\t\t\t\tconst doc = await tx.doc(HeldQueueDoc);\n\t\t\t\tconst record = JSON.parse(doc.json);\n\t\t\t\tconst result = change(record);\n\t\t\t\trecord.revision++;\n\t\t\t\tdoc.json = JSON.stringify(record);\n\t\t\t\treturn result;\n\t\t\t}, context));\n\t\t};\n\t\tlet userAdmission = false;\n\t\tlet promptAdmissions = 0;\n\t\tlet userAdmissionSettled = Promise.resolve();\n\t\tlet releaseUserAdmission;\n\t\tconst guardUserAdmission = () => {\n\t\t\tif (userAdmission) throw new Error(\"A user interruption is already being admitted\");\n\t\t};\n\t\tlet external;\n\t\tlet externalAbort;\n\t\tlet compactionAdmission = false;\n\t\tconst nativeExecution = async () => {\n\t\t\tconst live = await harness.snapshot(LiveDoc, conversation.id, context);\n\t\t\tconst task = (await harness.inspect(context)).tasks.find((t) => t.record.conversationId === conversation.id && !t.record.background);\n\t\t\treturn live?.run ? {\n\t\t\t\tid: String(live.run.inputs[0]),\n\t\t\t\tkind: \"run\",\n\t\t\t\tstatus: (await readRecord()).abortOperationId === String(live.run.inputs[0]) ? \"aborting\" : \"open\"\n\t\t\t} : task ? {\n\t\t\t\tid: String(task.record.id),\n\t\t\t\tkind: \"compaction\",\n\t\t\t\tstatus: task.record.abortRequested ? \"aborting\" : \"open\"\n\t\t\t} : null;\n\t\t};\n\t\tconst execution = async () => await nativeExecution() ?? (external ? {\n\t\t\tid: external,\n\t\t\tkind: \"navigation\",\n\t\t\tstatus: \"open\"\n\t\t} : settling ? {\n\t\t\tid: \"settling\",\n\t\t\tkind: \"run\",\n\t\t\tstatus: \"open\"\n\t\t} : null);\n\t\tconst runAtToolBoundary = (callback) => {\n\t\t\tif (disposed || disposePromise) return Promise.reject(/* @__PURE__ */ new Error(\"Direct harness is disposed\"));\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst pending = {\n\t\t\t\t\tasync run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresolve(await callback());\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\treject\n\t\t\t\t};\n\t\t\t\ttoolBoundaryQueue.push(pending);\n\t\t\t\tnativeExecution().then(async (active) => {\n\t\t\t\t\tif (!active && !external) await flushToolBoundary();\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tconst index = toolBoundaryQueue.indexOf(pending);\n\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\ttoolBoundaryQueue.splice(index, 1);\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\t\tconst readLifecycle = async () => {\n\t\t\tconst record = await readRecord();\n\t\t\tconst inbox = await harness.snapshot(InboxDoc, conversation.id, context);\n\t\t\tconst handedOff = [];\n\t\t\tfor (const item of inbox?.items ?? []) {\n\t\t\t\tif (item.mode === \"write\") continue;\n\t\t\t\tconst requestId = (await storage.storage.submission(item.id, context))?.requestId;\n\t\t\t\tif (!requestId?.startsWith(heldRequestId(\"\"))) continue;\n\t\t\t\thandedOff.push({\n\t\t\t\t\tid: requestId.slice(heldRequestId(\"\").length),\n\t\t\t\t\t...fromContent(item.content),\n\t\t\t\t\tdelivery: item.mode,\n\t\t\t\t\tscheduling: \"automatic\",\n\t\t\t\t\tdisposition: \"handoff\"\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn {\n\t\t\t\trevision: record.revision,\n\t\t\t\tpaused: record.paused,\n\t\t\t\tqueue: [...handedOff, ...record.held.filter((item) => item.explicitQueue).map(({ explicitQueue: _q, message: _m, entry: _e, ...item }) => ({\n\t\t\t\t\t...item,\n\t\t\t\t\tdisposition: \"pending\"\n\t\t\t\t}))],\n\t\t\t\toperation: await execution()\n\t\t\t};\n\t\t};\n\t\tconst publish = async () => emit({\n\t\t\ttype: \"lifecycle_update\",\n\t\t\tlifecycle: await readLifecycle()\n\t\t});\n\t\tlet watcher;\n\t\tlet eventsSettled = Promise.resolve();\n\t\tlet settling = 0;\n\t\tconst admittingInternal = /* @__PURE__ */ new Set();\n\t\tconst reconcilingInternal = /* @__PURE__ */ new Map();\n\t\tconst internalDelivery = /* @__PURE__ */ new Map();\n\t\tconst deliveredInputs = /* @__PURE__ */ new Set();\n\t\tconst nextTurnMessages = [];\n\t\tlet deferredInternalCount = 0;\n\t\tconst flushNextTurn = async () => {\n\t\t\tconst staged = nextTurnMessages.splice(0);\n\t\t\tfor (let index = 0; index < staged.length; index++) {\n\t\t\t\tconst message = staged[index];\n\t\t\t\ttry {\n\t\t\t\t\tawait writable(() => conversation.submit({\n\t\t\t\t\t\ttype: \"write\",\n\t\t\t\t\t\trequestId: randomUUID(),\n\t\t\t\t\t\tentry: {\n\t\t\t\t\t\t\tkind: \"po.entry\",\n\t\t\t\t\t\t\tdata: json({\n\t\t\t\t\t\t\t\ttype: \"message\",\n\t\t\t\t\t\t\t\tmessage\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tmodel: convertToLlm([message])\n\t\t\t\t\t\t}\n\t\t\t\t\t}, context));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tnextTurnMessages.unshift(...staged.slice(index));\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tlet logicalLoopActive = false;\n\t\tlet lastAssistant;\n\t\tlet partial;\n\t\tlet activeRunId;\n\t\tlet toolResults = [];\n\t\tconst deliver = async (event, eventContext) => {\n\t\t\tfor (const listener of eventListeners) try {\n\t\t\t\tawait listener(event, eventContext);\n\t\t\t} catch (error) {\n\t\t\t\temit({\n\t\t\t\t\ttype: \"handler_error\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\tconst attach = async () => {\n\t\t\tif (watcher) await watcher.stop();\n\t\t\twatcher = await watchEvents(harness, conversation.id, context);\n\t\t\tlet predecessor = watcher.snapshot.entries.at(-1)?.id;\n\t\t\tconst toolOutputs = /* @__PURE__ */ new Map();\n\t\t\tlastAssistant = void 0;\n\t\t\tpartial = void 0;\n\t\t\ttoolResults = [];\n\t\t\twatcher.start(async (events, eventContext) => {\n\t\t\t\tfor (const event of events) {\n\t\t\t\t\tlet mapped;\n\t\t\t\t\tif (event.type === \"turn_start\" || event.type === \"run_start\") {\n\t\t\t\t\t\tlastAssistant = void 0;\n\t\t\t\t\t\tpartial = void 0;\n\t\t\t\t\t\ttoolResults = [];\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"message_end\" || event.type === \"entry_appended\") {\n\t\t\t\t\t\tconst entry = projectDurableEntries([event.entry])[0];\n\t\t\t\t\t\tif (entry) {\n\t\t\t\t\t\t\tentry.parentId = predecessor === void 0 ? null : String(predecessor);\n\t\t\t\t\t\t\tconst added = {\n\t\t\t\t\t\t\t\ttype: \"entry_appended\",\n\t\t\t\t\t\t\t\tentry\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\temit({\n\t\t\t\t\t\t\t\ttype: \"entry_appended\",\n\t\t\t\t\t\t\t\tentry\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\teventsSettled = eventsSettled.then(() => deliver(added, eventContext));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpredecessor = event.entry.id;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"run_start\") activeRunId = String(event.inputs[0]);\n\t\t\t\t\tif ([\n\t\t\t\t\t\t\"run_end\",\n\t\t\t\t\t\t\"turn_start\",\n\t\t\t\t\t\t\"compaction_start\"\n\t\t\t\t\t].includes(event.type)) mapped = { type: event.type };\n\t\t\t\t\tif (event.type === \"run_start\") mapped = {\n\t\t\t\t\t\ttype: \"run_start\",\n\t\t\t\t\t\trunId: activeRunId\n\t\t\t\t\t};\n\t\t\t\t\tif (event.type === \"message_start\") {\n\t\t\t\t\t\tif (event.message.role === \"assistant\") partial = structuredClone(event.message);\n\t\t\t\t\t\tmapped = {\n\t\t\t\t\t\t\ttype: \"message_start\",\n\t\t\t\t\t\t\tmessage: event.message\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"message_end\" && event.entry.model?.[0]) {\n\t\t\t\t\t\tconst projected = projectDurableEntries([event.entry])[0];\n\t\t\t\t\t\tconst message = projected?.type === \"message\" && projected.message.role === \"custom\" ? projected.message : event.entry.model[0];\n\t\t\t\t\t\tif (message.role === \"assistant\") lastAssistant = message;\n\t\t\t\t\t\tif (message.role === \"toolResult\") toolResults.push(message);\n\t\t\t\t\t\tmapped = {\n\t\t\t\t\t\t\ttype: \"message_end\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tentryId: String(event.entry.id),\n\t\t\t\t\t\t\trunId: String(conversation.id)\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"tool_execution_start\") mapped = {\n\t\t\t\t\t\t...event,\n\t\t\t\t\t\ttype: \"tool_execution_start\"\n\t\t\t\t\t};\n\t\t\t\t\tif (event.type === \"tool_execution_end\") {\n\t\t\t\t\t\ttoolOutputs.delete(event.toolCallId);\n\t\t\t\t\t\tconst result = event.entry?.model?.find((m) => m.role === \"toolResult\");\n\t\t\t\t\t\tmapped = {\n\t\t\t\t\t\t\ttype: \"tool_execution_end\",\n\t\t\t\t\t\t\ttoolCallId: event.toolCallId,\n\t\t\t\t\t\t\ttoolName: event.toolName,\n\t\t\t\t\t\t\tresult: {\n\t\t\t\t\t\t\t\tcontent: result?.content ?? [],\n\t\t\t\t\t\t\t\tdetails: result?.details === void 0 ? void 0 : json(result.details)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tisError: result?.isError ?? true\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"turn_end\" && lastAssistant) {\n\t\t\t\t\t\tmapped = {\n\t\t\t\t\t\t\ttype: \"turn_end\",\n\t\t\t\t\t\t\tmessage: lastAssistant,\n\t\t\t\t\t\t\ttoolResults,\n\t\t\t\t\t\t\trunId: activeRunId\n\t\t\t\t\t\t};\n\t\t\t\t\t\ttoolResults = [];\n\t\t\t\t\t\tlastAssistant = void 0;\n\t\t\t\t\t\tpartial = void 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"message_update\" && partial) for (const change of event.changes) {\n\t\t\t\t\t\tif (change.type === \"message\") partial = structuredClone(change.message);\n\t\t\t\t\t\telse if (\"block\" in change) partial.content[change.contentIndex] = structuredClone(change.block);\n\t\t\t\t\t\tconst block = \"contentIndex\" in change ? partial.content[change.contentIndex] : void 0;\n\t\t\t\t\t\tif (change.type === \"text_delta\" && block?.type === \"text\") block.text += change.delta;\n\t\t\t\t\t\tif (change.type === \"thinking_delta\" && block?.type === \"thinking\") block.thinking += change.delta;\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconst update = {\n\t\t\t\t\t\t\t\ttype: \"message_update\",\n\t\t\t\t\t\t\t\tmessage: structuredClone(partial),\n\t\t\t\t\t\t\t\tevent: \"delta\" in change ? {\n\t\t\t\t\t\t\t\t\ttype: change.type,\n\t\t\t\t\t\t\t\t\tcontentIndex: change.contentIndex,\n\t\t\t\t\t\t\t\t\tdelta: change.delta,\n\t\t\t\t\t\t\t\t\tpartial: structuredClone(partial)\n\t\t\t\t\t\t\t\t} : {\n\t\t\t\t\t\t\t\t\ttype: \"start\",\n\t\t\t\t\t\t\t\t\tpartial: structuredClone(partial)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\temit({\n\t\t\t\t\t\t\t\ttype: \"message_update\",\n\t\t\t\t\t\t\t\tmessage: update.message\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\teventsSettled = eventsSettled.then(() => deliver(update, eventContext));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"tool_execution_update\") {\n\t\t\t\t\t\tconst previous = toolOutputs.get(event.toolCallId) ?? \"\";\n\t\t\t\t\t\tconst output = !event.output ? previous : \"set\" in event.output ? event.output.set : previous.slice(event.output.trimStart ?? 0) + (event.output.append ?? \"\");\n\t\t\t\t\t\ttoolOutputs.set(event.toolCallId, output);\n\t\t\t\t\t\tmapped = {\n\t\t\t\t\t\t\ttype: \"tool_execution_update\",\n\t\t\t\t\t\t\ttoolCallId: event.toolCallId,\n\t\t\t\t\t\t\ttoolName: event.toolName,\n\t\t\t\t\t\t\tpartialResult: {\n\t\t\t\t\t\t\t\tcontent: [{\n\t\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\t\ttext: output\n\t\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\tdetails: event.details\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"compaction_end\") {\n\t\t\t\t\t\tconst outcome = (await harness.waitForTask(event.taskId, eventContext)).state.outcome;\n\t\t\t\t\t\tconst result = outcome.status === \"completed\" ? outcome.result : void 0;\n\t\t\t\t\t\tconst status = await (result?.submissionId ? await harness.submission(result.submissionId, eventContext) : void 0)?.status(eventContext);\n\t\t\t\t\t\tconst entryId = result?.entryId ?? (status && \"entry\" in status ? status.entry : void 0);\n\t\t\t\t\t\tmapped = {\n\t\t\t\t\t\t\ttype: \"compaction_end\",\n\t\t\t\t\t\t\tstatus: outcome.status === \"completed\" ? result?.entryId !== void 0 || result?.submissionId !== void 0 ? \"completed\" : \"aborted\" : outcome.status === \"aborted\" ? \"aborted\" : \"failed\",\n\t\t\t\t\t\t\treason: event.reason,\n\t\t\t\t\t\t\tentryId: entryId === void 0 ? void 0 : String(entryId),\n\t\t\t\t\t\t\terror: event.error === void 0 ? void 0 : new Error(event.error)\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"inbox_update\") mapped = {\n\t\t\t\t\t\ttype: \"queue_update\",\n\t\t\t\t\t\tqueues: event.items.map((item) => ({ kind: item.mode }))\n\t\t\t\t\t};\n\t\t\t\t\tif (event.type === \"message_end\") {\n\t\t\t\t\t\tfor (const message of event.entry.model ?? []) if (message.role === \"assistant\") eventsSettled = eventsSettled.then(() => deliver({\n\t\t\t\t\t\t\ttype: \"usage\",\n\t\t\t\t\t\t\trow: {\n\t\t\t\t\t\t\t\tid: String(event.entry.id),\n\t\t\t\t\t\t\t\tusage: message.usage\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, eventContext));\n\t\t\t\t\t}\n\t\t\t\t\tif (!mapped) continue;\n\t\t\t\t\tif (mapped.type === \"run_end\") {\n\t\t\t\t\t\tconst settledEvent = {\n\t\t\t\t\t\t\trunId: String(event.type === \"run_end\" ? event.inputs[0] : conversation.id),\n\t\t\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsettling++;\n\t\t\t\t\t\tlet released = false;\n\t\t\t\t\t\tconst release = () => {\n\t\t\t\t\t\t\tif (!released) {\n\t\t\t\t\t\t\t\tsettling--;\n\t\t\t\t\t\t\t\treleased = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\teventsSettled = eventsSettled.then(async () => {\n\t\t\t\t\t\t\tif (!await nativeExecution() && !external) await flushToolBoundary();\n\t\t\t\t\t\t\tawait reconcile();\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait writable(() => harness.commit((tx) => tx.appendEntry(conversation.id, {\n\t\t\t\t\t\t\t\t\tkind: AGENT_SETTLED_ENTRY_TYPE,\n\t\t\t\t\t\t\t\t\tdata: settledEvent\n\t\t\t\t\t\t\t\t}), eventContext));\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\temit({\n\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\tcode: \"agent_settled\",\n\t\t\t\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst live = await harness.snapshot(LiveDoc, conversation.id, eventContext);\n\t\t\t\t\t\t\tconst successorActive = !!live?.run && String(live.run.inputs[0]) !== settledEvent.runId;\n\t\t\t\t\t\t\tconst aborted = (await Promise.all(event.type === \"run_end\" ? event.inputs.map(async (id) => {\n\t\t\t\t\t\t\t\tconst submission = await harness.submission(id, eventContext);\n\t\t\t\t\t\t\t\tif (!submission) throw new Error(`Settled submission ${id} is unavailable`);\n\t\t\t\t\t\t\t\treturn submission.status(eventContext);\n\t\t\t\t\t\t\t}) : [])).some((status) => status.status === \"unanswered\" && status.reason === \"aborted\");\n\t\t\t\t\t\t\tmapped = {\n\t\t\t\t\t\t\t\ttype: \"run_end\",\n\t\t\t\t\t\t\t\trunId: settledEvent.runId,\n\t\t\t\t\t\t\t\tsuccessorActive,\n\t\t\t\t\t\t\t\taborted\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\temit(mapped);\n\t\t\t\t\t\t\tawait deliver(mapped, eventContext);\n\t\t\t\t\t\t\trelease();\n\t\t\t\t\t\t\tconst lifecycle = await readLifecycle();\n\t\t\t\t\t\t\temit({\n\t\t\t\t\t\t\t\ttype: \"lifecycle_update\",\n\t\t\t\t\t\t\t\tlifecycle\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (!lifecycle.operation) {\n\t\t\t\t\t\t\t\tlogicalLoopActive = false;\n\t\t\t\t\t\t\t\temit({\n\t\t\t\t\t\t\t\t\ttype: \"agent_end\",\n\t\t\t\t\t\t\t\t\trunId: settledEvent.runId\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\temit({\n\t\t\t\t\t\t\t\t\ttype: \"agent_settled\",\n\t\t\t\t\t\t\t\t\t...settledEvent\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}).catch((error) => emit({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\tcode: \"settled_event\",\n\t\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t\t})).finally(async () => {\n\t\t\t\t\t\t\trelease();\n\t\t\t\t\t\t\tif (event.type === \"run_end\") for (const id of event.inputs) {\n\t\t\t\t\t\t\t\tdeliveredInputs.add(id);\n\t\t\t\t\t\t\t\tinternalDelivery.get(id)?.resolve();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhile (deliveredInputs.size > 128) deliveredInputs.delete(deliveredInputs.values().next().value);\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait publish();\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\temit({\n\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\tcode: \"lifecycle_update\",\n\t\t\t\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdispatch().catch((error) => emit({\n\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\tcode: \"dispatch\",\n\t\t\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\temit(mapped);\n\t\t\t\t\t\tif (mapped.type === \"run_start\") {\n\t\t\t\t\t\t\tif (!logicalLoopActive) emit({ type: \"agent_start\" });\n\t\t\t\t\t\t\tlogicalLoopActive = true;\n\t\t\t\t\t\t\tpublish().catch((error) => emit({\n\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\tcode: \"lifecycle_update\",\n\t\t\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst delivered = mapped;\n\t\t\t\t\t\teventsSettled = eventsSettled.then(() => deliver(delivered, eventContext));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tawait attach();\n\t\tconst internalDeliveries = /* @__PURE__ */ new Map();\n\t\tconst reconcileInternal = (requestId, item) => {\n\t\t\tconst existing = reconcilingInternal.get(requestId);\n\t\t\tif (existing) return existing;\n\t\t\tconst work = (async () => {\n\t\t\t\tif (admittingInternal.has(requestId)) return;\n\t\t\t\tconst target = item.conversationId === conversation.id ? conversation : await harness.conversation(item.conversationId, context);\n\t\t\t\tif (!target) throw new Error(\"Internal delivery conversation is unavailable\");\n\t\t\t\tlet receipt = await storage.storage.submissionByRequest(target.id, requestId, context);\n\t\t\t\tif (receipt?.status === \"queued\" && !(await harness.snapshot(LiveDoc, target.id, context))?.run) {\n\t\t\t\t\tawait harness.abortSubmission(receipt.id, context);\n\t\t\t\t\treceipt = await storage.storage.submissionByRequest(target.id, requestId, context);\n\t\t\t\t}\n\t\t\t\tif (receipt?.status === \"queued\") return;\n\t\t\t\tif (!receipt || receipt.status === \"unanswered\" && receipt.entry === void 0) {\n\t\t\t\t\tif ((await harness.snapshot(LiveDoc, target.id, context))?.run) return;\n\t\t\t\t\tconst draft = {\n\t\t\t\t\t\ttype: \"write\",\n\t\t\t\t\t\trequestId: `${requestId}:context`,\n\t\t\t\t\t\tentry: {\n\t\t\t\t\t\t\tkind: \"po.entry\",\n\t\t\t\t\t\t\tdata: json({\n\t\t\t\t\t\t\t\ttype: \"message\",\n\t\t\t\t\t\t\t\tmessage: item.message,\n\t\t\t\t\t\t\t\ttimestamp: item.message.timestamp\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tmodel: convertToLlm([item.message])\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tlet fallback;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfallback = await writable(() => target.submit(draft, context));\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst accepted = await storage.storage.submissionByRequest(target.id, `${requestId}:context`, context);\n\t\t\t\t\t\tfallback = accepted && await harness.submission(accepted.id, context);\n\t\t\t\t\t\tif (!fallback) throw error;\n\t\t\t\t\t}\n\t\t\t\t\tif ((await fallback.wait(context)).status !== \"done\") throw new Error(\"Internal context write failed\");\n\t\t\t\t}\n\t\t\t\tinternalDeliveries.delete(requestId);\n\t\t\t})().finally(() => {\n\t\t\t\treconcilingInternal.delete(requestId);\n\t\t\t});\n\t\t\treconcilingInternal.set(requestId, work);\n\t\t\treturn work;\n\t\t};\n\t\tconst reconcile = async () => {\n\t\t\tfor (const [requestId, item] of internalDeliveries) {\n\t\t\t\tif (admittingInternal.has(requestId)) continue;\n\t\t\t\tif ((await harness.snapshot(LiveDoc, item.conversationId, context))?.run) continue;\n\t\t\t\tconst receipt = await storage.storage.submissionByRequest(item.conversationId, requestId, context);\n\t\t\t\tif (receipt?.status === \"queued\") await harness.abortSubmission(receipt.id, context);\n\t\t\t}\n\t\t\tfor (const [requestId, item] of internalDeliveries) await reconcileInternal(requestId, item);\n\t\t};\n\t\tconst submitInput = async (draft) => {\n\t\t\ttry {\n\t\t\t\treturn await writable(() => conversation.submit(draft, context));\n\t\t\t} catch (error) {\n\t\t\t\tconst accepted = await storage.storage.submissionByRequest(conversation.id, draft.requestId, context);\n\t\t\t\tconst submission = accepted && await harness.submission(accepted.id, context);\n\t\t\t\tif (!submission) throw error;\n\t\t\t\treturn submission;\n\t\t\t}\n\t\t};\n\t\tconst handingOff = /* @__PURE__ */ new Set();\n\t\tlet dispatching;\n\t\tlet dispatchRequested = false;\n\t\tconst dispatch = () => {\n\t\t\tif (dispatching) {\n\t\t\t\tdispatchRequested = true;\n\t\t\t\treturn dispatching;\n\t\t\t}\n\t\t\treturn dispatching = (async () => {\n\t\t\t\twhile (!disposed) {\n\t\t\t\t\tconst record = await readRecord();\n\t\t\t\t\tif (agentLocked || userAdmission || external || record.paused) break;\n\t\t\t\t\tconst idle = !await execution();\n\t\t\t\t\tconst item = record.held.find((q) => idle || !q.explicitQueue);\n\t\t\t\t\tif (!item || userAdmission || external) break;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!await changeRecord((r) => {\n\t\t\t\t\t\t\tif (!r.held.some((q) => q.id === item.id)) return false;\n\t\t\t\t\t\t\thandingOff.add(item.id);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t})) continue;\n\t\t\t\t\t\tawait submitInput({\n\t\t\t\t\t\t\ttype: \"input\",\n\t\t\t\t\t\t\tcontent: heldContent(item.message ?? item.text, item.images),\n\t\t\t\t\t\t\twhenBusy: \"followUp\",\n\t\t\t\t\t\t\trequestId: heldRequestId(item.id),\n\t\t\t\t\t\t\t...item.entry ? { entry: item.entry } : {}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tawait changeRecord((r) => {\n\t\t\t\t\t\t\tr.held = r.held.filter((q) => q.id !== item.id);\n\t\t\t\t\t\t});\n\t\t\t\t\t} finally {\n\t\t\t\t\t\thandingOff.delete(item.id);\n\t\t\t\t\t}\n\t\t\t\t\tawait publish();\n\t\t\t\t}\n\t\t\t})().finally(() => {\n\t\t\t\tdispatching = void 0;\n\t\t\t\tif (dispatchRequested) {\n\t\t\t\t\tdispatchRequested = false;\n\t\t\t\t\tdispatch().catch((error) => emit({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\tcode: \"dispatch\",\n\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tconst enqueue = async (message, images, delivery, explicitQueue) => {\n\t\t\tconst id = randomUUID();\n\t\t\tawait changeRecord((r) => {\n\t\t\t\tr.held.push({\n\t\t\t\t\tid,\n\t\t\t\t\ttext: text(message),\n\t\t\t\t\t...images ? { images } : {},\n\t\t\t\t\t...typeof message === \"string\" ? {} : { message },\n\t\t\t\t\tdelivery,\n\t\t\t\t\tscheduling: \"automatic\",\n\t\t\t\t\texplicitQueue\n\t\t\t\t});\n\t\t\t});\n\t\t\tawait publish();\n\t\t\treturn { id };\n\t\t};\n\t\tconst queued = async (message, images, delivery) => {\n\t\t\tguardUserAdmission();\n\t\t\tassertUnlocked();\n\t\t\tif (external || (await readRecord()).paused) {\n\t\t\t\tawait enqueue(message, images, delivery, false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait submitInput({\n\t\t\t\ttype: \"input\",\n\t\t\t\tcontent: heldContent(message, images),\n\t\t\t\twhenBusy: \"followUp\",\n\t\t\t\trequestId: randomUUID()\n\t\t\t});\n\t\t\tawait publish();\n\t\t};\n\t\tconst dispatchCommand = async (value) => options.dispatchCommand?.(value) ?? false;\n\t\tconst admit = async (message, images, mode) => {\n\t\t\tguardUserAdmission();\n\t\t\tif (external) throw new Error(\"An operation is already running\");\n\t\t\tif (typeof message === \"string\" && await dispatchCommand(message)) return {\n\t\t\t\tsettled: Promise.resolve(),\n\t\t\t\thandledCommand: true\n\t\t\t};\n\t\t\tguardUserAdmission();\n\t\t\tif (external) throw new Error(\"An operation is already running\");\n\t\t\tpromptAdmissions++;\n\t\t\ttry {\n\t\t\t\tassertUnlocked();\n\t\t\t\tawait flushNextTurn();\n\t\t\t\tconst submission = await submitInput({\n\t\t\t\t\ttype: \"input\",\n\t\t\t\t\tcontent: heldContent(message, images),\n\t\t\t\t\twhenBusy: mode ?? \"reject\",\n\t\t\t\t\trequestId: randomUUID()\n\t\t\t\t});\n\t\t\t\tawait publish();\n\t\t\t\tlet resolveDelivery;\n\t\t\t\tconst delivered = new Promise((resolve) => {\n\t\t\t\t\tresolveDelivery = resolve;\n\t\t\t\t});\n\t\t\t\tinternalDelivery.set(submission.id, {\n\t\t\t\t\tdone: delivered,\n\t\t\t\t\tresolve: resolveDelivery\n\t\t\t\t});\n\t\t\t\tif (deliveredInputs.has(submission.id)) resolveDelivery();\n\t\t\t\tconst settled = (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst status = await submission.wait(context);\n\t\t\t\t\t\tif (status.status === \"done\" || status.entry !== void 0) await delivered;\n\t\t\t\t\t\tawait eventsSettled;\n\t\t\t\t\t\tawait reconcile();\n\t\t\t\t\t\tawait publish();\n\t\t\t\t\t\tif (status.status === \"unanswered\" && status.reason !== \"aborted\") throw new Error(`Agent submission failed: ${status.reason}${typeof status.detail === \"string\" && status.detail ? `: ${status.detail}` : \"\"}`);\n\t\t\t\t\t\tawait dispatch();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tinternalDelivery.delete(submission.id);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\tsettled.catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t\treturn { settled };\n\t\t\t} finally {\n\t\t\t\tpromptAdmissions--;\n\t\t\t}\n\t\t};\n\t\tconst abort = async (operationId) => {\n\t\t\tconst current = await execution();\n\t\t\tif (!current || current.id === \"settling\" || operationId && current.id !== operationId) return;\n\t\t\tif (current.id === external) {\n\t\t\t\texternalAbort?.abort();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst stop = () => writable(async () => {\n\t\t\t\tif (current.kind === \"run\") await conversation.abort(context);\n\t\t\t\telse await harness.abortTask(nativeId(current.id), context);\n\t\t\t});\n\t\t\tif (attached) {\n\t\t\t\tawait stop();\n\t\t\t\tawait reconcile();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst captured = /* @__PURE__ */ new Set();\n\t\t\tif (current.kind === \"run\") for (const item of (await harness.snapshot(InboxDoc, conversation.id, context))?.items ?? []) {\n\t\t\t\tif (item.mode === \"write\") continue;\n\t\t\t\tconst requestId = (await storage.storage.submission(item.id, context))?.requestId;\n\t\t\t\tif (requestId === void 0 || !internalDeliveries.has(requestId)) captured.add(item.id);\n\t\t\t}\n\t\t\tawait writable(() => harness.commit(async (tx) => {\n\t\t\t\tconst doc = await tx.doc(HeldQueueDoc);\n\t\t\t\tconst record = JSON.parse(doc.json);\n\t\t\t\trecord.paused = true;\n\t\t\t\trecord.abortOperationId = current.id;\n\t\t\t\tconst items = (await tx.doc(InboxDoc, conversation.id)).items;\n\t\t\t\tconst moved = [];\n\t\t\t\tfor (let index = items.length - 1; index >= 0; index--) {\n\t\t\t\t\tconst item = items[index];\n\t\t\t\t\tif (item.mode === \"write\" || !captured.has(item.id)) continue;\n\t\t\t\t\tmoved.unshift({\n\t\t\t\t\t\tid: randomUUID(),\n\t\t\t\t\t\t...fromContent(item.content),\n\t\t\t\t\t\t...item.entry ? { entry: item.entry } : {},\n\t\t\t\t\t\tdelivery: item.mode,\n\t\t\t\t\t\tscheduling: \"automatic\",\n\t\t\t\t\t\texplicitQueue: true\n\t\t\t\t\t});\n\t\t\t\t\ttx.settleSubmission(item.id, {\n\t\t\t\t\t\tstatus: \"unanswered\",\n\t\t\t\t\t\treason: \"aborted\"\n\t\t\t\t\t});\n\t\t\t\t\titems.splice(index, 1);\n\t\t\t\t}\n\t\t\t\trecord.held.unshift(...moved);\n\t\t\t\trecord.revision++;\n\t\t\t\tdoc.json = JSON.stringify(record);\n\t\t\t}, context));\n\t\t\tawait publish();\n\t\t\tawait stop();\n\t\t\tawait reconcile();\n\t\t};\n\t\tconst interrupt = async () => {\n\t\t\tawait abort();\n\t\t\tawait writable(() => conversation.abort(context));\n\t\t\tawait eventsSettled;\n\t\t};\n\t\tconst admitUser = async (work) => {\n\t\t\tuserAdmission = true;\n\t\t\tuserAdmissionSettled = new Promise((resolve) => {\n\t\t\t\treleaseUserAdmission = resolve;\n\t\t\t});\n\t\t\ttry {\n\t\t\t\treturn await work();\n\t\t\t} finally {\n\t\t\t\tuserAdmission = false;\n\t\t\t\treleaseUserAdmission?.();\n\t\t\t\treleaseUserAdmission = void 0;\n\t\t\t}\n\t\t};\n\t\tconst submitUserPrompt = async (message, images, submissionMode = \"reject\") => {\n\t\t\tguardUserAdmission();\n\t\t\tif (external) throw new Error(\"An operation is already running\");\n\t\t\tif (typeof message === \"string\" ? !message && !images?.length : !message.content.length) throw new Error(\"User input must contain text or an image\");\n\t\t\tif (typeof message === \"string\" && await dispatchCommand(message)) return {\n\t\t\t\tsettled: Promise.resolve(),\n\t\t\t\thandledCommand: true\n\t\t\t};\n\t\t\tassertUnlocked();\n\t\t\tguardUserAdmission();\n\t\t\tif (external) throw new Error(\"An operation is already running\");\n\t\t\treturn admitUser(async () => {\n\t\t\t\tif (submissionMode === \"reject\") {\n\t\t\t\t\tconst current = await execution();\n\t\t\t\t\tif (current) await abort(current.id);\n\t\t\t\t\tawait conversation.waitForIdle(context);\n\t\t\t\t\tawait eventsSettled;\n\t\t\t\t}\n\t\t\t\tawait flushNextTurn();\n\t\t\t\tconst submission = await submitInput({\n\t\t\t\t\ttype: \"input\",\n\t\t\t\t\tcontent: heldContent(message, images),\n\t\t\t\t\twhenBusy: submissionMode,\n\t\t\t\t\trequestId: randomUUID()\n\t\t\t\t});\n\t\t\t\tconst settled = (async () => {\n\t\t\t\t\tconst status = await submission.wait(context);\n\t\t\t\t\tawait eventsSettled;\n\t\t\t\t\tawait reconcile();\n\t\t\t\t\tawait publish();\n\t\t\t\t\tif (status.status === \"unanswered\" && status.reason !== \"aborted\") throw new Error(`Agent submission failed: ${status.reason}`);\n\t\t\t\t\tawait dispatch();\n\t\t\t\t})();\n\t\t\t\tsettled.catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tcode: \"user_prompt\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t\tawait publish();\n\t\t\t\treturn { settled };\n\t\t\t});\n\t\t};\n\t\tconst recover = async () => {\n\t\t\tconst r = await readRecord();\n\t\t\tconst current = r.abortOperationId ? await nativeExecution() : null;\n\t\t\tif (current?.id === r.abortOperationId) {\n\t\t\t\tif (current?.kind === \"run\") await conversation.abort(context);\n\t\t\t\telse if (current) await harness.abortTask(nativeId(current.id), context);\n\t\t\t}\n\t\t\tconst accepted = /* @__PURE__ */ new Set();\n\t\t\tfor (const item of r.held) if (await storage.storage.submissionByRequest(conversation.id, heldRequestId(item.id), context)) accepted.add(item.id);\n\t\t\tawait reconcile();\n\t\t\tawait changeRecord((record) => {\n\t\t\t\trecord.held = record.held.filter((q) => !accepted.has(q.id));\n\t\t\t});\n\t\t};\n\t\tconst admissionBusy = () => userAdmission || promptAdmissions > 0 || settling > 0 || handingOff.size > 0 || admittingInternal.size > 0 || compactionAdmission;\n\t\tconst runExternalOperation = async (work, { signal, waitMs = 0 } = {}) => {\n\t\t\tif (!Number.isFinite(waitMs) || waitMs < 0) throw new RangeError(\"waitMs must be finite and non-negative\");\n\t\t\tconst deadline = Date.now() + waitMs;\n\t\t\tconst pendingFollowUp = async () => {\n\t\t\t\tif (waitMs === 0 || agentLocked) return false;\n\t\t\t\tconst record = await readRecord();\n\t\t\t\treturn !record.paused && record.held.length > 0;\n\t\t\t};\n\t\t\tfor (;;) {\n\t\t\t\tif (waitMs === 0) guardUserAdmission();\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\tif (disposed || disposePromise) throw new Error(\"Direct harness is disposed\");\n\t\t\t\tconst busy = await nativeExecution() || await pendingFollowUp();\n\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\tif (disposed || disposePromise) throw new Error(\"Direct harness is disposed\");\n\t\t\t\tif (!busy && !external && !admissionBusy()) {\n\t\t\t\t\texternal = randomUUID();\n\t\t\t\t\tlet admitted = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst changed = await nativeExecution() || await pendingFollowUp();\n\t\t\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\t\t\tif (disposed || disposePromise) throw new Error(\"Direct harness is disposed\");\n\t\t\t\t\t\tif (waitMs > 0 && Date.now() >= deadline) throw new PoHeadlessToolBusyError();\n\t\t\t\t\t\tadmitted = !changed && !admissionBusy();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (!admitted) {\n\t\t\t\t\t\t\texternal = void 0;\n\t\t\t\t\t\t\tif (!await nativeExecution()) await flushToolBoundary();\n\t\t\t\t\t\t\tdispatch().catch((error) => emit({\n\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (admitted) break;\n\t\t\t\t}\n\t\t\t\tconst remaining = deadline - Date.now();\n\t\t\t\tif (remaining <= 0) throw new PoHeadlessToolBusyError();\n\t\t\t\tlet timer;\n\t\t\t\ttry {\n\t\t\t\t\tawait awaitWithContext(new Promise((resolve) => {\n\t\t\t\t\t\ttimer = setTimeout(resolve, Math.min(100, remaining));\n\t\t\t\t\t}), signal ? withAbortSignal(signal, context) : context);\n\t\t\t\t} finally {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t}\n\t\t\t}\n\t\t\texternalAbort = new AbortController();\n\t\t\ttry {\n\t\t\t\tawait publish();\n\t\t\t\treturn await writable(work);\n\t\t\t} finally {\n\t\t\t\texternal = void 0;\n\t\t\t\texternalAbort = void 0;\n\t\t\t\tawait flushToolBoundary();\n\t\t\t\tawait publish();\n\t\t\t\tdispatch().catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t}\n\t\t};\n\t\tconst appendEntry = async (entry) => {\n\t\t\tconst lane = conversation;\n\t\t\tconst receipt = await (await writable(() => lane.submit(entry, context))).wait(context);\n\t\t\tif (receipt.status !== \"done\") throw new Error(`Entry write failed: ${receipt.reason}`);\n\t\t\treturn String(receipt.entry);\n\t\t};\n\t\tconst restoreCustomContextMessages = (messages, view) => {\n\t\t\tconst contextContributions = /* @__PURE__ */ new Map();\n\t\t\tfor (const [index, raw] of view.entries.entries()) {\n\t\t\t\tconst entry = projectDurableEntries([raw])[0];\n\t\t\t\tconst contributions = view.contributions[index] ?? [];\n\t\t\t\tconst custom = entry?.type === \"message\" && entry.message.role === \"custom\" && raw.model?.length === 1 && contributions.length === 1 && JSON.stringify(raw.model[0]) === JSON.stringify(contributions[0]) ? entry.message : void 0;\n\t\t\t\tfor (const native of contributions) {\n\t\t\t\t\tconst key = JSON.stringify(native);\n\t\t\t\t\tconst restored = contextContributions.get(key) ?? [];\n\t\t\t\t\trestored.push(custom ?? native);\n\t\t\t\t\tcontextContributions.set(key, restored);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn messages.filter((message) => message.role !== \"system\").map((message) => contextContributions.get(JSON.stringify(message))?.shift() ?? message);\n\t\t};\n\t\tconst readEntries = async () => {\n\t\t\tconst entries = await projectDurableConversationEntries(conversation, context);\n\t\t\toptions.onFullHistoryRead?.(sessionId, entries.length);\n\t\t\treturn {\n\t\t\t\tentries,\n\t\t\t\tleafId: entries.at(-1)?.id ?? null\n\t\t\t};\n\t\t};\n\t\tlet statsCache;\n\t\tconst getSessionStats = async () => {\n\t\t\tconst lane = conversation;\n\t\t\tconst cached = statsCache;\n\t\t\tconst previous = cached?.conversation === lane ? cached : void 0;\n\t\t\tconst entries = (await projectDurableConversationEntries(lane, context, previous?.seq)).filter((entry) => previous?.seq === void 0 || entry.seq > previous.seq);\n\t\t\tconst messages = entries.flatMap((e) => e.type === \"message\" ? [e.message] : []);\n\t\t\tconst agent = await conversation.agent(context);\n\t\t\tconst selected = agent.model ? models.getModel(agent.model.provider, agent.model.modelId) : void 0;\n\t\t\tconst latest = messages.findLast((message) => message.role === \"assistant\");\n\t\t\tconst contextTokens = latest?.role === \"assistant\" ? contextTokensOf(latest.usage) : previous?.contextTokens ?? null;\n\t\t\tconst contextUsage = contextUsageOf(contextTokens, selected?.contextWindow);\n\t\t\tconst usage = attached ? await harness.snapshot(UsageDoc, conversation.id, context) : await harness.usage(context);\n\t\t\tconst children = attached ? [] : await Promise.all((await subagentConversations(harness, context)).map((id) => harness.snapshot(UsageDoc, id, context)));\n\t\t\tconst tokens = {\n\t\t\t\tinput: 0,\n\t\t\t\toutput: 0,\n\t\t\t\tcacheRead: 0,\n\t\t\t\tcacheWrite: 0,\n\t\t\t\ttotal: 0\n\t\t\t};\n\t\t\tlet cost = 0;\n\t\t\tconst add = (ledger, sign) => {\n\t\t\t\tconst rows = [...Object.values(ledger?.models ?? {}), ...Object.values(ledger?.tools ?? {})];\n\t\t\t\tfor (const u of rows) {\n\t\t\t\t\ttokens.input += sign * u.input;\n\t\t\t\t\ttokens.output += sign * u.output;\n\t\t\t\t\ttokens.cacheRead += sign * u.cacheRead;\n\t\t\t\t\ttokens.cacheWrite += sign * u.cacheWrite;\n\t\t\t\t\ttokens.total += sign * u.totalTokens;\n\t\t\t\t\tcost += sign * u.cost.total;\n\t\t\t\t}\n\t\t\t};\n\t\t\tadd(usage, 1);\n\t\t\tfor (const child of children) add(child, -1);\n\t\t\tconst next = {\n\t\t\t\tconversation: lane,\n\t\t\t\tseq: entries.at(-1)?.seq ?? previous?.seq,\n\t\t\t\tcontextTokens,\n\t\t\t\tmessageCount: (previous?.messageCount ?? 0) + messages.length,\n\t\t\t\tuserMessages: (previous?.userMessages ?? 0) + messages.filter((m) => m.role === \"user\").length,\n\t\t\t\tassistantMessages: (previous?.assistantMessages ?? 0) + messages.filter((m) => m.role === \"assistant\").length,\n\t\t\t\ttoolCalls: (previous?.toolCalls ?? 0) + messages.flatMap((m) => m.role === \"assistant\" ? m.content.filter((c) => c.type === \"toolCall\") : []).length,\n\t\t\t\ttoolResults: (previous?.toolResults ?? 0) + messages.filter((m) => m.role === \"toolResult\").length\n\t\t\t};\n\t\t\tif (conversation === lane && statsCache === cached) statsCache = next;\n\t\t\treturn {\n\t\t\t\tsessionId,\n\t\t\t\t...contextUsage === void 0 ? {} : { contextUsage },\n\t\t\t\tmessageCount: next.messageCount,\n\t\t\t\ttotalMessages: next.messageCount,\n\t\t\t\tuserMessages: next.userMessages,\n\t\t\t\tassistantMessages: next.assistantMessages,\n\t\t\t\ttoolCalls: next.toolCalls,\n\t\t\t\ttoolResults: next.toolResults,\n\t\t\t\ttokens,\n\t\t\t\tcost,\n\t\t\t\ttotalCost: cost,\n\t\t\t\tusage: {\n\t\t\t\t\tinput: tokens.input,\n\t\t\t\t\toutput: tokens.output,\n\t\t\t\t\tcacheRead: tokens.cacheRead,\n\t\t\t\t\tcacheWrite: tokens.cacheWrite,\n\t\t\t\t\ttotalTokens: tokens.total,\n\t\t\t\t\tcost: {\n\t\t\t\t\t\tinput: 0,\n\t\t\t\t\t\toutput: 0,\n\t\t\t\t\t\tcacheRead: 0,\n\t\t\t\t\t\tcacheWrite: 0,\n\t\t\t\t\t\ttotal: cost\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\tlet disposePromise;\n\t\tconst dispose = () => disposePromise ??= (async () => {\n\t\t\tfor (const pending of toolBoundaryQueue.splice(0)) pending.reject(/* @__PURE__ */ new Error(\"Direct harness is disposed\"));\n\t\t\tconst failures = [];\n\t\t\tconst attempt = async (cleanup) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait cleanup();\n\t\t\t\t\treturn true;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tfailures.push(error);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (!attached) await attempt(interrupt);\n\t\t\tdisposed = true;\n\t\t\tawait attempt(() => watcher.stop());\n\t\t\tawait attempt(() => eventsSettled);\n\t\t\tif (!attached) {\n\t\t\t\tconst harnessClosed = await attempt(() => harness.close(context));\n\t\t\t\tawait attempt(() => environment.cleanup(context));\n\t\t\t\tif (harnessClosed) await attempt(() => storage.release(context));\n\t\t\t}\n\t\t\tresolveExited(failures.length ? 1 : 0);\n\t\t\tif (failures.length) throw new AggregateError(failures, \"Direct harness cleanup failed\");\n\t\t})();\n\t\tconst recordUsage = async (usage, usageOptions) => {\n\t\t\tconst entryId = await appendEntry({\n\t\t\t\ttype: \"write\",\n\t\t\t\tentry: {\n\t\t\t\t\tkind: \"po.usage\",\n\t\t\t\t\tdata: json({\n\t\t\t\t\t\tusage,\n\t\t\t\t\t\t...usageOptions\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t});\n\t\t\tawait writable(() => harness.commit(async (tx) => {\n\t\t\t\tconst ledger = await tx.doc(UsageDoc, conversation.id);\n\t\t\t\tconst key = \"po/auxiliary\";\n\t\t\t\tconst previous = ledger.models[key];\n\t\t\t\tledger.models[key] = previous ? {\n\t\t\t\t\t...usage,\n\t\t\t\t\tinput: previous.input + usage.input,\n\t\t\t\t\toutput: previous.output + usage.output,\n\t\t\t\t\tcacheRead: previous.cacheRead + usage.cacheRead,\n\t\t\t\t\tcacheWrite: previous.cacheWrite + usage.cacheWrite,\n\t\t\t\t\ttotalTokens: previous.totalTokens + usage.totalTokens,\n\t\t\t\t\tcost: {\n\t\t\t\t\t\tinput: previous.cost.input + usage.cost.input,\n\t\t\t\t\t\toutput: previous.cost.output + usage.cost.output,\n\t\t\t\t\t\tcacheRead: previous.cost.cacheRead + usage.cost.cacheRead,\n\t\t\t\t\t\tcacheWrite: previous.cost.cacheWrite + usage.cost.cacheWrite,\n\t\t\t\t\t\ttotal: previous.cost.total + usage.cost.total\n\t\t\t\t\t}\n\t\t\t\t} : usage;\n\t\t\t}, context));\n\t\t\treturn entryId;\n\t\t};\n\t\tconst removeQueued = async (id) => {\n\t\t\tconst held = await changeRecord((r) => {\n\t\t\t\tif (handingOff.has(id)) return \"in_flight\";\n\t\t\t\tconst index = r.held.findIndex((q) => q.id === id && q.explicitQueue);\n\t\t\t\tif (index === -1) return \"not_held\";\n\t\t\t\tr.held.splice(index, 1);\n\t\t\t\treturn \"removed\";\n\t\t\t});\n\t\t\tif (held === \"in_flight\") return held;\n\t\t\tif (held === \"not_held\") {\n\t\t\t\tconst accepted = await storage.storage.submissionByRequest(conversation.id, heldRequestId(id), context);\n\t\t\t\tif (!accepted) return \"not_found\";\n\t\t\t\treturn accepted.status === \"queued\" ? \"in_flight\" : \"already_consumed\";\n\t\t\t}\n\t\t\tawait publish();\n\t\t\treturn \"removed\";\n\t\t};\n\t\tconst commitCheckpointMessage = async (registration, lane, message, ctx, scopeIsOpen = () => true, taskId) => {\n\t\t\tconst usable = () => registration.active && scopeIsOpen() && !disposed && !quarantined && !external && conversation.id === lane.id && !ctx.abortSignal?.aborted;\n\t\t\tif (!usable()) return;\n\t\t\treturn writable(async () => {\n\t\t\t\tif (!usable()) return;\n\t\t\t\treturn harness.commit(async (tx) => {\n\t\t\t\t\tif (!usable()) return;\n\t\t\t\t\tconst live = await tx.doc(LiveDoc, lane.id);\n\t\t\t\t\tconst inbox = await tx.doc(InboxDoc, lane.id);\n\t\t\t\t\tif (!usable() || live.compactions?.length || inbox.items.some((item) => item.mode !== \"write\") || (taskId === void 0 ? live.run !== void 0 : live.run?.taskId !== taskId)) return;\n\t\t\t\t\tconst entry = await tx.appendEntry(lane.id, {\n\t\t\t\t\t\tkind: \"po.entry\",\n\t\t\t\t\t\tdata: json({\n\t\t\t\t\t\t\ttype: \"message\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\ttimestamp: message.timestamp\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tmodel: convertToLlm([message])\n\t\t\t\t\t});\n\t\t\t\t\treturn String(entry.id);\n\t\t\t\t}, ctx);\n\t\t\t});\n\t\t};\n\t\tconst appendMessage = (message, requestId) => appendEntry({\n\t\t\ttype: \"write\",\n\t\t\t...requestId === void 0 ? {} : { requestId },\n\t\t\tentry: {\n\t\t\t\tkind: \"po.entry\",\n\t\t\t\tdata: json({\n\t\t\t\t\ttype: \"message\",\n\t\t\t\t\tmessage,\n\t\t\t\t\ttimestamp: message.timestamp\n\t\t\t\t}),\n\t\t\t\tmodel: convertToLlm([message])\n\t\t\t}\n\t\t});\n\t\tconst mainOnly = () => {\n\t\t\tif (attached) throw new Error(\"Session state belongs to the main lane.\");\n\t\t};\n\t\treturn {\n\t\t\tsessionId,\n\t\t\tlaneName,\n\t\t\tharnessId: options.harnessId ?? `${sessionId}:${laneName}`,\n\t\t\tsession: harness,\n\t\t\tharness,\n\t\t\tget lane() {\n\t\t\t\treturn conversation;\n\t\t\t},\n\t\t\texited,\n\t\t\tget storageQuarantined() {\n\t\t\t\treturn quarantined;\n\t\t\t},\n\t\t\tcompleteModel: models.complete?.bind(models),\n\t\t\tonPresentationFrame(listener) {\n\t\t\t\tlisteners.add(listener);\n\t\t\t\treturn () => listeners.delete(listener);\n\t\t\t},\n\t\t\tonEvent(listener) {\n\t\t\t\teventListeners.add(listener);\n\t\t\t\treturn () => eventListeners.delete(listener);\n\t\t\t},\n\t\t\tstop() {\n\t\t\t\tdispose().catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t},\n\t\t\treadEntries,\n\t\t\tasync readEntriesFrom(seq) {\n\t\t\t\tconst lane = conversation;\n\t\t\t\tconst minEntryId = nativeId(String(seq));\n\t\t\t\tconst entries = await projectDurableConversationEntries(lane, context, minEntryId);\n\t\t\t\tif (entries.length > 0 && minEntryId > 0) {\n\t\t\t\t\tconst previous = await lane.entries({ maxEntryId: minEntryId - 1 }, 1, void 0, context);\n\t\t\t\t\tconst parentId = previous.items[0] === void 0 ? null : String(previous.items[0].id);\n\t\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\t\tif (entry.seq !== entries[0].seq) break;\n\t\t\t\t\t\tentry.parentId = parentId;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tentries,\n\t\t\t\t\tleafId: entries.at(-1)?.id ?? null\n\t\t\t\t};\n\t\t\t},\n\t\t\tscanEntries: (query, limit, cursor, scanContext) => conversation.entries(query, limit, cursor, scanContext),\n\t\t\treadIdentities: (readContext) => harness.snapshot(IdentityHistoryDoc, conversation.id, readContext),\n\t\t\tasync getContextMessages() {\n\t\t\t\tconst assertReadable = () => {\n\t\t\t\t\tif (disposed || quarantined) throw new Error(\"Direct harness context is unavailable\", { cause: failure });\n\t\t\t\t};\n\t\t\t\tassertReadable();\n\t\t\t\tconst view = await conversation.context(context);\n\t\t\t\tassertReadable();\n\t\t\t\tconst messages = restoreCustomContextMessages(view.messages, view);\n\t\t\t\tassertReadable();\n\t\t\t\treturn structuredClone(messages);\n\t\t\t},\n\t\t\treadLifecycle,\n\t\t\tdispatchCommand,\n\t\t\tlistCommands: () => [...options.listCommands?.() ?? []],\n\t\t\tasync readState() {\n\t\t\t\tconst lifecycle = await readLifecycle();\n\t\t\t\tconst agent = await conversation.agent(context);\n\t\t\t\tconst metadata = await harness.snapshot(SessionMetadataDoc, context);\n\t\t\t\tconst stats = await getSessionStats();\n\t\t\t\tconst inbox = await harness.snapshot(InboxDoc, conversation.id, context);\n\t\t\t\tconst held = (await readRecord()).held.length;\n\t\t\t\tconst nativePending = inbox?.items.filter((item) => item.mode !== \"write\").length ?? 0;\n\t\t\t\treturn json({\n\t\t\t\t\tsessionId,\n\t\t\t\t\tsessionName: metadata?.name,\n\t\t\t\t\tmodel: agent.model ? {\n\t\t\t\t\t\tprovider: agent.model.provider,\n\t\t\t\t\t\tid: agent.model.modelId\n\t\t\t\t\t} : void 0,\n\t\t\t\t\tthinkingLevel: agent.thinkingLevel,\n\t\t\t\t\tisIdle: !await execution() && !admissionBusy(),\n\t\t\t\t\tisStreaming: lifecycle.operation?.kind === \"run\",\n\t\t\t\t\tisCompacting: lifecycle.operation?.kind === \"compaction\",\n\t\t\t\t\toperationId: lifecycle.operation?.id,\n\t\t\t\t\texecutionStatus: lifecycle.operation?.status,\n\t\t\t\t\tfastMode,\n\t\t\t\t\tagentLocked,\n\t\t\t\t\tqueuePaused: lifecycle.paused,\n\t\t\t\t\tqueueRevision: lifecycle.revision,\n\t\t\t\t\tsteeringMode: settings.steeringMode ?? \"one-at-a-time\",\n\t\t\t\t\tfollowUpMode: settings.followUpMode ?? \"one-at-a-time\",\n\t\t\t\t\tautoCompactionEnabled: settings.compaction?.enabled ?? true,\n\t\t\t\t\tmessageCount: stats.messageCount,\n\t\t\t\t\tpendingMessageCount: held + nativePending + nextTurnMessages.length + deferredInternalCount\n\t\t\t\t});\n\t\t\t},\n\t\t\tenqueueAutomatic: async (value, images) => {\n\t\t\t\tassertUnlocked();\n\t\t\t\tconst result = await enqueue(value, images, \"nextRun\", true);\n\t\t\t\tdispatch().catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tremoveQueued,\n\t\t\tasync promoteQueued(id, operationId) {\n\t\t\t\tguardUserAdmission();\n\t\t\t\tassertUnlocked();\n\t\t\t\tif (handingOff.has(id)) return \"in_flight\";\n\t\t\t\tconst result = await admitUser(() => writable(async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn await harness.commit((tx) => admitSelected(tx, conversation.id, {\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\toperationId\n\t\t\t\t\t\t}, settings, false), context);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (await storage.storage.submissionByRequest(conversation.id, heldRequestId(id), context)) return \"promoted\";\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tif (typeof result === \"string\" && result !== \"promoted\") {\n\t\t\t\t\tawait publish();\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tharness.resume();\n\t\t\t\tawait publish();\n\t\t\t\treturn \"promoted\";\n\t\t\t},\n\t\t\tasync resumeQueue() {\n\t\t\t\tguardUserAdmission();\n\t\t\t\tawait changeRecord((r) => {\n\t\t\t\t\tr.paused = false;\n\t\t\t\t\tdelete r.abortOperationId;\n\t\t\t\t});\n\t\t\t\tawait publish();\n\t\t\t\tdispatch().catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t},\n\t\t\trecover,\n\t\t\tasync setFastMode(enabled) {\n\t\t\t\tmainOnly();\n\t\t\t\tif (enabled) {\n\t\t\t\t\tconst selected = (await conversation.agent(context)).model;\n\t\t\t\t\tconst model = selected ? models.getModel(selected.provider, selected.modelId) : void 0;\n\t\t\t\t\tif (model?.api !== CODEX_API || model.provider !== CODEX_PROVIDER) throw new Error(\"Fast mode requires an OpenAI Codex model\");\n\t\t\t\t}\n\t\t\t\tawait writable(() => harness.commit(async (tx) => {\n\t\t\t\t\t(await tx.doc(FastModeDoc)).enabled = enabled;\n\t\t\t\t\tawait tx.appendEntry(conversation.id, {\n\t\t\t\t\t\tkind: \"po.fast-mode\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tversion: 1,\n\t\t\t\t\t\t\tenabled,\n\t\t\t\t\t\t\tsessionId\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, context));\n\t\t\t\tfastMode = enabled;\n\t\t\t\temit({\n\t\t\t\t\ttype: \"fast_mode_changed\",\n\t\t\t\t\tenabled\n\t\t\t\t});\n\t\t\t},\n\t\t\tagentLocked: () => agentLocked,\n\t\t\tasync setAgentLock(locked) {\n\t\t\t\tmainOnly();\n\t\t\t\tif (typeof locked !== \"boolean\") throw new Error(\"Agent lock must be a boolean.\");\n\t\t\t\tawait writable(() => harness.commit(async (tx) => {\n\t\t\t\t\t(await tx.doc(AgentLockDoc)).locked = locked;\n\t\t\t\t}, context));\n\t\t\t\tagentLocked = locked;\n\t\t\t\temit({\n\t\t\t\t\ttype: \"agent_lock_changed\",\n\t\t\t\t\tlocked\n\t\t\t\t});\n\t\t\t\tif (!locked) return;\n\t\t\t\tconst current = await execution();\n\t\t\t\tif (current?.kind === \"run\") await abort(current.id);\n\t\t\t},\n\t\t\tasync setModel(model) {\n\t\t\t\tconst previous = (await conversation.agent(context)).model;\n\t\t\t\tif (!models.getModel(model.provider, model.id)) throw new Error(`Model not found: ${model.provider}/${model.id}`);\n\t\t\t\tawait writable(() => conversation.configure({ model: {\n\t\t\t\t\tprovider: model.provider,\n\t\t\t\t\tmodelId: model.id\n\t\t\t\t} }, context));\n\t\t\t\tawait deliver({\n\t\t\t\t\ttype: \"config_update\",\n\t\t\t\t\tproperty: \"model\",\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tprovider: model.provider,\n\t\t\t\t\t\tmodelId: model.id\n\t\t\t\t\t},\n\t\t\t\t\tprevious\n\t\t\t\t}, context);\n\t\t\t\temit({\n\t\t\t\t\ttype: \"model_select\",\n\t\t\t\t\tmodel\n\t\t\t\t});\n\t\t\t},\n\t\t\tavailableModels: () => models.getAvailable(),\n\t\t\tasync availableThinkingLevels() {\n\t\t\t\tconst agent = await conversation.agent(context);\n\t\t\t\tconst model = agent.model ? models.getModel(agent.model.provider, agent.model.modelId) : void 0;\n\t\t\t\tif (!model) throw new Error(\"No model is selected\");\n\t\t\t\treturn getSupportedThinkingLevels(model);\n\t\t\t},\n\t\t\tasync setThinkingLevel(level) {\n\t\t\t\tawait writable(() => conversation.configure({ thinkingLevel: level }, context));\n\t\t\t\temit({\n\t\t\t\t\ttype: \"thinking_level_changed\",\n\t\t\t\t\tlevel: (await conversation.agent(context)).thinkingLevel\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync setSteeringMode(mode) {\n\t\t\t\tsettings = {\n\t\t\t\t\t...settings,\n\t\t\t\t\tsteeringMode: mode\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync setFollowUpMode(mode) {\n\t\t\t\tsettings = {\n\t\t\t\t\t...settings,\n\t\t\t\t\tfollowUpMode: mode\n\t\t\t\t};\n\t\t\t},\n\t\t\tnavigateTree: (targetId, navigationOptions) => runExternalOperation(async () => {\n\t\t\t\tmainOnly();\n\t\t\t\ttry {\n\t\t\t\t\tconst expected = conversation.id;\n\t\t\t\t\tif (targetId !== null && !await storage.storage.entry(conversation.id, nativeId(targetId), context)) throw new Error(\"Navigation target is not in the selected conversation\");\n\t\t\t\t\tconst oldTip = (await readEntries()).leafId;\n\t\t\t\t\tawait deliver({ type: \"navigation_start\" }, context);\n\t\t\t\t\temit({\n\t\t\t\t\t\ttype: \"navigation_start\",\n\t\t\t\t\t\ttargetId\n\t\t\t\t\t});\n\t\t\t\t\tlet summary = navigationOptions?.summary;\n\t\t\t\t\tif (navigationOptions?.summarize === true && summary === void 0) {\n\t\t\t\t\t\tconst selected = (await conversation.agent(context)).model;\n\t\t\t\t\t\tconst model = selected ? models.getModel(selected.provider, selected.modelId) : void 0;\n\t\t\t\t\t\tif (!model) throw new Error(\"No model is selected for navigation summary\");\n\t\t\t\t\t\tconst instructions = navigationOptions.customInstructions;\n\t\t\t\t\t\tif (instructions !== void 0 && typeof instructions !== \"string\") throw new Error(\"Navigation instructions must be a string\");\n\t\t\t\t\t\tconst base = \"Summarize this conversation for continuing work on another branch. Include decisions, progress, remaining work, and essential context. Return only the summary.\";\n\t\t\t\t\t\tconst messages = [{\n\t\t\t\t\t\t\trole: \"system\",\n\t\t\t\t\t\t\tcontent: navigationOptions.replaceInstructions === true ? instructions ?? base : [base, instructions].filter(Boolean).join(\"\\n\\n\"),\n\t\t\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\t\tcontent: JSON.stringify((await conversation.context(context)).messages),\n\t\t\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t\t\t}];\n\t\t\t\t\t\tawait options.beforeModelRequest?.({\n\t\t\t\t\t\t\tphase: \"request\",\n\t\t\t\t\t\t\tmodel,\n\t\t\t\t\t\t\tprompt: messages,\n\t\t\t\t\t\t\tresources\n\t\t\t\t\t\t}, context);\n\t\t\t\t\t\tconst summaryContext = withAbortSignal(externalAbort.signal, context);\n\t\t\t\t\t\tlet answer;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tanswer = await awaitWithContext(models.complete(model, { messages }, { signal: externalAbort.signal }), summaryContext);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tif (externalAbort?.signal.aborted) {\n\t\t\t\t\t\t\t\tawait deliver({\n\t\t\t\t\t\t\t\t\ttype: \"navigation_end\",\n\t\t\t\t\t\t\t\t\tstatus: \"aborted\",\n\t\t\t\t\t\t\t\t\ttipId: oldTip,\n\t\t\t\t\t\t\t\t\tfromTipId: oldTip\n\t\t\t\t\t\t\t\t}, context);\n\t\t\t\t\t\t\t\temit({\n\t\t\t\t\t\t\t\t\ttype: \"navigation_end\",\n\t\t\t\t\t\t\t\t\tstatus: \"aborted\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tcancelled: true,\n\t\t\t\t\t\t\t\t\tentries: (await readEntries()).entries\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (answer.stopReason === \"error\" || answer.stopReason === \"aborted\") throw new Error(answer.errorMessage ?? \"Navigation summary failed\");\n\t\t\t\t\t\tsummary = text(answer).trim();\n\t\t\t\t\t\tawait recordUsage(answer.usage, { details: { purpose: \"branch_summary\" } });\n\t\t\t\t\t}\n\t\t\t\t\tif (externalAbort?.signal.aborted) {\n\t\t\t\t\t\tawait deliver({\n\t\t\t\t\t\t\ttype: \"navigation_end\",\n\t\t\t\t\t\t\tstatus: \"aborted\",\n\t\t\t\t\t\t\ttipId: oldTip,\n\t\t\t\t\t\t\tfromTipId: oldTip\n\t\t\t\t\t\t}, context);\n\t\t\t\t\t\temit({\n\t\t\t\t\t\t\ttype: \"navigation_end\",\n\t\t\t\t\t\t\tstatus: \"aborted\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcancelled: true,\n\t\t\t\t\t\t\tentries: (await readEntries()).entries\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif (summary !== void 0 && typeof summary !== \"string\") throw new Error(\"Navigation summary must be a string\");\n\t\t\t\t\tconst id = await navigateDurableConversation(harness, expected, targetId === null ? null : nativeId(targetId), context, typeof summary === \"string\" ? { summary: {\n\t\t\t\t\t\tkind: \"po.entry\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\ttype: \"branch_summary\",\n\t\t\t\t\t\t\tsummary,\n\t\t\t\t\t\t\tfromId: targetId,\n\t\t\t\t\t\t\tfromHook: navigationOptions?.summarize !== true\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmodel: [{\n\t\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\t\tcontent: `<branch_summary>\\n${summary}\\n</branch_summary>`,\n\t\t\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t\t\t}]\n\t\t\t\t\t} } : void 0);\n\t\t\t\t\tconst agent = await conversation.agent(context);\n\t\t\t\t\tconversation = await harness.conversation(id, context);\n\t\t\t\t\tstatsCache = void 0;\n\t\t\t\t\tif (targetId === null) await conversation.configure({\n\t\t\t\t\t\tmodel: agent.model,\n\t\t\t\t\t\tthinkingLevel: agent.thinkingLevel,\n\t\t\t\t\t\tcwd: agent.cwd,\n\t\t\t\t\t\ttools: tools.filter((t) => activeNames.has(t.name)).map(nativeTool),\n\t\t\t\t\t\tinstructions: agent.instructions\n\t\t\t\t\t}, context);\n\t\t\t\t\tawait attach();\n\t\t\t\t\tconst result = await readEntries();\n\t\t\t\t\tif (typeof navigationOptions?.label === \"string\" && targetId !== null) await harness.commit(async (tx) => {\n\t\t\t\t\t\t(await tx.doc(LabelsDoc)).labels[targetId] = navigationOptions.label;\n\t\t\t\t\t}, context);\n\t\t\t\t\tfor (const entry of result.entries) if (entry.type === \"branch_summary\") await deliver({\n\t\t\t\t\t\ttype: \"entry_appended\",\n\t\t\t\t\t\tentry\n\t\t\t\t\t}, context);\n\t\t\t\t\tconst event = {\n\t\t\t\t\t\ttype: \"navigation_end\",\n\t\t\t\t\t\tstatus: \"completed\",\n\t\t\t\t\t\ttipId: result.leafId,\n\t\t\t\t\t\tfromTipId: oldTip\n\t\t\t\t\t};\n\t\t\t\t\tawait deliver(event, context);\n\t\t\t\t\temit({ ...event });\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcancelled: false,\n\t\t\t\t\t\tentries: result.entries\n\t\t\t\t\t};\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait deliver({\n\t\t\t\t\t\ttype: \"navigation_end\",\n\t\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\t\ttipId: null,\n\t\t\t\t\t\tfromTipId: null,\n\t\t\t\t\t\terror: error instanceof Error ? error : new Error(String(error))\n\t\t\t\t\t}, context);\n\t\t\t\t\temit({\n\t\t\t\t\t\ttype: \"navigation_end\",\n\t\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t});\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}),\n\t\t\tasync clearQueue() {\n\t\t\t\tconst selected = (await readLifecycle()).queue;\n\t\t\t\tfor (const item of selected) await removeQueued(item.id);\n\t\t\t\tawait publish();\n\t\t\t\treturn {\n\t\t\t\t\tsteering: [],\n\t\t\t\t\tfollowUp: []\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync setName(name) {\n\t\t\t\tmainOnly();\n\t\t\t\tawait writable(() => harness.commit(async (tx) => {\n\t\t\t\t\t(await tx.doc(SessionMetadataDoc)).name = name;\n\t\t\t\t}, context));\n\t\t\t\temit({\n\t\t\t\t\ttype: \"session_info_changed\",\n\t\t\t\t\tname\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync setGroups(groups) {\n\t\t\t\tmainOnly();\n\t\t\t\tawait writable(() => harness.commit(async (tx) => {\n\t\t\t\t\t(await tx.doc(SessionMetadataDoc)).groups = [...groups];\n\t\t\t\t}, context));\n\t\t\t\temit({\n\t\t\t\t\ttype: SESSION_GROUPS_CHANGED_FRAME,\n\t\t\t\t\tgroups: [...groups]\n\t\t\t\t});\n\t\t\t},\n\t\t\tgetSessionStats,\n\t\t\tasync replaceTools(replacement) {\n\t\t\t\ttools = replacement;\n\t\t\t\tactiveNames = new Set(tools.map((t) => t.name));\n\t\t\t\tinstall();\n\t\t\t\tawait writable(() => conversation.configure({ tools: tools.map(nativeTool) }, context));\n\t\t\t},\n\t\t\tasync replaceResources(replacement) {\n\t\t\t\tresources = replacement;\n\t\t\t\tinstall();\n\t\t\t},\n\t\t\tasync readResources() {\n\t\t\t\treturn resources;\n\t\t\t},\n\t\t\trunExternalOperation,\n\t\t\trunAtToolBoundary,\n\t\t\tappendCustomEntry: async (customType, data) => {\n\t\t\t\tconst lane = conversation;\n\t\t\t\treturn String((await writable(() => lane.commit(async (tx) => {\n\t\t\t\t\tconst entry = await tx.appendEntry(lane.id, {\n\t\t\t\t\t\tkind: customType,\n\t\t\t\t\t\t...data === void 0 ? {} : { data: json(data) },\n\t\t\t\t\t\t...options.entryProjectors?.[customType] ? { model: convertToLlm(options.entryProjectors[customType]({\n\t\t\t\t\t\t\ttype: \"custom\",\n\t\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\t\tparentId: null,\n\t\t\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t\t\t\tseq: 0,\n\t\t\t\t\t\t\tcustomType,\n\t\t\t\t\t\t\t...data === void 0 ? {} : { data: json(data) }\n\t\t\t\t\t\t})) } : {}\n\t\t\t\t\t});\n\t\t\t\t\tif (customType === \"po-profile-identity\") {\n\t\t\t\t\t\tconst history = await tx.doc(IdentityHistoryDoc, lane.id);\n\t\t\t\t\t\tconst identity = json(data ?? {});\n\t\t\t\t\t\tif (JSON.stringify(history.items.at(-1)?.data) !== JSON.stringify(identity)) history.items.push({\n\t\t\t\t\t\t\tseq: Number(entry.id),\n\t\t\t\t\t\t\tdata: identity\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn entry;\n\t\t\t\t}, context))).id);\n\t\t\t},\n\t\t\tappendMessage: (message) => appendMessage(message),\n\t\t\tregisterCheckpointBoundary(callback) {\n\t\t\t\tconst registration = {\n\t\t\t\t\tactive: true,\n\t\t\t\t\tcallback\n\t\t\t\t};\n\t\t\t\tcheckpointBoundaries.add(registration);\n\t\t\t\treturn {\n\t\t\t\t\tappendMessage: (message) => commitCheckpointMessage(registration, conversation, message, context),\n\t\t\t\t\tdispose() {\n\t\t\t\t\t\tregistration.active = false;\n\t\t\t\t\t\tcheckpointBoundaries.delete(registration);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\t\t\tsetLabel: (targetId, label) => writable(() => {\n\t\t\t\tmainOnly();\n\t\t\t\treturn harness.commit(async (tx) => {\n\t\t\t\t\tconst labels = (await tx.doc(LabelsDoc)).labels;\n\t\t\t\t\tif (label === void 0) delete labels[targetId];\n\t\t\t\t\telse labels[targetId] = label;\n\t\t\t\t}, context);\n\t\t\t}),\n\t\t\trecordUsage,\n\t\t\tsubmitPrompt: admit,\n\t\t\tsubmitUserPrompt,\n\t\t\tprompt: async (value, images) => {\n\t\t\t\tawait (await admit(value, images)).settled;\n\t\t\t},\n\t\t\tadmitMessage: (message) => admit(message),\n\t\t\tsubmitInternalMessage: async function submitInternalMessage(message, delivery = \"steer\", requestId = randomUUID()) {\n\t\t\t\tif (typeof message !== \"string\" && message.role !== \"user\" && message.role !== \"custom\") throw new Error(\"Internal input must be user or custom message content\");\n\t\t\t\tif (delivery === \"nextTurn\") {\n\t\t\t\t\tnextTurnMessages.push(typeof message === \"string\" ? {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: message,\n\t\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t\t} : message);\n\t\t\t\t\treturn { settled: Promise.resolve() };\n\t\t\t\t}\n\t\t\t\tconst preserved = typeof message === \"string\" ? {\n\t\t\t\t\trole: \"user\",\n\t\t\t\t\tcontent: message,\n\t\t\t\t\ttimestamp: Date.now()\n\t\t\t\t} : message;\n\t\t\t\tif (agentLocked) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait appendMessage(preserved, requestId);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (!await storage.storage.submissionByRequest(conversation.id, requestId, context)) throw error;\n\t\t\t\t\t}\n\t\t\t\t\treturn { settled: Promise.resolve() };\n\t\t\t\t}\n\t\t\t\tconst deliveryRecord = {\n\t\t\t\t\tmessage: preserved,\n\t\t\t\t\tconversationId: conversation.id\n\t\t\t\t};\n\t\t\t\tif (userAdmission) {\n\t\t\t\t\tdeferredInternalCount++;\n\t\t\t\t\tadmittingInternal.add(requestId);\n\t\t\t\t\tinternalDeliveries.set(requestId, deliveryRecord);\n\t\t\t\t\tconst admission = userAdmissionSettled.then(() => {\n\t\t\t\t\t\tdeferredInternalCount--;\n\t\t\t\t\t\tadmittingInternal.delete(requestId);\n\t\t\t\t\t\treturn submitInternalMessage(preserved, delivery, requestId);\n\t\t\t\t\t});\n\t\t\t\t\tconst settled = admission.then((submission) => submission.settled);\n\t\t\t\t\tsettled.catch((error) => emit({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\tcode: \"internal_message\",\n\t\t\t\t\t\terror: String(error)\n\t\t\t\t\t}));\n\t\t\t\t\tconst admitted = admission.then((submission) => submission.admitted);\n\t\t\t\t\tadmitted.catch(() => void 0);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsettled,\n\t\t\t\t\t\tadmitted\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (external) throw new Error(\"An operation is already running\");\n\t\t\t\tconst content = typeof message === \"string\" ? message : message.content;\n\t\t\t\tadmittingInternal.add(requestId);\n\t\t\t\tlet submission;\n\t\t\t\ttry {\n\t\t\t\t\tinternalDeliveries.set(requestId, deliveryRecord);\n\t\t\t\t\tsubmission = await submitInput({\n\t\t\t\t\t\ttype: \"input\",\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\twhenBusy: delivery,\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\t...preserved.role === \"custom\" ? { entry: {\n\t\t\t\t\t\t\tkind: \"po.entry\",\n\t\t\t\t\t\t\tdata: json({\n\t\t\t\t\t\t\t\ttype: \"message\",\n\t\t\t\t\t\t\t\tmessage: preserved,\n\t\t\t\t\t\t\t\ttimestamp: preserved.timestamp\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} } : {}\n\t\t\t\t\t});\n\t\t\t\t} finally {\n\t\t\t\t\tadmittingInternal.delete(requestId);\n\t\t\t\t}\n\t\t\t\tlet pendingDelivery = internalDelivery.get(submission.id);\n\t\t\t\tif (!pendingDelivery) {\n\t\t\t\t\tlet resolveDelivery;\n\t\t\t\t\tpendingDelivery = {\n\t\t\t\t\t\tdone: new Promise((resolve) => {\n\t\t\t\t\t\t\tresolveDelivery = resolve;\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tresolve: resolveDelivery\n\t\t\t\t\t};\n\t\t\t\t\tinternalDelivery.set(submission.id, pendingDelivery);\n\t\t\t\t}\n\t\t\t\tif (deliveredInputs.has(submission.id)) pendingDelivery.resolve();\n\t\t\t\tconst delivered = pendingDelivery.done;\n\t\t\t\tconst settled = (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst status = await submission.wait(context);\n\t\t\t\t\t\tif (status.status === \"unanswered\" && status.entry === void 0) {\n\t\t\t\t\t\t\tawait conversation.waitForIdle(context);\n\t\t\t\t\t\t\tawait reconcileInternal(requestId, deliveryRecord);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (status.status === \"done\" || status.entry !== void 0) {\n\t\t\t\t\t\t\tif (!(await harness.snapshot(LiveDoc, deliveryRecord.conversationId, context))?.run?.inputs.some((id) => String(id) === String(submission.id))) pendingDelivery.resolve();\n\t\t\t\t\t\t\tawait delivered;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait eventsSettled;\n\t\t\t\t\t\tawait reconcileInternal(requestId, deliveryRecord);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tinternalDelivery.delete(submission.id);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\tsettled.catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tcode: \"internal_message\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t\treturn { settled };\n\t\t\t},\n\t\t\tsteer: async (message, images) => {\n\t\t\t\tif (typeof message !== \"string\" && message.role !== \"user\") throw new Error(\"Only user messages can steer an agent run\");\n\t\t\t\tawait submitUserPrompt(message, images, \"steer\");\n\t\t\t},\n\t\t\tfollowUp: (message, images) => queued(message, images, \"followUp\"),\n\t\t\tnextRun: (message, images) => queued(message, images, \"nextRun\"),\n\t\t\tabort,\n\t\t\tinterrupt,\n\t\t\tasync compact(instructions) {\n\t\t\t\tif (attached) throw new Error(\"Manual compaction runs on the main lane only.\");\n\t\t\t\tguardUserAdmission();\n\t\t\t\tif (external || compactionAdmission) throw new Error(\"An operation is already running\");\n\t\t\t\tcompactionAdmission = true;\n\t\t\t\tconst previous = settings;\n\t\t\t\ttry {\n\t\t\t\t\tif (await execution()) throw new Error(\"An operation is already running\");\n\t\t\t\t\tsettings = {\n\t\t\t\t\t\t...settings,\n\t\t\t\t\t\tcompaction: {\n\t\t\t\t\t\t\t...settings.compaction,\n\t\t\t\t\t\t\tkeepRecentTokens: 0\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tmanualCompaction.conversationId = String(conversation.id);\n\t\t\t\t\tconst task = await writable(() => conversation.compact(instructions, context));\n\t\t\t\t\tconst receipt = await harness.waitForTask(task, context);\n\t\t\t\t\tawait eventsSettled;\n\t\t\t\t\tconst outcome = receipt.state.outcome;\n\t\t\t\t\tif (outcome.status === \"failed\" || outcome.status === \"faulted\" || outcome.status === \"orphaned\") {\n\t\t\t\t\t\tconst reason = outcome.status === \"orphaned\" ? outcome.reason : outcome.error.message;\n\t\t\t\t\t\tthrow new Error(`Compaction failed: ${reason.trim() || outcome.status}`, { cause: outcome });\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tsettings = previous;\n\t\t\t\t\tdelete manualCompaction.conversationId;\n\t\t\t\t\tcompactionAdmission = false;\n\t\t\t\t\tif (!await nativeExecution()) await flushToolBoundary();\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync admitResume() {\n\t\t\t\tawait recover();\n\t\t\t\tconst resumed = !!await execution();\n\t\t\t\tharness.resume();\n\t\t\t\tconst settled = (async () => {\n\t\t\t\t\tawait conversation.waitForIdle(context);\n\t\t\t\t\tawait eventsSettled;\n\t\t\t\t\tawait dispatch();\n\t\t\t\t})();\n\t\t\t\tsettled.catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tcode: \"resume\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t\treturn {\n\t\t\t\t\tresumed,\n\t\t\t\t\tsettled\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync resume() {\n\t\t\t\tawait recover();\n\t\t\t\tconst resumed = !!await execution();\n\t\t\t\tharness.resume();\n\t\t\t\tif (resumed) {\n\t\t\t\t\tawait conversation.waitForIdle(context);\n\t\t\t\t\tawait eventsSettled;\n\t\t\t\t}\n\t\t\t\tdispatch().catch((error) => emit({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terror: String(error)\n\t\t\t\t}));\n\t\t\t\treturn resumed;\n\t\t\t},\n\t\t\topenLane(laneConversation, laneOptions) {\n\t\t\t\tif (attached) return Promise.reject(/* @__PURE__ */ new Error(\"Lanes open on the main lane.\"));\n\t\t\t\treturn createLaneRuntime({\n\t\t\t\t\t...options.onFullHistoryRead ? { onFullHistoryRead: options.onFullHistoryRead } : {},\n\t\t\t\t\t...laneOptions,\n\t\t\t\t\tplatform,\n\t\t\t\t\tmodels: sourceModels\n\t\t\t\t}, {\n\t\t\t\t\tharness,\n\t\t\t\t\tstorage,\n\t\t\t\t\tregistry,\n\t\t\t\t\tconversation: laneConversation,\n\t\t\t\t\tlaneProviderSessions,\n\t\t\t\t\tmanualCompaction\n\t\t\t\t});\n\t\t\t},\n\t\t\tcloseLane(conversationId) {\n\t\t\t\tif (attached) throw new Error(\"Lanes close on the main lane.\");\n\t\t\t\tregistry.uninstall({ name: laneExtensionName(conversationId) });\n\t\t\t},\n\t\t\tdispose\n\t\t};\n\t} catch (error) {\n\t\tif (attached) throw error;\n\t\tconst failures = [error];\n\t\ttry {\n\t\t\tif (startupHarness) await startupHarness.close(context);\n\t\t\telse await storage.storage.close(context);\n\t\t} catch (closeError) {\n\t\t\tfailures.push(closeError);\n\t\t}\n\t\tif (failures.length === 1) try {\n\t\t\tawait storage.release(context);\n\t\t} catch (closeError) {\n\t\t\tfailures.push(closeError);\n\t\t}\n\t\tif (failures.length > 1) throw new AggregateError(failures, \"Direct harness startup and cleanup failed\");\n\t\tthrow error;\n\t}\n}\n//#endregion\nexport { createDirectHarnessRuntime, projectDurableConversationEntries, promptForAssistantText };\n\n//# sourceMappingURL=directHarnessRuntime.mjs.map","import { CHATGPT_SIGN_IN_HINT, chatgptCredentials, readBoundedJson } from \"../chatgptAuth/index.mjs\";\n//#region src/services/chatgptImages/index.ts\nconst BASE_URL = \"https://chatgpt.com/backend-api/codex/images/\";\nconst MAX_IMAGE_BYTES = 33554432;\nconst MAX_REFERENCE_BYTES = 20971520;\nconst MAX_REFERENCES_BYTES = 52428800;\nconst MAX_RESPONSE_BYTES = Math.ceil(MAX_IMAGE_BYTES * 4 / 3) + 1048576;\nconst LOGIN_MESSAGE = `Image generation needs a ChatGPT sign-in. ${CHATGPT_SIGN_IN_HINT}`;\nconst INVALID_RESPONSE = \"Image generation returned an invalid image.\";\nconst PNG_SIGNATURE = Buffer.from([\n\t137,\n\t80,\n\t78,\n\t71,\n\t13,\n\t10,\n\t26,\n\t10\n]);\nfunction record(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction decodeImage(data, limit) {\n\tif (!data || data.length > Math.ceil(limit * 4 / 3) + 4 || !/^[A-Za-z0-9+/]*={0,2}$/.test(data)) throw new Error(INVALID_RESPONSE);\n\tconst bytes = Buffer.from(data, \"base64\");\n\tif (bytes.length > limit || bytes.toString(\"base64\") !== data) throw new Error(INVALID_RESPONSE);\n\treturn bytes;\n}\nfunction matchesMime(bytes, mimeType) {\n\tif (mimeType === \"image/png\") return bytes.subarray(0, 8).equals(PNG_SIGNATURE);\n\tif (mimeType === \"image/jpeg\") return bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255;\n\treturn mimeType === \"image/webp\" && bytes.toString(\"ascii\", 0, 4) === \"RIFF\" && bytes.toString(\"ascii\", 8, 12) === \"WEBP\";\n}\n/** Host-only transport: authentication never crosses the package boundary. */\nfunction createChatgptImageClient(dependencies) {\n\treturn {\n\t\tavailable: () => dependencies.available(),\n\t\tasync generate(request) {\n\t\t\trequest.signal?.throwIfAborted();\n\t\t\tif (typeof request.prompt !== \"string\" || !request.prompt.trim()) throw new Error(\"An image prompt is required.\");\n\t\t\tif (request.transparentBackground !== void 0 && typeof request.transparentBackground !== \"boolean\") throw new Error(\"Invalid transparency option.\");\n\t\t\tif (typeof request.correlationId !== \"string\" || !/^[\\x21-\\x7e]{1,1024}$/.test(request.correlationId)) throw new Error(\"Invalid image operation identifier.\");\n\t\t\tif (request.images !== void 0 && (!Array.isArray(request.images) || request.images.length > 5)) throw new Error(\"At most five reference images are supported.\");\n\t\t\tlet total = 0;\n\t\t\tfor (const image of request.images ?? []) {\n\t\t\t\tif (!record(image) || typeof image.data !== \"string\" || typeof image.mimeType !== \"string\") throw new Error(\"Invalid reference image.\");\n\t\t\t\tconst bytes = decodeImage(image.data, MAX_REFERENCE_BYTES);\n\t\t\t\ttotal += bytes.length;\n\t\t\t\tif (total > MAX_REFERENCES_BYTES || !matchesMime(bytes, image.mimeType)) throw new Error(\"Invalid or oversized reference image.\");\n\t\t\t}\n\t\t\tconst { token, accountId: id } = await chatgptCredentials(dependencies, LOGIN_MESSAGE, request.signal);\n\t\t\tlet response;\n\t\t\ttry {\n\t\t\t\tresponse = await (dependencies.fetch ?? globalThis.fetch)(BASE_URL + (request.images?.length ? \"edits\" : \"generations\"), {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tredirect: \"error\",\n\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\tAuthorization: `Bearer ${token}`,\n\t\t\t\t\t\t\"chatgpt-account-id\": id,\n\t\t\t\t\t\toriginator: \"po_image_gen\",\n\t\t\t\t\t\t\"User-Agent\": \"@agimon-ai/po-image-gen\",\n\t\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\t\t\"x-codex-image-turn-id\": request.correlationId\n\t\t\t\t\t},\n\t\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\t\tprompt: request.prompt,\n\t\t\t\t\t\tbackground: request.transparentBackground ? \"transparent\" : \"opaque\",\n\t\t\t\t\t\tmodel: \"gpt-image-2\",\n\t\t\t\t\t\tquality: \"auto\",\n\t\t\t\t\t\tsize: \"auto\",\n\t\t\t\t\t\t...request.images?.length ? { images: request.images.map((image) => ({ image_url: `data:${image.mimeType};base64,${image.data}` })) } : {}\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\trequest.signal?.throwIfAborted();\n\t\t\t\tthrow new Error(\"Image generation request failed.\");\n\t\t\t}\n\t\t\tif (!response.ok) {\n\t\t\t\tawait response.body?.cancel().catch(() => void 0);\n\t\t\t\tif (response.status === 401) throw new Error(LOGIN_MESSAGE);\n\t\t\t\tif (response.status === 403) throw new Error(\"Image generation was denied for this account.\");\n\t\t\t\tif (response.status === 429) {\n\t\t\t\t\tconst reset = response.headers.get(\"x-image-gen-primary-reset-at\");\n\t\t\t\t\tthrow new Error(`Image generation quota reached.${reset && /^\\d{1,12}$/.test(reset) ? ` Reset time: ${reset}.` : \"\"}`);\n\t\t\t\t}\n\t\t\t\tthrow new Error(\"Image generation request failed.\");\n\t\t\t}\n\t\t\tlet body;\n\t\t\ttry {\n\t\t\t\tbody = await readBoundedJson(response, MAX_RESPONSE_BYTES, request.signal);\n\t\t\t} catch {\n\t\t\t\trequest.signal?.throwIfAborted();\n\t\t\t\tthrow new Error(INVALID_RESPONSE);\n\t\t\t}\n\t\t\tconst first = record(body) && Array.isArray(body.data) ? body.data[0] : void 0;\n\t\t\tif (!record(first) || typeof first.b64_json !== \"string\") throw new Error(INVALID_RESPONSE);\n\t\t\tif (!matchesMime(decodeImage(first.b64_json, MAX_IMAGE_BYTES), \"image/png\")) throw new Error(INVALID_RESPONSE);\n\t\t\tconst requestId = response.headers.get(\"x-codex-imagegen-request-id\");\n\t\t\tconst generationId = first.generation_id;\n\t\t\treturn {\n\t\t\t\tdata: first.b64_json,\n\t\t\t\tmimeType: \"image/png\",\n\t\t\t\t...requestId && /^[A-Za-z0-9_-]{1,256}$/.test(requestId) ? { requestId } : {},\n\t\t\t\t...typeof generationId === \"string\" && /^[A-Za-z0-9_-]{1,256}$/.test(generationId) ? { generationId } : {}\n\t\t\t};\n\t\t}\n\t};\n}\n//#endregion\nexport { createChatgptImageClient };\n\n//# sourceMappingURL=index.mjs.map","import { CHATGPT_SIGN_IN_HINT, chatgptCredentials, readBoundedJson } from \"../chatgptAuth/index.mjs\";\n//#region src/services/chatgptWebSearch/index.ts\nconst ENDPOINT = \"https://chatgpt.com/backend-api/codex/alpha/search\";\nconst MAX_OUTPUT_TOKENS = 1e4;\nconst MAX_COMMANDS_BYTES = 65536;\nconst MAX_CONVERSATION_BYTES = 262144;\nconst MAX_CONVERSATION_ITEMS = 16;\nconst MAX_RESPONSE_BYTES = 4194304;\nconst MAX_RESULTS = 100;\nconst LOGIN_MESSAGE = `Web search needs a ChatGPT sign-in. ${CHATGPT_SIGN_IN_HINT}`;\nconst INVALID_RESPONSE = \"Web search returned an invalid response.\";\nconst FAILED = \"Web search request failed.\";\nconst ACCESS = {\n\tcached: false,\n\tindexed: \"indexed\",\n\tlive: true\n};\nconst DEFAULT_MODEL = \"gpt-6.1-sol\";\nfunction record(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** Detaches caller data into plain JSON so the wire body is exactly what was validated. */\nfunction boundedJson(value, limit, message) {\n\tlet json;\n\ttry {\n\t\tjson = JSON.stringify(value);\n\t} catch {\n\t\tthrow new Error(message);\n\t}\n\tif (json === void 0 || Buffer.byteLength(json) > limit) throw new Error(message);\n\treturn JSON.parse(json);\n}\nfunction conversationInput(conversation) {\n\tif (conversation === void 0) return void 0;\n\tconst message = \"Invalid web search conversation.\";\n\tif (!Array.isArray(conversation) || conversation.length > MAX_CONVERSATION_ITEMS) throw new Error(message);\n\tconst items = boundedJson(conversation, MAX_CONVERSATION_BYTES, message);\n\tif (items.length === 0) return void 0;\n\treturn items.map((item) => {\n\t\tif (!record(item) || item.role !== \"user\" && item.role !== \"assistant\" || typeof item.text !== \"string\" || !item.text) throw new Error(message);\n\t\treturn {\n\t\t\ttype: \"message\",\n\t\t\trole: item.role,\n\t\t\tcontent: [{\n\t\t\t\ttype: item.role === \"user\" ? \"input_text\" : \"output_text\",\n\t\t\t\ttext: item.text\n\t\t\t}]\n\t\t};\n\t});\n}\n/** Host-only transport: authentication never crosses the package boundary. */\nfunction createChatgptWebSearchClient(dependencies) {\n\treturn { async search(request) {\n\t\tconst { signal } = request;\n\t\tsignal?.throwIfAborted();\n\t\tif (!record(request.commands) || Object.keys(request.commands).length === 0) throw new Error(\"Invalid web search commands.\");\n\t\tconst commands = boundedJson(request.commands, MAX_COMMANDS_BYTES, \"Invalid web search commands.\");\n\t\tconst input = conversationInput(request.conversation);\n\t\tif (!Object.hasOwn(ACCESS, request.access)) throw new Error(\"Invalid web search access mode.\");\n\t\tconst model = request.model ?? DEFAULT_MODEL;\n\t\tif (typeof model !== \"string\" || !/^[A-Za-z0-9._:-]{1,128}$/.test(model)) throw new Error(\"Invalid web search model.\");\n\t\tif (typeof request.sessionId !== \"string\" || !/^[\\x21-\\x7e]{1,256}$/.test(request.sessionId)) throw new Error(\"Invalid web search session.\");\n\t\tconst { token, accountId } = await chatgptCredentials(dependencies, LOGIN_MESSAGE, signal);\n\t\tlet response;\n\t\ttry {\n\t\t\tresponse = await (dependencies.fetch ?? globalThis.fetch)(ENDPOINT, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tredirect: \"error\",\n\t\t\t\tsignal,\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`,\n\t\t\t\t\t\"chatgpt-account-id\": accountId,\n\t\t\t\t\toriginator: \"po_web_search\",\n\t\t\t\t\t\"User-Agent\": \"@agimon-ai/po-web-search\",\n\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\tAccept: \"application/json\"\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tid: request.sessionId,\n\t\t\t\t\tmodel,\n\t\t\t\t\t...input ? { input } : {},\n\t\t\t\t\tcommands,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tallowed_callers: [\"direct\"],\n\t\t\t\t\t\texternal_web_access: ACCESS[request.access]\n\t\t\t\t\t},\n\t\t\t\t\tmax_output_tokens: MAX_OUTPUT_TOKENS\n\t\t\t\t})\n\t\t\t});\n\t\t} catch {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tthrow new Error(FAILED);\n\t\t}\n\t\tif (!response.ok) {\n\t\t\tawait response.body?.cancel().catch(() => void 0);\n\t\t\tif (response.status === 401) throw new Error(LOGIN_MESSAGE);\n\t\t\tif (response.status === 403) throw new Error(\"Web search is not available for this ChatGPT account.\");\n\t\t\tif (response.status === 429) {\n\t\t\t\tconst retry = response.headers.get(\"retry-after\");\n\t\t\t\tthrow new Error(`Web search quota reached.${retry && /^\\d{1,6}$/.test(retry) ? ` Try again in ${retry} seconds.` : \"\"}`);\n\t\t\t}\n\t\t\tthrow new Error(`Web search request failed (HTTP ${response.status}).`);\n\t\t}\n\t\tlet body;\n\t\ttry {\n\t\t\tbody = await readBoundedJson(response, MAX_RESPONSE_BYTES, signal);\n\t\t} catch {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tthrow new Error(INVALID_RESPONSE);\n\t\t}\n\t\tif (!record(body) || typeof body.output !== \"string\") throw new Error(INVALID_RESPONSE);\n\t\tconst output = body.output.trim() ? body.output : \"Web search returned no results.\";\n\t\tconst results = Array.isArray(body.results) && body.results.length <= MAX_RESULTS && body.results.every(record) ? body.results : void 0;\n\t\treturn results ? {\n\t\t\toutput,\n\t\t\tresults\n\t\t} : { output };\n\t} };\n}\n//#endregion\nexport { createChatgptWebSearchClient };\n\n//# sourceMappingURL=index.mjs.map","import { tokensForTool } from \"./src/services/toolCost/index.mjs\";\n//#region src/services/contextDetail/index.ts\nconst CORE_OWNER = \"pi\";\n/** The same join the projection makes, so a row and its detail agree on the owner. */\nfunction ownerOf(source) {\n\tif (source.kind === \"extension\") return source.packageName ?? source.key;\n\tif (source.kind === \"mcp\") return source.key.slice(4);\n\treturn CORE_OWNER;\n}\nfunction skillSource(group) {\n\tif (group === \"plugins\") return \"plugin\";\n\tif (group === \"extensions\") return \"extension\";\n\treturn \"core\";\n}\nfunction buildContextDetail(input) {\n\tconst items = [];\n\tfor (const source of input.sources) {\n\t\tconst owner = ownerOf(source);\n\t\tfor (const tool of source.tools) {\n\t\t\tconst cost = tokensForTool(tool, input.countTokens);\n\t\t\tconst detail = {\n\t\t\t\titemKind: \"tool\",\n\t\t\t\tname: tool.name,\n\t\t\t\towner,\n\t\t\t\tsource: source.kind === \"core\" ? \"core\" : source.kind,\n\t\t\t\tactive: tool.active,\n\t\t\t\ttokens: {\n\t\t\t\t\tschemaTokens: cost.schemaTokens,\n\t\t\t\t\tpromptTokens: cost.promptTokens,\n\t\t\t\t\ttotalTokens: cost.totalTokens\n\t\t\t\t},\n\t\t\t\t...tool.description ? { description: tool.description } : {},\n\t\t\t\t...tool.promptSnippet ? { promptSnippet: tool.promptSnippet } : {},\n\t\t\t\t...tool.promptGuidelines?.length ? { promptGuidelines: tool.promptGuidelines } : {},\n\t\t\t\t...tool.parameters === void 0 ? {} : { parameters: tool.parameters }\n\t\t\t};\n\t\t\titems.push(detail);\n\t\t}\n\t}\n\tfor (const skill of input.skills) items.push({\n\t\titemKind: \"skill\",\n\t\tname: skill.name,\n\t\towner: skill.owner,\n\t\tsource: skillSource(skill.group),\n\t\tactive: true,\n\t\ttokens: skill.promptTokens ?? 0,\n\t\tdescription: skill.description,\n\t\t...skill.filePath === void 0 ? {} : { filePath: skill.filePath },\n\t\t...skill.body === void 0 ? {} : { body: skill.body },\n\t\tmodelInvocable: skill.modelInvocable\n\t});\n\tif (input.systemPrompt !== void 0) items.push({\n\t\titemKind: \"prompt\",\n\t\tname: \"system\",\n\t\ttokens: input.systemPrompt.tokens,\n\t\tstage: input.systemPrompt.stage,\n\t\ttext: input.systemPrompt.text\n\t});\n\treturn items;\n}\n//#endregion\nexport { buildContextDetail };\n\n//# sourceMappingURL=contextDetail.mjs.map","import { PO_NOTIFICATION_ENTRY_TYPE, createPoNotificationEntryData } from \"../../schemas/notification.mjs\";\nimport \"../../../notification.mjs\";\nimport { randomUUID } from \"node:crypto\";\n//#region src/services/headlessClient/index.ts\n/** Explicit client interactions over the existing browser dialog protocol. */\nfunction createHeadlessClient(options) {\n\tconst pending = /* @__PURE__ */ new Map();\n\tconst statuses = /* @__PURE__ */ new Map();\n\tlet disposed = false;\n\tconst advance = () => pending.values().next().value?.start();\n\treturn {\n\t\tclient: {\n\t\t\tasync notify(request) {\n\t\t\t\tif (disposed) return;\n\t\t\t\tconst data = createPoNotificationEntryData(request);\n\t\t\t\tif (!data) throw new Error(\"Invalid notification request\");\n\t\t\t\ttry {\n\t\t\t\t\tawait options.appendCustomEntry(PO_NOTIFICATION_ENTRY_TYPE, data);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (disposed) return;\n\t\t\t\t\toptions.emitFrame({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\tcode: \"notification_undelivered\",\n\t\t\t\t\t\terror: `${data.body} (not saved to history: ${error instanceof Error ? error.message : String(error)})`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\tsetStatus(source, text) {\n\t\t\t\tif (disposed) return;\n\t\t\t\tstatuses.set(source, text);\n\t\t\t\toptions.emitFrame({\n\t\t\t\t\ttype: \"extension_ui_request\",\n\t\t\t\t\tmethod: \"setStatus\",\n\t\t\t\t\tstatusKey: source,\n\t\t\t\t\tstatusText: text\n\t\t\t\t});\n\t\t\t},\n\t\t\tappendComposerText(text) {\n\t\t\t\tif (disposed) throw new Error(\"Headless client is closed\");\n\t\t\t\toptions.emitFrame({\n\t\t\t\t\ttype: \"extension_ui_request\",\n\t\t\t\t\tmethod: \"append_composer_text\",\n\t\t\t\t\tid: randomUUID(),\n\t\t\t\t\ttext\n\t\t\t\t});\n\t\t\t},\n\t\t\tpendingFeedback() {\n\t\t\t\treturn pending.values().next().value?.feedback();\n\t\t\t},\n\t\t\tanswerFeedback(id, value) {\n\t\t\t\tconst current = pending.values().next().value;\n\t\t\t\tif (current?.feedback()?.id !== id) return false;\n\t\t\t\tcurrent.respond({ value });\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\trequest(request, signal) {\n\t\t\t\tif (disposed) return Promise.reject(/* @__PURE__ */ new Error(\"Headless client is closed\"));\n\t\t\t\tif (signal?.aborted) return Promise.resolve(void 0);\n\t\t\t\tif (![\n\t\t\t\t\t\"confirm\",\n\t\t\t\t\t\"select\",\n\t\t\t\t\t\"input\"\n\t\t\t\t].includes(request.kind)) return Promise.reject(/* @__PURE__ */ new Error(\"Unsupported headless client request\"));\n\t\t\t\tconst labels = request.options?.map((option) => option.label);\n\t\t\t\tif (labels && new Set(labels).size !== labels.length) return Promise.reject(/* @__PURE__ */ new Error(\"Select option labels must be unique\"));\n\t\t\t\tconst id = `headless-ui:${randomUUID()}`;\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\tlet started = false;\n\t\t\t\t\tconst finish = (outcome) => {\n\t\t\t\t\t\tif (!pending.delete(id)) return;\n\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", abort);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (started) options.emitFrame({\n\t\t\t\t\t\t\t\ttype: \"extension_ui_answered\",\n\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (\"error\" in outcome) reject(outcome.error);\n\t\t\t\t\t\t\telse resolve(outcome.value);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tadvance();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tconst abort = () => finish({ value: void 0 });\n\t\t\t\t\tconst frame = {\n\t\t\t\t\t\ttype: \"extension_ui_request\",\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tmethod: request.kind === \"input\" && request.multiline ? \"editor\" : request.kind,\n\t\t\t\t\t\ttitle: request.title,\n\t\t\t\t\t\tmessage: request.message,\n\t\t\t\t\t\tpurpose: request.purpose,\n\t\t\t\t\t\toptions: labels,\n\t\t\t\t\t\tplaceholder: request.message,\n\t\t\t\t\t\tprefill: request.initialValue\n\t\t\t\t\t};\n\t\t\t\t\tpending.set(id, {\n\t\t\t\t\t\tfeedback() {\n\t\t\t\t\t\t\tif (!started || request.purpose !== \"feedback\" || request.kind === \"confirm\") return void 0;\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tkind: request.kind,\n\t\t\t\t\t\t\t\ttitle: request.title,\n\t\t\t\t\t\t\t\t...request.message === void 0 ? {} : { message: request.message },\n\t\t\t\t\t\t\t\t...labels === void 0 ? {} : { labels: [...labels] }\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisStarted: () => started,\n\t\t\t\t\t\treplay(listener) {\n\t\t\t\t\t\t\tif (started) listener(frame);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstart() {\n\t\t\t\t\t\t\tif (started || disposed) return;\n\t\t\t\t\t\t\tstarted = true;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\toptions.emitFrame(frame);\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tfinish({ error });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\trespond(frame) {\n\t\t\t\t\t\t\tif (!started) return;\n\t\t\t\t\t\t\tif (frame.cancelled === true) return finish({ value: void 0 });\n\t\t\t\t\t\t\tif (request.kind === \"confirm\") {\n\t\t\t\t\t\t\t\tif (typeof frame.confirmed === \"boolean\") finish({ value: frame.confirmed });\n\t\t\t\t\t\t\t} else if (typeof frame.value === \"string\") {\n\t\t\t\t\t\t\t\tconst selected = request.options?.find((option) => option.label === frame.value);\n\t\t\t\t\t\t\t\tfinish({ value: selected?.value ?? frame.value });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclose: () => finish({ error: /* @__PURE__ */ new Error(\"Headless client is closed\") })\n\t\t\t\t\t});\n\t\t\t\t\tsignal?.addEventListener(\"abort\", abort, { once: true });\n\t\t\t\t\tadvance();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\treceive(frame) {\n\t\t\tif (frame.type !== \"extension_ui_response\") return false;\n\t\t\tconst current = typeof frame.id === \"string\" ? pending.get(frame.id) : void 0;\n\t\t\tif (!current?.isStarted()) return false;\n\t\t\tcurrent.respond(frame);\n\t\t\treturn true;\n\t\t},\n\t\treplay(listener) {\n\t\t\tfor (const [statusKey, statusText] of statuses) listener({\n\t\t\t\ttype: \"extension_ui_request\",\n\t\t\t\tmethod: \"setStatus\",\n\t\t\t\tstatusKey,\n\t\t\t\tstatusText\n\t\t\t});\n\t\t\tpending.values().next().value?.replay(listener);\n\t\t},\n\t\tdispose() {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tstatuses.clear();\n\t\t\tfor (const request of pending.values()) request.close();\n\t\t}\n\t};\n}\n//#endregion\nexport { createHeadlessClient };\n\n//# sourceMappingURL=index.mjs.map","import { modelConfigDirectory, modelSettingsDirectory } from \"../piSettings/sync.mjs\";\nimport \"../../../runtimePiSettings.mjs\";\nimport { registerChatgptAuthProvider } from \"../chatgptLogin/index.mjs\";\nimport { PoSessionSetupError } from \"../../schemas/headless.mjs\";\nimport { createPiExtensionHost, preloadPiExtensions, resolvePiSettingsPackageEntries } from \"../piExtensionHost/index.mjs\";\nimport path from \"node:path\";\nimport { ModelRuntime, SettingsManager, getAgentDir, loadProjectContextFiles, resolveCliModel, resolveModelScopeWithDiagnostics } from \"@earendil-works/pi-coding-agent\";\n//#region src/services/nodeModelDependencies/index.ts\nasync function resolveModel(parsed, modelRuntime, settings, overrides) {\n\tconst cli = resolveCliModel({\n\t\tcliProvider: parsed.provider,\n\t\tcliModel: parsed.model,\n\t\tcliThinking: parsed.thinking,\n\t\tmodelRuntime\n\t});\n\tif (cli.error) throw new Error(cli.error);\n\tlet scoped;\n\tif (parsed.models !== void 0 && parsed.models.length > 0) {\n\t\tscoped = (await resolveModelScopeWithDiagnostics(parsed.models, modelRuntime)).scopedModels[0]?.model;\n\t\tif (scoped === void 0) throw new PoSessionSetupError(`No configured model matched --models ${parsed.models.join(\", \")}.`);\n\t}\n\tconst fallback = overrides.defaultModel?.();\n\tconst fallbackModel = fallback === void 0 ? void 0 : modelRuntime.getModel(fallback.provider, fallback.id);\n\tconst configured = cli.model ?? scoped ?? (settings.getDefaultProvider() && settings.getDefaultModel() ? modelRuntime.getModel(settings.getDefaultProvider(), settings.getDefaultModel()) : void 0) ?? fallbackModel ?? (await modelRuntime.getAvailable())[0];\n\tif (configured === void 0) {\n\t\tif (overrides.modelRuntime !== void 0) throw new PoSessionSetupError(\"The host offers no signed-in model, so the session cannot start. Sign in to a provider on the host.\");\n\t\tconst agentDir = getAgentDir();\n\t\tconst runtimeError = modelRuntime.getError();\n\t\tthrow new PoSessionSetupError(`No model is configured, so the session cannot start. Add a provider and its credentials in ${agentDir} (auth.json, or models.json for a custom provider), then set defaultProvider and defaultModel in ${path.join(agentDir, \"settings.json\")}.` + (runtimeError ? `\\n\\n${runtimeError}` : \"\"));\n\t}\n\treturn {\n\t\tmodel: configured,\n\t\tthinkingLevel: cli.thinkingLevel ?? parsed.thinking ?? settings.getModelThinkingLevel(configured.provider, configured.id) ?? settings.getDefaultThinkingLevel() ?? (configured === fallbackModel ? fallback?.thinkingLevel : void 0)\n\t};\n}\n/** Models, settings and Pi extensions from `~/.pi/agent` and the worktree, as the Node server loads them. */\nasync function createNodeModelDependencies(options, overrides = {}) {\n\tconst agentDir = getAgentDir();\n\tconst settings = SettingsManager.create(options.cwd, agentDir);\n\tconst modelDir = modelConfigDirectory(agentDir);\n\tconst settingsDir = modelSettingsDirectory(agentDir);\n\tconst modelSettings = settingsDir === agentDir ? settings : SettingsManager.create(options.cwd, settingsDir);\n\tconst modelRuntime = overrides.modelRuntime ?? await ModelRuntime.create({\n\t\tauthPath: path.join(modelDir, \"auth.json\"),\n\t\tmodelsPath: path.join(modelDir, \"models.json\"),\n\t\trefreshOnCreate: false\n\t});\n\tif (overrides.modelRuntime === void 0) registerChatgptAuthProvider(modelRuntime);\n\tconst piExtensionPaths = options.piExtensions === false ? [] : await resolvePiSettingsPackageEntries({\n\t\tcwd: options.cwd,\n\t\tagentDir,\n\t\tsettings,\n\t\t...options.onNotice === void 0 ? {} : { onNotice: options.onNotice }\n\t});\n\tconst piPreload = await preloadPiExtensions({\n\t\tcwd: options.cwd,\n\t\tagentDir,\n\t\tmodels: modelRuntime,\n\t\textensionPaths: [...new Set(piExtensionPaths)],\n\t\t...options.onNotice === void 0 ? {} : { onNotice: options.onNotice }\n\t});\n\treturn {\n\t\tagentDir,\n\t\tmodelRuntime,\n\t\tprojectContextFiles: loadProjectContextFiles({\n\t\t\tcwd: options.cwd,\n\t\t\tagentDir\n\t\t}),\n\t\tresolveModel: (parsed) => resolveModel(parsed, modelRuntime, modelSettings, overrides),\n\t\t...piPreload === void 0 || piPreload.extensions.length === 0 ? {} : { piExtensions: (input) => createPiExtensionHost({\n\t\t\t...input,\n\t\t\tcwd: options.cwd,\n\t\t\tagentDir,\n\t\t\tmodels: modelRuntime,\n\t\t\tsettings,\n\t\t\tpreload: piPreload\n\t\t}) }\n\t};\n}\n//#endregion\nexport { createNodeModelDependencies };\n\n//# sourceMappingURL=index.mjs.map","import { parseArgs } from \"@earendil-works/pi-coding-agent\";\n//#region src/services/piArgs/index.ts\nconst unsupported = (parsed) => {\n\tconst match = [\n\t\t[\"--help\", parsed.help],\n\t\t[\"--version\", parsed.version],\n\t\t[\"--mode\", parsed.mode],\n\t\t[\"--print\", parsed.print],\n\t\t[\"--export\", parsed.export],\n\t\t[\"--no-session\", parsed.noSession],\n\t\t[\"--session\", parsed.session],\n\t\t[\"--session-dir\", parsed.sessionDir],\n\t\t[\"--continue\", parsed.continue],\n\t\t[\"--resume\", parsed.resume],\n\t\t[\"--fork\", parsed.fork],\n\t\t[\"--list-models\", parsed.listModels],\n\t\t[\"--offline\", parsed.offline],\n\t\t[\"--tui-mode\", parsed.tuiMode],\n\t\t[\"--extensions\", parsed.extensions],\n\t\t[\"--no-extensions\", parsed.noExtensions],\n\t\t[\"--skills\", parsed.skills],\n\t\t[\"--no-skills\", parsed.noSkills],\n\t\t[\"--prompt-templates\", parsed.promptTemplates],\n\t\t[\"--no-prompt-templates\", parsed.noPromptTemplates],\n\t\t[\"--themes\", parsed.themes],\n\t\t[\"--no-themes\", parsed.noThemes],\n\t\t[\"--no-context-files\", parsed.noContextFiles],\n\t\t[\"--tools\", parsed.tools],\n\t\t[\"--exclude-tools\", parsed.excludeTools],\n\t\t[\"--no-tools\", parsed.noTools],\n\t\t[\"--no-builtin-tools\", parsed.noBuiltinTools],\n\t\t[\"--project-trust-override\", parsed.projectTrustOverride],\n\t\t[\"--verbose\", parsed.verbose]\n\t].find(([, value]) => value !== void 0 && value !== false);\n\tif (match) return `Direct headless mode does not support ${match[0]}.`;\n\tif (parsed.messages.length > 0 || parsed.fileArgs.length > 0) return \"Direct headless mode does not support positional prompts or files.\";\n\tconst unknown = parsed.unknownFlags.keys().next().value;\n\treturn typeof unknown === \"string\" ? `Direct headless mode does not support --${unknown}.` : void 0;\n};\n/** Validate the Pi flags that remain after Po's harness flags are removed. */\nfunction validateDirectHeadlessArgs(agentArgs) {\n\tif (agentArgs.includes(\"--mode\")) throw new Error(\"Direct headless mode does not support --mode.\");\n\tconst parsed = parseArgs([...agentArgs]);\n\tconst diagnostics = parsed.diagnostics.filter((diagnostic) => diagnostic.type === \"error\");\n\tif (diagnostics.length) throw new Error(diagnostics.map((diagnostic) => diagnostic.message).join(\"\\n\"));\n\tconst error = unsupported(parsed);\n\tif (error) throw new Error(error);\n\treturn parsed;\n}\n//#endregion\nexport { validateDirectHeadlessArgs };\n\n//# sourceMappingURL=index.mjs.map","import { DEFAULT_COMPACTION_SETTINGS, generateSummary } from \"@earendil-works/pi-coding-agent\";\n//#region src/services/piSummary/index.ts\nconst summarize = (messages, model, signal, instructions, previousSummary, thinkingLevel, complete) => generateSummary(messages, model, DEFAULT_COMPACTION_SETTINGS.reserveTokens, void 0, void 0, signal, instructions, previousSummary, thinkingLevel, complete);\n//#endregion\nexport { summarize };\n\n//# sourceMappingURL=index.mjs.map","//#region src/services/toolPrompt/index.ts\nfunction formatToolPrompt(entries) {\n\tconst listed = entries.filter((entry) => (entry.promptSnippet ?? \"\").trim().length > 0);\n\tconst guidelines = [...new Set(entries.flatMap((entry) => entry.promptGuidelines ?? []).filter((line) => line.trim().length > 0))];\n\tconst sections = [];\n\tif (listed.length > 0) sections.push(`Available tools:\\n${listed.map((entry) => `- ${entry.name}: ${entry.promptSnippet}`).join(\"\\n\")}`);\n\tif (guidelines.length > 0) sections.push(`Guidelines:\\n${guidelines.map((line) => `- ${line}`).join(\"\\n\")}`);\n\treturn sections.join(\"\\n\\n\");\n}\n//#endregion\nexport { formatToolPrompt };\n\n//# sourceMappingURL=index.mjs.map","//#region src/systems/child/services/childSession/index.ts\n/**\n* Owns lifecycle for runtimes created by a direct host adapter.\n*\n* The factory is the host boundary: it must construct the direct harness, apply\n* history ownership, and return only after child extensions are composed.\n*/\nfunction createPoChildSessionService(factory, dependencies) {\n\tconst handles = /* @__PURE__ */ new Map();\n\tconst outcomes = /* @__PURE__ */ new Map();\n\tconst transcriptReaders = /* @__PURE__ */ new Map();\n\tconst claimedRunIds = /* @__PURE__ */ new Set();\n\tconst starting = /* @__PURE__ */ new Set();\n\tconst cleanupFailures = [];\n\tlet closed = false;\n\tlet closePromise;\n\tconst release = (runId) => {\n\t\thandles.delete(runId);\n\t\tif (!transcriptReaders.has(runId)) claimedRunIds.delete(runId);\n\t};\n\tconst recordCleanupFailure = (error) => {\n\t\tcleanupFailures.push(error);\n\t};\n\tconst store = dependencies.store;\n\tconst service = {\n\t\tstart(request, signal) {\n\t\t\tif (closed) return Promise.reject(/* @__PURE__ */ new Error(\"The Po child-session service is closed.\"));\n\t\t\tif (claimedRunIds.has(request.runId)) return Promise.reject(/* @__PURE__ */ new Error(`Child run '${request.runId}' already exists.`));\n\t\t\tclaimedRunIds.add(request.runId);\n\t\t\tconst pending = (async () => {\n\t\t\t\ttry {\n\t\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\t\tconst owned = await createHandle(async (ownedRequest, ownedSignal) => {\n\t\t\t\t\t\tconst runtime = await factory(ownedRequest, ownedSignal);\n\t\t\t\t\t\tif (runtime.readTranscriptPage) transcriptReaders.set(request.runId, (pageRequest, pageSignal) => runtime.readTranscriptPage(pageRequest, pageSignal));\n\t\t\t\t\t\treturn runtime;\n\t\t\t\t\t}, dependencies, request, signal, (outcome) => {\n\t\t\t\t\t\tif (outcome) outcomes.set(request.runId, outcome);\n\t\t\t\t\t\trelease(request.runId);\n\t\t\t\t\t}, recordCleanupFailure);\n\t\t\t\t\tconst handle = owned.handle;\n\t\t\t\t\tif (closed || signal?.aborted) {\n\t\t\t\t\t\tawait handle.dispose();\n\t\t\t\t\t\tthrow signal?.reason ?? /* @__PURE__ */ new Error(\"Child session startup was cancelled.\");\n\t\t\t\t\t}\n\t\t\t\t\tif (!isTerminal(handle.state())) handles.set(request.runId, owned);\n\t\t\t\t\treturn handle;\n\t\t\t\t} catch (error) {\n\t\t\t\t\ttranscriptReaders.delete(request.runId);\n\t\t\t\t\trelease(request.runId);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t})();\n\t\t\tstarting.add(pending);\n\t\t\tpending.then(() => starting.delete(pending), () => starting.delete(pending));\n\t\t\treturn pending;\n\t\t},\n\t\tget: (runId) => handles.get(runId)?.handle,\n\t\tasync readTranscriptPage(runId, request, signal) {\n\t\t\tif (closed) throw new Error(\"The Po child-session service is closed.\");\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst reader = transcriptReaders.get(runId);\n\t\t\tif (!reader) throw new Error(`Child run '${runId}' has no readable transcript.`);\n\t\t\tconst page = await reader(request, signal);\n\t\t\tsignal?.throwIfAborted();\n\t\t\treturn page;\n\t\t},\n\t\t...store ? {\n\t\t\tstored: () => store.stored(),\n\t\t\tasync restore(runId, live) {\n\t\t\t\tconst active = handles.get(runId);\n\t\t\t\tif (active) return active.handle;\n\t\t\t\tconst run = (await store.stored()).find((stored) => stored.request.runId === runId);\n\t\t\t\tif (!run) throw new Error(`No stored child run matches '${runId}'.`);\n\t\t\t\treturn service.start({\n\t\t\t\t\t...run.request,\n\t\t\t\t\tsource: { kind: \"fresh\" },\n\t\t\t\t\tenvironment: {},\n\t\t\t\t\t...live?.intercom ? { intercom: live.intercom } : {}\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync markReported(runId) {\n\t\t\t\tawait store.markReported(runId, outcomes.get(runId));\n\t\t\t\toutcomes.delete(runId);\n\t\t\t}\n\t\t} : {},\n\t\tclose() {\n\t\t\tclosePromise ??= (async () => {\n\t\t\t\tif (closed) return;\n\t\t\t\tclosed = true;\n\t\t\t\tawait Promise.allSettled(starting);\n\t\t\t\tconst active = [...handles.values()];\n\t\t\t\tawait Promise.allSettled(active.map((owned) => owned.detach()));\n\t\t\t\tconst failures = [...cleanupFailures];\n\t\t\t\thandles.clear();\n\t\t\t\ttranscriptReaders.clear();\n\t\t\t\tclaimedRunIds.clear();\n\t\t\t\toutcomes.clear();\n\t\t\t\tif (failures.length) throw new AggregateError(failures, \"Po child-session shutdown failed.\");\n\t\t\t})();\n\t\t\treturn closePromise;\n\t\t}\n\t};\n\treturn service;\n}\nfunction isTerminal(state) {\n\treturn state === \"completed\" || state === \"failed\" || state === \"stopped\";\n}\nfunction isAbortError(error) {\n\treturn error instanceof Error && error.name === \"AbortError\";\n}\nfunction errorMessage(error) {\n\treturn error instanceof Error ? error.message : typeof error === \"string\" ? error : \"Unknown cleanup failure\";\n}\nasync function createHandle(factory, dependencies, request, signal, onTerminal, onCleanupFailure) {\n\tconst runtime = await factory(request, signal);\n\tif (signal?.aborted) {\n\t\tawait runtime.dispose();\n\t\tthrow signal.reason ?? /* @__PURE__ */ new Error(\"Child session startup was cancelled.\");\n\t}\n\tlet state = \"starting\";\n\tlet disposed = false;\n\tlet lastEvent;\n\tlet finishPromise;\n\tlet stopPromise;\n\tlet cleanupPromise;\n\tlet abortCleanup;\n\tconst listeners = /* @__PURE__ */ new Set();\n\tconst usageRows = /* @__PURE__ */ new Set();\n\tconst toolCalls = /* @__PURE__ */ new Set();\n\tlet cost;\n\tlet tokens;\n\tlet config = {};\n\tlet usageCleanup;\n\tconst emit = (next, message) => {\n\t\tstate = next;\n\t\tconst event = {\n\t\t\trunId: request.runId,\n\t\t\tstate: next,\n\t\t\ttimestamp: dependencies.now(),\n\t\t\t...message ? { message } : {},\n\t\t\t...cost === void 0 ? {} : { cost },\n\t\t\t...tokens === void 0 ? {} : { tokens },\n\t\t\t...toolCalls.size === 0 ? {} : { toolCount: toolCalls.size },\n\t\t\t...config\n\t\t};\n\t\tlastEvent = event;\n\t\tfor (const listener of Array.from(listeners)) try {\n\t\t\tlistener(event);\n\t\t} catch {}\n\t};\n\tconst onUsage = (usage) => {\n\t\tif (usageRows.has(usage.rowId) || !Number.isFinite(usage.cost)) return;\n\t\tusageRows.add(usage.rowId);\n\t\tcost = (cost ?? 0) + usage.cost;\n\t\tif (usage.tokens !== void 0 && Number.isFinite(usage.tokens)) tokens = (tokens ?? 0) + usage.tokens;\n\t\tif (!isTerminal(state)) emit(\"running\");\n\t};\n\tconst onConfig = (next) => {\n\t\tconfig = {\n\t\t\t...config,\n\t\t\t...next.model ? { model: next.model } : {},\n\t\t\t...next.thinking ? { thinking: next.thinking } : {}\n\t\t};\n\t\tif (!isTerminal(state)) emit(\"running\");\n\t};\n\tconst onToolStart = (toolCallId) => {\n\t\tif (toolCalls.has(toolCallId)) return;\n\t\ttoolCalls.add(toolCallId);\n\t\tif (!isTerminal(state)) emit(\"running\");\n\t};\n\tconst cleanup = () => {\n\t\tcleanupPromise ??= (async () => {\n\t\t\ttry {\n\t\t\t\tawait runtime.dispose();\n\t\t\t} finally {\n\t\t\t\tusageCleanup?.();\n\t\t\t\tusageCleanup = void 0;\n\t\t\t\tabortCleanup?.();\n\t\t\t\tabortCleanup = void 0;\n\t\t\t}\n\t\t})();\n\t\treturn cleanupPromise;\n\t};\n\tconst finish = (next, message) => {\n\t\tfinishPromise ??= (async () => {\n\t\t\tlet cleanupFailure;\n\t\t\ttry {\n\t\t\t\tawait cleanup();\n\t\t\t} catch (error) {\n\t\t\t\tcleanupFailure = error;\n\t\t\t\tonCleanupFailure(error);\n\t\t\t}\n\t\t\tconst outcome = { state: cleanupFailure === void 0 ? next : \"failed\" };\n\t\t\tdisposed = true;\n\t\t\tonTerminal(outcome);\n\t\t\tif (cleanupFailure === void 0) emit(next, message);\n\t\t\telse {\n\t\t\t\tconst detail = errorMessage(cleanupFailure);\n\t\t\t\temit(\"failed\", `Child session cleanup failed: ${detail}`);\n\t\t\t}\n\t\t\tlisteners.clear();\n\t\t\tif (cleanupFailure !== void 0) throw cleanupFailure;\n\t\t})();\n\t\treturn finishPromise;\n\t};\n\tconst handle = {\n\t\trunId: request.runId,\n\t\tstate: () => state,\n\t\tsubscribe(listener) {\n\t\t\tif (disposed || isTerminal(state)) {\n\t\t\t\tif (lastEvent) try {\n\t\t\t\t\tlistener(lastEvent);\n\t\t\t\t} catch {}\n\t\t\t\treturn () => false;\n\t\t\t}\n\t\t\tlisteners.add(listener);\n\t\t\tif (lastEvent) try {\n\t\t\t\tlistener(lastEvent);\n\t\t\t} catch {}\n\t\t\treturn () => listeners.delete(listener);\n\t\t},\n\t\tasync steer(message, steerSignal) {\n\t\t\tif (disposed || finishPromise) throw new Error(`Child run '${request.runId}' is no longer active.`);\n\t\t\tsteerSignal?.throwIfAborted();\n\t\t\tawait runtime.steer(message);\n\t\t\tsteerSignal?.throwIfAborted();\n\t\t},\n\t\tstop(reason) {\n\t\t\tstopPromise ??= (async () => {\n\t\t\t\tif (finishPromise) return finishPromise;\n\t\t\t\tlet abortFailure;\n\t\t\t\ttry {\n\t\t\t\t\tawait runtime.abort();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tabortFailure = error;\n\t\t\t\t}\n\t\t\t\tlet finishFailure;\n\t\t\t\ttry {\n\t\t\t\t\tawait finish(\"stopped\", reason ?? \"Child session stopped.\");\n\t\t\t\t} catch (error) {\n\t\t\t\t\tfinishFailure = error;\n\t\t\t\t}\n\t\t\t\tif (abortFailure !== void 0 && finishFailure !== void 0) throw new AggregateError([abortFailure, finishFailure], \"Stopping the child session failed.\");\n\t\t\t\tif (abortFailure !== void 0) throw abortFailure;\n\t\t\t\tif (finishFailure !== void 0) throw finishFailure;\n\t\t\t})();\n\t\t\treturn stopPromise;\n\t\t},\n\t\tdispose: () => finish(\"stopped\", \"Child session disposed.\")\n\t};\n\tconst detach = () => {\n\t\tfinishPromise ??= (async () => {\n\t\t\tdisposed = true;\n\t\t\tlisteners.clear();\n\t\t\ttry {\n\t\t\t\tawait cleanup();\n\t\t\t} catch (error) {\n\t\t\t\tonCleanupFailure(error);\n\t\t\t} finally {\n\t\t\t\tonTerminal();\n\t\t\t}\n\t\t})();\n\t\treturn finishPromise.catch(() => void 0);\n\t};\n\tif (signal) {\n\t\tconst onAbort = () => {\n\t\t\thandle.stop(\"Child session startup was cancelled.\").catch(() => void 0);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tabortCleanup = () => signal.removeEventListener(\"abort\", onAbort);\n\t}\n\tconst unsubscribe = [\n\t\truntime.onUsage?.(onUsage),\n\t\truntime.onConfig?.(onConfig),\n\t\truntime.onToolStart?.(onToolStart)\n\t];\n\tusageCleanup = () => {\n\t\tfor (const stop of unsubscribe) stop?.();\n\t};\n\temit(\"running\");\n\tPromise.resolve().then(() => runtime.prompt(request.sender ? {\n\t\ttext: request.task,\n\t\tsender: request.sender\n\t} : request.task)).then((message) => stopPromise ? void 0 : finish(\"completed\", typeof message === \"string\" ? message : void 0).catch(() => void 0), (error) => stopPromise ? void 0 : finish(isAbortError(error) ? \"stopped\" : \"failed\", error instanceof Error ? error.message : String(error)).catch(() => void 0));\n\treturn {\n\t\thandle,\n\t\tdetach\n\t};\n}\n//#endregion\nexport { createPoChildSessionService };\n\n//# sourceMappingURL=index.mjs.map","import { FileTooLargeError, readBoundedFile, recordBoundedRead, recordRipgrepOutput } from \"../platformFiles/index.mjs\";\nimport { packageEntry } from \"../../../moduleResolution.mjs\";\nimport path from \"node:path\";\nimport { BACKGROUND_CONTEXT, withAbortSignal } from \"@earendil-works/chord/context\";\nimport { getOrThrow } from \"@earendil-works/pi-durable/env\";\nimport { DEFAULT_MAX_BYTES, createBashTool, createEditTool, createFindTool, createGrepTool, createLsTool, createReadTool, createWriteTool, detectSupportedImageMimeTypeFromFile, formatSize, truncateHead, truncateLine } from \"@earendil-works/pi-coding-agent\";\nimport { spawn } from \"node:child_process\";\nimport { pathToFileURL } from \"node:url\";\n//#region src/services/nativeChildTools/index.ts\n/** Names only. Execution always uses the bounded factories below. */\nconst NATIVE_TOOL_FACTORIES = {\n\tread: createReadTool,\n\tbash: createBashTool,\n\tedit: createEditTool,\n\twrite: createWriteTool,\n\tgrep: createGrepTool,\n\tfind: createFindTool,\n\tls: createLsTool\n};\nfunction createNativeToolFactories(options) {\n\tconst context = options.context ?? BACKGROUND_CONTEXT;\n\tconst fs = () => {\n\t\tif (!options.fs) throw new Error(\"Native tools require the host filesystem.\");\n\t\treturn options.fs;\n\t};\n\tconst read = async (filePath, maxBytes, family, readContext = context) => {\n\t\tlet data;\n\t\ttry {\n\t\t\tdata = await readBoundedFile(fs(), filePath, maxBytes, readContext);\n\t\t} catch (error) {\n\t\t\tif (error instanceof FileTooLargeError) {\n\t\t\t\trecordBoundedRead(0, family, true);\n\t\t\t\toptions.onRead?.(0, family, true);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\trecordBoundedRead(data.length, family);\n\t\toptions.onRead?.(data.length, family, false);\n\t\treturn Buffer.from(data);\n\t};\n\tconst access = async (filePath) => {\n\t\tgetOrThrow(await fs().fileInfo(filePath, context));\n\t};\n\treturn {\n\t\t...NATIVE_TOOL_FACTORIES,\n\t\tread: (cwd) => createReadTool(cwd, { operations: {\n\t\t\taccess,\n\t\t\treadFile: (filePath) => read(filePath, 8388608, \"read\"),\n\t\t\tdetectImageMimeType: detectSupportedImageMimeTypeFromFile\n\t\t} }),\n\t\tedit: (cwd) => createEditTool(cwd, { operations: {\n\t\t\taccess,\n\t\t\treadFile: (filePath) => read(filePath, 8388608, \"edit\"),\n\t\t\twriteFile: async (filePath, content) => {\n\t\t\t\tgetOrThrow(await fs().writeFile(filePath, content, context));\n\t\t\t}\n\t\t} }),\n\t\tgrep: (cwd) => {\n\t\t\treturn {\n\t\t\t\t...createGrepTool(cwd),\n\t\t\t\tasync execute(...args) {\n\t\t\t\t\tconst readContext = args[2] ? withAbortSignal(args[2], context) : context;\n\t\t\t\t\tlet remaining = 4194304;\n\t\t\t\t\tconst omitted = /* @__PURE__ */ new Set();\n\t\t\t\t\tconst [, params, signal, , executionContext] = args;\n\t\t\t\t\tconst checkAbort = () => {\n\t\t\t\t\t\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n\t\t\t\t\t};\n\t\t\t\t\tcheckAbort();\n\t\t\t\t\tconst piEntry = pathToFileURL(packageEntry(\"@earendil-works/pi-coding-agent\", import.meta.url));\n\t\t\t\t\tconst { ensureTool } = await import(new URL(\"./utils/tools-manager.js\", piEntry).href);\n\t\t\t\t\tconst { resolveToCwd } = await import(new URL(\"./core/tools/path-utils.js\", piEntry).href);\n\t\t\t\t\tconst rgPath = await ensureTool(\"rg\");\n\t\t\t\t\tcheckAbort();\n\t\t\t\t\tif (!rgPath) throw new Error(\"ripgrep (rg) is not available and could not be downloaded\");\n\t\t\t\t\tconst searchPath = resolveToCwd(params.path || \".\", executionContext?.cwd || cwd);\n\t\t\t\t\tlet isDirectory;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst info = getOrThrow(await fs().fileInfo(searchPath, readContext));\n\t\t\t\t\t\tconst target = info.kind === \"symlink\" ? getOrThrow(await fs().canonicalPath(searchPath, readContext)) : searchPath;\n\t\t\t\t\t\tisDirectory = (info.kind === \"symlink\" ? getOrThrow(await fs().fileInfo(target, readContext)) : info).kind === \"directory\";\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tcheckAbort();\n\t\t\t\t\t\tthrow new Error(`Path not found: ${searchPath}`);\n\t\t\t\t\t}\n\t\t\t\t\tcheckAbort();\n\t\t\t\t\tconst contextValue = params.context && params.context > 0 ? params.context : 0;\n\t\t\t\t\tconst effectiveLimit = Math.max(1, params.limit ?? 100);\n\t\t\t\t\tconst argv = [\n\t\t\t\t\t\t\"--json\",\n\t\t\t\t\t\t\"--line-number\",\n\t\t\t\t\t\t\"--color=never\",\n\t\t\t\t\t\t\"--hidden\"\n\t\t\t\t\t];\n\t\t\t\t\tif (params.ignoreCase) argv.push(\"--ignore-case\");\n\t\t\t\t\tif (params.literal) argv.push(\"--fixed-strings\");\n\t\t\t\t\tif (params.glob) argv.push(\"--glob\", params.glob);\n\t\t\t\t\targv.push(\"--\", params.pattern, searchPath);\n\t\t\t\t\tconst collected = await collectNativeGrep(rgPath, argv, effectiveLimit, signal);\n\t\t\t\t\tcheckAbort();\n\t\t\t\t\tconst formatPath = (filePath) => {\n\t\t\t\t\t\tif (isDirectory) {\n\t\t\t\t\t\t\tconst relative = path.relative(searchPath, filePath);\n\t\t\t\t\t\t\tif (relative && !relative.startsWith(\"..\")) return relative.replace(/\\\\/g, \"/\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn path.basename(filePath);\n\t\t\t\t\t};\n\t\t\t\t\tconst fileCache = /* @__PURE__ */ new Map();\n\t\t\t\t\tconst outputLines = [];\n\t\t\t\t\tlet linesTruncated = contextValue === 0 && collected.linesTruncated;\n\t\t\t\t\tconst preview = (text) => {\n\t\t\t\t\t\tconst truncated = truncateLine(text);\n\t\t\t\t\t\tlinesTruncated ||= truncated.wasTruncated;\n\t\t\t\t\t\treturn truncated.text;\n\t\t\t\t\t};\n\t\t\t\t\tfor (const match of collected.matches) {\n\t\t\t\t\t\tcheckAbort();\n\t\t\t\t\t\tconst relativePath = formatPath(match.filePath);\n\t\t\t\t\t\tif (contextValue === 0 && match.lineText !== void 0) {\n\t\t\t\t\t\t\toutputLines.push(`${relativePath}:${match.lineNumber}: ${match.lineText}`);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet lines = fileCache.get(match.filePath);\n\t\t\t\t\t\tif (!lines) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst data = await read(match.filePath, Math.min(1048576, remaining), \"grep\", readContext);\n\t\t\t\t\t\t\t\tremaining -= data.length;\n\t\t\t\t\t\t\t\tlines = data.toString(\"utf8\").replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\\n\").split(\"\\n\");\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tcheckAbort();\n\t\t\t\t\t\t\t\tif (error instanceof FileTooLargeError) omitted.add(match.filePath);\n\t\t\t\t\t\t\t\tlines = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfileCache.set(match.filePath, lines);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcheckAbort();\n\t\t\t\t\t\tif (!lines.length) {\n\t\t\t\t\t\t\toutputLines.push(`${relativePath}:${match.lineNumber}: (unable to read file)`);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst start = Math.max(1, match.lineNumber - contextValue);\n\t\t\t\t\t\tconst end = Math.min(lines.length, match.lineNumber + contextValue);\n\t\t\t\t\t\tfor (let current = start; current <= end; current++) {\n\t\t\t\t\t\t\tconst text = preview((lines[current - 1] ?? \"\").replace(/\\r/g, \"\"));\n\t\t\t\t\t\t\toutputLines.push(current === match.lineNumber ? `${relativePath}:${current}: ${text}` : `${relativePath}-${current}- ${text}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst truncation = truncateHead(outputLines.join(\"\\n\"), { maxLines: Number.MAX_SAFE_INTEGER });\n\t\t\t\t\tlet output = collected.matchCount === 0 ? collected.truncated ? \"No complete matches collected\" : \"No matches found\" : truncation.content;\n\t\t\t\t\tconst details = {};\n\t\t\t\t\tconst notices = [];\n\t\t\t\t\tif (collected.matchLimitReached) {\n\t\t\t\t\t\tnotices.push(`${effectiveLimit} matches limit reached. Use limit=${effectiveLimit * 2} for more, or refine pattern`);\n\t\t\t\t\t\tdetails.matchLimitReached = effectiveLimit;\n\t\t\t\t\t}\n\t\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\t\tnotices.push(`${formatSize(DEFAULT_MAX_BYTES)} limit reached`);\n\t\t\t\t\t\tdetails.truncation = truncation;\n\t\t\t\t\t}\n\t\t\t\t\tif (linesTruncated) {\n\t\t\t\t\t\tnotices.push(\"Some lines truncated to 500 chars. Use read tool to see full lines\");\n\t\t\t\t\t\tdetails.linesTruncated = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (collected.truncated) notices.push(\"ripgrep raw output truncated at 8 MiB stdout or 64 KiB stderr; incomplete matching lines omitted. Narrow the path or refine pattern\");\n\t\t\t\t\tif (notices.length) output += `\\n\\n[${notices.join(\". \")}]`;\n\t\t\t\t\tconst result = {\n\t\t\t\t\t\tcontent: [{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: output\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tdetails: Object.keys(details).length ? details : void 0\n\t\t\t\t\t};\n\t\t\t\t\tif (omitted.size) result.content.push({\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: `context omitted for ${omitted.size} files over 1 MiB or the 4 MiB call budget; narrow the path or search without context`\n\t\t\t\t\t});\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n}\nconst GREP_STDOUT_CAP = 8388608;\nconst GREP_STDERR_CAP = 65536;\n/** Bound raw process buffers before decoding, JSON parsing, or retaining match previews. */\nfunction collectNativeGrep(executable, argv, limit, signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(/* @__PURE__ */ new Error(\"Operation aborted\"));\n\t\t\treturn;\n\t\t}\n\t\tconst child = spawn(executable, argv, { stdio: [\n\t\t\t\"ignore\",\n\t\t\t\"pipe\",\n\t\t\t\"pipe\"\n\t\t] });\n\t\tconst matches = [];\n\t\tconst pending = [];\n\t\tconst stderr = [];\n\t\tlet stdoutBytes = 0;\n\t\tlet stderrBytes = 0;\n\t\tlet matchCount = 0;\n\t\tlet matchLimitReached = false;\n\t\tlet linesTruncated = false;\n\t\tlet truncated = false;\n\t\tlet stderrCapped = false;\n\t\tlet aborted = false;\n\t\tlet settled = false;\n\t\tconst abort = () => {\n\t\t\taborted = true;\n\t\t\tchild.kill();\n\t\t};\n\t\tconst finish = (error) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tsignal?.removeEventListener(\"abort\", abort);\n\t\t\tif (error) reject(error);\n\t\t\telse resolve({\n\t\t\t\tmatches,\n\t\t\t\tmatchCount,\n\t\t\t\tmatchLimitReached,\n\t\t\t\tlinesTruncated,\n\t\t\t\ttruncated\n\t\t\t});\n\t\t};\n\t\tconst parseLine = (line) => {\n\t\t\tif (matchCount >= limit) return;\n\t\t\tlet event;\n\t\t\ttry {\n\t\t\t\tevent = JSON.parse(line.toString(\"utf8\"));\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (event?.type !== \"match\") return;\n\t\t\tmatchCount++;\n\t\t\tconst filePath = event.data?.path?.text;\n\t\t\tconst lineNumber = event.data?.line_number;\n\t\t\tconst rawText = event.data?.lines?.text;\n\t\t\tconst preview = rawText === void 0 ? void 0 : truncateLine(rawText.replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\").replace(/\\n$/, \"\"));\n\t\t\tlinesTruncated ||= preview?.wasTruncated ?? false;\n\t\t\tif (filePath && typeof lineNumber === \"number\") matches.push({\n\t\t\t\tfilePath,\n\t\t\t\tlineNumber,\n\t\t\t\tlineText: preview?.text\n\t\t\t});\n\t\t\tif (matchCount >= limit) {\n\t\t\t\tmatchLimitReached = true;\n\t\t\t\tchild.kill();\n\t\t\t}\n\t\t};\n\t\tchild.stdout.on(\"data\", (chunk) => {\n\t\t\tif (settled || aborted || truncated || matchLimitReached) return;\n\t\t\tconst retained = Math.min(chunk.length, GREP_STDOUT_CAP - stdoutBytes);\n\t\t\tstdoutBytes += retained;\n\t\t\tconst capped = stdoutBytes >= GREP_STDOUT_CAP;\n\t\t\trecordRipgrepOutput(retained, capped);\n\t\t\tconst data = chunk.subarray(0, retained);\n\t\t\tlet offset = 0;\n\t\t\tfor (let end = data.indexOf(10); end !== -1; end = data.indexOf(10, offset)) {\n\t\t\t\tpending.push(Buffer.from(data.subarray(offset, end)));\n\t\t\t\tparseLine(Buffer.concat(pending));\n\t\t\t\tpending.length = 0;\n\t\t\t\toffset = end + 1;\n\t\t\t\tif (matchLimitReached) break;\n\t\t\t}\n\t\t\tif (!matchLimitReached && offset < data.length) pending.push(Buffer.from(data.subarray(offset)));\n\t\t\tif (capped) {\n\t\t\t\ttruncated = true;\n\t\t\t\tpending.length = 0;\n\t\t\t\tchild.kill();\n\t\t\t}\n\t\t});\n\t\tchild.stderr.on(\"data\", (chunk) => {\n\t\t\tif (settled || aborted || truncated || matchLimitReached) return;\n\t\t\tconst retained = Math.min(chunk.length, GREP_STDERR_CAP - stderrBytes);\n\t\t\tif (retained) stderr.push(Buffer.from(chunk.subarray(0, retained)));\n\t\t\tstderrBytes += retained;\n\t\t\tconst capped = stderrBytes >= GREP_STDERR_CAP;\n\t\t\trecordRipgrepOutput(retained, capped);\n\t\t\tif (capped) {\n\t\t\t\ttruncated = true;\n\t\t\t\tstderrCapped = true;\n\t\t\t\tpending.length = 0;\n\t\t\t\tchild.kill();\n\t\t\t}\n\t\t});\n\t\tchild.once(\"error\", (error) => finish(/* @__PURE__ */ new Error(`Failed to run ripgrep: ${error.message}`)));\n\t\tchild.once(\"close\", (code) => {\n\t\t\tif (aborted || signal?.aborted) {\n\t\t\t\tfinish(/* @__PURE__ */ new Error(\"Operation aborted\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (stderrCapped) {\n\t\t\t\tfinish(/* @__PURE__ */ new Error(`${Buffer.concat(stderr, stderrBytes).toString(\"utf8\").trim()}\\n\\n[ripgrep stderr truncated at 64 KiB; refine pattern or narrow the path]`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!truncated && !matchLimitReached && code !== 0 && code !== 1) {\n\t\t\t\tfinish(new Error(Buffer.concat(stderr, stderrBytes).toString(\"utf8\").trim() || `ripgrep exited with code ${code}`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!truncated && !matchLimitReached && pending.length) parseLine(Buffer.concat(pending));\n\t\t\tfinish();\n\t\t});\n\t\tsignal?.addEventListener(\"abort\", abort, { once: true });\n\t\tif (signal?.aborted) abort();\n\t});\n}\n//#endregion\nexport { NATIVE_TOOL_FACTORIES, createNativeToolFactories };\n\n//# sourceMappingURL=index.mjs.map","import { PO_CHILD_INPUT_CUSTOM_TYPE } from \"../types/childSession.mjs\";\nimport { createPoChildSessionService } from \"../services/childSession/index.mjs\";\nimport { dropInvalidImages } from \"../../../schemas/headless.mjs\";\nimport { IdentityHistoryDoc } from \"../../../services/durableSession/docs.mjs\";\nimport { durableTranscriptLane, readTranscriptPage } from \"../../../services/transcriptPages/index.mjs\";\nimport { abandonSubagent, createSubagentConversation, markSubagentReported, readSubagents } from \"../../../services/durableSubagents/index.mjs\";\nimport { promptForAssistantText } from \"../../../server/directHarnessRuntime.mjs\";\nimport { createAgentSessionRuntime } from \"../../../pi/piSessionRuntime.mjs\";\nimport { NATIVE_TOOL_FACTORIES, createNativeToolFactories } from \"../../../services/nativeChildTools/index.mjs\";\nimport { BACKGROUND_CONTEXT, withAbortSignal } from \"@earendil-works/chord/context\";\n//#region src/systems/child/adapters/headlessChildSessionService.ts\nconst THINKING_SUFFIX_PATTERN = /:(off|minimal|low|medium|high|xhigh|max)$/;\n/**\n* Child model specs may carry a Pi thinking suffix, for example\n* `anthropic-vertex/claude-sonnet-5:medium`. The suffix is a request option and\n* never part of the model id, so it has to be split off before model lookup.\n*/\nfunction parseChildModelReference(value) {\n\tif (value === void 0) return void 0;\n\tconst suffix = THINKING_SUFFIX_PATTERN.exec(value);\n\tconst reference = suffix === null ? value : value.slice(0, value.length - suffix[0].length);\n\tconst separator = reference.indexOf(\"/\");\n\tif (separator <= 0 || separator === reference.length - 1) throw new Error(`Child model must use the provider/model form: ${value}`);\n\treturn {\n\t\tmodel: {\n\t\t\tprovider: reference.slice(0, separator),\n\t\t\tid: reference.slice(separator + 1)\n\t\t},\n\t\t...suffix === null ? {} : { thinking: suffix[1] }\n\t};\n}\n/**\n* An attributed input rides a displayed custom message whose details carry the\n* sender. The model reads its text once, as a user turn, exactly like a string.\n*/\nfunction childInputMessage(input) {\n\tif (typeof input === \"string\") return input;\n\treturn {\n\t\trole: \"custom\",\n\t\tcustomType: PO_CHILD_INPUT_CUSTOM_TYPE,\n\t\tcontent: input.text,\n\t\tdisplay: true,\n\t\tdetails: { sender: input.sender },\n\t\ttimestamp: Date.now()\n\t};\n}\n/** The runtime's own model and effort, read once and then followed through its config changes. */\nfunction observeChildConfig(runtime, listener) {\n\tconst changed = /* @__PURE__ */ new Set();\n\tlet open = true;\n\tconst off = runtime.onEvent((event) => {\n\t\tif (event.type !== \"config_update\") return;\n\t\tchanged.add(event.property);\n\t\tlistener(event.property === \"model\" ? { model: `${event.value.provider}/${event.value.modelId}` } : { thinking: event.value });\n\t});\n\truntime.readState().then((state) => {\n\t\tconst model = state.model;\n\t\tif (!open) return;\n\t\tlistener({\n\t\t\t...!changed.has(\"model\") && typeof model?.provider === \"string\" && typeof model.id === \"string\" ? { model: `${model.provider}/${model.id}` } : {},\n\t\t\t...!changed.has(\"thinkingLevel\") && typeof state.thinkingLevel === \"string\" ? { thinking: state.thinkingLevel } : {}\n\t\t});\n\t}, () => void 0);\n\treturn () => {\n\t\topen = false;\n\t\toff();\n\t};\n}\n/** Input, usage and observation methods of a child lane. */\nfunction childRuntimeMethods(runtime, inputRequestId, hold) {\n\treturn {\n\t\tprompt: (task) => promptForAssistantText(runtime, childInputMessage(task), hold, inputRequestId),\n\t\tasync steer(message) {\n\t\t\tawait runtime.submitInternalMessage(childInputMessage(message), \"steer\");\n\t\t},\n\t\tasync followUp(message) {\n\t\t\tawait runtime.submitInternalMessage(childInputMessage(message), \"followUp\");\n\t\t},\n\t\tabort: () => runtime.abort(),\n\t\tonUsage: (listener) => runtime.onEvent((event) => {\n\t\t\tif (event.type !== \"usage\") return;\n\t\t\tlistener({\n\t\t\t\trowId: event.row.id,\n\t\t\t\tcost: event.row.usage.cost.total,\n\t\t\t\ttokens: event.row.usage.totalTokens\n\t\t\t});\n\t\t}),\n\t\tonConfig: (listener) => observeChildConfig(runtime, listener),\n\t\tonToolStart: (listener) => runtime.onEvent((event) => {\n\t\t\tif (event.type === \"tool_execution_start\") listener(event.toolCallId);\n\t\t})\n\t};\n}\n/** Pages of a child conversation through its parent's Harness, also after the child's lane closed. */\nfunction childTranscriptReader(harness, conversation, sessionId) {\n\treturn async (request, signal) => {\n\t\tconst context = signal ? withAbortSignal(signal, BACKGROUND_CONTEXT) : BACKGROUND_CONTEXT;\n\t\treturn {\n\t\t\t...await readTranscriptPage({\n\t\t\t\tsessionId,\n\t\t\t\tlaneName: \"main\",\n\t\t\t\tlane: durableTranscriptLane((query, limit, cursor, scanContext) => conversation.entries(query, limit, cursor, scanContext), (readContext) => harness.snapshot(IdentityHistoryDoc, conversation.id, readContext))\n\t\t\t}, request, 0, context),\n\t\t\trevision: 0\n\t\t};\n\t};\n}\n/** Pages of a stored run's conversation, opened on first read: what a thread view reads once the run's lane is gone. */\nfunction storedTranscriptReader(harness, conversationId, sessionId) {\n\tlet opening;\n\treturn async (request, signal) => {\n\t\topening ??= harness.conversation(conversationId, BACKGROUND_CONTEXT).then((conversation) => {\n\t\t\tif (!conversation) throw new Error(`Child conversation ${conversationId} is unavailable.`);\n\t\t\treturn childTranscriptReader(harness, conversation, sessionId);\n\t\t});\n\t\ttry {\n\t\t\treturn await (await opening)(request, signal);\n\t\t} catch (error) {\n\t\t\topening = void 0;\n\t\t\tthrow error;\n\t\t}\n\t};\n}\nfunction childRuntime(runtime, inputRequestId, readPage, intercom, release) {\n\treturn {\n\t\tsessionId: runtime.sessionId,\n\t\t...readPage ? { readTranscriptPage: readPage } : {},\n\t\t...childRuntimeMethods(runtime, inputRequestId, intercom?.hold?.bind(intercom)),\n\t\tdispose: async () => {\n\t\t\ttry {\n\t\t\t\tawait release?.();\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tawait runtime.dispose();\n\t\t\t\t} finally {\n\t\t\t\t\tintercom?.dispose?.();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n/** Own the hook lifetime independently of the caller's startup signal. */\nfunction bindChildHooks(request, hooks, readRuntime, signal) {\n\tconst lifetime = new AbortController();\n\tconst abort = () => lifetime.abort(signal?.reason);\n\tsignal?.addEventListener(\"abort\", abort, { once: true });\n\tif (signal?.aborted) abort();\n\tconst admittedRuntime = () => {\n\t\tlifetime.signal.throwIfAborted();\n\t\tconst runtime = readRuntime();\n\t\tif (!runtime) throw new Error(\"Child hook runtime is not available.\");\n\t\treturn runtime;\n\t};\n\tconst { intercom, ...data } = request;\n\tconst freeze = (value) => {\n\t\tif (typeof value !== \"object\" || value === null) return;\n\t\tfor (const child of Object.values(value)) freeze(child);\n\t\tObject.freeze(value);\n\t};\n\tconst snapshot = structuredClone(data);\n\tfreeze(snapshot);\n\tlet binding;\n\ttry {\n\t\tbinding = hooks?.bind({\n\t\t\trequest: Object.freeze({\n\t\t\t\t...snapshot,\n\t\t\t\t...intercom ? { intercom } : {}\n\t\t\t}),\n\t\t\tsessionId: () => readRuntime()?.sessionId,\n\t\t\tsignal: lifetime.signal,\n\t\t\tasync sendMessage(text, delivery) {\n\t\t\t\tawait admittedRuntime().submitInternalMessage(text, delivery);\n\t\t\t},\n\t\t\tasync appendCustomEntry(type, data) {\n\t\t\t\tawait admittedRuntime().appendCustomEntry(type, data);\n\t\t\t}\n\t\t});\n\t} catch (error) {\n\t\tlifetime.abort();\n\t\tsignal?.removeEventListener(\"abort\", abort);\n\t\tthrow error;\n\t}\n\tlet disposal;\n\treturn {\n\t\t...binding ? { binding } : {},\n\t\tdispose: () => disposal ??= (async () => {\n\t\t\tlifetime.abort();\n\t\t\tsignal?.removeEventListener(\"abort\", abort);\n\t\t\tawait binding?.dispose();\n\t\t})()\n\t};\n}\nfunction createPoChildSessionHookRegistry() {\n\tconst entries = /* @__PURE__ */ new Set();\n\treturn {\n\t\tregister(hooks) {\n\t\t\tentries.add(hooks);\n\t\t\treturn { dispose: () => void entries.delete(hooks) };\n\t\t},\n\t\tlist: () => [...entries]\n\t};\n}\n/**\n* Chains child hooks into one provider. The first is the legacy single provider: its errors\n* propagate as before. Later hooks see the patched result, and their errors are reported and skipped,\n* so an observer can never break a child tool call.\n*/\nfunction composeChildSessionHooks(list, onError) {\n\tconst hooks = list.filter((entry) => entry !== void 0);\n\tif (hooks.length <= 1) return hooks[0];\n\tconst report = (error) => onError?.(`Child session hook failed: ${error instanceof Error ? error.message : String(error)}`);\n\treturn { bind(scope) {\n\t\tconst bindings = [];\n\t\ttry {\n\t\t\tfor (const entry of hooks) bindings.push(entry.bind(scope));\n\t\t} catch (error) {\n\t\t\tPromise.allSettled(bindings.map((binding) => binding.dispose()));\n\t\t\tthrow error;\n\t\t}\n\t\treturn {\n\t\t\tasync beforeTool(event, context) {\n\t\t\t\tlet args = event.args;\n\t\t\t\tlet changed = false;\n\t\t\t\tfor (const [index, binding] of bindings.entries()) {\n\t\t\t\t\tlet result;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresult = await binding.beforeTool({\n\t\t\t\t\t\t\t...event,\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t}, context);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (index === 0) throw error;\n\t\t\t\t\t\treport(error);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (result?.block) return result;\n\t\t\t\t\tif (result?.args) {\n\t\t\t\t\t\targs = result.args;\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn changed ? { args } : void 0;\n\t\t\t},\n\t\t\tasync afterTool(event, context) {\n\t\t\t\tlet current = event;\n\t\t\t\tlet patch;\n\t\t\t\tfor (const [index, binding] of bindings.entries()) {\n\t\t\t\t\tlet result;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresult = await binding.afterTool(current, context);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (index === 0) throw error;\n\t\t\t\t\t\treport(error);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!result) continue;\n\t\t\t\t\tconst terminate = patch?.terminate === true || result.terminate === true;\n\t\t\t\t\tpatch = {\n\t\t\t\t\t\t...patch,\n\t\t\t\t\t\t...result,\n\t\t\t\t\t\t...terminate ? { terminate } : {}\n\t\t\t\t\t};\n\t\t\t\t\tcurrent = {\n\t\t\t\t\t\t...current,\n\t\t\t\t\t\t...result.content === void 0 ? {} : { content: result.content },\n\t\t\t\t\t\t...result.details === void 0 ? {} : { details: result.details },\n\t\t\t\t\t\t...result.isError === void 0 ? {} : { isError: result.isError },\n\t\t\t\t\t\t...result.usage === void 0 ? {} : { usage: result.usage }\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn patch;\n\t\t\t},\n\t\t\tasync dispose() {\n\t\t\t\tconst failure = (await Promise.allSettled(bindings.map((binding) => binding.dispose()))).find((result) => result.status === \"rejected\");\n\t\t\t\tif (failure) throw failure.reason;\n\t\t\t}\n\t\t};\n\t} };\n}\nasync function installIntercom(runtime, intercom, tools, inputRequestId) {\n\tif (!intercom) return;\n\tconst tool = intercom.bindRuntime(childRuntime(runtime, inputRequestId, void 0));\n\tconst adapted = {\n\t\tname: tool.name,\n\t\tdescription: tool.description,\n\t\tparameters: tool.parameters,\n\t\texecute: async (operationId, params, onUpdate, _toolContext, _invocation, context) => {\n\t\t\tconst result = await tool.execute(operationId, params, context.abortSignal ?? new AbortController().signal, (partial) => onUpdate({\n\t\t\t\tcontent: partial.content,\n\t\t\t\tdetails: partial.details\n\t\t\t}));\n\t\t\treturn {\n\t\t\t\tcontent: result.content,\n\t\t\t\tdetails: result.details,\n\t\t\t\tisError: result.isError\n\t\t\t};\n\t\t}\n\t};\n\ttools.push(adapted);\n\tawait runtime.replaceTools(tools);\n}\nfunction hasConfiguredValues(value) {\n\treturn value !== void 0 && value.length > 0;\n}\nfunction adaptNativeTool(tool) {\n\tconst prompt = tool;\n\treturn {\n\t\tname: prompt.name,\n\t\tdescription: prompt.description,\n\t\t...prompt.executionMode === \"parallel\" || prompt.executionMode === \"sequential\" ? { executionMode: prompt.executionMode } : {},\n\t\tlabel: \"label\" in tool ? tool.label : tool.name,\n\t\tparameters: tool.parameters,\n\t\t...\"prepareArguments\" in tool && typeof tool.prepareArguments === \"function\" ? { prepareArguments: (args) => tool.prepareArguments(args) } : {},\n\t\tasync execute(toolCallId, parameters, onUpdate, _toolContext, _invocation, context) {\n\t\t\tconst execute = tool.execute;\n\t\t\tconst result = await execute(toolCallId, parameters, context.abortSignal ?? new AbortController().signal, (partial) => onUpdate({\n\t\t\t\tcontent: partial.content,\n\t\t\t\tdetails: partial.details\n\t\t\t}));\n\t\t\tif (result.isError) {\n\t\t\t\tconst content = result.content;\n\t\t\t\tthrow new Error(content.filter((part) => part.type === \"text\").map((part) => part.text).join(\"\\n\") || \"MCP tool failed.\");\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tcontent: dropInvalidImages(result.content),\n\t\t\t\tdetails: result.details\n\t\t\t};\n\t\t}\n\t};\n}\n/** Validate and project native fields before the child conversation is created. */\nfunction composeDirectHarnessRequestOptions(request, resolveMcpTool, validateRequired = true, parent, nativeOptions = {}) {\n\tconst unsupported = [\n\t\t...hasConfiguredValues(request.extensions) ? [\"extensions\"] : [],\n\t\t...hasConfiguredValues(request.subagentOnlyExtensions) ? [\"subagentOnlyExtensions\"] : [],\n\t\t...hasConfiguredValues(request.capabilityCeiling?.allowedExternalProfiles) ? [\"allowedExternalProfiles\"] : []\n\t];\n\tif (unsupported.length > 0) throw new Error(`Native child session configuration is unsupported by the direct harness: ${unsupported.join(\", \")}`);\n\tconst isMcp = (name) => name === \"mcp\" || name === \"mcp_use\";\n\tconst parentAllows = (name) => parent?.allows(name) !== false;\n\tconst parentMcp = (parent?.tools ?? []).filter((tool) => isMcp(tool.name));\n\tconst parentMcpDenied = () => parentMcp.length > 0 && parentMcp.every((tool) => !parentAllows(tool.name));\n\tconst requested = [...new Set(request.tools ?? [...Object.keys(NATIVE_TOOL_FACTORIES), ...parentMcp.filter((tool) => parentAllows(tool.name)).map((tool) => tool.name)])];\n\tconst excluded = new Set(request.excludeTools ?? []);\n\tconst ceiling = request.capabilityCeiling;\n\tconst allowed = ceiling?.allowedTools;\n\tconst borrowable = (parent?.tools ?? []).filter((tool) => !Object.hasOwn(NATIVE_TOOL_FACTORIES, tool.name) && !isMcp(tool.name) && (request.tools === void 0 || requested.includes(tool.name)));\n\tconst isBorrowable = (name) => borrowable.some((tool) => tool.name === name);\n\tconst mcpDenied = parentMcpDenied() || ceiling !== void 0 && ceiling.allowMcpTools !== true || allowed !== void 0 && allowed.every((name) => Object.hasOwn(NATIVE_TOOL_FACTORIES, name)) || [...excluded].some(isMcp);\n\tconst wantsMcp = !mcpDenied && (requested.some(isMcp) || hasConfiguredValues(request.mcpDirectTools) || requested.some((name) => !Object.hasOwn(NATIVE_TOOL_FACTORIES, name) && !isBorrowable(name)));\n\tconst provider = wantsMcp ? resolveMcpTool?.() : void 0;\n\tconst catalog = provider?.catalog;\n\tconst snapshot = catalog?.snapshot() ?? [];\n\tconst expand = (values) => new Set(values.flatMap((name) => isMcp(name) ? snapshot.map((tool) => tool.name) : [name]));\n\tconst grants = allowed === void 0 ? void 0 : expand(allowed);\n\tconst denied = expand([...excluded]);\n\tconst selected = expand(requested);\n\tif (request.mcpDirectTools?.length) {\n\t\tconst selectors = new Set(catalog?.resolveSelectors(request.mcpDirectTools) ?? []);\n\t\tfor (const tool of snapshot) if (!selectors.has(tool.name)) selected.delete(tool.name);\n\t\telse if (request.tools === void 0) selected.add(tool.name);\n\t}\n\tconst nativeNames = requested.filter((name) => Object.hasOwn(NATIVE_TOOL_FACTORIES, name) && !denied.has(name) && (grants === void 0 || grants.has(name)) && parentAllows(name));\n\tconst borrowed = borrowable.filter((tool) => !denied.has(tool.name) && (grants === void 0 || grants.has(tool.name)) && parentAllows(tool.name));\n\tconst direct = mcpDenied ? [] : snapshot.filter((tool) => selected.has(tool.name) && !denied.has(tool.name) && (grants === void 0 || grants.has(tool.name)) && parentAllows(tool.name));\n\tconst unknown = requested.filter((name) => !Object.hasOwn(NATIVE_TOOL_FACTORIES, name) && !isMcp(name) && !isBorrowable(name) && !snapshot.some((tool) => tool.name === name) && !denied.has(name) && (grants === void 0 || grants.has(name)));\n\tif (unknown.length > 0 && validateRequired) throw new Error(`Native child session requested unknown direct harness tools: ${unknown.join(\", \")}`);\n\tconst names = [\n\t\t...nativeNames,\n\t\t...borrowed.map((tool) => tool.name),\n\t\t...direct.map((tool) => tool.name)\n\t];\n\tconst missing = (ceiling?.requiredTools ?? []).filter((name) => isMcp(name) ? direct.length === 0 : !names.includes(name));\n\tif (validateRequired && missing.length > 0) throw new Error(`Native child session capability ceiling requires unavailable tools: ${missing.join(\", \")}`);\n\tif (validateRequired && wantsMcp && !catalog) throw new Error(\"Native child session MCP tools are unavailable. Enable MCP in the parent session.\");\n\tconst factories = createNativeToolFactories(nativeOptions);\n\treturn {\n\t\ttools: [\n\t\t\t...nativeNames.map((name) => adaptNativeTool(factories[name](request.cwd))),\n\t\t\t...borrowed,\n\t\t\t...direct.map((tool) => adaptNativeTool({\n\t\t\t\t...tool,\n\t\t\t\texecute(toolCallId, parameters, signal, onUpdate) {\n\t\t\t\t\tsignal?.throwIfAborted();\n\t\t\t\t\tif (resolveMcpTool?.() !== provider || !catalog?.snapshot().includes(tool) || parentMcpDenied() || !parentAllows(tool.name)) throw new Error(\"The parent session MCP tool is no longer available.\");\n\t\t\t\t\treturn tool.execute(toolCallId, parameters, signal, onUpdate);\n\t\t\t\t}\n\t\t\t}))\n\t\t],\n\t\tactiveToolNames: names,\n\t\t...request.systemPrompt === void 0 ? {} : { systemPrompt: request.systemPrompt }\n\t};\n}\n/** Refresh borrowed declarations without replacing native tools or rebinding intercom. */\nfunction bindChildMcpCatalog(runtime, request, options, initialTools) {\n\tif (request.capabilityCeiling !== void 0 && request.capabilityCeiling.allowMcpTools !== true) return () => void 0;\n\tif (request.capabilityCeiling?.allowedTools?.every((name) => Object.hasOwn(NATIVE_TOOL_FACTORIES, name))) return () => void 0;\n\tif (request.excludeTools?.some((name) => name === \"mcp\" || name === \"mcp_use\")) return () => void 0;\n\tif (request.tools !== void 0 && !request.tools.some((name) => name === \"mcp\" || name === \"mcp_use\" || !Object.hasOwn(NATIVE_TOOL_FACTORIES, name)) && !request.mcpDirectTools?.length) return () => void 0;\n\tconst retained = initialTools.filter((tool, index) => Object.hasOwn(NATIVE_TOOL_FACTORIES, tool.name) || request.intercom !== void 0 && index === initialTools.length - 1);\n\tlet disposed = false;\n\tlet provider;\n\tlet unsubscribeCatalog;\n\tlet previous = [];\n\tlet pending = Promise.resolve();\n\tlet failure;\n\tconst refresh = () => {\n\t\tif (disposed) return;\n\t\tconst current = options.mcpTool?.();\n\t\tconst changed = current !== provider;\n\t\tif (changed) {\n\t\t\tunsubscribeCatalog?.();\n\t\t\tprovider = current;\n\t\t\tunsubscribeCatalog = provider?.catalog?.subscribe(refresh);\n\t\t}\n\t\tconst snapshot = provider?.catalog?.snapshot() ?? [];\n\t\tif (!changed && snapshot.length === previous.length && snapshot.every((tool, index) => tool === previous[index])) return;\n\t\tprevious = snapshot;\n\t\tconst direct = (composeDirectHarnessRequestOptions(request, options.mcpTool, false, options.parentTools?.()).tools ?? []).filter((tool) => !Object.hasOwn(NATIVE_TOOL_FACTORIES, tool.name));\n\t\tpending = pending.then(async () => {\n\t\t\tif (!disposed) await runtime.replaceTools([...retained, ...direct]);\n\t\t}).catch((error) => {\n\t\t\tfailure = error;\n\t\t});\n\t};\n\tconst unsubscribeProvider = options.subscribeMcpTool?.(refresh);\n\trefresh();\n\treturn () => {\n\t\tdisposed = true;\n\t\tunsubscribeProvider?.();\n\t\tunsubscribeCatalog?.();\n\t\tif (failure !== void 0) throw new Error(\"Child MCP catalog refresh failed.\", { cause: failure });\n\t};\n}\n/** The request as stored for a re-attach: data only, without its live intercom, environment or source. */\nfunction storedRequest(request) {\n\tconst { intercom: _intercom, environment: _environment, source: _source, ...data } = request;\n\treturn JSON.parse(JSON.stringify(data));\n}\n/**\n* Children are task-owned conversations of the parent's Harness, each run as one more lane. A run's conversation,\n* anchor and request are stored, so after a restart the child resumes with the Harness and `restore` re-attaches it.\n*/\nfunction createHeadlessChildSessionService(options) {\n\tconst parent = options.runtime;\n\tconst context = BACKGROUND_CONTEXT;\n\tconst states = /* @__PURE__ */ new Map();\n\tconst readers = /* @__PURE__ */ new Map();\n\tlet closed = false;\n\tconst storedReader = (runId, conversationId) => {\n\t\tconst reader = storedTranscriptReader(parent.harness, conversationId, runId);\n\t\treaders.set(runId, reader);\n\t\treturn reader;\n\t};\n\treadSubagents(parent.harness, context).then((runs) => {\n\t\tif (closed) return;\n\t\tfor (const [runId, run] of Object.entries(runs)) if (!readers.has(runId)) storedReader(runId, run.conversationId);\n\t}, () => void 0);\n\tconst readerOf = async (runId) => {\n\t\tconst reader = readers.get(runId);\n\t\tif (reader) return reader;\n\t\tconst run = (await readSubagents(parent.harness, context))[runId];\n\t\treturn run ? readers.get(runId) ?? storedReader(runId, run.conversationId) : void 0;\n\t};\n\tconst report = async (runId, outcome) => {\n\t\tconst conversationId = await markSubagentReported(parent.harness, runId, context, outcome);\n\t\tif (conversationId !== void 0) parent.closeLane(conversationId);\n\t};\n\tconst service = createPoChildSessionService(async (request, signal) => {\n\t\tsignal?.throwIfAborted();\n\t\tconst existing = (await readSubagents(parent.harness, context))[request.runId];\n\t\tif (existing?.reported) throw new Error(`Child run '${request.runId}' has already finished.`);\n\t\tconst restoring = existing !== void 0;\n\t\tconst directRequestOptions = composeDirectHarnessRequestOptions(request, options.mcpTool, !restoring, options.parentTools?.(), {\n\t\t\tfs: options.fs,\n\t\t\tcontext\n\t\t});\n\t\tconst requestedModel = parseChildModelReference(request.model);\n\t\tconst thinking = request.thinking ?? requestedModel?.thinking;\n\t\tlet forkAt;\n\t\tif (!restoring && request.source.kind === \"fork\") {\n\t\t\tconst entryId = request.source.entryId ?? (await parent.readEntries()).leafId ?? void 0;\n\t\t\tconst durableId = entryId === void 0 ? NaN : Number(String(entryId).split(\":\", 1)[0]);\n\t\t\tif (!Number.isSafeInteger(durableId)) throw new Error(\"The parent session has no history to fork.\");\n\t\t\tforkAt = durableId;\n\t\t}\n\t\tconst { conversation, stored } = existing ? {\n\t\t\tconversation: await parent.harness.conversation(existing.conversationId, context),\n\t\t\tstored: existing\n\t\t} : await createSubagentConversation(parent.harness, parent.lane, {\n\t\t\trunId: request.runId,\n\t\t\trequest: storedRequest(request),\n\t\t\t...forkAt === void 0 ? {} : { forkAt }\n\t\t}, context);\n\t\tif (!conversation) throw new Error(`Child run '${request.runId}' has no conversation.`);\n\t\tlet runtime;\n\t\tlet hooks;\n\t\tconst boundHooks = () => hooks ??= bindChildHooks(request, options.hooks?.(), () => runtime, signal);\n\t\ttry {\n\t\t\tif (!restoring) boundHooks();\n\t\t\tconst laneOptions = {\n\t\t\t\tsessionId: request.runId,\n\t\t\t\tcwd: request.cwd || options.cwd,\n\t\t\t\t...requestedModel ? { model: requestedModel.model } : {},\n\t\t\t\t...thinking === void 0 ? {} : { thinkingLevel: thinking },\n\t\t\t\t...directRequestOptions,\n\t\t\t\tbeforeTool: (event, toolContext) => boundHooks().binding?.beforeTool(event, toolContext),\n\t\t\t\tafterTool: (event, toolContext) => boundHooks().binding?.afterTool(event, toolContext)\n\t\t\t};\n\t\t\truntime = await parent.openLane(conversation, laneOptions);\n\t\t\tawait installIntercom(runtime, request.intercom, laneOptions.tools ?? [], stored.inputRequestId);\n\t\t\tconst releaseMcp = bindChildMcpCatalog(runtime, request, options, laneOptions.tools ?? []);\n\t\t\tconst state = createAgentSessionRuntime({\n\t\t\t\truntime,\n\t\t\t\tsessionId: runtime.sessionId,\n\t\t\t\tsessionName: runtime.sessionId,\n\t\t\t\tcwd: \"\"\n\t\t\t});\n\t\t\tstates.set(request.runId, state);\n\t\t\tconst readPage = childTranscriptReader(parent.harness, conversation, runtime.sessionId);\n\t\t\treaders.set(request.runId, readPage);\n\t\t\treturn childRuntime(runtime, stored.inputRequestId, readPage, request.intercom, async () => {\n\t\t\t\ttry {\n\t\t\t\t\treleaseMcp();\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (states.get(request.runId) === state) states.delete(request.runId);\n\t\t\t\t\t\tawait state.dispose();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait hooks?.dispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst failures = [error];\n\t\t\tfor (const cleanup of [\n\t\t\t\t() => hooks?.dispose(),\n\t\t\t\t() => runtime?.dispose(),\n\t\t\t\t() => request.intercom?.dispose?.(),\n\t\t\t\t() => restoring ? void 0 : report(request.runId, { state: \"failed\" })\n\t\t\t]) try {\n\t\t\t\tawait cleanup();\n\t\t\t} catch (cleanupError) {\n\t\t\t\tfailures.push(cleanupError);\n\t\t\t}\n\t\t\tif (failures.length > 1) throw new AggregateError(failures, \"Headless child startup cleanup failed\");\n\t\t\tthrow error;\n\t\t}\n\t}, {\n\t\tnow: options.now ?? Date.now,\n\t\tstore: {\n\t\t\tasync stored() {\n\t\t\t\tconst runs = [];\n\t\t\t\tfor (const run of Object.values(await readSubagents(parent.harness, context))) {\n\t\t\t\t\tif (run.reported || !run.request) continue;\n\t\t\t\t\tconst receipt = await parent.harness.commit((tx) => tx.submissionByRequest(run.conversationId, run.inputRequestId), context);\n\t\t\t\t\truns.push({\n\t\t\t\t\t\trequest: run.request,\n\t\t\t\t\t\tsettled: receipt?.status === \"done\" || receipt?.status === \"unanswered\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn runs;\n\t\t\t},\n\t\t\tmarkReported: report\n\t\t}\n\t});\n\treturn {\n\t\t...service,\n\t\tasync readTranscriptPage(runId, request, signal) {\n\t\t\tif (closed) throw new Error(\"The Po child-session service is closed.\");\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst reader = await readerOf(runId);\n\t\t\tif (!reader) throw new Error(`Child run '${runId}' has no readable transcript.`);\n\t\t\tconst page = await reader(request, signal);\n\t\t\tsignal?.throwIfAborted();\n\t\t\treturn page;\n\t\t},\n\t\tasync abandon(runId) {\n\t\t\tconst conversationId = await abandonSubagent(parent.harness, runId, context);\n\t\t\tif (conversationId !== void 0) parent.closeLane(conversationId);\n\t\t},\n\t\tasync reported(runId) {\n\t\t\tconst run = (await readSubagents(parent.harness, context))[runId];\n\t\t\tif (!run?.reported) return void 0;\n\t\t\treturn {\n\t\t\t\t...run.agent === void 0 ? {} : { agent: run.agent },\n\t\t\t\t...run.task === void 0 ? {} : { task: run.task },\n\t\t\t\t...run.state === void 0 ? {} : { state: run.state }\n\t\t\t};\n\t\t},\n\t\tthread(runId) {\n\t\t\tconst reader = readers.get(runId);\n\t\t\tif (!reader) return void 0;\n\t\t\tconst state = states.get(runId)?.state;\n\t\t\treturn {\n\t\t\t\t...state ? { state } : {},\n\t\t\t\treadTranscriptPage: reader\n\t\t\t};\n\t\t},\n\t\tasync close() {\n\t\t\tclosed = true;\n\t\t\tawait service.close();\n\t\t\tstates.clear();\n\t\t\treaders.clear();\n\t\t}\n\t};\n}\nfunction createHeadlessChildSessionServiceProvider(options) {\n\tconst service = createHeadlessChildSessionService(options);\n\treturn {\n\t\tget: () => service,\n\t\tclose: () => service.close()\n\t};\n}\n//#endregion\nexport { bindChildHooks, bindChildMcpCatalog, childInputMessage, composeChildSessionHooks, composeDirectHarnessRequestOptions, createHeadlessChildSessionService, createHeadlessChildSessionServiceProvider, createPoChildSessionHookRegistry, parseChildModelReference };\n\n//# sourceMappingURL=headlessChildSessionService.mjs.map","import { clampThinkingLevel } from \"../models.js\";\nimport { estimateContextTokens } from \"../utils/estimate.js\";\nconst CONTEXT_SAFETY_TOKENS = 4096;\nconst MIN_MAX_TOKENS = 1;\nexport function clampMaxTokensToContext(model, context, maxTokens) {\n    if (model.contextWindow <= 0)\n        return Math.max(MIN_MAX_TOKENS, maxTokens);\n    const available = model.contextWindow - estimateContextTokens(context).tokens - CONTEXT_SAFETY_TOKENS;\n    return Math.min(maxTokens, Math.max(MIN_MAX_TOKENS, available));\n}\nexport function resolveSamplingParams(model, thinkingLevel, requestParams) {\n    const effectiveThinkingLevel = clampThinkingLevel(model, thinkingLevel);\n    const thinkingLevelParams = model.samplingParamsByThinkingLevel?.[effectiveThinkingLevel];\n    return model.samplingParams || thinkingLevelParams || requestParams\n        ? { ...model.samplingParams, ...thinkingLevelParams, ...requestParams }\n        : undefined;\n}\nexport function buildBaseOptions(model, context, options, apiKey) {\n    const samplingParams = resolveSamplingParams(model, options?.reasoning ?? \"off\", options?.samplingParams);\n    return {\n        temperature: options?.temperature,\n        samplingParams,\n        maxTokens: clampMaxTokensToContext(model, context, options?.maxTokens ?? model.maxTokens),\n        signal: options?.signal,\n        telemetryContext: options?.telemetryContext,\n        apiKey: apiKey || options?.apiKey,\n        fetch: options?.fetch,\n        transport: options?.transport,\n        cacheRetention: options?.cacheRetention,\n        sessionId: options?.sessionId,\n        headers: options?.headers,\n        onPayload: options?.onPayload,\n        onResponse: options?.onResponse,\n        onProviderStreamEvent: options?.onProviderStreamEvent,\n        timeoutMs: options?.timeoutMs,\n        websocketConnectTimeoutMs: options?.websocketConnectTimeoutMs,\n        maxRetries: options?.maxRetries,\n        maxRetryDelayMs: options?.maxRetryDelayMs,\n        metadata: options?.metadata,\n        env: options?.env,\n    };\n}\n/** Tokens always left for the answer when a thinking budget shares the response ceiling. */\nexport const MIN_ANSWER_TOKENS = 1024;\nexport const DEFAULT_THINKING_BUDGETS = {\n    minimal: 1024,\n    low: 2048,\n    medium: 8192,\n    high: 16384,\n};\nexport function clampReasoning(effort) {\n    return effort === \"xhigh\" || effort === \"max\" ? \"high\" : effort;\n}\nexport function thinkingBudgetForLevel(reasoningLevel, customBudgets) {\n    const budgets = { ...DEFAULT_THINKING_BUDGETS, ...customBudgets };\n    const level = clampReasoning(reasoningLevel);\n    return budgets[level];\n}\n/** Cap a thinking budget so at least MIN_ANSWER_TOKENS remain under a shared response ceiling. */\nexport function clampThinkingBudgetToAnswerRoom(thinkingBudget, ceiling) {\n    return Math.min(thinkingBudget, Math.max(0, ceiling - MIN_ANSWER_TOKENS));\n}\nexport function adjustMaxTokensForThinking(\n// Undefined means no explicit caller cap. Use the model cap and fit thinking inside it.\nbaseMaxTokens, modelMaxTokens, reasoningLevel, customBudgets) {\n    let thinkingBudget = thinkingBudgetForLevel(reasoningLevel, customBudgets);\n    const maxTokens = baseMaxTokens === undefined ? modelMaxTokens : Math.min(baseMaxTokens + thinkingBudget, modelMaxTokens);\n    if (maxTokens <= thinkingBudget) {\n        thinkingBudget = clampThinkingBudgetToAnswerRoom(thinkingBudget, maxTokens);\n    }\n    return { maxTokens, thinkingBudget };\n}\n//# sourceMappingURL=simple-options.js.map","import { piAgentDirectory } from \"../../../services/piSettings/core.mjs\";\nimport { PO_AGENT_MODEL_ENTRY_TYPE } from \"../../../schemas/agentModel.mjs\";\nimport { PO_BACKGROUND_WORK_CHANGED_EVENT, PO_BACKGROUND_WORK_SERVICE, readPoBackgroundWorkService } from \"../../../schemas/backgroundWork.mjs\";\nimport \"../../../../backgroundWork.mjs\";\nimport { CHATGPT_AUTH_PROVIDER_ID } from \"../../../services/chatgptAuth/index.mjs\";\nimport { PO_CHILD_SESSION_HOOKS_SERVICE, PO_CHILD_SESSION_HOOK_REGISTRY_SERVICE, PO_CHILD_SESSION_MCP_TOOL_SERVICE, PO_CHILD_SESSION_SERVICE } from \"../../child/types/childSession.mjs\";\nimport { registerPoSessionEnvironment } from \"../../../../runtimeCordisHost.mjs\";\nimport \"../../../../cordisHost.mjs\";\nimport { PO_LOAD_SKILL_TOOL, PoHeadlessPromptAdmissionError, dropInvalidImages, isPoHeadlessToolModelVisible } from \"../../../schemas/headless.mjs\";\nimport { SessionMetadataDoc } from \"../../../services/durableSession/docs.mjs\";\nimport { durableEntriesNewestFirst } from \"../../../services/transcriptPages/index.mjs\";\nimport \"../../../schemas/hubChannel.mjs\";\nimport { validationDetails } from \"../../../../runtimeProtocol.mjs\";\nimport { formatSkillsForSystemPrompt } from \"../../../services/skillPrompt/index.mjs\";\nimport { HeadlessHost, describeSkillTool, headlessHarnessSkill, systemPromptSkills } from \"./headlessHost.mjs\";\nimport { PO_WORKFLOW_CONTEXT_SERVICE } from \"../../../schemas/workflow.mjs\";\nimport { abandonSubagent } from \"../../../services/durableSubagents/index.mjs\";\nimport { createToolContinuation, isBashSequenceEnvelope } from \"../../../services/toolContinuation/index.mjs\";\nimport { createDirectHarnessRuntime } from \"../../../server/directHarnessRuntime.mjs\";\nimport { harnessErrorMessage } from \"../../../server/harnessErrorMessage.mjs\";\nimport { createChatgptImageClient } from \"../../../services/chatgptImages/index.mjs\";\nimport { createChatgptWebSearchClient } from \"../../../services/chatgptWebSearch/index.mjs\";\nimport { buildContextDetail } from \"../../../../contextDetail.mjs\";\nimport { removeContextDetail, writeContextDetail } from \"../../../../contextDetailStore.mjs\";\nimport { PO_CONTEXT_ENTRY_TYPE, projectContext } from \"../../../../contextProjection.mjs\";\nimport { createHeadlessClient } from \"../../../services/headlessClient/index.mjs\";\nimport { createNodeModelDependencies } from \"../../../services/nodeModelDependencies/index.mjs\";\nimport { validateDirectHeadlessArgs } from \"../../../services/piArgs/index.mjs\";\nimport { summarize } from \"../../../services/piSummary/index.mjs\";\nimport { observe } from \"../../../../serverTelemetry.mjs\";\nimport { PO_SESSION_TEMP_DIR, prepareSessionEnvironment } from \"../../../services/sessionFiles/index.mjs\";\nimport { formatToolPrompt } from \"../../../services/toolPrompt/index.mjs\";\nimport { composeChildSessionHooks, createHeadlessChildSessionServiceProvider, createPoChildSessionHookRegistry } from \"../../child/adapters/headlessChildSessionService.mjs\";\nimport { randomUUID } from \"node:crypto\";\nimport path from \"node:path\";\nimport { BACKGROUND_CONTEXT, withAbortSignal } from \"@earendil-works/chord/context\";\nimport { Value } from \"typebox/value\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { createAssistantMessageEventStream, isContextOverflow } from \"@earendil-works/pi-ai\";\nimport { clampMaxTokensToContext } from \"@earendil-works/pi-ai/api/simple-options\";\n//#region src/systems/main/adapters/headlessSessionHost.ts\nconst EXTERNAL_OPERATION = \"external\";\nconst REMOTE_TOOL_WAIT_MS = 3e4;\nconst PROMPT_PREPARATION_FAILED_EVENT = \"po_server.system_prompt_preparation_failed\";\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction stringArray(value) {\n\treturn Array.isArray(value) && value.every((entry) => typeof entry === \"string\") ? value : void 0;\n}\n/** Restores the last accepted live selection from journal projections, falling back on launch configuration. */\nfunction restoreHeadlessSelection(entries, fallback) {\n\tlet projected;\n\tfor (let index = entries.length - 1; index >= 0 && projected === void 0; index -= 1) {\n\t\tconst entry = entries[index];\n\t\tif (!isRecord(entry) || entry.type !== \"custom\" || !isRecord(entry.data)) continue;\n\t\tif (projected === void 0 && entry.customType === \"po-context\") {\n\t\t\tconst selection = entry.data.selection;\n\t\t\tif (!isRecord(selection) || typeof selection.majorMode !== \"string\") continue;\n\t\t\tconst domains = stringArray(selection.domains);\n\t\t\tif (domains === void 0 || selection.profile !== void 0 && typeof selection.profile !== \"string\") continue;\n\t\t\tprojected = {\n\t\t\t\tmajorMode: selection.majorMode,\n\t\t\t\tdomains,\n\t\t\t\t...typeof selection.profile === \"string\" ? { profile: selection.profile } : {}\n\t\t\t};\n\t\t}\n\t}\n\treturn {\n\t\t...fallback,\n\t\t...projected\n\t};\n}\nfunction isJsonValue(value) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value);\n\tif (Array.isArray(value)) return value.every(isJsonValue);\n\treturn isRecord(value) && Object.values(value).every(isJsonValue);\n}\nfunction assertJsonMessageData(value) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst visit = (item, depth) => {\n\t\tif (depth > 128) throw new TypeError(\"Message data is too deeply nested.\");\n\t\tif (item === null || typeof item === \"string\" || typeof item === \"boolean\") return;\n\t\tif (typeof item === \"number\" && Number.isFinite(item)) return;\n\t\tif (typeof item !== \"object\" || seen.has(item)) throw new TypeError(\"Message data must be JSON serializable.\");\n\t\tseen.add(item);\n\t\tfor (const child of Object.values(item)) if (child !== void 0) visit(child, depth + 1);\n\t\tseen.delete(item);\n\t};\n\tvisit(value, 0);\n}\nfunction boundedJsonCopy(value, limit = 16777216) {\n\tassertJsonMessageData(value);\n\tconst encoded = JSON.stringify(value);\n\tif (encoded.length > limit) throw new TypeError(\"Message data exceeds the serialization limit.\");\n\treturn JSON.parse(encoded);\n}\nfunction isSummaryMessage(value) {\n\tif (!isRecord(value) || typeof value.timestamp !== \"number\" || !Number.isFinite(value.timestamp)) return false;\n\tif (value.role === \"user\") return typeof value.content === \"string\" || isToolContent(value.content);\n\tif (value.role === \"custom\") return typeof value.customType === \"string\" && typeof value.display === \"boolean\" && (typeof value.content === \"string\" || isToolContent(value.content));\n\tif (value.role === \"compactionSummary\") return typeof value.summary === \"string\" && typeof value.tokensBefore === \"number\";\n\tif (value.role === \"branchSummary\") return typeof value.summary === \"string\" && (value.fromId === null || typeof value.fromId === \"string\");\n\tif (value.role === \"bashExecution\") return typeof value.command === \"string\" && typeof value.output === \"string\" && typeof value.cancelled === \"boolean\" && typeof value.truncated === \"boolean\" && (value.exitCode === void 0 || typeof value.exitCode === \"number\");\n\tif (value.role === \"toolResult\") return isToolContent(value.content) && isAgentMessage(value);\n\treturn value.role === \"assistant\" && Array.isArray(value.content) && value.content.every((part) => {\n\t\tif (!isRecord(part)) return false;\n\t\tif (part.type === \"text\") return typeof part.text === \"string\";\n\t\tif (part.type === \"thinking\") return typeof part.thinking === \"string\";\n\t\treturn part.type === \"toolCall\" && typeof part.id === \"string\" && typeof part.name === \"string\" && isJsonObject(part.arguments);\n\t}) && isAgentMessage(value);\n}\nfunction isJsonObject(value) {\n\treturn isRecord(value) && Object.values(value).every(isJsonValue);\n}\nfunction isToolContent(value) {\n\treturn Array.isArray(value) && value.every((part) => {\n\t\tif (!isRecord(part)) return false;\n\t\tif (part.type === \"text\") return typeof part.text === \"string\";\n\t\treturn part.type === \"image\" && typeof part.data === \"string\" && typeof part.mimeType === \"string\";\n\t});\n}\nfunction isUsage(value) {\n\tif (!isRecord(value) || !isRecord(value.cost)) return false;\n\tconst cost = value.cost;\n\treturn [\n\t\t\"input\",\n\t\t\"output\",\n\t\t\"cacheRead\",\n\t\t\"cacheWrite\",\n\t\t\"totalTokens\"\n\t].every((key) => typeof value[key] === \"number\" && Number.isFinite(value[key])) && [\n\t\t\"input\",\n\t\t\"output\",\n\t\t\"cacheRead\",\n\t\t\"cacheWrite\",\n\t\t\"total\"\n\t].every((key) => typeof cost[key] === \"number\" && Number.isFinite(cost[key]));\n}\nfunction isAgentMessage(value) {\n\tif (!isRecord(value) || typeof value.timestamp !== \"number\" || !Number.isFinite(value.timestamp)) return false;\n\tif (value.role === \"user\") return typeof value.content === \"string\" || Array.isArray(value.content);\n\tif (!Array.isArray(value.content)) return false;\n\tif (value.role === \"assistant\") return typeof value.api === \"string\" && typeof value.provider === \"string\" && typeof value.model === \"string\" && typeof value.stopReason === \"string\" && isUsage(value.usage);\n\treturn value.role === \"toolResult\" && typeof value.toolCallId === \"string\" && typeof value.toolName === \"string\" && typeof value.isError === \"boolean\";\n}\nfunction isCompactResult(value) {\n\treturn isRecord(value) && typeof value.summary === \"string\" && typeof value.tokensBefore === \"number\" && Number.isFinite(value.tokensBefore) && Array.isArray(value.retainedTail) && value.retainedTail.every(isAgentMessage) && (value.usage === void 0 || isUsage(value.usage)) && (value.details === void 0 || isJsonValue(value.details));\n}\nfunction modelIdentity(model) {\n\treturn {\n\t\tprovider: model.provider,\n\t\tid: model.id\n\t};\n}\nfunction modelMetadata(model) {\n\tconst compat = {};\n\tconst source = model.compat;\n\tfor (const key of [\n\t\t\"supportsStore\",\n\t\t\"supportsDeveloperRole\",\n\t\t\"supportsReasoningEffort\",\n\t\t\"supportsUsageInStreaming\",\n\t\t\"supportsStrictMode\",\n\t\t\"maxTokensField\",\n\t\t\"sendSessionAffinityHeaders\",\n\t\t\"sessionAffinityFormat\",\n\t\t\"supportsLongCacheRetention\",\n\t\t\"thinkingFormat\",\n\t\t\"requiresReasoningContentOnAssistantMessages\",\n\t\t\"cacheControlFormat\",\n\t\t\"forceAdaptiveThinking\",\n\t\t\"allowEmptySignature\"\n\t]) {\n\t\tconst value = source?.[key];\n\t\tif (typeof value === \"boolean\" || typeof value === \"string\") compat[key] = value;\n\t}\n\tlet baseUrl;\n\ttry {\n\t\tconst url = new URL(model.baseUrl);\n\t\turl.username = \"\";\n\t\turl.password = \"\";\n\t\turl.search = \"\";\n\t\turl.hash = \"\";\n\t\tbaseUrl = url.toString();\n\t} catch {\n\t\tbaseUrl = void 0;\n\t}\n\treturn Object.freeze({\n\t\tprovider: model.provider,\n\t\tid: model.id,\n\t\tapi: model.api,\n\t\tname: model.name,\n\t\t...baseUrl ? { baseUrl } : {},\n\t\tcompat: Object.freeze(compat)\n\t});\n}\nfunction mapResources(resources) {\n\tconst skills = [];\n\tconst promptTemplates = [];\n\tconst context = [];\n\tfor (const resource of resources) if (resource.kind === \"skill\") {\n\t\tconst skill = headlessHarnessSkill(resource);\n\t\tskills.push(skill);\n\t} else if (resource.kind === \"prompt\") promptTemplates.push({\n\t\tname: resource.name,\n\t\tcontent: resource.text\n\t});\n\telse context.push(resource.text);\n\treturn {\n\t\tharness: {\n\t\t\tskills,\n\t\t\tpromptTemplates\n\t\t},\n\t\tcontext\n\t};\n}\nfunction toolAdapter(tool, executionContext, reportedErrors) {\n\treturn {\n\t\tname: tool.name,\n\t\tlabel: tool.label ?? tool.name,\n\t\tdescription: tool.description,\n\t\tparameters: tool.parameters,\n\t\t...tool.promptSnippet === void 0 ? {} : { promptSnippet: tool.promptSnippet },\n\t\t...tool.promptGuidelines === void 0 ? {} : { promptGuidelines: tool.promptGuidelines },\n\t\t...tool.executionMode === void 0 ? {} : { executionMode: tool.executionMode === \"parallel\" ? \"parallel\" : \"sequential\" },\n\t\tasync execute(toolCallId, parameters, onUpdate, _toolContext, _invocation, context) {\n\t\t\tconst continuation = _invocation?.toolContinuation;\n\t\t\tconst result = await tool.execute(toolCallId, parameters, context.abortSignal, (partial) => onUpdate({\n\t\t\t\tcontent: partial.content,\n\t\t\t\tdetails: partial.details\n\t\t\t}), {\n\t\t\t\t...executionContext(),\n\t\t\t\t...continuation ? { toolContinuation: continuation } : {}\n\t\t\t});\n\t\t\tconst sequence = isBashSequenceEnvelope(tool.name, parameters);\n\t\t\tif (result.isError === true && !sequence) reportedErrors.add(toolCallId);\n\t\t\treturn {\n\t\t\t\tcontent: dropInvalidImages(result.content),\n\t\t\t\tdetails: result.details,\n\t\t\t\t...sequence && result.isError === true ? { isError: true } : {}\n\t\t\t};\n\t\t}\n\t};\n}\nfunction eventHook(event) {\n\treturn {\n\t\trun_start: \"agent_start\",\n\t\trun_resume: \"agent_start\",\n\t\trun_end: \"agent_settled\",\n\t\tturn_start: \"turn_start\",\n\t\tturn_end: \"turn_end\",\n\t\tmessage_start: \"message_start\",\n\t\tmessage_update: \"message_update\",\n\t\tmessage_end: \"message_end\",\n\t\ttool_execution_start: \"tool_execution_start\",\n\t\ttool_execution_update: \"tool_execution_update\",\n\t\ttool_execution_end: \"tool_execution_end\",\n\t\tcompaction_end: \"session_compact\",\n\t\tnavigation_start: \"session_tree\",\n\t\tnavigation_end: \"session_tree\"\n\t}[event];\n}\nfunction emitTo(listeners, frame) {\n\tconst snapshot = [...listeners];\n\tfor (const listener of snapshot) try {\n\t\tlistener(frame);\n\t} catch {}\n}\nfunction createHeadlessCompositionPublisher(runtime, host, environment, groups, readSystemPrompt, alive) {\n\tlet countTokens;\n\tlet contextRevision = 0;\n\tlet publishedContext;\n\tlet tail = Promise.resolve();\n\tconst publish = async (selection) => {\n\t\tif (!alive()) return;\n\t\tcountTokens ??= (await import(\"gpt-tokenizer\")).countTokens;\n\t\tif (!alive()) return;\n\t\tconst inventory = host.getContextInventory(selection, countTokens);\n\t\tconst prompt = readSystemPrompt();\n\t\tconst promptCost = prompt === void 0 ? void 0 : {\n\t\t\ttokens: countTokens(prompt.text),\n\t\t\tstage: prompt.stage\n\t\t};\n\t\tconst context = projectContext({\n\t\t\trevision: contextRevision + 1,\n\t\t\tmajorMode: selection.majorMode,\n\t\t\t...selection.profile === void 0 ? {} : { profile: selection.profile },\n\t\t\tgroups: groups(selection),\n\t\t\tdomains: selection.domains,\n\t\t\tsources: inventory.sources,\n\t\t\tskills: inventory.skills,\n\t\t\tattribution: inventory.attribution,\n\t\t\tcountTokens,\n\t\t\t...promptCost === void 0 ? {} : { systemPrompt: promptCost }\n\t\t});\n\t\tconst contextKey = JSON.stringify({\n\t\t\t...context,\n\t\t\trevision: 0,\n\t\t\tpromptText: prompt?.text\n\t\t});\n\t\tif (contextKey === publishedContext) return;\n\t\tconst revision = contextRevision + 1;\n\t\tconst details = buildContextDetail({\n\t\t\tsources: inventory.sources,\n\t\t\tskills: inventory.skills,\n\t\t\tcountTokens,\n\t\t\t...prompt === void 0 || promptCost === void 0 ? {} : { systemPrompt: {\n\t\t\t\ttext: prompt.text,\n\t\t\t\ttokens: promptCost.tokens,\n\t\t\t\tstage: prompt.stage\n\t\t\t} }\n\t\t});\n\t\tawait runtime.appendCustomEntry(PO_CONTEXT_ENTRY_TYPE, {\n\t\t\t...context,\n\t\t\trevision\n\t\t});\n\t\tif (!alive()) return;\n\t\twriteContextDetail(runtime.sessionId, revision, details, environment, {\n\t\t\t...context,\n\t\t\trevision\n\t\t});\n\t\tcontextRevision = revision;\n\t\tpublishedContext = contextKey;\n\t};\n\treturn (selection = host.context.selection) => {\n\t\ttail = tail.then(() => publish(selection), () => publish(selection));\n\t\treturn tail;\n\t};\n}\n/**\n* The project instructions an MCP client may read: repository-relative, never the global AGENTS.md,\n* and never a file whose canonical path leaves the repository. Resolved once, like the files\n* themselves; an unresolvable root or agent directory is kept and reported on read.\n*/\nasync function repositoryInstructions(platform, repoRoot, agentDir, files) {\n\tconst env = platform.env(repoRoot);\n\tconst canonical = async (target) => {\n\t\tconst result = await env.canonicalPath(target, BACKGROUND_CONTEXT);\n\t\tif (!result.ok) throw result.error;\n\t\treturn result.value;\n\t};\n\ttry {\n\t\tconst root = await canonical(repoRoot);\n\t\tconst globalInstruction = path.join(await canonical(agentDir), \"AGENTS.md\");\n\t\tconst out = [];\n\t\tfor (const { path: filePath, content } of files) {\n\t\t\tconst relative = path.relative(repoRoot, filePath);\n\t\t\tif (relative === \"\" || relative.startsWith(\"..\") || path.isAbsolute(relative)) continue;\n\t\t\tconst canonicalPath = await canonical(filePath).catch(() => void 0);\n\t\t\tif (canonicalPath === void 0 || canonicalPath === globalInstruction) continue;\n\t\t\tconst canonicalRelative = path.relative(root, canonicalPath);\n\t\t\tif (canonicalRelative === \"\" || canonicalRelative.startsWith(\"..\") || path.isAbsolute(canonicalRelative)) continue;\n\t\t\tout.push({\n\t\t\t\tpath: relative.replaceAll(path.sep, \"/\"),\n\t\t\t\tcontent\n\t\t\t});\n\t\t}\n\t\treturn out;\n\t} catch (error) {\n\t\treturn error instanceof Error ? error : new Error(String(error));\n\t} finally {\n\t\tawait env.cleanup(BACKGROUND_CONTEXT);\n\t}\n}\n/** Create the gated, same-process host used by direct-headless startup tests. */\n/**\n* Composes one server session's host.\n*\n* Its Pi extensions run in the server's process, so the session's admitted environment is\n* registered under its id for them to read instead of `process.env`, and released with it.\n*/\nasync function createHeadlessSessionHost(options) {\n\tif (options.workflowContext !== void 0 && (options.resume === true || options.parentSessionId !== options.workflowContext.run.ownerSessionId || options.sessionProvenance !== \"workflow\")) throw new Error(\"Workflow context requires a new step session owned by its workflow session.\");\n\tlet releaseEnvironment;\n\ttry {\n\t\toptions = {\n\t\t\t...options,\n\t\t\tenvironment: await prepareSessionEnvironment(options)\n\t\t};\n\t\treleaseEnvironment = registerPoSessionEnvironment(options.sessionId, options.environment);\n\t\treturn await composeHeadlessSessionHost(options, releaseEnvironment);\n\t} catch (error) {\n\t\tremoveContextDetail(options.sessionId, options.environment);\n\t\treleaseEnvironment?.();\n\t\tthrow error;\n\t}\n}\nasync function composeHeadlessSessionHost(options, releaseEnvironment) {\n\tconst parsed = validateDirectHeadlessArgs(options.agentArgs);\n\tconst models = await (options.modelDependencies ?? createNodeModelDependencies)(options);\n\tconst { agentDir, modelRuntime, projectContextFiles } = models;\n\tconst { platform } = options;\n\tconst instructions = await repositoryInstructions(platform, options.repoRoot, agentDir, projectContextFiles);\n\tfor (const override of options.providerOverrides?.() ?? []) {\n\t\tif (!override.name.trim() || override.name !== override.name.trim()) throw new Error(\"Invalid native provider identity.\");\n\t\tconst url = new URL(override.baseUrl);\n\t\tif (![\"http:\", \"https:\"].includes(url.protocol) || url.username || url.password) throw new Error(\"Invalid native provider base URL.\");\n\t\tif (modelRuntime.getRegisteredNativeProvider(override.name)) continue;\n\t\tmodelRuntime.registerProvider(override.name, { baseUrl: override.baseUrl });\n\t}\n\tconst resolved = await models.resolveModel(parsed);\n\tif (parsed.apiKey !== void 0) await modelRuntime.setRuntimeApiKey(resolved.model.provider, parsed.apiKey);\n\tconst reportedToolErrors = /* @__PURE__ */ new Set();\n\tlet promptPreparationFailed = false;\n\tlet promptPreparationError;\n\tlet headlessReady = false;\n\tlet toolGuidance = [];\n\tconst initialSystemPrompt = [parsed.systemPrompt, ...parsed.appendSystemPrompt ?? []].filter(Boolean).join(\"\\n\\n\");\n\t/**\n\t* AGENTS.md and friends, in Pi's own framing.\n\t*\n\t* The server had none of this: its prompt began at the --system-prompt flag, so a\n\t* repository's own instructions reached a terminal session and never a cockpit one.\n\t* Mirrors @earendil-works/pi-coding-agent@0.86.0 dist/core/system-prompt.js:21-27\n\t* (the customPrompt branch, which is the shape this host matches). `buildSystemPrompt`\n\t* is not exported and the package exports map has no wildcard, so the four literals\n\t* below are copied; re-diff them against that file on upgrade.\n\t*\n\t* Not trust-gated, deliberately: TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES in Pi's\n\t* trust-manager covers settings.json, extensions, skills, prompts, themes, SYSTEM.md\n\t* and APPEND_SYSTEM.md, all of which execute or replace instructions. AGENTS.md is\n\t* advisory prose and Pi appends it unconditionally; gating it here would be a\n\t* divergence from Pi rather than parity with it.\n\t*\n\t* Resolved once: cwd is fixed for the host's lifetime, and composeSystemPrompt runs\n\t* on every generation.\n\t*/\n\tconst projectContextBlock = (() => {\n\t\tif (projectContextFiles.length === 0) return \"\";\n\t\treturn `<project_context>\\n\\nProject-specific instructions and guidelines:\\n\\n${projectContextFiles.map(({ path: filePath, content }) => `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n`).join(\"\\n\")}\\n</project_context>`;\n\t})();\n\tconst workingDirectoryLine = `Current working directory: ${options.cwd.replace(/\\\\/g, \"/\")}`;\n\t/**\n\t* Everything the prompt is made of before a package has had a say.\n\t*\n\t* Shared with the runtime callback below rather than copied. Assembling it is\n\t* pure; the hook pass that follows it there is not, which is why the context\n\t* panel is shown this rather than a prompt built for the panel's sake.\n\t*/\n\tconst composeSystemPrompt = (resources) => {\n\t\tconst mapped = mapResources(resources);\n\t\tconst skills = formatSkillsForSystemPrompt(systemPromptSkills(resources, toolGuidance.some((entry) => entry.name === PO_LOAD_SKILL_TOOL)).map(headlessHarnessSkill)).trim();\n\t\treturn [\n\t\t\tinitialSystemPrompt,\n\t\t\tprojectContextBlock,\n\t\t\tformatToolPrompt(toolGuidance),\n\t\t\tskills,\n\t\t\t...mapped.context,\n\t\t\tworkingDirectoryLine,\n\t\t\toptions.environment[\"PO_SESSION_TEMP_DIR\"] ? `Session temporary folder: ${options.environment[PO_SESSION_TEMP_DIR]}\\nUse this folder for generated scratch files outside the workspace. Keep workspace edits in place and save important deliverables in session artifacts. Temporary files may be removed by the operating system.` : \"\"\n\t\t].filter(Boolean).join(\"\\n\\n\");\n\t};\n\t/** The last prompt a turn actually built, once one has. */\n\tlet builtSystemPrompt;\n\t/**\n\t* What the context panel is shown: the prompt a turn sent, or the hook-free\n\t* base until one has.\n\t*\n\t* The base is composed from the applied snapshot rather than a fresh read, so\n\t* it answers at exactly the moments the tool inventory beside it answers.\n\t* Re-reading refuses while a selection is mid-apply, and the panel would then\n\t* spend a published revision saying there is no prompt before the next one\n\t* said there is.\n\t*/\n\tconst readSystemPrompt = () => {\n\t\tif (!headlessHost) return void 0;\n\t\tif (builtSystemPrompt !== void 0) return {\n\t\t\ttext: builtSystemPrompt,\n\t\t\tstage: \"effective\"\n\t\t};\n\t\treturn {\n\t\t\ttext: composeSystemPrompt(headlessHost.appliedResources),\n\t\t\tstage: \"base\"\n\t\t};\n\t};\n\tconst beforeTool = async (event, context) => {\n\t\tif (!headlessReady || !headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\tif (isBashSequenceEnvelope(event.toolName, event.args)) return void 0;\n\t\tconst patches = await headlessHost.dispatchHook(\"tool_call\", event, context.abortSignal);\n\t\tlet args = event.args;\n\t\tlet block;\n\t\tfor (const patch of patches) {\n\t\t\tif (!isRecord(patch)) continue;\n\t\t\tif (patch.args !== void 0) {\n\t\t\t\tif (!isJsonObject(patch.args)) throw new Error(\"Invalid headless tool arguments\");\n\t\t\t\targs = patch.args;\n\t\t\t}\n\t\t\tif (patch.block === void 0) continue;\n\t\t\tif (!isRecord(patch.block) || typeof patch.block.reason !== \"string\" || patch.block.terminate !== void 0 && typeof patch.block.terminate !== \"boolean\") throw new Error(\"Invalid headless tool denial\");\n\t\t\tblock = {\n\t\t\t\treason: patch.block.reason,\n\t\t\t\t...typeof patch.block.terminate === \"boolean\" ? { terminate: patch.block.terminate } : {}\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\treturn {\n\t\t\t...args === event.args ? {} : { args },\n\t\t\t...block === void 0 ? {} : { block }\n\t\t};\n\t};\n\tconst afterTool = async (event, context) => {\n\t\tif (!headlessReady || !headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\tif (isBashSequenceEnvelope(event.toolName, event.args)) return void 0;\n\t\tconst original = reportedToolErrors.delete(event.toolCallId) ? {\n\t\t\t...event,\n\t\t\tisError: true\n\t\t} : event;\n\t\tconst patches = await headlessHost.dispatchHook(\"tool_result\", original, context.abortSignal);\n\t\tlet content = original.content;\n\t\tlet details = original.details;\n\t\tlet isError = original.isError;\n\t\tlet usage = original.usage;\n\t\tlet terminate;\n\t\tlet resultRewritten = false;\n\t\tfor (const patch of patches) {\n\t\t\tif (!isRecord(patch)) continue;\n\t\t\tif (isToolContent(patch.content)) {\n\t\t\t\tcontent = patch.content;\n\t\t\t\tresultRewritten = true;\n\t\t\t}\n\t\t\tif (\"details\" in patch && isJsonValue(patch.details)) {\n\t\t\t\tdetails = patch.details;\n\t\t\t\tresultRewritten = true;\n\t\t\t}\n\t\t\tif (typeof patch.isError === \"boolean\") {\n\t\t\t\tisError = patch.isError;\n\t\t\t\tresultRewritten = true;\n\t\t\t}\n\t\t\tif (isUsage(patch.usage)) usage = patch.usage;\n\t\t\tif (typeof patch.terminate === \"boolean\") terminate = patch.terminate;\n\t\t}\n\t\tif (resultRewritten && isRecord(details) && \"app\" in details) {\n\t\t\tconst { app: _app, ...redactedDetails } = details;\n\t\t\tdetails = redactedDetails;\n\t\t}\n\t\treturn {\n\t\t\t...content === event.content ? {} : { content },\n\t\t\t...details === event.details ? {} : { details },\n\t\t\t...isError === event.isError ? {} : { isError },\n\t\t\t...usage === event.usage ? {} : { usage },\n\t\t\t...terminate === void 0 ? {} : { terminate }\n\t\t};\n\t};\n\tconst selectionCommand = new AsyncLocalStorage();\n\tconst runtime = await createDirectHarnessRuntime({\n\t\tcwd: options.cwd,\n\t\tsessionId: options.sessionId,\n\t\tonFullHistoryRead: (sessionId, entryCount) => {\n\t\t\tobserve(Promise.resolve().then(() => options.telemetry?.recordEvent?.(\"po_server.history_full_read\", {\n\t\t\t\tsession_id: sessionId,\n\t\t\t\tentry_count: entryCount\n\t\t\t})));\n\t\t},\n\t\t...options.initialFastMode === void 0 ? {} : { initialFastMode: options.initialFastMode },\n\t\t...options.initialAgentLocked === void 0 ? {} : { initialAgentLocked: options.initialAgentLocked },\n\t\t...options.parentSessionId === void 0 ? {} : { parentSessionId: options.parentSessionId },\n\t\t...options.resume ? { resume: true } : {},\n\t\tplatform,\n\t\tsessionName: parsed.name ?? options.sessionName,\n\t\tmodels: modelRuntime,\n\t\tmodel: resolved.model,\n\t\t...resolved.thinkingLevel === void 0 ? {} : { thinkingLevel: resolved.thinkingLevel },\n\t\tbeforeModelRequest: async ({ phase }) => {\n\t\t\tif (!headlessReady || !headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\t\tif (phase === \"turn\" && options.inheritedSelection) await headlessHost.inheritSelection(await options.inheritedSelection());\n\t\t\tawait headlessHost.settled();\n\t\t},\n\t\ttransformContext: async (event) => {\n\t\t\tif (!headlessReady || !headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\t\tconst patches = await headlessHost.dispatchHook(\"context\", event);\n\t\t\tlet messages = event.messages;\n\t\t\tlet systemPrompt = event.systemPrompt;\n\t\t\tfor (const patch of patches) {\n\t\t\t\tif (!isRecord(patch)) continue;\n\t\t\t\tif (patch.messages !== void 0) {\n\t\t\t\t\tif (!Array.isArray(patch.messages)) throw new Error(\"Invalid headless context messages\");\n\t\t\t\t\tmessages = patch.messages;\n\t\t\t\t}\n\t\t\t\tif (patch.systemPrompt !== void 0) {\n\t\t\t\t\tif (typeof patch.systemPrompt !== \"string\") throw new Error(\"Invalid headless context system prompt\");\n\t\t\t\t\tsystemPrompt = patch.systemPrompt;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tmessages: await (piHost?.transformContext(messages) ?? messages),\n\t\t\t\tsystemPrompt\n\t\t\t};\n\t\t},\n\t\tbeforeTool,\n\t\tafterTool,\n\t\tbeforePayload: async (event) => {\n\t\t\tif (!headlessReady || !headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\t\tconst patches = await headlessHost.dispatchHook(\"before_provider_request\", event);\n\t\t\tlet payload = event.payload;\n\t\t\tfor (const patch of patches) {\n\t\t\t\tif (patch === void 0 || patch === null) continue;\n\t\t\t\tif (!isRecord(patch) || !(\"payload\" in patch)) throw new Error(\"Invalid headless provider payload patch\");\n\t\t\t\tpayload = patch.payload;\n\t\t\t}\n\t\t\treturn { payload };\n\t\t},\n\t\tbeforeCompaction: async (event) => {\n\t\t\tif (!headlessReady || !headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\t\tconst patches = await headlessHost.dispatchHook(\"session_before_compact\", {\n\t\t\t\treason: event.reason,\n\t\t\t\tpreparation: event.preparation,\n\t\t\t\t...event.customInstructions === void 0 ? {} : {\n\t\t\t\t\tinstructions: event.customInstructions,\n\t\t\t\t\tcustomInstructions: event.customInstructions\n\t\t\t\t}\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tfor (const patch of patches) {\n\t\t\t\t\tif (patch === void 0 || patch === null) continue;\n\t\t\t\t\tif (!isRecord(patch)) throw new Error(\"Invalid headless compaction patch\");\n\t\t\t\t\tif (patch.cancel !== void 0 && typeof patch.cancel !== \"boolean\") throw new Error(\"Invalid headless compaction cancellation\");\n\t\t\t\t\tif (patch.decline !== void 0 && typeof patch.decline !== \"boolean\") throw new Error(\"Invalid headless compaction decline\");\n\t\t\t\t\tconst decline = patch.cancel === true || patch.decline === true;\n\t\t\t\t\tif (decline && patch.compaction !== void 0) throw new Error(\"Conflicting headless compaction patch\");\n\t\t\t\t\tif (decline) return { decline: true };\n\t\t\t\t\tif (patch.compaction !== void 0) {\n\t\t\t\t\t\tif (!isCompactResult(patch.compaction)) throw new Error(\"Invalid headless compaction result\");\n\t\t\t\t\t\treturn { compaction: patch.compaction };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\toptions.onNotice?.(`Headless compaction hook rejected: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t\treturn { decline: true };\n\t\t\t}\n\t\t\treturn piHost?.beforeCompaction(event);\n\t\t},\n\t\tsystemPrompt: async () => {\n\t\t\tlet stage = \"resources\";\n\t\t\ttry {\n\t\t\t\tif (!headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\t\t\tawait headlessHost.settled();\n\t\t\t\tlet prompt = composeSystemPrompt(await headlessHost.readResources());\n\t\t\t\tstage = \"before_agent_start hooks\";\n\t\t\t\tconst patches = await headlessHost.dispatchHook(\"before_agent_start\", { systemPrompt: prompt });\n\t\t\t\tfor (const patch of patches) if (patch && typeof patch === \"object\" && \"systemPrompt\" in patch && typeof patch.systemPrompt === \"string\") prompt = patch.systemPrompt;\n\t\t\t\tpromptPreparationFailed = false;\n\t\t\t\tpromptPreparationError = void 0;\n\t\t\t\tif (prompt !== builtSystemPrompt) {\n\t\t\t\t\tbuiltSystemPrompt = prompt;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait publishComposition();\n\t\t\t\t\t} catch {}\n\t\t\t\t}\n\t\t\t\treturn prompt;\n\t\t\t} catch (error) {\n\t\t\t\tpromptPreparationFailed = true;\n\t\t\t\tpromptPreparationError = error;\n\t\t\t\tobserve(Promise.resolve().then(() => options.telemetry?.recordError(PROMPT_PREPARATION_FAILED_EVENT, error, {\n\t\t\t\t\tsession_id: options.sessionId,\n\t\t\t\t\tstage\n\t\t\t\t}, { includeException: true })));\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t},\n\t\tlistCommands: () => {\n\t\t\tif (!headlessReady || !headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\t\treturn headlessHost.listCommands();\n\t\t},\n\t\tdispatchCommand: async (text) => {\n\t\t\tif (!headlessReady || !headlessHost) throw new Error(\"Headless capabilities are not installed.\");\n\t\t\tconst match = /^\\/(\\S+)(?:\\s+([\\s\\S]*))?$/.exec(text);\n\t\t\tif (!match) {\n\t\t\t\tawait headlessHost.settled();\n\t\t\t\theadlessHost.assertActive();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst name = match[1];\n\t\t\tconst args = match[2] ?? \"\";\n\t\t\tif (!headlessHost.listCommands().some((entry) => entry.name === name)) {\n\t\t\t\theadlessHost.assertActive();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tawait selectionCommand.run([\n\t\t\t\t\"mode\",\n\t\t\t\t\"domains\",\n\t\t\t\t\"profile\",\n\t\t\t\t\"minor\"\n\t\t\t].includes(name), () => headlessHost.dispatchCommand(name, args));\n\t\t\treturn true;\n\t\t},\n\t\tguardModelRequest: () => {\n\t\t\tif (promptPreparationFailed) throw new Error(`Headless capability preparation is not ready: ${harnessErrorMessage(promptPreparationError)}`, { cause: promptPreparationError });\n\t\t\tif (!headlessReady || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\t}\n\t});\n\tconst opened = await (async () => {\n\t\tawait runtime.session.commit(async (tx) => {\n\t\t\tconst metadata = await tx.doc(SessionMetadataDoc);\n\t\t\tmetadata.workspaceRoot = options.repoRoot;\n\t\t\tmetadata.execution = JSON.stringify({\n\t\t\t\tcwd: options.cwd,\n\t\t\t\trepoRoot: options.repoRoot,\n\t\t\t\tworkspaceId: options.workspaceId,\n\t\t\t\tgroupingRoot: options.groupingRoot ?? options.repoRoot,\n\t\t\t\tparentSessionId: options.parentSessionId,\n\t\t\t\tsessionProvenance: options.sessionProvenance,\n\t\t\t\tfiles: {\n\t\t\t\t\tagentDirectory: path.resolve(piAgentDirectory(options.environment, options.platform.homeDirectory)),\n\t\t\t\t\t...options.environment[\"PO_SESSION_TEMP_DIR\"] === void 0 ? {} : { temporaryDirectory: options.environment[PO_SESSION_TEMP_DIR] }\n\t\t\t\t}\n\t\t\t});\n\t\t}, BACKGROUND_CONTEXT);\n\t\tconst agent = await runtime.lane.agent(BACKGROUND_CONTEXT);\n\t\treturn {\n\t\t\tmodel: agent.model ? modelRuntime.getModel(agent.model.provider, agent.model.modelId) : void 0,\n\t\t\tentries: (await runtime.readEntries()).entries.filter((entry) => entry.type === \"custom\" && entry.customType === \"po-context\").slice(-1)\n\t\t};\n\t})().catch(async (error) => {\n\t\tawait runtime.dispose().catch((disposeError) => options.onNotice?.(`Session runtime failed to close: ${String(disposeError)}`));\n\t\tthrow error;\n\t});\n\tlet currentModel = opened.model;\n\tlet publishedAgentModel;\n\tconst sessionContext = options.workspaceId === void 0 ? void 0 : Object.freeze({\n\t\tsessionId: runtime.sessionId,\n\t\tworkspaceId: options.workspaceId,\n\t\tworkspaceRoot: options.groupingRoot ?? options.repoRoot,\n\t\tcheckoutRoot: options.repoRoot,\n\t\tcwd: options.cwd,\n\t\t...options.parentSessionId === void 0 ? {} : { parentSessionId: options.parentSessionId },\n\t\t...options.sessionProvenance === void 0 ? {} : { provenance: options.sessionProvenance }\n\t});\n\tconst entries = opened.entries;\n\tconst listeners = /* @__PURE__ */ new Set();\n\tconst selectionListeners = /* @__PURE__ */ new Set();\n\tconst backgroundWorkListeners = /* @__PURE__ */ new Set();\n\tlet backgroundWorkActive = null;\n\tlet backgroundWorkBinding;\n\tlet latestSelection = options.selection;\n\tconst initialSelection = restoreHeadlessSelection(entries, options.selection);\n\tlet headlessHost;\n\tlet mcpServiceRoot;\n\tlet mcpLifecycle = new AbortController();\n\tconst chatgptLifecycle = new AbortController();\n\tlet piHost;\n\tlet client;\n\tlet disposed = false;\n\tlet disposePromise;\n\tlet publishComposition = async () => {\n\t\tthrow new Error(\"Direct headless composition publisher is not installed.\");\n\t};\n\tconst readMcpContext = (signal) => {\n\t\tsignal.throwIfAborted();\n\t\tconst host = headlessHost;\n\t\tif (!host || disposed) throw new Error(\"Session context is unavailable.\");\n\t\tconst status = host.status;\n\t\tif (!status.ready || status.requestedRevision !== status.appliedRevision) throw new Error(\"Session context is unavailable.\");\n\t\tif (instructions instanceof Error) throw instructions;\n\t\tconst selection = host.context.selection;\n\t\tconst persona = host.appliedResources.find(({ name, kind }) => name === \"po/profile-config\" && kind === \"context\")?.text;\n\t\tsignal.throwIfAborted();\n\t\tconst current = host.status;\n\t\tif (!current.ready || current.appliedRevision !== status.appliedRevision || current.requestedRevision !== current.appliedRevision) throw new Error(\"Session context changed. Call load_context again.\");\n\t\treturn {\n\t\t\tsession: {\n\t\t\t\tid: runtime.sessionId,\n\t\t\t\trevision: status.appliedRevision\n\t\t\t},\n\t\t\trepository: {\n\t\t\t\troot: options.repoRoot,\n\t\t\t\tcwd: options.cwd\n\t\t\t},\n\t\t\tselection: {\n\t\t\t\tprofile: selection.profile ?? null,\n\t\t\t\tdomains: [...selection.domains],\n\t\t\t\tmajorMode: selection.majorMode,\n\t\t\t\tactiveLayers: [...selection.activeLayers],\n\t\t\t\tminorModes: [...selection.state?.[\"minor-mode\"] ?? []]\n\t\t\t},\n\t\t\tinstructions,\n\t\t\tpersona: persona ?? null\n\t\t};\n\t};\n\tlet appliedChildTools = [];\n\tconst childHookRegistry = createPoChildSessionHookRegistry();\n\tconst childSessionProvider = createHeadlessChildSessionServiceProvider({\n\t\truntime,\n\t\tcwd: options.cwd,\n\t\tfs: platform.env(options.cwd),\n\t\tsubscribeMcpTool: (listener) => {\n\t\t\treturn mcpServiceRoot?.on(\"internal/service\", (name) => {\n\t\t\t\tif (name === \"po/child-session-mcp-tool\") listener();\n\t\t\t}) ?? (() => void 0);\n\t\t},\n\t\thooks: () => {\n\t\t\tif (disposed || !headlessReady || !headlessHost?.status.ready) throw new Error(\"Headless capabilities are not installed.\");\n\t\t\treturn composeChildSessionHooks([mcpServiceRoot?.get(PO_CHILD_SESSION_HOOKS_SERVICE), ...childHookRegistry.list()], options.onNotice);\n\t\t},\n\t\tmcpTool: () => {\n\t\t\tif (disposed || !headlessReady || !headlessHost?.status.ready) return void 0;\n\t\t\treturn mcpServiceRoot?.get(PO_CHILD_SESSION_MCP_TOOL_SERVICE);\n\t\t},\n\t\tparentTools: () => {\n\t\t\tif (disposed || !headlessReady || !headlessHost?.status.ready) return void 0;\n\t\t\treturn {\n\t\t\t\ttools: appliedChildTools,\n\t\t\t\tallows: (name) => headlessHost.allowsTool(name)\n\t\t\t};\n\t\t}\n\t});\n\tconst completeAuxiliaryModel = async (reference, request) => {\n\t\tif (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\trequest.signal?.throwIfAborted();\n\t\tconst separator = reference.indexOf(\"/\");\n\t\tconst model = separator > 0 ? modelRuntime.getModel(reference.slice(0, separator), reference.slice(separator + 1)) : void 0;\n\t\tif (!model || !modelRuntime.hasConfiguredAuth(model.provider)) throw new Error(`Model is not configured: ${reference}`);\n\t\tif (!runtime.completeModel) throw new Error(\"The runtime does not support auxiliary model requests.\");\n\t\tconst response = await runtime.completeModel(model, {\n\t\t\tsystemPrompt: request.systemPrompt,\n\t\t\tmessages: [{\n\t\t\t\trole: \"user\",\n\t\t\t\tcontent: request.input,\n\t\t\t\ttimestamp: Date.now()\n\t\t\t}],\n\t\t\t...request.tools ? { tools: [...request.tools] } : {}\n\t\t}, {\n\t\t\tsignal: request.signal,\n\t\t\tmaxTokens: request.maxTokens,\n\t\t\tcacheRetention: request.cacheRetention,\n\t\t\treasoningEffort: \"none\",\n\t\t\tmaxRetries: 0\n\t\t});\n\t\tif (request.recordUsage) await runtime.recordUsage(response.usage, { details: {\n\t\t\tpurpose: \"auxiliary_completion\",\n\t\t\tmodel: reference\n\t\t} });\n\t\trequest.signal?.throwIfAborted();\n\t\tif (request.recordUsage && response.stopReason === \"length\") throw new Error(\"Auxiliary model request exceeded its output limit.\");\n\t\tif (response.stopReason === \"error\" || response.stopReason === \"aborted\") throw new Error(response.errorMessage ?? `Model stopped: ${response.stopReason}`);\n\t\treturn response;\n\t};\n\tconst informationalMessage = (message) => {\n\t\tif (!message || typeof message.type !== \"string\" || !message.type.trim() || typeof message.text !== \"string\") throw new TypeError(\"Informational messages require a non-empty type and string text.\");\n\t\tif (message.display !== void 0 && typeof message.display !== \"boolean\") throw new TypeError(\"Informational message display must be a boolean.\");\n\t\tconst details = message.details === void 0 ? void 0 : boundedJsonCopy(message.details);\n\t\treturn {\n\t\t\trole: \"custom\",\n\t\t\tcustomType: message.type,\n\t\t\tcontent: message.text,\n\t\t\tdisplay: message.display ?? true,\n\t\t\t...details === void 0 ? {} : { details },\n\t\t\ttimestamp: Date.now()\n\t\t};\n\t};\n\tasync function* entriesNewestFirst(query) {\n\t\tconst limit = query?.limit;\n\t\tif (limit !== void 0 && (!Number.isSafeInteger(limit) || limit < 0)) throw new TypeError(\"History limit must be a non-negative safe integer.\");\n\t\tif (limit === 0) return;\n\t\tlet count = 0;\n\t\tfor await (const entry of durableEntriesNewestFirst(runtime.scanEntries.bind(runtime), BACKGROUND_CONTEXT)) {\n\t\t\tif (query?.type && entry.type !== query.type) continue;\n\t\t\tif (query?.customType && (entry.type !== \"custom\" || entry.customType !== query.customType)) continue;\n\t\t\tyield entry;\n\t\t\tif (++count === limit) return;\n\t\t}\n\t}\n\tconst executionContext = (selection) => ({\n\t\tcwd: options.cwd,\n\t\trepoRoot: options.repoRoot,\n\t\tsessionId: runtime.sessionId,\n\t\t...sessionContext === void 0 ? {} : { sessionContext },\n\t\tenvironment: options.environment,\n\t\tclient: client.client,\n\t\tmodel: currentModel === void 0 ? void 0 : modelMetadata(currentModel),\n\t\tgetModel(provider, id) {\n\t\t\tconst model = modelRuntime.getModel(provider, id);\n\t\t\treturn model ? modelMetadata(model) : void 0;\n\t\t},\n\t\tasync getAvailableModels() {\n\t\t\tif (disposed) throw new Error(\"The session is closed.\");\n\t\t\treturn (await modelRuntime.getAvailable()).filter((model) => modelRuntime.hasConfiguredAuth(model.provider)).map(({ provider, id }) => ({\n\t\t\t\tprovider,\n\t\t\t\tid\n\t\t\t}));\n\t\t},\n\t\tselection,\n\t\timageGeneration: {\n\t\t\tavailable: () => !disposed && modelRuntime.isUsingSubscription(\"po-chatgpt\"),\n\t\t\tasync generate(request) {\n\t\t\t\tif (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\t\t\treturn createChatgptImageClient({\n\t\t\t\t\tavailable: () => modelRuntime.isUsingSubscription(CHATGPT_AUTH_PROVIDER_ID),\n\t\t\t\t\tgetAuth: (signal) => modelRuntime.getAuth(CHATGPT_AUTH_PROVIDER_ID, { signal })\n\t\t\t\t}).generate({\n\t\t\t\t\t...request,\n\t\t\t\t\tsignal: request.signal ? AbortSignal.any([request.signal, chatgptLifecycle.signal]) : chatgptLifecycle.signal\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\twebSearch: {\n\t\t\tavailable: () => !disposed && modelRuntime.isUsingSubscription(\"po-chatgpt\"),\n\t\t\tasync search(request) {\n\t\t\t\tif (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\t\t\treturn createChatgptWebSearchClient({\n\t\t\t\t\tavailable: () => modelRuntime.isUsingSubscription(CHATGPT_AUTH_PROVIDER_ID),\n\t\t\t\t\tgetAuth: (signal) => modelRuntime.getAuth(CHATGPT_AUTH_PROVIDER_ID, { signal })\n\t\t\t\t}).search({\n\t\t\t\t\t...request,\n\t\t\t\t\tsessionId: runtime.sessionId,\n\t\t\t\t\t...currentModel?.provider === \"openai-codex\" ? { model: currentModel.id } : {},\n\t\t\t\t\tsignal: request.signal ? AbortSignal.any([request.signal, chatgptLifecycle.signal]) : chatgptLifecycle.signal\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\ttextCompletion: {\n\t\t\tavailable(reference) {\n\t\t\t\tconst separator = reference.indexOf(\"/\");\n\t\t\t\treturn separator > 0 && !!modelRuntime.getModel(reference.slice(0, separator), reference.slice(separator + 1)) && modelRuntime.hasConfiguredAuth(reference.slice(0, separator));\n\t\t\t},\n\t\t\tasync summarize(reference, request) {\n\t\t\t\tif (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\t\t\trequest.signal?.throwIfAborted();\n\t\t\t\tconst separator = reference.indexOf(\"/\");\n\t\t\t\tconst model = separator > 0 ? modelRuntime.getModel(reference.slice(0, separator), reference.slice(separator + 1)) : void 0;\n\t\t\t\tif (!model || !modelRuntime.hasConfiguredAuth(model.provider)) throw new Error(`Model is not configured: ${reference}`);\n\t\t\t\tif (!runtime.completeModel) throw new Error(\"The runtime does not support auxiliary model requests.\");\n\t\t\t\tassertJsonMessageData(request.messages);\n\t\t\t\tif (!Array.isArray(request.messages) || !request.messages.every(isSummaryMessage)) throw new TypeError(\"Summary requests require supported native messages.\");\n\t\t\t\tconst messages = boundedJsonCopy(request.messages.map((message) => \"content\" in message && Array.isArray(message.content) ? {\n\t\t\t\t\t...message,\n\t\t\t\t\tcontent: message.content.filter((part) => !isRecord(part) || part.type !== \"image\" && part.type !== \"thinking\")\n\t\t\t\t} : message));\n\t\t\t\tif (typeof request.instructions !== \"string\" || request.previousSummary !== void 0 && typeof request.previousSummary !== \"string\") throw new TypeError(\"Summary instructions and previous summary must be strings.\");\n\t\t\t\tif (request.thinkingLevel !== void 0 && ![\n\t\t\t\t\t\"off\",\n\t\t\t\t\t\"minimal\",\n\t\t\t\t\t\"low\",\n\t\t\t\t\t\"medium\",\n\t\t\t\t\t\"high\",\n\t\t\t\t\t\"xhigh\",\n\t\t\t\t\t\"max\"\n\t\t\t\t].includes(request.thinkingLevel)) throw new TypeError(\"Unsupported summary thinking level.\");\n\t\t\t\tlet summaryFailure;\n\t\t\t\tlet overflowed = false;\n\t\t\t\tconst attempt = (target) => summarize(messages, target, request.signal, request.instructions, request.previousSummary, request.thinkingLevel, (_model, context, options) => {\n\t\t\t\t\tconst stream = createAssistantMessageEventStream();\n\t\t\t\t\tconst maxTokens = target.maxTokens > 0 ? clampMaxTokensToContext(target, context, target.maxTokens) : options?.maxTokens;\n\t\t\t\t\truntime.completeModel(target, context, {\n\t\t\t\t\t\tsignal: options?.signal,\n\t\t\t\t\t\tmaxTokens,\n\t\t\t\t\t\tcacheRetention: \"none\",\n\t\t\t\t\t\treasoningEffort: !target.reasoning || request.thinkingLevel === \"off\" ? \"none\" : request.thinkingLevel,\n\t\t\t\t\t\tmaxRetries: 0\n\t\t\t\t\t}).then((response) => {\n\t\t\t\t\t\tif (response.stopReason === \"aborted\") summaryFailure = new Error(response.errorMessage ?? \"Summary was aborted.\");\n\t\t\t\t\t\toverflowed = isContextOverflow(response, target.contextWindow) || response.stopReason === \"length\" && maxTokens !== void 0 && maxTokens < target.maxTokens;\n\t\t\t\t\t\tstream.end(response);\n\t\t\t\t\t}, (error) => {\n\t\t\t\t\t\tsummaryFailure = error instanceof Error ? error : new Error(String(error));\n\t\t\t\t\t\tstream.end({\n\t\t\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\t\t\tapi: target.api,\n\t\t\t\t\t\t\tprovider: target.provider,\n\t\t\t\t\t\t\tmodel: target.id,\n\t\t\t\t\t\t\tcontent: [],\n\t\t\t\t\t\t\tstopReason: request.signal?.aborted ? \"aborted\" : \"error\",\n\t\t\t\t\t\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\t\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t\t\t\tusage: {\n\t\t\t\t\t\t\t\tinput: 0,\n\t\t\t\t\t\t\t\toutput: 0,\n\t\t\t\t\t\t\t\tcacheRead: 0,\n\t\t\t\t\t\t\t\tcacheWrite: 0,\n\t\t\t\t\t\t\t\ttotalTokens: 0,\n\t\t\t\t\t\t\t\tcost: {\n\t\t\t\t\t\t\t\t\tinput: 0,\n\t\t\t\t\t\t\t\t\toutput: 0,\n\t\t\t\t\t\t\t\t\tcacheRead: 0,\n\t\t\t\t\t\t\t\t\tcacheWrite: 0,\n\t\t\t\t\t\t\t\t\ttotal: 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\treturn stream;\n\t\t\t\t});\n\t\t\t\tlet summary;\n\t\t\t\ttry {\n\t\t\t\t\tsummary = await attempt(model);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst widest = overflowed && !request.signal?.aborted ? (await modelRuntime.getAvailable()).reduce((best, item) => item.contextWindow > best.contextWindow ? item : best, model) : model;\n\t\t\t\t\tif (widest === model) throw error;\n\t\t\t\t\tsummaryFailure = void 0;\n\t\t\t\t\tsummary = await attempt(widest);\n\t\t\t\t}\n\t\t\t\trequest.signal?.throwIfAborted();\n\t\t\t\tif (summaryFailure) throw summaryFailure;\n\t\t\t\tif (!summary.trim()) throw new Error(\"Summarization returned an empty checkpoint.\");\n\t\t\t\treturn summary;\n\t\t\t},\n\t\t\tasync complete(reference, request) {\n\t\t\t\treturn (await completeAuxiliaryModel(reference, {\n\t\t\t\t\t...request,\n\t\t\t\t\ttools: void 0\n\t\t\t\t})).content.filter((part) => part.type === \"text\").map((part) => part.text).join(\"\").trim();\n\t\t\t}\n\t\t},\n\t\ttoolCompletion: { async complete(reference, request) {\n\t\t\tconst response = await completeAuxiliaryModel(reference, request);\n\t\t\tif (response.stopReason === \"length\") throw new Error(\"Auxiliary tool request exceeded its output limit.\");\n\t\t\treturn {\n\t\t\t\ttoolCalls: response.content.filter((part) => part.type === \"toolCall\"),\n\t\t\t\tusage: response.usage\n\t\t\t};\n\t\t} },\n\t\tsession: {\n\t\t\tsetFastMode: (enabled) => runtime.setFastMode(enabled),\n\t\t\tasync readModelSettings() {\n\t\t\t\tconst selected = (await runtime.lane.agent(BACKGROUND_CONTEXT)).model;\n\t\t\t\tconst model = selected ? modelRuntime.getModel(selected.provider, selected.modelId) : void 0;\n\t\t\t\tconst thinkingLevel = (await runtime.lane.agent(BACKGROUND_CONTEXT)).thinkingLevel;\n\t\t\t\treturn {\n\t\t\t\t\t...model ? { model: modelIdentity(model) } : {},\n\t\t\t\t\tthinkingLevel\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync setModelSettings(settings) {\n\t\t\t\tif (settings.model) await runtime.setModel(settings.model);\n\t\t\t\tif (settings.thinkingLevel !== void 0) await runtime.setThinkingLevel(settings.thinkingLevel);\n\t\t\t},\n\t\t\tasync forkSource() {\n\t\t\t\tfor await (const entry of entriesNewestFirst({ limit: 1 })) return {\n\t\t\t\t\tkind: \"fork\",\n\t\t\t\t\tentryId: String(entry.id)\n\t\t\t\t};\n\t\t\t\treturn { kind: \"fork\" };\n\t\t\t},\n\t\t\tentriesNewestFirst,\n\t\t\tentries: async (query) => {\n\t\t\t\tconst entries = [];\n\t\t\t\tfor await (const entry of entriesNewestFirst(query)) entries.push(entry);\n\t\t\t\treturn query?.limit === void 0 ? entries.reverse() : entries;\n\t\t\t},\n\t\t\tasync appendMessage(message) {\n\t\t\t\treturn runtime.appendMessage(informationalMessage(message));\n\t\t\t},\n\t\t\tasync admitMessage(message, delivery = \"followUp\", requestId = randomUUID()) {\n\t\t\t\ttry {\n\t\t\t\t\tif (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\t\t\t\tif (delivery !== \"steer\" && delivery !== \"followUp\") throw new TypeError(\"Custom message delivery must be steer or followUp.\");\n\t\t\t\t\tif (typeof requestId !== \"string\" || !requestId.trim()) throw new TypeError(\"Custom message requestId must be a non-empty string.\");\n\t\t\t\t\tconst submission = await runtime.submitInternalMessage(informationalMessage(message), delivery, requestId);\n\t\t\t\t\tsubmission.settled.catch((error) => client.client.notify({\n\t\t\t\t\t\tbody: error instanceof Error ? error.message : String(error),\n\t\t\t\t\t\tlevel: \"error\"\n\t\t\t\t\t}));\n\t\t\t\t\tif (\"admitted\" in submission) await submission.admitted;\n\t\t\t\t\treturn {\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\tsettled: submission.settled\n\t\t\t\t\t};\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow new PoHeadlessPromptAdmissionError(error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tregisterCheckpointBoundary(callback) {\n\t\t\t\tif (!runtime.registerCheckpointBoundary) throw new Error(\"Native checkpoint boundaries are unavailable.\");\n\t\t\t\tconst registration = runtime.registerCheckpointBoundary(async (boundary) => {\n\t\t\t\t\tif (disposed || !headlessReady || !headlessHost?.status.ready) return;\n\t\t\t\t\tawait callback({\n\t\t\t\t\t\tsignal: boundary.signal,\n\t\t\t\t\t\tappendMessage: (message) => boundary.appendMessage(informationalMessage(message))\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\tappendMessage: (message) => disposed || !headlessReady || !headlessHost?.status.ready ? Promise.resolve(void 0) : registration.appendMessage(informationalMessage(message)),\n\t\t\t\t\tdispose: () => registration.dispose()\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync contextMessages() {\n\t\t\t\tconst assertReadable = () => {\n\t\t\t\t\tif (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\t\t\t};\n\t\t\t\tassertReadable();\n\t\t\t\tconst messages = boundedJsonCopy(await runtime.getContextMessages(), 268435456);\n\t\t\t\tassertReadable();\n\t\t\t\treturn messages;\n\t\t\t},\n\t\t\tasync contextUsage() {\n\t\t\t\tconst usage = (await runtime.getSessionStats()).contextUsage;\n\t\t\t\treturn usage ? {\n\t\t\t\t\ttokens: usage.tokens,\n\t\t\t\t\tcontextWindow: usage.contextWindow\n\t\t\t\t} : void 0;\n\t\t\t},\n\t\t\tsetLabel: (entryId, label) => runtime.setLabel(entryId, label),\n\t\t\tasync appendCustomEntry(type, data) {\n\t\t\t\tawait runtime.appendCustomEntry(type, data);\n\t\t\t},\n\t\t\tasync prompt(text, delivery) {\n\t\t\t\tawait (await runtime.submitPrompt(text, void 0, delivery === \"steer\" || delivery === \"followUp\" ? delivery : void 0)).settled;\n\t\t\t},\n\t\t\tasync admitPrompt(text, delivery, origin, requestId) {\n\t\t\t\ttry {\n\t\t\t\t\tif (origin === \"operator\" && delivery === \"followUp\") return await runtime.followUp(text);\n\t\t\t\t\tconst submission = delivery === \"interrupt\" ? await runtime.submitUserPrompt(text) : origin === \"operator\" ? await runtime.submitPrompt(text, void 0, delivery === \"steer\" ? \"steer\" : void 0) : await runtime.submitInternalMessage(text, delivery === \"steer\" ? \"steer\" : \"followUp\", requestId);\n\t\t\t\t\tsubmission.settled.catch((error) => client.client.notify({\n\t\t\t\t\t\tbody: error instanceof Error ? error.message : String(error),\n\t\t\t\t\t\tlevel: \"error\"\n\t\t\t\t\t}));\n\t\t\t\t\tif (\"admitted\" in submission) await submission.admitted;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow new PoHeadlessPromptAdmissionError(error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tabort: (expectedOperationId) => runtime.abort(expectedOperationId),\n\t\t\tcompact: (instructions) => runtime.compact(instructions),\n\t\t\tasync activity() {\n\t\t\t\tconst state = await runtime.readState();\n\t\t\t\tconst isIdle = (!state.isStreaming || state.operationId === \"settling\") && !state.isCompacting;\n\t\t\t\treturn {\n\t\t\t\t\thasPendingMessages: Number(state.pendingMessageCount) > 0,\n\t\t\t\t\tisIdle,\n\t\t\t\t\t...isIdle || typeof state.operationId !== \"string\" ? {} : { operationId: state.operationId }\n\t\t\t\t};\n\t\t\t},\n\t\t\tsetName: (name) => runtime.setName(name)\n\t\t},\n\t\tshutdown: () => stop()\n\t});\n\tclient = createHeadlessClient({\n\t\tappendCustomEntry: async (type, data) => {\n\t\t\tawait runtime.appendCustomEntry(type, data);\n\t\t},\n\t\temitFrame: (frame) => emitTo(listeners, frame)\n\t});\n\tconst unsubscribePresentation = runtime.onPresentationFrame((frame) => emitTo(listeners, frame));\n\tlet logicalRunActive = false;\n\tlet runMessages = [];\n\tlet requiredServerPackages = [];\n\tlet installedServerPackages = [];\n\tconst unsubscribeEvents = runtime.onEvent(async (event, _context) => {\n\t\tif ((event.type === \"run_start\" || event.type === \"run_resume\") && !logicalRunActive) {\n\t\t\tlogicalRunActive = true;\n\t\t\trunMessages = [];\n\t\t}\n\t\tif (event.type === \"message_end\" && event.runId !== void 0) runMessages.push(event.message);\n\t\tif (event.type === \"run_end\" && !event.successorActive) {\n\t\t\tconst messages = runMessages;\n\t\t\trunMessages = [];\n\t\t\tconst ended = logicalRunActive;\n\t\t\tlogicalRunActive = false;\n\t\t\tif (ended && headlessHost?.status.ready) await headlessHost.dispatchHook(\"agent_end\", { messages });\n\t\t}\n\t\tif (event.type === \"config_update\" && event.property === \"model\") {\n\t\t\tconst selected = (await runtime.lane.agent(BACKGROUND_CONTEXT)).model;\n\t\t\tcurrentModel = selected ? modelRuntime.getModel(selected.provider, selected.modelId) : void 0;\n\t\t\tif (headlessHost !== void 0 && currentModel !== void 0 && headlessHost.status.ready) {\n\t\t\t\tawait headlessHost.dispatchHook(\"model_select\", { model: currentModel });\n\t\t\t\tconst projection = {\n\t\t\t\t\tprovider: currentModel.provider,\n\t\t\t\t\tid: currentModel.id\n\t\t\t\t};\n\t\t\t\tconst serialized = JSON.stringify(projection);\n\t\t\t\tif (serialized !== publishedAgentModel) {\n\t\t\t\t\tpublishedAgentModel = serialized;\n\t\t\t\t\tawait runtime.appendCustomEntry(PO_AGENT_MODEL_ENTRY_TYPE, projection);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst hook = event.type === \"run_end\" && event.successorActive ? void 0 : eventHook(event.type);\n\t\tif (headlessHost !== void 0 && hook !== void 0 && headlessHost.status.ready) await headlessHost.dispatchHook(hook, event.type === \"navigation_start\" ? {\n\t\t\t...event,\n\t\t\tstatus: \"started\"\n\t\t} : event);\n\t});\n\tlet appliedPackageTools = [];\n\tlet appliedSessionTools = /* @__PURE__ */ new Map();\n\tlet appliedSkills = /* @__PURE__ */ new Map();\n\tlet surfaceRevision = 0;\n\tlet toolSurfaceReady = false;\n\tlet toolReapplyQueued = false;\n\tlet mcpSurfaceRevision = 0;\n\tlet mcpSurfaceReady = false;\n\tlet appliedMcpTools = /* @__PURE__ */ new Map();\n\tlet appliedMcpSkills = /* @__PURE__ */ new Map();\n\tlet appliedMcpUiResources = /* @__PURE__ */ new Map();\n\tlet mcpRefreshQueued = false;\n\tconst scheduleMcpRefresh = () => {\n\t\tif (mcpRefreshQueued || disposed || !headlessReady) return;\n\t\tmcpRefreshQueued = true;\n\t\tqueueMicrotask(() => {\n\t\t\tmcpRefreshQueued = false;\n\t\t\tif (disposed || !headlessReady || !headlessHost?.status.ready) return;\n\t\t\tprepareMcpSurface().catch((error) => options.onNotice?.(`MCP tool refresh failed: ${error instanceof Error ? error.message : String(error)}`));\n\t\t});\n\t};\n\tconst prepareMcpSurface = async () => {\n\t\tif (!headlessHost?.status.ready) throw new Error(\"Headless capabilities are not installed.\");\n\t\tif (mcpServiceRoot === void 0) throw new Error(\"MCP session services are not installed.\");\n\t\tmcpSurfaceReady = false;\n\t\tmcpLifecycle.abort();\n\t\tconst lifecycle = new AbortController();\n\t\tmcpLifecycle = lifecycle;\n\t\tconst pluginContext = {\n\t\t\texecution: headlessHost.context,\n\t\t\tservices: { get: (name) => mcpServiceRoot?.get(name) ?? piHost?.getService(name) },\n\t\t\tselection: {\n\t\t\t\tread: () => headlessHost.context.selection,\n\t\t\t\tchange: (change) => headlessHost.changeSelection(change)\n\t\t\t},\n\t\t\tloadContext: () => readMcpContext(lifecycle.signal),\n\t\t\tsignal: lifecycle.signal,\n\t\t\trefresh: scheduleMcpRefresh\n\t\t};\n\t\tconst nextTools = /* @__PURE__ */ new Map();\n\t\tconst nextSkills = /* @__PURE__ */ new Map();\n\t\tconst nextUiResources = /* @__PURE__ */ new Map();\n\t\tfor (const loaded of options.mcpPlugins ?? []) {\n\t\t\tconst selection = headlessHost.context.selection;\n\t\t\tif (!loaded.declaration.owners.some((owner) => owner.majorMode === selection.majorMode && (owner.layer === \"default\" || selection.activeLayers.includes(owner.layer)))) continue;\n\t\t\tconst scope = typeof loaded.plugin.session === \"function\" ? await loaded.plugin.session(pluginContext) : loaded.plugin.session;\n\t\t\tlifecycle.signal.throwIfAborted();\n\t\t\tconst resources = scope.uiResources ?? [];\n\t\t\tfor (const resource of resources) {\n\t\t\t\tconst uri = new URL(resource.uri);\n\t\t\t\tif (uri.protocol !== \"ui:\" || !uri.hostname || uri.username || uri.password || uri.search || uri.hash || uri.href !== resource.uri || resource.mimeType !== \"text/html;profile=mcp-app\") throw new Error(`Invalid MCP UI resource '${resource.uri}'`);\n\t\t\t\tif (nextUiResources.has(resource.uri) && nextUiResources.get(resource.uri).resource !== resource) throw new Error(`Duplicate MCP UI resource '${resource.uri}'`);\n\t\t\t\tconst descriptor = {\n\t\t\t\t\turi: resource.uri,\n\t\t\t\t\tname: resource.name,\n\t\t\t\t\tmimeType: resource.mimeType,\n\t\t\t\t\t...resource.description === void 0 ? {} : { description: resource.description },\n\t\t\t\t\t...resource._meta === void 0 ? {} : { _meta: resource._meta }\n\t\t\t\t};\n\t\t\t\tnextUiResources.set(resource.uri, {\n\t\t\t\t\tdescriptor,\n\t\t\t\t\tresource\n\t\t\t\t});\n\t\t\t}\n\t\t\tfor (const tool of scope.tools ?? []) {\n\t\t\t\tif (nextTools.has(tool.name)) throw new Error(`Duplicate MCP tool '${tool.name}'`);\n\t\t\t\tconst resourceUri = tool._meta?.ui?.resourceUri;\n\t\t\t\tif (resourceUri !== void 0 && !resources.some((resource) => resource.uri === resourceUri)) throw new Error(`MCP tool '${tool.name}' references a UI resource not owned by its plugin`);\n\t\t\t\tif (!headlessHost.allowsTool(tool.name)) continue;\n\t\t\t\tnextTools.set(tool.name, {\n\t\t\t\t\tdescriptor: {\n\t\t\t\t\t\tname: tool.name,\n\t\t\t\t\t\tlabel: tool.label ?? tool.name,\n\t\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\t\tparameters: tool.parameters,\n\t\t\t\t\t\t...tool.annotations === void 0 ? {} : { annotations: tool.annotations },\n\t\t\t\t\t\t...tool.outputSchema === void 0 ? {} : { outputSchema: tool.outputSchema },\n\t\t\t\t\t\t...tool._meta === void 0 ? {} : { _meta: tool._meta }\n\t\t\t\t\t},\n\t\t\t\t\texecute: (toolCallId, parameters, signal, onUpdate, execution) => tool.execute(toolCallId, parameters, signal, onUpdate, execution ?? headlessHost.context)\n\t\t\t\t});\n\t\t\t}\n\t\t\tfor (const skill of scope.skills ?? []) {\n\t\t\t\tif ([...nextSkills.values()].some((candidate) => candidate.descriptor.name === skill.name)) throw new Error(`Duplicate MCP skill '${skill.name}'`);\n\t\t\t\tconst uri = `po://session/${encodeURIComponent(runtime.sessionId)}/mcp/skills/${encodeURIComponent(skill.name)}`;\n\t\t\t\tnextSkills.set(uri, {\n\t\t\t\t\tdescriptor: {\n\t\t\t\t\t\tname: skill.name,\n\t\t\t\t\t\tdescription: skill.description,\n\t\t\t\t\t\turi\n\t\t\t\t\t},\n\t\t\t\t\tskill\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tappliedMcpTools = nextTools;\n\t\tappliedMcpSkills = nextSkills;\n\t\tappliedMcpUiResources = nextUiResources;\n\t\tmcpSurfaceRevision += 1;\n\t\tmcpSurfaceReady = true;\n\t};\n\tconst applyToolSurface = async (tools) => {\n\t\ttoolSurfaceReady = false;\n\t\tconst modelTools = tools.filter(isPoHeadlessToolModelVisible);\n\t\tconst packageTools = modelTools.map((tool) => toolAdapter({\n\t\t\t...tool,\n\t\t\tdescription: describeSkillTool(tool, headlessHost?.appliedResources ?? [])\n\t\t}, () => headlessHost.context, reportedToolErrors));\n\t\tconst packageNames = headlessHost?.declaredToolNames ?? new Set(packageTools.map((tool) => tool.name));\n\t\tconst piTools = (piHost?.tools ?? []).filter((tool) => !packageNames.has(tool.name) && headlessHost?.allowsTool(tool.name) !== false).map((tool) => ({\n\t\t\t...tool,\n\t\t\tasync execute(...args) {\n\t\t\t\theadlessHost.assertActive();\n\t\t\t\tif (!toolSurfaceReady || !headlessHost.allowsTool(tool.name)) throw new Error(`Tool '${tool.name}' is no longer active`);\n\t\t\t\tconst result = await tool.execute(...args);\n\t\t\t\treturn Array.isArray(result.content) ? {\n\t\t\t\t\t...result,\n\t\t\t\t\tcontent: dropInvalidImages(result.content)\n\t\t\t\t} : result;\n\t\t\t}\n\t\t}));\n\t\tconst piNames = new Set(piTools.map((tool) => tool.name));\n\t\tconst nextToolGuidance = [...(piHost?.toolGuidance ?? []).filter((entry) => piNames.has(entry.name)), ...modelTools.map((tool) => ({\n\t\t\tname: tool.name,\n\t\t\t...tool.promptSnippet === void 0 ? {} : { promptSnippet: tool.promptSnippet },\n\t\t\t...tool.promptGuidelines === void 0 ? {} : { promptGuidelines: tool.promptGuidelines }\n\t\t}))];\n\t\tawait runtime.replaceTools([...piTools, ...packageTools]);\n\t\tappliedChildTools = modelTools.flatMap((tool, index) => tool.mainAgentOnly ? [] : [packageTools[index]]);\n\t\tconst next = /* @__PURE__ */ new Map();\n\t\tfor (const tool of piTools) next.set(tool.name, {\n\t\t\tdescriptor: {\n\t\t\t\tname: tool.name,\n\t\t\t\tlabel: tool.label ?? tool.name,\n\t\t\t\tdescription: tool.description,\n\t\t\t\tparameters: tool.parameters\n\t\t\t},\n\t\t\texecute: (toolCallId, parameters, signal, onUpdate) => piHost.executeTool(tool.name, toolCallId, parameters, signal, onUpdate)\n\t\t});\n\t\tfor (const tool of tools) next.set(tool.name, {\n\t\t\tdescriptor: {\n\t\t\t\tname: tool.name,\n\t\t\t\tlabel: tool.label ?? tool.name,\n\t\t\t\tdescription: describeSkillTool(tool, headlessHost?.appliedResources ?? []),\n\t\t\t\tparameters: tool.parameters,\n\t\t\t\t...tool.annotations === void 0 ? {} : { annotations: tool.annotations },\n\t\t\t\t...tool.outputSchema === void 0 ? {} : { outputSchema: tool.outputSchema },\n\t\t\t\t...tool._meta === void 0 ? {} : { _meta: tool._meta }\n\t\t\t},\n\t\t\texecute: (toolCallId, parameters, signal, onUpdate, execution) => tool.execute(toolCallId, parameters, signal, onUpdate, execution ?? headlessHost.context)\n\t\t});\n\t\ttoolGuidance = nextToolGuidance;\n\t\tappliedSessionTools = next;\n\t\tsurfaceRevision += 1;\n\t\ttoolSurfaceReady = true;\n\t};\n\t/**\n\t* Rebuilds the merged tool surface after a Pi extension narrowed its own tools.\n\t*\n\t* Deferred because the tool surface arbiter calls `setActiveTools` synchronously from inside\n\t* `register`, and coalesced because several extensions register their restrictions in the same\n\t* tick. The package set is unchanged, so this never re-enters the kernel.\n\t*/\n\tlet toolLine = Promise.resolve();\n\tconst applyLatestTools = () => {\n\t\ttoolLine = toolLine.catch(() => void 0).then(() => applyToolSurface(appliedPackageTools));\n\t\treturn toolLine;\n\t};\n\tconst scheduleToolReapply = () => {\n\t\tif (toolReapplyQueued) return;\n\t\ttoolReapplyQueued = true;\n\t\tqueueMicrotask(() => {\n\t\t\ttoolReapplyQueued = false;\n\t\t\tif (disposed) return;\n\t\t\tapplyLatestTools().catch((error) => options.onNotice?.(`Pi extension tool refresh failed: ${error instanceof Error ? error.message : String(error)}`));\n\t\t});\n\t};\n\tconst publishBackgroundWork = (active) => {\n\t\tif (disposed || active === backgroundWorkActive) return;\n\t\tbackgroundWorkActive = active;\n\t\tfor (const listener of backgroundWorkListeners) listener(active);\n\t};\n\tlet admittedToolSurface;\n\tconst preparePackages = (root) => {\n\t\tmcpServiceRoot = root;\n\t\tif (options.workflowContext !== void 0) root.provide(PO_WORKFLOW_CONTEXT_SERVICE, options.workflowContext);\n\t\tbackgroundWorkBinding = root.inject([PO_BACKGROUND_WORK_SERVICE], (context) => {\n\t\t\tconst service = readPoBackgroundWorkService(context);\n\t\t\tif (service === void 0) return void 0;\n\t\t\tlet active = true;\n\t\t\tconst refresh = () => {\n\t\t\t\tif (disposed || !active) return;\n\t\t\t\ttry {\n\t\t\t\t\tconst snapshot = service.snapshot(options.sessionId);\n\t\t\t\t\tpublishBackgroundWork(snapshot.items.length > 0 ? true : snapshot.errors.length > 0 ? null : false);\n\t\t\t\t} catch {\n\t\t\t\t\tpublishBackgroundWork(null);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst unsubscribe = context.on(PO_BACKGROUND_WORK_CHANGED_EVENT, refresh);\n\t\t\trefresh();\n\t\t\treturn () => {\n\t\t\t\tactive = false;\n\t\t\t\tunsubscribe();\n\t\t\t\tpublishBackgroundWork(null);\n\t\t\t};\n\t\t});\n\t\troot.plugin((context) => {\n\t\t\tcontext.provide(PO_CHILD_SESSION_SERVICE, childSessionProvider.get());\n\t\t\tcontext.provide(PO_CHILD_SESSION_HOOK_REGISTRY_SERVICE, childHookRegistry);\n\t\t\tcontext.effect(() => () => childSessionProvider.close(), \"headless child session service lifetime\");\n\t\t});\n\t\tif (headlessHost !== void 0) throw new Error(\"Direct headless packages were prepared more than once.\");\n\t\tif (models.piExtensions !== void 0) piHost = models.piExtensions({\n\t\t\truntime,\n\t\t\tgetModel: () => currentModel,\n\t\t\tgetThinkingLevel: () => resolved.thinkingLevel ?? \"off\",\n\t\t\tclient: () => client?.client,\n\t\t\tonActiveToolsChanged: scheduleToolReapply,\n\t\t\tserverServices: {\n\t\t\t\tsessionId: options.sessionId,\n\t\t\t\tget: (name) => root.get(name)\n\t\t\t},\n\t\t\t...options.onNotice === void 0 ? {} : { onNotice: options.onNotice }\n\t\t});\n\t\theadlessHost = new HeadlessHost(root, {\n\t\t\tscheduleSelection: (change, apply, options) => {\n\t\t\t\tif (!selectionCommand.getStore() && !options?.atToolBoundary) return apply(change);\n\t\t\t\tconst previous = headlessHost.context.selection.state?.[\"minor-mode\"] ?? [];\n\t\t\t\treturn runtime.runAtToolBoundary(() => selectionCommand.run(false, () => {\n\t\t\t\t\tif (change.axis !== \"state\" || change.key !== \"minor-mode\") return apply(change);\n\t\t\t\t\tconst removed = previous.filter((name) => !change.values.includes(name));\n\t\t\t\t\tconst added = change.values.filter((name) => !previous.includes(name));\n\t\t\t\t\tconst current = headlessHost.context.selection.state?.[\"minor-mode\"] ?? [];\n\t\t\t\t\treturn apply({\n\t\t\t\t\t\t...change,\n\t\t\t\t\t\tvalues: [.../* @__PURE__ */ new Set([...current.filter((name) => !removed.includes(name)), ...added])]\n\t\t\t\t\t});\n\t\t\t\t}));\n\t\t\t},\n\t\t\tcandidates: options.candidates,\n\t\t\ttoolSurface: () => admittedToolSurface,\n\t\t\tselection: initialSelection,\n\t\t\tselectionOverrides: [.../* @__PURE__ */ new Set([...options.selectionOverrides ?? [], ...[\n\t\t\t\t\"majorMode\",\n\t\t\t\t\"domains\",\n\t\t\t\t\"profile\"\n\t\t\t].filter((axis) => JSON.stringify(initialSelection[axis]) !== JSON.stringify(options.selection[axis]))])],\n\t\t\tcontext: executionContext,\n\t\t\tresolveSelection: options.resolveSelection,\n\t\t\tvalidateSelection: (selection) => {\n\t\t\t\tfor (const packageName of requiredServerPackages) if (!options.candidates.some((entry) => entry.packageName === packageName && entry.scopes.includes(\"session\") && entry.owners.some((owner) => owner.majorMode === selection.majorMode && (owner.layer === \"default\" || selection.activeLayers.includes(owner.layer)))) || !installedServerPackages.includes(packageName)) throw new Error(`Required headless package '${packageName}' is unavailable. Run po sync, then reopen this session.`);\n\t\t\t},\n\t\t\t...options.allowedTools === void 0 ? {} : { allowedTools: () => options.allowedTools },\n\t\t\tapplyTools: async (tools) => {\n\t\t\t\tappliedPackageTools = tools;\n\t\t\t\tawait applyLatestTools();\n\t\t\t},\n\t\t\tapplyResources: async (next) => {\n\t\t\t\tconst mapped = mapResources(next);\n\t\t\t\tconst packageNames = new Set((mapped.harness.skills ?? []).map((skill) => skill.name));\n\t\t\t\tconst piSkills = (piHost?.skills ?? []).filter((skill) => !packageNames.has(skill.name));\n\t\t\t\tconst mergedSkills = [...piSkills, ...mapped.harness.skills ?? []];\n\t\t\t\tawait runtime.replaceResources(piSkills.length === 0 ? mapped.harness : {\n\t\t\t\t\t...mapped.harness,\n\t\t\t\t\tskills: mergedSkills\n\t\t\t\t});\n\t\t\t\tappliedSkills = new Map(mergedSkills.map((skill) => {\n\t\t\t\t\tconst uri = `po://session/${encodeURIComponent(runtime.sessionId)}/skills/${encodeURIComponent(skill.name)}`;\n\t\t\t\t\treturn [uri, {\n\t\t\t\t\t\tdescriptor: {\n\t\t\t\t\t\t\tname: skill.name,\n\t\t\t\t\t\t\tdescription: skill.description,\n\t\t\t\t\t\t\turi\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontent: skill.content\n\t\t\t\t\t}];\n\t\t\t\t}));\n\t\t\t\tsurfaceRevision += 1;\n\t\t\t\tif (appliedPackageTools.some((tool) => tool.name === \"load_skill\" || tool.name === \"search_skills\")) await applyLatestTools();\n\t\t\t},\n\t\t\tonApplied: async (selection) => {\n\t\t\t\toptions.publishSelectionStatus?.((source, text) => client.client.setStatus(source, text), selection);\n\t\t\t\tlatestSelection = selection;\n\t\t\t\tfor (const listener of selectionListeners) listener(selection);\n\t\t\t},\n\t\t\tonError: (error, source) => options.onNotice?.(`Headless ${source ?? \"host\"} failed: ${harnessErrorMessage(error)}`)\n\t\t});\n\t\tpublishComposition = createHeadlessCompositionPublisher(runtime, headlessHost, options.environment, (selection) => options.contextGroups?.(root, selection) ?? [], readSystemPrompt, () => !disposed);\n\t\theadlessHost.subscribeSelection(async (selection) => {\n\t\t\tif (!headlessReady || !headlessHost?.status.ready) return;\n\t\t\ttry {\n\t\t\t\tawait prepareMcpSurface();\n\t\t\t} catch (error) {\n\t\t\t\tif (!(error instanceof Error && error.name === \"AbortError\")) options.onNotice?.(`MCP tool refresh failed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t}\n\t\t\tawait publishComposition(selection);\n\t\t});\n\t};\n\tconst activatePackages = async (installedPackages) => {\n\t\tif (headlessHost === void 0) throw new Error(\"Direct headless host was not prepared.\");\n\t\tconst host = headlessHost;\n\t\tconst assertLive = () => {\n\t\t\tif (disposed) throw new Error(\"The session was closed while it was starting.\");\n\t\t};\n\t\trequiredServerPackages = await options.requiredServerPackages?.() ?? [];\n\t\tinstalledServerPackages = installedPackages;\n\t\tassertLive();\n\t\thost.setAvailableSources(installedPackages);\n\t\tif (piHost !== void 0) try {\n\t\t\tawait piHost.load();\n\t\t} catch (error) {\n\t\t\toptions.onNotice?.(`Pi extensions failed to load: ${error instanceof Error ? error.message : String(error)}`);\n\t\t}\n\t\tassertLive();\n\t\tawait host.select(initialSelection);\n\t\tassertLive();\n\t\tif (!host.status.ready) throw new Error(`Session capabilities failed to start: ${host.status.error ?? \"selection is not ready\"}`);\n\t\theadlessReady = true;\n\t\tawait prepareMcpSurface();\n\t\tassertLive();\n\t\tawait runtime.recover();\n\t\tassertLive();\n\t\tawait host.dispatchHook(\"session_start\", {});\n\t\tawait publishComposition();\n\t\tconst children = childSessionProvider.get();\n\t\tfor (const run of await children.stored?.() ?? []) {\n\t\t\tif (run.settled) continue;\n\t\t\tconst runId = run.request.runId;\n\t\t\ttry {\n\t\t\t\tawait children.restore?.(runId);\n\t\t\t} catch (error) {\n\t\t\t\toptions.onNotice?.(`Child run ${runId} could not resume: ${harnessErrorMessage(error)}`);\n\t\t\t\tassertLive();\n\t\t\t\tconst conversationId = await abandonSubagent(runtime.harness, runId, BACKGROUND_CONTEXT).catch((abandonError) => {\n\t\t\t\t\toptions.onNotice?.(`Child run ${runId} could not be stopped: ${harnessErrorMessage(abandonError)}`);\n\t\t\t\t});\n\t\t\t\tif (conversationId !== void 0) runtime.closeLane(conversationId);\n\t\t\t}\n\t\t}\n\t\tassertLive();\n\t\t(await runtime.admitResume()).settled.catch((error) => options.onNotice?.(`Session resume failed: ${harnessErrorMessage(error)}`));\n\t\tassertLive();\n\t};\n\tconst dispose = () => {\n\t\tdisposePromise ??= (async () => {\n\t\t\tif (disposed) return;\n\t\t\tconst wasReady = headlessReady;\n\t\t\tdisposed = true;\n\t\t\theadlessReady = false;\n\t\t\tmcpSurfaceReady = false;\n\t\t\tmcpLifecycle.abort();\n\t\t\tchatgptLifecycle.abort();\n\t\t\tconst failures = [];\n\t\t\tremoveContextDetail(runtime.sessionId, options.environment);\n\t\t\tbackgroundWorkListeners.clear();\n\t\t\ttry {\n\t\t\t\tawait backgroundWorkBinding?.dispose();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait runtime.interrupt();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (wasReady && headlessHost?.status.ready) await headlessHost.dispatchHook(\"session_shutdown\", {});\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait childSessionProvider.close();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait runtime.dispose();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait piHost?.shutdown();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait headlessHost?.close();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\tclient?.dispose();\n\t\t\tunsubscribePresentation();\n\t\t\tunsubscribeEvents();\n\t\t\treleaseEnvironment();\n\t\t\tif (failures.length) throw new AggregateError(failures, \"Headless session shutdown failed\");\n\t\t})();\n\t\treturn disposePromise;\n\t};\n\tconst stop = () => {\n\t\tdispose().catch((error) => options.onNotice?.(harnessErrorMessage(error)));\n\t};\n\tconst invokeSurfaceTool = async (invocation, readRevision, readTools, ready, lifecycleSignal, waitMs) => {\n\t\tif (disposed || !headlessReady || !ready() || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready. Retry in a few seconds.\");\n\t\tif (invocation.revision !== readRevision()) throw new Error(\"The session tool surface has changed\");\n\t\tif (!isJsonObject(invocation.arguments)) throw new Error(\"Tool arguments must be a JSON object\");\n\t\tconst applied = readTools().get(invocation.name);\n\t\tif (applied === void 0) throw new Error(`Tool '${invocation.name}' is not active`);\n\t\tif (!Value.Check(applied.descriptor.parameters, invocation.arguments)) throw new Error(`Invalid arguments for tool '${invocation.name}': ${validationDetails(applied.descriptor.parameters, invocation.arguments)}`);\n\t\tconst signals = [invocation.signal, lifecycleSignal].filter((signal) => signal !== void 0);\n\t\tconst signal = signals.length === 0 ? void 0 : AbortSignal.any(signals);\n\t\tsignal?.throwIfAborted();\n\t\treturn runtime.runExternalOperation(async () => {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tawait invocation.authorize?.();\n\t\t\tsignal?.throwIfAborted();\n\t\t\tif (disposed || !headlessReady || !ready() || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready. Retry in a few seconds.\");\n\t\t\tif (invocation.revision !== readRevision() || readTools().get(invocation.name) !== applied) throw new Error(`Tool '${invocation.name}' is no longer active`);\n\t\t\tconst toolCallId = `external-${randomUUID()}`;\n\t\t\tconst before = await beforeTool({\n\t\t\t\ttoolCallId,\n\t\t\t\ttoolName: invocation.name,\n\t\t\t\targs: invocation.arguments\n\t\t\t}, signal ? withAbortSignal(signal, BACKGROUND_CONTEXT) : BACKGROUND_CONTEXT);\n\t\t\tif (before?.block !== void 0) return {\n\t\t\t\tcontent: [{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: before.block.reason\n\t\t\t\t}],\n\t\t\t\tisError: true\n\t\t\t};\n\t\t\tconst args = before?.args ?? invocation.arguments;\n\t\t\tif (!Value.Check(applied.descriptor.parameters, args)) throw new Error(`A tool hook produced invalid arguments for '${invocation.name}': ${validationDetails(applied.descriptor.parameters, args)}`);\n\t\t\tawait invocation.authorize?.();\n\t\t\tsignal?.throwIfAborted();\n\t\t\tif (disposed || !headlessReady || !ready() || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready. Retry in a few seconds.\");\n\t\t\tif (invocation.revision !== readRevision() || readTools().get(invocation.name) !== applied) throw new Error(`Tool '${invocation.name}' is no longer active`);\n\t\t\tconst startEvent = {\n\t\t\t\ttype: \"tool_execution_start\",\n\t\t\t\trunId: EXTERNAL_OPERATION,\n\t\t\t\tturnId: EXTERNAL_OPERATION,\n\t\t\t\ttoolCallId,\n\t\t\t\ttoolName: invocation.name,\n\t\t\t\targs\n\t\t\t};\n\t\t\temitTo(listeners, startEvent);\n\t\t\tawait headlessHost.dispatchHook(\"tool_execution_start\", startEvent);\n\t\t\tlet result;\n\t\t\ttry {\n\t\t\t\tresult = await applied.execute(toolCallId, args, signal, (partial) => {\n\t\t\t\t\temitTo(listeners, {\n\t\t\t\t\t\ttype: \"tool_execution_update\",\n\t\t\t\t\t\trunId: EXTERNAL_OPERATION,\n\t\t\t\t\t\tturnId: EXTERNAL_OPERATION,\n\t\t\t\t\t\ttoolCallId,\n\t\t\t\t\t\ttoolName: invocation.name,\n\t\t\t\t\t\tpartialResult: partial\n\t\t\t\t\t});\n\t\t\t\t\tinvocation.onUpdate?.(partial);\n\t\t\t\t}, {\n\t\t\t\t\t...headlessHost.context,\n\t\t\t\t\t...invocation.mcpSkills === void 0 ? {} : { mcpSkills: invocation.mcpSkills },\n\t\t\t\t\ttoolContinuation: createToolContinuation({\n\t\t\t\t\t\ttoolName: invocation.name,\n\t\t\t\t\t\tparameters: applied.descriptor.parameters,\n\t\t\t\t\t\tbeforeTool,\n\t\t\t\t\t\tafterTool,\n\t\t\t\t\t\tauthorize: invocation.authorize,\n\t\t\t\t\t\tlifecycleSignal,\n\t\t\t\t\t\tassertAvailable() {\n\t\t\t\t\t\t\tif (disposed || !headlessReady || !ready() || !headlessHost?.status.ready || invocation.revision !== readRevision() || readTools().get(invocation.name) !== applied) throw new Error(`Tool '${invocation.name}' is no longer active`);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tresult = {\n\t\t\t\t\tcontent: [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: error instanceof Error ? error.message : String(error)\n\t\t\t\t\t}],\n\t\t\t\t\tisError: true\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst patch = signal?.aborted ? void 0 : await afterTool({\n\t\t\t\ttoolCallId,\n\t\t\t\ttoolName: invocation.name,\n\t\t\t\targs,\n\t\t\t\tcontent: result.content,\n\t\t\t\t...isJsonValue(result.details) ? { details: result.details } : {},\n\t\t\t\tisError: result.isError === true\n\t\t\t}, signal ? withAbortSignal(signal, BACKGROUND_CONTEXT) : BACKGROUND_CONTEXT);\n\t\t\tconst patched = {\n\t\t\t\tcontent: patch?.content ?? result.content,\n\t\t\t\t...patch?.content !== void 0 || patch?.isError !== void 0 || result.structuredContent === void 0 ? {} : { structuredContent: result.structuredContent },\n\t\t\t\t...patch?.content !== void 0 || patch?.isError !== void 0 || patch?.details !== void 0 || result._meta === void 0 ? {} : { _meta: result._meta },\n\t\t\t\t...patch?.details !== void 0 ? { details: patch.details } : result.details === void 0 ? {} : { details: result.details },\n\t\t\t\tisError: patch?.isError ?? result.isError ?? false\n\t\t\t};\n\t\t\tconst endEvent = {\n\t\t\t\ttype: \"tool_execution_end\",\n\t\t\t\trunId: EXTERNAL_OPERATION,\n\t\t\t\tturnId: EXTERNAL_OPERATION,\n\t\t\t\ttoolCallId,\n\t\t\t\ttoolName: invocation.name,\n\t\t\t\tresult: patched,\n\t\t\t\tisError: patched.isError,\n\t\t\t\tterminate: patch?.terminate ?? false\n\t\t\t};\n\t\t\temitTo(listeners, endEvent);\n\t\t\tawait headlessHost.dispatchHook(\"tool_execution_end\", endEvent);\n\t\t\treturn patched;\n\t\t}, {\n\t\t\tsignal,\n\t\t\twaitMs\n\t\t});\n\t};\n\tconst toolSurface = {\n\t\treadSurface() {\n\t\t\tif (disposed || !headlessReady || !toolSurfaceReady || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\t\treturn {\n\t\t\t\trevision: surfaceRevision,\n\t\t\t\ttools: [...appliedSessionTools.values()].map((tool) => tool.descriptor),\n\t\t\t\tskills: [...appliedSkills.values()].map((skill) => skill.descriptor)\n\t\t\t};\n\t\t},\n\t\tinvokeTool: (invocation) => invokeSurfaceTool(invocation, () => surfaceRevision, () => appliedSessionTools, () => toolSurfaceReady),\n\t\treadSkill(revision, uri) {\n\t\t\tif (disposed || !headlessReady || !toolSurfaceReady || !headlessHost?.status.ready) throw new Error(\"Headless capability preparation is not ready.\");\n\t\t\tif (revision !== surfaceRevision) throw new Error(\"The session skill surface has changed\");\n\t\t\tconst skill = appliedSkills.get(uri);\n\t\t\tif (skill === void 0) throw new Error(\"The session skill is not active\");\n\t\t\treturn skill.content;\n\t\t}\n\t};\n\tadmittedToolSurface = {\n\t\treadSurface: () => toolSurface.readSurface(),\n\t\tinvokeTool: (invocation) => toolSurface.invokeTool(invocation)\n\t};\n\tconst mcpSurface = {\n\t\treadSurface() {\n\t\t\tif (disposed || !headlessReady || !mcpSurfaceReady || !headlessHost?.status.ready) throw new Error(\"MCP capability preparation is not ready.\");\n\t\t\treturn {\n\t\t\t\trevision: mcpSurfaceRevision,\n\t\t\t\ttools: [...appliedMcpTools.values()].map((tool) => tool.descriptor),\n\t\t\t\tskills: [...appliedMcpSkills.values()].map((skill) => skill.descriptor),\n\t\t\t\tuiResources: [...appliedMcpUiResources.values()].map((resource) => resource.descriptor)\n\t\t\t};\n\t\t},\n\t\tinvokeTool: (invocation) => invokeSurfaceTool(invocation, () => mcpSurfaceRevision, () => appliedMcpTools, () => mcpSurfaceReady, mcpLifecycle.signal, REMOTE_TOOL_WAIT_MS),\n\t\tasync readUiResource(revision, uri) {\n\t\t\tif (disposed || !headlessReady || !mcpSurfaceReady || !headlessHost?.status.ready) throw new Error(\"MCP capability preparation is not ready.\");\n\t\t\tif (revision !== mcpSurfaceRevision) throw new Error(\"The session MCP surface has changed\");\n\t\t\tconst resource = appliedMcpUiResources.get(uri)?.resource;\n\t\t\tif (resource === void 0) throw new Error(\"The session MCP UI resource is not active\");\n\t\t\tconst text = await resource.read();\n\t\t\tif (disposed || !headlessReady || !mcpSurfaceReady || !headlessHost?.status.ready) throw new Error(\"MCP capability preparation is not ready.\");\n\t\t\tif (revision !== mcpSurfaceRevision || appliedMcpUiResources.get(uri)?.resource !== resource) throw new Error(\"The session MCP surface has changed\");\n\t\t\treturn text;\n\t\t},\n\t\tasync readSkill(revision, uri) {\n\t\t\tif (disposed || !headlessReady || !mcpSurfaceReady || !headlessHost?.status.ready) throw new Error(\"MCP capability preparation is not ready.\");\n\t\t\tif (revision !== mcpSurfaceRevision) throw new Error(\"The session MCP surface has changed\");\n\t\t\tconst skill = appliedMcpSkills.get(uri)?.skill;\n\t\t\tif (skill === void 0) throw new Error(\"The session MCP skill is not active\");\n\t\t\tconst text = await skill.read(headlessHost.context);\n\t\t\tif (disposed || !headlessReady || !mcpSurfaceReady || !headlessHost?.status.ready) throw new Error(\"MCP capability preparation is not ready.\");\n\t\t\tif (revision !== mcpSurfaceRevision || appliedMcpSkills.get(uri)?.skill !== skill) throw new Error(\"The session MCP surface has changed\");\n\t\t\treturn text;\n\t\t}\n\t};\n\treturn {\n\t\truntime,\n\t\tasync readExecutionState() {\n\t\t\tconst state = await runtime.readState();\n\t\t\tconst backgroundWork = mcpServiceRoot === void 0 ? void 0 : readPoBackgroundWorkService(mcpServiceRoot)?.snapshot(options.sessionId);\n\t\t\treturn {\n\t\t\t\tisIdle: state.isIdle === true,\n\t\t\t\thasPendingMessages: Number(state.pendingMessageCount) > 0,\n\t\t\t\t...backgroundWork === void 0 ? {} : { backgroundWork }\n\t\t\t};\n\t\t},\n\t\t...sessionContext === void 0 ? {} : { sessionContext },\n\t\tget host() {\n\t\t\treturn headlessHost;\n\t\t},\n\t\ttoolSurface,\n\t\tmcpSurface,\n\t\tpreparePackages,\n\t\tactivatePackages,\n\t\tcanDispatch: () => !disposed && headlessReady && !promptPreparationFailed && headlessHost?.status.ready === true,\n\t\tchildThread: (runId) => childSessionProvider.get().thread(runId),\n\t\tonPresentationFrame(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\tclient?.replay(listener);\n\t\t\treturn () => listeners.delete(listener);\n\t\t},\n\t\tonSelection(listener) {\n\t\t\tselectionListeners.add(listener);\n\t\t\tlistener(latestSelection);\n\t\t\treturn () => {\n\t\t\t\tselectionListeners.delete(listener);\n\t\t\t};\n\t\t},\n\t\tonBackgroundWork(listener) {\n\t\t\tif (disposed) return () => void 0;\n\t\t\tbackgroundWorkListeners.add(listener);\n\t\t\tlistener(backgroundWorkActive);\n\t\t\treturn () => backgroundWorkListeners.delete(listener);\n\t\t},\n\t\trespondToExtensionUi(frame) {\n\t\t\treturn client?.receive(frame) ?? false;\n\t\t},\n\t\tdispose\n\t};\n}\n//#endregion\nexport { createHeadlessSessionHost, restoreHeadlessSelection, toolAdapter, validateDirectHeadlessArgs };\n\n//# sourceMappingURL=headlessSessionHost.mjs.map","import { createHeadlessSessionHost } from \"./src/systems/main/adapters/headlessSessionHost.mjs\";\n//#region src/systems/main/adapters/headlessSessionManager.ts\nfunction createHeadlessSessionManager(defaults = {}) {\n\tconst sessions = /* @__PURE__ */ new Map();\n\tlet closed = false;\n\tlet closePromise;\n\tconst closeSession = async (sessionId) => {\n\t\tconst session = sessions.get(sessionId);\n\t\tif (!session) return;\n\t\tsessions.delete(sessionId);\n\t\tawait session.dispose();\n\t};\n\treturn {\n\t\tasync create(options) {\n\t\t\tif (closed) throw new Error(\"The headless session manager is closed.\");\n\t\t\tif (sessions.has(options.sessionId)) throw new Error(`Session '${options.sessionId}' already exists.`);\n\t\t\tif (options.signal?.aborted) throw options.signal.reason ?? /* @__PURE__ */ new Error(\"Session creation was aborted.\");\n\t\t\tconst { signal, ...hostOptions } = options;\n\t\t\tconst session = await createHeadlessSessionHost({\n\t\t\t\t...defaults,\n\t\t\t\t...hostOptions\n\t\t\t});\n\t\t\tif (closed || signal?.aborted) {\n\t\t\t\tawait session.dispose();\n\t\t\t\tif (closed) throw new Error(\"The headless session manager closed during session creation.\");\n\t\t\t\tthrow signal?.reason ?? /* @__PURE__ */ new Error(\"Session creation was aborted.\");\n\t\t\t}\n\t\t\tsessions.set(options.sessionId, session);\n\t\t\treturn session;\n\t\t},\n\t\tget: (sessionId) => sessions.get(sessionId),\n\t\tsessions: () => [...sessions.values()],\n\t\tcloseSession,\n\t\tclose() {\n\t\t\tclosePromise ??= (async () => {\n\t\t\t\tif (closed) return;\n\t\t\t\tclosed = true;\n\t\t\t\tconst active = [...sessions.values()].reverse();\n\t\t\t\tsessions.clear();\n\t\t\t\tconst failures = (await Promise.allSettled(active.map((session) => session.dispose()))).filter((outcome) => outcome.status === \"rejected\").map((outcome) => outcome.reason);\n\t\t\t\tif (failures.length) throw new AggregateError(failures, \"Headless session manager shutdown failed\");\n\t\t\t})();\n\t\t\treturn closePromise;\n\t\t}\n\t};\n}\n//#endregion\nexport { createHeadlessSessionManager };\n\n//# sourceMappingURL=headlessSessionManager.mjs.map","import { guardedImport, withTimeout } from \"./liveImport.mjs\";\n//#region src/server/mcpBundleLoader.ts\nfunction isMcpPlugin(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value;\n\treturn typeof candidate.name === \"string\" && (typeof candidate.session === \"function\" || typeof candidate.session === \"object\");\n}\n/** Points a package's widget-tagged tools at the composed UI resource and serves it with them. */\nfunction withPackageWidgets(original, widgets, ui) {\n\tconst allowedWidgets = new Set(widgets ?? []);\n\tif (ui === void 0 || allowedWidgets.size === 0) return original;\n\treturn {\n\t\t...original,\n\t\tasync session(context) {\n\t\t\tconst { tools: contributedTools, uiResources: contributedResources, ...rest } = typeof original.session === \"function\" ? await original.session(context) : original.session;\n\t\t\tlet usesWidget = false;\n\t\t\tconst tools = contributedTools?.map((tool) => {\n\t\t\t\tconst widget = tool._meta?.[\"po/widget\"];\n\t\t\t\tif (widget === void 0) return tool;\n\t\t\t\tif (typeof widget !== \"string\" || !allowedWidgets.has(widget)) throw new Error(`MCP tool '${tool.name}' references a widget not owned by its package`);\n\t\t\t\tusesWidget = true;\n\t\t\t\treturn {\n\t\t\t\t\t...tool,\n\t\t\t\t\t_meta: {\n\t\t\t\t\t\t...tool._meta,\n\t\t\t\t\t\tui: {\n\t\t\t\t\t\t\t...tool._meta?.ui,\n\t\t\t\t\t\t\tresourceUri: ui.uri,\n\t\t\t\t\t\t\tvisibility: tool._meta?.ui?.visibility ?? [\"model\"]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"openai/outputTemplate\": ui.uri\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t});\n\t\t\treturn {\n\t\t\t\t...rest,\n\t\t\t\t...tools === void 0 ? {} : { tools },\n\t\t\t\tuiResources: [...contributedResources ?? [], ...usesWidget ? [ui] : []]\n\t\t\t};\n\t\t}\n\t};\n}\n/** The served MCP App resource for composed package widget HTML. */\nfunction mcpUiResource(html, sha256) {\n\treturn {\n\t\turi: `ui://po/tools/${sha256}/index.html`,\n\t\tname: \"po-tool-widgets\",\n\t\tdescription: \"Package-owned tool widgets composed by po.\",\n\t\tmimeType: \"text/html;profile=mcp-app\",\n\t\t_meta: {\n\t\t\tui: {\n\t\t\t\tcsp: {\n\t\t\t\t\tconnectDomains: [],\n\t\t\t\t\tresourceDomains: []\n\t\t\t\t},\n\t\t\t\tprefersBorder: true\n\t\t\t},\n\t\t\t\"openai/widgetPrefersBorder\": true,\n\t\t\t\"openai/widgetCSP\": {\n\t\t\t\tconnect_domains: [],\n\t\t\t\tresource_domains: []\n\t\t\t}\n\t\t},\n\t\tread: () => html\n\t};\n}\n/**\n* Live reader: imports each package's built MCP entry from its content-addressed URL.\n*\n* Same eligibility rules as `loadMcpBundle`: an ineligible candidate is kept only with\n* `retainCandidates`, and a failure is fatal only for an eligible plugin. Package widgets\n* resolve to `uiResource`, which the po server builds per content key. Each import\n* is bounded and poisoned on failure (see `guardedImport`), and each `session` factory call\n* is bounded by `factoryTimeoutMs`.\n*/\nasync function loadMcpPlugins(options) {\n\tconst importer = options.importer ?? ((url) => import(url));\n\tconst factoryTimeoutMs = options.factoryTimeoutMs ?? 1e4;\n\tconst plugins = [];\n\tfor (const { url, ...declaration } of options.entries) {\n\t\tconst eligible = declaration.owners.some((owner) => owner.majorMode === options.majorMode && (owner.layer === \"default\" || options.activeLayers.includes(owner.layer)));\n\t\tif (!eligible && options.retainCandidates !== true) continue;\n\t\ttry {\n\t\t\tconst imported = await guardedImport(url, importer, options);\n\t\t\tif (!isMcpPlugin(imported?.default)) throw new Error(\"default export is not an MCP plugin\");\n\t\t\tconst original = withPackageWidgets(imported.default, declaration.widgets, options.uiResource);\n\t\t\tconst session = original.session;\n\t\t\tconst label = `MCP plugin '${declaration.packageName}' session`;\n\t\t\tplugins.push({\n\t\t\t\tdeclaration,\n\t\t\t\tplugin: typeof session === \"function\" ? {\n\t\t\t\t\t...original,\n\t\t\t\t\tsession: (context) => withTimeout(Promise.resolve().then(() => session.call(original, context)), factoryTimeoutMs, label)\n\t\t\t\t} : original\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst message = `MCP plugin '${declaration.packageName}' could not load (${error instanceof Error ? error.message : String(error)})`;\n\t\t\tif (eligible) throw new Error(message, { cause: error });\n\t\t\toptions.onNotice?.(message);\n\t\t}\n\t}\n\treturn { plugins };\n}\n//#endregion\nexport { loadMcpPlugins, mcpUiResource };\n\n//# sourceMappingURL=mcpBundleLoader.mjs.map","//#region src/constants/modelGateway.ts\n/**\n* The hub channel a contained server publishes its pending model calls on. A host that merges a container's\n* channels into its own hub leaves this frame type out: it is the gateway's transport, never UI state.\n*/\nconst MODEL_GATEWAY_FRAME_TYPE = \"model_gateway\";\n/** The global plugin service a contained server mounts the gateway methods under. */\nconst MODEL_GATEWAY_SERVICE = \"model-gateway\";\nconst MODEL_GATEWAY_METHOD = {\n\tattach: \"attach\",\n\ttake: \"take\",\n\tpush: \"push\",\n\tcancel: \"cancel\",\n\tsetCatalog: \"setCatalog\"\n};\n/**\n* Host-side defaults for one container's gateway. The host cannot tell a code mode `llm` call from a summary or a\n* turn, so these bound the whole container. Code mode's per-exec `llm` limits (calls, concurrency, input bytes and\n* tokens, in po-codemode's llm namespace) still apply where code mode runs, in the container, before a call reaches\n* the stand-in; `maxTokens` crosses the gateway unchanged.\n*/\nconst MODEL_GATEWAY_DEFAULT_CAPS = {\n\t/** Serialized request (model reference, context and options). A larger request is refused before any call. */\n\tmaxRequestBytes: 8388608,\n\t/** Model calls running at once for one container; a call beyond it is refused, not queued. */\n\tmaxConcurrentStreams: 8,\n\t/** Model calls one container may start per window. */\n\trateLimit: {\n\t\tcalls: 120,\n\t\twindowMs: 6e4\n\t}\n};\n/** How long a contained server waits for the host's first model catalogue before refusing a session. */\nconst MODEL_GATEWAY_CATALOG_TIMEOUT_MS = 3e4;\n/** A push with no answer in this time is treated as lost and resent from the last acknowledgement. */\nconst MODEL_GATEWAY_PUSH_TIMEOUT_MS = 1e4;\n/** How often the host compares its catalogue with the last one it published. */\nconst MODEL_GATEWAY_CATALOG_POLL_MS = 15e3;\n//#endregion\nexport { MODEL_GATEWAY_CATALOG_POLL_MS, MODEL_GATEWAY_CATALOG_TIMEOUT_MS, MODEL_GATEWAY_DEFAULT_CAPS, MODEL_GATEWAY_FRAME_TYPE, MODEL_GATEWAY_METHOD, MODEL_GATEWAY_PUSH_TIMEOUT_MS, MODEL_GATEWAY_SERVICE };\n\n//# sourceMappingURL=modelGateway.mjs.map","import { definePoPluginMethod } from \"./pluginProtocol.mjs\";\nimport { MODEL_GATEWAY_METHOD, MODEL_GATEWAY_SERVICE } from \"../constants/modelGateway.mjs\";\nimport { Type } from \"typebox\";\n//#region src/schemas/modelGateway.ts\nconst Json = Type.Unsafe({});\nconst Id = Type.String({\n\tminLength: 1,\n\tmaxLength: 512\n});\n/** The two streaming operations a request names. `complete` and `completeSimple` stream too and keep the result. */\nconst ModelGatewayOpSchema = Type.Union([Type.Literal(\"stream\"), Type.Literal(\"streamSimple\")]);\n/**\n* One model call as the container asks for it. The model is a reference the host resolves in its own catalogue,\n* so a container cannot send a base URL or headers; options are an allowlist the host applies again.\n*/\nconst ModelGatewayRequestSchema = Type.Object({\n\top: ModelGatewayOpSchema,\n\tmodel: Type.Object({\n\t\tprovider: Id,\n\t\tid: Id\n\t}, { additionalProperties: false }),\n\tcontext: Type.Object({ messages: Type.Array(Json) }, { additionalProperties: true }),\n\toptions: Type.Record(Type.String(), Json)\n}, { additionalProperties: false });\n/**\n* One pending call as the channel names it: metadata only. The attached host reads the request itself once,\n* through `take`, so a change to the channel never repeats every request in full.\n*/\nconst ModelGatewayPendingSchema = Type.Object({\n\tstreamId: Id,\n\tsessionId: Type.Optional(Type.String()),\n\tbytes: Type.Integer({ minimum: 0 })\n}, { additionalProperties: false });\nType.Object({ pending: Type.Array(ModelGatewayPendingSchema) });\n/** A Pi assistant event without its `partial` message, plus a patch that rebuilds it, or a gateway failure. */\nconst ModelGatewayWireEventSchema = Type.Object({ type: Type.String({ minLength: 1 }) });\nconst ModelGatewayProviderSchema = Type.Object({\n\tid: Id,\n\tname: Type.String(),\n\tconfigured: Type.Boolean(),\n\tsubscription: Type.Boolean(),\n\toauth: Type.Boolean()\n});\nconst ThinkingLevelSchema = Type.Union([\n\tType.Literal(\"off\"),\n\tType.Literal(\"minimal\"),\n\tType.Literal(\"low\"),\n\tType.Literal(\"medium\"),\n\tType.Literal(\"high\"),\n\tType.Literal(\"xhigh\"),\n\tType.Literal(\"max\")\n]);\n/** The host's default model, which a container uses when its own settings name none. */\nconst ModelGatewayDefaultModelSchema = Type.Object({\n\tprovider: Id,\n\tid: Id,\n\tthinkingLevel: Type.Optional(ThinkingLevelSchema)\n}, { additionalProperties: false });\n/** What the host tells the container about models: no credentials, no headers. */\nconst ModelGatewayCatalogSchema = Type.Object({\n\trevision: Type.Integer({ minimum: 0 }),\n\t/** Every model of every type, with `headers` removed. */\n\tmodels: Type.Array(Type.Object({\n\t\tid: Id,\n\t\tprovider: Id,\n\t\tapi: Type.String()\n\t})),\n\t/** `provider/id` of the chat models whose provider has auth on the host. */\n\tavailable: Type.Array(Type.String()),\n\tproviders: Type.Array(ModelGatewayProviderSchema),\n\tdefaultModel: Type.Optional(ModelGatewayDefaultModelSchema),\n\tlimits: Type.Object({\n\t\tmaxRequestBytes: Type.Integer({ minimum: 1 }),\n\t\tmaxConcurrentStreams: Type.Integer({ minimum: 1 })\n\t}),\n\terror: Type.Optional(Type.String())\n});\nconst ModelGatewayPushResultSchema = Type.Object({\n\tnext: Type.Integer({ minimum: 0 }),\n\tcancelled: Type.Optional(Type.String())\n});\nconst OkSchema = Type.Object({ ok: Type.Boolean() });\nconst GATEWAY = {\n\tservice: MODEL_GATEWAY_SERVICE,\n\tscope: \"global\",\n\tdirection: \"client-to-server\"\n};\n/** Global plugin methods a contained server mounts and its host calls through `po.hub` `invoke`. */\nconst MODEL_GATEWAY_METHODS = {\n\t/** Names the calling connection as the gateway. Every call in flight is cancelled: it belonged to the last one. */\n\tattach: definePoPluginMethod({\n\t\t...GATEWAY,\n\t\tmethod: MODEL_GATEWAY_METHOD.attach,\n\t\tinput: Type.Object({}),\n\t\toutput: OkSchema\n\t}),\n\t/** Hands the attached host one pending request. Each stream's request is handed over once; a second take is refused. */\n\ttake: definePoPluginMethod({\n\t\t...GATEWAY,\n\t\tmethod: MODEL_GATEWAY_METHOD.take,\n\t\tinput: Type.Object({ streamId: Id }),\n\t\toutput: ModelGatewayRequestSchema\n\t}),\n\t/** Appends events from `seq`. Duplicates are skipped, a gap answers the expected `next`, `done`/`error` ends. */\n\tpush: definePoPluginMethod({\n\t\t...GATEWAY,\n\t\tmethod: MODEL_GATEWAY_METHOD.push,\n\t\tinput: Type.Object({\n\t\t\tstreamId: Id,\n\t\t\tseq: Type.Integer({ minimum: 0 }),\n\t\t\tevents: Type.Array(ModelGatewayWireEventSchema, { maxItems: 1024 })\n\t\t}),\n\t\toutput: ModelGatewayPushResultSchema\n\t}),\n\t/** The host gives a call up; the container's caller gets an error. */\n\tcancel: definePoPluginMethod({\n\t\t...GATEWAY,\n\t\tmethod: MODEL_GATEWAY_METHOD.cancel,\n\t\tinput: Type.Object({\n\t\t\tstreamId: Id,\n\t\t\treason: Type.String()\n\t\t}),\n\t\toutput: OkSchema\n\t}),\n\tsetCatalog: definePoPluginMethod({\n\t\t...GATEWAY,\n\t\tmethod: MODEL_GATEWAY_METHOD.setCatalog,\n\t\tinput: ModelGatewayCatalogSchema,\n\t\toutput: OkSchema\n\t})\n};\n//#endregion\nexport { MODEL_GATEWAY_METHODS, ModelGatewayCatalogSchema, ModelGatewayDefaultModelSchema, ModelGatewayOpSchema, ModelGatewayPendingSchema, ModelGatewayProviderSchema, ModelGatewayPushResultSchema, ModelGatewayRequestSchema, ModelGatewayWireEventSchema };\n\n//# sourceMappingURL=modelGateway.mjs.map","//#region src/services/modelGatewayWire/index.ts\n/** The gateway's own terminal event: the host refused or gave the call up. */\nconst MODEL_GATEWAY_ERROR_EVENT = \"gateway_error\";\nconst NUMBER_OPTIONS = /* @__PURE__ */ new Set([\n\t\"temperature\",\n\t\"maxTokens\",\n\t\"timeoutMs\",\n\t\"maxRetries\",\n\t\"maxRetryDelayMs\",\n\t\"websocketConnectTimeoutMs\"\n]);\nconst STRING_OPTIONS = /* @__PURE__ */ new Set([\n\t\"sessionId\",\n\t\"cacheRetention\",\n\t\"serviceTier\",\n\t\"reasoning\",\n\t\"reasoningEffort\",\n\t\"transport\"\n]);\nconst NUMBER_RECORD_OPTIONS = /* @__PURE__ */ new Set([\"thinkingBudgets\", \"samplingParams\"]);\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* The request options that may cross the gateway, in either direction. An allowlist, so credentials (`apiKey`,\n* `env`, `headers`), transport hooks (`fetch`, `onPayload`, `onResponse`) and anything a later Pi adds stay out.\n* The host applies it again: it is the boundary, the container's copy only keeps the wire small.\n*/\nfunction modelGatewayOptions(options) {\n\tconst allowed = {};\n\tif (!isRecord(options)) return allowed;\n\tfor (const [key, value] of Object.entries(options)) if (NUMBER_OPTIONS.has(key) && typeof value === \"number\" && Number.isFinite(value)) allowed[key] = value;\n\telse if (STRING_OPTIONS.has(key) && typeof value === \"string\" && value.length <= 256) allowed[key] = value;\n\telse if (key === \"toolChoice\" && (typeof value === \"string\" || isRecord(value))) allowed[key] = JSON.parse(JSON.stringify(value));\n\telse if (NUMBER_RECORD_OPTIONS.has(key) && isRecord(value) && Object.values(value).every((item) => typeof item === \"number\" && Number.isFinite(item))) allowed[key] = { ...value };\n\treturn allowed;\n}\n/** UTF-8 size of a value's JSON. */\nfunction jsonBytes(value) {\n\treturn new TextEncoder().encode(JSON.stringify(value) ?? \"\").length;\n}\nfunction sameJson(previous, next) {\n\treturn previous === next;\n}\n/** The smallest patch this format can express from `previous` to `next`; undefined when they are equal. */\nfunction diffJson(previous, next) {\n\tif (sameJson(previous, next)) return void 0;\n\tif (typeof previous === \"string\" && typeof next === \"string\" && next.startsWith(previous)) return { a: next.slice(previous.length) };\n\tif (Array.isArray(previous) && Array.isArray(next)) {\n\t\tconst items = {};\n\t\tnext.forEach((item, index) => {\n\t\t\tconst change = index < previous.length ? diffJson(previous[index], item) : { s: item };\n\t\t\tif (change !== void 0) items[index] = change;\n\t\t});\n\t\treturn Object.keys(items).length === 0 && previous.length === next.length ? void 0 : {\n\t\t\tl: next.length,\n\t\t\ti: items\n\t\t};\n\t}\n\tif (isRecord(previous) && isRecord(next)) {\n\t\tconst keys = {};\n\t\tfor (const [key, item] of Object.entries(next)) {\n\t\t\tconst change = Object.hasOwn(previous, key) ? diffJson(previous[key], item) : { s: item };\n\t\t\tif (change !== void 0) keys[key] = change;\n\t\t}\n\t\tfor (const key of Object.keys(previous)) if (!Object.hasOwn(next, key)) keys[key] = null;\n\t\treturn Object.keys(keys).length === 0 ? void 0 : { o: keys };\n\t}\n\treturn { s: next };\n}\n/** Applies a patch, changing objects and arrays in place, and returns the new value. */\nfunction applyJsonPatch(target, patch) {\n\tif (\"s\" in patch) return JSON.parse(JSON.stringify(patch.s));\n\tif (\"a\" in patch) {\n\t\tif (typeof target !== \"string\") throw new Error(\"Model gateway patch appends to a value that is not text.\");\n\t\treturn target + patch.a;\n\t}\n\tif (\"l\" in patch) {\n\t\tif (!Array.isArray(target)) throw new Error(\"Model gateway patch changes items of a value that is not a list.\");\n\t\ttarget.length = Math.min(target.length, patch.l);\n\t\tfor (const [key, change] of Object.entries(patch.i)) {\n\t\t\tconst index = Number(key);\n\t\t\tif (!Number.isInteger(index) || index < 0 || index >= patch.l) throw new Error(\"Model gateway patch names an item outside its list.\");\n\t\t\ttarget[index] = applyJsonPatch(target[index], change);\n\t\t}\n\t\tif (target.length !== patch.l) throw new Error(\"Model gateway patch leaves a hole in its list.\");\n\t\treturn target;\n\t}\n\tif (!isRecord(target)) throw new Error(\"Model gateway patch changes keys of a value that is not an object.\");\n\tfor (const [key, change] of Object.entries(patch.o)) {\n\t\tif (key === \"__proto__\" || key === \"constructor\" || key === \"prototype\") throw new Error(\"Model gateway patch names a reserved key.\");\n\t\tif (change === null) delete target[key];\n\t\telse target[key] = applyJsonPatch(target[key], change);\n\t}\n\treturn target;\n}\nconst toJson = (value) => JSON.parse(JSON.stringify(value));\n/**\n* Turns Pi assistant events into wire events for one stream. Every Pi event repeats the whole message so far in\n* `partial`; sent as is, a long answer costs the square of its length. The wire carries a patch from the last\n* partial instead, which for a text delta is the delta itself.\n*/\nfunction createModelGatewayEncoder() {\n\tlet last;\n\treturn (event) => {\n\t\tif (!(\"partial\" in event)) return toJson(event);\n\t\tconst { partial, ...rest } = event;\n\t\tconst next = toJson(partial);\n\t\tconst patch = diffJson(last, next);\n\t\tlast = next;\n\t\treturn {\n\t\t\t...toJson(rest),\n\t\t\ttype: event.type,\n\t\t\t...patch === void 0 ? {} : { p: patch }\n\t\t};\n\t};\n}\n/**\n* Rebuilds Pi assistant events from wire events. Like a Pi provider, it keeps one partial message and changes it in\n* place, so a consumer that copies `partial` when it reads it sees what it would see in process.\n*/\nfunction createModelGatewayDecoder() {\n\tlet partial;\n\treturn (wire) => {\n\t\tif (wire.type === \"done\" || wire.type === \"error\") return wire;\n\t\tconst { p, ...rest } = wire;\n\t\tif (p !== void 0) partial = applyJsonPatch(partial, p);\n\t\tif (!isRecord(partial)) throw new Error(\"Model gateway event arrived before its message.\");\n\t\treturn {\n\t\t\t...rest,\n\t\t\tpartial\n\t\t};\n\t};\n}\n/** An assistant message for a call that ended without one: refused, cancelled or cut off. */\nfunction failedAssistantMessage(base, stopReason, errorMessage) {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: [],\n\t\tusage: {\n\t\t\tinput: 0,\n\t\t\toutput: 0,\n\t\t\tcacheRead: 0,\n\t\t\tcacheWrite: 0,\n\t\t\ttotalTokens: 0,\n\t\t\tcost: {\n\t\t\t\tinput: 0,\n\t\t\t\toutput: 0,\n\t\t\t\tcacheRead: 0,\n\t\t\t\tcacheWrite: 0,\n\t\t\t\ttotal: 0\n\t\t\t}\n\t\t},\n\t\ttimestamp: Date.now(),\n\t\t...base,\n\t\tstopReason,\n\t\terrorMessage\n\t};\n}\n//#endregion\nexport { MODEL_GATEWAY_ERROR_EVENT, applyJsonPatch, createModelGatewayDecoder, createModelGatewayEncoder, diffJson, failedAssistantMessage, jsonBytes, modelGatewayOptions };\n\n//# sourceMappingURL=index.mjs.map","import { PoSessionSetupError } from \"../../schemas/headless.mjs\";\nimport { createNodeModelDependencies } from \"../nodeModelDependencies/index.mjs\";\nimport { MODEL_GATEWAY_FRAME_TYPE } from \"../../constants/modelGateway.mjs\";\nimport { MODEL_GATEWAY_METHODS } from \"../../schemas/modelGateway.mjs\";\nimport { createModelGatewayDecoder, failedAssistantMessage, jsonBytes, modelGatewayOptions } from \"../modelGatewayWire/index.mjs\";\nimport { createAssistantMessageEventStream } from \"@earendil-works/pi-ai\";\n//#region src/services/modelGatewayContainer/index.ts\n/** Why a call ended without a provider answer: the gateway refused, the host cancelled or the link closed. */\nvar ModelGatewayError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"ModelGatewayError\";\n\t}\n};\nconst CREDENTIALS_ON_HOST = \"Credentials stay on the host in a contained workspace, so this server cannot read or change them.\";\nconst PROVIDER_REFUSED = \"Provider registration is refused in a contained workspace: model calls run on the host, through its providers.\";\nconst NOT_ATTACHED = \"The host model gateway is not connected, so this model call cannot run.\";\nconst LINK_CLOSED = \"The link to the host closed, so this model call was cancelled.\";\nconst REATTACHED = \"The host model gateway attached again, so this model call was cancelled.\";\nconst NOT_GATEWAY = \"This connection is not the attached model gateway.\";\nconst UNKNOWN_STREAM = \"unknown stream\";\nconst ALREADY_TAKEN = \"The host already took this model request.\";\nconst ABORTED = \"The model call was aborted.\";\nconst key = (provider, id) => `${provider}/${id}`;\nconst isChat = (model) => model.type === void 0 || model.type === \"chat\";\nconst ofType = (model, type) => type === \"chat\" ? isChat(model) : model.type === type;\n/**\n* Installs the container side of the model gateway on a contained server's hub.\n*\n* Calls are published on the global `model_gateway` channel as metadata; the attached host takes each request once,\n* runs it through its own model runtime, with its own credentials, and pushes the events back in sequenced batches. `before_provider_request`\n* hooks (`onPayload`) and other request callbacks cannot cross the link, so they do not run for a contained session.\n*/\nfunction createModelGatewayContainer(options) {\n\tconst timeoutMs = options.catalogTimeoutMs ?? 3e4;\n\tconst streams = /* @__PURE__ */ new Map();\n\tconst catalogWaiters = /* @__PURE__ */ new Set();\n\tlet catalog;\n\tlet attached;\n\tlet channelHost;\n\tlet disposed = false;\n\tconst payload = () => ({ pending: [...streams.values()].map(({ pending }) => pending) });\n\tconst publish = () => {\n\t\tif (channelHost === void 0) return;\n\t\tconst current = payload();\n\t\tfor (const scope of channelHost.sessions()) channelHost.publish(scope.sessionId, current);\n\t};\n\tconst remove = (stream) => {\n\t\tif (streams.get(stream.id) !== stream) return;\n\t\tstreams.delete(stream.id);\n\t\tstream.release?.();\n\t\tpublish();\n\t};\n\tconst fail = (stream, stopReason, message) => {\n\t\tif (streams.get(stream.id) !== stream) return;\n\t\tif (stopReason === \"error\") stream.failure = new ModelGatewayError(message);\n\t\tstream.output.push({\n\t\t\ttype: \"error\",\n\t\t\treason: stopReason,\n\t\t\terror: failedAssistantMessage({\n\t\t\t\t...stream.partial,\n\t\t\t\tapi: stream.model.api,\n\t\t\t\tprovider: stream.model.provider,\n\t\t\t\tmodel: stream.model.id\n\t\t\t}, stopReason, message)\n\t\t});\n\t\tstream.output.end();\n\t\tremove(stream);\n\t};\n\tconst failAll = (message) => {\n\t\tfor (const stream of streams.values()) fail(stream, \"error\", message);\n\t};\n\tconst refused = (model, message) => {\n\t\tconst stream = createAssistantMessageEventStream();\n\t\tconst failure = new ModelGatewayError(message);\n\t\tstream.push({\n\t\t\ttype: \"error\",\n\t\t\treason: \"error\",\n\t\t\terror: failedAssistantMessage({\n\t\t\t\tapi: model.api,\n\t\t\t\tprovider: model.provider,\n\t\t\t\tmodel: model.id\n\t\t\t}, \"error\", message)\n\t\t});\n\t\tstream.end();\n\t\treturn {\n\t\t\tstream,\n\t\t\tfailure: () => failure\n\t\t};\n\t};\n\tconst open = (op, model, context, requestOptions) => {\n\t\tif (disposed) return refused(model, \"The model gateway is closed.\");\n\t\tif (catalog === void 0) return refused(model, \"The host has not sent its model catalogue yet.\");\n\t\tif (attached === void 0) return refused(model, NOT_ATTACHED);\n\t\tif (!catalog.models.some((item) => item.provider === model.provider && item.id === model.id)) return refused(model, `The host has no model ${key(model.provider, model.id)}.`);\n\t\tconst signal = requestOptions?.signal;\n\t\tif (signal instanceof AbortSignal && signal.aborted) {\n\t\t\tconst stream = createAssistantMessageEventStream();\n\t\t\tstream.push({\n\t\t\t\ttype: \"error\",\n\t\t\t\treason: \"aborted\",\n\t\t\t\terror: failedAssistantMessage({\n\t\t\t\t\tapi: model.api,\n\t\t\t\t\tprovider: model.provider,\n\t\t\t\t\tmodel: model.id\n\t\t\t\t}, \"aborted\", ABORTED)\n\t\t\t});\n\t\t\tstream.end();\n\t\t\treturn {\n\t\t\t\tstream,\n\t\t\t\tfailure: () => void 0\n\t\t\t};\n\t\t}\n\t\tconst request = {\n\t\t\top,\n\t\t\tmodel: {\n\t\t\t\tprovider: model.provider,\n\t\t\t\tid: model.id\n\t\t\t},\n\t\t\tcontext: JSON.parse(JSON.stringify(context)),\n\t\t\toptions: modelGatewayOptions(requestOptions)\n\t\t};\n\t\tconst bytes = jsonBytes(request);\n\t\tif (bytes > catalog.limits.maxRequestBytes) return refused(model, `This model request is ${bytes} bytes; the host takes at most ${catalog.limits.maxRequestBytes}.`);\n\t\tif (streams.size >= catalog.limits.maxConcurrentStreams) return refused(model, `This workspace already has ${streams.size} model calls running, the most the host allows at once.`);\n\t\tconst id = crypto.randomUUID();\n\t\tconst sessionId = request.options.sessionId;\n\t\tconst stream = {\n\t\t\tid,\n\t\t\tpending: {\n\t\t\t\tstreamId: id,\n\t\t\t\t...typeof sessionId === \"string\" ? { sessionId } : {},\n\t\t\t\tbytes\n\t\t\t},\n\t\t\trequest,\n\t\t\toutput: createAssistantMessageEventStream(),\n\t\t\tdecode: createModelGatewayDecoder(),\n\t\t\tmodel,\n\t\t\tnext: 0\n\t\t};\n\t\tstreams.set(id, stream);\n\t\tif (signal instanceof AbortSignal) {\n\t\t\tconst abort = () => fail(stream, \"aborted\", ABORTED);\n\t\t\tsignal.addEventListener(\"abort\", abort, { once: true });\n\t\t\tstream.release = () => signal.removeEventListener(\"abort\", abort);\n\t\t}\n\t\tpublish();\n\t\treturn {\n\t\t\tstream: stream.output,\n\t\t\tfailure: () => stream.failure\n\t\t};\n\t};\n\tconst complete = async (op, model, context, requestOptions) => {\n\t\tconst call = open(op, model, context, requestOptions);\n\t\tconst message = await call.stream.result();\n\t\tconst failure = call.failure();\n\t\tif (failure !== void 0) throw failure;\n\t\treturn message;\n\t};\n\tconst requireGateway = (caller) => {\n\t\tif (caller.connectionId === void 0 || caller.connectionId !== attached) throw new ModelGatewayError(NOT_GATEWAY);\n\t};\n\tconst take = (input, caller) => {\n\t\trequireGateway(caller);\n\t\tconst stream = streams.get(input.streamId);\n\t\tif (stream === void 0) throw new ModelGatewayError(`The model gateway has no stream ${input.streamId}.`);\n\t\tif (stream.request === void 0) throw new ModelGatewayError(ALREADY_TAKEN);\n\t\tconst { request } = stream;\n\t\tstream.request = void 0;\n\t\treturn request;\n\t};\n\tconst push = (input, caller) => {\n\t\tif (caller.connectionId === void 0 || caller.connectionId !== attached) return {\n\t\t\tnext: 0,\n\t\t\tcancelled: NOT_GATEWAY\n\t\t};\n\t\tconst stream = streams.get(input.streamId);\n\t\tif (stream === void 0) return {\n\t\t\tnext: 0,\n\t\t\tcancelled: UNKNOWN_STREAM\n\t\t};\n\t\tif (input.seq > stream.next) return { next: stream.next };\n\t\tfor (const wire of input.events.slice(stream.next - input.seq)) {\n\t\t\tstream.next += 1;\n\t\t\tif (wire.type === \"gateway_error\") {\n\t\t\t\tfail(stream, \"error\", typeof wire.message === \"string\" ? wire.message : \"The host refused the model call.\");\n\t\t\t\treturn { next: stream.next };\n\t\t\t}\n\t\t\tlet event;\n\t\t\ttry {\n\t\t\t\tevent = stream.decode(wire);\n\t\t\t} catch (error) {\n\t\t\t\tfail(stream, \"error\", `The host sent an unreadable model event: ${error.message}`);\n\t\t\t\treturn {\n\t\t\t\t\tnext: stream.next,\n\t\t\t\t\tcancelled: \"unreadable event\"\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (\"partial\" in event) stream.partial = event.partial;\n\t\t\tstream.output.push(event);\n\t\t\tif (event.type === \"done\" || event.type === \"error\") {\n\t\t\t\tstream.output.end();\n\t\t\t\tremove(stream);\n\t\t\t\treturn { next: stream.next };\n\t\t\t}\n\t\t}\n\t\treturn { next: stream.next };\n\t};\n\tconst unregister = [\n\t\toptions.hub.registerChannel({\n\t\t\tframeType: MODEL_GATEWAY_FRAME_TYPE,\n\t\t\tstart(host) {\n\t\t\t\tchannelHost = host;\n\t\t\t\treturn {\n\t\t\t\t\tpayloadFor: () => payload(),\n\t\t\t\t\tclose: () => {\n\t\t\t\t\t\tif (channelHost === host) channelHost = void 0;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\t\t\tdisconnected({ connectionId }) {\n\t\t\t\tif (connectionId !== attached) return;\n\t\t\t\tattached = void 0;\n\t\t\t\tfailAll(LINK_CLOSED);\n\t\t\t}\n\t\t}, { scope: \"global\" }),\n\t\toptions.hub.pluginRegistry.register({ scope: \"global\" }, MODEL_GATEWAY_METHODS.attach, (_input, caller) => {\n\t\t\tif (caller.connectionId === void 0) throw new ModelGatewayError(\"The model gateway needs a connection.\");\n\t\t\tfailAll(REATTACHED);\n\t\t\tattached = caller.connectionId;\n\t\t\treturn { ok: true };\n\t\t}),\n\t\toptions.hub.pluginRegistry.register({ scope: \"global\" }, MODEL_GATEWAY_METHODS.take, (input, caller) => take(input, caller)),\n\t\toptions.hub.pluginRegistry.register({ scope: \"global\" }, MODEL_GATEWAY_METHODS.push, (input, caller) => push(input, caller)),\n\t\toptions.hub.pluginRegistry.register({ scope: \"global\" }, MODEL_GATEWAY_METHODS.cancel, (input, caller) => {\n\t\t\trequireGateway(caller);\n\t\t\tconst stream = streams.get(input.streamId);\n\t\t\tif (stream === void 0) return { ok: false };\n\t\t\tfail(stream, \"error\", `The host cancelled the model call: ${input.reason}`);\n\t\t\treturn { ok: true };\n\t\t}),\n\t\toptions.hub.pluginRegistry.register({ scope: \"global\" }, MODEL_GATEWAY_METHODS.setCatalog, (input, caller) => {\n\t\t\trequireGateway(caller);\n\t\t\tif (catalog !== void 0 && input.revision < catalog.revision) return { ok: false };\n\t\t\tcatalog = input;\n\t\t\tfor (const wake of catalogWaiters) wake();\n\t\t\treturn { ok: true };\n\t\t})\n\t];\n\tconst models = () => catalog?.models ?? [];\n\tconst provider = (id) => catalog?.providers.find((item) => item.id === id);\n\tconst available = () => {\n\t\tconst keys = new Set(catalog?.available ?? []);\n\t\treturn models().filter((model) => isChat(model) && keys.has(key(model.provider, model.id)));\n\t};\n\tconst byProvider = (list, providerId) => providerId === void 0 ? list : list.filter((model) => model.provider === providerId);\n\tconst refuse = (message) => {\n\t\tthrow new ModelGatewayError(message);\n\t};\n\tconst syntheticProvider = (id) => {\n\t\tconst entry = provider(id);\n\t\tif (entry === void 0) return void 0;\n\t\treturn {\n\t\t\tid: entry.id,\n\t\t\tname: entry.name,\n\t\t\tauth: {},\n\t\t\tgetModels: () => byProvider(models(), id).filter(isChat),\n\t\t\tgetAllModels: () => byProvider(models(), id),\n\t\t\tstream: (model, context, requestOptions) => open(\"stream\", model, context, requestOptions).stream,\n\t\t\tstreamSimple: (model, context, requestOptions) => open(\"streamSimple\", model, context, requestOptions).stream\n\t\t};\n\t};\n\tconst deferredRefused = (model) => refused(model, \"Deferred model responses are not available in a contained workspace.\").stream;\n\tconst modelRuntime = {\n\t\tgetProviders: () => (catalog?.providers ?? []).map(({ id }) => syntheticProvider(id)).filter((item) => item !== void 0),\n\t\tgetProvider: (id) => syntheticProvider(id),\n\t\tgetModels: (providerId) => byProvider(models(), providerId).filter(isChat),\n\t\tgetModel: (providerId, modelId) => models().find((model) => isChat(model) && model.provider === providerId && model.id === modelId),\n\t\tgetModelsOfType: (type, providerId) => byProvider(models(), providerId).filter((model) => ofType(model, type)),\n\t\tgetModelOfType: (type, providerId, modelId) => models().find((model) => ofType(model, type) && model.provider === providerId && model.id === modelId),\n\t\tgetAllModels: (providerId) => byProvider(models(), providerId),\n\t\trefresh: async () => ({\n\t\t\taborted: false,\n\t\t\terrors: /* @__PURE__ */ new Map()\n\t\t}),\n\t\tcheckAuth: async (providerId) => {\n\t\t\tconst entry = provider(providerId);\n\t\t\treturn entry?.configured ? {\n\t\t\t\ttype: entry.oauth ? \"oauth\" : \"api_key\",\n\t\t\t\tsource: \"host\"\n\t\t\t} : void 0;\n\t\t},\n\t\tgetAvailable: async (providerId) => byProvider(available(), providerId),\n\t\tgetAvailableOfType: async (type, providerId) => type === \"chat\" ? byProvider(available(), providerId) : byProvider(models(), providerId).filter((model) => model.type === type && provider(model.provider)?.configured === true),\n\t\tgetAllAvailable: async (providerId) => byProvider(models(), providerId).filter((model) => isChat(model) ? (catalog?.available ?? []).includes(key(model.provider, model.id)) : provider(model.provider)?.configured === true),\n\t\tgetAvailableSnapshot: () => available(),\n\t\tgetError: () => catalog?.error,\n\t\tgetAuth: async () => refuse(CREDENTIALS_ON_HOST),\n\t\tlogin: async () => refuse(CREDENTIALS_ON_HOST),\n\t\tlogout: async () => refuse(CREDENTIALS_ON_HOST),\n\t\tsetRuntimeApiKey: async () => refuse(CREDENTIALS_ON_HOST),\n\t\tremoveRuntimeApiKey: async () => refuse(CREDENTIALS_ON_HOST),\n\t\tlistCredentials: async () => [],\n\t\thasConfiguredAuth: (providerId) => provider(providerId)?.configured === true,\n\t\tisUsingSubscription: () => false,\n\t\tisUsingOAuth: (providerId) => provider(providerId)?.oauth === true,\n\t\tgetProviderAuthStatus: (providerId) => provider(providerId)?.configured === true ? {\n\t\t\tconfigured: true,\n\t\t\tlabel: \"host\"\n\t\t} : { configured: false },\n\t\tgetRegisteredNativeProvider: () => void 0,\n\t\tgetRegisteredProviderConfig: () => void 0,\n\t\tgetRegisteredProviderIds: () => [],\n\t\tgetCompatibilityRequestConfig: () => refuse(CREDENTIALS_ON_HOST),\n\t\tregisterProvider: () => refuse(PROVIDER_REFUSED),\n\t\tregisterNativeProvider: () => refuse(PROVIDER_REFUSED),\n\t\tunregisterProvider: () => refuse(PROVIDER_REFUSED),\n\t\tregisterVirtualModel: () => refuse(PROVIDER_REFUSED),\n\t\tunregisterVirtualModel: () => refuse(PROVIDER_REFUSED),\n\t\tstream: (model, context, requestOptions) => open(\"stream\", model, context, requestOptions).stream,\n\t\tstreamSimple: (model, context, requestOptions) => open(\"streamSimple\", model, context, requestOptions).stream,\n\t\tcomplete: (model, context, requestOptions) => complete(\"stream\", model, context, requestOptions),\n\t\tcompleteSimple: (model, context, requestOptions) => complete(\"streamSimple\", model, context, requestOptions),\n\t\tstreamDeferred: (model) => deferredRefused(model),\n\t\tfetchDeferred: async (model) => deferredRefused(model).result(),\n\t\tcancelDeferred: async () => refuse(\"Deferred model responses are not available in a contained workspace.\"),\n\t\tgenerateImages: async (model) => ({\n\t\t\tapi: model.api,\n\t\t\tprovider: model.provider,\n\t\t\tmodel: model.id,\n\t\t\toutput: [],\n\t\t\tstopReason: \"error\",\n\t\t\terrorMessage: \"Image models are not available in a contained workspace.\",\n\t\t\ttimestamp: Date.now()\n\t\t}),\n\t\tclassify: async (model) => ({\n\t\t\tapi: model.api,\n\t\t\tprovider: model.provider,\n\t\t\tmodel: model.id,\n\t\t\tanswers: {},\n\t\t\tstopReason: \"error\",\n\t\t\terrorMessage: \"Classifier models are not available in a contained workspace.\",\n\t\t\ttimestamp: Date.now()\n\t\t})\n\t};\n\tconst ready = () => {\n\t\tif (catalog !== void 0) return Promise.resolve();\n\t\tif (disposed) return Promise.reject(new PoSessionSetupError(\"The model gateway is closed.\"));\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst wake = () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tcatalogWaiters.delete(wake);\n\t\t\t\tif (catalog === void 0) reject(new PoSessionSetupError(\"The model gateway closed before the host sent its model catalogue.\"));\n\t\t\t\telse resolve();\n\t\t\t};\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tcatalogWaiters.delete(wake);\n\t\t\t\treject(new PoSessionSetupError(`The host did not send its model catalogue within ${Math.round(timeoutMs / 1e3)} seconds, so this contained session cannot start. Check that the host is connected to this workspace, then try again.`));\n\t\t\t}, timeoutMs);\n\t\t\tcatalogWaiters.add(wake);\n\t\t});\n\t};\n\treturn {\n\t\tmodelRuntime,\n\t\tget catalog() {\n\t\t\treturn catalog;\n\t\t},\n\t\tget attached() {\n\t\t\treturn attached !== void 0;\n\t\t},\n\t\tpending: () => [...streams.keys()],\n\t\tready,\n\t\tasync modelDependencies(sessionOptions) {\n\t\t\tawait ready();\n\t\t\treturn createNodeModelDependencies(sessionOptions, {\n\t\t\t\tmodelRuntime,\n\t\t\t\tdefaultModel: () => catalog?.defaultModel\n\t\t\t});\n\t\t},\n\t\tdispose() {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tfor (const release of unregister) release();\n\t\t\tfailAll(\"The model gateway is closed.\");\n\t\t\tfor (const wake of catalogWaiters) wake();\n\t\t\tattached = void 0;\n\t\t}\n\t};\n}\n//#endregion\nexport { ModelGatewayError, createModelGatewayContainer };\n\n//# sourceMappingURL=index.mjs.map","import { MODEL_GATEWAY_CATALOG_POLL_MS, MODEL_GATEWAY_DEFAULT_CAPS, MODEL_GATEWAY_FRAME_TYPE, MODEL_GATEWAY_METHOD, MODEL_GATEWAY_PUSH_TIMEOUT_MS, MODEL_GATEWAY_SERVICE } from \"../../constants/modelGateway.mjs\";\nimport { ModelGatewayPendingSchema, ModelGatewayPushResultSchema, ModelGatewayRequestSchema } from \"../../schemas/modelGateway.mjs\";\nimport { MODEL_GATEWAY_ERROR_EVENT, createModelGatewayEncoder, jsonBytes, modelGatewayOptions } from \"../modelGatewayWire/index.mjs\";\nimport { Check } from \"typebox/value\";\n//#region src/services/modelGatewayHost/index.ts\nconst TERMINAL = /* @__PURE__ */ new Set([\n\t\"done\",\n\t\"error\",\n\tMODEL_GATEWAY_ERROR_EVENT\n]);\nfunction withTimeout(promise, ms) {\n\tlet timer;\n\treturn Promise.race([promise, new Promise((_resolve, reject) => {\n\t\ttimer = setTimeout(() => reject(/* @__PURE__ */ new Error(`No answer within ${ms} ms.`)), ms);\n\t})]).finally(() => clearTimeout(timer));\n}\n/** A model's catalogue entry without anything that can carry a credential. */\nfunction catalogueModel(model) {\n\tconst { headers: _headers, baseUrl, ...rest } = model;\n\tlet safeBaseUrl;\n\tif (typeof baseUrl === \"string\" && baseUrl !== \"\") try {\n\t\tconst url = new URL(baseUrl);\n\t\tsafeBaseUrl = `${url.origin}${url.pathname}`;\n\t} catch {\n\t\tsafeBaseUrl = void 0;\n\t}\n\treturn JSON.parse(JSON.stringify({\n\t\t...rest,\n\t\tbaseUrl: safeBaseUrl ?? \"\"\n\t}));\n}\n/**\n* The host side of one container's model gateway.\n*\n* Attaches to the container, publishes the catalogue, then takes the request of every call the container names as\n* pending (once per stream), runs it through the host's model runtime and pushes the events back from the last\n* acknowledgement. A call the container drops from pending, or answers `cancelled` for, is aborted upstream. When the link drops every call stops (the\n* container fails its side); when the ref is live again the runner attaches and publishes the catalogue again.\n*/\nfunction runModelGateway(options) {\n\tconst caps = {\n\t\tmaxRequestBytes: MODEL_GATEWAY_DEFAULT_CAPS.maxRequestBytes,\n\t\tmaxConcurrentStreams: MODEL_GATEWAY_DEFAULT_CAPS.maxConcurrentStreams,\n\t\trateLimit: MODEL_GATEWAY_DEFAULT_CAPS.rateLimit,\n\t\tbatchEvents: 64,\n\t\tpushTimeoutMs: MODEL_GATEWAY_PUSH_TIMEOUT_MS,\n\t\tpushRetries: 5,\n\t\tcatalogPollMs: MODEL_GATEWAY_CATALOG_POLL_MS,\n\t\t...options.caps\n\t};\n\tconst { hub, modelRuntime, signal } = options;\n\tconst notice = options.onNotice ?? (() => void 0);\n\t/** Calls running upstream, by stream id. */\n\tconst runs = /* @__PURE__ */ new Map();\n\t/** Calls this runner has started (and takes or took), kept until the container's pending list no longer names them. */\n\tconst taken = /* @__PURE__ */ new Set();\n\t/** Calls whose terminal event the container acknowledged; their absence from pending is not a cancel. */\n\tconst finished = /* @__PURE__ */ new Set();\n\tconst starts = [];\n\tlet channels = options.channels;\n\tlet unsubscribe;\n\tlet live = false;\n\tlet stopped = false;\n\tlet revision = 0;\n\tlet lastCatalog;\n\tlet attaching;\n\tconst invoke = (method, input) => withTimeout(hub.invoke({\n\t\tmount: { scope: \"global\" },\n\t\tservice: MODEL_GATEWAY_SERVICE,\n\t\tmethod,\n\t\tinput\n\t}), caps.pushTimeoutMs);\n\tconst buildCatalog = async () => {\n\t\tconst availableModels = await modelRuntime.getAvailable();\n\t\tconst all = modelRuntime.getAllModels();\n\t\tconst named = new Map(modelRuntime.getProviders().map((provider) => [provider.id, provider.name]));\n\t\tconst ids = [.../* @__PURE__ */ new Set([...named.keys(), ...all.map((model) => model.provider)])].sort();\n\t\tconst error = modelRuntime.getError?.();\n\t\tconst defaultModel = options.defaultModel?.();\n\t\treturn {\n\t\t\tmodels: all.map(catalogueModel),\n\t\t\tavailable: availableModels.filter((model) => modelRuntime.hasConfiguredAuth(model.provider)).map((model) => `${model.provider}/${model.id}`),\n\t\t\tproviders: ids.map((id) => ({\n\t\t\t\tid,\n\t\t\t\tname: named.get(id) ?? id,\n\t\t\t\tconfigured: modelRuntime.hasConfiguredAuth(id),\n\t\t\t\tsubscription: modelRuntime.isUsingSubscription(id),\n\t\t\t\toauth: modelRuntime.isUsingOAuth?.(id) ?? false\n\t\t\t})),\n\t\t\t...defaultModel === void 0 ? {} : { defaultModel },\n\t\t\tlimits: {\n\t\t\t\tmaxRequestBytes: caps.maxRequestBytes,\n\t\t\t\tmaxConcurrentStreams: caps.maxConcurrentStreams\n\t\t\t},\n\t\t\t...error === void 0 ? {} : { error }\n\t\t};\n\t};\n\tconst publishCatalog = async (force) => {\n\t\tconst next = await buildCatalog();\n\t\tconst text = JSON.stringify(next);\n\t\tif (!force && text === lastCatalog) return;\n\t\trevision += 1;\n\t\tawait invoke(MODEL_GATEWAY_METHOD.setCatalog, {\n\t\t\t...next,\n\t\t\trevision\n\t\t});\n\t\tlastCatalog = text;\n\t};\n\tconst abortAll = (reason) => {\n\t\tfor (const [, controller] of runs) controller.abort(new Error(reason));\n\t\truns.clear();\n\t};\n\tconst pushEvents = async (streamId, seq, events) => {\n\t\tconst result = await invoke(MODEL_GATEWAY_METHOD.push, {\n\t\t\tstreamId,\n\t\t\tseq,\n\t\t\tevents\n\t\t});\n\t\tif (!Check(ModelGatewayPushResultSchema, result)) throw new Error(\"The container answered a push with no position.\");\n\t\treturn result;\n\t};\n\t/**\n\t* Sends `buffer` from the container's acknowledged position until the terminal event is acknowledged, the call\n\t* is cancelled, or pushes keep failing. Every failure resends from the last acknowledgement: duplicates are\n\t* skipped by the container, so a lost reply costs a resend and never a lost or repeated event.\n\t*/\n\tconst deliver = async (streamId, controller, buffer, produced, waitForMore) => {\n\t\tlet acknowledged = 0;\n\t\tlet failures = 0;\n\t\twhile (!controller.signal.aborted) {\n\t\t\tif (acknowledged >= buffer.length) {\n\t\t\t\tif (produced()) return;\n\t\t\t\tawait waitForMore();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst batch = buffer.slice(acknowledged, acknowledged + caps.batchEvents);\n\t\t\tlet result;\n\t\t\ttry {\n\t\t\t\tresult = await pushEvents(streamId, acknowledged, batch);\n\t\t\t} catch (error) {\n\t\t\t\tif (controller.signal.aborted || !live) return;\n\t\t\t\tfailures += 1;\n\t\t\t\tif (failures > caps.pushRetries) {\n\t\t\t\t\tnotice(`Model gateway gave up stream ${streamId} after ${failures} failed pushes: ${String(error)}`);\n\t\t\t\t\tcontroller.abort(/* @__PURE__ */ new Error(\"push failed\"));\n\t\t\t\t\tinvoke(MODEL_GATEWAY_METHOD.cancel, {\n\t\t\t\t\t\tstreamId,\n\t\t\t\t\t\treason: \"The host could not deliver the answer.\"\n\t\t\t\t\t}).catch((cancelError) => notice(`Model gateway cancel failed: ${String(cancelError)}`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfailures = 0;\n\t\t\tif (result.cancelled !== void 0) {\n\t\t\t\tcontroller.abort(new Error(result.cancelled));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (result.next > buffer.length) {\n\t\t\t\tcontroller.abort(/* @__PURE__ */ new Error(\"The container acknowledged events that were never sent.\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tacknowledged = result.next;\n\t\t\tif (acknowledged > 0 && TERMINAL.has(buffer[acknowledged - 1].type)) {\n\t\t\t\tfinished.add(streamId);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\tconst refusal = (message) => ({\n\t\ttype: MODEL_GATEWAY_ERROR_EVENT,\n\t\tmessage\n\t});\n\tconst tooLarge = `The model request is larger than the host allows (${caps.maxRequestBytes} bytes).`;\n\t/**\n\t* Why the host will not take this call, from its metadata alone, or the start it reserved when it will. The\n\t* reservation is synchronous, so calls named in one channel change cannot pass the caps together.\n\t*/\n\tconst reserve = (entry) => {\n\t\tif (entry.bytes > caps.maxRequestBytes) return { refusal: tooLarge };\n\t\tif (runs.size >= caps.maxConcurrentStreams) return { refusal: `The host runs at most ${caps.maxConcurrentStreams} model calls at once for this workspace.` };\n\t\tconst now = Date.now();\n\t\twhile (starts.length > 0 && starts[0] <= now - caps.rateLimit.windowMs) starts.shift();\n\t\tif (starts.length >= caps.rateLimit.calls) return { refusal: `This workspace started more than ${caps.rateLimit.calls} model calls in ${Math.round(caps.rateLimit.windowMs / 1e3)} seconds. Wait, then try again.` };\n\t\tstarts.push(now);\n\t\treturn { start: now };\n\t};\n\t/** Why the host will not run a taken request, or the resolved model when it will. The size is checked again. */\n\tconst admit = (request) => {\n\t\tif (!Check(ModelGatewayRequestSchema, request)) return { refusal: \"The model request is malformed.\" };\n\t\tif (jsonBytes(request) > caps.maxRequestBytes) return { refusal: tooLarge };\n\t\tconst { provider, id } = request.model;\n\t\tconst model = modelRuntime.getModel(provider, id);\n\t\tif (model === void 0) return { refusal: `The host has no model ${provider}/${id}.` };\n\t\tif (!modelRuntime.hasConfiguredAuth(provider)) return { refusal: `The host is not signed in to ${provider}.` };\n\t\treturn {\n\t\t\tmodel,\n\t\t\trequest\n\t\t};\n\t};\n\t/** The call's request, taken from the container, or why it could not be. */\n\tconst takeRequest = async (streamId) => {\n\t\ttry {\n\t\t\treturn { request: await invoke(MODEL_GATEWAY_METHOD.take, { streamId }) };\n\t\t} catch (error) {\n\t\t\treturn { refusal: `The host could not take the model request: ${error instanceof Error ? error.message : String(error)}` };\n\t\t}\n\t};\n\tconst run = async (entry) => {\n\t\tconst controller = new AbortController();\n\t\tconst buffer = [];\n\t\tlet produced = false;\n\t\tlet wake;\n\t\tconst append = (event) => {\n\t\t\tbuffer.push(event);\n\t\t\twake?.();\n\t\t};\n\t\tconst waitForMore = () => new Promise((resolve) => {\n\t\t\twake = resolve;\n\t\t\tcontroller.signal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t\t});\n\t\tconst reserved = reserve(entry);\n\t\tlet admitted;\n\t\tif (\"refusal\" in reserved) admitted = reserved;\n\t\telse {\n\t\t\truns.set(entry.streamId, controller);\n\t\t\tconst took = await takeRequest(entry.streamId);\n\t\t\tif (controller.signal.aborted) {\n\t\t\t\tif (runs.get(entry.streamId) === controller) runs.delete(entry.streamId);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tadmitted = \"refusal\" in took ? took : admit(took.request);\n\t\t\tif (\"refusal\" in admitted) {\n\t\t\t\truns.delete(entry.streamId);\n\t\t\t\tconst index = starts.lastIndexOf(reserved.start);\n\t\t\t\tif (index >= 0) starts.splice(index, 1);\n\t\t\t}\n\t\t}\n\t\tif (\"refusal\" in admitted) {\n\t\t\tappend(refusal(admitted.refusal));\n\t\t\tproduced = true;\n\t\t} else {\n\t\t\tconst { request } = admitted;\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst requestOptions = {\n\t\t\t\t\t\t...modelGatewayOptions(request.options),\n\t\t\t\t\t\tsignal: controller.signal\n\t\t\t\t\t};\n\t\t\t\t\tconst context = request.context;\n\t\t\t\t\tconst source = request.op === \"stream\" ? modelRuntime.stream(admitted.model, context, requestOptions) : modelRuntime.streamSimple(admitted.model, context, requestOptions);\n\t\t\t\t\tconst encode = createModelGatewayEncoder();\n\t\t\t\t\tfor await (const event of source) {\n\t\t\t\t\t\tif (controller.signal.aborted) break;\n\t\t\t\t\t\tappend(encode(event));\n\t\t\t\t\t\tif (event.type === \"done\" || event.type === \"error\") break;\n\t\t\t\t\t}\n\t\t\t\t\tif (!controller.signal.aborted && !TERMINAL.has(buffer.at(-1)?.type ?? \"\")) append(refusal(\"The provider ended the answer without a result.\"));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!controller.signal.aborted) append(refusal(error instanceof Error ? error.message : String(error)));\n\t\t\t\t} finally {\n\t\t\t\t\tproduced = true;\n\t\t\t\t\twake?.();\n\t\t\t\t}\n\t\t\t})();\n\t\t}\n\t\ttry {\n\t\t\tawait deliver(entry.streamId, controller, buffer, () => produced, waitForMore);\n\t\t} finally {\n\t\t\tcontroller.abort(/* @__PURE__ */ new Error(\"delivered\"));\n\t\t\tif (runs.get(entry.streamId) === controller) runs.delete(entry.streamId);\n\t\t}\n\t};\n\tconst sync = (value) => {\n\t\tif (stopped || !live || attaching !== void 0) return;\n\t\tconst frame = value?.[MODEL_GATEWAY_FRAME_TYPE];\n\t\tconst pending = (Array.isArray(frame?.pending) ? frame.pending : []).filter((entry) => Check(ModelGatewayPendingSchema, entry));\n\t\tconst ids = new Set(pending.map(({ streamId }) => streamId));\n\t\tfor (const entry of pending) {\n\t\t\tif (taken.has(entry.streamId)) continue;\n\t\t\ttaken.add(entry.streamId);\n\t\t\trun(entry).catch((error) => notice(`Model gateway stream ${entry.streamId} failed: ${String(error)}`));\n\t\t}\n\t\tfor (const [streamId, controller] of runs) if (!ids.has(streamId) && !finished.has(streamId)) controller.abort(/* @__PURE__ */ new Error(\"The container cancelled the call.\"));\n\t\tfor (const streamId of taken) if (!ids.has(streamId) && !runs.has(streamId)) taken.delete(streamId);\n\t\tfor (const streamId of finished) if (!ids.has(streamId)) finished.delete(streamId);\n\t};\n\tconst watch = () => {\n\t\tunsubscribe?.();\n\t\tunsubscribe = channels.latest.subscribe(sync);\n\t};\n\tlet resolveAttached;\n\tconst attached = new Promise((resolve) => {\n\t\tresolveAttached = resolve;\n\t});\n\tconst attach = () => {\n\t\tattaching ??= (async () => {\n\t\t\ttry {\n\t\t\t\tawait invoke(MODEL_GATEWAY_METHOD.attach, {});\n\t\t\t\tawait publishCatalog(true);\n\t\t\t\tresolveAttached();\n\t\t\t} finally {\n\t\t\t\tattaching = void 0;\n\t\t\t}\n\t\t\tsync(channels.latest.value);\n\t\t})().catch((error) => {\n\t\t\tnotice(`Model gateway attach failed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t});\n\t\treturn attaching;\n\t};\n\tlet resolveDone;\n\tconst done = new Promise((resolve) => {\n\t\tresolveDone = resolve;\n\t});\n\tconst timer = setInterval(() => {\n\t\tif (live && attaching === void 0) publishCatalog(false).catch((error) => notice(`Model gateway catalogue failed: ${String(error)}`));\n\t}, caps.catalogPollMs);\n\tconst stop = () => {\n\t\tif (stopped) return;\n\t\tstopped = true;\n\t\tclearInterval(timer);\n\t\tunsubscribeStatus();\n\t\tunsubscribe?.();\n\t\tabortAll(\"The model gateway stopped.\");\n\t\tresolveDone();\n\t};\n\tconst unsubscribeStatus = hub.onStatus((status) => {\n\t\tif (status === \"live\") {\n\t\t\tif (live) return;\n\t\t\tlive = true;\n\t\t\tattach();\n\t\t\treturn;\n\t\t}\n\t\tif (live) {\n\t\t\tlive = false;\n\t\t\tabortAll(\"The link to the container closed.\");\n\t\t}\n\t\tif (status === \"gone\" || status === \"released\") stop();\n\t});\n\tsignal.addEventListener(\"abort\", stop, { once: true });\n\tif (signal.aborted) stop();\n\telse {\n\t\twatch();\n\t\tif (hub.status === \"live\") {\n\t\t\tlive = true;\n\t\t\tattach();\n\t\t}\n\t}\n\treturn {\n\t\tattached,\n\t\tdone,\n\t\trefreshCatalog: () => publishCatalog(false),\n\t\tasync cancel(streamId, reason) {\n\t\t\truns.get(streamId)?.abort(new Error(reason));\n\t\t\tawait invoke(MODEL_GATEWAY_METHOD.cancel, {\n\t\t\t\tstreamId,\n\t\t\t\treason\n\t\t\t});\n\t\t},\n\t\tuseChannels(next) {\n\t\t\tchannels = next;\n\t\t\tif (!stopped) watch();\n\t\t},\n\t\trunning: () => [...runs.keys()]\n\t};\n}\n//#endregion\nexport { runModelGateway };\n\n//# sourceMappingURL=index.mjs.map","import { createHash } from \"node:crypto\";\nimport { watch as fsWatch } from \"node:fs\";\nimport { lstat, readdir, readFile, stat, statfs } from \"node:fs/promises\";\nimport { dirname, relative, sep } from \"node:path\";\nimport { FileError } from \"./index.js\";\nconst DEBOUNCE_MS = 50;\n/**\n * On macOS, `fs.watch` returns before libuv's FSEvents stream is live, and changes in between are never reported\n * (about 2% of changes made right after the call, none after 100 ms). A rescan this long after installing watchers\n * catches them.\n */\nconst FSEVENTS_SETTLE_MS = 500;\nconst DEFAULT_POLL_MS = 2000;\nconst DEFAULT_MAX_DIRECTORIES = 10_000;\n/** In polling mode, recently modified small files are also compared by content: a second write within the file system's\n * timestamp granularity can keep size and modification time. */\nconst HASH_MAX_BYTES = 256 * 1024;\nconst HASH_RECENT_MS = 5000;\n/** Linux `statfs` magic numbers of file systems that accept watches but do not report changes made elsewhere. */\nconst UNRELIABLE_FILE_SYSTEMS = new Set([\n    0x6969, // NFS\n    0x517b, // SMB\n    0xff534d42, // CIFS\n    0xfe534d42, // SMB2\n    0x65735546, // FUSE (sshfs, Android shared storage)\n    0x01021997, // 9P (WSL2 Windows drives)\n    0x0bd00bd0, // Lustre\n    0x47504653, // GPFS\n    0x00c36400, // Ceph\n    0x5346414f, // OpenAFS\n    0x6b414653, // kAFS\n    0x5dca2df5, // sdcardfs\n]);\nclass BudgetExceeded extends Error {\n}\nfunction isNodeError(error) {\n    return error instanceof Error && \"code\" in error;\n}\nfunction isDenied(error) {\n    return isNodeError(error) && (error.code === \"EACCES\" || error.code === \"EPERM\");\n}\nfunction entryOf(stats, hash) {\n    const kind = stats.isFile()\n        ? \"file\"\n        : stats.isDirectory()\n            ? \"directory\"\n            : stats.isSymbolicLink()\n                ? \"symlink\"\n                : \"other\";\n    return {\n        kind,\n        dev: stats.dev,\n        ino: stats.ino,\n        size: kind === \"directory\" ? 0 : stats.size,\n        mtimeMs: kind === \"directory\" ? 0 : stats.mtimeMs,\n        ...(hash === undefined ? {} : { hash }),\n    };\n}\nfunction sameEntry(a, b) {\n    return (a.kind === b.kind &&\n        a.dev === b.dev &&\n        a.ino === b.ino &&\n        a.size === b.size &&\n        a.mtimeMs === b.mtimeMs &&\n        a.hash === b.hash);\n}\n/** Ancestors of `path`, nearest first, up to the root. */\nfunction ancestorsOf(path) {\n    const result = [];\n    for (let current = dirname(path);; current = dirname(current)) {\n        result.push(current);\n        if (dirname(current) === current)\n            return result;\n    }\n}\n/** Whether `path` is `ancestor` or below it. */\nfunction isWithin(path, ancestor) {\n    return path === ancestor || path.startsWith(ancestor.endsWith(sep) ? ancestor : ancestor + sep);\n}\nfunction excluded(target, name) {\n    return (target.hidden && name.startsWith(\".\")) || target.names.has(name);\n}\n/**\n * Watches by snapshots: native events only trigger a debounced rescan, and changes are the difference between\n * snapshots plus the event paths. A replaced file, a renamed or recreated ancestor, or a directory created with its\n * contents therefore never depends on which events an operating system sends. New directories get their watchers\n * before they are scanned again, so nothing written into them before the watcher existed is missed.\n */\nexport class NodeFileWatcher {\n    #targets;\n    #onChange;\n    #pollIntervalMs;\n    #maxDirectories;\n    #watchers = new Map();\n    #events = new Set();\n    #mode;\n    #snapshot = new Map();\n    #timer;\n    #settleTimer;\n    #running;\n    #dirty = false;\n    #closed = false;\n    constructor(targets, onChange, mode, options) {\n        this.#targets = targets;\n        this.#onChange = onChange;\n        this.#mode = mode;\n        this.#pollIntervalMs = options.pollIntervalMs ?? DEFAULT_POLL_MS;\n        this.#maxDirectories = options.maxDirectories ?? DEFAULT_MAX_DIRECTORIES;\n    }\n    /** Establish coverage: watchers first, then the snapshot later changes are compared with. */\n    static async open(targets, resolvePath, onChange, options) {\n        const resolved = targets.map((target) => ({\n            path: resolvePath(target.path),\n            recursive: target.recursive === true,\n            hidden: target.exclude?.hidden === true,\n            names: new Set(target.exclude?.names ?? []),\n        }));\n        // Windows refuses to rename a directory while another directory below it is open, and a native watcher keeps\n        // every watched directory open: watching would break renames of their parents, so Windows polls.\n        const mode = options.mode ??\n            (process.platform === \"win32\" || (await anyUnreliable(resolved.map((target) => target.path)))\n                ? \"polling\"\n                : \"native\");\n        const watcher = new NodeFileWatcher(resolved, onChange, mode, options);\n        try {\n            await watcher.#sync(false);\n        }\n        catch (error) {\n            watcher.#stop();\n            if (error instanceof BudgetExceeded)\n                throw new FileError(\"invalid\", error.message);\n            throw error;\n        }\n        watcher.#schedulePoll();\n        return watcher;\n    }\n    get mode() {\n        return this.#mode;\n    }\n    async close(_context) {\n        if (this.#closed)\n            return;\n        this.#stop();\n        await this.#running;\n    }\n    #stop() {\n        this.#closed = true;\n        clearTimeout(this.#timer);\n        this.#timer = undefined;\n        clearTimeout(this.#settleTimer);\n        this.#settleTimer = undefined;\n        for (const { watcher } of this.#watchers.values())\n            watcher.close();\n        this.#watchers.clear();\n    }\n    #deliver(change) {\n        if (this.#closed)\n            return;\n        try {\n            this.#onChange(change);\n        }\n        catch {\n            // A throwing callback must not stop watching.\n        }\n    }\n    #schedulePoll() {\n        if (this.#closed || this.#mode !== \"polling\")\n            return;\n        this.#timer = setTimeout(() => {\n            this.#timer = undefined;\n            void this.#flush().finally(() => this.#schedulePoll());\n        }, this.#pollIntervalMs);\n    }\n    #scheduleFlush() {\n        if (this.#closed || this.#timer !== undefined)\n            return;\n        this.#timer = setTimeout(() => {\n            this.#timer = undefined;\n            void this.#flush();\n        }, DEBOUNCE_MS);\n    }\n    #scheduleSettle() {\n        if (this.#closed)\n            return;\n        clearTimeout(this.#settleTimer);\n        this.#settleTimer = setTimeout(() => {\n            this.#settleTimer = undefined;\n            void this.#flush();\n        }, FSEVENTS_SETTLE_MS);\n    }\n    #flush() {\n        if (this.#running !== undefined) {\n            this.#dirty = true;\n            return this.#running;\n        }\n        this.#running = (async () => {\n            try {\n                do {\n                    this.#dirty = false;\n                    const events = [...this.#events];\n                    this.#events.clear();\n                    const changed = await this.#sync(true);\n                    for (const path of events)\n                        changed.add(path);\n                    if (changed.size > 0)\n                        this.#deliver({ paths: [...changed].sort() });\n                } while (this.#dirty && !this.#closed);\n            }\n            catch (error) {\n                const message = error instanceof Error ? error.message : String(error);\n                const fileError = error instanceof FileError\n                    ? error\n                    : new FileError(isDenied(error) ? \"permission_denied\" : \"invalid\", message);\n                this.#deliver({ error: fileError });\n                this.#stop();\n            }\n            finally {\n                this.#running = undefined;\n            }\n        })();\n        return this.#running;\n    }\n    /** Rescan, report differences, and install watchers for new directories, rescanning until none are new. */\n    async #sync(report) {\n        const changed = new Set();\n        for (let round = 0; round < 10 && !this.#closed; round++) {\n            const scan = await this.#scan();\n            // Closed during the scan: installing watchers now would leak them.\n            if (this.#closed)\n                break;\n            const next = scan.snapshot;\n            if (report)\n                for (const path of this.#diff(this.#snapshot, next))\n                    changed.add(path);\n            this.#snapshot = next;\n            if (this.#mode === \"polling\" || !this.#reconcileWatchers(scan))\n                break;\n            if (process.platform === \"darwin\")\n                this.#scheduleSettle();\n            // Something written into a new directory before its watcher existed shows up in the next round.\n            report = true;\n        }\n        return changed;\n    }\n    #diff(previous, next) {\n        const changed = [];\n        for (const [path, entry] of next) {\n            const before = previous.get(path);\n            if (before === undefined || !sameEntry(before, entry))\n                changed.push(this.#reported(path));\n        }\n        for (const path of previous.keys())\n            if (!next.has(path))\n                changed.push(this.#reported(path));\n        return changed;\n    }\n    /** An ancestor that changed identity moved every target below it; report those targets. */\n    #reported(path) {\n        if (this.#targets.some((target) => isWithin(path, target.path)))\n            return path;\n        return this.#targets.find((target) => isWithin(target.path, path))?.path ?? path;\n    }\n    async #scan() {\n        const snapshot = new Map();\n        const linkedFiles = new Set();\n        // Directories are counted once, but traversed once per target: overlapping targets differ in recursion and\n        // exclusions, and an entry recorded for one target must still be descended into for another.\n        const counted = new Set();\n        const traversed = new Set();\n        /** Kinds of listed entries, not following links: a target that links to a directory is recorded by `stat`, but\n         * symbolic links below a recursive target are not followed. */\n        const listed = new Map();\n        const countDirectory = (path) => {\n            counted.add(path);\n            if (counted.size > this.#maxDirectories) {\n                throw new BudgetExceeded(`Watched paths exceed ${this.#maxDirectories} directories`);\n            }\n        };\n        const record = async (path, stats) => {\n            let hash;\n            if (this.#mode === \"polling\" &&\n                stats.isFile() &&\n                stats.size <= HASH_MAX_BYTES &&\n                Date.now() - stats.mtimeMs < HASH_RECENT_MS) {\n                hash = await readFile(path).then((content) => createHash(\"sha256\").update(content).digest(\"hex\"), () => undefined);\n            }\n            snapshot.set(path, entryOf(stats, hash));\n        };\n        const scanDirectory = async (index, target, directory) => {\n            const key = `${index}\\0${directory}`;\n            if (traversed.has(key))\n                return;\n            traversed.add(key);\n            let names;\n            try {\n                names = await readdir(directory);\n            }\n            catch (error) {\n                // The watched directory itself must be readable; below it, unreadable directories are skipped.\n                if (directory === target.path && isDenied(error))\n                    throw error;\n                if (isNodeError(error) && [\"ENOENT\", \"EACCES\", \"EPERM\", \"ENOTDIR\"].includes(error.code ?? \"\"))\n                    return;\n                throw error;\n            }\n            for (const name of names) {\n                if (excluded(target, name))\n                    continue;\n                const path = `${directory.endsWith(sep) ? directory : directory + sep}${name}`;\n                let kind = listed.get(path);\n                if (kind === undefined) {\n                    const stats = await lstat(path).catch(() => undefined);\n                    if (stats === undefined)\n                        continue;\n                    kind = entryOf(stats).kind;\n                    listed.set(path, kind);\n                    // A target's own entry (following links) wins over its listing by another target.\n                    if (!snapshot.has(path))\n                        await record(path, stats);\n                }\n                if (target.recursive && kind === \"directory\") {\n                    countDirectory(path);\n                    await scanDirectory(index, target, path);\n                }\n            }\n        };\n        for (const [index, target] of this.#targets.entries()) {\n            for (const ancestor of ancestorsOf(target.path)) {\n                if (snapshot.has(ancestor))\n                    continue;\n                const stats = await lstat(ancestor).catch(() => undefined);\n                // Identity only: an ancestor's own timestamps change with every unrelated sibling.\n                if (stats !== undefined)\n                    snapshot.set(ancestor, { ...entryOf(stats), size: 0, mtimeMs: 0 });\n            }\n            // The target itself may be a symbolic link to what is watched; follow it. A missing target is watched for its\n            // creation; one that cannot be reached for lack of permission fails.\n            let stats;\n            try {\n                stats = await stat(target.path);\n            }\n            catch (error) {\n                if (isDenied(error))\n                    throw error;\n                continue;\n            }\n            await record(target.path, stats);\n            if (stats.isFile() && (await lstat(target.path).catch(() => undefined))?.isSymbolicLink()) {\n                linkedFiles.add(target.path);\n            }\n            if (stats.isDirectory()) {\n                countDirectory(target.path);\n                await scanDirectory(index, target, target.path);\n            }\n        }\n        return { snapshot, linkedFiles };\n    }\n    /**\n     * Watch every existing ancestor of each target, each target directory, each target that is a symbolic link to a file\n     * (changes to that file are not events of the link's directory), and on Linux each directory below a recursive target\n     * (elsewhere one recursive watcher per target). Returns whether a watcher was added.\n     */\n    #reconcileWatchers({ snapshot, linkedFiles }) {\n        const wanted = new Map();\n        for (const path of linkedFiles)\n            wanted.set(path, false);\n        const perDirectory = process.platform === \"linux\" || process.platform === \"android\";\n        for (const target of this.#targets) {\n            for (const ancestor of ancestorsOf(target.path)) {\n                if (snapshot.get(ancestor)?.kind === \"directory\" && !wanted.has(ancestor))\n                    wanted.set(ancestor, false);\n            }\n            if (snapshot.get(target.path)?.kind !== \"directory\")\n                continue;\n            const recursiveRoot = target.recursive && !perDirectory;\n            wanted.set(target.path, recursiveRoot);\n            if (target.recursive && perDirectory) {\n                for (const [path, entry] of snapshot) {\n                    if (entry.kind === \"directory\" && path !== target.path && isWithin(path, target.path)) {\n                        wanted.set(path, false);\n                    }\n                }\n            }\n        }\n        for (const [path, installed] of this.#watchers) {\n            const entry = snapshot.get(path);\n            // Gone, or replaced: a watcher follows the directory it was installed on, not the path.\n            if (!wanted.has(path) || entry === undefined || entry.dev !== installed.dev || entry.ino !== installed.ino) {\n                installed.watcher.close();\n                this.#watchers.delete(path);\n            }\n        }\n        let added = false;\n        for (const [path, recursive] of wanted) {\n            const entry = snapshot.get(path);\n            if (this.#watchers.has(path) || entry === undefined)\n                continue;\n            const linked = linkedFiles.has(path);\n            try {\n                const watcher = fsWatch(path, { recursive, persistent: false }, (_event, filename) => linked\n                    ? this.#onLinkedFileEvent(path)\n                    : this.#onEvent(path, filename === null ? undefined : String(filename)));\n                // A watched directory that disappears or fails: rescan, which also replaces the watcher.\n                watcher.on(\"error\", () => {\n                    watcher.close();\n                    if (this.#watchers.get(path)?.watcher === watcher)\n                        this.#watchers.delete(path);\n                    this.#scheduleFlush();\n                });\n                this.#watchers.set(path, { watcher, dev: entry.dev, ino: entry.ino });\n                added = true;\n            }\n            catch (error) {\n                // Out of watches or unsupported: compare snapshots from now on, and say coverage was uncertain.\n                if (isNodeError(error) && error.code !== \"ENOENT\" && error.code !== \"EACCES\" && error.code !== \"EPERM\") {\n                    this.#switchToPolling();\n                    return false;\n                }\n            }\n        }\n        return added;\n    }\n    #switchToPolling() {\n        if (this.#mode === \"polling\")\n            return;\n        this.#mode = \"polling\";\n        for (const { watcher } of this.#watchers.values())\n            watcher.close();\n        this.#watchers.clear();\n        this.#deliver({ overflow: true });\n        clearTimeout(this.#timer);\n        this.#timer = undefined;\n        this.#schedulePoll();\n    }\n    #onEvent(directory, filename) {\n        if (this.#closed)\n            return;\n        const path = filename === undefined ? directory : `${directory.endsWith(sep) ? directory : directory + sep}${filename}`;\n        // Events about unrelated siblings of an ancestor, or about excluded entries, are ignored.\n        const relevant = this.#inScope(path);\n        if (relevant)\n            this.#events.add(this.#reported(path));\n        if (relevant || filename === undefined)\n            this.#scheduleFlush();\n    }\n    /** The file a target links to changed: report the target. */\n    #onLinkedFileEvent(target) {\n        if (this.#closed)\n            return;\n        this.#events.add(target);\n        this.#scheduleFlush();\n    }\n    #inScope(path) {\n        for (const target of this.#targets) {\n            if (isWithin(target.path, path))\n                return true;\n            if (!isWithin(path, target.path) || path === target.path)\n                continue;\n            const components = relative(target.path, path).split(sep);\n            if (!target.recursive && components.length > 1)\n                continue;\n            if (components.some((name) => excluded(target, name)))\n                continue;\n            return true;\n        }\n        return false;\n    }\n}\n/** Whether any path, or its nearest existing ancestor, is on a file system that does not report remote changes. */\nasync function anyUnreliable(paths) {\n    if (process.platform !== \"linux\" && process.platform !== \"android\")\n        return false;\n    for (const path of paths) {\n        for (const candidate of [path, ...ancestorsOf(path)]) {\n            const info = await statfs(candidate).catch(() => undefined);\n            if (info === undefined)\n                continue;\n            if (UNRELIABLE_FILE_SYSTEMS.has(info.type))\n                return true;\n            break;\n        }\n    }\n    return false;\n}\n//# sourceMappingURL=node-watch.js.map","import { spawn } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { constants, createWriteStream } from \"node:fs\";\nimport { access, appendFile, lstat, mkdir, mkdtemp, opendir, open as openFile, readdir, readFile, realpath, rename, rm, writeFile, } from \"node:fs/promises\";\nimport { homedir, constants as osConstants, tmpdir } from \"node:os\";\nimport { basename, isAbsolute, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { StreamDecoder } from \"./decode.js\";\nimport { ExecutionError, err, FileError, ok, toError, } from \"./index.js\";\nimport { LineScanner } from \"./line-scan.js\";\nimport { NodeFileWatcher } from \"./node-watch.js\";\nconst MAX_TIMEOUT_MS = 2_147_483_647;\nconst MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;\nconst EXIT_STDIO_GRACE_MS = 100;\nconst SPILL_HIGH_WATER_MARK = 1024 * 1024;\n/** Largest single read of a `BinaryReader`, so a huge `length` allocates only as much as the file yields. */\nconst BINARY_READ_CHUNK = 1024 * 1024;\nfunction resolveTimeoutMs(timeout) {\n    if (timeout === undefined)\n        return ok(undefined);\n    if (!Number.isFinite(timeout) || timeout <= 0) {\n        return err(new ExecutionError(\"timeout\", \"Invalid timeout: must be a finite number of seconds\"));\n    }\n    const timeoutMs = timeout * 1000;\n    if (timeoutMs > MAX_TIMEOUT_MS) {\n        return err(new ExecutionError(\"timeout\", `Invalid timeout: maximum is ${MAX_TIMEOUT_SECONDS} seconds`));\n    }\n    return ok(timeoutMs);\n}\nfunction resolvePath(cwd, path) {\n    let normalized = path;\n    if (normalized === \"~\") {\n        normalized = homedir();\n    }\n    else if (normalized.startsWith(\"~/\") || (process.platform === \"win32\" && normalized.startsWith(\"~\\\\\"))) {\n        normalized = join(homedir(), normalized.slice(2));\n    }\n    else if (normalized.startsWith(\"file://\")) {\n        try {\n            normalized = fileURLToPath(normalized);\n        }\n        catch {\n            // Keep malformed URLs as ordinary paths so filesystem methods preserve their non-throwing contract.\n        }\n    }\n    return isAbsolute(normalized) ? resolve(normalized) : resolve(cwd, normalized);\n}\nfunction fileKindFromStats(stats) {\n    if (stats.isFile())\n        return \"file\";\n    if (stats.isDirectory())\n        return \"directory\";\n    if (stats.isSymbolicLink())\n        return \"symlink\";\n    return undefined;\n}\nfunction fileInfoFromStats(path, stats) {\n    const kind = fileKindFromStats(stats);\n    if (!kind)\n        return err(new FileError(\"invalid\", \"Unsupported file type\", path));\n    return ok({\n        name: basename(path),\n        path,\n        kind,\n        size: stats.size,\n        mtimeMs: stats.mtimeMs,\n    });\n}\nfunction isNodeError(error) {\n    return error instanceof Error && \"code\" in error;\n}\nfunction toFileError(error, fallbackPath) {\n    if (error instanceof FileError)\n        return error;\n    const cause = toError(error);\n    const nodeError = isNodeError(error) ? error : undefined;\n    const path = typeof nodeError?.path === \"string\" ? nodeError.path : fallbackPath;\n    if (nodeError) {\n        const message = nodeError.message;\n        switch (nodeError.code) {\n            case \"ABORT_ERR\":\n                return new FileError(\"aborted\", message, path, cause);\n            case \"ENOENT\":\n                return new FileError(\"not_found\", message, path, cause);\n            case \"EACCES\":\n            case \"EPERM\":\n                return new FileError(\"permission_denied\", message, path, cause);\n            case \"ENOTDIR\":\n                return new FileError(\"not_directory\", message, path, cause);\n            case \"EISDIR\":\n                return new FileError(\"is_directory\", message, path, cause);\n            case \"EINVAL\":\n                return new FileError(\"invalid\", message, path, cause);\n        }\n    }\n    return new FileError(\"unknown\", cause.message, path, cause);\n}\nfunction abortResult(signal, path) {\n    return signal?.aborted ? err(new FileError(\"aborted\", \"aborted\", path)) : undefined;\n}\nasync function pathExists(path) {\n    try {\n        await access(path, constants.F_OK);\n        return true;\n    }\n    catch {\n        return false;\n    }\n}\nasync function runCommand(command, args, timeoutMs) {\n    return await new Promise((resolve) => {\n        let stdout = \"\";\n        let child;\n        try {\n            child = spawn(command, args, {\n                stdio: [\"ignore\", \"pipe\", \"ignore\"],\n                windowsHide: true,\n            });\n        }\n        catch {\n            resolve({ stdout: \"\", status: null });\n            return;\n        }\n        const timeout = setTimeout(() => {\n            if (child.pid)\n                killProcessTree(child.pid);\n        }, timeoutMs);\n        child.stdout?.setEncoding(\"utf8\");\n        child.stdout?.on(\"data\", (chunk) => {\n            stdout += chunk;\n        });\n        child.on(\"error\", () => {\n            clearTimeout(timeout);\n            resolve({ stdout: \"\", status: null });\n        });\n        child.on(\"close\", (status) => {\n            clearTimeout(timeout);\n            resolve({ stdout, status });\n        });\n    });\n}\nasync function findBashOnPath() {\n    const result = process.platform === \"win32\"\n        ? await runCommand(\"where\", [\"bash.exe\"], 5000)\n        : await runCommand(\"which\", [\"bash\"], 5000);\n    if (result.status !== 0 || !result.stdout)\n        return null;\n    const firstMatch = result.stdout.trim().split(/\\r?\\n/)[0];\n    return firstMatch && (await pathExists(firstMatch)) ? firstMatch : null;\n}\nfunction isLegacyWslBashPath(path) {\n    const normalized = path.replace(/\\//g, \"\\\\\").toLowerCase();\n    return /^[a-z]:\\\\windows\\\\(?:system32|sysnative)\\\\bash\\.exe$/.test(normalized);\n}\nfunction getBashShellConfig(shell) {\n    return isLegacyWslBashPath(shell) ? { shell, args: [\"-s\"], commandTransport: \"stdin\" } : { shell, args: [\"-c\"] };\n}\nasync function getShellConfig(customShellPath) {\n    if (customShellPath) {\n        if (await pathExists(customShellPath)) {\n            return ok(getBashShellConfig(customShellPath));\n        }\n        return err(new ExecutionError(\"shell_unavailable\", `Custom shell path not found: ${customShellPath}`));\n    }\n    if (process.platform === \"win32\") {\n        const candidates = [];\n        const programFiles = process.env.ProgramFiles;\n        if (programFiles)\n            candidates.push(`${programFiles}\\\\Git\\\\bin\\\\bash.exe`);\n        const programFilesX86 = process.env[\"ProgramFiles(x86)\"];\n        if (programFilesX86)\n            candidates.push(`${programFilesX86}\\\\Git\\\\bin\\\\bash.exe`);\n        for (const candidate of candidates) {\n            if (await pathExists(candidate)) {\n                return ok(getBashShellConfig(candidate));\n            }\n        }\n        const bashOnPath = await findBashOnPath();\n        if (bashOnPath) {\n            return ok(getBashShellConfig(bashOnPath));\n        }\n        return err(new ExecutionError(\"shell_unavailable\", `No bash shell found. Options:\\n` +\n            `  1. Install Git for Windows: https://git-scm.com/download/win\\n` +\n            `  2. Add your bash to PATH (Cygwin, MSYS2, etc.)\\n` +\n            \"  3. Configure an explicit shellPath\\n\\n\" +\n            `Searched Git Bash in:\\n${candidates.map((path) => `  ${path}`).join(\"\\n\")}`));\n    }\n    if (await pathExists(\"/bin/bash\")) {\n        return ok(getBashShellConfig(\"/bin/bash\"));\n    }\n    const bashOnPath = await findBashOnPath();\n    if (bashOnPath) {\n        return ok(getBashShellConfig(bashOnPath));\n    }\n    return ok({ shell: \"sh\", args: [\"-c\"] });\n}\nfunction getShellEnv(baseEnv, extraEnv, inheritEnv = true) {\n    if (!inheritEnv)\n        return { ...extraEnv };\n    return {\n        ...process.env,\n        ...baseEnv,\n        ...extraEnv,\n    };\n}\nfunction killProcessTree(pid) {\n    if (process.platform === \"win32\") {\n        try {\n            const child = spawn(join(process.env.SystemRoot ?? \"C:\\\\Windows\", \"System32\", \"taskkill.exe\"), [\"/F\", \"/T\", \"/PID\", String(pid)], {\n                stdio: \"ignore\",\n                detached: true,\n                windowsHide: true,\n            });\n            // A failed spawn emits \"error\" asynchronously; consume it to avoid crashing Node.\n            child.once(\"error\", () => { });\n        }\n        catch {\n            // Ignore errors.\n        }\n        return;\n    }\n    try {\n        process.kill(-pid, \"SIGKILL\");\n    }\n    catch {\n        try {\n            process.kill(pid, \"SIGKILL\");\n        }\n        catch {\n            // Process already dead.\n        }\n    }\n}\nfunction waitForChildProcess(child, spillIsDraining) {\n    return new Promise((resolvePromise, reject) => {\n        let settled = false;\n        let exited = false;\n        let exitCode = null;\n        let exitSignal = null;\n        let postExitTimer;\n        let stdoutEnded = child.stdout === null;\n        let stderrEnded = child.stderr === null;\n        const cleanup = () => {\n            if (postExitTimer)\n                clearTimeout(postExitTimer);\n            child.removeListener(\"error\", onError);\n            child.removeListener(\"exit\", onExit);\n            child.removeListener(\"close\", onClose);\n            child.stdout?.removeListener(\"end\", onStdoutEnd);\n            child.stderr?.removeListener(\"end\", onStderrEnd);\n            child.stdout?.removeListener(\"data\", onData);\n            child.stderr?.removeListener(\"data\", onData);\n        };\n        const finalize = () => {\n            if (settled)\n                return;\n            settled = true;\n            cleanup();\n            child.stdout?.destroy();\n            child.stderr?.destroy();\n            resolvePromise({ code: exitCode, signal: exitSignal });\n        };\n        const maybeFinalizeAfterExit = () => {\n            if (exited && stdoutEnded && stderrEnded)\n                finalize();\n        };\n        const armIdleTimer = () => {\n            if (postExitTimer)\n                clearTimeout(postExitTimer);\n            postExitTimer = setTimeout(() => {\n                if (spillIsDraining())\n                    armIdleTimer();\n                else\n                    finalize();\n            }, EXIT_STDIO_GRACE_MS);\n        };\n        const onData = () => {\n            if (exited && !settled)\n                armIdleTimer();\n        };\n        const onStdoutEnd = () => {\n            stdoutEnded = true;\n            maybeFinalizeAfterExit();\n        };\n        const onStderrEnd = () => {\n            stderrEnded = true;\n            maybeFinalizeAfterExit();\n        };\n        const onError = (error) => {\n            if (settled)\n                return;\n            settled = true;\n            cleanup();\n            reject(error);\n        };\n        const onExit = (code, signal) => {\n            exited = true;\n            exitCode = code;\n            exitSignal = signal;\n            maybeFinalizeAfterExit();\n            if (!settled)\n                armIdleTimer();\n        };\n        const onClose = (code, signal) => {\n            exitCode = code;\n            exitSignal = signal;\n            finalize();\n        };\n        child.stdout?.once(\"end\", onStdoutEnd);\n        child.stderr?.once(\"end\", onStderrEnd);\n        child.stdout?.on(\"data\", onData);\n        child.stderr?.on(\"data\", onData);\n        child.once(\"error\", onError);\n        child.once(\"exit\", onExit);\n        child.once(\"close\", onClose);\n    });\n}\n/** Strict LF reader; Node readline does not report whether its final line was newline-terminated. */\nclass NodeTextLineReader {\n    file;\n    path;\n    decoder = new StreamDecoder();\n    chunk = new Uint8Array(64 * 1024);\n    byteOffset = 0;\n    buffered = \"\";\n    ended = false;\n    closed = false;\n    constructor(file, path) {\n        this.file = file;\n        this.path = path;\n    }\n    async readLine(context) {\n        const aborted = abortResult(context.abortSignal, this.path);\n        if (aborted)\n            return aborted;\n        if (this.closed)\n            return err(new FileError(\"invalid\", \"Text line reader is closed\", this.path));\n        try {\n            while (true) {\n                const newline = this.buffered.indexOf(\"\\n\");\n                if (newline !== -1) {\n                    const text = this.buffered.slice(0, newline);\n                    this.buffered = this.buffered.slice(newline + 1);\n                    return ok({ text, terminated: true });\n                }\n                if (this.ended) {\n                    if (this.buffered.length === 0)\n                        return ok(undefined);\n                    const text = this.buffered;\n                    this.buffered = \"\";\n                    return ok({ text, terminated: false });\n                }\n                // Explicit positions allow an aborted read to be retried without skipping bytes.\n                const { bytesRead } = await this.file.read(this.chunk, 0, this.chunk.length, this.byteOffset);\n                const afterReadAbort = abortResult(context.abortSignal, this.path);\n                if (afterReadAbort)\n                    return afterReadAbort;\n                this.byteOffset += bytesRead;\n                if (bytesRead === 0) {\n                    this.buffered += this.decoder.decode();\n                    this.ended = true;\n                }\n                else {\n                    this.buffered += this.decoder.decode(this.chunk.subarray(0, bytesRead));\n                }\n            }\n        }\n        catch (error) {\n            return err(toFileError(error, this.path));\n        }\n    }\n    async close(_context) {\n        if (this.closed)\n            return;\n        this.closed = true;\n        this.buffered = \"\";\n        try {\n            await this.file.close();\n        }\n        catch {\n            // Closing is best-effort, including after cancellation or an earlier I/O failure.\n        }\n    }\n}\nfunction closedResult(what, path) {\n    return err(new FileError(\"invalid\", `${what} is closed`, path));\n}\nclass NodeBinaryReader {\n    file;\n    path;\n    closed = false;\n    constructor(file, path) {\n        this.file = file;\n        this.path = path;\n    }\n    async info(context) {\n        const aborted = abortResult(context.abortSignal, this.path);\n        if (aborted)\n            return aborted;\n        if (this.closed)\n            return closedResult(\"Binary reader\", this.path);\n        try {\n            return fileInfoFromStats(this.path, await this.file.stat());\n        }\n        catch (error) {\n            return err(toFileError(error, this.path));\n        }\n    }\n    async read(offset, length, context) {\n        const aborted = abortResult(context.abortSignal, this.path);\n        if (aborted)\n            return aborted;\n        if (this.closed)\n            return closedResult(\"Binary reader\", this.path);\n        if (!Number.isSafeInteger(offset) || offset < 0 || !Number.isSafeInteger(length) || length < 0) {\n            return err(new FileError(\"invalid\", \"Offset and length must be non-negative safe integers\", this.path));\n        }\n        const chunks = [];\n        let total = 0;\n        try {\n            while (total < length) {\n                const chunk = new Uint8Array(Math.min(length - total, BINARY_READ_CHUNK));\n                const { bytesRead } = await this.file.read(chunk, 0, chunk.length, offset + total);\n                const afterReadAbort = abortResult(context.abortSignal, this.path);\n                if (afterReadAbort)\n                    return afterReadAbort;\n                if (bytesRead === 0)\n                    break;\n                chunks.push(bytesRead === chunk.length ? chunk : chunk.subarray(0, bytesRead));\n                total += bytesRead;\n            }\n        }\n        catch (error) {\n            return err(toFileError(error, this.path));\n        }\n        if (chunks.length === 1)\n            return ok(chunks[0]);\n        const bytes = new Uint8Array(total);\n        let position = 0;\n        for (const chunk of chunks) {\n            bytes.set(chunk, position);\n            position += chunk.length;\n        }\n        return ok(bytes);\n    }\n    async scanLines(options, context) {\n        const aborted = abortResult(context.abortSignal, this.path);\n        if (aborted)\n            return aborted;\n        if (this.closed)\n            return closedResult(\"Binary reader\", this.path);\n        let scanner;\n        try {\n            scanner = new LineScanner(options.startLine, options.endLine);\n        }\n        catch {\n            return err(new FileError(\"invalid\", \"Invalid line range\", this.path));\n        }\n        const chunk = new Uint8Array(64 * 1024);\n        try {\n            for (let position = 0;;) {\n                const { bytesRead } = await this.file.read(chunk, 0, chunk.length, position);\n                const afterReadAbort = abortResult(context.abortSignal, this.path);\n                if (afterReadAbort)\n                    return afterReadAbort;\n                if (bytesRead === 0)\n                    return ok(scanner.finish());\n                scanner.push(chunk.subarray(0, bytesRead));\n                position += bytesRead;\n            }\n        }\n        catch (error) {\n            return err(toFileError(error, this.path));\n        }\n    }\n    async close(_context) {\n        if (this.closed)\n            return;\n        this.closed = true;\n        await this.file.close().catch(() => undefined);\n    }\n}\nclass NodeDirReader {\n    dir;\n    path;\n    done = false;\n    closed = false;\n    constructor(dir, path) {\n        this.dir = dir;\n        this.path = path;\n    }\n    async next(maxEntries, context) {\n        const aborted = abortResult(context.abortSignal, this.path);\n        if (aborted)\n            return aborted;\n        if (this.closed)\n            return closedResult(\"Directory reader\", this.path);\n        if (!Number.isSafeInteger(maxEntries) || maxEntries <= 0) {\n            return err(new FileError(\"invalid\", \"maxEntries must be a positive safe integer\", this.path));\n        }\n        const entries = [];\n        try {\n            while (!this.done && entries.length < maxEntries) {\n                const entry = await this.dir.read();\n                if (entry === null) {\n                    this.done = true;\n                    break;\n                }\n                const loopAbort = abortResult(context.abortSignal, this.path);\n                if (loopAbort)\n                    return loopAbort;\n                const entryPath = resolve(this.path, entry.name);\n                let stats;\n                try {\n                    stats = await lstat(entryPath);\n                }\n                catch (error) {\n                    // Removed between enumeration and lstat: not part of the listing any more.\n                    if (isNodeError(error) && error.code === \"ENOENT\")\n                        continue;\n                    return err(toFileError(error, entryPath));\n                }\n                const info = fileInfoFromStats(entryPath, stats);\n                if (info.ok)\n                    entries.push(info.value);\n            }\n            return ok({ entries, done: this.done });\n        }\n        catch (error) {\n            return err(toFileError(error, this.path));\n        }\n    }\n    async close(_context) {\n        if (this.closed)\n            return;\n        this.closed = true;\n        await this.dir.close().catch(() => undefined);\n    }\n}\nfunction symlinkRefused(path, cause) {\n    return new FileError(\"invalid\", \"Refusing to follow a symbolic link\", path, cause);\n}\nexport class NodeExecutionEnv {\n    /** Every local environment sees the same files. */\n    id = \"node:local\";\n    cwd;\n    shellPath;\n    shellEnv;\n    watchOptions;\n    activeChildPids = new Set();\n    constructor(options) {\n        this.cwd = options.cwd;\n        this.shellPath = options.shellPath;\n        this.shellEnv = options.shellEnv;\n        this.watchOptions = options.watch ?? {};\n    }\n    async watch(targets, onChange, context) {\n        const aborted = abortResult(context.abortSignal);\n        if (aborted)\n            return aborted;\n        try {\n            const watcher = await NodeFileWatcher.open(targets, (path) => resolvePath(this.cwd, path), onChange, this.watchOptions);\n            const afterOpenAbort = abortResult(context.abortSignal);\n            if (afterOpenAbort) {\n                await watcher.close(context);\n                return afterOpenAbort;\n            }\n            return ok(watcher);\n        }\n        catch (error) {\n            return err(toFileError(error));\n        }\n    }\n    async absolutePath(path, _context) {\n        return ok(resolvePath(this.cwd, path));\n    }\n    async joinPath(parts, _context) {\n        return ok(join(...parts));\n    }\n    async exec(command, options, context) {\n        const signal = context.abortSignal;\n        if (signal?.aborted)\n            return err(new ExecutionError(\"aborted\", \"aborted\"));\n        const timeoutMsResult = resolveTimeoutMs(options?.timeout);\n        if (!timeoutMsResult.ok)\n            return err(timeoutMsResult.error);\n        const timeoutMs = timeoutMsResult.value;\n        const cwd = options?.cwd ? resolvePath(this.cwd, options.cwd) : this.cwd;\n        // A string runs through the shell; an argv array runs its program directly, without shell parsing.\n        let program;\n        let args;\n        let stdinCommand;\n        if (typeof command === \"string\") {\n            const shellConfig = await getShellConfig(this.shellPath);\n            if (!shellConfig.ok)\n                return shellConfig;\n            const commandFromStdin = shellConfig.value.commandTransport === \"stdin\";\n            program = shellConfig.value.shell;\n            args = commandFromStdin ? shellConfig.value.args : [...shellConfig.value.args, command];\n            stdinCommand = commandFromStdin ? command : undefined;\n        }\n        else {\n            const [first, ...rest] = command;\n            if (first === undefined)\n                return err(new ExecutionError(\"spawn_error\", \"Empty argv: no program to run\"));\n            program = first;\n            args = rest;\n        }\n        try {\n            await access(cwd, constants.F_OK);\n        }\n        catch (error) {\n            const cause = toError(error);\n            return err(new ExecutionError(\"spawn_error\", `Working directory does not exist: ${cwd}\\nCannot execute bash commands.`, cause));\n        }\n        return await new Promise((resolvePromise) => {\n            let settled = false;\n            let timedOut = false;\n            let callbackError;\n            let spillError;\n            let child;\n            let timeoutId;\n            const spillPrefix = [];\n            let spillPath;\n            const spillQueue = [];\n            let spillStart;\n            let spillStream;\n            let spillBackpressured = false;\n            const onAbort = () => {\n                if (child?.pid)\n                    killProcessTree(child.pid);\n            };\n            const failCallback = (error) => {\n                if (callbackError !== undefined)\n                    return;\n                const cause = toError(error);\n                callbackError = new ExecutionError(\"callback_error\", cause.message, cause);\n                onAbort();\n            };\n            // One decoder per stream, so a character split across chunks of one stream survives interleaving.\n            const stdoutDecoder = new StreamDecoder();\n            const stderrDecoder = new StreamDecoder();\n            // No output reaches the caller after exec() settled, for example from a descendant holding stdio open.\n            const emit = (text, stream) => {\n                if (settled || text === \"\" || options?.onOutput === undefined || callbackError !== undefined)\n                    return;\n                try {\n                    options.onOutput(text, context, { stream });\n                }\n                catch (error) {\n                    failCallback(error);\n                }\n            };\n            // Output seen before the spill starts: counted against the thresholds and kept for the spill's prefix.\n            let seenBytes = 0;\n            let seenNewlines = 0;\n            const settle = (result) => {\n                if (settled)\n                    return;\n                settled = true;\n                if (timeoutId)\n                    clearTimeout(timeoutId);\n                if (signal)\n                    signal.removeEventListener(\"abort\", onAbort);\n                if (child?.pid)\n                    this.activeChildPids.delete(child.pid);\n                resolvePromise(result);\n            };\n            const pauseOutput = () => {\n                child?.stdout?.pause();\n                child?.stderr?.pause();\n            };\n            const resumeOutput = () => {\n                if (callbackError || spillError || timedOut || signal?.aborted || spillBackpressured)\n                    return;\n                child?.stdout?.resume();\n                child?.stderr?.resume();\n            };\n            const failSpill = (error) => {\n                if (spillError !== undefined)\n                    return;\n                const cause = toError(error);\n                spillError = new ExecutionError(\"unknown\", `Failed to preserve complete shell output: ${cause.message}`, cause);\n                spillBackpressured = false;\n                onAbort();\n            };\n            const writeSpill = (chunk) => {\n                if (spillStream === undefined || chunk.length === 0)\n                    return;\n                if (spillStream.write(chunk) || spillBackpressured)\n                    return;\n                spillBackpressured = true;\n                pauseOutput();\n                spillStream.once(\"drain\", () => {\n                    spillBackpressured = false;\n                    resumeOutput();\n                });\n            };\n            const startSpill = (chunk) => {\n                if (spillStream !== undefined) {\n                    writeSpill(chunk);\n                    return;\n                }\n                spillQueue.push(chunk);\n                if (spillStart !== undefined)\n                    return;\n                pauseOutput();\n                spillStart = (async () => {\n                    const created = await this.createTempFile({ prefix: \"pi-output-\", suffix: \".log\" }, context);\n                    if (!created.ok)\n                        throw created.error;\n                    spillPath = created.value;\n                    spillStream = createWriteStream(spillPath, { flags: \"a\", highWaterMark: SPILL_HIGH_WATER_MARK });\n                    spillStream.on(\"error\", failSpill);\n                    for (const queued of spillQueue)\n                        writeSpill(queued);\n                    spillQueue.length = 0;\n                })()\n                    .catch(failSpill)\n                    .finally(resumeOutput);\n            };\n            const finishSpill = async () => {\n                await spillStart;\n                const stream = spillStream;\n                if (stream === undefined || spillError !== undefined || stream.destroyed)\n                    return;\n                await new Promise((resolveFinish) => {\n                    stream.once(\"error\", () => resolveFinish());\n                    stream.once(\"finish\", resolveFinish);\n                    stream.end();\n                });\n            };\n            try {\n                child = spawn(program, args, {\n                    cwd,\n                    detached: process.platform !== \"win32\",\n                    env: getShellEnv(this.shellEnv, options?.env, options?.inheritEnv),\n                    stdio: [stdinCommand === undefined ? \"ignore\" : \"pipe\", \"pipe\", \"pipe\"],\n                    windowsHide: true,\n                });\n                if (child.pid)\n                    this.activeChildPids.add(child.pid);\n                if (stdinCommand !== undefined) {\n                    child.stdin?.on(\"error\", () => { });\n                    child.stdin?.end(stdinCommand);\n                }\n            }\n            catch (error) {\n                const cause = toError(error);\n                settle(err(new ExecutionError(\"spawn_error\", cause.message, cause)));\n                return;\n            }\n            timeoutId =\n                timeoutMs === undefined\n                    ? undefined\n                    : setTimeout(() => {\n                        timedOut = true;\n                        onAbort();\n                    }, timeoutMs);\n            if (signal) {\n                if (signal.aborted)\n                    onAbort();\n                else\n                    signal.addEventListener(\"abort\", onAbort, { once: true });\n            }\n            const feed = (source, decoder) => (chunk) => {\n                emit(decoder.decode(chunk), source);\n                const spill = options?.spill;\n                if (spill === undefined || chunk.length === 0)\n                    return;\n                if (spillStart !== undefined) {\n                    startSpill(chunk);\n                    return;\n                }\n                seenBytes += chunk.length;\n                for (let index = chunk.indexOf(0x0a); index !== -1; index = chunk.indexOf(0x0a, index + 1))\n                    seenNewlines++;\n                const lines = seenNewlines + (chunk[chunk.length - 1] === 0x0a ? 0 : 1);\n                if (seenBytes <= spill.afterBytes && lines <= spill.afterLines) {\n                    spillPrefix.push(chunk);\n                    return;\n                }\n                for (const prefix of spillPrefix)\n                    startSpill(prefix);\n                spillPrefix.length = 0;\n                startSpill(chunk);\n            };\n            child.stdout?.on(\"data\", feed(\"stdout\", stdoutDecoder));\n            child.stderr?.on(\"data\", feed(\"stderr\", stderrDecoder));\n            void waitForChildProcess(child, () => spillError === undefined &&\n                spillStart !== undefined &&\n                (spillStream === undefined || spillBackpressured)).then(async ({ code, signal: exitSignal }) => {\n                await finishSpill();\n                emit(stdoutDecoder.decode(), \"stdout\");\n                emit(stderrDecoder.decode(), \"stderr\");\n                if (callbackError) {\n                    settle(err(callbackError));\n                    return;\n                }\n                const interrupted = timedOut\n                    ? new ExecutionError(\"timeout\", `timeout:${options?.timeout}`)\n                    : signal?.aborted\n                        ? new ExecutionError(\"aborted\", \"aborted\")\n                        : undefined;\n                if (interrupted !== undefined) {\n                    if (spillPath !== undefined)\n                        interrupted.spillPath = spillPath;\n                    settle(err(interrupted));\n                    return;\n                }\n                if (spillError) {\n                    settle(err(spillError));\n                    return;\n                }\n                // A process killed by a signal (e.g. OOM killer) has no exit code; map it\n                // to the conventional 128 + signal number so callers do not mistake it\n                // for a successful exit.\n                const exitCode = code ?? (exitSignal ? 128 + (osConstants.signals[exitSignal] ?? 0) : 1);\n                settle(ok({ exitCode, ...(spillPath === undefined ? {} : { spillPath }) }));\n            }, (error) => settle(err(new ExecutionError(\"spawn_error\", error.message, error))));\n        });\n    }\n    async openTextLineReader(path, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const aborted = abortResult(context.abortSignal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            const file = await openFile(resolved, \"r\");\n            const afterOpenAbort = abortResult(context.abortSignal, resolved);\n            if (afterOpenAbort) {\n                await file.close().catch(() => undefined);\n                return afterOpenAbort;\n            }\n            return ok(new NodeTextLineReader(file, resolved));\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async readTextFile(path, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const signal = context.abortSignal;\n        const aborted = abortResult(signal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            return ok(await readFile(resolved, { encoding: \"utf8\", signal }));\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async readTextLines(path, options, context) {\n        if (options?.maxLines !== undefined && options.maxLines <= 0)\n            return ok([]);\n        const opened = await this.openTextLineReader(path, context);\n        if (!opened.ok)\n            return opened;\n        const lines = [];\n        try {\n            while (options?.maxLines === undefined || lines.length < options.maxLines) {\n                const line = await opened.value.readLine(context);\n                if (!line.ok)\n                    return line;\n                if (line.value === undefined)\n                    break;\n                lines.push(line.value.text);\n            }\n            return ok(lines);\n        }\n        finally {\n            await opened.value.close(context);\n        }\n    }\n    async readBinaryFile(path, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const signal = context.abortSignal;\n        const aborted = abortResult(signal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            return ok(await readFile(resolved, { signal }));\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async openBinaryReader(path, options, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const aborted = abortResult(context.abortSignal, resolved);\n        if (aborted)\n            return aborted;\n        const noFollow = options?.noFollow === true;\n        let file;\n        try {\n            let flags = constants.O_RDONLY;\n            if (process.platform === \"win32\") {\n                // Windows has no O_NOFOLLOW; check the final component before opening (not race-free).\n                if (noFollow && (await lstat(resolved)).isSymbolicLink())\n                    return err(symlinkRefused(resolved));\n            }\n            else {\n                // Nonblocking, so opening a FIFO does not wait for a writer.\n                flags |= constants.O_NONBLOCK;\n                if (noFollow)\n                    flags |= constants.O_NOFOLLOW;\n            }\n            file = await openFile(resolved, flags);\n            const stats = await file.stat();\n            if (!stats.isFile()) {\n                await file.close().catch(() => undefined);\n                return err(stats.isDirectory()\n                    ? new FileError(\"is_directory\", \"EISDIR: illegal operation on a directory, read\", resolved)\n                    : new FileError(\"invalid\", \"Not a regular file\", resolved));\n            }\n            const afterOpenAbort = abortResult(context.abortSignal, resolved);\n            if (afterOpenAbort) {\n                await file.close().catch(() => undefined);\n                return afterOpenAbort;\n            }\n            return ok(new NodeBinaryReader(file, resolved));\n        }\n        catch (error) {\n            await file?.close().catch(() => undefined);\n            // O_NOFOLLOW reports a final-component symlink as ELOOP (EMLINK on some BSDs).\n            if (noFollow && isNodeError(error) && (error.code === \"ELOOP\" || error.code === \"EMLINK\")) {\n                return err(symlinkRefused(resolved, toError(error)));\n            }\n            return err(toFileError(error, resolved));\n        }\n    }\n    async writeFile(path, content, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const signal = context.abortSignal;\n        const aborted = abortResult(signal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            await mkdir(resolve(resolved, \"..\"), { recursive: true });\n            const afterMkdirAbort = abortResult(signal, resolved);\n            if (afterMkdirAbort)\n                return afterMkdirAbort;\n            await writeFile(resolved, content, { signal });\n            return ok(undefined);\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async appendFile(path, content, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const signal = context.abortSignal;\n        const aborted = abortResult(signal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            await mkdir(resolve(resolved, \"..\"), { recursive: true });\n            const afterMkdirAbort = abortResult(signal, resolved);\n            if (afterMkdirAbort)\n                return afterMkdirAbort;\n            await appendFile(resolved, content);\n            const afterAppendAbort = abortResult(signal, resolved);\n            return afterAppendAbort ?? ok(undefined);\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async truncateFile(path, size, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const signal = context.abortSignal;\n        const aborted = abortResult(signal, resolved);\n        if (aborted)\n            return aborted;\n        if (!Number.isSafeInteger(size) || size < 0) {\n            return err(new FileError(\"invalid\", \"File size must be a non-negative safe integer\", resolved));\n        }\n        let file;\n        try {\n            file = await openFile(resolved, \"r+\");\n            await file.truncate(size);\n            const afterTruncateAbort = abortResult(signal, resolved);\n            return afterTruncateAbort ?? ok(undefined);\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n        finally {\n            await file?.close().catch(() => undefined);\n        }\n    }\n    async flushFile(path, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const signal = context.abortSignal;\n        const aborted = abortResult(signal, resolved);\n        if (aborted)\n            return aborted;\n        let file;\n        try {\n            file = await openFile(resolved, \"r+\");\n            // POSIX refuses to open a directory for writing; Windows opens it, so check explicitly.\n            if ((await file.stat()).isDirectory())\n                return err(new FileError(\"is_directory\", \"Is a directory\", resolved));\n            await file.sync();\n            const afterSyncAbort = abortResult(signal, resolved);\n            return afterSyncAbort ?? ok(undefined);\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n        finally {\n            await file?.close().catch(() => undefined);\n        }\n    }\n    async renameFile(sourcePath, destinationPath, context) {\n        const source = resolvePath(this.cwd, sourcePath);\n        const destination = resolvePath(this.cwd, destinationPath);\n        const aborted = abortResult(context.abortSignal, destination);\n        if (aborted)\n            return aborted;\n        try {\n            await rename(source, destination);\n            return ok(undefined);\n        }\n        catch (error) {\n            return err(toFileError(error, source));\n        }\n    }\n    async fileInfo(path, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const aborted = abortResult(context.abortSignal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            return fileInfoFromStats(resolved, await lstat(resolved));\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async listDir(path, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const signal = context.abortSignal;\n        const aborted = abortResult(signal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            const entries = await readdir(resolved, { withFileTypes: true });\n            const infos = [];\n            for (const entry of entries) {\n                const loopAbort = abortResult(signal, resolved);\n                if (loopAbort)\n                    return loopAbort;\n                const entryPath = resolve(resolved, entry.name);\n                try {\n                    const info = fileInfoFromStats(entryPath, await lstat(entryPath));\n                    if (info.ok)\n                        infos.push(info.value);\n                }\n                catch (error) {\n                    return err(toFileError(error, entryPath));\n                }\n            }\n            return ok(infos);\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async openDirReader(path, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const aborted = abortResult(context.abortSignal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            const dir = await opendir(resolved);\n            const afterOpenAbort = abortResult(context.abortSignal, resolved);\n            if (afterOpenAbort) {\n                await dir.close().catch(() => undefined);\n                return afterOpenAbort;\n            }\n            return ok(new NodeDirReader(dir, resolved));\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async canonicalPath(path, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const aborted = abortResult(context.abortSignal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            return ok(await realpath(resolved));\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async exists(path, context) {\n        const result = await this.fileInfo(path, context);\n        if (result.ok)\n            return ok(true);\n        if (result.error.code === \"not_found\")\n            return ok(false);\n        return err(result.error);\n    }\n    async createDir(path, options, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const aborted = abortResult(context.abortSignal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            await mkdir(resolved, { recursive: options?.recursive ?? true });\n            return ok(undefined);\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async remove(path, options, context) {\n        const resolved = resolvePath(this.cwd, path);\n        const aborted = abortResult(context.abortSignal, resolved);\n        if (aborted)\n            return aborted;\n        try {\n            await rm(resolved, { recursive: options?.recursive ?? false, force: options?.force ?? false });\n            return ok(undefined);\n        }\n        catch (error) {\n            return err(toFileError(error, resolved));\n        }\n    }\n    async createTempDir(prefix, context) {\n        const aborted = abortResult(context.abortSignal);\n        if (aborted)\n            return aborted;\n        try {\n            prefix ??= \"tmp-\";\n            return ok(await mkdtemp(join(tmpdir(), prefix)));\n        }\n        catch (error) {\n            return err(toFileError(error));\n        }\n    }\n    async createTempFile(options, context) {\n        const dir = await this.createTempDir(\"tmp-\", context);\n        if (!dir.ok)\n            return dir;\n        const filePath = join(dir.value, `${options?.prefix ?? \"\"}${randomUUID()}${options?.suffix ?? \"\"}`);\n        try {\n            await writeFile(filePath, \"\");\n            return ok(filePath);\n        }\n        catch (error) {\n            return err(toFileError(error, filePath));\n        }\n    }\n    async cleanup(_context) {\n        for (const pid of this.activeChildPids)\n            killProcessTree(pid);\n        this.activeChildPids.clear();\n    }\n}\n//# sourceMappingURL=node.js.map","import { createHistoryOwnership } from \"./historyOwnership.mjs\";\nimport { DURABLE_DIRECTORY } from \"./src/services/durableSession/index.mjs\";\nimport { openReadOnlyDurableStorage, openSqliteSessionStorage, sqliteSessionFile } from \"./sqliteSessionStorage.mjs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport fs from \"node:fs/promises\";\nimport { openNodeSqliteDatabase } from \"@earendil-works/pi-durable/storage/sqlite/node\";\nimport { NodeExecutionEnv } from \"@earendil-works/pi-durable/env/node\";\n//#region src/services/nodePlatform/index.ts\n/** One lock-owned durable-v1 SQLite file per agent session. */\nfunction createNodeSessions(options) {\n\tlet historyOwnership = options.historyOwnership;\n\tconst root = () => {\n\t\tif (options.sessionsRoot === void 0) throw new Error(\"This Node platform was given no sessions root.\");\n\t\treturn options.sessionsRoot;\n\t};\n\treturn {\n\t\tabiVersion: 1,\n\t\tasync open(request, context) {\n\t\t\thistoryOwnership ??= createHistoryOwnership({ sourceFormat: \"sqlite\" });\n\t\t\tconst opened = await openSqliteSessionStorage({\n\t\t\t\t...request,\n\t\t\t\tsessionsRoot: root(),\n\t\t\t\thistoryOwnership\n\t\t\t}, context);\n\t\t\treturn {\n\t\t\t\tstorage: opened.storage,\n\t\t\t\tassertWritable: () => opened.historyLease.assertQuiescent(),\n\t\t\t\tasync release(releaseContext) {\n\t\t\t\t\tawait opened.session.close(releaseContext);\n\t\t\t\t\tawait opened.historyLease.release();\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\topenReadOnly: async (sessionId) => openReadOnlyDurableStorage(sqliteSessionFile(root(), sessionId)),\n\t\tasync list() {\n\t\t\tconst directory = path.join(root(), DURABLE_DIRECTORY);\n\t\t\tconst files = await fs.readdir(directory).catch((error) => {\n\t\t\t\tif (error.code === \"ENOENT\") return [];\n\t\t\t\tthrow error;\n\t\t\t});\n\t\t\tconst stored = [];\n\t\t\tfor (const file of files) {\n\t\t\t\tif (!/^[a-zA-Z0-9_-]+\\.sqlite$/u.test(file)) continue;\n\t\t\t\tconst { mtimeMs } = await fs.stat(path.join(directory, file));\n\t\t\t\tstored.push({\n\t\t\t\t\tsessionId: path.basename(file, \".sqlite\"),\n\t\t\t\t\tupdatedAt: mtimeMs\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn stored;\n\t\t}\n\t};\n}\n/** The Node host: local files and shell, `node:sqlite` files, and lock-owned durable-v1 sessions. */\nfunction createNodePlatform(options = {}) {\n\treturn {\n\t\tabiVersion: 1,\n\t\thomeDirectory: options.homeDirectory ?? os.homedir(),\n\t\ttemporaryDirectory: process.platform === \"darwin\" || process.platform === \"linux\" ? options.temporaryDirectory ?? os.tmpdir() : void 0,\n\t\tenv: (cwd) => new NodeExecutionEnv({ cwd }),\n\t\tsqlite: {\n\t\t\tabiVersion: 1,\n\t\t\topen: (file) => openNodeSqliteDatabase(file)\n\t\t},\n\t\tsessions: createNodeSessions(options)\n\t};\n}\n//#endregion\nexport { createNodePlatform };\n\n//# sourceMappingURL=nodePlatform.mjs.map","//#region src/services/traceContext/index.ts\nconst TRACEPARENT = /^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u;\n/** Accepts only a valid W3C traceparent and never forwards tracestate or baggage. */\nfunction validatedTraceContext(value) {\n\tif (typeof value !== \"string\") return void 0;\n\tconst match = TRACEPARENT.exec(value);\n\tif (!match || /^0+$/u.test(match[1] ?? \"\") || /^0+$/u.test(match[2] ?? \"\")) return void 0;\n\treturn { traceparent: value };\n}\n//#endregion\nexport { validatedTraceContext };\n\n//# sourceMappingURL=index.mjs.map","import { OperationCancelledError } from \"./src/services/telemetry/index.mjs\";\nimport { observe } from \"./serverTelemetry.mjs\";\nimport { PO_SESSION_TEMP_DIR, prepareSessionEnvironment } from \"./src/services/sessionFiles/index.mjs\";\nimport { PO_API_ROUTE_PREFIX } from \"./src/schemas/packageApi.mjs\";\nimport \"./packageApi.mjs\";\nimport { SESSION_FILES_API } from \"./src/constants/sessionFiles.mjs\";\nimport { readAccessibleFile } from \"./src/services/fileAccess/accessibleFile.mjs\";\nimport { PO_FILE_ACCESS_SERVICE, createFileAccess } from \"./src/services/fileAccess/index.mjs\";\nimport { createPoServerHost } from \"./src/services/serverHost/index.mjs\";\nimport { PoServerScope } from \"./src/server/serverScope.mjs\";\nimport \"./serverPlugin.mjs\";\nimport { validatedTraceContext } from \"./src/services/traceContext/index.mjs\";\nimport path from \"node:path\";\n//#region src/server/packageApiServer.ts\n/**\n* A body that keeps streaming well after its headers went out is worth its own span. A fast\n* one is not: the request span already carries the duration and outcome, so emitting a second\n* span per call made package API traffic 99.65% of all spans recorded in a two hour sample.\n*/\nconst COMPLETION_SPAN_MIN_DURATION_MS = 1e3;\nfunction describeError(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\nfunction responseWithCompletion(response, complete) {\n\tif (response.body === null) {\n\t\tcomplete();\n\t\treturn response;\n\t}\n\tconst reader = response.body.getReader();\n\tlet completed = false;\n\tconst finish = () => {\n\t\tif (completed) return;\n\t\tcompleted = true;\n\t\tcomplete();\n\t};\n\tconst body = new ReadableStream({\n\t\tasync pull(controller) {\n\t\t\ttry {\n\t\t\t\tconst result = await reader.read();\n\t\t\t\tif (result.done) {\n\t\t\t\t\tfinish();\n\t\t\t\t\tcontroller.close();\n\t\t\t\t} else controller.enqueue(result.value);\n\t\t\t} catch (error) {\n\t\t\t\tfinish();\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t},\n\t\tasync cancel(reason) {\n\t\t\tfinish();\n\t\t\tawait reader.cancel(reason);\n\t\t}\n\t});\n\treturn new Response(body, response);\n}\n/** Reads files under the session's open folders; the hub's session `/file` route forwards here. */\nfunction sessionFilesApi(fileAccess, cwd) {\n\treturn {\n\t\tbasePath: SESSION_FILES_API,\n\t\tstart: () => ({\n\t\t\tfetch: (request) => {\n\t\t\t\tif (request.method !== \"GET\") return Response.json({ error: \"Method not allowed.\" }, { status: 405 });\n\t\t\t\treturn readAccessibleFile({\n\t\t\t\t\troots: fileAccess.roots(),\n\t\t\t\t\tcwd,\n\t\t\t\t\tpath: new URL(request.url).searchParams.get(\"path\"),\n\t\t\t\t\t...request.headers.get(\"range\") === null ? {} : { range: request.headers.get(\"range\") },\n\t\t\t\t\t...request.headers.get(\"if-match\") === null ? {} : { expectedVersion: request.headers.get(\"if-match\") }\n\t\t\t\t});\n\t\t\t},\n\t\t\tclose: () => void 0\n\t\t})\n\t};\n}\n/** Installs session packages and dispatches authenticated package API calls in-process. */\nasync function serveSessionApis(options) {\n\tif (options.environment === void 0) throw new Error(\"Session package API server requires an admitted environment.\");\n\tif (options.directEvents === void 0) throw new Error(\"Session package API server requires direct events.\");\n\toptions = {\n\t\t...options,\n\t\tenvironment: await prepareSessionEnvironment(options)\n\t};\n\tconst packages = options.packages ?? [];\n\tconst routesNothing = () => !options.preparePackages && options.parentScope === void 0;\n\tif (options.apis.length === 0 && packages.length === 0 && routesNothing()) return {\n\t\trequest: async () => Response.json({ error: \"No package APIs are mounted.\" }, { status: 404 }),\n\t\tclose: () => Promise.resolve()\n\t};\n\tconst owningSessionService = options.sessionService;\n\tconst communication = owningSessionService?.bindCommunication?.(options.sessionId);\n\tconst ownedReadExecutionState = owningSessionService?.readExecutionState?.bind(owningSessionService);\n\tconst ownedPrompt = owningSessionService?.prompt?.bind(owningSessionService);\n\tconst ownedAbort = owningSessionService?.abort?.bind(owningSessionService);\n\tconst ownedSteer = owningSessionService?.steer?.bind(owningSessionService);\n\tconst ownedRelease = owningSessionService?.release?.bind(owningSessionService);\n\tconst exposedSessionService = owningSessionService === void 0 ? void 0 : {\n\t\tcreate: (request) => owningSessionService.create(request),\n\t\tclose: (sessionId) => owningSessionService.close(sessionId),\n\t\tisLive: (sessionId) => owningSessionService.isLive(sessionId),\n\t\t...ownedReadExecutionState === void 0 ? {} : { readExecutionState: (sessionId) => ownedReadExecutionState(sessionId, { parentSessionId: options.sessionId }) },\n\t\t...ownedPrompt === void 0 ? {} : { prompt: (sessionId, text, promptOptions) => ownedPrompt(sessionId, text, {\n\t\t\t...promptOptions?.signal === void 0 ? {} : { signal: promptOptions.signal },\n\t\t\tparentSessionId: options.sessionId\n\t\t}) },\n\t\t...ownedAbort === void 0 ? {} : { abort: (sessionId) => ownedAbort(sessionId, { parentSessionId: options.sessionId }) },\n\t\t...ownedSteer === void 0 ? {} : { steer: (sessionId, message) => ownedSteer(sessionId, message, { parentSessionId: options.sessionId }) },\n\t\t...ownedRelease === void 0 ? {} : { release: (sessionId) => ownedRelease(sessionId, { parentSessionId: options.sessionId }) },\n\t\t...owningSessionService.canCommunicate === void 0 ? {} : { canCommunicate: (sourceSessionId, targetSessionId) => owningSessionService.canCommunicate?.(sourceSessionId, targetSessionId) === true }\n\t};\n\tconst context = {\n\t\tscope: \"session\",\n\t\tsessionId: options.sessionId,\n\t\tworkspaceId: options.workspaceId,\n\t\tworkspaceRoot: options.workspaceRoot,\n\t\t...options.sessionContext === void 0 ? {} : { sessionContext: options.sessionContext },\n\t\thomeDirectory: options.homeDirectory ?? options.platform.homeDirectory,\n\t\tsessionStorage: options.platform.sessions,\n\t\tcwd: options.cwd,\n\t\tenvironment: options.environment,\n\t\tdirectEvents: options.directEvents,\n\t\t...options.computerUse === void 0 ? {} : { computerUse: options.computerUse },\n\t\t...options.shareFile === void 0 ? {} : { shareFile: options.shareFile },\n\t\t...options.mediaArbitration === void 0 ? {} : { mediaArbitration: options.mediaArbitration },\n\t\t...options.executionBudget === void 0 ? {} : { executionBudget: options.executionBudget },\n\t\t...options.editPresence === void 0 ? {} : { editPresence: options.editPresence },\n\t\t...options.peerAgents === void 0 ? {} : { peerAgents: options.peerAgents },\n\t\t...options.requestApi === void 0 ? {} : { requestApi: options.requestApi },\n\t\t...options.publishActivity === void 0 ? {} : { publishActivity: options.publishActivity },\n\t\t...options.internalToken === void 0 ? {} : { internalToken: options.internalToken },\n\t\t...options.hubToken === void 0 ? {} : { hubToken: options.hubToken },\n\t\t...exposedSessionService === void 0 ? {} : { sessionService: exposedSessionService },\n\t\t...communication === void 0 ? {} : { sessionCommunication: communication },\n\t\tonNotice: options.onNotice\n\t};\n\tconst host = createPoServerHost({\n\t\tscope: \"session\",\n\t\tcontext,\n\t\tmountChannel: options.mountChannel,\n\t\t...options.pluginRegistry === void 0 ? {} : { pluginRegistry: options.pluginRegistry }\n\t});\n\tconst fileAccess = createFileAccess();\n\tfor (const directory of [\n\t\toptions.cwd,\n\t\toptions.workspaceRoot,\n\t\toptions.environment[PO_SESSION_TEMP_DIR]\n\t]) if (directory !== void 0 && path.isAbsolute(directory)) fileAccess.register(directory);\n\tlet scope;\n\ttry {\n\t\thost.registerApi(sessionFilesApi(fileAccess, options.cwd));\n\t\tfor (const api of options.apis) host.registerApi(api);\n\t\tscope = await PoServerScope.open(\"session\", options.parentScope);\n\t\tawait scope.serve({\n\t\t\thost,\n\t\t\tplatform: options.platform\n\t\t});\n\t\tawait scope.root.plugin((root) => {\n\t\t\troot.provide(PO_FILE_ACCESS_SERVICE, fileAccess);\n\t\t});\n\t\tawait options.preparePackages?.(scope.root);\n\t\tconst installed = await scope.install(packages, {\n\t\t\tonNotice: options.onNotice,\n\t\t\tonPackageSettled: (report) => {\n\t\t\t\tif (!options.telemetry) return;\n\t\t\t\tobserve(options.telemetry.recordEvent(\"po_server.package_install\", {\n\t\t\t\t\t\"package.name\": report.packageName,\n\t\t\t\t\t\"package.outcome\": report.outcome,\n\t\t\t\t\tduration_ms: report.durationMs,\n\t\t\t\t\tscope: \"session\"\n\t\t\t\t}), options.onNotice);\n\t\t\t}\n\t\t});\n\t\tawait options.activatePackages?.(installed);\n\t} catch (error) {\n\t\tawait scope?.dispose();\n\t\tcommunication?.close();\n\t\thost.dispose();\n\t\tthrow error;\n\t}\n\tif (host.mounted().length === 0 && routesNothing()) {\n\t\tawait scope.dispose();\n\t\tcommunication?.close();\n\t\thost.dispose();\n\t\treturn {\n\t\t\trequest: async () => Response.json({ error: \"No package APIs are mounted.\" }, { status: 404 }),\n\t\t\tclose: () => Promise.resolve()\n\t\t};\n\t}\n\tconst sessionScope = scope;\n\tconst dispatch = async (request) => {\n\t\tif (options.canDispatch?.() === false) return Response.json({ error: \"Session selection is not ready.\" }, { status: 503 });\n\t\tconst url = new URL(request.url);\n\t\tif (!url.pathname.startsWith(`/api/plugins/`)) return Response.json({ error: \"Not found.\" }, { status: 404 });\n\t\tconst rest = url.pathname.slice(PO_API_ROUTE_PREFIX.length + 1);\n\t\tconst slash = rest.indexOf(\"/\");\n\t\tconst basePath = slash === -1 ? rest : rest.slice(0, slash);\n\t\tconst handler = sessionScope.apiHandler(basePath);\n\t\tif (handler === void 0) return Response.json({ error: `No API '${basePath}' in this session.` }, { status: 404 });\n\t\turl.pathname = slash === -1 ? \"/\" : rest.slice(slash);\n\t\tconst startedAt = performance.now();\n\t\tconst parent = validatedTraceContext(request.headers.get(\"traceparent\"));\n\t\tlet childContext;\n\t\tlet response;\n\t\ttry {\n\t\t\tconst invoke = async (context) => {\n\t\t\t\tif (options.canDispatch?.() === false || sessionScope.apiHandler(basePath) !== handler) return Response.json({ error: \"Session selection changed before dispatch.\" }, { status: 503 });\n\t\t\t\tchildContext = context;\n\t\t\t\tconst incoming = new Request(url, request);\n\t\t\t\ttry {\n\t\t\t\t\treturn await handler.fetch(incoming);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (incoming.signal.aborted && (error === incoming.signal.reason || error instanceof OperationCancelledError)) return new Response(null, { status: 499 });\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t};\n\t\t\tresponse = options.telemetry ? await options.telemetry.runInSpan(\"po_server.package_api.request\", {\n\t\t\t\tapi: basePath,\n\t\t\t\tmethod: request.method\n\t\t\t}, invoke, parent) : await invoke();\n\t\t} catch (error) {\n\t\t\toptions.onNotice(`package API '${basePath}' failed on ${url.pathname} (${describeError(error)})`);\n\t\t\tresponse = Response.json({ error: `The '${basePath}' API failed.` }, { status: 500 });\n\t\t}\n\t\treturn responseWithCompletion(response, () => {\n\t\t\tif (!options.telemetry) return;\n\t\t\tconst durationMs = Math.round(performance.now() - startedAt);\n\t\t\tif (response.status < 400 && durationMs < 1e3) return;\n\t\t\tobserve(options.telemetry.runInSpan(\"po_server.package_api.complete\", {\n\t\t\t\tapi: basePath,\n\t\t\t\tmethod: request.method,\n\t\t\t\tstatus_code: response.status,\n\t\t\t\tduration_ms: durationMs\n\t\t\t}, async () => void 0, childContext ?? parent), options.onNotice);\n\t\t});\n\t};\n\tlet closePromise;\n\treturn {\n\t\trequest: dispatch,\n\t\tclose: () => {\n\t\t\tclosePromise ??= (async () => {\n\t\t\t\tawait scope.dispose();\n\t\t\t\tcommunication?.close();\n\t\t\t\thost.dispose();\n\t\t\t})();\n\t\t\treturn closePromise;\n\t\t}\n\t};\n}\n//#endregion\nexport { COMPLETION_SPAN_MIN_DURATION_MS, serveSessionApis };\n\n//# sourceMappingURL=packageApiServer.mjs.map","import { defineServiceContract } from \"./serverScope.mjs\";\n//#region src/schemas/remoteOrigin.ts\nconst PO_REMOTE_ORIGIN_SERVICE = \"po/remote-origin\";\nconst PO_REMOTE_ORIGIN_CONTRACT = defineServiceContract(PO_REMOTE_ORIGIN_SERVICE, { scope: \"global\" });\n//#endregion\nexport { PO_REMOTE_ORIGIN_CONTRACT, PO_REMOTE_ORIGIN_SERVICE };\n\n//# sourceMappingURL=remoteOrigin.mjs.map","//#region src/constants/remote.ts\n/**\n* Wire vocabulary for remote access, shared by the hub routes and the cockpit.\n*\n* Remote access binds a second loopback listener that a tunnel points at, and\n* everything arriving there must prove it holds a paired session. The\n* discriminator is the listening socket, not a header: a tunnel connects from\n* 127.0.0.1 like every local client, and there is no header a remote caller\n* cannot forge.\n*/\n/** REST surface for the remote-access control plane; local callers only, except turn-off and revoke. */\nconst REMOTE_API_ROUTE = \"/api/remote\";\n/** Dev proxy control plane: list targets anywhere, register or remove them only on the host. */\nconst DEV_PROXY_TARGETS_ROUTE = `${REMOTE_API_ROUTE}/dev-proxy/targets`;\n/**\n* The path every proxied dev-server request lives under. Both slashes matter: the leading one\n* anchors it at the root, and the trailing one keeps `/devproxyevil` from matching.\n*/\nconst DEV_PROXY_PREFIX = \"/devproxy/\";\n/** Direct endpoint that establishes one scoped end-to-end channel. */\nconst REMOTE_CHANNEL_ROUTE = `${REMOTE_API_ROUTE}/channel`;\n/** The only authenticated HTTP gateway exposed on the tunnel listener. */\nconst REMOTE_HTTP_ROUTE = `${REMOTE_API_ROUTE}/request`;\n/** Device-bound, sealed routes for ephemeral live Web Push registration. */\nconst REMOTE_PUSH_ROUTE = `${REMOTE_API_ROUTE}/push`;\n`${REMOTE_PUSH_ROUTE}`;\n/** The pairing page a scanned QR opens. Unauthenticated on the tunnel listener. */\nconst PAIRING_PAGE_ROUTE = \"/pair\";\n/** Where the pairing page posts the scanned code. Unauthenticated on the tunnel listener. */\nconst PAIRING_CLAIM_ROUTE = \"/api/remote/pair\";\n/** Polled until the host approves or denies. Unauthenticated on the tunnel listener. */\nconst PAIRING_STATUS_ROUTE = \"/api/remote/pair/status\";\n/** Query parameter naming the pairing request; a path parameter would force a wildcard into the allowlist. */\nconst PAIRING_STATUS_QUERY = \"request\";\n/**\n* Session cookie base name. Rendered `__Host-po_device` by hono's `host`\n* prefix, which refuses the cookie unless it is Secure, Path=/, and\n* Domain-less, so a sibling subdomain can neither read nor overwrite it.\n*/\nconst DEVICE_COOKIE = \"po_device\";\n/**\n* Passkey ceremonies exposed directly on the pairing surface.\n*\n* Sign-in is unauthenticated because it creates a session. Registration requires\n* the paired device cookie issued after host approval, but remains direct so the\n* self-contained pairing page can offer enrolment before loading the cockpit.\n*/\nconst PASSKEY_AUTH_BEGIN_ROUTE = \"/api/remote/passkeys/authenticate/begin\";\nconst PASSKEY_AUTH_FINISH_ROUTE = \"/api/remote/passkeys/authenticate/finish\";\nconst PASSKEY_REGISTER_BEGIN_ROUTE = \"/api/remote/passkeys/register/begin\";\nconst PASSKEY_REGISTER_FINISH_ROUTE = \"/api/remote/passkeys/register/finish\";\n/** Header carrying a step-up assertion for an action that needs more than a live session. */\nconst STEP_UP_HEADER = \"x-po-assertion\";\n/** The vite dev server port; the origin allowlist and vite.config.ts share this. */\nconst WEB_DEV_SERVER_PORT = 7534;\n/** How long a scanned pairing code stays claimable. */\nconst PAIRING_CODE_TTL_MS = 12e4;\n/** How long the host has to approve or deny a claimed request. */\nconst PAIRING_REQUEST_TTL_MS = 18e4;\n/** Cookie lifetime when session expiry is switched off; a session cookie can outlive the laptop. */\nconst COOKIE_CEILING_SECONDS = 2592e3;\n/** Hub frame announcing remote-access state; sent to local and remote pages. */\nconst REMOTE_STATE_TYPE = \"remote_state\";\n/** Hub frame announcing a device waiting for approval; sent to local pages only. */\nconst REMOTE_PAIRING_REQUEST_TYPE = \"remote_pairing_request\";\n/**\n* Native device trust. A phone paired by QR registers an identity key and a biometric step-up key over\n* the sealed gateway, then reconnects with the identity key and no host approval.\n*/\nconst DEVICE_AUTH_CHALLENGE_ROUTE = `${REMOTE_API_ROUTE}/device-auth/challenge`;\nconst DEVICE_AUTH_AUTHENTICATE_ROUTE = `${REMOTE_API_ROUTE}/device-auth/authenticate`;\n/** Sealed only: registration bodies never travel where the relay can read them. */\nconst TRUSTED_DEVICES_ROUTE = `${REMOTE_API_ROUTE}/trusted-devices`;\nconst DEVICE_AUTH_AUTHENTICATE_BODY_BYTES = 1024;\nconst TRUSTED_DEVICE_REGISTER_BODY_BYTES = 2048;\n/** A reconnect challenge has to survive a slow network and a cold app start. */\nconst DEVICE_AUTH_CHALLENGE_TTL_MS = 12e4;\n/** Matches the passkey step-up window: long enough for Face ID, short enough to be useless when captured. */\nconst DEVICE_STEP_UP_CHALLENGE_TTL_MS = 6e4;\n/** Upper bound on outstanding device challenges; the oldest is dropped first. */\nconst DEVICE_CHALLENGE_LIMIT = 1024;\n/** Signed by the host bundle signer: `origin`, `hostPublicKey`, `deviceNonce`. */\nconst HOST_CHANNEL_KEY_TAG = \"po/host-channel-key/v1\";\n/**\n* Signed by the identity key and separately by the step-up key: `origin`, `hostPublicKey`,\n* `sessionDeviceId`, `identityPublicKey`, `stepUpPublicKey`, `platform`.\n*/\nconst DEVICE_REGISTER_TAG = \"po/device-register/v1\";\n/**\n* Signed by the identity key: `origin`, `challenge`, `hostPublicKey`, `trustedDeviceId`, `sessionKey`,\n* `protocolKey`, `httpKey`.\n*/\nconst DEVICE_AUTH_TAG = \"po/device-auth/v1\";\n/** Signed by the biometric step-up key: `origin`, `action`, `sessionDeviceId`, `challengeId`, `challenge`. */\nconst DEVICE_STEP_UP_TAG = \"po/device-step-up/v1\";\n/** Sealed, trusted-native self registration only. */\nconst NATIVE_PUSH_ROUTE = `${REMOTE_API_ROUTE}/native-push`;\nconst NATIVE_PUSH_BODY_BYTES = 8192;\n//#endregion\nexport { COOKIE_CEILING_SECONDS, DEVICE_AUTH_AUTHENTICATE_BODY_BYTES, DEVICE_AUTH_AUTHENTICATE_ROUTE, DEVICE_AUTH_CHALLENGE_ROUTE, DEVICE_AUTH_CHALLENGE_TTL_MS, DEVICE_AUTH_TAG, DEVICE_CHALLENGE_LIMIT, DEVICE_COOKIE, DEVICE_REGISTER_TAG, DEVICE_STEP_UP_CHALLENGE_TTL_MS, DEVICE_STEP_UP_TAG, DEV_PROXY_PREFIX, DEV_PROXY_TARGETS_ROUTE, HOST_CHANNEL_KEY_TAG, NATIVE_PUSH_BODY_BYTES, NATIVE_PUSH_ROUTE, PAIRING_CLAIM_ROUTE, PAIRING_CODE_TTL_MS, PAIRING_PAGE_ROUTE, PAIRING_REQUEST_TTL_MS, PAIRING_STATUS_QUERY, PAIRING_STATUS_ROUTE, PASSKEY_AUTH_BEGIN_ROUTE, PASSKEY_AUTH_FINISH_ROUTE, PASSKEY_REGISTER_BEGIN_ROUTE, PASSKEY_REGISTER_FINISH_ROUTE, REMOTE_API_ROUTE, REMOTE_CHANNEL_ROUTE, REMOTE_HTTP_ROUTE, REMOTE_PAIRING_REQUEST_TYPE, REMOTE_PUSH_ROUTE, REMOTE_STATE_TYPE, STEP_UP_HEADER, TRUSTED_DEVICES_ROUTE, TRUSTED_DEVICE_REGISTER_BODY_BYTES, WEB_DEV_SERVER_PORT };\n\n//# sourceMappingURL=remote.mjs.map","import { DEV_PROXY_PREFIX } from \"../../constants/remote.mjs\";\n//#region src/services/devProxyPolicy/index.ts\n/**\n* What the dev proxy will forward, and where.\n*\n* Pure, with no I/O, so the whole decision surface of a feature that reaches\n* loopback services can be read in one sitting and tested without a server.\n*\n* The upstream host is not a parameter anywhere in this module, and a target\n* is a port and nothing else. Accepting a hostname would mean resolving one,\n* and a resolver turns a fixed destination into an attacker-chosen one through\n* DNS rebinding, decimal and octal address spellings, and IPv4-mapped IPv6\n* forms. Refusing the parameter forecloses that family rather than filtering\n* it. Which of the two loopback literals actually answers is settled in\n* the loopbackAddress service, from the port alone.\n*/\nconst MAX_NAME_LENGTH = 32;\n/**\n* Lowercase, digits and dashes, opening on an alphanumeric.\n*\n* The name is a path segment and it is also what the developer types into\n* `base: '/devproxy/<name>/'`, so it stays in the character set that needs no\n* escaping in either place.\n*/\nconst TARGET_NAME = /^[a-z0-9][a-z0-9-]{0,31}$/u;\nconst MIN_PORT = 1;\nconst MAX_PORT = 65535;\nfunction validateTargetName(raw) {\n\tif (typeof raw !== \"string\") return {\n\t\tok: false,\n\t\treason: \"A target name must be text.\"\n\t};\n\tconst name = raw.trim().toLowerCase();\n\tif (name === \"\") return {\n\t\tok: false,\n\t\treason: \"A target needs a name.\"\n\t};\n\tif (name.length > MAX_NAME_LENGTH) return {\n\t\tok: false,\n\t\treason: `A target name is at most ${String(MAX_NAME_LENGTH)} characters.`\n\t};\n\tif (!TARGET_NAME.test(name)) return {\n\t\tok: false,\n\t\treason: \"A target name uses lowercase letters, digits and dashes, starting with a letter or digit.\"\n\t};\n\treturn {\n\t\tok: true,\n\t\tname\n\t};\n}\n/**\n* Whether this port may be proxied.\n*\n* `reserved` is read fresh by the caller on every attempt rather than captured\n* once, because the cockpit's own ports are only known after it binds and the\n* tunnel port changes when remote access is toggled. A cached list would go\n* stale in exactly the direction that matters, letting the proxy point at the\n* cockpit itself.\n*/\nfunction validateTargetPort(raw, reserved) {\n\tconst port = typeof raw === \"number\" ? raw : Number(raw);\n\tif (!Number.isSafeInteger(port)) return {\n\t\tok: false,\n\t\treason: \"A port must be a whole number.\"\n\t};\n\tif (port < MIN_PORT || port > MAX_PORT) return {\n\t\tok: false,\n\t\treason: `A port is between ${String(MIN_PORT)} and ${String(MAX_PORT)}.`\n\t};\n\tif (reserved.includes(port)) return {\n\t\tok: false,\n\t\treason: \"That port belongs to the cockpit itself.\"\n\t};\n\treturn {\n\t\tok: true,\n\t\tport\n\t};\n}\n/**\n* Whether a path segment tries to climb out of the prefix.\n*\n* Checked before and after percent-decoding. A proxy that only checked the raw\n* form would forward `%2e%2e`, and an upstream that decodes before resolving\n* would then walk out of the tree the operator meant to expose.\n*/\nfunction escapesPrefix(upstreamPath) {\n\tlet decoded;\n\ttry {\n\t\tdecoded = decodeURIComponent(upstreamPath);\n\t} catch {\n\t\treturn true;\n\t}\n\tfor (const candidate of [upstreamPath, decoded]) for (const segment of candidate.split(\"/\")) if (segment === \".\" || segment === \"..\") return true;\n\treturn false;\n}\n/**\n* Whether this path is one the dev proxy owns.\n*\n* The remote guard and the proxy handler must agree about this, and they do not\n* see the same string: Hono's router hands the guard a raw slice of the request\n* line, while the handler reads `new URL(...).pathname`, which resolves `..`\n* before anyone looks at it. So `/devproxy/x/../../api/health` can be a proxy\n* path to one and an API path to the other, and a guard that answered on the\n* prefix alone would grant an `/api/` request the direct, unsealed treatment.\n*\n* Refusing every dot segment removes the disagreement instead of trying to\n* predict it. A legitimate asset URL has no reason to carry one.\n*/\nfunction isDevProxyPath(path) {\n\tif (!path.startsWith(\"/devproxy/\")) return false;\n\treturn !escapesPrefix(path.slice(DEV_PROXY_PREFIX.length));\n}\n/**\n* Identifies the target a proxied request belongs to.\n*\n* `upstreamPath` is the request path unchanged, prefix included. That is the\n* whole trick, and getting it wrong costs a redirect loop: the target is\n* configured with `base: '/devproxy/<name>/'`, so it believes it is serving\n* there and redirects anything at `/` back to its base. Stripping the prefix\n* would hand it `/`, take its redirect, and go round again. nginx draws the\n* same distinction between `proxy_pass http://host/` and `proxy_pass\n* http://host`; this is the second one.\n*\n* Reads the raw, still-encoded pathname. Hono routes and the remote guard both\n* work on the decoded value, so a request that only becomes `/devproxy/...`\n* after decoding would reach this handler, and passing the encoded form\n* through untouched is what makes a file named `a b.png` load.\n*/\nfunction parseProxyPath(rawPathname) {\n\tif (!rawPathname.startsWith(\"/devproxy/\")) return {\n\t\tkind: \"reject\",\n\t\treason: \"Not a proxied path.\"\n\t};\n\tconst rest = rawPathname.slice(DEV_PROXY_PREFIX.length);\n\tconst boundary = rest.indexOf(\"/\");\n\tif (boundary === -1) {\n\t\tconst verdict = validateTargetName(rest);\n\t\tif (!verdict.ok) return {\n\t\t\tkind: \"reject\",\n\t\t\treason: verdict.reason\n\t\t};\n\t\treturn {\n\t\t\tkind: \"redirect\",\n\t\t\tlocation: `${DEV_PROXY_PREFIX}${verdict.name}/`\n\t\t};\n\t}\n\tconst verdict = validateTargetName(rest.slice(0, boundary));\n\tif (!verdict.ok) return {\n\t\tkind: \"reject\",\n\t\treason: verdict.reason\n\t};\n\tif (escapesPrefix(rest.slice(boundary))) return {\n\t\tkind: \"reject\",\n\t\treason: \"That path leaves the proxied target.\"\n\t};\n\treturn {\n\t\tkind: \"match\",\n\t\tname: verdict.name,\n\t\tupstreamPath: rawPathname\n\t};\n}\n//#endregion\nexport { isDevProxyPath, parseProxyPath, validateTargetName, validateTargetPort };\n\n//# sourceMappingURL=index.mjs.map","import { validateTargetName } from \"../devProxyPolicy/index.mjs\";\n//#region src/services/devProxyStore/devProxyRecords.ts\n/**\n* Registered proxy targets on disk.\n*\n* Persisted, unlike a remote session, because a target is a name the developer\n* typed into their own build configuration as `base: '/devproxy/<name>/'`.\n* Losing it on restart would silently break that line, and the file holds no\n* secret: a port number and a label the operator chose while sitting at the\n* machine.\n*/\nconst TARGETS_FILE = \"dev-proxy.json\";\n/** Any bit set for group or other; a state file readable by another account is worth repairing. */\nconst LOOSE_MODE_MASK = 63;\n/** Whether a file mode lets another account read the file. */\nfunction isLooseMode(mode) {\n\treturn (mode & LOOSE_MODE_MASK) !== 0;\n}\n/**\n* Rebuilds one record, dropping anything the current policy would refuse.\n*\n* The file is revalidated on read rather than trusted, because a name that was\n* legal when written is not necessarily legal now, and an edited file must not\n* be able to introduce a target the API would have rejected.\n*/\nfunction parseTarget(value) {\n\tif (typeof value !== \"object\" || value === null) return void 0;\n\tconst record = value;\n\tconst name = validateTargetName(record.name);\n\tif (!name.ok) return void 0;\n\tif (typeof record.port !== \"number\" || !Number.isSafeInteger(record.port)) return void 0;\n\tconst createdAt = typeof record.createdAt === \"number\" ? record.createdAt : 0;\n\treturn {\n\t\tname: name.name,\n\t\tport: record.port,\n\t\tcreatedAt\n\t};\n}\nfunction parseDevProxyTargets(raw, targetsPath, notice) {\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\tnotice(`dev proxy targets at ${targetsPath} are not valid JSON; none will load`);\n\t\treturn [];\n\t}\n\tif (!Array.isArray(parsed)) return [];\n\treturn parsed.map(parseTarget).filter((target) => target !== void 0);\n}\nfunction serializeDevProxyTargets(targets) {\n\treturn `${JSON.stringify(targets, void 0, 2)}\\n`;\n}\n//#endregion\nexport { TARGETS_FILE, isLooseMode, parseDevProxyTargets, serializeDevProxyTargets };\n\n//# sourceMappingURL=devProxyRecords.mjs.map","import { TARGETS_FILE, isLooseMode, parseDevProxyTargets, serializeDevProxyTargets } from \"./devProxyRecords.mjs\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/services/devProxyStore/sync.ts\n/** Repairs a state file another account can read. */\nfunction tightenMode(filePath, notice) {\n\ttry {\n\t\tif (!isLooseMode(fs.statSync(filePath).mode)) return;\n\t\tfs.chmodSync(filePath, 384);\n\t\tnotice(`tightened permissions on ${filePath}`);\n\t} catch {}\n}\n/** @deprecated Node-only sync shim; use createDevProxyStoreAsync. Removed in M2. */\nfunction createDevProxyStore(options) {\n\tconst notice = options.onNotice ?? (() => {});\n\tconst targetsPath = path.join(options.stateDir, TARGETS_FILE);\n\tlet held = load();\n\tfunction load() {\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = fs.readFileSync(targetsPath, \"utf8\");\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t\ttightenMode(targetsPath, notice);\n\t\treturn parseDevProxyTargets(raw, targetsPath, notice);\n\t}\n\tfunction write() {\n\t\tconst temporary = `${targetsPath}.${String(process.pid)}.tmp`;\n\t\ttry {\n\t\t\tfs.mkdirSync(options.stateDir, {\n\t\t\t\trecursive: true,\n\t\t\t\tmode: 448\n\t\t\t});\n\t\t\tfs.writeFileSync(temporary, serializeDevProxyTargets(held), { mode: 384 });\n\t\t\tfs.renameSync(temporary, targetsPath);\n\t\t} catch (error) {\n\t\t\tnotice(`${targetsPath} could not be saved: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\ttry {\n\t\t\t\tfs.rmSync(temporary, { force: true });\n\t\t\t} catch {}\n\t\t}\n\t}\n\treturn {\n\t\ttargets: () => held,\n\t\tfind: (name) => held.find((target) => target.name === name),\n\t\tsave(target) {\n\t\t\theld = [...held.filter((existing) => existing.name !== target.name), target];\n\t\t\twrite();\n\t\t},\n\t\tremove(name) {\n\t\t\tconst next = held.filter((existing) => existing.name !== name);\n\t\t\tif (next.length === held.length) return false;\n\t\t\theld = next;\n\t\t\twrite();\n\t\t\treturn true;\n\t\t}\n\t};\n}\n//#endregion\nexport { createDevProxyStore };\n\n//# sourceMappingURL=sync.mjs.map","import \"../platformFiles/index.mjs\";\nimport { createSerialRunner } from \"../serialRunner/index.mjs\";\nimport \"./devProxyRecords.mjs\";\n//#endregion\nexport { createDevProxyStore } from \"./sync.mjs\";\nimport \"node:path\";\nimport \"@earendil-works/pi-durable/env\";\ncreateSerialRunner();\n\n//# sourceMappingURL=index.mjs.map","import { PO_SHARE_FILE_REMOTE_OFF_MESSAGE } from \"../../schemas/packageApi.mjs\";\nimport { SESSION_FILE_CONTENT_TYPES } from \"../../constants/sessionFiles.mjs\";\nimport { sessionAttachmentRoot } from \"../sessionAttachments/index.mjs\";\nimport { createHash, randomBytes } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Readable } from \"node:stream\";\n//#region src/services/publicFileShares/index.ts\n/**\n* Short-lived public links to one session file, so a remote MCP server can fetch\n* what the model was asked to hand it.\n*\n* The link is the only credential, so only its hash is kept, and every way a\n* link can fail answers the same 404. A file is pinned by identity when the\n* link is minted and reopened when it is served: a path that now names another\n* file, or reaches it through a new symlink, is refused rather than followed.\n*/\n/** Public tunnel path prefix; the token is the only segment after it. */\nconst PUBLIC_FILE_SHARE_PREFIX = \"/mcp-file/\";\nconst TOKEN_BYTES = 32;\nconst TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/u;\nconst SHARE_TTL_MS = 6e5;\nconst SHARE_DOWNLOADS = 3;\nconst MAX_LIVE_SHARES_PER_SESSION = 16;\nconst OPEN_FLAGS = fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW;\nfunction tokenDigest(token) {\n\treturn createHash(\"sha256\").update(token).digest(\"base64url\");\n}\nfunction notFound() {\n\treturn Response.json({ error: \"Not found.\" }, { status: 404 });\n}\n/** RFC 8187 value for `filename*`: encodeURIComponent leaves a few characters the grammar forbids. */\nfunction contentDispositionName(fileName) {\n\treturn encodeURIComponent(fileName).replace(/['()*]/gu, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`);\n}\n/** True when filePath sits strictly below the real root with no segment that starts with a dot. */\nasync function containedIn(root, filePath) {\n\tlet realRoot;\n\ttry {\n\t\trealRoot = await fs.promises.realpath(root);\n\t} catch {\n\t\treturn false;\n\t}\n\tconst relative = path.relative(realRoot, filePath);\n\treturn relative !== \"\" && !path.isAbsolute(relative) && relative.split(path.sep).every((segment) => !segment.startsWith(\".\"));\n}\n/** The real path of a shareable file: inside the session cwd or its attachment root, never through a dot segment. */\nasync function resolveShareable(request, environment) {\n\tconst refused = /* @__PURE__ */ new Error(`\"${request.path}\" is not a file in this session's working directory or attachments.`);\n\tif (request.path === \"\" || request.path.includes(\"\\0\") || request.path.split(/[\\\\/]/u).some((segment) => segment === \".\" || segment === \"..\")) throw refused;\n\tlet filePath;\n\ttry {\n\t\tfilePath = await fs.promises.realpath(path.resolve(request.cwd, request.path));\n\t} catch {\n\t\tthrow refused;\n\t}\n\tconst roots = [request.cwd];\n\ttry {\n\t\troots.push(sessionAttachmentRoot(request.sessionId, environment));\n\t} catch {}\n\tfor (const root of roots) if (await containedIn(root, filePath)) return filePath;\n\tthrow refused;\n}\n/**\n* Opens a regular file without following a final symlink, then proves the handle is\n* still the file at that real path: a parent swapped for a symlink changes the real\n* path, and a replaced file changes the identity. Resolves undefined, with nothing\n* left open, when either check fails.\n*/\nasync function openPinned(filePath) {\n\tlet handle;\n\ttry {\n\t\thandle = await fs.promises.open(filePath, OPEN_FLAGS);\n\t} catch {\n\t\treturn;\n\t}\n\ttry {\n\t\tconst stat = await handle.stat();\n\t\tconst named = await fs.promises.lstat(filePath);\n\t\tif (stat.isFile() && named.dev === stat.dev && named.ino === stat.ino && await fs.promises.realpath(filePath) === filePath) return {\n\t\t\thandle,\n\t\t\tstat\n\t\t};\n\t} catch {}\n\tawait handle.close();\n}\nfunction createPublicFileShares(options) {\n\tconst environment = options.environment ?? process.env;\n\tconst shares = /* @__PURE__ */ new Map();\n\tconst authorized = (share) => !share.revoked && Date.now() < share.expiresAt && share.revision === options.publicOriginRevision() && options.publicOrigin() !== void 0;\n\tconst live = (share) => authorized(share) && share.downloadsLeft > 0;\n\treturn {\n\t\tasync mint(request) {\n\t\t\tconst origin = options.publicOrigin();\n\t\t\tconst revision = options.publicOriginRevision();\n\t\t\tif (origin === void 0) throw new Error(PO_SHARE_FILE_REMOTE_OFF_MESSAGE);\n\t\t\tconst filePath = await resolveShareable(request, environment);\n\t\t\tconst opened = await openPinned(filePath);\n\t\t\tif (opened === void 0) throw new Error(`\"${request.path}\" is not a regular file Po can share.`);\n\t\t\tconst { stat } = opened;\n\t\t\tawait opened.handle.close();\n\t\t\tif (stat.size > 26214400) throw new Error(`\"${request.path}\" is larger than the 25 MB file sharing limit.`);\n\t\t\tfor (const [key, share] of shares) if (!live(share)) shares.delete(key);\n\t\t\tif ([...shares.values()].filter((share) => share.sessionId === request.sessionId).length >= MAX_LIVE_SHARES_PER_SESSION) throw new Error(`This session already shares ${String(MAX_LIVE_SHARES_PER_SESSION)} files. Retry after a tool call finishes.`);\n\t\t\tconst token = randomBytes(TOKEN_BYTES).toString(\"base64url\");\n\t\t\tconst key = tokenDigest(token);\n\t\t\tconst fileName = path.basename(filePath);\n\t\t\tconst share = {\n\t\t\t\tsessionId: request.sessionId,\n\t\t\t\tfilePath,\n\t\t\t\tfileName,\n\t\t\t\tdev: stat.dev,\n\t\t\t\tino: stat.ino,\n\t\t\t\tsize: stat.size,\n\t\t\t\tmtimeMs: stat.mtimeMs,\n\t\t\t\trevision,\n\t\t\t\texpiresAt: Date.now() + SHARE_TTL_MS,\n\t\t\t\tdownloadsLeft: SHARE_DOWNLOADS,\n\t\t\t\trevoked: false\n\t\t\t};\n\t\t\tshares.set(key, share);\n\t\t\toptions.onNotice(`file share: published \"${fileName}\" for ${request.label} on the remote-access tunnel.`);\n\t\t\treturn {\n\t\t\t\turl: `${origin}${PUBLIC_FILE_SHARE_PREFIX}${token}`,\n\t\t\t\tfileName,\n\t\t\t\tmimeType: SESSION_FILE_CONTENT_TYPES[path.extname(fileName).toLowerCase()] ?? \"application/octet-stream\",\n\t\t\t\tsize: stat.size,\n\t\t\t\texpiresAt: share.expiresAt,\n\t\t\t\tmaxDownloads: SHARE_DOWNLOADS,\n\t\t\t\trevoke: () => {\n\t\t\t\t\tshare.revoked = true;\n\t\t\t\t\tshares.delete(key);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tasync serve(token, method) {\n\t\t\tif (method !== \"GET\" && method !== \"HEAD\" || !TOKEN_PATTERN.test(token)) return notFound();\n\t\t\tconst key = tokenDigest(token);\n\t\t\tconst share = shares.get(key);\n\t\t\tif (share === void 0) return notFound();\n\t\t\tif (!live(share)) {\n\t\t\t\tshares.delete(key);\n\t\t\t\treturn notFound();\n\t\t\t}\n\t\t\tif (method === \"GET\") {\n\t\t\t\tshare.downloadsLeft -= 1;\n\t\t\t\tif (share.downloadsLeft === 0) shares.delete(key);\n\t\t\t}\n\t\t\tconst opened = await openPinned(share.filePath);\n\t\t\tif (opened === void 0 || opened.stat.dev !== share.dev || opened.stat.ino !== share.ino || opened.stat.size !== share.size || opened.stat.mtimeMs !== share.mtimeMs) {\n\t\t\t\tawait opened?.handle.close();\n\t\t\t\tshares.delete(key);\n\t\t\t\toptions.onNotice(`file share: refused \"${share.fileName}\" because the file changed after it was shared.`);\n\t\t\t\treturn notFound();\n\t\t\t}\n\t\t\tif (!authorized(share)) {\n\t\t\t\tawait opened.handle.close();\n\t\t\t\tshares.delete(key);\n\t\t\t\treturn notFound();\n\t\t\t}\n\t\t\tconst headers = {\n\t\t\t\t\"content-type\": \"application/octet-stream\",\n\t\t\t\t\"content-length\": String(share.size),\n\t\t\t\t\"content-disposition\": `attachment; filename*=UTF-8''${contentDispositionName(share.fileName)}`,\n\t\t\t\t\"x-content-type-options\": \"nosniff\",\n\t\t\t\t\"content-security-policy\": \"sandbox; default-src 'none'\",\n\t\t\t\t\"cross-origin-resource-policy\": \"same-origin\",\n\t\t\t\t\"cache-control\": \"no-store, private\",\n\t\t\t\t\"referrer-policy\": \"no-referrer\",\n\t\t\t\t\"accept-ranges\": \"none\",\n\t\t\t\t\"x-robots-tag\": \"noindex\"\n\t\t\t};\n\t\t\tif (method === \"HEAD\" || share.size === 0) {\n\t\t\t\tawait opened.handle.close();\n\t\t\t\treturn new Response(method === \"HEAD\" ? null : /* @__PURE__ */ new Uint8Array(), { headers });\n\t\t\t}\n\t\t\tconst body = Readable.toWeb(opened.handle.createReadStream({\n\t\t\t\tstart: 0,\n\t\t\t\tend: share.size - 1\n\t\t\t}));\n\t\t\treturn new Response(body, { headers });\n\t\t}\n\t};\n}\n//#endregion\nexport { PUBLIC_FILE_SHARE_PREFIX, createPublicFileShares };\n\n//# sourceMappingURL=index.mjs.map","//#region src/services/webauthnPolicy/index.ts\n/**\n* What a passkey is allowed to prove, and for how long.\n*\n* A session cookie is a bearer token: whoever holds the bytes is you. A passkey\n* is a private key in the device's secure enclave that never leaves it, so the\n* cookie stops being the only thing between a stolen phone and this machine.\n* The cookie does not go away, because a WebSocket cannot run a ceremony per\n* frame; what changes is that the cookie is short-lived, re-mintable with a\n* gesture rather than a QR, and insufficient on its own for the actions below.\n*\n* The crypto lives in the adapter. This file is the policy: which actions need\n* a fresh signature, how long a challenge is good for, and when a counter says\n* the credential has been cloned.\n*/\n/**\n* Actions that need a fresh gesture even from a live session.\n*\n* These are escalation paths rather than ordinary prompting or tool approval:\n* credentials redirect machine traffic, sessions run code in a selected directory,\n* repository writes change future sessions, and live MCP operations may start local\n* processes or contact remote servers.\n*/\nconst STEP_UP_ACTIONS = [\n\t\"provider.login\",\n\t\"provider.logout\",\n\t\"session.create\",\n\t\"settings.write\",\n\t\"mcp.discover\",\n\t\"mcp.authorize\",\n\t\"computer-use.activate\",\n\t\"device.revoke\",\n\t\"peer.link\"\n];\n/** Short enough that a captured challenge is useless, long enough for a slow Face ID. */\nconst STEP_UP_CHALLENGE_TTL_MS = 6e4;\n/** A registration or sign-in ceremony the user has to complete. */\nconst CEREMONY_TTL_MS = 12e4;\n/**\n* Which action, if any, a request is attempting.\n*\n* Matched here rather than at each route so the list of gated operations is one\n* readable table instead of three call sites that can drift apart. Anything not\n* named is not gated, which is the safe default only because the gate is an\n* addition to the session check rather than a replacement for it.\n*/\nconst GATED_ROUTES = [\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/plugins\\/session-peer\\/link\\/(?:prepare|accept|unlink)$/u,\n\t\taction: \"peer.link\"\n\t},\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/workspaces$/u,\n\t\taction: \"session.create\"\n\t},\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/(?:resume|sessions(?:\\/[^/]+\\/(?:resume|revive))?)$/u,\n\t\taction: \"session.create\"\n\t},\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/plugins\\/git\\/sessions$/u,\n\t\taction: \"session.create\"\n\t},\n\t{\n\t\tmethod: \"PATCH\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+$/u,\n\t\taction: \"settings.write\"\n\t},\n\t{\n\t\tmethod: \"PUT\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/plugins\\/git\\/auth$/u,\n\t\taction: \"settings.write\"\n\t},\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/plugins\\/po\\/logins(?:\\/[^/]+\\/answer)?$/u,\n\t\taction: \"provider.login\"\n\t},\n\t{\n\t\tmethod: \"DELETE\",\n\t\tpattern: /^\\/api\\/plugins\\/po\\/providers\\/[^/]+$/u,\n\t\taction: \"provider.logout\"\n\t},\n\t{\n\t\tmethod: \"PUT\",\n\t\tpattern: /^\\/api(?:\\/workspaces\\/[^/]+)?\\/settings\\/(?:value|repository\\/selection|images)$/u,\n\t\taction: \"settings.write\"\n\t},\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/plugins\\/mcp\\/repository\\/discover$/u,\n\t\taction: \"mcp.discover\"\n\t},\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/plugins\\/mcp\\/repository\\/authorize$/u,\n\t\taction: \"mcp.authorize\"\n\t},\n\t{\n\t\tmethod: \"DELETE\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/plugins\\/mcp\\/repository\\/authorize\\/[^/]+$/u,\n\t\taction: \"mcp.authorize\"\n\t},\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/sessions\\/[^/]+\\/mcp\\/clients$/u,\n\t\taction: \"mcp.authorize\"\n\t},\n\t{\n\t\tmethod: \"DELETE\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/sessions\\/[^/]+\\/mcp\\/clients\\/[^/]+$/u,\n\t\taction: \"mcp.authorize\"\n\t},\n\t{\n\t\tmethod: \"POST\",\n\t\tpattern: /^\\/api\\/workspaces\\/[^/]+\\/sessions\\/[^/]+\\/plugins\\/computer-use\\/activate$/u,\n\t\taction: \"computer-use.activate\"\n\t},\n\t{\n\t\tmethod: \"DELETE\",\n\t\tpattern: /^\\/api\\/remote\\/trusted-devices\\/[^/]+$/u,\n\t\taction: \"device.revoke\"\n\t}\n];\nfunction stepUpActionFor(method, path) {\n\tconst wanted = method.toUpperCase();\n\treturn GATED_ROUTES.find((route) => route.method === wanted && route.pattern.test(path))?.action;\n}\nfunction isStepUpAction(value) {\n\treturn typeof value === \"string\" && STEP_UP_ACTIONS.includes(value);\n}\n/**\n* Whether a signature counter moved the way a real authenticator moves it.\n*\n* A counter that stays at zero means the authenticator does not implement one,\n* which is common and not a signal. A counter that goes backwards or repeats\n* while claiming to count means two things are signing with the same key, which\n* is the definition of a cloned credential.\n*/\nfunction counterVerdict(stored, presented) {\n\tif (stored === 0 && presented === 0) return \"ok\";\n\treturn presented > stored ? \"ok\" : \"clone-suspected\";\n}\n/** Whether a ceremony or step-up challenge is still live. */\nfunction challengeIsFresh(issuedAt, now, ttlMs) {\n\treturn now - issuedAt < ttlMs;\n}\n/** A quick tunnel's domain; its hostname rotates on every start. */\nconst ROTATING_SUFFIX = \".trycloudflare.com\";\nfunction isQuickTunnelHost(origin) {\n\tif (origin === void 0) return false;\n\ttry {\n\t\treturn new URL(origin).hostname.toLowerCase().endsWith(ROTATING_SUFFIX);\n\t} catch {\n\t\treturn false;\n\t}\n}\n/** Dotted-quad, and the bracketed form a URL uses for v6. */\nconst IPV4 = /^\\d{1,3}(?:\\.\\d{1,3}){3}$/u;\n/**\n* The relying party id a passkey is bound to.\n*\n* Derived from the configured tunnel hostname and nothing else, never from a\n* request header: `rpID` is the entire scope of a credential, so a caller who\n* could influence it could mint credentials against somebody else's origin.\n*\n* Three things are refused rather than accepted and regretted later:\n*\n* - A quick tunnel, whose hostname rotates on every start, so a passkey\n*   registered now would silently stop working on the next one.\n* - An IP address, which WebAuthn does not accept as a relying party id at all;\n*   registering against one fails in the browser rather than here, which is a\n*   much worse place to find out.\n* - Anything without a dot, which cannot be a public tunnel hostname.\n*/\nfunction relyingPartyId(publicOrigin) {\n\tif (publicOrigin === void 0) return void 0;\n\tlet host;\n\ttry {\n\t\thost = new URL(publicOrigin).hostname.toLowerCase();\n\t} catch {\n\t\treturn;\n\t}\n\tif (isQuickTunnelHost(publicOrigin)) return void 0;\n\tif (IPV4.test(host) || host.startsWith(\"[\")) return void 0;\n\tif (!host.includes(\".\")) return void 0;\n\treturn host;\n}\n//#endregion\nexport { CEREMONY_TTL_MS, STEP_UP_ACTIONS, STEP_UP_CHALLENGE_TTL_MS, challengeIsFresh, counterVerdict, isQuickTunnelHost, isStepUpAction, relyingPartyId, stepUpActionFor };\n\n//# sourceMappingURL=index.mjs.map","import { DEVICE_AUTH_AUTHENTICATE_ROUTE, DEVICE_AUTH_CHALLENGE_ROUTE, PAIRING_CLAIM_ROUTE, PAIRING_PAGE_ROUTE, PAIRING_STATUS_ROUTE, PASSKEY_AUTH_BEGIN_ROUTE, PASSKEY_AUTH_FINISH_ROUTE, PASSKEY_REGISTER_BEGIN_ROUTE, PASSKEY_REGISTER_FINISH_ROUTE, WEB_DEV_SERVER_PORT } from \"../../constants/remote.mjs\";\n//#region src/services/remoteGuardPolicy/index.ts\n/**\n* Who may do what, on which listener.\n*\n* The cockpit runs one Hono app behind two sockets: a loopback listener that is\n* open to whoever already has an account on the machine, and a tunnel listener\n* that faces the public internet. Every decision here answers one question\n* about one request, with no I/O, so the whole trust boundary is readable in a\n* single sitting and testable without a server.\n*/\nconst METHOD_GET = \"GET\";\nconst METHOD_HEAD = \"HEAD\";\nconst METHOD_POST = \"POST\";\n/** Cloudflare's edge speaks to us on 443, so the Host it forwards may or may not carry the port. */\nconst HTTPS_DEFAULT_PORT = \"443\";\n/**\n* The exact package-owned pairing and PWA bootstrap routes the tunnel listener\n* answers directly. They are matched by string equality, never prefixes or\n* wildcards. A contract test pins the list so additions require review.\n*\n* Passkey sign-in and native device sign-in are public because each creates a\n* session by proving a credential: a passkey, or a registered device identity key.\n* Passkey registration is also direct so the self-contained pairing page can run\n* it, but its handlers require the paired device cookie issued only after host\n* approval. Native device registration is not listed: it is sealed only.\n*/\nconst PUBLIC_PAIRING_ROUTES = [\n\t{\n\t\tmethod: METHOD_GET,\n\t\tpath: \"/\"\n\t},\n\t{\n\t\tmethod: METHOD_GET,\n\t\tpath: PAIRING_PAGE_ROUTE\n\t},\n\t{\n\t\tmethod: METHOD_GET,\n\t\tpath: \"/manifest.webmanifest\"\n\t},\n\t{\n\t\tmethod: METHOD_GET,\n\t\tpath: \"/sw.js\"\n\t},\n\t{\n\t\tmethod: METHOD_GET,\n\t\tpath: \"/pwa/pwa.js\"\n\t},\n\t{\n\t\tmethod: METHOD_GET,\n\t\tpath: \"/pwa/icon-192.png\"\n\t},\n\t{\n\t\tmethod: METHOD_GET,\n\t\tpath: \"/pwa/icon-512.png\"\n\t},\n\t{\n\t\tmethod: METHOD_POST,\n\t\tpath: PAIRING_CLAIM_ROUTE\n\t},\n\t{\n\t\tmethod: METHOD_GET,\n\t\tpath: PAIRING_STATUS_ROUTE\n\t},\n\t{\n\t\tmethod: METHOD_POST,\n\t\tpath: PASSKEY_AUTH_BEGIN_ROUTE\n\t},\n\t{\n\t\tmethod: METHOD_POST,\n\t\tpath: PASSKEY_AUTH_FINISH_ROUTE\n\t},\n\t{\n\t\tmethod: METHOD_POST,\n\t\tpath: PASSKEY_REGISTER_BEGIN_ROUTE\n\t},\n\t{\n\t\tmethod: METHOD_POST,\n\t\tpath: PASSKEY_REGISTER_FINISH_ROUTE\n\t},\n\t{\n\t\tmethod: METHOD_POST,\n\t\tpath: DEVICE_AUTH_CHALLENGE_ROUTE\n\t},\n\t{\n\t\tmethod: METHOD_POST,\n\t\tpath: DEVICE_AUTH_AUTHENTICATE_ROUTE\n\t}\n];\n/**\n* Whether the tunnel listener may answer this request directly.\n*\n* Session requirements for direct routes are enforced by their exact handlers.\n* `path` must be the value the router matched on, which for Hono is\n* `c.req.path`. That value is percent-decoded, so `/%70air` reaches the `/pair`\n* handler; comparing against a separately parsed pathname would let the guard\n* and the router disagree about the same request, which is how an allowlist\n* turns into a bypass.\n*/\nfunction isPublicPairingRoute(method, path) {\n\tconst wanted = method.toUpperCase();\n\treturn PUBLIC_PAIRING_ROUTES.some((route) => route.method === wanted && route.path === path);\n}\n/** Normalizes to scheme://host[:port], lowercased. Undefined for anything unparseable, `null` included. */\nfunction normalizeOrigin(raw) {\n\ttry {\n\t\treturn new URL(raw).origin.toLowerCase();\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction normalizeHost(raw) {\n\treturn raw.trim().toLowerCase();\n}\n/**\n* What the loopback listener accepts.\n*\n* The port is the one the socket actually bound, not a constant, because the\n* hub takes `--port` and the e2e fixture reserves a random free one. The vite\n* dev server is allowed unconditionally so the documented two-terminal plugin\n* loop keeps working; anything that can bind that port already runs as this\n* user, so the marginal risk is close to nothing.\n*/\nfunction localOriginPolicy(port, extraOrigins = []) {\n\tconst hosts = /* @__PURE__ */ new Set();\n\tconst origins = /* @__PURE__ */ new Set();\n\tfor (const listenPort of [port, WEB_DEV_SERVER_PORT]) for (const name of [\n\t\t\"127.0.0.1\",\n\t\t\"localhost\",\n\t\t\"[::1]\"\n\t]) {\n\t\tconst host = `${name}:${String(listenPort)}`;\n\t\thosts.add(host);\n\t\torigins.add(`http://${host}`);\n\t}\n\tfor (const extra of extraOrigins) {\n\t\tconst normalized = normalizeOrigin(extra);\n\t\tif (normalized !== void 0) origins.add(normalized);\n\t}\n\treturn {\n\t\torigins,\n\t\thosts\n\t};\n}\n/** What the tunnel listener accepts: its own origin and nothing else. */\nfunction tunnelOriginPolicy(publicOrigin, extraHosts = []) {\n\tconst normalized = normalizeOrigin(publicOrigin);\n\tif (normalized === void 0) throw new Error(`The tunnel origin \"${publicOrigin}\" is not a URL.`);\n\tconst host = new URL(normalized).host;\n\tconst hosts = /* @__PURE__ */ new Set([host, `${host}:${HTTPS_DEFAULT_PORT}`]);\n\tfor (const extra of extraHosts) hosts.add(normalizeHost(extra));\n\treturn {\n\t\torigins: /* @__PURE__ */ new Set([normalized]),\n\t\thosts\n\t};\n}\n/** A request with a side effect: anything that is not a plain read, plus every socket upgrade. */\nfunction isMutating(method, isUpgrade) {\n\tif (isUpgrade) return true;\n\tconst wanted = method.toUpperCase();\n\treturn wanted !== METHOD_GET && wanted !== METHOD_HEAD;\n}\n/**\n* Whether the request's Origin and Host are ones this listener answers to.\n*\n* The loopback listener is lenient about a missing Origin and strict about one\n* that is present. That asymmetry is deliberate: a browser always sends Origin\n* on a socket handshake and on a cross-origin mutation, which is the attack\n* this closes, while curl, the health probe, and the test harness send none and\n* would break for no security gain. It buys nothing against a local program,\n* which can send whatever it likes, and is not meant to.\n*\n* The tunnel listener requires Origin on anything with a side effect and\n* tolerates its absence only on a plain read, because a top-level navigation\n* (following the scanned link) legitimately sends none.\n*\n* Host is checked on both. On the loopback listener that is the DNS-rebinding\n* defence for a well-known port, and it is the only check a socket upgrade gets\n* at all, since the upgrade path never reaches the node-server host parsing.\n*/\nfunction originVerdict(input) {\n\tconst policy = input.listener === \"local\" ? input.local : input.tunnel;\n\tif (policy === void 0) return \"not-ready\";\n\tif (input.host === void 0 || !policy.hosts.has(normalizeHost(input.host))) return \"bad-host\";\n\tif (input.origin === void 0) {\n\t\tif (input.listener === \"local\") return \"allow\";\n\t\treturn isMutating(input.method, input.isUpgrade) ? \"bad-origin\" : \"allow\";\n\t}\n\tconst origin = normalizeOrigin(input.origin);\n\tif (origin === void 0 || !policy.origins.has(origin)) return \"bad-origin\";\n\treturn \"allow\";\n}\n//#endregion\nexport { PUBLIC_PAIRING_ROUTES, isPublicPairingRoute, localOriginPolicy, originVerdict, tunnelOriginPolicy };\n\n//# sourceMappingURL=index.mjs.map","//#region src/services/deviceSessions/index.ts\nconst MS_PER_MINUTE = 6e4;\nconst MS_PER_HOUR = 36e5;\nconst MS_PER_SECOND = 1e3;\n/** Long enough to tell an iPhone from a laptop, short enough not to be a fingerprint in a log. */\nconst MAX_USER_AGENT = 200;\n/** Upper bound of the C0 block, and the bounds of C1. Codepoints rather than a character class:\n* a regex over control characters is unreadable, hard to review, and trips no-control-regex. */\nconst C0_END = 31;\nconst C1_START = 127;\nconst C1_END = 159;\nconst UNKNOWN_DEVICE = \"unknown device\";\n/** Whether this record still authorizes a request, under the settings in force right now. */\nfunction evaluateDevice(record, now, settings) {\n\tif (record === void 0) return {\n\t\tok: false,\n\t\treason: \"unknown\"\n\t};\n\tif (!settings.sessionExpiryEnabled) return {\n\t\tok: true,\n\t\trecord\n\t};\n\tif (now - record.lastSeenAt >= settings.idleMinutes * MS_PER_MINUTE) return {\n\t\tok: false,\n\t\treason: \"idle\"\n\t};\n\tif (now - record.createdAt >= settings.absoluteHours * MS_PER_HOUR) return {\n\t\tok: false,\n\t\treason: \"absolute\"\n\t};\n\treturn {\n\t\tok: true,\n\t\trecord\n\t};\n}\n/** Exact deadline at which this device stops authorizing, or undefined while expiry is disabled. */\nfunction deviceExpiryAt(record, settings) {\n\tif (!settings.sessionExpiryEnabled) return void 0;\n\treturn Math.min(record.lastSeenAt + settings.idleMinutes * MS_PER_MINUTE, record.createdAt + settings.absoluteHours * MS_PER_HOUR);\n}\nfunction touchDevice(record, now) {\n\treturn {\n\t\t...record,\n\t\tlastSeenAt: now\n\t};\n}\n/** How long the cookie should live, so the browser forgets roughly when the server does. */\nfunction cookieMaxAgeSeconds(settings, ceilingSeconds) {\n\tif (!settings.sessionExpiryEnabled) return ceilingSeconds;\n\treturn Math.min(ceilingSeconds, Math.round(settings.absoluteHours * MS_PER_HOUR / MS_PER_SECOND));\n}\n/** Replaces every C0 and C1 control character with a space; those are what could forge a log line. */\nfunction withoutControlCharacters(value) {\n\tlet out = \"\";\n\tfor (const character of value) {\n\t\tconst code = character.codePointAt(0) ?? 0;\n\t\tout += code <= C0_END || code >= C1_START && code <= C1_END ? \" \" : character;\n\t}\n\treturn out;\n}\n/**\n* Strips anything that could forge a second line in a log or a second element\n* in the approval dialog, then truncates.\n*\n* The user agent is attacker-supplied and lands in both `notice()` output and\n* the host's approval prompt, so control characters are the concern rather than\n* length.\n*/\nfunction sanitizeUserAgent(raw) {\n\tif (raw === void 0) return UNKNOWN_DEVICE;\n\tconst stripped = withoutControlCharacters(raw).replaceAll(/\\s+/gu, \" \").trim();\n\tif (stripped === \"\") return UNKNOWN_DEVICE;\n\treturn stripped.slice(0, MAX_USER_AGENT);\n}\n/**\n* The address Cloudflare's edge reported, reduced to a safe display and key value.\n*\n* It never authorizes a request. The tunnel route may use it only for abuse\n* throttling when Cloudflare is the trusted proxy. A local process can forge it,\n* but local processes are outside that public-internet boundary.\n*/\nfunction sanitizeEdgeIp(raw) {\n\tif (raw === void 0) return \"unknown\";\n\tconst candidate = raw.split(\",\")[0]?.trim() ?? \"\";\n\treturn /^[0-9a-f:.]{1,45}$/iu.test(candidate) ? candidate : \"unknown\";\n}\nconst DEVICE_HINTS = [\n\t{\n\t\tpattern: /iphone/iu,\n\t\tlabel: \"iPhone\"\n\t},\n\t{\n\t\tpattern: /ipad/iu,\n\t\tlabel: \"iPad\"\n\t},\n\t{\n\t\tpattern: /android/iu,\n\t\tlabel: \"Android\"\n\t},\n\t{\n\t\tpattern: /macintosh|mac os x/iu,\n\t\tlabel: \"Mac\"\n\t},\n\t{\n\t\tpattern: /windows/iu,\n\t\tlabel: \"Windows\"\n\t},\n\t{\n\t\tpattern: /linux/iu,\n\t\tlabel: \"Linux\"\n\t}\n];\nconst BROWSER_HINTS = [\n\t{\n\t\tpattern: /edg\\//iu,\n\t\tlabel: \"Edge\"\n\t},\n\t{\n\t\tpattern: /firefox\\//iu,\n\t\tlabel: \"Firefox\"\n\t},\n\t{\n\t\tpattern: /chrome\\/|crios\\//iu,\n\t\tlabel: \"Chrome\"\n\t},\n\t{\n\t\tpattern: /safari\\//iu,\n\t\tlabel: \"Safari\"\n\t}\n];\n/** A human label for the device list, best effort; the full user agent is shown alongside. */\nfunction deviceLabelFor(userAgent) {\n\tconst device = DEVICE_HINTS.find((hint) => hint.pattern.test(userAgent))?.label;\n\tconst browser = BROWSER_HINTS.find((hint) => hint.pattern.test(userAgent))?.label;\n\tif (device !== void 0 && browser !== void 0) return `${device} · ${browser}`;\n\treturn device ?? browser ?? \"paired device\";\n}\n//#endregion\nexport { cookieMaxAgeSeconds, deviceExpiryAt, deviceLabelFor, evaluateDevice, sanitizeEdgeIp, sanitizeUserAgent, touchDevice };\n\n//# sourceMappingURL=index.mjs.map","import { deviceExpiryAt, deviceLabelFor, evaluateDevice, sanitizeUserAgent, touchDevice } from \"../deviceSessions/index.mjs\";\nimport { createHash, randomBytes } from \"node:crypto\";\n//#region src/services/deviceAuth/index.ts\n/** 256 bits. The token is scanned or set by the server, never typed, so there is no reason to economise. */\nconst TOKEN_BYTES = 32;\nconst ID_BYTES = 8;\nfunction digest(token) {\n\treturn createHash(\"sha256\").update(token).digest(\"hex\");\n}\n/**\n* Paired sessions, held in memory only.\n*\n* Keyed by digest rather than scanned, so verification is a map lookup and\n* there is no comparison loop for a timing side channel to live in. That is why\n* `timingSafeEqual` does not appear here: there is nothing to compare. If a\n* future change introduces a scan, it will need one.\n*/\nfunction createDeviceAuth(options) {\n\tconst now = options.now ?? (() => Date.now());\n\tconst notice = options.onNotice ?? (() => {});\n\t/** Digest to record. The raw token exists only in flight. */\n\tconst devices = /* @__PURE__ */ new Map();\n\tconst timers = /* @__PURE__ */ new Map();\n\tconst clearDeadline = (hash) => {\n\t\tconst timer = timers.get(hash);\n\t\tif (timer !== void 0) clearTimeout(timer);\n\t\ttimers.delete(hash);\n\t};\n\tconst drop = (hash, reason) => {\n\t\tconst record = devices.get(hash);\n\t\tif (record === void 0) return void 0;\n\t\tdevices.delete(hash);\n\t\tclearDeadline(hash);\n\t\toptions.onDrop?.(record, reason);\n\t\treturn record;\n\t};\n\tconst schedule = (hash, record) => {\n\t\tclearDeadline(hash);\n\t\tconst deadline = deviceExpiryAt(record, options.settings());\n\t\tif (deadline === void 0) return;\n\t\tconst remaining = deadline - now();\n\t\tif (remaining <= 0) {\n\t\t\tdrop(hash, \"expired\");\n\t\t\treturn;\n\t\t}\n\t\tconst timer = setTimeout(() => {\n\t\t\tconst current = devices.get(hash);\n\t\t\tif (current === void 0) return;\n\t\t\tif (evaluateDevice(current, now(), options.settings()).ok) schedule(hash, current);\n\t\t\telse drop(hash, \"expired\");\n\t\t}, Math.min(remaining, 2147483647));\n\t\ttimer.unref();\n\t\ttimers.set(hash, timer);\n\t};\n\treturn {\n\t\tenrol(input) {\n\t\t\tconst token = randomBytes(TOKEN_BYTES).toString(\"base64url\");\n\t\t\tconst userAgent = sanitizeUserAgent(input.userAgent);\n\t\t\tconst at = now();\n\t\t\tconst record = {\n\t\t\t\tid: randomBytes(ID_BYTES).toString(\"hex\"),\n\t\t\t\ttokenHash: digest(token),\n\t\t\t\tlabel: deviceLabelFor(userAgent),\n\t\t\t\tuserAgent,\n\t\t\t\tcreatedAt: at,\n\t\t\t\tlastSeenAt: at,\n\t\t\t\ttrust: input.trust\n\t\t\t};\n\t\t\tdevices.set(record.tokenHash, record);\n\t\t\tschedule(record.tokenHash, record);\n\t\t\tnotice(`paired ${record.label} (${record.id})`);\n\t\t\treturn {\n\t\t\t\ttoken,\n\t\t\t\trecord\n\t\t\t};\n\t\t},\n\t\tverify(token) {\n\t\t\tif (token === void 0 || token === \"\") return void 0;\n\t\t\tconst hash = digest(token);\n\t\t\tconst at = now();\n\t\t\tconst verdict = evaluateDevice(devices.get(hash), at, options.settings());\n\t\t\tif (!verdict.ok) {\n\t\t\t\tif (verdict.reason !== \"unknown\") drop(hash, \"expired\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst seen = touchDevice(verdict.record, at);\n\t\t\tdevices.set(hash, seen);\n\t\t\tschedule(hash, seen);\n\t\t\treturn seen;\n\t\t},\n\t\trevoke(id) {\n\t\t\tfor (const [hash, record] of devices) {\n\t\t\t\tif (record.id !== id) continue;\n\t\t\t\tdrop(hash, \"revoked\");\n\t\t\t\tnotice(`revoked ${record.label} (${record.id})`);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tsetTrust(id, trust) {\n\t\t\tfor (const [hash, record] of devices) {\n\t\t\t\tif (record.id !== id) continue;\n\t\t\t\tdevices.set(hash, {\n\t\t\t\t\t...record,\n\t\t\t\t\ttrust\n\t\t\t\t});\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\ttrustOf: (id) => [...devices.values()].find((record) => record.id === id)?.trust,\n\t\trevokeWhere(predicate) {\n\t\t\tconst selected = [...devices].filter(([, record]) => predicate(record));\n\t\t\tfor (const [hash, record] of selected) {\n\t\t\t\tdrop(hash, \"revoked\");\n\t\t\t\tnotice(`revoked ${record.label} (${record.id})`);\n\t\t\t}\n\t\t\treturn selected.length;\n\t\t},\n\t\trevokeAll() {\n\t\t\tconst records = [...devices.values()];\n\t\t\tfor (const [hash] of devices) drop(hash, \"revoked\");\n\t\t\tif (records.length > 0) notice(`revoked ${String(records.length)} paired device(s)`);\n\t\t\treturn records.length;\n\t\t},\n\t\tlist: () => [...devices.values()],\n\t\treschedule() {\n\t\t\tfor (const [hash, record] of devices) schedule(hash, record);\n\t\t},\n\t\tsweep() {\n\t\t\tconst at = now();\n\t\t\tconst settings = options.settings();\n\t\t\tlet dropped = 0;\n\t\t\tfor (const [hash, record] of devices) {\n\t\t\t\tif (evaluateDevice(record, at, settings).ok) continue;\n\t\t\t\tdrop(hash, \"expired\");\n\t\t\t\tdropped += 1;\n\t\t\t}\n\t\t\treturn dropped;\n\t\t}\n\t};\n}\n//#endregion\nexport { createDeviceAuth };\n\n//# sourceMappingURL=index.mjs.map","import{MAX_MESSAGES_PER_KEY as e,infoFor as t,isSealedEnvelope as n}from\"../../types/sealedChannel.mjs\";import{ECDH as r,createCipheriv as i,createDecipheriv as a,createECDH as o,hkdfSync as s,randomBytes as c}from\"node:crypto\";const l=`prime256v1`,u=`aes-256-gcm`,d=Buffer.from(`po/sealed/v1`);function f(e,n){return Buffer.from(s(`sha256`,e,d,Buffer.from(t(n)),32))}function p(e,t){let n=Buffer.alloc(12);return e.copy(n,0,0,4),n.writeBigUInt64BE(t,4),n}function m(t,r,o){let s=f(t,r),c=f(t,r===`c2s`?`s2c`:`c2s`),l=0n,d=-1n;return{seal(t){if(l>=BigInt(e))return{ok:!1,failure:`exhausted`};let n=p(o,l),r=i(u,s,n),a=Buffer.concat([r.update(t),r.final(),r.getAuthTag()]);return l+=1n,{ok:!0,envelope:{v:1,n:n.toString(`base64url`),c:a.toString(`base64url`)}}},open(e){let t=e;if(typeof t?.n!=`string`||typeof t.c!=`string`)return{ok:!1,failure:`malformed`};if(t.v!==1)return{ok:!1,failure:`version`};if(!n(e))return{ok:!1,failure:`malformed`};let r=Buffer.from(e.n,`base64url`),i=Buffer.from(e.c,`base64url`);if(r.length!==12||i.length<16)return{ok:!1,failure:`malformed`};let o=r.readBigUInt64BE(4);if(o<=d)return{ok:!1,failure:`replay`};let s=a(u,c,r);s.setAuthTag(i.subarray(i.length-16));let l;try{l=Buffer.concat([s.update(i.subarray(0,i.length-16)),s.final()])}catch{return{ok:!1,failure:`auth`}}return d=o,{ok:!0,plaintext:new Uint8Array(l)}}}}function h(e){if(e.length>128||!/^[A-Za-z0-9_-]+$/.test(e))return;let t;try{t=Buffer.from(e,`base64url`)}catch{return}if(!(t.length!==65&&t.length!==33||(t.length===65?t[0]!==4:t[0]!==2&&t[0]!==3)||t.toString(`base64url`)!==e))try{let e=r.convertKey(t,l,void 0,void 0,`uncompressed`);return Buffer.isBuffer(e)?e:void 0}catch{return}}function g(){let e=o(l);e.generateKeys();let t=/* @__PURE__ */ new Set;return{publicKey:e.getPublicKey().toString(`base64url`),accept(n){let r=h(n);if(r===void 0||t.has(r.toString(`base64url`)))return;let i;try{i=e.computeSecret(r)}catch{return}return t.add(r.toString(`base64url`)),m(i,`s2c`,c(4))}}}function _(){let e=o(l);e.generateKeys();let t=!1;return{publicKey:e.getPublicKey().toString(`base64url`),accept(n){if(t)return;let r=h(n);if(r===void 0)return;let i;try{i=e.computeSecret(r)}catch{return}return t=!0,m(i,`c2s`,c(4))}}}export{_ as createClientHandshake,g as createHostHandshake};\n//# sourceMappingURL=index.mjs.map","import{attestationBytes as e,canonicalManifest as t,isBundleManifest as n}from\"../../types/bundleManifest.mjs\";import{createHash as r,createPrivateKey as i,createPublicKey as a,createSign as o,generateKeyPairSync as s,randomBytes as c}from\"node:crypto\";import l from\"node:fs\";import u from\"node:path\";const d=`signing.json`,f=`sha256`,p=/* @__PURE__ */ new Set([`.map`]),m=[`web`,`native`,`app`],h={\".css\":`text/css`,\".gif\":`image/gif`,\".html\":`text/html`,\".ico\":`image/x-icon`,\".jpeg\":`image/jpeg`,\".jpg\":`image/jpeg`,\".js\":`text/javascript`,\".json\":`application/json`,\".mjs\":`text/javascript`,\".png\":`image/png`,\".svg\":`image/svg+xml`,\".txt\":`text/plain`,\".wasm\":`application/wasm`,\".webp\":`image/webp`,\".woff\":`font/woff`,\".woff2\":`font/woff2`};function g(e){l.mkdirSync(e,{recursive:!0,mode:448});let t=l.lstatSync(e);if(!t.isDirectory()||t.isSymbolicLink())throw Error(`bundle signing state is not a directory: ${e}`);l.chmodSync(e,448)}function _(e,t){g(e);let n=u.join(e,`signing.lock`),r;for(let e=0;e<500;e+=1)try{r=l.openSync(n,`wx`,384);break}catch(e){if(e.code!==`EEXIST`)throw e;Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,10)}if(r===void 0)throw Error(`timed out waiting for bundle signing state lock: ${n}`);try{return t()}finally{l.closeSync(r),l.rmSync(n,{force:!0})}}function v(e,t){let n=u.join(e,d),r=u.join(e,`.${d}.${process.pid}.${c(8).toString(`hex`)}`),i=l.openSync(r,`wx`,384);try{l.writeFileSync(i,`${JSON.stringify(t,void 0,2)}\\n`),l.fsyncSync(i)}finally{l.closeSync(i)}try{l.renameSync(r,n),l.chmodSync(n,384)}catch(e){throw l.rmSync(r,{force:!0}),e}}function y(e,t){if(typeof e!=`object`||!e)throw Error(`invalid bundle signing state: ${t}`);let n=e;if(typeof n.privateKey!=`string`||typeof n.publicKey!=`string`)throw Error(`invalid bundle signing state: ${t}`);let r=n.revision===void 0?0:n.revision;if(!Number.isSafeInteger(r)||r<0)throw Error(`invalid bundle signing revision: ${t}`);let i;try{i=T(n.privateKey)}catch{throw Error(`invalid bundle signing private key: ${t}`)}if(i!==n.publicKey)throw Error(`bundle signing keys do not match: ${t}`);return{privateKey:n.privateKey,publicKey:n.publicKey,revision:r}}function b(e){return _(e,()=>{let t=u.join(e,d);try{let n=l.lstatSync(t);if(!n.isFile()||n.isSymbolicLink())throw Error(`invalid bundle signing state file: ${t}`);let r=JSON.parse(l.readFileSync(t,`utf8`)),i=y(r,t);return l.chmodSync(t,384),r.revision===void 0&&v(e,i),i}catch(e){if(e.code!==`ENOENT`)throw e}let n=s(`ec`,{namedCurve:`prime256v1`,privateKeyEncoding:{type:`pkcs8`,format:`pem`},publicKeyEncoding:{type:`spki`,format:`der`}}),r={privateKey:n.privateKey,publicKey:Buffer.from(n.publicKey).toString(`base64url`),revision:0};return v(e,r),r})}function x(e,t){return _(e,()=>{let n=u.join(e,d),r=y(JSON.parse(l.readFileSync(n,`utf8`)),n);if(r.publicKey!==t)throw Error(`bundle signing key changed while the signer was active`);if(r.revision===2**53-1)throw Error(`bundle signing revision is exhausted`);let i={...r,revision:r.revision+1};return v(e,i),i.revision})}function S(e){return h[u.extname(e).toLowerCase()]??`application/octet-stream`}function C(e,t,n){let i=l.readdirSync(t,{withFileTypes:!0});for(let a of i){let i=u.join(t,a.name),o=l.lstatSync(i);if(o.isSymbolicLink())throw Error(`refusing to sign symbolic link: ${i}`);if(o.isDirectory()){C(e,i,n);continue}if(!o.isFile())throw Error(`refusing to omit unsupported asset: ${i}`);if(p.has(u.extname(a.name)))continue;let s=l.readFileSync(i);n.push({path:`/${u.relative(e,i).split(u.sep).map(e=>encodeURIComponent(e)).join(`/`)}`,sha256:r(`sha256`).update(s).digest(`hex`),byteLength:s.byteLength,contentType:S(i)})}}function w(r,a=()=>{}){let s=b(r),c=i(s.privateKey),d=/* @__PURE__ */ new Map,p=(e,t)=>`${t}:${u.resolve(e)}`,h=(e,i)=>{let a=l.lstatSync(e);if(!a.isDirectory()||a.isSymbolicLink())throw Error(`refusing to sign an unsafe asset root: ${e}`);let u=[];if(C(e,e,u),u.length===0)return;u.sort((e,t)=>e.path.localeCompare(t.path));let d={version:2,revision:x(r,s.publicKey),builtAt:Date.now(),assets:u};if(!n(d,i))throw Error(`refusing to sign an invalid ${i} bundle manifest`);return{manifest:d,signature:o(f).update(t(d)).sign({key:c,dsaEncoding:`ieee-p1363`}).toString(`base64url`),publicKey:s.publicKey}},g=(e,t=`web`)=>{let n=p(e,t);if(d.has(n))return d.get(n);let r=h(u.resolve(e),t);return d.set(n,r),r};return{publicKey:()=>s.publicKey,sign:g,refresh(e,t=`web`){return d.delete(p(e,t)),g(e,t)},invalidate(e){if(e===void 0)d.clear();else for(let t of m)d.delete(p(e,t))},attest(t,n){return o(f).update(e(t,n)).sign({key:c,dsaEncoding:`ieee-p1363`}).toString(`base64url`)}}}function T(e){return Buffer.from(a(e).export({type:`spki`,format:`der`})).toString(`base64url`)}export{w as createBundleSigner,T as publicKeyOf};\n//# sourceMappingURL=index.mjs.map","import{attestationBytes as e}from\"../../types/bundleManifest.mjs\";import{createPublicKey as t,verify as n}from\"node:crypto\";const r=/^[A-Za-z0-9_-]+$/u;function i(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&r.test(e)}function a(e){try{let n=t({key:Buffer.from(e,`base64url`),format:`der`,type:`spki`});return n.asymmetricKeyType!==`ec`||n.asymmetricKeyDetails?.namedCurve!==`prime256v1`?void 0:n}catch{return}}function o(t,r,o,s){let c=e(r,o);if(!i(t,512)||!i(s,86)||s.length!==86)return!1;let l=a(t);if(l===void 0)return!1;try{return n(`sha256`,c,{key:l,dsaEncoding:`ieee-p1363`},Buffer.from(s,`base64url`))}catch{return!1}}export{o as verifyDeviceSignature};\n//# sourceMappingURL=index.mjs.map","import { DEVICE_AUTH_CHALLENGE_TTL_MS, DEVICE_CHALLENGE_LIMIT, DEVICE_STEP_UP_CHALLENGE_TTL_MS, DEVICE_STEP_UP_TAG } from \"../../constants/remote.mjs\";\nimport { sanitizeUserAgent } from \"../deviceSessions/index.mjs\";\nimport { isStepUpAction } from \"../webauthnPolicy/index.mjs\";\nimport { createPublicKey, randomBytes } from \"node:crypto\";\nimport { verifyDeviceSignature } from \"@agimon-ai/po-web-security/node\";\n//#region src/services/deviceTrust/index.ts\n/**\n* Native device trust: message layout, key checks, and single-use challenges.\n*\n* A phone paired by QR registers two P-256 keys over the sealed gateway: an\n* identity key that signs silent reconnects, and a step-up key that only\n* biometrics unlock. Every signed message is `tag + \"\\n\" + JSON.stringify(fields)`\n* with the fields in the fixed order below, so the phone and the host build the\n* same bytes and no message can be passed off as another or as a manifest.\n*\n* No I/O and no hidden clock: the caller passes the clock, the challenge store,\n* and the record lookup, so every rule here is testable without a server.\n*/\n/** Challenges and nonces are 32 random bytes, which is 43 base64url characters. */\nconst RANDOM_BYTES = 32;\nconst RANDOM_VALUE = /^[A-Za-z0-9_-]{43}$/u;\nconst CHALLENGE_ID_BYTES = 16;\n/** Opaque ids: trusted device ids, session device ids, and challenge ids. */\nconst OPAQUE_ID = /^[A-Za-z0-9_-]{1,64}$/u;\nconst MAX_SPKI_LENGTH = 512;\nconst MAX_CHANNEL_KEY_LENGTH = 128;\nconst MAX_SIGNATURE_LENGTH = 128;\nconst BASE64URL = /^[A-Za-z0-9_-]+$/u;\nconst P256_CURVE = \"prime256v1\";\nconst PLATFORMS = /* @__PURE__ */ new Set([\"ios\", \"android\"]);\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isBase64Url(value, maximum) {\n\treturn typeof value === \"string\" && value.length > 0 && value.length <= maximum && BASE64URL.test(value);\n}\nfunction ttlOf(purpose) {\n\treturn purpose.kind === \"auth\" ? DEVICE_AUTH_CHALLENGE_TTL_MS : DEVICE_STEP_UP_CHALLENGE_TTL_MS;\n}\n/** `po/host-channel-key/v1`, signed by the host bundle signer. */\nfunction hostChannelKeyFields(origin, hostPublicKey, deviceNonce) {\n\treturn [\n\t\torigin,\n\t\thostPublicKey,\n\t\tdeviceNonce\n\t];\n}\n/** `po/device-register/v1`, signed by the identity key and separately by the step-up key. */\nfunction deviceRegisterFields(input) {\n\treturn [\n\t\tinput.origin,\n\t\tinput.hostPublicKey,\n\t\tinput.sessionDeviceId,\n\t\tinput.identityPublicKey,\n\t\tinput.stepUpPublicKey,\n\t\tinput.platform\n\t];\n}\n/** `po/device-auth/v1`, signed by the identity key. All three channel keys are covered. */\nfunction deviceAuthFields(input) {\n\treturn [\n\t\tinput.origin,\n\t\tinput.challenge,\n\t\tinput.hostPublicKey,\n\t\tinput.trustedDeviceId,\n\t\tinput.channels.session,\n\t\tinput.channels.protocol,\n\t\tinput.channels.http\n\t];\n}\n/** `po/device-step-up/v1`, signed by the biometric step-up key. */\nfunction deviceStepUpFields(input) {\n\treturn [\n\t\tinput.origin,\n\t\tinput.action,\n\t\tinput.sessionDeviceId,\n\t\tinput.challengeId,\n\t\tinput.challenge\n\t];\n}\n/** Whether a value is a base64url DER SPKI for an EC P-256 public key, the only kind a device may register. */\nfunction isP256PublicKey(value) {\n\tif (!isBase64Url(value, MAX_SPKI_LENGTH)) return false;\n\ttry {\n\t\tconst key = createPublicKey({\n\t\t\tkey: Buffer.from(value, \"base64url\"),\n\t\t\tformat: \"der\",\n\t\t\ttype: \"spki\"\n\t\t});\n\t\treturn key.asymmetricKeyType === \"ec\" && key.asymmetricKeyDetails?.namedCurve === P256_CURVE;\n\t} catch {\n\t\treturn false;\n\t}\n}\n/** Whether a value is a fresh-looking 32-byte base64url nonce. */\nfunction isDeviceNonce(value) {\n\treturn typeof value === \"string\" && RANDOM_VALUE.test(value);\n}\nfunction isOpaqueId(value) {\n\treturn typeof value === \"string\" && OPAQUE_ID.test(value);\n}\n/**\n* Single-use challenges, bounded in count and lifetime.\n*\n* Deleted on first `take`, whatever the outcome of the check that follows, so a\n* challenge cannot be retried. Expired entries are swept on every issue, and the\n* oldest entry goes when the store is full.\n*/\nfunction createDeviceChallenges(options) {\n\tconst random = options.random ?? ((bytes) => randomBytes(bytes).toString(\"base64url\"));\n\tconst pending = /* @__PURE__ */ new Map();\n\tconst live = (entry, at) => at - entry.issuedAt < ttlOf(entry.purpose);\n\treturn {\n\t\tissue(hostPublicKey, purpose) {\n\t\t\tconst at = options.now();\n\t\t\tfor (const [id, entry] of pending) if (!live(entry, at)) pending.delete(id);\n\t\t\twhile (pending.size >= DEVICE_CHALLENGE_LIMIT) {\n\t\t\t\tconst oldest = pending.keys().next().value;\n\t\t\t\tif (oldest === void 0) break;\n\t\t\t\tpending.delete(oldest);\n\t\t\t}\n\t\t\tconst entry = {\n\t\t\t\tid: random(CHALLENGE_ID_BYTES),\n\t\t\t\tchallenge: random(RANDOM_BYTES),\n\t\t\t\thostPublicKey,\n\t\t\t\tissuedAt: at,\n\t\t\t\tpurpose\n\t\t\t};\n\t\t\tpending.set(entry.id, entry);\n\t\t\treturn entry;\n\t\t},\n\t\ttake(id) {\n\t\t\tconst entry = pending.get(id);\n\t\t\tif (entry === void 0) return void 0;\n\t\t\tpending.delete(id);\n\t\t\treturn live(entry, options.now()) ? entry : void 0;\n\t\t},\n\t\tdropWhere(predicate) {\n\t\t\tfor (const [id, entry] of pending) if (predicate(entry)) pending.delete(id);\n\t\t},\n\t\tclear: () => pending.clear(),\n\t\tsize: () => pending.size\n\t};\n}\n/**\n* The public reconnect challenge.\n*\n* It never consults the trusted-device list, so a known id and an unknown one\n* produce the same shape and the route cannot be used to enumerate devices.\n* The attestation proves the fresh tunnel key with the signer the phone pinned\n* at pairing, over the phone's own nonce. Undefined while the host cannot attest.\n*/\nfunction deviceAuthChallenge(input) {\n\tconst attestation = input.attest(hostChannelKeyFields(input.origin, input.hostPublicKey, input.nonce));\n\tif (attestation === void 0) return void 0;\n\tconst issued = input.challenges.issue(input.hostPublicKey, {\n\t\tkind: \"auth\",\n\t\ttrustedDeviceId: input.trustedDeviceId\n\t});\n\treturn {\n\t\tchallengeId: issued.id,\n\t\tchallenge: issued.challenge,\n\t\thostPublicKey: input.hostPublicKey,\n\t\tattestation\n\t};\n}\n/** A step-up challenge bound to one action and one session, answered by the biometric key. */\nfunction deviceStepUpChallenge(input) {\n\tconst issued = input.challenges.issue(input.hostPublicKey, {\n\t\tkind: \"step-up\",\n\t\tsessionDeviceId: input.sessionDeviceId,\n\t\taction: input.action\n\t});\n\treturn {\n\t\tceremonyId: issued.id,\n\t\tchallenge: issued.challenge,\n\t\tkind: \"device-key\"\n\t};\n}\n/**\n* Checks a registration from a sealed `pairing` session.\n*\n* Both keys must be distinct P-256 SPKIs and both must sign the same\n* `po/device-register/v1` message, which binds them to this origin, this\n* tunnel key, and this exact session.\n*/\nfunction verifyRegistration(input) {\n\tif (input.trust?.kind !== \"pairing\") return {\n\t\tok: false,\n\t\treason: \"not-pairing\"\n\t};\n\tconst body = input.body;\n\tif (!isRecord(body)) return {\n\t\tok: false,\n\t\treason: \"invalid\"\n\t};\n\tconst { identityPublicKey, stepUpPublicKey, label, platform, identityProof, stepUpProof } = body;\n\tif (!isP256PublicKey(identityPublicKey) || !isP256PublicKey(stepUpPublicKey) || identityPublicKey === stepUpPublicKey || typeof label !== \"string\" || typeof platform !== \"string\" || !PLATFORMS.has(platform) || !isBase64Url(identityProof, MAX_SIGNATURE_LENGTH) || !isBase64Url(stepUpProof, MAX_SIGNATURE_LENGTH)) return {\n\t\tok: false,\n\t\treason: \"invalid\"\n\t};\n\tconst fields = deviceRegisterFields({\n\t\torigin: input.origin,\n\t\thostPublicKey: input.hostPublicKey,\n\t\tsessionDeviceId: input.sessionDeviceId,\n\t\tidentityPublicKey,\n\t\tstepUpPublicKey,\n\t\tplatform\n\t});\n\tif (!verifyDeviceSignature(identityPublicKey, \"po/device-register/v1\", fields, identityProof) || !verifyDeviceSignature(stepUpPublicKey, \"po/device-register/v1\", fields, stepUpProof)) return {\n\t\tok: false,\n\t\treason: \"invalid\"\n\t};\n\treturn {\n\t\tok: true,\n\t\tidentityPublicKey,\n\t\tstepUpPublicKey,\n\t\tlabel: sanitizeUserAgent(label),\n\t\tplatform\n\t};\n}\nfunction channelKeysOf(value) {\n\tif (!isRecord(value)) return void 0;\n\tconst { session, protocol, http } = value;\n\tif (!isBase64Url(session, MAX_CHANNEL_KEY_LENGTH) || !isBase64Url(protocol, MAX_CHANNEL_KEY_LENGTH) || !isBase64Url(http, MAX_CHANNEL_KEY_LENGTH)) return void 0;\n\tif (session === protocol || session === http || protocol === http) return void 0;\n\treturn {\n\t\tsession,\n\t\tprotocol,\n\t\thttp\n\t};\n}\n/**\n* Checks a device sign-in. The challenge is consumed before anything else is\n* looked at, so every attempt, good or bad, burns it.\n*/\nfunction verifyAuthentication(input) {\n\tconst body = input.body;\n\tif (!isRecord(body) || !isOpaqueId(body.challengeId)) return { ok: false };\n\tconst issued = input.challenges.take(body.challengeId);\n\tif (issued === void 0 || issued.purpose.kind !== \"auth\") return { ok: false };\n\tif (input.hostPublicKey === void 0 || issued.hostPublicKey !== input.hostPublicKey) return { ok: false };\n\tif (!isOpaqueId(body.trustedDeviceId) || body.trustedDeviceId !== issued.purpose.trustedDeviceId) return { ok: false };\n\tif (!isBase64Url(body.signature, MAX_SIGNATURE_LENGTH)) return { ok: false };\n\tconst channels = channelKeysOf(body.channels);\n\tif (channels === void 0) return { ok: false };\n\tconst record = input.find(body.trustedDeviceId);\n\tif (record === void 0) return { ok: false };\n\tconst fields = deviceAuthFields({\n\t\torigin: input.origin,\n\t\tchallenge: issued.challenge,\n\t\thostPublicKey: issued.hostPublicKey,\n\t\ttrustedDeviceId: record.id,\n\t\tchannels\n\t});\n\tif (!verifyDeviceSignature(record.identityPublicKey, \"po/device-auth/v1\", fields, body.signature)) return { ok: false };\n\treturn {\n\t\tok: true,\n\t\trecord,\n\t\tchannels\n\t};\n}\n/** Checks a biometric step-up signature for one action from one device-key session. */\nfunction verifyStepUp(input) {\n\tif (!isOpaqueId(input.ceremonyId) || !isStepUpAction(input.action)) return false;\n\tconst issued = input.challenges.take(input.ceremonyId);\n\tif (issued === void 0 || issued.purpose.kind !== \"step-up\") return false;\n\tif (input.hostPublicKey === void 0 || issued.hostPublicKey !== input.hostPublicKey) return false;\n\tif (issued.purpose.sessionDeviceId !== input.sessionDeviceId || issued.purpose.action !== input.action) return false;\n\tif (!isBase64Url(input.signature, MAX_SIGNATURE_LENGTH)) return false;\n\treturn verifyDeviceSignature(input.stepUpPublicKey, DEVICE_STEP_UP_TAG, deviceStepUpFields({\n\t\torigin: input.origin,\n\t\taction: input.action,\n\t\tsessionDeviceId: input.sessionDeviceId,\n\t\tchallengeId: issued.id,\n\t\tchallenge: issued.challenge\n\t}), input.signature);\n}\n//#endregion\nexport { createDeviceChallenges, deviceAuthChallenge, deviceAuthFields, deviceRegisterFields, deviceStepUpChallenge, deviceStepUpFields, hostChannelKeyFields, isDeviceNonce, isOpaqueId, isP256PublicKey, verifyAuthentication, verifyRegistration, verifyStepUp };\n\n//# sourceMappingURL=index.mjs.map","//#region src/services/nativePushRegistration/index.ts\nconst MAX_TOKEN_LENGTH = 4096;\nconst APNS_TOKEN = /^(?:[a-fA-F0-9]{2})+$/u;\nconst FCM_TOKEN = /^[A-Za-z0-9_:.-]+$/u;\n/** Strict wire/disk validation. Return a detached value, never caller-owned metadata. */\nfunction parseNativePushRegistration(value, platform) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return void 0;\n\tconst body = value;\n\tif (body.hostRef !== void 0 && (typeof body.hostRef !== \"string\" || !/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/u.test(body.hostRef))) return void 0;\n\tconst attribution = body.hostRef === void 0 ? {} : { hostRef: body.hostRef };\n\tif (platform !== void 0 && body.platform !== platform) return void 0;\n\tif (typeof body.token !== \"string\" || body.token.length === 0 || body.token.length > MAX_TOKEN_LENGTH) return void 0;\n\tif (body.platform === \"ios\") {\n\t\tif (Object.keys(body).some((key) => ![\n\t\t\t\"platform\",\n\t\t\t\"token\",\n\t\t\t\"environment\",\n\t\t\t\"hostRef\"\n\t\t].includes(key)) || !APNS_TOKEN.test(body.token) || body.environment !== \"development\" && body.environment !== \"production\") return void 0;\n\t\treturn {\n\t\t\t...attribution,\n\t\t\tplatform: \"ios\",\n\t\t\ttoken: body.token.toLowerCase(),\n\t\t\tenvironment: body.environment\n\t\t};\n\t}\n\tif (body.platform !== \"android\" || Object.keys(body).some((key) => ![\n\t\t\"platform\",\n\t\t\"token\",\n\t\t\"hostRef\"\n\t].includes(key)) || !FCM_TOKEN.test(body.token)) return void 0;\n\treturn {\n\t\t...attribution,\n\t\tplatform: \"android\",\n\t\ttoken: body.token\n\t};\n}\nfunction sameNativePushRegistration(a, b) {\n\treturn a.platform === b.platform && a.token === b.token && a.hostRef === b.hostRef && (a.platform !== \"ios\" || b.platform === \"ios\" && a.environment === b.environment);\n}\n//#endregion\nexport { parseNativePushRegistration, sameNativePushRegistration };\n\n//# sourceMappingURL=index.mjs.map","import { PAIRING_CODE_TTL_MS, PAIRING_REQUEST_TTL_MS } from \"../../constants/remote.mjs\";\nimport { sanitizeEdgeIp, sanitizeUserAgent } from \"../deviceSessions/index.mjs\";\n//#region src/services/pairingFlow/index.ts\n/**\n* Pairing a device, as a state machine over injected randomness and time.\n*\n*   code (120s) --claim--> pending (180s) --approve--> approved --consume--> consumed\n*                             |                 \\\n*                             +----- deny -------+--> denied\n*\n* The host approval step is the point. A scanned code proves someone is\n* standing where the screen is, but a screen is visible over a shoulder and in\n* a screenshare, so the code alone is a single factor for a credential that\n* ends in shell access. Approving on the machine is the second.\n*\n* Randomness and hashing arrive as functions so this file stays free of\n* node:crypto and testable with a counter.\n*/\n/** Failed claims allowed per source inside one window before the endpoint starts refusing. */\nconst ATTEMPT_LIMIT = 10;\nconst ATTEMPT_WINDOW_MS = 6e4;\n/** Caps throttle state even if many distinct peers reach the listener. */\nconst SOURCE_LIMIT = 1024;\n/** How long a settled request stays readable, so a late approval is still collectable. */\nconst PAIRING_REQUEST_RETENTION_MS = PAIRING_REQUEST_TTL_MS * 2;\nfunction createPairingFlow(options) {\n\t/** Only the newest code pair is live, so minting another retires both old codes. */\n\tlet liveCode;\n\tconst requests = /* @__PURE__ */ new Map();\n\tconst attemptsBySource = /* @__PURE__ */ new Map();\n\tconst notice = options.onNotice ?? (() => {});\n\tconst isExpired = (request, now) => request.status === \"pending\" && now - request.createdAt >= 18e4;\n\t/** Derived rather than scheduled, so a stopped clock cannot leave a request live. */\n\tconst statusOf = (request, now) => isExpired(request, now) ? \"expired\" : request.status;\n\tconst countFailure = (sourceAddress, now) => {\n\t\tconst source = sourceAddress ?? \"unknown\";\n\t\tlet attempts = attemptsBySource.get(source);\n\t\tif (attempts === void 0 || now - attempts.windowStartedAt >= ATTEMPT_WINDOW_MS) {\n\t\t\tif (attempts === void 0 && attemptsBySource.size >= SOURCE_LIMIT) {\n\t\t\t\tconst oldest = attemptsBySource.keys().next().value;\n\t\t\t\tif (oldest !== void 0) attemptsBySource.delete(oldest);\n\t\t\t}\n\t\t\tattempts = {\n\t\t\t\twindowStartedAt: now,\n\t\t\t\tfailures: 0\n\t\t\t};\n\t\t\tattemptsBySource.set(source, attempts);\n\t\t}\n\t\tattempts.failures += 1;\n\t\tif (attempts.failures === 11) notice(`pairing claim abuse detected from ${source}; throttling invalid attempts`);\n\t\treturn attempts.failures > ATTEMPT_LIMIT ? \"rate_limited\" : \"ok\";\n\t};\n\treturn {\n\t\tmintCode() {\n\t\t\tconst code = options.randomToken();\n\t\t\tconst manualCode = options.randomManualCode();\n\t\t\tconst expiresAt = options.now() + PAIRING_CODE_TTL_MS;\n\t\t\tliveCode = {\n\t\t\t\thashes: [options.digest(code), options.digest(manualCode)],\n\t\t\t\texpiresAt\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tcode,\n\t\t\t\tmanualCode,\n\t\t\t\texpiresAt\n\t\t\t};\n\t\t},\n\t\tclaim(input) {\n\t\t\tconst now = options.now();\n\t\t\tconst presented = options.digest(input.code);\n\t\t\tif (liveCode === void 0 || now >= liveCode.expiresAt || !liveCode.hashes.includes(presented)) {\n\t\t\t\tconst limit = countFailure(input.sourceAddress, now);\n\t\t\t\tif (limit !== \"ok\") return {\n\t\t\t\t\tok: false,\n\t\t\t\t\tcode: limit\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\tcode: \"unknown_code\"\n\t\t\t\t};\n\t\t\t}\n\t\t\tliveCode = void 0;\n\t\t\tconst request = {\n\t\t\t\tid: options.randomToken(),\n\t\t\t\tuserAgent: sanitizeUserAgent(input.userAgent),\n\t\t\t\tedgeIp: sanitizeEdgeIp(input.edgeIp),\n\t\t\t\tcreatedAt: now,\n\t\t\t\tstatus: \"pending\"\n\t\t\t};\n\t\t\trequests.set(request.id, request);\n\t\t\tnotice(`pairing requested from ${request.userAgent} via ${request.edgeIp}`);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\trequestId: request.id\n\t\t\t};\n\t\t},\n\t\tstatus(requestId) {\n\t\t\tconst request = requests.get(requestId);\n\t\t\treturn request === void 0 ? void 0 : statusOf(request, options.now());\n\t\t},\n\t\tapprove(requestId) {\n\t\t\tconst request = requests.get(requestId);\n\t\t\tif (request === void 0) return \"unknown\";\n\t\t\tconst now = options.now();\n\t\t\tif (isExpired(request, now)) return \"expired\";\n\t\t\tif (request.status !== \"pending\") return \"settled\";\n\t\t\trequest.status = \"approved\";\n\t\t\tnotice(`pairing approved for ${request.userAgent}`);\n\t\t\treturn \"approved\";\n\t\t},\n\t\tdeny(requestId) {\n\t\t\tconst request = requests.get(requestId);\n\t\t\tif (request === void 0) return \"unknown\";\n\t\t\tif (request.status !== \"pending\") return \"settled\";\n\t\t\trequest.status = \"denied\";\n\t\t\tnotice(`pairing denied for ${request.userAgent}`);\n\t\t\treturn \"denied\";\n\t\t},\n\t\tconsume(requestId) {\n\t\t\tconst request = requests.get(requestId);\n\t\t\tif (request === void 0 || request.status !== \"approved\") return void 0;\n\t\t\trequest.status = \"consumed\";\n\t\t\treturn { userAgent: request.userAgent };\n\t\t},\n\t\tpending() {\n\t\t\tconst now = options.now();\n\t\t\treturn [...requests.values()].filter((request) => statusOf(request, now) === \"pending\");\n\t\t},\n\t\tsweep() {\n\t\t\tconst now = options.now();\n\t\t\tfor (const [id, request] of requests) if (now - request.createdAt >= PAIRING_REQUEST_RETENTION_MS) requests.delete(id);\n\t\t\tif (liveCode !== void 0 && now >= liveCode.expiresAt) liveCode = void 0;\n\t\t\tfor (const [source, attempts] of attemptsBySource) if (now - attempts.windowStartedAt >= ATTEMPT_WINDOW_MS) attemptsBySource.delete(source);\n\t\t},\n\t\tclear() {\n\t\t\trequests.clear();\n\t\t\tliveCode = void 0;\n\t\t\tattemptsBySource.clear();\n\t\t}\n\t};\n}\n//#endregion\nexport { createPairingFlow };\n\n//# sourceMappingURL=index.mjs.map","const MIN_MINUTES = 1;\nconst MAX_MINUTES = 1440;\nconst MIN_HOURS = 1;\nconst MAX_HOURS = 720;\n/**\n* Both time limits start off.\n*\n* The durations are still here so switching one on lands on a sensible number\n* rather than an empty field. What being off actually means: a tunnel stays up\n* until it is closed or the hub restarts, and a paired session lasts until it\n* is revoked or remote access is switched off. Those two events are the only\n* expiry there is by default.\n*/\nconst DEFAULT_REMOTE_SETTINGS = {\n\tautoCloseEnabled: false,\n\tautoCloseMinutes: 60,\n\tsessionExpiryEnabled: false,\n\tidleMinutes: 30,\n\tabsoluteHours: 12,\n\ttunnel: { kind: \"quick\" }\n};\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction readBoolean(raw, fallback, field, warnings) {\n\tif (raw === void 0) return fallback;\n\tif (typeof raw !== \"boolean\") {\n\t\twarnings.push(`${field} must be true or false; using ${String(fallback)}.`);\n\t\treturn fallback;\n\t}\n\treturn raw;\n}\nfunction readClamped(raw, fallback, bounds, field, warnings) {\n\tif (raw === void 0) return fallback;\n\tif (typeof raw !== \"number\" || !Number.isFinite(raw)) {\n\t\twarnings.push(`${field} must be a number; using ${String(fallback)}.`);\n\t\treturn fallback;\n\t}\n\tconst clamped = Math.min(bounds.max, Math.max(bounds.min, Math.round(raw)));\n\tif (clamped !== raw) warnings.push(`${field} must be between ${String(bounds.min)} and ${String(bounds.max)}; using ${String(clamped)}.`);\n\treturn clamped;\n}\n/**\n* A tunnel configuration is only accepted whole.\n*\n* A named tunnel missing its hostname is not a named tunnel with a default, it\n* is a misconfiguration, and quietly falling back to a quick tunnel would swap\n* a stable origin for a rotating one without telling anybody.\n*/\nfunction readTunnel(raw, warnings) {\n\tif (raw === void 0) return DEFAULT_REMOTE_SETTINGS.tunnel;\n\tif (!isRecord(raw)) {\n\t\twarnings.push(\"tunnel must be an object; using a quick tunnel.\");\n\t\treturn { kind: \"quick\" };\n\t}\n\tif (raw.kind === \"quick\") return { kind: \"quick\" };\n\tif (raw.kind !== \"named\") {\n\t\twarnings.push(`tunnel.kind must be \"quick\" or \"named\"; using a quick tunnel.`);\n\t\treturn { kind: \"quick\" };\n\t}\n\tif (typeof raw.hostname !== \"string\" || raw.hostname === \"\") {\n\t\twarnings.push(\"A named tunnel needs a hostname; using a quick tunnel.\");\n\t\treturn { kind: \"quick\" };\n\t}\n\treturn {\n\t\tkind: \"named\",\n\t\thostname: raw.hostname,\n\t\t...typeof raw.name === \"string\" && raw.name !== \"\" ? { name: raw.name } : {},\n\t\t...typeof raw.tokenFile === \"string\" && raw.tokenFile !== \"\" ? { tokenFile: raw.tokenFile } : {},\n\t\t...typeof raw.configFile === \"string\" && raw.configFile !== \"\" ? { configFile: raw.configFile } : {}\n\t};\n}\nfunction parseRemoteAccessSettings(raw) {\n\tconst warnings = [];\n\tif (!isRecord(raw)) return {\n\t\tsettings: DEFAULT_REMOTE_SETTINGS,\n\t\twarnings\n\t};\n\tif (raw.version !== 1) {\n\t\twarnings.push(`Settings version ${String(raw.version)} is not version ${String(1)}; using defaults.`);\n\t\treturn {\n\t\t\tsettings: DEFAULT_REMOTE_SETTINGS,\n\t\t\twarnings\n\t\t};\n\t}\n\tconst defaults = DEFAULT_REMOTE_SETTINGS;\n\treturn {\n\t\tsettings: {\n\t\t\tautoCloseEnabled: readBoolean(raw.autoCloseEnabled, defaults.autoCloseEnabled, \"autoCloseEnabled\", warnings),\n\t\t\tautoCloseMinutes: readClamped(raw.autoCloseMinutes, defaults.autoCloseMinutes, {\n\t\t\t\tmin: MIN_MINUTES,\n\t\t\t\tmax: MAX_MINUTES\n\t\t\t}, \"autoCloseMinutes\", warnings),\n\t\t\tsessionExpiryEnabled: readBoolean(raw.sessionExpiryEnabled, defaults.sessionExpiryEnabled, \"sessionExpiryEnabled\", warnings),\n\t\t\tidleMinutes: readClamped(raw.idleMinutes, defaults.idleMinutes, {\n\t\t\t\tmin: MIN_MINUTES,\n\t\t\t\tmax: MAX_MINUTES\n\t\t\t}, \"idleMinutes\", warnings),\n\t\t\tabsoluteHours: readClamped(raw.absoluteHours, defaults.absoluteHours, {\n\t\t\t\tmin: MIN_HOURS,\n\t\t\t\tmax: MAX_HOURS\n\t\t\t}, \"absoluteHours\", warnings),\n\t\t\ttunnel: readTunnel(raw.tunnel, warnings)\n\t\t},\n\t\twarnings\n\t};\n}\nfunction serializeRemoteAccessSettings(settings) {\n\treturn {\n\t\tversion: 1,\n\t\t...settings\n\t};\n}\n//#endregion\nexport { DEFAULT_REMOTE_SETTINGS, parseRemoteAccessSettings, serializeRemoteAccessSettings };\n\n//# sourceMappingURL=index.mjs.map","/* ------------------------------------------------------------------------------------\n\n  base64 - MIT License - Hexagon <hexagon@56k.guru>\n\n  ------------------------------------------------------------------------------------\n\n  License:\n\n\tCopyright (c) 2021 Hexagon <hexagon@56k.guru>\n\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE.\n\n  ------------------------------------------------------------------------------------  */\n\nconst \n\t// Regular base64 characters\n\tchars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",\n\n\t// Base64url characters\n\tcharsUrl = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\",\n\n\tgenLookup = (target) => {\n\t\tconst lookupTemp = typeof Uint8Array === \"undefined\" ? [] : new Uint8Array(256);\n\t\tconst len = chars.length;\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tlookupTemp[target.charCodeAt(i)] = i;\n\t\t}\n\t\treturn lookupTemp;\n\t},\n  \n\t// Use a lookup table to find the index.\n\tlookup = genLookup(chars),\n\tlookupUrl = genLookup(charsUrl); \n\n/**\n * Pre-calculated regexes for validating base64 and base64url\n */\nconst base64UrlPattern = /^[-A-Za-z0-9\\-_]*$/;\nconst base64Pattern = /^[-A-Za-z0-9+/]*={0,3}$/;\n\n/**\n * @namespace base64\n */\nconst base64 = {};\n\n/**\n * Convenience function for converting a base64 encoded string to an ArrayBuffer instance\n * @public\n * \n * @param {string} data - Base64 representation of data\n * @param {boolean} [urlMode] - If set to true, URL mode string will be expected\n * @returns {ArrayBuffer} - Decoded data\n */\nbase64.toArrayBuffer = (data, urlMode) => {\n\tconst \n\t\tlen = data.length;\n\tlet bufferLength = data.length * 0.75,\n\t\ti,\n\t\tp = 0,\n\t\tencoded1,\n\t\tencoded2,\n\t\tencoded3,\n\t\tencoded4;\n\n\tif (data[data.length - 1] === \"=\") {\n\t\tbufferLength--;\n\t\tif (data[data.length - 2] === \"=\") {\n\t\t\tbufferLength--;\n\t\t}\n\t}\n\n\tconst \n\t\tarraybuffer = new ArrayBuffer(bufferLength),\n\t\tbytes = new Uint8Array(arraybuffer),\n\t\ttarget = urlMode ? lookupUrl : lookup;\n\n\tfor (i = 0; i < len; i += 4) {\n\t\tencoded1 = target[data.charCodeAt(i)];\n\t\tencoded2 = target[data.charCodeAt(i + 1)];\n\t\tencoded3 = target[data.charCodeAt(i + 2)];\n\t\tencoded4 = target[data.charCodeAt(i + 3)];\n\n\t\tbytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n\t\tbytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n\t\tbytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n\t}\n\n\treturn arraybuffer;\n\n};\n\n/**\n * Convenience function for creating a base64 encoded string from an ArrayBuffer instance\n * @public\n * \n * @param {ArrayBuffer} arrBuf - ArrayBuffer to be encoded\n * @param {boolean} [urlMode] - If set to true, URL mode string will be returned\n * @returns {string} - Base64 representation of data\n */\nbase64.fromArrayBuffer = (arrBuf, urlMode) => {\n\tconst bytes = new Uint8Array(arrBuf);\n\tlet\n\t\ti,\n\t\tresult = \"\";\n\n\tconst\n\t\tlen = bytes.length,\n\t\ttarget = urlMode ? charsUrl : chars;\n\n\tfor (i = 0; i < len; i += 3) {\n\t\tresult += target[bytes[i] >> 2];\n\t\tresult += target[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n\t\tresult += target[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n\t\tresult += target[bytes[i + 2] & 63];\n\t}\n\n\tconst remainder = len % 3;\n\tif (remainder === 2) {\n\t\tresult = result.substring(0, result.length - 1) + (urlMode ? \"\" : \"=\");\n\t} else if (remainder === 1) {\n\t\tresult = result.substring(0, result.length - 2) + (urlMode ? \"\" : \"==\");\n\t}\n\n\treturn result;\n\n};\n\n/**\n * Convenience function for converting base64 to string\n * @public\n * \n * @param {string} str - Base64 encoded string to be decoded\n * @param {boolean} [urlMode] - If set to true, URL mode string will be expected\n * @returns {string} - Decoded string\n */\nbase64.toString = (str, urlMode) => {\n\treturn new TextDecoder().decode(base64.toArrayBuffer(str, urlMode));\n};\n\n/**\n * Convenience function for converting a javascript string to base64\n * @public\n * \n * @param {string} str - String to be converted to base64\n * @param {boolean} [urlMode] - If set to true, URL mode string will be returned\n * @returns {string} - Base64 encoded string\n */\nbase64.fromString = (str, urlMode) => {\n\treturn base64.fromArrayBuffer(new TextEncoder().encode(str), urlMode);\n};\n\n/**\n * Function to validate base64\n * @public\n * @param {string} encoded - Base64 or Base64url encoded data\n * @param {boolean} [urlMode] - If set to true, base64url will be expected\n * @returns {boolean} - Valid base64/base64url?\n */\nbase64.validate = (encoded, urlMode) => {\n\n\t// Bail out if not string\n\tif (!(typeof encoded === \"string\" || encoded instanceof String)) {\n\t\treturn false;\n\t}\n\n\t// Go on validate\n\ttry {\n\t\treturn urlMode ? base64UrlPattern.test(encoded) : base64Pattern.test(encoded);\n\t} catch (_e) {\n\t\treturn false;\n\t}\n};\n\nbase64.base64 = base64;\nexport default base64;\nexport { base64 };","/**\n * A runtime-agnostic collection of methods for working with Base64URL encoding\n * @module\n */\nimport base64 from '@hexagon/base64';\n/**\n * Decode from a Base64URL-encoded string to an ArrayBuffer. Best used when converting a\n * credential ID from a JSON string to an ArrayBuffer, like in allowCredentials or\n * excludeCredentials.\n *\n * @param buffer Value to decode from base64\n * @param to (optional) The decoding to use, in case it's desirable to decode from base64 instead\n */\nexport function toBuffer(base64urlString, from = 'base64url') {\n    const _buffer = base64.toArrayBuffer(base64urlString, from === 'base64url');\n    return new Uint8Array(_buffer);\n}\n/**\n * Encode the given array buffer into a Base64URL-encoded string. Ideal for converting various\n * credential response ArrayBuffers to string for sending back to the server as JSON.\n *\n * @param buffer Value to encode to base64\n * @param to (optional) The encoding to use, in case it's desirable to encode to base64 instead\n */\nexport function fromBuffer(buffer, to = 'base64url') {\n    /**\n     * Gracefully handle Uint8Array subclass types, like Node's Buffer, that can have a large\n     * ArrayBuffer backing it.\n     */\n    const _normalized = new Uint8Array(buffer);\n    return base64.fromArrayBuffer(_normalized.buffer, to === 'base64url');\n}\n/**\n * Convert a base64url string into base64\n */\nexport function toBase64(base64urlString) {\n    const fromBase64Url = base64.toArrayBuffer(base64urlString, true);\n    const toBase64 = base64.fromArrayBuffer(fromBase64Url);\n    return toBase64;\n}\n/**\n * Encode a UTF-8 string to base64url\n */\nexport function fromUTF8String(utf8String) {\n    return base64.fromString(utf8String, true);\n}\n/**\n * Decode a base64url string into its original UTF-8 string\n */\nexport function toUTF8String(base64urlString) {\n    return base64.toString(base64urlString, true);\n}\n/**\n * Confirm that the string is encoded into base64\n */\nexport function isBase64(input) {\n    return base64.validate(input, false);\n}\n/**\n * Confirm that the string is encoded into base64url, with support for optional padding\n */\nexport function isBase64URL(input) {\n    // Trim padding characters from the string if present\n    input = trimPadding(input);\n    return base64.validate(input, true);\n}\n/**\n * Remove optional padding from a base64url-encoded string\n */\nexport function trimPadding(input) {\n    return input.replace(/=/g, '');\n}\n","export function decodeLength(data, argument, index) {\n    if (argument < 24) {\n        return [argument, 1];\n    }\n    const remainingDataLength = data.byteLength - index - 1;\n    const view = new DataView(data.buffer, index + 1);\n    let output;\n    let bytes = 0;\n    switch (argument) {\n        case 24: {\n            if (remainingDataLength > 0) {\n                output = view.getUint8(0);\n                bytes = 2;\n            }\n            break;\n        }\n        case 25: {\n            if (remainingDataLength > 1) {\n                output = view.getUint16(0, false);\n                bytes = 3;\n            }\n            break;\n        }\n        case 26: {\n            if (remainingDataLength > 3) {\n                output = view.getUint32(0, false);\n                bytes = 5;\n            }\n            break;\n        }\n        case 27: {\n            if (remainingDataLength > 7) {\n                const bigOutput = view.getBigUint64(0, false);\n                // Bound it to [24, MAX_SAFE_INTEGER], where it is safe\n                // to encode as a javascript number\n                if (bigOutput >= 24n && bigOutput <= Number.MAX_SAFE_INTEGER) {\n                    return [Number(bigOutput), 9];\n                }\n            }\n            break;\n        }\n    }\n    if (output && output >= 24) {\n        return [output, bytes];\n    }\n    throw new Error(\"Length not supported or not well formed\");\n}\nexport const MAJOR_TYPE_UNSIGNED_INTEGER = 0;\nexport const MAJOR_TYPE_NEGATIVE_INTEGER = 1;\nexport const MAJOR_TYPE_BYTE_STRING = 2;\nexport const MAJOR_TYPE_TEXT_STRING = 3;\nexport const MAJOR_TYPE_ARRAY = 4;\nexport const MAJOR_TYPE_MAP = 5;\nexport const MAJOR_TYPE_TAG = 6;\nexport const MAJOR_TYPE_SIMPLE_OR_FLOAT = 7;\nexport function encodeLength(major, argument) {\n    const majorEncoded = major << 5;\n    if (argument < 0) {\n        throw new Error(\"CBOR Data Item argument must not be negative\");\n    }\n    // Convert to bigint first.\n    // Encode integers around and above 32 bits in big endian / network byte order\n    // is unreliable in javascript.\n    // https://tc39.es/ecma262/#sec-bitwise-shift-operators\n    // Bit shifting operations result in 32 bit signed numbers\n    let bigintArgument;\n    if (typeof argument == \"number\") {\n        if (!Number.isInteger(argument)) {\n            throw new Error(\"CBOR Data Item argument must be an integer\");\n        }\n        bigintArgument = BigInt(argument);\n    }\n    else {\n        bigintArgument = argument;\n    }\n    // Negative 0 is not a thing\n    if (major == MAJOR_TYPE_NEGATIVE_INTEGER) {\n        if (bigintArgument == 0n) {\n            throw new Error(\"CBOR Data Item argument cannot be zero when negative\");\n        }\n        bigintArgument = bigintArgument - 1n;\n    }\n    if (bigintArgument > 18446744073709551615n) {\n        throw new Error(\"CBOR number out of range\");\n    }\n    // Encode into 64 bits and extract the tail\n    const buffer = new Uint8Array(8);\n    const view = new DataView(buffer.buffer);\n    view.setBigUint64(0, bigintArgument, false);\n    if (bigintArgument <= 23) {\n        return [majorEncoded | buffer[7]];\n    }\n    else if (bigintArgument <= 255) {\n        return [majorEncoded | 24, buffer[7]];\n    }\n    else if (bigintArgument <= 65535) {\n        return [majorEncoded | 25, ...buffer.slice(6)];\n    }\n    else if (bigintArgument <= 4294967295) {\n        return [\n            majorEncoded | 26,\n            ...buffer.slice(4),\n        ];\n    }\n    else {\n        return [\n            majorEncoded | 27,\n            ...buffer,\n        ];\n    }\n}\n","import { decodeLength, encodeLength, MAJOR_TYPE_ARRAY, MAJOR_TYPE_BYTE_STRING, MAJOR_TYPE_MAP, MAJOR_TYPE_NEGATIVE_INTEGER, MAJOR_TYPE_SIMPLE_OR_FLOAT, MAJOR_TYPE_TAG, MAJOR_TYPE_TEXT_STRING, MAJOR_TYPE_UNSIGNED_INTEGER, } from \"./cbor_internal.js\";\n/**\n * A value which is wrapped with a CBOR Tag.\n * Several tags are registered with defined meanings like 0 for a date string.\n * These meanings are **not interpreted** when decoded or encoded.\n *\n * This class is an immutable record.\n * If the tag number or value needs to change, then construct a new tag\n */\nexport class CBORTag {\n    /**\n     * Wrap a value with a tag number.\n     * When encoded, this tag will be attached to the value.\n     *\n     * @param tag Tag number\n     * @param value Wrapped value\n     */\n    constructor(tag, value) {\n        Object.defineProperty(this, \"tagId\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: void 0\n        });\n        Object.defineProperty(this, \"tagValue\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: void 0\n        });\n        this.tagId = tag;\n        this.tagValue = value;\n    }\n    /**\n     * Read the tag number\n     */\n    get tag() {\n        return this.tagId;\n    }\n    /**\n     * Read the value\n     */\n    get value() {\n        return this.tagValue;\n    }\n}\nfunction decodeUnsignedInteger(data, argument, index) {\n    return decodeLength(data, argument, index);\n}\nfunction decodeNegativeInteger(data, argument, index) {\n    const [value, length] = decodeUnsignedInteger(data, argument, index);\n    return [-value - 1, length];\n}\nfunction decodeByteString(data, argument, index) {\n    const [lengthValue, lengthConsumed] = decodeLength(data, argument, index);\n    const dataStartIndex = index + lengthConsumed;\n    return [\n        new Uint8Array(data.buffer.slice(dataStartIndex, dataStartIndex + lengthValue)),\n        lengthConsumed + lengthValue,\n    ];\n}\nconst TEXT_DECODER = new TextDecoder();\nfunction decodeString(data, argument, index) {\n    const [value, length] = decodeByteString(data, argument, index);\n    return [TEXT_DECODER.decode(value), length];\n}\nfunction decodeArray(data, argument, index) {\n    if (argument === 0) {\n        return [[], 1];\n    }\n    const [length, lengthConsumed] = decodeLength(data, argument, index);\n    let consumedLength = lengthConsumed;\n    const value = [];\n    for (let i = 0; i < length; i++) {\n        const remainingDataLength = data.byteLength - index - consumedLength;\n        if (remainingDataLength <= 0) {\n            throw new Error(\"array is not supported or well formed\");\n        }\n        const [decodedValue, consumed] = decodeNext(data, index + consumedLength);\n        value.push(decodedValue);\n        consumedLength += consumed;\n    }\n    return [value, consumedLength];\n}\nconst MAP_ERROR = \"Map is not supported or well formed\";\nfunction decodeMap(data, argument, index) {\n    if (argument === 0) {\n        return [new Map(), 1];\n    }\n    const [length, lengthConsumed] = decodeLength(data, argument, index);\n    let consumedLength = lengthConsumed;\n    const result = new Map();\n    for (let i = 0; i < length; i++) {\n        let remainingDataLength = data.byteLength - index - consumedLength;\n        if (remainingDataLength <= 0) {\n            throw new Error(MAP_ERROR);\n        }\n        // Load key\n        const [key, keyConsumed] = decodeNext(data, index + consumedLength);\n        consumedLength += keyConsumed;\n        remainingDataLength -= keyConsumed;\n        // Check that there's enough to have a value\n        if (remainingDataLength <= 0) {\n            throw new Error(MAP_ERROR);\n        }\n        // Technically CBOR maps can have any type as the key, and so can JS Maps\n        // However, JS Maps can only reference such keys as references which would\n        // require key iteration and pattern matching.\n        // For simplicity, since such keys are not in use with WebAuthn, this\n        // capability is not implemented and the types are restricted to strings\n        // and numbers.\n        if (typeof key !== \"string\" && typeof key !== \"number\") {\n            throw new Error(MAP_ERROR);\n        }\n        // CBOR Maps are not well formed if there are duplicate keys\n        if (result.has(key)) {\n            throw new Error(MAP_ERROR);\n        }\n        // Load value\n        const [value, valueConsumed] = decodeNext(data, index + consumedLength);\n        consumedLength += valueConsumed;\n        result.set(key, value);\n    }\n    return [result, consumedLength];\n}\nfunction decodeFloat16(data, index) {\n    if (index + 3 > data.byteLength) {\n        throw new Error(\"CBOR stream ended before end of Float 16\");\n    }\n    // Skip the first byte\n    const result = data.getUint16(index + 1, false);\n    // A minimal selection of supported values\n    if (result == 0x7c00) {\n        return [Infinity, 3];\n    }\n    else if (result == 0x7e00) {\n        return [NaN, 3];\n    }\n    else if (result == 0xfc00) {\n        return [-Infinity, 3];\n    }\n    throw new Error(\"Float16 data is unsupported\");\n}\nfunction decodeFloat32(data, index) {\n    if (index + 5 > data.byteLength) {\n        throw new Error(\"CBOR stream ended before end of Float 32\");\n    }\n    // Skip the first byte\n    const result = data.getFloat32(index + 1, false);\n    // First byte + 4 byte float\n    return [result, 5];\n}\nfunction decodeFloat64(data, index) {\n    if (index + 9 > data.byteLength) {\n        throw new Error(\"CBOR stream ended before end of Float 64\");\n    }\n    // Skip the first byte\n    const result = data.getFloat64(index + 1, false);\n    // First byte + 8 byte float\n    return [result, 9];\n}\nfunction decodeTag(data, argument, index) {\n    const [tag, tagBytes] = decodeLength(data, argument, index);\n    const [value, valueBytes] = decodeNext(data, index + tagBytes);\n    return [new CBORTag(tag, value), tagBytes + valueBytes];\n}\nfunction decodeNext(data, index) {\n    if (index >= data.byteLength) {\n        throw new Error(\"CBOR stream ended before tag value\");\n    }\n    const byte = data.getUint8(index);\n    const majorType = byte >> 5;\n    const argument = byte & 0x1f;\n    switch (majorType) {\n        case MAJOR_TYPE_UNSIGNED_INTEGER: {\n            return decodeUnsignedInteger(data, argument, index);\n        }\n        case MAJOR_TYPE_NEGATIVE_INTEGER: {\n            return decodeNegativeInteger(data, argument, index);\n        }\n        case MAJOR_TYPE_BYTE_STRING: {\n            return decodeByteString(data, argument, index);\n        }\n        case MAJOR_TYPE_TEXT_STRING: {\n            return decodeString(data, argument, index);\n        }\n        case MAJOR_TYPE_ARRAY: {\n            return decodeArray(data, argument, index);\n        }\n        case MAJOR_TYPE_MAP: {\n            return decodeMap(data, argument, index);\n        }\n        case MAJOR_TYPE_TAG: {\n            return decodeTag(data, argument, index);\n        }\n        case MAJOR_TYPE_SIMPLE_OR_FLOAT: {\n            switch (argument) {\n                case 20:\n                    return [false, 1];\n                case 21:\n                    return [true, 1];\n                case 22:\n                    return [null, 1];\n                case 23:\n                    return [undefined, 1];\n                // 24: Simple value (value 32..255 in following byte)\n                case 25: // IEEE 754 Half-Precision Float (16 bits follow)\n                    return decodeFloat16(data, index);\n                case 26: // IEEE 754 Single-Precision Float (32 bits follow)\n                    return decodeFloat32(data, index);\n                case 27: // IEEE 754 Double-Precision Float (64 bits follow)\n                    return decodeFloat64(data, index);\n                // 28-30: Reserved, not well-formed in the present document\n                // 31: \"break\" stop code for indefinite-length items\n            }\n        }\n    }\n    throw new Error(`Unsupported or not well formed at ${index}`);\n}\nfunction encodeSimple(data) {\n    if (data === true) {\n        return 0xf5;\n    }\n    else if (data === false) {\n        return 0xf4;\n    }\n    else if (data === null) {\n        return 0xf6;\n    }\n    // Else undefined\n    return 0xf7;\n}\nfunction encodeFloat(data) {\n    if (Math.fround(data) == data || !Number.isFinite(data) || Number.isNaN(data)) {\n        // Float32\n        const output = new Uint8Array(5);\n        output[0] = 0xfa;\n        const view = new DataView(output.buffer);\n        view.setFloat32(1, data, false);\n        return output;\n    }\n    else {\n        // Float64\n        const output = new Uint8Array(9);\n        output[0] = 0xfb;\n        const view = new DataView(output.buffer);\n        view.setFloat64(1, data, false);\n        return output;\n    }\n}\nfunction encodeNumber(data) {\n    if (typeof data == \"number\") {\n        if (Number.isSafeInteger(data)) {\n            // Encode integer\n            if (data < 0) {\n                return encodeLength(MAJOR_TYPE_NEGATIVE_INTEGER, Math.abs(data));\n            }\n            else {\n                return encodeLength(MAJOR_TYPE_UNSIGNED_INTEGER, data);\n            }\n        }\n        return [encodeFloat(data)];\n    }\n    else {\n        if (data < 0n) {\n            return encodeLength(MAJOR_TYPE_NEGATIVE_INTEGER, data * -1n);\n        }\n        else {\n            return encodeLength(MAJOR_TYPE_UNSIGNED_INTEGER, data);\n        }\n    }\n}\nconst ENCODER = new TextEncoder();\nfunction encodeString(data, output) {\n    output.push(...encodeLength(MAJOR_TYPE_TEXT_STRING, data.length));\n    output.push(ENCODER.encode(data));\n}\nfunction encodeBytes(data, output) {\n    output.push(...encodeLength(MAJOR_TYPE_BYTE_STRING, data.length));\n    output.push(data);\n}\nfunction encodeArray(data, output) {\n    output.push(...encodeLength(MAJOR_TYPE_ARRAY, data.length));\n    for (const element of data) {\n        encodePartialCBOR(element, output);\n    }\n}\nfunction encodeMap(data, output) {\n    output.push(new Uint8Array(encodeLength(MAJOR_TYPE_MAP, data.size)));\n    for (const [key, value] of data.entries()) {\n        encodePartialCBOR(key, output);\n        encodePartialCBOR(value, output);\n    }\n}\nfunction encodeTag(tag, output) {\n    output.push(...encodeLength(MAJOR_TYPE_TAG, tag.tag));\n    encodePartialCBOR(tag.value, output);\n}\nfunction encodePartialCBOR(data, output) {\n    if (typeof data == \"boolean\" || data === null || data == undefined) {\n        output.push(encodeSimple(data));\n        return;\n    }\n    if (typeof data == \"number\" || typeof data == \"bigint\") {\n        output.push(...encodeNumber(data));\n        return;\n    }\n    if (typeof data == \"string\") {\n        encodeString(data, output);\n        return;\n    }\n    if (data instanceof Uint8Array) {\n        encodeBytes(data, output);\n        return;\n    }\n    if (Array.isArray(data)) {\n        encodeArray(data, output);\n        return;\n    }\n    if (data instanceof Map) {\n        encodeMap(data, output);\n        return;\n    }\n    if (data instanceof CBORTag) {\n        encodeTag(data, output);\n        return;\n    }\n    throw new Error(\"Not implemented\");\n}\n/**\n * Like {decodeCBOR}, but the length of the data is unknown and there is likely\n * more -- possibly unrelated non-CBOR -- data afterwards.\n *\n * Examples:\n *\n * ```ts\n * import {decodePartialCBOR} from './cbor.ts'\n * decodePartialCBOR(new Uint8Array([1, 2, 245, 3, 4]), 2)\n * // returns [true, 1]\n * // It did not decode the leading [1, 2] or trailing [3, 4]\n * ```\n *\n * @param data a data stream to read data from\n * @param index where to start reading in the data stream\n * @returns a tuple of the value followed by bytes read.\n * @throws {Error}\n *   When the data stream ends early or the CBOR data is not well formed\n */\nexport function decodePartialCBOR(data, index) {\n    if (data.byteLength === 0 || data.byteLength <= index || index < 0) {\n        throw new Error(\"No data\");\n    }\n    if (data instanceof Uint8Array) {\n        return decodeNext(new DataView(data.buffer), index);\n    }\n    else if (data instanceof ArrayBuffer) {\n        return decodeNext(new DataView(data), index);\n    }\n    // otherwise, it is a data view\n    return decodeNext(data, index);\n}\n/**\n * Decode CBOR data from a binary stream\n *\n * The entire data stream from [0, length) will be consumed.\n * If you require a partial decoding, see {decodePartialCBOR}.\n *\n * Examples:\n *\n * ```ts\n * import {decodeCBOR, CBORTag, CBORType} from './cbor.ts'\n * decodeCBOR(new Uint8Array([162, 99, 107, 101, 121, 101, 118, 97, 108, 117, 101, 1, 109, 97, 110, 111, 116, 104, 101, 114, 32, 118, 97, 108, 117, 101]));\n * // returns new Map<string | number, CBORType>([\n * //   [\"key\", \"value\"],\n * //   [1, \"another value\"]\n * // ]);\n *\n * const taggedItem = new Uint8Array([217, 4, 210, 101, 104, 101, 108, 108, 111]);\n * decodeCBOR(new DataView(taggedItem.buffer))\n * // returns new CBORTag(1234, \"hello\")\n * ```\n *\n * @param data a data stream, multiple types are supported\n * @returns\n */\nexport function decodeCBOR(data) {\n    const [value, length] = decodePartialCBOR(data, 0);\n    if (length !== data.byteLength) {\n        throw new Error(`Data was decoded, but the whole stream was not processed ${length} != ${data.byteLength}`);\n    }\n    return value;\n}\n/**\n * Encode a supported structure to a CBOR byte string.\n *\n * Example:\n *\n * ```ts\n * import {encodeCBOR, CBORType, CBORTag} from './cbor.ts'\n * encodeCBOR(new Map<string | number, CBORType>([\n *   [\"key\", \"value\"],\n *   [1, \"another value\"]\n * ]));\n * // returns new Uint8Array([162, 99, 107, 101, 121, 101, 118, 97, 108, 117, 101, 1, 109, 97, 110, 111, 116, 104, 101, 114, 32 118, 97, 108, 117, 101])\n *\n * encodeCBOR(new CBORTag(1234, \"hello\"))\n * // returns new UInt8Array([217, 4, 210, 101, 104, 101, 108, 108, 111])\n * ```\n *\n * @param data Data to encode\n * @returns A byte string as a Uint8Array\n * @throws Error\n *   if unsupported data is found during encoding\n */\nexport function encodeCBOR(data) {\n    const results = [];\n    encodePartialCBOR(data, results);\n    let length = 0;\n    for (const result of results) {\n        if (typeof result == \"number\") {\n            length += 1;\n        }\n        else {\n            length += result.length;\n        }\n    }\n    const output = new Uint8Array(length);\n    let index = 0;\n    for (const result of results) {\n        if (typeof result == \"number\") {\n            output[index] = result;\n            index += 1;\n        }\n        else {\n            output.set(result, index);\n            index += result.length;\n        }\n    }\n    return output;\n}\n","/**\n * A runtime-agnostic collection of methods for working with CBOR encoding\n * @module\n */\nimport * as tinyCbor from '@levischuck/tiny-cbor';\n/**\n * Whatever CBOR encoder is used should keep CBOR data the same length when data is re-encoded\n *\n * MOST CRITICALLY, this means the following needs to be true of whatever CBOR library we use:\n * - CBOR Map type values MUST decode to JavaScript Maps\n * - CBOR tag 64 (uint8 Typed Array) MUST NOT be used when encoding Uint8Arrays back to CBOR\n *\n * So long as these requirements are maintained, then CBOR sequences can be encoded and decoded\n * freely while maintaining their lengths for the most accurate pointer movement across them.\n */\n/**\n * Decode and return the first item in a sequence of CBOR-encoded values\n *\n * @param input The CBOR data to decode\n * @param asObject (optional) Whether to convert any CBOR Maps into JavaScript Objects. Defaults to\n * `false`\n */\nexport function decodeFirst(input) {\n    // Make a copy so we don't mutate the original\n    const _input = new Uint8Array(input);\n    const decoded = tinyCbor.decodePartialCBOR(_input, 0);\n    const [first] = decoded;\n    return first;\n}\n/**\n * Encode data to CBOR\n */\nexport function encode(input) {\n    return tinyCbor.encodeCBOR(input);\n}\n","/**\n * A type guard for determining if a COSE public key is an OKP key pair\n */\nexport function isCOSEPublicKeyOKP(cosePublicKey) {\n    const kty = cosePublicKey.get(COSEKEYS.kty);\n    return isCOSEKty(kty) && kty === COSEKTY.OKP;\n}\n/**\n * A type guard for determining if a COSE public key is an EC2 key pair\n */\nexport function isCOSEPublicKeyEC2(cosePublicKey) {\n    const kty = cosePublicKey.get(COSEKEYS.kty);\n    return isCOSEKty(kty) && kty === COSEKTY.EC2;\n}\n/**\n * A type guard for determining if a COSE public key is an RSA key pair\n */\nexport function isCOSEPublicKeyRSA(cosePublicKey) {\n    const kty = cosePublicKey.get(COSEKEYS.kty);\n    return isCOSEKty(kty) && kty === COSEKTY.RSA;\n}\n/**\n * A type guard for determining if a COSE public key is an AKP key pair\n */\nexport function isCOSEPublicKeyAKP(cosePublicKey) {\n    const kty = cosePublicKey.get(COSEKEYS.kty);\n    return isCOSEKty(kty) && kty === COSEKTY.AKP;\n}\n/**\n * COSE Keys\n *\n * https://www.iana.org/assignments/cose/cose.xhtml#key-common-parameters\n * https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters\n */\nexport var COSEKEYS;\n(function (COSEKEYS) {\n    COSEKEYS[COSEKEYS[\"kty\"] = 1] = \"kty\";\n    COSEKEYS[COSEKEYS[\"alg\"] = 3] = \"alg\";\n    COSEKEYS[COSEKEYS[\"crv\"] = -1] = \"crv\";\n    COSEKEYS[COSEKEYS[\"x\"] = -2] = \"x\";\n    COSEKEYS[COSEKEYS[\"y\"] = -3] = \"y\";\n    COSEKEYS[COSEKEYS[\"n\"] = -1] = \"n\";\n    COSEKEYS[COSEKEYS[\"e\"] = -2] = \"e\";\n    COSEKEYS[COSEKEYS[\"pub\"] = -1] = \"pub\";\n})(COSEKEYS || (COSEKEYS = {}));\n/**\n * COSE Key Types\n *\n * https://www.iana.org/assignments/cose/cose.xhtml#key-type\n */\nexport var COSEKTY;\n(function (COSEKTY) {\n    COSEKTY[COSEKTY[\"OKP\"] = 1] = \"OKP\";\n    COSEKTY[COSEKTY[\"EC2\"] = 2] = \"EC2\";\n    COSEKTY[COSEKTY[\"RSA\"] = 3] = \"RSA\";\n    COSEKTY[COSEKTY[\"AKP\"] = 7] = \"AKP\";\n})(COSEKTY || (COSEKTY = {}));\nexport function isCOSEKty(kty) {\n    return Object.values(COSEKTY).indexOf(kty) >= 0;\n}\n/**\n * COSE Curves\n *\n * https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves\n */\nexport var COSECRV;\n(function (COSECRV) {\n    COSECRV[COSECRV[\"P256\"] = 1] = \"P256\";\n    COSECRV[COSECRV[\"P384\"] = 2] = \"P384\";\n    COSECRV[COSECRV[\"P521\"] = 3] = \"P521\";\n    COSECRV[COSECRV[\"ED25519\"] = 6] = \"ED25519\";\n    COSECRV[COSECRV[\"SECP256K1\"] = 8] = \"SECP256K1\";\n})(COSECRV || (COSECRV = {}));\nexport function isCOSECrv(crv) {\n    return Object.values(COSECRV).indexOf(crv) >= 0;\n}\n/**\n * COSE Algorithms\n *\n * https://www.iana.org/assignments/cose/cose.xhtml#algorithms\n */\nexport var COSEALG;\n(function (COSEALG) {\n    COSEALG[COSEALG[\"ES256\"] = -7] = \"ES256\";\n    COSEALG[COSEALG[\"EdDSA\"] = -8] = \"EdDSA\";\n    COSEALG[COSEALG[\"ES384\"] = -35] = \"ES384\";\n    COSEALG[COSEALG[\"ES512\"] = -36] = \"ES512\";\n    COSEALG[COSEALG[\"PS256\"] = -37] = \"PS256\";\n    COSEALG[COSEALG[\"PS384\"] = -38] = \"PS384\";\n    COSEALG[COSEALG[\"PS512\"] = -39] = \"PS512\";\n    COSEALG[COSEALG[\"ES256K\"] = -47] = \"ES256K\";\n    COSEALG[COSEALG[\"ML_DSA_44\"] = -48] = \"ML_DSA_44\";\n    COSEALG[COSEALG[\"ML_DSA_65\"] = -49] = \"ML_DSA_65\";\n    COSEALG[COSEALG[\"ML_DSA_87\"] = -50] = \"ML_DSA_87\";\n    COSEALG[COSEALG[\"RS256\"] = -257] = \"RS256\";\n    COSEALG[COSEALG[\"RS384\"] = -258] = \"RS384\";\n    COSEALG[COSEALG[\"RS512\"] = -259] = \"RS512\";\n    COSEALG[COSEALG[\"RS1\"] = -65535] = \"RS1\";\n})(COSEALG || (COSEALG = {}));\nexport function isCOSEAlg(alg) {\n    return Object.values(COSEALG).indexOf(alg) >= 0;\n}\nexport function isPQCCOSEAlg(alg) {\n    return [COSEALG.ML_DSA_44, COSEALG.ML_DSA_65, COSEALG.ML_DSA_87].indexOf(alg) >= 0;\n}\n","import { COSEALG } from '../../cose.js';\n/**\n * Convert a COSE alg ID into a corresponding hash algorithm string value that WebCrypto APIs expect\n *\n * Unless otherwise specified, mappings were referenced from\n * https://w3c.github.io/webcrypto/#jwk-mapping-alg\n */\nexport function mapCoseAlgToWebCryptoHashAlgName(alg) {\n    if ([COSEALG.RS1].indexOf(alg) >= 0) {\n        return 'SHA-1';\n    }\n    else if ([COSEALG.ES256, COSEALG.PS256, COSEALG.RS256].indexOf(alg) >= 0) {\n        return 'SHA-256';\n    }\n    else if ([COSEALG.ES384, COSEALG.PS384, COSEALG.RS384].indexOf(alg) >= 0) {\n        return 'SHA-384';\n    }\n    else if ([COSEALG.ES512, COSEALG.PS512, COSEALG.RS512, COSEALG.EdDSA].indexOf(alg) >=\n        0) {\n        return 'SHA-512';\n    }\n    throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto hash alg name`);\n}\n","let webCrypto = undefined;\n/**\n * Try to get an instance of the Crypto API from the current runtime. Should support Node,\n * as well as others, like Deno, that implement Web APIs.\n */\nexport function getWebCrypto() {\n    /**\n     * Hello there! If you came here wondering why this method is asynchronous when use of\n     * `globalThis.crypto` is not, it's to minimize a bunch of refactor related to making this\n     * synchronous. For example, `generateRegistrationOptions()` and `generateAuthenticationOptions()`\n     * become synchronous if we make this synchronous (since nothing else in that method is async)\n     * which represents a breaking API change in this library's core API.\n     *\n     * TODO: If it's after February 2025 when you read this then consider whether it still makes sense\n     * to keep this method asynchronous.\n     */\n    const toResolve = new Promise((resolve, reject) => {\n        if (webCrypto) {\n            return resolve(webCrypto);\n        }\n        /**\n         * Naively attempt to access Crypto as a global object, which popular ESM-centric run-times\n         * support (and Node v20+)\n         */\n        const _globalThisCrypto = _getWebCryptoInternals.stubThisGlobalThisCrypto();\n        if (_globalThisCrypto) {\n            /**\n             * In Deno v2.7.x, TypeScript 5.9 defines `Crypto.getRandomValues()` as the following type:\n             *\n             * `getRandomValues<T extends ArrayBufferView>(array: T): T;`\n             *\n             * However in earlier versions of TypeScript, `Crypto.getRandomValues()` is defined as such:\n             *\n             * `getRandomValues<T extends ArrayBufferView | null>(array: T): T;`\n             *\n             * Casting to `as unknown as Crypto` here (using this project's `Crypto` types extracted from\n             * DOM types in an older, minimum-supported-Deno version of TypeScript) helps bridge the gap.\n             */\n            webCrypto = _globalThisCrypto;\n            return resolve(webCrypto);\n        }\n        // We tried to access it both in Node and globally, so bail out\n        return reject(new MissingWebCrypto());\n    });\n    return toResolve;\n}\nexport class MissingWebCrypto extends Error {\n    constructor() {\n        const message = 'An instance of the Crypto API could not be located';\n        super(message);\n        this.name = 'MissingWebCrypto';\n    }\n}\n// Make it possible to stub return values during testing\nexport const _getWebCryptoInternals = {\n    stubThisGlobalThisCrypto: () => globalThis.crypto,\n    // Make it possible to reset the `webCrypto` at the top of the file\n    setCachedCrypto: (newCrypto) => {\n        webCrypto = newCrypto;\n    },\n};\n","import { mapCoseAlgToWebCryptoHashAlgName } from './mapCoseAlgToWebCryptoHashAlgName.js';\nimport { getWebCrypto } from './getWebCrypto.js';\n/**\n * Generate a digest of the provided data.\n *\n * @param data The data to generate a digest of\n * @param algorithm A COSE algorithm ID that maps to a desired SHA algorithm\n */\nexport async function digest(data, algorithm) {\n    const WebCrypto = await getWebCrypto();\n    const subtleAlgorithm = mapCoseAlgToWebCryptoHashAlgName(algorithm);\n    const hashed = await WebCrypto.subtle.digest(subtleAlgorithm, data);\n    return new Uint8Array(hashed);\n}\n","import { getWebCrypto } from './getWebCrypto.js';\n/**\n * Fill up the provided bytes array with random bytes equal to its length.\n *\n * @returns the same bytes array passed into the method\n */\nexport async function getRandomValues(array) {\n    const WebCrypto = await getWebCrypto();\n    WebCrypto.getRandomValues(array);\n    return array;\n}\n","import { isoUint8Array } from './iso/index.js';\n/**\n * Convert the aaguid buffer in authData into a UUID string\n */\nexport function convertAAGUIDToString(aaguid) {\n    // Raw Hex: adce000235bcc60a648b0b25f1f05503\n    const hex = isoUint8Array.toHex(aaguid);\n    const segments = [\n        hex.slice(0, 8), // 8\n        hex.slice(8, 12), // 4\n        hex.slice(12, 16), // 4\n        hex.slice(16, 20), // 4\n        hex.slice(20, 32), // 8\n    ];\n    // Formatted: adce0002-35bc-c60a-648b-0b25f1f05503\n    return segments.join('-');\n}\n","import { isoCBOR, isoUint8Array } from './iso/index.js';\nimport { COSEKEYS } from './cose.js';\n/**\n * Takes COSE-encoded public key and converts it to PKCS key\n */\nexport function convertCOSEtoPKCS(cosePublicKey) {\n    // This is a little sloppy, I'm using COSEPublicKeyEC2 since it could have both x and y, but when\n    // there's no y it means it's probably better typed as COSEPublicKeyOKP. I'll leave this for now\n    // and revisit it later if it ever becomes an actual problem.\n    const struct = isoCBOR.decodeFirst(cosePublicKey);\n    const tag = Uint8Array.from([0x04]);\n    const x = struct.get(COSEKEYS.x);\n    const y = struct.get(COSEKEYS.y);\n    if (!x) {\n        throw new Error('COSE public key was missing x');\n    }\n    if (y) {\n        return isoUint8Array.concat([tag, x, y]);\n    }\n    return isoUint8Array.concat([tag, x]);\n}\n","import { isoCBOR } from './iso/index.js';\n/**\n * Convert an AttestationObject buffer to a proper object\n *\n * @param base64AttestationObject Attestation Object buffer\n */\nexport function decodeAttestationObject(attestationObject) {\n    return _decodeAttestationObjectInternals.stubThis(isoCBOR.decodeFirst(attestationObject));\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _decodeAttestationObjectInternals = {\n    stubThis: (value) => value,\n};\n","import { isoBase64URL } from './iso/index.js';\n/**\n * Decode an authenticator's base64url-encoded clientDataJSON to JSON\n */\nexport function decodeClientDataJSON(data) {\n    const toString = isoBase64URL.toUTF8String(data);\n    const clientData = JSON.parse(toString);\n    return _decodeClientDataJSONInternals.stubThis(clientData);\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _decodeClientDataJSONInternals = {\n    stubThis: (value) => value,\n};\n","import { isoCBOR } from './iso/index.js';\nexport function decodeCredentialPublicKey(publicKey) {\n    return _decodeCredentialPublicKeyInternals.stubThis(isoCBOR.decodeFirst(publicKey));\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _decodeCredentialPublicKeyInternals = {\n    stubThis: (value) => value,\n};\n","import { isoCrypto } from './iso/index.js';\n/**\n * Generate a suitably random value to be used as an attestation or assertion challenge\n */\nexport async function generateChallenge() {\n    /**\n     * WebAuthn spec says that 16 bytes is a good minimum:\n     *\n     * \"In order to prevent replay attacks, the challenges MUST contain enough entropy to make\n     * guessing them infeasible. Challenges SHOULD therefore be at least 16 bytes long.\"\n     *\n     * Just in case, let's double it\n     */\n    const challenge = new Uint8Array(32);\n    await isoCrypto.getRandomValues(challenge);\n    return _generateChallengeInternals.stubThis(challenge);\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _generateChallengeInternals = {\n    stubThis: (value) => value,\n};\n","import { isoCrypto } from './iso/index.js';\n/**\n * Generate a suitably random value to be used as user ID\n */\nexport async function generateUserID() {\n    /**\n     * WebAuthn spec says user.id has a max length of 64 bytes. I prefer how 32 random bytes look\n     * after they're base64url-encoded so I'm choosing to go with that here.\n     */\n    const newUserID = new Uint8Array(32);\n    await isoCrypto.getRandomValues(newUserID);\n    return _generateUserIDInternals.stubThis(newUserID);\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _generateUserIDInternals = {\n    stubThis: (value) => value,\n};\n","/*!\n * MIT License\n * \n * Copyright (c) 2017-2024 Peculiar Ventures, LLC\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n */\n\nconst ARRAY_BUFFER_NAME = \"[object ArrayBuffer]\";\nclass BufferSourceConverter {\n    static isArrayBuffer(data) {\n        return Object.prototype.toString.call(data) === ARRAY_BUFFER_NAME;\n    }\n    static toArrayBuffer(data) {\n        if (this.isArrayBuffer(data)) {\n            return data;\n        }\n        if (data.byteLength === data.buffer.byteLength) {\n            return data.buffer;\n        }\n        if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {\n            return data.buffer;\n        }\n        return this.toUint8Array(data.buffer)\n            .slice(data.byteOffset, data.byteOffset + data.byteLength)\n            .buffer;\n    }\n    static toUint8Array(data) {\n        return this.toView(data, Uint8Array);\n    }\n    static toView(data, type) {\n        if (data.constructor === type) {\n            return data;\n        }\n        if (this.isArrayBuffer(data)) {\n            return new type(data);\n        }\n        if (this.isArrayBufferView(data)) {\n            return new type(data.buffer, data.byteOffset, data.byteLength);\n        }\n        throw new TypeError(\"The provided value is not of type '(ArrayBuffer or ArrayBufferView)'\");\n    }\n    static isBufferSource(data) {\n        return this.isArrayBufferView(data)\n            || this.isArrayBuffer(data);\n    }\n    static isArrayBufferView(data) {\n        return ArrayBuffer.isView(data)\n            || (data && this.isArrayBuffer(data.buffer));\n    }\n    static isEqual(a, b) {\n        const aView = BufferSourceConverter.toUint8Array(a);\n        const bView = BufferSourceConverter.toUint8Array(b);\n        if (aView.length !== bView.byteLength) {\n            return false;\n        }\n        for (let i = 0; i < aView.length; i++) {\n            if (aView[i] !== bView[i]) {\n                return false;\n            }\n        }\n        return true;\n    }\n    static concat(...args) {\n        let buffers;\n        if (Array.isArray(args[0]) && !(args[1] instanceof Function)) {\n            buffers = args[0];\n        }\n        else if (Array.isArray(args[0]) && args[1] instanceof Function) {\n            buffers = args[0];\n        }\n        else {\n            if (args[args.length - 1] instanceof Function) {\n                buffers = args.slice(0, args.length - 1);\n            }\n            else {\n                buffers = args;\n            }\n        }\n        let size = 0;\n        for (const buffer of buffers) {\n            size += buffer.byteLength;\n        }\n        const res = new Uint8Array(size);\n        let offset = 0;\n        for (const buffer of buffers) {\n            const view = this.toUint8Array(buffer);\n            res.set(view, offset);\n            offset += view.length;\n        }\n        if (args[args.length - 1] instanceof Function) {\n            return this.toView(res, args[args.length - 1]);\n        }\n        return res.buffer;\n    }\n}\n\nconst STRING_TYPE = \"string\";\nconst HEX_REGEX = /^[0-9a-f\\s]+$/i;\nconst BASE64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\nconst BASE64URL_REGEX = /^[a-zA-Z0-9-_]+$/;\nclass Utf8Converter {\n    static fromString(text) {\n        const s = unescape(encodeURIComponent(text));\n        const uintArray = new Uint8Array(s.length);\n        for (let i = 0; i < s.length; i++) {\n            uintArray[i] = s.charCodeAt(i);\n        }\n        return uintArray.buffer;\n    }\n    static toString(buffer) {\n        const buf = BufferSourceConverter.toUint8Array(buffer);\n        let encodedString = \"\";\n        for (let i = 0; i < buf.length; i++) {\n            encodedString += String.fromCharCode(buf[i]);\n        }\n        const decodedString = decodeURIComponent(escape(encodedString));\n        return decodedString;\n    }\n}\nclass Utf16Converter {\n    static toString(buffer, littleEndian = false) {\n        const arrayBuffer = BufferSourceConverter.toArrayBuffer(buffer);\n        const dataView = new DataView(arrayBuffer);\n        let res = \"\";\n        for (let i = 0; i < arrayBuffer.byteLength; i += 2) {\n            const code = dataView.getUint16(i, littleEndian);\n            res += String.fromCharCode(code);\n        }\n        return res;\n    }\n    static fromString(text, littleEndian = false) {\n        const res = new ArrayBuffer(text.length * 2);\n        const dataView = new DataView(res);\n        for (let i = 0; i < text.length; i++) {\n            dataView.setUint16(i * 2, text.charCodeAt(i), littleEndian);\n        }\n        return res;\n    }\n}\nclass Convert {\n    static isHex(data) {\n        return typeof data === STRING_TYPE\n            && HEX_REGEX.test(data);\n    }\n    static isBase64(data) {\n        return typeof data === STRING_TYPE\n            && BASE64_REGEX.test(data);\n    }\n    static isBase64Url(data) {\n        return typeof data === STRING_TYPE\n            && BASE64URL_REGEX.test(data);\n    }\n    static ToString(buffer, enc = \"utf8\") {\n        const buf = BufferSourceConverter.toUint8Array(buffer);\n        switch (enc.toLowerCase()) {\n            case \"utf8\":\n                return this.ToUtf8String(buf);\n            case \"binary\":\n                return this.ToBinary(buf);\n            case \"hex\":\n                return this.ToHex(buf);\n            case \"base64\":\n                return this.ToBase64(buf);\n            case \"base64url\":\n                return this.ToBase64Url(buf);\n            case \"utf16le\":\n                return Utf16Converter.toString(buf, true);\n            case \"utf16\":\n            case \"utf16be\":\n                return Utf16Converter.toString(buf);\n            default:\n                throw new Error(`Unknown type of encoding '${enc}'`);\n        }\n    }\n    static FromString(str, enc = \"utf8\") {\n        if (!str) {\n            return new ArrayBuffer(0);\n        }\n        switch (enc.toLowerCase()) {\n            case \"utf8\":\n                return this.FromUtf8String(str);\n            case \"binary\":\n                return this.FromBinary(str);\n            case \"hex\":\n                return this.FromHex(str);\n            case \"base64\":\n                return this.FromBase64(str);\n            case \"base64url\":\n                return this.FromBase64Url(str);\n            case \"utf16le\":\n                return Utf16Converter.fromString(str, true);\n            case \"utf16\":\n            case \"utf16be\":\n                return Utf16Converter.fromString(str);\n            default:\n                throw new Error(`Unknown type of encoding '${enc}'`);\n        }\n    }\n    static ToBase64(buffer) {\n        const buf = BufferSourceConverter.toUint8Array(buffer);\n        if (typeof btoa !== \"undefined\") {\n            const binary = this.ToString(buf, \"binary\");\n            return btoa(binary);\n        }\n        else {\n            return Buffer.from(buf).toString(\"base64\");\n        }\n    }\n    static FromBase64(base64) {\n        const formatted = this.formatString(base64);\n        if (!formatted) {\n            return new ArrayBuffer(0);\n        }\n        if (!Convert.isBase64(formatted)) {\n            throw new TypeError(\"Argument 'base64Text' is not Base64 encoded\");\n        }\n        if (typeof atob !== \"undefined\") {\n            return this.FromBinary(atob(formatted));\n        }\n        else {\n            return new Uint8Array(Buffer.from(formatted, \"base64\")).buffer;\n        }\n    }\n    static FromBase64Url(base64url) {\n        const formatted = this.formatString(base64url);\n        if (!formatted) {\n            return new ArrayBuffer(0);\n        }\n        if (!Convert.isBase64Url(formatted)) {\n            throw new TypeError(\"Argument 'base64url' is not Base64Url encoded\");\n        }\n        return this.FromBase64(this.Base64Padding(formatted.replace(/\\-/g, \"+\").replace(/\\_/g, \"/\")));\n    }\n    static ToBase64Url(data) {\n        return this.ToBase64(data).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/\\=/g, \"\");\n    }\n    static FromUtf8String(text, encoding = Convert.DEFAULT_UTF8_ENCODING) {\n        switch (encoding) {\n            case \"ascii\":\n                return this.FromBinary(text);\n            case \"utf8\":\n                return Utf8Converter.fromString(text);\n            case \"utf16\":\n            case \"utf16be\":\n                return Utf16Converter.fromString(text);\n            case \"utf16le\":\n            case \"usc2\":\n                return Utf16Converter.fromString(text, true);\n            default:\n                throw new Error(`Unknown type of encoding '${encoding}'`);\n        }\n    }\n    static ToUtf8String(buffer, encoding = Convert.DEFAULT_UTF8_ENCODING) {\n        switch (encoding) {\n            case \"ascii\":\n                return this.ToBinary(buffer);\n            case \"utf8\":\n                return Utf8Converter.toString(buffer);\n            case \"utf16\":\n            case \"utf16be\":\n                return Utf16Converter.toString(buffer);\n            case \"utf16le\":\n            case \"usc2\":\n                return Utf16Converter.toString(buffer, true);\n            default:\n                throw new Error(`Unknown type of encoding '${encoding}'`);\n        }\n    }\n    static FromBinary(text) {\n        const stringLength = text.length;\n        const resultView = new Uint8Array(stringLength);\n        for (let i = 0; i < stringLength; i++) {\n            resultView[i] = text.charCodeAt(i);\n        }\n        return resultView.buffer;\n    }\n    static ToBinary(buffer) {\n        const buf = BufferSourceConverter.toUint8Array(buffer);\n        let res = \"\";\n        for (let i = 0; i < buf.length; i++) {\n            res += String.fromCharCode(buf[i]);\n        }\n        return res;\n    }\n    static ToHex(buffer) {\n        const buf = BufferSourceConverter.toUint8Array(buffer);\n        let result = \"\";\n        const len = buf.length;\n        for (let i = 0; i < len; i++) {\n            const byte = buf[i];\n            if (byte < 16) {\n                result += \"0\";\n            }\n            result += byte.toString(16);\n        }\n        return result;\n    }\n    static FromHex(hexString) {\n        let formatted = this.formatString(hexString);\n        if (!formatted) {\n            return new ArrayBuffer(0);\n        }\n        if (!Convert.isHex(formatted)) {\n            throw new TypeError(\"Argument 'hexString' is not HEX encoded\");\n        }\n        if (formatted.length % 2) {\n            formatted = `0${formatted}`;\n        }\n        const res = new Uint8Array(formatted.length / 2);\n        for (let i = 0; i < formatted.length; i = i + 2) {\n            const c = formatted.slice(i, i + 2);\n            res[i / 2] = parseInt(c, 16);\n        }\n        return res.buffer;\n    }\n    static ToUtf16String(buffer, littleEndian = false) {\n        return Utf16Converter.toString(buffer, littleEndian);\n    }\n    static FromUtf16String(text, littleEndian = false) {\n        return Utf16Converter.fromString(text, littleEndian);\n    }\n    static Base64Padding(base64) {\n        const padCount = 4 - (base64.length % 4);\n        if (padCount < 4) {\n            for (let i = 0; i < padCount; i++) {\n                base64 += \"=\";\n            }\n        }\n        return base64;\n    }\n    static formatString(data) {\n        return (data === null || data === void 0 ? void 0 : data.replace(/[\\n\\r\\t ]/g, \"\")) || \"\";\n    }\n}\nConvert.DEFAULT_UTF8_ENCODING = \"utf8\";\n\nfunction assign(target, ...sources) {\n    const res = arguments[0];\n    for (let i = 1; i < arguments.length; i++) {\n        const obj = arguments[i];\n        for (const prop in obj) {\n            res[prop] = obj[prop];\n        }\n    }\n    return res;\n}\nfunction combine(...buf) {\n    const totalByteLength = buf.map((item) => item.byteLength).reduce((prev, cur) => prev + cur);\n    const res = new Uint8Array(totalByteLength);\n    let currentPos = 0;\n    buf.map((item) => new Uint8Array(item)).forEach((arr) => {\n        for (const item2 of arr) {\n            res[currentPos++] = item2;\n        }\n    });\n    return res.buffer;\n}\nfunction isEqual(bytes1, bytes2) {\n    if (!(bytes1 && bytes2)) {\n        return false;\n    }\n    if (bytes1.byteLength !== bytes2.byteLength) {\n        return false;\n    }\n    const b1 = new Uint8Array(bytes1);\n    const b2 = new Uint8Array(bytes2);\n    for (let i = 0; i < bytes1.byteLength; i++) {\n        if (b1[i] !== b2[i]) {\n            return false;\n        }\n    }\n    return true;\n}\n\nexport { BufferSourceConverter, Convert, assign, combine, isEqual };\n","/*!\n Copyright (c) Peculiar Ventures, LLC\n*/\n\nfunction getUTCDate(date) {\n    return new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n}\nfunction getParametersValue(parameters, name, defaultValue) {\n    var _a;\n    if (parameters instanceof Object === false) {\n        return defaultValue;\n    }\n    return (_a = parameters[name]) !== null && _a !== void 0 ? _a : defaultValue;\n}\nfunction bufferToHexCodes(inputBuffer, inputOffset = 0, inputLength = inputBuffer.byteLength - inputOffset, insertSpace = false) {\n    let result = \"\";\n    for (const item of new Uint8Array(inputBuffer, inputOffset, inputLength)) {\n        const str = item.toString(16).toUpperCase();\n        if (str.length === 1) {\n            result += \"0\";\n        }\n        result += str;\n        if (insertSpace) {\n            result += \" \";\n        }\n    }\n    return result.trim();\n}\nfunction checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength) {\n    if (!(inputBuffer instanceof ArrayBuffer)) {\n        baseBlock.error = 'Wrong parameter: inputBuffer must be \"ArrayBuffer\"';\n        return false;\n    }\n    if (!inputBuffer.byteLength) {\n        baseBlock.error = \"Wrong parameter: inputBuffer has zero length\";\n        return false;\n    }\n    if (inputOffset < 0) {\n        baseBlock.error = \"Wrong parameter: inputOffset less than zero\";\n        return false;\n    }\n    if (inputLength < 0) {\n        baseBlock.error = \"Wrong parameter: inputLength less than zero\";\n        return false;\n    }\n    if (inputBuffer.byteLength - inputOffset - inputLength < 0) {\n        baseBlock.error =\n            \"End of input reached before message was fully decoded (inconsistent offset and length values)\";\n        return false;\n    }\n    return true;\n}\nfunction utilFromBase(inputBuffer, inputBase) {\n    let result = 0;\n    if (inputBuffer.length === 1) {\n        return inputBuffer[0];\n    }\n    for (let i = inputBuffer.length - 1; i >= 0; i--) {\n        result += inputBuffer[inputBuffer.length - 1 - i] * Math.pow(2, inputBase * i);\n    }\n    return result;\n}\nfunction utilToBase(value, base, reserved = -1) {\n    const internalReserved = reserved;\n    let internalValue = value;\n    let result = 0;\n    let biggest = Math.pow(2, base);\n    for (let i = 1; i < 8; i++) {\n        if (value < biggest) {\n            let retBuf;\n            if (internalReserved < 0) {\n                retBuf = new ArrayBuffer(i);\n                result = i;\n            }\n            else {\n                if (internalReserved < i) {\n                    return new ArrayBuffer(0);\n                }\n                retBuf = new ArrayBuffer(internalReserved);\n                result = internalReserved;\n            }\n            const retView = new Uint8Array(retBuf);\n            for (let j = i - 1; j >= 0; j--) {\n                const basis = Math.pow(2, j * base);\n                retView[result - j - 1] = Math.floor(internalValue / basis);\n                internalValue -= retView[result - j - 1] * basis;\n            }\n            return retBuf;\n        }\n        biggest *= Math.pow(2, base);\n    }\n    return new ArrayBuffer(0);\n}\nfunction utilConcatBuf(...buffers) {\n    let outputLength = 0;\n    let prevLength = 0;\n    for (const buffer of buffers) {\n        outputLength += buffer.byteLength;\n    }\n    const retBuf = new ArrayBuffer(outputLength);\n    const retView = new Uint8Array(retBuf);\n    for (const buffer of buffers) {\n        retView.set(new Uint8Array(buffer), prevLength);\n        prevLength += buffer.byteLength;\n    }\n    return retBuf;\n}\nfunction utilConcatView(...views) {\n    let outputLength = 0;\n    let prevLength = 0;\n    for (const view of views) {\n        outputLength += view.length;\n    }\n    const retBuf = new ArrayBuffer(outputLength);\n    const retView = new Uint8Array(retBuf);\n    for (const view of views) {\n        retView.set(view, prevLength);\n        prevLength += view.length;\n    }\n    return retView;\n}\nfunction utilDecodeTC() {\n    const buf = new Uint8Array(this.valueHex);\n    if (this.valueHex.byteLength >= 2) {\n        const condition1 = buf[0] === 0xff && buf[1] & 0x80;\n        const condition2 = buf[0] === 0x00 && (buf[1] & 0x80) === 0x00;\n        if (condition1 || condition2) {\n            this.warnings.push(\"Needlessly long format\");\n        }\n    }\n    const bigIntBuffer = new ArrayBuffer(this.valueHex.byteLength);\n    const bigIntView = new Uint8Array(bigIntBuffer);\n    for (let i = 0; i < this.valueHex.byteLength; i++) {\n        bigIntView[i] = 0;\n    }\n    bigIntView[0] = buf[0] & 0x80;\n    const bigInt = utilFromBase(bigIntView, 8);\n    const smallIntBuffer = new ArrayBuffer(this.valueHex.byteLength);\n    const smallIntView = new Uint8Array(smallIntBuffer);\n    for (let j = 0; j < this.valueHex.byteLength; j++) {\n        smallIntView[j] = buf[j];\n    }\n    smallIntView[0] &= 0x7f;\n    const smallInt = utilFromBase(smallIntView, 8);\n    return smallInt - bigInt;\n}\nfunction utilEncodeTC(value) {\n    const modValue = value < 0 ? value * -1 : value;\n    let bigInt = 128;\n    for (let i = 1; i < 8; i++) {\n        if (modValue <= bigInt) {\n            if (value < 0) {\n                const smallInt = bigInt - modValue;\n                const retBuf = utilToBase(smallInt, 8, i);\n                const retView = new Uint8Array(retBuf);\n                retView[0] |= 0x80;\n                return retBuf;\n            }\n            let retBuf = utilToBase(modValue, 8, i);\n            let retView = new Uint8Array(retBuf);\n            if (retView[0] & 0x80) {\n                const tempBuf = retBuf.slice(0);\n                const tempView = new Uint8Array(tempBuf);\n                retBuf = new ArrayBuffer(retBuf.byteLength + 1);\n                retView = new Uint8Array(retBuf);\n                for (let k = 0; k < tempBuf.byteLength; k++) {\n                    retView[k + 1] = tempView[k];\n                }\n                retView[0] = 0x00;\n            }\n            return retBuf;\n        }\n        bigInt *= Math.pow(2, 8);\n    }\n    return new ArrayBuffer(0);\n}\nfunction isEqualBuffer(inputBuffer1, inputBuffer2) {\n    if (inputBuffer1.byteLength !== inputBuffer2.byteLength) {\n        return false;\n    }\n    const view1 = new Uint8Array(inputBuffer1);\n    const view2 = new Uint8Array(inputBuffer2);\n    for (let i = 0; i < view1.length; i++) {\n        if (view1[i] !== view2[i]) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction padNumber(inputNumber, fullLength) {\n    const str = inputNumber.toString(10);\n    if (fullLength < str.length) {\n        return \"\";\n    }\n    const dif = fullLength - str.length;\n    const padding = Array.from({ length: dif });\n    for (let i = 0; i < dif; i++) {\n        padding[i] = \"0\";\n    }\n    const paddingString = padding.join(\"\");\n    return paddingString.concat(str);\n}\nconst base64Template = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nconst base64UrlTemplate = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=\";\nfunction toBase64(input, useUrlTemplate = false, skipPadding = false, skipLeadingZeros = false) {\n    let i = 0;\n    let flag1 = 0;\n    let flag2 = 0;\n    let output = \"\";\n    const template = useUrlTemplate ? base64UrlTemplate : base64Template;\n    if (skipLeadingZeros) {\n        let nonZeroPosition = 0;\n        for (let i = 0; i < input.length; i++) {\n            if (input.charCodeAt(i) !== 0) {\n                nonZeroPosition = i;\n                break;\n            }\n        }\n        input = input.slice(nonZeroPosition);\n    }\n    while (i < input.length) {\n        const chr1 = input.charCodeAt(i++);\n        if (i >= input.length) {\n            flag1 = 1;\n        }\n        const chr2 = input.charCodeAt(i++);\n        if (i >= input.length) {\n            flag2 = 1;\n        }\n        const chr3 = input.charCodeAt(i++);\n        const enc1 = chr1 >> 2;\n        const enc2 = ((chr1 & 0x03) << 4) | (chr2 >> 4);\n        let enc3 = ((chr2 & 0x0f) << 2) | (chr3 >> 6);\n        let enc4 = chr3 & 0x3f;\n        if (flag1 === 1) {\n            enc3 = enc4 = 64;\n        }\n        else {\n            if (flag2 === 1) {\n                enc4 = 64;\n            }\n        }\n        if (skipPadding) {\n            if (enc3 === 64) {\n                output += `${template.charAt(enc1)}${template.charAt(enc2)}`;\n            }\n            else {\n                if (enc4 === 64) {\n                    output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}`;\n                }\n                else {\n                    output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}${template.charAt(enc4)}`;\n                }\n            }\n        }\n        else {\n            output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}${template.charAt(enc4)}`;\n        }\n    }\n    return output;\n}\nfunction fromBase64(input, useUrlTemplate = false, cutTailZeros = false) {\n    const template = useUrlTemplate ? base64UrlTemplate : base64Template;\n    function indexOf(toSearch) {\n        for (let i = 0; i < 64; i++) {\n            if (template.charAt(i) === toSearch)\n                return i;\n        }\n        return 64;\n    }\n    function test(incoming) {\n        return incoming === 64 ? 0x00 : incoming;\n    }\n    let i = 0;\n    let output = \"\";\n    while (i < input.length) {\n        const enc1 = indexOf(input.charAt(i++));\n        const enc2 = i >= input.length ? 0x00 : indexOf(input.charAt(i++));\n        const enc3 = i >= input.length ? 0x00 : indexOf(input.charAt(i++));\n        const enc4 = i >= input.length ? 0x00 : indexOf(input.charAt(i++));\n        const chr1 = (test(enc1) << 2) | (test(enc2) >> 4);\n        const chr2 = ((test(enc2) & 0x0f) << 4) | (test(enc3) >> 2);\n        const chr3 = ((test(enc3) & 0x03) << 6) | test(enc4);\n        output += String.fromCharCode(chr1);\n        if (enc3 !== 64) {\n            output += String.fromCharCode(chr2);\n        }\n        if (enc4 !== 64) {\n            output += String.fromCharCode(chr3);\n        }\n    }\n    if (cutTailZeros) {\n        const outputLength = output.length;\n        let nonZeroStart = -1;\n        for (let i = outputLength - 1; i >= 0; i--) {\n            if (output.charCodeAt(i) !== 0) {\n                nonZeroStart = i;\n                break;\n            }\n        }\n        if (nonZeroStart !== -1) {\n            output = output.slice(0, nonZeroStart + 1);\n        }\n        else {\n            output = \"\";\n        }\n    }\n    return output;\n}\nfunction arrayBufferToString(buffer) {\n    let resultString = \"\";\n    const view = new Uint8Array(buffer);\n    for (const element of view) {\n        resultString += String.fromCharCode(element);\n    }\n    return resultString;\n}\nfunction stringToArrayBuffer(str) {\n    const stringLength = str.length;\n    const resultBuffer = new ArrayBuffer(stringLength);\n    const resultView = new Uint8Array(resultBuffer);\n    for (let i = 0; i < stringLength; i++) {\n        resultView[i] = str.charCodeAt(i);\n    }\n    return resultBuffer;\n}\nconst log2 = Math.log(2);\nfunction nearestPowerOf2(length) {\n    const base = Math.log(length) / log2;\n    const floor = Math.floor(base);\n    const round = Math.round(base);\n    return floor === round ? floor : round;\n}\nfunction clearProps(object, propsArray) {\n    for (const prop of propsArray) {\n        delete object[prop];\n    }\n}\n\nexport { arrayBufferToString, bufferToHexCodes, checkBufferParams, clearProps, fromBase64, getParametersValue, getUTCDate, isEqualBuffer, nearestPowerOf2, padNumber, stringToArrayBuffer, toBase64, utilConcatBuf, utilConcatView, utilDecodeTC, utilEncodeTC, utilFromBase, utilToBase };\n","/*!\n * Copyright (c) 2014, GMO GlobalSign\n * Copyright (c) 2015-2022, Peculiar Ventures\n * All rights reserved.\n * \n * Author 2014-2019, Yury Strozhevsky\n * \n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * \n * * Redistributions of source code must retain the above copyright notice, this\n *   list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, this\n *   list of conditions and the following disclaimer in the documentation and/or\n *   other materials provided with the distribution.\n * \n * * Neither the name of the copyright holder nor the names of its\n *   contributors may be used to endorse or promote products derived from\n *   this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n * \n */\n\nimport * as pvtsutils from 'pvtsutils';\nimport * as pvutils from 'pvutils';\n\nfunction assertBigInt() {\n    if (typeof BigInt === \"undefined\") {\n        throw new Error(\"BigInt is not defined. Your environment doesn't implement BigInt.\");\n    }\n}\nfunction concat(buffers) {\n    let outputLength = 0;\n    let prevLength = 0;\n    for (let i = 0; i < buffers.length; i++) {\n        const buffer = buffers[i];\n        outputLength += buffer.byteLength;\n    }\n    const retView = new Uint8Array(outputLength);\n    for (let i = 0; i < buffers.length; i++) {\n        const buffer = buffers[i];\n        retView.set(new Uint8Array(buffer), prevLength);\n        prevLength += buffer.byteLength;\n    }\n    return retView.buffer;\n}\nfunction checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength) {\n    if (!(inputBuffer instanceof Uint8Array)) {\n        baseBlock.error = \"Wrong parameter: inputBuffer must be 'Uint8Array'\";\n        return false;\n    }\n    if (!inputBuffer.byteLength) {\n        baseBlock.error = \"Wrong parameter: inputBuffer has zero length\";\n        return false;\n    }\n    if (inputOffset < 0) {\n        baseBlock.error = \"Wrong parameter: inputOffset less than zero\";\n        return false;\n    }\n    if (inputLength < 0) {\n        baseBlock.error = \"Wrong parameter: inputLength less than zero\";\n        return false;\n    }\n    if ((inputBuffer.byteLength - inputOffset - inputLength) < 0) {\n        baseBlock.error = \"End of input reached before message was fully decoded (inconsistent offset and length values)\";\n        return false;\n    }\n    return true;\n}\n\nclass ViewWriter {\n    constructor() {\n        this.items = [];\n    }\n    write(buf) {\n        this.items.push(buf);\n    }\n    final() {\n        return concat(this.items);\n    }\n}\n\nconst powers2 = [new Uint8Array([1])];\nconst digitsString = \"0123456789\";\nconst NAME = \"name\";\nconst VALUE_HEX_VIEW = \"valueHexView\";\nconst IS_HEX_ONLY = \"isHexOnly\";\nconst ID_BLOCK = \"idBlock\";\nconst TAG_CLASS = \"tagClass\";\nconst TAG_NUMBER = \"tagNumber\";\nconst IS_CONSTRUCTED = \"isConstructed\";\nconst FROM_BER = \"fromBER\";\nconst TO_BER = \"toBER\";\nconst LOCAL = \"local\";\nconst EMPTY_STRING = \"\";\nconst EMPTY_BUFFER = new ArrayBuffer(0);\nconst EMPTY_VIEW = new Uint8Array(0);\nconst END_OF_CONTENT_NAME = \"EndOfContent\";\nconst OCTET_STRING_NAME = \"OCTET STRING\";\nconst BIT_STRING_NAME = \"BIT STRING\";\n\nfunction HexBlock(BaseClass) {\n    var _a;\n    return _a = class Some extends BaseClass {\n            get valueHex() {\n                return this.valueHexView.slice().buffer;\n            }\n            set valueHex(value) {\n                this.valueHexView = new Uint8Array(value);\n            }\n            constructor(...args) {\n                var _b;\n                super(...args);\n                const params = args[0] || {};\n                this.isHexOnly = (_b = params.isHexOnly) !== null && _b !== void 0 ? _b : false;\n                this.valueHexView = params.valueHex ? pvtsutils.BufferSourceConverter.toUint8Array(params.valueHex) : EMPTY_VIEW;\n            }\n            fromBER(inputBuffer, inputOffset, inputLength, _context) {\n                const view = inputBuffer instanceof ArrayBuffer ? new Uint8Array(inputBuffer) : inputBuffer;\n                if (!checkBufferParams(this, view, inputOffset, inputLength)) {\n                    return -1;\n                }\n                const endLength = inputOffset + inputLength;\n                this.valueHexView = view.subarray(inputOffset, endLength);\n                if (!this.valueHexView.length) {\n                    this.warnings.push(\"Zero buffer length\");\n                    return inputOffset;\n                }\n                this.blockLength = inputLength;\n                return endLength;\n            }\n            toBER(sizeOnly = false) {\n                if (!this.isHexOnly) {\n                    this.error = \"Flag 'isHexOnly' is not set, abort\";\n                    return EMPTY_BUFFER;\n                }\n                if (sizeOnly) {\n                    return new ArrayBuffer(this.valueHexView.byteLength);\n                }\n                return (this.valueHexView.byteLength === this.valueHexView.buffer.byteLength)\n                    ? this.valueHexView.buffer\n                    : this.valueHexView.slice().buffer;\n            }\n            toJSON() {\n                return {\n                    ...super.toJSON(),\n                    isHexOnly: this.isHexOnly,\n                    valueHex: pvtsutils.Convert.ToHex(this.valueHexView),\n                };\n            }\n        },\n        _a.NAME = \"hexBlock\",\n        _a;\n}\n\nclass LocalBaseBlock {\n    static blockName() {\n        return this.NAME;\n    }\n    get valueBeforeDecode() {\n        return this.valueBeforeDecodeView.slice().buffer;\n    }\n    set valueBeforeDecode(value) {\n        this.valueBeforeDecodeView = new Uint8Array(value);\n    }\n    constructor({ blockLength = 0, error = EMPTY_STRING, warnings = [], valueBeforeDecode = EMPTY_VIEW, } = {}) {\n        this.blockLength = blockLength;\n        this.error = error;\n        this.warnings = warnings;\n        this.valueBeforeDecodeView = pvtsutils.BufferSourceConverter.toUint8Array(valueBeforeDecode);\n    }\n    toJSON() {\n        return {\n            blockName: this.constructor.NAME,\n            blockLength: this.blockLength,\n            error: this.error,\n            warnings: this.warnings,\n            valueBeforeDecode: pvtsutils.Convert.ToHex(this.valueBeforeDecodeView),\n        };\n    }\n}\nLocalBaseBlock.NAME = \"baseBlock\";\n\nclass ValueBlock extends LocalBaseBlock {\n    fromBER(_inputBuffer, _inputOffset, _inputLength, _context) {\n        throw TypeError(\"User need to make a specific function in a class which extends 'ValueBlock'\");\n    }\n    toBER(_sizeOnly, _writer) {\n        throw TypeError(\"User need to make a specific function in a class which extends 'ValueBlock'\");\n    }\n}\nValueBlock.NAME = \"valueBlock\";\n\nclass LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {\n    constructor({ idBlock = {} } = {}) {\n        var _a, _b, _c, _d;\n        super();\n        if (idBlock) {\n            this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false;\n            this.valueHexView = idBlock.valueHex\n                ? pvtsutils.BufferSourceConverter.toUint8Array(idBlock.valueHex)\n                : EMPTY_VIEW;\n            this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1;\n            this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1;\n            this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false;\n        }\n        else {\n            this.tagClass = -1;\n            this.tagNumber = -1;\n            this.isConstructed = false;\n        }\n    }\n    toBER(sizeOnly = false) {\n        let firstOctet = 0;\n        switch (this.tagClass) {\n            case 1:\n                firstOctet |= 0x00;\n                break;\n            case 2:\n                firstOctet |= 0x40;\n                break;\n            case 3:\n                firstOctet |= 0x80;\n                break;\n            case 4:\n                firstOctet |= 0xC0;\n                break;\n            default:\n                this.error = \"Unknown tag class\";\n                return EMPTY_BUFFER;\n        }\n        if (this.isConstructed)\n            firstOctet |= 0x20;\n        if (this.tagNumber < 31 && !this.isHexOnly) {\n            const retView = new Uint8Array(1);\n            if (!sizeOnly) {\n                let number = this.tagNumber;\n                number &= 0x1F;\n                firstOctet |= number;\n                retView[0] = firstOctet;\n            }\n            return retView.buffer;\n        }\n        if (!this.isHexOnly) {\n            const encodedBuf = pvutils.utilToBase(this.tagNumber, 7);\n            const encodedView = new Uint8Array(encodedBuf);\n            const size = encodedBuf.byteLength;\n            const retView = new Uint8Array(size + 1);\n            retView[0] = (firstOctet | 0x1F);\n            if (!sizeOnly) {\n                for (let i = 0; i < (size - 1); i++)\n                    retView[i + 1] = encodedView[i] | 0x80;\n                retView[size] = encodedView[size - 1];\n            }\n            return retView.buffer;\n        }\n        const retView = new Uint8Array(this.valueHexView.byteLength + 1);\n        retView[0] = (firstOctet | 0x1F);\n        if (!sizeOnly) {\n            const curView = this.valueHexView;\n            for (let i = 0; i < (curView.length - 1); i++)\n                retView[i + 1] = curView[i] | 0x80;\n            retView[this.valueHexView.byteLength] = curView[curView.length - 1];\n        }\n        return retView.buffer;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        const inputView = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n        if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {\n            return -1;\n        }\n        const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);\n        if (intBuffer.length === 0) {\n            this.error = \"Zero buffer length\";\n            return -1;\n        }\n        const tagClassMask = intBuffer[0] & 0xC0;\n        switch (tagClassMask) {\n            case 0x00:\n                this.tagClass = (1);\n                break;\n            case 0x40:\n                this.tagClass = (2);\n                break;\n            case 0x80:\n                this.tagClass = (3);\n                break;\n            case 0xC0:\n                this.tagClass = (4);\n                break;\n            default:\n                this.error = \"Unknown tag class\";\n                return -1;\n        }\n        this.isConstructed = (intBuffer[0] & 0x20) === 0x20;\n        this.isHexOnly = false;\n        const tagNumberMask = intBuffer[0] & 0x1F;\n        if (tagNumberMask !== 0x1F) {\n            this.tagNumber = (tagNumberMask);\n            this.blockLength = 1;\n        }\n        else {\n            let count = 0;\n            while (true) {\n                const tagByteIndex = count + 1;\n                if (tagByteIndex >= intBuffer.length) {\n                    this.error = \"End of input reached before message was fully decoded\";\n                    return -1;\n                }\n                count++;\n                if ((intBuffer[tagByteIndex] & 0x80) === 0x00)\n                    break;\n            }\n            this.blockLength = (count + 1);\n            const intTagNumberBuffer = this.valueHexView = new Uint8Array(count);\n            for (let i = 0; i < count; i++)\n                intTagNumberBuffer[i] = intBuffer[i + 1] & 0x7F;\n            if (this.blockLength <= 9)\n                this.tagNumber = pvutils.utilFromBase(intTagNumberBuffer, 7);\n            else {\n                this.isHexOnly = true;\n                this.warnings.push(\"Tag too long, represented as hex-coded\");\n            }\n        }\n        if (((this.tagClass === 1))\n            && (this.isConstructed)) {\n            switch (this.tagNumber) {\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                case 9:\n                case 13:\n                case 14:\n                case 23:\n                case 24:\n                case 31:\n                case 32:\n                case 33:\n                case 34:\n                    this.error = \"Constructed encoding used for primitive type\";\n                    return -1;\n            }\n        }\n        return (inputOffset + this.blockLength);\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            tagClass: this.tagClass,\n            tagNumber: this.tagNumber,\n            isConstructed: this.isConstructed,\n        };\n    }\n}\nLocalIdentificationBlock.NAME = \"identificationBlock\";\n\nclass LocalLengthBlock extends LocalBaseBlock {\n    constructor({ lenBlock = {} } = {}) {\n        var _a, _b, _c;\n        super();\n        this.isIndefiniteForm = (_a = lenBlock.isIndefiniteForm) !== null && _a !== void 0 ? _a : false;\n        this.longFormUsed = (_b = lenBlock.longFormUsed) !== null && _b !== void 0 ? _b : false;\n        this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        const view = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n        if (!checkBufferParams(this, view, inputOffset, inputLength)) {\n            return -1;\n        }\n        const intBuffer = view.subarray(inputOffset, inputOffset + inputLength);\n        if (intBuffer.length === 0) {\n            this.error = \"Zero buffer length\";\n            return -1;\n        }\n        if (intBuffer[0] === 0xFF) {\n            this.error = \"Length block 0xFF is reserved by standard\";\n            return -1;\n        }\n        this.isIndefiniteForm = intBuffer[0] === 0x80;\n        if (this.isIndefiniteForm) {\n            this.blockLength = 1;\n            return (inputOffset + this.blockLength);\n        }\n        this.longFormUsed = !!(intBuffer[0] & 0x80);\n        if (this.longFormUsed === false) {\n            this.length = (intBuffer[0]);\n            this.blockLength = 1;\n            return (inputOffset + this.blockLength);\n        }\n        const count = intBuffer[0] & 0x7F;\n        if (count > 8) {\n            this.error = \"Too big integer\";\n            return -1;\n        }\n        if ((count + 1) > intBuffer.length) {\n            this.error = \"End of input reached before message was fully decoded\";\n            return -1;\n        }\n        const lenOffset = inputOffset + 1;\n        const lengthBufferView = view.subarray(lenOffset, lenOffset + count);\n        if (lengthBufferView[count - 1] === 0x00)\n            this.warnings.push(\"Needlessly long encoded length\");\n        this.length = pvutils.utilFromBase(lengthBufferView, 8);\n        if (this.longFormUsed && (this.length <= 127))\n            this.warnings.push(\"Unnecessary usage of long length form\");\n        this.blockLength = count + 1;\n        return (inputOffset + this.blockLength);\n    }\n    toBER(sizeOnly = false) {\n        let retBuf;\n        let retView;\n        if (this.length > 127)\n            this.longFormUsed = true;\n        if (this.isIndefiniteForm) {\n            retBuf = new ArrayBuffer(1);\n            if (sizeOnly === false) {\n                retView = new Uint8Array(retBuf);\n                retView[0] = 0x80;\n            }\n            return retBuf;\n        }\n        if (this.longFormUsed) {\n            const encodedBuf = pvutils.utilToBase(this.length, 8);\n            if (encodedBuf.byteLength > 127) {\n                this.error = \"Too big length\";\n                return (EMPTY_BUFFER);\n            }\n            retBuf = new ArrayBuffer(encodedBuf.byteLength + 1);\n            if (sizeOnly)\n                return retBuf;\n            const encodedView = new Uint8Array(encodedBuf);\n            retView = new Uint8Array(retBuf);\n            retView[0] = encodedBuf.byteLength | 0x80;\n            for (let i = 0; i < encodedBuf.byteLength; i++)\n                retView[i + 1] = encodedView[i];\n            return retBuf;\n        }\n        retBuf = new ArrayBuffer(1);\n        if (sizeOnly === false) {\n            retView = new Uint8Array(retBuf);\n            retView[0] = this.length;\n        }\n        return retBuf;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            isIndefiniteForm: this.isIndefiniteForm,\n            longFormUsed: this.longFormUsed,\n            length: this.length,\n        };\n    }\n}\nLocalLengthBlock.NAME = \"lengthBlock\";\n\nconst typeStore = {};\n\nclass BaseBlock extends LocalBaseBlock {\n    constructor({ name = EMPTY_STRING, optional = false, primitiveSchema, ...parameters } = {}, valueBlockType) {\n        super(parameters);\n        this.name = name;\n        this.optional = optional;\n        if (primitiveSchema) {\n            this.primitiveSchema = primitiveSchema;\n        }\n        this.idBlock = new LocalIdentificationBlock(parameters);\n        this.lenBlock = new LocalLengthBlock(parameters);\n        this.valueBlock = valueBlockType ? new valueBlockType(parameters) : new ValueBlock(parameters);\n    }\n    fromBER(inputBuffer, inputOffset, inputLength, context) {\n        const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm)\n            ? inputLength\n            : this.lenBlock.length, context);\n        if (resultOffset === -1) {\n            this.error = this.valueBlock.error;\n            return resultOffset;\n        }\n        if (!this.idBlock.error.length)\n            this.blockLength += this.idBlock.blockLength;\n        if (!this.lenBlock.error.length)\n            this.blockLength += this.lenBlock.blockLength;\n        if (!this.valueBlock.error.length)\n            this.blockLength += this.valueBlock.blockLength;\n        return resultOffset;\n    }\n    toBER(sizeOnly, writer) {\n        const _writer = writer || new ViewWriter();\n        if (!writer) {\n            prepareIndefiniteForm(this);\n        }\n        const idBlockBuf = this.idBlock.toBER(sizeOnly);\n        _writer.write(idBlockBuf);\n        if (this.lenBlock.isIndefiniteForm) {\n            _writer.write(new Uint8Array([0x80]).buffer);\n            this.valueBlock.toBER(sizeOnly, _writer);\n            _writer.write(new ArrayBuffer(2));\n        }\n        else {\n            const valueBlockBuf = this.valueBlock.toBER(sizeOnly);\n            this.lenBlock.length = valueBlockBuf.byteLength;\n            const lenBlockBuf = this.lenBlock.toBER(sizeOnly);\n            _writer.write(lenBlockBuf);\n            _writer.write(valueBlockBuf);\n        }\n        if (!writer) {\n            return _writer.final();\n        }\n        return EMPTY_BUFFER;\n    }\n    toJSON() {\n        const object = {\n            ...super.toJSON(),\n            idBlock: this.idBlock.toJSON(),\n            lenBlock: this.lenBlock.toJSON(),\n            valueBlock: this.valueBlock.toJSON(),\n            name: this.name,\n            optional: this.optional,\n        };\n        if (this.primitiveSchema)\n            object.primitiveSchema = this.primitiveSchema.toJSON();\n        return object;\n    }\n    toString(encoding = \"ascii\") {\n        if (encoding === \"ascii\") {\n            return this.onAsciiEncoding();\n        }\n        return pvtsutils.Convert.ToHex(this.toBER());\n    }\n    onAsciiEncoding() {\n        const name = this.constructor.NAME;\n        const value = pvtsutils.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);\n        return `${name} : ${value}`;\n    }\n    isEqual(other) {\n        if (this === other) {\n            return true;\n        }\n        if (!(other instanceof this.constructor)) {\n            return false;\n        }\n        const thisRaw = this.toBER();\n        const otherRaw = other.toBER();\n        return pvutils.isEqualBuffer(thisRaw, otherRaw);\n    }\n}\nBaseBlock.NAME = \"BaseBlock\";\nfunction prepareIndefiniteForm(baseBlock) {\n    var _a;\n    if (baseBlock instanceof typeStore.Constructed) {\n        for (const value of baseBlock.valueBlock.value) {\n            if (prepareIndefiniteForm(value)) {\n                baseBlock.lenBlock.isIndefiniteForm = true;\n            }\n        }\n    }\n    return !!((_a = baseBlock.lenBlock) === null || _a === void 0 ? void 0 : _a.isIndefiniteForm);\n}\n\nclass BaseStringBlock extends BaseBlock {\n    getValue() {\n        return this.valueBlock.value;\n    }\n    setValue(value) {\n        this.valueBlock.value = value;\n    }\n    constructor({ value = EMPTY_STRING, ...parameters } = {}, stringValueBlockType) {\n        super(parameters, stringValueBlockType);\n        if (value) {\n            this.fromString(value);\n        }\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm)\n            ? inputLength\n            : this.lenBlock.length);\n        if (resultOffset === -1) {\n            this.error = this.valueBlock.error;\n            return resultOffset;\n        }\n        this.fromBuffer(this.valueBlock.valueHexView);\n        if (!this.idBlock.error.length)\n            this.blockLength += this.idBlock.blockLength;\n        if (!this.lenBlock.error.length)\n            this.blockLength += this.lenBlock.blockLength;\n        if (!this.valueBlock.error.length)\n            this.blockLength += this.valueBlock.blockLength;\n        return resultOffset;\n    }\n    onAsciiEncoding() {\n        return `${this.constructor.NAME} : '${this.valueBlock.value}'`;\n    }\n}\nBaseStringBlock.NAME = \"BaseStringBlock\";\n\nclass LocalPrimitiveValueBlock extends HexBlock(ValueBlock) {\n    constructor({ isHexOnly = true, ...parameters } = {}) {\n        super(parameters);\n        this.isHexOnly = isHexOnly;\n    }\n}\nLocalPrimitiveValueBlock.NAME = \"PrimitiveValueBlock\";\n\nvar _a$w;\nclass Primitive extends BaseBlock {\n    constructor(parameters = {}) {\n        super(parameters, LocalPrimitiveValueBlock);\n        this.idBlock.isConstructed = false;\n    }\n}\n_a$w = Primitive;\n(() => {\n    typeStore.Primitive = _a$w;\n})();\nPrimitive.NAME = \"PRIMITIVE\";\n\nconst DEFAULT_MAX_DEPTH = 100;\nconst DEFAULT_MAX_NODES = 10000;\nconst DEFAULT_MAX_CONTENT_LENGTH = 16 * 1024 * 1024;\nconst MAX_DEPTH_EXCEEDED_ERROR = \"Maximum ASN.1 nesting depth exceeded\";\nconst MAX_NODES_EXCEEDED_ERROR = \"Maximum ASN.1 node count exceeded\";\nconst MAX_CONTENT_LENGTH_EXCEEDED_ERROR = \"Maximum ASN.1 content length exceeded\";\nfunction createFromBerContext(options = {}) {\n    var _a, _b, _c;\n    return {\n        depth: 0,\n        maxDepth: (_a = options.maxDepth) !== null && _a !== void 0 ? _a : DEFAULT_MAX_DEPTH,\n        nodesCount: 0,\n        maxNodes: (_b = options.maxNodes) !== null && _b !== void 0 ? _b : DEFAULT_MAX_NODES,\n        maxContentLength: (_c = options.maxContentLength) !== null && _c !== void 0 ? _c : DEFAULT_MAX_CONTENT_LENGTH,\n    };\n}\nfunction createErrorResult(error) {\n    const result = new BaseBlock({}, ValueBlock);\n    result.error = error;\n    return {\n        offset: -1,\n        result,\n    };\n}\nfunction checkNodesLimit(context) {\n    context.nodesCount += 1;\n    if (context.nodesCount > context.maxNodes) {\n        return MAX_NODES_EXCEEDED_ERROR;\n    }\n    return undefined;\n}\nfunction checkContentLengthLimit(inputLength, context) {\n    if (inputLength > context.maxContentLength) {\n        return MAX_CONTENT_LENGTH_EXCEEDED_ERROR;\n    }\n    return undefined;\n}\nfunction localFromBERWithChildContext(inputBuffer, inputOffset, inputLength, context) {\n    const childDepth = context.depth + 1;\n    if (childDepth > context.maxDepth) {\n        return createErrorResult(MAX_DEPTH_EXCEEDED_ERROR);\n    }\n    context.depth = childDepth;\n    try {\n        return localFromBER(inputBuffer, inputOffset, inputLength, context);\n    }\n    finally {\n        context.depth -= 1;\n    }\n}\nfunction localChangeType(inputObject, newType) {\n    if (inputObject instanceof newType) {\n        return inputObject;\n    }\n    const newObject = new newType();\n    newObject.idBlock = inputObject.idBlock;\n    newObject.lenBlock = inputObject.lenBlock;\n    newObject.warnings = inputObject.warnings;\n    newObject.valueBeforeDecodeView = inputObject.valueBeforeDecodeView;\n    return newObject;\n}\nfunction localFromBER(inputBuffer, inputOffset = 0, inputLength = inputBuffer.length, context = createFromBerContext()) {\n    const incomingOffset = inputOffset;\n    let returnObject = new BaseBlock({}, ValueBlock);\n    const baseBlock = new LocalBaseBlock();\n    if (!checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength)) {\n        returnObject.error = baseBlock.error;\n        return {\n            offset: -1,\n            result: returnObject,\n        };\n    }\n    const intBuffer = inputBuffer.subarray(inputOffset, inputOffset + inputLength);\n    if (!intBuffer.length) {\n        returnObject.error = \"Zero buffer length\";\n        return {\n            offset: -1,\n            result: returnObject,\n        };\n    }\n    const nodesLimitError = checkNodesLimit(context);\n    if (nodesLimitError) {\n        returnObject.error = nodesLimitError;\n        return {\n            offset: -1,\n            result: returnObject,\n        };\n    }\n    let resultOffset = returnObject.idBlock.fromBER(inputBuffer, inputOffset, inputLength);\n    if (returnObject.idBlock.warnings.length) {\n        returnObject.warnings.concat(returnObject.idBlock.warnings);\n    }\n    if (resultOffset === -1) {\n        returnObject.error = returnObject.idBlock.error;\n        return {\n            offset: -1,\n            result: returnObject,\n        };\n    }\n    inputOffset = resultOffset;\n    inputLength -= returnObject.idBlock.blockLength;\n    resultOffset = returnObject.lenBlock.fromBER(inputBuffer, inputOffset, inputLength);\n    if (returnObject.lenBlock.warnings.length) {\n        returnObject.warnings.concat(returnObject.lenBlock.warnings);\n    }\n    if (resultOffset === -1) {\n        returnObject.error = returnObject.lenBlock.error;\n        return {\n            offset: -1,\n            result: returnObject,\n        };\n    }\n    inputOffset = resultOffset;\n    inputLength -= returnObject.lenBlock.blockLength;\n    const valueLength = returnObject.lenBlock.isIndefiniteForm ? inputLength : returnObject.lenBlock.length;\n    const contentLengthError = checkContentLengthLimit(valueLength, context);\n    if (contentLengthError) {\n        returnObject.error = contentLengthError;\n        return {\n            offset: -1,\n            result: returnObject,\n        };\n    }\n    if (!returnObject.idBlock.isConstructed\n        && returnObject.lenBlock.isIndefiniteForm) {\n        returnObject.error = \"Indefinite length form used for primitive encoding form\";\n        return {\n            offset: -1,\n            result: returnObject,\n        };\n    }\n    let newASN1Type = BaseBlock;\n    switch (returnObject.idBlock.tagClass) {\n        case 1:\n            if ((returnObject.idBlock.tagNumber >= 37)\n                && (returnObject.idBlock.isHexOnly === false)) {\n                returnObject.error = \"UNIVERSAL 37 and upper tags are reserved by ASN.1 standard\";\n                return {\n                    offset: -1,\n                    result: returnObject,\n                };\n            }\n            switch (returnObject.idBlock.tagNumber) {\n                case 0:\n                    if ((returnObject.idBlock.isConstructed)\n                        && (returnObject.lenBlock.length > 0)) {\n                        returnObject.error = \"Type [UNIVERSAL 0] is reserved\";\n                        return {\n                            offset: -1,\n                            result: returnObject,\n                        };\n                    }\n                    newASN1Type = typeStore.EndOfContent;\n                    break;\n                case 1:\n                    newASN1Type = typeStore.Boolean;\n                    break;\n                case 2:\n                    newASN1Type = typeStore.Integer;\n                    break;\n                case 3:\n                    newASN1Type = typeStore.BitString;\n                    break;\n                case 4:\n                    newASN1Type = typeStore.OctetString;\n                    break;\n                case 5:\n                    newASN1Type = typeStore.Null;\n                    break;\n                case 6:\n                    newASN1Type = typeStore.ObjectIdentifier;\n                    break;\n                case 10:\n                    newASN1Type = typeStore.Enumerated;\n                    break;\n                case 12:\n                    newASN1Type = typeStore.Utf8String;\n                    break;\n                case 13:\n                    newASN1Type = typeStore.RelativeObjectIdentifier;\n                    break;\n                case 14:\n                    newASN1Type = typeStore.TIME;\n                    break;\n                case 15:\n                    returnObject.error = \"[UNIVERSAL 15] is reserved by ASN.1 standard\";\n                    return {\n                        offset: -1,\n                        result: returnObject,\n                    };\n                case 16:\n                    newASN1Type = typeStore.Sequence;\n                    break;\n                case 17:\n                    newASN1Type = typeStore.Set;\n                    break;\n                case 18:\n                    newASN1Type = typeStore.NumericString;\n                    break;\n                case 19:\n                    newASN1Type = typeStore.PrintableString;\n                    break;\n                case 20:\n                    newASN1Type = typeStore.TeletexString;\n                    break;\n                case 21:\n                    newASN1Type = typeStore.VideotexString;\n                    break;\n                case 22:\n                    newASN1Type = typeStore.IA5String;\n                    break;\n                case 23:\n                    newASN1Type = typeStore.UTCTime;\n                    break;\n                case 24:\n                    newASN1Type = typeStore.GeneralizedTime;\n                    break;\n                case 25:\n                    newASN1Type = typeStore.GraphicString;\n                    break;\n                case 26:\n                    newASN1Type = typeStore.VisibleString;\n                    break;\n                case 27:\n                    newASN1Type = typeStore.GeneralString;\n                    break;\n                case 28:\n                    newASN1Type = typeStore.UniversalString;\n                    break;\n                case 29:\n                    newASN1Type = typeStore.CharacterString;\n                    break;\n                case 30:\n                    newASN1Type = typeStore.BmpString;\n                    break;\n                case 31:\n                    newASN1Type = typeStore.DATE;\n                    break;\n                case 32:\n                    newASN1Type = typeStore.TimeOfDay;\n                    break;\n                case 33:\n                    newASN1Type = typeStore.DateTime;\n                    break;\n                case 34:\n                    newASN1Type = typeStore.Duration;\n                    break;\n                default: {\n                    const newObject = returnObject.idBlock.isConstructed\n                        ? new typeStore.Constructed()\n                        : new typeStore.Primitive();\n                    newObject.idBlock = returnObject.idBlock;\n                    newObject.lenBlock = returnObject.lenBlock;\n                    newObject.warnings = returnObject.warnings;\n                    returnObject = newObject;\n                }\n            }\n            break;\n        case 2:\n        case 3:\n        case 4:\n        default: {\n            newASN1Type = returnObject.idBlock.isConstructed\n                ? typeStore.Constructed\n                : typeStore.Primitive;\n        }\n    }\n    returnObject = localChangeType(returnObject, newASN1Type);\n    resultOffset = returnObject.fromBER(inputBuffer, inputOffset, valueLength, context);\n    returnObject.valueBeforeDecodeView = inputBuffer.subarray(incomingOffset, incomingOffset + returnObject.blockLength);\n    return {\n        offset: resultOffset,\n        result: returnObject,\n    };\n}\nfunction fromBER(inputBuffer, options = {}) {\n    if (!inputBuffer.byteLength) {\n        const result = new BaseBlock({}, ValueBlock);\n        result.error = \"Input buffer has zero length\";\n        return {\n            offset: -1,\n            result,\n        };\n    }\n    return localFromBER(pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer).slice(), 0, inputBuffer.byteLength, createFromBerContext(options));\n}\n\nfunction checkLen(indefiniteLength, length) {\n    if (indefiniteLength) {\n        return 1;\n    }\n    return length;\n}\nclass LocalConstructedValueBlock extends ValueBlock {\n    constructor({ value = [], isIndefiniteForm = false, ...parameters } = {}) {\n        super(parameters);\n        this.value = value;\n        this.isIndefiniteForm = isIndefiniteForm;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength, context) {\n        const view = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n        const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();\n        if (!checkBufferParams(this, view, inputOffset, inputLength)) {\n            return -1;\n        }\n        this.valueBeforeDecodeView = view.subarray(inputOffset, inputOffset + inputLength);\n        if (this.valueBeforeDecodeView.length === 0) {\n            this.warnings.push(\"Zero buffer length\");\n            return inputOffset;\n        }\n        let currentOffset = inputOffset;\n        while (checkLen(this.isIndefiniteForm, inputLength) > 0) {\n            const returnObject = localFromBERWithChildContext(view, currentOffset, inputLength, parseContext);\n            if (returnObject.offset === -1) {\n                this.error = returnObject.result.error;\n                this.warnings.concat(returnObject.result.warnings);\n                return -1;\n            }\n            currentOffset = returnObject.offset;\n            this.blockLength += returnObject.result.blockLength;\n            inputLength -= returnObject.result.blockLength;\n            this.value.push(returnObject.result);\n            if (this.isIndefiniteForm && returnObject.result.constructor.NAME === END_OF_CONTENT_NAME) {\n                break;\n            }\n        }\n        if (this.isIndefiniteForm) {\n            if (this.value[this.value.length - 1].constructor.NAME === END_OF_CONTENT_NAME) {\n                this.value.pop();\n            }\n            else {\n                this.warnings.push(\"No EndOfContent block encoded\");\n            }\n        }\n        return currentOffset;\n    }\n    toBER(sizeOnly, writer) {\n        const _writer = writer || new ViewWriter();\n        for (let i = 0; i < this.value.length; i++) {\n            this.value[i].toBER(sizeOnly, _writer);\n        }\n        if (!writer) {\n            return _writer.final();\n        }\n        return EMPTY_BUFFER;\n    }\n    toJSON() {\n        const object = {\n            ...super.toJSON(),\n            isIndefiniteForm: this.isIndefiniteForm,\n            value: [],\n        };\n        for (const value of this.value) {\n            object.value.push(value.toJSON());\n        }\n        return object;\n    }\n}\nLocalConstructedValueBlock.NAME = \"ConstructedValueBlock\";\n\nvar _a$v;\nclass Constructed extends BaseBlock {\n    constructor(parameters = {}) {\n        super(parameters, LocalConstructedValueBlock);\n        this.idBlock.isConstructed = true;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength, context) {\n        this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;\n        const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm) ? inputLength : this.lenBlock.length, context);\n        if (resultOffset === -1) {\n            this.error = this.valueBlock.error;\n            return resultOffset;\n        }\n        if (!this.idBlock.error.length)\n            this.blockLength += this.idBlock.blockLength;\n        if (!this.lenBlock.error.length)\n            this.blockLength += this.lenBlock.blockLength;\n        if (!this.valueBlock.error.length)\n            this.blockLength += this.valueBlock.blockLength;\n        return resultOffset;\n    }\n    onAsciiEncoding() {\n        const values = [];\n        for (const value of this.valueBlock.value) {\n            values.push(value.toString(\"ascii\").split(\"\\n\").map((o) => `  ${o}`).join(\"\\n\"));\n        }\n        const blockName = this.idBlock.tagClass === 3\n            ? `[${this.idBlock.tagNumber}]`\n            : this.constructor.NAME;\n        return values.length\n            ? `${blockName} :\\n${values.join(\"\\n\")}`\n            : `${blockName} :`;\n    }\n}\n_a$v = Constructed;\n(() => {\n    typeStore.Constructed = _a$v;\n})();\nConstructed.NAME = \"CONSTRUCTED\";\n\nclass LocalEndOfContentValueBlock extends ValueBlock {\n    fromBER(inputBuffer, inputOffset, _inputLength) {\n        return inputOffset;\n    }\n    toBER(_sizeOnly) {\n        return EMPTY_BUFFER;\n    }\n}\nLocalEndOfContentValueBlock.override = \"EndOfContentValueBlock\";\n\nvar _a$u;\nclass EndOfContent extends BaseBlock {\n    constructor(parameters = {}) {\n        super(parameters, LocalEndOfContentValueBlock);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 0;\n    }\n}\n_a$u = EndOfContent;\n(() => {\n    typeStore.EndOfContent = _a$u;\n})();\nEndOfContent.NAME = END_OF_CONTENT_NAME;\n\nvar _a$t;\nclass Null extends BaseBlock {\n    constructor(parameters = {}) {\n        super(parameters, ValueBlock);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 5;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        if (this.lenBlock.length > 0)\n            this.warnings.push(\"Non-zero length of value block for Null type\");\n        if (!this.idBlock.error.length)\n            this.blockLength += this.idBlock.blockLength;\n        if (!this.lenBlock.error.length)\n            this.blockLength += this.lenBlock.blockLength;\n        this.blockLength += inputLength;\n        if ((inputOffset + inputLength) > inputBuffer.byteLength) {\n            this.error = \"End of input reached before message was fully decoded (inconsistent offset and length values)\";\n            return -1;\n        }\n        return (inputOffset + inputLength);\n    }\n    toBER(sizeOnly, writer) {\n        const retBuf = new ArrayBuffer(2);\n        if (!sizeOnly) {\n            const retView = new Uint8Array(retBuf);\n            retView[0] = 0x05;\n            retView[1] = 0x00;\n        }\n        if (writer) {\n            writer.write(retBuf);\n        }\n        return retBuf;\n    }\n    onAsciiEncoding() {\n        return `${this.constructor.NAME}`;\n    }\n}\n_a$t = Null;\n(() => {\n    typeStore.Null = _a$t;\n})();\nNull.NAME = \"NULL\";\n\nclass LocalBooleanValueBlock extends HexBlock(ValueBlock) {\n    get value() {\n        for (const octet of this.valueHexView) {\n            if (octet > 0) {\n                return true;\n            }\n        }\n        return false;\n    }\n    set value(value) {\n        this.valueHexView[0] = value ? 0xFF : 0x00;\n    }\n    constructor({ value, ...parameters } = {}) {\n        super(parameters);\n        if (parameters.valueHex) {\n            this.valueHexView = pvtsutils.BufferSourceConverter.toUint8Array(parameters.valueHex);\n        }\n        else {\n            this.valueHexView = new Uint8Array(1);\n        }\n        if (value) {\n            this.value = value;\n        }\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        const inputView = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n        if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {\n            return -1;\n        }\n        this.valueHexView = inputView.subarray(inputOffset, inputOffset + inputLength);\n        if (inputLength > 1)\n            this.warnings.push(\"Boolean value encoded in more then 1 octet\");\n        this.isHexOnly = true;\n        pvutils.utilDecodeTC.call(this);\n        this.blockLength = inputLength;\n        return (inputOffset + inputLength);\n    }\n    toBER() {\n        return this.valueHexView.slice();\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            value: this.value,\n        };\n    }\n}\nLocalBooleanValueBlock.NAME = \"BooleanValueBlock\";\n\nvar _a$s;\nclass Boolean extends BaseBlock {\n    getValue() {\n        return this.valueBlock.value;\n    }\n    setValue(value) {\n        this.valueBlock.value = value;\n    }\n    constructor(parameters = {}) {\n        super(parameters, LocalBooleanValueBlock);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 1;\n    }\n    onAsciiEncoding() {\n        return `${this.constructor.NAME} : ${this.getValue}`;\n    }\n}\n_a$s = Boolean;\n(() => {\n    typeStore.Boolean = _a$s;\n})();\nBoolean.NAME = \"BOOLEAN\";\n\nclass LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock) {\n    constructor({ isConstructed = false, ...parameters } = {}) {\n        super(parameters);\n        this.isConstructed = isConstructed;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength, context) {\n        let resultOffset = 0;\n        if (this.isConstructed) {\n            this.isHexOnly = false;\n            resultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength, context);\n            if (resultOffset === -1)\n                return resultOffset;\n            for (let i = 0; i < this.value.length; i++) {\n                const currentBlockName = this.value[i].constructor.NAME;\n                if (currentBlockName === END_OF_CONTENT_NAME) {\n                    if (this.isIndefiniteForm)\n                        break;\n                    else {\n                        this.error = \"EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only\";\n                        return -1;\n                    }\n                }\n                if (currentBlockName !== OCTET_STRING_NAME) {\n                    this.error = \"OCTET STRING may consists of OCTET STRINGs only\";\n                    return -1;\n                }\n            }\n        }\n        else {\n            this.isHexOnly = true;\n            resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength);\n            this.blockLength = inputLength;\n        }\n        return resultOffset;\n    }\n    toBER(sizeOnly, writer) {\n        if (this.isConstructed)\n            return LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer);\n        return sizeOnly\n            ? new ArrayBuffer(this.valueHexView.byteLength)\n            : this.valueHexView.slice().buffer;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            isConstructed: this.isConstructed,\n        };\n    }\n}\nLocalOctetStringValueBlock.NAME = \"OctetStringValueBlock\";\n\nvar _a$r;\nclass OctetString extends BaseBlock {\n    constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {\n        var _b, _c;\n        (_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));\n        super({\n            idBlock: {\n                isConstructed: parameters.isConstructed,\n                ...idBlock,\n            },\n            lenBlock: {\n                ...lenBlock,\n                isIndefiniteForm: !!parameters.isIndefiniteForm,\n            },\n            ...parameters,\n        }, LocalOctetStringValueBlock);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 4;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength, context) {\n        this.valueBlock.isConstructed = this.idBlock.isConstructed;\n        this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;\n        if (inputLength === 0) {\n            if (this.idBlock.error.length === 0)\n                this.blockLength += this.idBlock.blockLength;\n            if (this.lenBlock.error.length === 0)\n                this.blockLength += this.lenBlock.blockLength;\n            return inputOffset;\n        }\n        if (!this.valueBlock.isConstructed) {\n            const view = inputBuffer instanceof ArrayBuffer ? new Uint8Array(inputBuffer) : inputBuffer;\n            const buf = view.subarray(inputOffset, inputOffset + inputLength);\n            try {\n                if (buf.byteLength) {\n                    const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();\n                    const asn = localFromBERWithChildContext(buf, 0, buf.byteLength, parseContext);\n                    if (asn.offset !== -1 && asn.offset === inputLength) {\n                        this.valueBlock.value = [asn.result];\n                    }\n                }\n            }\n            catch {\n            }\n        }\n        return super.fromBER(inputBuffer, inputOffset, inputLength, context);\n    }\n    onAsciiEncoding() {\n        if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {\n            return Constructed.prototype.onAsciiEncoding.call(this);\n        }\n        const name = this.constructor.NAME;\n        const value = pvtsutils.Convert.ToHex(this.valueBlock.valueHexView);\n        return `${name} : ${value}`;\n    }\n    getValue() {\n        if (!this.idBlock.isConstructed) {\n            return this.valueBlock.valueHexView.slice().buffer;\n        }\n        const array = [];\n        for (const content of this.valueBlock.value) {\n            if (content instanceof _a$r) {\n                array.push(content.valueBlock.valueHexView);\n            }\n        }\n        return pvtsutils.BufferSourceConverter.concat(array);\n    }\n}\n_a$r = OctetString;\n(() => {\n    typeStore.OctetString = _a$r;\n})();\nOctetString.NAME = OCTET_STRING_NAME;\n\nclass LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {\n    constructor({ unusedBits = 0, isConstructed = false, ...parameters } = {}) {\n        super(parameters);\n        this.unusedBits = unusedBits;\n        this.isConstructed = isConstructed;\n        this.blockLength = this.valueHexView.byteLength;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength, context) {\n        if (!inputLength) {\n            return inputOffset;\n        }\n        let resultOffset = -1;\n        if (this.isConstructed) {\n            resultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength, context);\n            if (resultOffset === -1)\n                return resultOffset;\n            for (const value of this.value) {\n                const currentBlockName = value.constructor.NAME;\n                if (currentBlockName === END_OF_CONTENT_NAME) {\n                    if (this.isIndefiniteForm)\n                        break;\n                    else {\n                        this.error = \"EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only\";\n                        return -1;\n                    }\n                }\n                if (currentBlockName !== BIT_STRING_NAME) {\n                    this.error = \"BIT STRING may consists of BIT STRINGs only\";\n                    return -1;\n                }\n                const valueBlock = value.valueBlock;\n                if ((this.unusedBits > 0) && (valueBlock.unusedBits > 0)) {\n                    this.error = \"Using of \\\"unused bits\\\" inside constructive BIT STRING allowed for least one only\";\n                    return -1;\n                }\n                this.unusedBits = valueBlock.unusedBits;\n            }\n            return resultOffset;\n        }\n        const inputView = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n        if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {\n            return -1;\n        }\n        const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);\n        this.unusedBits = intBuffer[0];\n        if (this.unusedBits > 7) {\n            this.error = \"Unused bits for BitString must be in range 0-7\";\n            return -1;\n        }\n        if (!this.unusedBits) {\n            const buf = intBuffer.subarray(1);\n            try {\n                if (buf.byteLength) {\n                    const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();\n                    const asn = localFromBERWithChildContext(buf, 0, buf.byteLength, parseContext);\n                    if (asn.offset !== -1 && asn.offset === (inputLength - 1)) {\n                        this.value = [asn.result];\n                    }\n                }\n            }\n            catch {\n            }\n        }\n        this.valueHexView = intBuffer.subarray(1);\n        this.blockLength = intBuffer.length;\n        return (inputOffset + inputLength);\n    }\n    toBER(sizeOnly, writer) {\n        if (this.isConstructed) {\n            return LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer);\n        }\n        if (sizeOnly) {\n            return new ArrayBuffer(this.valueHexView.byteLength + 1);\n        }\n        if (!this.valueHexView.byteLength) {\n            const empty = new Uint8Array(1);\n            empty[0] = 0;\n            return empty.buffer;\n        }\n        const retView = new Uint8Array(this.valueHexView.length + 1);\n        retView[0] = this.unusedBits;\n        retView.set(this.valueHexView, 1);\n        return retView.buffer;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            unusedBits: this.unusedBits,\n            isConstructed: this.isConstructed,\n        };\n    }\n}\nLocalBitStringValueBlock.NAME = \"BitStringValueBlock\";\n\nvar _a$q;\nclass BitString extends BaseBlock {\n    constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {\n        var _b, _c;\n        (_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));\n        super({\n            idBlock: {\n                isConstructed: parameters.isConstructed,\n                ...idBlock,\n            },\n            lenBlock: {\n                ...lenBlock,\n                isIndefiniteForm: !!parameters.isIndefiniteForm,\n            },\n            ...parameters,\n        }, LocalBitStringValueBlock);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 3;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength, context) {\n        this.valueBlock.isConstructed = this.idBlock.isConstructed;\n        this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;\n        return super.fromBER(inputBuffer, inputOffset, inputLength, context);\n    }\n    onAsciiEncoding() {\n        if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {\n            return Constructed.prototype.onAsciiEncoding.call(this);\n        }\n        else {\n            const bits = [];\n            const valueHex = this.valueBlock.valueHexView;\n            for (const byte of valueHex) {\n                bits.push(byte.toString(2).padStart(8, \"0\"));\n            }\n            const bitsStr = bits.join(\"\");\n            const name = this.constructor.NAME;\n            const value = bitsStr.substring(0, bitsStr.length - this.valueBlock.unusedBits);\n            return `${name} : ${value}`;\n        }\n    }\n}\n_a$q = BitString;\n(() => {\n    typeStore.BitString = _a$q;\n})();\nBitString.NAME = BIT_STRING_NAME;\n\nvar _a$p;\nfunction viewAdd(first, second) {\n    const c = new Uint8Array([0]);\n    const firstView = new Uint8Array(first);\n    const secondView = new Uint8Array(second);\n    let firstViewCopy = firstView.slice(0);\n    const firstViewCopyLength = firstViewCopy.length - 1;\n    const secondViewCopy = secondView.slice(0);\n    const secondViewCopyLength = secondViewCopy.length - 1;\n    let value = 0;\n    const max = (secondViewCopyLength < firstViewCopyLength) ? firstViewCopyLength : secondViewCopyLength;\n    let counter = 0;\n    for (let i = max; i >= 0; i--, counter++) {\n        switch (true) {\n            case (counter < secondViewCopy.length):\n                value = firstViewCopy[firstViewCopyLength - counter] + secondViewCopy[secondViewCopyLength - counter] + c[0];\n                break;\n            default:\n                value = firstViewCopy[firstViewCopyLength - counter] + c[0];\n        }\n        c[0] = value / 10;\n        switch (true) {\n            case (counter >= firstViewCopy.length):\n                firstViewCopy = pvutils.utilConcatView(new Uint8Array([value % 10]), firstViewCopy);\n                break;\n            default:\n                firstViewCopy[firstViewCopyLength - counter] = value % 10;\n        }\n    }\n    if (c[0] > 0)\n        firstViewCopy = pvutils.utilConcatView(c, firstViewCopy);\n    return firstViewCopy;\n}\nfunction power2(n) {\n    if (n >= powers2.length) {\n        for (let p = powers2.length; p <= n; p++) {\n            const c = new Uint8Array([0]);\n            let digits = (powers2[p - 1]).slice(0);\n            for (let i = (digits.length - 1); i >= 0; i--) {\n                const newValue = new Uint8Array([(digits[i] << 1) + c[0]]);\n                c[0] = newValue[0] / 10;\n                digits[i] = newValue[0] % 10;\n            }\n            if (c[0] > 0)\n                digits = pvutils.utilConcatView(c, digits);\n            powers2.push(digits);\n        }\n    }\n    return powers2[n];\n}\nfunction viewSub(first, second) {\n    let b = 0;\n    const firstView = new Uint8Array(first);\n    const secondView = new Uint8Array(second);\n    const firstViewCopy = firstView.slice(0);\n    const firstViewCopyLength = firstViewCopy.length - 1;\n    const secondViewCopy = secondView.slice(0);\n    const secondViewCopyLength = secondViewCopy.length - 1;\n    let value;\n    let counter = 0;\n    for (let i = secondViewCopyLength; i >= 0; i--, counter++) {\n        value = firstViewCopy[firstViewCopyLength - counter] - secondViewCopy[secondViewCopyLength - counter] - b;\n        switch (true) {\n            case (value < 0):\n                b = 1;\n                firstViewCopy[firstViewCopyLength - counter] = value + 10;\n                break;\n            default:\n                b = 0;\n                firstViewCopy[firstViewCopyLength - counter] = value;\n        }\n    }\n    if (b > 0) {\n        for (let i = (firstViewCopyLength - secondViewCopyLength + 1); i >= 0; i--, counter++) {\n            value = firstViewCopy[firstViewCopyLength - counter] - b;\n            if (value < 0) {\n                b = 1;\n                firstViewCopy[firstViewCopyLength - counter] = value + 10;\n            }\n            else {\n                b = 0;\n                firstViewCopy[firstViewCopyLength - counter] = value;\n                break;\n            }\n        }\n    }\n    return firstViewCopy.slice();\n}\nclass LocalIntegerValueBlock extends HexBlock(ValueBlock) {\n    setValueHex() {\n        if (this.valueHexView.length >= 4) {\n            this.warnings.push(\"Too big Integer for decoding, hex only\");\n            this.isHexOnly = true;\n            this._valueDec = 0;\n        }\n        else {\n            this.isHexOnly = false;\n            if (this.valueHexView.length > 0) {\n                this._valueDec = pvutils.utilDecodeTC.call(this);\n            }\n        }\n    }\n    constructor({ value, ...parameters } = {}) {\n        super(parameters);\n        this._valueDec = 0;\n        if (parameters.valueHex) {\n            this.setValueHex();\n        }\n        if (value !== undefined) {\n            this.valueDec = value;\n        }\n    }\n    set valueDec(v) {\n        this._valueDec = v;\n        this.isHexOnly = false;\n        this.valueHexView = new Uint8Array(pvutils.utilEncodeTC(v));\n    }\n    get valueDec() {\n        return this._valueDec;\n    }\n    fromDER(inputBuffer, inputOffset, inputLength, expectedLength = 0) {\n        const offset = this.fromBER(inputBuffer, inputOffset, inputLength);\n        if (offset === -1)\n            return offset;\n        const view = this.valueHexView;\n        if ((view[0] === 0x00) && ((view[1] & 0x80) !== 0)) {\n            this.valueHexView = view.subarray(1);\n        }\n        else {\n            if (expectedLength !== 0) {\n                if (view.length < expectedLength) {\n                    if ((expectedLength - view.length) > 1)\n                        expectedLength = view.length + 1;\n                    this.valueHexView = view.subarray(expectedLength - view.length);\n                }\n            }\n        }\n        return offset;\n    }\n    toDER(sizeOnly = false) {\n        const view = this.valueHexView;\n        switch (true) {\n            case ((view[0] & 0x80) !== 0):\n                {\n                    const updatedView = new Uint8Array(this.valueHexView.length + 1);\n                    updatedView[0] = 0x00;\n                    updatedView.set(view, 1);\n                    this.valueHexView = updatedView;\n                }\n                break;\n            case ((view[0] === 0x00) && ((view[1] & 0x80) === 0)):\n                {\n                    this.valueHexView = this.valueHexView.subarray(1);\n                }\n                break;\n        }\n        return this.toBER(sizeOnly);\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        const resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength);\n        if (resultOffset === -1) {\n            return resultOffset;\n        }\n        this.setValueHex();\n        return resultOffset;\n    }\n    toBER(sizeOnly) {\n        return sizeOnly\n            ? new ArrayBuffer(this.valueHexView.length)\n            : this.valueHexView.slice().buffer;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            valueDec: this.valueDec,\n        };\n    }\n    toString() {\n        const firstBit = (this.valueHexView.length * 8) - 1;\n        let digits = new Uint8Array((this.valueHexView.length * 8) / 3);\n        let bitNumber = 0;\n        let currentByte;\n        const asn1View = this.valueHexView;\n        let result = \"\";\n        let flag = false;\n        for (let byteNumber = (asn1View.byteLength - 1); byteNumber >= 0; byteNumber--) {\n            currentByte = asn1View[byteNumber];\n            for (let i = 0; i < 8; i++) {\n                if ((currentByte & 1) === 1) {\n                    switch (bitNumber) {\n                        case firstBit:\n                            digits = viewSub(power2(bitNumber), digits);\n                            result = \"-\";\n                            break;\n                        default:\n                            digits = viewAdd(digits, power2(bitNumber));\n                    }\n                }\n                bitNumber++;\n                currentByte >>= 1;\n            }\n        }\n        for (let i = 0; i < digits.length; i++) {\n            if (digits[i])\n                flag = true;\n            if (flag)\n                result += digitsString.charAt(digits[i]);\n        }\n        if (flag === false)\n            result += digitsString.charAt(0);\n        return result;\n    }\n}\n_a$p = LocalIntegerValueBlock;\nLocalIntegerValueBlock.NAME = \"IntegerValueBlock\";\n(() => {\n    Object.defineProperty(_a$p.prototype, \"valueHex\", {\n        set: function (v) {\n            this.valueHexView = new Uint8Array(v);\n            this.setValueHex();\n        },\n        get: function () {\n            return this.valueHexView.slice().buffer;\n        },\n    });\n})();\n\nvar _a$o;\nclass Integer extends BaseBlock {\n    constructor(parameters = {}) {\n        super(parameters, LocalIntegerValueBlock);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 2;\n    }\n    toBigInt() {\n        assertBigInt();\n        return BigInt(this.valueBlock.toString());\n    }\n    static fromBigInt(value) {\n        assertBigInt();\n        const bigIntValue = BigInt(value);\n        const writer = new ViewWriter();\n        const hex = bigIntValue.toString(16).replace(/^-/, \"\");\n        const view = new Uint8Array(pvtsutils.Convert.FromHex(hex));\n        if (bigIntValue < 0) {\n            const first = new Uint8Array(view.length + (view[0] & 0x80 ? 1 : 0));\n            first[0] |= 0x80;\n            const firstInt = BigInt(`0x${pvtsutils.Convert.ToHex(first)}`);\n            const secondInt = firstInt + bigIntValue;\n            const second = pvtsutils.BufferSourceConverter.toUint8Array(pvtsutils.Convert.FromHex(secondInt.toString(16)));\n            second[0] |= 0x80;\n            writer.write(second);\n        }\n        else {\n            if (view[0] & 0x80) {\n                writer.write(new Uint8Array([0]));\n            }\n            writer.write(view);\n        }\n        const res = new _a$o({ valueHex: writer.final() });\n        return res;\n    }\n    convertToDER() {\n        const integer = new _a$o({ valueHex: this.valueBlock.valueHexView });\n        integer.valueBlock.toDER();\n        return integer;\n    }\n    convertFromDER() {\n        return new _a$o({\n            valueHex: this.valueBlock.valueHexView[0] === 0\n                ? this.valueBlock.valueHexView.subarray(1)\n                : this.valueBlock.valueHexView,\n        });\n    }\n    onAsciiEncoding() {\n        return `${this.constructor.NAME} : ${this.valueBlock.toString()}`;\n    }\n}\n_a$o = Integer;\n(() => {\n    typeStore.Integer = _a$o;\n})();\nInteger.NAME = \"INTEGER\";\n\nvar _a$n;\nclass Enumerated extends Integer {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 10;\n    }\n}\n_a$n = Enumerated;\n(() => {\n    typeStore.Enumerated = _a$n;\n})();\nEnumerated.NAME = \"ENUMERATED\";\n\nclass LocalSidValueBlock extends HexBlock(ValueBlock) {\n    constructor({ valueDec = -1, isFirstSid = false, ...parameters } = {}) {\n        super(parameters);\n        this.valueDec = valueDec;\n        this.isFirstSid = isFirstSid;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        if (!inputLength) {\n            return inputOffset;\n        }\n        const inputView = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n        if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {\n            return -1;\n        }\n        const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);\n        this.valueHexView = new Uint8Array(inputLength);\n        for (let i = 0; i < inputLength; i++) {\n            this.valueHexView[i] = intBuffer[i] & 0x7F;\n            this.blockLength++;\n            if ((intBuffer[i] & 0x80) === 0x00)\n                break;\n        }\n        const tempView = new Uint8Array(this.blockLength);\n        for (let i = 0; i < this.blockLength; i++) {\n            tempView[i] = this.valueHexView[i];\n        }\n        this.valueHexView = tempView;\n        if ((intBuffer[this.blockLength - 1] & 0x80) !== 0x00) {\n            this.error = \"End of input reached before message was fully decoded\";\n            return -1;\n        }\n        if (this.valueHexView[0] === 0x00)\n            this.warnings.push(\"Needlessly long format of SID encoding\");\n        if (this.blockLength <= 8)\n            this.valueDec = pvutils.utilFromBase(this.valueHexView, 7);\n        else {\n            this.isHexOnly = true;\n            this.warnings.push(\"Too big SID for decoding, hex only\");\n        }\n        return (inputOffset + this.blockLength);\n    }\n    set valueBigInt(value) {\n        assertBigInt();\n        let bits = BigInt(value).toString(2);\n        while (bits.length % 7) {\n            bits = \"0\" + bits;\n        }\n        const bytes = new Uint8Array(bits.length / 7);\n        for (let i = 0; i < bytes.length; i++) {\n            bytes[i] = parseInt(bits.slice(i * 7, i * 7 + 7), 2) + (i + 1 < bytes.length ? 0x80 : 0);\n        }\n        this.fromBER(bytes.buffer, 0, bytes.length);\n    }\n    toBER(sizeOnly) {\n        if (this.isHexOnly) {\n            if (sizeOnly)\n                return (new ArrayBuffer(this.valueHexView.byteLength));\n            const curView = this.valueHexView;\n            const retView = new Uint8Array(this.blockLength);\n            for (let i = 0; i < (this.blockLength - 1); i++)\n                retView[i] = curView[i] | 0x80;\n            retView[this.blockLength - 1] = curView[this.blockLength - 1];\n            return retView.buffer;\n        }\n        const encodedBuf = pvutils.utilToBase(this.valueDec, 7);\n        if (encodedBuf.byteLength === 0) {\n            this.error = \"Error during encoding SID value\";\n            return EMPTY_BUFFER;\n        }\n        const retView = new Uint8Array(encodedBuf.byteLength);\n        if (!sizeOnly) {\n            const encodedView = new Uint8Array(encodedBuf);\n            const len = encodedBuf.byteLength - 1;\n            for (let i = 0; i < len; i++)\n                retView[i] = encodedView[i] | 0x80;\n            retView[len] = encodedView[len];\n        }\n        return retView;\n    }\n    toString() {\n        let result = \"\";\n        if (this.isHexOnly)\n            result = pvtsutils.Convert.ToHex(this.valueHexView);\n        else {\n            if (this.isFirstSid) {\n                let sidValue = this.valueDec;\n                if (this.valueDec <= 39)\n                    result = \"0.\";\n                else {\n                    if (this.valueDec <= 79) {\n                        result = \"1.\";\n                        sidValue -= 40;\n                    }\n                    else {\n                        result = \"2.\";\n                        sidValue -= 80;\n                    }\n                }\n                result += sidValue.toString();\n            }\n            else\n                result = this.valueDec.toString();\n        }\n        return result;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            valueDec: this.valueDec,\n            isFirstSid: this.isFirstSid,\n        };\n    }\n}\nLocalSidValueBlock.NAME = \"sidBlock\";\n\nclass LocalObjectIdentifierValueBlock extends ValueBlock {\n    constructor({ value = EMPTY_STRING, ...parameters } = {}) {\n        super(parameters);\n        this.value = [];\n        if (value) {\n            this.fromString(value);\n        }\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        let resultOffset = inputOffset;\n        while (inputLength > 0) {\n            const sidBlock = new LocalSidValueBlock();\n            resultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength);\n            if (resultOffset === -1) {\n                this.blockLength = 0;\n                this.error = sidBlock.error;\n                return resultOffset;\n            }\n            if (this.value.length === 0)\n                sidBlock.isFirstSid = true;\n            this.blockLength += sidBlock.blockLength;\n            inputLength -= sidBlock.blockLength;\n            this.value.push(sidBlock);\n        }\n        return resultOffset;\n    }\n    toBER(sizeOnly) {\n        const retBuffers = [];\n        for (let i = 0; i < this.value.length; i++) {\n            const valueBuf = this.value[i].toBER(sizeOnly);\n            if (valueBuf.byteLength === 0) {\n                this.error = this.value[i].error;\n                return EMPTY_BUFFER;\n            }\n            retBuffers.push(valueBuf);\n        }\n        return concat(retBuffers);\n    }\n    fromString(string) {\n        this.value = [];\n        let pos1 = 0;\n        let pos2 = 0;\n        let sid = \"\";\n        let flag = false;\n        do {\n            pos2 = string.indexOf(\".\", pos1);\n            if (pos2 === -1)\n                sid = string.substring(pos1);\n            else\n                sid = string.substring(pos1, pos2);\n            pos1 = pos2 + 1;\n            if (flag) {\n                const sidBlock = this.value[0];\n                let plus = 0;\n                switch (sidBlock.valueDec) {\n                    case 0:\n                        break;\n                    case 1:\n                        plus = 40;\n                        break;\n                    case 2:\n                        plus = 80;\n                        break;\n                    default:\n                        this.value = [];\n                        return;\n                }\n                const parsedSID = parseInt(sid, 10);\n                if (isNaN(parsedSID))\n                    return;\n                sidBlock.valueDec = parsedSID + plus;\n                flag = false;\n            }\n            else {\n                const sidBlock = new LocalSidValueBlock();\n                if (sid > Number.MAX_SAFE_INTEGER) {\n                    assertBigInt();\n                    const sidValue = BigInt(sid);\n                    sidBlock.valueBigInt = sidValue;\n                }\n                else {\n                    sidBlock.valueDec = parseInt(sid, 10);\n                    if (isNaN(sidBlock.valueDec))\n                        return;\n                }\n                if (!this.value.length) {\n                    sidBlock.isFirstSid = true;\n                    flag = true;\n                }\n                this.value.push(sidBlock);\n            }\n        } while (pos2 !== -1);\n    }\n    toString() {\n        let result = \"\";\n        let isHexOnly = false;\n        for (let i = 0; i < this.value.length; i++) {\n            isHexOnly = this.value[i].isHexOnly;\n            let sidStr = this.value[i].toString();\n            if (i !== 0)\n                result = `${result}.`;\n            if (isHexOnly) {\n                sidStr = `{${sidStr}}`;\n                if (this.value[i].isFirstSid)\n                    result = `2.{${sidStr} - 80}`;\n                else\n                    result += sidStr;\n            }\n            else\n                result += sidStr;\n        }\n        return result;\n    }\n    toJSON() {\n        const object = {\n            ...super.toJSON(),\n            value: this.toString(),\n            sidArray: [],\n        };\n        for (let i = 0; i < this.value.length; i++) {\n            object.sidArray.push(this.value[i].toJSON());\n        }\n        return object;\n    }\n}\nLocalObjectIdentifierValueBlock.NAME = \"ObjectIdentifierValueBlock\";\n\nvar _a$m;\nclass ObjectIdentifier extends BaseBlock {\n    getValue() {\n        return this.valueBlock.toString();\n    }\n    setValue(value) {\n        this.valueBlock.fromString(value);\n    }\n    constructor(parameters = {}) {\n        super(parameters, LocalObjectIdentifierValueBlock);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 6;\n    }\n    onAsciiEncoding() {\n        return `${this.constructor.NAME} : ${this.valueBlock.toString() || \"empty\"}`;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            value: this.getValue(),\n        };\n    }\n}\n_a$m = ObjectIdentifier;\n(() => {\n    typeStore.ObjectIdentifier = _a$m;\n})();\nObjectIdentifier.NAME = \"OBJECT IDENTIFIER\";\n\nclass LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {\n    constructor({ valueDec = 0, ...parameters } = {}) {\n        super(parameters);\n        this.valueDec = valueDec;\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        if (inputLength === 0)\n            return inputOffset;\n        const inputView = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n        if (!checkBufferParams(this, inputView, inputOffset, inputLength))\n            return -1;\n        const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);\n        this.valueHexView = new Uint8Array(inputLength);\n        for (let i = 0; i < inputLength; i++) {\n            this.valueHexView[i] = intBuffer[i] & 0x7F;\n            this.blockLength++;\n            if ((intBuffer[i] & 0x80) === 0x00)\n                break;\n        }\n        const tempView = new Uint8Array(this.blockLength);\n        for (let i = 0; i < this.blockLength; i++)\n            tempView[i] = this.valueHexView[i];\n        this.valueHexView = tempView;\n        if ((intBuffer[this.blockLength - 1] & 0x80) !== 0x00) {\n            this.error = \"End of input reached before message was fully decoded\";\n            return -1;\n        }\n        if (this.valueHexView[0] === 0x00)\n            this.warnings.push(\"Needlessly long format of SID encoding\");\n        if (this.blockLength <= 8)\n            this.valueDec = pvutils.utilFromBase(this.valueHexView, 7);\n        else {\n            this.isHexOnly = true;\n            this.warnings.push(\"Too big SID for decoding, hex only\");\n        }\n        return (inputOffset + this.blockLength);\n    }\n    toBER(sizeOnly) {\n        if (this.isHexOnly) {\n            if (sizeOnly)\n                return (new ArrayBuffer(this.valueHexView.byteLength));\n            const curView = this.valueHexView;\n            const retView = new Uint8Array(this.blockLength);\n            for (let i = 0; i < (this.blockLength - 1); i++)\n                retView[i] = curView[i] | 0x80;\n            retView[this.blockLength - 1] = curView[this.blockLength - 1];\n            return retView.buffer;\n        }\n        const encodedBuf = pvutils.utilToBase(this.valueDec, 7);\n        if (encodedBuf.byteLength === 0) {\n            this.error = \"Error during encoding SID value\";\n            return EMPTY_BUFFER;\n        }\n        const retView = new Uint8Array(encodedBuf.byteLength);\n        if (!sizeOnly) {\n            const encodedView = new Uint8Array(encodedBuf);\n            const len = encodedBuf.byteLength - 1;\n            for (let i = 0; i < len; i++)\n                retView[i] = encodedView[i] | 0x80;\n            retView[len] = encodedView[len];\n        }\n        return retView.buffer;\n    }\n    toString() {\n        let result = \"\";\n        if (this.isHexOnly)\n            result = pvtsutils.Convert.ToHex(this.valueHexView);\n        else {\n            result = this.valueDec.toString();\n        }\n        return result;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            valueDec: this.valueDec,\n        };\n    }\n}\nLocalRelativeSidValueBlock.NAME = \"relativeSidBlock\";\n\nclass LocalRelativeObjectIdentifierValueBlock extends ValueBlock {\n    constructor({ value = EMPTY_STRING, ...parameters } = {}) {\n        super(parameters);\n        this.value = [];\n        if (value) {\n            this.fromString(value);\n        }\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        let resultOffset = inputOffset;\n        while (inputLength > 0) {\n            const sidBlock = new LocalRelativeSidValueBlock();\n            resultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength);\n            if (resultOffset === -1) {\n                this.blockLength = 0;\n                this.error = sidBlock.error;\n                return resultOffset;\n            }\n            this.blockLength += sidBlock.blockLength;\n            inputLength -= sidBlock.blockLength;\n            this.value.push(sidBlock);\n        }\n        return resultOffset;\n    }\n    toBER(sizeOnly, _writer) {\n        const retBuffers = [];\n        for (let i = 0; i < this.value.length; i++) {\n            const valueBuf = this.value[i].toBER(sizeOnly);\n            if (valueBuf.byteLength === 0) {\n                this.error = this.value[i].error;\n                return EMPTY_BUFFER;\n            }\n            retBuffers.push(valueBuf);\n        }\n        return concat(retBuffers);\n    }\n    fromString(string) {\n        this.value = [];\n        let pos1 = 0;\n        let pos2 = 0;\n        let sid = \"\";\n        do {\n            pos2 = string.indexOf(\".\", pos1);\n            if (pos2 === -1)\n                sid = string.substring(pos1);\n            else\n                sid = string.substring(pos1, pos2);\n            pos1 = pos2 + 1;\n            const sidBlock = new LocalRelativeSidValueBlock();\n            sidBlock.valueDec = parseInt(sid, 10);\n            if (isNaN(sidBlock.valueDec))\n                return true;\n            this.value.push(sidBlock);\n        } while (pos2 !== -1);\n        return true;\n    }\n    toString() {\n        let result = \"\";\n        let isHexOnly = false;\n        for (let i = 0; i < this.value.length; i++) {\n            isHexOnly = this.value[i].isHexOnly;\n            let sidStr = this.value[i].toString();\n            if (i !== 0)\n                result = `${result}.`;\n            if (isHexOnly) {\n                sidStr = `{${sidStr}}`;\n                result += sidStr;\n            }\n            else\n                result += sidStr;\n        }\n        return result;\n    }\n    toJSON() {\n        const object = {\n            ...super.toJSON(),\n            value: this.toString(),\n            sidArray: [],\n        };\n        for (let i = 0; i < this.value.length; i++)\n            object.sidArray.push(this.value[i].toJSON());\n        return object;\n    }\n}\nLocalRelativeObjectIdentifierValueBlock.NAME = \"RelativeObjectIdentifierValueBlock\";\n\nvar _a$l;\nclass RelativeObjectIdentifier extends BaseBlock {\n    getValue() {\n        return this.valueBlock.toString();\n    }\n    setValue(value) {\n        this.valueBlock.fromString(value);\n    }\n    constructor(parameters = {}) {\n        super(parameters, LocalRelativeObjectIdentifierValueBlock);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 13;\n    }\n    onAsciiEncoding() {\n        return `${this.constructor.NAME} : ${this.valueBlock.toString() || \"empty\"}`;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            value: this.getValue(),\n        };\n    }\n}\n_a$l = RelativeObjectIdentifier;\n(() => {\n    typeStore.RelativeObjectIdentifier = _a$l;\n})();\nRelativeObjectIdentifier.NAME = \"RelativeObjectIdentifier\";\n\nvar _a$k;\nclass Sequence extends Constructed {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 16;\n    }\n}\n_a$k = Sequence;\n(() => {\n    typeStore.Sequence = _a$k;\n})();\nSequence.NAME = \"SEQUENCE\";\n\nvar _a$j;\nclass Set extends Constructed {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 17;\n    }\n}\n_a$j = Set;\n(() => {\n    typeStore.Set = _a$j;\n})();\nSet.NAME = \"SET\";\n\nclass LocalStringValueBlock extends HexBlock(ValueBlock) {\n    constructor({ ...parameters } = {}) {\n        super(parameters);\n        this.isHexOnly = true;\n        this.value = EMPTY_STRING;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            value: this.value,\n        };\n    }\n}\nLocalStringValueBlock.NAME = \"StringValueBlock\";\n\nclass LocalSimpleStringValueBlock extends LocalStringValueBlock {\n}\nLocalSimpleStringValueBlock.NAME = \"SimpleStringValueBlock\";\n\nclass LocalSimpleStringBlock extends BaseStringBlock {\n    constructor({ ...parameters } = {}) {\n        super(parameters, LocalSimpleStringValueBlock);\n    }\n    fromBuffer(inputBuffer) {\n        this.valueBlock.value = String.fromCharCode.apply(null, pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer));\n    }\n    fromString(inputString) {\n        const strLen = inputString.length;\n        const view = this.valueBlock.valueHexView = new Uint8Array(strLen);\n        for (let i = 0; i < strLen; i++)\n            view[i] = inputString.charCodeAt(i);\n        this.valueBlock.value = inputString;\n    }\n}\nLocalSimpleStringBlock.NAME = \"SIMPLE STRING\";\n\nclass LocalUtf8StringValueBlock extends LocalSimpleStringBlock {\n    fromBuffer(inputBuffer) {\n        this.valueBlock.valueHexView = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n        try {\n            this.valueBlock.value = pvtsutils.Convert.ToUtf8String(inputBuffer);\n        }\n        catch (ex) {\n            this.warnings.push(`Error during \"decodeURIComponent\": ${ex}, using raw string`);\n            this.valueBlock.value = pvtsutils.Convert.ToBinary(inputBuffer);\n        }\n    }\n    fromString(inputString) {\n        this.valueBlock.valueHexView = new Uint8Array(pvtsutils.Convert.FromUtf8String(inputString));\n        this.valueBlock.value = inputString;\n    }\n}\nLocalUtf8StringValueBlock.NAME = \"Utf8StringValueBlock\";\n\nvar _a$i;\nclass Utf8String extends LocalUtf8StringValueBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 12;\n    }\n}\n_a$i = Utf8String;\n(() => {\n    typeStore.Utf8String = _a$i;\n})();\nUtf8String.NAME = \"UTF8String\";\n\nclass LocalBmpStringValueBlock extends LocalSimpleStringBlock {\n    fromBuffer(inputBuffer) {\n        this.valueBlock.value = pvtsutils.Convert.ToUtf16String(inputBuffer);\n        this.valueBlock.valueHexView = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer);\n    }\n    fromString(inputString) {\n        this.valueBlock.value = inputString;\n        this.valueBlock.valueHexView = new Uint8Array(pvtsutils.Convert.FromUtf16String(inputString));\n    }\n}\nLocalBmpStringValueBlock.NAME = \"BmpStringValueBlock\";\n\nvar _a$h;\nclass BmpString extends LocalBmpStringValueBlock {\n    constructor({ ...parameters } = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 30;\n    }\n}\n_a$h = BmpString;\n(() => {\n    typeStore.BmpString = _a$h;\n})();\nBmpString.NAME = \"BMPString\";\n\nclass LocalUniversalStringValueBlock extends LocalSimpleStringBlock {\n    fromBuffer(inputBuffer) {\n        const copyBuffer = ArrayBuffer.isView(inputBuffer) ? inputBuffer.slice().buffer : inputBuffer.slice(0);\n        const valueView = new Uint8Array(copyBuffer);\n        for (let i = 0; i < valueView.length; i += 4) {\n            valueView[i] = valueView[i + 3];\n            valueView[i + 1] = valueView[i + 2];\n            valueView[i + 2] = 0x00;\n            valueView[i + 3] = 0x00;\n        }\n        this.valueBlock.value = String.fromCharCode.apply(null, new Uint32Array(copyBuffer));\n    }\n    fromString(inputString) {\n        const strLength = inputString.length;\n        const valueHexView = this.valueBlock.valueHexView = new Uint8Array(strLength * 4);\n        for (let i = 0; i < strLength; i++) {\n            const codeBuf = pvutils.utilToBase(inputString.charCodeAt(i), 8);\n            const codeView = new Uint8Array(codeBuf);\n            if (codeView.length > 4)\n                continue;\n            const dif = 4 - codeView.length;\n            for (let j = (codeView.length - 1); j >= 0; j--)\n                valueHexView[i * 4 + j + dif] = codeView[j];\n        }\n        this.valueBlock.value = inputString;\n    }\n}\nLocalUniversalStringValueBlock.NAME = \"UniversalStringValueBlock\";\n\nvar _a$g;\nclass UniversalString extends LocalUniversalStringValueBlock {\n    constructor({ ...parameters } = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 28;\n    }\n}\n_a$g = UniversalString;\n(() => {\n    typeStore.UniversalString = _a$g;\n})();\nUniversalString.NAME = \"UniversalString\";\n\nvar _a$f;\nclass NumericString extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 18;\n    }\n}\n_a$f = NumericString;\n(() => {\n    typeStore.NumericString = _a$f;\n})();\nNumericString.NAME = \"NumericString\";\n\nvar _a$e;\nclass PrintableString extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 19;\n    }\n}\n_a$e = PrintableString;\n(() => {\n    typeStore.PrintableString = _a$e;\n})();\nPrintableString.NAME = \"PrintableString\";\n\nvar _a$d;\nclass TeletexString extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 20;\n    }\n}\n_a$d = TeletexString;\n(() => {\n    typeStore.TeletexString = _a$d;\n})();\nTeletexString.NAME = \"TeletexString\";\n\nvar _a$c;\nclass VideotexString extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 21;\n    }\n}\n_a$c = VideotexString;\n(() => {\n    typeStore.VideotexString = _a$c;\n})();\nVideotexString.NAME = \"VideotexString\";\n\nvar _a$b;\nclass IA5String extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 22;\n    }\n}\n_a$b = IA5String;\n(() => {\n    typeStore.IA5String = _a$b;\n})();\nIA5String.NAME = \"IA5String\";\n\nvar _a$a;\nclass GraphicString extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 25;\n    }\n}\n_a$a = GraphicString;\n(() => {\n    typeStore.GraphicString = _a$a;\n})();\nGraphicString.NAME = \"GraphicString\";\n\nvar _a$9;\nclass VisibleString extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 26;\n    }\n}\n_a$9 = VisibleString;\n(() => {\n    typeStore.VisibleString = _a$9;\n})();\nVisibleString.NAME = \"VisibleString\";\n\nvar _a$8;\nclass GeneralString extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 27;\n    }\n}\n_a$8 = GeneralString;\n(() => {\n    typeStore.GeneralString = _a$8;\n})();\nGeneralString.NAME = \"GeneralString\";\n\nvar _a$7;\nclass CharacterString extends LocalSimpleStringBlock {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 29;\n    }\n}\n_a$7 = CharacterString;\n(() => {\n    typeStore.CharacterString = _a$7;\n})();\nCharacterString.NAME = \"CharacterString\";\n\nvar _a$6;\nclass UTCTime extends VisibleString {\n    constructor({ value, valueDate, ...parameters } = {}) {\n        super(parameters);\n        this.year = 0;\n        this.month = 0;\n        this.day = 0;\n        this.hour = 0;\n        this.minute = 0;\n        this.second = 0;\n        if (value) {\n            this.fromString(value);\n            this.valueBlock.valueHexView = new Uint8Array(value.length);\n            for (let i = 0; i < value.length; i++)\n                this.valueBlock.valueHexView[i] = value.charCodeAt(i);\n        }\n        if (valueDate) {\n            this.fromDate(valueDate);\n            this.valueBlock.valueHexView = new Uint8Array(this.toBuffer());\n        }\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 23;\n    }\n    fromBuffer(inputBuffer) {\n        this.fromString(String.fromCharCode.apply(null, pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer)));\n    }\n    toBuffer() {\n        const str = this.toString();\n        const buffer = new ArrayBuffer(str.length);\n        const view = new Uint8Array(buffer);\n        for (let i = 0; i < str.length; i++)\n            view[i] = str.charCodeAt(i);\n        return buffer;\n    }\n    fromDate(inputDate) {\n        this.year = inputDate.getUTCFullYear();\n        this.month = inputDate.getUTCMonth() + 1;\n        this.day = inputDate.getUTCDate();\n        this.hour = inputDate.getUTCHours();\n        this.minute = inputDate.getUTCMinutes();\n        this.second = inputDate.getUTCSeconds();\n    }\n    toDate() {\n        return (new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second)));\n    }\n    fromString(inputString) {\n        const parser = /(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})Z/ig;\n        const parserArray = parser.exec(inputString);\n        if (parserArray === null) {\n            this.error = \"Wrong input string for conversion\";\n            return;\n        }\n        const year = parseInt(parserArray[1], 10);\n        if (year >= 50)\n            this.year = 1900 + year;\n        else\n            this.year = 2000 + year;\n        this.month = parseInt(parserArray[2], 10);\n        this.day = parseInt(parserArray[3], 10);\n        this.hour = parseInt(parserArray[4], 10);\n        this.minute = parseInt(parserArray[5], 10);\n        this.second = parseInt(parserArray[6], 10);\n    }\n    toString(encoding = \"iso\") {\n        if (encoding === \"iso\") {\n            const outputArray = new Array(7);\n            outputArray[0] = pvutils.padNumber(((this.year < 2000) ? (this.year - 1900) : (this.year - 2000)), 2);\n            outputArray[1] = pvutils.padNumber(this.month, 2);\n            outputArray[2] = pvutils.padNumber(this.day, 2);\n            outputArray[3] = pvutils.padNumber(this.hour, 2);\n            outputArray[4] = pvutils.padNumber(this.minute, 2);\n            outputArray[5] = pvutils.padNumber(this.second, 2);\n            outputArray[6] = \"Z\";\n            return outputArray.join(\"\");\n        }\n        return super.toString(encoding);\n    }\n    onAsciiEncoding() {\n        return `${this.constructor.NAME} : ${this.toDate().toISOString()}`;\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            year: this.year,\n            month: this.month,\n            day: this.day,\n            hour: this.hour,\n            minute: this.minute,\n            second: this.second,\n        };\n    }\n}\n_a$6 = UTCTime;\n(() => {\n    typeStore.UTCTime = _a$6;\n})();\nUTCTime.NAME = \"UTCTime\";\n\nvar _a$5;\nclass GeneralizedTime extends UTCTime {\n    constructor(parameters = {}) {\n        var _b;\n        super(parameters);\n        (_b = this.millisecond) !== null && _b !== void 0 ? _b : (this.millisecond = 0);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 24;\n    }\n    fromDate(inputDate) {\n        super.fromDate(inputDate);\n        this.millisecond = inputDate.getUTCMilliseconds();\n    }\n    toDate() {\n        const utcDate = Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond);\n        return (new Date(utcDate));\n    }\n    fromString(inputString) {\n        let isUTC = false;\n        let timeString = \"\";\n        let dateTimeString = \"\";\n        let fractionPart = 0;\n        let parser;\n        let hourDifference = 0;\n        let minuteDifference = 0;\n        if (inputString[inputString.length - 1] === \"Z\") {\n            timeString = inputString.substring(0, inputString.length - 1);\n            isUTC = true;\n        }\n        else {\n            const number = new Number(inputString[inputString.length - 1]);\n            if (isNaN(number.valueOf()))\n                throw new Error(\"Wrong input string for conversion\");\n            timeString = inputString;\n        }\n        if (isUTC) {\n            if (timeString.indexOf(\"+\") !== -1)\n                throw new Error(\"Wrong input string for conversion\");\n            if (timeString.indexOf(\"-\") !== -1)\n                throw new Error(\"Wrong input string for conversion\");\n        }\n        else {\n            let multiplier = 1;\n            let differencePosition = timeString.indexOf(\"+\");\n            let differenceString = \"\";\n            if (differencePosition === -1) {\n                differencePosition = timeString.indexOf(\"-\");\n                multiplier = -1;\n            }\n            if (differencePosition !== -1) {\n                differenceString = timeString.substring(differencePosition + 1);\n                timeString = timeString.substring(0, differencePosition);\n                if ((differenceString.length !== 2) && (differenceString.length !== 4))\n                    throw new Error(\"Wrong input string for conversion\");\n                let number = parseInt(differenceString.substring(0, 2), 10);\n                if (isNaN(number.valueOf()))\n                    throw new Error(\"Wrong input string for conversion\");\n                hourDifference = multiplier * number;\n                if (differenceString.length === 4) {\n                    number = parseInt(differenceString.substring(2, 4), 10);\n                    if (isNaN(number.valueOf()))\n                        throw new Error(\"Wrong input string for conversion\");\n                    minuteDifference = multiplier * number;\n                }\n            }\n        }\n        let fractionPointPosition = timeString.indexOf(\".\");\n        if (fractionPointPosition === -1)\n            fractionPointPosition = timeString.indexOf(\",\");\n        if (fractionPointPosition !== -1) {\n            const fractionPartCheck = new Number(`0${timeString.substring(fractionPointPosition)}`);\n            if (isNaN(fractionPartCheck.valueOf()))\n                throw new Error(\"Wrong input string for conversion\");\n            fractionPart = fractionPartCheck.valueOf();\n            dateTimeString = timeString.substring(0, fractionPointPosition);\n        }\n        else\n            dateTimeString = timeString;\n        switch (true) {\n            case (dateTimeString.length === 8):\n                parser = /(\\d{4})(\\d{2})(\\d{2})/ig;\n                if (fractionPointPosition !== -1)\n                    throw new Error(\"Wrong input string for conversion\");\n                break;\n            case (dateTimeString.length === 10):\n                parser = /(\\d{4})(\\d{2})(\\d{2})(\\d{2})/ig;\n                if (fractionPointPosition !== -1) {\n                    let fractionResult = 60 * fractionPart;\n                    this.minute = Math.floor(fractionResult);\n                    fractionResult = 60 * (fractionResult - this.minute);\n                    this.second = Math.floor(fractionResult);\n                    fractionResult = 1000 * (fractionResult - this.second);\n                    this.millisecond = Math.floor(fractionResult);\n                }\n                break;\n            case (dateTimeString.length === 12):\n                parser = /(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/ig;\n                if (fractionPointPosition !== -1) {\n                    let fractionResult = 60 * fractionPart;\n                    this.second = Math.floor(fractionResult);\n                    fractionResult = 1000 * (fractionResult - this.second);\n                    this.millisecond = Math.floor(fractionResult);\n                }\n                break;\n            case (dateTimeString.length === 14):\n                parser = /(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/ig;\n                if (fractionPointPosition !== -1) {\n                    const fractionResult = 1000 * fractionPart;\n                    this.millisecond = Math.floor(fractionResult);\n                }\n                break;\n            default:\n                throw new Error(\"Wrong input string for conversion\");\n        }\n        const parserArray = parser.exec(dateTimeString);\n        if (parserArray === null)\n            throw new Error(\"Wrong input string for conversion\");\n        for (let j = 1; j < parserArray.length; j++) {\n            switch (j) {\n                case 1:\n                    this.year = parseInt(parserArray[j], 10);\n                    break;\n                case 2:\n                    this.month = parseInt(parserArray[j], 10);\n                    break;\n                case 3:\n                    this.day = parseInt(parserArray[j], 10);\n                    break;\n                case 4:\n                    this.hour = parseInt(parserArray[j], 10) + hourDifference;\n                    break;\n                case 5:\n                    this.minute = parseInt(parserArray[j], 10) + minuteDifference;\n                    break;\n                case 6:\n                    this.second = parseInt(parserArray[j], 10);\n                    break;\n                default:\n                    throw new Error(\"Wrong input string for conversion\");\n            }\n        }\n        if (isUTC === false) {\n            const tempDate = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n            this.year = tempDate.getUTCFullYear();\n            this.month = tempDate.getUTCMonth();\n            this.day = tempDate.getUTCDay();\n            this.hour = tempDate.getUTCHours();\n            this.minute = tempDate.getUTCMinutes();\n            this.second = tempDate.getUTCSeconds();\n            this.millisecond = tempDate.getUTCMilliseconds();\n        }\n    }\n    toString(encoding = \"iso\") {\n        if (encoding === \"iso\") {\n            const outputArray = [];\n            outputArray.push(pvutils.padNumber(this.year, 4));\n            outputArray.push(pvutils.padNumber(this.month, 2));\n            outputArray.push(pvutils.padNumber(this.day, 2));\n            outputArray.push(pvutils.padNumber(this.hour, 2));\n            outputArray.push(pvutils.padNumber(this.minute, 2));\n            outputArray.push(pvutils.padNumber(this.second, 2));\n            if (this.millisecond !== 0) {\n                outputArray.push(\".\");\n                outputArray.push(pvutils.padNumber(this.millisecond, 3));\n            }\n            outputArray.push(\"Z\");\n            return outputArray.join(\"\");\n        }\n        return super.toString(encoding);\n    }\n    toJSON() {\n        return {\n            ...super.toJSON(),\n            millisecond: this.millisecond,\n        };\n    }\n}\n_a$5 = GeneralizedTime;\n(() => {\n    typeStore.GeneralizedTime = _a$5;\n})();\nGeneralizedTime.NAME = \"GeneralizedTime\";\n\nvar _a$4;\nclass DATE extends Utf8String {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 31;\n    }\n}\n_a$4 = DATE;\n(() => {\n    typeStore.DATE = _a$4;\n})();\nDATE.NAME = \"DATE\";\n\nvar _a$3;\nclass TimeOfDay extends Utf8String {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 32;\n    }\n}\n_a$3 = TimeOfDay;\n(() => {\n    typeStore.TimeOfDay = _a$3;\n})();\nTimeOfDay.NAME = \"TimeOfDay\";\n\nvar _a$2;\nclass DateTime extends Utf8String {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 33;\n    }\n}\n_a$2 = DateTime;\n(() => {\n    typeStore.DateTime = _a$2;\n})();\nDateTime.NAME = \"DateTime\";\n\nvar _a$1;\nclass Duration extends Utf8String {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 34;\n    }\n}\n_a$1 = Duration;\n(() => {\n    typeStore.Duration = _a$1;\n})();\nDuration.NAME = \"Duration\";\n\nvar _a;\nclass TIME extends Utf8String {\n    constructor(parameters = {}) {\n        super(parameters);\n        this.idBlock.tagClass = 1;\n        this.idBlock.tagNumber = 14;\n    }\n}\n_a = TIME;\n(() => {\n    typeStore.TIME = _a;\n})();\nTIME.NAME = \"TIME\";\n\nclass Any {\n    constructor({ name = EMPTY_STRING, optional = false } = {}) {\n        this.name = name;\n        this.optional = optional;\n    }\n}\n\nclass Choice extends Any {\n    constructor({ value = [], ...parameters } = {}) {\n        super(parameters);\n        this.value = value;\n    }\n}\n\nclass Repeated extends Any {\n    constructor({ value = new Any(), local = false, ...parameters } = {}) {\n        super(parameters);\n        this.value = value;\n        this.local = local;\n    }\n}\n\nclass RawData {\n    get data() {\n        return this.dataView.slice().buffer;\n    }\n    set data(value) {\n        this.dataView = pvtsutils.BufferSourceConverter.toUint8Array(value);\n    }\n    constructor({ data = EMPTY_VIEW } = {}) {\n        this.dataView = pvtsutils.BufferSourceConverter.toUint8Array(data);\n    }\n    fromBER(inputBuffer, inputOffset, inputLength) {\n        const endLength = inputOffset + inputLength;\n        this.dataView = pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer).subarray(inputOffset, endLength);\n        return endLength;\n    }\n    toBER(_sizeOnly) {\n        return this.dataView.slice().buffer;\n    }\n}\n\nfunction compareSchema(root, inputData, inputSchema) {\n    if (inputSchema instanceof Choice) {\n        for (const element of inputSchema.value) {\n            const result = compareSchema(root, inputData, element);\n            if (result.verified) {\n                return {\n                    verified: true,\n                    result: root,\n                };\n            }\n        }\n        {\n            const _result = {\n                verified: false,\n                result: { error: \"Wrong values for Choice type\" },\n            };\n            if (inputSchema.hasOwnProperty(NAME))\n                _result.name = inputSchema.name;\n            return _result;\n        }\n    }\n    if (inputSchema instanceof Any) {\n        if (inputSchema.hasOwnProperty(NAME))\n            root[inputSchema.name] = inputData;\n        return {\n            verified: true,\n            result: root,\n        };\n    }\n    if ((root instanceof Object) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong root object\" },\n        };\n    }\n    if ((inputData instanceof Object) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 data\" },\n        };\n    }\n    if ((inputSchema instanceof Object) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema\" },\n        };\n    }\n    if ((ID_BLOCK in inputSchema) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema\" },\n        };\n    }\n    if ((FROM_BER in inputSchema.idBlock) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema\" },\n        };\n    }\n    if ((TO_BER in inputSchema.idBlock) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema\" },\n        };\n    }\n    const encodedId = inputSchema.idBlock.toBER(false);\n    if (encodedId.byteLength === 0) {\n        return {\n            verified: false,\n            result: { error: \"Error encoding idBlock for ASN.1 schema\" },\n        };\n    }\n    const decodedOffset = inputSchema.idBlock.fromBER(encodedId, 0, encodedId.byteLength);\n    if (decodedOffset === -1) {\n        return {\n            verified: false,\n            result: { error: \"Error decoding idBlock for ASN.1 schema\" },\n        };\n    }\n    if (inputSchema.idBlock.hasOwnProperty(TAG_CLASS) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema\" },\n        };\n    }\n    if (inputSchema.idBlock.tagClass !== inputData.idBlock.tagClass) {\n        return {\n            verified: false,\n            result: root,\n        };\n    }\n    if (inputSchema.idBlock.hasOwnProperty(TAG_NUMBER) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema\" },\n        };\n    }\n    if (inputSchema.idBlock.tagNumber !== inputData.idBlock.tagNumber) {\n        return {\n            verified: false,\n            result: root,\n        };\n    }\n    if (inputSchema.idBlock.hasOwnProperty(IS_CONSTRUCTED) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema\" },\n        };\n    }\n    if (inputSchema.idBlock.isConstructed !== inputData.idBlock.isConstructed) {\n        return {\n            verified: false,\n            result: root,\n        };\n    }\n    if (!(IS_HEX_ONLY in inputSchema.idBlock)) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema\" },\n        };\n    }\n    if (inputSchema.idBlock.isHexOnly !== inputData.idBlock.isHexOnly) {\n        return {\n            verified: false,\n            result: root,\n        };\n    }\n    if (inputSchema.idBlock.isHexOnly) {\n        if ((VALUE_HEX_VIEW in inputSchema.idBlock) === false) {\n            return {\n                verified: false,\n                result: { error: \"Wrong ASN.1 schema\" },\n            };\n        }\n        const schemaView = inputSchema.idBlock.valueHexView;\n        const asn1View = inputData.idBlock.valueHexView;\n        if (schemaView.length !== asn1View.length) {\n            return {\n                verified: false,\n                result: root,\n            };\n        }\n        for (let i = 0; i < schemaView.length; i++) {\n            if (schemaView[i] !== asn1View[1]) {\n                return {\n                    verified: false,\n                    result: root,\n                };\n            }\n        }\n    }\n    if (inputSchema.name) {\n        inputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n        if (inputSchema.name)\n            root[inputSchema.name] = inputData;\n    }\n    if (inputSchema instanceof typeStore.Constructed) {\n        let admission = 0;\n        let result = {\n            verified: false,\n            result: { error: \"Unknown error\" },\n        };\n        let maxLength = inputSchema.valueBlock.value.length;\n        if (maxLength > 0) {\n            if (inputSchema.valueBlock.value[0] instanceof Repeated) {\n                maxLength = inputData.valueBlock.value.length;\n            }\n        }\n        if (maxLength === 0) {\n            return {\n                verified: true,\n                result: root,\n            };\n        }\n        if ((inputData.valueBlock.value.length === 0)\n            && (inputSchema.valueBlock.value.length !== 0)) {\n            let _optional = true;\n            for (let i = 0; i < inputSchema.valueBlock.value.length; i++)\n                _optional = _optional && (inputSchema.valueBlock.value[i].optional || false);\n            if (_optional) {\n                return {\n                    verified: true,\n                    result: root,\n                };\n            }\n            if (inputSchema.name) {\n                inputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n                if (inputSchema.name)\n                    delete root[inputSchema.name];\n            }\n            root.error = \"Inconsistent object length\";\n            return {\n                verified: false,\n                result: root,\n            };\n        }\n        for (let i = 0; i < maxLength; i++) {\n            if ((i - admission) >= inputData.valueBlock.value.length) {\n                if (inputSchema.valueBlock.value[i].optional === false) {\n                    const _result = {\n                        verified: false,\n                        result: root,\n                    };\n                    root.error = \"Inconsistent length between ASN.1 data and schema\";\n                    if (inputSchema.name) {\n                        inputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n                        if (inputSchema.name) {\n                            delete root[inputSchema.name];\n                            _result.name = inputSchema.name;\n                        }\n                    }\n                    return _result;\n                }\n            }\n            else {\n                if (inputSchema.valueBlock.value[0] instanceof Repeated) {\n                    result = compareSchema(root, inputData.valueBlock.value[i], inputSchema.valueBlock.value[0].value);\n                    if (result.verified === false) {\n                        if (inputSchema.valueBlock.value[0].optional)\n                            admission++;\n                        else {\n                            if (inputSchema.name) {\n                                inputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n                                if (inputSchema.name)\n                                    delete root[inputSchema.name];\n                            }\n                            return result;\n                        }\n                    }\n                    if ((NAME in inputSchema.valueBlock.value[0]) && (inputSchema.valueBlock.value[0].name.length > 0)) {\n                        let arrayRoot = {};\n                        if ((LOCAL in inputSchema.valueBlock.value[0]) && (inputSchema.valueBlock.value[0].local))\n                            arrayRoot = inputData;\n                        else\n                            arrayRoot = root;\n                        if (typeof arrayRoot[inputSchema.valueBlock.value[0].name] === \"undefined\")\n                            arrayRoot[inputSchema.valueBlock.value[0].name] = [];\n                        arrayRoot[inputSchema.valueBlock.value[0].name].push(inputData.valueBlock.value[i]);\n                    }\n                }\n                else {\n                    result = compareSchema(root, inputData.valueBlock.value[i - admission], inputSchema.valueBlock.value[i]);\n                    if (result.verified === false) {\n                        if (inputSchema.valueBlock.value[i].optional)\n                            admission++;\n                        else {\n                            if (inputSchema.name) {\n                                inputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n                                if (inputSchema.name)\n                                    delete root[inputSchema.name];\n                            }\n                            return result;\n                        }\n                    }\n                }\n            }\n        }\n        if (result.verified === false) {\n            const _result = {\n                verified: false,\n                result: root,\n            };\n            if (inputSchema.name) {\n                inputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n                if (inputSchema.name) {\n                    delete root[inputSchema.name];\n                    _result.name = inputSchema.name;\n                }\n            }\n            return _result;\n        }\n        return {\n            verified: true,\n            result: root,\n        };\n    }\n    if (inputSchema.primitiveSchema\n        && (VALUE_HEX_VIEW in inputData.valueBlock)) {\n        const asn1 = localFromBER(inputData.valueBlock.valueHexView);\n        if (asn1.offset === -1) {\n            const _result = {\n                verified: false,\n                result: asn1.result,\n            };\n            if (inputSchema.name) {\n                inputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n                if (inputSchema.name) {\n                    delete root[inputSchema.name];\n                    _result.name = inputSchema.name;\n                }\n            }\n            return _result;\n        }\n        return compareSchema(root, asn1.result, inputSchema.primitiveSchema);\n    }\n    return {\n        verified: true,\n        result: root,\n    };\n}\nfunction verifySchema(inputBuffer, inputSchema) {\n    if ((inputSchema instanceof Object) === false) {\n        return {\n            verified: false,\n            result: { error: \"Wrong ASN.1 schema type\" },\n        };\n    }\n    const asn1 = localFromBER(pvtsutils.BufferSourceConverter.toUint8Array(inputBuffer));\n    if (asn1.offset === -1) {\n        return {\n            verified: false,\n            result: asn1.result,\n        };\n    }\n    return compareSchema(asn1.result, asn1.result, inputSchema);\n}\n\nexport { Any, BaseBlock, BaseStringBlock, BitString, BmpString, Boolean, CharacterString, Choice, Constructed, DATE, DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_MAX_DEPTH, DEFAULT_MAX_NODES, DateTime, Duration, EndOfContent, Enumerated, GeneralString, GeneralizedTime, GraphicString, HexBlock, IA5String, Integer, Null, NumericString, ObjectIdentifier, OctetString, Primitive, PrintableString, RawData, RelativeObjectIdentifier, Repeated, Sequence, Set, TIME, TeletexString, TimeOfDay, UTCTime, UniversalString, Utf8String, ValueBlock, VideotexString, ViewWriter, VisibleString, compareSchema, fromBER, verifySchema };\n","const ARRAY_BUFFER_TAG = \"[object ArrayBuffer]\";\nconst SHARED_ARRAY_BUFFER_TAG = \"[object SharedArrayBuffer]\";\nfunction tagOf(value) {\n    return Object.prototype.toString.call(value);\n}\nfunction isDataViewConstructor(type) {\n    return type === DataView || type.prototype instanceof DataView;\n}\nfunction bytesPerElement(type) {\n    if (isDataViewConstructor(type)) {\n        return 1;\n    }\n    const value = type.BYTES_PER_ELEMENT;\n    return value ?? 1;\n}\nfunction isArrayBufferViewLike(value) {\n    if (ArrayBuffer.isView(value)) {\n        return true;\n    }\n    if (!value || typeof value !== \"object\") {\n        return false;\n    }\n    const view = value;\n    return typeof view.byteOffset === \"number\"\n        && typeof view.byteLength === \"number\"\n        && isArrayBufferLike(view.buffer);\n}\nfunction copyBytes(data) {\n    const view = toUint8Array(data);\n    const copy = new Uint8Array(view.byteLength);\n    copy.set(view);\n    return copy;\n}\nexport function isArrayBuffer(value) {\n    return tagOf(value) === ARRAY_BUFFER_TAG;\n}\nexport function isSharedArrayBuffer(value) {\n    return typeof SharedArrayBuffer !== \"undefined\" && tagOf(value) === SHARED_ARRAY_BUFFER_TAG;\n}\nexport function isArrayBufferLike(value) {\n    return isArrayBuffer(value) || isSharedArrayBuffer(value);\n}\nexport function isArrayBufferView(value) {\n    return isArrayBufferViewLike(value);\n}\nexport function isBufferSource(value) {\n    return isArrayBufferLike(value) || isArrayBufferView(value);\n}\nexport function assertBufferSource(value) {\n    if (!isBufferSource(value)) {\n        throw new TypeError(\"Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView\");\n    }\n}\nexport function toUint8Array(data) {\n    assertBufferSource(data);\n    if (isArrayBufferLike(data)) {\n        return new Uint8Array(data);\n    }\n    return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n}\nexport function toUint8ArrayCopy(data) {\n    return copyBytes(data);\n}\nexport function toArrayBuffer(data) {\n    assertBufferSource(data);\n    if (isArrayBuffer(data)) {\n        return data;\n    }\n    const buffer = new ArrayBuffer(data.byteLength);\n    new Uint8Array(buffer).set(toUint8Array(data));\n    return buffer;\n}\nexport function toArrayBufferLike(data) {\n    assertBufferSource(data);\n    if (isArrayBufferLike(data)) {\n        return data;\n    }\n    if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {\n        return data.buffer;\n    }\n    return copyBytes(data).buffer;\n}\nexport function toView(data, type) {\n    assertBufferSource(data);\n    if (ArrayBuffer.isView(data) && data.constructor === type) {\n        return data;\n    }\n    const view = toUint8Array(data);\n    const elementSize = bytesPerElement(type);\n    if (view.byteOffset % elementSize !== 0 || view.byteLength % elementSize !== 0) {\n        throw new RangeError(`Cannot create ${type.name} over unaligned byte range`);\n    }\n    if (isDataViewConstructor(type)) {\n        return new type(view.buffer, view.byteOffset, view.byteLength);\n    }\n    return new type(view.buffer, view.byteOffset, view.byteLength / elementSize);\n}\nexport function toViewCopy(data, type) {\n    const copy = toUint8ArrayCopy(data);\n    return toView(copy, type);\n}\n","import { toUint8Array } from \"./buffer-source.js\";\nexport function equal(a, b, options = {}) {\n    const left = toUint8Array(a);\n    const right = toUint8Array(b);\n    if (!options.constantTime && left.byteLength !== right.byteLength) {\n        return false;\n    }\n    const length = Math.max(left.byteLength, right.byteLength);\n    let diff = left.byteLength ^ right.byteLength;\n    for (let i = 0; i < length; i++) {\n        diff |= (left[i] ?? 0) ^ (right[i] ?? 0);\n    }\n    return diff === 0;\n}\n","import { toUint8Array } from \"../bytes/index.js\";\nexport function encode(data) {\n    const bytes = toUint8Array(data);\n    let result = \"\";\n    for (const byte of bytes) {\n        result += String.fromCharCode(byte);\n    }\n    return result;\n}\nexport function decode(text) {\n    const result = new Uint8Array(text.length);\n    for (let i = 0; i < text.length; i++) {\n        result[i] = text.charCodeAt(i) & 0xff;\n    }\n    return result;\n}\nexport function is(text) {\n    return typeof text === \"string\";\n}\nexport const binary = { encode, decode, is };\n","import { toUint8Array } from \"../bytes/index.js\";\nconst HEX_CHARACTER_REGEX = /^[0-9a-f]$/i;\nconst COMMON_SEPARATORS = [\" \", \"\\t\", \"\\n\", \"\\r\", \":\", \"-\", \".\"];\nfunction resolveSeparators(options) {\n    if (options.separators === \"none\") {\n        return [];\n    }\n    if (!options.separators || options.separators === \"common\") {\n        return COMMON_SEPARATORS;\n    }\n    return options.separators;\n}\nfunction validateSeparator(separator) {\n    if (!separator) {\n        throw new TypeError(\"Hex separators must be non-empty strings\");\n    }\n}\nfunction matchSeparator(text, index, separators) {\n    for (const separator of separators) {\n        if (text.startsWith(separator, index)) {\n            return separator;\n        }\n    }\n    return undefined;\n}\nfunction detectCase(text) {\n    const hasUpper = /[A-F]/.test(text);\n    const hasLower = /[a-f]/.test(text);\n    return hasUpper && !hasLower ? \"upper\" : \"lower\";\n}\nfunction detectLineSeparator(text) {\n    const match = /\\r\\n|\\n/.exec(text);\n    if (!match) {\n        return undefined;\n    }\n    return match[0] === \"\\r\\n\" ? \"\\r\\n\" : \"\\n\";\n}\nfunction compactForDetection(text) {\n    return text.replace(/[^0-9a-f]/gi, \"\");\n}\nfunction detectGroup(text) {\n    const segments = text.match(/[0-9A-Fa-f]+|[^0-9A-Fa-f]+/g) ?? [];\n    if (segments.length < 3) {\n        return undefined;\n    }\n    const hexSegments = segments.filter((_, index) => index % 2 === 0);\n    const separators = segments.filter((_, index) => index % 2 === 1);\n    const separator = separators[0];\n    if (!separator || separators.some((item) => item !== separator)) {\n        return undefined;\n    }\n    if (hexSegments.some((segment) => segment.length === 0 || segment.length % 2 !== 0)) {\n        return undefined;\n    }\n    const firstLength = hexSegments[0]?.length ?? 0;\n    if (!firstLength) {\n        return undefined;\n    }\n    if (hexSegments.slice(0, -1).some((segment) => segment.length !== firstLength)) {\n        return undefined;\n    }\n    if ((hexSegments[hexSegments.length - 1]?.length ?? 0) > firstLength) {\n        return undefined;\n    }\n    return {\n        size: firstLength / 2,\n        separator,\n    };\n}\nfunction detectFormat(text) {\n    const trimmed = text.trim();\n    const prefix = /^0x/i.test(trimmed) ? \"0x\" : \"\";\n    const body = prefix ? trimmed.slice(2) : trimmed;\n    const lineSeparator = detectLineSeparator(body);\n    const lines = body.split(/\\r\\n|\\n/).filter((line) => line.length > 0);\n    const sampleLine = lines[0]?.trim() ?? \"\";\n    const group = detectGroup(sampleLine);\n    const format = {\n        case: detectCase(trimmed),\n        prefix,\n    };\n    if (group) {\n        format.group = group;\n    }\n    if (lineSeparator && lines.length > 1) {\n        const firstLineBytes = compactForDetection(lines[0] ?? \"\").length / 2;\n        if (firstLineBytes > 0 && lines.slice(0, -1).every((line) => compactForDetection(line).length / 2 === firstLineBytes)) {\n            format.line = {\n                bytesPerLine: firstLineBytes,\n                separator: lineSeparator,\n            };\n        }\n    }\n    return format;\n}\nfunction normalizeText(text, options) {\n    const allowPrefix = options.allowPrefix ?? true;\n    const separators = [...resolveSeparators(options)].sort((left, right) => right.length - left.length);\n    for (const separator of separators) {\n        validateSeparator(separator);\n    }\n    let working = text.trim();\n    if (/^0x/i.test(working)) {\n        if (!allowPrefix) {\n            throw new TypeError(\"Hexadecimal text must not include a 0x prefix\");\n        }\n        working = working.slice(2);\n    }\n    let normalized = \"\";\n    let lastTokenWasSeparator = false;\n    for (let index = 0; index < working.length;) {\n        const character = working[index] ?? \"\";\n        if (HEX_CHARACTER_REGEX.test(character)) {\n            normalized += character;\n            lastTokenWasSeparator = false;\n            index += 1;\n            continue;\n        }\n        const separator = matchSeparator(working, index, separators);\n        if (!separator) {\n            throw new TypeError(\"Input is not valid hexadecimal text\");\n        }\n        if (options.strict && (lastTokenWasSeparator || normalized.length === 0)) {\n            throw new TypeError(\"Hexadecimal text contains misplaced separators\");\n        }\n        lastTokenWasSeparator = true;\n        index += separator.length;\n    }\n    if (options.strict && lastTokenWasSeparator && normalized.length > 0) {\n        throw new TypeError(\"Hexadecimal text must not end with a separator\");\n    }\n    if (normalized.length % 2 !== 0) {\n        if (!options.allowOddLength) {\n            throw new TypeError(\"Hexadecimal text must contain an even number of characters\");\n        }\n        normalized = `0${normalized}`;\n    }\n    return normalized.toLowerCase();\n}\nfunction groupPairs(pairs, group) {\n    if (!group) {\n        return pairs.join(\"\");\n    }\n    if (!Number.isInteger(group.size) || group.size < 1) {\n        throw new RangeError(\"Hex group size must be a positive integer\");\n    }\n    const chunks = [];\n    for (let index = 0; index < pairs.length; index += group.size) {\n        chunks.push(pairs.slice(index, index + group.size).join(\"\"));\n    }\n    return chunks.join(group.separator);\n}\nexport function normalize(text, options = {}) {\n    return normalizeText(text, options);\n}\nexport function is(text, options = {}) {\n    if (typeof text !== \"string\") {\n        return false;\n    }\n    try {\n        normalize(text, options);\n        return true;\n    }\n    catch {\n        return false;\n    }\n}\nexport function encode(data, options = {}) {\n    const bytes = toUint8Array(data);\n    const casing = options.case ?? \"lower\";\n    const pairs = Array.from(bytes, (byte) => {\n        const text = byte.toString(16).padStart(2, \"0\");\n        return casing === \"upper\" ? text.toUpperCase() : text;\n    });\n    let body = \"\";\n    if (options.line) {\n        const bytesPerLine = options.line.bytesPerLine;\n        if (!Number.isInteger(bytesPerLine) || bytesPerLine < 1) {\n            throw new RangeError(\"Hex bytesPerLine must be a positive integer\");\n        }\n        const separator = options.line.separator ?? \"\\n\";\n        const lines = [];\n        for (let index = 0; index < pairs.length; index += bytesPerLine) {\n            lines.push(groupPairs(pairs.slice(index, index + bytesPerLine), options.group));\n        }\n        body = lines.join(separator);\n    }\n    else {\n        body = groupPairs(pairs, options.group);\n    }\n    return `${options.prefix ?? \"\"}${body}`;\n}\nexport function decode(text, options = {}) {\n    const normalized = normalize(text, options);\n    const result = new Uint8Array(normalized.length / 2);\n    for (let i = 0; i < normalized.length; i += 2) {\n        result[i / 2] = Number.parseInt(normalized.slice(i, i + 2), 16);\n    }\n    return result;\n}\nexport function parse(text, options = {}) {\n    const normalized = normalize(text, options);\n    return {\n        bytes: decode(normalized),\n        format: detectFormat(text),\n        normalized,\n    };\n}\nexport function format(data, value) {\n    return encode(data, value);\n}\nexport const formats = {\n    compact: Object.freeze({}),\n    upper: Object.freeze({ case: \"upper\" }),\n    colon: Object.freeze({ group: { size: 1, separator: \":\" } }),\n    colonUpper: Object.freeze({ case: \"upper\", group: { size: 1, separator: \":\" } }),\n    groupsOf4: Object.freeze({ group: { size: 4, separator: \" \" } }),\n    prefixed: Object.freeze({ prefix: \"0x\" }),\n};\nexport const hex = { encode, decode, format, formats, is, normalize, parse };\n","import { toUint8Array } from \"../bytes/index.js\";\nexport function encode(text) {\n    return new TextEncoder().encode(text);\n}\nexport function decode(data) {\n    return new TextDecoder(\"utf-8\", { fatal: false }).decode(toUint8Array(data));\n}\nexport const utf8 = { encode, decode };\n","import { toArrayBuffer } from \"../bytes/index.js\";\nexport function encode(text, options = {}) {\n    const result = new ArrayBuffer(text.length * 2);\n    const view = new DataView(result);\n    for (let i = 0; i < text.length; i++) {\n        view.setUint16(i * 2, text.charCodeAt(i), options.littleEndian ?? false);\n    }\n    return new Uint8Array(result);\n}\nexport function decode(data, options = {}) {\n    const buffer = toArrayBuffer(data);\n    const view = new DataView(buffer);\n    let result = \"\";\n    for (let i = 0; i < buffer.byteLength; i += 2) {\n        result += String.fromCharCode(view.getUint16(i, options.littleEndian ?? false));\n    }\n    return result;\n}\nexport const utf16 = { encode, decode };\n","import { toUint8Array } from \"../bytes/index.js\";\nimport { encode as encodeBinary, decode as decodeBinary } from \"./binary.js\";\nconst BASE64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\nfunction nodeBuffer() {\n    return globalThis.Buffer;\n}\nexport function normalize(text) {\n    return text.replace(/[\\n\\r\\t ]/g, \"\");\n}\nexport function pad(text) {\n    const remainder = text.length % 4;\n    return remainder ? text + \"=\".repeat(4 - remainder) : text;\n}\nexport function is(text) {\n    if (typeof text !== \"string\") {\n        return false;\n    }\n    const normalized = normalize(text);\n    return normalized === \"\" || BASE64_REGEX.test(normalized);\n}\nexport function encode(data, _options) {\n    const bytes = toUint8Array(data);\n    const buffer = nodeBuffer();\n    if (buffer) {\n        return buffer.from(bytes).toString(\"base64\");\n    }\n    return btoa(encodeBinary(bytes));\n}\nexport function decode(text, _options) {\n    const normalized = normalize(text);\n    if (!is(normalized)) {\n        throw new TypeError(\"Input is not valid Base64 text\");\n    }\n    const buffer = nodeBuffer();\n    if (buffer) {\n        return new Uint8Array(buffer.from(normalized, \"base64\"));\n    }\n    return decodeBinary(atob(normalized));\n}\nexport const base64 = { encode, decode, is, normalize, pad };\n","import { base64 } from \"./base64.js\";\nconst BASE64URL_REGEX = /^[A-Za-z0-9_-]*$/;\nexport function normalize(text) {\n    return text.replace(/[\\n\\r\\t ]/g, \"\");\n}\nexport function is(text) {\n    return typeof text === \"string\" && BASE64URL_REGEX.test(normalize(text));\n}\nexport function encode(data, _options) {\n    return base64.encode(data).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/g, \"\");\n}\nexport function decode(text, _options) {\n    const normalized = normalize(text);\n    if (!is(normalized)) {\n        throw new TypeError(\"Input is not valid Base64Url text\");\n    }\n    return base64.decode(base64.pad(normalized.replace(/-/g, \"+\").replace(/_/g, \"/\")));\n}\nexport const base64url = { encode, decode, is, normalize };\n","import { base64 } from \"../encoding/base64.js\";\nconst LABEL_REGEX = /^[A-Z0-9][A-Z0-9 ._-]*[A-Z0-9]$/i;\nconst PEM_BLOCK_REGEX = /-----BEGIN ([^-]+)-----([\\s\\S]*?)-----END \\1-----/g;\nfunction assertLabel(label) {\n    if (!LABEL_REGEX.test(label)) {\n        throw new TypeError(`Invalid PEM label '${label}'`);\n    }\n}\nfunction wrap(text, lineLength) {\n    const result = [];\n    for (let i = 0; i < text.length; i += lineLength) {\n        result.push(text.slice(i, i + lineLength));\n    }\n    return result;\n}\nfunction parseBody(body) {\n    const normalized = body.trim().replace(/\\r\\n/g, \"\\n\");\n    const lines = normalized.split(\"\\n\").map((line) => line.trim()).filter(Boolean);\n    const headers = {};\n    let index = 0;\n    for (; index < lines.length; index++) {\n        const line = lines[index];\n        const separator = line.indexOf(\":\");\n        if (separator <= 0) {\n            break;\n        }\n        headers[line.slice(0, separator).trim()] = line.slice(separator + 1).trim();\n    }\n    return {\n        headers: Object.keys(headers).length ? headers : undefined,\n        base64Lines: lines.slice(index),\n        base64Text: lines.slice(index).join(\"\"),\n    };\n}\nfunction detectNewline(text) {\n    return /\\r\\n/.test(text) ? \"\\r\\n\" : \"\\n\";\n}\nfunction collectBlocks(text, options = {}) {\n    const blocks = [];\n    const requestedLabel = options.label;\n    let match;\n    PEM_BLOCK_REGEX.lastIndex = 0;\n    while ((match = PEM_BLOCK_REGEX.exec(text))) {\n        const label = match[1].trim();\n        if (requestedLabel && label !== requestedLabel) {\n            continue;\n        }\n        assertLabel(label);\n        const parsed = parseBody(match[2]);\n        blocks.push({\n            label,\n            data: base64.decode(parsed.base64Text),\n            headers: parsed.headers,\n            lineLength: parsed.base64Lines[0]?.length ?? 64,\n            newline: detectNewline(match[0]),\n        });\n    }\n    if (options.strict && blocks.length === 0) {\n        throw new TypeError(requestedLabel\n            ? `No PEM block with label '${requestedLabel}' was found`\n            : \"No PEM blocks were found\");\n    }\n    return blocks;\n}\nexport function encode(label, data, options = {}) {\n    assertLabel(label);\n    const lineLength = options.lineLength ?? 64;\n    if (!Number.isInteger(lineLength) || lineLength < 1) {\n        throw new RangeError(\"PEM lineLength must be a positive integer\");\n    }\n    const newline = options.newline ?? \"\\n\";\n    const lines = [`-----BEGIN ${label}-----`];\n    if (options.headers) {\n        for (const [name, value] of Object.entries(options.headers)) {\n            lines.push(`${name}: ${value}`);\n        }\n        lines.push(\"\");\n    }\n    lines.push(...wrap(base64.encode(data), lineLength));\n    lines.push(`-----END ${label}-----`);\n    return `${lines.join(newline)}${newline}`;\n}\nexport function encodeMany(blocks, options = {}) {\n    return blocks.map((block) => encode(block.label, block.data, { ...options, headers: block.headers ?? options.headers })).join(\"\");\n}\nexport function decode(text, options = {}) {\n    return collectBlocks(text, options).map(({ lineLength: _lineLength, newline: _newline, ...block }) => block);\n}\nexport function find(text, label) {\n    return decode(text, { label })[0];\n}\nexport function findAll(text, label) {\n    return decode(text, { label });\n}\nexport function decodeFirst(text, label) {\n    const [block] = decode(text, { label, strict: true });\n    return block.data;\n}\nexport function parse(text, options = {}) {\n    const [block] = collectBlocks(text, { ...options, strict: true });\n    const format = {\n        label: block.label,\n        headers: block.headers,\n        lineLength: block.lineLength,\n        newline: block.newline,\n    };\n    return {\n        bytes: block.data,\n        format,\n        normalized: encode(block.label, block.data, format),\n    };\n}\nexport function format(data, value) {\n    return encode(value.label, data, value);\n}\nexport const pem = { decode, decodeFirst, encode, encodeMany, find, findAll, format, parse };\nexport const pemConverter = {\n    name: \"pem\",\n    encode: (data, options) => {\n        if (!options?.label) {\n            throw new TypeError(\"PEM label is required\");\n        }\n        return encode(options.label, data, options);\n    },\n    decode: (text, options) => decodeFirst(text, options?.label),\n    format,\n    is: (text) => typeof text === \"string\" && /-----BEGIN [^-]+-----/.test(text),\n    parse,\n};\n","function keyOf(name) {\n    return name.trim().toLowerCase();\n}\nfunction toError(error) {\n    return error instanceof Error ? error : new Error(String(error));\n}\nfunction removeConverter(converters, primaryNames, converter) {\n    for (const alias of [converter.name, ...(converter.aliases ?? [])]) {\n        converters.delete(keyOf(alias));\n    }\n    primaryNames.delete(keyOf(converter.name));\n}\nfunction requireCapability(converter, name, capability) {\n    const method = converter[capability];\n    if (typeof method !== \"function\") {\n        throw new Error(`Converter '${name}' does not support ${capability}()`);\n    }\n    return method;\n}\nfunction detectConfidence(name, text, converter) {\n    const normalizedName = keyOf(converter.name || name);\n    const trimmed = text.trim();\n    if (!trimmed) {\n        return 0;\n    }\n    let accepted = false;\n    if (converter.is) {\n        accepted = converter.is(text);\n    }\n    let decodable = false;\n    try {\n        converter.decode(text);\n        decodable = true;\n    }\n    catch {\n        decodable = false;\n    }\n    if (!accepted && !decodable) {\n        return 0;\n    }\n    switch (normalizedName) {\n        case \"pem\":\n            return /-----BEGIN [^-]+-----/.test(text) ? 1 : 0;\n        case \"hex\": {\n            const compact = trimmed.replace(/^0x/i, \"\").replace(/[\\s:.-]/g, \"\");\n            if (!compact || /[^0-9a-f]/i.test(compact) || compact.length % 2 !== 0) {\n                return 0;\n            }\n            if (/^0x/i.test(trimmed) || /[:\\s.-]/.test(trimmed)) {\n                return 0.95;\n            }\n            if (/[a-f]/.test(trimmed) || /[A-F]/.test(trimmed)) {\n                return 0.8;\n            }\n            return 0.45;\n        }\n        case \"base64url\":\n            if (/[-_]/.test(trimmed)) {\n                return 0.95;\n            }\n            if (/=/.test(trimmed)) {\n                return 0.1;\n            }\n            return 0.6;\n        case \"base64\":\n            if (/[+/=]/.test(trimmed)) {\n                return 0.9;\n            }\n            return 0.55;\n        case \"binary\":\n        case \"utf8\":\n        case \"utf16be\":\n        case \"utf16le\":\n            return 0;\n        default:\n            return accepted && decodable ? 0.75 : 0.5;\n    }\n}\nexport function createConverterRegistry(initialConverters = []) {\n    const converters = new Map();\n    const primaryNames = new Set();\n    const api = {\n        register(converter, options = {}) {\n            if (!converter.name || !keyOf(converter.name)) {\n                throw new TypeError(\"Converter name is required\");\n            }\n            const names = [...new Set([converter.name, ...(converter.aliases ?? [])].map(keyOf))];\n            const conflicts = new Set();\n            for (const name of names) {\n                const existing = converters.get(name);\n                if (!existing) {\n                    continue;\n                }\n                if (!options.override) {\n                    throw new Error(`Converter '${name}' is already registered`);\n                }\n                conflicts.add(existing);\n            }\n            for (const conflicting of conflicts) {\n                removeConverter(converters, primaryNames, conflicting);\n            }\n            for (const name of names) {\n                converters.set(name, converter);\n            }\n            primaryNames.add(keyOf(converter.name));\n            return this;\n        },\n        unregister(name) {\n            const converter = converters.get(keyOf(name));\n            if (!converter) {\n                return false;\n            }\n            removeConverter(converters, primaryNames, converter);\n            return true;\n        },\n        has(name) {\n            return converters.has(keyOf(name));\n        },\n        get(name) {\n            const converter = converters.get(keyOf(name));\n            if (!converter) {\n                throw new Error(`Converter '${name}' is not registered`);\n            }\n            return converter;\n        },\n        list() {\n            return [...primaryNames].map((name) => this.get(name));\n        },\n        encode(name, data, options) {\n            return this.get(name).encode(data, options);\n        },\n        decode(name, text, options) {\n            return this.get(name).decode(text, options);\n        },\n        tryDecode(name, text, options) {\n            try {\n                return { ok: true, bytes: this.decode(name, text, options) };\n            }\n            catch (error) {\n                return { ok: false, error: toError(error) };\n            }\n        },\n        normalize(name, text, options) {\n            const converter = this.get(name);\n            return requireCapability(converter, name, \"normalize\").call(converter, text, options);\n        },\n        parse(name, text, options) {\n            const converter = this.get(name);\n            return requireCapability(converter, name, \"parse\").call(converter, text, options);\n        },\n        format(name, data, format) {\n            const converter = this.get(name);\n            return requireCapability(converter, name, \"format\").call(converter, data, format);\n        },\n        transcode(text, options) {\n            const bytes = this.decode(options.from, text, options.fromOptions);\n            return this.encode(options.to, bytes, options.toOptions);\n        },\n        detect(text, options = {}) {\n            const formatNames = options.formats?.length\n                ? options.formats.map((name) => String(name))\n                : this.list()\n                    .map((converter) => converter.name)\n                    .filter((name) => ![\"binary\", \"utf8\", \"utf16be\", \"utf16le\"].includes(keyOf(name)));\n            const detections = new Map();\n            for (const requestedName of formatNames) {\n                const converter = this.get(requestedName);\n                const confidence = detectConfidence(requestedName, text, converter);\n                if (confidence <= 0) {\n                    continue;\n                }\n                const format = converter.name;\n                const current = detections.get(format);\n                if (!current || confidence > current.confidence) {\n                    detections.set(format, { format, confidence });\n                }\n            }\n            return [...detections.values()].sort((left, right) => right.confidence - left.confidence);\n        },\n    };\n    for (const converter of initialConverters) {\n        api.register(converter);\n    }\n    return api;\n}\n","import { base64, base64url, binary, hex, utf8, utf16 } from \"../encoding/index.js\";\nimport { pemConverter } from \"../pem/index.js\";\nexport { pemConverter } from \"../pem/index.js\";\nimport { createConverterRegistry } from \"./registry.js\";\nexport const binaryConverter = {\n    name: \"binary\",\n    aliases: [\"latin1\"],\n    encode: binary.encode,\n    decode: binary.decode,\n    is: binary.is,\n};\nexport const hexConverter = {\n    name: \"hex\",\n    encode: hex.encode,\n    decode: hex.decode,\n    format: hex.format,\n    is: hex.is,\n    normalize: hex.normalize,\n    parse: hex.parse,\n};\nexport const base64Converter = {\n    name: \"base64\",\n    aliases: [\"b64\"],\n    encode: base64.encode,\n    decode: base64.decode,\n    is: base64.is,\n    normalize: base64.normalize,\n};\nexport const base64urlConverter = {\n    name: \"base64url\",\n    aliases: [\"base64-url\", \"b64url\"],\n    encode: base64url.encode,\n    decode: base64url.decode,\n    is: base64url.is,\n    normalize: base64url.normalize,\n};\nexport const utf8Converter = {\n    name: \"utf8\",\n    aliases: [\"utf-8\"],\n    encode: (data) => utf8.decode(data),\n    decode: (text) => utf8.encode(text),\n    is: (text) => typeof text === \"string\",\n};\nexport const utf16beConverter = {\n    name: \"utf16be\",\n    aliases: [\"utf16\", \"utf-16\", \"utf-16be\"],\n    encode: (data) => utf16.decode(data),\n    decode: (text) => utf16.encode(text),\n    is: (text) => typeof text === \"string\",\n};\nexport const utf16leConverter = {\n    name: \"utf16le\",\n    aliases: [\"utf-16le\", \"ucs2\", \"usc2\"],\n    encode: (data) => utf16.decode(data, { littleEndian: true }),\n    decode: (text) => utf16.encode(text, { littleEndian: true }),\n    is: (text) => typeof text === \"string\",\n};\nexport const defaultConverters = [\n    binaryConverter,\n    hexConverter,\n    base64Converter,\n    base64urlConverter,\n    utf8Converter,\n    utf16beConverter,\n    utf16leConverter,\n    pemConverter,\n];\nexport const defaultConverterRegistry = createConverterRegistry(defaultConverters);\n","import { toArrayBuffer } from \"../bytes/index.js\";\nimport { base64, base64url, binary, hex, utf8, utf16 } from \"../encoding/index.js\";\nimport { defaultConverterRegistry } from \"./defaults.js\";\nfunction encode(name, data, ...args) {\n    return defaultConverterRegistry.encode(name, data, ...args);\n}\nfunction decode(name, text, ...args) {\n    return defaultConverterRegistry.decode(name, text, ...args);\n}\nfunction tryDecode(name, text, ...args) {\n    return defaultConverterRegistry.tryDecode(name, text, ...args);\n}\nfunction normalize(name, text, ...args) {\n    return defaultConverterRegistry.normalize(name, text, ...args);\n}\nfunction parse(name, text, ...args) {\n    return defaultConverterRegistry.parse(name, text, ...args);\n}\nfunction format(name, data, value) {\n    return defaultConverterRegistry.format(name, data, value);\n}\nfunction transcode(text, options) {\n    return defaultConverterRegistry.transcode(text, options);\n}\nfunction detect(text, options) {\n    return defaultConverterRegistry.detect(text, options);\n}\nfunction normalizeEncodingName(encoding) {\n    return encoding.toLowerCase();\n}\nexport const convert = {\n    encode,\n    decode,\n    tryDecode,\n    normalize,\n    parse,\n    format,\n    transcode,\n    detect,\n    to(format, data, ...args) {\n        return encode(format, data, ...args);\n    },\n    from(format, text, ...args) {\n        return decode(format, text, ...args);\n    },\n    toString(data, encoding = \"utf8\") {\n        return encode(encoding, data);\n    },\n    fromString(text, encoding = \"utf8\") {\n        if (normalizeEncodingName(encoding) === \"hex\") {\n            return toArrayBuffer(hex.decode(text, { allowOddLength: true }));\n        }\n        return toArrayBuffer(decode(encoding, text));\n    },\n    toBase64: base64.encode,\n    fromBase64: (text) => toArrayBuffer(base64.decode(text)),\n    toBase64Url: base64url.encode,\n    fromBase64Url: (text) => toArrayBuffer(base64url.decode(text)),\n    toHex: hex.encode,\n    fromHex: (text) => toArrayBuffer(hex.decode(text, { allowOddLength: true })),\n    toBinary: binary.encode,\n    fromBinary: (text) => toArrayBuffer(binary.decode(text)),\n    toUtf8String: utf8.decode,\n    fromUtf8String: (text) => toArrayBuffer(utf8.encode(text)),\n    toUtf16String: (data, littleEndian = false) => utf16.decode(data, { littleEndian }),\n    fromUtf16String: (text, littleEndian = false) => toArrayBuffer(utf16.encode(text, { littleEndian })),\n    isHex: hex.is,\n    isBase64: base64.is,\n    isBase64Url: base64url.is,\n    formatString: base64.normalize,\n};\n","export var AsnTypeTypes;\n(function (AsnTypeTypes) {\n    AsnTypeTypes[AsnTypeTypes[\"Sequence\"] = 0] = \"Sequence\";\n    AsnTypeTypes[AsnTypeTypes[\"Set\"] = 1] = \"Set\";\n    AsnTypeTypes[AsnTypeTypes[\"Choice\"] = 2] = \"Choice\";\n})(AsnTypeTypes || (AsnTypeTypes = {}));\nexport var AsnPropTypes;\n(function (AsnPropTypes) {\n    AsnPropTypes[AsnPropTypes[\"Any\"] = 1] = \"Any\";\n    AsnPropTypes[AsnPropTypes[\"Boolean\"] = 2] = \"Boolean\";\n    AsnPropTypes[AsnPropTypes[\"OctetString\"] = 3] = \"OctetString\";\n    AsnPropTypes[AsnPropTypes[\"BitString\"] = 4] = \"BitString\";\n    AsnPropTypes[AsnPropTypes[\"Integer\"] = 5] = \"Integer\";\n    AsnPropTypes[AsnPropTypes[\"Enumerated\"] = 6] = \"Enumerated\";\n    AsnPropTypes[AsnPropTypes[\"ObjectIdentifier\"] = 7] = \"ObjectIdentifier\";\n    AsnPropTypes[AsnPropTypes[\"Utf8String\"] = 8] = \"Utf8String\";\n    AsnPropTypes[AsnPropTypes[\"BmpString\"] = 9] = \"BmpString\";\n    AsnPropTypes[AsnPropTypes[\"UniversalString\"] = 10] = \"UniversalString\";\n    AsnPropTypes[AsnPropTypes[\"NumericString\"] = 11] = \"NumericString\";\n    AsnPropTypes[AsnPropTypes[\"PrintableString\"] = 12] = \"PrintableString\";\n    AsnPropTypes[AsnPropTypes[\"TeletexString\"] = 13] = \"TeletexString\";\n    AsnPropTypes[AsnPropTypes[\"VideotexString\"] = 14] = \"VideotexString\";\n    AsnPropTypes[AsnPropTypes[\"IA5String\"] = 15] = \"IA5String\";\n    AsnPropTypes[AsnPropTypes[\"GraphicString\"] = 16] = \"GraphicString\";\n    AsnPropTypes[AsnPropTypes[\"VisibleString\"] = 17] = \"VisibleString\";\n    AsnPropTypes[AsnPropTypes[\"GeneralString\"] = 18] = \"GeneralString\";\n    AsnPropTypes[AsnPropTypes[\"CharacterString\"] = 19] = \"CharacterString\";\n    AsnPropTypes[AsnPropTypes[\"UTCTime\"] = 20] = \"UTCTime\";\n    AsnPropTypes[AsnPropTypes[\"GeneralizedTime\"] = 21] = \"GeneralizedTime\";\n    AsnPropTypes[AsnPropTypes[\"DATE\"] = 22] = \"DATE\";\n    AsnPropTypes[AsnPropTypes[\"TimeOfDay\"] = 23] = \"TimeOfDay\";\n    AsnPropTypes[AsnPropTypes[\"DateTime\"] = 24] = \"DateTime\";\n    AsnPropTypes[AsnPropTypes[\"Duration\"] = 25] = \"Duration\";\n    AsnPropTypes[AsnPropTypes[\"TIME\"] = 26] = \"TIME\";\n    AsnPropTypes[AsnPropTypes[\"Null\"] = 27] = \"Null\";\n    AsnPropTypes[AsnPropTypes[\"RelativeObjectIdentifier\"] = 28] = \"RelativeObjectIdentifier\";\n})(AsnPropTypes || (AsnPropTypes = {}));\n","import * as asn1js from \"asn1js\";\nimport { isBufferSource, toArrayBuffer } from \"@peculiar/utils\";\nexport class BitString {\n    unusedBits = 0;\n    value = new ArrayBuffer(0);\n    constructor(params, unusedBits = 0) {\n        if (params) {\n            if (typeof params === \"number\") {\n                this.fromNumber(params);\n            }\n            else if (isBufferSource(params)) {\n                this.unusedBits = unusedBits;\n                this.value = toArrayBuffer(params);\n            }\n            else {\n                throw TypeError(\"Unsupported type of 'params' argument for BitString\");\n            }\n        }\n    }\n    fromASN(asn) {\n        if (!(asn instanceof asn1js.BitString)) {\n            throw new TypeError(\"Argument 'asn' is not instance of ASN.1 BitString\");\n        }\n        this.unusedBits = asn.valueBlock.unusedBits;\n        this.value = toArrayBuffer(asn.valueBlock.valueHex);\n        return this;\n    }\n    toASN() {\n        return new asn1js.BitString({\n            unusedBits: this.unusedBits,\n            valueHex: this.value,\n        });\n    }\n    toSchema(name) {\n        return new asn1js.BitString({ name });\n    }\n    toNumber() {\n        let res = \"\";\n        const uintArray = new Uint8Array(this.value);\n        for (const octet of uintArray) {\n            res += octet.toString(2).padStart(8, \"0\");\n        }\n        res = res.split(\"\").reverse().join(\"\");\n        if (this.unusedBits) {\n            res = res.slice(this.unusedBits).padStart(this.unusedBits, \"0\");\n        }\n        return parseInt(res, 2);\n    }\n    fromNumber(value) {\n        let bits = value.toString(2);\n        const octetSize = (bits.length + 7) >> 3;\n        this.unusedBits = (octetSize << 3) - bits.length;\n        const octets = new Uint8Array(octetSize);\n        bits = bits\n            .padStart(octetSize << 3, \"0\")\n            .split(\"\")\n            .reverse()\n            .join(\"\");\n        let index = 0;\n        while (index < octetSize) {\n            octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);\n            index++;\n        }\n        this.value = octets.buffer;\n    }\n}\n","import * as asn1js from \"asn1js\";\nimport { isBufferSource, toArrayBuffer } from \"@peculiar/utils\";\nexport class OctetString {\n    buffer;\n    get byteLength() {\n        return this.buffer.byteLength;\n    }\n    get byteOffset() {\n        return 0;\n    }\n    constructor(param) {\n        if (typeof param === \"number\") {\n            this.buffer = new ArrayBuffer(param);\n        }\n        else {\n            if (isBufferSource(param)) {\n                this.buffer = toArrayBuffer(param);\n            }\n            else if (Array.isArray(param)) {\n                this.buffer = new Uint8Array(param).buffer;\n            }\n            else {\n                this.buffer = new ArrayBuffer(0);\n            }\n        }\n    }\n    fromASN(asn) {\n        if (!(asn instanceof asn1js.OctetString)) {\n            throw new TypeError(\"Argument 'asn' is not instance of ASN.1 OctetString\");\n        }\n        this.buffer = toArrayBuffer(asn.valueBlock.valueHex);\n        return this;\n    }\n    toASN() {\n        return new asn1js.OctetString({ valueHex: this.buffer });\n    }\n    toSchema(name) {\n        return new asn1js.OctetString({ name });\n    }\n}\n","import * as asn1js from \"asn1js\";\nimport { toArrayBuffer } from \"@peculiar/utils\";\nimport { AsnPropTypes } from \"./enums.js\";\nimport { OctetString } from \"./types/index.js\";\nexport const AsnAnyConverter = {\n    fromASN: (value) => (value instanceof asn1js.Null ? null : toArrayBuffer(value.valueBeforeDecodeView)),\n    toASN: (value) => {\n        if (value === null) {\n            return new asn1js.Null();\n        }\n        const schema = asn1js.fromBER(value);\n        if (schema.result.error) {\n            throw new Error(schema.result.error);\n        }\n        return schema.result;\n    },\n};\nexport const AsnIntegerConverter = {\n    fromASN: (value) => value.valueBlock.valueHexView.byteLength >= 4\n        ? value.valueBlock.toString()\n        : value.valueBlock.valueDec,\n    toASN: (value) => new asn1js.Integer({ value: +value }),\n};\nexport const AsnEnumeratedConverter = {\n    fromASN: (value) => value.valueBlock.valueDec,\n    toASN: (value) => new asn1js.Enumerated({ value }),\n};\nexport const AsnIntegerArrayBufferConverter = {\n    fromASN: (value) => toArrayBuffer(value.valueBlock.valueHexView),\n    toASN: (value) => new asn1js.Integer({ valueHex: value }),\n};\nexport const AsnIntegerBigIntConverter = {\n    fromASN: (value) => value.toBigInt(),\n    toASN: (value) => asn1js.Integer.fromBigInt(value),\n};\nexport const AsnBitStringConverter = {\n    fromASN: (value) => toArrayBuffer(value.valueBlock.valueHexView),\n    toASN: (value) => new asn1js.BitString({ valueHex: value }),\n};\nexport const AsnObjectIdentifierConverter = {\n    fromASN: (value) => value.valueBlock.toString(),\n    toASN: (value) => new asn1js.ObjectIdentifier({ value }),\n};\nexport const AsnRelativeObjectIdentifierConverter = {\n    fromASN: (value) => value.valueBlock.toString(),\n    toASN: (value) => new asn1js.RelativeObjectIdentifier({ value }),\n};\nexport const AsnBooleanConverter = {\n    fromASN: (value) => value.valueBlock.value,\n    toASN: (value) => new asn1js.Boolean({ value }),\n};\nexport const AsnOctetStringConverter = {\n    fromASN: (value) => toArrayBuffer(value.valueBlock.valueHexView),\n    toASN: (value) => new asn1js.OctetString({ valueHex: value }),\n};\nexport const AsnConstructedOctetStringConverter = {\n    fromASN: (value) => new OctetString(value.getValue()),\n    toASN: (value) => value.toASN(),\n};\nfunction createStringConverter(Asn1Type) {\n    return {\n        fromASN: (value) => value.valueBlock.value,\n        toASN: (value) => new Asn1Type({ value }),\n    };\n}\nexport const AsnUtf8StringConverter = createStringConverter(asn1js.Utf8String);\nexport const AsnBmpStringConverter = createStringConverter(asn1js.BmpString);\nexport const AsnUniversalStringConverter = createStringConverter(asn1js.UniversalString);\nexport const AsnNumericStringConverter = createStringConverter(asn1js.NumericString);\nexport const AsnPrintableStringConverter = createStringConverter(asn1js.PrintableString);\nexport const AsnTeletexStringConverter = createStringConverter(asn1js.TeletexString);\nexport const AsnVideotexStringConverter = createStringConverter(asn1js.VideotexString);\nexport const AsnIA5StringConverter = createStringConverter(asn1js.IA5String);\nexport const AsnGraphicStringConverter = createStringConverter(asn1js.GraphicString);\nexport const AsnVisibleStringConverter = createStringConverter(asn1js.VisibleString);\nexport const AsnGeneralStringConverter = createStringConverter(asn1js.GeneralString);\nexport const AsnCharacterStringConverter = createStringConverter(asn1js.CharacterString);\nexport const AsnUTCTimeConverter = {\n    fromASN: (value) => value.toDate(),\n    toASN: (value) => new asn1js.UTCTime({ valueDate: value }),\n};\nexport const AsnGeneralizedTimeConverter = {\n    fromASN: (value) => value.toDate(),\n    toASN: (value) => new asn1js.GeneralizedTime({ valueDate: value }),\n};\nexport const AsnNullConverter = {\n    fromASN: () => null,\n    toASN: () => {\n        return new asn1js.Null();\n    },\n};\nexport function defaultConverter(type) {\n    switch (type) {\n        case AsnPropTypes.Any:\n            return AsnAnyConverter;\n        case AsnPropTypes.BitString:\n            return AsnBitStringConverter;\n        case AsnPropTypes.BmpString:\n            return AsnBmpStringConverter;\n        case AsnPropTypes.Boolean:\n            return AsnBooleanConverter;\n        case AsnPropTypes.CharacterString:\n            return AsnCharacterStringConverter;\n        case AsnPropTypes.Enumerated:\n            return AsnEnumeratedConverter;\n        case AsnPropTypes.GeneralString:\n            return AsnGeneralStringConverter;\n        case AsnPropTypes.GeneralizedTime:\n            return AsnGeneralizedTimeConverter;\n        case AsnPropTypes.GraphicString:\n            return AsnGraphicStringConverter;\n        case AsnPropTypes.IA5String:\n            return AsnIA5StringConverter;\n        case AsnPropTypes.Integer:\n            return AsnIntegerConverter;\n        case AsnPropTypes.Null:\n            return AsnNullConverter;\n        case AsnPropTypes.NumericString:\n            return AsnNumericStringConverter;\n        case AsnPropTypes.ObjectIdentifier:\n            return AsnObjectIdentifierConverter;\n        case AsnPropTypes.RelativeObjectIdentifier:\n            return AsnRelativeObjectIdentifierConverter;\n        case AsnPropTypes.OctetString:\n            return AsnOctetStringConverter;\n        case AsnPropTypes.PrintableString:\n            return AsnPrintableStringConverter;\n        case AsnPropTypes.TeletexString:\n            return AsnTeletexStringConverter;\n        case AsnPropTypes.UTCTime:\n            return AsnUTCTimeConverter;\n        case AsnPropTypes.UniversalString:\n            return AsnUniversalStringConverter;\n        case AsnPropTypes.Utf8String:\n            return AsnUtf8StringConverter;\n        case AsnPropTypes.VideotexString:\n            return AsnVideotexStringConverter;\n        case AsnPropTypes.VisibleString:\n            return AsnVisibleStringConverter;\n        default:\n            return null;\n    }\n}\n","export function isConvertible(target) {\n    if (typeof target === \"function\" && target.prototype) {\n        if (target.prototype.toASN && target.prototype.fromASN) {\n            return true;\n        }\n        else {\n            return isConvertible(target.prototype);\n        }\n    }\n    else {\n        return !!(target && typeof target === \"object\" && \"toASN\" in target && \"fromASN\" in target);\n    }\n}\nexport function isTypeOfArray(target) {\n    if (target) {\n        const proto = Object.getPrototypeOf(target);\n        if (proto?.prototype?.constructor === Array) {\n            return true;\n        }\n        return isTypeOfArray(proto);\n    }\n    return false;\n}\nexport function isArrayEqual(bytes1, bytes2) {\n    if (!(bytes1 && bytes2)) {\n        return false;\n    }\n    if (bytes1.byteLength !== bytes2.byteLength) {\n        return false;\n    }\n    const b1 = new Uint8Array(bytes1);\n    const b2 = new Uint8Array(bytes2);\n    for (let i = 0; i < bytes1.byteLength; i++) {\n        if (b1[i] !== b2[i]) {\n            return false;\n        }\n    }\n    return true;\n}\n","import * as asn1js from \"asn1js\";\nimport { AsnPropTypes, AsnTypeTypes } from \"./enums.js\";\nimport { isConvertible } from \"./helper.js\";\nexport class AsnSchemaStorage {\n    items = new WeakMap();\n    has(target) {\n        return this.items.has(target);\n    }\n    get(target, checkSchema = false) {\n        const schema = this.items.get(target);\n        if (!schema) {\n            throw new Error(`Cannot get schema for '${target.prototype.constructor.name}' target`);\n        }\n        if (checkSchema && !schema.schema) {\n            throw new Error(`Schema '${target.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);\n        }\n        return schema;\n    }\n    cache(target) {\n        const schema = this.get(target);\n        if (!schema.schema) {\n            schema.schema = this.create(target, true);\n        }\n    }\n    createDefault(target) {\n        const schema = {\n            type: AsnTypeTypes.Sequence,\n            items: {},\n        };\n        const parentSchema = this.findParentSchema(target);\n        if (parentSchema) {\n            Object.assign(schema, parentSchema);\n            schema.items = Object.assign({}, schema.items, parentSchema.items);\n        }\n        return schema;\n    }\n    create(target, useNames) {\n        const schema = this.items.get(target) || this.createDefault(target);\n        const asn1Value = [];\n        for (const key in schema.items) {\n            const item = schema.items[key];\n            const name = useNames ? key : \"\";\n            let asn1Item;\n            if (typeof item.type === \"number\") {\n                const Asn1TypeName = AsnPropTypes[item.type];\n                const Asn1Type = asn1js[Asn1TypeName];\n                if (!Asn1Type) {\n                    throw new Error(`Cannot get ASN1 class by name '${Asn1TypeName}'`);\n                }\n                asn1Item = new Asn1Type({ name });\n            }\n            else if (isConvertible(item.type)) {\n                const instance = new item.type();\n                asn1Item = instance.toSchema(name);\n            }\n            else if (item.optional) {\n                const itemSchema = this.get(item.type);\n                if (itemSchema.type === AsnTypeTypes.Choice) {\n                    asn1Item = new asn1js.Any({ name });\n                }\n                else {\n                    asn1Item = this.create(item.type, false);\n                    asn1Item.name = name;\n                }\n            }\n            else {\n                asn1Item = new asn1js.Any({ name });\n            }\n            const optional = !!item.optional || item.defaultValue !== undefined;\n            if (item.repeated) {\n                asn1Item.name = \"\";\n                const Container = item.repeated === \"set\" ? asn1js.Set : asn1js.Sequence;\n                asn1Item = new Container({\n                    name: \"\",\n                    value: [\n                        new asn1js.Repeated({\n                            name,\n                            value: asn1Item,\n                        }),\n                    ],\n                });\n            }\n            if (item.context !== null && item.context !== undefined) {\n                if (item.implicit) {\n                    if (typeof item.type === \"number\" || isConvertible(item.type)) {\n                        const Container = item.repeated ? asn1js.Constructed : asn1js.Primitive;\n                        asn1Value.push(new Container({\n                            name,\n                            optional,\n                            idBlock: {\n                                tagClass: 3,\n                                tagNumber: item.context,\n                            },\n                        }));\n                    }\n                    else {\n                        this.cache(item.type);\n                        const isRepeated = !!item.repeated;\n                        let value = !isRepeated ? this.get(item.type, true).schema : asn1Item;\n                        value = \"valueBlock\" in value ? value.valueBlock.value : value.value;\n                        asn1Value.push(new asn1js.Constructed({\n                            name: !isRepeated ? name : \"\",\n                            optional,\n                            idBlock: {\n                                tagClass: 3,\n                                tagNumber: item.context,\n                            },\n                            value: value,\n                        }));\n                    }\n                }\n                else {\n                    asn1Value.push(new asn1js.Constructed({\n                        optional,\n                        idBlock: {\n                            tagClass: 3,\n                            tagNumber: item.context,\n                        },\n                        value: [asn1Item],\n                    }));\n                }\n            }\n            else {\n                asn1Item.optional = optional;\n                asn1Value.push(asn1Item);\n            }\n        }\n        switch (schema.type) {\n            case AsnTypeTypes.Sequence:\n                return new asn1js.Sequence({\n                    value: asn1Value,\n                    name: \"\",\n                });\n            case AsnTypeTypes.Set:\n                return new asn1js.Set({\n                    value: asn1Value,\n                    name: \"\",\n                });\n            case AsnTypeTypes.Choice:\n                return new asn1js.Choice({\n                    value: asn1Value,\n                    name: \"\",\n                });\n            default:\n                throw new Error(\"Unsupported ASN1 type in use\");\n        }\n    }\n    set(target, schema) {\n        this.items.set(target, schema);\n        return this;\n    }\n    findParentSchema(target) {\n        const parent = Object.getPrototypeOf(target);\n        if (parent) {\n            const schema = this.items.get(parent);\n            return schema || this.findParentSchema(parent);\n        }\n        return null;\n    }\n}\n","import { AsnSchemaStorage } from \"./schema.js\";\nexport const schemaStorage = new AsnSchemaStorage();\n","import * as converters from \"./converters.js\";\nimport { AsnTypeTypes } from \"./enums.js\";\nimport { schemaStorage } from \"./storage.js\";\nexport const AsnType = (options) => (target) => {\n    let schema;\n    if (!schemaStorage.has(target)) {\n        schema = schemaStorage.createDefault(target);\n        schemaStorage.set(target, schema);\n    }\n    else {\n        schema = schemaStorage.get(target);\n    }\n    Object.assign(schema, options);\n};\nexport const AsnChoiceType = () => AsnType({ type: AsnTypeTypes.Choice });\nexport const AsnSetType = (options) => AsnType({\n    type: AsnTypeTypes.Set,\n    ...options,\n});\nexport const AsnSequenceType = (options) => AsnType({\n    type: AsnTypeTypes.Sequence,\n    ...options,\n});\nexport const AsnProp = (options) => (target, propertyKey) => {\n    let schema;\n    if (!schemaStorage.has(target.constructor)) {\n        schema = schemaStorage.createDefault(target.constructor);\n        schemaStorage.set(target.constructor, schema);\n    }\n    else {\n        schema = schemaStorage.get(target.constructor);\n    }\n    const copyOptions = Object.assign({}, options);\n    if (typeof copyOptions.type === \"number\" && !copyOptions.converter) {\n        const defaultConverter = converters.defaultConverter(options.type);\n        if (!defaultConverter) {\n            throw new Error(`Cannot get default converter for property '${propertyKey}' of ${target.constructor.name}`);\n        }\n        copyOptions.converter = defaultConverter;\n    }\n    copyOptions.raw = options.raw;\n    schema.items[propertyKey] = copyOptions;\n};\n","export class AsnSchemaValidationError extends Error {\n    schemas = [];\n}\n","import * as asn1js from \"asn1js\";\nimport { toArrayBuffer } from \"@peculiar/utils\";\nimport { AsnPropTypes, AsnTypeTypes } from \"./enums.js\";\nimport * as converters from \"./converters.js\";\nimport { AsnSchemaValidationError } from \"./errors/index.js\";\nimport { isConvertible, isTypeOfArray } from \"./helper.js\";\nimport { schemaStorage } from \"./storage.js\";\nexport class AsnParser {\n    static parse(data, target, options) {\n        const asn1Parsed = asn1js.fromBER(toArrayBuffer(data), options?.berOptions);\n        if (asn1Parsed.result.error) {\n            throw new Error(asn1Parsed.result.error);\n        }\n        const res = this.fromASN(asn1Parsed.result, target, options);\n        return res;\n    }\n    static fromASN(asn1Schema, target, options) {\n        try {\n            if (isConvertible(target)) {\n                const value = new target();\n                return value.fromASN(asn1Schema);\n            }\n            const schema = schemaStorage.get(target);\n            schemaStorage.cache(target);\n            let targetSchema = schema.schema;\n            const choiceResult = this.handleChoiceTypes(asn1Schema, schema, target, targetSchema, options);\n            if (choiceResult?.result) {\n                return choiceResult.result;\n            }\n            if (choiceResult?.targetSchema) {\n                targetSchema = choiceResult.targetSchema;\n            }\n            const sequenceResult = this.handleSequenceTypes(asn1Schema, schema, target, targetSchema);\n            const res = new target();\n            if (isTypeOfArray(target)) {\n                return this.handleArrayTypes(asn1Schema, schema, target, options);\n            }\n            this.processSchemaItems(schema, sequenceResult, res, options);\n            return res;\n        }\n        catch (error) {\n            if (error instanceof AsnSchemaValidationError) {\n                error.schemas.push(target.name);\n            }\n            throw error;\n        }\n    }\n    static handleChoiceTypes(asn1Schema, schema, target, targetSchema, options) {\n        if (asn1Schema.constructor === asn1js.Constructed && schema.type === AsnTypeTypes.Choice && asn1Schema.idBlock.tagClass === 3) {\n            for (const key in schema.items) {\n                const schemaItem = schema.items[key];\n                if (schemaItem.context === asn1Schema.idBlock.tagNumber && schemaItem.implicit) {\n                    if (typeof schemaItem.type === \"function\" && schemaStorage.has(schemaItem.type)) {\n                        const fieldSchema = schemaStorage.get(schemaItem.type);\n                        if (fieldSchema && fieldSchema.type === AsnTypeTypes.Sequence) {\n                            const newSeq = new asn1js.Sequence();\n                            if (\"value\" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value) && \"value\" in newSeq.valueBlock) {\n                                newSeq.valueBlock.value = asn1Schema.valueBlock.value;\n                                const fieldValue = this.fromASN(newSeq, schemaItem.type, options);\n                                const res = new target();\n                                res[key] = fieldValue;\n                                return { result: res };\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        else if (asn1Schema.constructor === asn1js.Constructed && schema.type !== AsnTypeTypes.Choice) {\n            const newTargetSchema = new asn1js.Constructed({\n                idBlock: {\n                    tagClass: 3,\n                    tagNumber: asn1Schema.idBlock.tagNumber,\n                },\n                value: schema.schema.valueBlock.value,\n            });\n            for (const key in schema.items) {\n                delete asn1Schema[key];\n            }\n            return { targetSchema: newTargetSchema };\n        }\n        return null;\n    }\n    static handleSequenceTypes(asn1Schema, schema, target, targetSchema) {\n        if (schema.type === AsnTypeTypes.Sequence) {\n            const asn1ComparedSchema = asn1js.compareSchema({}, asn1Schema, targetSchema);\n            if (!asn1ComparedSchema.verified) {\n                throw new AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema.${asn1ComparedSchema.result.error ? ` ${asn1ComparedSchema.result.error}` : \"\"}`);\n            }\n            return asn1ComparedSchema;\n        }\n        else {\n            const asn1ComparedSchema = asn1js.compareSchema({}, asn1Schema, targetSchema);\n            if (!asn1ComparedSchema.verified) {\n                throw new AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema.${asn1ComparedSchema.result.error ? ` ${asn1ComparedSchema.result.error}` : \"\"}`);\n            }\n            return asn1ComparedSchema;\n        }\n    }\n    static processRepeatedField(asn1Elements, asn1Index, schemaItem) {\n        let elementsToProcess = asn1Elements.slice(asn1Index);\n        if (elementsToProcess.length === 1 && elementsToProcess[0].constructor.name === \"Sequence\") {\n            const seq = elementsToProcess[0];\n            if (seq.valueBlock && seq.valueBlock.value && Array.isArray(seq.valueBlock.value)) {\n                elementsToProcess = seq.valueBlock.value;\n            }\n        }\n        if (typeof schemaItem.type === \"number\") {\n            const converter = converters.defaultConverter(schemaItem.type);\n            if (!converter)\n                throw new Error(`No converter for ASN.1 type ${schemaItem.type}`);\n            return elementsToProcess\n                .filter((el) => el && el.valueBlock)\n                .map((el) => {\n                try {\n                    return converter.fromASN(el);\n                }\n                catch {\n                    return undefined;\n                }\n            })\n                .filter((v) => v !== undefined);\n        }\n        else {\n            return elementsToProcess\n                .filter((el) => el && el.valueBlock)\n                .map((el) => {\n                try {\n                    return this.fromASN(el, schemaItem.type);\n                }\n                catch {\n                    return undefined;\n                }\n            })\n                .filter((v) => v !== undefined);\n        }\n    }\n    static processPrimitiveField(asn1Element, schemaItem) {\n        const converter = converters.defaultConverter(schemaItem.type);\n        if (!converter)\n            throw new Error(`No converter for ASN.1 type ${schemaItem.type}`);\n        return converter.fromASN(asn1Element);\n    }\n    static isOptionalChoiceField(schemaItem) {\n        return (schemaItem.optional &&\n            typeof schemaItem.type === \"function\" &&\n            schemaStorage.has(schemaItem.type) &&\n            schemaStorage.get(schemaItem.type).type === AsnTypeTypes.Choice);\n    }\n    static processOptionalChoiceField(asn1Element, schemaItem) {\n        try {\n            const value = this.fromASN(asn1Element, schemaItem.type);\n            return {\n                processed: true,\n                value,\n            };\n        }\n        catch (err) {\n            if (err instanceof AsnSchemaValidationError && /Wrong values for Choice type/.test(err.message)) {\n                return { processed: false };\n            }\n            throw err;\n        }\n    }\n    static handleArrayTypes(asn1Schema, schema, target, options) {\n        if (!(\"value\" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value))) {\n            throw new Error(\"Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.\");\n        }\n        const itemType = schema.itemType;\n        if (typeof itemType === \"number\") {\n            const converter = converters.defaultConverter(itemType);\n            if (!converter) {\n                throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);\n            }\n            return target.from(asn1Schema.valueBlock.value, (element) => converter.fromASN(element));\n        }\n        else {\n            return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element, itemType, options));\n        }\n    }\n    static processSchemaItems(schema, asn1ComparedSchema, res, options) {\n        for (const key in schema.items) {\n            const asn1SchemaValue = asn1ComparedSchema.result[key];\n            if (!asn1SchemaValue) {\n                continue;\n            }\n            const schemaItem = schema.items[key];\n            const schemaItemType = schemaItem.type;\n            let parsedValue;\n            if (typeof schemaItemType === \"number\" || isConvertible(schemaItemType)) {\n                parsedValue = this.processPrimitiveSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options);\n            }\n            else {\n                parsedValue = this.processComplexSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options);\n            }\n            if (parsedValue && typeof parsedValue === \"object\" && \"value\" in parsedValue && \"raw\" in parsedValue) {\n                res[key] = parsedValue.value;\n                res[`${key}Raw`] = parsedValue.raw;\n            }\n            else {\n                res[key] = parsedValue;\n            }\n        }\n    }\n    static processPrimitiveSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options) {\n        const converter = schemaItem.converter ?? (isConvertible(schemaItemType) ? new schemaItemType() : null);\n        if (!converter) {\n            throw new Error(\"Converter is empty\");\n        }\n        if (schemaItem.repeated) {\n            return this.processRepeatedPrimitiveItem(asn1SchemaValue, schemaItem, converter, options);\n        }\n        else {\n            return this.processSinglePrimitiveItem(asn1SchemaValue, schemaItem, schemaItemType, converter, options);\n        }\n    }\n    static processRepeatedPrimitiveItem(asn1SchemaValue, schemaItem, converter, options) {\n        if (schemaItem.implicit) {\n            const Container = schemaItem.repeated === \"sequence\" ? asn1js.Sequence : asn1js.Set;\n            const newItem = new Container();\n            newItem.valueBlock = asn1SchemaValue.valueBlock;\n            const newItemAsn = asn1js.fromBER(newItem.toBER(false), options?.berOptions);\n            if (newItemAsn.offset === -1) {\n                throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`);\n            }\n            if (!(\"value\" in newItemAsn.result.valueBlock && Array.isArray(newItemAsn.result.valueBlock.value))) {\n                throw new Error(\"Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.\");\n            }\n            const value = newItemAsn.result.valueBlock.value;\n            return Array.from(value, (element) => converter.fromASN(element));\n        }\n        else {\n            return Array.from(asn1SchemaValue, (element) => converter.fromASN(element));\n        }\n    }\n    static processSinglePrimitiveItem(asn1SchemaValue, schemaItem, schemaItemType, converter, options) {\n        let value = asn1SchemaValue;\n        if (schemaItem.implicit) {\n            let newItem;\n            if (isConvertible(schemaItemType)) {\n                newItem = new schemaItemType().toSchema(\"\");\n            }\n            else {\n                const Asn1TypeName = AsnPropTypes[schemaItemType];\n                const Asn1Type = asn1js[Asn1TypeName];\n                if (!Asn1Type) {\n                    throw new Error(`Cannot get '${Asn1TypeName}' class from asn1js module`);\n                }\n                newItem = new Asn1Type();\n            }\n            newItem.valueBlock = value.valueBlock;\n            value = asn1js.fromBER(newItem.toBER(false), options?.berOptions).result;\n        }\n        return converter.fromASN(value);\n    }\n    static processComplexSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options) {\n        if (schemaItem.repeated) {\n            if (!Array.isArray(asn1SchemaValue)) {\n                throw new Error(\"Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.\");\n            }\n            return Array.from(asn1SchemaValue, (element) => this.fromASN(element, schemaItemType, options));\n        }\n        else {\n            const valueToProcess = this.handleImplicitTagging(asn1SchemaValue, schemaItem, schemaItemType);\n            if (this.isOptionalChoiceField(schemaItem)) {\n                try {\n                    return this.fromASN(valueToProcess, schemaItemType, options);\n                }\n                catch (err) {\n                    if (err instanceof AsnSchemaValidationError && /Wrong values for Choice type/.test(err.message)) {\n                        return undefined;\n                    }\n                    throw err;\n                }\n            }\n            else {\n                const parsedValue = this.fromASN(valueToProcess, schemaItemType, options);\n                if (schemaItem.raw) {\n                    return {\n                        value: parsedValue,\n                        raw: asn1SchemaValue.valueBeforeDecodeView,\n                    };\n                }\n                return parsedValue;\n            }\n        }\n    }\n    static handleImplicitTagging(asn1SchemaValue, schemaItem, schemaItemType) {\n        if (schemaItem.implicit && typeof schemaItem.context === \"number\") {\n            const schema = schemaStorage.get(schemaItemType);\n            if (schema.type === AsnTypeTypes.Sequence) {\n                const newSeq = new asn1js.Sequence();\n                if (\"value\" in asn1SchemaValue.valueBlock && Array.isArray(asn1SchemaValue.valueBlock.value) && \"value\" in newSeq.valueBlock) {\n                    newSeq.valueBlock.value = asn1SchemaValue.valueBlock.value;\n                    return newSeq;\n                }\n            }\n            else if (schema.type === AsnTypeTypes.Set) {\n                const newSet = new asn1js.Set();\n                if (\"value\" in asn1SchemaValue.valueBlock && Array.isArray(asn1SchemaValue.valueBlock.value) && \"value\" in newSet.valueBlock) {\n                    newSet.valueBlock.value = asn1SchemaValue.valueBlock.value;\n                    return newSet;\n                }\n            }\n        }\n        return asn1SchemaValue;\n    }\n}\n","import * as asn1js from \"asn1js\";\nimport { toArrayBuffer } from \"@peculiar/utils\";\nimport * as converters from \"./converters.js\";\nimport { AsnPropTypes, AsnTypeTypes } from \"./enums.js\";\nimport { isConvertible, isArrayEqual } from \"./helper.js\";\nimport { schemaStorage } from \"./storage.js\";\nexport class AsnSerializer {\n    static serialize(obj) {\n        if (obj instanceof asn1js.BaseBlock) {\n            return obj.toBER(false);\n        }\n        return this.toASN(obj).toBER(false);\n    }\n    static toASN(obj) {\n        if (obj && typeof obj === \"object\" && isConvertible(obj)) {\n            return obj.toASN();\n        }\n        if (!(obj && typeof obj === \"object\")) {\n            throw new TypeError(\"Parameter 1 should be type of Object.\");\n        }\n        const target = obj.constructor;\n        const schema = schemaStorage.get(target);\n        schemaStorage.cache(target);\n        let asn1Value = [];\n        if (schema.itemType) {\n            if (!Array.isArray(obj)) {\n                throw new TypeError(\"Parameter 1 should be type of Array.\");\n            }\n            if (typeof schema.itemType === \"number\") {\n                const converter = converters.defaultConverter(schema.itemType);\n                if (!converter) {\n                    throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);\n                }\n                asn1Value = obj.map((o) => converter.toASN(o));\n            }\n            else {\n                asn1Value = obj.map((o) => this.toAsnItem({ type: schema.itemType }, \"[]\", target, o));\n            }\n        }\n        else {\n            for (const key in schema.items) {\n                const schemaItem = schema.items[key];\n                const objProp = obj[key];\n                if (objProp === undefined ||\n                    schemaItem.defaultValue === objProp ||\n                    (typeof schemaItem.defaultValue === \"object\" && typeof objProp === \"object\" && isArrayEqual(this.serialize(schemaItem.defaultValue), this.serialize(objProp)))) {\n                    continue;\n                }\n                const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);\n                if (typeof schemaItem.context === \"number\") {\n                    if (schemaItem.implicit) {\n                        if (!schemaItem.repeated && (typeof schemaItem.type === \"number\" || isConvertible(schemaItem.type))) {\n                            const value = {};\n                            value.valueHex = asn1Item instanceof asn1js.Null ? toArrayBuffer(asn1Item.valueBeforeDecodeView) : asn1Item.valueBlock.toBER();\n                            asn1Value.push(new asn1js.Primitive({\n                                optional: schemaItem.optional,\n                                idBlock: {\n                                    tagClass: 3,\n                                    tagNumber: schemaItem.context,\n                                },\n                                ...value,\n                            }));\n                        }\n                        else {\n                            asn1Value.push(new asn1js.Constructed({\n                                optional: schemaItem.optional,\n                                idBlock: {\n                                    tagClass: 3,\n                                    tagNumber: schemaItem.context,\n                                },\n                                value: asn1Item.valueBlock.value,\n                            }));\n                        }\n                    }\n                    else {\n                        asn1Value.push(new asn1js.Constructed({\n                            optional: schemaItem.optional,\n                            idBlock: {\n                                tagClass: 3,\n                                tagNumber: schemaItem.context,\n                            },\n                            value: [asn1Item],\n                        }));\n                    }\n                }\n                else if (schemaItem.repeated) {\n                    asn1Value = asn1Value.concat(asn1Item);\n                }\n                else {\n                    asn1Value.push(asn1Item);\n                }\n            }\n        }\n        let asnSchema;\n        switch (schema.type) {\n            case AsnTypeTypes.Sequence:\n                asnSchema = new asn1js.Sequence({ value: asn1Value });\n                break;\n            case AsnTypeTypes.Set:\n                asnSchema = new asn1js.Set({ value: asn1Value });\n                break;\n            case AsnTypeTypes.Choice:\n                if (!asn1Value[0]) {\n                    throw new Error(`Schema '${target.name}' has wrong data. Choice cannot be empty.`);\n                }\n                asnSchema = asn1Value[0];\n                break;\n        }\n        return asnSchema;\n    }\n    static toAsnItem(schemaItem, key, target, objProp) {\n        let asn1Item;\n        if (typeof schemaItem.type === \"number\") {\n            const converter = schemaItem.converter;\n            if (!converter) {\n                throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);\n            }\n            if (schemaItem.repeated) {\n                if (!Array.isArray(objProp)) {\n                    throw new TypeError(\"Parameter 'objProp' should be type of Array.\");\n                }\n                const items = Array.from(objProp, (element) => converter.toASN(element));\n                const Container = schemaItem.repeated === \"sequence\" ? asn1js.Sequence : asn1js.Set;\n                asn1Item = new Container({ value: items });\n            }\n            else {\n                asn1Item = converter.toASN(objProp);\n            }\n        }\n        else {\n            if (schemaItem.repeated) {\n                if (!Array.isArray(objProp)) {\n                    throw new TypeError(\"Parameter 'objProp' should be type of Array.\");\n                }\n                const items = Array.from(objProp, (element) => this.toASN(element));\n                const Container = schemaItem.repeated === \"sequence\" ? asn1js.Sequence : asn1js.Set;\n                asn1Item = new Container({ value: items });\n            }\n            else {\n                asn1Item = this.toASN(objProp);\n            }\n        }\n        return asn1Item;\n    }\n}\n","export class AsnArray extends Array {\n    constructor(items = []) {\n        if (typeof items === \"number\") {\n            super(items);\n        }\n        else {\n            super();\n            for (const item of items) {\n                this.push(item);\n            }\n        }\n    }\n}\n","import * as asn1js from \"asn1js\";\nimport { isBufferSource, toArrayBuffer } from \"@peculiar/utils\";\nimport { AsnParser } from \"./parser.js\";\nimport { AsnSerializer } from \"./serializer.js\";\nexport class AsnConvert {\n    static serialize(obj) {\n        return AsnSerializer.serialize(obj);\n    }\n    static parse(data, target, options) {\n        return AsnParser.parse(data, target, options);\n    }\n    static toString(data, options) {\n        const buf = isBufferSource(data) ? toArrayBuffer(data) : AsnConvert.serialize(data);\n        const asn = asn1js.fromBER(buf, options?.berOptions);\n        if (asn.offset === -1) {\n            throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);\n        }\n        return asn.result.toString();\n    }\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n  extendStatics = Object.setPrototypeOf ||\n      ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n      function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n  return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n  if (typeof b !== \"function\" && b !== null)\n      throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n  extendStatics(d, b);\n  function __() { this.constructor = d; }\n  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n  __assign = Object.assign || function __assign(t) {\n      for (var s, i = 1, n = arguments.length; i < n; i++) {\n          s = arguments[i];\n          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n      }\n      return t;\n  }\n  return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n      t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n      for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n          if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n              t[p[i]] = s[p[i]];\n      }\n  return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n  if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n  return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n  return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n  function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n  var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n  var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n  var _, done = false;\n  for (var i = decorators.length - 1; i >= 0; i--) {\n      var context = {};\n      for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n      for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n      context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n      var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n      if (kind === \"accessor\") {\n          if (result === void 0) continue;\n          if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n          if (_ = accept(result.get)) descriptor.get = _;\n          if (_ = accept(result.set)) descriptor.set = _;\n          if (_ = accept(result.init)) initializers.unshift(_);\n      }\n      else if (_ = accept(result)) {\n          if (kind === \"field\") initializers.unshift(_);\n          else descriptor[key] = _;\n      }\n  }\n  if (target) Object.defineProperty(target, contextIn.name, descriptor);\n  done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n  var useValue = arguments.length > 2;\n  for (var i = 0; i < initializers.length; i++) {\n      value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n  }\n  return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n  return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n  if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n  return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n  if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n  return new (P || (P = Promise))(function (resolve, reject) {\n      function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n      function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n      function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n      step((generator = generator.apply(thisArg, _arguments || [])).next());\n  });\n}\n\nexport function __generator(thisArg, body) {\n  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n  return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n  function verb(n) { return function (v) { return step([n, v]); }; }\n  function step(op) {\n      if (f) throw new TypeError(\"Generator is already executing.\");\n      while (g && (g = 0, op[0] && (_ = 0)), _) try {\n          if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n          if (y = 0, t) op = [op[0] & 2, t.value];\n          switch (op[0]) {\n              case 0: case 1: t = op; break;\n              case 4: _.label++; return { value: op[1], done: false };\n              case 5: _.label++; y = op[1]; op = [0]; continue;\n              case 7: op = _.ops.pop(); _.trys.pop(); continue;\n              default:\n                  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n                  if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n                  if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n                  if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n                  if (t[2]) _.ops.pop();\n                  _.trys.pop(); continue;\n          }\n          op = body.call(thisArg, _);\n      } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n      if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n  }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n  }\n  Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n  var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n  if (m) return m.call(o);\n  if (o && typeof o.length === \"number\") return {\n      next: function () {\n          if (o && i >= o.length) o = void 0;\n          return { value: o && o[i++], done: !o };\n      }\n  };\n  throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n  var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n  if (!m) return o;\n  var i = m.call(o), r, ar = [], e;\n  try {\n      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n  }\n  catch (error) { e = { error: error }; }\n  finally {\n      try {\n          if (r && !r.done && (m = i[\"return\"])) m.call(i);\n      }\n      finally { if (e) throw e.error; }\n  }\n  return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n  for (var ar = [], i = 0; i < arguments.length; i++)\n      ar = ar.concat(__read(arguments[i]));\n  return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n  for (var r = Array(s), k = 0, i = 0; i < il; i++)\n      for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n          r[k] = a[j];\n  return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n      if (ar || !(i in from)) {\n          if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n          ar[i] = from[i];\n      }\n  }\n  return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n  return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n  if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n  var g = generator.apply(thisArg, _arguments || []), i, q = [];\n  return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n  function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n  function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n  function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n  function fulfill(value) { resume(\"next\", value); }\n  function reject(value) { resume(\"throw\", value); }\n  function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n  var i, p;\n  return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n  function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n  if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n  var m = o[Symbol.asyncIterator], i;\n  return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n  if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n  return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n  Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n  o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n  ownKeys = Object.getOwnPropertyNames || function (o) {\n    var ar = [];\n    for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n    return ar;\n  };\n  return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n  if (mod && mod.__esModule) return mod;\n  var result = {};\n  if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n  __setModuleDefault(result, mod);\n  return result;\n}\n\nexport function __importDefault(mod) {\n  return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n  if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n  if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n  return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n  if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n  if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n  if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n  return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n  if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n  return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n  if (value !== null && value !== void 0) {\n    if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n    var dispose, inner;\n    if (async) {\n      if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n      dispose = value[Symbol.asyncDispose];\n    }\n    if (dispose === void 0) {\n      if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n      dispose = value[Symbol.dispose];\n      if (async) inner = dispose;\n    }\n    if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n    if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n    env.stack.push({ value: value, dispose: dispose, async: async });\n  }\n  else if (async) {\n    env.stack.push({ async: true });\n  }\n  return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n  var e = new Error(message);\n  return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n  function fail(e) {\n    env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n    env.hasError = true;\n  }\n  var r, s = 0;\n  function next() {\n    while (r = env.stack.pop()) {\n      try {\n        if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n        if (r.dispose) {\n          var result = r.dispose.call(r.value);\n          if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n        }\n        else s |= 1;\n      }\n      catch (e) {\n        fail(e);\n      }\n    }\n    if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n    if (env.hasError) throw env.error;\n  }\n  return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n  if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n      return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n          return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n      });\n  }\n  return path;\n}\n\nexport default {\n  __extends,\n  __assign,\n  __rest,\n  __decorate,\n  __param,\n  __esDecorate,\n  __runInitializers,\n  __propKey,\n  __setFunctionName,\n  __metadata,\n  __awaiter,\n  __generator,\n  __createBinding,\n  __exportStar,\n  __values,\n  __read,\n  __spread,\n  __spreadArrays,\n  __spreadArray,\n  __await,\n  __asyncGenerator,\n  __asyncDelegator,\n  __asyncValues,\n  __makeTemplateObject,\n  __importStar,\n  __importDefault,\n  __classPrivateFieldGet,\n  __classPrivateFieldSet,\n  __classPrivateFieldIn,\n  __addDisposableResource,\n  __disposeResources,\n  __rewriteRelativeImportExtension,\n};\n","import { hex } from \"@peculiar/utils/encoding\";\nexport class IpConverter {\n    static isIPv4(ip) {\n        return /^(\\d{1,3}\\.){3}\\d{1,3}$/.test(ip);\n    }\n    static parseIPv4(ip) {\n        const parts = ip.split(\".\");\n        if (parts.length !== 4) {\n            throw new Error(\"Invalid IPv4 address\");\n        }\n        return parts.map((part) => {\n            const num = parseInt(part, 10);\n            if (isNaN(num) || num < 0 || num > 255) {\n                throw new Error(\"Invalid IPv4 address part\");\n            }\n            return num;\n        });\n    }\n    static parseIPv6(ip) {\n        const expandedIP = this.expandIPv6(ip);\n        const parts = expandedIP.split(\":\");\n        if (parts.length !== 8) {\n            throw new Error(\"Invalid IPv6 address\");\n        }\n        return parts.reduce((bytes, part) => {\n            const num = parseInt(part, 16);\n            if (isNaN(num) || num < 0 || num > 0xffff) {\n                throw new Error(\"Invalid IPv6 address part\");\n            }\n            bytes.push((num >> 8) & 0xff);\n            bytes.push(num & 0xff);\n            return bytes;\n        }, []);\n    }\n    static expandIPv6(ip) {\n        if (!ip.includes(\"::\")) {\n            return ip;\n        }\n        const parts = ip.split(\"::\");\n        if (parts.length > 2) {\n            throw new Error(\"Invalid IPv6 address\");\n        }\n        const left = parts[0] ? parts[0].split(\":\") : [];\n        const right = parts[1] ? parts[1].split(\":\") : [];\n        const missing = 8 - (left.length + right.length);\n        if (missing < 0) {\n            throw new Error(\"Invalid IPv6 address\");\n        }\n        return [...left, ...Array(missing).fill(\"0\"), ...right].join(\":\");\n    }\n    static formatIPv6(bytes) {\n        const parts = [];\n        for (let i = 0; i < 16; i += 2) {\n            parts.push(((bytes[i] << 8) | bytes[i + 1]).toString(16));\n        }\n        return this.compressIPv6(parts.join(\":\"));\n    }\n    static compressIPv6(ip) {\n        const parts = ip.split(\":\");\n        let longestZeroStart = -1;\n        let longestZeroLength = 0;\n        let currentZeroStart = -1;\n        let currentZeroLength = 0;\n        for (let i = 0; i < parts.length; i++) {\n            if (parts[i] === \"0\") {\n                if (currentZeroStart === -1) {\n                    currentZeroStart = i;\n                }\n                currentZeroLength++;\n            }\n            else {\n                if (currentZeroLength > longestZeroLength) {\n                    longestZeroStart = currentZeroStart;\n                    longestZeroLength = currentZeroLength;\n                }\n                currentZeroStart = -1;\n                currentZeroLength = 0;\n            }\n        }\n        if (currentZeroLength > longestZeroLength) {\n            longestZeroStart = currentZeroStart;\n            longestZeroLength = currentZeroLength;\n        }\n        if (longestZeroLength > 1) {\n            const before = parts.slice(0, longestZeroStart).join(\":\");\n            const after = parts.slice(longestZeroStart + longestZeroLength).join(\":\");\n            return `${before}::${after}`;\n        }\n        return ip;\n    }\n    static parseCIDR(text) {\n        const [addr, prefixStr] = text.split(\"/\");\n        const prefix = parseInt(prefixStr, 10);\n        if (this.isIPv4(addr)) {\n            if (prefix < 0 || prefix > 32) {\n                throw new Error(\"Invalid IPv4 prefix length\");\n            }\n            return [this.parseIPv4(addr), prefix];\n        }\n        else {\n            if (prefix < 0 || prefix > 128) {\n                throw new Error(\"Invalid IPv6 prefix length\");\n            }\n            return [this.parseIPv6(addr), prefix];\n        }\n    }\n    static decodeIP(value) {\n        if (value.length === 64 && parseInt(value, 16) === 0) {\n            return \"::/0\";\n        }\n        if (value.length !== 16) {\n            return value;\n        }\n        const mask = parseInt(value.slice(8), 16)\n            .toString(2)\n            .split(\"\")\n            .reduce((a, k) => a + +k, 0);\n        let ip = value.slice(0, 8).replace(/(.{2})/g, (match) => `${parseInt(match, 16)}.`);\n        ip = ip.slice(0, -1);\n        return `${ip}/${mask}`;\n    }\n    static toString(buf) {\n        const uint8 = new Uint8Array(buf);\n        if (uint8.length === 4) {\n            return Array.from(uint8).join(\".\");\n        }\n        if (uint8.length === 16) {\n            return this.formatIPv6(uint8);\n        }\n        if (uint8.length === 8 || uint8.length === 32) {\n            const half = uint8.length / 2;\n            const addrBytes = uint8.slice(0, half);\n            const maskBytes = uint8.slice(half);\n            const isAllZeros = uint8.every((byte) => byte === 0);\n            if (isAllZeros) {\n                return uint8.length === 8 ? \"0.0.0.0/0\" : \"::/0\";\n            }\n            const prefixLen = maskBytes.reduce((a, b) => a + (b.toString(2).match(/1/g) || []).length, 0);\n            if (uint8.length === 8) {\n                const addrStr = Array.from(addrBytes).join(\".\");\n                return `${addrStr}/${prefixLen}`;\n            }\n            else {\n                const addrStr = this.formatIPv6(addrBytes);\n                return `${addrStr}/${prefixLen}`;\n            }\n        }\n        return this.decodeIP(hex.encode(buf));\n    }\n    static fromString(text) {\n        if (text.includes(\"/\")) {\n            const [addr, prefix] = this.parseCIDR(text);\n            const maskBytes = new Uint8Array(addr.length);\n            let bitsLeft = prefix;\n            for (let i = 0; i < maskBytes.length; i++) {\n                if (bitsLeft >= 8) {\n                    maskBytes[i] = 0xff;\n                    bitsLeft -= 8;\n                }\n                else if (bitsLeft > 0) {\n                    maskBytes[i] = 0xff << (8 - bitsLeft);\n                    bitsLeft = 0;\n                }\n            }\n            const out = new Uint8Array(addr.length * 2);\n            out.set(addr, 0);\n            out.set(maskBytes, addr.length);\n            return out.buffer;\n        }\n        const bytes = this.isIPv4(text) ? this.parseIPv4(text) : this.parseIPv6(text);\n        return new Uint8Array(bytes).buffer;\n    }\n}\n","var RelativeDistinguishedName_1, RDNSequence_1, Name_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, AsnArray } from \"@peculiar/asn1-schema\";\nimport { hex } from \"@peculiar/utils/encoding\";\nlet DirectoryString = class DirectoryString {\n    teletexString;\n    printableString;\n    universalString;\n    utf8String;\n    bmpString;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n    toString() {\n        return this.bmpString || this.printableString || this.teletexString || this.universalString || this.utf8String || \"\";\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.TeletexString })\n], DirectoryString.prototype, \"teletexString\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.PrintableString })\n], DirectoryString.prototype, \"printableString\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.UniversalString })\n], DirectoryString.prototype, \"universalString\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Utf8String })\n], DirectoryString.prototype, \"utf8String\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BmpString })\n], DirectoryString.prototype, \"bmpString\", void 0);\nDirectoryString = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], DirectoryString);\nexport { DirectoryString };\nlet AttributeValue = class AttributeValue extends DirectoryString {\n    ia5String;\n    anyValue;\n    constructor(params = {}) {\n        super(params);\n        Object.assign(this, params);\n    }\n    toString() {\n        return this.ia5String || (this.anyValue ? hex.encode(this.anyValue) : super.toString());\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.IA5String })\n], AttributeValue.prototype, \"ia5String\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Any })\n], AttributeValue.prototype, \"anyValue\", void 0);\nAttributeValue = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], AttributeValue);\nexport { AttributeValue };\nexport class AttributeTypeAndValue {\n    type = \"\";\n    value = new AttributeValue();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], AttributeTypeAndValue.prototype, \"type\", void 0);\n__decorate([\n    AsnProp({ type: AttributeValue })\n], AttributeTypeAndValue.prototype, \"value\", void 0);\nlet RelativeDistinguishedName = RelativeDistinguishedName_1 = class RelativeDistinguishedName extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, RelativeDistinguishedName_1.prototype);\n    }\n};\nRelativeDistinguishedName = RelativeDistinguishedName_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: AttributeTypeAndValue,\n    })\n], RelativeDistinguishedName);\nexport { RelativeDistinguishedName };\nlet RDNSequence = RDNSequence_1 = class RDNSequence extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, RDNSequence_1.prototype);\n    }\n};\nRDNSequence = RDNSequence_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: RelativeDistinguishedName,\n    })\n], RDNSequence);\nexport { RDNSequence };\nlet Name = Name_1 = class Name extends RDNSequence {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, Name_1.prototype);\n    }\n};\nName = Name_1 = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], Name);\nexport { Name };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, AsnOctetStringConverter } from \"@peculiar/asn1-schema\";\nimport { IpConverter } from \"./ip_converter.js\";\nimport { DirectoryString, Name } from \"./name.js\";\nexport const AsnIpConverter = {\n    fromASN: (value) => IpConverter.toString(AsnOctetStringConverter.fromASN(value)),\n    toASN: (value) => AsnOctetStringConverter.toASN(IpConverter.fromString(value)),\n};\nexport class OtherName {\n    typeId = \"\";\n    value = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], OtherName.prototype, \"typeId\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        context: 0,\n    })\n], OtherName.prototype, \"value\", void 0);\nexport class EDIPartyName {\n    nameAssigner;\n    partyName = new DirectoryString();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: DirectoryString,\n        optional: true,\n        context: 0,\n        implicit: true,\n    })\n], EDIPartyName.prototype, \"nameAssigner\", void 0);\n__decorate([\n    AsnProp({\n        type: DirectoryString,\n        context: 1,\n        implicit: true,\n    })\n], EDIPartyName.prototype, \"partyName\", void 0);\nlet GeneralName = class GeneralName {\n    otherName;\n    rfc822Name;\n    dNSName;\n    x400Address;\n    directoryName;\n    ediPartyName;\n    uniformResourceIdentifier;\n    iPAddress;\n    registeredID;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: OtherName,\n        context: 0,\n        implicit: true,\n    })\n], GeneralName.prototype, \"otherName\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.IA5String,\n        context: 1,\n        implicit: true,\n    })\n], GeneralName.prototype, \"rfc822Name\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.IA5String,\n        context: 2,\n        implicit: true,\n    })\n], GeneralName.prototype, \"dNSName\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        context: 3,\n        implicit: true,\n    })\n], GeneralName.prototype, \"x400Address\", void 0);\n__decorate([\n    AsnProp({\n        type: Name,\n        context: 4,\n        implicit: false,\n    })\n], GeneralName.prototype, \"directoryName\", void 0);\n__decorate([\n    AsnProp({\n        type: EDIPartyName,\n        context: 5,\n    })\n], GeneralName.prototype, \"ediPartyName\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.IA5String,\n        context: 6,\n        implicit: true,\n    })\n], GeneralName.prototype, \"uniformResourceIdentifier\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.OctetString,\n        context: 7,\n        implicit: true,\n        converter: AsnIpConverter,\n    })\n], GeneralName.prototype, \"iPAddress\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.ObjectIdentifier,\n        context: 8,\n        implicit: true,\n    })\n], GeneralName.prototype, \"registeredID\", void 0);\nGeneralName = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], GeneralName);\nexport { GeneralName };\n","export const id_pkix = \"1.3.6.1.5.5.7\";\nexport const id_pe = `${id_pkix}.1`;\nexport const id_qt = `${id_pkix}.2`;\nexport const id_kp = `${id_pkix}.3`;\nexport const id_ad = `${id_pkix}.48`;\nexport const id_qt_csp = `${id_qt}.1`;\nexport const id_qt_unotice = `${id_qt}.2`;\nexport const id_ad_ocsp = `${id_ad}.1`;\nexport const id_ad_caIssuers = `${id_ad}.2`;\nexport const id_ad_timeStamping = `${id_ad}.3`;\nexport const id_ad_caRepository = `${id_ad}.5`;\nexport const id_ce = \"2.5.29\";\nexport const id_alg_unsigned = \"1.3.6.1.5.5.7.6.36\";\n","var AuthorityInfoAccessSyntax_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { GeneralName } from \"../general_name.js\";\nimport { id_pe } from \"../object_identifiers.js\";\nexport const id_pe_authorityInfoAccess = `${id_pe}.1`;\nexport class AccessDescription {\n    accessMethod = \"\";\n    accessLocation = new GeneralName();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], AccessDescription.prototype, \"accessMethod\", void 0);\n__decorate([\n    AsnProp({ type: GeneralName })\n], AccessDescription.prototype, \"accessLocation\", void 0);\nlet AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax_1 = class AuthorityInfoAccessSyntax extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, AuthorityInfoAccessSyntax_1.prototype);\n    }\n};\nAuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: AccessDescription,\n    })\n], AuthorityInfoAccessSyntax);\nexport { AuthorityInfoAccessSyntax };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter, OctetString } from \"@peculiar/asn1-schema\";\nimport { GeneralName } from \"../general_name.js\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_authorityKeyIdentifier = `${id_ce}.35`;\nexport class KeyIdentifier extends OctetString {\n}\nexport class AuthorityKeyIdentifier {\n    keyIdentifier;\n    authorityCertIssuer;\n    authorityCertSerialNumber;\n    constructor(params = {}) {\n        if (params) {\n            Object.assign(this, params);\n        }\n    }\n}\n__decorate([\n    AsnProp({\n        type: KeyIdentifier,\n        context: 0,\n        optional: true,\n        implicit: true,\n    })\n], AuthorityKeyIdentifier.prototype, \"keyIdentifier\", void 0);\n__decorate([\n    AsnProp({\n        type: GeneralName,\n        context: 1,\n        optional: true,\n        implicit: true,\n        repeated: \"sequence\",\n    })\n], AuthorityKeyIdentifier.prototype, \"authorityCertIssuer\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        context: 2,\n        optional: true,\n        implicit: true,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], AuthorityKeyIdentifier.prototype, \"authorityCertSerialNumber\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_basicConstraints = `${id_ce}.19`;\nexport class BasicConstraints {\n    cA = false;\n    pathLenConstraint;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Boolean,\n        defaultValue: false,\n    })\n], BasicConstraints.prototype, \"cA\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], BasicConstraints.prototype, \"pathLenConstraint\", void 0);\n","var GeneralNames_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes, AsnArray } from \"@peculiar/asn1-schema\";\nimport { GeneralName } from \"./general_name.js\";\nlet GeneralNames = GeneralNames_1 = class GeneralNames extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, GeneralNames_1.prototype);\n    }\n};\nGeneralNames = GeneralNames_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: GeneralName,\n    })\n], GeneralNames);\nexport { GeneralNames };\n","var CertificateIssuer_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { GeneralNames } from \"../general_names.js\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_certificateIssuer = `${id_ce}.29`;\nlet CertificateIssuer = CertificateIssuer_1 = class CertificateIssuer extends GeneralNames {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, CertificateIssuer_1.prototype);\n    }\n};\nCertificateIssuer = CertificateIssuer_1 = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], CertificateIssuer);\nexport { CertificateIssuer };\n","var CertificatePolicies_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, AsnArray } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_certificatePolicies = `${id_ce}.32`;\nexport const id_ce_certificatePolicies_anyPolicy = `${id_ce_certificatePolicies}.0`;\nlet DisplayText = class DisplayText {\n    ia5String;\n    visibleString;\n    bmpString;\n    utf8String;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n    toString() {\n        return this.ia5String || this.visibleString || this.bmpString || this.utf8String || \"\";\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.IA5String })\n], DisplayText.prototype, \"ia5String\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.VisibleString })\n], DisplayText.prototype, \"visibleString\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BmpString })\n], DisplayText.prototype, \"bmpString\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Utf8String })\n], DisplayText.prototype, \"utf8String\", void 0);\nDisplayText = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], DisplayText);\nexport { DisplayText };\nexport class NoticeReference {\n    organization = new DisplayText();\n    noticeNumbers = [];\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: DisplayText })\n], NoticeReference.prototype, \"organization\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        repeated: \"sequence\",\n    })\n], NoticeReference.prototype, \"noticeNumbers\", void 0);\nexport class UserNotice {\n    noticeRef;\n    explicitText;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: NoticeReference,\n        optional: true,\n    })\n], UserNotice.prototype, \"noticeRef\", void 0);\n__decorate([\n    AsnProp({\n        type: DisplayText,\n        optional: true,\n    })\n], UserNotice.prototype, \"explicitText\", void 0);\nlet Qualifier = class Qualifier {\n    cPSuri;\n    userNotice;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.IA5String })\n], Qualifier.prototype, \"cPSuri\", void 0);\n__decorate([\n    AsnProp({ type: UserNotice })\n], Qualifier.prototype, \"userNotice\", void 0);\nQualifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], Qualifier);\nexport { Qualifier };\nexport class PolicyQualifierInfo {\n    policyQualifierId = \"\";\n    qualifier = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], PolicyQualifierInfo.prototype, \"policyQualifierId\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Any })\n], PolicyQualifierInfo.prototype, \"qualifier\", void 0);\nexport class PolicyInformation {\n    policyIdentifier = \"\";\n    policyQualifiers;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], PolicyInformation.prototype, \"policyIdentifier\", void 0);\n__decorate([\n    AsnProp({\n        type: PolicyQualifierInfo,\n        repeated: \"sequence\",\n        optional: true,\n    })\n], PolicyInformation.prototype, \"policyQualifiers\", void 0);\nlet CertificatePolicies = CertificatePolicies_1 = class CertificatePolicies extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, CertificatePolicies_1.prototype);\n    }\n};\nCertificatePolicies = CertificatePolicies_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: PolicyInformation,\n    })\n], CertificatePolicies);\nexport { CertificatePolicies };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_cRLNumber = `${id_ce}.20`;\nlet CRLNumber = class CRLNumber {\n    value;\n    constructor(value = 0) {\n        this.value = value;\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], CRLNumber.prototype, \"value\", void 0);\nCRLNumber = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], CRLNumber);\nexport { CRLNumber };\n","import { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nimport { CRLNumber } from \"./crl_number.js\";\nexport const id_ce_deltaCRLIndicator = `${id_ce}.27`;\nlet BaseCRLNumber = class BaseCRLNumber extends CRLNumber {\n};\nBaseCRLNumber = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], BaseCRLNumber);\nexport { BaseCRLNumber };\n","var CRLDistributionPoints_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnType, AsnTypeTypes, AsnArray, BitString } from \"@peculiar/asn1-schema\";\nimport { RelativeDistinguishedName } from \"../name.js\";\nimport { GeneralName } from \"../general_name.js\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_cRLDistributionPoints = `${id_ce}.31`;\nexport var ReasonFlags;\n(function (ReasonFlags) {\n    ReasonFlags[ReasonFlags[\"unused\"] = 1] = \"unused\";\n    ReasonFlags[ReasonFlags[\"keyCompromise\"] = 2] = \"keyCompromise\";\n    ReasonFlags[ReasonFlags[\"cACompromise\"] = 4] = \"cACompromise\";\n    ReasonFlags[ReasonFlags[\"affiliationChanged\"] = 8] = \"affiliationChanged\";\n    ReasonFlags[ReasonFlags[\"superseded\"] = 16] = \"superseded\";\n    ReasonFlags[ReasonFlags[\"cessationOfOperation\"] = 32] = \"cessationOfOperation\";\n    ReasonFlags[ReasonFlags[\"certificateHold\"] = 64] = \"certificateHold\";\n    ReasonFlags[ReasonFlags[\"privilegeWithdrawn\"] = 128] = \"privilegeWithdrawn\";\n    ReasonFlags[ReasonFlags[\"aACompromise\"] = 256] = \"aACompromise\";\n})(ReasonFlags || (ReasonFlags = {}));\nexport class Reason extends BitString {\n    toJSON() {\n        const res = [];\n        const flags = this.toNumber();\n        if (flags & ReasonFlags.aACompromise) {\n            res.push(\"aACompromise\");\n        }\n        if (flags & ReasonFlags.affiliationChanged) {\n            res.push(\"affiliationChanged\");\n        }\n        if (flags & ReasonFlags.cACompromise) {\n            res.push(\"cACompromise\");\n        }\n        if (flags & ReasonFlags.certificateHold) {\n            res.push(\"certificateHold\");\n        }\n        if (flags & ReasonFlags.cessationOfOperation) {\n            res.push(\"cessationOfOperation\");\n        }\n        if (flags & ReasonFlags.keyCompromise) {\n            res.push(\"keyCompromise\");\n        }\n        if (flags & ReasonFlags.privilegeWithdrawn) {\n            res.push(\"privilegeWithdrawn\");\n        }\n        if (flags & ReasonFlags.superseded) {\n            res.push(\"superseded\");\n        }\n        if (flags & ReasonFlags.unused) {\n            res.push(\"unused\");\n        }\n        return res;\n    }\n    toString() {\n        return `[${this.toJSON().join(\", \")}]`;\n    }\n}\nlet DistributionPointName = class DistributionPointName {\n    fullName;\n    nameRelativeToCRLIssuer;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: GeneralName,\n        context: 0,\n        repeated: \"sequence\",\n        implicit: true,\n    })\n], DistributionPointName.prototype, \"fullName\", void 0);\n__decorate([\n    AsnProp({\n        type: RelativeDistinguishedName,\n        context: 1,\n        implicit: true,\n    })\n], DistributionPointName.prototype, \"nameRelativeToCRLIssuer\", void 0);\nDistributionPointName = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], DistributionPointName);\nexport { DistributionPointName };\nexport class DistributionPoint {\n    distributionPoint;\n    reasons;\n    cRLIssuer;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: DistributionPointName,\n        context: 0,\n        optional: true,\n    })\n], DistributionPoint.prototype, \"distributionPoint\", void 0);\n__decorate([\n    AsnProp({\n        type: Reason,\n        context: 1,\n        optional: true,\n        implicit: true,\n    })\n], DistributionPoint.prototype, \"reasons\", void 0);\n__decorate([\n    AsnProp({\n        type: GeneralName,\n        context: 2,\n        optional: true,\n        repeated: \"sequence\",\n        implicit: true,\n    })\n], DistributionPoint.prototype, \"cRLIssuer\", void 0);\nlet CRLDistributionPoints = CRLDistributionPoints_1 = class CRLDistributionPoints extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, CRLDistributionPoints_1.prototype);\n    }\n};\nCRLDistributionPoints = CRLDistributionPoints_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: DistributionPoint,\n    })\n], CRLDistributionPoints);\nexport { CRLDistributionPoints };\n","var FreshestCRL_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nimport { CRLDistributionPoints, DistributionPoint } from \"./crl_distribution_points.js\";\nexport const id_ce_freshestCRL = `${id_ce}.46`;\nlet FreshestCRL = FreshestCRL_1 = class FreshestCRL extends CRLDistributionPoints {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, FreshestCRL_1.prototype);\n    }\n};\nFreshestCRL = FreshestCRL_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: DistributionPoint,\n    })\n], FreshestCRL);\nexport { FreshestCRL };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nimport { DistributionPointName, Reason } from \"./crl_distribution_points.js\";\nexport const id_ce_issuingDistributionPoint = `${id_ce}.28`;\nexport class IssuingDistributionPoint {\n    static ONLY = false;\n    distributionPoint;\n    onlyContainsUserCerts = IssuingDistributionPoint.ONLY;\n    onlyContainsCACerts = IssuingDistributionPoint.ONLY;\n    onlySomeReasons;\n    indirectCRL = IssuingDistributionPoint.ONLY;\n    onlyContainsAttributeCerts = IssuingDistributionPoint.ONLY;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: DistributionPointName,\n        context: 0,\n        optional: true,\n    })\n], IssuingDistributionPoint.prototype, \"distributionPoint\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Boolean,\n        context: 1,\n        defaultValue: IssuingDistributionPoint.ONLY,\n        implicit: true,\n    })\n], IssuingDistributionPoint.prototype, \"onlyContainsUserCerts\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Boolean,\n        context: 2,\n        defaultValue: IssuingDistributionPoint.ONLY,\n        implicit: true,\n    })\n], IssuingDistributionPoint.prototype, \"onlyContainsCACerts\", void 0);\n__decorate([\n    AsnProp({\n        type: Reason,\n        context: 3,\n        optional: true,\n        implicit: true,\n    })\n], IssuingDistributionPoint.prototype, \"onlySomeReasons\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Boolean,\n        context: 4,\n        defaultValue: IssuingDistributionPoint.ONLY,\n        implicit: true,\n    })\n], IssuingDistributionPoint.prototype, \"indirectCRL\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Boolean,\n        context: 5,\n        defaultValue: IssuingDistributionPoint.ONLY,\n        implicit: true,\n    })\n], IssuingDistributionPoint.prototype, \"onlyContainsAttributeCerts\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_cRLReasons = `${id_ce}.21`;\nexport var CRLReasons;\n(function (CRLReasons) {\n    CRLReasons[CRLReasons[\"unspecified\"] = 0] = \"unspecified\";\n    CRLReasons[CRLReasons[\"keyCompromise\"] = 1] = \"keyCompromise\";\n    CRLReasons[CRLReasons[\"cACompromise\"] = 2] = \"cACompromise\";\n    CRLReasons[CRLReasons[\"affiliationChanged\"] = 3] = \"affiliationChanged\";\n    CRLReasons[CRLReasons[\"superseded\"] = 4] = \"superseded\";\n    CRLReasons[CRLReasons[\"cessationOfOperation\"] = 5] = \"cessationOfOperation\";\n    CRLReasons[CRLReasons[\"certificateHold\"] = 6] = \"certificateHold\";\n    CRLReasons[CRLReasons[\"removeFromCRL\"] = 8] = \"removeFromCRL\";\n    CRLReasons[CRLReasons[\"privilegeWithdrawn\"] = 9] = \"privilegeWithdrawn\";\n    CRLReasons[CRLReasons[\"aACompromise\"] = 10] = \"aACompromise\";\n})(CRLReasons || (CRLReasons = {}));\nlet CRLReason = class CRLReason {\n    reason = CRLReasons.unspecified;\n    constructor(reason = CRLReasons.unspecified) {\n        this.reason = reason;\n    }\n    toJSON() {\n        return CRLReasons[this.reason];\n    }\n    toString() {\n        return this.toJSON();\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], CRLReason.prototype, \"reason\", void 0);\nCRLReason = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], CRLReason);\nexport { CRLReason };\n","var ExtendedKeyUsage_1;\nimport { __decorate } from \"tslib\";\nimport { AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce, id_kp } from \"../object_identifiers.js\";\nexport const id_ce_extKeyUsage = `${id_ce}.37`;\nlet ExtendedKeyUsage = ExtendedKeyUsage_1 = class ExtendedKeyUsage extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, ExtendedKeyUsage_1.prototype);\n    }\n};\nExtendedKeyUsage = ExtendedKeyUsage_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: AsnPropTypes.ObjectIdentifier,\n    })\n], ExtendedKeyUsage);\nexport { ExtendedKeyUsage };\nexport const anyExtendedKeyUsage = `${id_ce_extKeyUsage}.0`;\nexport const id_kp_serverAuth = `${id_kp}.1`;\nexport const id_kp_clientAuth = `${id_kp}.2`;\nexport const id_kp_codeSigning = `${id_kp}.3`;\nexport const id_kp_emailProtection = `${id_kp}.4`;\nexport const id_kp_timeStamping = `${id_kp}.8`;\nexport const id_kp_OCSPSigning = `${id_kp}.9`;\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_inhibitAnyPolicy = `${id_ce}.54`;\nlet InhibitAnyPolicy = class InhibitAnyPolicy {\n    value;\n    constructor(value = new ArrayBuffer(0)) {\n        this.value = value;\n    }\n};\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], InhibitAnyPolicy.prototype, \"value\", void 0);\nInhibitAnyPolicy = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], InhibitAnyPolicy);\nexport { InhibitAnyPolicy };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_invalidityDate = `${id_ce}.24`;\nlet InvalidityDate = class InvalidityDate {\n    value = new Date();\n    constructor(value) {\n        if (value) {\n            this.value = value;\n        }\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.GeneralizedTime })\n], InvalidityDate.prototype, \"value\", void 0);\nInvalidityDate = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], InvalidityDate);\nexport { InvalidityDate };\n","var IssueAlternativeName_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { GeneralNames } from \"../general_names.js\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_issuerAltName = `${id_ce}.18`;\nlet IssueAlternativeName = IssueAlternativeName_1 = class IssueAlternativeName extends GeneralNames {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, IssueAlternativeName_1.prototype);\n    }\n};\nIssueAlternativeName = IssueAlternativeName_1 = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], IssueAlternativeName);\nexport { IssueAlternativeName };\n","import { BitString } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_keyUsage = `${id_ce}.15`;\nexport var KeyUsageFlags;\n(function (KeyUsageFlags) {\n    KeyUsageFlags[KeyUsageFlags[\"digitalSignature\"] = 1] = \"digitalSignature\";\n    KeyUsageFlags[KeyUsageFlags[\"nonRepudiation\"] = 2] = \"nonRepudiation\";\n    KeyUsageFlags[KeyUsageFlags[\"keyEncipherment\"] = 4] = \"keyEncipherment\";\n    KeyUsageFlags[KeyUsageFlags[\"dataEncipherment\"] = 8] = \"dataEncipherment\";\n    KeyUsageFlags[KeyUsageFlags[\"keyAgreement\"] = 16] = \"keyAgreement\";\n    KeyUsageFlags[KeyUsageFlags[\"keyCertSign\"] = 32] = \"keyCertSign\";\n    KeyUsageFlags[KeyUsageFlags[\"cRLSign\"] = 64] = \"cRLSign\";\n    KeyUsageFlags[KeyUsageFlags[\"encipherOnly\"] = 128] = \"encipherOnly\";\n    KeyUsageFlags[KeyUsageFlags[\"decipherOnly\"] = 256] = \"decipherOnly\";\n})(KeyUsageFlags || (KeyUsageFlags = {}));\nexport class KeyUsage extends BitString {\n    toJSON() {\n        const flag = this.toNumber();\n        const res = [];\n        if (flag & KeyUsageFlags.cRLSign) {\n            res.push(\"crlSign\");\n        }\n        if (flag & KeyUsageFlags.dataEncipherment) {\n            res.push(\"dataEncipherment\");\n        }\n        if (flag & KeyUsageFlags.decipherOnly) {\n            res.push(\"decipherOnly\");\n        }\n        if (flag & KeyUsageFlags.digitalSignature) {\n            res.push(\"digitalSignature\");\n        }\n        if (flag & KeyUsageFlags.encipherOnly) {\n            res.push(\"encipherOnly\");\n        }\n        if (flag & KeyUsageFlags.keyAgreement) {\n            res.push(\"keyAgreement\");\n        }\n        if (flag & KeyUsageFlags.keyCertSign) {\n            res.push(\"keyCertSign\");\n        }\n        if (flag & KeyUsageFlags.keyEncipherment) {\n            res.push(\"keyEncipherment\");\n        }\n        if (flag & KeyUsageFlags.nonRepudiation) {\n            res.push(\"nonRepudiation\");\n        }\n        return res;\n    }\n    toString() {\n        return `[${this.toJSON().join(\", \")}]`;\n    }\n}\n","var GeneralSubtrees_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { GeneralName } from \"../general_name.js\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_nameConstraints = `${id_ce}.30`;\nexport class GeneralSubtree {\n    base = new GeneralName();\n    minimum = 0;\n    maximum;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: GeneralName })\n], GeneralSubtree.prototype, \"base\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        context: 0,\n        defaultValue: 0,\n        implicit: true,\n    })\n], GeneralSubtree.prototype, \"minimum\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        context: 1,\n        optional: true,\n        implicit: true,\n    })\n], GeneralSubtree.prototype, \"maximum\", void 0);\nlet GeneralSubtrees = GeneralSubtrees_1 = class GeneralSubtrees extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, GeneralSubtrees_1.prototype);\n    }\n};\nGeneralSubtrees = GeneralSubtrees_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: GeneralSubtree,\n    })\n], GeneralSubtrees);\nexport { GeneralSubtrees };\nexport class NameConstraints {\n    permittedSubtrees;\n    excludedSubtrees;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: GeneralSubtrees,\n        context: 0,\n        optional: true,\n        implicit: true,\n    })\n], NameConstraints.prototype, \"permittedSubtrees\", void 0);\n__decorate([\n    AsnProp({\n        type: GeneralSubtrees,\n        context: 1,\n        optional: true,\n        implicit: true,\n    })\n], NameConstraints.prototype, \"excludedSubtrees\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_policyConstraints = `${id_ce}.36`;\nexport class PolicyConstraints {\n    requireExplicitPolicy;\n    inhibitPolicyMapping;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        context: 0,\n        implicit: true,\n        optional: true,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], PolicyConstraints.prototype, \"requireExplicitPolicy\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        context: 1,\n        implicit: true,\n        optional: true,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], PolicyConstraints.prototype, \"inhibitPolicyMapping\", void 0);\n","var PolicyMappings_1;\nimport { __decorate } from \"tslib\";\nimport { AsnArray, AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_policyMappings = `${id_ce}.33`;\nexport class PolicyMapping {\n    issuerDomainPolicy = \"\";\n    subjectDomainPolicy = \"\";\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], PolicyMapping.prototype, \"issuerDomainPolicy\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], PolicyMapping.prototype, \"subjectDomainPolicy\", void 0);\nlet PolicyMappings = PolicyMappings_1 = class PolicyMappings extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, PolicyMappings_1.prototype);\n    }\n};\nPolicyMappings = PolicyMappings_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: PolicyMapping,\n    })\n], PolicyMappings);\nexport { PolicyMappings };\n","var SubjectAlternativeName_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { GeneralNames } from \"../general_names.js\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_subjectAltName = `${id_ce}.17`;\nlet SubjectAlternativeName = SubjectAlternativeName_1 = class SubjectAlternativeName extends GeneralNames {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, SubjectAlternativeName_1.prototype);\n    }\n};\nSubjectAlternativeName = SubjectAlternativeName_1 = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], SubjectAlternativeName);\nexport { SubjectAlternativeName };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nexport class Attribute {\n    type = \"\";\n    values = [];\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], Attribute.prototype, \"type\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        repeated: \"set\",\n    })\n], Attribute.prototype, \"values\", void 0);\n","var SubjectDirectoryAttributes_1;\nimport { __decorate } from \"tslib\";\nimport { AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { Attribute } from \"../attribute.js\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_subjectDirectoryAttributes = `${id_ce}.9`;\nlet SubjectDirectoryAttributes = SubjectDirectoryAttributes_1 = class SubjectDirectoryAttributes extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, SubjectDirectoryAttributes_1.prototype);\n    }\n};\nSubjectDirectoryAttributes = SubjectDirectoryAttributes_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: Attribute,\n    })\n], SubjectDirectoryAttributes);\nexport { SubjectDirectoryAttributes };\n","import { id_ce } from \"../object_identifiers.js\";\nimport { KeyIdentifier } from \"./authority_key_identifier.js\";\nexport const id_ce_subjectKeyIdentifier = `${id_ce}.14`;\nexport class SubjectKeyIdentifier extends KeyIdentifier {\n}\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { id_ce } from \"../object_identifiers.js\";\nexport const id_ce_privateKeyUsagePeriod = `${id_ce}.16`;\nexport class PrivateKeyUsagePeriod {\n    notBefore;\n    notAfter;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.GeneralizedTime,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], PrivateKeyUsagePeriod.prototype, \"notBefore\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.GeneralizedTime,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], PrivateKeyUsagePeriod.prototype, \"notAfter\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, BitString } from \"@peculiar/asn1-schema\";\nexport const id_entrust_entrustVersInfo = \"1.2.840.113533.7.65.0\";\nexport var EntrustInfoFlags;\n(function (EntrustInfoFlags) {\n    EntrustInfoFlags[EntrustInfoFlags[\"keyUpdateAllowed\"] = 1] = \"keyUpdateAllowed\";\n    EntrustInfoFlags[EntrustInfoFlags[\"newExtensions\"] = 2] = \"newExtensions\";\n    EntrustInfoFlags[EntrustInfoFlags[\"pKIXCertificate\"] = 4] = \"pKIXCertificate\";\n})(EntrustInfoFlags || (EntrustInfoFlags = {}));\nexport class EntrustInfo extends BitString {\n    toJSON() {\n        const res = [];\n        const flags = this.toNumber();\n        if (flags & EntrustInfoFlags.pKIXCertificate) {\n            res.push(\"pKIXCertificate\");\n        }\n        if (flags & EntrustInfoFlags.newExtensions) {\n            res.push(\"newExtensions\");\n        }\n        if (flags & EntrustInfoFlags.keyUpdateAllowed) {\n            res.push(\"keyUpdateAllowed\");\n        }\n        return res;\n    }\n    toString() {\n        return `[${this.toJSON().join(\", \")}]`;\n    }\n}\nexport class EntrustVersionInfo {\n    entrustVers = \"\";\n    entrustInfoFlags = new EntrustInfo();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.GeneralString })\n], EntrustVersionInfo.prototype, \"entrustVers\", void 0);\n__decorate([\n    AsnProp({ type: EntrustInfo })\n], EntrustVersionInfo.prototype, \"entrustInfoFlags\", void 0);\n","var SubjectInfoAccessSyntax_1;\nimport { __decorate } from \"tslib\";\nimport { AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { id_pe } from \"../object_identifiers.js\";\nimport { AccessDescription } from \"./authority_information_access.js\";\nexport const id_pe_subjectInfoAccess = `${id_pe}.11`;\nlet SubjectInfoAccessSyntax = SubjectInfoAccessSyntax_1 = class SubjectInfoAccessSyntax extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, SubjectInfoAccessSyntax_1.prototype);\n    }\n};\nSubjectInfoAccessSyntax = SubjectInfoAccessSyntax_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: AccessDescription,\n    })\n], SubjectInfoAccessSyntax);\nexport { SubjectInfoAccessSyntax };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { equal } from \"@peculiar/utils/bytes\";\nexport class AlgorithmIdentifier {\n    algorithm = \"\";\n    parameters;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n    isEqual(data) {\n        return (data instanceof AlgorithmIdentifier &&\n            data.algorithm == this.algorithm &&\n            ((data.parameters && this.parameters && equal(data.parameters, this.parameters)) || data.parameters === this.parameters));\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], AlgorithmIdentifier.prototype, \"algorithm\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        optional: true,\n    })\n], AlgorithmIdentifier.prototype, \"parameters\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"./algorithm_identifier.js\";\nexport class SubjectPublicKeyInfo {\n    algorithm = new AlgorithmIdentifier();\n    subjectPublicKey = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], SubjectPublicKeyInfo.prototype, \"algorithm\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BitString })\n], SubjectPublicKeyInfo.prototype, \"subjectPublicKey\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nlet Time = class Time {\n    utcTime;\n    generalTime;\n    constructor(time) {\n        if (time) {\n            if (typeof time === \"string\" || typeof time === \"number\" || time instanceof Date) {\n                const date = new Date(time);\n                date.setMilliseconds(0);\n                if (date.getUTCFullYear() > 2049) {\n                    this.generalTime = date;\n                }\n                else {\n                    this.utcTime = date;\n                }\n            }\n            else {\n                Object.assign(this, time);\n            }\n        }\n    }\n    getTime() {\n        const time = this.utcTime || this.generalTime;\n        if (!time) {\n            throw new Error(\"Cannot get time from CHOICE object\");\n        }\n        return time;\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.UTCTime })\n], Time.prototype, \"utcTime\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.GeneralizedTime })\n], Time.prototype, \"generalTime\", void 0);\nTime = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], Time);\nexport { Time };\n","import { __decorate } from \"tslib\";\nimport { AsnProp } from \"@peculiar/asn1-schema\";\nimport { Time } from \"./time.js\";\nexport class Validity {\n    notBefore = new Time(new Date());\n    notAfter = new Time(new Date());\n    constructor(params) {\n        if (params) {\n            this.notBefore = new Time(params.notBefore);\n            this.notAfter = new Time(params.notAfter);\n        }\n    }\n}\n__decorate([\n    AsnProp({ type: Time })\n], Validity.prototype, \"notBefore\", void 0);\n__decorate([\n    AsnProp({ type: Time })\n], Validity.prototype, \"notAfter\", void 0);\n","var Extensions_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nexport class Extension {\n    static CRITICAL = false;\n    extnID = \"\";\n    critical = Extension.CRITICAL;\n    extnValue = new OctetString();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], Extension.prototype, \"extnID\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Boolean,\n        defaultValue: Extension.CRITICAL,\n    })\n], Extension.prototype, \"critical\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], Extension.prototype, \"extnValue\", void 0);\nlet Extensions = Extensions_1 = class Extensions extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, Extensions_1.prototype);\n    }\n};\nExtensions = Extensions_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: Extension,\n    })\n], Extensions);\nexport { Extensions };\n","export var Version;\n(function (Version) {\n    Version[Version[\"v1\"] = 0] = \"v1\";\n    Version[Version[\"v2\"] = 1] = \"v2\";\n    Version[Version[\"v3\"] = 2] = \"v3\";\n})(Version || (Version = {}));\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"./algorithm_identifier.js\";\nimport { Name } from \"./name.js\";\nimport { SubjectPublicKeyInfo } from \"./subject_public_key_info.js\";\nimport { Validity } from \"./validity.js\";\nimport { Extensions } from \"./extension.js\";\nimport { Version } from \"./types.js\";\nexport class TBSCertificate {\n    version = Version.v1;\n    serialNumber = new ArrayBuffer(0);\n    signature = new AlgorithmIdentifier();\n    issuer = new Name();\n    validity = new Validity();\n    subject = new Name();\n    subjectPublicKeyInfo = new SubjectPublicKeyInfo();\n    issuerUniqueID;\n    subjectUniqueID;\n    extensions;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        context: 0,\n        defaultValue: Version.v1,\n    })\n], TBSCertificate.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], TBSCertificate.prototype, \"serialNumber\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], TBSCertificate.prototype, \"signature\", void 0);\n__decorate([\n    AsnProp({ type: Name })\n], TBSCertificate.prototype, \"issuer\", void 0);\n__decorate([\n    AsnProp({ type: Validity })\n], TBSCertificate.prototype, \"validity\", void 0);\n__decorate([\n    AsnProp({ type: Name })\n], TBSCertificate.prototype, \"subject\", void 0);\n__decorate([\n    AsnProp({ type: SubjectPublicKeyInfo })\n], TBSCertificate.prototype, \"subjectPublicKeyInfo\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.BitString,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], TBSCertificate.prototype, \"issuerUniqueID\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.BitString,\n        context: 2,\n        implicit: true,\n        optional: true,\n    })\n], TBSCertificate.prototype, \"subjectUniqueID\", void 0);\n__decorate([\n    AsnProp({\n        type: Extensions,\n        context: 3,\n        optional: true,\n    })\n], TBSCertificate.prototype, \"extensions\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"./algorithm_identifier.js\";\nimport { TBSCertificate } from \"./tbs_certificate.js\";\nexport class Certificate {\n    tbsCertificate = new TBSCertificate();\n    tbsCertificateRaw;\n    signatureAlgorithm = new AlgorithmIdentifier();\n    signatureValue = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: TBSCertificate,\n        raw: true,\n    })\n], Certificate.prototype, \"tbsCertificate\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], Certificate.prototype, \"signatureAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BitString })\n], Certificate.prototype, \"signatureValue\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"./algorithm_identifier.js\";\nimport { Name } from \"./name.js\";\nimport { Time } from \"./time.js\";\nimport { Extension } from \"./extension.js\";\nexport class RevokedCertificate {\n    userCertificate = new ArrayBuffer(0);\n    revocationDate = new Time();\n    crlEntryExtensions;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RevokedCertificate.prototype, \"userCertificate\", void 0);\n__decorate([\n    AsnProp({ type: Time })\n], RevokedCertificate.prototype, \"revocationDate\", void 0);\n__decorate([\n    AsnProp({\n        type: Extension,\n        optional: true,\n        repeated: \"sequence\",\n    })\n], RevokedCertificate.prototype, \"crlEntryExtensions\", void 0);\nexport class TBSCertList {\n    version;\n    signature = new AlgorithmIdentifier();\n    issuer = new Name();\n    thisUpdate = new Time();\n    nextUpdate;\n    revokedCertificates;\n    crlExtensions;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], TBSCertList.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], TBSCertList.prototype, \"signature\", void 0);\n__decorate([\n    AsnProp({ type: Name })\n], TBSCertList.prototype, \"issuer\", void 0);\n__decorate([\n    AsnProp({ type: Time })\n], TBSCertList.prototype, \"thisUpdate\", void 0);\n__decorate([\n    AsnProp({\n        type: Time,\n        optional: true,\n    })\n], TBSCertList.prototype, \"nextUpdate\", void 0);\n__decorate([\n    AsnProp({\n        type: RevokedCertificate,\n        repeated: \"sequence\",\n        optional: true,\n    })\n], TBSCertList.prototype, \"revokedCertificates\", void 0);\n__decorate([\n    AsnProp({\n        type: Extension,\n        optional: true,\n        context: 0,\n        repeated: \"sequence\",\n    })\n], TBSCertList.prototype, \"crlExtensions\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"./algorithm_identifier.js\";\nimport { TBSCertList } from \"./tbs_cert_list.js\";\nexport class CertificateList {\n    tbsCertList = new TBSCertList();\n    tbsCertListRaw;\n    signatureAlgorithm = new AlgorithmIdentifier();\n    signature = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: TBSCertList,\n        raw: true,\n    })\n], CertificateList.prototype, \"tbsCertList\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], CertificateList.prototype, \"signatureAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BitString })\n], CertificateList.prototype, \"signature\", void 0);\n","import { AsnParser } from '@peculiar/asn1-schema';\nimport { BasicConstraints, Certificate, id_ce_basicConstraints } from '@peculiar/asn1-x509';\nconst issuerSubjectIDKey = {\n    '2.5.4.6': 'C',\n    '2.5.4.10': 'O',\n    '2.5.4.11': 'OU',\n    '2.5.4.3': 'CN',\n};\n/**\n * Extract PEM certificate info\n *\n * @param pemCertificate Result from call to `convertASN1toPEM(x5c[0])`\n */\nexport function getCertificateInfo(leafCertBuffer) {\n    const x509 = AsnParser.parse(leafCertBuffer, Certificate);\n    const parsedCert = x509.tbsCertificate;\n    // Issuer\n    const issuer = { combined: '' };\n    parsedCert.issuer.forEach(([iss]) => {\n        const key = issuerSubjectIDKey[iss.type];\n        if (key) {\n            issuer[key] = iss.value.toString();\n        }\n    });\n    issuer.combined = issuerSubjectToString(issuer);\n    // Subject\n    const subject = { combined: '' };\n    parsedCert.subject.forEach(([iss]) => {\n        const key = issuerSubjectIDKey[iss.type];\n        if (key) {\n            subject[key] = iss.value.toString();\n        }\n    });\n    subject.combined = issuerSubjectToString(subject);\n    let basicConstraintsCA = false;\n    if (parsedCert.extensions) {\n        // console.log(parsedCert.extensions);\n        for (const ext of parsedCert.extensions) {\n            if (ext.extnID === id_ce_basicConstraints) {\n                const basicConstraints = AsnParser.parse(ext.extnValue, BasicConstraints);\n                basicConstraintsCA = basicConstraints.cA;\n            }\n        }\n    }\n    return {\n        issuer,\n        subject,\n        version: parsedCert.version,\n        basicConstraintsCA,\n        notBefore: parsedCert.validity.notBefore.getTime(),\n        notAfter: parsedCert.validity.notAfter.getTime(),\n        parsedCertificate: x509,\n    };\n}\n/**\n * Stringify the parts of Issuer or Subject info for easier comparison of subject issuers with\n * issuer subjects.\n *\n * The order might seem arbitrary, because it is. It should be enough that the two are stringified\n * in the same order.\n */\nfunction issuerSubjectToString(input) {\n    const parts = [];\n    if (input.C) {\n        parts.push(input.C);\n    }\n    if (input.O) {\n        parts.push(input.O);\n    }\n    if (input.OU) {\n        parts.push(input.OU);\n    }\n    if (input.CN) {\n        parts.push(input.CN);\n    }\n    return parts.join(' : ');\n}\n","/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n(function (Reflect) {\n    // Metadata Proposal\n    // https://rbuckton.github.io/reflect-metadata/\n    (function (factory) {\n        var root = typeof globalThis === \"object\" ? globalThis :\n            typeof global === \"object\" ? global :\n                typeof self === \"object\" ? self :\n                    typeof this === \"object\" ? this :\n                        sloppyModeThis();\n        var exporter = makeExporter(Reflect);\n        if (typeof root.Reflect !== \"undefined\") {\n            exporter = makeExporter(root.Reflect, exporter);\n        }\n        factory(exporter, root);\n        if (typeof root.Reflect === \"undefined\") {\n            root.Reflect = Reflect;\n        }\n        function makeExporter(target, previous) {\n            return function (key, value) {\n                Object.defineProperty(target, key, { configurable: true, writable: true, value: value });\n                if (previous)\n                    previous(key, value);\n            };\n        }\n        function functionThis() {\n            try {\n                return Function(\"return this;\")();\n            }\n            catch (_) { }\n        }\n        function indirectEvalThis() {\n            try {\n                return (void 0, eval)(\"(function() { return this; })()\");\n            }\n            catch (_) { }\n        }\n        function sloppyModeThis() {\n            return functionThis() || indirectEvalThis();\n        }\n    })(function (exporter, root) {\n        var hasOwn = Object.prototype.hasOwnProperty;\n        // feature test for Symbol support\n        var supportsSymbol = typeof Symbol === \"function\";\n        var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : \"@@toPrimitive\";\n        var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : \"@@iterator\";\n        var supportsCreate = typeof Object.create === \"function\"; // feature test for Object.create support\n        var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support\n        var downLevel = !supportsCreate && !supportsProto;\n        var HashMap = {\n            // create an object in dictionary mode (a.k.a. \"slow\" mode in v8)\n            create: supportsCreate\n                ? function () { return MakeDictionary(Object.create(null)); }\n                : supportsProto\n                    ? function () { return MakeDictionary({ __proto__: null }); }\n                    : function () { return MakeDictionary({}); },\n            has: downLevel\n                ? function (map, key) { return hasOwn.call(map, key); }\n                : function (map, key) { return key in map; },\n            get: downLevel\n                ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }\n                : function (map, key) { return map[key]; },\n        };\n        // Load global or shim versions of Map, Set, and WeakMap\n        var functionPrototype = Object.getPrototypeOf(Function);\n        var _Map = typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n        var _Set = typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n        var _WeakMap = typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill();\n        var registrySymbol = supportsSymbol ? Symbol.for(\"@reflect-metadata:registry\") : undefined;\n        var metadataRegistry = GetOrCreateMetadataRegistry();\n        var metadataProvider = CreateMetadataProvider(metadataRegistry);\n        /**\n         * Applies a set of decorators to a property of a target object.\n         * @param decorators An array of decorators.\n         * @param target The target object.\n         * @param propertyKey (Optional) The property key to decorate.\n         * @param attributes (Optional) The property descriptor for the target key.\n         * @remarks Decorators are applied in reverse order.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     Example = Reflect.decorate(decoratorsArray, Example);\n         *\n         *     // property (on constructor)\n         *     Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     Object.defineProperty(Example, \"staticMethod\",\n         *         Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n         *             Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n         *\n         *     // method (on prototype)\n         *     Object.defineProperty(Example.prototype, \"method\",\n         *         Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n         *             Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n         *\n         */\n        function decorate(decorators, target, propertyKey, attributes) {\n            if (!IsUndefined(propertyKey)) {\n                if (!IsArray(decorators))\n                    throw new TypeError();\n                if (!IsObject(target))\n                    throw new TypeError();\n                if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))\n                    throw new TypeError();\n                if (IsNull(attributes))\n                    attributes = undefined;\n                propertyKey = ToPropertyKey(propertyKey);\n                return DecorateProperty(decorators, target, propertyKey, attributes);\n            }\n            else {\n                if (!IsArray(decorators))\n                    throw new TypeError();\n                if (!IsConstructor(target))\n                    throw new TypeError();\n                return DecorateConstructor(decorators, target);\n            }\n        }\n        exporter(\"decorate\", decorate);\n        // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n        // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n        /**\n         * A default metadata decorator factory that can be used on a class, class member, or parameter.\n         * @param metadataKey The key for the metadata entry.\n         * @param metadataValue The value for the metadata entry.\n         * @returns A decorator function.\n         * @remarks\n         * If `metadataKey` is already defined for the target and target key, the\n         * metadataValue for that key will be overwritten.\n         * @example\n         *\n         *     // constructor\n         *     @Reflect.metadata(key, value)\n         *     class Example {\n         *     }\n         *\n         *     // property (on constructor, TypeScript only)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         static staticProperty;\n         *     }\n         *\n         *     // property (on prototype, TypeScript only)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         property;\n         *     }\n         *\n         *     // method (on constructor)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         static staticMethod() { }\n         *     }\n         *\n         *     // method (on prototype)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         method() { }\n         *     }\n         *\n         */\n        function metadata(metadataKey, metadataValue) {\n            function decorator(target, propertyKey) {\n                if (!IsObject(target))\n                    throw new TypeError();\n                if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))\n                    throw new TypeError();\n                OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n            }\n            return decorator;\n        }\n        exporter(\"metadata\", metadata);\n        /**\n         * Define a unique metadata entry on the target.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param metadataValue A value that contains attached metadata.\n         * @param target The target object on which to define metadata.\n         * @param propertyKey (Optional) The property key for the target.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example);\n         *\n         *     // property (on constructor)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n         *\n         *     // decorator factory as metadata-producing annotation.\n         *     function MyAnnotation(options): Decorator {\n         *         return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n         *     }\n         *\n         */\n        function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n        }\n        exporter(\"defineMetadata\", defineMetadata);\n        /**\n         * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function hasMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"hasMetadata\", hasMetadata);\n        /**\n         * Gets a value indicating whether the target object has the provided metadata key defined.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function hasOwnMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"hasOwnMetadata\", hasOwnMetadata);\n        /**\n         * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function getMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"getMetadata\", getMetadata);\n        /**\n         * Gets the metadata value for the provided metadata key on the target object.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function getOwnMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"getOwnMetadata\", getOwnMetadata);\n        /**\n         * Gets the metadata keys defined on the target object or its prototype chain.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns An array of unique metadata keys.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getMetadataKeys(Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n         *\n         */\n        function getMetadataKeys(target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryMetadataKeys(target, propertyKey);\n        }\n        exporter(\"getMetadataKeys\", getMetadataKeys);\n        /**\n         * Gets the unique metadata keys defined on the target object.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns An array of unique metadata keys.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getOwnMetadataKeys(Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n         *\n         */\n        function getOwnMetadataKeys(target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryOwnMetadataKeys(target, propertyKey);\n        }\n        exporter(\"getOwnMetadataKeys\", getOwnMetadataKeys);\n        /**\n         * Deletes the metadata entry from the target object with the provided key.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function deleteMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            var provider = GetMetadataProvider(target, propertyKey, /*Create*/ false);\n            if (IsUndefined(provider))\n                return false;\n            return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"deleteMetadata\", deleteMetadata);\n        function DecorateConstructor(decorators, target) {\n            for (var i = decorators.length - 1; i >= 0; --i) {\n                var decorator = decorators[i];\n                var decorated = decorator(target);\n                if (!IsUndefined(decorated) && !IsNull(decorated)) {\n                    if (!IsConstructor(decorated))\n                        throw new TypeError();\n                    target = decorated;\n                }\n            }\n            return target;\n        }\n        function DecorateProperty(decorators, target, propertyKey, descriptor) {\n            for (var i = decorators.length - 1; i >= 0; --i) {\n                var decorator = decorators[i];\n                var decorated = decorator(target, propertyKey, descriptor);\n                if (!IsUndefined(decorated) && !IsNull(decorated)) {\n                    if (!IsObject(decorated))\n                        throw new TypeError();\n                    descriptor = decorated;\n                }\n            }\n            return descriptor;\n        }\n        // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n        function OrdinaryHasMetadata(MetadataKey, O, P) {\n            var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n            if (hasOwn)\n                return true;\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (!IsNull(parent))\n                return OrdinaryHasMetadata(MetadataKey, parent, P);\n            return false;\n        }\n        // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n        function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ false);\n            if (IsUndefined(provider))\n                return false;\n            return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));\n        }\n        // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n        function OrdinaryGetMetadata(MetadataKey, O, P) {\n            var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n            if (hasOwn)\n                return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (!IsNull(parent))\n                return OrdinaryGetMetadata(MetadataKey, parent, P);\n            return undefined;\n        }\n        // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n        function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ false);\n            if (IsUndefined(provider))\n                return;\n            return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);\n        }\n        // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n        function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ true);\n            provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);\n        }\n        // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n        function OrdinaryMetadataKeys(O, P) {\n            var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (parent === null)\n                return ownKeys;\n            var parentKeys = OrdinaryMetadataKeys(parent, P);\n            if (parentKeys.length <= 0)\n                return ownKeys;\n            if (ownKeys.length <= 0)\n                return parentKeys;\n            var set = new _Set();\n            var keys = [];\n            for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n                var key = ownKeys_1[_i];\n                var hasKey = set.has(key);\n                if (!hasKey) {\n                    set.add(key);\n                    keys.push(key);\n                }\n            }\n            for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n                var key = parentKeys_1[_a];\n                var hasKey = set.has(key);\n                if (!hasKey) {\n                    set.add(key);\n                    keys.push(key);\n                }\n            }\n            return keys;\n        }\n        // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n        function OrdinaryOwnMetadataKeys(O, P) {\n            var provider = GetMetadataProvider(O, P, /*create*/ false);\n            if (!provider) {\n                return [];\n            }\n            return provider.OrdinaryOwnMetadataKeys(O, P);\n        }\n        // 6 ECMAScript Data Types and Values\n        // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n        function Type(x) {\n            if (x === null)\n                return 1 /* Null */;\n            switch (typeof x) {\n                case \"undefined\": return 0 /* Undefined */;\n                case \"boolean\": return 2 /* Boolean */;\n                case \"string\": return 3 /* String */;\n                case \"symbol\": return 4 /* Symbol */;\n                case \"number\": return 5 /* Number */;\n                case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n                default: return 6 /* Object */;\n            }\n        }\n        // 6.1.1 The Undefined Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n        function IsUndefined(x) {\n            return x === undefined;\n        }\n        // 6.1.2 The Null Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n        function IsNull(x) {\n            return x === null;\n        }\n        // 6.1.5 The Symbol Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n        function IsSymbol(x) {\n            return typeof x === \"symbol\";\n        }\n        // 6.1.7 The Object Type\n        // https://tc39.github.io/ecma262/#sec-object-type\n        function IsObject(x) {\n            return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n        }\n        // 7.1 Type Conversion\n        // https://tc39.github.io/ecma262/#sec-type-conversion\n        // 7.1.1 ToPrimitive(input [, PreferredType])\n        // https://tc39.github.io/ecma262/#sec-toprimitive\n        function ToPrimitive(input, PreferredType) {\n            switch (Type(input)) {\n                case 0 /* Undefined */: return input;\n                case 1 /* Null */: return input;\n                case 2 /* Boolean */: return input;\n                case 3 /* String */: return input;\n                case 4 /* Symbol */: return input;\n                case 5 /* Number */: return input;\n            }\n            var hint = PreferredType === 3 /* String */ ? \"string\" : PreferredType === 5 /* Number */ ? \"number\" : \"default\";\n            var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n            if (exoticToPrim !== undefined) {\n                var result = exoticToPrim.call(input, hint);\n                if (IsObject(result))\n                    throw new TypeError();\n                return result;\n            }\n            return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n        }\n        // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n        // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n        function OrdinaryToPrimitive(O, hint) {\n            if (hint === \"string\") {\n                var toString_1 = O.toString;\n                if (IsCallable(toString_1)) {\n                    var result = toString_1.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n                var valueOf = O.valueOf;\n                if (IsCallable(valueOf)) {\n                    var result = valueOf.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n            }\n            else {\n                var valueOf = O.valueOf;\n                if (IsCallable(valueOf)) {\n                    var result = valueOf.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n                var toString_2 = O.toString;\n                if (IsCallable(toString_2)) {\n                    var result = toString_2.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n            }\n            throw new TypeError();\n        }\n        // 7.1.2 ToBoolean(argument)\n        // https://tc39.github.io/ecma262/2016/#sec-toboolean\n        function ToBoolean(argument) {\n            return !!argument;\n        }\n        // 7.1.12 ToString(argument)\n        // https://tc39.github.io/ecma262/#sec-tostring\n        function ToString(argument) {\n            return \"\" + argument;\n        }\n        // 7.1.14 ToPropertyKey(argument)\n        // https://tc39.github.io/ecma262/#sec-topropertykey\n        function ToPropertyKey(argument) {\n            var key = ToPrimitive(argument, 3 /* String */);\n            if (IsSymbol(key))\n                return key;\n            return ToString(key);\n        }\n        // 7.2 Testing and Comparison Operations\n        // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n        // 7.2.2 IsArray(argument)\n        // https://tc39.github.io/ecma262/#sec-isarray\n        function IsArray(argument) {\n            return Array.isArray\n                ? Array.isArray(argument)\n                : argument instanceof Object\n                    ? argument instanceof Array\n                    : Object.prototype.toString.call(argument) === \"[object Array]\";\n        }\n        // 7.2.3 IsCallable(argument)\n        // https://tc39.github.io/ecma262/#sec-iscallable\n        function IsCallable(argument) {\n            // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n            return typeof argument === \"function\";\n        }\n        // 7.2.4 IsConstructor(argument)\n        // https://tc39.github.io/ecma262/#sec-isconstructor\n        function IsConstructor(argument) {\n            // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n            return typeof argument === \"function\";\n        }\n        // 7.2.7 IsPropertyKey(argument)\n        // https://tc39.github.io/ecma262/#sec-ispropertykey\n        function IsPropertyKey(argument) {\n            switch (Type(argument)) {\n                case 3 /* String */: return true;\n                case 4 /* Symbol */: return true;\n                default: return false;\n            }\n        }\n        function SameValueZero(x, y) {\n            return x === y || x !== x && y !== y;\n        }\n        // 7.3 Operations on Objects\n        // https://tc39.github.io/ecma262/#sec-operations-on-objects\n        // 7.3.9 GetMethod(V, P)\n        // https://tc39.github.io/ecma262/#sec-getmethod\n        function GetMethod(V, P) {\n            var func = V[P];\n            if (func === undefined || func === null)\n                return undefined;\n            if (!IsCallable(func))\n                throw new TypeError();\n            return func;\n        }\n        // 7.4 Operations on Iterator Objects\n        // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n        function GetIterator(obj) {\n            var method = GetMethod(obj, iteratorSymbol);\n            if (!IsCallable(method))\n                throw new TypeError(); // from Call\n            var iterator = method.call(obj);\n            if (!IsObject(iterator))\n                throw new TypeError();\n            return iterator;\n        }\n        // 7.4.4 IteratorValue(iterResult)\n        // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n        function IteratorValue(iterResult) {\n            return iterResult.value;\n        }\n        // 7.4.5 IteratorStep(iterator)\n        // https://tc39.github.io/ecma262/#sec-iteratorstep\n        function IteratorStep(iterator) {\n            var result = iterator.next();\n            return result.done ? false : result;\n        }\n        // 7.4.6 IteratorClose(iterator, completion)\n        // https://tc39.github.io/ecma262/#sec-iteratorclose\n        function IteratorClose(iterator) {\n            var f = iterator[\"return\"];\n            if (f)\n                f.call(iterator);\n        }\n        // 9.1 Ordinary Object Internal Methods and Internal Slots\n        // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n        // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n        // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n        function OrdinaryGetPrototypeOf(O) {\n            var proto = Object.getPrototypeOf(O);\n            if (typeof O !== \"function\" || O === functionPrototype)\n                return proto;\n            // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n            // Try to determine the superclass constructor. Compatible implementations\n            // must either set __proto__ on a subclass constructor to the superclass constructor,\n            // or ensure each class has a valid `constructor` property on its prototype that\n            // points back to the constructor.\n            // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n            // This is the case when in ES6 or when using __proto__ in a compatible browser.\n            if (proto !== functionPrototype)\n                return proto;\n            // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n            var prototype = O.prototype;\n            var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n            if (prototypeProto == null || prototypeProto === Object.prototype)\n                return proto;\n            // If the constructor was not a function, then we cannot determine the heritage.\n            var constructor = prototypeProto.constructor;\n            if (typeof constructor !== \"function\")\n                return proto;\n            // If we have some kind of self-reference, then we cannot determine the heritage.\n            if (constructor === O)\n                return proto;\n            // we have a pretty good guess at the heritage.\n            return constructor;\n        }\n        // Global metadata registry\n        // - Allows `import \"reflect-metadata\"` and `import \"reflect-metadata/no-conflict\"` to interoperate.\n        // - Uses isolated metadata if `Reflect` is frozen before the registry can be installed.\n        /**\n         * Creates a registry used to allow multiple `reflect-metadata` providers.\n         */\n        function CreateMetadataRegistry() {\n            var fallback;\n            if (!IsUndefined(registrySymbol) &&\n                typeof root.Reflect !== \"undefined\" &&\n                !(registrySymbol in root.Reflect) &&\n                typeof root.Reflect.defineMetadata === \"function\") {\n                // interoperate with older version of `reflect-metadata` that did not support a registry.\n                fallback = CreateFallbackProvider(root.Reflect);\n            }\n            var first;\n            var second;\n            var rest;\n            var targetProviderMap = new _WeakMap();\n            var registry = {\n                registerProvider: registerProvider,\n                getProvider: getProvider,\n                setProvider: setProvider,\n            };\n            return registry;\n            function registerProvider(provider) {\n                if (!Object.isExtensible(registry)) {\n                    throw new Error(\"Cannot add provider to a frozen registry.\");\n                }\n                switch (true) {\n                    case fallback === provider: break;\n                    case IsUndefined(first):\n                        first = provider;\n                        break;\n                    case first === provider: break;\n                    case IsUndefined(second):\n                        second = provider;\n                        break;\n                    case second === provider: break;\n                    default:\n                        if (rest === undefined)\n                            rest = new _Set();\n                        rest.add(provider);\n                        break;\n                }\n            }\n            function getProviderNoCache(O, P) {\n                if (!IsUndefined(first)) {\n                    if (first.isProviderFor(O, P))\n                        return first;\n                    if (!IsUndefined(second)) {\n                        if (second.isProviderFor(O, P))\n                            return first;\n                        if (!IsUndefined(rest)) {\n                            var iterator = GetIterator(rest);\n                            while (true) {\n                                var next = IteratorStep(iterator);\n                                if (!next) {\n                                    return undefined;\n                                }\n                                var provider = IteratorValue(next);\n                                if (provider.isProviderFor(O, P)) {\n                                    IteratorClose(iterator);\n                                    return provider;\n                                }\n                            }\n                        }\n                    }\n                }\n                if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {\n                    return fallback;\n                }\n                return undefined;\n            }\n            function getProvider(O, P) {\n                var providerMap = targetProviderMap.get(O);\n                var provider;\n                if (!IsUndefined(providerMap)) {\n                    provider = providerMap.get(P);\n                }\n                if (!IsUndefined(provider)) {\n                    return provider;\n                }\n                provider = getProviderNoCache(O, P);\n                if (!IsUndefined(provider)) {\n                    if (IsUndefined(providerMap)) {\n                        providerMap = new _Map();\n                        targetProviderMap.set(O, providerMap);\n                    }\n                    providerMap.set(P, provider);\n                }\n                return provider;\n            }\n            function hasProvider(provider) {\n                if (IsUndefined(provider))\n                    throw new TypeError();\n                return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);\n            }\n            function setProvider(O, P, provider) {\n                if (!hasProvider(provider)) {\n                    throw new Error(\"Metadata provider not registered.\");\n                }\n                var existingProvider = getProvider(O, P);\n                if (existingProvider !== provider) {\n                    if (!IsUndefined(existingProvider)) {\n                        return false;\n                    }\n                    var providerMap = targetProviderMap.get(O);\n                    if (IsUndefined(providerMap)) {\n                        providerMap = new _Map();\n                        targetProviderMap.set(O, providerMap);\n                    }\n                    providerMap.set(P, provider);\n                }\n                return true;\n            }\n        }\n        /**\n         * Gets or creates the shared registry of metadata providers.\n         */\n        function GetOrCreateMetadataRegistry() {\n            var metadataRegistry;\n            if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n                metadataRegistry = root.Reflect[registrySymbol];\n            }\n            if (IsUndefined(metadataRegistry)) {\n                metadataRegistry = CreateMetadataRegistry();\n            }\n            if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n                Object.defineProperty(root.Reflect, registrySymbol, {\n                    enumerable: false,\n                    configurable: false,\n                    writable: false,\n                    value: metadataRegistry\n                });\n            }\n            return metadataRegistry;\n        }\n        function CreateMetadataProvider(registry) {\n            // [[Metadata]] internal slot\n            // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n            var metadata = new _WeakMap();\n            var provider = {\n                isProviderFor: function (O, P) {\n                    var targetMetadata = metadata.get(O);\n                    if (IsUndefined(targetMetadata))\n                        return false;\n                    return targetMetadata.has(P);\n                },\n                OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata,\n                OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata,\n                OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata,\n                OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys,\n                OrdinaryDeleteMetadata: OrdinaryDeleteMetadata,\n            };\n            metadataRegistry.registerProvider(provider);\n            return provider;\n            function GetOrCreateMetadataMap(O, P, Create) {\n                var targetMetadata = metadata.get(O);\n                var createdTargetMetadata = false;\n                if (IsUndefined(targetMetadata)) {\n                    if (!Create)\n                        return undefined;\n                    targetMetadata = new _Map();\n                    metadata.set(O, targetMetadata);\n                    createdTargetMetadata = true;\n                }\n                var metadataMap = targetMetadata.get(P);\n                if (IsUndefined(metadataMap)) {\n                    if (!Create)\n                        return undefined;\n                    metadataMap = new _Map();\n                    targetMetadata.set(P, metadataMap);\n                    if (!registry.setProvider(O, P, provider)) {\n                        targetMetadata.delete(P);\n                        if (createdTargetMetadata) {\n                            metadata.delete(O);\n                        }\n                        throw new Error(\"Wrong provider for target.\");\n                    }\n                }\n                return metadataMap;\n            }\n            // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n            function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return false;\n                return ToBoolean(metadataMap.has(MetadataKey));\n            }\n            // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n            function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return undefined;\n                return metadataMap.get(MetadataKey);\n            }\n            // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n            function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);\n                metadataMap.set(MetadataKey, MetadataValue);\n            }\n            // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n            function OrdinaryOwnMetadataKeys(O, P) {\n                var keys = [];\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return keys;\n                var keysObj = metadataMap.keys();\n                var iterator = GetIterator(keysObj);\n                var k = 0;\n                while (true) {\n                    var next = IteratorStep(iterator);\n                    if (!next) {\n                        keys.length = k;\n                        return keys;\n                    }\n                    var nextValue = IteratorValue(next);\n                    try {\n                        keys[k] = nextValue;\n                    }\n                    catch (e) {\n                        try {\n                            IteratorClose(iterator);\n                        }\n                        finally {\n                            throw e;\n                        }\n                    }\n                    k++;\n                }\n            }\n            function OrdinaryDeleteMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return false;\n                if (!metadataMap.delete(MetadataKey))\n                    return false;\n                if (metadataMap.size === 0) {\n                    var targetMetadata = metadata.get(O);\n                    if (!IsUndefined(targetMetadata)) {\n                        targetMetadata.delete(P);\n                        if (targetMetadata.size === 0) {\n                            metadata.delete(targetMetadata);\n                        }\n                    }\n                }\n                return true;\n            }\n        }\n        function CreateFallbackProvider(reflect) {\n            var defineMetadata = reflect.defineMetadata, hasOwnMetadata = reflect.hasOwnMetadata, getOwnMetadata = reflect.getOwnMetadata, getOwnMetadataKeys = reflect.getOwnMetadataKeys, deleteMetadata = reflect.deleteMetadata;\n            var metadataOwner = new _WeakMap();\n            var provider = {\n                isProviderFor: function (O, P) {\n                    var metadataPropertySet = metadataOwner.get(O);\n                    if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {\n                        return true;\n                    }\n                    if (getOwnMetadataKeys(O, P).length) {\n                        if (IsUndefined(metadataPropertySet)) {\n                            metadataPropertySet = new _Set();\n                            metadataOwner.set(O, metadataPropertySet);\n                        }\n                        metadataPropertySet.add(P);\n                        return true;\n                    }\n                    return false;\n                },\n                OrdinaryDefineOwnMetadata: defineMetadata,\n                OrdinaryHasOwnMetadata: hasOwnMetadata,\n                OrdinaryGetOwnMetadata: getOwnMetadata,\n                OrdinaryOwnMetadataKeys: getOwnMetadataKeys,\n                OrdinaryDeleteMetadata: deleteMetadata,\n            };\n            return provider;\n        }\n        /**\n         * Gets the metadata provider for an object. If the object has no metadata provider and this is for a create operation,\n         * then this module's metadata provider is assigned to the object.\n         */\n        function GetMetadataProvider(O, P, Create) {\n            var registeredProvider = metadataRegistry.getProvider(O, P);\n            if (!IsUndefined(registeredProvider)) {\n                return registeredProvider;\n            }\n            if (Create) {\n                if (metadataRegistry.setProvider(O, P, metadataProvider)) {\n                    return metadataProvider;\n                }\n                throw new Error(\"Illegal state.\");\n            }\n            return undefined;\n        }\n        // naive Map shim\n        function CreateMapPolyfill() {\n            var cacheSentinel = {};\n            var arraySentinel = [];\n            var MapIterator = /** @class */ (function () {\n                function MapIterator(keys, values, selector) {\n                    this._index = 0;\n                    this._keys = keys;\n                    this._values = values;\n                    this._selector = selector;\n                }\n                MapIterator.prototype[\"@@iterator\"] = function () { return this; };\n                MapIterator.prototype[iteratorSymbol] = function () { return this; };\n                MapIterator.prototype.next = function () {\n                    var index = this._index;\n                    if (index >= 0 && index < this._keys.length) {\n                        var result = this._selector(this._keys[index], this._values[index]);\n                        if (index + 1 >= this._keys.length) {\n                            this._index = -1;\n                            this._keys = arraySentinel;\n                            this._values = arraySentinel;\n                        }\n                        else {\n                            this._index++;\n                        }\n                        return { value: result, done: false };\n                    }\n                    return { value: undefined, done: true };\n                };\n                MapIterator.prototype.throw = function (error) {\n                    if (this._index >= 0) {\n                        this._index = -1;\n                        this._keys = arraySentinel;\n                        this._values = arraySentinel;\n                    }\n                    throw error;\n                };\n                MapIterator.prototype.return = function (value) {\n                    if (this._index >= 0) {\n                        this._index = -1;\n                        this._keys = arraySentinel;\n                        this._values = arraySentinel;\n                    }\n                    return { value: value, done: true };\n                };\n                return MapIterator;\n            }());\n            var Map = /** @class */ (function () {\n                function Map() {\n                    this._keys = [];\n                    this._values = [];\n                    this._cacheKey = cacheSentinel;\n                    this._cacheIndex = -2;\n                }\n                Object.defineProperty(Map.prototype, \"size\", {\n                    get: function () { return this._keys.length; },\n                    enumerable: true,\n                    configurable: true\n                });\n                Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };\n                Map.prototype.get = function (key) {\n                    var index = this._find(key, /*insert*/ false);\n                    return index >= 0 ? this._values[index] : undefined;\n                };\n                Map.prototype.set = function (key, value) {\n                    var index = this._find(key, /*insert*/ true);\n                    this._values[index] = value;\n                    return this;\n                };\n                Map.prototype.delete = function (key) {\n                    var index = this._find(key, /*insert*/ false);\n                    if (index >= 0) {\n                        var size = this._keys.length;\n                        for (var i = index + 1; i < size; i++) {\n                            this._keys[i - 1] = this._keys[i];\n                            this._values[i - 1] = this._values[i];\n                        }\n                        this._keys.length--;\n                        this._values.length--;\n                        if (SameValueZero(key, this._cacheKey)) {\n                            this._cacheKey = cacheSentinel;\n                            this._cacheIndex = -2;\n                        }\n                        return true;\n                    }\n                    return false;\n                };\n                Map.prototype.clear = function () {\n                    this._keys.length = 0;\n                    this._values.length = 0;\n                    this._cacheKey = cacheSentinel;\n                    this._cacheIndex = -2;\n                };\n                Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };\n                Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };\n                Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };\n                Map.prototype[\"@@iterator\"] = function () { return this.entries(); };\n                Map.prototype[iteratorSymbol] = function () { return this.entries(); };\n                Map.prototype._find = function (key, insert) {\n                    if (!SameValueZero(this._cacheKey, key)) {\n                        this._cacheIndex = -1;\n                        for (var i = 0; i < this._keys.length; i++) {\n                            if (SameValueZero(this._keys[i], key)) {\n                                this._cacheIndex = i;\n                                break;\n                            }\n                        }\n                    }\n                    if (this._cacheIndex < 0 && insert) {\n                        this._cacheIndex = this._keys.length;\n                        this._keys.push(key);\n                        this._values.push(undefined);\n                    }\n                    return this._cacheIndex;\n                };\n                return Map;\n            }());\n            return Map;\n            function getKey(key, _) {\n                return key;\n            }\n            function getValue(_, value) {\n                return value;\n            }\n            function getEntry(key, value) {\n                return [key, value];\n            }\n        }\n        // naive Set shim\n        function CreateSetPolyfill() {\n            var Set = /** @class */ (function () {\n                function Set() {\n                    this._map = new _Map();\n                }\n                Object.defineProperty(Set.prototype, \"size\", {\n                    get: function () { return this._map.size; },\n                    enumerable: true,\n                    configurable: true\n                });\n                Set.prototype.has = function (value) { return this._map.has(value); };\n                Set.prototype.add = function (value) { return this._map.set(value, value), this; };\n                Set.prototype.delete = function (value) { return this._map.delete(value); };\n                Set.prototype.clear = function () { this._map.clear(); };\n                Set.prototype.keys = function () { return this._map.keys(); };\n                Set.prototype.values = function () { return this._map.keys(); };\n                Set.prototype.entries = function () { return this._map.entries(); };\n                Set.prototype[\"@@iterator\"] = function () { return this.keys(); };\n                Set.prototype[iteratorSymbol] = function () { return this.keys(); };\n                return Set;\n            }());\n            return Set;\n        }\n        // naive WeakMap shim\n        function CreateWeakMapPolyfill() {\n            var UUID_SIZE = 16;\n            var keys = HashMap.create();\n            var rootKey = CreateUniqueKey();\n            return /** @class */ (function () {\n                function WeakMap() {\n                    this._key = CreateUniqueKey();\n                }\n                WeakMap.prototype.has = function (target) {\n                    var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                    return table !== undefined ? HashMap.has(table, this._key) : false;\n                };\n                WeakMap.prototype.get = function (target) {\n                    var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                    return table !== undefined ? HashMap.get(table, this._key) : undefined;\n                };\n                WeakMap.prototype.set = function (target, value) {\n                    var table = GetOrCreateWeakMapTable(target, /*create*/ true);\n                    table[this._key] = value;\n                    return this;\n                };\n                WeakMap.prototype.delete = function (target) {\n                    var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n                    return table !== undefined ? delete table[this._key] : false;\n                };\n                WeakMap.prototype.clear = function () {\n                    // NOTE: not a real clear, just makes the previous data unreachable\n                    this._key = CreateUniqueKey();\n                };\n                return WeakMap;\n            }());\n            function CreateUniqueKey() {\n                var key;\n                do\n                    key = \"@@WeakMap@@\" + CreateUUID();\n                while (HashMap.has(keys, key));\n                keys[key] = true;\n                return key;\n            }\n            function GetOrCreateWeakMapTable(target, create) {\n                if (!hasOwn.call(target, rootKey)) {\n                    if (!create)\n                        return undefined;\n                    Object.defineProperty(target, rootKey, { value: HashMap.create() });\n                }\n                return target[rootKey];\n            }\n            function FillRandomBytes(buffer, size) {\n                for (var i = 0; i < size; ++i)\n                    buffer[i] = Math.random() * 0xff | 0;\n                return buffer;\n            }\n            function GenRandomBytes(size) {\n                if (typeof Uint8Array === \"function\") {\n                    var array = new Uint8Array(size);\n                    if (typeof crypto !== \"undefined\") {\n                        crypto.getRandomValues(array);\n                    }\n                    else if (typeof msCrypto !== \"undefined\") {\n                        msCrypto.getRandomValues(array);\n                    }\n                    else {\n                        FillRandomBytes(array, size);\n                    }\n                    return array;\n                }\n                return FillRandomBytes(new Array(size), size);\n            }\n            function CreateUUID() {\n                var data = GenRandomBytes(UUID_SIZE);\n                // mark as random - RFC 4122 § 4.4\n                data[6] = data[6] & 0x4f | 0x40;\n                data[8] = data[8] & 0xbf | 0x80;\n                var result = \"\";\n                for (var offset = 0; offset < UUID_SIZE; ++offset) {\n                    var byte = data[offset];\n                    if (offset === 4 || offset === 6 || offset === 8)\n                        result += \"-\";\n                    if (byte < 16)\n                        result += \"0\";\n                    result += byte.toString(16).toLowerCase();\n                }\n                return result;\n            }\n        }\n        // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n        function MakeDictionary(obj) {\n            obj.__ = undefined;\n            delete obj.__;\n            return obj;\n        }\n    });\n})(Reflect || (Reflect = {}));\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nimport { Name } from \"@peculiar/asn1-x509\";\nexport class IssuerAndSerialNumber {\n    issuer = new Name();\n    serialNumber = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: Name })\n], IssuerAndSerialNumber.prototype, \"issuer\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], IssuerAndSerialNumber.prototype, \"serialNumber\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { SubjectKeyIdentifier } from \"@peculiar/asn1-x509\";\nimport { IssuerAndSerialNumber } from \"./issuer_and_serial_number.js\";\nlet SignerIdentifier = class SignerIdentifier {\n    subjectKeyIdentifier;\n    issuerAndSerialNumber;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: SubjectKeyIdentifier,\n        context: 0,\n        implicit: true,\n    })\n], SignerIdentifier.prototype, \"subjectKeyIdentifier\", void 0);\n__decorate([\n    AsnProp({ type: IssuerAndSerialNumber })\n], SignerIdentifier.prototype, \"issuerAndSerialNumber\", void 0);\nSignerIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], SignerIdentifier);\nexport { SignerIdentifier };\n","import { __decorate } from \"tslib\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nimport { AsnTypeTypes, AsnType } from \"@peculiar/asn1-schema\";\nexport var CMSVersion;\n(function (CMSVersion) {\n    CMSVersion[CMSVersion[\"v0\"] = 0] = \"v0\";\n    CMSVersion[CMSVersion[\"v1\"] = 1] = \"v1\";\n    CMSVersion[CMSVersion[\"v2\"] = 2] = \"v2\";\n    CMSVersion[CMSVersion[\"v3\"] = 3] = \"v3\";\n    CMSVersion[CMSVersion[\"v4\"] = 4] = \"v4\";\n    CMSVersion[CMSVersion[\"v5\"] = 5] = \"v5\";\n})(CMSVersion || (CMSVersion = {}));\nlet DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends AlgorithmIdentifier {\n};\nDigestAlgorithmIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], DigestAlgorithmIdentifier);\nexport { DigestAlgorithmIdentifier };\nlet SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends AlgorithmIdentifier {\n};\nSignatureAlgorithmIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], SignatureAlgorithmIdentifier);\nexport { SignatureAlgorithmIdentifier };\nlet KeyEncryptionAlgorithmIdentifier = class KeyEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {\n};\nKeyEncryptionAlgorithmIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], KeyEncryptionAlgorithmIdentifier);\nexport { KeyEncryptionAlgorithmIdentifier };\nlet ContentEncryptionAlgorithmIdentifier = class ContentEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {\n};\nContentEncryptionAlgorithmIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], ContentEncryptionAlgorithmIdentifier);\nexport { ContentEncryptionAlgorithmIdentifier };\nlet MessageAuthenticationCodeAlgorithm = class MessageAuthenticationCodeAlgorithm extends AlgorithmIdentifier {\n};\nMessageAuthenticationCodeAlgorithm = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], MessageAuthenticationCodeAlgorithm);\nexport { MessageAuthenticationCodeAlgorithm };\nlet KeyDerivationAlgorithmIdentifier = class KeyDerivationAlgorithmIdentifier extends AlgorithmIdentifier {\n};\nKeyDerivationAlgorithmIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], KeyDerivationAlgorithmIdentifier);\nexport { KeyDerivationAlgorithmIdentifier };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nexport class Attribute {\n    attrType = \"\";\n    attrValues = [];\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], Attribute.prototype, \"attrType\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        repeated: \"set\",\n    })\n], Attribute.prototype, \"attrValues\", void 0);\n","var SignerInfos_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { SignerIdentifier } from \"./signer_identifier.js\";\nimport { CMSVersion, SignatureAlgorithmIdentifier, DigestAlgorithmIdentifier } from \"./types.js\";\nimport { Attribute } from \"./attribute.js\";\nexport class SignerInfo {\n    version = CMSVersion.v0;\n    sid = new SignerIdentifier();\n    digestAlgorithm = new DigestAlgorithmIdentifier();\n    signedAttrs;\n    signedAttrsRaw;\n    signatureAlgorithm = new SignatureAlgorithmIdentifier();\n    signature = new OctetString();\n    unsignedAttrs;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], SignerInfo.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: SignerIdentifier })\n], SignerInfo.prototype, \"sid\", void 0);\n__decorate([\n    AsnProp({ type: DigestAlgorithmIdentifier })\n], SignerInfo.prototype, \"digestAlgorithm\", void 0);\n__decorate([\n    AsnProp({\n        type: Attribute,\n        repeated: \"set\",\n        context: 0,\n        implicit: true,\n        optional: true,\n        raw: true,\n    })\n], SignerInfo.prototype, \"signedAttrs\", void 0);\n__decorate([\n    AsnProp({ type: SignatureAlgorithmIdentifier })\n], SignerInfo.prototype, \"signatureAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], SignerInfo.prototype, \"signature\", void 0);\n__decorate([\n    AsnProp({\n        type: Attribute,\n        repeated: \"set\",\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], SignerInfo.prototype, \"unsignedAttrs\", void 0);\nlet SignerInfos = SignerInfos_1 = class SignerInfos extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, SignerInfos_1.prototype);\n    }\n};\nSignerInfos = SignerInfos_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: SignerInfo,\n    })\n], SignerInfos);\nexport { SignerInfos };\n","import { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { SignerInfo } from \"../signer_info.js\";\nexport const id_counterSignature = \"1.2.840.113549.1.9.6\";\nlet CounterSignature = class CounterSignature extends SignerInfo {\n};\nCounterSignature = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], CounterSignature);\nexport { CounterSignature };\n","import { __decorate } from \"tslib\";\nimport { Time } from \"@peculiar/asn1-x509\";\nimport { AsnTypeTypes, AsnType } from \"@peculiar/asn1-schema\";\nexport const id_signingTime = \"1.2.840.113549.1.9.5\";\nlet SigningTime = class SigningTime extends Time {\n};\nSigningTime = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], SigningTime);\nexport { SigningTime };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { GeneralName, Attribute } from \"@peculiar/asn1-x509\";\nexport class ACClearAttrs {\n    acIssuer = new GeneralName();\n    acSerial = 0;\n    attrs = [];\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: GeneralName })\n], ACClearAttrs.prototype, \"acIssuer\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], ACClearAttrs.prototype, \"acSerial\", void 0);\n__decorate([\n    AsnProp({\n        type: Attribute,\n        repeated: \"sequence\",\n    })\n], ACClearAttrs.prototype, \"attrs\", void 0);\n","var AttrSpec_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes, AsnPropTypes, AsnArray } from \"@peculiar/asn1-schema\";\nlet AttrSpec = AttrSpec_1 = class AttrSpec extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, AttrSpec_1.prototype);\n    }\n};\nAttrSpec = AttrSpec_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: AsnPropTypes.ObjectIdentifier,\n    })\n], AttrSpec);\nexport { AttrSpec };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { AttrSpec } from \"./attr_spec.js\";\nexport class AAControls {\n    pathLenConstraint;\n    permittedAttrs;\n    excludedAttrs;\n    permitUnSpecified = true;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AAControls.prototype, \"pathLenConstraint\", void 0);\n__decorate([\n    AsnProp({\n        type: AttrSpec,\n        implicit: true,\n        context: 0,\n        optional: true,\n    })\n], AAControls.prototype, \"permittedAttrs\", void 0);\n__decorate([\n    AsnProp({\n        type: AttrSpec,\n        implicit: true,\n        context: 1,\n        optional: true,\n    })\n], AAControls.prototype, \"excludedAttrs\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Boolean,\n        defaultValue: true,\n    })\n], AAControls.prototype, \"permitUnSpecified\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nimport { GeneralNames } from \"@peculiar/asn1-x509\";\nexport class IssuerSerial {\n    issuer = new GeneralNames();\n    serial = new ArrayBuffer(0);\n    issuerUID = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: GeneralNames })\n], IssuerSerial.prototype, \"issuer\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], IssuerSerial.prototype, \"serial\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.BitString,\n        optional: true,\n    })\n], IssuerSerial.prototype, \"issuerUID\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nexport var DigestedObjectType;\n(function (DigestedObjectType) {\n    DigestedObjectType[DigestedObjectType[\"publicKey\"] = 0] = \"publicKey\";\n    DigestedObjectType[DigestedObjectType[\"publicKeyCert\"] = 1] = \"publicKeyCert\";\n    DigestedObjectType[DigestedObjectType[\"otherObjectTypes\"] = 2] = \"otherObjectTypes\";\n})(DigestedObjectType || (DigestedObjectType = {}));\nexport class ObjectDigestInfo {\n    digestedObjectType = DigestedObjectType.publicKey;\n    otherObjectTypeID;\n    digestAlgorithm = new AlgorithmIdentifier();\n    objectDigest = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], ObjectDigestInfo.prototype, \"digestedObjectType\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.ObjectIdentifier,\n        optional: true,\n    })\n], ObjectDigestInfo.prototype, \"otherObjectTypeID\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], ObjectDigestInfo.prototype, \"digestAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BitString })\n], ObjectDigestInfo.prototype, \"objectDigest\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp } from \"@peculiar/asn1-schema\";\nimport { GeneralNames } from \"@peculiar/asn1-x509\";\nimport { IssuerSerial } from \"./issuer_serial.js\";\nimport { ObjectDigestInfo } from \"./object_digest_info.js\";\nexport class V2Form {\n    issuerName;\n    baseCertificateID;\n    objectDigestInfo;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: GeneralNames,\n        optional: true,\n    })\n], V2Form.prototype, \"issuerName\", void 0);\n__decorate([\n    AsnProp({\n        type: IssuerSerial,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], V2Form.prototype, \"baseCertificateID\", void 0);\n__decorate([\n    AsnProp({\n        type: ObjectDigestInfo,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], V2Form.prototype, \"objectDigestInfo\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes, AsnProp } from \"@peculiar/asn1-schema\";\nimport { GeneralName } from \"@peculiar/asn1-x509\";\nimport { V2Form } from \"./v2_form.js\";\nlet AttCertIssuer = class AttCertIssuer {\n    v1Form;\n    v2Form;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: GeneralName,\n        repeated: \"sequence\",\n    })\n], AttCertIssuer.prototype, \"v1Form\", void 0);\n__decorate([\n    AsnProp({\n        type: V2Form,\n        context: 0,\n        implicit: true,\n    })\n], AttCertIssuer.prototype, \"v2Form\", void 0);\nAttCertIssuer = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], AttCertIssuer);\nexport { AttCertIssuer };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nexport class AttCertValidityPeriod {\n    notBeforeTime = new Date();\n    notAfterTime = new Date();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.GeneralizedTime })\n], AttCertValidityPeriod.prototype, \"notBeforeTime\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.GeneralizedTime })\n], AttCertValidityPeriod.prototype, \"notAfterTime\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp } from \"@peculiar/asn1-schema\";\nimport { GeneralNames } from \"@peculiar/asn1-x509\";\nimport { IssuerSerial } from \"./issuer_serial.js\";\nimport { ObjectDigestInfo } from \"./object_digest_info.js\";\nexport class Holder {\n    baseCertificateID;\n    entityName;\n    objectDigestInfo;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: IssuerSerial,\n        implicit: true,\n        context: 0,\n        optional: true,\n    })\n], Holder.prototype, \"baseCertificateID\", void 0);\n__decorate([\n    AsnProp({\n        type: GeneralNames,\n        implicit: true,\n        context: 1,\n        optional: true,\n    })\n], Holder.prototype, \"entityName\", void 0);\n__decorate([\n    AsnProp({\n        type: ObjectDigestInfo,\n        implicit: true,\n        context: 2,\n        optional: true,\n    })\n], Holder.prototype, \"objectDigestInfo\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier, Attribute, Extensions } from \"@peculiar/asn1-x509\";\nimport { Holder } from \"./holder.js\";\nimport { AttCertIssuer } from \"./attr_cert_issuer.js\";\nimport { AttCertValidityPeriod } from \"./attr_cert_validity_period.js\";\nexport var AttCertVersion;\n(function (AttCertVersion) {\n    AttCertVersion[AttCertVersion[\"v2\"] = 1] = \"v2\";\n})(AttCertVersion || (AttCertVersion = {}));\nexport class AttributeCertificateInfo {\n    version = AttCertVersion.v2;\n    holder = new Holder();\n    issuer = new AttCertIssuer();\n    signature = new AlgorithmIdentifier();\n    serialNumber = new ArrayBuffer(0);\n    attrCertValidityPeriod = new AttCertValidityPeriod();\n    attributes = [];\n    issuerUniqueID;\n    extensions;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], AttributeCertificateInfo.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: Holder })\n], AttributeCertificateInfo.prototype, \"holder\", void 0);\n__decorate([\n    AsnProp({ type: AttCertIssuer })\n], AttributeCertificateInfo.prototype, \"issuer\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], AttributeCertificateInfo.prototype, \"signature\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], AttributeCertificateInfo.prototype, \"serialNumber\", void 0);\n__decorate([\n    AsnProp({ type: AttCertValidityPeriod })\n], AttributeCertificateInfo.prototype, \"attrCertValidityPeriod\", void 0);\n__decorate([\n    AsnProp({\n        type: Attribute,\n        repeated: \"sequence\",\n    })\n], AttributeCertificateInfo.prototype, \"attributes\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.BitString,\n        optional: true,\n    })\n], AttributeCertificateInfo.prototype, \"issuerUniqueID\", void 0);\n__decorate([\n    AsnProp({\n        type: Extensions,\n        optional: true,\n    })\n], AttributeCertificateInfo.prototype, \"extensions\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nimport { AttributeCertificateInfo } from \"./attribute_certificate_info.js\";\nexport class AttributeCertificate {\n    acinfo = new AttributeCertificateInfo();\n    signatureAlgorithm = new AlgorithmIdentifier();\n    signatureValue = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AttributeCertificateInfo })\n], AttributeCertificate.prototype, \"acinfo\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], AttributeCertificate.prototype, \"signatureAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BitString })\n], AttributeCertificate.prototype, \"signatureValue\", void 0);\n","import { BitString } from \"@peculiar/asn1-schema\";\nexport var ClassListFlags;\n(function (ClassListFlags) {\n    ClassListFlags[ClassListFlags[\"unmarked\"] = 1] = \"unmarked\";\n    ClassListFlags[ClassListFlags[\"unclassified\"] = 2] = \"unclassified\";\n    ClassListFlags[ClassListFlags[\"restricted\"] = 4] = \"restricted\";\n    ClassListFlags[ClassListFlags[\"confidential\"] = 8] = \"confidential\";\n    ClassListFlags[ClassListFlags[\"secret\"] = 16] = \"secret\";\n    ClassListFlags[ClassListFlags[\"topSecret\"] = 32] = \"topSecret\";\n})(ClassListFlags || (ClassListFlags = {}));\nexport class ClassList extends BitString {\n}\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nexport class SecurityCategory {\n    type = \"\";\n    value = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.ObjectIdentifier,\n        implicit: true,\n        context: 0,\n    })\n], SecurityCategory.prototype, \"type\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        implicit: true,\n        context: 1,\n    })\n], SecurityCategory.prototype, \"value\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { ClassList, ClassListFlags } from \"./class_list.js\";\nimport { SecurityCategory } from \"./security_category.js\";\nexport class Clearance {\n    policyId = \"\";\n    classList = new ClassList(ClassListFlags.unclassified);\n    securityCategories;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], Clearance.prototype, \"policyId\", void 0);\n__decorate([\n    AsnProp({\n        type: ClassList,\n        defaultValue: new ClassList(ClassListFlags.unclassified),\n    })\n], Clearance.prototype, \"classList\", void 0);\n__decorate([\n    AsnProp({\n        type: SecurityCategory,\n        repeated: \"set\",\n    })\n], Clearance.prototype, \"securityCategories\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, OctetString, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { GeneralNames } from \"@peculiar/asn1-x509\";\nexport class IetfAttrSyntaxValueChoices {\n    cotets;\n    oid;\n    string;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: OctetString })\n], IetfAttrSyntaxValueChoices.prototype, \"cotets\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], IetfAttrSyntaxValueChoices.prototype, \"oid\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Utf8String })\n], IetfAttrSyntaxValueChoices.prototype, \"string\", void 0);\nexport class IetfAttrSyntax {\n    policyAuthority;\n    values = [];\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: GeneralNames,\n        implicit: true,\n        context: 0,\n        optional: true,\n    })\n], IetfAttrSyntax.prototype, \"policyAuthority\", void 0);\n__decorate([\n    AsnProp({\n        type: IetfAttrSyntaxValueChoices,\n        repeated: \"sequence\",\n    })\n], IetfAttrSyntax.prototype, \"values\", void 0);\n","import { id_pe, id_ce, id_pkix } from \"@peculiar/asn1-x509\";\nexport const id_pe_ac_auditIdentity = `${id_pe}.4`;\nexport const id_pe_aaControls = `${id_pe}.6`;\nexport const id_pe_ac_proxying = `${id_pe}.10`;\nexport const id_ce_targetInformation = `${id_ce}.55`;\nexport const id_aca = `${id_pkix}.10`;\nexport const id_aca_authenticationInfo = `${id_aca}.1`;\nexport const id_aca_accessIdentity = `${id_aca}.2`;\nexport const id_aca_chargingIdentity = `${id_aca}.3`;\nexport const id_aca_group = `${id_aca}.4`;\nexport const id_aca_encAttrs = `${id_aca}.6`;\nexport const id_at = \"2.5.4\";\nexport const id_at_role = `${id_at}.72`;\nexport const id_at_clearance = \"2.5.1.5.55\";\n","var Targets_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnType, AsnTypeTypes, AsnArray } from \"@peculiar/asn1-schema\";\nimport { GeneralName } from \"@peculiar/asn1-x509\";\nimport { IssuerSerial } from \"./issuer_serial.js\";\nimport { ObjectDigestInfo } from \"./object_digest_info.js\";\nexport class TargetCert {\n    targetCertificate = new IssuerSerial();\n    targetName;\n    certDigestInfo;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: IssuerSerial })\n], TargetCert.prototype, \"targetCertificate\", void 0);\n__decorate([\n    AsnProp({\n        type: GeneralName,\n        optional: true,\n    })\n], TargetCert.prototype, \"targetName\", void 0);\n__decorate([\n    AsnProp({\n        type: ObjectDigestInfo,\n        optional: true,\n    })\n], TargetCert.prototype, \"certDigestInfo\", void 0);\nlet Target = class Target {\n    targetName;\n    targetGroup;\n    targetCert;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: GeneralName,\n        context: 0,\n        implicit: true,\n    })\n], Target.prototype, \"targetName\", void 0);\n__decorate([\n    AsnProp({\n        type: GeneralName,\n        context: 1,\n        implicit: true,\n    })\n], Target.prototype, \"targetGroup\", void 0);\n__decorate([\n    AsnProp({\n        type: TargetCert,\n        context: 2,\n        implicit: true,\n    })\n], Target.prototype, \"targetCert\", void 0);\nTarget = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], Target);\nexport { Target };\nlet Targets = Targets_1 = class Targets extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, Targets_1.prototype);\n    }\n};\nTargets = Targets_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: Target,\n    })\n], Targets);\nexport { Targets };\n","var ProxyInfo_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes, AsnArray } from \"@peculiar/asn1-schema\";\nimport { Targets } from \"./target.js\";\nlet ProxyInfo = ProxyInfo_1 = class ProxyInfo extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, ProxyInfo_1.prototype);\n    }\n};\nProxyInfo = ProxyInfo_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: Targets,\n    })\n], ProxyInfo);\nexport { ProxyInfo };\n","import { __decorate } from \"tslib\";\nimport { AsnProp } from \"@peculiar/asn1-schema\";\nimport { GeneralNames, GeneralName } from \"@peculiar/asn1-x509\";\nexport class RoleSyntax {\n    roleAuthority;\n    roleName;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: GeneralNames,\n        implicit: true,\n        context: 0,\n        optional: true,\n    })\n], RoleSyntax.prototype, \"roleAuthority\", void 0);\n__decorate([\n    AsnProp({\n        type: GeneralName,\n        implicit: true,\n        context: 1,\n    })\n], RoleSyntax.prototype, \"roleName\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, OctetString } from \"@peculiar/asn1-schema\";\nimport { GeneralName } from \"@peculiar/asn1-x509\";\nexport class SvceAuthInfo {\n    service = new GeneralName();\n    ident = new GeneralName();\n    authInfo;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: GeneralName })\n], SvceAuthInfo.prototype, \"service\", void 0);\n__decorate([\n    AsnProp({ type: GeneralName })\n], SvceAuthInfo.prototype, \"ident\", void 0);\n__decorate([\n    AsnProp({\n        type: OctetString,\n        optional: true,\n    })\n], SvceAuthInfo.prototype, \"authInfo\", void 0);\n","var CertificateSet_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes, AsnProp, AsnPropTypes, AsnArray } from \"@peculiar/asn1-schema\";\nimport { Certificate } from \"@peculiar/asn1-x509\";\nimport { AttributeCertificate } from \"@peculiar/asn1-x509-attr\";\nexport class OtherCertificateFormat {\n    otherCertFormat = \"\";\n    otherCert = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], OtherCertificateFormat.prototype, \"otherCertFormat\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Any })\n], OtherCertificateFormat.prototype, \"otherCert\", void 0);\nlet CertificateChoices = class CertificateChoices {\n    certificate;\n    v2AttrCert;\n    other;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({ type: Certificate })\n], CertificateChoices.prototype, \"certificate\", void 0);\n__decorate([\n    AsnProp({\n        type: AttributeCertificate,\n        context: 2,\n        implicit: true,\n    })\n], CertificateChoices.prototype, \"v2AttrCert\", void 0);\n__decorate([\n    AsnProp({\n        type: OtherCertificateFormat,\n        context: 3,\n        implicit: true,\n    })\n], CertificateChoices.prototype, \"other\", void 0);\nCertificateChoices = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], CertificateChoices);\nexport { CertificateChoices };\nlet CertificateSet = CertificateSet_1 = class CertificateSet extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, CertificateSet_1.prototype);\n    }\n};\nCertificateSet = CertificateSet_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: CertificateChoices,\n    })\n], CertificateSet);\nexport { CertificateSet };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nexport class ContentInfo {\n    contentType = \"\";\n    content = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], ContentInfo.prototype, \"contentType\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        context: 0,\n    })\n], ContentInfo.prototype, \"content\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nlet EncapsulatedContent = class EncapsulatedContent {\n    single;\n    any;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({ type: OctetString })\n], EncapsulatedContent.prototype, \"single\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Any })\n], EncapsulatedContent.prototype, \"any\", void 0);\nEncapsulatedContent = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], EncapsulatedContent);\nexport { EncapsulatedContent };\nexport class EncapsulatedContentInfo {\n    eContentType = \"\";\n    eContent;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], EncapsulatedContentInfo.prototype, \"eContentType\", void 0);\n__decorate([\n    AsnProp({\n        type: EncapsulatedContent,\n        context: 0,\n        optional: true,\n    })\n], EncapsulatedContentInfo.prototype, \"eContent\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnConstructedOctetStringConverter, AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { ContentEncryptionAlgorithmIdentifier } from \"./types.js\";\nlet EncryptedContent = class EncryptedContent {\n    value;\n    constructedValue;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: OctetString,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], EncryptedContent.prototype, \"value\", void 0);\n__decorate([\n    AsnProp({\n        type: OctetString,\n        converter: AsnConstructedOctetStringConverter,\n        context: 0,\n        implicit: true,\n        optional: true,\n        repeated: \"sequence\",\n    })\n], EncryptedContent.prototype, \"constructedValue\", void 0);\nEncryptedContent = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], EncryptedContent);\nexport { EncryptedContent };\nexport class EncryptedContentInfo {\n    contentType = \"\";\n    contentEncryptionAlgorithm = new ContentEncryptionAlgorithmIdentifier();\n    encryptedContent;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], EncryptedContentInfo.prototype, \"contentType\", void 0);\n__decorate([\n    AsnProp({ type: ContentEncryptionAlgorithmIdentifier })\n], EncryptedContentInfo.prototype, \"contentEncryptionAlgorithm\", void 0);\n__decorate([\n    AsnProp({\n        type: EncryptedContent,\n        optional: true,\n    })\n], EncryptedContentInfo.prototype, \"encryptedContent\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nexport class OtherKeyAttribute {\n    keyAttrId = \"\";\n    keyAttr;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], OtherKeyAttribute.prototype, \"keyAttrId\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        optional: true,\n    })\n], OtherKeyAttribute.prototype, \"keyAttr\", void 0);\n","var RecipientEncryptedKeys_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier, SubjectKeyIdentifier } from \"@peculiar/asn1-x509\";\nimport { CMSVersion, KeyEncryptionAlgorithmIdentifier } from \"./types.js\";\nimport { IssuerAndSerialNumber } from \"./issuer_and_serial_number.js\";\nimport { OtherKeyAttribute } from \"./other_key_attribute.js\";\nexport class RecipientKeyIdentifier {\n    subjectKeyIdentifier = new SubjectKeyIdentifier();\n    date;\n    other;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: SubjectKeyIdentifier })\n], RecipientKeyIdentifier.prototype, \"subjectKeyIdentifier\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.GeneralizedTime,\n        optional: true,\n    })\n], RecipientKeyIdentifier.prototype, \"date\", void 0);\n__decorate([\n    AsnProp({\n        type: OtherKeyAttribute,\n        optional: true,\n    })\n], RecipientKeyIdentifier.prototype, \"other\", void 0);\nlet KeyAgreeRecipientIdentifier = class KeyAgreeRecipientIdentifier {\n    rKeyId;\n    issuerAndSerialNumber;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: RecipientKeyIdentifier,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], KeyAgreeRecipientIdentifier.prototype, \"rKeyId\", void 0);\n__decorate([\n    AsnProp({\n        type: IssuerAndSerialNumber,\n        optional: true,\n    })\n], KeyAgreeRecipientIdentifier.prototype, \"issuerAndSerialNumber\", void 0);\nKeyAgreeRecipientIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], KeyAgreeRecipientIdentifier);\nexport { KeyAgreeRecipientIdentifier };\nexport class RecipientEncryptedKey {\n    rid = new KeyAgreeRecipientIdentifier();\n    encryptedKey = new OctetString();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: KeyAgreeRecipientIdentifier })\n], RecipientEncryptedKey.prototype, \"rid\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], RecipientEncryptedKey.prototype, \"encryptedKey\", void 0);\nlet RecipientEncryptedKeys = RecipientEncryptedKeys_1 = class RecipientEncryptedKeys extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, RecipientEncryptedKeys_1.prototype);\n    }\n};\nRecipientEncryptedKeys = RecipientEncryptedKeys_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: RecipientEncryptedKey,\n    })\n], RecipientEncryptedKeys);\nexport { RecipientEncryptedKeys };\nexport class OriginatorPublicKey {\n    algorithm = new AlgorithmIdentifier();\n    publicKey = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], OriginatorPublicKey.prototype, \"algorithm\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BitString })\n], OriginatorPublicKey.prototype, \"publicKey\", void 0);\nlet OriginatorIdentifierOrKey = class OriginatorIdentifierOrKey {\n    subjectKeyIdentifier;\n    originatorKey;\n    issuerAndSerialNumber;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: SubjectKeyIdentifier,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], OriginatorIdentifierOrKey.prototype, \"subjectKeyIdentifier\", void 0);\n__decorate([\n    AsnProp({\n        type: OriginatorPublicKey,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], OriginatorIdentifierOrKey.prototype, \"originatorKey\", void 0);\n__decorate([\n    AsnProp({\n        type: IssuerAndSerialNumber,\n        optional: true,\n    })\n], OriginatorIdentifierOrKey.prototype, \"issuerAndSerialNumber\", void 0);\nOriginatorIdentifierOrKey = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], OriginatorIdentifierOrKey);\nexport { OriginatorIdentifierOrKey };\nexport class KeyAgreeRecipientInfo {\n    version = CMSVersion.v3;\n    originator = new OriginatorIdentifierOrKey();\n    ukm;\n    keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();\n    recipientEncryptedKeys = new RecipientEncryptedKeys();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], KeyAgreeRecipientInfo.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({\n        type: OriginatorIdentifierOrKey,\n        context: 0,\n    })\n], KeyAgreeRecipientInfo.prototype, \"originator\", void 0);\n__decorate([\n    AsnProp({\n        type: OctetString,\n        context: 1,\n        optional: true,\n    })\n], KeyAgreeRecipientInfo.prototype, \"ukm\", void 0);\n__decorate([\n    AsnProp({ type: KeyEncryptionAlgorithmIdentifier })\n], KeyAgreeRecipientInfo.prototype, \"keyEncryptionAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: RecipientEncryptedKeys })\n], KeyAgreeRecipientInfo.prototype, \"recipientEncryptedKeys\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { SubjectKeyIdentifier } from \"@peculiar/asn1-x509\";\nimport { CMSVersion, KeyEncryptionAlgorithmIdentifier } from \"./types.js\";\nimport { IssuerAndSerialNumber } from \"./issuer_and_serial_number.js\";\nlet RecipientIdentifier = class RecipientIdentifier {\n    subjectKeyIdentifier;\n    issuerAndSerialNumber;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: SubjectKeyIdentifier,\n        context: 0,\n        implicit: true,\n    })\n], RecipientIdentifier.prototype, \"subjectKeyIdentifier\", void 0);\n__decorate([\n    AsnProp({ type: IssuerAndSerialNumber })\n], RecipientIdentifier.prototype, \"issuerAndSerialNumber\", void 0);\nRecipientIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], RecipientIdentifier);\nexport { RecipientIdentifier };\nexport class KeyTransRecipientInfo {\n    version = CMSVersion.v0;\n    rid = new RecipientIdentifier();\n    keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();\n    encryptedKey = new OctetString();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], KeyTransRecipientInfo.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: RecipientIdentifier })\n], KeyTransRecipientInfo.prototype, \"rid\", void 0);\n__decorate([\n    AsnProp({ type: KeyEncryptionAlgorithmIdentifier })\n], KeyTransRecipientInfo.prototype, \"keyEncryptionAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], KeyTransRecipientInfo.prototype, \"encryptedKey\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { OtherKeyAttribute } from \"./other_key_attribute.js\";\nimport { CMSVersion, KeyEncryptionAlgorithmIdentifier } from \"./types.js\";\nexport class KEKIdentifier {\n    keyIdentifier = new OctetString();\n    date;\n    other;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: OctetString })\n], KEKIdentifier.prototype, \"keyIdentifier\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.GeneralizedTime,\n        optional: true,\n    })\n], KEKIdentifier.prototype, \"date\", void 0);\n__decorate([\n    AsnProp({\n        type: OtherKeyAttribute,\n        optional: true,\n    })\n], KEKIdentifier.prototype, \"other\", void 0);\nexport class KEKRecipientInfo {\n    version = CMSVersion.v4;\n    kekid = new KEKIdentifier();\n    keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();\n    encryptedKey = new OctetString();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], KEKRecipientInfo.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: KEKIdentifier })\n], KEKRecipientInfo.prototype, \"kekid\", void 0);\n__decorate([\n    AsnProp({ type: KeyEncryptionAlgorithmIdentifier })\n], KEKRecipientInfo.prototype, \"keyEncryptionAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], KEKRecipientInfo.prototype, \"encryptedKey\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { CMSVersion, KeyDerivationAlgorithmIdentifier, KeyEncryptionAlgorithmIdentifier } from \"./types.js\";\nexport class PasswordRecipientInfo {\n    version = CMSVersion.v0;\n    keyDerivationAlgorithm;\n    keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();\n    encryptedKey = new OctetString();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], PasswordRecipientInfo.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({\n        type: KeyDerivationAlgorithmIdentifier,\n        context: 0,\n        optional: true,\n    })\n], PasswordRecipientInfo.prototype, \"keyDerivationAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: KeyEncryptionAlgorithmIdentifier })\n], PasswordRecipientInfo.prototype, \"keyEncryptionAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], PasswordRecipientInfo.prototype, \"encryptedKey\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { KeyAgreeRecipientInfo } from \"./key_agree_recipient_info.js\";\nimport { KeyTransRecipientInfo } from \"./key_trans_recipient_info.js\";\nimport { KEKRecipientInfo } from \"./kek_recipient_info.js\";\nimport { PasswordRecipientInfo } from \"./password_recipient_info.js\";\nexport class OtherRecipientInfo {\n    oriType = \"\";\n    oriValue = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], OtherRecipientInfo.prototype, \"oriType\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Any })\n], OtherRecipientInfo.prototype, \"oriValue\", void 0);\nlet RecipientInfo = class RecipientInfo {\n    ktri;\n    kari;\n    kekri;\n    pwri;\n    ori;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: KeyTransRecipientInfo,\n        optional: true,\n    })\n], RecipientInfo.prototype, \"ktri\", void 0);\n__decorate([\n    AsnProp({\n        type: KeyAgreeRecipientInfo,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], RecipientInfo.prototype, \"kari\", void 0);\n__decorate([\n    AsnProp({\n        type: KEKRecipientInfo,\n        context: 2,\n        implicit: true,\n        optional: true,\n    })\n], RecipientInfo.prototype, \"kekri\", void 0);\n__decorate([\n    AsnProp({\n        type: PasswordRecipientInfo,\n        context: 3,\n        implicit: true,\n        optional: true,\n    })\n], RecipientInfo.prototype, \"pwri\", void 0);\n__decorate([\n    AsnProp({\n        type: OtherRecipientInfo,\n        context: 4,\n        implicit: true,\n        optional: true,\n    })\n], RecipientInfo.prototype, \"ori\", void 0);\nRecipientInfo = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], RecipientInfo);\nexport { RecipientInfo };\n","var RecipientInfos_1;\nimport { __decorate } from \"tslib\";\nimport { AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { RecipientInfo } from \"./recipient_info.js\";\nlet RecipientInfos = RecipientInfos_1 = class RecipientInfos extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, RecipientInfos_1.prototype);\n    }\n};\nRecipientInfos = RecipientInfos_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: RecipientInfo,\n    })\n], RecipientInfos);\nexport { RecipientInfos };\n","var RevocationInfoChoices_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, AsnArray } from \"@peculiar/asn1-schema\";\nimport { id_pkix } from \"@peculiar/asn1-x509\";\nexport const id_ri = `${id_pkix}.16`;\nexport const id_ri_ocsp_response = `${id_ri}.2`;\nexport const id_ri_scvp = `${id_ri}.4`;\nexport class OtherRevocationInfoFormat {\n    otherRevInfoFormat = \"\";\n    otherRevInfo = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], OtherRevocationInfoFormat.prototype, \"otherRevInfoFormat\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Any })\n], OtherRevocationInfoFormat.prototype, \"otherRevInfo\", void 0);\nlet RevocationInfoChoice = class RevocationInfoChoice {\n    other = new OtherRevocationInfoFormat();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({\n        type: OtherRevocationInfoFormat,\n        context: 1,\n        implicit: true,\n    })\n], RevocationInfoChoice.prototype, \"other\", void 0);\nRevocationInfoChoice = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], RevocationInfoChoice);\nexport { RevocationInfoChoice };\nlet RevocationInfoChoices = RevocationInfoChoices_1 = class RevocationInfoChoices extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, RevocationInfoChoices_1.prototype);\n    }\n};\nRevocationInfoChoices = RevocationInfoChoices_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: RevocationInfoChoice,\n    })\n], RevocationInfoChoices);\nexport { RevocationInfoChoices };\n","import { __decorate } from \"tslib\";\nimport { AsnProp } from \"@peculiar/asn1-schema\";\nimport { CertificateSet } from \"./certificate_choices.js\";\nimport { RevocationInfoChoices } from \"./revocation_info_choice.js\";\nexport class OriginatorInfo {\n    certs;\n    crls;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: CertificateSet,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], OriginatorInfo.prototype, \"certs\", void 0);\n__decorate([\n    AsnProp({\n        type: RevocationInfoChoices,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], OriginatorInfo.prototype, \"crls\", void 0);\n","var UnprotectedAttributes_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { CMSVersion } from \"./types.js\";\nimport { Attribute } from \"./attribute.js\";\nimport { RecipientInfos } from \"./recipient_infos.js\";\nimport { OriginatorInfo } from \"./originator_info.js\";\nimport { EncryptedContentInfo } from \"./encrypted_content_info.js\";\nlet UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype);\n    }\n};\nUnprotectedAttributes = UnprotectedAttributes_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: Attribute,\n    })\n], UnprotectedAttributes);\nexport { UnprotectedAttributes };\nexport class EnvelopedData {\n    version = CMSVersion.v0;\n    originatorInfo;\n    recipientInfos = new RecipientInfos();\n    encryptedContentInfo = new EncryptedContentInfo();\n    unprotectedAttrs;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], EnvelopedData.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({\n        type: OriginatorInfo,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], EnvelopedData.prototype, \"originatorInfo\", void 0);\n__decorate([\n    AsnProp({ type: RecipientInfos })\n], EnvelopedData.prototype, \"recipientInfos\", void 0);\n__decorate([\n    AsnProp({ type: EncryptedContentInfo })\n], EnvelopedData.prototype, \"encryptedContentInfo\", void 0);\n__decorate([\n    AsnProp({\n        type: UnprotectedAttributes,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], EnvelopedData.prototype, \"unprotectedAttrs\", void 0);\n","export const id_ct_contentInfo = \"1.2.840.113549.1.9.16.1.6\";\nexport const id_data = \"1.2.840.113549.1.7.1\";\nexport const id_signedData = \"1.2.840.113549.1.7.2\";\nexport const id_envelopedData = \"1.2.840.113549.1.7.3\";\nexport const id_digestedData = \"1.2.840.113549.1.7.5\";\nexport const id_encryptedData = \"1.2.840.113549.1.7.6\";\nexport const id_authData = \"1.2.840.113549.1.9.16.1.2\";\n","var DigestAlgorithmIdentifiers_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { CertificateSet } from \"./certificate_choices.js\";\nimport { CMSVersion, DigestAlgorithmIdentifier } from \"./types.js\";\nimport { EncapsulatedContentInfo } from \"./encapsulated_content_info.js\";\nimport { RevocationInfoChoices } from \"./revocation_info_choice.js\";\nimport { SignerInfos } from \"./signer_info.js\";\nlet DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = class DigestAlgorithmIdentifiers extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, DigestAlgorithmIdentifiers_1.prototype);\n    }\n};\nDigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: DigestAlgorithmIdentifier,\n    })\n], DigestAlgorithmIdentifiers);\nexport { DigestAlgorithmIdentifiers };\nexport class SignedData {\n    version = CMSVersion.v0;\n    digestAlgorithms = new DigestAlgorithmIdentifiers();\n    encapContentInfo = new EncapsulatedContentInfo();\n    certificates;\n    crls;\n    signerInfos = new SignerInfos();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], SignedData.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: DigestAlgorithmIdentifiers })\n], SignedData.prototype, \"digestAlgorithms\", void 0);\n__decorate([\n    AsnProp({ type: EncapsulatedContentInfo })\n], SignedData.prototype, \"encapContentInfo\", void 0);\n__decorate([\n    AsnProp({\n        type: CertificateSet,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], SignedData.prototype, \"certificates\", void 0);\n__decorate([\n    AsnProp({\n        type: RevocationInfoChoices,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], SignedData.prototype, \"crls\", void 0);\n__decorate([\n    AsnProp({ type: SignerInfos })\n], SignedData.prototype, \"signerInfos\", void 0);\n","export const id_ecPublicKey = \"1.2.840.10045.2.1\";\nexport const id_ecDH = \"1.3.132.1.12\";\nexport const id_ecMQV = \"1.3.132.1.13\";\nexport const id_ecdsaWithSHA1 = \"1.2.840.10045.4.1\";\nexport const id_ecdsaWithSHA224 = \"1.2.840.10045.4.3.1\";\nexport const id_ecdsaWithSHA256 = \"1.2.840.10045.4.3.2\";\nexport const id_ecdsaWithSHA384 = \"1.2.840.10045.4.3.3\";\nexport const id_ecdsaWithSHA512 = \"1.2.840.10045.4.3.4\";\nexport const id_secp192r1 = \"1.2.840.10045.3.1.1\";\nexport const id_sect163k1 = \"1.3.132.0.1\";\nexport const id_sect163r2 = \"1.3.132.0.15\";\nexport const id_secp224r1 = \"1.3.132.0.33\";\nexport const id_sect233k1 = \"1.3.132.0.26\";\nexport const id_sect233r1 = \"1.3.132.0.27\";\nexport const id_secp256r1 = \"1.2.840.10045.3.1.7\";\nexport const id_sect283k1 = \"1.3.132.0.16\";\nexport const id_sect283r1 = \"1.3.132.0.17\";\nexport const id_secp384r1 = \"1.3.132.0.34\";\nexport const id_sect409k1 = \"1.3.132.0.36\";\nexport const id_sect409r1 = \"1.3.132.0.37\";\nexport const id_secp521r1 = \"1.3.132.0.35\";\nexport const id_sect571k1 = \"1.3.132.0.38\";\nexport const id_sect571r1 = \"1.3.132.0.39\";\n","import { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nimport * as oid from \"./object_identifiers.js\";\nfunction create(algorithm) {\n    return new AlgorithmIdentifier({ algorithm });\n}\nexport const ecdsaWithSHA1 = create(oid.id_ecdsaWithSHA1);\nexport const ecdsaWithSHA224 = create(oid.id_ecdsaWithSHA224);\nexport const ecdsaWithSHA256 = create(oid.id_ecdsaWithSHA256);\nexport const ecdsaWithSHA384 = create(oid.id_ecdsaWithSHA384);\nexport const ecdsaWithSHA512 = create(oid.id_ecdsaWithSHA512);\n","import { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes, AsnProp, AsnPropTypes, OctetString, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nlet FieldID = class FieldID {\n    fieldType;\n    parameters;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], FieldID.prototype, \"fieldType\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Any })\n], FieldID.prototype, \"parameters\", void 0);\nFieldID = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], FieldID);\nexport { FieldID };\nexport class ECPoint extends OctetString {\n}\nexport class FieldElement extends OctetString {\n}\nlet Curve = class Curve {\n    a;\n    b;\n    seed;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.OctetString })\n], Curve.prototype, \"a\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.OctetString })\n], Curve.prototype, \"b\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.BitString,\n        optional: true,\n    })\n], Curve.prototype, \"seed\", void 0);\nCurve = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], Curve);\nexport { Curve };\nexport var ECPVer;\n(function (ECPVer) {\n    ECPVer[ECPVer[\"ecpVer1\"] = 1] = \"ecpVer1\";\n})(ECPVer || (ECPVer = {}));\nlet SpecifiedECDomain = class SpecifiedECDomain {\n    version = ECPVer.ecpVer1;\n    fieldID;\n    curve;\n    base;\n    order;\n    cofactor;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], SpecifiedECDomain.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: FieldID })\n], SpecifiedECDomain.prototype, \"fieldID\", void 0);\n__decorate([\n    AsnProp({ type: Curve })\n], SpecifiedECDomain.prototype, \"curve\", void 0);\n__decorate([\n    AsnProp({ type: ECPoint })\n], SpecifiedECDomain.prototype, \"base\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], SpecifiedECDomain.prototype, \"order\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], SpecifiedECDomain.prototype, \"cofactor\", void 0);\nSpecifiedECDomain = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], SpecifiedECDomain);\nexport { SpecifiedECDomain };\n","import { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes, AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { SpecifiedECDomain } from \"./rfc3279.js\";\nlet ECParameters = class ECParameters {\n    namedCurve;\n    implicitCurve;\n    specifiedCurve;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], ECParameters.prototype, \"namedCurve\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Null })\n], ECParameters.prototype, \"implicitCurve\", void 0);\n__decorate([\n    AsnProp({ type: SpecifiedECDomain })\n], ECParameters.prototype, \"specifiedCurve\", void 0);\nECParameters = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], ECParameters);\nexport { ECParameters };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { ECParameters } from \"./ec_parameters.js\";\nexport class ECPrivateKey {\n    version = 1;\n    privateKey = new OctetString();\n    parameters;\n    publicKey;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], ECPrivateKey.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], ECPrivateKey.prototype, \"privateKey\", void 0);\n__decorate([\n    AsnProp({\n        type: ECParameters,\n        context: 0,\n        optional: true,\n    })\n], ECPrivateKey.prototype, \"parameters\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.BitString,\n        context: 1,\n        optional: true,\n    })\n], ECPrivateKey.prototype, \"publicKey\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nexport class ECDSASigValue {\n    r = new ArrayBuffer(0);\n    s = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], ECDSASigValue.prototype, \"r\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], ECDSASigValue.prototype, \"s\", void 0);\n","export const id_pkcs_1 = \"1.2.840.113549.1.1\";\nexport const id_rsaEncryption = `${id_pkcs_1}.1`;\nexport const id_RSAES_OAEP = `${id_pkcs_1}.7`;\nexport const id_pSpecified = `${id_pkcs_1}.9`;\nexport const id_RSASSA_PSS = `${id_pkcs_1}.10`;\nexport const id_md2WithRSAEncryption = `${id_pkcs_1}.2`;\nexport const id_md5WithRSAEncryption = `${id_pkcs_1}.4`;\nexport const id_sha1WithRSAEncryption = `${id_pkcs_1}.5`;\nexport const id_sha224WithRSAEncryption = `${id_pkcs_1}.14`;\nexport const id_ssha224WithRSAEncryption = id_sha224WithRSAEncryption;\nexport const id_sha256WithRSAEncryption = `${id_pkcs_1}.11`;\nexport const id_sha384WithRSAEncryption = `${id_pkcs_1}.12`;\nexport const id_sha512WithRSAEncryption = `${id_pkcs_1}.13`;\nexport const id_sha512_224WithRSAEncryption = `${id_pkcs_1}.15`;\nexport const id_sha512_256WithRSAEncryption = `${id_pkcs_1}.16`;\nexport const id_sha1 = \"1.3.14.3.2.26\";\nexport const id_sha224 = \"2.16.840.1.101.3.4.2.4\";\nexport const id_sha256 = \"2.16.840.1.101.3.4.2.1\";\nexport const id_sha384 = \"2.16.840.1.101.3.4.2.2\";\nexport const id_sha512 = \"2.16.840.1.101.3.4.2.3\";\nexport const id_sha512_224 = \"2.16.840.1.101.3.4.2.5\";\nexport const id_sha512_256 = \"2.16.840.1.101.3.4.2.6\";\nexport const id_md2 = \"1.2.840.113549.2.2\";\nexport const id_md5 = \"1.2.840.113549.2.5\";\nexport const id_mgf1 = `${id_pkcs_1}.8`;\n","import { AsnConvert, AsnOctetStringConverter } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nimport * as oid from \"./object_identifiers.js\";\nfunction create(algorithm) {\n    return new AlgorithmIdentifier({\n        algorithm,\n        parameters: null,\n    });\n}\nexport const md2 = create(oid.id_md2);\nexport const md4 = create(oid.id_md5);\nexport const sha1 = create(oid.id_sha1);\nexport const sha224 = create(oid.id_sha224);\nexport const sha256 = create(oid.id_sha256);\nexport const sha384 = create(oid.id_sha384);\nexport const sha512 = create(oid.id_sha512);\nexport const sha512_224 = create(oid.id_sha512_224);\nexport const sha512_256 = create(oid.id_sha512_256);\nexport const mgf1SHA1 = new AlgorithmIdentifier({\n    algorithm: oid.id_mgf1,\n    parameters: AsnConvert.serialize(sha1),\n});\nexport const pSpecifiedEmpty = new AlgorithmIdentifier({\n    algorithm: oid.id_pSpecified,\n    parameters: AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90, 0xaf, 0xd8, 0x07, 0x09]).buffer)),\n});\nexport const rsaEncryption = create(oid.id_rsaEncryption);\nexport const md2WithRSAEncryption = create(oid.id_md2WithRSAEncryption);\nexport const md5WithRSAEncryption = create(oid.id_md5WithRSAEncryption);\nexport const sha1WithRSAEncryption = create(oid.id_sha1WithRSAEncryption);\nexport const sha224WithRSAEncryption = create(oid.id_sha512_224WithRSAEncryption);\nexport const sha256WithRSAEncryption = create(oid.id_sha512_256WithRSAEncryption);\nexport const sha384WithRSAEncryption = create(oid.id_sha384WithRSAEncryption);\nexport const sha512WithRSAEncryption = create(oid.id_sha512WithRSAEncryption);\nexport const sha512_224WithRSAEncryption = create(oid.id_sha512_224WithRSAEncryption);\nexport const sha512_256WithRSAEncryption = create(oid.id_sha512_256WithRSAEncryption);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnConvert } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nimport { id_mgf1, id_RSAES_OAEP } from \"../object_identifiers.js\";\nimport { sha1, mgf1SHA1, pSpecifiedEmpty } from \"../algorithms.js\";\nexport class RsaEsOaepParams {\n    hashAlgorithm = new AlgorithmIdentifier(sha1);\n    maskGenAlgorithm = new AlgorithmIdentifier({\n        algorithm: id_mgf1,\n        parameters: AsnConvert.serialize(sha1),\n    });\n    pSourceAlgorithm = new AlgorithmIdentifier(pSpecifiedEmpty);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AlgorithmIdentifier,\n        context: 0,\n        defaultValue: sha1,\n    })\n], RsaEsOaepParams.prototype, \"hashAlgorithm\", void 0);\n__decorate([\n    AsnProp({\n        type: AlgorithmIdentifier,\n        context: 1,\n        defaultValue: mgf1SHA1,\n    })\n], RsaEsOaepParams.prototype, \"maskGenAlgorithm\", void 0);\n__decorate([\n    AsnProp({\n        type: AlgorithmIdentifier,\n        context: 2,\n        defaultValue: pSpecifiedEmpty,\n    })\n], RsaEsOaepParams.prototype, \"pSourceAlgorithm\", void 0);\nexport const RSAES_OAEP = new AlgorithmIdentifier({\n    algorithm: id_RSAES_OAEP,\n    parameters: AsnConvert.serialize(new RsaEsOaepParams()),\n});\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnConvert, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nimport { id_mgf1, id_RSASSA_PSS } from \"../object_identifiers.js\";\nimport { sha1, mgf1SHA1 } from \"../algorithms.js\";\nexport class RsaSaPssParams {\n    hashAlgorithm = new AlgorithmIdentifier(sha1);\n    maskGenAlgorithm = new AlgorithmIdentifier({\n        algorithm: id_mgf1,\n        parameters: AsnConvert.serialize(sha1),\n    });\n    saltLength = 20;\n    trailerField = 1;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AlgorithmIdentifier,\n        context: 0,\n        defaultValue: sha1,\n    })\n], RsaSaPssParams.prototype, \"hashAlgorithm\", void 0);\n__decorate([\n    AsnProp({\n        type: AlgorithmIdentifier,\n        context: 1,\n        defaultValue: mgf1SHA1,\n    })\n], RsaSaPssParams.prototype, \"maskGenAlgorithm\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        context: 2,\n        defaultValue: 20,\n    })\n], RsaSaPssParams.prototype, \"saltLength\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        context: 3,\n        defaultValue: 1,\n    })\n], RsaSaPssParams.prototype, \"trailerField\", void 0);\nexport const RSASSA_PSS = new AlgorithmIdentifier({\n    algorithm: id_RSASSA_PSS,\n    parameters: AsnConvert.serialize(new RsaSaPssParams()),\n});\n","import { __decorate } from \"tslib\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nimport { AsnProp, OctetString } from \"@peculiar/asn1-schema\";\nexport class DigestInfo {\n    digestAlgorithm = new AlgorithmIdentifier();\n    digest = new OctetString();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], DigestInfo.prototype, \"digestAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], DigestInfo.prototype, \"digest\", void 0);\n","var OtherPrimeInfos_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter, AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nexport class OtherPrimeInfo {\n    prime = new ArrayBuffer(0);\n    exponent = new ArrayBuffer(0);\n    coefficient = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], OtherPrimeInfo.prototype, \"prime\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], OtherPrimeInfo.prototype, \"exponent\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], OtherPrimeInfo.prototype, \"coefficient\", void 0);\nlet OtherPrimeInfos = OtherPrimeInfos_1 = class OtherPrimeInfos extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, OtherPrimeInfos_1.prototype);\n    }\n};\nOtherPrimeInfos = OtherPrimeInfos_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: OtherPrimeInfo,\n    })\n], OtherPrimeInfos);\nexport { OtherPrimeInfos };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nimport { OtherPrimeInfos } from \"./other_prime_info.js\";\nexport class RSAPrivateKey {\n    version = 0;\n    modulus = new ArrayBuffer(0);\n    publicExponent = new ArrayBuffer(0);\n    privateExponent = new ArrayBuffer(0);\n    prime1 = new ArrayBuffer(0);\n    prime2 = new ArrayBuffer(0);\n    exponent1 = new ArrayBuffer(0);\n    exponent2 = new ArrayBuffer(0);\n    coefficient = new ArrayBuffer(0);\n    otherPrimeInfos;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], RSAPrivateKey.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPrivateKey.prototype, \"modulus\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPrivateKey.prototype, \"publicExponent\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPrivateKey.prototype, \"privateExponent\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPrivateKey.prototype, \"prime1\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPrivateKey.prototype, \"prime2\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPrivateKey.prototype, \"exponent1\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPrivateKey.prototype, \"exponent2\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPrivateKey.prototype, \"coefficient\", void 0);\n__decorate([\n    AsnProp({\n        type: OtherPrimeInfos,\n        optional: true,\n    })\n], RSAPrivateKey.prototype, \"otherPrimeInfos\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from \"@peculiar/asn1-schema\";\nexport class RSAPublicKey {\n    modulus = new ArrayBuffer(0);\n    publicExponent = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPublicKey.prototype, \"modulus\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        converter: AsnIntegerArrayBufferConverter,\n    })\n], RSAPublicKey.prototype, \"publicExponent\", void 0);\n","var Lifecycle;\n(function (Lifecycle) {\n    Lifecycle[Lifecycle[\"Transient\"] = 0] = \"Transient\";\n    Lifecycle[Lifecycle[\"Singleton\"] = 1] = \"Singleton\";\n    Lifecycle[Lifecycle[\"ResolutionScoped\"] = 2] = \"ResolutionScoped\";\n    Lifecycle[Lifecycle[\"ContainerScoped\"] = 3] = \"ContainerScoped\";\n})(Lifecycle || (Lifecycle = {}));\nexport default Lifecycle;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n    extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n    return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n    extendStatics(d, b);\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    }\r\n    return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n    return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (_) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n    for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n    if (m) return m.call(o);\r\n    if (o && typeof o.length === \"number\") return {\r\n        next: function () {\r\n            if (o && i >= o.length) o = void 0;\r\n            return { value: o && o[i++], done: !o };\r\n        }\r\n    };\r\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n    if (!m) return o;\r\n    var i = m.call(o), r, ar = [], e;\r\n    try {\r\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n    }\r\n    catch (error) { e = { error: error }; }\r\n    finally {\r\n        try {\r\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n        }\r\n        finally { if (e) throw e.error; }\r\n    }\r\n    return ar;\r\n}\r\n\r\nexport function __spread() {\r\n    for (var ar = [], i = 0; i < arguments.length; i++)\r\n        ar = ar.concat(__read(arguments[i]));\r\n    return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n            r[k] = a[j];\r\n    return r;\r\n};\r\n\r\nexport function __await(v) {\r\n    return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n    return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n    function fulfill(value) { resume(\"next\", value); }\r\n    function reject(value) { resume(\"throw\", value); }\r\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n    var i, p;\r\n    return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var m = o[Symbol.asyncIterator], i;\r\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n    return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n    if (mod && mod.__esModule) return mod;\r\n    var result = {};\r\n    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n    result.default = mod;\r\n    return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n    return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n    if (!privateMap.has(receiver)) {\r\n        throw new TypeError(\"attempted to get private field on non-instance\");\r\n    }\r\n    return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n    if (!privateMap.has(receiver)) {\r\n        throw new TypeError(\"attempted to set private field on non-instance\");\r\n    }\r\n    privateMap.set(receiver, value);\r\n    return value;\r\n}\r\n","export var INJECTION_TOKEN_METADATA_KEY = \"injectionTokens\";\nexport function getParamInfo(target) {\n    var params = Reflect.getMetadata(\"design:paramtypes\", target) || [];\n    var injectionTokens = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {};\n    Object.keys(injectionTokens).forEach(function (key) {\n        params[+key] = injectionTokens[key];\n    });\n    return params;\n}\nexport function defineInjectionTokenMetadata(data, transform) {\n    return function (target, _propertyKey, parameterIndex) {\n        var descriptors = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {};\n        descriptors[parameterIndex] = transform\n            ? {\n                token: data,\n                transform: transform.transformToken,\n                transformArgs: transform.args || []\n            }\n            : data;\n        Reflect.defineMetadata(INJECTION_TOKEN_METADATA_KEY, descriptors, target);\n    };\n}\n","export function isClassProvider(provider) {\n    return !!provider.useClass;\n}\n","export function isFactoryProvider(provider) {\n    return !!provider.useFactory;\n}\n","import { __read, __spread } from \"tslib\";\nvar DelayedConstructor = (function () {\n    function DelayedConstructor(wrap) {\n        this.wrap = wrap;\n        this.reflectMethods = [\n            \"get\",\n            \"getPrototypeOf\",\n            \"setPrototypeOf\",\n            \"getOwnPropertyDescriptor\",\n            \"defineProperty\",\n            \"has\",\n            \"set\",\n            \"deleteProperty\",\n            \"apply\",\n            \"construct\",\n            \"ownKeys\"\n        ];\n    }\n    DelayedConstructor.prototype.createProxy = function (createObject) {\n        var _this = this;\n        var target = {};\n        var init = false;\n        var value;\n        var delayedObject = function () {\n            if (!init) {\n                value = createObject(_this.wrap());\n                init = true;\n            }\n            return value;\n        };\n        return new Proxy(target, this.createHandler(delayedObject));\n    };\n    DelayedConstructor.prototype.createHandler = function (delayedObject) {\n        var handler = {};\n        var install = function (name) {\n            handler[name] = function () {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                args[0] = delayedObject();\n                var method = Reflect[name];\n                return method.apply(void 0, __spread(args));\n            };\n        };\n        this.reflectMethods.forEach(install);\n        return handler;\n    };\n    return DelayedConstructor;\n}());\nexport { DelayedConstructor };\nexport function delay(wrappedConstructor) {\n    if (typeof wrappedConstructor === \"undefined\") {\n        throw new Error(\"Attempt to `delay` undefined. Constructor must be wrapped in a callback\");\n    }\n    return new DelayedConstructor(wrappedConstructor);\n}\n","import { DelayedConstructor } from \"../lazy-helpers\";\nexport function isNormalToken(token) {\n    return typeof token === \"string\" || typeof token === \"symbol\";\n}\nexport function isTokenDescriptor(descriptor) {\n    return (typeof descriptor === \"object\" &&\n        \"token\" in descriptor &&\n        \"multiple\" in descriptor);\n}\nexport function isTransformDescriptor(descriptor) {\n    return (typeof descriptor === \"object\" &&\n        \"token\" in descriptor &&\n        \"transform\" in descriptor);\n}\nexport function isConstructorToken(token) {\n    return typeof token === \"function\" || token instanceof DelayedConstructor;\n}\n","export function isTokenProvider(provider) {\n    return !!provider.useToken;\n}\n","export function isValueProvider(provider) {\n    return provider.useValue != undefined;\n}\n","import { isClassProvider } from \"./class-provider\";\nimport { isValueProvider } from \"./value-provider\";\nimport { isTokenProvider } from \"./token-provider\";\nimport { isFactoryProvider } from \"./factory-provider\";\nexport function isProvider(provider) {\n    return (isClassProvider(provider) ||\n        isValueProvider(provider) ||\n        isTokenProvider(provider) ||\n        isFactoryProvider(provider));\n}\n","var RegistryBase = (function () {\n    function RegistryBase() {\n        this._registryMap = new Map();\n    }\n    RegistryBase.prototype.entries = function () {\n        return this._registryMap.entries();\n    };\n    RegistryBase.prototype.getAll = function (key) {\n        this.ensure(key);\n        return this._registryMap.get(key);\n    };\n    RegistryBase.prototype.get = function (key) {\n        this.ensure(key);\n        var value = this._registryMap.get(key);\n        return value[value.length - 1] || null;\n    };\n    RegistryBase.prototype.set = function (key, value) {\n        this.ensure(key);\n        this._registryMap.get(key).push(value);\n    };\n    RegistryBase.prototype.setAll = function (key, value) {\n        this._registryMap.set(key, value);\n    };\n    RegistryBase.prototype.has = function (key) {\n        this.ensure(key);\n        return this._registryMap.get(key).length > 0;\n    };\n    RegistryBase.prototype.clear = function () {\n        this._registryMap.clear();\n    };\n    RegistryBase.prototype.ensure = function (key) {\n        if (!this._registryMap.has(key)) {\n            this._registryMap.set(key, []);\n        }\n    };\n    return RegistryBase;\n}());\nexport default RegistryBase;\n","import { __extends } from \"tslib\";\nimport RegistryBase from \"./registry-base\";\nvar Registry = (function (_super) {\n    __extends(Registry, _super);\n    function Registry() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    return Registry;\n}(RegistryBase));\nexport default Registry;\n","var ResolutionContext = (function () {\n    function ResolutionContext() {\n        this.scopedResolutions = new Map();\n    }\n    return ResolutionContext;\n}());\nexport default ResolutionContext;\n","import { __read, __spread } from \"tslib\";\nfunction formatDependency(params, idx) {\n    if (params === null) {\n        return \"at position #\" + idx;\n    }\n    var argName = params.split(\",\")[idx].trim();\n    return \"\\\"\" + argName + \"\\\" at position #\" + idx;\n}\nfunction composeErrorMessage(msg, e, indent) {\n    if (indent === void 0) { indent = \"    \"; }\n    return __spread([msg], e.message.split(\"\\n\").map(function (l) { return indent + l; })).join(\"\\n\");\n}\nexport function formatErrorCtor(ctor, paramIdx, error) {\n    var _a = __read(ctor.toString().match(/constructor\\(([\\w, ]+)\\)/) || [], 2), _b = _a[1], params = _b === void 0 ? null : _b;\n    var dep = formatDependency(params, paramIdx);\n    return composeErrorMessage(\"Cannot inject the dependency \" + dep + \" of \\\"\" + ctor.name + \"\\\" constructor. Reason:\", error);\n}\n","export function isDisposable(value) {\n    if (typeof value.dispose !== \"function\")\n        return false;\n    var disposeFun = value.dispose;\n    if (disposeFun.length > 0) {\n        return false;\n    }\n    return true;\n}\n","import { __extends } from \"tslib\";\nimport RegistryBase from \"./registry-base\";\nvar PreResolutionInterceptors = (function (_super) {\n    __extends(PreResolutionInterceptors, _super);\n    function PreResolutionInterceptors() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    return PreResolutionInterceptors;\n}(RegistryBase));\nexport { PreResolutionInterceptors };\nvar PostResolutionInterceptors = (function (_super) {\n    __extends(PostResolutionInterceptors, _super);\n    function PostResolutionInterceptors() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    return PostResolutionInterceptors;\n}(RegistryBase));\nexport { PostResolutionInterceptors };\nvar Interceptors = (function () {\n    function Interceptors() {\n        this.preResolution = new PreResolutionInterceptors();\n        this.postResolution = new PostResolutionInterceptors();\n    }\n    return Interceptors;\n}());\nexport default Interceptors;\n","import { __awaiter, __generator, __read, __spread, __values } from \"tslib\";\nimport { isClassProvider, isFactoryProvider, isNormalToken, isTokenProvider, isValueProvider } from \"./providers\";\nimport { isProvider } from \"./providers/provider\";\nimport { isConstructorToken, isTokenDescriptor, isTransformDescriptor } from \"./providers/injection-token\";\nimport Registry from \"./registry\";\nimport Lifecycle from \"./types/lifecycle\";\nimport ResolutionContext from \"./resolution-context\";\nimport { formatErrorCtor } from \"./error-helpers\";\nimport { DelayedConstructor } from \"./lazy-helpers\";\nimport { isDisposable } from \"./types/disposable\";\nimport Interceptors from \"./interceptors\";\nexport var typeInfo = new Map();\nvar InternalDependencyContainer = (function () {\n    function InternalDependencyContainer(parent) {\n        this.parent = parent;\n        this._registry = new Registry();\n        this.interceptors = new Interceptors();\n        this.disposed = false;\n        this.disposables = new Set();\n    }\n    InternalDependencyContainer.prototype.register = function (token, providerOrConstructor, options) {\n        if (options === void 0) { options = { lifecycle: Lifecycle.Transient }; }\n        this.ensureNotDisposed();\n        var provider;\n        if (!isProvider(providerOrConstructor)) {\n            provider = { useClass: providerOrConstructor };\n        }\n        else {\n            provider = providerOrConstructor;\n        }\n        if (isTokenProvider(provider)) {\n            var path = [token];\n            var tokenProvider = provider;\n            while (tokenProvider != null) {\n                var currentToken = tokenProvider.useToken;\n                if (path.includes(currentToken)) {\n                    throw new Error(\"Token registration cycle detected! \" + __spread(path, [currentToken]).join(\" -> \"));\n                }\n                path.push(currentToken);\n                var registration = this._registry.get(currentToken);\n                if (registration && isTokenProvider(registration.provider)) {\n                    tokenProvider = registration.provider;\n                }\n                else {\n                    tokenProvider = null;\n                }\n            }\n        }\n        if (options.lifecycle === Lifecycle.Singleton ||\n            options.lifecycle == Lifecycle.ContainerScoped ||\n            options.lifecycle == Lifecycle.ResolutionScoped) {\n            if (isValueProvider(provider) || isFactoryProvider(provider)) {\n                throw new Error(\"Cannot use lifecycle \\\"\" + Lifecycle[options.lifecycle] + \"\\\" with ValueProviders or FactoryProviders\");\n            }\n        }\n        this._registry.set(token, { provider: provider, options: options });\n        return this;\n    };\n    InternalDependencyContainer.prototype.registerType = function (from, to) {\n        this.ensureNotDisposed();\n        if (isNormalToken(to)) {\n            return this.register(from, {\n                useToken: to\n            });\n        }\n        return this.register(from, {\n            useClass: to\n        });\n    };\n    InternalDependencyContainer.prototype.registerInstance = function (token, instance) {\n        this.ensureNotDisposed();\n        return this.register(token, {\n            useValue: instance\n        });\n    };\n    InternalDependencyContainer.prototype.registerSingleton = function (from, to) {\n        this.ensureNotDisposed();\n        if (isNormalToken(from)) {\n            if (isNormalToken(to)) {\n                return this.register(from, {\n                    useToken: to\n                }, { lifecycle: Lifecycle.Singleton });\n            }\n            else if (to) {\n                return this.register(from, {\n                    useClass: to\n                }, { lifecycle: Lifecycle.Singleton });\n            }\n            throw new Error('Cannot register a type name as a singleton without a \"to\" token');\n        }\n        var useClass = from;\n        if (to && !isNormalToken(to)) {\n            useClass = to;\n        }\n        return this.register(from, {\n            useClass: useClass\n        }, { lifecycle: Lifecycle.Singleton });\n    };\n    InternalDependencyContainer.prototype.resolve = function (token, context, isOptional) {\n        if (context === void 0) { context = new ResolutionContext(); }\n        if (isOptional === void 0) { isOptional = false; }\n        this.ensureNotDisposed();\n        var registration = this.getRegistration(token);\n        if (!registration && isNormalToken(token)) {\n            if (isOptional) {\n                return undefined;\n            }\n            throw new Error(\"Attempted to resolve unregistered dependency token: \\\"\" + token.toString() + \"\\\"\");\n        }\n        this.executePreResolutionInterceptor(token, \"Single\");\n        if (registration) {\n            var result = this.resolveRegistration(registration, context);\n            this.executePostResolutionInterceptor(token, result, \"Single\");\n            return result;\n        }\n        if (isConstructorToken(token)) {\n            var result = this.construct(token, context);\n            this.executePostResolutionInterceptor(token, result, \"Single\");\n            return result;\n        }\n        throw new Error(\"Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.\");\n    };\n    InternalDependencyContainer.prototype.executePreResolutionInterceptor = function (token, resolutionType) {\n        var e_1, _a;\n        if (this.interceptors.preResolution.has(token)) {\n            var remainingInterceptors = [];\n            try {\n                for (var _b = __values(this.interceptors.preResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) {\n                    var interceptor = _c.value;\n                    if (interceptor.options.frequency != \"Once\") {\n                        remainingInterceptors.push(interceptor);\n                    }\n                    interceptor.callback(token, resolutionType);\n                }\n            }\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\n            finally {\n                try {\n                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n                }\n                finally { if (e_1) throw e_1.error; }\n            }\n            this.interceptors.preResolution.setAll(token, remainingInterceptors);\n        }\n    };\n    InternalDependencyContainer.prototype.executePostResolutionInterceptor = function (token, result, resolutionType) {\n        var e_2, _a;\n        if (this.interceptors.postResolution.has(token)) {\n            var remainingInterceptors = [];\n            try {\n                for (var _b = __values(this.interceptors.postResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) {\n                    var interceptor = _c.value;\n                    if (interceptor.options.frequency != \"Once\") {\n                        remainingInterceptors.push(interceptor);\n                    }\n                    interceptor.callback(token, result, resolutionType);\n                }\n            }\n            catch (e_2_1) { e_2 = { error: e_2_1 }; }\n            finally {\n                try {\n                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n                }\n                finally { if (e_2) throw e_2.error; }\n            }\n            this.interceptors.postResolution.setAll(token, remainingInterceptors);\n        }\n    };\n    InternalDependencyContainer.prototype.resolveRegistration = function (registration, context) {\n        this.ensureNotDisposed();\n        if (registration.options.lifecycle === Lifecycle.ResolutionScoped &&\n            context.scopedResolutions.has(registration)) {\n            return context.scopedResolutions.get(registration);\n        }\n        var isSingleton = registration.options.lifecycle === Lifecycle.Singleton;\n        var isContainerScoped = registration.options.lifecycle === Lifecycle.ContainerScoped;\n        var returnInstance = isSingleton || isContainerScoped;\n        var resolved;\n        if (isValueProvider(registration.provider)) {\n            resolved = registration.provider.useValue;\n        }\n        else if (isTokenProvider(registration.provider)) {\n            resolved = returnInstance\n                ? registration.instance ||\n                    (registration.instance = this.resolve(registration.provider.useToken, context))\n                : this.resolve(registration.provider.useToken, context);\n        }\n        else if (isClassProvider(registration.provider)) {\n            resolved = returnInstance\n                ? registration.instance ||\n                    (registration.instance = this.construct(registration.provider.useClass, context))\n                : this.construct(registration.provider.useClass, context);\n        }\n        else if (isFactoryProvider(registration.provider)) {\n            resolved = registration.provider.useFactory(this);\n        }\n        else {\n            resolved = this.construct(registration.provider, context);\n        }\n        if (registration.options.lifecycle === Lifecycle.ResolutionScoped) {\n            context.scopedResolutions.set(registration, resolved);\n        }\n        return resolved;\n    };\n    InternalDependencyContainer.prototype.resolveAll = function (token, context, isOptional) {\n        var _this = this;\n        if (context === void 0) { context = new ResolutionContext(); }\n        if (isOptional === void 0) { isOptional = false; }\n        this.ensureNotDisposed();\n        var registrations = this.getAllRegistrations(token);\n        if (!registrations && isNormalToken(token)) {\n            if (isOptional) {\n                return [];\n            }\n            throw new Error(\"Attempted to resolve unregistered dependency token: \\\"\" + token.toString() + \"\\\"\");\n        }\n        this.executePreResolutionInterceptor(token, \"All\");\n        if (registrations) {\n            var result_1 = registrations.map(function (item) {\n                return _this.resolveRegistration(item, context);\n            });\n            this.executePostResolutionInterceptor(token, result_1, \"All\");\n            return result_1;\n        }\n        var result = [this.construct(token, context)];\n        this.executePostResolutionInterceptor(token, result, \"All\");\n        return result;\n    };\n    InternalDependencyContainer.prototype.isRegistered = function (token, recursive) {\n        if (recursive === void 0) { recursive = false; }\n        this.ensureNotDisposed();\n        return (this._registry.has(token) ||\n            (recursive &&\n                (this.parent || false) &&\n                this.parent.isRegistered(token, true)));\n    };\n    InternalDependencyContainer.prototype.reset = function () {\n        this.ensureNotDisposed();\n        this._registry.clear();\n        this.interceptors.preResolution.clear();\n        this.interceptors.postResolution.clear();\n    };\n    InternalDependencyContainer.prototype.clearInstances = function () {\n        var e_3, _a;\n        this.ensureNotDisposed();\n        try {\n            for (var _b = __values(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\n                var _d = __read(_c.value, 2), token = _d[0], registrations = _d[1];\n                this._registry.setAll(token, registrations\n                    .filter(function (registration) { return !isValueProvider(registration.provider); })\n                    .map(function (registration) {\n                    registration.instance = undefined;\n                    return registration;\n                }));\n            }\n        }\n        catch (e_3_1) { e_3 = { error: e_3_1 }; }\n        finally {\n            try {\n                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n            }\n            finally { if (e_3) throw e_3.error; }\n        }\n    };\n    InternalDependencyContainer.prototype.createChildContainer = function () {\n        var e_4, _a;\n        this.ensureNotDisposed();\n        var childContainer = new InternalDependencyContainer(this);\n        try {\n            for (var _b = __values(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\n                var _d = __read(_c.value, 2), token = _d[0], registrations = _d[1];\n                if (registrations.some(function (_a) {\n                    var options = _a.options;\n                    return options.lifecycle === Lifecycle.ContainerScoped;\n                })) {\n                    childContainer._registry.setAll(token, registrations.map(function (registration) {\n                        if (registration.options.lifecycle === Lifecycle.ContainerScoped) {\n                            return {\n                                provider: registration.provider,\n                                options: registration.options\n                            };\n                        }\n                        return registration;\n                    }));\n                }\n            }\n        }\n        catch (e_4_1) { e_4 = { error: e_4_1 }; }\n        finally {\n            try {\n                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n            }\n            finally { if (e_4) throw e_4.error; }\n        }\n        return childContainer;\n    };\n    InternalDependencyContainer.prototype.beforeResolution = function (token, callback, options) {\n        if (options === void 0) { options = { frequency: \"Always\" }; }\n        this.interceptors.preResolution.set(token, {\n            callback: callback,\n            options: options\n        });\n    };\n    InternalDependencyContainer.prototype.afterResolution = function (token, callback, options) {\n        if (options === void 0) { options = { frequency: \"Always\" }; }\n        this.interceptors.postResolution.set(token, {\n            callback: callback,\n            options: options\n        });\n    };\n    InternalDependencyContainer.prototype.dispose = function () {\n        return __awaiter(this, void 0, void 0, function () {\n            var promises;\n            return __generator(this, function (_a) {\n                switch (_a.label) {\n                    case 0:\n                        this.disposed = true;\n                        promises = [];\n                        this.disposables.forEach(function (disposable) {\n                            var maybePromise = disposable.dispose();\n                            if (maybePromise) {\n                                promises.push(maybePromise);\n                            }\n                        });\n                        return [4, Promise.all(promises)];\n                    case 1:\n                        _a.sent();\n                        return [2];\n                }\n            });\n        });\n    };\n    InternalDependencyContainer.prototype.getRegistration = function (token) {\n        if (this.isRegistered(token)) {\n            return this._registry.get(token);\n        }\n        if (this.parent) {\n            return this.parent.getRegistration(token);\n        }\n        return null;\n    };\n    InternalDependencyContainer.prototype.getAllRegistrations = function (token) {\n        if (this.isRegistered(token)) {\n            return this._registry.getAll(token);\n        }\n        if (this.parent) {\n            return this.parent.getAllRegistrations(token);\n        }\n        return null;\n    };\n    InternalDependencyContainer.prototype.construct = function (ctor, context) {\n        var _this = this;\n        if (ctor instanceof DelayedConstructor) {\n            return ctor.createProxy(function (target) {\n                return _this.resolve(target, context);\n            });\n        }\n        var instance = (function () {\n            var paramInfo = typeInfo.get(ctor);\n            if (!paramInfo || paramInfo.length === 0) {\n                if (ctor.length === 0) {\n                    return new ctor();\n                }\n                else {\n                    throw new Error(\"TypeInfo not known for \\\"\" + ctor.name + \"\\\"\");\n                }\n            }\n            var params = paramInfo.map(_this.resolveParams(context, ctor));\n            return new (ctor.bind.apply(ctor, __spread([void 0], params)))();\n        })();\n        if (isDisposable(instance)) {\n            this.disposables.add(instance);\n        }\n        return instance;\n    };\n    InternalDependencyContainer.prototype.resolveParams = function (context, ctor) {\n        var _this = this;\n        return function (param, idx) {\n            var _a, _b, _c;\n            try {\n                if (isTokenDescriptor(param)) {\n                    if (isTransformDescriptor(param)) {\n                        return param.multiple\n                            ? (_a = _this.resolve(param.transform)).transform.apply(_a, __spread([_this.resolveAll(param.token, new ResolutionContext(), param.isOptional)], param.transformArgs)) : (_b = _this.resolve(param.transform)).transform.apply(_b, __spread([_this.resolve(param.token, context, param.isOptional)], param.transformArgs));\n                    }\n                    else {\n                        return param.multiple\n                            ? _this.resolveAll(param.token, new ResolutionContext(), param.isOptional)\n                            : _this.resolve(param.token, context, param.isOptional);\n                    }\n                }\n                else if (isTransformDescriptor(param)) {\n                    return (_c = _this.resolve(param.transform, context)).transform.apply(_c, __spread([_this.resolve(param.token, context)], param.transformArgs));\n                }\n                return _this.resolve(param, context);\n            }\n            catch (e) {\n                throw new Error(formatErrorCtor(ctor, idx, e));\n            }\n        };\n    };\n    InternalDependencyContainer.prototype.ensureNotDisposed = function () {\n        if (this.disposed) {\n            throw new Error(\"This container has been disposed, you cannot interact with a disposed container\");\n        }\n    };\n    return InternalDependencyContainer;\n}());\nexport var instance = new InternalDependencyContainer();\nexport default instance;\n","import { getParamInfo } from \"../reflection-helpers\";\nimport { typeInfo } from \"../dependency-container\";\nimport { instance as globalContainer } from \"../dependency-container\";\nfunction injectable(options) {\n    return function (target) {\n        typeInfo.set(target, getParamInfo(target));\n        if (options && options.token) {\n            if (!Array.isArray(options.token)) {\n                globalContainer.register(options.token, target);\n            }\n            else {\n                options.token.forEach(function (token) {\n                    globalContainer.register(token, target);\n                });\n            }\n        }\n    };\n}\nexport default injectable;\n","if (typeof Reflect === \"undefined\" || !Reflect.getMetadata) {\n    throw new Error(\"tsyringe requires a reflect polyfill. Please add 'import \\\"reflect-metadata\\\"' to the top of your entry point.\");\n}\nexport { Lifecycle } from \"./types\";\nexport * from \"./decorators\";\nexport * from \"./factories\";\nexport * from \"./providers\";\nexport { delay } from \"./lazy-helpers\";\nexport { instance as container } from \"./dependency-container\";\n","var PKCS12AttrSet_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nexport class PKCS12Attribute {\n    attrId = \"\";\n    attrValues = [];\n    constructor(params = {}) {\n        Object.assign(params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], PKCS12Attribute.prototype, \"attrId\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        repeated: \"set\",\n    })\n], PKCS12Attribute.prototype, \"attrValues\", void 0);\nlet PKCS12AttrSet = PKCS12AttrSet_1 = class PKCS12AttrSet extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, PKCS12AttrSet_1.prototype);\n    }\n};\nPKCS12AttrSet = PKCS12AttrSet_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: PKCS12Attribute,\n    })\n], PKCS12AttrSet);\nexport { PKCS12AttrSet };\n","var AuthenticatedSafe_1;\nimport { __decorate } from \"tslib\";\nimport { AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { ContentInfo } from \"@peculiar/asn1-cms\";\nlet AuthenticatedSafe = AuthenticatedSafe_1 = class AuthenticatedSafe extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, AuthenticatedSafe_1.prototype);\n    }\n};\nAuthenticatedSafe = AuthenticatedSafe_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: ContentInfo,\n    })\n], AuthenticatedSafe);\nexport { AuthenticatedSafe };\n","import { id_bagtypes } from \"../object_identifiers.js\";\nexport const id_keyBag = `${id_bagtypes}.1`;\nexport const id_pkcs8ShroudedKeyBag = `${id_bagtypes}.2`;\nexport const id_certBag = `${id_bagtypes}.3`;\nexport const id_CRLBag = `${id_bagtypes}.4`;\nexport const id_SecretBag = `${id_bagtypes}.5`;\nexport const id_SafeContents = `${id_bagtypes}.6`;\nexport const id_pkcs_9 = \"1.2.840.113549.1.9\";\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { id_pkcs_9 } from \"./types.js\";\nexport class CertBag {\n    certId = \"\";\n    certValue = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], CertBag.prototype, \"certId\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        context: 0,\n    })\n], CertBag.prototype, \"certValue\", void 0);\nexport const id_certTypes = `${id_pkcs_9}.22`;\nexport const id_x509Certificate = `${id_certTypes}.1`;\nexport const id_sdsiCertificate = `${id_certTypes}.2`;\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { id_pkcs_9 } from \"./types.js\";\nexport class CRLBag {\n    crlId = \"\";\n    crltValue = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], CRLBag.prototype, \"crlId\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        context: 0,\n    })\n], CRLBag.prototype, \"crltValue\", void 0);\nexport const id_crlTypes = `${id_pkcs_9}.23`;\nexport const id_x509CRL = `${id_crlTypes}.1`;\n","import { __decorate } from \"tslib\";\nimport { AsnProp, OctetString } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nexport class EncryptedData extends OctetString {\n}\nexport class EncryptedPrivateKeyInfo {\n    encryptionAlgorithm = new AlgorithmIdentifier();\n    encryptedData = new EncryptedData();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], EncryptedPrivateKeyInfo.prototype, \"encryptionAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: EncryptedData })\n], EncryptedPrivateKeyInfo.prototype, \"encryptedData\", void 0);\n","var Attributes_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier, Attribute } from \"@peculiar/asn1-x509\";\nexport var Version;\n(function (Version) {\n    Version[Version[\"v1\"] = 0] = \"v1\";\n})(Version || (Version = {}));\nexport class PrivateKey extends OctetString {\n}\nlet Attributes = Attributes_1 = class Attributes extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, Attributes_1.prototype);\n    }\n};\nAttributes = Attributes_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: Attribute,\n    })\n], Attributes);\nexport { Attributes };\nexport class PrivateKeyInfo {\n    version = Version.v1;\n    privateKeyAlgorithm = new AlgorithmIdentifier();\n    privateKey = new PrivateKey();\n    attributes;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], PrivateKeyInfo.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], PrivateKeyInfo.prototype, \"privateKeyAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: PrivateKey })\n], PrivateKeyInfo.prototype, \"privateKey\", void 0);\n__decorate([\n    AsnProp({\n        type: Attributes,\n        implicit: true,\n        context: 0,\n        optional: true,\n    })\n], PrivateKeyInfo.prototype, \"attributes\", void 0);\n","import { __decorate } from \"tslib\";\nimport { PrivateKeyInfo } from \"@peculiar/asn1-pkcs8\";\nimport { AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nlet KeyBag = class KeyBag extends PrivateKeyInfo {\n};\nKeyBag = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], KeyBag);\nexport { KeyBag };\n","import { __decorate } from \"tslib\";\nimport { EncryptedPrivateKeyInfo } from \"@peculiar/asn1-pkcs8\";\nimport { AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nlet PKCS8ShroudedKeyBag = class PKCS8ShroudedKeyBag extends EncryptedPrivateKeyInfo {\n};\nPKCS8ShroudedKeyBag = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], PKCS8ShroudedKeyBag);\nexport { PKCS8ShroudedKeyBag };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nexport class SecretBag {\n    secretTypeId = \"\";\n    secretValue = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], SecretBag.prototype, \"secretTypeId\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        context: 0,\n    })\n], SecretBag.prototype, \"secretValue\", void 0);\n","import { __decorate } from \"tslib\";\nimport { DigestInfo } from \"@peculiar/asn1-rsa\";\nimport { AsnProp, AsnPropTypes, OctetString } from \"@peculiar/asn1-schema\";\nexport class MacData {\n    mac = new DigestInfo();\n    macSalt = new OctetString();\n    iterations = 1;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: DigestInfo })\n], MacData.prototype, \"mac\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], MacData.prototype, \"macSalt\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Integer,\n        defaultValue: 1,\n    })\n], MacData.prototype, \"iterations\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { ContentInfo } from \"@peculiar/asn1-cms\";\nimport { MacData } from \"./mac_data.js\";\nexport class PFX {\n    version = 3;\n    authSafe = new ContentInfo();\n    macData = new MacData();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], PFX.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: ContentInfo })\n], PFX.prototype, \"authSafe\", void 0);\n__decorate([\n    AsnProp({\n        type: MacData,\n        optional: true,\n    })\n], PFX.prototype, \"macData\", void 0);\n","var SafeContents_1;\nimport { __decorate } from \"tslib\";\nimport { AsnArray, AsnType, AsnTypeTypes, AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { PKCS12Attribute } from \"./attribute.js\";\nexport class SafeBag {\n    bagId = \"\";\n    bagValue = new ArrayBuffer(0);\n    bagAttributes;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], SafeBag.prototype, \"bagId\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.Any,\n        context: 0,\n    })\n], SafeBag.prototype, \"bagValue\", void 0);\n__decorate([\n    AsnProp({\n        type: PKCS12Attribute,\n        repeated: \"set\",\n        optional: true,\n    })\n], SafeBag.prototype, \"bagAttributes\", void 0);\nlet SafeContents = SafeContents_1 = class SafeContents extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, SafeContents_1.prototype);\n    }\n};\nSafeContents = SafeContents_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: SafeBag,\n    })\n], SafeContents);\nexport { SafeContents };\n","var ExtensionRequest_1, ExtendedCertificateAttributes_1, SMIMECapabilities_1;\nimport { __decorate } from \"tslib\";\nimport { AsnType, AsnTypeTypes, AsnPropTypes, AsnProp, OctetString, AsnArray } from \"@peculiar/asn1-schema\";\nimport * as cms from \"@peculiar/asn1-cms\";\nimport * as pfx from \"@peculiar/asn1-pfx\";\nimport * as pkcs8 from \"@peculiar/asn1-pkcs8\";\nimport * as x509 from \"@peculiar/asn1-x509\";\nimport * as attr from \"@peculiar/asn1-x509-attr\";\nexport const id_pkcs9 = \"1.2.840.113549.1.9\";\nexport const id_pkcs9_mo = `${id_pkcs9}.0`;\nexport const id_pkcs9_oc = `${id_pkcs9}.24`;\nexport const id_pkcs9_at = `${id_pkcs9}.25`;\nexport const id_pkcs9_sx = `${id_pkcs9}.26`;\nexport const id_pkcs9_mr = `${id_pkcs9}.27`;\nexport const id_pkcs9_oc_pkcsEntity = `${id_pkcs9_oc}.1`;\nexport const id_pkcs9_oc_naturalPerson = `${id_pkcs9_oc}.2`;\nexport const id_pkcs9_at_emailAddress = `${id_pkcs9}.1`;\nexport const id_pkcs9_at_unstructuredName = `${id_pkcs9}.2`;\nexport const id_pkcs9_at_contentType = `${id_pkcs9}.3`;\nexport const id_pkcs9_at_messageDigest = `${id_pkcs9}.4`;\nexport const id_pkcs9_at_signingTime = `${id_pkcs9}.5`;\nexport const id_pkcs9_at_counterSignature = `${id_pkcs9}.6`;\nexport const id_pkcs9_at_challengePassword = `${id_pkcs9}.7`;\nexport const id_pkcs9_at_unstructuredAddress = `${id_pkcs9}.8`;\nexport const id_pkcs9_at_extendedCertificateAttributes = `${id_pkcs9}.9`;\nexport const id_pkcs9_at_signingDescription = `${id_pkcs9}.13`;\nexport const id_pkcs9_at_extensionRequest = `${id_pkcs9}.14`;\nexport const id_pkcs9_at_smimeCapabilities = `${id_pkcs9}.15`;\nexport const id_pkcs9_at_friendlyName = `${id_pkcs9}.20`;\nexport const id_pkcs9_at_localKeyId = `${id_pkcs9}.21`;\nexport const id_pkcs9_at_userPKCS12 = \"2.16.840.1.113730.3.1.216\";\nexport const id_pkcs9_at_pkcs15Token = `${id_pkcs9_at}.1`;\nexport const id_pkcs9_at_encryptedPrivateKeyInfo = `${id_pkcs9_at}.2`;\nexport const id_pkcs9_at_randomNonce = `${id_pkcs9_at}.3`;\nexport const id_pkcs9_at_sequenceNumber = `${id_pkcs9_at}.4`;\nexport const id_pkcs9_at_pkcs7PDU = `${id_pkcs9_at}.5`;\nexport const id_ietf_at = \"1.3.6.1.5.5.7.9\";\nexport const id_pkcs9_at_dateOfBirth = `${id_ietf_at}.1`;\nexport const id_pkcs9_at_placeOfBirth = `${id_ietf_at}.2`;\nexport const id_pkcs9_at_gender = `${id_ietf_at}.3`;\nexport const id_pkcs9_at_countryOfCitizenship = `${id_ietf_at}.4`;\nexport const id_pkcs9_at_countryOfResidence = `${id_ietf_at}.5`;\nexport const id_pkcs9_sx_pkcs9String = `${id_pkcs9_sx}.1`;\nexport const id_pkcs9_sx_signingTime = `${id_pkcs9_sx}.2`;\nexport const id_pkcs9_mr_caseIgnoreMatch = `${id_pkcs9_mr}.1`;\nexport const id_pkcs9_mr_signingTimeMatch = `${id_pkcs9_mr}.2`;\nexport const id_smime = `${id_pkcs9}.16`;\nexport const id_certTypes = `${id_pkcs9}.22`;\nexport const crlTypes = `${id_pkcs9}.23`;\nexport const id_at_pseudonym = `${attr.id_at}.65`;\nlet PKCS9String = class PKCS9String extends x509.DirectoryString {\n    ia5String;\n    constructor(params = {}) {\n        super(params);\n    }\n    toString() {\n        const o = {};\n        o.toString();\n        return this.ia5String || super.toString();\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.IA5String })\n], PKCS9String.prototype, \"ia5String\", void 0);\nPKCS9String = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], PKCS9String);\nexport { PKCS9String };\nlet Pkcs7PDU = class Pkcs7PDU extends cms.ContentInfo {\n};\nPkcs7PDU = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], Pkcs7PDU);\nexport { Pkcs7PDU };\nlet UserPKCS12 = class UserPKCS12 extends pfx.PFX {\n};\nUserPKCS12 = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], UserPKCS12);\nexport { UserPKCS12 };\nlet EncryptedPrivateKeyInfo = class EncryptedPrivateKeyInfo extends pkcs8.EncryptedPrivateKeyInfo {\n};\nEncryptedPrivateKeyInfo = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], EncryptedPrivateKeyInfo);\nexport { EncryptedPrivateKeyInfo };\nlet EmailAddress = class EmailAddress {\n    value;\n    constructor(value = \"\") {\n        this.value = value;\n    }\n    toString() {\n        return this.value;\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.IA5String })\n], EmailAddress.prototype, \"value\", void 0);\nEmailAddress = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], EmailAddress);\nexport { EmailAddress };\nlet UnstructuredName = class UnstructuredName extends PKCS9String {\n};\nUnstructuredName = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], UnstructuredName);\nexport { UnstructuredName };\nlet UnstructuredAddress = class UnstructuredAddress extends x509.DirectoryString {\n};\nUnstructuredAddress = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], UnstructuredAddress);\nexport { UnstructuredAddress };\nlet DateOfBirth = class DateOfBirth {\n    value;\n    constructor(value = new Date()) {\n        this.value = value;\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.GeneralizedTime })\n], DateOfBirth.prototype, \"value\", void 0);\nDateOfBirth = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], DateOfBirth);\nexport { DateOfBirth };\nlet PlaceOfBirth = class PlaceOfBirth extends x509.DirectoryString {\n};\nPlaceOfBirth = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], PlaceOfBirth);\nexport { PlaceOfBirth };\nlet Gender = class Gender {\n    value;\n    constructor(value = \"M\") {\n        this.value = value;\n    }\n    toString() {\n        return this.value;\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.PrintableString })\n], Gender.prototype, \"value\", void 0);\nGender = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], Gender);\nexport { Gender };\nlet CountryOfCitizenship = class CountryOfCitizenship {\n    value;\n    constructor(value = \"\") {\n        this.value = value;\n    }\n    toString() {\n        return this.value;\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.PrintableString })\n], CountryOfCitizenship.prototype, \"value\", void 0);\nCountryOfCitizenship = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], CountryOfCitizenship);\nexport { CountryOfCitizenship };\nlet CountryOfResidence = class CountryOfResidence extends CountryOfCitizenship {\n};\nCountryOfResidence = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], CountryOfResidence);\nexport { CountryOfResidence };\nlet Pseudonym = class Pseudonym extends x509.DirectoryString {\n};\nPseudonym = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], Pseudonym);\nexport { Pseudonym };\nlet ContentType = class ContentType {\n    value;\n    constructor(value = \"\") {\n        this.value = value;\n    }\n    toString() {\n        return this.value;\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.ObjectIdentifier })\n], ContentType.prototype, \"value\", void 0);\nContentType = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], ContentType);\nexport { ContentType };\nexport class MessageDigest extends OctetString {\n}\nlet SigningTime = class SigningTime extends x509.Time {\n};\nSigningTime = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], SigningTime);\nexport { SigningTime };\nexport class RandomNonce extends OctetString {\n}\nlet SequenceNumber = class SequenceNumber {\n    value;\n    constructor(value = 0) {\n        this.value = value;\n    }\n    toString() {\n        return this.value.toString();\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], SequenceNumber.prototype, \"value\", void 0);\nSequenceNumber = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], SequenceNumber);\nexport { SequenceNumber };\nlet CounterSignature = class CounterSignature extends cms.SignerInfo {\n};\nCounterSignature = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], CounterSignature);\nexport { CounterSignature };\nlet ChallengePassword = class ChallengePassword extends x509.DirectoryString {\n};\nChallengePassword = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], ChallengePassword);\nexport { ChallengePassword };\nlet ExtensionRequest = ExtensionRequest_1 = class ExtensionRequest extends x509.Extensions {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, ExtensionRequest_1.prototype);\n    }\n};\nExtensionRequest = ExtensionRequest_1 = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], ExtensionRequest);\nexport { ExtensionRequest };\nlet ExtendedCertificateAttributes = ExtendedCertificateAttributes_1 = class ExtendedCertificateAttributes extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, ExtendedCertificateAttributes_1.prototype);\n    }\n};\nExtendedCertificateAttributes = ExtendedCertificateAttributes_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: cms.Attribute,\n    })\n], ExtendedCertificateAttributes);\nexport { ExtendedCertificateAttributes };\nlet FriendlyName = class FriendlyName {\n    value;\n    constructor(value = \"\") {\n        this.value = value;\n    }\n    toString() {\n        return this.value;\n    }\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.BmpString })\n], FriendlyName.prototype, \"value\", void 0);\nFriendlyName = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], FriendlyName);\nexport { FriendlyName };\nexport class LocalKeyId extends OctetString {\n}\nexport class SigningDescription extends x509.DirectoryString {\n}\nlet SMIMECapability = class SMIMECapability extends x509.AlgorithmIdentifier {\n};\nSMIMECapability = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], SMIMECapability);\nexport { SMIMECapability };\nlet SMIMECapabilities = SMIMECapabilities_1 = class SMIMECapabilities extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, SMIMECapabilities_1.prototype);\n    }\n};\nSMIMECapabilities = SMIMECapabilities_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: SMIMECapability,\n    })\n], SMIMECapabilities);\nexport { SMIMECapabilities };\n","var CompositeParams_1, CompositeSignatureValue_1;\nimport { __decorate } from \"tslib\";\nimport { AsnArray, AsnPropTypes, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nexport const id_alg_composite = \"1.3.6.1.4.1.18227.2.1\";\nlet CompositeParams = CompositeParams_1 = class CompositeParams extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, CompositeParams_1.prototype);\n    }\n};\nCompositeParams = CompositeParams_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: AlgorithmIdentifier,\n    })\n], CompositeParams);\nexport { CompositeParams };\nlet CompositeSignatureValue = CompositeSignatureValue_1 = class CompositeSignatureValue extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, CompositeSignatureValue_1.prototype);\n    }\n};\nCompositeSignatureValue = CompositeSignatureValue_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: AsnPropTypes.BitString,\n    })\n], CompositeSignatureValue);\nexport { CompositeSignatureValue };\n","var AsymmetricKeyPackage_1;\nimport { __decorate } from \"tslib\";\nimport { Attributes } from \"@peculiar/asn1-pkcs8\";\nimport { AsnArray, AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, BitString, OctetString } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nexport const id_ct_KP_aKeyPackage = \"2.16.840.1.101.2.1.78.5\";\nexport var Version;\n(function (Version) {\n    Version[Version[\"v1\"] = 0] = \"v1\";\n    Version[Version[\"v2\"] = 1] = \"v2\";\n})(Version || (Version = {}));\nlet PrivateKeyAlgorithmIdentifier = class PrivateKeyAlgorithmIdentifier extends AlgorithmIdentifier {\n};\nPrivateKeyAlgorithmIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], PrivateKeyAlgorithmIdentifier);\nexport { PrivateKeyAlgorithmIdentifier };\nexport class PrivateKey extends OctetString {\n}\nexport class PublicKey extends BitString {\n}\nlet OneAsymmetricKey = class OneAsymmetricKey {\n    version = Version.v1;\n    privateKeyAlgorithm = new AlgorithmIdentifier();\n    privateKey = new ArrayBuffer(0);\n    attributes;\n    publicKey;\n};\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], OneAsymmetricKey.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], OneAsymmetricKey.prototype, \"privateKeyAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.OctetString })\n], OneAsymmetricKey.prototype, \"privateKey\", void 0);\n__decorate([\n    AsnProp({\n        type: Attributes,\n        context: 0,\n        implicit: true,\n        optional: true,\n    })\n], OneAsymmetricKey.prototype, \"attributes\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.BitString,\n        context: 1,\n        implicit: true,\n        optional: true,\n    })\n], OneAsymmetricKey.prototype, \"publicKey\", void 0);\nOneAsymmetricKey = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], OneAsymmetricKey);\nexport { OneAsymmetricKey };\nlet PrivateKeyInfo = class PrivateKeyInfo extends OneAsymmetricKey {\n};\nPrivateKeyInfo = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], PrivateKeyInfo);\nexport { PrivateKeyInfo };\nlet AsymmetricKeyPackage = AsymmetricKeyPackage_1 = class AsymmetricKeyPackage extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, AsymmetricKeyPackage_1.prototype);\n    }\n};\nAsymmetricKeyPackage = AsymmetricKeyPackage_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: OneAsymmetricKey,\n    })\n], AsymmetricKeyPackage);\nexport { AsymmetricKeyPackage };\nexport { EncryptedPrivateKeyInfo, EncryptedData } from \"@peculiar/asn1-pkcs8\";\n","var CompositePublicKey_1, CompositePrivateKey_1;\nimport { __decorate } from \"tslib\";\nimport { OneAsymmetricKey } from \"@peculiar/asn1-asym-key\";\nimport { AsnArray, AsnType, AsnTypeTypes, BitString, OctetString } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier, SubjectPublicKeyInfo } from \"@peculiar/asn1-x509\";\nexport const id_composite_key = \"2.16.840.1.114027.80.4.1\";\nexport const id_Dilithium3_ECDSA_P256 = \"2.16.840.1.114027.80.5.1\";\nexport const id_Dilithium3_RSA = \"2.16.840.1.114027.80.5.2\";\nlet CompositeAlgorithmIdentifier = class CompositeAlgorithmIdentifier extends AlgorithmIdentifier {\n};\nCompositeAlgorithmIdentifier = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], CompositeAlgorithmIdentifier);\nexport { CompositeAlgorithmIdentifier };\nlet CompositePublicKey = CompositePublicKey_1 = class CompositePublicKey extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, CompositePublicKey_1.prototype);\n    }\n};\nCompositePublicKey = CompositePublicKey_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: SubjectPublicKeyInfo,\n    })\n], CompositePublicKey);\nexport { CompositePublicKey };\nexport class CompositePublicKeyOs extends OctetString {\n}\nexport class CompositePublicKeyBs extends BitString {\n}\nlet CompositePrivateKey = CompositePrivateKey_1 = class CompositePrivateKey extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, CompositePrivateKey_1.prototype);\n    }\n};\nCompositePrivateKey = CompositePrivateKey_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: OneAsymmetricKey,\n    })\n], CompositePrivateKey);\nexport { CompositePrivateKey };\n","const id_sigAlgs = \"2.16.840.1.101.3.4.3\";\nexport const id_ml_dsa_44 = `${id_sigAlgs}.17`;\nexport const id_ml_dsa_65 = `${id_sigAlgs}.18`;\nexport const id_ml_dsa_87 = `${id_sigAlgs}.19`;\nexport const id_slh_dsa_sha2_128s = `${id_sigAlgs}.20`;\nexport const id_slh_dsa_sha2_128f = `${id_sigAlgs}.21`;\nexport const id_slh_dsa_sha2_192s = `${id_sigAlgs}.22`;\nexport const id_slh_dsa_sha2_192f = `${id_sigAlgs}.23`;\nexport const id_slh_dsa_sha2_256s = `${id_sigAlgs}.24`;\nexport const id_slh_dsa_sha2_256f = `${id_sigAlgs}.25`;\nexport const id_slh_dsa_shake_128s = `${id_sigAlgs}.26`;\nexport const id_slh_dsa_shake_128f = `${id_sigAlgs}.27`;\nexport const id_slh_dsa_shake_192s = `${id_sigAlgs}.28`;\nexport const id_slh_dsa_shake_192f = `${id_sigAlgs}.29`;\nexport const id_slh_dsa_shake_256s = `${id_sigAlgs}.30`;\nexport const id_slh_dsa_shake_256f = `${id_sigAlgs}.31`;\n","var Attributes_1;\nimport { __decorate } from \"tslib\";\nimport { AsnArray, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\nimport { Attribute } from \"@peculiar/asn1-x509\";\nlet Attributes = Attributes_1 = class Attributes extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, Attributes_1.prototype);\n    }\n};\nAttributes = Attributes_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: Attribute,\n    })\n], Attributes);\nexport { Attributes };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { Name, SubjectPublicKeyInfo } from \"@peculiar/asn1-x509\";\nimport { Attributes } from \"./attributes.js\";\nexport class CertificationRequestInfo {\n    version = 0;\n    subject = new Name();\n    subjectPKInfo = new SubjectPublicKeyInfo();\n    attributes = new Attributes();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], CertificationRequestInfo.prototype, \"version\", void 0);\n__decorate([\n    AsnProp({ type: Name })\n], CertificationRequestInfo.prototype, \"subject\", void 0);\n__decorate([\n    AsnProp({ type: SubjectPublicKeyInfo })\n], CertificationRequestInfo.prototype, \"subjectPKInfo\", void 0);\n__decorate([\n    AsnProp({\n        type: Attributes,\n        implicit: true,\n        context: 0,\n        optional: true,\n    })\n], CertificationRequestInfo.prototype, \"attributes\", void 0);\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nimport { AlgorithmIdentifier } from \"@peculiar/asn1-x509\";\nimport { CertificationRequestInfo } from \"./certification_request_info.js\";\nexport class CertificationRequest {\n    certificationRequestInfo = new CertificationRequestInfo();\n    certificationRequestInfoRaw;\n    signatureAlgorithm = new AlgorithmIdentifier();\n    signature = new ArrayBuffer(0);\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: CertificationRequestInfo,\n        raw: true,\n    })\n], CertificationRequest.prototype, \"certificationRequestInfo\", void 0);\n__decorate([\n    AsnProp({ type: AlgorithmIdentifier })\n], CertificationRequest.prototype, \"signatureAlgorithm\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.BitString })\n], CertificationRequest.prototype, \"signature\", void 0);\n","/*!\n * MIT License\n * \n * Copyright (c) Peculiar Ventures. All rights reserved.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n */\nimport { AsnConvert, OctetString, AsnUtf8StringConverter } from '@peculiar/asn1-schema';\nimport * as asn1X509 from '@peculiar/asn1-x509';\nimport { AlgorithmIdentifier, Extension as Extension$1, Name as Name$1, RelativeDistinguishedName, AttributeTypeAndValue, SubjectPublicKeyInfo, BasicConstraints, id_ce_basicConstraints, KeyUsage, id_ce_keyUsage, Attribute as Attribute$1, Version, Extensions, Certificate, id_ce_invalidityDate, InvalidityDate, id_ce_cRLReasons, CRLReason, RevokedCertificate, Time, CertificateList } from '@peculiar/asn1-x509';\nimport { BufferSourceConverter, isEqual, Convert, combine } from 'pvtsutils';\nimport { __decorate, __classPrivateFieldGet, __classPrivateFieldSet } from 'tslib';\nimport * as asn1Cms from '@peculiar/asn1-cms';\nimport * as asn1Ecc from '@peculiar/asn1-ecc';\nimport { id_ecPublicKey, ECDSASigValue } from '@peculiar/asn1-ecc';\nimport * as asn1Rsa from '@peculiar/asn1-rsa';\nimport { id_RSASSA_PSS, id_rsaEncryption, RSAPublicKey, id_sha512, id_sha384, id_sha256, id_sha1 } from '@peculiar/asn1-rsa';\nimport { container, injectable } from 'tsyringe';\nimport * as asnPkcs9 from '@peculiar/asn1-pkcs9';\nimport { id_pkcs9_at_extensionRequest } from '@peculiar/asn1-pkcs9';\nimport { id_ml_dsa_87, id_ml_dsa_65, id_ml_dsa_44, id_slh_dsa_shake_256f, id_slh_dsa_shake_256s, id_slh_dsa_shake_192f, id_slh_dsa_shake_192s, id_slh_dsa_shake_128f, id_slh_dsa_shake_128s, id_slh_dsa_sha2_256f, id_slh_dsa_sha2_256s, id_slh_dsa_sha2_192f, id_slh_dsa_sha2_192s, id_slh_dsa_sha2_128f, id_slh_dsa_sha2_128s } from '@peculiar/asn1-x509-post-quantum';\nimport { CertificationRequest, CertificationRequestInfo } from '@peculiar/asn1-csr';\n\nconst diAlgorithm = \"crypto.algorithm\";\nclass AlgorithmProvider {\n    getAlgorithms() {\n        return container.resolveAll(diAlgorithm);\n    }\n    toAsnAlgorithm(alg) {\n        const algCopy = { ...alg };\n        if (algCopy.hash && typeof algCopy.hash === \"string\") {\n            algCopy.hash = { name: algCopy.hash };\n        }\n        for (const algorithm of this.getAlgorithms()) {\n            const res = algorithm.toAsnAlgorithm(algCopy);\n            if (res) {\n                return res;\n            }\n        }\n        if (/^[0-9.]+$/.test(alg.name)) {\n            const res = new AlgorithmIdentifier({ algorithm: alg.name });\n            if (\"parameters\" in alg) {\n                const unknown = alg;\n                res.parameters = unknown.parameters;\n            }\n            return res;\n        }\n        throw new Error(\"Cannot convert WebCrypto algorithm to ASN.1 algorithm\");\n    }\n    toWebAlgorithm(alg) {\n        for (const algorithm of this.getAlgorithms()) {\n            const res = algorithm.toWebAlgorithm(alg);\n            if (res) {\n                return res;\n            }\n        }\n        const unknown = {\n            name: alg.algorithm,\n            parameters: alg.parameters,\n        };\n        return unknown;\n    }\n}\nconst diAlgorithmProvider = \"crypto.algorithmProvider\";\ncontainer.registerSingleton(diAlgorithmProvider, AlgorithmProvider);\n\nvar EcAlgorithm_1;\nconst idVersionOne = \"1.3.36.3.3.2.8.1.1\";\nconst idBrainpoolP160r1 = `${idVersionOne}.1`;\nconst idBrainpoolP160t1 = `${idVersionOne}.2`;\nconst idBrainpoolP192r1 = `${idVersionOne}.3`;\nconst idBrainpoolP192t1 = `${idVersionOne}.4`;\nconst idBrainpoolP224r1 = `${idVersionOne}.5`;\nconst idBrainpoolP224t1 = `${idVersionOne}.6`;\nconst idBrainpoolP256r1 = `${idVersionOne}.7`;\nconst idBrainpoolP256t1 = `${idVersionOne}.8`;\nconst idBrainpoolP320r1 = `${idVersionOne}.9`;\nconst idBrainpoolP320t1 = `${idVersionOne}.10`;\nconst idBrainpoolP384r1 = `${idVersionOne}.11`;\nconst idBrainpoolP384t1 = `${idVersionOne}.12`;\nconst idBrainpoolP512r1 = `${idVersionOne}.13`;\nconst idBrainpoolP512t1 = `${idVersionOne}.14`;\nconst brainpoolP160r1 = \"brainpoolP160r1\";\nconst brainpoolP160t1 = \"brainpoolP160t1\";\nconst brainpoolP192r1 = \"brainpoolP192r1\";\nconst brainpoolP192t1 = \"brainpoolP192t1\";\nconst brainpoolP224r1 = \"brainpoolP224r1\";\nconst brainpoolP224t1 = \"brainpoolP224t1\";\nconst brainpoolP256r1 = \"brainpoolP256r1\";\nconst brainpoolP256t1 = \"brainpoolP256t1\";\nconst brainpoolP320r1 = \"brainpoolP320r1\";\nconst brainpoolP320t1 = \"brainpoolP320t1\";\nconst brainpoolP384r1 = \"brainpoolP384r1\";\nconst brainpoolP384t1 = \"brainpoolP384t1\";\nconst brainpoolP512r1 = \"brainpoolP512r1\";\nconst brainpoolP512t1 = \"brainpoolP512t1\";\nconst ECDSA = \"ECDSA\";\nlet EcAlgorithm = EcAlgorithm_1 = class EcAlgorithm {\n    toAsnAlgorithm(alg) {\n        switch (alg.name.toLowerCase()) {\n            case ECDSA.toLowerCase():\n                if (\"hash\" in alg) {\n                    const hash = typeof alg.hash === \"string\" ? alg.hash : alg.hash.name;\n                    switch (hash.toLowerCase()) {\n                        case \"sha-1\":\n                            return asn1Ecc.ecdsaWithSHA1;\n                        case \"sha-256\":\n                            return asn1Ecc.ecdsaWithSHA256;\n                        case \"sha-384\":\n                            return asn1Ecc.ecdsaWithSHA384;\n                        case \"sha-512\":\n                            return asn1Ecc.ecdsaWithSHA512;\n                    }\n                }\n                else if (\"namedCurve\" in alg) {\n                    let parameters = \"\";\n                    switch (alg.namedCurve) {\n                        case \"P-256\":\n                            parameters = asn1Ecc.id_secp256r1;\n                            break;\n                        case \"K-256\":\n                            parameters = EcAlgorithm_1.SECP256K1;\n                            break;\n                        case \"P-384\":\n                            parameters = asn1Ecc.id_secp384r1;\n                            break;\n                        case \"P-521\":\n                            parameters = asn1Ecc.id_secp521r1;\n                            break;\n                        case brainpoolP160r1:\n                            parameters = idBrainpoolP160r1;\n                            break;\n                        case brainpoolP160t1:\n                            parameters = idBrainpoolP160t1;\n                            break;\n                        case brainpoolP192r1:\n                            parameters = idBrainpoolP192r1;\n                            break;\n                        case brainpoolP192t1:\n                            parameters = idBrainpoolP192t1;\n                            break;\n                        case brainpoolP224r1:\n                            parameters = idBrainpoolP224r1;\n                            break;\n                        case brainpoolP224t1:\n                            parameters = idBrainpoolP224t1;\n                            break;\n                        case brainpoolP256r1:\n                            parameters = idBrainpoolP256r1;\n                            break;\n                        case brainpoolP256t1:\n                            parameters = idBrainpoolP256t1;\n                            break;\n                        case brainpoolP320r1:\n                            parameters = idBrainpoolP320r1;\n                            break;\n                        case brainpoolP320t1:\n                            parameters = idBrainpoolP320t1;\n                            break;\n                        case brainpoolP384r1:\n                            parameters = idBrainpoolP384r1;\n                            break;\n                        case brainpoolP384t1:\n                            parameters = idBrainpoolP384t1;\n                            break;\n                        case brainpoolP512r1:\n                            parameters = idBrainpoolP512r1;\n                            break;\n                        case brainpoolP512t1:\n                            parameters = idBrainpoolP512t1;\n                            break;\n                    }\n                    if (parameters) {\n                        return new AlgorithmIdentifier({\n                            algorithm: asn1Ecc.id_ecPublicKey,\n                            parameters: AsnConvert.serialize(new asn1Ecc.ECParameters({ namedCurve: parameters })),\n                        });\n                    }\n                }\n        }\n        return null;\n    }\n    toWebAlgorithm(alg) {\n        switch (alg.algorithm) {\n            case asn1Ecc.id_ecdsaWithSHA1:\n                return {\n                    name: ECDSA,\n                    hash: { name: \"SHA-1\" },\n                };\n            case asn1Ecc.id_ecdsaWithSHA256:\n                return {\n                    name: ECDSA,\n                    hash: { name: \"SHA-256\" },\n                };\n            case asn1Ecc.id_ecdsaWithSHA384:\n                return {\n                    name: ECDSA,\n                    hash: { name: \"SHA-384\" },\n                };\n            case asn1Ecc.id_ecdsaWithSHA512:\n                return {\n                    name: ECDSA,\n                    hash: { name: \"SHA-512\" },\n                };\n            case asn1Ecc.id_ecPublicKey: {\n                if (!alg.parameters) {\n                    throw new TypeError(\"Cannot get required parameters from EC algorithm\");\n                }\n                const parameters = AsnConvert.parse(alg.parameters, asn1Ecc.ECParameters);\n                switch (parameters.namedCurve) {\n                    case asn1Ecc.id_secp256r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: \"P-256\",\n                        };\n                    case EcAlgorithm_1.SECP256K1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: \"K-256\",\n                        };\n                    case asn1Ecc.id_secp384r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: \"P-384\",\n                        };\n                    case asn1Ecc.id_secp521r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: \"P-521\",\n                        };\n                    case idBrainpoolP160r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP160r1,\n                        };\n                    case idBrainpoolP160t1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP160t1,\n                        };\n                    case idBrainpoolP192r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP192r1,\n                        };\n                    case idBrainpoolP192t1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP192t1,\n                        };\n                    case idBrainpoolP224r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP224r1,\n                        };\n                    case idBrainpoolP224t1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP224t1,\n                        };\n                    case idBrainpoolP256r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP256r1,\n                        };\n                    case idBrainpoolP256t1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP256t1,\n                        };\n                    case idBrainpoolP320r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP320r1,\n                        };\n                    case idBrainpoolP320t1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP320t1,\n                        };\n                    case idBrainpoolP384r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP384r1,\n                        };\n                    case idBrainpoolP384t1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP384t1,\n                        };\n                    case idBrainpoolP512r1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP512r1,\n                        };\n                    case idBrainpoolP512t1:\n                        return {\n                            name: ECDSA,\n                            namedCurve: brainpoolP512t1,\n                        };\n                }\n            }\n        }\n        return null;\n    }\n};\nEcAlgorithm.SECP256K1 = \"1.3.132.0.10\";\nEcAlgorithm = EcAlgorithm_1 = __decorate([\n    injectable()\n], EcAlgorithm);\ncontainer.registerSingleton(diAlgorithm, EcAlgorithm);\n\nconst NAME = Symbol(\"name\");\nconst VALUE = Symbol(\"value\");\nclass TextObject {\n    constructor(name, items = {}, value = \"\") {\n        this[NAME] = name;\n        this[VALUE] = value;\n        for (const key in items) {\n            this[key] = items[key];\n        }\n    }\n}\nTextObject.NAME = NAME;\nTextObject.VALUE = VALUE;\nclass DefaultAlgorithmSerializer {\n    static toTextObject(alg) {\n        const obj = new TextObject(\"Algorithm Identifier\", {}, OidSerializer.toString(alg.algorithm));\n        if (alg.parameters) {\n            switch (alg.algorithm) {\n                case asn1Ecc.id_ecPublicKey: {\n                    const ecAlg = new EcAlgorithm().toWebAlgorithm(alg);\n                    if (ecAlg && \"namedCurve\" in ecAlg) {\n                        obj[\"Named Curve\"] = ecAlg.namedCurve;\n                    }\n                    else {\n                        obj[\"Parameters\"] = alg.parameters;\n                    }\n                    break;\n                }\n                default:\n                    obj[\"Parameters\"] = alg.parameters;\n            }\n        }\n        return obj;\n    }\n}\nclass OidSerializer {\n    static toString(oid) {\n        const name = this.items[oid];\n        if (name) {\n            return name;\n        }\n        return oid;\n    }\n}\nOidSerializer.items = {\n    [asn1Rsa.id_sha1]: \"sha1\",\n    [asn1Rsa.id_sha224]: \"sha224\",\n    [asn1Rsa.id_sha256]: \"sha256\",\n    [asn1Rsa.id_sha384]: \"sha384\",\n    [asn1Rsa.id_sha512]: \"sha512\",\n    [asn1Rsa.id_rsaEncryption]: \"rsaEncryption\",\n    [asn1Rsa.id_sha1WithRSAEncryption]: \"sha1WithRSAEncryption\",\n    [asn1Rsa.id_sha224WithRSAEncryption]: \"sha224WithRSAEncryption\",\n    [asn1Rsa.id_sha256WithRSAEncryption]: \"sha256WithRSAEncryption\",\n    [asn1Rsa.id_sha384WithRSAEncryption]: \"sha384WithRSAEncryption\",\n    [asn1Rsa.id_sha512WithRSAEncryption]: \"sha512WithRSAEncryption\",\n    [asn1Ecc.id_ecPublicKey]: \"ecPublicKey\",\n    [asn1Ecc.id_ecdsaWithSHA1]: \"ecdsaWithSHA1\",\n    [asn1Ecc.id_ecdsaWithSHA224]: \"ecdsaWithSHA224\",\n    [asn1Ecc.id_ecdsaWithSHA256]: \"ecdsaWithSHA256\",\n    [asn1Ecc.id_ecdsaWithSHA384]: \"ecdsaWithSHA384\",\n    [asn1Ecc.id_ecdsaWithSHA512]: \"ecdsaWithSHA512\",\n    [asn1X509.id_kp_serverAuth]: \"TLS WWW server authentication\",\n    [asn1X509.id_kp_clientAuth]: \"TLS WWW client authentication\",\n    [asn1X509.id_kp_codeSigning]: \"Code Signing\",\n    [asn1X509.id_kp_emailProtection]: \"E-mail Protection\",\n    [asn1X509.id_kp_timeStamping]: \"Time Stamping\",\n    [asn1X509.id_kp_OCSPSigning]: \"OCSP Signing\",\n    [asn1Cms.id_signedData]: \"Signed Data\",\n};\nclass TextConverter {\n    static serialize(obj) {\n        return this.serializeObj(obj).join(\"\\n\");\n    }\n    static pad(deep = 0) {\n        return \"\".padStart(2 * deep, \" \");\n    }\n    static serializeObj(obj, deep = 0) {\n        const res = [];\n        let pad = this.pad(deep++);\n        let value = \"\";\n        const objValue = obj[TextObject.VALUE];\n        if (objValue) {\n            value = ` ${objValue}`;\n        }\n        res.push(`${pad}${obj[TextObject.NAME]}:${value}`);\n        pad = this.pad(deep);\n        for (const key in obj) {\n            if (typeof key === \"symbol\") {\n                continue;\n            }\n            const value = obj[key];\n            const keyValue = key ? `${key}: ` : \"\";\n            if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n                res.push(`${pad}${keyValue}${value}`);\n            }\n            else if (value instanceof Date) {\n                res.push(`${pad}${keyValue}${value.toUTCString()}`);\n            }\n            else if (Array.isArray(value)) {\n                for (const obj of value) {\n                    obj[TextObject.NAME] = key;\n                    res.push(...this.serializeObj(obj, deep));\n                }\n            }\n            else if (value instanceof TextObject) {\n                value[TextObject.NAME] = key;\n                res.push(...this.serializeObj(value, deep));\n            }\n            else if (BufferSourceConverter.isBufferSource(value)) {\n                if (key) {\n                    res.push(`${pad}${keyValue}`);\n                    res.push(...this.serializeBufferSource(value, deep + 1));\n                }\n                else {\n                    res.push(...this.serializeBufferSource(value, deep));\n                }\n            }\n            else if (\"toTextObject\" in value) {\n                const obj = value.toTextObject();\n                obj[TextObject.NAME] = key;\n                res.push(...this.serializeObj(obj, deep));\n            }\n            else {\n                throw new TypeError(\"Cannot serialize data in text format. Unsupported type.\");\n            }\n        }\n        return res;\n    }\n    static serializeBufferSource(buffer, deep = 0) {\n        const pad = this.pad(deep);\n        const view = BufferSourceConverter.toUint8Array(buffer);\n        const res = [];\n        for (let i = 0; i < view.length;) {\n            const row = [];\n            for (let j = 0; j < 16 && i < view.length; j++) {\n                if (j === 8) {\n                    row.push(\"\");\n                }\n                const hex = view[i++].toString(16).padStart(2, \"0\");\n                row.push(hex);\n            }\n            res.push(`${pad}${row.join(\" \")}`);\n        }\n        return res;\n    }\n    static serializeAlgorithm(alg) {\n        return this.algorithmSerializer.toTextObject(alg);\n    }\n}\nTextConverter.oidSerializer = OidSerializer;\nTextConverter.algorithmSerializer = DefaultAlgorithmSerializer;\n\nvar _AsnData_rawData, _AsnData_options;\nclass AsnData {\n    get parseOptions() {\n        return __classPrivateFieldGet(this, _AsnData_options, \"f\");\n    }\n    get rawData() {\n        if (!__classPrivateFieldGet(this, _AsnData_rawData, \"f\")) {\n            __classPrivateFieldSet(this, _AsnData_rawData, AsnConvert.serialize(this.asn), \"f\");\n        }\n        return __classPrivateFieldGet(this, _AsnData_rawData, \"f\");\n    }\n    constructor(...args) {\n        _AsnData_rawData.set(this, void 0);\n        _AsnData_options.set(this, void 0);\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            __classPrivateFieldSet(this, _AsnData_options, args[2], \"f\");\n            this.asn = AsnConvert.parse(args[0], args[1], args[2]);\n            __classPrivateFieldSet(this, _AsnData_rawData, BufferSourceConverter.toArrayBuffer(args[0]), \"f\");\n            this.onInit(this.asn);\n        }\n        else {\n            __classPrivateFieldSet(this, _AsnData_options, args[1], \"f\");\n            this.asn = args[0];\n            this.onInit(this.asn);\n        }\n    }\n    equal(data) {\n        if (data instanceof AsnData) {\n            return isEqual(data.rawData, this.rawData);\n        }\n        return false;\n    }\n    toString(format = \"text\") {\n        switch (format) {\n            case \"asn\":\n                return AsnConvert.toString(this.rawData, __classPrivateFieldGet(this, _AsnData_options, \"f\"));\n            case \"text\":\n                return TextConverter.serialize(this.toTextObject());\n            case \"hex\":\n                return Convert.ToHex(this.rawData);\n            case \"base64\":\n                return Convert.ToBase64(this.rawData);\n            case \"base64url\":\n                return Convert.ToBase64Url(this.rawData);\n            default:\n                throw TypeError(\"Argument 'format' is unsupported value\");\n        }\n    }\n    getTextName() {\n        const constructor = this.constructor;\n        return constructor.NAME;\n    }\n    toTextObject() {\n        const obj = this.toTextObjectEmpty();\n        obj[\"\"] = this.rawData;\n        return obj;\n    }\n    toTextObjectEmpty(value) {\n        return new TextObject(this.getTextName(), {}, value);\n    }\n}\n_AsnData_rawData = new WeakMap(), _AsnData_options = new WeakMap();\nAsnData.NAME = \"ASN\";\n\nclass Extension extends AsnData {\n    constructor(...args) {\n        let raw;\n        let options;\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            raw = BufferSourceConverter.toArrayBuffer(args[0]);\n            options = args[1];\n        }\n        else {\n            raw = AsnConvert.serialize(new Extension$1({\n                extnID: args[0],\n                critical: args[1],\n                extnValue: new OctetString(BufferSourceConverter.toArrayBuffer(args[2])),\n            }));\n        }\n        super(raw, Extension$1, options);\n    }\n    onInit(asn) {\n        this.type = asn.extnID;\n        this.critical = asn.critical;\n        this.value = asn.extnValue.buffer;\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        obj[\"\"] = this.value;\n        return obj;\n    }\n    toTextObjectWithoutValue() {\n        const obj = this.toTextObjectEmpty(this.critical ? \"critical\" : undefined);\n        if (obj[TextObject.NAME] === Extension.NAME) {\n            obj[TextObject.NAME] = OidSerializer.toString(this.type);\n        }\n        return obj;\n    }\n}\n\nvar _a;\nclass CryptoProvider {\n    static isCryptoKeyPair(data) {\n        return data && data.privateKey && data.publicKey;\n    }\n    static isCryptoKey(data) {\n        return data && data.usages && data.type && data.algorithm && data.extractable !== undefined;\n    }\n    constructor() {\n        this.items = new Map();\n        this[_a] = \"CryptoProvider\";\n        if (typeof self !== \"undefined\" && typeof crypto !== \"undefined\") {\n            this.set(CryptoProvider.DEFAULT, crypto);\n        }\n        else if (typeof global !== \"undefined\" && global.crypto && global.crypto.subtle) {\n            this.set(CryptoProvider.DEFAULT, global.crypto);\n        }\n    }\n    clear() {\n        this.items.clear();\n    }\n    delete(key) {\n        return this.items.delete(key);\n    }\n    forEach(callbackfn, thisArg) {\n        return this.items.forEach(callbackfn, thisArg);\n    }\n    has(key) {\n        return this.items.has(key);\n    }\n    get size() {\n        return this.items.size;\n    }\n    entries() {\n        return this.items.entries();\n    }\n    keys() {\n        return this.items.keys();\n    }\n    values() {\n        return this.items.values();\n    }\n    [Symbol.iterator]() {\n        return this.items[Symbol.iterator]();\n    }\n    get(key = CryptoProvider.DEFAULT) {\n        const crypto = this.items.get(key.toLowerCase());\n        if (!crypto) {\n            throw new Error(`Cannot get Crypto by name '${key}'`);\n        }\n        return crypto;\n    }\n    set(key, value) {\n        if (typeof key === \"string\") {\n            if (!value) {\n                throw new TypeError(\"Argument 'value' is required\");\n            }\n            this.items.set(key.toLowerCase(), value);\n        }\n        else {\n            this.items.set(CryptoProvider.DEFAULT, key);\n        }\n        return this;\n    }\n}\n_a = Symbol.toStringTag;\nCryptoProvider.DEFAULT = \"default\";\nconst cryptoProvider = new CryptoProvider();\n\nconst OID_REGEX = /^[0-2](?:\\.[1-9][0-9]*)+$/;\nfunction isOID(id) {\n    return new RegExp(OID_REGEX).test(id);\n}\nclass NameIdentifier {\n    constructor(names = {}) {\n        this.items = {};\n        for (const id in names) {\n            this.register(id, names[id]);\n        }\n    }\n    get(idOrName) {\n        return this.items[idOrName] || null;\n    }\n    findId(idOrName) {\n        if (!isOID(idOrName)) {\n            return this.get(idOrName);\n        }\n        return idOrName;\n    }\n    register(id, name) {\n        this.items[id] = name;\n        this.items[name] = id;\n    }\n}\nconst names = new NameIdentifier();\nnames.register(\"CN\", \"2.5.4.3\");\nnames.register(\"L\", \"2.5.4.7\");\nnames.register(\"ST\", \"2.5.4.8\");\nnames.register(\"O\", \"2.5.4.10\");\nnames.register(\"OU\", \"2.5.4.11\");\nnames.register(\"C\", \"2.5.4.6\");\nnames.register(\"DC\", \"0.9.2342.19200300.100.1.25\");\nnames.register(\"E\", \"1.2.840.113549.1.9.1\");\nnames.register(\"G\", \"2.5.4.42\");\nnames.register(\"I\", \"2.5.4.43\");\nnames.register(\"SN\", \"2.5.4.4\");\nnames.register(\"T\", \"2.5.4.12\");\nfunction replaceUnknownCharacter(text, char) {\n    return `\\\\${Convert.ToHex(Convert.FromUtf8String(char)).toUpperCase()}`;\n}\nfunction escape(data) {\n    return data\n        .replace(/([,+\"\\\\<>;])/g, \"\\\\$1\")\n        .replace(/^([ #])/, \"\\\\$1\")\n        .replace(/([ ]$)/, \"\\\\$1\")\n        .replace(/([\\r\\n\\t])/, replaceUnknownCharacter);\n}\nclass Name {\n    static isASCII(text) {\n        for (let i = 0; i < text.length; i++) {\n            const code = text.charCodeAt(i);\n            if (code > 0xff) {\n                return false;\n            }\n        }\n        return true;\n    }\n    static isPrintableString(text) {\n        return /^[A-Za-z0-9 '()+,-./:=?]*$/g.test(text);\n    }\n    constructor(data, extraNames = {}) {\n        this.extraNames = new NameIdentifier();\n        this.asn = new Name$1();\n        for (const key in extraNames) {\n            if (Object.prototype.hasOwnProperty.call(extraNames, key)) {\n                const value = extraNames[key];\n                this.extraNames.register(key, value);\n            }\n        }\n        if (typeof data === \"string\") {\n            this.asn = this.fromString(data);\n        }\n        else if (data instanceof Name$1) {\n            this.asn = data;\n        }\n        else if (BufferSourceConverter.isBufferSource(data)) {\n            this.asn = AsnConvert.parse(data, Name$1);\n        }\n        else {\n            this.asn = this.fromJSON(data);\n        }\n    }\n    getField(idOrName) {\n        const id = this.extraNames.findId(idOrName) || names.findId(idOrName);\n        const res = [];\n        for (const name of this.asn) {\n            for (const rdn of name) {\n                if (rdn.type === id) {\n                    res.push(rdn.value.toString());\n                }\n            }\n        }\n        return res;\n    }\n    getName(idOrName) {\n        return this.extraNames.get(idOrName) || names.get(idOrName);\n    }\n    toString() {\n        return this.asn\n            .map((rdn) => rdn\n            .map((o) => {\n            const type = this.getName(o.type) || o.type;\n            const value = o.value.anyValue\n                ?\n                    `#${Convert.ToHex(o.value.anyValue)}`\n                :\n                    escape(o.value.toString());\n            return `${type}=${value}`;\n        })\n            .join(\"+\"))\n            .join(\", \");\n    }\n    toJSON() {\n        var _a;\n        const json = [];\n        for (const rdn of this.asn) {\n            const jsonItem = {};\n            for (const attr of rdn) {\n                const type = this.getName(attr.type) || attr.type;\n                (_a = jsonItem[type]) !== null && _a !== void 0 ? _a : (jsonItem[type] = []);\n                jsonItem[type].push(attr.value.anyValue ? `#${Convert.ToHex(attr.value.anyValue)}` : attr.value.toString());\n            }\n            json.push(jsonItem);\n        }\n        return json;\n    }\n    fromString(data) {\n        const asn = new Name$1();\n        const regex = /(\\d\\.[\\d.]*\\d|[A-Za-z]+)=((?:\"\")|(?:\".*?[^\\\\]\")|(?:[^,+\"\\\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\\\][,+]))|(?:))([,+])?/g;\n        let matches = null;\n        let level = \",\";\n        while ((matches = regex.exec(`${data},`))) {\n            let [, type, value] = matches;\n            const lastChar = value[value.length - 1];\n            if (lastChar === \",\" || lastChar === \"+\") {\n                value = value.slice(0, value.length - 1);\n                matches[3] = lastChar;\n            }\n            const next = matches[3];\n            type = this.getTypeOid(type);\n            const attr = this.createAttribute(type, value);\n            if (level === \"+\") {\n                asn[asn.length - 1].push(attr);\n            }\n            else {\n                asn.push(new RelativeDistinguishedName([attr]));\n            }\n            level = next;\n        }\n        return asn;\n    }\n    fromJSON(data) {\n        const asn = new Name$1();\n        for (const item of data) {\n            const asnRdn = new RelativeDistinguishedName();\n            for (const type in item) {\n                const typeId = this.getTypeOid(type);\n                const values = item[type];\n                for (const value of values) {\n                    const asnAttr = this.createAttribute(typeId, value);\n                    asnRdn.push(asnAttr);\n                }\n            }\n            asn.push(asnRdn);\n        }\n        return asn;\n    }\n    getTypeOid(type) {\n        if (!/[\\d.]+/.test(type)) {\n            type = this.getName(type) || \"\";\n        }\n        if (!type) {\n            throw new Error(`Cannot get OID for name type '${type}'`);\n        }\n        return type;\n    }\n    createAttribute(type, value) {\n        const attr = new AttributeTypeAndValue({ type });\n        if (typeof value === \"object\") {\n            for (const key in value) {\n                switch (key) {\n                    case \"ia5String\":\n                        attr.value.ia5String = value[key];\n                        break;\n                    case \"utf8String\":\n                        attr.value.utf8String = value[key];\n                        break;\n                    case \"universalString\":\n                        attr.value.universalString = value[key];\n                        break;\n                    case \"bmpString\":\n                        attr.value.bmpString = value[key];\n                        break;\n                    case \"printableString\":\n                        attr.value.printableString = value[key];\n                        break;\n                }\n            }\n        }\n        else if (value[0] === \"#\") {\n            attr.value.anyValue = Convert.FromHex(value.slice(1));\n        }\n        else {\n            const processedValue = this.processStringValue(value);\n            if (type === this.getName(\"E\") || type === this.getName(\"DC\")) {\n                attr.value.ia5String = processedValue;\n            }\n            else {\n                if (Name.isPrintableString(processedValue)) {\n                    attr.value.printableString = processedValue;\n                }\n                else {\n                    attr.value.utf8String = processedValue;\n                }\n            }\n        }\n        return attr;\n    }\n    processStringValue(value) {\n        const quotedMatches = /\"(.*?[^\\\\])?\"/.exec(value);\n        if (quotedMatches) {\n            value = quotedMatches[1];\n        }\n        return value\n            .replace(/\\\\0a/gi, \"\\n\")\n            .replace(/\\\\0d/gi, \"\\r\")\n            .replace(/\\\\0g/gi, \"\\t\")\n            .replace(/\\\\(.)/g, \"$1\");\n    }\n    toArrayBuffer() {\n        return AsnConvert.serialize(this.asn);\n    }\n    async getThumbprint(arg1, arg2) {\n        let crypto;\n        let algorithm = \"SHA-1\";\n        if (arg1) {\n            if (typeof arg1 === \"object\" && \"subtle\" in arg1) {\n                crypto = arg1;\n            }\n            else {\n                algorithm = arg1;\n                crypto = arg2;\n            }\n        }\n        crypto !== null && crypto !== void 0 ? crypto : (crypto = cryptoProvider.get());\n        return await crypto.subtle.digest(algorithm, this.toArrayBuffer());\n    }\n}\n\nconst ERR_GN_CONSTRUCTOR = \"Cannot initialize GeneralName from ASN.1 data.\";\nconst ERR_GN_STRING_FORMAT = `${ERR_GN_CONSTRUCTOR} Unsupported string format in use.`;\nconst ERR_GUID = `${ERR_GN_CONSTRUCTOR} Value doesn't match to GUID regular expression.`;\nconst GUID_REGEX = /^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i;\nconst id_GUID = \"1.3.6.1.4.1.311.25.1\";\nconst id_UPN = \"1.3.6.1.4.1.311.20.2.3\";\nconst DNS = \"dns\";\nconst DN = \"dn\";\nconst EMAIL = \"email\";\nconst IP = \"ip\";\nconst URL = \"url\";\nconst GUID = \"guid\";\nconst UPN = \"upn\";\nconst REGISTERED_ID = \"id\";\nclass GeneralName extends AsnData {\n    constructor(...args) {\n        let name;\n        if (args.length === 2) {\n            switch (args[0]) {\n                case DN: {\n                    const derName = new Name(args[1]).toArrayBuffer();\n                    const asnName = AsnConvert.parse(derName, asn1X509.Name);\n                    name = new asn1X509.GeneralName({ directoryName: asnName });\n                    break;\n                }\n                case DNS:\n                    name = new asn1X509.GeneralName({ dNSName: args[1] });\n                    break;\n                case EMAIL:\n                    name = new asn1X509.GeneralName({ rfc822Name: args[1] });\n                    break;\n                case GUID: {\n                    const matches = new RegExp(GUID_REGEX, \"i\").exec(args[1]);\n                    if (!matches) {\n                        throw new Error(\"Cannot parse GUID value. Value doesn't match to regular expression\");\n                    }\n                    const hex = matches\n                        .slice(1)\n                        .map((o, i) => {\n                        if (i < 3) {\n                            return Convert.ToHex(new Uint8Array(Convert.FromHex(o)).reverse());\n                        }\n                        return o;\n                    })\n                        .join(\"\");\n                    name = new asn1X509.GeneralName({\n                        otherName: new asn1X509.OtherName({\n                            typeId: id_GUID,\n                            value: AsnConvert.serialize(new OctetString(Convert.FromHex(hex))),\n                        }),\n                    });\n                    break;\n                }\n                case IP:\n                    name = new asn1X509.GeneralName({ iPAddress: args[1] });\n                    break;\n                case REGISTERED_ID:\n                    name = new asn1X509.GeneralName({ registeredID: args[1] });\n                    break;\n                case UPN: {\n                    name = new asn1X509.GeneralName({\n                        otherName: new asn1X509.OtherName({\n                            typeId: id_UPN,\n                            value: AsnConvert.serialize(AsnUtf8StringConverter.toASN(args[1])),\n                        }),\n                    });\n                    break;\n                }\n                case URL:\n                    name = new asn1X509.GeneralName({ uniformResourceIdentifier: args[1] });\n                    break;\n                default:\n                    throw new Error(\"Cannot create GeneralName. Unsupported type of the name\");\n            }\n        }\n        else if (BufferSourceConverter.isBufferSource(args[0])) {\n            name = AsnConvert.parse(args[0], asn1X509.GeneralName);\n        }\n        else {\n            name = args[0];\n        }\n        super(name);\n    }\n    onInit(asn) {\n        if (asn.dNSName != undefined) {\n            this.type = DNS;\n            this.value = asn.dNSName;\n        }\n        else if (asn.rfc822Name != undefined) {\n            this.type = EMAIL;\n            this.value = asn.rfc822Name;\n        }\n        else if (asn.iPAddress != undefined) {\n            this.type = IP;\n            this.value = asn.iPAddress;\n        }\n        else if (asn.uniformResourceIdentifier != undefined) {\n            this.type = URL;\n            this.value = asn.uniformResourceIdentifier;\n        }\n        else if (asn.registeredID != undefined) {\n            this.type = REGISTERED_ID;\n            this.value = asn.registeredID;\n        }\n        else if (asn.directoryName != undefined) {\n            this.type = DN;\n            this.value = new Name(asn.directoryName).toString();\n        }\n        else if (asn.otherName != undefined) {\n            if (asn.otherName.typeId === id_GUID) {\n                this.type = GUID;\n                const guid = AsnConvert.parse(asn.otherName.value, OctetString);\n                const matches = new RegExp(GUID_REGEX, \"i\").exec(Convert.ToHex(guid));\n                if (!matches) {\n                    throw new Error(ERR_GUID);\n                }\n                this.value = matches\n                    .slice(1)\n                    .map((o, i) => {\n                    if (i < 3) {\n                        return Convert.ToHex(new Uint8Array(Convert.FromHex(o)).reverse());\n                    }\n                    return o;\n                })\n                    .join(\"-\");\n            }\n            else if (asn.otherName.typeId === id_UPN) {\n                this.type = UPN;\n                this.value = AsnConvert.parse(asn.otherName.value, asn1X509.DirectoryString).toString();\n            }\n            else {\n                throw new Error(ERR_GN_STRING_FORMAT);\n            }\n        }\n        else {\n            throw new Error(ERR_GN_STRING_FORMAT);\n        }\n    }\n    toJSON() {\n        return {\n            type: this.type,\n            value: this.value,\n        };\n    }\n    toTextObject() {\n        let type;\n        switch (this.type) {\n            case DN:\n            case DNS:\n            case GUID:\n            case IP:\n            case REGISTERED_ID:\n            case UPN:\n            case URL:\n                type = this.type.toUpperCase();\n                break;\n            case EMAIL:\n                type = \"Email\";\n                break;\n            default:\n                throw new Error(\"Unsupported GeneralName type\");\n        }\n        let value = this.value;\n        if (this.type === REGISTERED_ID) {\n            value = OidSerializer.toString(value);\n        }\n        return new TextObject(type, undefined, value);\n    }\n}\nclass GeneralNames extends AsnData {\n    constructor(params) {\n        let names;\n        if (params instanceof asn1X509.GeneralNames) {\n            names = params;\n        }\n        else if (Array.isArray(params)) {\n            const items = [];\n            for (const name of params) {\n                if (name instanceof asn1X509.GeneralName) {\n                    items.push(name);\n                }\n                else {\n                    const asnName = AsnConvert.parse(new GeneralName(name.type, name.value).rawData, asn1X509.GeneralName);\n                    items.push(asnName);\n                }\n            }\n            names = new asn1X509.GeneralNames(items);\n        }\n        else if (BufferSourceConverter.isBufferSource(params)) {\n            names = AsnConvert.parse(params, asn1X509.GeneralNames);\n        }\n        else {\n            throw new Error(\"Cannot initialize GeneralNames. Incorrect incoming arguments\");\n        }\n        super(names);\n    }\n    onInit(asn) {\n        const items = [];\n        for (const asnName of asn) {\n            let name = null;\n            try {\n                name = new GeneralName(asnName);\n            }\n            catch {\n                continue;\n            }\n            items.push(name);\n        }\n        this.items = items;\n    }\n    toJSON() {\n        return this.items.map((o) => o.toJSON());\n    }\n    toTextObject() {\n        const res = super.toTextObjectEmpty();\n        for (const name of this.items) {\n            const nameObj = name.toTextObject();\n            let field = res[nameObj[TextObject.NAME]];\n            if (!Array.isArray(field)) {\n                field = [];\n                res[nameObj[TextObject.NAME]] = field;\n            }\n            field.push(nameObj);\n        }\n        return res;\n    }\n}\nGeneralNames.NAME = \"GeneralNames\";\n\nconst rPaddingTag = \"-{5}\";\nconst rEolChars = \"\\\\n\";\nconst rNameTag = `[^${rEolChars}]+`;\nconst rBeginTag = `${rPaddingTag}BEGIN (${rNameTag}(?=${rPaddingTag}))${rPaddingTag}`;\nconst rEndTag = `${rPaddingTag}END \\\\1${rPaddingTag}`;\nconst rEolGroup = \"\\\\n\";\nconst rHeaderKey = `[^:${rEolChars}]+`;\nconst rHeaderValue = `(?:[^${rEolChars}]+${rEolGroup}(?: +[^${rEolChars}]+${rEolGroup})*)`;\nconst rBase64Chars = \"[a-zA-Z0-9=+/]+\";\nconst rBase64 = `(?:${rBase64Chars}${rEolGroup})+`;\nconst rPem = `${rBeginTag}${rEolGroup}(?:((?:${rHeaderKey}: ${rHeaderValue})+))?${rEolGroup}?(${rBase64})${rEndTag}`;\nconst rEolPattern = new RegExp(`[${rEolChars}]+`, \"g\");\nclass PemConverter {\n    static isPem(data) {\n        return typeof data === \"string\" && new RegExp(rPem, \"g\").test(data.replace(/\\r/g, \"\"));\n    }\n    static decodeWithHeaders(pem) {\n        pem = pem.replace(/\\r/g, \"\");\n        const pattern = new RegExp(rPem, \"g\");\n        const res = [];\n        let matches = null;\n        while ((matches = pattern.exec(pem))) {\n            const base64 = matches[3].replace(rEolPattern, \"\");\n            const pemStruct = {\n                type: matches[1],\n                headers: [],\n                rawData: Convert.FromBase64(base64),\n            };\n            const headersString = matches[2];\n            if (headersString) {\n                const headers = headersString.split(new RegExp(rEolGroup, \"g\"));\n                let lastHeader = null;\n                for (const header of headers) {\n                    const [key, value] = header.split(/:(.*)/);\n                    if (value === undefined) {\n                        if (!lastHeader) {\n                            throw new Error(\"Cannot parse PEM string. Incorrect header value\");\n                        }\n                        lastHeader.value += key.trim();\n                    }\n                    else {\n                        if (lastHeader) {\n                            pemStruct.headers.push(lastHeader);\n                        }\n                        lastHeader = {\n                            key,\n                            value: value.trim(),\n                        };\n                    }\n                }\n                if (lastHeader) {\n                    pemStruct.headers.push(lastHeader);\n                }\n            }\n            res.push(pemStruct);\n        }\n        return res;\n    }\n    static decode(pem) {\n        const blocks = this.decodeWithHeaders(pem);\n        return blocks.map((o) => o.rawData);\n    }\n    static decodeFirst(pem) {\n        const items = this.decode(pem);\n        if (!items.length) {\n            throw new RangeError(\"PEM string doesn't contain any objects\");\n        }\n        return items[0];\n    }\n    static encode(rawData, tag) {\n        if (Array.isArray(rawData)) {\n            const raws = new Array();\n            if (tag) {\n                rawData.forEach((element) => {\n                    if (!BufferSourceConverter.isBufferSource(element)) {\n                        throw new TypeError(\"Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource\");\n                    }\n                    raws.push(this.encodeStruct({\n                        type: tag,\n                        rawData: BufferSourceConverter.toArrayBuffer(element),\n                    }));\n                });\n            }\n            else {\n                rawData.forEach((element) => {\n                    if (!(\"type\" in element)) {\n                        throw new TypeError(\"Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut\");\n                    }\n                    raws.push(this.encodeStruct(element));\n                });\n            }\n            return raws.join(\"\\n\");\n        }\n        else {\n            if (!tag) {\n                throw new Error(\"Required argument 'tag' is missed\");\n            }\n            return this.encodeStruct({\n                type: tag,\n                rawData: BufferSourceConverter.toArrayBuffer(rawData),\n            });\n        }\n    }\n    static encodeStruct(pem) {\n        var _a;\n        const upperCaseType = pem.type.toLocaleUpperCase();\n        const res = [];\n        res.push(`-----BEGIN ${upperCaseType}-----`);\n        if ((_a = pem.headers) === null || _a === void 0 ? void 0 : _a.length) {\n            for (const header of pem.headers) {\n                res.push(`${header.key}: ${header.value}`);\n            }\n            res.push(\"\");\n        }\n        const base64 = Convert.ToBase64(pem.rawData);\n        for (let i = 0; i < base64.length; i += 64) {\n            res.push(base64.substring(i, i + 64));\n        }\n        res.push(`-----END ${upperCaseType}-----`);\n        return res.join(\"\\n\");\n    }\n}\nPemConverter.CertificateTag = \"CERTIFICATE\";\nPemConverter.CrlTag = \"CRL\";\nPemConverter.CertificateRequestTag = \"CERTIFICATE REQUEST\";\nPemConverter.PublicKeyTag = \"PUBLIC KEY\";\nPemConverter.PrivateKeyTag = \"PRIVATE KEY\";\n\nclass PemData extends AsnData {\n    static isAsnEncoded(data) {\n        return BufferSourceConverter.isBufferSource(data) || typeof data === \"string\";\n    }\n    static toArrayBuffer(raw) {\n        if (typeof raw === \"string\") {\n            if (PemConverter.isPem(raw)) {\n                return PemConverter.decode(raw)[0];\n            }\n            else if (Convert.isHex(raw)) {\n                return Convert.FromHex(raw);\n            }\n            else if (Convert.isBase64(raw)) {\n                return Convert.FromBase64(raw);\n            }\n            else if (Convert.isBase64Url(raw)) {\n                return Convert.FromBase64Url(raw);\n            }\n            else {\n                throw new TypeError(\"Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url\");\n            }\n        }\n        else {\n            const buffer = BufferSourceConverter.toUint8Array(raw);\n            if (buffer.length > 0 && buffer[0] === 0x30) {\n                return BufferSourceConverter.toArrayBuffer(raw);\n            }\n            const stringRaw = Convert.ToBinary(raw);\n            if (PemConverter.isPem(stringRaw)) {\n                return PemConverter.decode(stringRaw)[0];\n            }\n            else if (Convert.isHex(stringRaw)) {\n                return Convert.FromHex(stringRaw);\n            }\n            else if (Convert.isBase64(stringRaw)) {\n                return Convert.FromBase64(stringRaw);\n            }\n            else if (Convert.isBase64Url(stringRaw)) {\n                return Convert.FromBase64Url(stringRaw);\n            }\n            throw new TypeError(\"Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url\");\n        }\n    }\n    constructor(...args) {\n        if (PemData.isAsnEncoded(args[0])) {\n            super(PemData.toArrayBuffer(args[0]), args[1], args[2]);\n        }\n        else {\n            super(args[0], args[1]);\n        }\n    }\n    toString(format = \"pem\") {\n        switch (format) {\n            case \"pem\":\n                return PemConverter.encode(this.rawData, this.tag);\n            default:\n                return super.toString(format);\n        }\n    }\n}\n\nclass PublicKey extends PemData {\n    static async create(data, crypto = cryptoProvider.get()) {\n        if (data instanceof PublicKey) {\n            return data;\n        }\n        else if (CryptoProvider.isCryptoKey(data)) {\n            if (data.type !== \"public\") {\n                throw new TypeError(\"Public key is required\");\n            }\n            const spki = await crypto.subtle.exportKey(\"spki\", data);\n            return new PublicKey(spki);\n        }\n        else if (data.publicKey) {\n            return data.publicKey;\n        }\n        else if (BufferSourceConverter.isBufferSource(data)) {\n            return new PublicKey(data);\n        }\n        else {\n            throw new TypeError(\"Unsupported PublicKeyType\");\n        }\n    }\n    constructor(param, options) {\n        if (PemData.isAsnEncoded(param)) {\n            super(param, SubjectPublicKeyInfo, options);\n        }\n        else {\n            super(param, options);\n        }\n        this.tag = PemConverter.PublicKeyTag;\n    }\n    async export(arg1, arg2, arg3) {\n        let crypto;\n        let keyUsages = [\"verify\"];\n        let algorithm = {\n            hash: \"SHA-256\",\n            ...this.algorithm,\n        };\n        if (arg2) {\n            algorithm = arg1;\n            keyUsages = arg2;\n            crypto = arg3;\n        }\n        else {\n            crypto = arg1;\n        }\n        crypto !== null && crypto !== void 0 ? crypto : (crypto = cryptoProvider.get());\n        let raw = this.rawData;\n        const asnSpki = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo, this.parseOptions);\n        if (asnSpki.algorithm.algorithm === id_RSASSA_PSS) {\n            raw = convertSpkiToRsaPkcs1(asnSpki, raw);\n        }\n        return crypto.subtle.importKey(\"spki\", raw, algorithm, true, keyUsages);\n    }\n    onInit(asn) {\n        const algProv = container.resolve(diAlgorithmProvider);\n        const algorithm = (this.algorithm = algProv.toWebAlgorithm(asn.algorithm));\n        switch (asn.algorithm.algorithm) {\n            case id_rsaEncryption: {\n                const rsaPublicKey = AsnConvert.parse(asn.subjectPublicKey, RSAPublicKey, this.parseOptions);\n                const modulus = BufferSourceConverter.toUint8Array(rsaPublicKey.modulus);\n                algorithm.publicExponent = BufferSourceConverter.toUint8Array(rsaPublicKey.publicExponent);\n                algorithm.modulusLength = (!modulus[0] ? modulus.slice(1) : modulus).byteLength << 3;\n                break;\n            }\n        }\n    }\n    async getThumbprint(arg1, arg2) {\n        let crypto;\n        let algorithm = \"SHA-1\";\n        if (arg1) {\n            if (typeof arg1 === \"object\" && \"subtle\" in arg1) {\n                crypto = arg1;\n            }\n            else {\n                algorithm = arg1;\n                crypto = arg2;\n            }\n        }\n        crypto !== null && crypto !== void 0 ? crypto : (crypto = cryptoProvider.get());\n        return await crypto.subtle.digest(algorithm, this.rawData);\n    }\n    async getKeyIdentifier(arg1, arg2) {\n        let crypto;\n        let algorithm = \"SHA-1\";\n        if (arg1) {\n            if (typeof arg1 === \"object\" && \"subtle\" in arg1) {\n                crypto = arg1;\n            }\n            else {\n                algorithm = arg1;\n                crypto = arg2;\n            }\n        }\n        crypto !== null && crypto !== void 0 ? crypto : (crypto = cryptoProvider.get());\n        const asn = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo, this.parseOptions);\n        return await crypto.subtle.digest(algorithm, asn.subjectPublicKey);\n    }\n    toTextObject() {\n        const obj = this.toTextObjectEmpty();\n        const asn = AsnConvert.parse(this.rawData, SubjectPublicKeyInfo, this.parseOptions);\n        obj[\"Algorithm\"] = TextConverter.serializeAlgorithm(asn.algorithm);\n        switch (asn.algorithm.algorithm) {\n            case id_ecPublicKey:\n                obj[\"EC Point\"] = asn.subjectPublicKey;\n                break;\n            case id_rsaEncryption:\n            default:\n                obj[\"Raw Data\"] = asn.subjectPublicKey;\n        }\n        return obj;\n    }\n}\nfunction convertSpkiToRsaPkcs1(asnSpki, raw) {\n    asnSpki.algorithm = new AlgorithmIdentifier({\n        algorithm: id_rsaEncryption,\n        parameters: null,\n    });\n    raw = AsnConvert.serialize(asnSpki);\n    return raw;\n}\n\nclass AuthorityKeyIdentifierExtension extends Extension {\n    static async create(param, critical = false, crypto = cryptoProvider.get()) {\n        if (\"name\" in param && \"serialNumber\" in param) {\n            return new AuthorityKeyIdentifierExtension(param, critical);\n        }\n        const key = await PublicKey.create(param, crypto);\n        const id = await key.getKeyIdentifier(crypto);\n        return new AuthorityKeyIdentifierExtension(Convert.ToHex(id), critical);\n    }\n    constructor(...args) {\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n        }\n        else if (typeof args[0] === \"string\") {\n            const value = new asn1X509.AuthorityKeyIdentifier({\n                keyIdentifier: new asn1X509.KeyIdentifier(Convert.FromHex(args[0])),\n            });\n            super(asn1X509.id_ce_authorityKeyIdentifier, args[1], AsnConvert.serialize(value));\n        }\n        else {\n            const certId = args[0];\n            const certIdName = certId.name instanceof GeneralNames\n                ? AsnConvert.parse(certId.name.rawData, asn1X509.GeneralNames)\n                : certId.name;\n            const value = new asn1X509.AuthorityKeyIdentifier({\n                authorityCertIssuer: certIdName,\n                authorityCertSerialNumber: Convert.FromHex(certId.serialNumber),\n            });\n            super(asn1X509.id_ce_authorityKeyIdentifier, args[1], AsnConvert.serialize(value));\n        }\n    }\n    onInit(asn) {\n        super.onInit(asn);\n        const aki = AsnConvert.parse(asn.extnValue, asn1X509.AuthorityKeyIdentifier, this.parseOptions);\n        if (aki.keyIdentifier) {\n            this.keyId = Convert.ToHex(aki.keyIdentifier);\n        }\n        if (aki.authorityCertIssuer || aki.authorityCertSerialNumber) {\n            this.certId = {\n                name: aki.authorityCertIssuer || [],\n                serialNumber: aki.authorityCertSerialNumber\n                    ? Convert.ToHex(aki.authorityCertSerialNumber)\n                    : \"\",\n            };\n        }\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        const asn = AsnConvert.parse(this.value, asn1X509.AuthorityKeyIdentifier, this.parseOptions);\n        if (asn.authorityCertIssuer) {\n            obj[\"Authority Issuer\"] = new GeneralNames(asn.authorityCertIssuer).toTextObject();\n        }\n        if (asn.authorityCertSerialNumber) {\n            obj[\"Authority Serial Number\"] = asn.authorityCertSerialNumber;\n        }\n        if (asn.keyIdentifier) {\n            obj[\"\"] = asn.keyIdentifier;\n        }\n        return obj;\n    }\n}\nAuthorityKeyIdentifierExtension.NAME = \"Authority Key Identifier\";\n\nclass BasicConstraintsExtension extends Extension {\n    constructor(...args) {\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n            const value = AsnConvert.parse(this.value, BasicConstraints, this.parseOptions);\n            this.ca = value.cA;\n            this.pathLength = value.pathLenConstraint;\n        }\n        else {\n            const value = new BasicConstraints({\n                cA: args[0],\n                pathLenConstraint: args[1],\n            });\n            super(id_ce_basicConstraints, args[2], AsnConvert.serialize(value));\n            this.ca = args[0];\n            this.pathLength = args[1];\n        }\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        if (this.ca) {\n            obj[\"CA\"] = this.ca;\n        }\n        if (this.pathLength !== undefined) {\n            obj[\"Path Length\"] = this.pathLength;\n        }\n        return obj;\n    }\n}\nBasicConstraintsExtension.NAME = \"Basic Constraints\";\n\nvar ExtendedKeyUsage;\n(function (ExtendedKeyUsage) {\n    ExtendedKeyUsage[\"serverAuth\"] = \"1.3.6.1.5.5.7.3.1\";\n    ExtendedKeyUsage[\"clientAuth\"] = \"1.3.6.1.5.5.7.3.2\";\n    ExtendedKeyUsage[\"codeSigning\"] = \"1.3.6.1.5.5.7.3.3\";\n    ExtendedKeyUsage[\"emailProtection\"] = \"1.3.6.1.5.5.7.3.4\";\n    ExtendedKeyUsage[\"timeStamping\"] = \"1.3.6.1.5.5.7.3.8\";\n    ExtendedKeyUsage[\"ocspSigning\"] = \"1.3.6.1.5.5.7.3.9\";\n})(ExtendedKeyUsage || (ExtendedKeyUsage = {}));\nclass ExtendedKeyUsageExtension extends Extension {\n    constructor(...args) {\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n            const value = AsnConvert.parse(this.value, asn1X509.ExtendedKeyUsage, this.parseOptions);\n            this.usages = value.map((o) => o);\n        }\n        else {\n            const value = new asn1X509.ExtendedKeyUsage(args[0]);\n            super(asn1X509.id_ce_extKeyUsage, args[1], AsnConvert.serialize(value));\n            this.usages = args[0];\n        }\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        obj[\"\"] = this.usages.map((o) => OidSerializer.toString(o)).join(\", \");\n        return obj;\n    }\n}\nExtendedKeyUsageExtension.NAME = \"Extended Key Usages\";\n\nvar KeyUsageFlags;\n(function (KeyUsageFlags) {\n    KeyUsageFlags[KeyUsageFlags[\"digitalSignature\"] = 1] = \"digitalSignature\";\n    KeyUsageFlags[KeyUsageFlags[\"nonRepudiation\"] = 2] = \"nonRepudiation\";\n    KeyUsageFlags[KeyUsageFlags[\"keyEncipherment\"] = 4] = \"keyEncipherment\";\n    KeyUsageFlags[KeyUsageFlags[\"dataEncipherment\"] = 8] = \"dataEncipherment\";\n    KeyUsageFlags[KeyUsageFlags[\"keyAgreement\"] = 16] = \"keyAgreement\";\n    KeyUsageFlags[KeyUsageFlags[\"keyCertSign\"] = 32] = \"keyCertSign\";\n    KeyUsageFlags[KeyUsageFlags[\"cRLSign\"] = 64] = \"cRLSign\";\n    KeyUsageFlags[KeyUsageFlags[\"encipherOnly\"] = 128] = \"encipherOnly\";\n    KeyUsageFlags[KeyUsageFlags[\"decipherOnly\"] = 256] = \"decipherOnly\";\n})(KeyUsageFlags || (KeyUsageFlags = {}));\nclass KeyUsagesExtension extends Extension {\n    constructor(...args) {\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n            const value = AsnConvert.parse(this.value, KeyUsage, this.parseOptions);\n            this.usages = value.toNumber();\n        }\n        else {\n            const value = new KeyUsage(args[0]);\n            super(id_ce_keyUsage, args[1], AsnConvert.serialize(value));\n            this.usages = args[0];\n        }\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        const asn = AsnConvert.parse(this.value, KeyUsage, this.parseOptions);\n        obj[\"\"] = asn.toJSON().join(\", \");\n        return obj;\n    }\n}\nKeyUsagesExtension.NAME = \"Key Usages\";\n\nclass SubjectKeyIdentifierExtension extends Extension {\n    static async create(publicKey, critical = false, crypto = cryptoProvider.get()) {\n        const key = await PublicKey.create(publicKey, crypto);\n        const id = await key.getKeyIdentifier(crypto);\n        return new SubjectKeyIdentifierExtension(Convert.ToHex(id), critical);\n    }\n    constructor(...args) {\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n            const value = AsnConvert.parse(this.value, asn1X509.SubjectKeyIdentifier, this.parseOptions);\n            this.keyId = Convert.ToHex(value);\n        }\n        else {\n            const identifier = typeof args[0] === \"string\" ? Convert.FromHex(args[0]) : args[0];\n            const value = new asn1X509.SubjectKeyIdentifier(identifier);\n            super(asn1X509.id_ce_subjectKeyIdentifier, args[1], AsnConvert.serialize(value));\n            this.keyId = Convert.ToHex(identifier);\n        }\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        const asn = AsnConvert.parse(this.value, asn1X509.SubjectKeyIdentifier, this.parseOptions);\n        obj[\"\"] = asn;\n        return obj;\n    }\n}\nSubjectKeyIdentifierExtension.NAME = \"Subject Key Identifier\";\n\nclass SubjectAlternativeNameExtension extends Extension {\n    constructor(...args) {\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n        }\n        else {\n            super(asn1X509.id_ce_subjectAltName, args[1], new GeneralNames(args[0] || []).rawData);\n        }\n    }\n    onInit(asn) {\n        super.onInit(asn);\n        const value = AsnConvert.parse(asn.extnValue, asn1X509.SubjectAlternativeName, this.parseOptions);\n        this.names = new GeneralNames(value);\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        const namesObj = this.names.toTextObject();\n        for (const key in namesObj) {\n            obj[key] = namesObj[key];\n        }\n        return obj;\n    }\n}\nSubjectAlternativeNameExtension.NAME = \"Subject Alternative Name\";\n\nclass ExtensionFactory {\n    static register(id, type) {\n        this.items.set(id, type);\n    }\n    static create(data, options) {\n        const extension = new Extension(data, options);\n        const Type = this.items.get(extension.type);\n        if (Type) {\n            return new Type(data, options);\n        }\n        return extension;\n    }\n}\nExtensionFactory.items = new Map();\n\nclass CertificatePolicyExtension extends Extension {\n    constructor(...args) {\n        var _a;\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n            const asnPolicies = AsnConvert.parse(this.value, asn1X509.CertificatePolicies, this.parseOptions);\n            this.policies = asnPolicies.map((o) => o.policyIdentifier);\n        }\n        else {\n            const policies = args[0];\n            const critical = (_a = args[1]) !== null && _a !== void 0 ? _a : false;\n            const value = new asn1X509.CertificatePolicies(policies.map((o) => new asn1X509.PolicyInformation({ policyIdentifier: o })));\n            super(asn1X509.id_ce_certificatePolicies, critical, AsnConvert.serialize(value));\n            this.policies = policies;\n        }\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        obj[\"Policy\"] = this.policies.map((o) => new TextObject(\"\", {}, OidSerializer.toString(o)));\n        return obj;\n    }\n}\nCertificatePolicyExtension.NAME = \"Certificate Policies\";\nExtensionFactory.register(asn1X509.id_ce_certificatePolicies, CertificatePolicyExtension);\n\nclass CRLDistributionPointsExtension extends Extension {\n    constructor(...args) {\n        var _a;\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n        }\n        else if (Array.isArray(args[0]) && typeof args[0][0] === \"string\") {\n            const urls = args[0];\n            const dps = urls.map((url) => {\n                return new asn1X509.DistributionPoint({\n                    distributionPoint: new asn1X509.DistributionPointName({\n                        fullName: [new asn1X509.GeneralName({ uniformResourceIdentifier: url })],\n                    }),\n                });\n            });\n            const value = new asn1X509.CRLDistributionPoints(dps);\n            super(asn1X509.id_ce_cRLDistributionPoints, args[1], AsnConvert.serialize(value));\n        }\n        else {\n            const value = new asn1X509.CRLDistributionPoints(args[0]);\n            super(asn1X509.id_ce_cRLDistributionPoints, args[1], AsnConvert.serialize(value));\n        }\n        (_a = this.distributionPoints) !== null && _a !== void 0 ? _a : (this.distributionPoints = []);\n    }\n    onInit(asn) {\n        super.onInit(asn);\n        const crlExt = AsnConvert.parse(asn.extnValue, asn1X509.CRLDistributionPoints, this.parseOptions);\n        this.distributionPoints = crlExt;\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        obj[\"Distribution Point\"] = this.distributionPoints.map((dp) => {\n            var _a;\n            const dpObj = new TextObject(\"\");\n            if ((_a = dp.distributionPoint) === null || _a === void 0 ? void 0 : _a.fullName) {\n                dpObj[\"\"] = dp.distributionPoint.fullName\n                    .map((name) => new GeneralName(name).toString())\n                    .join(\", \");\n            }\n            if (dp.reasons) {\n                dpObj[\"Reasons\"] = dp.reasons.toString();\n            }\n            if (dp.cRLIssuer) {\n                dpObj[\"CRL Issuer\"] = dp.cRLIssuer.map((issuer) => issuer.toString()).join(\", \");\n            }\n            return dpObj;\n        });\n        return obj;\n    }\n}\nCRLDistributionPointsExtension.NAME = \"CRL Distribution Points\";\n\nclass AuthorityInfoAccessExtension extends Extension {\n    constructor(...args) {\n        var _a, _b, _c, _d;\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n        }\n        else if (args[0] instanceof asn1X509.AuthorityInfoAccessSyntax) {\n            const value = new asn1X509.AuthorityInfoAccessSyntax(args[0]);\n            super(asn1X509.id_pe_authorityInfoAccess, args[1], AsnConvert.serialize(value));\n        }\n        else {\n            const params = args[0];\n            const value = new asn1X509.AuthorityInfoAccessSyntax();\n            addAccessDescriptions(value, params, asn1X509.id_ad_ocsp, \"ocsp\");\n            addAccessDescriptions(value, params, asn1X509.id_ad_caIssuers, \"caIssuers\");\n            addAccessDescriptions(value, params, asn1X509.id_ad_timeStamping, \"timeStamping\");\n            addAccessDescriptions(value, params, asn1X509.id_ad_caRepository, \"caRepository\");\n            super(asn1X509.id_pe_authorityInfoAccess, args[1], AsnConvert.serialize(value));\n        }\n        (_a = this.ocsp) !== null && _a !== void 0 ? _a : (this.ocsp = []);\n        (_b = this.caIssuers) !== null && _b !== void 0 ? _b : (this.caIssuers = []);\n        (_c = this.timeStamping) !== null && _c !== void 0 ? _c : (this.timeStamping = []);\n        (_d = this.caRepository) !== null && _d !== void 0 ? _d : (this.caRepository = []);\n    }\n    onInit(asn) {\n        super.onInit(asn);\n        this.ocsp = [];\n        this.caIssuers = [];\n        this.timeStamping = [];\n        this.caRepository = [];\n        const aia = AsnConvert.parse(asn.extnValue, asn1X509.AuthorityInfoAccessSyntax, this.parseOptions);\n        aia.forEach((accessDescription) => {\n            switch (accessDescription.accessMethod) {\n                case asn1X509.id_ad_ocsp:\n                    this.ocsp.push(new GeneralName(accessDescription.accessLocation));\n                    break;\n                case asn1X509.id_ad_caIssuers:\n                    this.caIssuers.push(new GeneralName(accessDescription.accessLocation));\n                    break;\n                case asn1X509.id_ad_timeStamping:\n                    this.timeStamping.push(new GeneralName(accessDescription.accessLocation));\n                    break;\n                case asn1X509.id_ad_caRepository:\n                    this.caRepository.push(new GeneralName(accessDescription.accessLocation));\n                    break;\n            }\n        });\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        if (this.ocsp.length) {\n            addUrlsToObject(obj, \"OCSP\", this.ocsp);\n        }\n        if (this.caIssuers.length) {\n            addUrlsToObject(obj, \"CA Issuers\", this.caIssuers);\n        }\n        if (this.timeStamping.length) {\n            addUrlsToObject(obj, \"Time Stamping\", this.timeStamping);\n        }\n        if (this.caRepository.length) {\n            addUrlsToObject(obj, \"CA Repository\", this.caRepository);\n        }\n        return obj;\n    }\n}\nAuthorityInfoAccessExtension.NAME = \"Authority Info Access\";\nfunction addUrlsToObject(obj, key, urls) {\n    if (urls.length === 1) {\n        obj[key] = urls[0].toTextObject();\n    }\n    else {\n        const names = new TextObject(\"\");\n        urls.forEach((name, index) => {\n            const nameObj = name.toTextObject();\n            const indexedKey = `${nameObj[TextObject.NAME]} ${index + 1}`;\n            let field = names[indexedKey];\n            if (!Array.isArray(field)) {\n                field = [];\n                names[indexedKey] = field;\n            }\n            field.push(nameObj);\n        });\n        obj[key] = names;\n    }\n}\nfunction addAccessDescriptions(value, params, method, key) {\n    const items = params[key];\n    if (items) {\n        const array = Array.isArray(items) ? items : [items];\n        array.forEach((url) => {\n            if (typeof url === \"string\") {\n                url = new GeneralName(\"url\", url);\n            }\n            value.push(new asn1X509.AccessDescription({\n                accessMethod: method,\n                accessLocation: AsnConvert.parse(url.rawData, asn1X509.GeneralName),\n            }));\n        });\n    }\n}\n\nclass IssuerAlternativeNameExtension extends Extension {\n    constructor(...args) {\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n        }\n        else {\n            super(asn1X509.id_ce_issuerAltName, args[1], new GeneralNames(args[0] || []).rawData);\n        }\n    }\n    onInit(asn) {\n        super.onInit(asn);\n        const value = AsnConvert.parse(asn.extnValue, asn1X509.GeneralNames, this.parseOptions);\n        this.names = new GeneralNames(value);\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        const namesObj = this.names.toTextObject();\n        for (const key in namesObj) {\n            obj[key] = namesObj[key];\n        }\n        return obj;\n    }\n}\nIssuerAlternativeNameExtension.NAME = \"Issuer Alternative Name\";\n\nclass Attribute extends AsnData {\n    constructor(...args) {\n        let raw;\n        let options;\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            raw = BufferSourceConverter.toArrayBuffer(args[0]);\n            options = args[1];\n        }\n        else {\n            const type = args[0];\n            const values = Array.isArray(args[1])\n                ? args[1].map((o) => BufferSourceConverter.toArrayBuffer(o))\n                : [];\n            raw = AsnConvert.serialize(new Attribute$1({\n                type,\n                values,\n            }));\n        }\n        super(raw, Attribute$1, options);\n    }\n    onInit(asn) {\n        this.type = asn.type;\n        this.values = asn.values;\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        obj[\"Value\"] = this.values.map((o) => new TextObject(\"\", { \"\": o }));\n        return obj;\n    }\n    toTextObjectWithoutValue() {\n        const obj = this.toTextObjectEmpty();\n        if (obj[TextObject.NAME] === Attribute.NAME) {\n            obj[TextObject.NAME] = OidSerializer.toString(this.type);\n        }\n        return obj;\n    }\n}\nAttribute.NAME = \"Attribute\";\n\nclass ChallengePasswordAttribute extends Attribute {\n    constructor(...args) {\n        var _a;\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n        }\n        else {\n            const value = new asnPkcs9.ChallengePassword({ printableString: args[0] });\n            super(asnPkcs9.id_pkcs9_at_challengePassword, [AsnConvert.serialize(value)]);\n        }\n        (_a = this.password) !== null && _a !== void 0 ? _a : (this.password = \"\");\n    }\n    onInit(asn) {\n        super.onInit(asn);\n        if (this.values[0]) {\n            const value = AsnConvert.parse(this.values[0], asnPkcs9.ChallengePassword, this.parseOptions);\n            this.password = value.toString();\n        }\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        obj[TextObject.VALUE] = this.password;\n        return obj;\n    }\n}\nChallengePasswordAttribute.NAME = \"Challenge Password\";\n\nclass ExtensionsAttribute extends Attribute {\n    constructor(...args) {\n        var _a;\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            super(args[0], args[1]);\n        }\n        else {\n            const extensions = args[0];\n            const value = new asn1X509.Extensions();\n            for (const extension of extensions) {\n                value.push(AsnConvert.parse(extension.rawData, asn1X509.Extension));\n            }\n            super(asnPkcs9.id_pkcs9_at_extensionRequest, [AsnConvert.serialize(value)]);\n        }\n        (_a = this.items) !== null && _a !== void 0 ? _a : (this.items = []);\n    }\n    onInit(asn) {\n        super.onInit(asn);\n        if (this.values[0]) {\n            const value = AsnConvert.parse(this.values[0], asn1X509.Extensions, this.parseOptions);\n            this.items = value.map((o) => ExtensionFactory.create(AsnConvert.serialize(o), this.parseOptions));\n        }\n    }\n    toTextObject() {\n        const obj = this.toTextObjectWithoutValue();\n        const extensions = this.items.map((o) => o.toTextObject());\n        for (const extension of extensions) {\n            obj[extension[TextObject.NAME]] = extension;\n        }\n        return obj;\n    }\n}\nExtensionsAttribute.NAME = \"Extensions\";\n\nclass AttributeFactory {\n    static register(id, type) {\n        this.items.set(id, type);\n    }\n    static create(data, options) {\n        const attribute = new Attribute(data, options);\n        const Type = this.items.get(attribute.type);\n        if (Type) {\n            return new Type(data, options);\n        }\n        return attribute;\n    }\n}\nAttributeFactory.items = new Map();\n\nconst diAsnSignatureFormatter = \"crypto.signatureFormatter\";\nclass AsnDefaultSignatureFormatter {\n    toAsnSignature(algorithm, signature) {\n        return BufferSourceConverter.toArrayBuffer(signature);\n    }\n    toWebSignature(algorithm, signature) {\n        return BufferSourceConverter.toArrayBuffer(signature);\n    }\n}\n\nvar RsaAlgorithm_1;\nlet RsaAlgorithm = RsaAlgorithm_1 = class RsaAlgorithm {\n    static createPssParams(hash, saltLength) {\n        const hashAlgorithm = RsaAlgorithm_1.getHashAlgorithm(hash);\n        if (!hashAlgorithm) {\n            return null;\n        }\n        return new asn1Rsa.RsaSaPssParams({\n            hashAlgorithm,\n            maskGenAlgorithm: new AlgorithmIdentifier({\n                algorithm: asn1Rsa.id_mgf1,\n                parameters: AsnConvert.serialize(hashAlgorithm),\n            }),\n            saltLength,\n        });\n    }\n    static getHashAlgorithm(alg) {\n        const algProv = container.resolve(diAlgorithmProvider);\n        if (typeof alg === \"string\") {\n            return algProv.toAsnAlgorithm({ name: alg });\n        }\n        if (typeof alg === \"object\" && alg && \"name\" in alg) {\n            return algProv.toAsnAlgorithm(alg);\n        }\n        return null;\n    }\n    toAsnAlgorithm(alg) {\n        switch (alg.name.toLowerCase()) {\n            case \"rsassa-pkcs1-v1_5\":\n                if (\"hash\" in alg) {\n                    let hash;\n                    if (typeof alg.hash === \"string\") {\n                        hash = alg.hash;\n                    }\n                    else if (alg.hash &&\n                        typeof alg.hash === \"object\" &&\n                        \"name\" in alg.hash &&\n                        typeof alg.hash.name === \"string\") {\n                        hash = alg.hash.name.toUpperCase();\n                    }\n                    else {\n                        throw new Error(\"Cannot get hash algorithm name\");\n                    }\n                    switch (hash.toLowerCase()) {\n                        case \"sha-1\":\n                            return new AlgorithmIdentifier({\n                                algorithm: asn1Rsa.id_sha1WithRSAEncryption,\n                                parameters: null,\n                            });\n                        case \"sha-256\":\n                            return new AlgorithmIdentifier({\n                                algorithm: asn1Rsa.id_sha256WithRSAEncryption,\n                                parameters: null,\n                            });\n                        case \"sha-384\":\n                            return new AlgorithmIdentifier({\n                                algorithm: asn1Rsa.id_sha384WithRSAEncryption,\n                                parameters: null,\n                            });\n                        case \"sha-512\":\n                            return new AlgorithmIdentifier({\n                                algorithm: asn1Rsa.id_sha512WithRSAEncryption,\n                                parameters: null,\n                            });\n                    }\n                }\n                else {\n                    return new AlgorithmIdentifier({\n                        algorithm: asn1Rsa.id_rsaEncryption,\n                        parameters: null,\n                    });\n                }\n                break;\n            case \"rsa-pss\":\n                if (\"hash\" in alg) {\n                    if (!(\"saltLength\" in alg && typeof alg.saltLength === \"number\")) {\n                        throw new Error(\"Cannot get 'saltLength' from 'alg' argument\");\n                    }\n                    const pssParams = RsaAlgorithm_1.createPssParams(alg.hash, alg.saltLength);\n                    if (!pssParams) {\n                        throw new Error(\"Cannot create PSS parameters\");\n                    }\n                    return new AlgorithmIdentifier({\n                        algorithm: asn1Rsa.id_RSASSA_PSS,\n                        parameters: AsnConvert.serialize(pssParams),\n                    });\n                }\n                else {\n                    return new AlgorithmIdentifier({\n                        algorithm: asn1Rsa.id_RSASSA_PSS,\n                        parameters: null,\n                    });\n                }\n        }\n        return null;\n    }\n    toWebAlgorithm(alg) {\n        switch (alg.algorithm) {\n            case asn1Rsa.id_rsaEncryption:\n                return { name: \"RSASSA-PKCS1-v1_5\" };\n            case asn1Rsa.id_sha1WithRSAEncryption:\n                return {\n                    name: \"RSASSA-PKCS1-v1_5\",\n                    hash: { name: \"SHA-1\" },\n                };\n            case asn1Rsa.id_sha256WithRSAEncryption:\n                return {\n                    name: \"RSASSA-PKCS1-v1_5\",\n                    hash: { name: \"SHA-256\" },\n                };\n            case asn1Rsa.id_sha384WithRSAEncryption:\n                return {\n                    name: \"RSASSA-PKCS1-v1_5\",\n                    hash: { name: \"SHA-384\" },\n                };\n            case asn1Rsa.id_sha512WithRSAEncryption:\n                return {\n                    name: \"RSASSA-PKCS1-v1_5\",\n                    hash: { name: \"SHA-512\" },\n                };\n            case asn1Rsa.id_RSASSA_PSS:\n                if (alg.parameters) {\n                    const pssParams = AsnConvert.parse(alg.parameters, asn1Rsa.RsaSaPssParams);\n                    const algProv = container.resolve(diAlgorithmProvider);\n                    const hashAlg = algProv.toWebAlgorithm(pssParams.hashAlgorithm);\n                    return {\n                        name: \"RSA-PSS\",\n                        hash: hashAlg,\n                        saltLength: pssParams.saltLength,\n                    };\n                }\n                else {\n                    return { name: \"RSA-PSS\" };\n                }\n        }\n        return null;\n    }\n};\nRsaAlgorithm = RsaAlgorithm_1 = __decorate([\n    injectable()\n], RsaAlgorithm);\ncontainer.registerSingleton(diAlgorithm, RsaAlgorithm);\n\nlet ShaAlgorithm = class ShaAlgorithm {\n    toAsnAlgorithm(alg) {\n        switch (alg.name.toLowerCase()) {\n            case \"sha-1\":\n                return new AlgorithmIdentifier({ algorithm: id_sha1 });\n            case \"sha-256\":\n                return new AlgorithmIdentifier({ algorithm: id_sha256 });\n            case \"sha-384\":\n                return new AlgorithmIdentifier({ algorithm: id_sha384 });\n            case \"sha-512\":\n                return new AlgorithmIdentifier({ algorithm: id_sha512 });\n        }\n        return null;\n    }\n    toWebAlgorithm(alg) {\n        switch (alg.algorithm) {\n            case id_sha1:\n                return { name: \"SHA-1\" };\n            case id_sha256:\n                return { name: \"SHA-256\" };\n            case id_sha384:\n                return { name: \"SHA-384\" };\n            case id_sha512:\n                return { name: \"SHA-512\" };\n        }\n        return null;\n    }\n};\nShaAlgorithm = __decorate([\n    injectable()\n], ShaAlgorithm);\ncontainer.registerSingleton(diAlgorithm, ShaAlgorithm);\n\nclass AsnEcSignatureFormatter {\n    addPadding(pointSize, data) {\n        const bytes = BufferSourceConverter.toUint8Array(data);\n        const res = new Uint8Array(pointSize);\n        res.set(bytes, pointSize - bytes.length);\n        return res.buffer;\n    }\n    removePadding(data, positive = false) {\n        let bytes = BufferSourceConverter.toUint8Array(data);\n        for (let i = 0; i < bytes.length; i++) {\n            if (!bytes[i]) {\n                continue;\n            }\n            bytes = bytes.slice(i);\n            break;\n        }\n        if (positive && bytes[0] > 127) {\n            const result = new Uint8Array(bytes.length + 1);\n            result.set(bytes, 1);\n            return result.buffer;\n        }\n        return bytes.buffer;\n    }\n    toAsnSignature(algorithm, signature) {\n        if (algorithm.name === \"ECDSA\") {\n            const namedCurve = algorithm.namedCurve;\n            const pointSize = AsnEcSignatureFormatter.namedCurveSize.get(namedCurve) ||\n                AsnEcSignatureFormatter.defaultNamedCurveSize;\n            const ecSignature = new ECDSASigValue();\n            const uint8Signature = BufferSourceConverter.toUint8Array(signature);\n            ecSignature.r = this.removePadding(uint8Signature.slice(0, pointSize), true);\n            ecSignature.s = this.removePadding(uint8Signature.slice(pointSize, pointSize + pointSize), true);\n            return AsnConvert.serialize(ecSignature);\n        }\n        return null;\n    }\n    toWebSignature(algorithm, signature) {\n        if (algorithm.name === \"ECDSA\") {\n            const ecSigValue = AsnConvert.parse(signature, ECDSASigValue);\n            const namedCurve = algorithm.namedCurve;\n            const pointSize = AsnEcSignatureFormatter.namedCurveSize.get(namedCurve) ||\n                AsnEcSignatureFormatter.defaultNamedCurveSize;\n            const r = this.addPadding(pointSize, this.removePadding(ecSigValue.r));\n            const s = this.addPadding(pointSize, this.removePadding(ecSigValue.s));\n            return combine(r, s);\n        }\n        return null;\n    }\n}\nAsnEcSignatureFormatter.namedCurveSize = new Map();\nAsnEcSignatureFormatter.defaultNamedCurveSize = 32;\n\nconst idX25519 = \"1.3.101.110\";\nconst idX448 = \"1.3.101.111\";\nconst idEd25519 = \"1.3.101.112\";\nconst idEd448 = \"1.3.101.113\";\nlet EdAlgorithm = class EdAlgorithm {\n    toAsnAlgorithm(alg) {\n        let algorithm = null;\n        switch (alg.name.toLowerCase()) {\n            case \"ed25519\":\n                algorithm = idEd25519;\n                break;\n            case \"x25519\":\n                algorithm = idX25519;\n                break;\n            case \"eddsa\":\n                switch (alg.namedCurve.toLowerCase()) {\n                    case \"ed25519\":\n                        algorithm = idEd25519;\n                        break;\n                    case \"ed448\":\n                        algorithm = idEd448;\n                        break;\n                }\n                break;\n            case \"ecdh-es\":\n                switch (alg.namedCurve.toLowerCase()) {\n                    case \"x25519\":\n                        algorithm = idX25519;\n                        break;\n                    case \"x448\":\n                        algorithm = idX448;\n                        break;\n                }\n        }\n        if (algorithm) {\n            return new AlgorithmIdentifier({ algorithm });\n        }\n        return null;\n    }\n    toWebAlgorithm(alg) {\n        switch (alg.algorithm) {\n            case idEd25519:\n                return { name: \"Ed25519\" };\n            case idEd448:\n                return {\n                    name: \"EdDSA\",\n                    namedCurve: \"Ed448\",\n                };\n            case idX25519:\n                return { name: \"X25519\" };\n            case idX448:\n                return {\n                    name: \"ECDH-ES\",\n                    namedCurve: \"X448\",\n                };\n        }\n        return null;\n    }\n};\nEdAlgorithm = __decorate([\n    injectable()\n], EdAlgorithm);\ncontainer.registerSingleton(diAlgorithm, EdAlgorithm);\n\nlet MlDsaAlgorithm = class MlDsaAlgorithm {\n    toAsnAlgorithm(alg) {\n        let algorithm = null;\n        switch (alg.name.toLowerCase()) {\n            case \"ml-dsa-44\":\n                algorithm = id_ml_dsa_44;\n                break;\n            case \"ml-dsa-65\":\n                algorithm = id_ml_dsa_65;\n                break;\n            case \"ml-dsa-87\":\n                algorithm = id_ml_dsa_87;\n                break;\n        }\n        if (algorithm) {\n            return new AlgorithmIdentifier({ algorithm });\n        }\n        return null;\n    }\n    toWebAlgorithm(alg) {\n        switch (alg.algorithm) {\n            case id_ml_dsa_44:\n                return { name: \"ML-DSA-44\" };\n            case id_ml_dsa_65:\n                return { name: \"ML-DSA-65\" };\n            case id_ml_dsa_87:\n                return { name: \"ML-DSA-87\" };\n        }\n        return null;\n    }\n};\nMlDsaAlgorithm = __decorate([\n    injectable()\n], MlDsaAlgorithm);\ncontainer.registerSingleton(diAlgorithm, MlDsaAlgorithm);\n\nlet SlhDsaAlgorithm = class SlhDsaAlgorithm {\n    toAsnAlgorithm(alg) {\n        let algorithm = null;\n        switch (alg.name.toLowerCase()) {\n            case \"slh-dsa-sha2-128s\":\n                algorithm = id_slh_dsa_sha2_128s;\n                break;\n            case \"slh-dsa-sha2-128f\":\n                algorithm = id_slh_dsa_sha2_128f;\n                break;\n            case \"slh-dsa-sha2-192s\":\n                algorithm = id_slh_dsa_sha2_192s;\n                break;\n            case \"slh-dsa-sha2-192f\":\n                algorithm = id_slh_dsa_sha2_192f;\n                break;\n            case \"slh-dsa-sha2-256s\":\n                algorithm = id_slh_dsa_sha2_256s;\n                break;\n            case \"slh-dsa-sha2-256f\":\n                algorithm = id_slh_dsa_sha2_256f;\n                break;\n            case \"slh-dsa-shake-128s\":\n                algorithm = id_slh_dsa_shake_128s;\n                break;\n            case \"slh-dsa-shake-128f\":\n                algorithm = id_slh_dsa_shake_128f;\n                break;\n            case \"slh-dsa-shake-192s\":\n                algorithm = id_slh_dsa_shake_192s;\n                break;\n            case \"slh-dsa-shake-192f\":\n                algorithm = id_slh_dsa_shake_192f;\n                break;\n            case \"slh-dsa-shake-256s\":\n                algorithm = id_slh_dsa_shake_256s;\n                break;\n            case \"slh-dsa-shake-256f\":\n                algorithm = id_slh_dsa_shake_256f;\n                break;\n        }\n        if (algorithm) {\n            return new AlgorithmIdentifier({ algorithm });\n        }\n        return null;\n    }\n    toWebAlgorithm(alg) {\n        switch (alg.algorithm) {\n            case id_slh_dsa_sha2_128s:\n                return { name: \"SLH-DSA-SHA2-128s\" };\n            case id_slh_dsa_sha2_128f:\n                return { name: \"SLH-DSA-SHA2-128f\" };\n            case id_slh_dsa_sha2_192s:\n                return { name: \"SLH-DSA-SHA2-192s\" };\n            case id_slh_dsa_sha2_192f:\n                return { name: \"SLH-DSA-SHA2-192f\" };\n            case id_slh_dsa_sha2_256s:\n                return { name: \"SLH-DSA-SHA2-256s\" };\n            case id_slh_dsa_sha2_256f:\n                return { name: \"SLH-DSA-SHA2-256f\" };\n            case id_slh_dsa_shake_128s:\n                return { name: \"SLH-DSA-SHAKE-128s\" };\n            case id_slh_dsa_shake_128f:\n                return { name: \"SLH-DSA-SHAKE-128f\" };\n            case id_slh_dsa_shake_192s:\n                return { name: \"SLH-DSA-SHAKE-192s\" };\n            case id_slh_dsa_shake_192f:\n                return { name: \"SLH-DSA-SHAKE-192f\" };\n            case id_slh_dsa_shake_256s:\n                return { name: \"SLH-DSA-SHAKE-256s\" };\n            case id_slh_dsa_shake_256f:\n                return { name: \"SLH-DSA-SHAKE-256f\" };\n        }\n        return null;\n    }\n};\nSlhDsaAlgorithm = __decorate([\n    injectable()\n], SlhDsaAlgorithm);\ncontainer.registerSingleton(diAlgorithm, SlhDsaAlgorithm);\n\nvar _Pkcs10CertificateRequest_tbs, _Pkcs10CertificateRequest_subjectName, _Pkcs10CertificateRequest_subject, _Pkcs10CertificateRequest_signatureAlgorithm, _Pkcs10CertificateRequest_signature, _Pkcs10CertificateRequest_publicKey, _Pkcs10CertificateRequest_attributes, _Pkcs10CertificateRequest_extensions;\nclass Pkcs10CertificateRequest extends PemData {\n    get subjectName() {\n        if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_subjectName, \"f\")) {\n            __classPrivateFieldSet(this, _Pkcs10CertificateRequest_subjectName, new Name(this.asn.certificationRequestInfo.subject), \"f\");\n        }\n        return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_subjectName, \"f\");\n    }\n    get subject() {\n        if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_subject, \"f\")) {\n            __classPrivateFieldSet(this, _Pkcs10CertificateRequest_subject, this.subjectName.toString(), \"f\");\n        }\n        return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_subject, \"f\");\n    }\n    get signatureAlgorithm() {\n        if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_signatureAlgorithm, \"f\")) {\n            const algProv = container.resolve(diAlgorithmProvider);\n            __classPrivateFieldSet(this, _Pkcs10CertificateRequest_signatureAlgorithm, algProv.toWebAlgorithm(this.asn.signatureAlgorithm), \"f\");\n        }\n        return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_signatureAlgorithm, \"f\");\n    }\n    get signature() {\n        if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_signature, \"f\")) {\n            __classPrivateFieldSet(this, _Pkcs10CertificateRequest_signature, this.asn.signature, \"f\");\n        }\n        return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_signature, \"f\");\n    }\n    get publicKey() {\n        if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_publicKey, \"f\")) {\n            __classPrivateFieldSet(this, _Pkcs10CertificateRequest_publicKey, new PublicKey(this.asn.certificationRequestInfo.subjectPKInfo, this.parseOptions), \"f\");\n        }\n        return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_publicKey, \"f\");\n    }\n    get attributes() {\n        if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_attributes, \"f\")) {\n            __classPrivateFieldSet(this, _Pkcs10CertificateRequest_attributes, this.asn.certificationRequestInfo.attributes.map((o) => AttributeFactory.create(AsnConvert.serialize(o), this.parseOptions)), \"f\");\n        }\n        return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_attributes, \"f\");\n    }\n    get extensions() {\n        if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_extensions, \"f\")) {\n            __classPrivateFieldSet(this, _Pkcs10CertificateRequest_extensions, [], \"f\");\n            const extensions = this.getAttribute(id_pkcs9_at_extensionRequest);\n            if (extensions instanceof ExtensionsAttribute) {\n                __classPrivateFieldSet(this, _Pkcs10CertificateRequest_extensions, extensions.items, \"f\");\n            }\n        }\n        return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_extensions, \"f\");\n    }\n    get tbs() {\n        if (!__classPrivateFieldGet(this, _Pkcs10CertificateRequest_tbs, \"f\")) {\n            __classPrivateFieldSet(this, _Pkcs10CertificateRequest_tbs, this.asn.certificationRequestInfoRaw ||\n                AsnConvert.serialize(this.asn.certificationRequestInfo), \"f\");\n        }\n        return __classPrivateFieldGet(this, _Pkcs10CertificateRequest_tbs, \"f\");\n    }\n    constructor(param, options) {\n        const args = PemData.isAsnEncoded(param)\n            ? [param, CertificationRequest, options]\n            : [param, options];\n        super(args[0], args[1], args[2]);\n        _Pkcs10CertificateRequest_tbs.set(this, void 0);\n        _Pkcs10CertificateRequest_subjectName.set(this, void 0);\n        _Pkcs10CertificateRequest_subject.set(this, void 0);\n        _Pkcs10CertificateRequest_signatureAlgorithm.set(this, void 0);\n        _Pkcs10CertificateRequest_signature.set(this, void 0);\n        _Pkcs10CertificateRequest_publicKey.set(this, void 0);\n        _Pkcs10CertificateRequest_attributes.set(this, void 0);\n        _Pkcs10CertificateRequest_extensions.set(this, void 0);\n        this.tag = PemConverter.CertificateRequestTag;\n    }\n    onInit(_asn) {\n    }\n    getAttribute(type) {\n        for (const attr of this.attributes) {\n            if (attr.type === type) {\n                return attr;\n            }\n        }\n        return null;\n    }\n    getAttributes(type) {\n        return this.attributes.filter((o) => o.type === type);\n    }\n    getExtension(type) {\n        for (const ext of this.extensions) {\n            if (ext.type === type) {\n                return ext;\n            }\n        }\n        return null;\n    }\n    getExtensions(type) {\n        return this.extensions.filter((o) => o.type === type);\n    }\n    async verify(crypto = cryptoProvider.get()) {\n        const algorithm = {\n            ...this.publicKey.algorithm,\n            ...this.signatureAlgorithm,\n        };\n        const publicKey = await this.publicKey.export(algorithm, [\"verify\"], crypto);\n        const signatureFormatters = container\n            .resolveAll(diAsnSignatureFormatter)\n            .reverse();\n        let signature = null;\n        for (const signatureFormatter of signatureFormatters) {\n            signature = signatureFormatter.toWebSignature(algorithm, this.signature);\n            if (signature) {\n                break;\n            }\n        }\n        if (!signature) {\n            throw Error(\"Cannot convert WebCrypto signature value to ASN.1 format\");\n        }\n        const ok = await crypto.subtle.verify(this.signatureAlgorithm, publicKey, signature, this.tbs);\n        return ok;\n    }\n    toTextObject() {\n        const obj = this.toTextObjectEmpty();\n        const req = AsnConvert.parse(this.rawData, CertificationRequest, this.parseOptions);\n        const tbs = req.certificationRequestInfo;\n        const data = new TextObject(\"\", {\n            Version: `${Version[tbs.version]} (${tbs.version})`,\n            Subject: this.subject,\n            \"Subject Public Key Info\": this.publicKey,\n        });\n        if (this.attributes.length) {\n            const attrs = new TextObject(\"\");\n            for (const ext of this.attributes) {\n                const attrObj = ext.toTextObject();\n                attrs[attrObj[TextObject.NAME]] = attrObj;\n            }\n            data[\"Attributes\"] = attrs;\n        }\n        obj[\"Data\"] = data;\n        obj[\"Signature\"] = new TextObject(\"\", {\n            Algorithm: TextConverter.serializeAlgorithm(req.signatureAlgorithm),\n            \"\": req.signature,\n        });\n        return obj;\n    }\n}\n_Pkcs10CertificateRequest_tbs = new WeakMap(), _Pkcs10CertificateRequest_subjectName = new WeakMap(), _Pkcs10CertificateRequest_subject = new WeakMap(), _Pkcs10CertificateRequest_signatureAlgorithm = new WeakMap(), _Pkcs10CertificateRequest_signature = new WeakMap(), _Pkcs10CertificateRequest_publicKey = new WeakMap(), _Pkcs10CertificateRequest_attributes = new WeakMap(), _Pkcs10CertificateRequest_extensions = new WeakMap();\nPkcs10CertificateRequest.NAME = \"PKCS#10 Certificate Request\";\n\nclass Pkcs10CertificateRequestGenerator {\n    static async create(params, crypto = cryptoProvider.get()) {\n        if (!params.keys.privateKey) {\n            throw new Error(\"Bad field 'keys' in 'params' argument. 'privateKey' is empty\");\n        }\n        if (!params.keys.publicKey) {\n            throw new Error(\"Bad field 'keys' in 'params' argument. 'publicKey' is empty\");\n        }\n        const spki = await crypto.subtle.exportKey(\"spki\", params.keys.publicKey);\n        const asnReq = new CertificationRequest({\n            certificationRequestInfo: new CertificationRequestInfo({\n                subjectPKInfo: AsnConvert.parse(spki, SubjectPublicKeyInfo),\n            }),\n        });\n        if (params.name) {\n            const name = params.name instanceof Name ? params.name : new Name(params.name);\n            asnReq.certificationRequestInfo.subject = AsnConvert.parse(name.toArrayBuffer(), Name$1);\n        }\n        if (params.attributes) {\n            for (const o of params.attributes) {\n                asnReq.certificationRequestInfo.attributes.push(AsnConvert.parse(o.rawData, Attribute$1));\n            }\n        }\n        if (params.extensions && params.extensions.length) {\n            const attr = new Attribute$1({ type: id_pkcs9_at_extensionRequest });\n            const extensions = new Extensions();\n            for (const o of params.extensions) {\n                extensions.push(AsnConvert.parse(o.rawData, Extension$1));\n            }\n            attr.values.push(AsnConvert.serialize(extensions));\n            asnReq.certificationRequestInfo.attributes.push(attr);\n        }\n        const signingAlgorithm = {\n            ...params.signingAlgorithm,\n            ...params.keys.privateKey.algorithm,\n        };\n        const algProv = container.resolve(diAlgorithmProvider);\n        asnReq.signatureAlgorithm = algProv.toAsnAlgorithm(signingAlgorithm);\n        const tbs = AsnConvert.serialize(asnReq.certificationRequestInfo);\n        const signature = await crypto.subtle.sign(signingAlgorithm, params.keys.privateKey, tbs);\n        const signatureFormatters = container\n            .resolveAll(diAsnSignatureFormatter)\n            .reverse();\n        let asnSignature = null;\n        for (const signatureFormatter of signatureFormatters) {\n            asnSignature = signatureFormatter.toAsnSignature(signingAlgorithm, signature);\n            if (asnSignature) {\n                break;\n            }\n        }\n        if (!asnSignature) {\n            throw Error(\"Cannot convert WebCrypto signature value to ASN.1 format\");\n        }\n        asnReq.signature = asnSignature;\n        return new Pkcs10CertificateRequest(AsnConvert.serialize(asnReq));\n    }\n}\n\nfunction toPositiveIntegerOctets(input) {\n    let firstNonZero = 0;\n    while (firstNonZero < input.length - 1 && input[firstNonZero] === 0) {\n        firstNonZero++;\n    }\n    let serialNumber = input.slice(firstNonZero);\n    if (!serialNumber.length) {\n        serialNumber = new Uint8Array([0x00]);\n    }\n    if (serialNumber[0] > 0x7f) {\n        const newSerialNumber = new Uint8Array(serialNumber.length + 1);\n        newSerialNumber[0] = 0x00;\n        newSerialNumber.set(serialNumber, 1);\n        serialNumber = newSerialNumber;\n    }\n    return serialNumber.buffer;\n}\nfunction normalizeCertificateSerialNumber(input) {\n    return toPositiveIntegerOctets(BufferSourceConverter.toUint8Array(Convert.FromHex(input || \"\")));\n}\nfunction generateCertificateSerialNumber(input, crypto = cryptoProvider.get()) {\n    const inputView = BufferSourceConverter.toUint8Array(Convert.FromHex(input || \"\"));\n    const serialNumber = inputView.length && inputView.some((o) => o > 0)\n        ? inputView\n        : crypto.getRandomValues(new Uint8Array(16));\n    return toPositiveIntegerOctets(serialNumber);\n}\nfunction getCertificateSerialNumber(raw) {\n    let serialNumber = BufferSourceConverter.toUint8Array(raw);\n    if (serialNumber.length > 1 && serialNumber[0] === 0x00 && serialNumber[1] > 0x7f) {\n        serialNumber = serialNumber.slice(1);\n    }\n    return Convert.ToHex(serialNumber);\n}\n\nvar _X509Certificate_tbs, _X509Certificate_serialNumber, _X509Certificate_subjectName, _X509Certificate_subject, _X509Certificate_issuerName, _X509Certificate_issuer, _X509Certificate_notBefore, _X509Certificate_notAfter, _X509Certificate_signatureAlgorithm, _X509Certificate_signature, _X509Certificate_extensions, _X509Certificate_publicKey;\nclass X509Certificate extends PemData {\n    get publicKey() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_publicKey, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_publicKey, new PublicKey(this.asn.tbsCertificate.subjectPublicKeyInfo, this.parseOptions), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_publicKey, \"f\");\n    }\n    get serialNumber() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_serialNumber, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_serialNumber, getCertificateSerialNumber(this.asn.tbsCertificate.serialNumber), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_serialNumber, \"f\");\n    }\n    get subjectName() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_subjectName, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_subjectName, new Name(this.asn.tbsCertificate.subject), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_subjectName, \"f\");\n    }\n    get subject() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_subject, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_subject, this.subjectName.toString(), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_subject, \"f\");\n    }\n    get issuerName() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_issuerName, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_issuerName, new Name(this.asn.tbsCertificate.issuer), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_issuerName, \"f\");\n    }\n    get issuer() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_issuer, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_issuer, this.issuerName.toString(), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_issuer, \"f\");\n    }\n    get notBefore() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_notBefore, \"f\")) {\n            const notBefore = this.asn.tbsCertificate.validity.notBefore.utcTime ||\n                this.asn.tbsCertificate.validity.notBefore.generalTime;\n            if (!notBefore) {\n                throw new Error(\"Cannot get 'notBefore' value\");\n            }\n            __classPrivateFieldSet(this, _X509Certificate_notBefore, notBefore, \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_notBefore, \"f\");\n    }\n    get notAfter() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_notAfter, \"f\")) {\n            const notAfter = this.asn.tbsCertificate.validity.notAfter.utcTime ||\n                this.asn.tbsCertificate.validity.notAfter.generalTime;\n            if (!notAfter) {\n                throw new Error(\"Cannot get 'notAfter' value\");\n            }\n            __classPrivateFieldSet(this, _X509Certificate_notAfter, notAfter, \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_notAfter, \"f\");\n    }\n    get signatureAlgorithm() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_signatureAlgorithm, \"f\")) {\n            const algProv = container.resolve(diAlgorithmProvider);\n            __classPrivateFieldSet(this, _X509Certificate_signatureAlgorithm, algProv.toWebAlgorithm(this.asn.signatureAlgorithm), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_signatureAlgorithm, \"f\");\n    }\n    get signature() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_signature, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_signature, this.asn.signatureValue, \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_signature, \"f\");\n    }\n    get extensions() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_extensions, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_extensions, [], \"f\");\n            if (this.asn.tbsCertificate.extensions) {\n                __classPrivateFieldSet(this, _X509Certificate_extensions, this.asn.tbsCertificate.extensions.map((o) => ExtensionFactory.create(AsnConvert.serialize(o), this.parseOptions)), \"f\");\n            }\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_extensions, \"f\");\n    }\n    get tbs() {\n        if (!__classPrivateFieldGet(this, _X509Certificate_tbs, \"f\")) {\n            __classPrivateFieldSet(this, _X509Certificate_tbs, this.asn.tbsCertificateRaw || AsnConvert.serialize(this.asn.tbsCertificate), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Certificate_tbs, \"f\");\n    }\n    constructor(param, options) {\n        const args = PemData.isAsnEncoded(param) ? [param, Certificate, options] : [param, options];\n        super(args[0], args[1], args[2]);\n        _X509Certificate_tbs.set(this, void 0);\n        _X509Certificate_serialNumber.set(this, void 0);\n        _X509Certificate_subjectName.set(this, void 0);\n        _X509Certificate_subject.set(this, void 0);\n        _X509Certificate_issuerName.set(this, void 0);\n        _X509Certificate_issuer.set(this, void 0);\n        _X509Certificate_notBefore.set(this, void 0);\n        _X509Certificate_notAfter.set(this, void 0);\n        _X509Certificate_signatureAlgorithm.set(this, void 0);\n        _X509Certificate_signature.set(this, void 0);\n        _X509Certificate_extensions.set(this, void 0);\n        _X509Certificate_publicKey.set(this, void 0);\n        this.tag = PemConverter.CertificateTag;\n    }\n    onInit(_asn) {\n    }\n    getExtension(type) {\n        for (const ext of this.extensions) {\n            if (typeof type === \"string\") {\n                if (ext.type === type) {\n                    return ext;\n                }\n            }\n            else {\n                if (ext instanceof type) {\n                    return ext;\n                }\n            }\n        }\n        return null;\n    }\n    getExtensions(type) {\n        return this.extensions.filter((o) => {\n            if (typeof type === \"string\") {\n                return o.type === type;\n            }\n            else {\n                return o instanceof type;\n            }\n        });\n    }\n    async verify(params = {}, crypto = cryptoProvider.get()) {\n        let keyAlgorithm;\n        let publicKey;\n        const paramsKey = params.publicKey;\n        try {\n            if (!paramsKey) {\n                keyAlgorithm = {\n                    ...this.publicKey.algorithm,\n                    ...this.signatureAlgorithm,\n                };\n                publicKey = await this.publicKey.export(keyAlgorithm, [\"verify\"], crypto);\n            }\n            else if (\"publicKey\" in paramsKey) {\n                keyAlgorithm = {\n                    ...paramsKey.publicKey.algorithm,\n                    ...this.signatureAlgorithm,\n                };\n                publicKey = await paramsKey.publicKey.export(keyAlgorithm, [\"verify\"], crypto);\n            }\n            else if (paramsKey instanceof PublicKey) {\n                keyAlgorithm = {\n                    ...paramsKey.algorithm,\n                    ...this.signatureAlgorithm,\n                };\n                publicKey = await paramsKey.export(keyAlgorithm, [\"verify\"], crypto);\n            }\n            else if (BufferSourceConverter.isBufferSource(paramsKey)) {\n                const key = new PublicKey(paramsKey);\n                keyAlgorithm = {\n                    ...key.algorithm,\n                    ...this.signatureAlgorithm,\n                };\n                publicKey = await key.export(keyAlgorithm, [\"verify\"], crypto);\n            }\n            else {\n                keyAlgorithm = {\n                    ...paramsKey.algorithm,\n                    ...this.signatureAlgorithm,\n                };\n                publicKey = paramsKey;\n            }\n        }\n        catch {\n            return false;\n        }\n        const signatureFormatters = container\n            .resolveAll(diAsnSignatureFormatter)\n            .reverse();\n        let signature = null;\n        for (const signatureFormatter of signatureFormatters) {\n            signature = signatureFormatter.toWebSignature(keyAlgorithm, this.signature);\n            if (signature) {\n                break;\n            }\n        }\n        if (!signature) {\n            throw Error(\"Cannot convert ASN.1 signature value to WebCrypto format\");\n        }\n        const ok = await crypto.subtle.verify(this.signatureAlgorithm, publicKey, signature, this.tbs);\n        if (params.signatureOnly) {\n            return ok;\n        }\n        else {\n            const date = params.date || new Date();\n            const time = date.getTime();\n            return ok && this.notBefore.getTime() < time && time < this.notAfter.getTime();\n        }\n    }\n    async getThumbprint(arg1, arg2) {\n        let crypto;\n        let algorithm = \"SHA-1\";\n        if (arg1) {\n            if (typeof arg1 === \"object\" && \"subtle\" in arg1) {\n                crypto = arg1;\n            }\n            else {\n                algorithm = arg1;\n                crypto = arg2;\n            }\n        }\n        crypto !== null && crypto !== void 0 ? crypto : (crypto = cryptoProvider.get());\n        return await crypto.subtle.digest(algorithm, this.rawData);\n    }\n    async isSelfSigned(crypto = cryptoProvider.get()) {\n        return this.subject === this.issuer && (await this.verify({ signatureOnly: true }, crypto));\n    }\n    toTextObject() {\n        const obj = this.toTextObjectEmpty();\n        const cert = AsnConvert.parse(this.rawData, Certificate, this.parseOptions);\n        const tbs = cert.tbsCertificate;\n        const data = new TextObject(\"\", {\n            Version: `${Version[tbs.version]} (${tbs.version})`,\n            \"Serial Number\": tbs.serialNumber,\n            \"Signature Algorithm\": TextConverter.serializeAlgorithm(tbs.signature),\n            Issuer: this.issuer,\n            Validity: new TextObject(\"\", {\n                \"Not Before\": tbs.validity.notBefore.getTime(),\n                \"Not After\": tbs.validity.notAfter.getTime(),\n            }),\n            Subject: this.subject,\n            \"Subject Public Key Info\": this.publicKey,\n        });\n        if (tbs.issuerUniqueID) {\n            data[\"Issuer Unique ID\"] = tbs.issuerUniqueID;\n        }\n        if (tbs.subjectUniqueID) {\n            data[\"Subject Unique ID\"] = tbs.subjectUniqueID;\n        }\n        if (this.extensions.length) {\n            const extensions = new TextObject(\"\");\n            for (const ext of this.extensions) {\n                const extObj = ext.toTextObject();\n                extensions[extObj[TextObject.NAME]] = extObj;\n            }\n            data[\"Extensions\"] = extensions;\n        }\n        obj[\"Data\"] = data;\n        obj[\"Signature\"] = new TextObject(\"\", {\n            Algorithm: TextConverter.serializeAlgorithm(cert.signatureAlgorithm),\n            \"\": cert.signatureValue,\n        });\n        return obj;\n    }\n}\n_X509Certificate_tbs = new WeakMap(), _X509Certificate_serialNumber = new WeakMap(), _X509Certificate_subjectName = new WeakMap(), _X509Certificate_subject = new WeakMap(), _X509Certificate_issuerName = new WeakMap(), _X509Certificate_issuer = new WeakMap(), _X509Certificate_notBefore = new WeakMap(), _X509Certificate_notAfter = new WeakMap(), _X509Certificate_signatureAlgorithm = new WeakMap(), _X509Certificate_signature = new WeakMap(), _X509Certificate_extensions = new WeakMap(), _X509Certificate_publicKey = new WeakMap();\nX509Certificate.NAME = \"Certificate\";\n\nvar _X509Certificates_options;\nclass X509Certificates extends Array {\n    constructor(param, options) {\n        super();\n        _X509Certificates_options.set(this, void 0);\n        if (PemData.isAsnEncoded(param)) {\n            this.import(param, options);\n        }\n        else if (param instanceof X509Certificate) {\n            this.push(param);\n        }\n        else if (Array.isArray(param)) {\n            for (const item of param) {\n                this.push(item);\n            }\n        }\n    }\n    export(format) {\n        const signedData = new asn1Cms.SignedData();\n        signedData.version = 1;\n        signedData.encapContentInfo.eContentType = asn1Cms.id_data;\n        signedData.encapContentInfo.eContent = new asn1Cms.EncapsulatedContent({\n            single: new OctetString(),\n        });\n        signedData.certificates = new asn1Cms.CertificateSet(this.map((o) => new asn1Cms.CertificateChoices({\n            certificate: AsnConvert.parse(o.rawData, Certificate, __classPrivateFieldGet(this, _X509Certificates_options, \"f\")),\n        })));\n        const cms = new asn1Cms.ContentInfo({\n            contentType: asn1Cms.id_signedData,\n            content: AsnConvert.serialize(signedData),\n        });\n        const raw = AsnConvert.serialize(cms);\n        if (format === \"raw\") {\n            return raw;\n        }\n        return this.toString(format);\n    }\n    import(data, options) {\n        const raw = PemData.toArrayBuffer(data);\n        const cms = AsnConvert.parse(raw, asn1Cms.ContentInfo, options);\n        if (cms.contentType !== asn1Cms.id_signedData) {\n            throw new TypeError(\"Cannot parse CMS package. Incoming data is not a SignedData object.\");\n        }\n        const signedData = AsnConvert.parse(cms.content, asn1Cms.SignedData, options);\n        const certificates = [];\n        for (const item of signedData.certificates || []) {\n            if (item.certificate) {\n                certificates.push(new X509Certificate(item.certificate, options));\n            }\n        }\n        this.clear();\n        for (const certificate of certificates) {\n            this.push(certificate);\n        }\n        __classPrivateFieldSet(this, _X509Certificates_options, options, \"f\");\n    }\n    clear() {\n        while (this.pop()) {\n        }\n    }\n    toString(format = \"pem\") {\n        const raw = this.export(\"raw\");\n        switch (format) {\n            case \"pem\":\n                return PemConverter.encode(raw, \"CMS\");\n            case \"pem-chain\":\n                return this.map((o) => o.toString(\"pem\")).join(\"\\n\");\n            case \"asn\":\n                return AsnConvert.toString(raw, __classPrivateFieldGet(this, _X509Certificates_options, \"f\"));\n            case \"hex\":\n                return Convert.ToHex(raw);\n            case \"base64\":\n                return Convert.ToBase64(raw);\n            case \"base64url\":\n                return Convert.ToBase64Url(raw);\n            case \"text\":\n                return TextConverter.serialize(this.toTextObject());\n            default:\n                throw TypeError(\"Argument 'format' is unsupported value\");\n        }\n    }\n    toTextObject() {\n        const contentInfo = AsnConvert.parse(this.export(\"raw\"), asn1Cms.ContentInfo, __classPrivateFieldGet(this, _X509Certificates_options, \"f\"));\n        const signedData = AsnConvert.parse(contentInfo.content, asn1Cms.SignedData, __classPrivateFieldGet(this, _X509Certificates_options, \"f\"));\n        const obj = new TextObject(\"X509Certificates\", {\n            \"Content Type\": OidSerializer.toString(contentInfo.contentType),\n            Content: new TextObject(\"\", {\n                Version: `${asn1Cms.CMSVersion[signedData.version]} (${signedData.version})`,\n                Certificates: new TextObject(\"\", { Certificate: this.map((o) => o.toTextObject()) }),\n            }),\n        });\n        return obj;\n    }\n}\n_X509Certificates_options = new WeakMap();\n\nclass X509ChainBuilder {\n    constructor(params = {}) {\n        this.certificates = [];\n        if (params.certificates) {\n            this.certificates = params.certificates;\n        }\n    }\n    async build(cert, crypto = cryptoProvider.get()) {\n        const chain = new X509Certificates(cert);\n        let current = cert;\n        while ((current = await this.findIssuer(current, crypto))) {\n            const thumbprint = await current.getThumbprint(crypto);\n            for (const item of chain) {\n                const thumbprint2 = await item.getThumbprint(crypto);\n                if (isEqual(thumbprint, thumbprint2)) {\n                    throw new Error(\"Cannot build a certificate chain. Circular dependency.\");\n                }\n            }\n            chain.push(current);\n        }\n        return chain;\n    }\n    async findIssuer(cert, crypto = cryptoProvider.get()) {\n        if (!(await cert.isSelfSigned(crypto))) {\n            const akiExt = cert.getExtension(asn1X509.id_ce_authorityKeyIdentifier);\n            for (const item of this.certificates) {\n                if (item.subject !== cert.issuer) {\n                    continue;\n                }\n                if (akiExt) {\n                    if (akiExt.keyId) {\n                        const skiExt = item.getExtension(asn1X509.id_ce_subjectKeyIdentifier);\n                        if (skiExt && skiExt.keyId !== akiExt.keyId) {\n                            continue;\n                        }\n                    }\n                    else if (akiExt.certId) {\n                        const sanExt = item.getExtension(asn1X509.id_ce_subjectAltName);\n                        if (sanExt &&\n                            !(akiExt.certId.serialNumber === item.serialNumber &&\n                                isEqual(AsnConvert.serialize(akiExt.certId.name), AsnConvert.serialize(sanExt)))) {\n                            continue;\n                        }\n                    }\n                }\n                try {\n                    const algorithm = {\n                        ...item.publicKey.algorithm,\n                        ...cert.signatureAlgorithm,\n                    };\n                    const publicKey = await item.publicKey.export(algorithm, [\"verify\"], crypto);\n                    const ok = await cert.verify({\n                        publicKey,\n                        signatureOnly: true,\n                    }, crypto);\n                    if (!ok) {\n                        continue;\n                    }\n                }\n                catch {\n                    continue;\n                }\n                return item;\n            }\n        }\n        return null;\n    }\n}\n\nclass X509CertificateGenerator {\n    static async createSelfSigned(params, crypto = cryptoProvider.get()) {\n        if (!params.keys.privateKey) {\n            throw new Error(\"Bad field 'keys' in 'params' argument. 'privateKey' is empty\");\n        }\n        if (!params.keys.publicKey) {\n            throw new Error(\"Bad field 'keys' in 'params' argument. 'publicKey' is empty\");\n        }\n        return this.create({\n            serialNumber: params.serialNumber,\n            subject: params.name,\n            issuer: params.name,\n            notBefore: params.notBefore,\n            notAfter: params.notAfter,\n            publicKey: params.keys.publicKey,\n            signingKey: params.keys.privateKey,\n            signingAlgorithm: params.signingAlgorithm,\n            extensions: params.extensions,\n        }, crypto);\n    }\n    static async create(params, crypto = cryptoProvider.get()) {\n        var _a;\n        let spki;\n        if (params.publicKey instanceof PublicKey) {\n            spki = params.publicKey.rawData;\n        }\n        else if (\"publicKey\" in params.publicKey) {\n            spki = params.publicKey.publicKey.rawData;\n        }\n        else if (BufferSourceConverter.isBufferSource(params.publicKey)) {\n            spki = params.publicKey;\n        }\n        else {\n            spki = await crypto.subtle.exportKey(\"spki\", params.publicKey);\n        }\n        const serialNumber = generateCertificateSerialNumber(params.serialNumber, crypto);\n        const notBefore = params.notBefore || new Date();\n        const notAfter = params.notAfter || new Date(notBefore.getTime() + 31536000000);\n        const asnX509 = new asn1X509.Certificate({\n            tbsCertificate: new asn1X509.TBSCertificate({\n                version: asn1X509.Version.v3,\n                serialNumber,\n                validity: new asn1X509.Validity({\n                    notBefore,\n                    notAfter,\n                }),\n                extensions: new asn1X509.Extensions(((_a = params.extensions) === null || _a === void 0 ? void 0 : _a.map((o) => AsnConvert.parse(o.rawData, asn1X509.Extension))) || []),\n                subjectPublicKeyInfo: AsnConvert.parse(spki, asn1X509.SubjectPublicKeyInfo),\n            }),\n        });\n        if (params.subject) {\n            const name = params.subject instanceof Name ? params.subject : new Name(params.subject);\n            asnX509.tbsCertificate.subject = AsnConvert.parse(name.toArrayBuffer(), asn1X509.Name);\n        }\n        if (params.issuer) {\n            const name = params.issuer instanceof Name ? params.issuer : new Name(params.issuer);\n            asnX509.tbsCertificate.issuer = AsnConvert.parse(name.toArrayBuffer(), asn1X509.Name);\n        }\n        const defaultSigningAlgorithm = { hash: \"SHA-256\" };\n        const signatureAlgorithm = \"signingKey\" in params\n            ? {\n                ...defaultSigningAlgorithm,\n                ...params.signingAlgorithm,\n                ...params.signingKey.algorithm,\n            }\n            : {\n                ...defaultSigningAlgorithm,\n                ...params.signingAlgorithm,\n            };\n        const algProv = container.resolve(diAlgorithmProvider);\n        asnX509.tbsCertificate.signature = asnX509.signatureAlgorithm =\n            algProv.toAsnAlgorithm(signatureAlgorithm);\n        const tbs = AsnConvert.serialize(asnX509.tbsCertificate);\n        const signatureValue = \"signingKey\" in params\n            ?\n                await crypto.subtle.sign(signatureAlgorithm, params.signingKey, tbs)\n            :\n                params.signature;\n        const signatureFormatters = container\n            .resolveAll(diAsnSignatureFormatter)\n            .reverse();\n        let asnSignature = null;\n        for (const signatureFormatter of signatureFormatters) {\n            asnSignature = signatureFormatter.toAsnSignature(signatureAlgorithm, signatureValue);\n            if (asnSignature) {\n                break;\n            }\n        }\n        if (!asnSignature) {\n            throw Error(\"Cannot convert ASN.1 signature value to WebCrypto format\");\n        }\n        asnX509.signatureValue = asnSignature;\n        return new X509Certificate(AsnConvert.serialize(asnX509));\n    }\n}\n\nvar _X509CrlEntry_serialNumber, _X509CrlEntry_revocationDate, _X509CrlEntry_reason, _X509CrlEntry_invalidity, _X509CrlEntry_extensions;\nvar X509CrlReason;\n(function (X509CrlReason) {\n    X509CrlReason[X509CrlReason[\"unspecified\"] = 0] = \"unspecified\";\n    X509CrlReason[X509CrlReason[\"keyCompromise\"] = 1] = \"keyCompromise\";\n    X509CrlReason[X509CrlReason[\"cACompromise\"] = 2] = \"cACompromise\";\n    X509CrlReason[X509CrlReason[\"affiliationChanged\"] = 3] = \"affiliationChanged\";\n    X509CrlReason[X509CrlReason[\"superseded\"] = 4] = \"superseded\";\n    X509CrlReason[X509CrlReason[\"cessationOfOperation\"] = 5] = \"cessationOfOperation\";\n    X509CrlReason[X509CrlReason[\"certificateHold\"] = 6] = \"certificateHold\";\n    X509CrlReason[X509CrlReason[\"removeFromCRL\"] = 8] = \"removeFromCRL\";\n    X509CrlReason[X509CrlReason[\"privilegeWithdrawn\"] = 9] = \"privilegeWithdrawn\";\n    X509CrlReason[X509CrlReason[\"aACompromise\"] = 10] = \"aACompromise\";\n})(X509CrlReason || (X509CrlReason = {}));\nclass X509CrlEntry extends AsnData {\n    get serialNumber() {\n        if (!__classPrivateFieldGet(this, _X509CrlEntry_serialNumber, \"f\")) {\n            __classPrivateFieldSet(this, _X509CrlEntry_serialNumber, getCertificateSerialNumber(this.asn.userCertificate), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509CrlEntry_serialNumber, \"f\");\n    }\n    get revocationDate() {\n        if (!__classPrivateFieldGet(this, _X509CrlEntry_revocationDate, \"f\")) {\n            __classPrivateFieldSet(this, _X509CrlEntry_revocationDate, this.asn.revocationDate.getTime(), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509CrlEntry_revocationDate, \"f\");\n    }\n    get reason() {\n        if (__classPrivateFieldGet(this, _X509CrlEntry_reason, \"f\") === undefined) {\n            void this.extensions;\n        }\n        return __classPrivateFieldGet(this, _X509CrlEntry_reason, \"f\");\n    }\n    get invalidity() {\n        if (__classPrivateFieldGet(this, _X509CrlEntry_invalidity, \"f\") === undefined) {\n            void this.extensions;\n        }\n        return __classPrivateFieldGet(this, _X509CrlEntry_invalidity, \"f\");\n    }\n    get extensions() {\n        if (!__classPrivateFieldGet(this, _X509CrlEntry_extensions, \"f\")) {\n            __classPrivateFieldSet(this, _X509CrlEntry_extensions, [], \"f\");\n            if (this.asn.crlEntryExtensions) {\n                __classPrivateFieldSet(this, _X509CrlEntry_extensions, this.asn.crlEntryExtensions.map((o) => {\n                    const extension = ExtensionFactory.create(AsnConvert.serialize(o), this.parseOptions);\n                    switch (extension.type) {\n                        case id_ce_cRLReasons:\n                            if (__classPrivateFieldGet(this, _X509CrlEntry_reason, \"f\") === undefined) {\n                                __classPrivateFieldSet(this, _X509CrlEntry_reason, AsnConvert.parse(extension.value, CRLReason, this.parseOptions)\n                                    .reason, \"f\");\n                            }\n                            break;\n                        case id_ce_invalidityDate:\n                            if (__classPrivateFieldGet(this, _X509CrlEntry_invalidity, \"f\") === undefined) {\n                                __classPrivateFieldSet(this, _X509CrlEntry_invalidity, AsnConvert.parse(extension.value, InvalidityDate, this.parseOptions).value, \"f\");\n                            }\n                            break;\n                    }\n                    return extension;\n                }), \"f\");\n            }\n        }\n        return __classPrivateFieldGet(this, _X509CrlEntry_extensions, \"f\");\n    }\n    constructor(...args) {\n        let raw;\n        let options;\n        if (BufferSourceConverter.isBufferSource(args[0])) {\n            raw = BufferSourceConverter.toArrayBuffer(args[0]);\n            options = args[1];\n        }\n        else if (typeof args[0] === \"string\") {\n            raw = AsnConvert.serialize(new RevokedCertificate({\n                userCertificate: normalizeCertificateSerialNumber(args[0]),\n                revocationDate: new Time(args[1]),\n                crlEntryExtensions: args[2],\n            }));\n        }\n        else if (args[0] instanceof RevokedCertificate) {\n            raw = args[0];\n            options = args[1];\n        }\n        if (!raw) {\n            throw new TypeError(\"Cannot create X509CrlEntry instance. Wrong constructor arguments.\");\n        }\n        const superArgs = raw instanceof RevokedCertificate ? [raw, options] : [raw, RevokedCertificate, options];\n        super(superArgs[0], superArgs[1], superArgs[2]);\n        _X509CrlEntry_serialNumber.set(this, void 0);\n        _X509CrlEntry_revocationDate.set(this, void 0);\n        _X509CrlEntry_reason.set(this, void 0);\n        _X509CrlEntry_invalidity.set(this, void 0);\n        _X509CrlEntry_extensions.set(this, void 0);\n    }\n    onInit(_asn) {\n    }\n}\n_X509CrlEntry_serialNumber = new WeakMap(), _X509CrlEntry_revocationDate = new WeakMap(), _X509CrlEntry_reason = new WeakMap(), _X509CrlEntry_invalidity = new WeakMap(), _X509CrlEntry_extensions = new WeakMap();\n\nvar _X509Crl_tbs, _X509Crl_signatureAlgorithm, _X509Crl_issuerName, _X509Crl_thisUpdate, _X509Crl_nextUpdate, _X509Crl_entries, _X509Crl_extensions;\nclass X509Crl extends PemData {\n    get version() {\n        return this.asn.tbsCertList.version;\n    }\n    get signatureAlgorithm() {\n        if (!__classPrivateFieldGet(this, _X509Crl_signatureAlgorithm, \"f\")) {\n            const algProv = container.resolve(diAlgorithmProvider);\n            __classPrivateFieldSet(this, _X509Crl_signatureAlgorithm, algProv.toWebAlgorithm(this.asn.signatureAlgorithm), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Crl_signatureAlgorithm, \"f\");\n    }\n    get signature() {\n        return this.asn.signature;\n    }\n    get issuer() {\n        return this.issuerName.toString();\n    }\n    get issuerName() {\n        if (!__classPrivateFieldGet(this, _X509Crl_issuerName, \"f\")) {\n            __classPrivateFieldSet(this, _X509Crl_issuerName, new Name(this.asn.tbsCertList.issuer), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Crl_issuerName, \"f\");\n    }\n    get thisUpdate() {\n        if (!__classPrivateFieldGet(this, _X509Crl_thisUpdate, \"f\")) {\n            const thisUpdate = this.asn.tbsCertList.thisUpdate.getTime();\n            if (!thisUpdate) {\n                throw new Error(\"Cannot get 'thisUpdate' value\");\n            }\n            __classPrivateFieldSet(this, _X509Crl_thisUpdate, thisUpdate, \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Crl_thisUpdate, \"f\");\n    }\n    get nextUpdate() {\n        var _a;\n        if (__classPrivateFieldGet(this, _X509Crl_nextUpdate, \"f\") === undefined) {\n            __classPrivateFieldSet(this, _X509Crl_nextUpdate, ((_a = this.asn.tbsCertList.nextUpdate) === null || _a === void 0 ? void 0 : _a.getTime()) || undefined, \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Crl_nextUpdate, \"f\");\n    }\n    get entries() {\n        var _a;\n        if (!__classPrivateFieldGet(this, _X509Crl_entries, \"f\")) {\n            __classPrivateFieldSet(this, _X509Crl_entries, ((_a = this.asn.tbsCertList.revokedCertificates) === null || _a === void 0 ? void 0 : _a.map((o) => new X509CrlEntry(o, this.parseOptions))) || [], \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Crl_entries, \"f\");\n    }\n    get extensions() {\n        if (!__classPrivateFieldGet(this, _X509Crl_extensions, \"f\")) {\n            __classPrivateFieldSet(this, _X509Crl_extensions, [], \"f\");\n            if (this.asn.tbsCertList.crlExtensions) {\n                __classPrivateFieldSet(this, _X509Crl_extensions, this.asn.tbsCertList.crlExtensions.map((o) => ExtensionFactory.create(AsnConvert.serialize(o), this.parseOptions)), \"f\");\n            }\n        }\n        return __classPrivateFieldGet(this, _X509Crl_extensions, \"f\");\n    }\n    get tbs() {\n        if (!__classPrivateFieldGet(this, _X509Crl_tbs, \"f\")) {\n            __classPrivateFieldSet(this, _X509Crl_tbs, this.asn.tbsCertListRaw || AsnConvert.serialize(this.asn.tbsCertList), \"f\");\n        }\n        return __classPrivateFieldGet(this, _X509Crl_tbs, \"f\");\n    }\n    get tbsCertListSignatureAlgorithm() {\n        return this.asn.tbsCertList.signature;\n    }\n    get certListSignatureAlgorithm() {\n        return this.asn.signatureAlgorithm;\n    }\n    constructor(param, options) {\n        const args = PemData.isAsnEncoded(param) ? [param, CertificateList, options] : [param, options];\n        super(args[0], args[1], args[2]);\n        this.tag = PemConverter.CrlTag;\n        _X509Crl_tbs.set(this, void 0);\n        _X509Crl_signatureAlgorithm.set(this, void 0);\n        _X509Crl_issuerName.set(this, void 0);\n        _X509Crl_thisUpdate.set(this, void 0);\n        _X509Crl_nextUpdate.set(this, void 0);\n        _X509Crl_entries.set(this, void 0);\n        _X509Crl_extensions.set(this, void 0);\n    }\n    onInit(_asn) {\n    }\n    getExtension(type) {\n        for (const ext of this.extensions) {\n            if (typeof type === \"string\") {\n                if (ext.type === type) {\n                    return ext;\n                }\n            }\n            else {\n                if (ext instanceof type) {\n                    return ext;\n                }\n            }\n        }\n        return null;\n    }\n    getExtensions(type) {\n        return this.extensions.filter((o) => {\n            if (typeof type === \"string\") {\n                return o.type === type;\n            }\n            else {\n                return o instanceof type;\n            }\n        });\n    }\n    async verify(params, crypto = cryptoProvider.get()) {\n        if (!this.certListSignatureAlgorithm.isEqual(this.tbsCertListSignatureAlgorithm)) {\n            throw new Error(\"algorithm identifier in the sequence tbsCertList and CertificateList mismatch\");\n        }\n        let keyAlgorithm;\n        let publicKey;\n        const paramsKey = params.publicKey;\n        try {\n            if (paramsKey instanceof X509Certificate) {\n                keyAlgorithm = {\n                    ...paramsKey.publicKey.algorithm,\n                    ...paramsKey.signatureAlgorithm,\n                };\n                publicKey = await paramsKey.publicKey.export(keyAlgorithm, [\"verify\"]);\n            }\n            else if (paramsKey instanceof PublicKey) {\n                keyAlgorithm = {\n                    ...paramsKey.algorithm,\n                    ...this.signatureAlgorithm,\n                };\n                publicKey = await paramsKey.export(keyAlgorithm, [\"verify\"]);\n            }\n            else {\n                keyAlgorithm = {\n                    ...paramsKey.algorithm,\n                    ...this.signatureAlgorithm,\n                };\n                publicKey = paramsKey;\n            }\n        }\n        catch {\n            return false;\n        }\n        const signatureFormatters = container\n            .resolveAll(diAsnSignatureFormatter)\n            .reverse();\n        let signature = null;\n        for (const signatureFormatter of signatureFormatters) {\n            signature = signatureFormatter.toWebSignature(keyAlgorithm, this.signature);\n            if (signature) {\n                break;\n            }\n        }\n        if (!signature) {\n            throw Error(\"Cannot convert ASN.1 signature value to WebCrypto format\");\n        }\n        return await crypto.subtle.verify(this.signatureAlgorithm, publicKey, signature, this.tbs);\n    }\n    async getThumbprint(arg1, arg2) {\n        let crypto;\n        let algorithm = \"SHA-1\";\n        if (arg1) {\n            if (typeof arg1 === \"object\" && \"subtle\" in arg1) {\n                crypto = arg1;\n            }\n            else {\n                algorithm = arg1;\n                crypto = arg2;\n            }\n        }\n        crypto !== null && crypto !== void 0 ? crypto : (crypto = cryptoProvider.get());\n        return await crypto.subtle.digest(algorithm, this.rawData);\n    }\n    findRevoked(certOrSerialNumber) {\n        const serialNumber = typeof certOrSerialNumber === \"string\" ? certOrSerialNumber : certOrSerialNumber.serialNumber;\n        const serialBuffer = normalizeCertificateSerialNumber(serialNumber);\n        for (const revoked of this.asn.tbsCertList.revokedCertificates || []) {\n            if (BufferSourceConverter.isEqual(revoked.userCertificate, serialBuffer)) {\n                return new X509CrlEntry(AsnConvert.serialize(revoked), this.parseOptions);\n            }\n        }\n        return null;\n    }\n}\n_X509Crl_tbs = new WeakMap(), _X509Crl_signatureAlgorithm = new WeakMap(), _X509Crl_issuerName = new WeakMap(), _X509Crl_thisUpdate = new WeakMap(), _X509Crl_nextUpdate = new WeakMap(), _X509Crl_entries = new WeakMap(), _X509Crl_extensions = new WeakMap();\n\nclass X509CrlGenerator {\n    static async create(params, crypto = cryptoProvider.get()) {\n        var _a;\n        const name = params.issuer instanceof Name ? params.issuer : new Name(params.issuer);\n        const asnX509Crl = new asn1X509.CertificateList({\n            tbsCertList: new asn1X509.TBSCertList({\n                version: asn1X509.Version.v2,\n                issuer: AsnConvert.parse(name.toArrayBuffer(), asn1X509.Name),\n                thisUpdate: new Time(params.thisUpdate || new Date()),\n            }),\n        });\n        if (params.nextUpdate) {\n            asnX509Crl.tbsCertList.nextUpdate = new Time(params.nextUpdate);\n        }\n        if (params.extensions && params.extensions.length) {\n            asnX509Crl.tbsCertList.crlExtensions = new asn1X509.Extensions(params.extensions.map((o) => AsnConvert.parse(o.rawData, asn1X509.Extension)) || []);\n        }\n        if (params.entries && params.entries.length) {\n            asnX509Crl.tbsCertList.revokedCertificates = [];\n            for (const entry of params.entries) {\n                const userCertificate = normalizeCertificateSerialNumber(entry.serialNumber);\n                const index = asnX509Crl.tbsCertList.revokedCertificates.findIndex((cert) => isEqual(cert.userCertificate, userCertificate));\n                if (index > -1) {\n                    throw new Error(`Certificate serial number ${entry.serialNumber} already exists in tbsCertList`);\n                }\n                const revokedCert = new RevokedCertificate({\n                    userCertificate: userCertificate,\n                    revocationDate: new Time(entry.revocationDate || new Date()),\n                });\n                if (\"extensions\" in entry && ((_a = entry.extensions) === null || _a === void 0 ? void 0 : _a.length)) {\n                    revokedCert.crlEntryExtensions = entry.extensions.map((o) => AsnConvert.parse(o.rawData, asn1X509.Extension));\n                }\n                else {\n                    revokedCert.crlEntryExtensions = [];\n                }\n                if (!(entry instanceof X509CrlEntry)) {\n                    if (entry.reason) {\n                        revokedCert.crlEntryExtensions.push(new asn1X509.Extension({\n                            extnID: asn1X509.id_ce_cRLReasons,\n                            critical: false,\n                            extnValue: new OctetString(AsnConvert.serialize(new asn1X509.CRLReason(entry.reason))),\n                        }));\n                    }\n                    if (entry.invalidity) {\n                        revokedCert.crlEntryExtensions.push(new asn1X509.Extension({\n                            extnID: asn1X509.id_ce_invalidityDate,\n                            critical: false,\n                            extnValue: new OctetString(AsnConvert.serialize(new asn1X509.InvalidityDate(entry.invalidity))),\n                        }));\n                    }\n                    if (entry.issuer) {\n                        const name = params.issuer instanceof Name ? params.issuer : new Name(params.issuer);\n                        revokedCert.crlEntryExtensions.push(new asn1X509.Extension({\n                            extnID: asn1X509.id_ce_certificateIssuer,\n                            critical: false,\n                            extnValue: new OctetString(AsnConvert.serialize(AsnConvert.parse(name.toArrayBuffer(), asn1X509.Name))),\n                        }));\n                    }\n                }\n                asnX509Crl.tbsCertList.revokedCertificates.push(revokedCert);\n            }\n        }\n        const signingAlgorithm = {\n            ...params.signingAlgorithm,\n            ...params.signingKey.algorithm,\n        };\n        const algProv = container.resolve(diAlgorithmProvider);\n        asnX509Crl.tbsCertList.signature = asnX509Crl.signatureAlgorithm =\n            algProv.toAsnAlgorithm(signingAlgorithm);\n        const tbs = AsnConvert.serialize(asnX509Crl.tbsCertList);\n        const signature = await crypto.subtle.sign(signingAlgorithm, params.signingKey, tbs);\n        const signatureFormatters = container\n            .resolveAll(diAsnSignatureFormatter)\n            .reverse();\n        let asnSignature = null;\n        for (const signatureFormatter of signatureFormatters) {\n            asnSignature = signatureFormatter.toAsnSignature(signingAlgorithm, signature);\n            if (asnSignature) {\n                break;\n            }\n        }\n        if (!asnSignature) {\n            throw Error(\"Cannot convert ASN.1 signature value to WebCrypto format\");\n        }\n        asnX509Crl.signature = asnSignature;\n        return new X509Crl(AsnConvert.serialize(asnX509Crl));\n    }\n}\n\nExtensionFactory.register(asn1X509.id_ce_basicConstraints, BasicConstraintsExtension);\nExtensionFactory.register(asn1X509.id_ce_extKeyUsage, ExtendedKeyUsageExtension);\nExtensionFactory.register(asn1X509.id_ce_keyUsage, KeyUsagesExtension);\nExtensionFactory.register(asn1X509.id_ce_subjectKeyIdentifier, SubjectKeyIdentifierExtension);\nExtensionFactory.register(asn1X509.id_ce_authorityKeyIdentifier, AuthorityKeyIdentifierExtension);\nExtensionFactory.register(asn1X509.id_ce_subjectAltName, SubjectAlternativeNameExtension);\nExtensionFactory.register(asn1X509.id_ce_cRLDistributionPoints, CRLDistributionPointsExtension);\nExtensionFactory.register(asn1X509.id_pe_authorityInfoAccess, AuthorityInfoAccessExtension);\nExtensionFactory.register(asn1X509.id_ce_issuerAltName, IssuerAlternativeNameExtension);\nAttributeFactory.register(asnPkcs9.id_pkcs9_at_challengePassword, ChallengePasswordAttribute);\nAttributeFactory.register(asnPkcs9.id_pkcs9_at_extensionRequest, ExtensionsAttribute);\ncontainer.registerSingleton(diAsnSignatureFormatter, AsnDefaultSignatureFormatter);\ncontainer.registerSingleton(diAsnSignatureFormatter, AsnEcSignatureFormatter);\nAsnEcSignatureFormatter.namedCurveSize.set(\"P-256\", 32);\nAsnEcSignatureFormatter.namedCurveSize.set(\"K-256\", 32);\nAsnEcSignatureFormatter.namedCurveSize.set(\"P-384\", 48);\nAsnEcSignatureFormatter.namedCurveSize.set(\"P-521\", 66);\n\nexport { AlgorithmProvider, AsnData, AsnDefaultSignatureFormatter, AsnEcSignatureFormatter, Attribute, AttributeFactory, AuthorityInfoAccessExtension, AuthorityKeyIdentifierExtension, BasicConstraintsExtension, CRLDistributionPointsExtension, CertificatePolicyExtension, ChallengePasswordAttribute, CryptoProvider, DN, DNS, DefaultAlgorithmSerializer, EMAIL, EcAlgorithm, EdAlgorithm, ExtendedKeyUsage, ExtendedKeyUsageExtension, Extension, ExtensionFactory, ExtensionsAttribute, GUID, GeneralName, GeneralNames, IP, IssuerAlternativeNameExtension, KeyUsageFlags, KeyUsagesExtension, MlDsaAlgorithm, Name, NameIdentifier, OidSerializer, PemConverter, PemData, Pkcs10CertificateRequest, Pkcs10CertificateRequestGenerator, PublicKey, REGISTERED_ID, RsaAlgorithm, ShaAlgorithm, SlhDsaAlgorithm, SubjectAlternativeNameExtension, SubjectKeyIdentifierExtension, TextConverter, TextObject, UPN, URL, X509Certificate, X509CertificateGenerator, X509Certificates, X509ChainBuilder, X509Crl, X509CrlEntry, X509CrlGenerator, X509CrlReason, cryptoProvider, diAlgorithm, diAlgorithmProvider, diAsnSignatureFormatter, idEd25519, idEd448, idX25519, idX448 };\n","/**\n * A simple method for requesting data via standard `fetch`. Should work\n * across multiple runtimes.\n */\nexport function fetch(url) {\n    return _fetchInternals.stubThis(url);\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _fetchInternals = {\n    stubThis: (url) => globalThis.fetch(url),\n};\n","import 'reflect-metadata';\nimport { AuthorityKeyIdentifierExtension, CRLDistributionPointsExtension, SubjectKeyIdentifierExtension, X509Crl, } from '@peculiar/x509';\nimport { fetch } from './fetch.js';\nconst cacheRevokedCerts = {};\n/**\n * A method to pull a CRL from a certificate and compare its serial number to the list of revoked\n * certificate serial numbers within the CRL.\n *\n * CRL certificate structure referenced from https://tools.ietf.org/html/rfc5280#page-117\n */\nexport async function isCertRevoked(certificate, issuer) {\n    if (!issuer) {\n        // We don't have a public key to verify any CRL signature so don't bother continuing\n        return false;\n    }\n    const { extensions } = certificate;\n    if (!extensions) {\n        return false;\n    }\n    // Get the issuer's key identifier for part of the cache key and to check against the\n    // certificate's and CRL's AuthorityKeyIdentifier extension\n    const { keyIdentifier: issuerKeyIdentifier, fromExtension: issuerKeyIdentifierFromExtension, } = await getIssuerKeyIdentifier(issuer);\n    const certificateExtAuthorityKeyID = certificate.extensions.find((ext) => ext instanceof AuthorityKeyIdentifierExtension);\n    // When present, assert that certificates's AuthorityKeyIdentifier mirrors\n    // the issuer's SubjectKeyIdentifier\n    if (issuerKeyIdentifierFromExtension &&\n        certificateExtAuthorityKeyID?.keyId &&\n        certificateExtAuthorityKeyID.keyId !== issuerKeyIdentifier) {\n        throw new Error(`Certificate's AuthorityKeyIdentifier did not match issuer's SubjectKeyIdentifier \"${issuerKeyIdentifier}\"`);\n    }\n    const extCRLDistributionPoints = extensions.find((ext) => ext instanceof CRLDistributionPointsExtension);\n    // Get all CRL URLs from within the certificate\n    const crlURLs = [];\n    extCRLDistributionPoints?.distributionPoints?.forEach((dPoint) => {\n        dPoint.distributionPoint?.fullName?.forEach((fullName) => {\n            if (fullName.uniformResourceIdentifier) {\n                crlURLs.push(fullName.uniformResourceIdentifier);\n            }\n        });\n    });\n    // If no URL(s) is provided then we have nothing to check\n    if (!(crlURLs.length > 0)) {\n        return false;\n    }\n    for (const crlURL of crlURLs) {\n        // Key off of issuer public key and CRL URL in case multiple CRLs are specified\n        const cacheKey = `${issuerKeyIdentifier}|${crlURL}`;\n        const cached = cacheRevokedCerts[cacheKey];\n        if (cached) {\n            const now = new Date();\n            // If there's a nextUpdate then make sure we're before it\n            if (!cached.nextUpdate || cached.nextUpdate > now) {\n                return cached.revokedCerts.indexOf(certificate.serialNumber) >= 0;\n            }\n        }\n        // Download and read the CRL\n        let crlBytes;\n        try {\n            const respCRL = await fetch(crlURL);\n            crlBytes = await respCRL.arrayBuffer();\n        }\n        catch (_err) {\n            // Some kind of network error occurred so try the next URL\n            continue;\n        }\n        let certCRL;\n        try {\n            certCRL = new X509Crl(crlBytes);\n        }\n        catch (_err) {\n            // Something was malformed with the CRL so try the next URL\n            continue;\n        }\n        const certCRLVerified = await certCRL.verify({ publicKey: issuer.publicKey });\n        if (!certCRLVerified) {\n            throw new Error(`CRL from ${crlURL} failed signature verification against issuer \"${issuer.subject}\"`);\n        }\n        // When present, assert that the CRL's AuthorityKeyIdentifier mirrors\n        // the issuer's SubjectKeyIdentifier\n        const crlAKI = certCRL.getExtension(AuthorityKeyIdentifierExtension);\n        if (issuerKeyIdentifierFromExtension &&\n            crlAKI?.keyId &&\n            crlAKI.keyId !== issuerKeyIdentifier) {\n            throw new Error(`CRL from ${crlURL} contained an AuthorityKeyIdentifier that did not match issuer's SubjectKeyIdentifier \"${issuerKeyIdentifier}\"`);\n        }\n        // Cache the CRL only if a nextUpdate has been provided\n        if (certCRL.nextUpdate) {\n            cacheRevokedCerts[cacheKey] = {\n                revokedCerts: certCRL.entries.map((entry) => entry.serialNumber),\n                nextUpdate: certCRL.nextUpdate,\n            };\n        }\n        // Finally, check entries for revocation status\n        const revoked = certCRL.findRevoked(certificate);\n        if (revoked) {\n            return true;\n        }\n    }\n    return false;\n}\n/**\n * Determine a unique key ID for the issuer certificate, based either on its\n * SubjectKeyIdentifierExtension or by generating the same value using the issuer's public key\n */\nasync function getIssuerKeyIdentifier(issuer) {\n    const issuerSKI = issuer.extensions?.find((ext) => ext instanceof SubjectKeyIdentifierExtension);\n    if (issuerSKI?.keyId) {\n        return { keyIdentifier: issuerSKI.keyId, fromExtension: true };\n    }\n    /**\n     * The issuer carries no SubjectKeyIdentifier extension, so derive one from its public key\n     * (RFC 5280, method 1). This is good enough to keep unrelated CAs from colliding when computing\n     * the revocation cache key, but it's not authoritative enough to reject a certificate over.\n     */\n    const computed = await SubjectKeyIdentifierExtension.create(issuer.publicKey);\n    return { keyIdentifier: computed.keyId, fromExtension: false };\n}\n","import { isoCBOR } from './iso/index.js';\n/**\n * Convert authenticator extension data buffer to a proper object\n *\n * @param extensionData Authenticator Extension Data buffer\n */\nexport function decodeAuthenticatorExtensions(extensionData) {\n    let toCBOR;\n    try {\n        toCBOR = isoCBOR.decodeFirst(extensionData);\n    }\n    catch (err) {\n        const _err = err;\n        throw new Error(`Error decoding authenticator extensions: ${_err.message}`);\n    }\n    return convertMapToObjectDeep(toCBOR);\n}\n/**\n * CBOR-encoded extensions can be deeply-nested Maps, which are too deep for a simple\n * `Object.entries()`. This method will recursively make sure that all Maps are converted into\n * basic objects.\n */\nfunction convertMapToObjectDeep(input) {\n    const mapped = {};\n    for (const [key, value] of input) {\n        if (value instanceof Map) {\n            mapped[key] = convertMapToObjectDeep(value);\n        }\n        else {\n            mapped[key] = value;\n        }\n    }\n    return mapped;\n}\n","import { decodeAuthenticatorExtensions, } from './decodeAuthenticatorExtensions.js';\nimport { isoCBOR, isoUint8Array } from './iso/index.js';\n/**\n * Make sense of the authData buffer contained in an Attestation\n */\nexport function parseAuthenticatorData(authData) {\n    if (authData.byteLength < 37) {\n        throw new Error(`Authenticator data was ${authData.byteLength} bytes, expected at least 37 bytes`);\n    }\n    let pointer = 0;\n    const dataView = isoUint8Array.toDataView(authData);\n    const rpIdHash = authData.slice(pointer, pointer += 32);\n    const flagsBuf = authData.slice(pointer, pointer += 1);\n    const flagsInt = flagsBuf[0];\n    // Bit positions can be referenced here:\n    // https://www.w3.org/TR/webauthn-2/#flags\n    const flags = {\n        up: !!(flagsInt & (1 << 0)), // User Presence\n        uv: !!(flagsInt & (1 << 2)), // User Verified\n        be: !!(flagsInt & (1 << 3)), // Backup Eligibility\n        bs: !!(flagsInt & (1 << 4)), // Backup State\n        at: !!(flagsInt & (1 << 6)), // Attested Credential Data Present\n        ed: !!(flagsInt & (1 << 7)), // Extension Data Present\n        flagsInt,\n    };\n    const counterBuf = authData.slice(pointer, pointer + 4);\n    const counter = dataView.getUint32(pointer, false);\n    pointer += 4;\n    let aaguid = undefined;\n    let credentialID = undefined;\n    let credentialPublicKey = undefined;\n    if (flags.at) {\n        aaguid = authData.slice(pointer, pointer += 16);\n        const credIDLen = dataView.getUint16(pointer);\n        pointer += 2;\n        credentialID = authData.slice(pointer, pointer += credIDLen);\n        /**\n         * Firefox 117 incorrectly CBOR-encodes authData when EdDSA (-8) is used for the public key.\n         * A CBOR \"Map of 3 items\" (0xa3) should be \"Map of 4 items\" (0xa4), and if we manually adjust\n         * the single byte there's a good chance the authData can be correctly parsed.\n         *\n         * This browser release also incorrectly uses the string labels \"OKP\" and \"Ed25519\" instead of\n         * their integer representations for kty and crv respectively. That's why the COSE public key\n         * in the hex below looks so odd.\n         */\n        // Bytes decode to `{ 1: \"OKP\", 3: -8, -1: \"Ed25519\" }` (it's missing key -2 a.k.a. COSEKEYS.x)\n        const badEdDSACBOR = isoUint8Array.fromHex('a301634f4b500327206745643235353139');\n        const bytesAtCurrentPosition = authData.slice(pointer, pointer + badEdDSACBOR.byteLength);\n        let foundBadCBOR = false;\n        if (isoUint8Array.areEqual(badEdDSACBOR, bytesAtCurrentPosition)) {\n            // Change the bad CBOR 0xa3 to 0xa4 so that the credential public key can be recognized\n            foundBadCBOR = true;\n            authData[pointer] = 0xa4;\n        }\n        // Decode the next CBOR item in the buffer, then re-encode it back to a Buffer\n        const firstDecoded = isoCBOR.decodeFirst(authData.slice(pointer));\n        const firstEncoded = Uint8Array.from(\n        /**\n         * Casting to `Map` via `as unknown` here because TS doesn't make it possible to define Maps\n         * with discrete keys and properties with known types per pair, and CBOR libs typically parse\n         * CBOR Major Type 5 to `Map` because you can have numbers for keys. A `COSEPublicKey` can be\n         * generalized as \"a Map with numbers for keys and either numbers or bytes for values\" though.\n         * If this presumption falls apart then other parts of verification later on will fail so we\n         * should be safe doing this here.\n         */\n        isoCBOR.encode(firstDecoded));\n        if (foundBadCBOR) {\n            // Restore the bit we changed so that `authData` is the same as it came in and won't break\n            // signature verification.\n            authData[pointer] = 0xa3;\n        }\n        credentialPublicKey = firstEncoded;\n        pointer += firstEncoded.byteLength;\n    }\n    let extensionsData = undefined;\n    let extensionsDataBuffer = undefined;\n    if (flags.ed) {\n        const firstDecoded = isoCBOR.decodeFirst(authData.slice(pointer));\n        extensionsDataBuffer = Uint8Array.from(isoCBOR.encode(firstDecoded));\n        extensionsData = decodeAuthenticatorExtensions(extensionsDataBuffer);\n        pointer += extensionsDataBuffer.byteLength;\n    }\n    // Pointer should be at the end of the authenticator data, otherwise too much data was sent\n    if (authData.byteLength > pointer) {\n        throw new Error('Leftover bytes detected while parsing authenticator data');\n    }\n    return _parseAuthenticatorDataInternals.stubThis({\n        rpIdHash,\n        flagsBuf,\n        flags,\n        counter,\n        counterBuf,\n        aaguid,\n        credentialID,\n        credentialPublicKey,\n        extensionsData,\n        extensionsDataBuffer,\n    });\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _parseAuthenticatorDataInternals = {\n    stubThis: (value) => value,\n};\n","import { isoCrypto, isoUint8Array } from './iso/index.js';\n/**\n * Returns hash digest of the given data, using the given algorithm when provided. Defaults to using\n * SHA-256.\n */\nexport function toHash(data, algorithm = -7) {\n    if (typeof data === 'string') {\n        data = isoUint8Array.fromUTF8String(data);\n    }\n    const digest = isoCrypto.digest(data, algorithm);\n    return digest;\n}\n","import { COSEALG } from '../../cose.js';\n/**\n * Convert a COSE alg ID into a corresponding key algorithm string value that WebCrypto APIs expect\n *\n * Unless otherwise specified, mappings were referenced from\n * https://w3c.github.io/webcrypto/#jwk-mapping-alg\n */\nexport function mapCoseAlgToWebCryptoKeyAlgName(alg) {\n    if ([COSEALG.EdDSA].indexOf(alg) >= 0) {\n        return 'Ed25519';\n    }\n    else if ([COSEALG.ES256, COSEALG.ES384, COSEALG.ES512, COSEALG.ES256K].indexOf(alg) >= 0) {\n        return 'ECDSA';\n    }\n    else if ([COSEALG.RS256, COSEALG.RS384, COSEALG.RS512, COSEALG.RS1].indexOf(alg) >= 0) {\n        return 'RSASSA-PKCS1-v1_5';\n    }\n    else if ([COSEALG.PS256, COSEALG.PS384, COSEALG.PS512].indexOf(alg) >= 0) {\n        return 'RSA-PSS';\n    }\n    else if ([COSEALG.ML_DSA_44].indexOf(alg) >= 0) {\n        // https://wicg.github.io/webcrypto-modern-algos/#ml-dsa-registration\n        return 'ML-DSA-44';\n    }\n    else if ([COSEALG.ML_DSA_65].indexOf(alg) >= 0) {\n        // https://wicg.github.io/webcrypto-modern-algos/#ml-dsa-registration\n        return 'ML-DSA-65';\n    }\n    else if ([COSEALG.ML_DSA_87].indexOf(alg) >= 0) {\n        // https://wicg.github.io/webcrypto-modern-algos/#ml-dsa-registration\n        return 'ML-DSA-87';\n    }\n    throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto key alg name`);\n}\n","import { mapCoseAlgToWebCryptoKeyAlgName } from '../helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js';\n/**\n * Base error class that helps disambiguate SimpleWebAuthn library errors from other library errors\n */\nexport class SimpleWebAuthnError extends Error {\n    constructor({ message, code, cause }) {\n        super(message, { cause });\n        Object.defineProperty(this, \"code\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: void 0\n        });\n        this.name = 'SimpleWebAuthnError';\n        this.code = code;\n    }\n}\nexport class PQCNotSupportedError extends SimpleWebAuthnError {\n    constructor(alg) {\n        const webCryptoAlg = mapCoseAlgToWebCryptoKeyAlgName(alg);\n        const message = `This runtime's WebCrypto.subtle does not support use of ${webCryptoAlg}`;\n        super({ message, code: 'RUNTIME_NO_PQC_SUPPORT' });\n    }\n}\n","import 'reflect-metadata';\nimport { X509Certificate, X509ChainBuilder } from '@peculiar/x509';\nimport { isCertRevoked } from './isCertRevoked.js';\nimport { SimpleWebAuthnError } from '../errors/index.js';\n/**\n * Traverse an array of PEM certificates and ensure they form a proper chain\n * @param x5cCertsPEM Typically the result of `x5c.map(convertASN1toPEM)`\n * @param trustAnchorsPEM PEM-formatted certs that an attestation statement x5c may chain back to\n */\nexport async function validateCertificatePath(x5cCertsPEM, trustAnchorsPEM = []) {\n    if (trustAnchorsPEM.length === 0) {\n        // We have no trust anchors to chain back to, so skip path validation\n        return true;\n    }\n    // Prepare to work with trust anchor certs\n    const trustAnchorsParsed = trustAnchorsPEM.map((certPEM) => {\n        try {\n            return new X509Certificate(certPEM);\n        }\n        catch (err) {\n            throw new SimpleWebAuthnError({\n                message: `Could not parse trust anchor certificate:\\n${certPEM}`,\n                code: 'CERTIFICATE_PATH_VERIFICATION_FAILED',\n                cause: err,\n            });\n        }\n    });\n    // Filter out any temporally invalid trust anchors certs\n    const validTrustAnchors = [];\n    for (let i = 0; i < trustAnchorsParsed.length; i++) {\n        const cert = trustAnchorsParsed[i];\n        try {\n            assertCertIsWithinValidTimeWindow(cert);\n        }\n        catch (_err) {\n            // Continue processing the other certs\n            continue;\n        }\n        validTrustAnchors.push(cert);\n    }\n    if (validTrustAnchors.length === 0) {\n        throw new SimpleWebAuthnError({\n            message: 'No specified trust anchor was valid for verifying x5c',\n            code: 'CERTIFICATE_PATH_VERIFICATION_FAILED',\n        });\n    }\n    // Prepare to work with x5c certs\n    const x5cCertsParsed = x5cCertsPEM.map((certPEM) => new X509Certificate(certPEM));\n    // Break apart x5c into leaf + intermediates\n    const x5cLeafCert = x5cCertsParsed[0];\n    let x5cIntermediates = [];\n    if (x5cCertsParsed.length > 1) {\n        x5cIntermediates = x5cCertsParsed.slice(1);\n    }\n    // Try to verify x5c with each valid trust anchor\n    let invalidCertificateChain = true;\n    let validatedChain = undefined;\n    for (const anchor of validTrustAnchors) {\n        try {\n            const x5cWithTrustAnchor = x5cCertsParsed.concat([anchor]);\n            const numUniqueCerts = new Set(x5cWithTrustAnchor.map((cert) => cert.toString('pem'))).size;\n            if (numUniqueCerts !== x5cWithTrustAnchor.length) {\n                throw new SimpleWebAuthnError({\n                    message: 'Invalid certificate path: found duplicate certificates',\n                    code: 'CERTIFICATE_PATH_VERIFICATION_FAILED',\n                });\n            }\n            // Order of certs doesn't matter here but for readability\n            const chainBuilder = new X509ChainBuilder({ certificates: [...x5cIntermediates, anchor] });\n            // Attempt to build a certificate path\n            const chain = await chainBuilder.build(x5cLeafCert);\n            /**\n             * The cert chain must chain to the anchor. Usually this is as simple as asserting that the\n             * final cert in the chain is the anchor cert. However there's an odd scenario where an\n             * intermediate certificate can chain to an anchor cert's public key, but not actually to the\n             * anchor cert because e.g. the chain builder stopped at a cross-signed cert for the anchor\n             * and not the anchor cert itself.\n             *\n             * So here we're going to check for that. In the simplest case we'll be fine with the last\n             * cert in the chain being byte-equivalent to the current anchor cert. If not, then move a\n             * cert up the chain and explicitly check that it was signed by the anchor cert. This also\n             * future-proofs this logic from the internals of whatever future X.509 library might be used\n             * to build the cert path.\n             */\n            const lastCert = chain[chain.length - 1];\n            const lastCertEqualsAnchor = lastCert.equal(anchor);\n            let certBeforeLastSignedByAnchor = false;\n            if (!lastCertEqualsAnchor && chain.length > 1) {\n                const certBeforeLast = chain[chain.length - 2];\n                certBeforeLastSignedByAnchor = await certBeforeLast.verify({\n                    publicKey: anchor.publicKey,\n                    signatureOnly: true,\n                });\n            }\n            const chainReachesAnchor = lastCertEqualsAnchor || certBeforeLastSignedByAnchor;\n            if (!chainReachesAnchor) {\n                // Invalid cert chain, try the next trust anchor\n                continue;\n            }\n            if (certBeforeLastSignedByAnchor) {\n                /**\n                 * Swap out the last cert in the chain with the anchor that we've already verified\n                 * chains to the second-to-last certificate. This makes it easier to verify the chain\n                 * as a standard certificate chain.\n                 */\n                chain[chain.length - 1] = anchor;\n            }\n            // We successfully validated a chain so there's no need to continue\n            invalidCertificateChain = false;\n            validatedChain = chain;\n            break;\n        }\n        catch (err) {\n            throw new SimpleWebAuthnError({\n                message: 'Unexpected error while validating certificate path',\n                code: 'CERTIFICATE_PATH_VERIFICATION_FAILED',\n                cause: err,\n            });\n        }\n    }\n    if (validatedChain) {\n        // Check for any temporally invalid or expired certs in the chain\n        for (let i = 0; i < validatedChain.length; i++) {\n            const cert = validatedChain[i];\n            try {\n                assertCertIsWithinValidTimeWindow(cert);\n            }\n            catch (_err) {\n                throw new SimpleWebAuthnError({\n                    message: `Found certificate out of validity period:\\n${cert.toString()}`,\n                    code: 'CERTIFICATE_PATH_VERIFICATION_FAILED',\n                });\n            }\n            /**\n             * Checking revocation is very expensive so do it only at the end when we're certain a cert\n             * is otherwise valid\n             */\n            let issuerCert = undefined;\n            if (i < validatedChain.length - 1) {\n                // Issuer cert is simply the next cert in the chain\n                issuerCert = validatedChain[i + 1];\n            }\n            else {\n                // `cert` is the anchor. Only try to verify its revocation status if it's a root certificate\n                if (await cert.isSelfSigned()) {\n                    issuerCert = cert;\n                }\n            }\n            try {\n                await assertCertNotRevoked(cert, issuerCert);\n            }\n            catch (err) {\n                throw new SimpleWebAuthnError({\n                    message: `The following certificate failed revocation status check\\n${cert.toString()}`,\n                    code: 'CERTIFICATE_PATH_VERIFICATION_FAILED',\n                    cause: err,\n                });\n            }\n        }\n    }\n    else {\n        invalidCertificateChain = true;\n    }\n    // We tried multiple trust anchors and none of them worked\n    if (invalidCertificateChain) {\n        throw new SimpleWebAuthnError({\n            message: 'x5c could not be chained to any specified trust anchor',\n            code: 'CERTIFICATE_PATH_VERIFICATION_FAILED',\n        });\n    }\n    return true;\n}\n/**\n * Check if the certificate is revoked or not. If it is, raise an error\n *\n * @throws Error - Wrap this in a SimpleWebAuthnError so RPs can identify issues here\n */\nasync function assertCertNotRevoked(certificate, issuerCert) {\n    // Check for certificate revocation\n    const subjectCertRevoked = await isCertRevoked(certificate, issuerCert);\n    if (subjectCertRevoked) {\n        throw new Error('Found revoked certificate in certificate path');\n    }\n}\n/**\n * Require the cert to be within its notBefore and notAfter time window\n */\nfunction assertCertIsWithinValidTimeWindow(certificate) {\n    const { notBefore: certNotBefore, notAfter: certNotAfter } = certificate;\n    const now = new Date(Date.now());\n    if (certNotBefore > now || certNotAfter < now) {\n        throw new Error('Certificate is not yet valid or expired');\n    }\n}\n","import { id_ecdsaWithSHA256, id_ecdsaWithSHA384, id_ecdsaWithSHA512 } from '@peculiar/asn1-ecc';\nimport { id_sha1WithRSAEncryption, id_sha256WithRSAEncryption, id_sha384WithRSAEncryption, id_sha512WithRSAEncryption, } from '@peculiar/asn1-rsa';\nimport { id_ml_dsa_44, id_ml_dsa_65, id_ml_dsa_87 } from '@peculiar/asn1-x509-post-quantum';\nimport { COSEALG } from './cose.js';\n/**\n * Map X.509 signature algorithm OIDs to COSE algorithm IDs\n */\nexport function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm) {\n    let alg;\n    if (signatureAlgorithm === id_ecdsaWithSHA256) {\n        alg = COSEALG.ES256;\n    }\n    else if (signatureAlgorithm === id_ecdsaWithSHA384) {\n        alg = COSEALG.ES384;\n    }\n    else if (signatureAlgorithm === id_ecdsaWithSHA512) {\n        alg = COSEALG.ES512;\n    }\n    else if (signatureAlgorithm === id_sha256WithRSAEncryption) {\n        alg = COSEALG.RS256;\n    }\n    else if (signatureAlgorithm === id_sha384WithRSAEncryption) {\n        alg = COSEALG.RS384;\n    }\n    else if (signatureAlgorithm === id_sha512WithRSAEncryption) {\n        alg = COSEALG.RS512;\n    }\n    else if (signatureAlgorithm === id_sha1WithRSAEncryption) {\n        alg = COSEALG.RS1;\n    }\n    else if (signatureAlgorithm === id_ml_dsa_44) {\n        alg = COSEALG.ML_DSA_44;\n    }\n    else if (signatureAlgorithm === id_ml_dsa_65) {\n        alg = COSEALG.ML_DSA_65;\n    }\n    else if (signatureAlgorithm === id_ml_dsa_87) {\n        alg = COSEALG.ML_DSA_87;\n    }\n    else {\n        throw new Error(`Unable to map X.509 signature algorithm ${signatureAlgorithm} to a COSE algorithm`);\n    }\n    return alg;\n}\n","import { AsnParser } from '@peculiar/asn1-schema';\nimport { Certificate } from '@peculiar/asn1-x509';\nimport { ECParameters, id_ecPublicKey, id_secp256r1, id_secp384r1 } from '@peculiar/asn1-ecc';\nimport { id_ml_dsa_44, id_ml_dsa_65, id_ml_dsa_87 } from '@peculiar/asn1-x509-post-quantum';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport { COSEALG, COSECRV, COSEKEYS, COSEKTY, } from './cose.js';\nimport { mapX509SignatureAlgToCOSEAlg } from './mapX509SignatureAlgToCOSEAlg.js';\nexport function convertX509PublicKeyToCOSE(x509Certificate) {\n    let cosePublicKey = new Map();\n    /**\n     * Time to extract the public key from an X.509 certificate\n     */\n    const x509 = AsnParser.parse(x509Certificate, Certificate);\n    const { tbsCertificate } = x509;\n    const { subjectPublicKeyInfo } = tbsCertificate;\n    const publicKeyAlgorithmID = subjectPublicKeyInfo.algorithm.algorithm;\n    if (publicKeyAlgorithmID === id_ecPublicKey) {\n        /**\n         * EC2 Public Key\n         */\n        if (!subjectPublicKeyInfo.algorithm.parameters) {\n            throw new Error('Certificate public key was missing parameters (EC2)');\n        }\n        const ecParameters = AsnParser.parse(new Uint8Array(subjectPublicKeyInfo.algorithm.parameters), ECParameters);\n        let alg;\n        let crv;\n        const { namedCurve } = ecParameters;\n        if (namedCurve === id_secp256r1) {\n            alg = COSEALG.ES256;\n            crv = COSECRV.P256;\n        }\n        else if (namedCurve === id_secp384r1) {\n            alg = COSEALG.ES384;\n            crv = COSECRV.P384;\n        }\n        else {\n            throw new Error(`Certificate public key contained unexpected namedCurve ${namedCurve} (EC2)`);\n        }\n        const subjectPublicKey = new Uint8Array(subjectPublicKeyInfo.subjectPublicKey);\n        let x;\n        let y;\n        if (subjectPublicKey[0] === 0x04) {\n            // Public key is in \"uncompressed form\", so we can split the remaining bytes in half\n            let pointer = 1;\n            const halfLength = (subjectPublicKey.length - 1) / 2;\n            x = subjectPublicKey.slice(pointer, pointer += halfLength);\n            y = subjectPublicKey.slice(pointer);\n        }\n        else {\n            throw new Error('TODO: Figure out how to handle public keys in \"compressed form\"');\n        }\n        const coseEC2PubKey = new Map();\n        coseEC2PubKey.set(COSEKEYS.kty, COSEKTY.EC2);\n        coseEC2PubKey.set(COSEKEYS.alg, alg);\n        coseEC2PubKey.set(COSEKEYS.crv, crv);\n        coseEC2PubKey.set(COSEKEYS.x, x);\n        coseEC2PubKey.set(COSEKEYS.y, y);\n        cosePublicKey = coseEC2PubKey;\n    }\n    else if (publicKeyAlgorithmID === id_rsaEncryption) {\n        /**\n         * RSA public key\n         */\n        const rsaPublicKey = AsnParser.parse(subjectPublicKeyInfo.subjectPublicKey, RSAPublicKey);\n        const coseRSAPubKey = new Map();\n        coseRSAPubKey.set(COSEKEYS.kty, COSEKTY.RSA);\n        /**\n         * The algorithm ID is too ambiguous to know what this alg should really be. But practically\n         * speaking `shaHashOverride` is always specified when verifying signatures with RSA public keys\n         * which ultimately overrides this sensible default. Using RS256 also gets the correct WebCrypto\n         * alg name later on in verifyRSA.ts\n         */\n        coseRSAPubKey.set(COSEKEYS.alg, COSEALG.RS256);\n        coseRSAPubKey.set(COSEKEYS.n, new Uint8Array(rsaPublicKey.modulus));\n        coseRSAPubKey.set(COSEKEYS.e, new Uint8Array(rsaPublicKey.publicExponent));\n        cosePublicKey = coseRSAPubKey;\n    }\n    else if ([id_ml_dsa_44, id_ml_dsa_65, id_ml_dsa_87].indexOf(publicKeyAlgorithmID) >= 0) {\n        const coseAKPPubKey = new Map();\n        coseAKPPubKey.set(COSEKEYS.kty, COSEKTY.AKP);\n        coseAKPPubKey.set(COSEKEYS.alg, mapX509SignatureAlgToCOSEAlg(publicKeyAlgorithmID));\n        coseAKPPubKey.set(COSEKEYS.pub, new Uint8Array(subjectPublicKeyInfo.subjectPublicKey));\n        cosePublicKey = coseAKPPubKey;\n    }\n    else {\n        throw new Error(`Certificate public key contained unexpected algorithm ID ${publicKeyAlgorithmID}`);\n    }\n    return cosePublicKey;\n}\n","import { isoCrypto } from './iso/index.js';\nimport { decodeCredentialPublicKey } from './decodeCredentialPublicKey.js';\nimport { convertX509PublicKeyToCOSE } from './convertX509PublicKeyToCOSE.js';\n/**\n * Verify an authenticator's signature\n */\nexport function verifySignature(opts) {\n    const { signature, data, credentialPublicKey, x509Certificate, hashAlgorithm, } = opts;\n    if (!x509Certificate && !credentialPublicKey) {\n        throw new Error('Must declare either \"leafCert\" or \"credentialPublicKey\"');\n    }\n    if (x509Certificate && credentialPublicKey) {\n        throw new Error('Must not declare both \"leafCert\" and \"credentialPublicKey\"');\n    }\n    let cosePublicKey = new Map();\n    if (credentialPublicKey) {\n        cosePublicKey = decodeCredentialPublicKey(credentialPublicKey);\n    }\n    else if (x509Certificate) {\n        cosePublicKey = convertX509PublicKeyToCOSE(x509Certificate);\n    }\n    return _verifySignatureInternals.stubThis(isoCrypto.verify({\n        cosePublicKey,\n        signature,\n        data,\n        shaHashOverride: hashAlgorithm,\n    }));\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _verifySignatureInternals = {\n    stubThis: (value) => value,\n};\n","import { isoBase64URL } from '../helpers/iso/index.js';\n/**\n * Process a JWT into Javascript-friendly data structures\n */\nexport function parseJWT(jwt) {\n    const parts = jwt.split('.');\n    return [\n        JSON.parse(isoBase64URL.toUTF8String(parts[0])),\n        JSON.parse(isoBase64URL.toUTF8String(parts[1])),\n        parts[2],\n    ];\n}\n","import { COSEALG } from './cose.js';\n/**\n * Map JWS algorithms to COSE algorithm IDs\n *\n * See https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1 for possible values\n */\nexport function mapJWSAlgToCOSEAlg(alg) {\n    let algCOSE;\n    if (alg === 'ES256') {\n        algCOSE = COSEALG.ES256;\n    }\n    else if (alg === 'ES384') {\n        algCOSE = COSEALG.ES384;\n    }\n    else if (alg === 'ES512') {\n        algCOSE = COSEALG.ES512;\n    }\n    else if (alg === 'RS256') {\n        algCOSE = COSEALG.RS256;\n    }\n    else if (alg === 'RS384') {\n        algCOSE = COSEALG.RS384;\n    }\n    else if (alg === 'RS512') {\n        algCOSE = COSEALG.RS512;\n    }\n    else {\n        throw new Error(`Unable to map JWS algorithm \"${alg}\" to a COSE algorithm`);\n    }\n    return algCOSE;\n}\n","import { getWebCrypto } from './getWebCrypto.js';\n/**\n * Convert a JWK-formatted public key into a WebCrypto CryptoKey that can be used for\n * signature verification\n */\nexport async function importJWKKey(opts) {\n    const WebCrypto = await getWebCrypto();\n    const { keyData, algorithm } = opts;\n    return WebCrypto.subtle.importKey('jwk', keyData, algorithm, false, ['verify']);\n}\n","import { COSECRV, COSEKEYS } from '../../cose.js';\nimport { mapCoseAlgToWebCryptoHashAlgName } from './mapCoseAlgToWebCryptoHashAlgName.js';\nimport { importJWKKey } from './importJWKKey.js';\nimport { isoBase64URL } from '../index.js';\nimport { getWebCrypto } from './getWebCrypto.js';\n/**\n * Verify a signature using an EC2 public key\n */\nexport async function verifyEC2(opts) {\n    const { cosePublicKey, signature, data, shaHashOverride } = opts;\n    const WebCrypto = await getWebCrypto();\n    // Import the public key\n    const alg = cosePublicKey.get(COSEKEYS.alg);\n    const crv = cosePublicKey.get(COSEKEYS.crv);\n    const x = cosePublicKey.get(COSEKEYS.x);\n    const y = cosePublicKey.get(COSEKEYS.y);\n    if (!alg) {\n        throw new Error('Public key was missing alg (EC2)');\n    }\n    if (!crv) {\n        throw new Error('Public key was missing crv (EC2)');\n    }\n    if (!x) {\n        throw new Error('Public key was missing x (EC2)');\n    }\n    if (!y) {\n        throw new Error('Public key was missing y (EC2)');\n    }\n    let _crv;\n    if (crv === COSECRV.P256) {\n        _crv = 'P-256';\n    }\n    else if (crv === COSECRV.P384) {\n        _crv = 'P-384';\n    }\n    else if (crv === COSECRV.P521) {\n        _crv = 'P-521';\n    }\n    else {\n        throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`);\n    }\n    const keyData = {\n        kty: 'EC',\n        crv: _crv,\n        x: isoBase64URL.fromBuffer(x),\n        y: isoBase64URL.fromBuffer(y),\n        ext: false,\n    };\n    const keyAlgorithm = {\n        /**\n         * Note to future self: you can't use `mapCoseAlgToWebCryptoKeyAlgName()` here because some\n         * leaf certs from actual devices specified an RSA SHA value for `alg` (e.g. `-257`) which\n         * would then map here to `'RSASSA-PKCS1-v1_5'`. We always want `'ECDSA'` here so we'll\n         * hard-code this.\n         */\n        name: 'ECDSA',\n        namedCurve: _crv,\n    };\n    const key = await importJWKKey({ keyData, algorithm: keyAlgorithm });\n    // Determine which SHA algorithm to use for signature verification\n    let subtleAlg = mapCoseAlgToWebCryptoHashAlgName(alg);\n    if (shaHashOverride) {\n        subtleAlg = mapCoseAlgToWebCryptoHashAlgName(shaHashOverride);\n    }\n    const verifyAlgorithm = {\n        name: 'ECDSA',\n        hash: { name: subtleAlg },\n    };\n    return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);\n}\n","import { COSEKEYS, isCOSEAlg } from '../../cose.js';\nimport { mapCoseAlgToWebCryptoHashAlgName } from './mapCoseAlgToWebCryptoHashAlgName.js';\nimport { importJWKKey } from './importJWKKey.js';\nimport { isoBase64URL } from '../index.js';\nimport { mapCoseAlgToWebCryptoKeyAlgName } from './mapCoseAlgToWebCryptoKeyAlgName.js';\nimport { getWebCrypto } from './getWebCrypto.js';\n/**\n * Verify a signature using an RSA public key\n */\nexport async function verifyRSA(opts) {\n    const { cosePublicKey, signature, data, shaHashOverride } = opts;\n    const WebCrypto = await getWebCrypto();\n    const alg = cosePublicKey.get(COSEKEYS.alg);\n    const n = cosePublicKey.get(COSEKEYS.n);\n    const e = cosePublicKey.get(COSEKEYS.e);\n    if (!alg) {\n        throw new Error('Public key was missing alg (RSA)');\n    }\n    if (!isCOSEAlg(alg)) {\n        throw new Error(`Public key had invalid alg ${alg} (RSA)`);\n    }\n    if (!n) {\n        throw new Error('Public key was missing n (RSA)');\n    }\n    if (!e) {\n        throw new Error('Public key was missing e (RSA)');\n    }\n    const keyData = {\n        kty: 'RSA',\n        alg: '',\n        n: isoBase64URL.fromBuffer(n),\n        e: isoBase64URL.fromBuffer(e),\n        ext: false,\n    };\n    const keyAlgorithm = {\n        name: mapCoseAlgToWebCryptoKeyAlgName(alg),\n        hash: { name: mapCoseAlgToWebCryptoHashAlgName(alg) },\n    };\n    const verifyAlgorithm = {\n        name: mapCoseAlgToWebCryptoKeyAlgName(alg),\n    };\n    if (shaHashOverride) {\n        keyAlgorithm.hash.name = mapCoseAlgToWebCryptoHashAlgName(shaHashOverride);\n    }\n    if (keyAlgorithm.name === 'RSASSA-PKCS1-v1_5') {\n        if (keyAlgorithm.hash.name === 'SHA-256') {\n            keyData.alg = 'RS256';\n        }\n        else if (keyAlgorithm.hash.name === 'SHA-384') {\n            keyData.alg = 'RS384';\n        }\n        else if (keyAlgorithm.hash.name === 'SHA-512') {\n            keyData.alg = 'RS512';\n        }\n        else if (keyAlgorithm.hash.name === 'SHA-1') {\n            keyData.alg = 'RS1';\n        }\n    }\n    else if (keyAlgorithm.name === 'RSA-PSS') {\n        /**\n         * salt length. The default value is 20 but the convention is to use hLen, the length of the\n         * output of the hash function in bytes. A salt length of zero is permitted and will result in\n         * a deterministic signature value. The actual salt length used can be determined from the\n         * signature value.\n         *\n         * From https://www.cryptosys.net/pki/manpki/pki_rsaschemes.html\n         */\n        let saltLength = 0;\n        if (keyAlgorithm.hash.name === 'SHA-256') {\n            keyData.alg = 'PS256';\n            saltLength = 32; // 256 bits => 32 bytes\n        }\n        else if (keyAlgorithm.hash.name === 'SHA-384') {\n            keyData.alg = 'PS384';\n            saltLength = 48; // 384 bits => 48 bytes\n        }\n        else if (keyAlgorithm.hash.name === 'SHA-512') {\n            keyData.alg = 'PS512';\n            saltLength = 64; // 512 bits => 64 bytes\n        }\n        verifyAlgorithm.saltLength = saltLength;\n    }\n    else {\n        throw new Error(`Unexpected RSA key algorithm ${alg} (${keyAlgorithm.name})`);\n    }\n    const key = await importJWKKey({ keyData, algorithm: keyAlgorithm });\n    return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);\n}\n","import { convertX509PublicKeyToCOSE } from '../helpers/convertX509PublicKeyToCOSE.js';\nimport { isoBase64URL, isoUint8Array } from '../helpers/iso/index.js';\nimport { COSEKEYS, isCOSEPublicKeyEC2, isCOSEPublicKeyRSA } from '../helpers/cose.js';\nimport { mapJWSAlgToCOSEAlg } from '../helpers/mapJWSAlgToCOSEAlg.js';\nimport { verifyEC2 } from '../helpers/iso/isoCrypto/verifyEC2.js';\nimport { verifyRSA } from '../helpers/iso/isoCrypto/verifyRSA.js';\n/**\n * Lightweight verification for FIDO MDS JWTs. Supports use of EC2 and RSA.\n *\n * If this ever needs to support more JWS algorithms, here's the list of them:\n *\n * https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1\n *\n * (Pulled from https://www.rfc-editor.org/rfc/rfc7515#section-4.1.1)\n */\nexport function verifyJWT(jwt, leafCert) {\n    const [header, payload, signature] = jwt.split('.');\n    const certCOSE = convertX509PublicKeyToCOSE(leafCert);\n    const data = isoUint8Array.fromUTF8String(`${header}.${payload}`);\n    const signatureBytes = isoBase64URL.toBuffer(signature);\n    // We just need the `alg` from the header, so only partially define the shape of it\n    const headerJSON = JSON.parse(isoBase64URL.toUTF8String(header));\n    const jwtHeaderHashAlgCOSE = mapJWSAlgToCOSEAlg(headerJSON.alg);\n    if (isCOSEPublicKeyEC2(certCOSE)) {\n        return verifyEC2({\n            data,\n            signature: signatureBytes,\n            cosePublicKey: certCOSE,\n            shaHashOverride: jwtHeaderHashAlgCOSE,\n        });\n    }\n    else if (isCOSEPublicKeyRSA(certCOSE)) {\n        return verifyRSA({\n            data,\n            signature: signatureBytes,\n            cosePublicKey: certCOSE,\n            shaHashOverride: jwtHeaderHashAlgCOSE,\n        });\n    }\n    const kty = certCOSE.get(COSEKEYS.kty);\n    throw new Error(`JWT verification with public key of kty ${kty} is not supported by this method`);\n}\n","import { isoBase64URL } from './iso/index.js';\n/**\n * Take a certificate in PEM format and convert it to bytes\n */\nexport function convertPEMToBytes(pem) {\n    const certBase64 = pem\n        .replace('-----BEGIN CERTIFICATE-----', '')\n        .replace('-----END CERTIFICATE-----', '')\n        .replace(/[\\n ]/g, '');\n    return isoBase64URL.toBuffer(certBase64, 'base64');\n}\n","import { parseJWT } from './parseJWT.js';\nimport { verifyJWT } from './verifyJWT.js';\nimport { validateCertificatePath } from '../helpers/validateCertificatePath.js';\nimport { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.js';\nimport { convertPEMToBytes } from '../helpers/convertPEMToBytes.js';\nimport { SettingsService } from '../services/settingsService.js';\n/**\n * Perform authenticity and integrity verification of a\n * [FIDO Metadata Service (MDS)](https://fidoalliance.org/metadata/)-compatible blob, and then\n * extract the FIDO2 metadata statements included within. This method will make network requests\n * for things like CRL checks.\n *\n * @param blob - A JWT downloaded from an MDS server (e.g. https://mds3.fidoalliance.org)\n */\nexport async function verifyMDSBlob(blob) {\n    // Parse the JWT\n    const parsedJWT = parseJWT(blob);\n    const header = parsedJWT[0];\n    const payload = parsedJWT[1];\n    const headerCertsPEM = header.x5c.map(convertCertBufferToPEM);\n    try {\n        // Validate the certificate chain\n        const rootCerts = SettingsService.getRootCertificates({\n            identifier: 'mds',\n        });\n        await validateCertificatePath(headerCertsPEM, rootCerts);\n    }\n    catch (error) {\n        const _error = error;\n        // From FIDO MDS docs: \"ignore the file if the chain cannot be verified or if one of the\n        // chain certificates is revoked\"\n        throw new Error('BLOB certificate path could not be validated', { cause: _error });\n    }\n    // Verify the BLOB JWT signature\n    const leafCert = headerCertsPEM[0];\n    const verified = await verifyJWT(blob, convertPEMToBytes(leafCert));\n    if (!verified) {\n        // From FIDO MDS docs: \"The FIDO Server SHOULD ignore the file if the signature is invalid.\"\n        throw new Error('BLOB signature could not be verified');\n    }\n    // Cache statements for FIDO2 devices\n    const statements = [];\n    for (const entry of payload.entries) {\n        // Only cache entries with an `aaguid`\n        if (entry.aaguid && entry.metadataStatement) {\n            statements.push(entry.metadataStatement);\n        }\n    }\n    // Convert the nextUpdate property into a Date so we can determine when to re-download\n    const [year, month, day] = payload.nextUpdate.split('-');\n    const parsedNextUpdate = new Date(parseInt(year, 10), \n    // Months need to be zero-indexed\n    parseInt(month, 10) - 1, parseInt(day, 10));\n    return {\n        statements,\n        parsedNextUpdate,\n        payload,\n    };\n}\n","import { COSEKEYS, isCOSEAlg } from '../../cose.js';\nimport { isoBase64URL } from '../../index.js';\nimport { importJWKKey } from './importJWKKey.js';\nimport { getWebCrypto } from './getWebCrypto.js';\nimport { mapCoseAlgToWebCryptoKeyAlgName } from './mapCoseAlgToWebCryptoKeyAlgName.js';\nimport { PQCNotSupportedError } from '../../../errors/index.js';\n/** AKP, a.k.a ML-DSA */\nexport async function verifyAKP(opts) {\n    const { cosePublicKey, signature, data } = opts;\n    const WebCrypto = await getWebCrypto();\n    const alg = cosePublicKey.get(COSEKEYS.alg);\n    const pub = cosePublicKey.get(COSEKEYS.pub);\n    if (!alg) {\n        throw new Error('Public key was missing alg (AKP)');\n    }\n    if (!isCOSEAlg(alg)) {\n        throw new Error(`Public key had invalid alg ${alg} (AKP)`);\n    }\n    if (!pub) {\n        throw new Error('Public key was missing pub (AKP)');\n    }\n    const webCryptoAlg = mapCoseAlgToWebCryptoKeyAlgName(alg);\n    // See https://wicg.github.io/webcrypto-modern-algos/#ml-dsa-operations-import-key -> \"jwk\"\n    const keyData = {\n        kty: 'AKP',\n        alg: webCryptoAlg,\n        pub: isoBase64URL.fromBuffer(pub),\n        ext: false,\n    };\n    /**\n     * ML-DSA support is pretty cutting edge, so take some steps to help RP's understand this instead\n     * of them getting a `NotSupportedError: Unrecognized algorithm name` and trying to interpret it.\n     */\n    let key;\n    try {\n        key = await importJWKKey({ keyData, algorithm: webCryptoAlg });\n    }\n    catch (err) {\n        const _err = err;\n        if (_err.name === 'NotSupportedError') {\n            throw new PQCNotSupportedError(alg);\n        }\n        else {\n            throw err;\n        }\n    }\n    return WebCrypto.subtle.verify(webCryptoAlg, key, signature, data);\n}\n","import { COSECRV, COSEKEYS, isCOSEAlg } from '../../cose.js';\nimport { isoBase64URL } from '../../index.js';\nimport { importJWKKey } from './importJWKKey.js';\nimport { getWebCrypto } from './getWebCrypto.js';\nexport async function verifyOKP(opts) {\n    const { cosePublicKey, signature, data } = opts;\n    const WebCrypto = await getWebCrypto();\n    const alg = cosePublicKey.get(COSEKEYS.alg);\n    const crv = cosePublicKey.get(COSEKEYS.crv);\n    const x = cosePublicKey.get(COSEKEYS.x);\n    if (!alg) {\n        throw new Error('Public key was missing alg (OKP)');\n    }\n    if (!isCOSEAlg(alg)) {\n        throw new Error(`Public key had invalid alg ${alg} (OKP)`);\n    }\n    if (!crv) {\n        throw new Error('Public key was missing crv (OKP)');\n    }\n    if (!x) {\n        throw new Error('Public key was missing x (OKP)');\n    }\n    // Pulled key import steps from here:\n    // https://wicg.github.io/webcrypto-secure-curves/#ed25519-operations\n    let _crv;\n    if (crv === COSECRV.ED25519) {\n        _crv = 'Ed25519';\n    }\n    else {\n        throw new Error(`Unexpected COSE crv value of ${crv} (OKP)`);\n    }\n    const keyData = {\n        kty: 'OKP',\n        crv: _crv,\n        alg: 'EdDSA',\n        x: isoBase64URL.fromBuffer(x),\n        ext: false,\n    };\n    const keyAlgorithm = {\n        name: _crv,\n        namedCurve: _crv,\n    };\n    const key = await importJWKKey({ keyData, algorithm: keyAlgorithm });\n    const verifyAlgorithm = {\n        name: _crv,\n    };\n    return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data);\n}\n","import { AsnParser } from '@peculiar/asn1-schema';\nimport { ECDSASigValue } from '@peculiar/asn1-ecc';\nimport { COSECRV } from '../../cose.js';\nimport { isoUint8Array } from '../index.js';\n/**\n * In WebAuthn, EC2 signatures are wrapped in ASN.1 structure so we need to peel r and s apart.\n *\n * See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types\n */\nexport function unwrapEC2Signature(signature, crv) {\n    const parsedSignature = AsnParser.parse(signature, ECDSASigValue);\n    const rBytes = new Uint8Array(parsedSignature.r);\n    const sBytes = new Uint8Array(parsedSignature.s);\n    const componentLength = getSignatureComponentLength(crv);\n    const rNormalizedBytes = toNormalizedBytes(rBytes, componentLength);\n    const sNormalizedBytes = toNormalizedBytes(sBytes, componentLength);\n    const finalSignature = isoUint8Array.concat([\n        rNormalizedBytes,\n        sNormalizedBytes,\n    ]);\n    return finalSignature;\n}\n/**\n * The SubtleCrypto Web Crypto API expects ECDSA signatures with `r` and `s` values to be encoded\n * to a specific length depending on the order of the curve. This function returns the expected\n * byte-length for each of the `r` and `s` signature components.\n *\n * See <https://www.w3.org/TR/WebCryptoAPI/#ecdsa-operations>\n */\nfunction getSignatureComponentLength(crv) {\n    switch (crv) {\n        case COSECRV.P256:\n            return 32;\n        case COSECRV.P384:\n            return 48;\n        case COSECRV.P521:\n            return 66;\n        default:\n            throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`);\n    }\n}\n/**\n * Converts the ASN.1 integer representation to bytes of a specific length `n`.\n *\n * DER encodes integers as big-endian byte arrays, with as small as possible representation and\n * requires a leading `0` byte to disambiguate between negative and positive numbers. This means\n * that `r` and `s` can potentially not be the expected byte-length that is needed by the\n * SubtleCrypto Web Crypto API: if there are leading `0`s it can be shorter than expected, and if\n * it has a leading `1` bit, it can be one byte longer.\n *\n * See <https://www.itu.int/rec/T-REC-X.690-202102-I/en>\n * See <https://www.w3.org/TR/WebCryptoAPI/#ecdsa-operations>\n */\nfunction toNormalizedBytes(bytes, componentLength) {\n    let normalizedBytes;\n    if (bytes.length < componentLength) {\n        // In case the bytes are shorter than expected, we need to pad it with leading `0`s.\n        normalizedBytes = new Uint8Array(componentLength);\n        normalizedBytes.set(bytes, componentLength - bytes.length);\n    }\n    else if (bytes.length === componentLength) {\n        normalizedBytes = bytes;\n    }\n    else if (bytes.length === componentLength + 1 && bytes[0] === 0 && (bytes[1] & 0x80) === 0x80) {\n        // The bytes contain a leading `0` to encode that the integer is positive. This leading `0`\n        // needs to be removed for compatibility with the SubtleCrypto Web Crypto API.\n        normalizedBytes = bytes.subarray(1);\n    }\n    else {\n        throw new Error(`Invalid signature component length ${bytes.length}, expected ${componentLength}`);\n    }\n    return normalizedBytes;\n}\n","import { COSEKEYS, isCOSECrv, isCOSEPublicKeyAKP, isCOSEPublicKeyEC2, isCOSEPublicKeyOKP, isCOSEPublicKeyRSA, } from '../../cose.js';\nimport { verifyAKP } from './verifyAKP.js';\nimport { verifyEC2 } from './verifyEC2.js';\nimport { verifyRSA } from './verifyRSA.js';\nimport { verifyOKP } from './verifyOKP.js';\nimport { unwrapEC2Signature } from './unwrapEC2Signature.js';\n/**\n * Verify signatures with their public key. Supports EC2 and RSA public keys.\n */\nexport function verify(opts) {\n    const { cosePublicKey, signature, data, shaHashOverride } = opts;\n    if (isCOSEPublicKeyEC2(cosePublicKey)) {\n        const crv = cosePublicKey.get(COSEKEYS.crv);\n        if (!isCOSECrv(crv)) {\n            throw new Error(`unknown COSE curve ${crv}`);\n        }\n        const unwrappedSignature = unwrapEC2Signature(signature, crv);\n        return verifyEC2({\n            cosePublicKey,\n            signature: unwrappedSignature,\n            data,\n            shaHashOverride,\n        });\n    }\n    else if (isCOSEPublicKeyRSA(cosePublicKey)) {\n        return verifyRSA({ cosePublicKey, signature, data, shaHashOverride });\n    }\n    else if (isCOSEPublicKeyOKP(cosePublicKey)) {\n        return verifyOKP({ cosePublicKey, signature, data });\n    }\n    else if (isCOSEPublicKeyAKP(cosePublicKey)) {\n        return verifyAKP({ cosePublicKey, signature, data });\n    }\n    const kty = cosePublicKey.get(COSEKEYS.kty);\n    throw new Error(`Signature verification with public key of kty ${kty} is not supported by this method`);\n}\n","/**\n * A runtime-agnostic collection of methods for working with Uint8Arrays\n * @module\n */\n/**\n * Make sure two Uint8Arrays are deeply equivalent\n */\nexport function areEqual(array1, array2) {\n    if (array1.length != array2.length) {\n        return false;\n    }\n    return array1.every((val, i) => val === array2[i]);\n}\n/**\n * Convert a Uint8Array to Hexadecimal.\n *\n * A replacement for `Buffer.toString('hex')`\n */\nexport function toHex(array) {\n    const hexParts = Array.from(array, (i) => i.toString(16).padStart(2, '0'));\n    // adce000235bcc60a648b0b25f1f05503\n    return hexParts.join('');\n}\n/**\n * Convert a hexadecimal string to isoUint8Array.\n *\n * A replacement for `Buffer.from('...', 'hex')`\n */\nexport function fromHex(hex) {\n    if (!hex) {\n        return Uint8Array.from([]);\n    }\n    const isValid = hex.length !== 0 && hex.length % 2 === 0 &&\n        !/[^a-fA-F0-9]/u.test(hex);\n    if (!isValid) {\n        throw new Error('Invalid hex string');\n    }\n    const byteStrings = hex.match(/.{1,2}/g) ?? [];\n    return Uint8Array.from(byteStrings.map((byte) => parseInt(byte, 16)));\n}\n/**\n * Combine multiple Uint8Arrays into a single Uint8Array\n */\nexport function concat(arrays) {\n    let pointer = 0;\n    const totalLength = arrays.reduce((prev, curr) => prev + curr.length, 0);\n    const toReturn = new Uint8Array(totalLength);\n    arrays.forEach((arr) => {\n        toReturn.set(arr, pointer);\n        pointer += arr.length;\n    });\n    return toReturn;\n}\n/**\n * Convert bytes into a UTF-8 string\n */\nexport function toUTF8String(array) {\n    const decoder = new globalThis.TextDecoder('utf-8');\n    return decoder.decode(array);\n}\n/**\n * Convert a UTF-8 string back into bytes\n */\nexport function fromUTF8String(utf8String) {\n    const encoder = new globalThis.TextEncoder();\n    return encoder.encode(utf8String);\n}\n/**\n * Convert an ASCII string to Uint8Array\n */\nexport function fromASCIIString(value) {\n    return Uint8Array.from(value.split('').map((x) => x.charCodeAt(0)));\n}\n/**\n * Prepare a DataView we can slice our way around in as we parse the bytes in a Uint8Array\n */\nexport function toDataView(array) {\n    return new DataView(array.buffer, array.byteOffset, array.length);\n}\n","import { isoBase64URL } from './iso/index.js';\n/**\n * Convert buffer to an OpenSSL-compatible PEM text format.\n */\nexport function convertCertBufferToPEM(certBuffer) {\n    let b64cert;\n    /**\n     * Get certBuffer to a base64 representation\n     */\n    if (typeof certBuffer === 'string') {\n        if (isoBase64URL.isBase64URL(certBuffer)) {\n            b64cert = isoBase64URL.toBase64(certBuffer);\n        }\n        else if (isoBase64URL.isBase64(certBuffer)) {\n            b64cert = certBuffer;\n        }\n        else {\n            throw new Error('Certificate is not a valid base64 or base64url string');\n        }\n    }\n    else {\n        b64cert = isoBase64URL.fromBuffer(certBuffer, 'base64');\n    }\n    let PEMKey = '';\n    for (let i = 0; i < Math.ceil(b64cert.length / 64); i += 1) {\n        const start = 64 * i;\n        PEMKey += `${b64cert.substr(start, 64)}\\n`;\n    }\n    PEMKey = `-----BEGIN CERTIFICATE-----\\n${PEMKey}-----END CERTIFICATE-----\\n`;\n    return PEMKey;\n}\n","/**\n * Use SubtleCrypto.supports() to understand if the runtime supports using the given key algorithm\n * for signature verification.\n */\nexport function runtimeSupportsWebCryptoKeyAlg(alg) {\n    const globalSubtleCrypto = globalThis.SubtleCrypto;\n    if (typeof globalSubtleCrypto.supports !== 'function') {\n        return false;\n    }\n    try {\n        return globalSubtleCrypto.supports('verify', alg);\n    }\n    catch (_err) {\n        return false;\n    }\n}\n","/**\n * GlobalSign Root CA\n *\n * Downloaded from https://pki.goog/roots.pem\n *\n * Valid until 2028-01-28 @ 04:00 PST\n *\n * SHA256 Fingerprint\n * EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99\n */\nexport const GlobalSign_Root_CA = `-----BEGIN CERTIFICATE-----\nMIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG\nA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv\nb3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw\nMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i\nYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT\naWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ\njc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp\nxy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp\n1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\nsnUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ\nU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8\n9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E\nBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B\nAQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz\nyj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE\n38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP\nAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad\nDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME\nHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n-----END CERTIFICATE-----\n`;\n","/**\n * Google Hardware Attestation Root 1\n *\n * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate\n * (first entry)\n *\n * Valid until 2026-05-24 @ 09:28 PST\n *\n * SHA256 Fingerprint\n * C1:98:4A:3E:F4:5C:1E:2A:91:85:51:DE:10:60:3C:86:F7:05:1B:22:49:C4:89:1C:AE:32:30:EA:BD:0C:97:D5\n */\nexport const Google_Hardware_Attestation_Root_1 = `-----BEGIN CERTIFICATE-----\nMIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy\nODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj\nn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XxzCyaMTjwftkJLkf6724DFhuKug2jITV0QkXvaJWF4nUaHOTNA4u\nJU9WDvZLI1j83A+/xnAJUucIv/zGJ1AMH2boHqF8CY16LpsYgBt6tKxxWH00XcyD\nCdW2KlBCeqbQPcsFmWyWugxdcekhYsAWyoSf818NUsZdBWBaR/OukXrNLfkQ79Iy\nZohZbvabO/X+MVT3rriAoKc8oE2Uws6DF+60PV7/WIPjNvXySdqspImSN78mflxD\nqwLqRBYkA3I75qppLGG9rp7UCdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic\nMDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1\nwDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk\n-----END CERTIFICATE-----\n`;\n/**\n * Google Hardware Attestation Root 2\n *\n * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate\n * (second entry)\n *\n * Valid until 2034-11-18 @ 12:37 PST\n *\n * SHA256 Fingerprint\n * 1E:F1:A0:4B:8B:A5:8A:B9:45:89:AC:49:8C:89:82:A7:83:F2:4E:A7:30:7E:01:59:A0:C3:A7:3B:37:7D:87:CC\n */\nexport const Google_Hardware_Attestation_Root_2 = `-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz\nNzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+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YTnnTUOtOIswUP/Vqd5SYgAI\nmMAfY8U9/iIgkQj6T2W6FsScy94IN9fFhE1UtzmLoBIuUFsVXJMTz+Jucth+IqoW\nFua9v1R93/k98p41pjtFX+H8DslVgfP097vju4KDlqN64xV1grw3ZLl4CiOe/A91\noeLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o\njm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB\nZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH\nex0SdDrx+tWUDqG8At2JHA==\n-----END CERTIFICATE-----\n`;\n/**\n * Google Hardware Attestation Root 3\n *\n * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate\n * (third entry)\n *\n * Valid until 2036-11-13 @ 15:10 PST\n *\n * SHA256 Fingerprint\n * AB:66:41:17:8A:36:E1:79:AA:0C:1C:DD:DF:9A:16:EB:45:FA:20:94:3E:2B:8C:D7:C7:C0:5C:26:CF:8B:48:7A\n */\nexport const Google_Hardware_Attestation_Root_3 = `\n-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx\nMDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj\nnar86461qO0rOs2cXjp3kOG1FE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Qj6oDcfPvq9JySe7pJ6wcHnl5EZ0lwc4xH\n7Y4Dx9RA1JlfooLMw3tOdJZH0enxPXaydfAD3YifeZpFaUzicHeLzVJLt9dvGB0b\nHQLE4+EqKFgOZv2EoP686DQqbVS1u+9k0p2xbMA105TBIk7npraa8VM0fnrRKi7w\nlZKwdH+aNAyhbXRW9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2\nOb3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7\nmD/vFDkzF+wm7cyWpQpCVQ==\n-----END CERTIFICATE-----\n`;\n/**\n * Google Hardware Attestation Root 4\n *\n * Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate\n * (fourth entry)\n *\n * Valid until 2042-03-15 @ 11:07 PDT\n *\n * SHA256 Fingerprint\n * CE:DB:1C:B6:DC:89:6A:E5:EC:79:73:48:BC:E9:28:67:53:C2:B3:8E:E7:1C:E0:FB:E3:4A:9A:12:48:80:0D:FC\n */\nexport const Google_Hardware_Attestation_Root_4 = `\n-----BEGIN CERTIFICATE-----\nMIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw\nNzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B\nAQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS\nSxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7\ntv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj\nnar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0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BRn0/NNfh7uRslOSZ/xKbN9tMBtw37Z8d2vvnXq/YWdsm1+JLVw\nn6yYD/yacNJBlwpddla8eaVMjsF6nBnIgQOf9zKSe06nSTqvgwUHosgOECZJZ1Eu\nzbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo\nvaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn\nw1IdYIg2Wxg7yHcQZemFQg==\n-----END CERTIFICATE-----\n`;\n","/**\n * Apple WebAuthn Root CA\n *\n * Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem\n *\n * Valid until 2045-03-14 @ 17:00 PST\n *\n * SHA256 Fingerprint\n * 09:15:DD:5C:07:A2:8D:B5:49:D1:F6:77:BB:5A:75:D4:BF:BE:95:61:A7:73:42:43:27:76:2E:9E:02:F9:BB:29\n */\nexport const Apple_WebAuthn_Root_CA = `-----BEGIN CERTIFICATE-----\nMIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w\nHQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ\nbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx\nNTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG\nA1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49\nAgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k\nxu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/\npcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk\n2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA\nMGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3\njAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B\n1bWeT0vT\n-----END CERTIFICATE-----\n`;\n","/**\n * GlobalSign Root CA - R3\n *\n * Downloaded from https://valid.r3.roots.globalsign.com/\n *\n * Valid until 2029-03-18 @ 00:00 PST\n *\n * SHA256 Fingerprint\n * CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B\n */\nexport const GlobalSign_Root_CA_R3 = `-----BEGIN CERTIFICATE-----\nMIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G\nA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp\nZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4\nMTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG\nA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8\nRgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT\ngHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm\nKPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd\nQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ\nXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw\nDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o\nLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU\nRUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp\njjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK\n6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX\nmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs\nMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH\nWD9f\n-----END CERTIFICATE-----\n `;\n/**\n * GlobalSign Root R46\n *\n * Downloaded from https://valid.r46.roots.globalsign.com/\n *\n * Valid until 2046-03-20 @ 00:00 PST\n *\n * SHA256 Fingerprint\n * 4F:A3:12:6D:8D:3A:11:D1:C4:85:5A:4F:80:7C:BA:D6:CF:91:9D:3A:5A:88:B0:3B:EA:2C:63:72:D9:3C:40:C9\n */\nexport const GlobalSign_Root_R46 = `-----BEGIN CERTIFICATE-----\nMIIFWjCCA0KgAwIBAgISEdK7udcjGJ5AXwqdLdDfJWfRMA0GCSqGSIb3DQEBDAUA\nMEYxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYD\nVQQDExNHbG9iYWxTaWduIFJvb3QgUjQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMy\nMDAwMDAwMFowRjELMAkGA1UEBhMCQkUxG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IaZHU1VNaL8FpO7XJqti\n2kM3S+LGteWygxk6x9PbTZ4IevPuzz5i+6zoYMzRx6Fcg0XERczzF2sUyQQCPtIk\npnnpHs6i58FZFZ8d4kuaPp92CC1r2LpXFNqD6v6MVenQTqnMdzGxRBF6XLE+0xRF\nFRhiJBPSy03OXIPBNvIQtQ6IbbjhVp+J3pZmOUdkLG5NrmJ7v2B0GbhWrJKsFjLt\nrWhV/pi60zTe9Mlhww6G9kuEYO4Ne7UyWHmRVSyBQ7N0H3qqJZ4d16GLuc1CLgSk\nZoNNiTW2bKg2SnkheCLQQrzRQDGQob4Ez8pn7fXwgNNgyYMqIgXQBztSvwyeqiv5\nu+YfjyW6hY0XHgL+XVAEV8/+LbzvXMAaq7afJMbfc2hIkCwU9D9SGuTSyxTDYWnP\n4vkYxboznxSjBF25cfe1lNj2M8FawTSLfJvdkzrnE6JwYZ+vj+vYxXX4M2bUdGc6\nN3ec592kD3ZDZopD8p/7DEJ4Y9HiD2971KE9dJeFt0g5QdYg/NA6s/rob8SKunE3\nvouXsXgxT7PntgMTzlSdriVZzH81Xwj3QEUxeCp6\n-----END CERTIFICATE-----\n`;\n","import { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.js';\nimport { runtimeSupportsWebCryptoKeyAlg } from '../helpers/iso/isoCrypto/runtimeSupportsWebCryptoKeyAlg.js';\nimport { GlobalSign_Root_CA } from './defaultRootCerts/android-safetynet.js';\nimport { Google_Hardware_Attestation_Root_1, Google_Hardware_Attestation_Root_2, Google_Hardware_Attestation_Root_3, Google_Hardware_Attestation_Root_4, } from './defaultRootCerts/android-key.js';\nimport { Apple_WebAuthn_Root_CA } from './defaultRootCerts/apple.js';\nimport { GlobalSign_Root_CA_R3, GlobalSign_Root_R46 } from './defaultRootCerts/mds.js';\nclass BaseSettingsService {\n    constructor() {\n        // Certificates are stored as PEM-formatted strings\n        Object.defineProperty(this, \"pemCertificates\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: void 0\n        });\n        // Track whether the runtime supports PQC algorithms\n        Object.defineProperty(this, \"_runtimeSupportsPQC\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: void 0\n        });\n        this.pemCertificates = new Map();\n    }\n    setRootCertificates(opts) {\n        const { identifier, certificates } = opts;\n        const newCertificates = [];\n        for (const cert of certificates) {\n            if (cert instanceof Uint8Array) {\n                newCertificates.push(convertCertBufferToPEM(cert));\n            }\n            else {\n                newCertificates.push(cert);\n            }\n        }\n        this.pemCertificates.set(identifier, newCertificates);\n    }\n    getRootCertificates(opts) {\n        const { identifier } = opts;\n        return this.pemCertificates.get(identifier) ?? [];\n    }\n    runtimeSupportsPQC() {\n        this._runtimeSupportsPQC ??= runtimeSupportsWebCryptoKeyAlg('ML-DSA-44');\n        return this._runtimeSupportsPQC;\n    }\n}\n/**\n * A basic service for specifying acceptable root certificates for all supported attestation\n * statement formats.\n *\n * In addition, default root certificates are included for the following statement formats:\n *\n * - `'android-key'`\n * - `'android-safetynet'`\n * - `'apple'`\n * - `'android-mds'`\n *\n * These can be overwritten as needed by setting alternative root certificates for their format\n * identifier using `setRootCertificates()`.\n */\nexport const SettingsService = new BaseSettingsService();\n// Initialize default certificates\nSettingsService.setRootCertificates({\n    identifier: 'android-key',\n    certificates: [\n        Google_Hardware_Attestation_Root_1,\n        Google_Hardware_Attestation_Root_2,\n        Google_Hardware_Attestation_Root_3,\n        Google_Hardware_Attestation_Root_4,\n    ],\n});\nSettingsService.setRootCertificates({\n    identifier: 'android-safetynet',\n    certificates: [GlobalSign_Root_CA],\n});\nSettingsService.setRootCertificates({\n    identifier: 'apple',\n    certificates: [Apple_WebAuthn_Root_CA],\n});\nSettingsService.setRootCertificates({\n    identifier: 'mds',\n    certificates: [\n        GlobalSign_Root_CA_R3,\n        GlobalSign_Root_R46,\n    ],\n});\n","import { SettingsService } from '../services/settingsService.js';\nimport { generateChallenge } from '../helpers/generateChallenge.js';\nimport { generateUserID } from '../helpers/generateUserID.js';\nimport { isoBase64URL, isoUint8Array } from '../helpers/iso/index.js';\nimport { COSEALG } from '../helpers/cose.js';\n/**\n * Set up some default authenticator selection options as per the latest spec:\n * https://www.w3.org/TR/webauthn-2/#dictdef-authenticatorselectioncriteria\n *\n * Helps with some older platforms (e.g. Android 7.0 Nougat) that may not be aware of these\n * defaults.\n */\nconst defaultAuthenticatorSelection = {\n    residentKey: 'preferred',\n    userVerification: 'preferred',\n};\n/**\n * Generate the default array of public key algorithms to offer during registration. Defaults to\n * the most commonly-supported algorithms of EdDSA, ES256, and RS256. When the runtime supports\n * PQC algorithms, ML-DSA-44 is included as the most preferred algorithm.\n */\nexport function getDefaultSupportedAlgorithmIDs() {\n    if (SettingsService.runtimeSupportsPQC()) {\n        return [COSEALG.ML_DSA_44, COSEALG.EdDSA, COSEALG.ES256, COSEALG.RS256];\n    }\n    return [COSEALG.EdDSA, COSEALG.ES256, COSEALG.RS256];\n}\n/**\n * Prepare a value to pass into navigator.credentials.create(...) for authenticator registration\n *\n * **Options:**\n *\n * @param rpName - User-visible, \"friendly\" website/service name\n * @param rpID - Valid domain name (after `https://`)\n * @param userName - User's website-specific username (email, etc...)\n * @param userID **(Optional)** - User's website-specific unique ID. Defaults to generating a random identifier\n * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back. Defaults to generating a random value\n * @param userDisplayName **(Optional)** - User's actual name. Defaults to `\"\"`\n * @param timeout **(Optional)** - How long (in ms) the user can take to complete attestation. Defaults to `60000`\n * @param attestationType **(Optional)** - Specific attestation statement. Defaults to `\"none\"`\n * @param excludeCredentials **(Optional)** - Authenticators registered by the user so the user can't register the same credential multiple times. Defaults to `[]`\n * @param authenticatorSelection **(Optional)** - Advanced criteria for restricting the types of authenticators that may be used. Defaults to `{ residentKey: 'preferred', userVerification: 'preferred' }`\n * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during attestation\n * @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers indicating supported public key algorithms. Import `COSEALG` from \\@simplewebauthn/server/helpers for suitable values. Defaults to `[COSEALG.EdDSA, COSEALG.ES256, COSEALG.RS256]`\n * @param preferredAuthenticatorType **(Optional)** - Encourage the browser to prompt the user to register a specific type of authenticator\n */\nexport async function generateRegistrationOptions(options) {\n    const { rpName, rpID, userName, userID, challenge = await generateChallenge(), userDisplayName = '', timeout = 60000, attestationType = 'none', excludeCredentials = [], authenticatorSelection = defaultAuthenticatorSelection, extensions, supportedAlgorithmIDs = getDefaultSupportedAlgorithmIDs(), preferredAuthenticatorType, } = options;\n    /**\n     * Prepare pubKeyCredParams from the array of algorithm ID's\n     */\n    const pubKeyCredParams = supportedAlgorithmIDs.map((id) => ({\n        alg: id,\n        type: 'public-key',\n    }));\n    /**\n     * Capture some of the nuances of how `residentKey` and `requireResidentKey` how either is set\n     * depending on when either is defined in the options\n     */\n    if (authenticatorSelection.residentKey === undefined) {\n        /**\n         * `residentKey`: \"If no value is given then the effective value is `required` if\n         * requireResidentKey is true or `discouraged` if it is false or absent.\"\n         *\n         * See https://www.w3.org/TR/webauthn-2/#dom-authenticatorselectioncriteria-residentkey\n         */\n        if (authenticatorSelection.requireResidentKey) {\n            authenticatorSelection.residentKey = 'required';\n        }\n        else {\n            /**\n             * FIDO Conformance v1.7.2 fails the first test if we do this, even though this is\n             * technically compatible with the WebAuthn L2 spec...\n             */\n            // authenticatorSelection.residentKey = 'discouraged';\n        }\n    }\n    else {\n        /**\n         * `requireResidentKey`: \"Relying Parties SHOULD set it to true if, and only if, residentKey is\n         * set to \"required\"\"\n         *\n         * Spec says this property defaults to `false` so we should still be okay to assign `false` too\n         *\n         * See https://www.w3.org/TR/webauthn-2/#dom-authenticatorselectioncriteria-requireresidentkey\n         */\n        authenticatorSelection.requireResidentKey = authenticatorSelection.residentKey === 'required';\n    }\n    /**\n     * Preserve ability to specify `string` values for challenges\n     */\n    let _challenge = challenge;\n    if (typeof _challenge === 'string') {\n        _challenge = isoUint8Array.fromUTF8String(_challenge);\n    }\n    /**\n     * Explicitly disallow use of strings for userID anymore because `isoBase64URL.fromBuffer()` below\n     * will return an empty string if one gets through!\n     */\n    if (typeof userID === 'string') {\n        throw new Error(`String values for \\`userID\\` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids`);\n    }\n    /**\n     * Generate a user ID if one is not provided\n     */\n    let _userID = userID;\n    if (!_userID) {\n        _userID = await generateUserID();\n    }\n    /**\n     * Map authenticator preference to hints. Map to authenticatorAttachment as well for\n     * backwards-compatibility.\n     */\n    const hints = [];\n    if (preferredAuthenticatorType) {\n        if (preferredAuthenticatorType === 'securityKey') {\n            hints.push('security-key');\n            authenticatorSelection.authenticatorAttachment = 'cross-platform';\n        }\n        else if (preferredAuthenticatorType === 'localDevice') {\n            hints.push('client-device');\n            authenticatorSelection.authenticatorAttachment = 'platform';\n        }\n        else if (preferredAuthenticatorType === 'remoteDevice') {\n            hints.push('hybrid');\n            authenticatorSelection.authenticatorAttachment = 'cross-platform';\n        }\n    }\n    return {\n        challenge: isoBase64URL.fromBuffer(_challenge),\n        rp: {\n            name: rpName,\n            id: rpID,\n        },\n        user: {\n            id: isoBase64URL.fromBuffer(_userID),\n            name: userName,\n            displayName: userDisplayName,\n        },\n        pubKeyCredParams,\n        timeout,\n        attestation: attestationType,\n        excludeCredentials: excludeCredentials.map((cred) => {\n            if (!isoBase64URL.isBase64URL(cred.id)) {\n                throw new Error(`excludeCredential id \"${cred.id}\" is not a valid base64url string`);\n            }\n            return {\n                ...cred,\n                id: isoBase64URL.trimPadding(cred.id),\n                type: 'public-key',\n            };\n        }),\n        authenticatorSelection,\n        extensions: {\n            ...extensions,\n            credProps: true,\n        },\n        hints,\n    };\n}\n","/**\n * Make sense of Bits 3 and 4 in authenticator indicating:\n *\n * - Whether the credential can be used on multiple devices\n * - Whether the credential is backed up or not\n *\n * Invalid configurations will raise an `Error`\n */\nexport function parseBackupFlags({ be, bs }) {\n    const credentialBackedUp = bs;\n    let credentialDeviceType = 'singleDevice';\n    if (be) {\n        credentialDeviceType = 'multiDevice';\n    }\n    if (credentialDeviceType === 'singleDevice' && credentialBackedUp) {\n        throw new InvalidBackupFlags('Single-device credential indicated that it was backed up, which should be impossible.');\n    }\n    return { credentialDeviceType, credentialBackedUp };\n}\nexport class InvalidBackupFlags extends Error {\n    constructor(message) {\n        super(message);\n        this.name = 'InvalidBackupFlags';\n    }\n}\n","import { toHash } from './toHash.js';\nimport { isoUint8Array } from './iso/index.js';\n/**\n * Go through each expected RP ID and try to find one that matches. Returns the unhashed RP ID\n * that matched the hash in the response.\n *\n * Raises an `UnexpectedRPIDHash` error if no match is found\n */\nexport async function matchExpectedRPID(rpIDHash, expectedRPIDs) {\n    try {\n        const matchedRPID = await Promise.any(expectedRPIDs.map((expected) => {\n            return new Promise((resolve, reject) => {\n                toHash(isoUint8Array.fromASCIIString(expected)).then((expectedRPIDHash) => {\n                    if (isoUint8Array.areEqual(rpIDHash, expectedRPIDHash)) {\n                        resolve(expected);\n                    }\n                    else {\n                        reject();\n                    }\n                });\n            });\n        }));\n        return matchedRPID;\n    }\n    catch (err) {\n        const _err = err;\n        // This means no matches were found\n        if (_err.name === 'AggregateError') {\n            throw new UnexpectedRPIDHash();\n        }\n        // An unexpected error occurred\n        throw err;\n    }\n}\nclass UnexpectedRPIDHash extends Error {\n    constructor() {\n        const message = 'Unexpected RP ID hash';\n        super(message);\n        this.name = 'UnexpectedRPIDHash';\n    }\n}\n","import { convertCOSEtoPKCS } from '../../helpers/convertCOSEtoPKCS.js';\nimport { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';\nimport { validateCertificatePath } from '../../helpers/validateCertificatePath.js';\nimport { verifySignature } from '../../helpers/verifySignature.js';\nimport { isoUint8Array } from '../../helpers/iso/index.js';\nimport { COSEALG } from '../../helpers/cose.js';\n/**\n * Verify an attestation response with fmt 'fido-u2f'\n */\nexport async function verifyAttestationFIDOU2F(options) {\n    const { attStmt, clientDataHash, rpIdHash, credentialID, credentialPublicKey, aaguid, rootCertificates, } = options;\n    const reservedByte = Uint8Array.from([0x00]);\n    const publicKey = convertCOSEtoPKCS(credentialPublicKey);\n    const signatureBase = isoUint8Array.concat([\n        reservedByte,\n        rpIdHash,\n        clientDataHash,\n        credentialID,\n        publicKey,\n    ]);\n    const sig = attStmt.get('sig');\n    const x5c = attStmt.get('x5c');\n    if (!x5c) {\n        throw new Error('No attestation certificate provided in attestation statement (FIDOU2F)');\n    }\n    if (!sig) {\n        throw new Error('No attestation signature provided in attestation statement (FIDOU2F)');\n    }\n    // FIDO spec says that aaguid _must_ equal 0x00 here to be legit\n    const aaguidToHex = Number.parseInt(isoUint8Array.toHex(aaguid), 16);\n    if (aaguidToHex !== 0x00) {\n        throw new Error(`AAGUID \"${aaguidToHex}\" was not expected value`);\n    }\n    try {\n        // Try validating the certificate path using the root certificates set via SettingsService\n        await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates);\n    }\n    catch (err) {\n        const _err = err;\n        throw new Error(`${_err.message} (FIDOU2F)`);\n    }\n    return verifySignature({\n        signature: sig,\n        data: signatureBase,\n        x509Certificate: x5c[0],\n        hashAlgorithm: COSEALG.ES256,\n    });\n}\n","import { AsnParser, OctetString } from '@peculiar/asn1-schema';\nimport { isoUint8Array } from './iso/index.js';\n/**\n * Attestation Certificate Extension OID: `id-fido-gen-ce-aaguid`\n *\n * Sourced from https://fidoalliance.org/specs/fido-v2.0-ps-20150904/fido-key-attestation-v2.0-ps-20150904.html#verifying-an-attestation-statement\n */\nconst id_fido_gen_ce_aaguid = '1.3.6.1.4.1.45724.1.1.4';\n/**\n * Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against\n * the attestation statement AAGUID.\n */\nexport function validateExtFIDOGenCEAAGUID(certExtensions, aaguid) {\n    // The certificate had no extensions so there's nothing to validate\n    if (!certExtensions) {\n        return true;\n    }\n    const extFIDOGenCEAAGUID = certExtensions.find((ext) => ext.extnID === id_fido_gen_ce_aaguid);\n    // The extension isn't present so there's nothing to validate\n    if (!extFIDOGenCEAAGUID) {\n        return true;\n    }\n    // Parse the extension value\n    const parsedExtFIDOGenCEAAGUID = AsnParser.parse(extFIDOGenCEAAGUID.extnValue, OctetString);\n    const extValue = new Uint8Array(parsedExtFIDOGenCEAAGUID.buffer);\n    // Compare the two values\n    const aaguidAndExtAreEqual = isoUint8Array.areEqual(aaguid, extValue);\n    if (!aaguidAndExtAreEqual) {\n        const _debugExtHex = isoUint8Array.toHex(extValue);\n        const _debugAAGUIDHex = isoUint8Array.toHex(aaguid);\n        throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${id_fido_gen_ce_aaguid}) value of \"${_debugExtHex}\" was present but not equal to attestation statement AAGUID value of \"${_debugAAGUIDHex}\"`);\n    }\n    return true;\n}\n","/**\n * A logger instance that doesn't do anything. Useful as a default argument when no custom instance\n * of the `SimpleWebAuthnLogger` interface is specified.\n */\nexport const DefaultNoopLogger = {\n    debug() { },\n    info() { },\n    warn() { },\n    error() { },\n};\n/**\n * Generate an instance of SimpleWebAuthnLogger that defines all methods. Any logging method not\n * defined on `logger` will be a no-op.\n */\nexport function buildLoggerAllMethods(logger) {\n    const toReturn = { ...DefaultNoopLogger };\n    if (logger.debug) {\n        toReturn.debug = logger.debug;\n    }\n    if (logger.info) {\n        toReturn.info = logger.info;\n    }\n    if (logger.warn) {\n        toReturn.warn = logger.warn;\n    }\n    if (logger.error) {\n        toReturn.error = logger.error;\n    }\n    return toReturn;\n}\n","import { convertAAGUIDToString } from '../helpers/convertAAGUIDToString.js';\nimport { verifyMDSBlob } from '../metadata/verifyMDSBlob.js';\nimport { buildLoggerAllMethods, DefaultNoopLogger, } from '../helpers/logging.js';\nimport { fetch } from '../helpers/fetch.js';\n/**\n * An instance of `CachedMDS` that will not trigger attempts to refresh the associated entry's blob\n */\nconst NonRefreshingMDS = {\n    url: '',\n    no: 0,\n    nextUpdate: new Date(0),\n};\nconst defaultURLMDS = 'https://mds.fidoalliance.org/'; // v3\nvar SERVICE_STATE;\n(function (SERVICE_STATE) {\n    SERVICE_STATE[SERVICE_STATE[\"DISABLED\"] = 0] = \"DISABLED\";\n    SERVICE_STATE[SERVICE_STATE[\"REFRESHING\"] = 1] = \"REFRESHING\";\n    SERVICE_STATE[SERVICE_STATE[\"READY\"] = 2] = \"READY\";\n})(SERVICE_STATE || (SERVICE_STATE = {}));\n/**\n * An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand\n * requesting and caching of individual metadata statements.\n *\n * https://fidoalliance.org/metadata/\n */\nexport class BaseMetadataService {\n    constructor() {\n        Object.defineProperty(this, \"mdsCache\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: {}\n        });\n        Object.defineProperty(this, \"statementCache\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: {}\n        });\n        Object.defineProperty(this, \"state\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: SERVICE_STATE.DISABLED\n        });\n        Object.defineProperty(this, \"verificationMode\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: 'strict'\n        });\n        Object.defineProperty(this, \"logger\", {\n            enumerable: true,\n            configurable: true,\n            writable: true,\n            value: DefaultNoopLogger\n        });\n    }\n    async initialize(opts = {}) {\n        // Reset statement cache\n        this.statementCache = {};\n        const { mdsServers = [defaultURLMDS], statements, verificationMode, logger = DefaultNoopLogger, } = opts;\n        this.logger = buildLoggerAllMethods(logger);\n        this.setState(SERVICE_STATE.REFRESHING);\n        /**\n         * If metadata statements are provided, load them into the cache first. These statements will\n         * not be refreshed when a stale one is detected.\n         */\n        if (statements?.length) {\n            let statementsAdded = 0;\n            statements.forEach((statement) => {\n                // Only cache statements that are for FIDO2-compatible authenticators\n                if (statement.aaguid) {\n                    this.statementCache[statement.aaguid] = {\n                        entry: {\n                            metadataStatement: statement,\n                            statusReports: [],\n                            timeOfLastStatusChange: '1970-01-01',\n                        },\n                        url: NonRefreshingMDS.url,\n                    };\n                    statementsAdded += 1;\n                }\n            });\n            this.logger.info(`Cached ${statementsAdded} local statements`);\n        }\n        /**\n         * If MDS servers are provided, then download blobs from them, verify them, and then add their\n         * entries to the cache. Blobs loaded in this way will be refreshed when a stale entry within is\n         * detected.\n         */\n        if (mdsServers?.length) {\n            // Get a current count so we know how many new statements we've added from MDS servers\n            const currentCacheCount = Object.keys(this.statementCache).length;\n            let numServers = mdsServers.length;\n            for (const url of mdsServers) {\n                try {\n                    const cachedMDS = {\n                        url,\n                        no: 0,\n                        nextUpdate: new Date(0),\n                    };\n                    const blob = await this.downloadBlob(cachedMDS);\n                    await this.verifyBlob(blob, cachedMDS);\n                }\n                catch (err) {\n                    // Notify of the error and move on\n                    this.logger.error(`Could not download BLOB from ${url}:`, err);\n                    numServers -= 1;\n                }\n            }\n            // Calculate the difference to get the total number of new statements we successfully added\n            const newCacheCount = Object.keys(this.statementCache).length;\n            const cacheDiff = newCacheCount - currentCacheCount;\n            this.logger.info(`Cached ${cacheDiff} statements from ${numServers} metadata server(s)`);\n        }\n        if (verificationMode) {\n            this.verificationMode = verificationMode;\n        }\n        this.setState(SERVICE_STATE.READY);\n    }\n    async getStatement(aaguid) {\n        if (this.state === SERVICE_STATE.DISABLED) {\n            return;\n        }\n        if (!aaguid) {\n            return;\n        }\n        if (aaguid instanceof Uint8Array) {\n            aaguid = convertAAGUIDToString(aaguid);\n        }\n        // If a cache refresh is in progress then pause this until the service is ready\n        await this.pauseUntilReady();\n        // Try to grab a cached statement\n        const cachedStatement = this.statementCache[aaguid];\n        if (!cachedStatement) {\n            if (this.verificationMode === 'strict') {\n                // FIDO conformance requires RP's to only support registered AAGUID's\n                throw new Error(`No metadata statement found for aaguid \"${aaguid}\"`);\n            }\n            // Allow registration verification to continue without using metadata\n            return;\n        }\n        // If the statement points to an MDS API, check the MDS' nextUpdate to see if we need to refresh\n        if (cachedStatement.url) {\n            const mds = this.mdsCache[cachedStatement.url];\n            const now = new Date();\n            if (now > mds.nextUpdate) {\n                try {\n                    this.setState(SERVICE_STATE.REFRESHING);\n                    const blob = await this.downloadBlob(mds);\n                    await this.verifyBlob(blob, mds);\n                }\n                finally {\n                    this.setState(SERVICE_STATE.READY);\n                }\n            }\n        }\n        const { entry } = cachedStatement;\n        // Check to see if the this aaguid has a status report with a \"compromised\" status\n        for (const report of entry.statusReports) {\n            const { status } = report;\n            if (status === 'USER_VERIFICATION_BYPASS' ||\n                status === 'ATTESTATION_KEY_COMPROMISE' ||\n                status === 'USER_KEY_REMOTE_COMPROMISE' ||\n                status === 'USER_KEY_PHYSICAL_COMPROMISE') {\n                throw new Error(`Detected compromised aaguid \"${aaguid}\"`);\n            }\n        }\n        return entry.metadataStatement;\n    }\n    /**\n     * Download and process the latest BLOB from MDS\n     */\n    async downloadBlob(cachedMDS) {\n        const { url } = cachedMDS;\n        // Get latest \"BLOB\" (FIDO's terminology, not mine)\n        const resp = await fetch(url);\n        const data = await resp.text();\n        return data;\n    }\n    /**\n     * Verify and process the MDS metadata blob\n     */\n    async verifyBlob(blob, cachedMDS) {\n        const { url, no } = cachedMDS;\n        const { payload, parsedNextUpdate } = await verifyMDSBlob(blob);\n        if (payload.no <= no) {\n            // From FIDO MDS docs: \"also ignore the file if its number (no) is less or equal to the\n            // number of the last BLOB cached locally.\"\n            throw new Error(`Latest BLOB no. ${payload.no} is not greater than previous no. ${no}`);\n        }\n        // Cache statements for FIDO2 devices\n        for (const entry of payload.entries) {\n            // Only cache entries with an `aaguid`\n            if (entry.aaguid) {\n                this.statementCache[entry.aaguid] = { entry, url };\n            }\n        }\n        if (url) {\n            // Remember info about the server so we can refresh later\n            this.mdsCache[url] = {\n                ...cachedMDS,\n                // Store the payload `no` to make sure we're getting the next BLOB in the sequence\n                no: payload.no,\n                // Remember when we need to refresh this blob\n                nextUpdate: parsedNextUpdate,\n            };\n        }\n        else {\n            /**\n             * This blob will not be refreshed, but we should still alert if the blob's `nextUpdate` is\n             * in the past\n             */\n            if (parsedNextUpdate < new Date()) {\n                // TODO (Feb 2026): It'd be more actionable for devs if a specific error was raised here,\n                // then this message was logged higher up when it can include the array index of the stale\n                // blob.\n                this.logger.warn(`⚠️ This MDS blob (serial: ${payload.no}) contains stale data as of ${parsedNextUpdate.toISOString()}. Please consider re-initializing MetadataService with a newer MDS blob.`);\n            }\n        }\n    }\n    /**\n     * A helper method to pause execution until the service is ready\n     */\n    pauseUntilReady() {\n        if (this.state === SERVICE_STATE.READY) {\n            return new Promise((resolve) => {\n                resolve();\n            });\n        }\n        // State isn't ready, so set up polling\n        const readyPromise = new Promise((resolve, reject) => {\n            const totalTimeoutMS = 70000;\n            const intervalMS = 100;\n            let iterations = totalTimeoutMS / intervalMS;\n            // Check service state every `intervalMS` milliseconds\n            const intervalID = globalThis.setInterval(() => {\n                if (iterations < 1) {\n                    clearInterval(intervalID);\n                    reject(`State did not become ready in ${totalTimeoutMS / 1000} seconds`);\n                }\n                else if (this.state === SERVICE_STATE.READY) {\n                    clearInterval(intervalID);\n                    resolve();\n                }\n                iterations -= 1;\n            }, intervalMS);\n        });\n        return readyPromise;\n    }\n    /**\n     * Report service status on change\n     */\n    setState(newState) {\n        this.state = newState;\n        if (newState === SERVICE_STATE.DISABLED) {\n            this.logger.debug('MetadataService is DISABLED');\n        }\n        else if (newState === SERVICE_STATE.REFRESHING) {\n            this.logger.debug('MetadataService is REFRESHING');\n        }\n        else if (newState === SERVICE_STATE.READY) {\n            this.logger.debug('MetadataService is READY');\n        }\n    }\n}\n/**\n * A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB\n * download and parsing, and on-demand requesting and caching of individual metadata statements.\n *\n * https://fidoalliance.org/metadata/\n */\nexport const MetadataService = new BaseMetadataService();\n","import { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.js';\nimport { validateCertificatePath } from '../helpers/validateCertificatePath.js';\nimport { decodeCredentialPublicKey } from '../helpers/decodeCredentialPublicKey.js';\nimport { COSEKEYS, COSEKTY, isCOSEPublicKeyEC2, } from '../helpers/cose.js';\n/**\n * Match properties of the authenticator's attestation statement against expected values as\n * registered with the FIDO Alliance Metadata Service\n */\nexport async function verifyAttestationWithMetadata({ statement, credentialPublicKey, x5c, attestationStatementAlg, }) {\n    const { authenticationAlgorithms, authenticatorGetInfo, attestationRootCertificates, } = statement;\n    // Make sure the alg in the attestation statement matches one of the ones specified in metadata\n    const keypairCOSEAlgs = new Set();\n    authenticationAlgorithms.forEach((algSign) => {\n        // Map algSign string to { kty, alg, crv }\n        const algSignCOSEINFO = algSignToCOSEInfoMap[algSign];\n        // Keeping this statement here just in case MDS returns something unexpected\n        if (algSignCOSEINFO) {\n            keypairCOSEAlgs.add(algSignCOSEINFO);\n        }\n    });\n    // Extract the public key's COSE info for comparison\n    const decodedPublicKey = decodeCredentialPublicKey(credentialPublicKey);\n    const kty = decodedPublicKey.get(COSEKEYS.kty);\n    const alg = decodedPublicKey.get(COSEKEYS.alg);\n    if (!kty) {\n        throw new Error('Credential public key was missing kty');\n    }\n    if (!alg) {\n        throw new Error('Credential public key was missing alg');\n    }\n    if (!kty) {\n        throw new Error('Credential public key was missing kty');\n    }\n    // Assume everything is a number because these values should be\n    const publicKeyCOSEInfo = { kty, alg };\n    if (isCOSEPublicKeyEC2(decodedPublicKey)) {\n        const crv = decodedPublicKey.get(COSEKEYS.crv);\n        publicKeyCOSEInfo.crv = crv;\n    }\n    /**\n     * Attempt to match the credential public key's algorithm to one specified in the device's\n     * metadata\n     */\n    let foundMatch = false;\n    for (const keypairAlg of keypairCOSEAlgs) {\n        // Make sure algorithm and key type match\n        if (keypairAlg.alg === publicKeyCOSEInfo.alg &&\n            keypairAlg.kty === publicKeyCOSEInfo.kty) {\n            // If not an RSA keypair then make sure curve numbers match too\n            if ((keypairAlg.kty === COSEKTY.EC2 || keypairAlg.kty === COSEKTY.OKP) &&\n                keypairAlg.crv === publicKeyCOSEInfo.crv) {\n                foundMatch = true;\n            }\n            else {\n                // We've matched an RSA public key's properties\n                foundMatch = true;\n            }\n        }\n        if (foundMatch) {\n            break;\n        }\n    }\n    // Make sure the public key is one of the allowed algorithms\n    if (!foundMatch) {\n        /**\n         * Craft some useful error output from the MDS algorithms\n         *\n         * Example:\n         *\n         * ```\n         * [\n         *   'rsassa_pss_sha256_raw' (COSE info: { kty: 3, alg: -37 }),\n         *   'secp256k1_ecdsa_sha256_raw' (COSE info: { kty: 2, alg: -47, crv: 8 })\n         * ]\n         * ```\n         */\n        const debugMDSAlgs = authenticationAlgorithms.map((algSign) => `'${algSign}' (COSE info: ${stringifyCOSEInfo(algSignToCOSEInfoMap[algSign])})`);\n        const strMDSAlgs = JSON.stringify(debugMDSAlgs, null, 2).replace(/\"/g, '');\n        /**\n         * Construct useful error output about the public key\n         */\n        const strPubKeyAlg = stringifyCOSEInfo(publicKeyCOSEInfo);\n        throw new Error(`Public key parameters ${strPubKeyAlg} did not match any of the following metadata algorithms:\\n${strMDSAlgs}`);\n    }\n    /**\n     * Confirm the attestation statement's algorithm is one supported according to metadata\n     */\n    if (attestationStatementAlg !== undefined &&\n        authenticatorGetInfo?.algorithms !== undefined) {\n        const getInfoAlgs = authenticatorGetInfo.algorithms.map((_alg) => _alg.alg);\n        if (getInfoAlgs.indexOf(attestationStatementAlg) < 0) {\n            throw new Error(`Attestation statement alg ${attestationStatementAlg} did not match one of ${getInfoAlgs}`);\n        }\n    }\n    // Prepare to check the certificate chain\n    const authenticatorCerts = x5c.map(convertCertBufferToPEM);\n    const statementRootCerts = attestationRootCertificates.map(convertCertBufferToPEM);\n    /**\n     * If an authenticator returns exactly one certificate in its x5c, and that cert is found in the\n     * metadata statement then the authenticator is \"self-referencing\". In this case we forego\n     * certificate chain validation.\n     */\n    let authenticatorIsSelfReferencing = false;\n    if (authenticatorCerts.length === 1 &&\n        statementRootCerts.indexOf(authenticatorCerts[0]) >= 0) {\n        authenticatorIsSelfReferencing = true;\n    }\n    if (!authenticatorIsSelfReferencing) {\n        await validateCertificatePath(authenticatorCerts, statementRootCerts);\n    }\n    return true;\n}\n/**\n * Convert ALG_SIGN values to COSE info\n *\n * Values pulled from `ALG_KEY_COSE` definitions in the FIDO Registry of Predefined Values\n *\n * https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms\n */\nexport const algSignToCOSEInfoMap = {\n    secp256r1_ecdsa_sha256_raw: { kty: 2, alg: -7, crv: 1 },\n    secp256r1_ecdsa_sha256_der: { kty: 2, alg: -7, crv: 1 },\n    rsassa_pss_sha256_raw: { kty: 3, alg: -37 },\n    rsassa_pss_sha256_der: { kty: 3, alg: -37 },\n    secp256k1_ecdsa_sha256_raw: { kty: 2, alg: -47, crv: 8 },\n    secp256k1_ecdsa_sha256_der: { kty: 2, alg: -47, crv: 8 },\n    rsassa_pss_sha384_raw: { kty: 3, alg: -38 },\n    rsassa_pkcsv15_sha256_raw: { kty: 3, alg: -257 },\n    rsassa_pkcsv15_sha384_raw: { kty: 3, alg: -258 },\n    rsassa_pkcsv15_sha512_raw: { kty: 3, alg: -259 },\n    rsassa_pkcsv15_sha1_raw: { kty: 3, alg: -65535 },\n    secp384r1_ecdsa_sha384_raw: { kty: 2, alg: -35, crv: 2 },\n    secp512r1_ecdsa_sha256_raw: { kty: 2, alg: -36, crv: 3 },\n    ed25519_eddsa_sha512_raw: { kty: 1, alg: -8, crv: 6 },\n};\n/**\n * A helper to format COSEInfo a little nicer than we can achieve with JSON.stringify()\n *\n * Input: `{ \"kty\": 3, \"alg\": -257 }`\n *\n * Output: `\"{ kty: 3, alg: -257 }\"`\n */\nfunction stringifyCOSEInfo(info) {\n    const { kty, alg, crv } = info;\n    let toReturn = '';\n    if (kty !== COSEKTY.RSA) {\n        toReturn = `{ kty: ${kty}, alg: ${alg}, crv: ${crv} }`;\n    }\n    else {\n        toReturn = `{ kty: ${kty}, alg: ${alg} }`;\n    }\n    return toReturn;\n}\n","import { isCOSEAlg } from '../../helpers/cose.js';\nimport { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';\nimport { validateCertificatePath } from '../../helpers/validateCertificatePath.js';\nimport { getCertificateInfo } from '../../helpers/getCertificateInfo.js';\nimport { verifySignature } from '../../helpers/verifySignature.js';\nimport { isoUint8Array } from '../../helpers/iso/index.js';\nimport { validateExtFIDOGenCEAAGUID } from '../../helpers/validateExtFIDOGenCEAAGUID.js';\nimport { MetadataService } from '../../services/metadataService.js';\nimport { verifyAttestationWithMetadata } from '../../metadata/verifyAttestationWithMetadata.js';\n/**\n * Verify an attestation response with fmt 'packed'\n */\nexport async function verifyAttestationPacked(options) {\n    const { attStmt, clientDataHash, authData, credentialPublicKey, aaguid, rootCertificates, } = options;\n    const sig = attStmt.get('sig');\n    const x5c = attStmt.get('x5c');\n    const alg = attStmt.get('alg');\n    if (!sig) {\n        throw new Error('No attestation signature provided in attestation statement (Packed)');\n    }\n    if (!alg) {\n        throw new Error('Attestation statement did not contain alg (Packed)');\n    }\n    if (!isCOSEAlg(alg)) {\n        throw new Error(`Attestation statement contained invalid alg ${alg} (Packed)`);\n    }\n    const signatureBase = isoUint8Array.concat([authData, clientDataHash]);\n    let verified = false;\n    if (x5c) {\n        const { subject, basicConstraintsCA, version, notBefore, notAfter, parsedCertificate, } = getCertificateInfo(x5c[0]);\n        const { OU, CN, O, C } = subject;\n        if (OU !== 'Authenticator Attestation') {\n            throw new Error('Certificate OU was not \"Authenticator Attestation\" (Packed|Full)');\n        }\n        if (!CN) {\n            throw new Error('Certificate CN was empty (Packed|Full)');\n        }\n        if (!O) {\n            throw new Error('Certificate O was empty (Packed|Full)');\n        }\n        if (!C || C.length !== 2) {\n            throw new Error('Certificate C was not two-character ISO 3166 code (Packed|Full)');\n        }\n        if (basicConstraintsCA) {\n            throw new Error('Certificate basic constraints CA was not `false` (Packed|Full)');\n        }\n        if (version !== 2) {\n            throw new Error('Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)');\n        }\n        let now = new Date();\n        if (notBefore > now) {\n            throw new Error(`Certificate not good before \"${notBefore.toString()}\" (Packed|Full)`);\n        }\n        now = new Date();\n        if (notAfter < now) {\n            throw new Error(`Certificate not good after \"${notAfter.toString()}\" (Packed|Full)`);\n        }\n        // Validate attestation statement AAGUID against leaf cert AAGUID\n        try {\n            await validateExtFIDOGenCEAAGUID(parsedCertificate.tbsCertificate.extensions, aaguid);\n        }\n        catch (err) {\n            const _err = err;\n            throw new Error(`${_err.message} (Packed|Full)`);\n        }\n        // If available, validate attestation alg and x5c with info in the metadata statement\n        const statement = await MetadataService.getStatement(aaguid);\n        if (statement) {\n            // The presence of x5c means this is a full attestation. Check to see if attestationTypes\n            // includes packed attestations.\n            if (statement.attestationTypes.indexOf('basic_full') < 0) {\n                throw new Error('Metadata does not indicate support for full attestations (Packed|Full)');\n            }\n            try {\n                await verifyAttestationWithMetadata({\n                    statement,\n                    credentialPublicKey,\n                    x5c,\n                    attestationStatementAlg: alg,\n                });\n            }\n            catch (err) {\n                const _err = err;\n                throw new Error(`${_err.message} (Packed|Full)`);\n            }\n        }\n        else {\n            try {\n                // Try validating the certificate path using the root certificates set via SettingsService\n                await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates);\n            }\n            catch (err) {\n                const _err = err;\n                throw new Error(`${_err.message} (Packed|Full)`, { cause: _err });\n            }\n        }\n        verified = await verifySignature({\n            signature: sig,\n            data: signatureBase,\n            x509Certificate: x5c[0],\n            hashAlgorithm: alg,\n        });\n    }\n    else {\n        verified = await verifySignature({\n            signature: sig,\n            data: signatureBase,\n            credentialPublicKey,\n            hashAlgorithm: alg,\n        });\n    }\n    return verified;\n}\n","import { toHash } from '../../helpers/toHash.js';\nimport { verifySignature } from '../../helpers/verifySignature.js';\nimport { getCertificateInfo } from '../../helpers/getCertificateInfo.js';\nimport { validateCertificatePath } from '../../helpers/validateCertificatePath.js';\nimport { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';\nimport { isoBase64URL, isoUint8Array } from '../../helpers/iso/index.js';\nimport { MetadataService } from '../../services/metadataService.js';\nimport { verifyAttestationWithMetadata } from '../../metadata/verifyAttestationWithMetadata.js';\n/**\n * Verify an attestation response with fmt 'android-safetynet'\n */\nexport async function verifyAttestationAndroidSafetyNet(options) {\n    const { attStmt, clientDataHash, authData, aaguid, rootCertificates, verifyTimestampMS = true, credentialPublicKey, attestationSafetyNetEnforceCTSCheck, } = options;\n    const alg = attStmt.get('alg');\n    const response = attStmt.get('response');\n    const ver = attStmt.get('ver');\n    if (!ver) {\n        throw new Error('No ver value in attestation (SafetyNet)');\n    }\n    if (!response) {\n        throw new Error('No response was included in attStmt by authenticator (SafetyNet)');\n    }\n    // Prepare to verify a JWT\n    const jwt = isoUint8Array.toUTF8String(response);\n    const jwtParts = jwt.split('.');\n    const HEADER = JSON.parse(isoBase64URL.toUTF8String(jwtParts[0]));\n    const PAYLOAD = JSON.parse(isoBase64URL.toUTF8String(jwtParts[1]));\n    const SIGNATURE = jwtParts[2];\n    /**\n     * START Verify PAYLOAD\n     */\n    const { nonce, ctsProfileMatch, timestampMs } = PAYLOAD;\n    if (verifyTimestampMS) {\n        // Make sure timestamp is in the past\n        let now = Date.now();\n        if (timestampMs > Date.now()) {\n            throw new Error(`Payload timestamp \"${timestampMs}\" was later than \"${now}\" (SafetyNet)`);\n        }\n        // Consider a SafetyNet attestation valid within a minute of it being performed\n        const timestampPlusDelay = timestampMs + 60 * 1000;\n        now = Date.now();\n        if (timestampPlusDelay < now) {\n            throw new Error(`Payload timestamp \"${timestampPlusDelay}\" has expired (SafetyNet)`);\n        }\n    }\n    const nonceBase = isoUint8Array.concat([authData, clientDataHash]);\n    const nonceBuffer = await toHash(nonceBase);\n    const expectedNonce = isoBase64URL.fromBuffer(nonceBuffer, 'base64');\n    if (nonce !== expectedNonce) {\n        throw new Error('Could not verify payload nonce (SafetyNet)');\n    }\n    if (attestationSafetyNetEnforceCTSCheck && !ctsProfileMatch) {\n        throw new Error('Could not verify device integrity (SafetyNet)');\n    }\n    /**\n     * END Verify PAYLOAD\n     */\n    /**\n     * START Verify Header\n     */\n    // `HEADER.x5c[0]` is definitely a base64 string\n    const leafCertBuffer = isoBase64URL.toBuffer(HEADER.x5c[0], 'base64');\n    const leafCertInfo = getCertificateInfo(leafCertBuffer);\n    const { subject } = leafCertInfo;\n    // Ensure the certificate was issued to this hostname\n    // See https://developer.android.com/training/safetynet/attestation#verify-attestation-response\n    if (subject.CN !== 'attest.android.com') {\n        throw new Error('Certificate common name was not \"attest.android.com\" (SafetyNet)');\n    }\n    const statement = await MetadataService.getStatement(aaguid);\n    if (statement) {\n        try {\n            await verifyAttestationWithMetadata({\n                statement,\n                credentialPublicKey,\n                x5c: HEADER.x5c,\n                attestationStatementAlg: alg,\n            });\n        }\n        catch (err) {\n            const _err = err;\n            throw new Error(`${_err.message} (SafetyNet)`);\n        }\n    }\n    else {\n        try {\n            // Try validating the certificate path using the root certificates set via SettingsService\n            await validateCertificatePath(HEADER.x5c.map(convertCertBufferToPEM), rootCertificates);\n        }\n        catch (err) {\n            const _err = err;\n            throw new Error(`${_err.message} (SafetyNet)`);\n        }\n    }\n    /**\n     * END Verify Header\n     */\n    /**\n     * START Verify Signature\n     */\n    const signatureBaseBuffer = isoUint8Array.fromUTF8String(`${jwtParts[0]}.${jwtParts[1]}`);\n    const signatureBuffer = isoBase64URL.toBuffer(SIGNATURE);\n    const verified = await verifySignature({\n        signature: signatureBuffer,\n        data: signatureBaseBuffer,\n        x509Certificate: leafCertBuffer,\n        hashAlgorithm: alg,\n    });\n    /**\n     * END Verify Signature\n     */\n    return verified;\n}\n","// deno-lint-ignore-file no-dupe-keys\n/**\n * A whole lotta domain knowledge is captured here, with hazy connections to source\n * documents. Good places to start searching for more info on these values are the\n * following Trusted Computing Group TPM Library docs linked in the WebAuthn API:\n *\n * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.38.pdf\n * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf\n * - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-3-Commands-01.38.pdf\n */\n/**\n * 6.9 TPM_ST (Structure Tags)\n */\nexport const TPM_ST = {\n    0x00c4: 'TPM_ST_RSP_COMMAND',\n    0x8000: 'TPM_ST_NULL',\n    0x8001: 'TPM_ST_NO_SESSIONS',\n    0x8002: 'TPM_ST_SESSIONS',\n    0x8014: 'TPM_ST_ATTEST_NV',\n    0x8015: 'TPM_ST_ATTEST_COMMAND_AUDIT',\n    0x8016: 'TPM_ST_ATTEST_SESSION_AUDIT',\n    0x8017: 'TPM_ST_ATTEST_CERTIFY',\n    0x8018: 'TPM_ST_ATTEST_QUOTE',\n    0x8019: 'TPM_ST_ATTEST_TIME',\n    0x801a: 'TPM_ST_ATTEST_CREATION',\n    0x8021: 'TPM_ST_CREATION',\n    0x8022: 'TPM_ST_VERIFIED',\n    0x8023: 'TPM_ST_AUTH_SECRET',\n    0x8024: 'TPM_ST_HASHCHECK',\n    0x8025: 'TPM_ST_AUTH_SIGNED',\n    0x8029: 'TPM_ST_FU_MANIFEST',\n};\n/**\n * 6.3 TPM_ALG_ID\n */\nexport const TPM_ALG = {\n    0x0000: 'TPM_ALG_ERROR',\n    0x0001: 'TPM_ALG_RSA',\n    0x0004: 'TPM_ALG_SHA',\n    // @ts-ignore 2300\n    0x0004: 'TPM_ALG_SHA1',\n    0x0005: 'TPM_ALG_HMAC',\n    0x0006: 'TPM_ALG_AES',\n    0x0007: 'TPM_ALG_MGF1',\n    0x0008: 'TPM_ALG_KEYEDHASH',\n    0x000a: 'TPM_ALG_XOR',\n    0x000b: 'TPM_ALG_SHA256',\n    0x000c: 'TPM_ALG_SHA384',\n    0x000d: 'TPM_ALG_SHA512',\n    0x0010: 'TPM_ALG_NULL',\n    0x0012: 'TPM_ALG_SM3_256',\n    0x0013: 'TPM_ALG_SM4',\n    0x0014: 'TPM_ALG_RSASSA',\n    0x0015: 'TPM_ALG_RSAES',\n    0x0016: 'TPM_ALG_RSAPSS',\n    0x0017: 'TPM_ALG_OAEP',\n    0x0018: 'TPM_ALG_ECDSA',\n    0x0019: 'TPM_ALG_ECDH',\n    0x001a: 'TPM_ALG_ECDAA',\n    0x001b: 'TPM_ALG_SM2',\n    0x001c: 'TPM_ALG_ECSCHNORR',\n    0x001d: 'TPM_ALG_ECMQV',\n    0x0020: 'TPM_ALG_KDF1_SP800_56A',\n    0x0021: 'TPM_ALG_KDF2',\n    0x0022: 'TPM_ALG_KDF1_SP800_108',\n    0x0023: 'TPM_ALG_ECC',\n    0x0025: 'TPM_ALG_SYMCIPHER',\n    0x0026: 'TPM_ALG_CAMELLIA',\n    0x0040: 'TPM_ALG_CTR',\n    0x0041: 'TPM_ALG_OFB',\n    0x0042: 'TPM_ALG_CBC',\n    0x0043: 'TPM_ALG_CFB',\n    0x0044: 'TPM_ALG_ECB',\n};\n/**\n * 6.4 TPM_ECC_CURVE\n */\nexport const TPM_ECC_CURVE = {\n    0x0000: 'TPM_ECC_NONE',\n    0x0001: 'TPM_ECC_NIST_P192',\n    0x0002: 'TPM_ECC_NIST_P224',\n    0x0003: 'TPM_ECC_NIST_P256',\n    0x0004: 'TPM_ECC_NIST_P384',\n    0x0005: 'TPM_ECC_NIST_P521',\n    0x0010: 'TPM_ECC_BN_P256',\n    0x0011: 'TPM_ECC_BN_P638',\n    0x0020: 'TPM_ECC_SM2_P256',\n};\n/**\n * Sourced from https://trustedcomputinggroup.org/resource/vendor-id-registry/\n *\n * Latest version:\n * https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-Vendor-ID-Registry-Version-1.02-Revision-1.00.pdf\n */\nexport const TPM_MANUFACTURERS = {\n    'id:414D4400': { name: 'AMD', id: 'AMD' },\n    'id:414E5400': { name: 'Ant Group', id: 'ANT' },\n    'id:41544D4C': { name: 'Atmel', id: 'ATML' },\n    'id:4252434D': { name: 'Broadcom', id: 'BRCM' },\n    'id:4353434F': { name: 'Cisco', id: 'CSCO' },\n    'id:464C5953': { name: 'Flyslice Technologies', id: 'FLYS' },\n    'id:524F4343': { name: 'Fuzhou Rockchip', id: 'ROCC' },\n    'id:474F4F47': { name: 'Google', id: 'GOOG' },\n    'id:48504900': { name: 'HPI', id: 'HPI' },\n    'id:48504500': { name: 'HPE', id: 'HPE' },\n    'id:48495349': { name: 'Huawei', id: 'HISI' },\n    'id:49424D00': { name: 'IBM', id: 'IBM' }, // IBM is \"id:49424d00\" in the TPM spec. It's been normalized here\n    'id:49465800': { name: 'Infineon', id: 'IFX' },\n    'id:494E5443': { name: 'Intel', id: 'INTC' },\n    'id:4C454E00': { name: 'Lenovo', id: 'LEN' },\n    'id:4D534654': { name: 'Microsoft', id: 'MSFT' },\n    'id:4E534D20': { name: 'National Semiconductor', id: 'NSM' },\n    'id:4E545A00': { name: 'Nationz', id: 'NTZ' },\n    'id:4E534700': { name: 'NSING', id: 'NSG' },\n    'id:4E544300': { name: 'Nuvoton Technology', id: 'NTC' },\n    'id:51434F4D': { name: 'Qualcomm', id: 'QCOM' },\n    'id:534D534E': { name: 'Samsung', id: 'SMSN' },\n    'id:53454345': { name: 'SecEdge', id: 'SECE' },\n    'id:534E5300': { name: 'Sinosun', id: 'SNS' },\n    'id:534D5343': { name: 'SMSC', id: 'SMSC' },\n    'id:53544D20': { name: 'STMicroelectronics', id: 'STM' },\n    'id:54584E00': { name: 'Texas Instruments', id: 'TXN' },\n    'id:57454300': { name: 'Winbond', id: 'WEC' },\n    'id:5345414C': { name: 'Wisekey', id: 'SEAL' },\n    'id:FFFFF1D0': { name: 'FIDO Alliance', id: 'FIDO' }, // FIDO Conformance\n};\n/**\n * Match TPM public area curve ID's to `crv` numbers used in COSE public keys\n */\nexport const TPM_ECC_CURVE_COSE_CRV_MAP = {\n    TPM_ECC_NIST_P256: 1, // p256\n    TPM_ECC_NIST_P384: 2, // p384\n    TPM_ECC_NIST_P521: 3, // p521\n    TPM_ECC_BN_P256: 1, // p256\n    TPM_ECC_SM2_P256: 1, // p256\n};\n","import { TPM_ALG, TPM_ST } from './constants.js';\nimport { isoUint8Array } from '../../../helpers/iso/index.js';\n/**\n * Cut up a TPM attestation's certInfo into intelligible chunks\n */\nexport function parseCertInfo(certInfo) {\n    let pointer = 0;\n    const dataView = isoUint8Array.toDataView(certInfo);\n    // Get a magic constant\n    const magic = dataView.getUint32(pointer);\n    pointer += 4;\n    // Determine the algorithm used for attestation\n    const typeBuffer = dataView.getUint16(pointer);\n    pointer += 2;\n    const type = TPM_ST[typeBuffer];\n    // The name of a parent entity, can be ignored\n    const qualifiedSignerLength = dataView.getUint16(pointer);\n    pointer += 2;\n    const qualifiedSigner = certInfo.slice(pointer, pointer += qualifiedSignerLength);\n    // Get the expected hash of `attsToBeSigned`\n    const extraDataLength = dataView.getUint16(pointer);\n    pointer += 2;\n    const extraData = certInfo.slice(pointer, pointer += extraDataLength);\n    // Information about the TPM device's internal clock, can be ignored\n    const clock = certInfo.slice(pointer, pointer += 8);\n    const resetCount = dataView.getUint32(pointer);\n    pointer += 4;\n    const restartCount = dataView.getUint32(pointer);\n    pointer += 4;\n    const safe = !!certInfo.slice(pointer, pointer += 1);\n    const clockInfo = { clock, resetCount, restartCount, safe };\n    // TPM device firmware version\n    const firmwareVersion = certInfo.slice(pointer, pointer += 8);\n    // Attested Name\n    const attestedNameLength = dataView.getUint16(pointer);\n    pointer += 2;\n    const attestedName = certInfo.slice(pointer, pointer += attestedNameLength);\n    const attestedNameDataView = isoUint8Array.toDataView(attestedName);\n    // Attested qualified name, can be ignored\n    const qualifiedNameLength = dataView.getUint16(pointer);\n    pointer += 2;\n    const qualifiedName = certInfo.slice(pointer, pointer += qualifiedNameLength);\n    const attested = {\n        nameAlg: TPM_ALG[attestedNameDataView.getUint16(0)],\n        nameAlgBuffer: attestedName.slice(0, 2),\n        name: attestedName,\n        qualifiedName,\n    };\n    return {\n        magic,\n        type,\n        qualifiedSigner,\n        extraData,\n        clockInfo,\n        firmwareVersion,\n        attested,\n    };\n}\n","import { TPM_ALG, TPM_ECC_CURVE } from './constants.js';\nimport { isoUint8Array } from '../../../helpers/iso/index.js';\n/**\n * Break apart a TPM attestation's pubArea buffer\n *\n * See 12.2.4 TPMT_PUBLIC here:\n * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf\n */\nexport function parsePubArea(pubArea) {\n    let pointer = 0;\n    const dataView = isoUint8Array.toDataView(pubArea);\n    const type = TPM_ALG[dataView.getUint16(pointer)];\n    pointer += 2;\n    const nameAlg = TPM_ALG[dataView.getUint16(pointer)];\n    pointer += 2;\n    // Get some authenticator attributes(?)\n    // const objectAttributesInt = pubArea.slice(pointer, (pointer += 4)).readUInt32BE(0);\n    const objectAttributesInt = dataView.getUint32(pointer);\n    pointer += 4;\n    const objectAttributes = {\n        fixedTPM: !!(objectAttributesInt & 1),\n        stClear: !!(objectAttributesInt & 2),\n        fixedParent: !!(objectAttributesInt & 8),\n        sensitiveDataOrigin: !!(objectAttributesInt & 16),\n        userWithAuth: !!(objectAttributesInt & 32),\n        adminWithPolicy: !!(objectAttributesInt & 64),\n        noDA: !!(objectAttributesInt & 512),\n        encryptedDuplication: !!(objectAttributesInt & 1024),\n        restricted: !!(objectAttributesInt & 32768),\n        decrypt: !!(objectAttributesInt & 65536),\n        signOrEncrypt: !!(objectAttributesInt & 131072),\n    };\n    // Slice out the authPolicy of dynamic length\n    const authPolicyLength = dataView.getUint16(pointer);\n    pointer += 2;\n    const authPolicy = pubArea.slice(pointer, pointer += authPolicyLength);\n    // Extract additional curve params according to type\n    const parameters = {};\n    let unique = Uint8Array.from([]);\n    if (type === 'TPM_ALG_RSA') {\n        const symmetric = TPM_ALG[dataView.getUint16(pointer)];\n        pointer += 2;\n        const scheme = TPM_ALG[dataView.getUint16(pointer)];\n        pointer += 2;\n        const keyBits = dataView.getUint16(pointer);\n        pointer += 2;\n        const exponent = dataView.getUint32(pointer);\n        pointer += 4;\n        parameters.rsa = { symmetric, scheme, keyBits, exponent };\n        /**\n         * See 11.2.4.5 TPM2B_PUBLIC_KEY_RSA here:\n         * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf\n         */\n        // const uniqueLength = pubArea.slice(pointer, (pointer += 2)).readUInt16BE(0);\n        const uniqueLength = dataView.getUint16(pointer);\n        pointer += 2;\n        unique = pubArea.slice(pointer, pointer += uniqueLength);\n    }\n    else if (type === 'TPM_ALG_ECC') {\n        const symmetric = TPM_ALG[dataView.getUint16(pointer)];\n        pointer += 2;\n        const scheme = TPM_ALG[dataView.getUint16(pointer)];\n        pointer += 2;\n        const curveID = TPM_ECC_CURVE[dataView.getUint16(pointer)];\n        pointer += 2;\n        const kdf = TPM_ALG[dataView.getUint16(pointer)];\n        pointer += 2;\n        parameters.ecc = { symmetric, scheme, curveID, kdf };\n        /**\n         * See 11.2.5.1 TPM2B_ECC_PARAMETER here:\n         * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf\n         */\n        // Retrieve X\n        const uniqueXLength = dataView.getUint16(pointer);\n        pointer += 2;\n        const uniqueX = pubArea.slice(pointer, pointer += uniqueXLength);\n        // Retrieve Y\n        const uniqueYLength = dataView.getUint16(pointer);\n        pointer += 2;\n        const uniqueY = pubArea.slice(pointer, pointer += uniqueYLength);\n        unique = isoUint8Array.concat([uniqueX, uniqueY]);\n    }\n    else {\n        throw new Error(`Unexpected type \"${type}\" (TPM)`);\n    }\n    return {\n        type,\n        nameAlg,\n        objectAttributes,\n        authPolicy,\n        parameters,\n        unique,\n    };\n}\n","import { TPM_MANUFACTURERS } from './constants.js';\nexport function getTPMManufacturerInfo(id) {\n    // e.g. \"id:51434f4d\" -> \"id:51434f4D\"\n    const _normalized = `id:${id.substring(3).toUpperCase()}`;\n    return TPM_MANUFACTURERS[_normalized];\n}\n","import { AsnParser } from '@peculiar/asn1-schema';\nimport { Certificate, ExtendedKeyUsage, id_ce_extKeyUsage, id_ce_subjectAltName, SubjectAlternativeName, } from '@peculiar/asn1-x509';\nimport { decodeCredentialPublicKey } from '../../../helpers/decodeCredentialPublicKey.js';\nimport { COSEALG, COSEKEYS, isCOSEAlg, isCOSEPublicKeyEC2, isCOSEPublicKeyRSA, } from '../../../helpers/cose.js';\nimport { toHash } from '../../../helpers/toHash.js';\nimport { convertCertBufferToPEM } from '../../../helpers/convertCertBufferToPEM.js';\nimport { validateCertificatePath } from '../../../helpers/validateCertificatePath.js';\nimport { getCertificateInfo } from '../../../helpers/getCertificateInfo.js';\nimport { verifySignature } from '../../../helpers/verifySignature.js';\nimport { isoUint8Array } from '../../../helpers/iso/index.js';\nimport { validateExtFIDOGenCEAAGUID } from '../../../helpers/validateExtFIDOGenCEAAGUID.js';\nimport { MetadataService } from '../../../services/metadataService.js';\nimport { verifyAttestationWithMetadata } from '../../../metadata/verifyAttestationWithMetadata.js';\nimport { TPM_ECC_CURVE_COSE_CRV_MAP } from './constants.js';\nimport { parseCertInfo } from './parseCertInfo.js';\nimport { parsePubArea } from './parsePubArea.js';\nimport { getTPMManufacturerInfo } from './isValidTPMManufacturerID.js';\nexport async function verifyAttestationTPM(options) {\n    const { aaguid, attStmt, authData, credentialPublicKey, clientDataHash, rootCertificates, } = options;\n    const ver = attStmt.get('ver');\n    const sig = attStmt.get('sig');\n    const alg = attStmt.get('alg');\n    const x5c = attStmt.get('x5c');\n    const pubArea = attStmt.get('pubArea');\n    const certInfo = attStmt.get('certInfo');\n    /**\n     * Verify structures\n     */\n    if (ver !== '2.0') {\n        throw new Error(`Unexpected ver \"${ver}\", expected \"2.0\" (TPM)`);\n    }\n    if (!sig) {\n        throw new Error('No attestation signature provided in attestation statement (TPM)');\n    }\n    if (!alg) {\n        throw new Error(`Attestation statement did not contain alg (TPM)`);\n    }\n    if (!isCOSEAlg(alg)) {\n        throw new Error(`Attestation statement contained invalid alg ${alg} (TPM)`);\n    }\n    if (!x5c) {\n        throw new Error('No attestation certificate provided in attestation statement (TPM)');\n    }\n    if (!pubArea) {\n        throw new Error('Attestation statement did not contain pubArea (TPM)');\n    }\n    if (!certInfo) {\n        throw new Error('Attestation statement did not contain certInfo (TPM)');\n    }\n    const parsedPubArea = parsePubArea(pubArea);\n    const { unique, type: pubType, parameters } = parsedPubArea;\n    // Verify that the public key specified by the parameters and unique fields of pubArea is\n    // identical to the credentialPublicKey in the attestedCredentialData in authenticatorData.\n    const cosePublicKey = decodeCredentialPublicKey(credentialPublicKey);\n    if (pubType === 'TPM_ALG_RSA') {\n        if (!isCOSEPublicKeyRSA(cosePublicKey)) {\n            throw new Error(`Credential public key with kty ${cosePublicKey.get(COSEKEYS.kty)} did not match ${pubType}`);\n        }\n        const n = cosePublicKey.get(COSEKEYS.n);\n        const e = cosePublicKey.get(COSEKEYS.e);\n        if (!n) {\n            throw new Error('COSE public key missing n (TPM|RSA)');\n        }\n        if (!e) {\n            throw new Error('COSE public key missing e (TPM|RSA)');\n        }\n        if (!isoUint8Array.areEqual(unique, n)) {\n            throw new Error('PubArea unique is not same as credentialPublicKey (TPM|RSA)');\n        }\n        if (!parameters.rsa) {\n            throw new Error(`Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)`);\n        }\n        const eBuffer = e;\n        // If `exponent` is equal to 0x00, then exponent is the default RSA exponent of 2^16+1 (65537)\n        const pubAreaExponent = parameters.rsa.exponent || 65537;\n        // Do some bit shifting to get to an integer\n        const eSum = eBuffer[0] + (eBuffer[1] << 8) + (eBuffer[2] << 16);\n        if (pubAreaExponent !== eSum) {\n            throw new Error(`Unexpected public key exp ${eSum}, expected ${pubAreaExponent} (TPM|RSA)`);\n        }\n    }\n    else if (pubType === 'TPM_ALG_ECC') {\n        if (!isCOSEPublicKeyEC2(cosePublicKey)) {\n            throw new Error(`Credential public key with kty ${cosePublicKey.get(COSEKEYS.kty)} did not match ${pubType}`);\n        }\n        const crv = cosePublicKey.get(COSEKEYS.crv);\n        const x = cosePublicKey.get(COSEKEYS.x);\n        const y = cosePublicKey.get(COSEKEYS.y);\n        if (!crv) {\n            throw new Error('COSE public key missing crv (TPM|ECC)');\n        }\n        if (!x) {\n            throw new Error('COSE public key missing x (TPM|ECC)');\n        }\n        if (!y) {\n            throw new Error('COSE public key missing y (TPM|ECC)');\n        }\n        if (!isoUint8Array.areEqual(unique, isoUint8Array.concat([x, y]))) {\n            throw new Error('PubArea unique is not same as public key x and y (TPM|ECC)');\n        }\n        if (!parameters.ecc) {\n            throw new Error(`Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)`);\n        }\n        const pubAreaCurveID = parameters.ecc.curveID;\n        const pubAreaCurveIDMapToCOSECRV = TPM_ECC_CURVE_COSE_CRV_MAP[pubAreaCurveID];\n        if (pubAreaCurveIDMapToCOSECRV !== crv) {\n            throw new Error(`Public area key curve ID \"${pubAreaCurveID}\" mapped to \"${pubAreaCurveIDMapToCOSECRV}\" which did not match public key crv of \"${crv}\" (TPM|ECC)`);\n        }\n    }\n    else {\n        throw new Error(`Unsupported pubArea.type \"${pubType}\"`);\n    }\n    const parsedCertInfo = parseCertInfo(certInfo);\n    const { magic, type: certType, attested, extraData } = parsedCertInfo;\n    if (magic !== 0xff544347) {\n        throw new Error(`Unexpected magic value \"${magic}\", expected \"0xff544347\" (TPM)`);\n    }\n    if (certType !== 'TPM_ST_ATTEST_CERTIFY') {\n        throw new Error(`Unexpected type \"${certType}\", expected \"TPM_ST_ATTEST_CERTIFY\" (TPM)`);\n    }\n    // Hash pubArea to create pubAreaHash using the nameAlg in attested\n    const pubAreaHash = await toHash(pubArea, attestedNameAlgToCOSEAlg(attested.nameAlg));\n    // Concatenate attested.nameAlg and pubAreaHash to create attestedName.\n    const attestedName = isoUint8Array.concat([\n        attested.nameAlgBuffer,\n        pubAreaHash,\n    ]);\n    // Check that certInfo.attested.name is equals to attestedName.\n    if (!isoUint8Array.areEqual(attested.name, attestedName)) {\n        throw new Error(`Attested name comparison failed (TPM)`);\n    }\n    // Concatenate authData with clientDataHash to create attToBeSigned\n    const attToBeSigned = isoUint8Array.concat([authData, clientDataHash]);\n    // Hash attToBeSigned using the algorithm specified in attStmt.alg to create attToBeSignedHash\n    const attToBeSignedHash = await toHash(attToBeSigned, alg);\n    // Check that certInfo.extraData is equals to attToBeSignedHash.\n    if (!isoUint8Array.areEqual(extraData, attToBeSignedHash)) {\n        throw new Error('CertInfo extra data did not equal hashed attestation (TPM)');\n    }\n    /**\n     * Verify signature\n     */\n    if (x5c.length < 1) {\n        throw new Error('No certificates present in x5c array (TPM)');\n    }\n    // Pick a leaf AIK certificate of the x5c array and parse it.\n    const leafCertInfo = getCertificateInfo(x5c[0]);\n    const { basicConstraintsCA, version, subject, notAfter, notBefore } = leafCertInfo;\n    if (basicConstraintsCA) {\n        throw new Error('Certificate basic constraints CA was not `false` (TPM)');\n    }\n    // Check that certificate is of version 3 (value must be set to 2).\n    if (version !== 2) {\n        throw new Error('Certificate version was not `3` (ASN.1 value of 2) (TPM)');\n    }\n    // Check that Subject sequence is empty.\n    if (subject.combined.length > 0) {\n        throw new Error('Certificate subject was not empty (TPM)');\n    }\n    // Check that certificate is currently valid\n    let now = new Date();\n    if (notBefore > now) {\n        throw new Error(`Certificate not good before \"${notBefore.toString()}\" (TPM)`);\n    }\n    // Check that certificate has not expired\n    now = new Date();\n    if (notAfter < now) {\n        throw new Error(`Certificate not good after \"${notAfter.toString()}\" (TPM)`);\n    }\n    /**\n     * Plumb the depths of the certificate's ASN.1-formatted data for some values we need to verify\n     */\n    const parsedCert = AsnParser.parse(x5c[0], Certificate);\n    if (!parsedCert.tbsCertificate.extensions) {\n        throw new Error('Certificate was missing extensions (TPM)');\n    }\n    let subjectAltNamePresent;\n    let extKeyUsage;\n    parsedCert.tbsCertificate.extensions.forEach((ext) => {\n        if (ext.extnID === id_ce_subjectAltName) {\n            subjectAltNamePresent = AsnParser.parse(ext.extnValue, SubjectAlternativeName);\n        }\n        else if (ext.extnID === id_ce_extKeyUsage) {\n            extKeyUsage = AsnParser.parse(ext.extnValue, ExtendedKeyUsage);\n        }\n    });\n    // Check that certificate contains subjectAltName (2.5.29.17) extension,\n    if (!subjectAltNamePresent) {\n        throw new Error('Certificate did not contain subjectAltName extension (TPM)');\n    }\n    // TPM-specific values are buried within `directoryName`, so first make sure there are values\n    // there.\n    if (!subjectAltNamePresent[0].directoryName?.[0].length) {\n        throw new Error('Certificate subjectAltName extension directoryName was empty (TPM)');\n    }\n    const { tcgAtTpmManufacturer, tcgAtTpmModel, tcgAtTpmVersion } = getTcgAtTpmValues(subjectAltNamePresent[0].directoryName);\n    if (!tcgAtTpmManufacturer || !tcgAtTpmModel || !tcgAtTpmVersion) {\n        throw new Error('Certificate contained incomplete subjectAltName data (TPM)');\n    }\n    if (!extKeyUsage) {\n        throw new Error('Certificate did not contain ExtendedKeyUsage extension (TPM)');\n    }\n    // Check that tcpaTpmManufacturer (2.23.133.2.1) field is set to a valid manufacturer ID.\n    if (!getTPMManufacturerInfo(tcgAtTpmManufacturer)) {\n        throw new Error(`Could not match TPM manufacturer \"${tcgAtTpmManufacturer}\" (TPM)`);\n    }\n    // Check that certificate contains extKeyUsage (2.5.29.37) extension and it must contain\n    // tcg-kp-AIKCertificate (2.23.133.8.3) OID.\n    if (extKeyUsage[0] !== '2.23.133.8.3') {\n        throw new Error(`Unexpected extKeyUsage \"${extKeyUsage[0]}\", expected \"2.23.133.8.3\" (TPM)`);\n    }\n    // Validate attestation statement AAGUID against leaf cert AAGUID\n    try {\n        await validateExtFIDOGenCEAAGUID(parsedCert.tbsCertificate.extensions, aaguid);\n    }\n    catch (err) {\n        const _err = err;\n        throw new Error(`${_err.message} (TPM)`);\n    }\n    // Run some metadata checks if a statement exists for this authenticator\n    const statement = await MetadataService.getStatement(aaguid);\n    if (statement) {\n        try {\n            await verifyAttestationWithMetadata({\n                statement,\n                credentialPublicKey,\n                x5c,\n                attestationStatementAlg: alg,\n            });\n        }\n        catch (err) {\n            const _err = err;\n            throw new Error(`${_err.message} (TPM)`);\n        }\n    }\n    else {\n        try {\n            // Try validating the certificate path using the root certificates set via SettingsService\n            await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates);\n        }\n        catch (err) {\n            const _err = err;\n            throw new Error(`${_err.message} (TPM)`);\n        }\n    }\n    // Verify signature over certInfo with the public key extracted from AIK certificate.\n    // In the wise words of Yuriy Ackermann: \"Get Martini friend, you are done!\"\n    return verifySignature({\n        signature: sig,\n        data: certInfo,\n        x509Certificate: x5c[0],\n        hashAlgorithm: alg,\n    });\n}\n/**\n * Contain logic for pulling TPM-specific values out of subjectAlternativeName extension\n */\nfunction getTcgAtTpmValues(root) {\n    const oidManufacturer = '2.23.133.2.1';\n    const oidModel = '2.23.133.2.2';\n    const oidVersion = '2.23.133.2.3';\n    let tcgAtTpmManufacturer;\n    let tcgAtTpmModel;\n    let tcgAtTpmVersion;\n    /**\n     * Iterate through the following potential structures:\n     *\n     * (Good, follows the spec)\n     * https://trustedcomputinggroup.org/wp-content/uploads/TCG_IWG_EKCredentialProfile_v2p3_r2_pub.pdf (page 33)\n     * Name [\n     *   RelativeDistinguishedName [\n     *     AttributeTypeAndValue { type, value }\n     *   ]\n     *   RelativeDistinguishedName [\n     *     AttributeTypeAndValue { type, value }\n     *   ]\n     *   RelativeDistinguishedName [\n     *     AttributeTypeAndValue { type, value }\n     *   ]\n     * ]\n     *\n     * (Bad, does not follow the spec)\n     * Name [\n     *   RelativeDistinguishedName [\n     *     AttributeTypeAndValue { type, value }\n     *     AttributeTypeAndValue { type, value }\n     *     AttributeTypeAndValue { type, value }\n     *   ]\n     * ]\n     *\n     * Both structures have been seen in the wild and need to be supported\n     */\n    root.forEach((relName) => {\n        relName.forEach((attr) => {\n            if (attr.type === oidManufacturer) {\n                tcgAtTpmManufacturer = attr.value.toString();\n            }\n            else if (attr.type === oidModel) {\n                tcgAtTpmModel = attr.value.toString();\n            }\n            else if (attr.type === oidVersion) {\n                tcgAtTpmVersion = attr.value.toString();\n            }\n        });\n    });\n    return {\n        tcgAtTpmManufacturer,\n        tcgAtTpmModel,\n        tcgAtTpmVersion,\n    };\n}\n/**\n * Convert TPM-specific SHA algorithm ID's with COSE-specific equivalents. Note that the choice to\n * use ECDSA SHA IDs is arbitrary; any such COSEALG that would map to SHA-256 in\n * `mapCoseAlgToWebCryptoAlg()`\n *\n * SHA IDs referenced from here:\n *\n * https://trustedcomputinggroup.org/wp-content/uploads/TCG_TPM2_r1p59_Part2_Structures_pub.pdf\n */\nfunction attestedNameAlgToCOSEAlg(alg) {\n    if (alg === 'TPM_ALG_SHA256') {\n        return COSEALG.ES256;\n    }\n    else if (alg === 'TPM_ALG_SHA384') {\n        return COSEALG.ES384;\n    }\n    else if (alg === 'TPM_ALG_SHA512') {\n        return COSEALG.ES512;\n    }\n    throw new Error(`Unexpected TPM attested name alg ${alg}`);\n}\n","var IntegerSet_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nexport const id_ce_keyDescription = \"1.3.6.1.4.1.11129.2.1.17\";\nexport var VerifiedBootState;\n(function (VerifiedBootState) {\n    VerifiedBootState[VerifiedBootState[\"verified\"] = 0] = \"verified\";\n    VerifiedBootState[VerifiedBootState[\"selfSigned\"] = 1] = \"selfSigned\";\n    VerifiedBootState[VerifiedBootState[\"unverified\"] = 2] = \"unverified\";\n    VerifiedBootState[VerifiedBootState[\"failed\"] = 3] = \"failed\";\n})(VerifiedBootState || (VerifiedBootState = {}));\nexport class RootOfTrust {\n    verifiedBootKey = new OctetString();\n    deviceLocked = false;\n    verifiedBootState = VerifiedBootState.verified;\n    verifiedBootHash;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: OctetString })\n], RootOfTrust.prototype, \"verifiedBootKey\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Boolean })\n], RootOfTrust.prototype, \"deviceLocked\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], RootOfTrust.prototype, \"verifiedBootState\", void 0);\n__decorate([\n    AsnProp({\n        type: OctetString,\n        optional: true,\n    })\n], RootOfTrust.prototype, \"verifiedBootHash\", void 0);\nlet IntegerSet = IntegerSet_1 = class IntegerSet extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, IntegerSet_1.prototype);\n    }\n};\nIntegerSet = IntegerSet_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Set,\n        itemType: AsnPropTypes.Integer,\n    })\n], IntegerSet);\nexport { IntegerSet };\nexport class AuthorizationList {\n    purpose;\n    algorithm;\n    keySize;\n    digest;\n    padding;\n    ecCurve;\n    rsaPublicExponent;\n    mgfDigest;\n    rollbackResistance;\n    earlyBootOnly;\n    activeDateTime;\n    originationExpireDateTime;\n    usageExpireDateTime;\n    usageCountLimit;\n    noAuthRequired;\n    userAuthType;\n    authTimeout;\n    allowWhileOnBody;\n    trustedUserPresenceRequired;\n    trustedConfirmationRequired;\n    unlockedDeviceRequired;\n    allApplications;\n    applicationId;\n    creationDateTime;\n    origin;\n    rollbackResistant;\n    rootOfTrust;\n    osVersion;\n    osPatchLevel;\n    attestationApplicationId;\n    attestationIdBrand;\n    attestationIdDevice;\n    attestationIdProduct;\n    attestationIdSerial;\n    attestationIdImei;\n    attestationIdMeid;\n    attestationIdManufacturer;\n    attestationIdModel;\n    vendorPatchLevel;\n    bootPatchLevel;\n    deviceUniqueAttestation;\n    attestationIdSecondImei;\n    moduleHash;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        context: 1,\n        type: IntegerSet,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"purpose\", void 0);\n__decorate([\n    AsnProp({\n        context: 2,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"algorithm\", void 0);\n__decorate([\n    AsnProp({\n        context: 3,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"keySize\", void 0);\n__decorate([\n    AsnProp({\n        context: 5,\n        type: IntegerSet,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"digest\", void 0);\n__decorate([\n    AsnProp({\n        context: 6,\n        type: IntegerSet,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"padding\", void 0);\n__decorate([\n    AsnProp({\n        context: 10,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"ecCurve\", void 0);\n__decorate([\n    AsnProp({\n        context: 200,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"rsaPublicExponent\", void 0);\n__decorate([\n    AsnProp({\n        context: 203,\n        type: IntegerSet,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"mgfDigest\", void 0);\n__decorate([\n    AsnProp({\n        context: 303,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"rollbackResistance\", void 0);\n__decorate([\n    AsnProp({\n        context: 305,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"earlyBootOnly\", void 0);\n__decorate([\n    AsnProp({\n        context: 400,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"activeDateTime\", void 0);\n__decorate([\n    AsnProp({\n        context: 401,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"originationExpireDateTime\", void 0);\n__decorate([\n    AsnProp({\n        context: 402,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"usageExpireDateTime\", void 0);\n__decorate([\n    AsnProp({\n        context: 405,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"usageCountLimit\", void 0);\n__decorate([\n    AsnProp({\n        context: 503,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"noAuthRequired\", void 0);\n__decorate([\n    AsnProp({\n        context: 504,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"userAuthType\", void 0);\n__decorate([\n    AsnProp({\n        context: 505,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"authTimeout\", void 0);\n__decorate([\n    AsnProp({\n        context: 506,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"allowWhileOnBody\", void 0);\n__decorate([\n    AsnProp({\n        context: 507,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"trustedUserPresenceRequired\", void 0);\n__decorate([\n    AsnProp({\n        context: 508,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"trustedConfirmationRequired\", void 0);\n__decorate([\n    AsnProp({\n        context: 509,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"unlockedDeviceRequired\", void 0);\n__decorate([\n    AsnProp({\n        context: 600,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"allApplications\", void 0);\n__decorate([\n    AsnProp({\n        context: 601,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"applicationId\", void 0);\n__decorate([\n    AsnProp({\n        context: 701,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"creationDateTime\", void 0);\n__decorate([\n    AsnProp({\n        context: 702,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"origin\", void 0);\n__decorate([\n    AsnProp({\n        context: 703,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"rollbackResistant\", void 0);\n__decorate([\n    AsnProp({\n        context: 704,\n        type: RootOfTrust,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"rootOfTrust\", void 0);\n__decorate([\n    AsnProp({\n        context: 705,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"osVersion\", void 0);\n__decorate([\n    AsnProp({\n        context: 706,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"osPatchLevel\", void 0);\n__decorate([\n    AsnProp({\n        context: 709,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationApplicationId\", void 0);\n__decorate([\n    AsnProp({\n        context: 710,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdBrand\", void 0);\n__decorate([\n    AsnProp({\n        context: 711,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdDevice\", void 0);\n__decorate([\n    AsnProp({\n        context: 712,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdProduct\", void 0);\n__decorate([\n    AsnProp({\n        context: 713,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdSerial\", void 0);\n__decorate([\n    AsnProp({\n        context: 714,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdImei\", void 0);\n__decorate([\n    AsnProp({\n        context: 715,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdMeid\", void 0);\n__decorate([\n    AsnProp({\n        context: 716,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdManufacturer\", void 0);\n__decorate([\n    AsnProp({\n        context: 717,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdModel\", void 0);\n__decorate([\n    AsnProp({\n        context: 718,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"vendorPatchLevel\", void 0);\n__decorate([\n    AsnProp({\n        context: 719,\n        type: AsnPropTypes.Integer,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"bootPatchLevel\", void 0);\n__decorate([\n    AsnProp({\n        context: 720,\n        type: AsnPropTypes.Null,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"deviceUniqueAttestation\", void 0);\n__decorate([\n    AsnProp({\n        context: 723,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"attestationIdSecondImei\", void 0);\n__decorate([\n    AsnProp({\n        context: 724,\n        type: OctetString,\n        optional: true,\n    })\n], AuthorizationList.prototype, \"moduleHash\", void 0);\nexport var SecurityLevel;\n(function (SecurityLevel) {\n    SecurityLevel[SecurityLevel[\"software\"] = 0] = \"software\";\n    SecurityLevel[SecurityLevel[\"trustedEnvironment\"] = 1] = \"trustedEnvironment\";\n    SecurityLevel[SecurityLevel[\"strongBox\"] = 2] = \"strongBox\";\n})(SecurityLevel || (SecurityLevel = {}));\nexport var Version;\n(function (Version) {\n    Version[Version[\"KM2\"] = 1] = \"KM2\";\n    Version[Version[\"KM3\"] = 2] = \"KM3\";\n    Version[Version[\"KM4\"] = 3] = \"KM4\";\n    Version[Version[\"KM4_1\"] = 4] = \"KM4_1\";\n    Version[Version[\"keyMint1\"] = 100] = \"keyMint1\";\n    Version[Version[\"keyMint2\"] = 200] = \"keyMint2\";\n    Version[Version[\"keyMint3\"] = 300] = \"keyMint3\";\n    Version[Version[\"keyMint4\"] = 400] = \"keyMint4\";\n})(Version || (Version = {}));\nexport class KeyDescription {\n    attestationVersion = Version.KM4;\n    attestationSecurityLevel = SecurityLevel.software;\n    keymasterVersion = 0;\n    keymasterSecurityLevel = SecurityLevel.software;\n    attestationChallenge = new OctetString();\n    uniqueId = new OctetString();\n    softwareEnforced = new AuthorizationList();\n    teeEnforced = new AuthorizationList();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], KeyDescription.prototype, \"attestationVersion\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], KeyDescription.prototype, \"attestationSecurityLevel\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], KeyDescription.prototype, \"keymasterVersion\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], KeyDescription.prototype, \"keymasterSecurityLevel\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], KeyDescription.prototype, \"attestationChallenge\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], KeyDescription.prototype, \"uniqueId\", void 0);\n__decorate([\n    AsnProp({ type: AuthorizationList })\n], KeyDescription.prototype, \"softwareEnforced\", void 0);\n__decorate([\n    AsnProp({ type: AuthorizationList })\n], KeyDescription.prototype, \"teeEnforced\", void 0);\nexport class KeyMintKeyDescription {\n    attestationVersion = Version.keyMint4;\n    attestationSecurityLevel = SecurityLevel.software;\n    keyMintVersion = 0;\n    keyMintSecurityLevel = SecurityLevel.software;\n    attestationChallenge = new OctetString();\n    uniqueId = new OctetString();\n    softwareEnforced = new AuthorizationList();\n    hardwareEnforced = new AuthorizationList();\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n    toLegacyKeyDescription() {\n        return new KeyDescription({\n            attestationVersion: this.attestationVersion,\n            attestationSecurityLevel: this.attestationSecurityLevel,\n            keymasterVersion: this.keyMintVersion,\n            keymasterSecurityLevel: this.keyMintSecurityLevel,\n            attestationChallenge: this.attestationChallenge,\n            uniqueId: this.uniqueId,\n            softwareEnforced: this.softwareEnforced,\n            teeEnforced: this.hardwareEnforced,\n        });\n    }\n    static fromLegacyKeyDescription(keyDesc) {\n        return new KeyMintKeyDescription({\n            attestationVersion: keyDesc.attestationVersion,\n            attestationSecurityLevel: keyDesc.attestationSecurityLevel,\n            keyMintVersion: keyDesc.keymasterVersion,\n            keyMintSecurityLevel: keyDesc.keymasterSecurityLevel,\n            attestationChallenge: keyDesc.attestationChallenge,\n            uniqueId: keyDesc.uniqueId,\n            softwareEnforced: keyDesc.softwareEnforced,\n            hardwareEnforced: keyDesc.teeEnforced,\n        });\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], KeyMintKeyDescription.prototype, \"attestationVersion\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], KeyMintKeyDescription.prototype, \"attestationSecurityLevel\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], KeyMintKeyDescription.prototype, \"keyMintVersion\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], KeyMintKeyDescription.prototype, \"keyMintSecurityLevel\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], KeyMintKeyDescription.prototype, \"attestationChallenge\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], KeyMintKeyDescription.prototype, \"uniqueId\", void 0);\n__decorate([\n    AsnProp({ type: AuthorizationList })\n], KeyMintKeyDescription.prototype, \"softwareEnforced\", void 0);\n__decorate([\n    AsnProp({ type: AuthorizationList })\n], KeyMintKeyDescription.prototype, \"hardwareEnforced\", void 0);\n","var NonStandardAuthorizationList_1;\nimport { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString } from \"@peculiar/asn1-schema\";\nimport { AuthorizationList, SecurityLevel, Version } from \"./key_description.js\";\nlet NonStandardAuthorization = class NonStandardAuthorization extends AuthorizationList {\n};\nNonStandardAuthorization = __decorate([\n    AsnType({ type: AsnTypeTypes.Choice })\n], NonStandardAuthorization);\nexport { NonStandardAuthorization };\nlet NonStandardAuthorizationList = NonStandardAuthorizationList_1 = class NonStandardAuthorizationList extends AsnArray {\n    constructor(items) {\n        super(items);\n        Object.setPrototypeOf(this, NonStandardAuthorizationList_1.prototype);\n    }\n    findProperty(key) {\n        const prop = this.find((o) => o[key] !== undefined);\n        if (prop) {\n            return prop[key];\n        }\n        return undefined;\n    }\n};\nNonStandardAuthorizationList = NonStandardAuthorizationList_1 = __decorate([\n    AsnType({\n        type: AsnTypeTypes.Sequence,\n        itemType: NonStandardAuthorization,\n    })\n], NonStandardAuthorizationList);\nexport { NonStandardAuthorizationList };\nexport class NonStandardKeyDescription {\n    attestationVersion = Version.KM4;\n    attestationSecurityLevel = SecurityLevel.software;\n    keymasterVersion = 0;\n    keymasterSecurityLevel = SecurityLevel.software;\n    attestationChallenge = new OctetString();\n    uniqueId = new OctetString();\n    softwareEnforced = new NonStandardAuthorizationList();\n    teeEnforced = new NonStandardAuthorizationList();\n    get keyMintVersion() {\n        return this.keymasterVersion;\n    }\n    set keyMintVersion(value) {\n        this.keymasterVersion = value;\n    }\n    get keyMintSecurityLevel() {\n        return this.keymasterSecurityLevel;\n    }\n    set keyMintSecurityLevel(value) {\n        this.keymasterSecurityLevel = value;\n    }\n    get hardwareEnforced() {\n        return this.teeEnforced;\n    }\n    set hardwareEnforced(value) {\n        this.teeEnforced = value;\n    }\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], NonStandardKeyDescription.prototype, \"attestationVersion\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], NonStandardKeyDescription.prototype, \"attestationSecurityLevel\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], NonStandardKeyDescription.prototype, \"keymasterVersion\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Enumerated })\n], NonStandardKeyDescription.prototype, \"keymasterSecurityLevel\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], NonStandardKeyDescription.prototype, \"attestationChallenge\", void 0);\n__decorate([\n    AsnProp({ type: OctetString })\n], NonStandardKeyDescription.prototype, \"uniqueId\", void 0);\n__decorate([\n    AsnProp({ type: NonStandardAuthorizationList })\n], NonStandardKeyDescription.prototype, \"softwareEnforced\", void 0);\n__decorate([\n    AsnProp({ type: NonStandardAuthorizationList })\n], NonStandardKeyDescription.prototype, \"teeEnforced\", void 0);\nlet NonStandardKeyMintKeyDescription = class NonStandardKeyMintKeyDescription extends NonStandardKeyDescription {\n    constructor(params = {}) {\n        if (\"keymasterVersion\" in params && !(\"keyMintVersion\" in params)) {\n            params.keyMintVersion = params.keymasterVersion;\n        }\n        if (\"keymasterSecurityLevel\" in params && !(\"keyMintSecurityLevel\" in params)) {\n            params.keyMintSecurityLevel = params.keymasterSecurityLevel;\n        }\n        if (\"teeEnforced\" in params && !(\"hardwareEnforced\" in params)) {\n            params.hardwareEnforced = params.teeEnforced;\n        }\n        super(params);\n    }\n};\nNonStandardKeyMintKeyDescription = __decorate([\n    AsnType({ type: AsnTypeTypes.Sequence })\n], NonStandardKeyMintKeyDescription);\nexport { NonStandardKeyMintKeyDescription };\n","import { __decorate } from \"tslib\";\nimport { AsnProp, AsnPropTypes } from \"@peculiar/asn1-schema\";\nexport class AttestationPackageInfo {\n    packageName;\n    version;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({ type: AsnPropTypes.OctetString })\n], AttestationPackageInfo.prototype, \"packageName\", void 0);\n__decorate([\n    AsnProp({ type: AsnPropTypes.Integer })\n], AttestationPackageInfo.prototype, \"version\", void 0);\nexport class AttestationApplicationId {\n    packageInfos;\n    signatureDigests;\n    constructor(params = {}) {\n        Object.assign(this, params);\n    }\n}\n__decorate([\n    AsnProp({\n        type: AttestationPackageInfo,\n        repeated: \"set\",\n    })\n], AttestationApplicationId.prototype, \"packageInfos\", void 0);\n__decorate([\n    AsnProp({\n        type: AsnPropTypes.OctetString,\n        repeated: \"set\",\n    })\n], AttestationApplicationId.prototype, \"signatureDigests\", void 0);\n","import { AsnParser } from '@peculiar/asn1-schema';\nimport { Certificate } from '@peculiar/asn1-x509';\nimport { id_ce_keyDescription, KeyDescription } from '@peculiar/asn1-android';\nimport { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';\nimport { validateCertificatePath } from '../../helpers/validateCertificatePath.js';\nimport { verifySignature } from '../../helpers/verifySignature.js';\nimport { convertCOSEtoPKCS } from '../../helpers/convertCOSEtoPKCS.js';\nimport { isCOSEAlg } from '../../helpers/cose.js';\nimport { isoUint8Array } from '../../helpers/iso/index.js';\nimport { MetadataService } from '../../services/metadataService.js';\nimport { verifyAttestationWithMetadata } from '../../metadata/verifyAttestationWithMetadata.js';\n/**\n * Verify an attestation response with fmt 'android-key'\n */\nexport async function verifyAttestationAndroidKey(options) {\n    const { authData, clientDataHash, attStmt, credentialPublicKey, aaguid, rootCertificates, } = options;\n    const x5c = attStmt.get('x5c');\n    const sig = attStmt.get('sig');\n    const alg = attStmt.get('alg');\n    if (!x5c) {\n        throw new Error('No attestation certificate provided in attestation statement (Android Key)');\n    }\n    if (!sig) {\n        throw new Error('No attestation signature provided in attestation statement (Android Key)');\n    }\n    if (!alg) {\n        throw new Error(`Attestation statement did not contain alg (Android Key)`);\n    }\n    if (!isCOSEAlg(alg)) {\n        throw new Error(`Attestation statement contained invalid alg ${alg} (Android Key)`);\n    }\n    /**\n     * Verify that the public key in the first certificate in x5c matches the credentialPublicKey in\n     * the attestedCredentialData in authenticatorData.\n     */\n    // Find the public cert in the certificate as PKCS\n    const parsedCert = AsnParser.parse(x5c[0], Certificate);\n    const parsedCertPubKey = new Uint8Array(parsedCert.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey);\n    // Convert the credentialPublicKey to PKCS\n    const credPubKeyPKCS = convertCOSEtoPKCS(credentialPublicKey);\n    if (!isoUint8Array.areEqual(credPubKeyPKCS, parsedCertPubKey)) {\n        throw new Error('Credential public key does not equal leaf cert public key (Android Key)');\n    }\n    /**\n     * Verify that the attestationChallenge field in the attestation certificate extension data is\n     * identical to clientDataHash.\n     */\n    // Find Android KeyStore Extension in certificate extensions\n    const extKeyStore = parsedCert.tbsCertificate.extensions?.find((ext) => ext.extnID === id_ce_keyDescription);\n    if (!extKeyStore) {\n        throw new Error('Certificate did not contain extKeyStore (Android Key)');\n    }\n    const parsedExtKeyStore = AsnParser.parse(extKeyStore.extnValue, KeyDescription);\n    // Verify extKeyStore values\n    const { attestationChallenge, teeEnforced, softwareEnforced } = parsedExtKeyStore;\n    if (!isoUint8Array.areEqual(new Uint8Array(attestationChallenge.buffer), clientDataHash)) {\n        throw new Error('Attestation challenge was not equal to client data hash (Android Key)');\n    }\n    /**\n     * The AuthorizationList.allApplications field is not present on either authorization list\n     * (softwareEnforced nor teeEnforced), since PublicKeyCredential MUST be scoped to the RP ID.\n     *\n     * (i.e. These shouldn't contain the [600] tag)\n     */\n    if (teeEnforced.allApplications !== undefined) {\n        throw new Error('teeEnforced contained \"allApplications [600]\" tag (Android Key)');\n    }\n    if (softwareEnforced.allApplications !== undefined) {\n        throw new Error('teeEnforced contained \"allApplications [600]\" tag (Android Key)');\n    }\n    const statement = await MetadataService.getStatement(aaguid);\n    if (statement) {\n        try {\n            await verifyAttestationWithMetadata({\n                statement,\n                credentialPublicKey,\n                x5c,\n                attestationStatementAlg: alg,\n            });\n        }\n        catch (err) {\n            const _err = err;\n            throw new Error(`${_err.message} (Android Key)`, { cause: _err });\n        }\n    }\n    else {\n        /**\n         * Verify that x5c contains a full certificate path.\n         */\n        const x5cNoRootPEM = x5c.slice(0, -1).map(convertCertBufferToPEM);\n        const x5cRootPEM = x5c.slice(-1).map(convertCertBufferToPEM);\n        try {\n            await validateCertificatePath(x5cNoRootPEM, x5cRootPEM);\n        }\n        catch (err) {\n            const _err = err;\n            throw new Error(`${_err.message} (Android Key)`, { cause: _err });\n        }\n        /**\n         * Make sure the root certificate is one of the Google Hardware Attestation Root certificates\n         *\n         * https://developer.android.com/privacy-and-security/security-key-attestation#root_certificate\n         */\n        if (rootCertificates.length > 0 && rootCertificates.indexOf(x5cRootPEM[0]) < 0) {\n            throw new Error('x5c root certificate was not a known root certificate (Android Key)');\n        }\n    }\n    /**\n     * Verify that sig is a valid signature over the concatenation of authenticatorData and\n     * clientDataHash using the public key in the first certificate in x5c with the algorithm\n     * specified in alg.\n     */\n    const signatureBase = isoUint8Array.concat([authData, clientDataHash]);\n    return verifySignature({\n        signature: sig,\n        data: signatureBase,\n        x509Certificate: x5c[0],\n        hashAlgorithm: alg,\n    });\n}\n","import { AsnParser } from '@peculiar/asn1-schema';\nimport { Certificate } from '@peculiar/asn1-x509';\nimport { validateCertificatePath } from '../../helpers/validateCertificatePath.js';\nimport { convertCertBufferToPEM } from '../../helpers/convertCertBufferToPEM.js';\nimport { toHash } from '../../helpers/toHash.js';\nimport { convertCOSEtoPKCS } from '../../helpers/convertCOSEtoPKCS.js';\nimport { isoUint8Array } from '../../helpers/iso/index.js';\nexport async function verifyAttestationApple(options) {\n    const { attStmt, authData, clientDataHash, credentialPublicKey, rootCertificates, } = options;\n    const x5c = attStmt.get('x5c');\n    if (!x5c) {\n        throw new Error('No attestation certificate provided in attestation statement (Apple)');\n    }\n    /**\n     * Verify certificate path\n     */\n    try {\n        await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates);\n    }\n    catch (err) {\n        const _err = err;\n        throw new Error(`${_err.message} (Apple)`);\n    }\n    /**\n     * Compare nonce in certificate extension to computed nonce\n     */\n    const parsedCredCert = AsnParser.parse(x5c[0], Certificate);\n    const { extensions, subjectPublicKeyInfo } = parsedCredCert.tbsCertificate;\n    if (!extensions) {\n        throw new Error('credCert missing extensions (Apple)');\n    }\n    const extCertNonce = extensions.find((ext) => ext.extnID === '1.2.840.113635.100.8.2');\n    if (!extCertNonce) {\n        throw new Error('credCert missing \"1.2.840.113635.100.8.2\" extension (Apple)');\n    }\n    const nonceToHash = isoUint8Array.concat([authData, clientDataHash]);\n    const nonce = await toHash(nonceToHash);\n    /**\n     * Ignore the first six ASN.1 structure bytes that define the nonce as an OCTET STRING. Should\n     * trim off <Buffer 30 24 a1 22 04 20>\n     *\n     * TODO: Try and get @peculiar (GitHub) to add a schema for \"1.2.840.113635.100.8.2\" when we\n     * find out where it's defined (doesn't seem to be publicly documented at the moment...)\n     */\n    const extNonce = new Uint8Array(extCertNonce.extnValue.buffer).slice(6);\n    if (!isoUint8Array.areEqual(nonce, extNonce)) {\n        throw new Error(`credCert nonce was not expected value (Apple)`);\n    }\n    /**\n     * Verify credential public key matches the Subject Public Key of credCert\n     */\n    const credPubKeyPKCS = convertCOSEtoPKCS(credentialPublicKey);\n    const credCertSubjectPublicKey = new Uint8Array(subjectPublicKeyInfo.subjectPublicKey);\n    if (!isoUint8Array.areEqual(credPubKeyPKCS, credCertSubjectPublicKey)) {\n        throw new Error('Credential public key does not equal credCert public key (Apple)');\n    }\n    return true;\n}\n","import { PQCNotSupportedError } from '../errors/index.js';\nimport { decodeAttestationObject, } from '../helpers/decodeAttestationObject.js';\nimport { decodeClientDataJSON } from '../helpers/decodeClientDataJSON.js';\nimport { parseAuthenticatorData } from '../helpers/parseAuthenticatorData.js';\nimport { toHash } from '../helpers/toHash.js';\nimport { decodeCredentialPublicKey } from '../helpers/decodeCredentialPublicKey.js';\nimport { COSEKEYS, isPQCCOSEAlg } from '../helpers/cose.js';\nimport { convertAAGUIDToString } from '../helpers/convertAAGUIDToString.js';\nimport { parseBackupFlags } from '../helpers/parseBackupFlags.js';\nimport { matchExpectedRPID } from '../helpers/matchExpectedRPID.js';\nimport { isoBase64URL } from '../helpers/iso/index.js';\nimport { SettingsService } from '../services/settingsService.js';\nimport { getDefaultSupportedAlgorithmIDs } from './generateRegistrationOptions.js';\nimport { verifyAttestationFIDOU2F } from './verifications/verifyAttestationFIDOU2F.js';\nimport { verifyAttestationPacked } from './verifications/verifyAttestationPacked.js';\nimport { verifyAttestationAndroidSafetyNet } from './verifications/verifyAttestationAndroidSafetyNet.js';\nimport { verifyAttestationTPM } from './verifications/tpm/verifyAttestationTPM.js';\nimport { verifyAttestationAndroidKey } from './verifications/verifyAttestationAndroidKey.js';\nimport { verifyAttestationApple } from './verifications/verifyAttestationApple.js';\n/**\n * Verify that the user has legitimately completed the registration process\n *\n * **Options:**\n *\n * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`\n * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateRegistrationOptions()`\n * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on\n * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options\n * @param expectedType **(Optional)** - The response type expected ('webauthn.create')\n * @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true`\n * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`\n * @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers indicating supported public key algorithms. Import `COSEALG` from \\@simplewebauthn/server/helpers for suitable values. Should be the same value that was specified for this same argument when calling `generateRegistrationOptions()`. Defaults to `[COSEALG.EdDSA, COSEALG.ES256, COSEALG.RS256]`\n * @param attestationSafetyNetEnforceCTSCheck **(Optional)** - Require that an Android device's system integrity has not been tampered with if it uses SafetyNet attestation. Defaults to `true`\n */\nexport async function verifyRegistrationResponse(options) {\n    const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, requireUserPresence = true, requireUserVerification = true, supportedAlgorithmIDs = getDefaultSupportedAlgorithmIDs(), attestationSafetyNetEnforceCTSCheck = true, } = options;\n    const { id, rawId, type: credentialType, response: attestationResponse } = response;\n    // Ensure credential specified an ID\n    if (!id) {\n        throw new Error('Missing credential ID');\n    }\n    // Ensure ID is base64url-encoded\n    if (id !== rawId) {\n        throw new Error('Credential ID was not base64url-encoded');\n    }\n    // Make sure credential type is public-key\n    if (credentialType !== 'public-key') {\n        throw new Error(`Unexpected credential type ${credentialType}, expected \"public-key\"`);\n    }\n    const clientDataJSON = decodeClientDataJSON(attestationResponse.clientDataJSON);\n    const { type, origin, challenge, tokenBinding } = clientDataJSON;\n    // Make sure we're handling an registration\n    if (Array.isArray(expectedType)) {\n        if (!expectedType.includes(type)) {\n            const joinedExpectedType = expectedType.join(', ');\n            throw new Error(`Unexpected registration response type \"${type}\", expected one of: ${joinedExpectedType}`);\n        }\n    }\n    else if (expectedType) {\n        if (type !== expectedType) {\n            throw new Error(`Unexpected registration response type \"${type}\", expected \"${expectedType}\"`);\n        }\n    }\n    else if (type !== 'webauthn.create') {\n        throw new Error(`Unexpected registration response type: ${type}`);\n    }\n    // Ensure the device provided the challenge we gave it\n    if (typeof expectedChallenge === 'function') {\n        if (!(await expectedChallenge(challenge))) {\n            throw new Error(`Custom challenge verifier returned false for registration response challenge \"${challenge}\"`);\n        }\n    }\n    else if (challenge !== expectedChallenge) {\n        throw new Error(`Unexpected registration response challenge \"${challenge}\", expected \"${expectedChallenge}\"`);\n    }\n    // Check that the origin is our site\n    if (Array.isArray(expectedOrigin)) {\n        if (!expectedOrigin.includes(origin)) {\n            throw new Error(`Unexpected registration response origin \"${origin}\", expected one of: ${expectedOrigin.join(', ')}`);\n        }\n    }\n    else {\n        if (origin !== expectedOrigin) {\n            throw new Error(`Unexpected registration response origin \"${origin}\", expected \"${expectedOrigin}\"`);\n        }\n    }\n    if (tokenBinding) {\n        if (typeof tokenBinding !== 'object') {\n            throw new Error(`Unexpected value for TokenBinding \"${tokenBinding}\"`);\n        }\n        if (['present', 'supported', 'not-supported'].indexOf(tokenBinding.status) < 0) {\n            throw new Error(`Unexpected tokenBinding.status value of \"${tokenBinding.status}\"`);\n        }\n    }\n    const attestationObject = isoBase64URL.toBuffer(attestationResponse.attestationObject);\n    const decodedAttestationObject = decodeAttestationObject(attestationObject);\n    const fmt = decodedAttestationObject.get('fmt');\n    const authData = decodedAttestationObject.get('authData');\n    const attStmt = decodedAttestationObject.get('attStmt');\n    const parsedAuthData = parseAuthenticatorData(authData);\n    const { aaguid, rpIdHash, flags, credentialID, counter, credentialPublicKey, extensionsData, } = parsedAuthData;\n    // Make sure the response's RP ID is ours\n    let matchedRPID;\n    if (expectedRPID) {\n        let expectedRPIDs = [];\n        if (typeof expectedRPID === 'string') {\n            expectedRPIDs = [expectedRPID];\n        }\n        else {\n            expectedRPIDs = expectedRPID;\n        }\n        matchedRPID = await matchExpectedRPID(rpIdHash, expectedRPIDs);\n    }\n    // Make sure someone was physically present\n    if (requireUserPresence && !flags.up) {\n        throw new Error('User presence was required, but user was not present');\n    }\n    // Enforce user verification if specified\n    if (requireUserVerification && !flags.uv) {\n        throw new Error('User verification was required, but user could not be verified');\n    }\n    if (!credentialID) {\n        throw new Error('No credential ID was provided by authenticator');\n    }\n    if (!credentialPublicKey) {\n        throw new Error('No public key was provided by authenticator');\n    }\n    if (!aaguid) {\n        throw new Error('No AAGUID was present during registration');\n    }\n    const decodedPublicKey = decodeCredentialPublicKey(credentialPublicKey);\n    const pubKeyAlg = decodedPublicKey.get(COSEKEYS.alg);\n    if (typeof pubKeyAlg !== 'number') {\n        throw new Error('Credential public key was missing numeric alg');\n    }\n    // Make sure the key algorithm is one we specified within the registration options\n    if (!supportedAlgorithmIDs.includes(pubKeyAlg)) {\n        const supported = supportedAlgorithmIDs.join(', ');\n        throw new Error(`Unexpected public key alg \"${pubKeyAlg}\", expected one of \"${supported}\"`);\n    }\n    /**\n     * If the runtime doesn't support PQC passkeys then terminate here at the first sign of a PQC\n     * algorithm so that downstream issues that arise due to lack of PQC support won't get masked as\n     * unexpected behavior.\n     *\n     * I'm choosing to raise here even if attestation is \"none\" because it feels weird to allow an RP\n     * to parse a registration response w/o attestation only to encounter failure when trying to auth\n     * with the PQC passkey and the runtime doesn't support PQC.\n     */\n    if (isPQCCOSEAlg(pubKeyAlg) && !SettingsService.runtimeSupportsPQC()) {\n        throw new PQCNotSupportedError(pubKeyAlg);\n    }\n    const clientDataHash = await toHash(isoBase64URL.toBuffer(attestationResponse.clientDataJSON));\n    const rootCertificates = SettingsService.getRootCertificates({ identifier: fmt });\n    // Prepare arguments to pass to the relevant verification method\n    const verifierOpts = {\n        aaguid,\n        attStmt,\n        authData,\n        clientDataHash,\n        credentialID,\n        credentialPublicKey,\n        rootCertificates,\n        rpIdHash,\n        attestationSafetyNetEnforceCTSCheck,\n    };\n    /**\n     * Verification can only be performed when attestation = 'direct'\n     */\n    let verified = false;\n    if (fmt === 'fido-u2f') {\n        verified = await verifyAttestationFIDOU2F(verifierOpts);\n    }\n    else if (fmt === 'packed') {\n        verified = await verifyAttestationPacked(verifierOpts);\n    }\n    else if (fmt === 'android-safetynet') {\n        verified = await verifyAttestationAndroidSafetyNet(verifierOpts);\n    }\n    else if (fmt === 'android-key') {\n        verified = await verifyAttestationAndroidKey(verifierOpts);\n    }\n    else if (fmt === 'tpm') {\n        verified = await verifyAttestationTPM(verifierOpts);\n    }\n    else if (fmt === 'apple') {\n        verified = await verifyAttestationApple(verifierOpts);\n    }\n    else if (fmt === 'none') {\n        if (attStmt.size > 0) {\n            throw new Error('None attestation had unexpected attestation statement');\n        }\n        // This is the weaker of the attestations, so there's nothing else to really check\n        verified = true;\n    }\n    else {\n        throw new Error(`Unsupported Attestation Format: ${fmt}`);\n    }\n    if (!verified) {\n        return { verified: false };\n    }\n    const { credentialDeviceType, credentialBackedUp } = parseBackupFlags(flags);\n    return {\n        verified: true,\n        registrationInfo: {\n            fmt,\n            aaguid: convertAAGUIDToString(aaguid),\n            credentialType,\n            credential: {\n                id: isoBase64URL.fromBuffer(credentialID),\n                publicKey: credentialPublicKey,\n                counter,\n                transports: response.response.transports,\n            },\n            attestationObject,\n            userVerified: flags.uv,\n            credentialDeviceType,\n            credentialBackedUp,\n            origin: clientDataJSON.origin,\n            rpID: matchedRPID,\n            authenticatorExtensionResults: extensionsData,\n        },\n    };\n}\n","import { isoBase64URL, isoUint8Array } from '../helpers/iso/index.js';\nimport { generateChallenge } from '../helpers/generateChallenge.js';\n/**\n * Prepare a value to pass into navigator.credentials.get(...) for authenticator authentication\n *\n * **Options:**\n *\n * @param rpID - Valid domain name (after `https://`)\n * @param allowCredentials **(Optional)** - Authenticators previously registered by the user, if any. If undefined the client will ask the user which credential they want to use\n * @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back user for authentication. Defaults to generating a random value\n * @param timeout **(Optional)** - How long (in ms) the user can take to complete authentication. Defaults to `60000`\n * @param userVerification **(Optional)** - Set to `'discouraged'` when asserting as part of a 2FA flow, otherwise set to `'preferred'` or `'required'` as desired. Defaults to `\"preferred\"`\n * @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during authentication\n */\nexport async function generateAuthenticationOptions(options) {\n    const { allowCredentials, challenge = await generateChallenge(), timeout = 60000, userVerification = 'preferred', extensions, rpID, } = options;\n    /**\n     * Preserve ability to specify `string` values for challenges\n     */\n    let _challenge = challenge;\n    if (typeof _challenge === 'string') {\n        _challenge = isoUint8Array.fromUTF8String(_challenge);\n    }\n    return {\n        rpId: rpID,\n        challenge: isoBase64URL.fromBuffer(_challenge),\n        allowCredentials: allowCredentials?.map((cred) => {\n            if (!isoBase64URL.isBase64URL(cred.id)) {\n                throw new Error(`allowCredential id \"${cred.id}\" is not a valid base64url string`);\n            }\n            return {\n                ...cred,\n                id: isoBase64URL.trimPadding(cred.id),\n                type: 'public-key',\n            };\n        }),\n        timeout,\n        userVerification,\n        extensions,\n    };\n}\n","import { decodeClientDataJSON } from '../helpers/decodeClientDataJSON.js';\nimport { toHash } from '../helpers/toHash.js';\nimport { verifySignature } from '../helpers/verifySignature.js';\nimport { parseAuthenticatorData } from '../helpers/parseAuthenticatorData.js';\nimport { parseBackupFlags } from '../helpers/parseBackupFlags.js';\nimport { matchExpectedRPID } from '../helpers/matchExpectedRPID.js';\nimport { isoBase64URL, isoUint8Array } from '../helpers/iso/index.js';\nimport { decodeCredentialPublicKey } from '../helpers/decodeCredentialPublicKey.js';\nimport { COSEKEYS, isPQCCOSEAlg } from '../helpers/cose.js';\nimport { SettingsService } from '../services/settingsService.js';\nimport { PQCNotSupportedError } from '../errors/index.js';\n/**\n * Verify that the user has legitimately completed the authentication process\n *\n * **Options:**\n *\n * @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`\n * @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()`\n * @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on\n * @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options\n * @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response\n * @param expectedType **(Optional)** - The response type expected ('webauthn.get')\n * @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`\n * @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements\n * @param advancedFIDOConfig.userVerification **(Optional)** - Enable alternative rules for evaluating the User Presence and User Verified flags in authenticator data: UV (and UP) flags are optional unless this value is `\"required\"`\n */\nexport async function verifyAuthenticationResponse(options) {\n    const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, expectedTopOrigin, credential, requireUserVerification = true, advancedFIDOConfig, } = options;\n    const { id, rawId, type: credentialType, response: assertionResponse } = response;\n    // Ensure credential specified an ID\n    if (!id) {\n        throw new Error('Missing credential ID');\n    }\n    // Ensure ID is base64url-encoded\n    if (id !== rawId) {\n        throw new Error('Credential ID was not base64url-encoded');\n    }\n    // Make sure credential type is public-key\n    if (credentialType !== 'public-key') {\n        throw new Error(`Unexpected credential type ${credentialType}, expected \"public-key\"`);\n    }\n    if (!response) {\n        throw new Error('Credential missing response');\n    }\n    if (typeof assertionResponse?.clientDataJSON !== 'string') {\n        throw new Error('Credential response clientDataJSON was not a string');\n    }\n    const clientDataJSON = decodeClientDataJSON(assertionResponse.clientDataJSON);\n    const { type, origin, challenge, tokenBinding, crossOrigin, topOrigin } = clientDataJSON;\n    // Make sure we're handling an authentication\n    if (Array.isArray(expectedType)) {\n        if (!expectedType.includes(type)) {\n            const joinedExpectedType = expectedType.join(', ');\n            throw new Error(`Unexpected authentication response type \"${type}\", expected one of: ${joinedExpectedType}`);\n        }\n    }\n    else if (expectedType) {\n        if (type !== expectedType) {\n            throw new Error(`Unexpected authentication response type \"${type}\", expected \"${expectedType}\"`);\n        }\n    }\n    else if (type !== 'webauthn.get') {\n        throw new Error(`Unexpected authentication response type: ${type}`);\n    }\n    // Ensure the device provided the challenge we gave it\n    if (typeof expectedChallenge === 'function') {\n        if (!(await expectedChallenge(challenge))) {\n            throw new Error(`Custom challenge verifier returned false for registration response challenge \"${challenge}\"`);\n        }\n    }\n    else if (challenge !== expectedChallenge) {\n        throw new Error(`Unexpected authentication response challenge \"${challenge}\", expected \"${expectedChallenge}\"`);\n    }\n    // Check that the authentication response is within an expected iframe\n    if (crossOrigin) {\n        /**\n         * TODO: Since Safari doesn't support `topOrigin` as of May 2026, only check this when\n         * `topOrigin` is available for now.\n         */\n        if (topOrigin) {\n            if (!expectedTopOrigin) {\n                /**\n                 * If `expectedTopOrigin` is not set, this should be considered an unexpected cross-origin\n                 * request. Reject the response while helping the RP understand how they need to update this\n                 * method call if they want to support verification of such WebAuthn authentication requests.\n                 */\n                throw new Error(`Detected cross-origin authentication response from top origin of \"${topOrigin}\", but a value for \\`expectedTopOrigin\\` was not specified when calling \\`verifyAuthenticationResponse()\\``);\n            }\n            if (Array.isArray(expectedTopOrigin)) {\n                if (!expectedTopOrigin.includes(topOrigin)) {\n                    const joinedExpectedTopOrigin = expectedTopOrigin.join(', ');\n                    throw new Error(`Unexpected cross-origin authentication response top origin of \"${topOrigin}\", expected one of: ${joinedExpectedTopOrigin}`);\n                }\n            }\n            else {\n                if (topOrigin !== expectedTopOrigin) {\n                    throw new Error(`Unexpected cross-origin authentication response top origin of \"${topOrigin}\", expected: ${expectedTopOrigin}`);\n                }\n            }\n        }\n    }\n    else {\n        if (topOrigin) {\n            /**\n             * If `topOrigin` is set despite `crossOrigin` being false, this is an unexpected request.\n             *\n             * See https://w3c.github.io/webauthn/#dom-collectedclientdata-toporigin.\n             */\n            throw new Error(`Unexpected top origin of \"${topOrigin}\" within a non-cross-origin authentication response. This error should be reported to the browser vendor as a WebAuthn specification violation with a link to https://w3c.github.io/webauthn/#dom-collectedclientdata-toporigin`);\n        }\n    }\n    // Check that the origin is our site\n    if (Array.isArray(expectedOrigin)) {\n        if (!expectedOrigin.includes(origin)) {\n            const joinedExpectedOrigin = expectedOrigin.join(', ');\n            throw new Error(`Unexpected authentication response origin \"${origin}\", expected one of: ${joinedExpectedOrigin}`);\n        }\n    }\n    else {\n        if (origin !== expectedOrigin) {\n            throw new Error(`Unexpected authentication response origin \"${origin}\", expected \"${expectedOrigin}\"`);\n        }\n    }\n    if (!isoBase64URL.isBase64URL(assertionResponse.authenticatorData)) {\n        throw new Error('Credential response authenticatorData was not a base64url string');\n    }\n    if (!isoBase64URL.isBase64URL(assertionResponse.signature)) {\n        throw new Error('Credential response signature was not a base64url string');\n    }\n    if (assertionResponse.userHandle &&\n        typeof assertionResponse.userHandle !== 'string') {\n        throw new Error('Credential response userHandle was not a string');\n    }\n    if (tokenBinding) {\n        if (typeof tokenBinding !== 'object') {\n            throw new Error('ClientDataJSON tokenBinding was not an object');\n        }\n        if (['present', 'supported', 'notSupported'].indexOf(tokenBinding.status) < 0) {\n            throw new Error(`Unexpected tokenBinding status ${tokenBinding.status}`);\n        }\n    }\n    const authDataBuffer = isoBase64URL.toBuffer(assertionResponse.authenticatorData);\n    const parsedAuthData = parseAuthenticatorData(authDataBuffer);\n    const { rpIdHash, flags, counter, extensionsData } = parsedAuthData;\n    // Make sure the response's RP ID is ours\n    let expectedRPIDs = [];\n    if (typeof expectedRPID === 'string') {\n        expectedRPIDs = [expectedRPID];\n    }\n    else {\n        expectedRPIDs = expectedRPID;\n    }\n    const matchedRPID = await matchExpectedRPID(rpIdHash, expectedRPIDs);\n    if (advancedFIDOConfig !== undefined) {\n        const { userVerification: fidoUserVerification } = advancedFIDOConfig;\n        /**\n         * Use FIDO Conformance-defined rules for verifying UP and UV flags\n         */\n        if (fidoUserVerification === 'required') {\n            // Require `flags.uv` be true (implies `flags.up` is true)\n            if (!flags.uv) {\n                throw new Error('User verification required, but user could not be verified');\n            }\n        }\n        else if (fidoUserVerification === 'preferred' ||\n            fidoUserVerification === 'discouraged') {\n            // Ignore `flags.uv`\n        }\n    }\n    else {\n        /**\n         * Use WebAuthn spec-defined rules for verifying UP and UV flags\n         */\n        // WebAuthn only requires the user presence flag be true\n        if (!flags.up) {\n            throw new Error('User not present during authentication');\n        }\n        // Enforce user verification if required\n        if (requireUserVerification && !flags.uv) {\n            throw new Error('User verification required, but user could not be verified');\n        }\n    }\n    const clientDataHash = await toHash(isoBase64URL.toBuffer(assertionResponse.clientDataJSON));\n    const signatureBase = isoUint8Array.concat([authDataBuffer, clientDataHash]);\n    const signature = isoBase64URL.toBuffer(assertionResponse.signature);\n    if ((counter > 0 || credential.counter > 0) &&\n        counter <= credential.counter) {\n        // Error out when the counter in the DB is greater than or equal to the counter in the\n        // dataStruct. It's related to how the authenticator maintains the number of times its been\n        // used for this client. If this happens, then someone's somehow increased the counter\n        // on the device without going through this site\n        throw new Error(`Response counter value ${counter} was lower than expected ${credential.counter}`);\n    }\n    const decodedPublicKey = decodeCredentialPublicKey(credential.publicKey);\n    const pubKeyAlg = decodedPublicKey.get(COSEKEYS.alg);\n    if (typeof pubKeyAlg !== 'number') {\n        throw new Error('Credential public key was missing numeric alg');\n    }\n    if (isPQCCOSEAlg(pubKeyAlg) && !SettingsService.runtimeSupportsPQC()) {\n        throw new PQCNotSupportedError(pubKeyAlg);\n    }\n    const { credentialDeviceType, credentialBackedUp } = parseBackupFlags(flags);\n    const toReturn = {\n        verified: await verifySignature({\n            signature,\n            data: signatureBase,\n            credentialPublicKey: credential.publicKey,\n        }),\n        authenticationInfo: {\n            newCounter: counter,\n            credentialID: credential.id,\n            userVerified: flags.uv,\n            credentialDeviceType,\n            credentialBackedUp,\n            authenticatorExtensionResults: extensionsData,\n            origin: clientDataJSON.origin,\n            rpID: matchedRPID,\n        },\n    };\n    return toReturn;\n}\n","import { CEREMONY_TTL_MS, STEP_UP_CHALLENGE_TTL_MS, challengeIsFresh, counterVerdict, relyingPartyId } from \"../webauthnPolicy/index.mjs\";\nimport { randomBytes } from \"node:crypto\";\nimport { generateAuthenticationOptions, generateRegistrationOptions, verifyAuthenticationResponse, verifyRegistrationResponse } from \"@simplewebauthn/server\";\n//#region src/services/webauthn/index.ts\nconst ID_BYTES = 8;\nconst CEREMONY_ID_BYTES = 16;\nconst USER_ID_BYTES = 16;\nconst MAX_PENDING_CEREMONIES = 256;\nconst RP_NAME = \"Po cockpit\";\n/** One synthetic owner: there is exactly one person here, and passkeys need a subject. */\nconst OWNER_NAME = \"this machine\";\nfunction describe(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/**\n* Passkeys over the tunnel, and the step-up gate in front of the two actions a\n* live session should not be enough for.\n*\n* `rpID` and `expectedOrigin` come from the configured tunnel hostname, never\n* from the request. That is the entire scope of a credential, so a caller that\n* could influence it could mint credentials against somebody else's origin.\n*/\nfunction createWebAuthn(options) {\n\tconst now = options.now ?? (() => Date.now());\n\tconst notice = options.onNotice ?? (() => {});\n\t/** One synthetic subject, stable for the life of the process. */\n\tconst userId = randomBytes(USER_ID_BYTES);\n\tconst pending = /* @__PURE__ */ new Map();\n\tconst support = () => {\n\t\tconst origin = options.publicOrigin();\n\t\tconst rpId = relyingPartyId(origin);\n\t\tif (origin === void 0) return {\n\t\t\tsupported: false,\n\t\t\treason: \"Remote access is not on.\"\n\t\t};\n\t\tif (rpId === void 0) return {\n\t\t\tsupported: false,\n\t\t\treason: \"A quick tunnel gets a new hostname every start, so a passkey registered now would not work again. Configure a named tunnel to use passkeys.\"\n\t\t};\n\t\treturn {\n\t\t\tsupported: true,\n\t\t\trpId\n\t\t};\n\t};\n\tconst ceremonyKey = (id, caller, type) => `${type}\\u0000${caller}\\u0000${id}`;\n\tconst ttlFor = (held) => held.type === \"step-up\" ? STEP_UP_CHALLENGE_TTL_MS : CEREMONY_TTL_MS;\n\tconst sweepPending = () => {\n\t\tconst at = now();\n\t\tfor (const [id, held] of pending) if (!challengeIsFresh(held.issuedAt, at, ttlFor(held))) pending.delete(id);\n\t};\n\tconst remember = (type, caller, challenge, action) => {\n\t\tsweepPending();\n\t\twhile (pending.size >= MAX_PENDING_CEREMONIES) {\n\t\t\tconst oldest = pending.keys().next().value;\n\t\t\tif (oldest === void 0) break;\n\t\t\tpending.delete(oldest);\n\t\t}\n\t\tlet id;\n\t\tdo\n\t\t\tid = randomBytes(CEREMONY_ID_BYTES).toString(\"base64url\");\n\t\twhile (pending.has(ceremonyKey(id, caller, type)));\n\t\tpending.set(ceremonyKey(id, caller, type), {\n\t\t\tchallenge,\n\t\t\tissuedAt: now(),\n\t\t\tcaller,\n\t\t\ttype,\n\t\t\t...action === void 0 ? {} : { action }\n\t\t});\n\t\treturn id;\n\t};\n\tconst take = (id, caller, type, action) => {\n\t\tconst key = ceremonyKey(id, caller, type);\n\t\tconst held = pending.get(key);\n\t\tif (held === void 0) return void 0;\n\t\tif (!challengeIsFresh(held.issuedAt, now(), ttlFor(held))) {\n\t\t\tpending.delete(key);\n\t\t\treturn;\n\t\t}\n\t\tif (held.caller !== caller || held.type !== type || held.action !== action) return void 0;\n\t\tpending.delete(key);\n\t\treturn held.challenge;\n\t};\n\treturn {\n\t\tsupport,\n\t\tasync beginRegistration(caller, label) {\n\t\t\tconst ready = support();\n\t\t\tif (!ready.supported) return void 0;\n\t\t\tconst options_ = await generateRegistrationOptions({\n\t\t\t\trpName: RP_NAME,\n\t\t\t\trpID: ready.rpId,\n\t\t\t\tuserID: userId,\n\t\t\t\tuserName: OWNER_NAME,\n\t\t\t\tuserDisplayName: label,\n\t\t\t\tattestationType: \"none\",\n\t\t\t\tauthenticatorSelection: {\n\t\t\t\t\tresidentKey: \"required\",\n\t\t\t\t\tuserVerification: \"required\",\n\t\t\t\t\tauthenticatorAttachment: \"platform\"\n\t\t\t\t},\n\t\t\t\texcludeCredentials: options.credentials().map((credential) => ({ id: credential.credentialId }))\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tceremonyId: remember(\"registration\", caller, options_.challenge),\n\t\t\t\toptions: options_\n\t\t\t};\n\t\t},\n\t\tasync finishRegistration(ceremonyId, caller, response, label) {\n\t\t\tconst ready = support();\n\t\t\tif (!ready.supported) return {\n\t\t\t\tok: false,\n\t\t\t\terror: ready.reason\n\t\t\t};\n\t\t\tconst challenge = take(ceremonyId, caller, \"registration\");\n\t\t\tif (challenge === void 0) return {\n\t\t\t\tok: false,\n\t\t\t\terror: \"That registration expired. Try again.\"\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tconst verification = await verifyRegistrationResponse({\n\t\t\t\t\tresponse,\n\t\t\t\t\texpectedChallenge: challenge,\n\t\t\t\t\texpectedOrigin: `https://${ready.rpId}`,\n\t\t\t\t\texpectedRPID: ready.rpId,\n\t\t\t\t\trequireUserVerification: true\n\t\t\t\t});\n\t\t\t\tif (!verification.verified || verification.registrationInfo === void 0) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: \"That passkey could not be verified.\"\n\t\t\t\t};\n\t\t\t\tconst info = verification.registrationInfo;\n\t\t\t\tconst at = now();\n\t\t\t\tconst credential = {\n\t\t\t\t\tid: randomBytes(ID_BYTES).toString(\"hex\"),\n\t\t\t\t\tcredentialId: info.credential.id,\n\t\t\t\t\tpublicKey: Buffer.from(info.credential.publicKey).toString(\"base64url\"),\n\t\t\t\t\tcounter: info.credential.counter,\n\t\t\t\t\ttransports: info.credential.transports ?? [],\n\t\t\t\t\tlabel,\n\t\t\t\t\tcreatedAt: at,\n\t\t\t\t\tlastUsedAt: at\n\t\t\t\t};\n\t\t\t\toptions.saveCredential(credential);\n\t\t\t\tnotice(`registered a passkey for ${label}`);\n\t\t\t\treturn {\n\t\t\t\t\tok: true,\n\t\t\t\t\tid: credential.id\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: describe(error)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\tasync beginAuthentication(caller) {\n\t\t\tconst ready = support();\n\t\t\tif (!ready.supported) return void 0;\n\t\t\tconst options_ = await generateAuthenticationOptions({\n\t\t\t\trpID: ready.rpId,\n\t\t\t\tuserVerification: \"required\"\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tceremonyId: remember(\"authentication\", caller, options_.challenge),\n\t\t\t\toptions: options_\n\t\t\t};\n\t\t},\n\t\tasync finishAuthentication(ceremonyId, caller, response) {\n\t\t\tconst ready = support();\n\t\t\tif (!ready.supported) return {\n\t\t\t\tok: false,\n\t\t\t\terror: ready.reason\n\t\t\t};\n\t\t\tconst challenge = take(ceremonyId, caller, \"authentication\");\n\t\t\tif (challenge === void 0) return {\n\t\t\t\tok: false,\n\t\t\t\terror: \"That sign-in expired. Try again.\"\n\t\t\t};\n\t\t\treturn await verifyAgainst(challenge, ready.rpId, response);\n\t\t},\n\t\tasync beginStepUp(caller, action) {\n\t\t\tconst ready = support();\n\t\t\tif (!ready.supported) return void 0;\n\t\t\tconst options_ = await generateAuthenticationOptions({\n\t\t\t\trpID: ready.rpId,\n\t\t\t\tuserVerification: \"required\"\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tceremonyId: remember(\"step-up\", caller, options_.challenge, action),\n\t\t\t\toptions: options_\n\t\t\t};\n\t\t},\n\t\tasync finishStepUp(ceremonyId, caller, action, response) {\n\t\t\tconst ready = support();\n\t\t\tif (!ready.supported) return false;\n\t\t\tconst challenge = take(ceremonyId, caller, \"step-up\", action);\n\t\t\tif (challenge === void 0) return false;\n\t\t\treturn (await verifyAgainst(challenge, ready.rpId, response)).ok;\n\t\t},\n\t\tclearChallenges() {\n\t\t\tpending.clear();\n\t\t}\n\t};\n\tasync function verifyAgainst(challenge, rpId, response) {\n\t\tconst presented = response.id;\n\t\tif (typeof presented !== \"string\") return {\n\t\t\tok: false,\n\t\t\terror: \"That response named no credential.\"\n\t\t};\n\t\tconst stored = options.credentials().find((candidate) => candidate.credentialId === presented);\n\t\tif (stored === void 0) return {\n\t\t\tok: false,\n\t\t\terror: \"That passkey is not registered here.\"\n\t\t};\n\t\ttry {\n\t\t\tconst verification = await verifyAuthenticationResponse({\n\t\t\t\tresponse,\n\t\t\t\texpectedChallenge: challenge,\n\t\t\t\texpectedOrigin: `https://${rpId}`,\n\t\t\t\texpectedRPID: rpId,\n\t\t\t\trequireUserVerification: true,\n\t\t\t\tcredential: {\n\t\t\t\t\tid: stored.credentialId,\n\t\t\t\t\tpublicKey: new Uint8Array(Buffer.from(stored.publicKey, \"base64url\")),\n\t\t\t\t\tcounter: stored.counter,\n\t\t\t\t\ttransports: stored.transports\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!verification.verified) return {\n\t\t\t\tok: false,\n\t\t\t\terror: \"That passkey did not verify.\"\n\t\t\t};\n\t\t\tconst presentedCounter = verification.authenticationInfo.newCounter;\n\t\t\tif (counterVerdict(stored.counter, presentedCounter) === \"clone-suspected\") {\n\t\t\t\toptions.removeCredential(stored.id);\n\t\t\t\tnotice(`revoked passkey ${stored.label}: its signature counter went backwards, which means a clone`);\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: \"That passkey looks cloned and has been revoked.\"\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst updated = {\n\t\t\t\t...stored,\n\t\t\t\tcounter: presentedCounter,\n\t\t\t\tlastUsedAt: now()\n\t\t\t};\n\t\t\toptions.saveCredential(updated);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tcredential: updated\n\t\t\t};\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: describe(error)\n\t\t\t};\n\t\t}\n\t}\n}\n//#endregion\nexport { createWebAuthn };\n\n//# sourceMappingURL=index.mjs.map","import { COOKIE_CEILING_SECONDS, PAIRING_PAGE_ROUTE, REMOTE_PAIRING_REQUEST_TYPE, REMOTE_STATE_TYPE } from \"../../constants/remote.mjs\";\nimport { cookieMaxAgeSeconds } from \"../deviceSessions/index.mjs\";\nimport { createDeviceAuth } from \"../deviceAuth/index.mjs\";\nimport { createDeviceChallenges, deviceAuthChallenge, deviceStepUpChallenge, isDeviceNonce, isOpaqueId, verifyAuthentication, verifyRegistration, verifyStepUp } from \"../deviceTrust/index.mjs\";\nimport { parseNativePushRegistration, sameNativePushRegistration } from \"../nativePushRegistration/index.mjs\";\nimport { createPairingFlow } from \"../pairingFlow/index.mjs\";\nimport { parseRemoteAccessSettings, serializeRemoteAccessSettings } from \"../remoteAccessSettings/index.mjs\";\nimport { tunnelOriginPolicy } from \"../remoteGuardPolicy/index.mjs\";\nimport { createWebAuthn } from \"../webauthn/index.mjs\";\nimport { createHash, randomBytes, randomInt } from \"node:crypto\";\nimport { SEALED_KEY_PARAM } from \"@agimon-ai/po-web-security\";\nimport { createHostHandshake } from \"@agimon-ai/po-web-security/node\";\n//#region src/services/remoteAccess/index.ts\nconst TOKEN_BYTES = 32;\nconst TRUSTED_DEVICE_ID_BYTES = 16;\nconst PAIRING_TRUST = { kind: \"pairing\" };\nconst PASSKEY_TRUST = { kind: \"passkey\" };\nconst SWEEP_INTERVAL_MS = 3e5;\nconst MS_PER_MINUTE = 6e4;\nfunction bundlePairingTrust(value) {\n\tif (value === void 0) return void 0;\n\treturn {\n\t\t...value,\n\t\tfingerprint: createHash(\"sha256\").update(Buffer.from(value.publicKey, \"base64url\")).digest(\"hex\")\n\t};\n}\nfunction createRemoteAccess(options) {\n\tconst notice = options.onNotice ?? (() => {});\n\tconst now = options.now ?? (() => Date.now());\n\tconst broadcastLocal = options.broadcastLocal ?? (() => {});\n\tconst broadcastAll = options.broadcastAll ?? (() => {});\n\tlet settings = options.store.settings();\n\tlet status = \"off\";\n\tlet startupGeneration = 0;\n\tlet listener;\n\tlet stopTunnel;\n\tlet tunnelStartup;\n\tlet publicOrigin;\n\tlet publicOriginRevision = 0;\n\tlet policy;\n\tlet startedAt;\n\tlet closesAt;\n\tlet failure;\n\tlet autoCloseTimer;\n\t/** One handshake per tunnel; its public half goes in every QR while the tunnel lives. */\n\tlet handshake;\n\tconst channels = /* @__PURE__ */ new Map();\n\tconst deviceChallenges = createDeviceChallenges({ now });\n\tconst sockets = /* @__PURE__ */ new Map();\n\tconst channelKey = (deviceId, scope) => `${deviceId}:${scope}`;\n\tconst dropDeviceAccess = (deviceId, reason) => {\n\t\toptions.onDeviceDropped?.(deviceId);\n\t\tfor (const scope of [\n\t\t\t\"session\",\n\t\t\t\"protocol\",\n\t\t\t\"http\"\n\t\t]) channels.delete(channelKey(deviceId, scope));\n\t\tconst held = sockets.get(deviceId);\n\t\tsockets.delete(deviceId);\n\t\tfor (const close of held ?? []) try {\n\t\t\tclose(1008, `device ${reason}`);\n\t\t} catch {}\n\t};\n\tconst devices = createDeviceAuth({\n\t\tsettings: () => settings,\n\t\tnow,\n\t\tonNotice: notice,\n\t\tonDrop: (record, reason) => dropDeviceAccess(record.id, reason)\n\t});\n\tconst webauthn = createWebAuthn({\n\t\tpublicOrigin: () => publicOrigin,\n\t\tcredentials: () => options.store.credentials(),\n\t\tsaveCredential: (credential) => options.store.saveCredential(credential),\n\t\tremoveCredential: (id) => options.store.removeCredential(id),\n\t\tnow,\n\t\tonNotice: notice\n\t});\n\tconst pairing = createPairingFlow({\n\t\trandomToken: () => randomBytes(TOKEN_BYTES).toString(\"base64url\"),\n\t\trandomManualCode: () => randomInt(1e8).toString().padStart(8, \"0\"),\n\t\tdigest: (token) => createHash(\"sha256\").update(token).digest(\"hex\"),\n\t\tnow,\n\t\tonNotice: notice\n\t});\n\tconst sweeper = setInterval(() => {\n\t\tdevices.sweep();\n\t\tpairing.sweep();\n\t}, SWEEP_INTERVAL_MS);\n\tsweeper.unref();\n\tfunction publish() {\n\t\tbroadcastAll({\n\t\t\ttype: REMOTE_STATE_TYPE,\n\t\t\tstate: view(void 0, false)\n\t\t});\n\t}\n\tfunction view(selfDeviceId, forLocalCaller) {\n\t\tconst selfTrust = selfDeviceId === void 0 ? void 0 : devices.trustOf(selfDeviceId);\n\t\tconst selfTrustedDeviceId = selfTrust?.kind === \"device-key\" ? selfTrust.trustedDeviceId : void 0;\n\t\treturn {\n\t\t\tstatus,\n\t\t\t...publicOrigin === void 0 ? {} : { publicUrl: publicOrigin },\n\t\t\t...startedAt === void 0 ? {} : { startedAt: new Date(startedAt).toISOString() },\n\t\t\t...closesAt === void 0 ? {} : { closesAt: new Date(closesAt).toISOString() },\n\t\t\t...failure === void 0 ? {} : { error: failure },\n\t\t\tdevices: devices.list().map((record) => ({\n\t\t\t\tid: record.id,\n\t\t\t\tlabel: record.label,\n\t\t\t\tuserAgent: record.userAgent,\n\t\t\t\tcreatedAt: new Date(record.createdAt).toISOString(),\n\t\t\t\tlastSeenAt: new Date(record.lastSeenAt).toISOString(),\n\t\t\t\tself: record.id === selfDeviceId\n\t\t\t})),\n\t\t\tpending: forLocalCaller ? pairing.pending().map((request) => ({\n\t\t\t\tid: request.id,\n\t\t\t\tuserAgent: request.userAgent,\n\t\t\t\tedgeIp: request.edgeIp,\n\t\t\t\tcreatedAt: new Date(request.createdAt).toISOString(),\n\t\t\t\texpiresAt: new Date(request.createdAt + 18e4).toISOString()\n\t\t\t})) : [],\n\t\t\ttrustedDevices: options.store.trustedDevices().map((record) => ({\n\t\t\t\tid: record.id,\n\t\t\t\tlabel: record.label,\n\t\t\t\tplatform: record.platform,\n\t\t\t\tcreatedAt: new Date(record.createdAt).toISOString(),\n\t\t\t\tlastSeenAt: new Date(record.lastSeenAt).toISOString(),\n\t\t\t\tself: selfTrustedDeviceId !== void 0 && record.id === selfTrustedDeviceId\n\t\t\t})),\n\t\t\tsettings\n\t\t};\n\t}\n\tfunction armAutoClose() {\n\t\tclearTimeout(autoCloseTimer);\n\t\tautoCloseTimer = void 0;\n\t\tif (status !== \"on\" && status !== \"starting\") return;\n\t\tif (settings.autoCloseEnabled) {\n\t\t\tconst at = now() + settings.autoCloseMinutes * MS_PER_MINUTE;\n\t\t\tclosesAt = closesAt === void 0 ? at : Math.min(closesAt, at);\n\t\t}\n\t\tif (closesAt === void 0) return;\n\t\tautoCloseTimer = setTimeout(() => {\n\t\t\tnotice(\"remote access reached its time limit; closing\");\n\t\t\tdisable();\n\t\t}, Math.max(0, closesAt - now()));\n\t\tautoCloseTimer.unref();\n\t}\n\t/** Everything teardown has to do, in the order it has to happen. */\n\tasync function teardown() {\n\t\tstartupGeneration += 1;\n\t\tclearTimeout(autoCloseTimer);\n\t\tautoCloseTimer = void 0;\n\t\tclosesAt = void 0;\n\t\tfor (const held of sockets.values()) for (const close of held) try {\n\t\t\tclose(1008, \"remote access revoked\");\n\t\t} catch {}\n\t\tsockets.clear();\n\t\tconst starting = tunnelStartup;\n\t\ttunnelStartup = void 0;\n\t\tstarting?.controller.abort();\n\t\tconst closingListener = listener?.close().catch(() => void 0);\n\t\tlistener = void 0;\n\t\tconst startingOutcome = await starting?.outcome.catch(() => void 0);\n\t\tif (startingOutcome?.ok === true) await startingOutcome.stop().catch(() => void 0);\n\t\tawait stopTunnel?.().catch(() => void 0);\n\t\tstopTunnel = void 0;\n\t\tawait closingListener;\n\t\tif (publicOrigin !== void 0) publicOriginRevision += 1;\n\t\tpublicOrigin = void 0;\n\t\tpolicy = void 0;\n\t\tstartedAt = void 0;\n\t\tpairing.clear();\n\t\twebauthn.clearChallenges();\n\t\tdeviceChallenges.clear();\n\t\thandshake = void 0;\n\t\tchannels.clear();\n\t\tdevices.revokeAll();\n\t}\n\tasync function disable() {\n\t\tif (status === \"off\") return;\n\t\tawait teardown();\n\t\tstatus = \"off\";\n\t\tfailure = void 0;\n\t\tnotice(\"remote access off\");\n\t\tpublish();\n\t}\n\treturn {\n\t\tstate: (selfDeviceId, forLocalCaller = false) => view(selfDeviceId, forLocalCaller),\n\t\tsettings: () => settings,\n\t\tpublicOrigin: () => publicOrigin,\n\t\tpublicOriginRevision: () => publicOriginRevision,\n\t\tupdateSettings(patch) {\n\t\t\tconst parsed = parseRemoteAccessSettings(serializeRemoteAccessSettings({\n\t\t\t\t...settings,\n\t\t\t\t...patch\n\t\t\t}));\n\t\t\tfor (const warning of parsed.warnings) notice(`remote access settings: ${warning}`);\n\t\t\tsettings = parsed.settings;\n\t\t\toptions.store.save(settings);\n\t\t\tdevices.reschedule();\n\t\t\tarmAutoClose();\n\t\t\tpublish();\n\t\t\treturn settings;\n\t\t},\n\t\ttunnelPort: () => listener?.port,\n\t\ttunnelPolicy: () => policy,\n\t\tasync enable(deadline) {\n\t\t\tif (status === \"on\" || status === \"starting\") return { ok: true };\n\t\t\tif (deadline !== void 0 && (!Number.isFinite(deadline) || !Number.isFinite(new Date(deadline).getTime()) || deadline <= now())) return {\n\t\t\t\tok: false,\n\t\t\t\terror: \"The tunnel deadline is invalid or expired.\"\n\t\t\t};\n\t\t\tconst generation = ++startupGeneration;\n\t\t\tconst tunnelConfig = settings.tunnel;\n\t\t\tclosesAt = deadline;\n\t\t\tstatus = \"starting\";\n\t\t\tfailure = void 0;\n\t\t\tarmAutoClose();\n\t\t\tpublish();\n\t\t\tlet bound;\n\t\t\ttry {\n\t\t\t\tbound = await options.bindListener();\n\t\t\t} catch (error) {\n\t\t\t\tif (generation !== startupGeneration) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: \"Tunnel startup was cancelled.\"\n\t\t\t\t};\n\t\t\t\tclearTimeout(autoCloseTimer);\n\t\t\t\tautoCloseTimer = void 0;\n\t\t\t\tclosesAt = void 0;\n\t\t\t\tstatus = \"failed\";\n\t\t\t\tfailure = `The tunnel listener could not bind: ${error instanceof Error ? error.message : String(error)}`;\n\t\t\t\tpublish();\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: failure\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (generation !== startupGeneration) {\n\t\t\t\tawait bound.close();\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: \"Tunnel startup was cancelled.\"\n\t\t\t\t};\n\t\t\t}\n\t\t\tlistener = bound;\n\t\t\tif (closesAt !== void 0 && closesAt <= now()) {\n\t\t\t\tawait disable();\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: \"The tunnel deadline expired during startup.\"\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst controller = new AbortController();\n\t\t\tconst launching = options.launchTunnel({\n\t\t\t\tport: bound.port,\n\t\t\t\tconfig: tunnelConfig,\n\t\t\t\tsignal: controller.signal,\n\t\t\t\tacceptOrigin: (origin) => {\n\t\t\t\t\tif (generation === startupGeneration) policy = tunnelOriginPolicy(origin);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst startup = {\n\t\t\t\tcontroller,\n\t\t\t\toutcome: launching\n\t\t\t};\n\t\t\ttunnelStartup = startup;\n\t\t\tconst outcome = await launching;\n\t\t\tif (tunnelStartup !== startup || controller.signal.aborted) return {\n\t\t\t\tok: false,\n\t\t\t\terror: \"Tunnel startup was cancelled.\"\n\t\t\t};\n\t\t\ttunnelStartup = void 0;\n\t\t\tif (!outcome.ok) {\n\t\t\t\tawait teardown();\n\t\t\t\tstatus = \"failed\";\n\t\t\t\tfailure = outcome.message;\n\t\t\t\tnotice(`remote access failed: ${outcome.message}`);\n\t\t\t\tpublish();\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: outcome.message\n\t\t\t\t};\n\t\t\t}\n\t\t\tstopTunnel = outcome.stop;\n\t\t\tif (closesAt !== void 0 && closesAt <= now()) {\n\t\t\t\tawait disable();\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: \"The tunnel deadline expired during startup.\"\n\t\t\t\t};\n\t\t\t}\n\t\t\thandshake = createHostHandshake();\n\t\t\tif (publicOrigin !== outcome.publicOrigin) publicOriginRevision += 1;\n\t\t\tpublicOrigin = outcome.publicOrigin;\n\t\t\tpolicy = tunnelOriginPolicy(outcome.publicOrigin);\n\t\t\tstartedAt = now();\n\t\t\tstatus = \"on\";\n\t\t\tarmAutoClose();\n\t\t\tnotice(`remote access on at ${outcome.publicOrigin}`);\n\t\t\tpublish();\n\t\t\treturn { ok: true };\n\t\t},\n\t\tdisable,\n\t\tmintPairing() {\n\t\t\tif (status !== \"on\" || publicOrigin === void 0 || handshake === void 0) return void 0;\n\t\t\tconst trust = bundlePairingTrust(options.bundleTrust?.());\n\t\t\tif (trust === void 0) return void 0;\n\t\t\tconst { code, manualCode, expiresAt } = pairing.mintCode();\n\t\t\tconst fragment = new URLSearchParams({\n\t\t\t\tc: code,\n\t\t\t\t[SEALED_KEY_PARAM]: handshake.publicKey,\n\t\t\t\t[\"s\"]: trust.publicKey,\n\t\t\t\t[\"r\"]: String(trust.revision)\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tcode,\n\t\t\t\tmanualCode,\n\t\t\t\tpairUrl: `${publicOrigin}${PAIRING_PAGE_ROUTE}#${fragment.toString()}`,\n\t\t\t\texpiresAt: new Date(expiresAt).toISOString(),\n\t\t\t\t...trust\n\t\t\t};\n\t\t},\n\t\tbundleTrust: () => bundlePairingTrust(options.bundleTrust?.()),\n\t\tclaim(input) {\n\t\t\tconst outcome = pairing.claim(input);\n\t\t\tif (outcome.ok) broadcastLocal({\n\t\t\t\ttype: REMOTE_PAIRING_REQUEST_TYPE,\n\t\t\t\tstate: view(void 0, true)\n\t\t\t});\n\t\t\treturn outcome;\n\t\t},\n\t\tpairingStatus: (requestId) => pairing.status(requestId),\n\t\tapprove(requestId) {\n\t\t\tconst outcome = pairing.approve(requestId);\n\t\t\tif (outcome === \"approved\") broadcastLocal({\n\t\t\t\ttype: REMOTE_PAIRING_REQUEST_TYPE,\n\t\t\t\tstate: view(void 0, true)\n\t\t\t});\n\t\t\treturn outcome;\n\t\t},\n\t\tdeny(requestId) {\n\t\t\tconst outcome = pairing.deny(requestId);\n\t\t\tif (outcome === \"denied\") broadcastLocal({\n\t\t\t\ttype: REMOTE_PAIRING_REQUEST_TYPE,\n\t\t\t\tstate: view(void 0, true)\n\t\t\t});\n\t\t\treturn outcome;\n\t\t},\n\t\tredeem(requestId) {\n\t\t\tconst approved = pairing.consume(requestId);\n\t\t\tif (approved === void 0) return void 0;\n\t\t\tconst enrolled = devices.enrol({\n\t\t\t\tuserAgent: approved.userAgent,\n\t\t\t\ttrust: PAIRING_TRUST\n\t\t\t});\n\t\t\tpublish();\n\t\t\treturn {\n\t\t\t\t...enrolled,\n\t\t\t\tmaxAgeSeconds: cookieMaxAgeSeconds(settings, COOKIE_CEILING_SECONDS)\n\t\t\t};\n\t\t},\n\t\tauthorize: (token) => devices.verify(token)?.id,\n\t\tisDeviceAuthorized(deviceId) {\n\t\t\tdevices.sweep();\n\t\t\treturn listener !== void 0 && devices.list().some((record) => record.id === deviceId);\n\t\t},\n\t\tsessionForPasskey(label) {\n\t\t\tconst enrolled = devices.enrol({\n\t\t\t\tuserAgent: label,\n\t\t\t\ttrust: PASSKEY_TRUST\n\t\t\t});\n\t\t\tpublish();\n\t\t\treturn {\n\t\t\t\t...enrolled,\n\t\t\t\tmaxAgeSeconds: cookieMaxAgeSeconds(settings, COOKIE_CEILING_SECONDS)\n\t\t\t};\n\t\t},\n\t\tpasskeys: () => ({\n\t\t\tsupport: () => webauthn.support(),\n\t\t\tlist: () => options.store.credentials(),\n\t\t\tbeginRegistration: async (caller, label) => await webauthn.beginRegistration(caller, label),\n\t\t\tfinishRegistration: async (ceremonyId, caller, response, label) => await webauthn.finishRegistration(ceremonyId, caller, response, label),\n\t\t\tbeginAuthentication: async (caller) => await webauthn.beginAuthentication(caller),\n\t\t\tfinishAuthentication: async (ceremonyId, caller, response) => await webauthn.finishAuthentication(ceremonyId, caller, response),\n\t\t\tbeginStepUp: async (caller, action) => await webauthn.beginStepUp(caller, action),\n\t\t\tfinishStepUp: async (ceremonyId, caller, action, response) => await webauthn.finishStepUp(ceremonyId, caller, action, response),\n\t\t\tforget: (id) => {\n\t\t\t\tconst forgotten = options.store.removeCredential(id);\n\t\t\t\tif (forgotten) publish();\n\t\t\t\treturn forgotten;\n\t\t\t}\n\t\t}),\n\t\tregisterTrustedDevice(sessionDeviceId, body) {\n\t\t\tif (publicOrigin === void 0 || handshake === void 0) return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"unavailable\"\n\t\t\t};\n\t\t\tconst verdict = verifyRegistration({\n\t\t\t\torigin: publicOrigin,\n\t\t\t\thostPublicKey: handshake.publicKey,\n\t\t\t\tsessionDeviceId,\n\t\t\t\ttrust: devices.trustOf(sessionDeviceId),\n\t\t\t\tbody\n\t\t\t});\n\t\t\tif (!verdict.ok) return {\n\t\t\t\tok: false,\n\t\t\t\treason: verdict.reason === \"not-pairing\" ? \"forbidden\" : \"invalid\"\n\t\t\t};\n\t\t\tif (options.store.trustedDevices().length >= 32) return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"full\"\n\t\t\t};\n\t\t\tconst at = now();\n\t\t\tconst trustedDeviceId = randomBytes(TRUSTED_DEVICE_ID_BYTES).toString(\"base64url\");\n\t\t\tif (!options.store.saveTrustedDevice({\n\t\t\t\tid: trustedDeviceId,\n\t\t\t\tidentityPublicKey: verdict.identityPublicKey,\n\t\t\t\tstepUpPublicKey: verdict.stepUpPublicKey,\n\t\t\t\tlabel: verdict.label,\n\t\t\t\tplatform: verdict.platform,\n\t\t\t\tcreatedAt: at,\n\t\t\t\tlastSeenAt: at\n\t\t\t})) return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"persistence\"\n\t\t\t};\n\t\t\tdevices.setTrust(sessionDeviceId, {\n\t\t\t\tkind: \"device-key\",\n\t\t\t\ttrustedDeviceId\n\t\t\t});\n\t\t\tnotice(`trusted ${verdict.label} (${trustedDeviceId})`);\n\t\t\tpublish();\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\ttrustedDeviceId\n\t\t\t};\n\t\t},\n\t\tsetNativePushRegistration(sessionDeviceId, body) {\n\t\t\tdevices.sweep();\n\t\t\tconst trust = devices.trustOf(sessionDeviceId);\n\t\t\tif (status !== \"on\" || trust?.kind !== \"device-key\") return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"forbidden\"\n\t\t\t};\n\t\t\tconst record = options.store.trustedDevices().find((held) => held.id === trust.trustedDeviceId);\n\t\t\tif (record === void 0) return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"forbidden\"\n\t\t\t};\n\t\t\tconst registration = body === void 0 ? void 0 : parseNativePushRegistration(body, record.platform);\n\t\t\tif (body !== void 0 && registration === void 0) return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"invalid\"\n\t\t\t};\n\t\t\tconst { nativePush: _previous, ...base } = record;\n\t\t\tif (!options.store.saveTrustedDevice({\n\t\t\t\t...base,\n\t\t\t\t...registration === void 0 ? {} : { nativePush: registration }\n\t\t\t})) return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"persistence\"\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tnotificationId: record.id\n\t\t\t};\n\t\t},\n\t\tlistNativePushRegistrations() {\n\t\t\treturn options.store.trustedDevices().flatMap((record) => {\n\t\t\t\tconst registration = parseNativePushRegistration(record.nativePush, record.platform);\n\t\t\t\treturn registration === void 0 ? [] : [{\n\t\t\t\t\tnotificationId: record.id,\n\t\t\t\t\tregistration\n\t\t\t\t}];\n\t\t\t});\n\t\t},\n\t\tclearNativePushRegistration(notificationId, expectedRegistration) {\n\t\t\tconst record = options.store.trustedDevices().find((held) => held.id === notificationId);\n\t\t\tif (record?.nativePush === void 0 || !sameNativePushRegistration(record.nativePush, expectedRegistration)) return false;\n\t\t\tconst { nativePush: _previous, ...next } = record;\n\t\t\treturn options.store.saveTrustedDevice(next);\n\t\t},\n\t\tbeginDeviceAuth(input) {\n\t\t\tif (!isOpaqueId(input.trustedDeviceId) || !isDeviceNonce(input.nonce)) return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"invalid\"\n\t\t\t};\n\t\t\tif (status !== \"on\" || publicOrigin === void 0 || handshake === void 0 || options.attestHost === void 0) return {\n\t\t\t\tok: false,\n\t\t\t\treason: \"unavailable\"\n\t\t\t};\n\t\t\tconst attest = options.attestHost;\n\t\t\tconst begun = deviceAuthChallenge({\n\t\t\t\tchallenges: deviceChallenges,\n\t\t\t\ttrustedDeviceId: input.trustedDeviceId,\n\t\t\t\tnonce: input.nonce,\n\t\t\t\torigin: publicOrigin,\n\t\t\t\thostPublicKey: handshake.publicKey,\n\t\t\t\tattest: (fields) => attest(fields)\n\t\t\t});\n\t\t\treturn begun === void 0 ? {\n\t\t\t\tok: false,\n\t\t\t\treason: \"unavailable\"\n\t\t\t} : {\n\t\t\t\tok: true,\n\t\t\t\t...begun\n\t\t\t};\n\t\t},\n\t\tfinishDeviceAuth(body) {\n\t\t\tif (status !== \"on\" || publicOrigin === void 0 || handshake === void 0) return void 0;\n\t\t\tconst verdict = verifyAuthentication({\n\t\t\t\tchallenges: deviceChallenges,\n\t\t\t\torigin: publicOrigin,\n\t\t\t\thostPublicKey: handshake.publicKey,\n\t\t\t\tfind: (id) => options.store.trustedDevices().find((record) => record.id === id),\n\t\t\t\tbody\n\t\t\t});\n\t\t\tif (!verdict.ok) return void 0;\n\t\t\tconst enrolled = devices.enrol({\n\t\t\t\tuserAgent: verdict.record.label,\n\t\t\t\ttrust: {\n\t\t\t\t\tkind: \"device-key\",\n\t\t\t\t\ttrustedDeviceId: verdict.record.id\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst opened = [\n\t\t\t\t[\"session\", handshake.accept(verdict.channels.session)],\n\t\t\t\t[\"protocol\", handshake.accept(verdict.channels.protocol)],\n\t\t\t\t[\"http\", handshake.accept(verdict.channels.http)]\n\t\t\t];\n\t\t\tif (opened.some(([, channel]) => channel === void 0)) {\n\t\t\t\tdevices.revoke(enrolled.record.id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const [scope, channel] of opened) if (channel !== void 0) channels.set(channelKey(enrolled.record.id, scope), channel);\n\t\t\tif (!options.store.saveTrustedDevice({\n\t\t\t\t...verdict.record,\n\t\t\t\tlastSeenAt: now()\n\t\t\t})) {\n\t\t\t\tdevices.revoke(enrolled.record.id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpublish();\n\t\t\treturn {\n\t\t\t\t...enrolled,\n\t\t\t\tmaxAgeSeconds: cookieMaxAgeSeconds(settings, COOKIE_CEILING_SECONDS)\n\t\t\t};\n\t\t},\n\t\tbeginDeviceStepUp(sessionDeviceId, action) {\n\t\t\tif (handshake === void 0 || devices.trustOf(sessionDeviceId)?.kind !== \"device-key\") return void 0;\n\t\t\treturn deviceStepUpChallenge({\n\t\t\t\tchallenges: deviceChallenges,\n\t\t\t\tsessionDeviceId,\n\t\t\t\taction,\n\t\t\t\thostPublicKey: handshake.publicKey\n\t\t\t});\n\t\t},\n\t\tfinishDeviceStepUp(sessionDeviceId, action, ceremonyId, signature) {\n\t\t\tconst trust = devices.trustOf(sessionDeviceId);\n\t\t\tif (trust?.kind !== \"device-key\" || publicOrigin === void 0) return false;\n\t\t\tconst record = options.store.trustedDevices().find((held) => held.id === trust.trustedDeviceId);\n\t\t\tif (record === void 0) return false;\n\t\t\treturn verifyStepUp({\n\t\t\t\tchallenges: deviceChallenges,\n\t\t\t\torigin: publicOrigin,\n\t\t\t\thostPublicKey: handshake?.publicKey,\n\t\t\t\tsessionDeviceId,\n\t\t\t\taction,\n\t\t\t\tceremonyId,\n\t\t\t\tsignature,\n\t\t\t\tstepUpPublicKey: record.stepUpPublicKey\n\t\t\t});\n\t\t},\n\t\trevokeTrustedDevice(id) {\n\t\t\tconst heldBy = (record) => record.trust.kind === \"device-key\" && record.trust.trustedDeviceId === id;\n\t\t\tconst existed = options.store.trustedDevices().some((record) => record.id === id);\n\t\t\tconst removed = options.store.removeTrustedDevice(id);\n\t\t\tif (existed && !removed) return false;\n\t\t\tconst endedIds = new Set(devices.list().filter(heldBy).map((record) => record.id));\n\t\t\tconst ended = devices.revokeWhere(heldBy);\n\t\t\tdeviceChallenges.dropWhere((challenge) => challenge.purpose.kind === \"auth\" && challenge.purpose.trustedDeviceId === id || challenge.purpose.kind === \"step-up\" && endedIds.has(challenge.purpose.sessionDeviceId));\n\t\t\tif (!removed && ended === 0) return false;\n\t\t\tnotice(`revoked trusted device ${id}`);\n\t\t\tpublish();\n\t\t\treturn true;\n\t\t},\n\t\ttrustKind: (deviceId) => devices.trustOf(deviceId)?.kind,\n\t\tstepUpRequired: (_action, deviceId) => deviceId !== void 0 && devices.trustOf(deviceId)?.kind === \"device-key\" || webauthn.support().supported,\n\t\tchannelPublicKey: () => handshake?.publicKey,\n\t\topenChannel(deviceId, scope, clientPublicKey) {\n\t\t\tconst channel = handshake?.accept(clientPublicKey);\n\t\t\tif (channel === void 0) return false;\n\t\t\tchannels.set(channelKey(deviceId, scope), channel);\n\t\t\treturn true;\n\t\t},\n\t\tchannelFor: (deviceId, scope) => channels.get(channelKey(deviceId, scope)),\n\t\trevokeDevice(id) {\n\t\t\tconst revoked = devices.revoke(id);\n\t\t\tif (revoked) publish();\n\t\t\treturn revoked;\n\t\t},\n\t\tisDeviceConnected: (deviceId) => (sockets.get(deviceId)?.size ?? 0) > 0,\n\t\ttrackSocket(deviceId, close) {\n\t\t\tconst held = sockets.get(deviceId) ?? /* @__PURE__ */ new Set();\n\t\t\theld.add(close);\n\t\t\tsockets.set(deviceId, held);\n\t\t\treturn () => {\n\t\t\t\theld.delete(close);\n\t\t\t\tif (held.size === 0) sockets.delete(deviceId);\n\t\t\t};\n\t\t},\n\t\tasync close() {\n\t\t\tclearInterval(sweeper);\n\t\t\tawait teardown();\n\t\t\tstatus = \"off\";\n\t\t}\n\t};\n}\n//#endregion\nexport { createRemoteAccess };\n\n//# sourceMappingURL=index.mjs.map","import { nodeHost } from \"../nodeHost/index.mjs\";\nimport { poHomeDirectory } from \"../piSettings/core.mjs\";\nimport \"../../../runtimePiSettings.mjs\";\nimport \"../../constants/remote.mjs\";\nimport { parseNativePushRegistration } from \"../nativePushRegistration/index.mjs\";\nimport { DEFAULT_REMOTE_SETTINGS, parseRemoteAccessSettings } from \"../remoteAccessSettings/index.mjs\";\nimport path from \"node:path\";\nconst SETTINGS_FILE = \"remote-access.json\";\nconst CREDENTIALS_FILE = \"credentials.json\";\nconst TRUSTED_DEVICES_FILE = \"trusted-devices.json\";\nconst TRUSTED_DEVICE_PLATFORMS = /* @__PURE__ */ new Set([\"ios\", \"android\"]);\nconst STORED_ID = /^[A-Za-z0-9_-]{1,64}$/u;\nconst STORED_KEY = /^[A-Za-z0-9_-]{1,512}$/u;\nconst MAX_STORED_LABEL = 200;\nfunction defaultRemoteStateDir(homeDir = nodeHost.homeDirectory()) {\n\treturn path.join(poHomeDirectory(homeDir), \"web\");\n}\n/** Whether a file mode lets another account read the file. */\nfunction isLooseMode(mode) {\n\treturn (mode & 63) !== 0;\n}\n/** Whether one parsed entry is a complete trusted-device record; anything else is dropped. */\nfunction isTrustedDeviceRecord(value) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst record = value;\n\treturn typeof record.id === \"string\" && STORED_ID.test(record.id) && typeof record.identityPublicKey === \"string\" && STORED_KEY.test(record.identityPublicKey) && typeof record.stepUpPublicKey === \"string\" && STORED_KEY.test(record.stepUpPublicKey) && record.identityPublicKey !== record.stepUpPublicKey && typeof record.label === \"string\" && record.label.length <= MAX_STORED_LABEL && typeof record.platform === \"string\" && TRUSTED_DEVICE_PLATFORMS.has(record.platform) && Number.isFinite(record.createdAt) && Number.isFinite(record.lastSeenAt);\n}\nfunction parseSettingsFile(raw, settingsPath, notice) {\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\tnotice(`remote access settings at ${settingsPath} are not valid JSON; using defaults`);\n\t\treturn DEFAULT_REMOTE_SETTINGS;\n\t}\n\tconst outcome = parseRemoteAccessSettings(parsed);\n\tfor (const warning of outcome.warnings) notice(`remote access settings: ${warning}`);\n\treturn outcome.settings;\n}\nfunction parseCredentialsFile(raw, credentialsPath, notice) {\n\ttry {\n\t\tconst parsed = JSON.parse(raw);\n\t\treturn Array.isArray(parsed) ? parsed : [];\n\t} catch {\n\t\tnotice(`registered passkeys at ${credentialsPath} are not valid JSON; none will load`);\n\t\treturn [];\n\t}\n}\nfunction parseTrustedDevicesFile(raw, trustedDevicesPath, notice) {\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\tnotice(`trusted devices at ${trustedDevicesPath} are not valid JSON; none will load`);\n\t\treturn [];\n\t}\n\tif (!Array.isArray(parsed)) {\n\t\tnotice(`trusted devices at ${trustedDevicesPath} are not a list; none will load`);\n\t\treturn [];\n\t}\n\tconst loaded = [];\n\tfor (const entry of parsed) {\n\t\tif (!isTrustedDeviceRecord(entry) || loaded.some((held) => held.id === entry.id)) {\n\t\t\tnotice(`dropped an invalid trusted device record from ${trustedDevicesPath}`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (loaded.length >= 32) {\n\t\t\tnotice(`dropped trusted devices beyond the limit of ${String(32)} from ${trustedDevicesPath}`);\n\t\t\tbreak;\n\t\t}\n\t\tconst nativePush = parseNativePushRegistration(entry.nativePush, entry.platform);\n\t\tloaded.push({\n\t\t\tid: entry.id,\n\t\t\tidentityPublicKey: entry.identityPublicKey,\n\t\t\tstepUpPublicKey: entry.stepUpPublicKey,\n\t\t\tlabel: entry.label,\n\t\t\tplatform: entry.platform,\n\t\t\tcreatedAt: entry.createdAt,\n\t\t\tlastSeenAt: entry.lastSeenAt,\n\t\t\t...nativePush === void 0 ? {} : { nativePush }\n\t\t});\n\t}\n\treturn loaded;\n}\nfunction serializeStateFile(body) {\n\treturn `${JSON.stringify(body, void 0, 2)}\\n`;\n}\n//#endregion\nexport { CREDENTIALS_FILE, SETTINGS_FILE, TRUSTED_DEVICES_FILE, defaultRemoteStateDir, isLooseMode, parseCredentialsFile, parseSettingsFile, parseTrustedDevicesFile, serializeStateFile };\n\n//# sourceMappingURL=remoteAccessRecords.mjs.map","import \"../../constants/remote.mjs\";\nimport { DEFAULT_REMOTE_SETTINGS, parseRemoteAccessSettings, serializeRemoteAccessSettings } from \"../remoteAccessSettings/index.mjs\";\nimport { CREDENTIALS_FILE, SETTINGS_FILE, TRUSTED_DEVICES_FILE, defaultRemoteStateDir, isLooseMode, parseCredentialsFile, parseSettingsFile, parseTrustedDevicesFile, serializeStateFile } from \"./remoteAccessRecords.mjs\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/services/remoteAccessStore/sync.ts\n/**\n* Repairs a state file another account can read.\n*\n* Cheap, and it catches the cases a fresh write never would: a file restored\n* from a backup, copied with a permissive umask, or checked out of somewhere it\n* should not have been.\n*/\nfunction tightenMode(filePath, notice) {\n\ttry {\n\t\tif (!isLooseMode(fs.statSync(filePath).mode)) return;\n\t\tfs.chmodSync(filePath, 384);\n\t\tnotice(`tightened permissions on ${filePath}`);\n\t} catch {}\n}\nfunction readState(filePath, notice) {\n\tlet raw;\n\ttry {\n\t\traw = fs.readFileSync(filePath, \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\ttightenMode(filePath, notice);\n\treturn raw;\n}\n/**\n* Settings and passkeys on disk. Sessions deliberately not.\n*\n* A session is revoked when remote access is switched off, and a hub restart is\n* a switch-off, so persisting one would buy nothing while creating a bearer\n* secret worth stealing. A passkey is the opposite: surviving is its whole\n* point, and what is stored is a public key.\n*\n* @deprecated Node-only sync shim; use createRemoteAccessStoreAsync. Removed in M2.\n*/\nfunction createRemoteAccessStore(options = {}) {\n\tconst directory = options.stateDir ?? defaultRemoteStateDir();\n\tconst notice = options.onNotice ?? (() => {});\n\tconst settingsPath = path.join(directory, SETTINGS_FILE);\n\tconst credentialsPath = path.join(directory, CREDENTIALS_FILE);\n\tconst trustedDevicesPath = path.join(directory, TRUSTED_DEVICES_FILE);\n\tconst settingsRaw = readState(settingsPath, notice);\n\tlet current = settingsRaw === void 0 ? DEFAULT_REMOTE_SETTINGS : parseSettingsFile(settingsRaw, settingsPath, notice);\n\tconst credentialsRaw = readState(credentialsPath, notice);\n\tlet registered = credentialsRaw === void 0 ? [] : parseCredentialsFile(credentialsRaw, credentialsPath, notice);\n\tconst devicesRaw = readState(trustedDevicesPath, notice);\n\tlet trusted = devicesRaw === void 0 ? [] : parseTrustedDevicesFile(devicesRaw, trustedDevicesPath, notice);\n\tfunction writeJson(target, body) {\n\t\tconst temporary = `${target}.${String(process.pid)}.tmp`;\n\t\ttry {\n\t\t\tfs.mkdirSync(directory, {\n\t\t\t\trecursive: true,\n\t\t\t\tmode: 448\n\t\t\t});\n\t\t\tfs.writeFileSync(temporary, serializeStateFile(body), { mode: 384 });\n\t\t\tfs.renameSync(temporary, target);\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tnotice(`${target} could not be saved: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\ttry {\n\t\t\t\tfs.rmSync(temporary, { force: true });\n\t\t\t} catch {}\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn {\n\t\tdirectory,\n\t\tsettings: () => current,\n\t\tsettingsForRestore() {\n\t\t\tconst raw = readState(settingsPath, notice);\n\t\t\tif (raw === void 0) return void 0;\n\t\t\ttry {\n\t\t\t\treturn parseRemoteAccessSettings(JSON.parse(raw));\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\tcredentials: () => registered,\n\t\tsaveCredential(credential) {\n\t\t\tregistered = [...registered.filter((held) => held.id !== credential.id), credential];\n\t\t\twriteJson(credentialsPath, registered);\n\t\t},\n\t\tremoveCredential(id) {\n\t\t\tconst next = registered.filter((held) => held.id !== id);\n\t\t\tif (next.length === registered.length) return false;\n\t\t\tregistered = next;\n\t\t\twriteJson(credentialsPath, registered);\n\t\t\treturn true;\n\t\t},\n\t\ttrustedDevices: () => trusted,\n\t\tsaveTrustedDevice(record) {\n\t\t\tconst others = trusted.filter((held) => held.id !== record.id);\n\t\t\tif (others.length === trusted.length && trusted.length >= 32) return false;\n\t\t\tconst next = [...others, record];\n\t\t\tif (!writeJson(trustedDevicesPath, next)) return false;\n\t\t\ttrusted = next;\n\t\t\treturn true;\n\t\t},\n\t\tremoveTrustedDevice(id) {\n\t\t\tconst next = trusted.filter((held) => held.id !== id);\n\t\t\tif (next.length === trusted.length) return false;\n\t\t\tif (!writeJson(trustedDevicesPath, next)) return false;\n\t\t\ttrusted = next;\n\t\t\treturn true;\n\t\t},\n\t\tsave(settings) {\n\t\t\tcurrent = settings;\n\t\t\twriteJson(settingsPath, serializeRemoteAccessSettings(settings));\n\t\t}\n\t};\n}\n//#endregion\nexport { createRemoteAccessStore };\n\n//# sourceMappingURL=sync.mjs.map","import \"../platformFiles/index.mjs\";\nimport { createSerialRunner } from \"../serialRunner/index.mjs\";\nimport \"../../constants/remote.mjs\";\nimport { defaultRemoteStateDir } from \"./remoteAccessRecords.mjs\";\nimport { createRemoteAccessStore } from \"./sync.mjs\";\nimport \"node:crypto\";\nimport \"node:path\";\nimport \"@earendil-works/pi-durable/env\";\ncreateSerialRunner();\n//#endregion\nexport { createRemoteAccessStore, defaultRemoteStateDir };\n\n//# sourceMappingURL=index.mjs.map","import { PAIRING_CLAIM_ROUTE, PAIRING_STATUS_QUERY, PAIRING_STATUS_ROUTE, PASSKEY_REGISTER_BEGIN_ROUTE, PASSKEY_REGISTER_FINISH_ROUTE, REMOTE_API_ROUTE } from \"../../constants/remote.mjs\";\n//#region src/services/pairingPage/index.ts\n/**\n* The package-owned page a scanned QR opens before any cockpit JavaScript runs.\n*\n* It cannot be the cockpit bundle. The bundle sits behind the guard and must be\n* verified first. Its only subresource is the separately built package-owned PWA\n* bootstrap, whose worker verifies and stages the signed host bundle.\n*\n* Request data is never echoed into the markup. Local-loopback responses may embed\n* the package-generated public signer fields, whose alphabets cannot form markup.\n*/\n/** Asserted by the tunnel self-test to prove the pairing route is reachable end to end. */\nconst PAIRING_PAGE_MARKER = \"po-pairing-page\";\n/** How often the phone asks whether the host has answered. */\nconst POLL_INTERVAL_MS = 1e3;\nfunction pairingPageCsp(nonce) {\n\treturn [\n\t\t\"default-src 'none'\",\n\t\t\"style-src 'unsafe-inline'\",\n\t\t`script-src 'nonce-${nonce}' 'self'`,\n\t\t\"connect-src 'self'\",\n\t\t\"img-src 'self'\",\n\t\t\"manifest-src 'self'\",\n\t\t\"worker-src 'self'\",\n\t\t\"base-uri 'none'\",\n\t\t\"form-action 'none'\",\n\t\t\"frame-ancestors 'none'\"\n\t].join(\"; \");\n}\nfunction pairingPageHeaders(nonce) {\n\treturn {\n\t\t\"Content-Type\": \"text/html; charset=utf-8\",\n\t\t\"Cache-Control\": \"no-store\",\n\t\t\"Referrer-Policy\": \"no-referrer\",\n\t\t\"X-Frame-Options\": \"DENY\",\n\t\t\"Content-Security-Policy\": pairingPageCsp(nonce)\n\t};\n}\n/**\n* Colours are literals here rather than theme tokens on purpose: this page\n* renders before, and without, the cockpit bundle that defines the tokens, and\n* it lives outside `src/web` so the browser theming rule does not reach it.\n*/\nconst STYLE = `\n  :root { color-scheme: dark; }\n  body {\n    margin: 0; min-height: 100vh; display: grid; place-items: center;\n    background: #14161a; color: #e6e8ec;\n    font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, sans-serif;\n  }\n  main { width: min(30rem, 100% - 2.5rem); text-align: center; }\n  [hidden] { display: none !important; }\n  h1 { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem; }\n  p { margin: 0 0 1rem; color: #a2a8b4; }\n  .state { font-weight: 600; color: #e6e8ec; }\n  .bad { color: #ff6b6b; }\n  .ok { color: #6bd68a; }\n  form, .actions { display: flex; gap: 0.5rem; margin-top: 1.5rem; }\n  input, button {\n    font: inherit; padding: 0.6rem 0.8rem; border-radius: 0.5rem;\n    border: 1px solid #2c313a; background: #1b1e24; color: inherit;\n  }\n  input { flex: 1; min-width: 0; }\n  button { flex: 1; background: #2f6feb; border-color: #2f6feb; font-weight: 600; }\n  button.secondary { background: #1b1e24; border-color: #2c313a; }\n  button:disabled { opacity: 0.6; }\n  video { width: 100%; max-height: 18rem; border-radius: 0.75rem; margin-top: 1rem; }\n  code { display: block; overflow-wrap: anywhere; margin: 0.75rem 0; color: #e6e8ec; }\n`;\n/**\n* The client half of the pairing handshake.\n*\n* The code arrives in the URL fragment, which no browser sends to any server,\n* so it never reaches Cloudflare's edge logs, this process's access log, or a\n* Referer header. It is scrubbed from the address bar before anything else\n* runs, so a screenshot or a shared history entry does not carry it either.\n*/\nconst SCRIPT = `\n  const params = new URLSearchParams(location.hash.slice(1));\n  const code = params.get('c') ?? '';\n  const state = document.getElementById('state');\n  const manual = document.getElementById('manual');\n  const actions = document.getElementById('actions');\n  const addPasskey = document.getElementById('add-passkey');\n  const skipPasskey = document.getElementById('skip-passkey');\n  const trustPanel = document.getElementById('trust');\n  const trustFingerprint = document.getElementById('trust-fingerprint');\n  const acceptTrust = document.getElementById('accept-trust');\n  const say = (text, tone) => { state.textContent = text; state.className = 'state ' + (tone ?? ''); };\n  const openCockpit = () => location.replace('/');\n\n  function trustOf(value) {\n    if (!value || typeof value.publicKey !== 'string' || !/^[A-Za-z0-9_-]{80,512}$/.test(value.publicKey)) return undefined;\n    const revision = Number(value.revision);\n    if (!Number.isSafeInteger(revision) || revision < 1) return undefined;\n    return { publicKey: value.publicKey, revision, fingerprint: typeof value.fingerprint === 'string' ? value.fingerprint : '' };\n  }\n\n  const scannedTrust = trustOf({\n    publicKey: params.get('s'),\n    revision: params.get('r'),\n  });\n  let fragmentClaimStarted = code !== '';\n  const localTrust = trustOf({\n    publicKey: document.body.dataset.localSigner,\n    revision: document.body.dataset.localRevision,\n    fingerprint: document.body.dataset.localFingerprint,\n  });\n\n  function rememberChannelKey(value) {\n    if (typeof value !== 'string' || value === '') return false;\n    try { sessionStorage.setItem('po.channelKey', value); return true; } catch { return false; }\n  }\n  rememberChannelKey(params.get('k'));\n  history.replaceState(null, '', location.pathname);\n  window.addEventListener('hashchange', () => {\n    const nextParams = new URLSearchParams(location.hash.slice(1));\n    const nextCode = nextParams.get('c') ?? '';\n    if (nextCode === '') return;\n    fragmentClaimStarted = true;\n    const nextTrust = trustOf({\n      publicKey: nextParams.get('s'),\n      revision: nextParams.get('r'),\n    });\n    rememberChannelKey(nextParams.get('k'));\n    history.replaceState(null, '', location.pathname);\n    void claim(nextCode, nextTrust);\n  });\n\n  async function requestWorker(message) {\n    if (!('serviceWorker' in navigator)) return { ok: false, message: 'This browser cannot install the trusted verifier.' };\n    let registration;\n    try {\n      registration = await Promise.race([\n        navigator.serviceWorker.ready,\n        new Promise((_, reject) => setTimeout(() => reject(new Error('The trusted verifier did not start.')), 20000)),\n      ]);\n    } catch (error) {\n      return { ok: false, message: error?.message ?? 'The trusted verifier did not start.' };\n    }\n    const serviceWorker = registration.active ?? registration.waiting ?? registration.installing;\n    if (!serviceWorker) return { ok: false, message: 'The trusted verifier is unavailable.' };\n    const channel = new MessageChannel();\n    return await new Promise((resolve) => {\n      const timer = setTimeout(() => resolve({ ok: false, message: 'Bundle verification timed out.' }), 120000);\n      channel.port1.addEventListener('message', (event) => {\n        clearTimeout(timer);\n        resolve(event.data && typeof event.data.ok === 'boolean' ? event.data : { ok: false, message: 'The verifier returned invalid data.' });\n      }, { once: true });\n      channel.port1.start();\n      serviceWorker.postMessage(message, [channel.port2]);\n    });\n  }\n\n  /**\n   * Names the refusal in terms of what the person has to do about it.\n   *\n   * A rotated host key reaches the verifier as untrusted-public-key rather than\n   * signer-mismatch, because a refresh always re-sends the pinned key and only\n   * the signature check can notice the host moved on.\n   */\n  function bundleRefusalMessage(result) {\n    if (result.code === 'untrusted-public-key')\n      return 'This host now signs with a different key. Scan a fresh pairing QR so you can confirm the new fingerprint.';\n    if (result.code === 'stale-revision')\n      return 'This host offers an older cockpit build than this device already verified. Clear this site data to accept it.';\n    return result.message ?? 'The signed cockpit bundle was refused.';\n  }\n\n  async function activateTrust(trust, alreadyConfirmed = false) {\n    say('Verifying every cockpit file before it can run.');\n    let result = await requestWorker({ type: 'po:activate-bundle', publicKey: trust.publicKey, minimumRevision: trust.revision });\n    if (!result.ok && result.code === 'signer-mismatch') {\n      if (!alreadyConfirmed && !(await confirmManualTrust(trust))) return false;\n      say('Resetting the old host key and verifying the newly paired host.');\n      const reset = await requestWorker({ type: 'po:reset-bundle-trust' });\n      if (!reset.ok) { say(reset.message ?? 'The old host key could not be reset.', 'bad'); return false; }\n      result = await requestWorker({ type: 'po:activate-bundle', publicKey: trust.publicKey, minimumRevision: trust.revision });\n    }\n    if (!result.ok) {\n      say(bundleRefusalMessage(result), 'bad');\n      return false;\n    }\n    return true;\n  }\n\n  function offerPasskey() {\n    if (!window.PublicKeyCredential) {\n      say('Paired and verified. Opening the cockpit.', 'ok');\n      setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n      return;\n    }\n    say('Paired and verified. Add a passkey to use Face ID, Touch ID, or your device PIN next time.', 'ok');\n    actions.hidden = false;\n  }\n\n  async function signingFingerprint(publicKey) {\n    try {\n      const normalized = publicKey.replaceAll('-', '+').replaceAll('_', '/');\n      const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, '=');\n      const bytes = Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));\n      const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', bytes));\n      return Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');\n    } catch {\n      return 'unavailable';\n    }\n  }\n\n  async function confirmManualTrust(trust) {\n    const fingerprint = trust.fingerprint || await signingFingerprint(trust.publicKey);\n    return await new Promise((resolve) => {\n      trustFingerprint.textContent = fingerprint.match(/.{1,8}/g)?.join(' ') ?? fingerprint;\n      trustPanel.hidden = false;\n      say('Compare this signing-key fingerprint with the one shown on the host.');\n      acceptTrust.addEventListener('click', () => { trustPanel.hidden = true; resolve(true); }, { once: true });\n    });\n  }\n\n  async function poll(requestId) {\n    for (;;) {\n      await new Promise((resolve) => setTimeout(resolve, ${String(POLL_INTERVAL_MS)}));\n      const response = await fetch('${PAIRING_STATUS_ROUTE}?${PAIRING_STATUS_QUERY}=' + encodeURIComponent(requestId), { credentials: 'same-origin' });\n      if (!response.ok) { say('This pairing request is no longer valid. Scan again.', 'bad'); return undefined; }\n      const body = await response.json();\n      if (body.status === 'approved') return body;\n      if (body.status === 'denied') { say('The host denied this device.', 'bad'); return undefined; }\n      if (body.status === 'expired') { say('The request timed out. Scan again.', 'bad'); return undefined; }\n    }\n  }\n\n  async function claim(value, candidateTrust) {\n    if (value === '') { say('Scan the code shown on the host or enter its manual code.', 'bad'); manual.hidden = false; return; }\n    say('Asking the host to approve this device...');\n    const response = await fetch('${PAIRING_CLAIM_ROUTE}', {\n      method: 'POST',\n      headers: { 'content-type': 'application/json' },\n      credentials: 'same-origin',\n      body: JSON.stringify({ code: value }),\n    });\n    if (!response.ok) {\n      say(response.status === 429 ? 'Too many attempts. Wait a minute.' : 'That code is not valid. Scan again.', 'bad');\n      manual.hidden = false;\n      return;\n    }\n    const claimed = await response.json();\n    say('Waiting for the host to approve this device.');\n    const approved = await poll(claimed.requestId);\n    if (!approved) return;\n    rememberChannelKey(approved.hostPublicKey);\n    const trust = candidateTrust ?? trustOf(approved.bundleTrust);\n    if (!trust) { say('The host did not provide signed-bundle trust. Pair again.', 'bad'); return; }\n    if (!candidateTrust && !(await confirmManualTrust(trust))) return;\n    if (await activateTrust(trust, !candidateTrust)) offerPasskey();\n  }\n\n  const fromBase64Url = (value) =>\n    Uint8Array.from(atob(value.replaceAll('-', '+').replaceAll('_', '/')), (c) => c.charCodeAt(0));\n  const toBase64Url = (buffer) =>\n    btoa(String.fromCharCode(...new Uint8Array(buffer))).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '');\n\n  function decodeAuthenticationOptions(options) {\n    return {\n      ...options,\n      challenge: fromBase64Url(options.challenge),\n      allowCredentials: (options.allowCredentials ?? []).map((entry) => ({ ...entry, id: fromBase64Url(entry.id) })),\n    };\n  }\n\n  function decodeRegistrationOptions(options) {\n    return {\n      ...options,\n      challenge: fromBase64Url(options.challenge),\n      user: { ...options.user, id: fromBase64Url(options.user.id) },\n      excludeCredentials: (options.excludeCredentials ?? []).map((entry) => ({ ...entry, id: fromBase64Url(entry.id) })),\n    };\n  }\n\n  function encodeCredential(credential) {\n    const assertion = credential.response;\n    return {\n      id: credential.id,\n      rawId: toBase64Url(credential.rawId),\n      type: credential.type,\n      clientExtensionResults: credential.getClientExtensionResults(),\n      response: {\n        clientDataJSON: toBase64Url(assertion.clientDataJSON),\n        authenticatorData: toBase64Url(assertion.authenticatorData),\n        signature: toBase64Url(assertion.signature),\n        userHandle: assertion.userHandle ? toBase64Url(assertion.userHandle) : undefined,\n      },\n    };\n  }\n\n  function encodeRegistrationCredential(credential) {\n    const attestation = credential.response;\n    return {\n      id: credential.id,\n      rawId: toBase64Url(credential.rawId),\n      type: credential.type,\n      authenticatorAttachment: credential.authenticatorAttachment,\n      clientExtensionResults: credential.getClientExtensionResults(),\n      response: {\n        clientDataJSON: toBase64Url(attestation.clientDataJSON),\n        attestationObject: toBase64Url(attestation.attestationObject),\n        transports: typeof attestation.getTransports === 'function' ? attestation.getTransports() : [],\n      },\n    };\n  }\n\n  async function passkeySignIn() {\n    if (!window.PublicKeyCredential) return false;\n    try {\n      const begun = await fetch('${REMOTE_API_ROUTE}/passkeys/authenticate/begin', {\n        method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin', body: '{}',\n      });\n      if (!begun.ok) return false;\n      const { ceremonyId, options } = await begun.json();\n      if (typeof ceremonyId !== 'string') return false;\n      const credential = await navigator.credentials.get({ publicKey: decodeAuthenticationOptions(options) });\n      if (!credential) return false;\n      const finished = await fetch('${REMOTE_API_ROUTE}/passkeys/authenticate/finish', {\n        method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin',\n        body: JSON.stringify({ ceremonyId, response: encodeCredential(credential) }),\n      });\n      if (!finished.ok) return false;\n      const result = await finished.json();\n      if (!rememberChannelKey(result.hostPublicKey)) return false;\n      const refreshed = await requestWorker({ type: 'po:refresh-bundle' });\n      // A host this device cannot reach is not a trust decision. The pin is the\n      // last bundle this device verified for itself, so it stays usable while\n      // the host is away. Every other refusal is a trust decision and still\n      // blocks entry.\n      if (!refreshed.ok && refreshed.code === 'manifest-fetch') {\n        say('Could not check for a newer cockpit build. Opening the last verified one.');\n        return true;\n      }\n      if (!refreshed.ok) say(bundleRefusalMessage(refreshed), 'bad');\n      return refreshed.ok;\n    } catch {\n      return false;\n    }\n  }\n\n  async function registerPasskey() {\n    addPasskey.disabled = true;\n    skipPasskey.disabled = true;\n    say('Confirm passkey setup on this device.');\n    try {\n      const begun = await fetch('${PASSKEY_REGISTER_BEGIN_ROUTE}', {\n        method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin', body: '{}',\n      });\n      if (!begun.ok) throw new Error('Passkey setup is unavailable.');\n      const { ceremonyId, options } = await begun.json();\n      if (typeof ceremonyId !== 'string') throw new Error('Passkey setup is unavailable.');\n      const credential = await navigator.credentials.create({ publicKey: decodeRegistrationOptions(options) });\n      if (!credential) throw new Error('Passkey setup was cancelled.');\n      const finished = await fetch('${PASSKEY_REGISTER_FINISH_ROUTE}', {\n        method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin',\n        body: JSON.stringify({ ceremonyId, response: encodeRegistrationCredential(credential) }),\n      });\n      if (!finished.ok) throw new Error('That passkey was not accepted.');\n      say('Passkey added. Opening the cockpit.', 'ok');\n      setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n    } catch (error) {\n      if (error?.name === 'InvalidStateError') {\n        say('A passkey for this site already exists. Opening the cockpit.', 'ok');\n        setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n        return;\n      }\n      say(error?.name === 'NotAllowedError' ? 'Passkey setup was cancelled.' : (error?.message ?? 'Passkey setup failed.'), 'bad');\n      addPasskey.disabled = false;\n      skipPasskey.disabled = false;\n    }\n  }\n\n  manual.addEventListener('submit', (event) => {\n    event.preventDefault();\n    manual.hidden = true;\n    void claim(new FormData(manual).get('code')?.toString().trim() ?? '', undefined);\n  });\n  addPasskey.addEventListener('click', () => void registerPasskey());\n  skipPasskey.addEventListener('click', openCockpit);\n\n  void (async () => {\n    if (localTrust) {\n      if (await activateTrust(localTrust)) openCockpit();\n      return;\n    }\n    if (code !== '') { await claim(code, scannedTrust); return; }\n    say('Checking for a passkey on this device...');\n    if (await passkeySignIn()) { say('Signed in and verified. Opening the cockpit.', 'ok'); openCockpit(); return; }\n    if (!fragmentClaimStarted) await claim('', undefined);\n  })();\n`;\nfunction pairingPageHtml(input) {\n\tconst localSigner = input.localTrust?.publicKey ?? \"\";\n\tconst localRevision = input.localTrust?.revision ?? \"\";\n\tconst localFingerprint = input.localTrust?.fingerprint ?? \"\";\n\treturn `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<meta name=\"theme-color\" content=\"#14161a\">\n<link rel=\"manifest\" href=\"/manifest.webmanifest\">\n<title>Pair with Po</title>\n<style>${STYLE}</style>\n</head>\n<body data-marker=\"${PAIRING_PAGE_MARKER}\" data-local-signer=\"${localSigner}\" data-local-revision=\"${String(localRevision)}\" data-local-fingerprint=\"${localFingerprint}\">\n<main>\n  <h1>Pair this device</h1>\n  <p>This cockpit can run shell commands on the host machine. Pair only your own device.</p>\n  <p id=\"state\" class=\"state\">Starting.</p>\n  <form id=\"manual\" hidden>\n    <input name=\"code\" inputmode=\"numeric\" pattern=\"[0-9]{8}\" maxlength=\"8\" autocomplete=\"one-time-code\" placeholder=\"8-digit pairing code\" aria-label=\"8-digit pairing code\">\n    <button type=\"submit\">Pair</button>\n  </form>\n  <div id=\"trust\" hidden>\n    <p>Signing-key fingerprint</p>\n    <code id=\"trust-fingerprint\"></code>\n    <button id=\"accept-trust\" type=\"button\">Fingerprint matches</button>\n  </div>\n  <div id=\"actions\" class=\"actions\" hidden>\n    <button id=\"add-passkey\" type=\"button\">Add passkey</button>\n    <button id=\"skip-passkey\" class=\"secondary\" type=\"button\">Not now</button>\n  </div>\n  <section id=\"scanner\">\n    <p id=\"pwa-status\" role=\"status\">Checking browser support.</p>\n    <video id=\"camera\" playsinline muted hidden></video>\n    <div class=\"actions\">\n      <button id=\"scan\" type=\"button\">Scan pairing QR</button>\n      <button id=\"cancel\" class=\"secondary\" type=\"button\" hidden>Cancel</button>\n    </div>\n  </section>\n  <noscript><p class=\"bad\">Pairing needs JavaScript, because the code never leaves your browser.</p></noscript>\n</main>\n<script nonce=\"${input.nonce}\">${SCRIPT}<\\/script>\n<script type=\"module\" src=\"/pwa/pwa.js\"><\\/script>\n</body>\n</html>`;\n}\n//#endregion\nexport { PAIRING_PAGE_MARKER, pairingPageCsp, pairingPageHeaders, pairingPageHtml };\n\n//# sourceMappingURL=index.mjs.map","//#region src/services/tunnelOutput/index.ts\n/**\n* A trycloudflare hostname, and nothing that merely ends near one.\n*\n* The trailing lookahead is the whole point. Without it,\n* `https://evil.trycloudflare.com.attacker.tld` printed by a confused or\n* hostile process would match, and the extracted value becomes the origin the\n* guard then trusts for every subsequent request.\n*/\nconst QUICK_TUNNEL_URL = /https:\\/\\/[a-z0-9][a-z0-9-]*(?:\\.[a-z0-9-]+)*\\.trycloudflare\\.com(?![a-z0-9.-])/iu;\n/** Cloudflare reports a connection registered; readiness waits for this as well as a URL. */\nconst CONNECTION_READY = /registered tunnel connection|connection .* registered/iu;\nfunction tunnelTarget(port) {\n\treturn `http://127.0.0.1:${String(port)}`;\n}\n/**\n* The cloudflared argument vector.\n*\n* `--url` is a flag on the `tunnel` command rather than on `run`, so it comes\n* before the subcommand in both shapes. `--token-file` belongs to `run`.\n*\n* Flag placement here follows cloudflared's documented usage and local help.\n*/\nfunction tunnelArgs(config, port, tokenFile) {\n\tconst args = [\"tunnel\", \"--no-autoupdate\"];\n\tif (config.kind === \"named\" && config.configFile !== void 0) args.push(\"--config\", config.configFile);\n\targs.push(\"--url\", tunnelTarget(port));\n\tif (config.kind === \"quick\") return args;\n\targs.push(\"run\");\n\tif (tokenFile !== void 0 && tokenFile !== \"\") args.push(\"--token-file\", tokenFile);\n\tif (config.name !== void 0) args.push(config.name);\n\treturn args;\n}\n/** The public origin a quick tunnel announced, or undefined if this output does not carry one. */\nfunction extractTunnelUrl(text) {\n\treturn QUICK_TUNNEL_URL.exec(text)?.[0].toLowerCase();\n}\nfunction mentionsRegisteredConnection(text) {\n\treturn CONNECTION_READY.test(text);\n}\n/** Operator-facing copy for a failure, with the cause appended by the caller. */\nfunction describeTunnelFailure(failure) {\n\tswitch (failure) {\n\t\tcase \"not_installed\": return \"cloudflared is not installed. Install it (brew install cloudflared) or set PO_CLOUDFLARED.\";\n\t\tcase \"spawn_failed\": return \"cloudflared could not be started.\";\n\t\tcase \"timeout\": return \"cloudflared did not report a public URL in time.\";\n\t\tcase \"self_test_failed\": return \"The tunnel came up unguarded and was closed immediately.\";\n\t\tcase \"exited\": return \"cloudflared stopped on its own.\";\n\t}\n}\n//#endregion\nexport { describeTunnelFailure, extractTunnelUrl, mentionsRegisteredConnection, tunnelArgs, tunnelTarget };\n\n//# sourceMappingURL=index.mjs.map","import { PAIRING_PAGE_ROUTE } from \"../../constants/remote.mjs\";\nimport \"../pairingPage/index.mjs\";\nimport { describeTunnelFailure, extractTunnelUrl, mentionsRegisteredConnection, tunnelArgs } from \"../tunnelOutput/index.mjs\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { spawn } from \"node:child_process\";\n//#region src/services/tunnelProcess/index.ts\n/** Explicit binary path, ahead of a PATH scan. */\nconst CLOUDFLARED_ENV = \"PO_CLOUDFLARED\";\nconst START_TIMEOUT_MS = 45e3;\nconst TERMINATE_GRACE_MS = 2e3;\nconst SELF_TEST_ATTEMPTS = 10;\nconst SELF_TEST_RETRY_MS = 500;\nconst NAMED_RESTART_ATTEMPTS = 3;\nconst NAMED_RESTART_BASE_DELAY_MS = 500;\nconst NAMED_RESTART_MAX_DELAY_MS = 4e3;\nconst NAMED_RESTART_STABLE_MS = 6e4;\nconst UNAUTHORIZED = 401;\n/** Cloudflare has the DNS route but no connector has registered yet. */\nconst EDGE_TUNNEL_UNAVAILABLE = 530;\nconst OK = 200;\nconst PID_FILE = \"tunnel.pid\";\nconst TOKEN_FILE = \"tunnel.token\";\nconst FILE_MODE = 384;\n/** A pid file older than this is stale beyond usefulness and the pid has likely been recycled. */\nconst PID_FILE_MAX_AGE_MS = 6048e5;\n/**\n* Finds cloudflared without a shell.\n*\n* A manual scan rather than `which`: spawning a shell to locate a binary is a\n* quoting hazard for no benefit, and this also works the same on every platform.\n*/\nfunction findCloudflared(env = process.env) {\n\tconst names = process.platform === \"win32\" ? [\"cloudflared.exe\", \"cloudflared\"] : [\"cloudflared\"];\n\tfor (const directory of (env.PATH ?? \"\").split(path.delimiter)) {\n\t\tif (directory === \"\") continue;\n\t\tfor (const name of names) {\n\t\t\tconst candidate = path.join(directory, name);\n\t\t\ttry {\n\t\t\t\tfs.accessSync(candidate, fs.constants.X_OK);\n\t\t\t\treturn candidate;\n\t\t\t} catch {}\n\t\t}\n\t}\n}\nasync function defaultProbe(url, signal) {\n\tconst response = await fetch(url, {\n\t\tredirect: \"manual\",\n\t\tsignal\n\t});\n\treturn {\n\t\tstatus: response.status,\n\t\tbody: await response.text()\n\t};\n}\nfunction validPid(value) {\n\treturn typeof value === \"number\" && Number.isSafeInteger(value) && value > 0;\n}\n/** Only ESRCH proves the owner is gone; permission and platform errors fail safe. */\nfunction ownerMayBeAlive(pid) {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (error) {\n\t\treturn error.code !== \"ESRCH\";\n\t}\n}\nfunction reapStaleTunnel(stateDir, onNotice) {\n\tconst pidPath = path.join(stateDir, PID_FILE);\n\tconst tokenPath = path.join(stateDir, TOKEN_FILE);\n\tlet raw;\n\ttry {\n\t\traw = fs.readFileSync(pidPath, \"utf8\");\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") fs.rmSync(tokenPath, { force: true });\n\t\treturn;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn;\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null) return;\n\tconst record = parsed;\n\tif (Object.hasOwn(record, \"ownerPid\")) {\n\t\tif (!validPid(record.ownerPid) || ownerMayBeAlive(record.ownerPid)) return;\n\t}\n\tfs.rmSync(tokenPath, { force: true });\n\tfs.rmSync(pidPath, { force: true });\n\tconst pid = validPid(record.pid) ? record.pid : void 0;\n\tconst startedAt = typeof record.startedAt === \"number\" ? record.startedAt : 0;\n\tif (pid === void 0 || Date.now() - startedAt > PID_FILE_MAX_AGE_MS) return;\n\tif (process.platform === \"linux\") try {\n\t\tif (!fs.readFileSync(`/proc/${String(pid)}/cmdline`, \"utf8\").includes(\"cloudflared\")) return;\n\t} catch {\n\t\treturn;\n\t}\n\ttry {\n\t\tprocess.kill(pid, \"SIGTERM\");\n\t\tonNotice(`stopped a tunnel left running by a previous hub (pid ${String(pid)})`);\n\t} catch {}\n}\nfunction tailOf(lines) {\n\treturn lines.slice(-20).join(\"\").trim();\n}\n/** Copies a named tunnel token to a private runtime file understood by cloudflared. */\nfunction writeTokenFile(config, stateDir) {\n\tif (config.kind !== \"named\" || config.tokenFile === void 0) return void 0;\n\tlet token;\n\tlet sourcePath;\n\ttry {\n\t\tsourcePath = fs.realpathSync(config.tokenFile);\n\t\ttoken = fs.readFileSync(sourcePath, \"utf8\").trim();\n\t} catch {\n\t\treturn;\n\t}\n\tif (token === \"\") return void 0;\n\tfs.mkdirSync(stateDir, {\n\t\trecursive: true,\n\t\tmode: 448\n\t});\n\tconst tokenPath = path.join(stateDir, TOKEN_FILE);\n\tlet existingTarget;\n\ttry {\n\t\texistingTarget = fs.realpathSync(tokenPath);\n\t} catch {}\n\tif (sourcePath === path.resolve(tokenPath) || sourcePath === existingTarget) throw new Error(\"The configured tunnel token file cannot also be Po runtime token storage.\");\n\tfs.rmSync(tokenPath, { force: true });\n\tfs.writeFileSync(tokenPath, token, { mode: FILE_MODE });\n\tfs.chmodSync(tokenPath, FILE_MODE);\n\treturn tokenPath;\n}\nfunction createTunnelLauncher(options) {\n\tconst notice = options.onNotice ?? (() => {});\n\tconst restartBaseDelayMs = options.restartBaseDelayMs ?? NAMED_RESTART_BASE_DELAY_MS;\n\tconst restartStableMs = options.restartStableMs ?? NAMED_RESTART_STABLE_MS;\n\treturn async function launch(input) {\n\t\tlet stopped = false;\n\t\tlet activeStop;\n\t\tlet stopPromise;\n\t\tlet recoveryPromise;\n\t\tlet pendingExit;\n\t\tlet restartCount = 0;\n\t\tlet lastReadyAt = 0;\n\t\tconst recoveryAbort = new AbortController();\n\t\tconst signal = input.signal === void 0 ? recoveryAbort.signal : AbortSignal.any([input.signal, recoveryAbort.signal]);\n\t\tconst supervisedInput = {\n\t\t\t...input,\n\t\t\tsignal\n\t\t};\n\t\tfunction queueUnexpectedExit(message) {\n\t\t\tif (stopped) return;\n\t\t\tif (input.config.kind === \"quick\") {\n\t\t\t\toptions.onExit?.(message);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (recoveryPromise !== void 0) {\n\t\t\t\tpendingExit = message;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbeginRecovery(message);\n\t\t}\n\t\tconst single = createSingleTunnelLauncher({\n\t\t\t...options,\n\t\t\tonExit: queueUnexpectedExit\n\t\t});\n\t\tasync function waitForRestart(attempt) {\n\t\t\tif (recoveryAbort.signal.aborted) return;\n\t\t\tconst delayMs = Math.min(restartBaseDelayMs * 2 ** (attempt - 1), NAMED_RESTART_MAX_DELAY_MS);\n\t\t\tawait new Promise((resolve) => {\n\t\t\t\tlet timer;\n\t\t\t\tconst done = () => {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\trecoveryAbort.signal.removeEventListener(\"abort\", done);\n\t\t\t\t\tresolve();\n\t\t\t\t};\n\t\t\t\ttimer = setTimeout(done, delayMs);\n\t\t\t\trecoveryAbort.signal.addEventListener(\"abort\", done, { once: true });\n\t\t\t\tif (recoveryAbort.signal.aborted) done();\n\t\t\t});\n\t\t}\n\t\tasync function recover(initialMessage) {\n\t\t\tif (Date.now() - lastReadyAt >= restartStableMs) restartCount = 0;\n\t\t\tlet lastFailure = initialMessage;\n\t\t\twhile (!stopped && restartCount < NAMED_RESTART_ATTEMPTS) {\n\t\t\t\trestartCount += 1;\n\t\t\t\tnotice(`cloudflared stopped; restarting named tunnel (attempt ${String(restartCount)} of ${String(NAMED_RESTART_ATTEMPTS)})`);\n\t\t\t\tawait waitForRestart(restartCount);\n\t\t\t\tif (stopped) return;\n\t\t\t\tconst outcome = await single(supervisedInput);\n\t\t\t\tif (stopped) {\n\t\t\t\t\tif (outcome.ok) await outcome.stop().catch(() => void 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!outcome.ok) {\n\t\t\t\t\tlastFailure = outcome.message;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tactiveStop = outcome.stop;\n\t\t\t\tlastReadyAt = Date.now();\n\t\t\t\tnotice(`named tunnel recovered at ${outcome.publicOrigin}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!stopped) options.onExit?.(`${initialMessage}\\nNamed tunnel recovery failed after ${String(NAMED_RESTART_ATTEMPTS)} attempts. Last failure: ${lastFailure}`);\n\t\t}\n\t\tfunction beginRecovery(message) {\n\t\t\trecoveryPromise = recover(message).catch((error) => {\n\t\t\t\tif (!stopped) {\n\t\t\t\t\tconst cause = error instanceof Error ? error.message : String(error);\n\t\t\t\t\toptions.onExit?.(`${message}\\nNamed tunnel recovery failed: ${cause}`);\n\t\t\t\t}\n\t\t\t}).finally(() => {\n\t\t\t\trecoveryPromise = void 0;\n\t\t\t\tconst queued = pendingExit;\n\t\t\t\tpendingExit = void 0;\n\t\t\t\tif (queued !== void 0 && !stopped) beginRecovery(queued);\n\t\t\t});\n\t\t}\n\t\tconst initial = await single(supervisedInput);\n\t\tif (!initial.ok) {\n\t\t\tstopped = true;\n\t\t\trecoveryAbort.abort();\n\t\t\treturn initial;\n\t\t}\n\t\tactiveStop = initial.stop;\n\t\tlastReadyAt = Date.now();\n\t\tconst stop = async () => {\n\t\t\tif (stopPromise !== void 0) return await stopPromise;\n\t\t\tstopped = true;\n\t\t\trecoveryAbort.abort();\n\t\t\tconst recovering = recoveryPromise;\n\t\t\tstopPromise = (async () => {\n\t\t\t\tawait activeStop?.().catch(() => void 0);\n\t\t\t\tawait recovering?.catch(() => void 0);\n\t\t\t\tfs.rmSync(path.join(options.stateDir, PID_FILE), { force: true });\n\t\t\t\tfs.rmSync(path.join(options.stateDir, TOKEN_FILE), { force: true });\n\t\t\t})();\n\t\t\treturn await stopPromise;\n\t\t};\n\t\treturn {\n\t\t\tok: true,\n\t\t\tpublicOrigin: initial.publicOrigin,\n\t\t\tstop\n\t\t};\n\t};\n}\n/** Starts one cloudflared child; the exported launcher supervises successive named-tunnel children. */\nfunction createSingleTunnelLauncher(options) {\n\tconst notice = options.onNotice ?? (() => {});\n\tconst spawnProcess = options.spawnProcess ?? spawn;\n\tconst probe = options.probe ?? defaultProbe;\n\tconst selfTestRetryMs = options.selfTestRetryMs ?? SELF_TEST_RETRY_MS;\n\tconst startTimeoutMs = options.startTimeoutMs ?? START_TIMEOUT_MS;\n\tconst pidPath = path.join(options.stateDir, PID_FILE);\n\tconst runtimeTokenPath = path.join(options.stateDir, TOKEN_FILE);\n\treturn async function launch(input) {\n\t\tif (input.signal?.aborted === true) return {\n\t\t\tok: false,\n\t\t\tfailure: \"exited\",\n\t\t\tmessage: \"Tunnel startup was cancelled.\"\n\t\t};\n\t\tconst binary = options.cloudflaredPath ?? process.env[\"PO_CLOUDFLARED\"] ?? findCloudflared();\n\t\tif (binary === void 0 || binary === \"\") return {\n\t\t\tok: false,\n\t\t\tfailure: \"not_installed\",\n\t\t\tmessage: describeTunnelFailure(\"not_installed\")\n\t\t};\n\t\tlet tokenPath;\n\t\ttry {\n\t\t\ttokenPath = writeTokenFile(input.config, options.stateDir);\n\t\t} catch (error) {\n\t\t\tconst cause = error instanceof Error ? error.message : String(error);\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\tfailure: \"spawn_failed\",\n\t\t\t\tmessage: `${describeTunnelFailure(\"spawn_failed\")} ${cause}`\n\t\t\t};\n\t\t}\n\t\tconst args = tunnelArgs(input.config, input.port, tokenPath);\n\t\tlet child;\n\t\ttry {\n\t\t\tchild = spawnProcess(binary, args, {\n\t\t\t\tdetached: false,\n\t\t\t\tstdio: [\n\t\t\t\t\t\"ignore\",\n\t\t\t\t\t\"pipe\",\n\t\t\t\t\t\"pipe\"\n\t\t\t\t]\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tfs.rmSync(runtimeTokenPath, { force: true });\n\t\t\tconst cause = error instanceof Error ? error.message : String(error);\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\tfailure: \"spawn_failed\",\n\t\t\t\tmessage: `${describeTunnelFailure(\"spawn_failed\")} ${cause}`\n\t\t\t};\n\t\t}\n\t\tconst lines = [];\n\t\tlet stopped = false;\n\t\tlet settle;\n\t\tlet selfTestStarted = false;\n\t\tconst selfTestAbort = new AbortController();\n\t\tconst killTree = () => {\n\t\t\ttry {\n\t\t\t\tchild.kill(\"SIGTERM\");\n\t\t\t} catch {}\n\t\t};\n\t\tconst onProcessExit = () => {\n\t\t\tfs.rmSync(runtimeTokenPath, { force: true });\n\t\t\ttry {\n\t\t\t\tif (child.pid !== void 0) process.kill(child.pid, \"SIGKILL\");\n\t\t\t} catch {}\n\t\t};\n\t\tprocess.once(\"exit\", onProcessExit);\n\t\tconst stop = async () => {\n\t\t\tif (stopped) return;\n\t\t\tstopped = true;\n\t\t\tif (child.exitCode !== null || child.signalCode !== null) {\n\t\t\t\tprocess.off(\"exit\", onProcessExit);\n\t\t\t\tfs.rmSync(pidPath, { force: true });\n\t\t\t\tfs.rmSync(runtimeTokenPath, { force: true });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait new Promise((resolve) => {\n\t\t\t\tconst escalate = setTimeout(() => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tchild.kill(\"SIGKILL\");\n\t\t\t\t\t} catch {}\n\t\t\t\t}, TERMINATE_GRACE_MS);\n\t\t\t\tchild.once(\"exit\", () => {\n\t\t\t\t\tclearTimeout(escalate);\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t\tkillTree();\n\t\t\t});\n\t\t\tprocess.off(\"exit\", onProcessExit);\n\t\t\tfs.rmSync(pidPath, { force: true });\n\t\t\tfs.rmSync(runtimeTokenPath, { force: true });\n\t\t};\n\t\ttry {\n\t\t\tfs.mkdirSync(options.stateDir, {\n\t\t\t\trecursive: true,\n\t\t\t\tmode: 448\n\t\t\t});\n\t\t\tfs.writeFileSync(pidPath, JSON.stringify({\n\t\t\t\tpid: child.pid,\n\t\t\t\townerPid: process.pid,\n\t\t\t\tstartedAt: Date.now(),\n\t\t\t\tcommand: binary\n\t\t\t}), { mode: FILE_MODE });\n\t\t} catch {}\n\t\tlet seenUrl = input.config.kind === \"named\" ? `https://${input.config.hostname}` : void 0;\n\t\tlet seenConnection = false;\n\t\tconst waitToRetry = async () => {\n\t\t\tif (selfTestRetryMs <= 0) return;\n\t\t\tawait new Promise((resolve) => {\n\t\t\t\tconst done = () => {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tselfTestAbort.signal.removeEventListener(\"abort\", done);\n\t\t\t\t\tresolve();\n\t\t\t\t};\n\t\t\t\tconst timer = setTimeout(done, selfTestRetryMs);\n\t\t\t\tselfTestAbort.signal.addEventListener(\"abort\", done, { once: true });\n\t\t\t});\n\t\t};\n\t\t/** Proves end to end that pairing is reachable and that everything else is not. */\n\t\tconst runSelfTest = async (origin) => {\n\t\t\tlet pairResponse;\n\t\t\tlet healthResponse;\n\t\t\tlet cause = \"fetch failed\";\n\t\t\tfor (let attempt = 0; attempt < SELF_TEST_ATTEMPTS && !selfTestAbort.signal.aborted; attempt += 1) {\n\t\t\t\ttry {\n\t\t\t\t\tpairResponse = await probe(`${origin}${PAIRING_PAGE_ROUTE}`, selfTestAbort.signal);\n\t\t\t\t\thealthResponse = await probe(`${origin}/api/health`, selfTestAbort.signal);\n\t\t\t\t\tif (pairResponse.status !== EDGE_TUNNEL_UNAVAILABLE && healthResponse.status !== EDGE_TUNNEL_UNAVAILABLE) break;\n\t\t\t\t\tcause = `Cloudflare edge answered ${String(healthResponse.status)} before the connector registered`;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tcause = error instanceof Error ? error.message : String(error);\n\t\t\t\t}\n\t\t\t\tif (attempt + 1 < SELF_TEST_ATTEMPTS && !selfTestAbort.signal.aborted) await waitToRetry();\n\t\t\t}\n\t\t\tif (pairResponse === void 0 || healthResponse === void 0) return {\n\t\t\t\tok: false,\n\t\t\t\tfailure: \"self_test_failed\",\n\t\t\t\tmessage: `The tunnel did not answer: ${cause}`\n\t\t\t};\n\t\t\tif (healthResponse.status !== UNAUTHORIZED) {\n\t\t\t\tconst message = `${describeTunnelFailure(\"self_test_failed\")} /api/health answered ${String(healthResponse.status)} through the tunnel.`;\n\t\t\t\tnotice(message);\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\tfailure: \"self_test_failed\",\n\t\t\t\t\tmessage\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (pairResponse.status !== OK || !pairResponse.body.includes(\"po-pairing-page\")) {\n\t\t\t\tconst message = `The pairing page answered ${String(pairResponse.status)} through the tunnel.`;\n\t\t\t\tnotice(message);\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\tfailure: \"self_test_failed\",\n\t\t\t\t\tmessage\n\t\t\t\t};\n\t\t\t}\n\t\t\tnotice(`tunnel ready at ${origin}`);\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tpublicOrigin: origin,\n\t\t\t\tstop\n\t\t\t};\n\t\t};\n\t\tconst consider = (chunk) => {\n\t\t\tlines.push(chunk);\n\t\t\tif (settle === void 0 || selfTestStarted) return;\n\t\t\tseenUrl ??= extractTunnelUrl(chunk);\n\t\t\tseenConnection ||= mentionsRegisteredConnection(chunk);\n\t\t\tif (seenUrl === void 0 || !seenConnection) return;\n\t\t\tselfTestStarted = true;\n\t\t\tinput.acceptOrigin?.(seenUrl);\n\t\t\trunSelfTest(seenUrl).then((result) => settle?.(result));\n\t\t};\n\t\tchild.stdout?.on(\"data\", (data) => consider(data.toString()));\n\t\tchild.stderr?.on(\"data\", (data) => consider(data.toString()));\n\t\treturn await new Promise((resolve) => {\n\t\t\tlet deadline;\n\t\t\tconst finish = (result, stopProcess = !result.ok) => {\n\t\t\t\tif (settle === void 0) return;\n\t\t\t\tsettle = void 0;\n\t\t\t\tclearTimeout(deadline);\n\t\t\t\tinput.signal?.removeEventListener(\"abort\", cancel);\n\t\t\t\tselfTestAbort.abort();\n\t\t\t\tif (stopProcess) stop().then(() => resolve(result));\n\t\t\t\telse resolve(result);\n\t\t\t};\n\t\t\tconst cancel = () => {\n\t\t\t\tfinish({\n\t\t\t\t\tok: false,\n\t\t\t\t\tfailure: \"exited\",\n\t\t\t\t\tmessage: \"Tunnel startup was cancelled.\"\n\t\t\t\t});\n\t\t\t};\n\t\t\tsettle = (result) => finish(result);\n\t\t\tdeadline = setTimeout(() => {\n\t\t\t\tfinish({\n\t\t\t\t\tok: false,\n\t\t\t\t\tfailure: \"timeout\",\n\t\t\t\t\tmessage: `${describeTunnelFailure(\"timeout\")}\\n${tailOf(lines)}`\n\t\t\t\t});\n\t\t\t}, startTimeoutMs);\n\t\t\tinput.signal?.addEventListener(\"abort\", cancel, { once: true });\n\t\t\tchild.once(\"error\", (error) => {\n\t\t\t\tfinish({\n\t\t\t\t\tok: false,\n\t\t\t\t\tfailure: \"spawn_failed\",\n\t\t\t\t\tmessage: `${describeTunnelFailure(\"spawn_failed\")} ${error.message}`\n\t\t\t\t});\n\t\t\t});\n\t\t\tchild.once(\"exit\", (code) => {\n\t\t\t\tprocess.off(\"exit\", onProcessExit);\n\t\t\t\tfs.rmSync(runtimeTokenPath, { force: true });\n\t\t\t\tconst message = `${describeTunnelFailure(\"exited\")} (code ${String(code)})\\n${tailOf(lines)}`;\n\t\t\t\tif (settle !== void 0) {\n\t\t\t\t\tfinish({\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\tfailure: \"exited\",\n\t\t\t\t\t\tmessage\n\t\t\t\t\t}, false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!stopped) options.onExit?.(message);\n\t\t\t});\n\t\t\tif (input.signal?.aborted === true) cancel();\n\t\t});\n\t};\n}\n//#endregion\nexport { CLOUDFLARED_ENV, createTunnelLauncher, findCloudflared, reapStaleTunnel };\n\n//# sourceMappingURL=index.mjs.map","import net from \"node:net\";\n//#region src/services/loopbackAddress/index.ts\n/**\n* Which loopback address a local dev server is actually listening on.\n*\n* Vite binds `localhost`, which on a machine with IPv6 resolves to `::1` and\n* nothing answers on `127.0.0.1`. Other servers do the opposite. Dialling the\n* wrong one is an immediate ECONNREFUSED, which looks to the developer like\n* the proxy is broken rather than like an address-family mismatch.\n*\n* This is deliberately not a resolver. The candidates are two hard-coded\n* loopback literals and the only input is a port number, so there is no\n* hostname to poison and no DNS-rebinding window: the answer can only ever be\n* this machine.\n*/\n/** IPv4 first: it is what a developer types, so preferring it keeps logs recognizable. */\nconst CANDIDATES = [\"127.0.0.1\", \"::1\"];\nconst PROBE_TIMEOUT_MS = 400;\n/** Remembered per port so a page of eighty assets probes once, not eighty times. */\nconst known = /* @__PURE__ */ new Map();\nasync function accepts(host, port) {\n\treturn new Promise((resolve) => {\n\t\tconst socket = net.connect({\n\t\t\thost,\n\t\t\tport\n\t\t});\n\t\tconst settle = (answer) => {\n\t\t\tsocket.destroy();\n\t\t\tresolve(answer);\n\t\t};\n\t\tsocket.setTimeout(PROBE_TIMEOUT_MS, () => settle(false));\n\t\tsocket.once(\"connect\", () => settle(true));\n\t\tsocket.once(\"error\", () => settle(false));\n\t});\n}\n/**\n* The loopback address answering on this port, preferring a remembered one.\n*\n* Falls back to IPv4 when neither answers, so the caller's own connection\n* produces the real ECONNREFUSED and its message, rather than this probe\n* inventing a different error for the same condition.\n*/\nasync function loopbackFor(port) {\n\tconst remembered = known.get(port);\n\tif (remembered !== void 0 && await accepts(remembered, port)) return remembered;\n\tfor (const candidate of CANDIDATES) if (await accepts(candidate, port)) {\n\t\tknown.set(port, candidate);\n\t\treturn candidate;\n\t}\n\tknown.delete(port);\n\treturn CANDIDATES[0];\n}\n//#endregion\nexport { loopbackFor };\n\n//# sourceMappingURL=index.mjs.map","import { DEV_PROXY_PREFIX } from \"../constants/remote.mjs\";\nimport { loopbackFor } from \"../services/loopbackAddress/index.mjs\";\nimport http from \"node:http\";\nimport { Readable } from \"node:stream\";\n//#region src/server/devProxyForward.ts\n/**\n* One HTTP request forwarded to a local dev server, the way nginx would.\n*\n* Three rewrites are not optional, and each one is a bug report waiting to\n* happen if it is skipped:\n*\n* - `Host` becomes the upstream's own address. Vite's `server.allowedHosts`\n*   and Next's dev-origin check refuse a request whose Host they do not\n*   recognize, so forwarding the cockpit's public hostname makes the dev\n*   server answer with a block page rather than the app.\n* - A root-relative `Location` gains the prefix, or the first redirect walks\n*   the browser out of the proxy and into the cockpit.\n* - `Set-Cookie` with `Path=/` is narrowed to the prefix, or the dev app's\n*   session cookie is sent on every cockpit request for the rest of the day.\n*\n* The cockpit's own cookies are removed on the way out. nginx would forward\n* them, but `__Host-po_device` is a bearer credential for the cockpit and\n* the dev server has no use for it. Handing it to an unaudited dev dependency,\n* or into its request log, is a leak with no upside.\n*/\n/** Headers that describe one hop and must not be copied onto the next. */\nconst HOP_BY_HOP = /* @__PURE__ */ new Set([\n\t\"connection\",\n\t\"keep-alive\",\n\t\"transfer-encoding\",\n\t\"upgrade\"\n]);\n/** Set from the target rather than copied, so the browser's value never reaches the upstream. */\nconst REPLACED = /* @__PURE__ */ new Set([\"host\"]);\n/** Cookies belonging to the cockpit rather than to the proxied application. */\nconst COCKPIT_COOKIE_MARKER = \"po\";\nconst BAD_GATEWAY = 502;\nconst NO_BODY_STATUSES = /* @__PURE__ */ new Set([204, 304]);\n/** An IPv6 literal needs brackets before it can be a Host header value. */\nfunction hostHeader(host, port) {\n\treturn host.includes(\":\") ? `[${host}]:${String(port)}` : `${host}:${String(port)}`;\n}\n/** Drops the cockpit's cookies and keeps the application's own. */\nfunction filterCookies(raw) {\n\tconst kept = raw.split(\";\").map((pair) => pair.trim()).filter((pair) => pair !== \"\" && !pair.slice(0, pair.indexOf(\"=\")).toLowerCase().includes(COCKPIT_COOKIE_MARKER));\n\treturn kept.length === 0 ? void 0 : kept.join(\"; \");\n}\nfunction outgoingHeaders(input, host) {\n\tconst out = {};\n\tinput.headers.forEach((value, key) => {\n\t\tconst normalized = key.toLowerCase();\n\t\tif (HOP_BY_HOP.has(normalized) || REPLACED.has(normalized)) return;\n\t\tif (normalized === \"cookie\") {\n\t\t\tconst kept = filterCookies(value);\n\t\t\tif (kept !== void 0) out.cookie = kept;\n\t\t\treturn;\n\t\t}\n\t\tout[key] = value;\n\t});\n\tout.host = hostHeader(host, input.port);\n\tout[\"x-forwarded-proto\"] = input.forwardedProto;\n\tif (input.forwardedHost !== void 0) out[\"x-forwarded-host\"] = input.forwardedHost;\n\tout[\"x-forwarded-prefix\"] = `${DEV_PROXY_PREFIX}${input.name}`;\n\treturn out;\n}\n/** Prefixes a root-relative redirect so it stays inside the proxied target. */\nfunction rewriteLocation(value, name) {\n\tconst mount = `${DEV_PROXY_PREFIX}${name}`;\n\tif (!value.startsWith(\"/\") || value.startsWith(\"//\") || value.startsWith(`${mount}/`)) return value;\n\treturn `${mount}${value}`;\n}\n/**\n* Narrows a cookie's Path to the proxied mount.\n*\n* A dev app setting `Path=/` means it on its own origin, where it is the only\n* tenant. Here it is not, so the attribute is rewritten rather than honoured.\n* A cookie with no Path at all already defaults to the request's directory,\n* which is inside the mount, so it is left alone.\n*/\nfunction rewriteSetCookie(value, name) {\n\tconst mount = `${DEV_PROXY_PREFIX}${name}/`;\n\treturn value.replaceAll(/;\\s*path=([^;]*)/giu, (_match, current) => {\n\t\tconst trimmed = current.trim();\n\t\tif (trimmed.startsWith(mount)) return `; Path=${trimmed}`;\n\t\tconst suffix = trimmed === \"/\" || trimmed === \"\" ? \"\" : trimmed.replace(/^\\//u, \"\");\n\t\treturn `; Path=${mount}${suffix}`;\n\t});\n}\nfunction responseHeaders(incoming, name) {\n\tconst headers = new Headers();\n\tfor (const [key, value] of Object.entries(incoming.headers)) {\n\t\tconst normalized = key.toLowerCase();\n\t\tif (value === void 0 || HOP_BY_HOP.has(normalized)) continue;\n\t\tif (normalized === \"set-cookie\") {\n\t\t\tfor (const cookie of Array.isArray(value) ? value : [value]) headers.append(\"set-cookie\", rewriteSetCookie(cookie, name));\n\t\t\tcontinue;\n\t\t}\n\t\tconst single = Array.isArray(value) ? value.join(\", \") : value;\n\t\theaders.set(key, normalized === \"location\" ? rewriteLocation(single, name) : single);\n\t}\n\treturn headers;\n}\n/**\n* Forwards one request and returns the upstream's answer.\n*\n* Both bodies stream. A dev server sends multi-megabyte source maps and\n* receives file uploads, and buffering either would hold the whole thing in\n* memory for no benefit.\n*/\nasync function forwardToDevServer(input) {\n\tconst host = await loopbackFor(input.port);\n\treturn new Promise((resolve, reject) => {\n\t\tconst request = http.request({\n\t\t\thost,\n\t\t\tport: input.port,\n\t\t\tpath: input.upstreamPath,\n\t\t\tmethod: input.method,\n\t\t\theaders: outgoingHeaders(input, host),\n\t\t\tsignal: input.signal\n\t\t}, (incoming) => {\n\t\t\tconst status = incoming.statusCode ?? BAD_GATEWAY;\n\t\t\tconst body = NO_BODY_STATUSES.has(status) ? null : Readable.toWeb(incoming);\n\t\t\tresolve(new Response(body, {\n\t\t\t\tstatus,\n\t\t\t\theaders: responseHeaders(incoming, input.name)\n\t\t\t}));\n\t\t});\n\t\trequest.once(\"error\", reject);\n\t\tif (input.body === null) {\n\t\t\trequest.end();\n\t\t\treturn;\n\t\t}\n\t\tReadable.fromWeb(input.body).on(\"error\", reject).pipe(request);\n\t});\n}\n//#endregion\nexport { forwardToDevServer };\n\n//# sourceMappingURL=devProxyForward.mjs.map","import { DEV_PROXY_PREFIX, DEV_PROXY_TARGETS_ROUTE } from \"../constants/remote.mjs\";\nimport { parseProxyPath, validateTargetName, validateTargetPort } from \"../services/devProxyPolicy/index.mjs\";\nimport { forwardToDevServer } from \"./devProxyForward.mjs\";\n//#region src/server/devProxyRoutes.ts\n/**\n* The dev proxy's control plane and its HTTP forwarding route.\n*\n* Registering a target is refused anywhere but the host, and that refusal is the entire consent\n* model: putting a local port on the public internet is decided by someone sitting at the machine.\n* A passkey gesture cannot carry it, because a quick tunnel's rotating hostname has no relying party.\n* Using a registered target is then open to any paired device, which is what makes the feature\n* usable away from the desk; a stolen phone reaches only the ports its owner chose to name.\n*/\nconst BAD_REQUEST = 400;\nconst FORBIDDEN = 403;\nconst NOT_FOUND = 404;\nconst CREATED = 201;\nconst NO_CONTENT = 204;\nconst MOVED_PERMANENTLY = 301;\nconst BAD_GATEWAY = 502;\nconst CONNECTION_REFUSED = \"ECONNREFUSED\";\n/** The scheme the browser used, trusting the edge's header only for its own hop. */\nfunction forwardedProto(context, listener) {\n\tconst declared = context.req.header(\"x-forwarded-proto\");\n\tif (declared === \"https\" || declared === \"http\") return declared;\n\treturn listener === \"local\" ? \"http\" : \"https\";\n}\nfunction describeUpstreamFailure(error, target) {\n\tif (error?.code === CONNECTION_REFUSED) return `Nothing is answering on port ${String(target.port)}. Is \"${target.name}\" running?`;\n\treturn `The dev server for \"${target.name}\" did not answer: ${error instanceof Error ? error.message : String(error)}`;\n}\nfunction registerDevProxyRoutes(app, options) {\n\tconst { store } = options;\n\tconst isLocal = (context) => options.listenerOf(context) === \"local\";\n\tapp.get(DEV_PROXY_TARGETS_ROUTE, (context) => context.json({\n\t\ttargets: store.targets(),\n\t\tcanRegister: isLocal(context)\n\t}));\n\tapp.post(DEV_PROXY_TARGETS_ROUTE, async (context) => {\n\t\tif (!isLocal(context)) return context.json({ error: \"A dev proxy target can only be added on the host, not through the tunnel.\" }, FORBIDDEN);\n\t\tlet body;\n\t\ttry {\n\t\t\tbody = await context.req.json();\n\t\t} catch {\n\t\t\treturn context.json({ error: \"Expected a JSON body with a name and a port.\" }, BAD_REQUEST);\n\t\t}\n\t\tconst name = validateTargetName(body.name);\n\t\tif (!name.ok) return context.json({ error: name.reason }, BAD_REQUEST);\n\t\tconst port = validateTargetPort(body.port, options.reservedPorts());\n\t\tif (!port.ok) return context.json({ error: port.reason }, BAD_REQUEST);\n\t\tconst target = {\n\t\t\tname: name.name,\n\t\t\tport: port.port,\n\t\t\tcreatedAt: Date.now()\n\t\t};\n\t\tstore.save(target);\n\t\toptions.onNotice(`dev proxy target \"${target.name}\" now serves port ${String(target.port)}`);\n\t\treturn context.json({ target }, CREATED);\n\t});\n\tapp.delete(`${DEV_PROXY_TARGETS_ROUTE}/:name`, (context) => {\n\t\tif (!isLocal(context)) return context.json({ error: \"A dev proxy target can only be removed on the host.\" }, FORBIDDEN);\n\t\tconst name = validateTargetName(context.req.param(\"name\"));\n\t\tif (!name.ok) return context.json({ error: name.reason }, BAD_REQUEST);\n\t\tif (!store.remove(name.name)) return context.json({ error: \"No such dev proxy target.\" }, NOT_FOUND);\n\t\toptions.onNotice(`dev proxy target \"${name.name}\" removed`);\n\t\treturn context.body(null, NO_CONTENT);\n\t});\n\tapp.all(`${DEV_PROXY_PREFIX}*`, async (context) => {\n\t\tconst url = new URL(context.req.url);\n\t\tconst parsed = parseProxyPath(url.pathname);\n\t\tif (parsed.kind === \"reject\") return context.text(parsed.reason, BAD_REQUEST);\n\t\tif (parsed.kind === \"redirect\") return context.redirect(parsed.location, MOVED_PERMANENTLY);\n\t\tconst target = store.find(parsed.name);\n\t\tif (target === void 0) return context.text(`No dev proxy target named \"${parsed.name}\".`, NOT_FOUND);\n\t\ttry {\n\t\t\treturn await forwardToDevServer({\n\t\t\t\tname: target.name,\n\t\t\t\tport: target.port,\n\t\t\t\tupstreamPath: `${parsed.upstreamPath}${url.search}`,\n\t\t\t\tmethod: context.req.method,\n\t\t\t\theaders: context.req.raw.headers,\n\t\t\t\tbody: context.req.raw.body,\n\t\t\t\tforwardedProto: forwardedProto(context, options.listenerOf(context)),\n\t\t\t\tforwardedHost: context.req.header(\"host\"),\n\t\t\t\tsignal: context.req.raw.signal\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst message = describeUpstreamFailure(error, target);\n\t\t\toptions.onNotice(message);\n\t\t\treturn context.text(message, BAD_GATEWAY);\n\t\t}\n\t});\n}\n//#endregion\nexport { registerDevProxyRoutes };\n\n//# sourceMappingURL=devProxyRoutes.mjs.map","import { loopbackFor } from \"../services/loopbackAddress/index.mjs\";\nimport { WebSocket } from \"ws\";\n//#region src/server/devProxySocket.ts\n/**\n* A WebSocket carried between a paired device and a local dev server.\n*\n* This is what carries hot module reload. Vite negotiates the `vite-hmr` subprotocol, so the\n* handshake's protocol list is forwarded rather than dropped; without it the dev client connects\n* and then gives up. The tunnel listener has already authorized the handshake, so this only\n* relays frames.\n*/\n/** Sent when the upstream never came up, or died in a way with no code to relay. */\nconst INTERNAL_ERROR = 1011;\nconst NORMAL_CLOSURE = 1e3;\n/** Reserved codes a peer may observe but no endpoint may transmit. */\nconst UNSENDABLE_CLOSE_CODES = /* @__PURE__ */ new Set([\n\t1005,\n\t1006,\n\t1015\n]);\nconst MAX_CLOSE_REASON = 120;\n/** Frames held while the upstream connects; a dev client that speaks first must not lose them. */\nconst MAX_PENDING_BYTES = 1048576;\n/** A code the upstream reported that this endpoint is actually allowed to send on. */\nfunction sendableCode(code, lostCode = NORMAL_CLOSURE) {\n\treturn code === 0 || UNSENDABLE_CLOSE_CODES.has(code) ? lostCode : code;\n}\nfunction frameBytes(data) {\n\tif (Array.isArray(data)) return Buffer.concat(data);\n\treturn Buffer.isBuffer(data) ? data : Buffer.from(new Uint8Array(data));\n}\n/** Relays one accepted browser socket to the dev server on the target's port until either side closes. */\nfunction relayDevProxySocket(client, input) {\n\tlet upstream;\n\tlet pending = [];\n\tlet pendingBytes = 0;\n\tlet closed = false;\n\tconst closeBoth = (code, reason) => {\n\t\tif (closed) return;\n\t\tclosed = true;\n\t\tpending = [];\n\t\tif (client.readyState === WebSocket.OPEN) client.close(code, reason.slice(0, MAX_CLOSE_REASON));\n\t\tupstream?.close();\n\t\tinput.onClose?.(code);\n\t};\n\tclient.on(\"message\", (data, binary) => {\n\t\tif (closed) return;\n\t\tconst bytes = frameBytes(data);\n\t\tif (upstream?.readyState === WebSocket.OPEN) {\n\t\t\tupstream.send(binary ? bytes : bytes.toString(\"utf8\"));\n\t\t\treturn;\n\t\t}\n\t\tpendingBytes += bytes.byteLength;\n\t\tif (pendingBytes > MAX_PENDING_BYTES) closeBoth(INTERNAL_ERROR, \"dev server socket did not open\");\n\t\telse pending.push({\n\t\t\tdata: bytes,\n\t\t\tbinary\n\t\t});\n\t});\n\tclient.on(\"close\", () => closeBoth(NORMAL_CLOSURE, \"\"));\n\tclient.on(\"error\", () => closeBoth(INTERNAL_ERROR, \"browser socket failed\"));\n\tconst protocols = input.protocols?.split(\",\").map((entry) => entry.trim()).filter((entry) => entry !== \"\");\n\tconst resolveTarget = async () => {\n\t\tif (input.target !== void 0) return input.target;\n\t\tconst host = await loopbackFor(input.port);\n\t\treturn `ws://${host.includes(\":\") ? `[${host}]` : host}:${String(input.port)}${input.upstreamPath}`;\n\t};\n\tconst options = input.headers === void 0 ? void 0 : { headers: input.headers };\n\tresolveTarget().then((target) => {\n\t\tif (closed) return;\n\t\tconst socket = protocols === void 0 || protocols.length === 0 ? new WebSocket(target, options) : new WebSocket(target, protocols, options);\n\t\tupstream = socket;\n\t\tsocket.on(\"open\", () => {\n\t\t\tfor (const frame of pending) socket.send(frame.binary ? frame.data : frame.data.toString(\"utf8\"));\n\t\t\tpending = [];\n\t\t\tpendingBytes = 0;\n\t\t});\n\t\tsocket.on(\"message\", (data, binary) => {\n\t\t\tif (closed || client.readyState !== WebSocket.OPEN) return;\n\t\t\tconst bytes = frameBytes(data);\n\t\t\tclient.send(binary ? bytes : bytes.toString(\"utf8\"));\n\t\t});\n\t\tsocket.on(\"close\", (code, reason) => closeBoth(sendableCode(code, input.upstreamLostCode), reason.toString()));\n\t\tsocket.on(\"error\", (error) => {\n\t\t\tinput.onNotice?.(`dev proxy socket to port ${String(input.port)} failed: ${error.message}`);\n\t\t\tcloseBoth(input.upstreamLostCode ?? INTERNAL_ERROR, \"dev server socket failed\");\n\t\t});\n\t});\n}\n//#endregion\nexport { relayDevProxySocket };\n\n//# sourceMappingURL=devProxySocket.mjs.map","//#region src/utils/url.ts\nconst splitPath = (path) => {\n\tconst paths = path.split(\"/\");\n\tif (paths[0] === \"\") paths.shift();\n\treturn paths;\n};\nconst splitRoutingPath = (routePath) => {\n\tconst { groups, path } = extractGroupsFromPath(routePath);\n\tconst paths = splitPath(path);\n\treturn replaceGroupMarks(paths, groups);\n};\nconst extractGroupsFromPath = (path) => {\n\tconst groups = [];\n\tpath = path.replace(/\\{[^}]+\\}/g, (match, index) => {\n\t\tconst mark = `@${index}`;\n\t\tgroups.push([mark, match]);\n\t\treturn mark;\n\t});\n\treturn {\n\t\tgroups,\n\t\tpath\n\t};\n};\nconst replaceGroupMarks = (paths, groups) => {\n\tfor (let i = groups.length - 1; i >= 0; i--) {\n\t\tconst [mark] = groups[i];\n\t\tfor (let j = paths.length - 1; j >= 0; j--) if (paths[j].includes(mark)) {\n\t\t\tpaths[j] = paths[j].replace(mark, groups[i][1]);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn paths;\n};\nconst patternCache = {};\nconst getPattern = (label, next) => {\n\tif (label === \"*\") return \"*\";\n\tconst match = label.match(/^\\:([^\\{\\}]+)(?:\\{(.+)\\})?$/);\n\tif (match) {\n\t\tconst cacheKey = `${label}#${next}`;\n\t\tif (!patternCache[cacheKey]) {\n\t\t\tif (match[2]) patternCache[cacheKey] = next && next[0] !== \":\" && next[0] !== \"*\" ? [\n\t\t\t\tcacheKey,\n\t\t\t\tmatch[1],\n\t\t\t\tnew RegExp(`^${match[2]}(?=/${next})`)\n\t\t\t] : [\n\t\t\t\tlabel,\n\t\t\t\tmatch[1],\n\t\t\t\tnew RegExp(`^${match[2]}$`)\n\t\t\t];\n\t\t\telse patternCache[cacheKey] = [\n\t\t\t\tlabel,\n\t\t\t\tmatch[1],\n\t\t\t\ttrue\n\t\t\t];\n\t\t}\n\t\treturn patternCache[cacheKey];\n\t}\n\treturn null;\n};\nconst tryDecode = (str, decoder) => {\n\ttry {\n\t\treturn decoder(str);\n\t} catch {\n\t\treturn str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => {\n\t\t\ttry {\n\t\t\t\treturn decoder(match);\n\t\t\t} catch {\n\t\t\t\treturn match;\n\t\t\t}\n\t\t});\n\t}\n};\n/**\n* Try to apply decodeURI() to given string.\n* If it fails, skip invalid percent encoding or invalid UTF-8 sequences, and apply decodeURI() to the rest as much as possible.\n* @param str The string to decode.\n* @returns The decoded string that sometimes contains undecodable percent encoding.\n* @example\n* tryDecodeURI('Hello%20World') // 'Hello World'\n* tryDecodeURI('Hello%20World/%A4%A2') // 'Hello World/%A4%A2'\n*/\nconst tryDecodeURI = (str) => tryDecode(str, decodeURI);\nconst getPath = (request) => {\n\tconst url = request.url;\n\tconst start = url.indexOf(\"/\", url.indexOf(\":\") + 4);\n\tlet i = start;\n\tfor (; i < url.length; i++) {\n\t\tconst charCode = url.charCodeAt(i);\n\t\tif (charCode === 37) {\n\t\t\tconst queryIndex = url.indexOf(\"?\", i);\n\t\t\tconst hashIndex = url.indexOf(\"#\", i);\n\t\t\tconst end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);\n\t\t\tconst path = url.slice(start, end);\n\t\t\treturn tryDecodeURI(path.includes(\"%25\") ? path.replace(/%25/g, \"%2525\") : path);\n\t\t} else if (charCode === 63 || charCode === 35) break;\n\t}\n\treturn url.slice(start, i);\n};\n/**\n* @deprecated\n* Use the `URL` API instead.\n*/\nconst getQueryStrings = (url) => {\n\tconst queryIndex = url.indexOf(\"?\", 8);\n\tif (queryIndex === -1) return \"\";\n\tconst hashIndex = url.indexOf(\"#\", 8);\n\treturn hashIndex === -1 ? url.slice(queryIndex) : queryIndex < hashIndex ? url.slice(queryIndex, hashIndex) : \"\";\n};\nconst getPathNoStrict = (request) => {\n\tconst result = getPath(request);\n\treturn result.length > 1 && result.at(-1) === \"/\" ? result.slice(0, -1) : result;\n};\n/**\n* Merge paths.\n* @param {string[]} ...paths - The paths to merge.\n* @returns {string} The merged path.\n* @example\n* mergePath('/api', '/users') // '/api/users'\n* mergePath('/api/', '/users') // '/api/users'\n* mergePath('/api', '/') // '/api'\n* mergePath('/api/', '/') // '/api/'\n*/\nconst mergePath = (base, sub, ...rest) => {\n\tif (rest.length) sub = mergePath(sub, ...rest);\n\treturn `${base?.[0] === \"/\" ? \"\" : \"/\"}${base}${sub === \"/\" ? \"\" : `${base?.at(-1) === \"/\" ? \"\" : \"/\"}${sub?.[0] === \"/\" ? sub.slice(1) : sub}`}`;\n};\nconst checkOptionalParameter = (path) => {\n\tif (path.charCodeAt(path.length - 1) !== 63 || !path.includes(\":\")) return null;\n\tconst segments = path.split(\"/\");\n\tconst results = [];\n\tlet basePath = \"\";\n\tsegments.forEach((segment) => {\n\t\tif (segment !== \"\" && !/\\:/.test(segment)) basePath += \"/\" + segment;\n\t\telse if (/\\:/.test(segment)) {\n\t\t\tif (segment.charCodeAt(segment.length - 1) === 63) {\n\t\t\t\tif (results.length === 0 && basePath === \"\") results.push(\"/\");\n\t\t\t\telse results.push(basePath);\n\t\t\t\tconst optionalSegment = segment.slice(0, -1);\n\t\t\t\tbasePath += \"/\" + optionalSegment;\n\t\t\t\tresults.push(basePath);\n\t\t\t} else basePath += \"/\" + segment;\n\t\t}\n\t});\n\treturn results.filter((v, i, a) => a.indexOf(v) === i);\n};\nconst tryDecodeURIComponent = (str) => str.indexOf(\"%\") !== -1 ? tryDecode(str, decodeURIComponent_) : str;\nconst _decodeURI = (value) => {\n\tif (value.indexOf(\"+\") !== -1) value = value.replace(/\\+/g, \" \");\n\treturn tryDecodeURIComponent(value);\n};\nconst _getQueryParam = (url, key, multiple) => {\n\tconst hashIndex = url.indexOf(\"#\", 8);\n\tif (hashIndex !== -1) url = url.slice(0, hashIndex);\n\tlet encoded;\n\tif (!multiple && key && key.indexOf(\"%\") === -1 && key.indexOf(\"+\") === -1) {\n\t\tlet keyIndex = url.indexOf(\"?\", 8);\n\t\tif (keyIndex === -1) return;\n\t\tif (!url.startsWith(key, keyIndex + 1)) keyIndex = url.indexOf(`&${key}`, keyIndex + 1);\n\t\twhile (keyIndex !== -1) {\n\t\t\tconst trailingKeyCode = url.charCodeAt(keyIndex + key.length + 1);\n\t\t\tif (trailingKeyCode === 61) {\n\t\t\t\tconst valueIndex = keyIndex + key.length + 2;\n\t\t\t\tconst endIndex = url.indexOf(\"&\", valueIndex);\n\t\t\t\treturn _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex));\n\t\t\t} else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) return \"\";\n\t\t\tkeyIndex = url.indexOf(`&${key}`, keyIndex + 1);\n\t\t}\n\t\tencoded = /[%+]/.test(url);\n\t\tif (!encoded) return;\n\t}\n\tconst results = Object.create(null);\n\tencoded ??= /[%+]/.test(url);\n\tlet keyIndex = url.indexOf(\"?\", 8);\n\twhile (keyIndex !== -1) {\n\t\tconst nextKeyIndex = url.indexOf(\"&\", keyIndex + 1);\n\t\tlet valueIndex = url.indexOf(\"=\", keyIndex);\n\t\tif (valueIndex > nextKeyIndex && nextKeyIndex !== -1) valueIndex = -1;\n\t\tlet name = url.slice(keyIndex + 1, valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex);\n\t\tif (encoded) name = _decodeURI(name);\n\t\tkeyIndex = nextKeyIndex;\n\t\tif (name === \"\") continue;\n\t\tlet value;\n\t\tif (valueIndex === -1) value = \"\";\n\t\telse {\n\t\t\tvalue = url.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex);\n\t\t\tif (encoded) value = _decodeURI(value);\n\t\t}\n\t\tif (multiple) {\n\t\t\tif (!(results[name] && Array.isArray(results[name]))) results[name] = [];\n\t\t\tresults[name].push(value);\n\t\t} else results[name] ??= value;\n\t}\n\treturn key ? results[key] : results;\n};\nconst getQueryParam = _getQueryParam;\nconst getQueryParams = (url, key) => {\n\treturn _getQueryParam(url, key, true);\n};\nconst decodeURIComponent_ = decodeURIComponent;\n//#endregion\nexport { checkOptionalParameter, decodeURIComponent_, getPath, getPathNoStrict, getPattern, getQueryParam, getQueryParams, getQueryStrings, mergePath, splitPath, splitRoutingPath, tryDecode, tryDecodeURI, tryDecodeURIComponent };\n","import { tryDecodeURIComponent } from \"./url.js\";\n//#region src/utils/cookie.ts\n/**\n* @module\n* Cookie utility.\n*/\nconst algorithm = {\n\tname: \"HMAC\",\n\thash: \"SHA-256\"\n};\nconst getCryptoKey = async (secret) => {\n\tconst secretBuf = typeof secret === \"string\" ? new TextEncoder().encode(secret) : secret;\n\treturn await crypto.subtle.importKey(\"raw\", secretBuf, algorithm, false, [\"sign\", \"verify\"]);\n};\nconst makeSignature = async (value, secret) => {\n\tconst key = await getCryptoKey(secret);\n\tconst signature = await crypto.subtle.sign(algorithm.name, key, new TextEncoder().encode(value));\n\treturn btoa(String.fromCharCode(...new Uint8Array(signature)));\n};\nconst verifySignature = async (base64Signature, value, secret) => {\n\ttry {\n\t\tconst signatureBinStr = atob(base64Signature);\n\t\tconst signature = new Uint8Array(signatureBinStr.length);\n\t\tfor (let i = 0, len = signatureBinStr.length; i < len; i++) signature[i] = signatureBinStr.charCodeAt(i);\n\t\treturn await crypto.subtle.verify(algorithm, secret, signature, new TextEncoder().encode(value));\n\t} catch {\n\t\treturn false;\n\t}\n};\nconst validCookieNameRegEx = /^[\\w!#$%&'*.^`|~+-]+$/;\nconst relaxedCookieNameRegEx = /^[!#-:<>-[\\]-~]+$/;\nconst validCookieValueRegEx = /^[ !#-:<-[\\]-~]*$/;\nconst trimCookieWhitespace = (value) => {\n\tlet start = 0;\n\tlet end = value.length;\n\twhile (start < end) {\n\t\tconst charCode = value.charCodeAt(start);\n\t\tif (charCode !== 32 && charCode !== 9) break;\n\t\tstart++;\n\t}\n\twhile (end > start) {\n\t\tconst charCode = value.charCodeAt(end - 1);\n\t\tif (charCode !== 32 && charCode !== 9) break;\n\t\tend--;\n\t}\n\treturn start === 0 && end === value.length ? value : value.slice(start, end);\n};\nconst parse = (cookie, name) => {\n\tif (name && cookie.indexOf(name) === -1) return {};\n\tconst pairs = cookie.split(\";\");\n\tconst parsedCookie = Object.create(null);\n\tfor (const pairStr of pairs) {\n\t\tconst valueStartPos = pairStr.indexOf(\"=\");\n\t\tif (valueStartPos === -1) continue;\n\t\tconst cookieName = trimCookieWhitespace(pairStr.substring(0, valueStartPos));\n\t\tif (name && name !== cookieName || !relaxedCookieNameRegEx.test(cookieName) || cookieName in parsedCookie) continue;\n\t\tlet cookieValue = trimCookieWhitespace(pairStr.substring(valueStartPos + 1));\n\t\tif (cookieValue.startsWith(\"\\\"\") && cookieValue.endsWith(\"\\\"\")) cookieValue = cookieValue.slice(1, -1);\n\t\tif (validCookieValueRegEx.test(cookieValue)) {\n\t\t\tparsedCookie[cookieName] = tryDecodeURIComponent(cookieValue);\n\t\t\tif (name) break;\n\t\t}\n\t}\n\treturn parsedCookie;\n};\nconst parseSigned = async (cookie, secret, name) => {\n\tconst parsedCookie = Object.create(null);\n\tconst secretKey = await getCryptoKey(secret);\n\tfor (const [key, value] of Object.entries(parse(cookie, name))) {\n\t\tconst signatureStartPos = value.lastIndexOf(\".\");\n\t\tif (signatureStartPos < 0) continue;\n\t\tconst signedValue = value.substring(0, signatureStartPos);\n\t\tconst signature = value.substring(signatureStartPos + 1);\n\t\tif (signature.length !== 44 || !signature.endsWith(\"=\")) continue;\n\t\tparsedCookie[key] = await verifySignature(signature, signedValue, secretKey) ? signedValue : false;\n\t}\n\treturn parsedCookie;\n};\nconst _serialize = (name, value, opt = {}) => {\n\tif (!validCookieNameRegEx.test(name)) throw new Error(\"Invalid cookie name\");\n\tlet cookie = `${name}=${value}`;\n\tif (name.startsWith(\"__Secure-\") && !opt.secure) throw new Error(\"__Secure- Cookie must have Secure attributes\");\n\tif (name.startsWith(\"__Host-\")) {\n\t\tif (!opt.secure) throw new Error(\"__Host- Cookie must have Secure attributes\");\n\t\tif (opt.path !== \"/\") throw new Error(\"__Host- Cookie must have Path attributes with \\\"/\\\"\");\n\t\tif (opt.domain) throw new Error(\"__Host- Cookie must not have Domain attributes\");\n\t}\n\tfor (const key of [\n\t\t\"domain\",\n\t\t\"path\",\n\t\t\"sameSite\",\n\t\t\"priority\"\n\t]) if (opt[key] && /[;\\r\\n]/.test(opt[key])) throw new Error(`${key} must not contain \";\", \"\\\\r\", or \"\\\\n\"`);\n\tif (opt && typeof opt.maxAge === \"number\" && opt.maxAge >= 0) {\n\t\tif (opt.maxAge > 3456e4) throw new Error(\"Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.\");\n\t\tcookie += `; Max-Age=${opt.maxAge | 0}`;\n\t}\n\tif (opt.domain && opt.prefix !== \"host\") cookie += `; Domain=${opt.domain}`;\n\tif (opt.path) cookie += `; Path=${opt.path}`;\n\tif (opt.expires) {\n\t\tif (opt.expires.getTime() - Date.now() > 3456e7) throw new Error(\"Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.\");\n\t\tcookie += `; Expires=${opt.expires.toUTCString()}`;\n\t}\n\tif (opt.httpOnly) cookie += \"; HttpOnly\";\n\tif (opt.secure) cookie += \"; Secure\";\n\tif (opt.sameSite) cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`;\n\tif (opt.priority) cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`;\n\tif (opt.partitioned) {\n\t\tif (!opt.secure) throw new Error(\"Partitioned Cookie must have Secure attributes\");\n\t\tcookie += \"; Partitioned\";\n\t}\n\treturn cookie;\n};\nconst serialize = (name, value, opt) => {\n\tvalue = encodeURIComponent(value);\n\treturn _serialize(name, value, opt);\n};\nconst serializeSigned = async (name, value, secret, opt = {}) => {\n\tconst signature = await makeSignature(value, secret);\n\tvalue = `${value}.${signature}`;\n\tvalue = encodeURIComponent(value);\n\treturn _serialize(name, value, opt);\n};\n//#endregion\nexport { parse, parseSigned, serialize, serializeSigned };\n","import { parse, parseSigned, serialize, serializeSigned } from \"../../utils/cookie.js\";\n//#region src/helper/cookie/index.ts\nconst getCookie = (c, key, prefix) => {\n\tconst cookie = c.req.raw.headers.get(\"Cookie\");\n\tif (typeof key === \"string\") {\n\t\tif (!cookie) return;\n\t\tlet finalKey = key;\n\t\tif (prefix === \"secure\") finalKey = \"__Secure-\" + key;\n\t\telse if (prefix === \"host\") finalKey = \"__Host-\" + key;\n\t\treturn parse(cookie, finalKey)[finalKey];\n\t}\n\tif (!cookie) return {};\n\treturn parse(cookie);\n};\nconst getSignedCookie = async (c, secret, key, prefix) => {\n\tconst cookie = c.req.raw.headers.get(\"Cookie\");\n\tif (typeof key === \"string\") {\n\t\tif (!cookie) return;\n\t\tlet finalKey = key;\n\t\tif (prefix === \"secure\") finalKey = \"__Secure-\" + key;\n\t\telse if (prefix === \"host\") finalKey = \"__Host-\" + key;\n\t\treturn (await parseSigned(cookie, secret, finalKey))[finalKey];\n\t}\n\tif (!cookie) return {};\n\treturn await parseSigned(cookie, secret);\n};\nconst generateCookie = (name, value, opt) => {\n\tlet cookie;\n\tif (opt?.prefix === \"secure\") cookie = serialize(\"__Secure-\" + name, value, {\n\t\tpath: \"/\",\n\t\t...opt,\n\t\tsecure: true\n\t});\n\telse if (opt?.prefix === \"host\") cookie = serialize(\"__Host-\" + name, value, {\n\t\t...opt,\n\t\tpath: \"/\",\n\t\tsecure: true,\n\t\tdomain: void 0\n\t});\n\telse cookie = serialize(name, value, {\n\t\tpath: \"/\",\n\t\t...opt\n\t});\n\treturn cookie;\n};\nconst setCookie = (c, name, value, opt) => {\n\tconst cookie = generateCookie(name, value, opt);\n\tc.header(\"Set-Cookie\", cookie, { append: true });\n};\nconst generateSignedCookie = async (name, value, secret, opt) => {\n\tlet cookie;\n\tif (opt?.prefix === \"secure\") cookie = await serializeSigned(\"__Secure-\" + name, value, secret, {\n\t\tpath: \"/\",\n\t\t...opt,\n\t\tsecure: true\n\t});\n\telse if (opt?.prefix === \"host\") cookie = await serializeSigned(\"__Host-\" + name, value, secret, {\n\t\t...opt,\n\t\tpath: \"/\",\n\t\tsecure: true,\n\t\tdomain: void 0\n\t});\n\telse cookie = await serializeSigned(name, value, secret, {\n\t\tpath: \"/\",\n\t\t...opt\n\t});\n\treturn cookie;\n};\nconst setSignedCookie = async (c, name, value, secret, opt) => {\n\tconst cookie = await generateSignedCookie(name, value, secret, opt);\n\tc.header(\"set-cookie\", cookie, { append: true });\n};\nconst deleteCookie = (c, name, opt) => {\n\tconst deletedCookie = getCookie(c, name, opt?.prefix);\n\tsetCookie(c, name, \"\", {\n\t\t...opt,\n\t\tmaxAge: 0\n\t});\n\treturn deletedCookie;\n};\n//#endregion\nexport { deleteCookie, generateCookie, generateSignedCookie, getCookie, getSignedCookie, setCookie, setSignedCookie };\n","//#region src/http-exception.ts\n/**\n* `HTTPException` must be used when a fatal error such as authentication failure occurs.\n*\n* @see {@link https://hono.dev/docs/api/exception}\n*\n* @param {StatusCode} status - status code of HTTPException\n* @param {HTTPExceptionOptions} options - options of HTTPException\n* @param {HTTPExceptionOptions[\"res\"]} options.res - response of options of HTTPException\n* @param {HTTPExceptionOptions[\"message\"]} options.message - message of options of HTTPException\n* @param {HTTPExceptionOptions[\"cause\"]} options.cause - cause of options of HTTPException\n*\n* @example\n* ```ts\n* import { HTTPException } from 'hono/http-exception'\n*\n* // ...\n*\n* app.post('/auth', async (c, next) => {\n*   // authentication\n*   if (authorized === false) {\n*     throw new HTTPException(401, { message: 'Custom error message' })\n*   }\n*   await next()\n* })\n* ```\n*/\nvar HTTPException = class extends Error {\n\tres;\n\tstatus;\n\t/**\n\t* Creates an instance of `HTTPException`.\n\t* @param status - HTTP status code for the exception. Defaults to 500.\n\t* @param options - Additional options for the exception.\n\t*/\n\tconstructor(status = 500, options) {\n\t\tsuper(options?.message, { cause: options?.cause });\n\t\tthis.res = options?.res;\n\t\tthis.status = status;\n\t}\n\t/**\n\t* Returns the response object associated with the exception.\n\t* If a response object is not provided, a new response is created with the error message and status code.\n\t* @returns The response object.\n\t*/\n\tgetResponse() {\n\t\tif (this.res) return new Response(this.res.body, {\n\t\t\tstatus: this.status,\n\t\t\theaders: this.res.headers\n\t\t});\n\t\treturn new Response(this.message, { status: this.status });\n\t}\n};\n//#endregion\nexport { HTTPException };\n","import { HTTPException } from \"../../http-exception.js\";\n//#region src/middleware/body-limit/index.ts\nconst ERROR_MESSAGE = \"Payload Too Large\";\n/**\n* Body Limit Middleware for Hono.\n*\n* @see {@link https://hono.dev/docs/middleware/builtin/body-limit}\n*\n* @param {BodyLimitOptions} options - The options for the body limit middleware.\n* @param {number} options.maxSize - The maximum body size allowed.\n* @param {OnError} [options.onError] - The error handler to be invoked if the specified body size is exceeded.\n* @returns {MiddlewareHandler} The middleware handler function.\n*\n* @example\n* ```ts\n* const app = new Hono()\n*\n* app.post(\n*   '/upload',\n*   bodyLimit({\n*     maxSize: 50 * 1024, // 50kb\n*     onError: (c) => {\n*       return c.text('overflow :(', 413)\n*     },\n*   }),\n*   async (c) => {\n*     const body = await c.req.parseBody()\n*     if (body['file'] instanceof File) {\n*       console.log(`Got file sized: ${body['file'].size}`)\n*     }\n*     return c.text('pass :)')\n*   }\n* )\n* ```\n*/\nconst bodyLimit = (options) => {\n\tconst onError = options.onError || (() => {\n\t\tconst res = new Response(ERROR_MESSAGE, { status: 413 });\n\t\tthrow new HTTPException(413, { res });\n\t});\n\tconst maxSize = options.maxSize;\n\treturn async function bodyLimit(c, next) {\n\t\tif (!c.req.raw.body) return next();\n\t\tconst hasTransferEncoding = c.req.raw.headers.has(\"transfer-encoding\");\n\t\tif (c.req.raw.headers.has(\"content-length\") && !hasTransferEncoding) return parseInt(c.req.raw.headers.get(\"content-length\") || \"0\", 10) > maxSize ? onError(c) : next();\n\t\tlet size = 0;\n\t\tconst chunks = [];\n\t\tconst rawReader = c.req.raw.body.getReader();\n\t\tfor (;;) {\n\t\t\tconst { done, value } = await rawReader.read();\n\t\t\tif (done) break;\n\t\t\tsize += value.length;\n\t\t\tif (size > maxSize) return onError(c);\n\t\t\tchunks.push(value);\n\t\t}\n\t\tconst requestInit = {\n\t\t\tbody: new ReadableStream({ start(controller) {\n\t\t\t\tfor (const chunk of chunks) controller.enqueue(chunk);\n\t\t\t\tcontroller.close();\n\t\t\t} }),\n\t\t\tduplex: \"half\"\n\t\t};\n\t\tc.req.raw = new Request(c.req.raw, requestInit);\n\t\treturn next();\n\t};\n};\n//#endregion\nexport { bodyLimit };\n","import { HTTPException } from \"../../http-exception.js\";\n//#region src/middleware/timeout/index.ts\nconst defaultTimeoutException = new HTTPException(504, { message: \"Gateway Timeout\" });\n/**\n* Timeout Middleware for Hono.\n*\n* @param {number} duration - The timeout duration in milliseconds.\n* @param {HTTPExceptionFunction | HTTPException} [exception=defaultTimeoutException] - The exception to throw when the timeout occurs. Can be a function that returns an HTTPException or an HTTPException object.\n* @returns {MiddlewareHandler} The middleware handler function.\n*\n* @example\n* ```ts\n* const app = new Hono()\n*\n* app.use(\n*   '/long-request',\n*   timeout(5000) // Set timeout to 5 seconds\n* )\n*\n* app.get('/long-request', async (c) => {\n*   await someLongRunningFunction()\n*   return c.text('Completed within time limit')\n* })\n* ```\n*/\nconst timeout = (duration, exception = defaultTimeoutException) => {\n\treturn async function timeout(context, next) {\n\t\tlet timer;\n\t\tconst timeoutPromise = new Promise((_, reject) => {\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\treject(typeof exception === \"function\" ? exception(context) : exception);\n\t\t\t}, duration);\n\t\t});\n\t\ttry {\n\t\t\tawait Promise.race([next(), timeoutPromise]);\n\t\t} finally {\n\t\t\tif (timer !== void 0) clearTimeout(timer);\n\t\t}\n\t};\n};\n//#endregion\nexport { timeout };\n","import { DEVICE_AUTH_AUTHENTICATE_BODY_BYTES, DEVICE_AUTH_AUTHENTICATE_ROUTE, DEVICE_AUTH_CHALLENGE_ROUTE, DEVICE_COOKIE, NATIVE_PUSH_BODY_BYTES, NATIVE_PUSH_ROUTE, PAIRING_CLAIM_ROUTE, PAIRING_PAGE_ROUTE, PAIRING_STATUS_QUERY, PAIRING_STATUS_ROUTE, PASSKEY_AUTH_BEGIN_ROUTE, PASSKEY_AUTH_FINISH_ROUTE, PASSKEY_REGISTER_BEGIN_ROUTE, PASSKEY_REGISTER_FINISH_ROUTE, REMOTE_API_ROUTE, REMOTE_CHANNEL_ROUTE, TRUSTED_DEVICES_ROUTE, TRUSTED_DEVICE_REGISTER_BODY_BYTES } from \"../constants/remote.mjs\";\nimport { sanitizeEdgeIp, sanitizeUserAgent } from \"../services/deviceSessions/index.mjs\";\nimport { isStepUpAction } from \"../services/webauthnPolicy/index.mjs\";\nimport { pairingPageHeaders, pairingPageHtml } from \"../services/pairingPage/index.mjs\";\nimport { randomBytes } from \"node:crypto\";\nimport { getCookie, setCookie } from \"hono/cookie\";\nimport { bodyLimit } from \"hono/body-limit\";\nimport { HTTPException } from \"hono/http-exception\";\nimport { timeout } from \"hono/timeout\";\n//#region src/server/remoteRoutes.ts\nconst NONCE_BYTES = 16;\nconst BAD_REQUEST = 400;\nconst FORBIDDEN = 403;\nconst NOT_FOUND = 404;\nconst CONFLICT = 409;\nconst GONE = 410;\nconst TOO_MANY = 429;\nconst BAD_GATEWAY = 502;\nconst UNAUTHORIZED = 401;\nconst ACCEPTED = 202;\nconst CREATED = 201;\nconst SERVICE_UNAVAILABLE = 503;\n/** Trusted Cloudflare client address, used for display and public abuse throttling only. */\nconst EDGE_IP_HEADER = \"cf-connecting-ip\";\nconst PAYLOAD_TOO_LARGE = 413;\nconst REQUEST_TIMEOUT = 408;\nconst PUBLIC_REQUEST_CONCURRENCY = 8;\nconst PUBLIC_REQUEST_TIMEOUT_MS = 5e3;\nconst PAIRING_BODY_BYTES = 2048;\nconst CHANNEL_BODY_BYTES = 4096;\nconst PASSKEY_BEGIN_BODY_BYTES = 256;\nconst PASSKEY_FINISH_BODY_BYTES = 65536;\nconst CEREMONY_CALLER_COOKIE = \"po_ceremony_caller\";\nconst CEREMONY_CALLER_TOKEN = /^[A-Za-z0-9_-]{22}$/u;\nconst CEREMONY_CALLER_MAX_AGE_SECONDS = 600;\nconst PUBLIC_BEGIN_LIMIT = 10;\nconst PUBLIC_BEGIN_WINDOW_MS = 6e4;\nconst PUBLIC_BEGIN_SOURCE_LIMIT = 1024;\n/** Fallback wait before a remote-initiated shutdown, when the raw response is not reachable. */\nconst RESPONSE_FLUSH_GRACE_MS = 250;\nconst CHANNEL_SCOPES = /* @__PURE__ */ new Set([\n\t\"session\",\n\t\"protocol\",\n\t\"http\"\n]);\nfunction isChannelScope(value) {\n\treturn typeof value === \"string\" && CHANNEL_SCOPES.has(value);\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nasync function readJson(context) {\n\ttry {\n\t\tconst body = await context.req.json();\n\t\treturn isRecord(body) ? body : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* Runs an action once this response has reached the wire.\n*\n* Both callers tear down the listener carrying their own response, and the\n* difference between a confirmed answer and a socket error the caller cannot\n* distinguish from a failure is doing it in this order.\n*/\nfunction afterResponse(context, action) {\n\tconst outgoing = context.env.outgoing;\n\tif (outgoing === void 0) {\n\t\tsetTimeout(action, RESPONSE_FLUSH_GRACE_MS);\n\t\treturn;\n\t}\n\toutgoing.once(\"finish\", action);\n}\n/** What the credential is called in the device list; the user agent is the only hint available. */\nfunction labelFrom(context) {\n\treturn sanitizeUserAgent(context.req.header(\"user-agent\"));\n}\n/**\n* Cloudflare's normalized client address on the tunnel listener, with the\n* actual socket peer as the fallback for local and direct requests.\n*\n* A local process can forge the Cloudflare header, but local processes are\n* already outside this internet-client throttle boundary. Cloudflare is the\n* trusted proxy and overwrites this header for public requests.\n*/\nfunction sourceAddressOf(context, listener) {\n\tconst socketPeer = context.env?.incoming?.socket?.remoteAddress;\n\tif (listener !== \"tunnel\") return socketPeer;\n\tconst edgeAddress = sanitizeEdgeIp(context.req.header(EDGE_IP_HEADER));\n\treturn edgeAddress === \"unknown\" ? socketPeer : `cloudflare:${edgeAddress}`;\n}\nfunction limitedJsonBody(maxSize) {\n\treturn bodyLimit({\n\t\tmaxSize,\n\t\tonError: (context) => context.json({ error: \"The request body is too large.\" }, PAYLOAD_TOO_LARGE)\n\t});\n}\nfunction createPublicRequestBudget(isLocal) {\n\tlet active = 0;\n\treturn async (context, next) => {\n\t\tif (isLocal(context)) return next();\n\t\tif (active >= PUBLIC_REQUEST_CONCURRENCY) {\n\t\t\tcontext.header(\"Retry-After\", \"1\");\n\t\t\treturn context.json({ error: \"Too many public requests are already in progress.\" }, TOO_MANY);\n\t\t}\n\t\tactive += 1;\n\t\ttry {\n\t\t\tawait next();\n\t\t} finally {\n\t\t\tactive -= 1;\n\t\t}\n\t};\n}\nfunction createPublicBeginLimit() {\n\tconst windows = /* @__PURE__ */ new Map();\n\treturn (source) => {\n\t\tconst at = Date.now();\n\t\tlet window = windows.get(source);\n\t\tif (window === void 0 || at - window.startedAt >= PUBLIC_BEGIN_WINDOW_MS) {\n\t\t\tif (window === void 0 && windows.size >= PUBLIC_BEGIN_SOURCE_LIMIT) {\n\t\t\t\tconst oldest = windows.keys().next().value;\n\t\t\t\tif (oldest !== void 0) windows.delete(oldest);\n\t\t\t}\n\t\t\twindow = {\n\t\t\t\tcount: 0,\n\t\t\t\tstartedAt: at\n\t\t\t};\n\t\t\twindows.delete(source);\n\t\t\twindows.set(source, window);\n\t\t}\n\t\tif (window.count >= PUBLIC_BEGIN_LIMIT) return false;\n\t\twindow.count += 1;\n\t\treturn true;\n\t};\n}\n/**\n* Registers the pairing surface and the remote-access control plane.\n*\n* Split by who may reach them, not by shape. The pairing, passkey sign-in, and\n* device sign-in routes are the only unauthenticated ones on the tunnel listener\n* (pinned in `PUBLIC_PAIRING_ROUTES`), so each is small, bounded, and echoes\n* nothing from its request. The control plane is mostly local-only:\n* minting a code, approving, denying, and changing settings all stay at the\n* machine, because a device that can do them can make its own access permanent.\n* Turning remote access off and revoking a credential are allowed remotely, on\n* the grounds that a panic button is worth more from the phone than the desk.\n*/\nfunction registerRemoteRoutes(app, options) {\n\tconst { remote } = options;\n\tconst isLocal = (context) => options.listenerOf(context) === \"local\";\n\tconst localOnly = (context) => isLocal(context) ? void 0 : context.json({ error: \"This action is only available on the host.\" }, FORBIDDEN);\n\tconst publicBudget = createPublicRequestBudget(isLocal);\n\tconst publicBeginAllowed = createPublicBeginLimit();\n\tconst deviceAuthBeginAllowed = createPublicBeginLimit();\n\tconst sealedDeviceOf = (context) => context.env?.sealedDeviceId;\n\tconst publicDeadline = timeout(PUBLIC_REQUEST_TIMEOUT_MS, () => new HTTPException(REQUEST_TIMEOUT, { res: Response.json({ error: \"The public request timed out.\" }, { status: REQUEST_TIMEOUT }) }));\n\tconst authenticatedCeremonyCaller = (context) => {\n\t\tconst deviceId = context.env?.sealedDeviceId ?? remote.authorize(getCookie(context, \"po_device\", \"host\"));\n\t\treturn deviceId === void 0 ? \"local\" : `device:${deviceId}`;\n\t};\n\tconst registrationCaller = (context) => {\n\t\tconst caller = authenticatedCeremonyCaller(context);\n\t\treturn isLocal(context) || caller !== \"local\" ? caller : void 0;\n\t};\n\tconst publicCeremonyCaller = (context, create) => {\n\t\tlet token = getCookie(context, CEREMONY_CALLER_COOKIE, \"host\");\n\t\tif (token !== void 0 && !CEREMONY_CALLER_TOKEN.test(token)) token = void 0;\n\t\tif (token === void 0 && create) token = randomBytes(16).toString(\"base64url\");\n\t\tif (token !== void 0 && create) setCookie(context, CEREMONY_CALLER_COOKIE, token, {\n\t\t\tprefix: \"host\",\n\t\t\thttpOnly: true,\n\t\t\tsameSite: \"Strict\",\n\t\t\tmaxAge: CEREMONY_CALLER_MAX_AGE_SECONDS\n\t\t});\n\t\treturn token === void 0 ? void 0 : `public:${token}`;\n\t};\n\tapp.get(PAIRING_PAGE_ROUTE, (context) => {\n\t\tconst nonce = randomBytes(NONCE_BYTES).toString(\"base64\");\n\t\tconst localTrust = options.listenerOf(context) === \"local\" ? remote.bundleTrust() : void 0;\n\t\treturn context.body(pairingPageHtml({\n\t\t\tnonce,\n\t\t\t...localTrust === void 0 ? {} : { localTrust }\n\t\t}), 200, pairingPageHeaders(nonce));\n\t});\n\tapp.post(PAIRING_CLAIM_ROUTE, publicBudget, publicDeadline, limitedJsonBody(PAIRING_BODY_BYTES), async (context) => {\n\t\tlet body;\n\t\ttry {\n\t\t\tbody = await context.req.json();\n\t\t} catch {\n\t\t\treturn context.json({ error: \"The request body must be JSON.\" }, BAD_REQUEST);\n\t\t}\n\t\tif (!isRecord(body) || typeof body.code !== \"string\" || body.code === \"\") return context.json({ error: \"A code string is required.\" }, BAD_REQUEST);\n\t\tconst outcome = remote.claim({\n\t\t\tcode: body.code,\n\t\t\tuserAgent: context.req.header(\"user-agent\"),\n\t\t\tedgeIp: context.req.header(EDGE_IP_HEADER),\n\t\t\tsourceAddress: sourceAddressOf(context, options.listenerOf(context))\n\t\t});\n\t\tif (outcome.ok) return context.json({\n\t\t\trequestId: outcome.requestId,\n\t\t\tstatus: \"pending\"\n\t\t}, ACCEPTED);\n\t\tif (outcome.code === \"unknown_code\") return context.json({ error: \"That code is not valid.\" }, GONE);\n\t\treturn context.json({ error: \"Too many attempts.\" }, TOO_MANY);\n\t});\n\tapp.get(PAIRING_STATUS_ROUTE, (context) => {\n\t\tconst requestId = context.req.query(PAIRING_STATUS_QUERY);\n\t\tif (requestId === void 0) return context.json({ error: \"A request id is required.\" }, BAD_REQUEST);\n\t\tconst status = remote.pairingStatus(requestId);\n\t\tif (status === void 0) return context.json({ error: \"No such pairing request.\" }, NOT_FOUND);\n\t\tif (status !== \"approved\") return context.json({ status });\n\t\tconst redeemed = remote.redeem(requestId);\n\t\tif (redeemed === void 0) return context.json({ status: \"consumed\" });\n\t\tsetCookie(context, DEVICE_COOKIE, redeemed.token, {\n\t\t\tprefix: \"host\",\n\t\t\thttpOnly: true,\n\t\t\tsameSite: \"Lax\",\n\t\t\tmaxAge: redeemed.maxAgeSeconds\n\t\t});\n\t\treturn context.json({\n\t\t\tstatus: \"approved\",\n\t\t\tbundleTrust: remote.bundleTrust(),\n\t\t\thostPublicKey: remote.channelPublicKey()\n\t\t});\n\t});\n\tapp.get(REMOTE_API_ROUTE, (context) => {\n\t\tconst self = remote.authorize(getCookie(context, DEVICE_COOKIE, \"host\"));\n\t\treturn context.json({ state: remote.state(self, isLocal(context)) });\n\t});\n\tapp.post(`${REMOTE_API_ROUTE}/enable`, async (context) => {\n\t\tconst refused = localOnly(context);\n\t\tif (refused) return refused;\n\t\tconst outcome = await remote.enable();\n\t\tif (!outcome.ok) return context.json({ error: outcome.error }, BAD_GATEWAY);\n\t\treturn context.json({ state: remote.state(void 0, true) });\n\t});\n\tapp.post(`${REMOTE_API_ROUTE}/disable`, async (context) => {\n\t\tif (isLocal(context)) {\n\t\t\tawait remote.disable();\n\t\t\treturn context.json({ state: remote.state(void 0, true) });\n\t\t}\n\t\tafterResponse(context, () => void remote.disable());\n\t\treturn context.json({ status: \"closing\" }, ACCEPTED);\n\t});\n\tapp.post(`${REMOTE_API_ROUTE}/codes`, (context) => {\n\t\tconst refused = localOnly(context);\n\t\tif (refused) return refused;\n\t\tconst minted = remote.mintPairing();\n\t\tif (minted === void 0) return context.json({ error: \"Remote access or signed bundle publication is unavailable.\" }, CONFLICT);\n\t\treturn context.json(minted, CREATED);\n\t});\n\tapp.post(`${REMOTE_API_ROUTE}/pairing/:id/approve`, (context) => {\n\t\tconst refused = localOnly(context);\n\t\tif (refused) return refused;\n\t\tconst outcome = remote.approve(context.req.param(\"id\"));\n\t\tif (outcome === \"approved\") return context.json({ state: remote.state(void 0, true) });\n\t\tif (outcome === \"unknown\") return context.json({ error: \"No such pairing request.\" }, NOT_FOUND);\n\t\treturn context.json({ error: `That request is ${outcome}.` }, CONFLICT);\n\t});\n\tapp.post(`${REMOTE_API_ROUTE}/pairing/:id/deny`, (context) => {\n\t\tconst refused = localOnly(context);\n\t\tif (refused) return refused;\n\t\tconst outcome = remote.deny(context.req.param(\"id\"));\n\t\tif (outcome === \"denied\") return context.json({ state: remote.state(void 0, true) });\n\t\tif (outcome === \"unknown\") return context.json({ error: \"No such pairing request.\" }, NOT_FOUND);\n\t\treturn context.json({ error: \"That request is already settled.\" }, CONFLICT);\n\t});\n\tapp.delete(`${REMOTE_API_ROUTE}/devices/:id`, (context) => {\n\t\tif (!remote.revokeDevice(context.req.param(\"id\"))) return context.json({ error: \"No such device.\" }, NOT_FOUND);\n\t\treturn context.json({ state: remote.state(void 0, isLocal(context)) });\n\t});\n\tapp.get(`${REMOTE_API_ROUTE}/passkeys`, (context) => {\n\t\tconst passkeys = remote.passkeys();\n\t\treturn context.json({\n\t\t\tsupport: passkeys.support(),\n\t\t\tcredentials: passkeys.list().map(({ id, label, createdAt, lastUsedAt }) => ({\n\t\t\t\tid,\n\t\t\t\tlabel,\n\t\t\t\tcreatedAt: new Date(createdAt).toISOString(),\n\t\t\t\tlastUsedAt: new Date(lastUsedAt).toISOString()\n\t\t\t}))\n\t\t});\n\t});\n\t/**\n\t* Registers a native device. Sealed only, so the relay never reads the keys, and only from a session\n\t* the host approved by QR. Unsealed requests never get here on the tunnel listener; this check\n\t* covers the loopback one too.\n\t*/\n\tapp.post(TRUSTED_DEVICES_ROUTE, limitedJsonBody(TRUSTED_DEVICE_REGISTER_BODY_BYTES), async (context) => {\n\t\tconst sessionDeviceId = sealedDeviceOf(context);\n\t\tif (sessionDeviceId === void 0) return context.json({ error: \"Devices register through the sealed gateway.\" }, FORBIDDEN);\n\t\tconst body = await readJson(context);\n\t\tif (body === void 0) return context.json({ error: \"The request body must be a JSON object.\" }, BAD_REQUEST);\n\t\tconst outcome = remote.registerTrustedDevice(sessionDeviceId, body);\n\t\tif (outcome.ok) return context.json({ trustedDeviceId: outcome.trustedDeviceId }, CREATED);\n\t\tif (outcome.reason === \"forbidden\") return context.json({ error: \"Only a freshly paired session can register this device.\" }, FORBIDDEN);\n\t\tif (outcome.reason === \"persistence\") return context.json({ error: \"The trusted device could not be saved.\" }, SERVICE_UNAVAILABLE);\n\t\tif (outcome.reason === \"full\") return context.json({ error: \"Too many trusted devices. Revoke one first.\" }, CONFLICT);\n\t\tif (outcome.reason === \"unavailable\") return context.json({ error: \"Remote access is unavailable.\" }, CONFLICT);\n\t\treturn context.json({ error: \"The device keys or proofs were not valid.\" }, BAD_REQUEST);\n\t});\n\tapp.post(NATIVE_PUSH_ROUTE, limitedJsonBody(NATIVE_PUSH_BODY_BYTES), async (context) => {\n\t\tconst sessionDeviceId = sealedDeviceOf(context);\n\t\tif (sessionDeviceId === void 0) return context.json({ error: \"Native push requires a sealed trusted device session.\" }, FORBIDDEN);\n\t\tconst body = await readJson(context);\n\t\tif (body === void 0) return context.json({ error: \"A registration object is required.\" }, BAD_REQUEST);\n\t\tconst outcome = remote.setNativePushRegistration(sessionDeviceId, body);\n\t\tif (outcome.ok) return context.json({ notificationId: outcome.notificationId });\n\t\tif (outcome.reason === \"forbidden\") return context.json({ error: \"A trusted native session is required.\" }, FORBIDDEN);\n\t\tif (outcome.reason === \"persistence\") return context.json({ error: \"The registration could not be saved.\" }, SERVICE_UNAVAILABLE);\n\t\treturn context.json({ error: \"The native push registration is invalid.\" }, BAD_REQUEST);\n\t});\n\tapp.delete(NATIVE_PUSH_ROUTE, limitedJsonBody(NATIVE_PUSH_BODY_BYTES), (context) => {\n\t\tconst sessionDeviceId = sealedDeviceOf(context);\n\t\tif (sessionDeviceId === void 0) return context.json({ error: \"Native push requires a sealed trusted device session.\" }, FORBIDDEN);\n\t\tconst outcome = remote.setNativePushRegistration(sessionDeviceId, void 0);\n\t\tif (outcome.ok) return context.json({ notificationId: outcome.notificationId });\n\t\tif (outcome.reason === \"persistence\") return context.json({ error: \"The registration could not be saved.\" }, SERVICE_UNAVAILABLE);\n\t\treturn context.json({ error: \"A trusted native session is required.\" }, FORBIDDEN);\n\t});\n\t/**\n\t* Revokes a trusted device and every session it holds. From the host, or from a sealed caller that\n\t* passed step-up. A quick-tunnel browser cannot step up, so it is told where revoking works.\n\t*/\n\tapp.delete(`${TRUSTED_DEVICES_ROUTE}/:id`, (context) => {\n\t\tconst stepUp = context.env?.sealedStepUp;\n\t\tif (!isLocal(context) && stepUp !== \"verified\") return context.json({ error: \"Revoke from the host or a trusted native device.\" }, FORBIDDEN);\n\t\tif (!remote.revokeTrustedDevice(context.req.param(\"id\"))) {\n\t\t\tif (remote.state().trustedDevices.some((record) => record.id === context.req.param(\"id\"))) return context.json({ error: \"The trusted device could not be removed.\" }, SERVICE_UNAVAILABLE);\n\t\t\treturn context.json({ error: \"No such trusted device.\" }, NOT_FOUND);\n\t\t}\n\t\treturn context.json({ state: remote.state(isLocal(context) ? void 0 : sealedDeviceOf(context), isLocal(context)) });\n\t});\n\t/**\n\t* Public reconnect challenge for a trusted native device. Rate limited on its own, and the answer has\n\t* the same shape for an unknown id, so probing cannot list devices.\n\t*/\n\tapp.post(DEVICE_AUTH_CHALLENGE_ROUTE, publicBudget, publicDeadline, limitedJsonBody(256), async (context) => {\n\t\tconst listener = options.listenerOf(context);\n\t\tconst source = sourceAddressOf(context, listener) ?? \"unknown\";\n\t\tif (listener === \"tunnel\" && !deviceAuthBeginAllowed(source)) {\n\t\t\tcontext.header(\"Retry-After\", \"60\");\n\t\t\treturn context.json({ error: \"Too many device sign-in attempts. Try again shortly.\" }, TOO_MANY);\n\t\t}\n\t\tconst body = await readJson(context);\n\t\tconst begun = remote.beginDeviceAuth({\n\t\t\ttrustedDeviceId: body?.trustedDeviceId,\n\t\t\tnonce: body?.nonce\n\t\t});\n\t\tif (begun.ok) {\n\t\t\tconst { challengeId, challenge, hostPublicKey, attestation } = begun;\n\t\t\treturn context.json({\n\t\t\t\tchallengeId,\n\t\t\t\tchallenge,\n\t\t\t\thostPublicKey,\n\t\t\t\tattestation\n\t\t\t});\n\t\t}\n\t\tif (begun.reason === \"invalid\") return context.json({ error: \"A trustedDeviceId and a 32-byte nonce are required.\" }, BAD_REQUEST);\n\t\treturn context.json({ error: \"Device sign-in is unavailable.\" }, CONFLICT);\n\t});\n\t/** Completes a device sign-in. Any failure is the same plain 401. */\n\tapp.post(DEVICE_AUTH_AUTHENTICATE_ROUTE, publicBudget, publicDeadline, limitedJsonBody(DEVICE_AUTH_AUTHENTICATE_BODY_BYTES), async (context) => {\n\t\tconst session = remote.finishDeviceAuth(await readJson(context));\n\t\tif (session === void 0) return context.json({ error: \"Device sign-in failed.\" }, UNAUTHORIZED);\n\t\tsetCookie(context, DEVICE_COOKIE, session.token, {\n\t\t\tprefix: \"host\",\n\t\t\thttpOnly: true,\n\t\t\tsameSite: \"Lax\",\n\t\t\tmaxAge: session.maxAgeSeconds\n\t\t});\n\t\treturn context.json({ ok: true });\n\t});\n\tapp.post(PASSKEY_REGISTER_BEGIN_ROUTE, publicBudget, publicDeadline, limitedJsonBody(PASSKEY_BEGIN_BODY_BYTES), async (context) => {\n\t\tconst caller = registrationCaller(context);\n\t\tif (caller === void 0) return context.json({ error: \"This device is not paired.\" }, UNAUTHORIZED);\n\t\tconst begun = await remote.passkeys().beginRegistration(caller, labelFrom(context));\n\t\tif (begun === void 0) return context.json({ error: remote.passkeys().support() }, CONFLICT);\n\t\treturn context.json(begun);\n\t});\n\tapp.post(PASSKEY_REGISTER_FINISH_ROUTE, publicBudget, publicDeadline, limitedJsonBody(PASSKEY_FINISH_BODY_BYTES), async (context) => {\n\t\tconst caller = registrationCaller(context);\n\t\tif (caller === void 0) return context.json({ error: \"This device is not paired.\" }, UNAUTHORIZED);\n\t\tconst body = await readJson(context);\n\t\tif (body === void 0 || typeof body.ceremonyId !== \"string\" || !(\"response\" in body)) return context.json({ error: \"A ceremonyId and response are required.\" }, BAD_REQUEST);\n\t\tconst outcome = await remote.passkeys().finishRegistration(body.ceremonyId, caller, body.response, labelFrom(context));\n\t\tif (!outcome.ok) return context.json({ error: outcome.error }, BAD_REQUEST);\n\t\treturn context.json({ id: outcome.id });\n\t});\n\tapp.post(PASSKEY_AUTH_BEGIN_ROUTE, publicBudget, publicDeadline, limitedJsonBody(PASSKEY_BEGIN_BODY_BYTES), async (context) => {\n\t\tconst listener = options.listenerOf(context);\n\t\tconst source = sourceAddressOf(context, listener) ?? \"unknown\";\n\t\tif (listener === \"tunnel\" && !publicBeginAllowed(source)) {\n\t\t\tcontext.header(\"Retry-After\", \"60\");\n\t\t\treturn context.json({ error: \"Too many passkey sign-in attempts. Try again shortly.\" }, TOO_MANY);\n\t\t}\n\t\tconst caller = publicCeremonyCaller(context, true);\n\t\tif (caller === void 0) return context.json({ error: \"Could not start this sign-in.\" }, CONFLICT);\n\t\tconst begun = await remote.passkeys().beginAuthentication(caller);\n\t\tif (begun === void 0) return context.json({ error: \"Passkeys are unavailable.\" }, CONFLICT);\n\t\treturn context.json(begun);\n\t});\n\tapp.post(PASSKEY_AUTH_FINISH_ROUTE, publicBudget, publicDeadline, limitedJsonBody(PASSKEY_FINISH_BODY_BYTES), async (context) => {\n\t\tconst body = await readJson(context);\n\t\tif (body === void 0 || typeof body.ceremonyId !== \"string\" || !(\"response\" in body)) return context.json({ error: \"A ceremonyId and response are required.\" }, BAD_REQUEST);\n\t\tconst caller = publicCeremonyCaller(context, false);\n\t\tif (caller === void 0) return context.json({ error: \"That sign-in was not started by this browser.\" }, UNAUTHORIZED);\n\t\tconst outcome = await remote.passkeys().finishAuthentication(body.ceremonyId, caller, body.response);\n\t\tif (!outcome.ok) return context.json({ error: outcome.error }, UNAUTHORIZED);\n\t\tconst hostPublicKey = remote.channelPublicKey();\n\t\tif (hostPublicKey === void 0) return context.json({ error: \"Sealed channels are unavailable.\" }, CONFLICT);\n\t\tconst session = remote.sessionForPasskey(outcome.credential.label);\n\t\tsetCookie(context, DEVICE_COOKIE, session.token, {\n\t\t\tprefix: \"host\",\n\t\t\thttpOnly: true,\n\t\t\tsameSite: \"Lax\",\n\t\t\tmaxAge: session.maxAgeSeconds\n\t\t});\n\t\treturn context.json({\n\t\t\tok: true,\n\t\t\thostPublicKey\n\t\t});\n\t});\n\tapp.delete(`${REMOTE_API_ROUTE}/passkeys/:id`, (context) => {\n\t\tconst refused = localOnly(context);\n\t\tif (refused) return refused;\n\t\tif (!remote.passkeys().forget(context.req.param(\"id\"))) return context.json({ error: \"No such passkey.\" }, NOT_FOUND);\n\t\treturn context.json({ ok: true });\n\t});\n\t/** A challenge bound to one action, so it cannot be replayed to authorise another. */\n\tapp.post(`${REMOTE_API_ROUTE}/challenge`, async (context) => {\n\t\tconst body = await readJson(context);\n\t\tif (body === void 0 || !isStepUpAction(body.action)) return context.json({ error: \"A known action is required.\" }, BAD_REQUEST);\n\t\tconst deviceId = sealedDeviceOf(context) ?? remote.authorize(getCookie(context, \"po_device\", \"host\"));\n\t\tif (deviceId !== void 0 && remote.trustKind(deviceId) === \"device-key\") {\n\t\t\tconst challenge = remote.beginDeviceStepUp(deviceId, body.action);\n\t\t\tif (challenge === void 0) return context.json({ error: \"Device step-up is unavailable.\" }, CONFLICT);\n\t\t\treturn context.json(challenge);\n\t\t}\n\t\tconst begun = await remote.passkeys().beginStepUp(authenticatedCeremonyCaller(context), body.action);\n\t\tif (begun === void 0) return context.json({ error: \"Passkeys are unavailable.\" }, CONFLICT);\n\t\treturn context.json(begun);\n\t});\n\t/**\n\t* Completes the sealed channel for the calling device.\n\t*\n\t* Unsealed by necessity: this is the request that establishes sealing. It\n\t* carries only a public key, which is safe for the relay to see, and needs the\n\t* host key delivered by an approved QR or successful passkey sign-in.\n\t*/\n\tapp.post(REMOTE_CHANNEL_ROUTE, limitedJsonBody(CHANNEL_BODY_BYTES), async (context) => {\n\t\tconst device = remote.authorize(getCookie(context, DEVICE_COOKIE, \"host\"));\n\t\tif (device === void 0) return context.json({ error: \"This device is not paired.\" }, UNAUTHORIZED);\n\t\tif (remote.trustKind(device) === \"device-key\") return context.json({ error: \"This session opened its channels at sign-in.\" }, FORBIDDEN);\n\t\tconst body = await readJson(context);\n\t\tif (body === void 0 || typeof body.clientPublicKey !== \"string\" || !isChannelScope(body.scope)) return context.json({ error: \"A clientPublicKey and known scope are required.\" }, BAD_REQUEST);\n\t\tif (!remote.openChannel(device, body.scope, body.clientPublicKey)) return context.json({ error: \"That key did not complete a fresh channel.\" }, BAD_REQUEST);\n\t\treturn context.json({ ok: true });\n\t});\n\tapp.put(`${REMOTE_API_ROUTE}/settings`, async (context) => {\n\t\tconst refused = localOnly(context);\n\t\tif (refused) return refused;\n\t\tlet body;\n\t\ttry {\n\t\t\tbody = await context.req.json();\n\t\t} catch {\n\t\t\treturn context.json({ error: \"The request body must be JSON.\" }, BAD_REQUEST);\n\t\t}\n\t\tif (!isRecord(body)) return context.json({ error: \"The settings must be an object.\" }, BAD_REQUEST);\n\t\tconst settings = remote.updateSettings(body);\n\t\treturn context.json({ settings });\n\t});\n}\n//#endregion\nexport { registerRemoteRoutes };\n\n//# sourceMappingURL=remoteRoutes.mjs.map","//#region src/request/constants.ts\nconst GET_MATCH_RESULT = Symbol();\n//#endregion\nexport { GET_MATCH_RESULT };\n","import { sha256 } from \"./crypto.js\";\n//#region src/utils/buffer.ts\n/**\n* @module\n* Buffer utility.\n*/\nconst equal = (a, b) => {\n\tif (a === b) return true;\n\tif (a.byteLength !== b.byteLength) return false;\n\tconst va = new DataView(a);\n\tconst vb = new DataView(b);\n\tlet i = va.byteLength;\n\twhile (i--) if (va.getUint8(i) !== vb.getUint8(i)) return false;\n\treturn true;\n};\nconst constantTimeEqualString = (a, b) => {\n\tconst aLen = a.length;\n\tconst bLen = b.length;\n\tconst maxLen = Math.max(aLen, bLen);\n\tlet out = aLen ^ bLen;\n\tfor (let i = 0; i < maxLen; i++) {\n\t\tconst aChar = i < aLen ? a.charCodeAt(i) : 0;\n\t\tconst bChar = i < bLen ? b.charCodeAt(i) : 0;\n\t\tout |= aChar ^ bChar;\n\t}\n\treturn out === 0;\n};\nconst timingSafeEqualString = async (a, b, hashFunction) => {\n\tif (!hashFunction) hashFunction = sha256;\n\tconst [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]);\n\tif (sa == null || sb == null || typeof sa !== \"string\" || typeof sb !== \"string\") return false;\n\tconst hashEqual = constantTimeEqualString(sa, sb);\n\tconst originalEqual = constantTimeEqualString(a, b);\n\treturn hashEqual && originalEqual;\n};\nconst timingSafeEqual = async (a, b, hashFunction) => {\n\tif (typeof a === \"string\" && typeof b === \"string\") return timingSafeEqualString(a, b, hashFunction);\n\tif (!hashFunction) hashFunction = sha256;\n\tconst [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]);\n\tif (!sa || !sb || typeof sa !== \"string\" || typeof sb !== \"string\") return false;\n\treturn timingSafeEqualString(sa, sb);\n};\nconst bufferToString = (buffer) => {\n\tif (buffer instanceof ArrayBuffer) return new TextDecoder(\"utf-8\").decode(buffer);\n\treturn buffer;\n};\nconst bufferToFormData = (arrayBuffer, contentType) => {\n\treturn new Response(arrayBuffer, { headers: { \"Content-Type\": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase()) } }).formData();\n};\n//#endregion\nexport { bufferToFormData, bufferToString, equal, timingSafeEqual };\n","import { bufferToFormData } from \"./buffer.js\";\n//#region src/utils/body.ts\nconst MAX_NESTED_OBJECTS = 1e4;\nconst isRawRequest = (request) => \"headers\" in request;\nconst parseBody = async (request, options = Object.create(null)) => {\n\tconst { all = false, dot = false } = options;\n\tconst mediaType = (isRawRequest(request) ? request.headers : request.raw.headers).get(\"Content-Type\")?.split(\";\")[0].trim().toLowerCase();\n\tif (mediaType === \"multipart/form-data\" || mediaType === \"application/x-www-form-urlencoded\") return parseFormData(request, {\n\t\tall,\n\t\tdot\n\t});\n\treturn {};\n};\n/**\n* Parses form data from a request.\n*\n* @template T - The type of the parsed body data.\n* @param {HonoRequest | Request} request - The request object containing form data.\n* @param {ParseBodyOptions} options - Options for parsing the form data.\n* @returns {Promise<T>} The parsed body data.\n*/\nasync function parseFormData(request, options) {\n\tif (!isRawRequest(request) && request.bodyCache.formData) return convertFormDataToBodyData(await request.bodyCache.formData, options);\n\tconst headers = isRawRequest(request) ? request.headers : request.raw.headers;\n\tconst arrayBuffer = await request.arrayBuffer();\n\tconst formDataPromise = bufferToFormData(arrayBuffer, headers.get(\"Content-Type\") || \"\");\n\tif (!isRawRequest(request)) request.bodyCache.formData = formDataPromise;\n\tconst formData = await formDataPromise;\n\tif (formData) return convertFormDataToBodyData(formData, options);\n\treturn {};\n}\n/**\n* Converts form data to body data based on the provided options.\n*\n* @template T - The type of the parsed body data.\n* @param {FormData} formData - The form data to convert.\n* @param {ParseBodyOptions} options - Options for parsing the form data.\n* @returns {T} The converted body data.\n*/\nfunction convertFormDataToBodyData(formData, options) {\n\tconst form = Object.create(null);\n\tconst nestingState = { count: 0 };\n\tformData.forEach((value, key) => {\n\t\tif (!(options.all || key.endsWith(\"[]\"))) form[key] = value;\n\t\telse handleParsingAllValues(form, key, value);\n\t});\n\tif (options.dot) Object.entries(form).forEach(([key, value]) => {\n\t\tif (key.includes(\".\")) {\n\t\t\thandleParsingNestedValues(form, key, value, nestingState);\n\t\t\tdelete form[key];\n\t\t}\n\t});\n\treturn form;\n}\n/**\n* Handles parsing all values for a given key, supporting multiple values as arrays.\n*\n* @param {BodyData} form - The form data object.\n* @param {string} key - The key to parse.\n* @param {FormDataEntryValue} value - The value to assign.\n*/\nconst handleParsingAllValues = (form, key, value) => {\n\tif (form[key] !== void 0) {\n\t\tif (Array.isArray(form[key])) form[key].push(value);\n\t\telse form[key] = [form[key], value];\n\t} else if (!key.endsWith(\"[]\")) form[key] = value;\n\telse form[key] = [value];\n};\n/**\n* Handles parsing nested values using dot notation keys.\n*\n* @param {BodyData} form - The form data object.\n* @param {string} key - The dot notation key.\n* @param {BodyDataValue} value - The value to assign.\n*/\nconst handleParsingNestedValues = (form, key, value, state) => {\n\tif (/(?:^|\\.)__proto__\\./.test(key)) return;\n\tlet nestedForm = form;\n\tconst keys = key.split(\".\", 34);\n\tif (keys.length > 33) throwNestingLimitExceeded();\n\tkeys.forEach((key, index) => {\n\t\tif (index === keys.length - 1) nestedForm[key] = value;\n\t\telse {\n\t\t\tif (!nestedForm[key] || typeof nestedForm[key] !== \"object\" || Array.isArray(nestedForm[key]) || nestedForm[key] instanceof File) {\n\t\t\t\tif (state.count++ >= MAX_NESTED_OBJECTS) throwNestingLimitExceeded();\n\t\t\t\tnestedForm[key] = Object.create(null);\n\t\t\t}\n\t\t\tnestedForm = nestedForm[key];\n\t\t}\n\t});\n};\nconst throwNestingLimitExceeded = () => {\n\tthrow new Error(\"Nesting limit exceeded\");\n};\n//#endregion\nexport { parseBody };\n","import { HTTPException } from \"./http-exception.js\";\nimport { GET_MATCH_RESULT } from \"./request/constants.js\";\nimport { parseBody } from \"./utils/body.js\";\nimport { getQueryParam, getQueryParams, tryDecodeURIComponent } from \"./utils/url.js\";\n//#region src/request.ts\nvar HonoRequest = class {\n\t/**\n\t* `.raw` can get the raw Request object.\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#raw}\n\t*\n\t* @example\n\t* ```ts\n\t* // For Cloudflare Workers\n\t* app.post('/', async (c) => {\n\t*   const metadata = c.req.raw.cf?.hostMetadata?\n\t*   ...\n\t* })\n\t* ```\n\t*/\n\traw;\n\t#validatedData;\n\t#matchResult;\n\trouteIndex = 0;\n\t/**\n\t* `.path` can get the pathname of the request.\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#path}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/about/me', (c) => {\n\t*   const pathname = c.req.path // `/about/me`\n\t* })\n\t* ```\n\t*/\n\tpath;\n\tbodyCache = {};\n\tconstructor(request, path = \"/\", matchResult = [[]]) {\n\t\tthis.raw = request;\n\t\tthis.path = path;\n\t\tthis.#matchResult = matchResult;\n\t}\n\tparam(key) {\n\t\treturn key ? this.#getDecodedParam(key) : this.#getAllDecodedParams();\n\t}\n\t#getDecodedParam(key) {\n\t\tconst paramKey = this.#matchResult[0][this.routeIndex]?.[1][key];\n\t\tconst param = this.#getParamValue(paramKey);\n\t\treturn param && tryDecodeURIComponent(param);\n\t}\n\t#getAllDecodedParams() {\n\t\tconst decoded = {};\n\t\tconst keys = Object.keys(this.#matchResult[0][this.routeIndex]?.[1] ?? {});\n\t\tfor (const key of keys) {\n\t\t\tconst value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]);\n\t\t\tif (value !== void 0) decoded[key] = tryDecodeURIComponent(value);\n\t\t}\n\t\treturn decoded;\n\t}\n\t#getParamValue(paramKey) {\n\t\treturn this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey;\n\t}\n\tquery(key) {\n\t\treturn getQueryParam(this.url, key);\n\t}\n\tqueries(key) {\n\t\treturn getQueryParams(this.url, key);\n\t}\n\theader(name) {\n\t\tif (name) return this.raw.headers.get(name) ?? void 0;\n\t\tconst headerData = Object.create(null);\n\t\tthis.raw.headers.forEach((value, key) => {\n\t\t\theaderData[key] = value;\n\t\t});\n\t\treturn headerData;\n\t}\n\tasync parseBody(options) {\n\t\treturn parseBody(this, options);\n\t}\n\t#cachedBody = (key) => {\n\t\tconst { bodyCache, raw } = this;\n\t\tconst cachedBody = bodyCache[key];\n\t\tif (cachedBody) return cachedBody;\n\t\tfor (const anyCachedKey in bodyCache) return bodyCache[anyCachedKey].then((body) => {\n\t\t\tif (anyCachedKey === \"json\") body = JSON.stringify(body);\n\t\t\tconst contentType = anyCachedKey === \"formData\" ? void 0 : raw.headers.get(\"content-type\");\n\t\t\treturn new Response(body, { headers: contentType ? { \"Content-Type\": contentType } : void 0 })[key]();\n\t\t});\n\t\treturn bodyCache[key] = raw[key]();\n\t};\n\t/**\n\t* `.json()` can parse Request body of type `application/json`\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#json}\n\t*\n\t* @example\n\t* ```ts\n\t* app.post('/entry', async (c) => {\n\t*   const body = await c.req.json()\n\t* })\n\t* ```\n\t*/\n\tjson() {\n\t\treturn this.#cachedBody(\"text\").then((text) => JSON.parse(text));\n\t}\n\t/**\n\t* `.text()` can parse Request body of type `text/plain`\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#text}\n\t*\n\t* @example\n\t* ```ts\n\t* app.post('/entry', async (c) => {\n\t*   const body = await c.req.text()\n\t* })\n\t* ```\n\t*/\n\ttext() {\n\t\treturn this.#cachedBody(\"text\");\n\t}\n\t/**\n\t* `.arrayBuffer()` parse Request body as an `ArrayBuffer`\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#arraybuffer}\n\t*\n\t* @example\n\t* ```ts\n\t* app.post('/entry', async (c) => {\n\t*   const body = await c.req.arrayBuffer()\n\t* })\n\t* ```\n\t*/\n\tarrayBuffer() {\n\t\treturn this.#cachedBody(\"arrayBuffer\");\n\t}\n\t/**\n\t* `.bytes()` parses the request body as a `Uint8Array`.\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#bytes}\n\t*\n\t* @example\n\t* ```ts\n\t* app.post('/entry', async (c) => {\n\t*   const body = await c.req.bytes()\n\t* })\n\t* ```\n\t*/\n\tbytes() {\n\t\treturn this.#cachedBody(\"arrayBuffer\").then((buffer) => new Uint8Array(buffer));\n\t}\n\t/**\n\t* Parses the request body as a `Blob`.\n\t* @example\n\t* ```ts\n\t* app.post('/entry', async (c) => {\n\t*   const body = await c.req.blob();\n\t* });\n\t* ```\n\t* @see https://hono.dev/docs/api/request#blob\n\t*/\n\tblob() {\n\t\treturn this.#cachedBody(\"blob\");\n\t}\n\t/**\n\t* Parses the request body as `FormData`.\n\t* @example\n\t* ```ts\n\t* app.post('/entry', async (c) => {\n\t*   const body = await c.req.formData();\n\t* });\n\t* ```\n\t* @see https://hono.dev/docs/api/request#formdata\n\t*/\n\tformData() {\n\t\treturn this.#cachedBody(\"formData\");\n\t}\n\t/**\n\t* Adds validated data to the request.\n\t*\n\t* @param target - The target of the validation.\n\t* @param data - The validated data to add.\n\t*/\n\taddValidatedData(target, data) {\n\t\t(this.#validatedData ??= {})[target] = data;\n\t}\n\tvalid(target) {\n\t\treturn this.#validatedData?.[target];\n\t}\n\t/**\n\t* `.url` can get the request url strings.\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#url}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/about/me', (c) => {\n\t*   const url = c.req.url // `http://localhost:8787/about/me`\n\t*   ...\n\t* })\n\t* ```\n\t*/\n\tget url() {\n\t\treturn this.raw.url;\n\t}\n\t/**\n\t* `.method` can get the method name of the request.\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#method}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/about/me', (c) => {\n\t*   const method = c.req.method // `GET`\n\t* })\n\t* ```\n\t*/\n\tget method() {\n\t\treturn this.raw.method;\n\t}\n\tget [GET_MATCH_RESULT]() {\n\t\treturn this.#matchResult;\n\t}\n\t/**\n\t* `.matchedRoutes` can return a matched route in the handler\n\t*\n\t* @deprecated\n\t*\n\t* Use matchedRoutes helper defined in \"hono/route\" instead.\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#matchedroutes}\n\t*\n\t* @example\n\t* ```ts\n\t* app.use('*', async function logger(c, next) {\n\t*   await next()\n\t*   c.req.matchedRoutes.forEach(({ handler, method, path }, i) => {\n\t*     const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]')\n\t*     console.log(\n\t*       method,\n\t*       ' ',\n\t*       path,\n\t*       ' '.repeat(Math.max(10 - path.length, 0)),\n\t*       name,\n\t*       i === c.req.routeIndex ? '<- respond from here' : ''\n\t*     )\n\t*   })\n\t* })\n\t* ```\n\t*/\n\tget matchedRoutes() {\n\t\treturn this.#matchResult[0].map(([[, route]]) => route);\n\t}\n\t/**\n\t* `.routePath` can retrieve the path registered within the handler\n\t*\n\t* @deprecated\n\t*\n\t* Use routePath helper defined in \"hono/route\" instead.\n\t*\n\t* @see {@link https://hono.dev/docs/api/request#routepath}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/posts/:id', (c) => {\n\t*   return c.json({ path: c.req.routePath })\n\t* })\n\t* ```\n\t*/\n\tget routePath() {\n\t\treturn this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path;\n\t}\n};\n/**\n* Clones a HonoRequest's underlying raw Request object.\n*\n* This utility handles both consumed and unconsumed request bodies:\n* - If the request body hasn't been consumed, it uses the native `clone()` method\n* - If the request body has been consumed, it reconstructs a new Request using cached body data\n*\n* This is particularly useful when you need to:\n* - Process the same request body multiple times\n* - Pass requests to external services after validation\n*\n* @param req - The HonoRequest object to clone\n* @returns A Promise that resolves to a new Request object with the same properties\n* @throws {HTTPException} If the request body was consumed directly via `req.raw`\n*   without using HonoRequest methods (e.g., `req.json()`, `req.text()`), making it\n*   impossible to reconstruct the body from cache\n*\n* @example\n* ```ts\n* // Clone after consuming the body (e.g., after validation)\n* app.post('/forward',\n*   validator('json', (data) => data),\n*   async (c) => {\n*     const validated = c.req.valid('json')\n*     // Body has been consumed, but cloneRawRequest still works\n*     const clonedReq = await cloneRawRequest(c.req)\n*     return fetch('http://backend-service.com', clonedReq)\n*   }\n* )\n* ```\n*/\nconst cloneRawRequest = async (req) => {\n\tif (!req.raw.bodyUsed) return req.raw.clone();\n\tconst cacheKey = Object.keys(req.bodyCache)[0];\n\tif (!cacheKey) throw new HTTPException(500, { message: \"Cannot clone request: body was already consumed and not cached. Please use HonoRequest methods (e.g., req.json(), req.text()) instead of consuming req.raw directly.\" });\n\tlet body = await req[cacheKey]();\n\tconst headers = req.header();\n\tif (cacheKey === \"json\") {\n\t\tbody = JSON.stringify(body);\n\t\tdelete headers[\"content-length\"];\n\t} else if (body instanceof FormData) {\n\t\tdelete headers[\"content-type\"];\n\t\tdelete headers[\"content-length\"];\n\t}\n\tconst requestInit = {\n\t\tbody,\n\t\tcache: req.raw.cache,\n\t\tcredentials: req.raw.credentials,\n\t\theaders,\n\t\tintegrity: req.raw.integrity,\n\t\tkeepalive: req.raw.keepalive,\n\t\tmethod: req.method,\n\t\tmode: req.raw.mode,\n\t\tredirect: req.raw.redirect,\n\t\treferrer: req.raw.referrer,\n\t\treferrerPolicy: req.raw.referrerPolicy,\n\t\tsignal: req.raw.signal\n\t};\n\treturn new Request(req.url, requestInit);\n};\n//#endregion\nexport { HonoRequest, cloneRawRequest };\n","//#region src/utils/html.ts\n/**\n* @module\n* HTML utility.\n*/\nconst HtmlEscapedCallbackPhase = {\n\tStringify: 1,\n\tBeforeStream: 2,\n\tStream: 3\n};\nconst raw = (value, callbacks) => {\n\tconst escapedString = new String(value);\n\tescapedString.isEscaped = true;\n\tescapedString.callbacks = callbacks;\n\treturn escapedString;\n};\nconst escapeRe = /[&<>'\"]/;\nconst stringBufferToString = async (buffer, callbacks) => {\n\tlet str = \"\";\n\tcallbacks ||= [];\n\tconst resolvedBuffer = await Promise.all(buffer);\n\tfor (let i = resolvedBuffer.length - 1;; i--) {\n\t\tstr += resolvedBuffer[i];\n\t\ti--;\n\t\tif (i < 0) break;\n\t\tlet r = resolvedBuffer[i];\n\t\tif (typeof r === \"object\") callbacks.push(...r.callbacks || []);\n\t\tconst isEscaped = r.isEscaped;\n\t\tr = await (typeof r === \"object\" ? r.toString() : r);\n\t\tif (typeof r === \"object\") callbacks.push(...r.callbacks || []);\n\t\tif (r.isEscaped ?? isEscaped) str += r;\n\t\telse {\n\t\t\tconst buf = [str];\n\t\t\tescapeToBuffer(r, buf);\n\t\t\tstr = buf[0];\n\t\t}\n\t}\n\treturn raw(str, callbacks);\n};\nconst escapeToBuffer = (str, buffer) => {\n\tconst match = str.search(escapeRe);\n\tif (match === -1) {\n\t\tbuffer[0] += str;\n\t\treturn;\n\t}\n\tlet escape;\n\tlet index;\n\tlet lastIndex = 0;\n\tfor (index = match; index < str.length; index++) {\n\t\tswitch (str.charCodeAt(index)) {\n\t\t\tcase 34:\n\t\t\t\tescape = \"&quot;\";\n\t\t\t\tbreak;\n\t\t\tcase 39:\n\t\t\t\tescape = \"&#39;\";\n\t\t\t\tbreak;\n\t\t\tcase 38:\n\t\t\t\tescape = \"&amp;\";\n\t\t\t\tbreak;\n\t\t\tcase 60:\n\t\t\t\tescape = \"&lt;\";\n\t\t\t\tbreak;\n\t\t\tcase 62:\n\t\t\t\tescape = \"&gt;\";\n\t\t\t\tbreak;\n\t\t\tdefault: continue;\n\t\t}\n\t\tbuffer[0] += str.substring(lastIndex, index) + escape;\n\t\tlastIndex = index + 1;\n\t}\n\tbuffer[0] += str.substring(lastIndex, index);\n};\nconst resolveCallbackSync = (str) => {\n\tconst callbacks = str.callbacks;\n\tif (!callbacks?.length) return str;\n\tconst buffer = [str];\n\tconst context = {};\n\tcallbacks.forEach((c) => c({\n\t\tphase: HtmlEscapedCallbackPhase.Stringify,\n\t\tbuffer,\n\t\tcontext\n\t}));\n\treturn buffer[0];\n};\nconst resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {\n\tif (typeof str === \"object\" && !(str instanceof String)) {\n\t\tif (!(str instanceof Promise)) str = str.toString();\n\t\tif (str instanceof Promise) str = await str;\n\t}\n\tconst callbacks = str.callbacks;\n\tif (!callbacks?.length) return Promise.resolve(str);\n\tif (buffer) buffer[0] += str;\n\telse buffer = [str];\n\tconst resStr = Promise.all(callbacks.map((c) => c({\n\t\tphase,\n\t\tbuffer,\n\t\tcontext\n\t}))).then((res) => Promise.all(res.filter(Boolean).map((str) => resolveCallback(str, phase, false, context, buffer))).then(() => buffer[0]));\n\tif (preserveCallbacks) return raw(await resStr, callbacks);\n\telse return resStr;\n};\n//#endregion\nexport { HtmlEscapedCallbackPhase, escapeToBuffer, raw, resolveCallback, resolveCallbackSync, stringBufferToString };\n","import { HonoRequest } from \"./request.js\";\nimport { HtmlEscapedCallbackPhase, resolveCallback } from \"./utils/html.js\";\n//#region src/context.ts\nconst TEXT_PLAIN = \"text/plain; charset=UTF-8\";\nconst setDefaultContentType = (contentType, headers) => {\n\treturn {\n\t\t\"Content-Type\": contentType,\n\t\t...headers\n\t};\n};\nconst createResponseInstance = (body, init) => new Response(body, init);\nvar Context = class {\n\t#rawRequest;\n\t#req;\n\t/**\n\t* `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#env}\n\t*\n\t* @example\n\t* ```ts\n\t* // Environment object for Cloudflare Workers\n\t* app.get('*', async c => {\n\t*   const counter = c.env.COUNTER\n\t* })\n\t* ```\n\t*/\n\tenv = {};\n\t#var;\n\tfinalized = false;\n\t/**\n\t* `.error` can get the error object from the middleware if the Handler throws an error.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#error}\n\t*\n\t* @example\n\t* ```ts\n\t* app.use('*', async (c, next) => {\n\t*   await next()\n\t*   if (c.error) {\n\t*     // do something...\n\t*   }\n\t* })\n\t* ```\n\t*/\n\terror;\n\t#status;\n\t#executionCtx;\n\t#res;\n\t#layout;\n\t#renderer;\n\t#notFoundHandler;\n\t#preparedHeaders;\n\t#matchResult;\n\t#path;\n\t/**\n\t* Creates an instance of the Context class.\n\t*\n\t* @param req - The Request object.\n\t* @param options - Optional configuration options for the context.\n\t*/\n\tconstructor(req, options) {\n\t\tthis.#rawRequest = req;\n\t\tif (options) {\n\t\t\tthis.#executionCtx = options.executionCtx;\n\t\t\tthis.env = options.env;\n\t\t\tthis.#notFoundHandler = options.notFoundHandler;\n\t\t\tthis.#path = options.path;\n\t\t\tthis.#matchResult = options.matchResult;\n\t\t}\n\t}\n\t/**\n\t* `.req` is the instance of {@link HonoRequest}.\n\t*/\n\tget req() {\n\t\tthis.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult);\n\t\treturn this.#req;\n\t}\n\t/**\n\t* @see {@link https://hono.dev/docs/api/context#event}\n\t* The FetchEvent associated with the current request.\n\t*\n\t* @throws Will throw an error if the context does not have a FetchEvent.\n\t*/\n\tget event() {\n\t\tif (this.#executionCtx && \"respondWith\" in this.#executionCtx) return this.#executionCtx;\n\t\telse throw Error(\"This context has no FetchEvent\");\n\t}\n\t/**\n\t* @see {@link https://hono.dev/docs/api/context#executionctx}\n\t* The ExecutionContext associated with the current request.\n\t*\n\t* @throws Will throw an error if the context does not have an ExecutionContext.\n\t*/\n\tget executionCtx() {\n\t\tif (this.#executionCtx) return this.#executionCtx;\n\t\telse throw Error(\"This context has no ExecutionContext\");\n\t}\n\t/**\n\t* @see {@link https://hono.dev/docs/api/context#res}\n\t* The Response object for the current request.\n\t*/\n\tget res() {\n\t\treturn this.#res ||= createResponseInstance(null, { headers: this.#preparedHeaders ??= new Headers() });\n\t}\n\t/**\n\t* Sets the Response object for the current request.\n\t*\n\t* @param _res - The Response object to set.\n\t*/\n\tset res(_res) {\n\t\tif (this.#res && _res) {\n\t\t\t_res = createResponseInstance(_res.body, _res);\n\t\t\tfor (const [k, v] of this.#res.headers.entries()) {\n\t\t\t\tif (k === \"content-type\") continue;\n\t\t\t\tif (k === \"set-cookie\") {\n\t\t\t\t\tconst cookies = this.#res.headers.getSetCookie();\n\t\t\t\t\t_res.headers.delete(\"set-cookie\");\n\t\t\t\t\tfor (const cookie of cookies) _res.headers.append(\"set-cookie\", cookie);\n\t\t\t\t} else _res.headers.set(k, v);\n\t\t\t}\n\t\t}\n\t\tthis.#res = _res;\n\t\tthis.finalized = true;\n\t}\n\t/**\n\t* `.render()` can create a response within a layout.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#render-setrenderer}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/', (c) => {\n\t*   return c.render('Hello!')\n\t* })\n\t* ```\n\t*/\n\trender = (...args) => {\n\t\tthis.#renderer ??= (content) => this.html(content);\n\t\treturn this.#renderer(...args);\n\t};\n\t/**\n\t* Sets the layout for the response.\n\t*\n\t* @param layout - The layout to set.\n\t* @returns The layout function.\n\t*/\n\tsetLayout = (layout) => this.#layout = layout;\n\t/**\n\t* Gets the current layout for the response.\n\t*\n\t* @returns The current layout function.\n\t*/\n\tgetLayout = () => this.#layout;\n\t/**\n\t* `.setRenderer()` can set the layout in the custom middleware.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#render-setrenderer}\n\t*\n\t* @example\n\t* ```tsx\n\t* app.use('*', async (c, next) => {\n\t*   c.setRenderer((content) => {\n\t*     return c.html(\n\t*       <html>\n\t*         <body>\n\t*           <p>{content}</p>\n\t*         </body>\n\t*       </html>\n\t*     )\n\t*   })\n\t*   await next()\n\t* })\n\t* ```\n\t*/\n\tsetRenderer = (renderer) => {\n\t\tthis.#renderer = renderer;\n\t};\n\t/**\n\t* `.header()` can set headers.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#header}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/welcome', (c) => {\n\t*   // Set headers\n\t*   c.header('X-Message', 'Hello!')\n\t*   c.header('Content-Type', 'text/plain')\n\t*\n\t*   // Append multiple headers using the append option (e.g. Vary)\n\t*   c.header('Vary', 'Accept-Encoding', { append: true })\n\t*   c.header('Vary', 'User-Agent', { append: true })\n\t*\n\t*   return c.body('Thank you for coming')\n\t* })\n\t* ```\n\t*/\n\theader = (name, value, options) => {\n\t\tif (this.finalized) this.#res = createResponseInstance(this.#res.body, this.#res);\n\t\tconst headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers();\n\t\tif (value === void 0) headers.delete(name);\n\t\telse if (options?.append) headers.append(name, value);\n\t\telse headers.set(name, value);\n\t};\n\tstatus = (status) => {\n\t\tthis.#status = status;\n\t};\n\t/**\n\t* `.set()` can set the value specified by the key.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#set-get}\n\t*\n\t* @example\n\t* ```ts\n\t* app.use('*', async (c, next) => {\n\t*   c.set('message', 'Hono is hot!!')\n\t*   await next()\n\t* })\n\t* ```\n\t*/\n\tset = (key, value) => {\n\t\tthis.#var ??= /* @__PURE__ */ new Map();\n\t\tthis.#var.set(key, value);\n\t};\n\t/**\n\t* `.get()` can use the value specified by the key.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#set-get}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/', (c) => {\n\t*   const message = c.get('message')\n\t*   return c.text(`The message is \"${message}\"`)\n\t* })\n\t* ```\n\t*/\n\tget = (key) => {\n\t\treturn this.#var ? this.#var.get(key) : void 0;\n\t};\n\t/**\n\t* `.var` can access the value of a variable.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#var}\n\t*\n\t* @example\n\t* ```ts\n\t* const result = c.var.client.oneMethod()\n\t* ```\n\t*/\n\tget var() {\n\t\tif (!this.#var) return {};\n\t\treturn Object.fromEntries(this.#var);\n\t}\n\t#newResponse(data, arg, headers) {\n\t\tlet responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders;\n\t\tif (typeof arg === \"object\" && arg.headers) {\n\t\t\tresponseHeaders ??= new Headers();\n\t\t\tfor (const [key, value] of new Headers(arg.headers)) if (key === \"set-cookie\") responseHeaders.append(key, value);\n\t\t\telse responseHeaders.set(key, value);\n\t\t}\n\t\tif (headers) {\n\t\t\tif (!responseHeaders) {\n\t\t\t\tlet count = 0;\n\t\t\t\tfor (const k in headers) if (++count > 1 || typeof headers[k] !== \"string\") {\n\t\t\t\t\tresponseHeaders = new Headers();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (responseHeaders) for (const k in headers) {\n\t\t\t\tconst v = headers[k];\n\t\t\t\tif (typeof v === \"string\") responseHeaders.set(k, v);\n\t\t\t\telse {\n\t\t\t\t\tresponseHeaders.delete(k);\n\t\t\t\t\tfor (const v2 of v) responseHeaders.append(k, v2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst status = typeof arg === \"number\" ? arg : arg?.status ?? this.#status;\n\t\treturn createResponseInstance(data, {\n\t\t\tstatus,\n\t\t\theaders: responseHeaders ?? headers\n\t\t});\n\t}\n\tnewResponse = (...args) => this.#newResponse(...args);\n\t/**\n\t* `.body()` can return the HTTP response.\n\t* You can set headers with `.header()` and set HTTP status code with `.status`.\n\t* This can also be set in `.text()`, `.json()` and so on.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#body}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/welcome', (c) => {\n\t*   // Set headers\n\t*   c.header('X-Message', 'Hello!')\n\t*   c.header('Content-Type', 'text/plain')\n\t*   // Set HTTP status code\n\t*   c.status(201)\n\t*\n\t*   // Return the response body\n\t*   return c.body('Thank you for coming')\n\t* })\n\t* ```\n\t*/\n\tbody = (data, arg, headers) => this.#newResponse(data, arg, headers);\n\t/**\n\t* `.text()` can render text as `Content-Type:text/plain`.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#text}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/say', (c) => {\n\t*   return c.text('Hello!')\n\t* })\n\t* ```\n\t*/\n\ttext = (text, arg, headers) => {\n\t\treturn !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse(text, arg, setDefaultContentType(TEXT_PLAIN, headers));\n\t};\n\t/**\n\t* `.json()` can render JSON as `Content-Type:application/json`.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#json}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/api', (c) => {\n\t*   return c.json({ message: 'Hello!' })\n\t* })\n\t* ```\n\t*/\n\tjson = (object, arg, headers) => {\n\t\treturn this.#newResponse(JSON.stringify(object), arg, setDefaultContentType(\"application/json\", headers));\n\t};\n\thtml = (html, arg, headers) => {\n\t\tconst res = (html) => this.#newResponse(html, arg, setDefaultContentType(\"text/html; charset=UTF-8\", headers));\n\t\treturn typeof html === \"object\" ? resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html);\n\t};\n\t/**\n\t* `.redirect()` can Redirect, default status code is 302.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#redirect}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/redirect', (c) => {\n\t*   return c.redirect('/')\n\t* })\n\t* app.get('/redirect-permanently', (c) => {\n\t*   return c.redirect('/', 301)\n\t* })\n\t* ```\n\t*/\n\tredirect = (location, status) => {\n\t\tconst locationString = String(location);\n\t\tthis.header(\"Location\", !/[^\\x00-\\xFF]/.test(locationString) ? locationString : encodeURI(locationString));\n\t\treturn this.newResponse(null, status ?? 302);\n\t};\n\t/**\n\t* `.notFound()` can return the Not Found Response.\n\t*\n\t* @see {@link https://hono.dev/docs/api/context#notfound}\n\t*\n\t* @example\n\t* ```ts\n\t* app.get('/notfound', (c) => {\n\t*   return c.notFound()\n\t* })\n\t* ```\n\t*/\n\tnotFound = () => {\n\t\tthis.#notFoundHandler ??= () => createResponseInstance();\n\t\treturn this.#notFoundHandler(this);\n\t};\n};\n//#endregion\nexport { Context, TEXT_PLAIN };\n","//#region src/compose.ts\n/**\n* Compose middleware functions into a single function based on `koa-compose` package.\n*\n* @template E - The environment type.\n*\n* @param {[[Function, unknown], unknown][] | [[Function]][]} middleware - An array of middleware functions and their corresponding parameters.\n* @param {ErrorHandler<E>} [onError] - An optional error handler function.\n* @param {NotFoundHandler<E>} [onNotFound] - An optional not-found handler function.\n*\n* @returns {(context: Context, next?: Next) => Promise<Context>} - A composed middleware function.\n*/\nconst compose = (middleware, onError, onNotFound) => {\n\treturn (context, next) => {\n\t\tlet index = -1;\n\t\treturn dispatch(0);\n\t\t/**\n\t\t* Dispatch the middleware functions.\n\t\t*\n\t\t* @param {number} i - The current index in the middleware array.\n\t\t*\n\t\t* @returns {Promise<Context>} - A promise that resolves to the context.\n\t\t*/\n\t\tasync function dispatch(i) {\n\t\t\tif (i <= index) throw new Error(\"next() called multiple times\");\n\t\t\tindex = i;\n\t\t\tlet res;\n\t\t\tlet isError = false;\n\t\t\tlet handler;\n\t\t\tif (middleware[i]) {\n\t\t\t\thandler = middleware[i][0][0];\n\t\t\t\tcontext.req.routeIndex = i;\n\t\t\t} else handler = i === middleware.length && next || void 0;\n\t\t\tif (handler) try {\n\t\t\t\tres = await handler(context, () => dispatch(i + 1));\n\t\t\t} catch (err) {\n\t\t\t\tif (err instanceof Error && onError) {\n\t\t\t\t\tcontext.error = err;\n\t\t\t\t\tres = await onError(err, context);\n\t\t\t\t\tisError = true;\n\t\t\t\t} else throw err;\n\t\t\t}\n\t\t\telse if (context.finalized === false && onNotFound) res = await onNotFound(context);\n\t\t\tif (res && (context.finalized === false || isError)) context.res = res;\n\t\t\treturn context;\n\t\t}\n\t};\n};\n//#endregion\nexport { compose };\n","//#region src/router.ts\n/**\n* @module\n* This module provides types definitions and variables for the routers.\n*/\n/**\n* Constant representing all HTTP methods in uppercase.\n*/\nconst METHOD_NAME_ALL = \"ALL\";\n/**\n* Constant representing all HTTP methods in lowercase.\n*/\nconst METHOD_NAME_ALL_LOWERCASE = \"all\";\n/**\n* Array of supported HTTP methods.\n*/\nconst METHODS = [\n\t\"get\",\n\t\"post\",\n\t\"put\",\n\t\"delete\",\n\t\"options\",\n\t\"patch\",\n\t\"query\"\n];\n/**\n* Error message indicating that a route cannot be added because the matcher is already built.\n*/\nconst MESSAGE_MATCHER_IS_ALREADY_BUILT = \"Can not add a route since the matcher is already built.\";\n/**\n* Error class representing an unsupported path error.\n*/\nvar UnsupportedPathError = class extends Error {};\n//#endregion\nexport { MESSAGE_MATCHER_IS_ALREADY_BUILT, METHODS, METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE, UnsupportedPathError };\n","//#region src/utils/constants.ts\n/**\n* Constant used to mark a composed handler.\n*/\nconst COMPOSED_HANDLER = \"__COMPOSED_HANDLER\";\n//#endregion\nexport { COMPOSED_HANDLER };\n","import { compose } from \"./compose.js\";\nimport { getPath, getPathNoStrict, mergePath } from \"./utils/url.js\";\nimport { Context } from \"./context.js\";\nimport { METHODS } from \"./router.js\";\nimport { COMPOSED_HANDLER } from \"./utils/constants.js\";\n//#region src/hono-base.ts\n/**\n* @module\n* This module is the base module for the Hono object.\n*/\nconst notFoundHandler = (c) => {\n\treturn c.text(\"404 Not Found\", 404);\n};\nconst errorHandler = (err, c) => {\n\tif (\"getResponse\" in err) {\n\t\tconst res = err.getResponse();\n\t\treturn c.newResponse(res.body, res);\n\t}\n\tconsole.error(err);\n\treturn c.text(\"Internal Server Error\", 500);\n};\nvar Hono = class Hono {\n\tget;\n\tpost;\n\tput;\n\tdelete;\n\toptions;\n\tpatch;\n\tquery;\n\tall;\n\ton;\n\tuse;\n\trouter;\n\tgetPath;\n\t_basePath = \"/\";\n\t#path = \"/\";\n\troutes = [];\n\tconstructor(options = {}) {\n\t\t[...METHODS, \"all\"].forEach((method) => {\n\t\t\tthis[method] = (args1, ...args) => {\n\t\t\t\tconst methodName = method.toUpperCase();\n\t\t\t\tif (typeof args1 === \"string\") this.#path = args1;\n\t\t\t\telse this.#addRoute(methodName, this.#path, args1);\n\t\t\t\targs.forEach((handler) => {\n\t\t\t\t\tthis.#addRoute(methodName, this.#path, handler);\n\t\t\t\t});\n\t\t\t\treturn this;\n\t\t\t};\n\t\t});\n\t\tthis.on = (method, path, ...handlers) => {\n\t\t\tfor (const p of [path].flat()) {\n\t\t\t\tthis.#path = p;\n\t\t\t\tfor (const m of [method].flat()) {\n\t\t\t\t\tconst methodName = m.toUpperCase();\n\t\t\t\t\tfor (const handler of handlers) this.#addRoute(methodName, this.#path, handler);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\tthis.use = (arg1, ...handlers) => {\n\t\t\tif (typeof arg1 === \"string\") this.#path = arg1;\n\t\t\telse {\n\t\t\t\tthis.#path = \"*\";\n\t\t\t\thandlers.unshift(arg1);\n\t\t\t}\n\t\t\thandlers.forEach((handler) => {\n\t\t\t\tthis.#addRoute(\"ALL\", this.#path, handler);\n\t\t\t});\n\t\t\treturn this;\n\t\t};\n\t\tconst { strict, ...optionsWithoutStrict } = options;\n\t\tObject.assign(this, optionsWithoutStrict);\n\t\tthis.getPath = strict ?? true ? options.getPath ?? getPath : getPathNoStrict;\n\t}\n\t#clone() {\n\t\tconst clone = new Hono({\n\t\t\trouter: this.router,\n\t\t\tgetPath: this.getPath\n\t\t});\n\t\tclone.errorHandler = this.errorHandler;\n\t\tclone.#notFoundHandler = this.#notFoundHandler;\n\t\tclone.routes = this.routes;\n\t\treturn clone;\n\t}\n\t#notFoundHandler = notFoundHandler;\n\terrorHandler = errorHandler;\n\t/**\n\t* `.route()` allows grouping other Hono instance in routes.\n\t*\n\t* @see {@link https://hono.dev/docs/api/routing#grouping}\n\t*\n\t* @param {string} path - base Path\n\t* @param {Hono} app - other Hono instance\n\t* @returns {Hono} routed Hono instance\n\t*\n\t* @example\n\t* ```ts\n\t* const app = new Hono()\n\t* const app2 = new Hono()\n\t*\n\t* app2.get(\"/user\", (c) => c.text(\"user\"))\n\t* app.route(\"/api\", app2) // GET /api/user\n\t* ```\n\t*/\n\troute(path, app) {\n\t\tconst subApp = this.basePath(path);\n\t\tapp.routes.map((r) => {\n\t\t\tlet handler;\n\t\t\tif (app.errorHandler === errorHandler) handler = r.handler;\n\t\t\telse {\n\t\t\t\thandler = async (c, next) => (await compose([], app.errorHandler)(c, () => r.handler(c, next))).res;\n\t\t\t\thandler[COMPOSED_HANDLER] = r.handler;\n\t\t\t}\n\t\t\tsubApp.#addRoute(r.method, r.path, handler, r.basePath);\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t* `.basePath()` allows base paths to be specified.\n\t*\n\t* @see {@link https://hono.dev/docs/api/routing#base-path}\n\t*\n\t* @param {string} path - base Path\n\t* @returns {Hono} changed Hono instance\n\t*\n\t* @example\n\t* ```ts\n\t* const api = new Hono().basePath('/api')\n\t* ```\n\t*/\n\tbasePath(path) {\n\t\tconst subApp = this.#clone();\n\t\tsubApp._basePath = mergePath(this._basePath, path);\n\t\treturn subApp;\n\t}\n\t/**\n\t* `.onError()` handles an error and returns a customized Response.\n\t*\n\t* @see {@link https://hono.dev/docs/api/hono#error-handling}\n\t*\n\t* @param {ErrorHandler} handler - request Handler for error\n\t* @returns {Hono} changed Hono instance\n\t*\n\t* @example\n\t* ```ts\n\t* app.onError((err, c) => {\n\t*   console.error(`${err}`)\n\t*   return c.text('Custom Error Message', 500)\n\t* })\n\t* ```\n\t*/\n\tonError = (handler) => {\n\t\tthis.errorHandler = handler;\n\t\treturn this;\n\t};\n\t/**\n\t* `.notFound()` allows you to customize a Not Found Response.\n\t*\n\t* @see {@link https://hono.dev/docs/api/hono#not-found}\n\t*\n\t* @param {NotFoundHandler} handler - request handler for not-found\n\t* @returns {Hono} changed Hono instance\n\t*\n\t* @example\n\t* ```ts\n\t* app.notFound((c) => {\n\t*   return c.text('Custom 404 Message', 404)\n\t* })\n\t* ```\n\t*/\n\tnotFound = (handler) => {\n\t\tthis.#notFoundHandler = handler;\n\t\treturn this;\n\t};\n\t/**\n\t* `.mount()` allows you to mount applications built with other frameworks into your Hono application.\n\t*\n\t* @deprecated Use `mount()` from `hono/mount` instead. `.mount()` will be removed in v5.\n\t*\n\t* @see {@link https://hono.dev/docs/api/hono#mount}\n\t*\n\t* @param {string} path - base Path\n\t* @param {Function} applicationHandler - other Request Handler\n\t* @param {MountOptions} [options] - options of `.mount()`\n\t* @returns {Hono} mounted Hono instance\n\t*\n\t* @example\n\t* ```ts\n\t* import { Router as IttyRouter } from 'itty-router'\n\t* import { Hono } from 'hono'\n\t* // Create itty-router application\n\t* const ittyRouter = IttyRouter()\n\t* // GET /itty-router/hello\n\t* ittyRouter.get('/hello', () => new Response('Hello from itty-router'))\n\t*\n\t* const app = new Hono()\n\t* app.mount('/itty-router', ittyRouter.handle)\n\t* ```\n\t*\n\t* @example\n\t* ```ts\n\t* const app = new Hono()\n\t* // Send the request to another application without modification.\n\t* app.mount('/app', anotherApp, {\n\t*   replaceRequest: (req) => req,\n\t* })\n\t* ```\n\t*/\n\tmount(path, applicationHandler, options) {\n\t\tlet replaceRequest;\n\t\tlet optionHandler;\n\t\tif (options) {\n\t\t\tif (typeof options === \"function\") optionHandler = options;\n\t\t\telse {\n\t\t\t\toptionHandler = options.optionHandler;\n\t\t\t\tif (options.replaceRequest === false) replaceRequest = (request) => request;\n\t\t\t\telse replaceRequest = options.replaceRequest;\n\t\t\t}\n\t\t}\n\t\tconst getOptions = optionHandler ? (c) => {\n\t\t\tconst options = optionHandler(c);\n\t\t\treturn Array.isArray(options) ? options : [options];\n\t\t} : (c) => {\n\t\t\tlet executionContext = void 0;\n\t\t\ttry {\n\t\t\t\texecutionContext = c.executionCtx;\n\t\t\t} catch {}\n\t\t\treturn [c.env, executionContext];\n\t\t};\n\t\treplaceRequest ||= (() => {\n\t\t\tconst mergedPath = mergePath(this._basePath, path);\n\t\t\tconst pathPrefixLength = mergedPath === \"/\" ? 0 : mergedPath.length;\n\t\t\treturn (request) => {\n\t\t\t\tconst url = new URL(request.url);\n\t\t\t\turl.pathname = this.getPath(request).slice(pathPrefixLength) || \"/\";\n\t\t\t\treturn new Request(url, request);\n\t\t\t};\n\t\t})();\n\t\tconst handler = async (c, next) => {\n\t\t\tconst res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c));\n\t\t\tif (res) return res;\n\t\t\tawait next();\n\t\t};\n\t\tthis.#addRoute(\"ALL\", mergePath(path, \"*\"), handler);\n\t\treturn this;\n\t}\n\t#addRoute(method, path, handler, baseRoutePath) {\n\t\tpath = mergePath(this._basePath, path);\n\t\tconst r = {\n\t\t\tbasePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,\n\t\t\tpath,\n\t\t\tmethod,\n\t\t\thandler\n\t\t};\n\t\tthis.router.add(method, path, [handler, r]);\n\t\tthis.routes.push(r);\n\t}\n\t#handleError(err, c) {\n\t\tif (err instanceof Error) return this.errorHandler(err, c);\n\t\tthrow err;\n\t}\n\t#dispatch(request, executionCtx, env, method) {\n\t\tif (method === \"HEAD\") return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, \"GET\")))();\n\t\tconst path = this.getPath(request, { env });\n\t\tconst matchResult = this.router.match(method, path);\n\t\tconst c = new Context(request, {\n\t\t\tpath,\n\t\t\tmatchResult,\n\t\t\tenv,\n\t\t\texecutionCtx,\n\t\t\tnotFoundHandler: this.#notFoundHandler\n\t\t});\n\t\tif (matchResult[0].length === 1) {\n\t\t\tlet res;\n\t\t\ttry {\n\t\t\t\tres = matchResult[0][0][0][0](c, async () => {\n\t\t\t\t\tc.res = await this.#notFoundHandler(c);\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\treturn this.#handleError(err, c);\n\t\t\t}\n\t\t\treturn res instanceof Promise ? res.then((resolved) => resolved || (c.finalized ? c.res : this.#notFoundHandler(c))).catch((err) => this.#handleError(err, c)) : res ?? this.#notFoundHandler(c);\n\t\t}\n\t\tconst composed = compose(matchResult[0], this.errorHandler, this.#notFoundHandler);\n\t\treturn (async () => {\n\t\t\ttry {\n\t\t\t\tconst context = await composed(c);\n\t\t\t\tif (!context.finalized) throw new Error(\"Context is not finalized. Did you forget to return a Response object or `await next()`?\");\n\t\t\t\treturn context.res;\n\t\t\t} catch (err) {\n\t\t\t\treturn this.#handleError(err, c);\n\t\t\t}\n\t\t})();\n\t}\n\t/**\n\t* `.fetch()` will be entry point of your app.\n\t*\n\t* @see {@link https://hono.dev/docs/api/hono#fetch}\n\t*\n\t* @param {Request} request - request Object of request\n\t* @param {Env} env - env Object\n\t* @param {ExecutionContext} executionCtx - context of execution\n\t* @returns {Response | Promise<Response>} response of request\n\t*\n\t*/\n\tfetch = (request, ...rest) => {\n\t\treturn this.#dispatch(request, rest[1], rest[0], request.method);\n\t};\n\t/**\n\t* `.request()` is a useful method for testing.\n\t* You can pass a URL or pathname to send a GET request.\n\t* app will return a Response object.\n\t* ```ts\n\t* test('GET /hello is ok', async () => {\n\t*   const res = await app.request('/hello')\n\t*   expect(res.status).toBe(200)\n\t* })\n\t* ```\n\t* @see https://hono.dev/docs/api/hono#request\n\t*/\n\trequest = (input, requestInit, Env, executionCtx) => {\n\t\tif (input instanceof Request) return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx);\n\t\tinput = input.toString();\n\t\treturn this.fetch(new Request(/^https?:\\/\\//.test(input) ? input : `http://localhost${mergePath(\"/\", input)}`, requestInit), Env, executionCtx);\n\t};\n\t/**\n\t* `.fire()` automatically adds a global fetch event listener.\n\t* This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers.\n\t* @deprecated\n\t* Use `fire` from `hono/service-worker` instead.\n\t* ```ts\n\t* import { Hono } from 'hono'\n\t* import { fire } from 'hono/service-worker'\n\t*\n\t* const app = new Hono()\n\t* // ...\n\t* fire(app)\n\t* ```\n\t* @see https://hono.dev/docs/api/hono#fire\n\t* @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API\n\t* @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/\n\t*/\n\tfire = () => {\n\t\taddEventListener(\"fetch\", (event) => {\n\t\t\tevent.respondWith(this.#dispatch(event.request, event, void 0, event.request.method));\n\t\t});\n\t};\n};\n//#endregion\nexport { Hono as HonoBase };\n","//#region src/router/utils.ts\nconst createNullObject = () => Object.create(null);\n//#endregion\nexport { createNullObject };\n","import \"../../router.js\";\n//#region src/router/reg-exp-router/matcher.ts\nconst emptyParam = [];\nfunction match(method, path) {\n\tconst matchers = this.buildAllMatchers();\n\tconst match = ((method, path) => {\n\t\tconst matcher = matchers[method] || matchers[\"ALL\"];\n\t\tconst staticMatch = matcher[2][path];\n\t\tif (staticMatch) return staticMatch;\n\t\tconst match = path.match(matcher[0]);\n\t\tif (!match) return [[], emptyParam];\n\t\tconst index = match.indexOf(\"\", 1);\n\t\treturn [matcher[1][index], match];\n\t});\n\tthis.match = match;\n\treturn match(method, path);\n}\n//#endregion\nexport { emptyParam, match };\n","import { createNullObject } from \"../utils.js\";\n//#region src/router/reg-exp-router/node.ts\nconst LABEL_REG_EXP_STR = \"[^/]+\";\nconst ONLY_WILDCARD_REG_EXP_STR = \".*\";\nconst TAIL_WILDCARD_REG_EXP_STR = \"(?:|/.*)\";\nconst PATH_ERROR = Symbol();\nconst regExpMetaChars = /* @__PURE__ */ new Set(\".\\\\+*[^]$()\");\n/**\n* Sort order:\n* 1. literal\n* 2. special pattern (e.g. :label{[0-9]+})\n* 3. common label pattern (e.g. :label)\n* 4. wildcard\n*/\nfunction compareKey(a, b) {\n\tif (a.length === 1) return b.length === 1 ? a < b ? -1 : 1 : -1;\n\tif (b.length === 1) return 1;\n\tif (a === \".*\" || a === \"(?:|/.*)\") return b === \"(?:|/.*)\" ? -1 : 1;\n\telse if (b === \".*\" || b === \"(?:|/.*)\") return -1;\n\tif (a === \"[^/]+\") return 1;\n\telse if (b === \"[^/]+\") return -1;\n\treturn a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;\n}\nvar Node = class Node {\n\t#index;\n\t#varIndex;\n\t#children = createNullObject();\n\tinsert(tokens, index, paramMap, context, isStatic) {\n\t\tlet node = this;\n\t\tfor (let i = 0, len = tokens.length; i < len; i++) {\n\t\t\tconst token = tokens[i];\n\t\t\tconst pattern = token.length === 1 ? token === \"*\" ? i === len - 1 ? [\n\t\t\t\t\"\",\n\t\t\t\t\"\",\n\t\t\t\t\".*\"\n\t\t\t] : [\n\t\t\t\t\"\",\n\t\t\t\t\"\",\n\t\t\t\tLABEL_REG_EXP_STR\n\t\t\t] : null : token === \"/*\" ? [\n\t\t\t\t\"\",\n\t\t\t\t\"\",\n\t\t\t\tTAIL_WILDCARD_REG_EXP_STR\n\t\t\t] : token.match(/^\\:([^\\{\\}]+)(?:\\{(.+)\\})?$/);\n\t\t\tlet nextNode;\n\t\t\tif (pattern) {\n\t\t\t\tconst name = pattern[1];\n\t\t\t\tlet regexpStr = pattern[2] || \"[^/]+\";\n\t\t\t\tif (name && pattern[2]) {\n\t\t\t\t\tif (regexpStr === \".*\") throw PATH_ERROR;\n\t\t\t\t\tregexpStr = regexpStr.replace(/^\\((?!\\?:)(?=[^)]+\\)$)/, \"(?:\");\n\t\t\t\t\tif (/\\((?!\\?:)/.test(regexpStr)) throw PATH_ERROR;\n\t\t\t\t\tif (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) throw PATH_ERROR;\n\t\t\t\t}\n\t\t\t\tnextNode = node.#children[regexpStr];\n\t\t\t\tif (!nextNode) {\n\t\t\t\t\tif (regexpStr !== \".*\" && regexpStr !== \"(?:|/.*)\") {\n\t\t\t\t\t\tfor (const k in node.#children) if ((regexpStr.length > 1 || k.length > 1) && k !== \".*\" && k !== \"(?:|/.*)\") throw PATH_ERROR;\n\t\t\t\t\t}\n\t\t\t\t\tnextNode = node.#children[regexpStr] = new Node();\n\t\t\t\t}\n\t\t\t\tif (name !== \"\") {\n\t\t\t\t\tnextNode.#varIndex ??= context.varIndex++;\n\t\t\t\t\tparamMap.push([name, nextNode.#varIndex]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnextNode = node.#children[token];\n\t\t\t\tif (!nextNode) {\n\t\t\t\t\tfor (const k in node.#children) if (k.length > 1 && k !== \".*\" && k !== \"(?:|/.*)\") throw PATH_ERROR;\n\t\t\t\t\tnextNode = node.#children[token] = new Node();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode = nextNode;\n\t\t}\n\t\tif (node.#index !== void 0) throw PATH_ERROR;\n\t\tnode.#index = isStatic ? -1 : index;\n\t}\n\tbuildRegExpStr() {\n\t\tconst strList = Object.keys(this.#children).sort(compareKey).map((k) => {\n\t\t\tconst c = this.#children[k];\n\t\t\tconst childStr = c.buildRegExpStr();\n\t\t\treturn childStr === \"\" ? \"\" : (typeof c.#varIndex === \"number\" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\\\${k}` : k) + childStr;\n\t\t}).filter(Boolean);\n\t\tif (typeof this.#index === \"number\" && this.#index !== -1) strList.unshift(`#${this.#index}`);\n\t\tif (strList.length === 0) return \"\";\n\t\tif (strList.length === 1) return strList[0];\n\t\treturn \"(?:\" + strList.join(\"|\") + \")\";\n\t}\n};\n//#endregion\nexport { LABEL_REG_EXP_STR, Node, ONLY_WILDCARD_REG_EXP_STR, PATH_ERROR, TAIL_WILDCARD_REG_EXP_STR };\n","import { createNullObject } from \"../utils.js\";\nimport { Node } from \"./node.js\";\n//#region src/router/reg-exp-router/trie.ts\nvar Trie = class {\n\t#context = { varIndex: 0 };\n\t#root = new Node();\n\t#index = 0;\n\tpaths = createNullObject();\n\tinsert(path, isStatic) {\n\t\tif (isStatic) {\n\t\t\tthis.#root.insert(path.split(\"\"), 0, [], this.#context, true);\n\t\t\treturn;\n\t\t}\n\t\tconst paramAssoc = [];\n\t\tconst groups = [];\n\t\tlet markedPath = path;\n\t\tfor (let i = 0;;) {\n\t\t\tlet replaced = false;\n\t\t\tmarkedPath = markedPath.replace(/\\{[^}]+\\}/g, (m) => {\n\t\t\t\tconst mark = `@\\\\${i}`;\n\t\t\t\tgroups[i] = [mark, m];\n\t\t\t\ti++;\n\t\t\t\treplaced = true;\n\t\t\t\treturn mark;\n\t\t\t});\n\t\t\tif (!replaced) break;\n\t\t}\n\t\t/**\n\t\t*  - pattern (:label, :label{0-9]+}, ...)\n\t\t*  - /* wildcard\n\t\t*  - character\n\t\t*/\n\t\tconst tokens = markedPath.match(/(?::[^\\/]+)|(?:\\/\\*$)|./g) || [];\n\t\tfor (let i = groups.length - 1; i >= 0; i--) {\n\t\t\tconst [mark] = groups[i];\n\t\t\tfor (let j = tokens.length - 1; j >= 0; j--) if (tokens[j].indexOf(mark) !== -1) {\n\t\t\t\ttokens[j] = tokens[j].replace(mark, groups[i][1]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.#root.insert(tokens, this.#index, paramAssoc, this.#context, false);\n\t\tthis.paths[path] = [this.#index++, paramAssoc];\n\t}\n\tbuildRegExp() {\n\t\tlet regexp = this.#root.buildRegExpStr();\n\t\tif (regexp === \"\") return [\n\t\t\t/^$/,\n\t\t\t[],\n\t\t\t[]\n\t\t];\n\t\tlet captureIndex = 0;\n\t\tconst indexReplacementMap = [];\n\t\tconst paramReplacementMap = [];\n\t\tregexp = regexp.replace(/#(\\d+)|@(\\d+)|\\.\\*\\$/g, (_, handlerIndex, paramIndex) => {\n\t\t\tif (handlerIndex !== void 0) {\n\t\t\t\tindexReplacementMap[++captureIndex] = Number(handlerIndex);\n\t\t\t\treturn \"$()\";\n\t\t\t}\n\t\t\tif (paramIndex !== void 0) {\n\t\t\t\tparamReplacementMap[Number(paramIndex)] = ++captureIndex;\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\treturn \"\";\n\t\t});\n\t\treturn [\n\t\t\tnew RegExp(`^${regexp}`),\n\t\t\tindexReplacementMap,\n\t\t\tparamReplacementMap\n\t\t];\n\t}\n};\n//#endregion\nexport { Trie };\n","import { checkOptionalParameter } from \"../../utils/url.js\";\nimport { MESSAGE_MATCHER_IS_ALREADY_BUILT, UnsupportedPathError } from \"../../router.js\";\nimport { createNullObject } from \"../utils.js\";\nimport { emptyParam, match } from \"./matcher.js\";\nimport { LABEL_REG_EXP_STR, PATH_ERROR, TAIL_WILDCARD_REG_EXP_STR } from \"./node.js\";\nimport { Trie } from \"./trie.js\";\n//#region src/router/reg-exp-router/router.ts\nlet wildcardRegExpCache = createNullObject();\nfunction buildWildcardRegExp(path) {\n\treturn wildcardRegExpCache[path] ??= new RegExp(`^${path.replace(/\\/:[^/{}]+(?:\\{\\[\\^\\/]\\+})?(?=[/{]|$)|\\/?\\*$|([.\\\\+*[^\\]$()?{}|])/g, (match, metaChar) => metaChar ? `\\\\${metaChar}` : match === \"/*\" ? TAIL_WILDCARD_REG_EXP_STR : match === \"*\" ? \".*\" : `/:${LABEL_REG_EXP_STR}`)}$`);\n}\nfunction findMiddleware(middleware, path) {\n\tfor (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path)) return [...middleware[k]];\n}\nvar RegExpRouter = class {\n\tname = \"RegExpRouter\";\n\t#middleware;\n\t#routes;\n\t#tries;\n\tconstructor() {\n\t\tthis.#middleware = { [\"ALL\"]: createNullObject() };\n\t\tthis.#routes = { [\"ALL\"]: createNullObject() };\n\t\tthis.#tries = { [\"ALL\"]: new Trie() };\n\t}\n\t#insertPath(method, path) {\n\t\ttry {\n\t\t\tthis.#tries[method].insert(path, !/\\*|\\/:/.test(path));\n\t\t} catch (e) {\n\t\t\tthrow e === PATH_ERROR ? new UnsupportedPathError(path) : e;\n\t\t}\n\t}\n\tadd(method, path, handler) {\n\t\tconst middleware = this.#middleware;\n\t\tconst routes = this.#routes;\n\t\tif (!middleware) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);\n\t\tif (!middleware[method]) {\n\t\t\tthis.#tries[method] = new Trie();\n\t\t\tfor (const handlerMap of [middleware, routes]) {\n\t\t\t\thandlerMap[method] = createNullObject();\n\t\t\t\tfor (const p in handlerMap[\"ALL\"]) {\n\t\t\t\t\thandlerMap[method][p] = [...handlerMap[\"ALL\"][p]];\n\t\t\t\t\tthis.#insertPath(method, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (path === \"/*\") path = \"*\";\n\t\tconst methods = method === \"ALL\" ? Object.keys(middleware) : [method];\n\t\tif (/\\*$/.test(path)) {\n\t\t\tconst re = buildWildcardRegExp(path);\n\t\t\tfor (const m of methods) if (!middleware[m][path]) {\n\t\t\t\tthis.#insertPath(m, path);\n\t\t\t\tmiddleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[\"ALL\"], path) || [];\n\t\t\t}\n\t\t\tfor (const handlerMap of [middleware, routes]) for (const m of methods) for (const p in handlerMap[m]) re.test(p) && handlerMap[m][p].push([handler, path]);\n\t\t\treturn;\n\t\t}\n\t\tconst paths = checkOptionalParameter(path) || [path];\n\t\tfor (const path of paths) for (const m of methods) {\n\t\t\tif (!routes[m][path]) {\n\t\t\t\tthis.#insertPath(m, path);\n\t\t\t\troutes[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[\"ALL\"], path) || [];\n\t\t\t}\n\t\t\troutes[m][path].push([handler, path]);\n\t\t}\n\t}\n\tmatch = match;\n\tbuildAllMatchers() {\n\t\tconst matchers = createNullObject();\n\t\tfor (const method of Object.keys(this.#routes)) matchers[method] = this.#buildMatcher(method);\n\t\tthis.#middleware = this.#routes = this.#tries = void 0;\n\t\twildcardRegExpCache = createNullObject();\n\t\treturn matchers;\n\t}\n\t#buildMatcher(method) {\n\t\tconst middleware = this.#middleware[method];\n\t\tconst routes = this.#routes[method];\n\t\tconst trie = this.#tries[method];\n\t\tconst staticMap = createNullObject();\n\t\tconst handlerData = [];\n\t\tconst [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();\n\t\tfor (const r of [middleware, routes]) for (const path in r) {\n\t\t\tconst handlers = r[path];\n\t\t\tconst pathData = trie.paths[path];\n\t\t\tif (!pathData) {\n\t\t\t\tstaticMap[path] = [handlers.map(([h]) => [h, createNullObject()]), emptyParam];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\thandlerData[pathData[0]] = handlers.map(([h, handlerPath]) => [h, trie.paths[handlerPath][1].reduceRight((map, [key], i) => {\n\t\t\t\tmap[key] = paramReplacementMap[pathData[1][i][1]];\n\t\t\t\treturn map;\n\t\t\t}, createNullObject())]);\n\t\t}\n\t\treturn [\n\t\t\tregexp,\n\t\t\tindexReplacementMap.map((i) => handlerData[i]),\n\t\t\tstaticMap\n\t\t];\n\t}\n};\n//#endregion\nexport { RegExpRouter };\n","import { MESSAGE_MATCHER_IS_ALREADY_BUILT, UnsupportedPathError } from \"../../router.js\";\n//#region src/router/smart-router/router.ts\nvar SmartRouter = class {\n\tname = \"SmartRouter\";\n\t#routers = [];\n\t#routes = [];\n\tconstructor(init) {\n\t\tthis.#routers = init.routers;\n\t}\n\tadd(method, path, handler) {\n\t\tif (!this.#routes) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);\n\t\tthis.#routes.push([\n\t\t\tmethod,\n\t\t\tpath,\n\t\t\thandler\n\t\t]);\n\t}\n\tmatch(method, path) {\n\t\tif (!this.#routes) throw new Error(\"Fatal error\");\n\t\tconst routers = this.#routers;\n\t\tconst routes = this.#routes;\n\t\tconst len = routers.length;\n\t\tlet i = 0;\n\t\tlet res;\n\t\tfor (; i < len; i++) {\n\t\t\tconst router = routers[i];\n\t\t\ttry {\n\t\t\t\tfor (let i = 0, len = routes.length; i < len; i++) router.add(...routes[i]);\n\t\t\t\tres = router.match(method, path);\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof UnsupportedPathError) continue;\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\tthis.match = router.match.bind(router);\n\t\t\tthis.#routers = [router];\n\t\t\tthis.#routes = void 0;\n\t\t\tbreak;\n\t\t}\n\t\tif (i === len) throw new Error(\"Fatal error\");\n\t\tthis.name = `SmartRouter + ${this.activeRouter.name}`;\n\t\treturn res;\n\t}\n\tget activeRouter() {\n\t\tif (this.#routes || this.#routers.length !== 1) throw new Error(\"No active router has been determined yet.\");\n\t\treturn this.#routers[0];\n\t}\n};\n//#endregion\nexport { SmartRouter };\n","import { getPattern, splitPath, splitRoutingPath } from \"../../utils/url.js\";\nimport \"../../router.js\";\nimport { createNullObject } from \"../utils.js\";\n//#region src/router/trie-router/node.ts\nconst emptyParams = createNullObject();\nlet order = 0;\nvar Node = class Node {\n\t#methods = [];\n\t#children = createNullObject();\n\t#patterns = [];\n\t#pattern;\n\t#params = emptyParams;\n\tinsert(method, path, handler) {\n\t\tlet curNode = this;\n\t\tconst parts = splitRoutingPath(path);\n\t\tconst possibleKeys = /* @__PURE__ */ new Set();\n\t\tlet i = 0;\n\t\tfor (const p of parts) {\n\t\t\tconst nextP = parts[++i];\n\t\t\tconst pattern = getPattern(p, nextP) || (nextP === void 0 && p && p.indexOf(\"*\") === p.length - 1 ? p : null);\n\t\t\tconst isParam = Array.isArray(pattern);\n\t\t\tconst key = isParam ? pattern[0] : pattern || p;\n\t\t\tconst child = curNode.#children[key] ||= new Node();\n\t\t\tif (pattern && !child.#pattern) {\n\t\t\t\tchild.#pattern = pattern;\n\t\t\t\tcurNode.#patterns.push(child);\n\t\t\t}\n\t\t\tcurNode = child;\n\t\t\tif (isParam) possibleKeys.add(pattern[1]);\n\t\t}\n\t\tcurNode.#methods.push({ [method]: {\n\t\t\thandler,\n\t\t\tpossibleKeys: [...possibleKeys],\n\t\t\tscore: ++order\n\t\t} });\n\t}\n\t#pushHandlerSets(handlerSets, node, method, nodeParams, params) {\n\t\tfor (let i = 0, len = node.#methods.length; i < len; i++) {\n\t\t\tconst m = node.#methods[i];\n\t\t\tconst handlerSet = m[method] || m[\"ALL\"];\n\t\t\tif (handlerSet) {\n\t\t\t\thandlerSet.params = createNullObject();\n\t\t\t\thandlerSets.push(handlerSet);\n\t\t\t\tfor (let i = 0, len = handlerSet.possibleKeys.length; i < len; i++) {\n\t\t\t\t\tconst key = handlerSet.possibleKeys[i];\n\t\t\t\t\thandlerSet.params[key] = params?.[key] && !i ? params[key] : nodeParams[key] ?? params?.[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tsearch(method, path) {\n\t\tconst handlerSets = [];\n\t\tthis.#params = emptyParams;\n\t\tlet curNodes = [this];\n\t\tconst parts = splitPath(path);\n\t\tconst curNodesQueue = [];\n\t\tconst len = parts.length;\n\t\tlet partOffsets = null;\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst part = parts[i];\n\t\t\tconst isLast = i === len - 1;\n\t\t\tconst tempNodes = [];\n\t\t\tfor (let j = 0, len2 = curNodes.length; j < len2; j++) {\n\t\t\t\tconst node = curNodes[j];\n\t\t\t\tconst nextNode = node.#children[part];\n\t\t\t\tif (nextNode) {\n\t\t\t\t\tnextNode.#params = node.#params;\n\t\t\t\t\tif (isLast) {\n\t\t\t\t\t\tif (nextNode.#children[\"*\"]) this.#pushHandlerSets(handlerSets, nextNode.#children[\"*\"], method, node.#params);\n\t\t\t\t\t\tthis.#pushHandlerSets(handlerSets, nextNode, method, node.#params);\n\t\t\t\t\t} else tempNodes.push(nextNode);\n\t\t\t\t}\n\t\t\t\tfor (const child of node.#patterns) {\n\t\t\t\t\tconst pattern = child.#pattern;\n\t\t\t\t\tconst params = node.#params === emptyParams ? {} : { ...node.#params };\n\t\t\t\t\tif (typeof pattern === \"string\") {\n\t\t\t\t\t\tif (pattern === \"*\" || part.startsWith(pattern.slice(0, -1))) {\n\t\t\t\t\t\t\tthis.#pushHandlerSets(handlerSets, child, method, node.#params);\n\t\t\t\t\t\t\tif (pattern === \"*\") {\n\t\t\t\t\t\t\t\tchild.#params = params;\n\t\t\t\t\t\t\t\ttempNodes.push(child);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst [, name, matcher] = pattern;\n\t\t\t\t\tif (!part && matcher === true) continue;\n\t\t\t\t\tif (matcher !== true) {\n\t\t\t\t\t\tif (!partOffsets) {\n\t\t\t\t\t\t\tpartOffsets = [];\n\t\t\t\t\t\t\tlet offset = path[0] === \"/\" ? 1 : 0;\n\t\t\t\t\t\t\tfor (let p = 0; p < len; p++) {\n\t\t\t\t\t\t\t\tpartOffsets[p] = offset;\n\t\t\t\t\t\t\t\toffset += parts[p].length + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst restPathString = path.slice(partOffsets[i]);\n\t\t\t\t\t\tconst m = matcher.exec(restPathString);\n\t\t\t\t\t\tif (m) {\n\t\t\t\t\t\t\tparams[name] = m[0];\n\t\t\t\t\t\t\tthis.#pushHandlerSets(handlerSets, child, method, node.#params, params);\n\t\t\t\t\t\t\tif (m[0].length === restPathString.length && child.#children[\"*\"]) this.#pushHandlerSets(handlerSets, child.#children[\"*\"], method, node.#params, params);\n\t\t\t\t\t\t\tfor (const _ in child.#children) {\n\t\t\t\t\t\t\t\tchild.#params = params;\n\t\t\t\t\t\t\t\tconst componentCount = m[0].match(/\\//g)?.length ?? 0;\n\t\t\t\t\t\t\t\t(curNodesQueue[componentCount] ||= []).push(child);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (matcher === true || matcher.test(part)) {\n\t\t\t\t\t\tparams[name] = part;\n\t\t\t\t\t\tif (isLast) {\n\t\t\t\t\t\t\tthis.#pushHandlerSets(handlerSets, child, method, params, node.#params);\n\t\t\t\t\t\t\tif (child.#children[\"*\"]) this.#pushHandlerSets(handlerSets, child.#children[\"*\"], method, params, node.#params);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchild.#params = params;\n\t\t\t\t\t\t\ttempNodes.push(child);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst shifted = curNodesQueue.shift();\n\t\t\tcurNodes = shifted ? tempNodes.concat(shifted) : tempNodes;\n\t\t}\n\t\tif (handlerSets[1]) handlerSets.sort((a, b) => {\n\t\t\treturn a.score - b.score;\n\t\t});\n\t\treturn [handlerSets.map(({ handler, params }) => [handler, params])];\n\t}\n};\n//#endregion\nexport { Node };\n","import { checkOptionalParameter } from \"../../utils/url.js\";\nimport { Node } from \"./node.js\";\n//#region src/router/trie-router/router.ts\nvar TrieRouter = class {\n\tname = \"TrieRouter\";\n\t#node = new Node();\n\tadd(method, path, handler) {\n\t\tfor (const result of checkOptionalParameter(path) || [path]) this.#node.insert(method, result, handler);\n\t}\n\tmatch(method, path) {\n\t\treturn this.#node.search(method, path);\n\t}\n};\n//#endregion\nexport { TrieRouter };\n","import { HonoBase as Hono$1 } from \"./hono-base.js\";\nimport { RegExpRouter } from \"./router/reg-exp-router/router.js\";\nimport \"./router/reg-exp-router/index.js\";\nimport { SmartRouter } from \"./router/smart-router/router.js\";\nimport { TrieRouter } from \"./router/trie-router/router.js\";\nimport \"./router/trie-router/index.js\";\n//#region src/hono.ts\n/**\n* The Hono class extends the functionality of the HonoBase class.\n* It sets up routing and allows for custom options to be passed.\n*\n* @template E - The environment type.\n* @template S - The schema type.\n* @template BasePath - The base path type.\n*/\nvar Hono = class extends Hono$1 {\n\t/**\n\t* Creates an instance of the Hono class.\n\t*\n\t* @param options - Optional configuration options for the Hono instance.\n\t*/\n\tconstructor(options = {}) {\n\t\tsuper(options);\n\t\tthis.router = options.router ?? new SmartRouter({ routers: [new RegExpRouter(), new TrieRouter()] });\n\t}\n};\n//#endregion\nexport { Hono };\n","import { createTextLink } from \"./src/schemas/protocolContracts.mjs\";\nimport { PO_API_CALLER_DEVICE_ID_HEADER, PO_API_CALLER_LOCALITY_HEADER, PO_API_CALLER_STEP_UP_HEADER, parsePoSocketPath } from \"./src/schemas/packageApi.mjs\";\nimport { PO_REMOTE_ORIGIN_CONTRACT, PO_REMOTE_ORIGIN_SERVICE } from \"./src/schemas/remoteOrigin.mjs\";\nimport { isPublicSessionMcpRoute, isSessionMcpHostRoute, isSessionMcpPhoneRoute } from \"./src/server/sessionMcpRoutes.mjs\";\nimport { DEVICE_COOKIE, REMOTE_CHANNEL_ROUTE, REMOTE_HTTP_ROUTE, STEP_UP_HEADER } from \"./src/constants/remote.mjs\";\nimport { isDevProxyPath, parseProxyPath } from \"./src/services/devProxyPolicy/index.mjs\";\nimport { createDevProxyStore } from \"./src/services/devProxyStore/sync.mjs\";\nimport \"./src/services/devProxyStore/index.mjs\";\nimport { PUBLIC_FILE_SHARE_PREFIX, createPublicFileShares } from \"./src/services/publicFileShares/index.mjs\";\nimport { isQuickTunnelHost, stepUpActionFor } from \"./src/services/webauthnPolicy/index.mjs\";\nimport { isPublicPairingRoute, localOriginPolicy, originVerdict } from \"./src/services/remoteGuardPolicy/index.mjs\";\nimport { createRemoteAccess } from \"./src/services/remoteAccess/index.mjs\";\nimport { defaultRemoteStateDir } from \"./src/services/remoteAccessStore/remoteAccessRecords.mjs\";\nimport { createRemoteAccessStore } from \"./src/services/remoteAccessStore/sync.mjs\";\nimport \"./src/services/remoteAccessStore/index.mjs\";\nimport { createTunnelLauncher, reapStaleTunnel } from \"./src/services/tunnelProcess/index.mjs\";\nimport { registerDevProxyRoutes } from \"./src/server/devProxyRoutes.mjs\";\nimport { relayDevProxySocket } from \"./src/server/devProxySocket.mjs\";\nimport { registerRemoteRoutes } from \"./src/server/remoteRoutes.mjs\";\nimport { createServer } from \"node:http\";\nimport { Readable } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport { WebSocketServer } from \"ws\";\nimport { Hono } from \"hono\";\nimport { getCookie } from \"hono/cookie\";\n//#region src/server/remoteRuntime.ts\nconst MAX_REQUEST_BYTES = 8388608;\nconst TUNNEL_HEADERS_TIMEOUT_MS = 5e3;\nconst TUNNEL_REQUEST_TIMEOUT_MS = 1e4;\nconst TUNNEL_CONNECTION_LIMIT = 64;\nconst TUNNEL_REQUESTS_PER_SOCKET = 100;\nconst SEALED_HTTP_VERSION = 1;\nconst SEALED_HTTP_METHODS = /* @__PURE__ */ new Set([\n\t\"GET\",\n\t\"HEAD\",\n\t\"POST\",\n\t\"PUT\",\n\t\"PATCH\",\n\t\"DELETE\"\n]);\n/** HMAC-authenticated peer routes are the only non-device tunnel APIs. */\nconst SESSION_PEER_ROUTES = /* @__PURE__ */ new Set([\"/api/plugins/session-peer/inbox\", \"/api/plugins/session-peer/control\"]);\nconst VOICE_PEER_ROUTES = /* @__PURE__ */ new Set([\"/api/plugins/voice/peer\", \"/api/plugins/voice/peer-ownership\"]);\n/** The one public file share shape: a 256-bit base64url token and nothing after it. */\nconst PUBLIC_FILE_SHARE_ROUTE = /^\\/mcp-file\\/([A-Za-z0-9_-]{43})$/u;\n/** Everything under this name is reserved for shares, so a near miss never reaches another route. */\nconst PUBLIC_FILE_SHARE_NAMESPACE = PUBLIC_FILE_SHARE_PREFIX.slice(0, -1);\nconst FORBIDDEN_HEADERS = /* @__PURE__ */ new Set([\n\t\"authorization\",\n\t\"connection\",\n\t\"content-length\",\n\t\"cookie\",\n\t\"forwarded\",\n\t\"host\",\n\t\"origin\",\n\t\"transfer-encoding\",\n\t\"upgrade\",\n\t\"x-po-token\",\n\t\"x-po-desktop\",\n\tPO_API_CALLER_LOCALITY_HEADER,\n\tPO_API_CALLER_DEVICE_ID_HEADER,\n\tPO_API_CALLER_STEP_UP_HEADER,\n\t\"x-forwarded-for\",\n\t\"x-forwarded-host\",\n\t\"x-forwarded-proto\"\n]);\nfunction sealedRequest(value) {\n\tif (typeof value !== \"object\" || value === null) return void 0;\n\tconst request = value;\n\tif (request.v !== SEALED_HTTP_VERSION || typeof request.method !== \"string\" || !SEALED_HTTP_METHODS.has(request.method) || typeof request.target !== \"string\" || !request.target.startsWith(\"/\") || request.target.startsWith(\"//\") || request.target.includes(\"#\") || !Array.isArray(request.headers) || !request.headers.every((header) => Array.isArray(header) && header.length === 2 && header.every((part) => typeof part === \"string\")) || request.body !== void 0 && typeof request.body !== \"string\") return void 0;\n\tconst parsed = new URL(request.target, \"http://po.local\");\n\tif (parsed.pathname === REMOTE_HTTP_ROUTE || parsed.pathname === REMOTE_CHANNEL_ROUTE) return void 0;\n\treturn request;\n}\nfunction decodedBody(value) {\n\tif (value === void 0) return Buffer.alloc(0);\n\tif (!/^(?:[A-Za-z\\d+/]{4})*(?:[A-Za-z\\d+/]{2}==|[A-Za-z\\d+/]{3}=)?$/u.test(value)) return void 0;\n\tconst body = Buffer.from(value, \"base64\");\n\treturn body.toString(\"base64\") === value ? body : void 0;\n}\nasync function readBody(request) {\n\tconst chunks = [];\n\tlet size = 0;\n\tfor await (const chunk of request) {\n\t\tconst bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);\n\t\tsize += bytes.byteLength;\n\t\tif (size > MAX_REQUEST_BYTES) throw new Error(\"The tunnel request body is too large.\");\n\t\tchunks.push(bytes);\n\t}\n\treturn Buffer.concat(chunks);\n}\nasync function writeResponse(response, result) {\n\tresponse.writeHead(result.status, Object.fromEntries(result.headers.entries()));\n\tif (result.body === null) {\n\t\tresponse.end();\n\t\treturn;\n\t}\n\tawait pipeline(Readable.fromWeb(result.body), response);\n}\n/** One global control plane and a second socket dedicated to public tunnel traffic. */\nfunction createRemoteRuntime(options) {\n\tconst store = createRemoteAccessStore({\n\t\tstateDir: defaultRemoteStateDir(options.homeDirectory),\n\t\tonNotice: (message) => options.onNotice(message)\n\t});\n\treapStaleTunnel(store.directory, (message) => options.onNotice(message));\n\tconst devProxy = createDevProxyStore({\n\t\tstateDir: store.directory,\n\t\tonNotice: (message) => options.onNotice(message)\n\t});\n\tconst app = new Hono();\n\tlet remote;\n\tlet closing = false;\n\tlet lastIntent;\n\tlet frontendOrigin;\n\tconst tunnelIntent = () => {\n\t\tconst state = remote.state();\n\t\tconst tunnel = remote.settings().tunnel;\n\t\tif (state.status !== \"on\" || tunnel.kind !== \"named\" || state.publicUrl === void 0) return void 0;\n\t\tif (new URL(state.publicUrl).hostname !== tunnel.hostname) return void 0;\n\t\treturn {\n\t\t\thostname: tunnel.hostname,\n\t\t\t...state.closesAt === void 0 ? {} : { closesAt: Date.parse(state.closesAt) }\n\t\t};\n\t};\n\tconst publishIntent = () => {\n\t\tif (closing) return;\n\t\tconst intent = tunnelIntent();\n\t\tif (intent?.hostname === lastIntent?.hostname && intent?.closesAt === lastIntent?.closesAt) return;\n\t\tlastIntent = intent;\n\t\toptions.onTunnelIntentChanged?.(intent);\n\t};\n\tconst fileShares = createPublicFileShares({\n\t\tpublicOrigin: () => remote.publicOrigin(),\n\t\tpublicOriginRevision: () => remote.publicOriginRevision(),\n\t\tonNotice: (message) => options.onNotice(message)\n\t});\n\t/** Exact share route on the decoded path, and the raw path must not have needed decoding. */\n\tconst publicFileShareToken = (request, path) => new URL(request.url).pathname === path ? PUBLIC_FILE_SHARE_ROUTE.exec(path)?.[1] : void 0;\n\tconst inFileShareNamespace = (request, path) => path.startsWith(PUBLIC_FILE_SHARE_NAMESPACE) || new URL(request.url).pathname.startsWith(PUBLIC_FILE_SHARE_NAMESPACE);\n\tapp.use(\"*\", async (context, next) => {\n\t\tif (context.env.listener === \"local\") return next();\n\t\tconst path = context.req.path;\n\t\tconst publicSessionMcp = isPublicSessionMcpRoute(context.req.method, path);\n\t\tconst publicSessionPeer = context.req.method === \"POST\" && SESSION_PEER_ROUTES.has(path);\n\t\tconst publicVoicePeer = context.req.method === \"POST\" && VOICE_PEER_ROUTES.has(path);\n\t\tconst publicFileShare = (context.req.method === \"GET\" || context.req.method === \"HEAD\") && publicFileShareToken(context.req.raw, path) !== void 0;\n\t\tconst verdict = originVerdict({\n\t\t\tlistener: \"tunnel\",\n\t\t\tmethod: publicSessionMcp || publicSessionPeer || publicVoicePeer ? \"GET\" : context.req.method,\n\t\t\tisUpgrade: false,\n\t\t\torigin: context.req.header(\"origin\"),\n\t\t\thost: context.req.header(\"host\"),\n\t\t\tlocal: localOriginPolicy(0),\n\t\t\ttunnel: remote.tunnelPolicy()\n\t\t});\n\t\tif (verdict !== \"allow\") return context.json({ error: `Tunnel request refused: ${verdict}.` }, 403);\n\t\tif (publicFileShare) return next();\n\t\tif (inFileShareNamespace(context.req.raw, path)) return context.json({ error: \"Not found.\" }, 404);\n\t\tif (isPublicPairingRoute(context.req.method, path) || publicSessionMcp || publicSessionPeer || publicVoicePeer) return next();\n\t\tconst device = remote.authorize(getCookie(context, DEVICE_COOKIE, \"host\"));\n\t\tif (device === void 0) return context.json({ error: \"This device is not paired.\" }, 401);\n\t\tif (context.env.sealedDeviceId === device) return next();\n\t\tif (isDevProxyPath(path)) return next();\n\t\tif (context.req.method === \"POST\" && (path === REMOTE_CHANNEL_ROUTE || path === REMOTE_HTTP_ROUTE)) return next();\n\t\tif ((context.req.method === \"GET\" || context.req.method === \"HEAD\") && !path.startsWith(\"/api/\")) return next();\n\t\treturn context.json({ error: \"Remote HTTP requests must use the sealed gateway.\" }, 401);\n\t});\n\tremote = createRemoteAccess({\n\t\tstore,\n\t\tbroadcastAll: publishIntent,\n\t\tonDeviceDropped: options.onDeviceDropped,\n\t\tlaunchTunnel: options.launchTunnel ?? createTunnelLauncher({\n\t\t\tstateDir: store.directory,\n\t\t\tonNotice: (message) => options.onNotice(message),\n\t\t\tonExit: (message) => {\n\t\t\t\toptions.onNotice(`remote access: ${message}`);\n\t\t\t\tremote.disable();\n\t\t\t}\n\t\t}),\n\t\tbindListener: async () => {\n\t\t\tconst webSockets = new WebSocketServer({\n\t\t\t\tnoServer: true,\n\t\t\t\tmaxPayload: MAX_REQUEST_BYTES\n\t\t\t});\n\t\t\tconst server = createServer((incoming, outgoing) => {\n\t\t\t\t(async () => {\n\t\t\t\t\tconst abort = new AbortController();\n\t\t\t\t\tconst disconnected = () => abort.abort();\n\t\t\t\t\tincoming.once(\"aborted\", disconnected);\n\t\t\t\t\toutgoing.once(\"close\", disconnected);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst url = new URL(incoming.url ?? \"/\", `http://${incoming.headers.host ?? \"localhost\"}`);\n\t\t\t\t\t\tconst headers = new Headers();\n\t\t\t\t\t\tfor (const [name, value] of Object.entries(incoming.headers)) if (value !== void 0) headers.set(name, Array.isArray(value) ? value.join(\", \") : value);\n\t\t\t\t\t\tconst body = incoming.method === \"GET\" || incoming.method === \"HEAD\" ? void 0 : await readBody(incoming);\n\t\t\t\t\t\tconst request = new Request(url, {\n\t\t\t\t\t\t\tmethod: incoming.method,\n\t\t\t\t\t\t\theaders,\n\t\t\t\t\t\t\tsignal: abort.signal,\n\t\t\t\t\t\t\t...body === void 0 ? {} : { body }\n\t\t\t\t\t\t});\n\t\t\t\t\t\tawait writeResponse(outgoing, await app.fetch(request, {\n\t\t\t\t\t\t\tlistener: \"tunnel\",\n\t\t\t\t\t\t\tincoming\n\t\t\t\t\t\t}));\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tincoming.off(\"aborted\", disconnected);\n\t\t\t\t\t\toutgoing.off(\"close\", disconnected);\n\t\t\t\t\t}\n\t\t\t\t})().catch((error) => {\n\t\t\t\t\toptions.onNotice(`tunnel request failed: ${String(error)}`);\n\t\t\t\t\tif (!outgoing.headersSent) {\n\t\t\t\t\t\toutgoing.writeHead(500, { \"content-type\": \"application/json\" });\n\t\t\t\t\t\toutgoing.end(JSON.stringify({ error: \"The tunnel request failed.\" }));\n\t\t\t\t\t} else outgoing.destroy();\n\t\t\t\t});\n\t\t\t});\n\t\t\tserver.on(\"upgrade\", (incoming, socket, head) => {\n\t\t\t\tconst url = new URL(incoming.url ?? \"/\", `http://${incoming.headers.host ?? \"localhost\"}`);\n\t\t\t\tconst verdict = originVerdict({\n\t\t\t\t\tlistener: \"tunnel\",\n\t\t\t\t\tmethod: incoming.method ?? \"GET\",\n\t\t\t\t\tisUpgrade: true,\n\t\t\t\t\torigin: incoming.headers.origin,\n\t\t\t\t\thost: incoming.headers.host,\n\t\t\t\t\tlocal: localOriginPolicy(0),\n\t\t\t\t\ttunnel: remote.tunnelPolicy()\n\t\t\t\t});\n\t\t\t\tconst cookies = new Map((incoming.headers.cookie ?? \"\").split(\";\").map((part) => {\n\t\t\t\t\tconst at = part.indexOf(\"=\");\n\t\t\t\t\treturn [part.slice(0, at).trim(), part.slice(at + 1).trim()];\n\t\t\t\t}));\n\t\t\t\tconst device = remote.authorize(cookies.get(`__Host-${DEVICE_COOKIE}`));\n\t\t\t\tif (isDevProxyPath(url.pathname) && verdict === \"allow\" && device !== void 0) {\n\t\t\t\t\tconst parsed = parseProxyPath(url.pathname);\n\t\t\t\t\tconst target = parsed.kind === \"match\" ? devProxy.find(parsed.name) : void 0;\n\t\t\t\t\tif (parsed.kind !== \"match\" || target === void 0) {\n\t\t\t\t\t\tsocket.write(\"HTTP/1.1 404 Not Found\\r\\n\\r\\n\");\n\t\t\t\t\t\tsocket.destroy();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\twebSockets.handleUpgrade(incoming, socket, head, (client) => {\n\t\t\t\t\t\tconst untrack = remote.trackSocket(device, (code, reason) => client.close(code, reason));\n\t\t\t\t\t\tclient.once(\"close\", untrack);\n\t\t\t\t\t\trelayDevProxySocket(client, {\n\t\t\t\t\t\t\tport: target.port,\n\t\t\t\t\t\t\tupstreamPath: `${parsed.upstreamPath}${url.search}`,\n\t\t\t\t\t\t\tprotocols: incoming.headers[\"sec-websocket-protocol\"],\n\t\t\t\t\t\t\tonNotice: (message) => options.onNotice(message)\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst channel = device === void 0 ? void 0 : remote.channelFor(device, \"protocol\");\n\t\t\t\tif (!parsePoSocketPath(url.pathname) || verdict !== \"allow\" || !device || !channel) {\n\t\t\t\t\tsocket.write(\"HTTP/1.1 403 Forbidden\\r\\n\\r\\n\");\n\t\t\t\t\tsocket.destroy();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twebSockets.handleUpgrade(incoming, socket, head, (client) => {\n\t\t\t\t\tconst untrack = remote.trackSocket(device, (code, reason) => client.close(code, reason));\n\t\t\t\t\tconst relay = createTextLink({\n\t\t\t\t\t\tsend: (text) => {\n\t\t\t\t\t\t\tconst sealed = channel.seal(Buffer.from(text));\n\t\t\t\t\t\t\tif (!sealed.ok) {\n\t\t\t\t\t\t\t\trelay.ended(\"seal failed\");\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclient.send(Buffer.from(JSON.stringify(sealed.envelope)));\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclose: () => {\n\t\t\t\t\t\t\tuntrack();\n\t\t\t\t\t\t\tclient.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tclient.on(\"message\", (raw) => {\n\t\t\t\t\t\tif (!remote.isDeviceAuthorized(device)) {\n\t\t\t\t\t\t\trelay.ended(\"device revoked\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst bytes = Array.isArray(raw) ? Buffer.concat(raw) : Buffer.from(raw);\n\t\t\t\t\t\tlet envelope;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tenvelope = JSON.parse(bytes.toString(\"utf8\"));\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\trelay.ended(\"invalid envelope\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst opened = channel.open(envelope);\n\t\t\t\t\t\tif (!opened.ok) {\n\t\t\t\t\t\t\trelay.ended(\"invalid envelope\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trelay.deliver(Buffer.from(opened.plaintext).toString(\"utf8\"));\n\t\t\t\t\t});\n\t\t\t\t\tclient.on(\"close\", () => relay.ended(\"client closed\"));\n\t\t\t\t\tclient.on(\"error\", () => relay.ended(\"client error\"));\n\t\t\t\t\ttry {\n\t\t\t\t\t\toptions.acceptProtocol(url.pathname, relay.link, device);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\toptions.onNotice(`remote protocol could not connect: ${String(error)}`);\n\t\t\t\t\t\trelay.ended(\"protocol unavailable\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t\tserver.headersTimeout = TUNNEL_HEADERS_TIMEOUT_MS;\n\t\t\tserver.requestTimeout = TUNNEL_REQUEST_TIMEOUT_MS;\n\t\t\tserver.maxConnections = TUNNEL_CONNECTION_LIMIT;\n\t\t\tserver.maxRequestsPerSocket = TUNNEL_REQUESTS_PER_SOCKET;\n\t\t\tawait new Promise((resolve, reject) => {\n\t\t\t\tserver.once(\"error\", reject);\n\t\t\t\tserver.listen(0, \"127.0.0.1\", resolve);\n\t\t\t});\n\t\t\tconst address = server.address();\n\t\t\tif (!address || typeof address === \"string\") throw new Error(\"The tunnel listener has no TCP address.\");\n\t\t\treturn {\n\t\t\t\tport: address.port,\n\t\t\t\tclose: async () => {\n\t\t\t\t\tfor (const client of webSockets.clients) client.terminate();\n\t\t\t\t\twebSockets.close();\n\t\t\t\t\tserver.closeAllConnections();\n\t\t\t\t\tawait new Promise((resolve, reject) => server.close((error) => error ? reject(error) : resolve()));\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tbundleTrust: () => options.bundleTrust(),\n\t\tattestHost: (fields) => options.attestHost?.(fields),\n\t\tonNotice: (message) => options.onNotice(message)\n\t});\n\tregisterRemoteRoutes(app, {\n\t\tremote,\n\t\tlistenerOf: (context) => context.env.listener\n\t});\n\tregisterDevProxyRoutes(app, {\n\t\tstore: devProxy,\n\t\tlistenerOf: (context) => context.env.listener,\n\t\treservedPorts: () => [\n\t\t\tremote.tunnelPort(),\n\t\t\tfrontendOrigin === void 0 ? void 0 : Number(new URL(frontendOrigin).port),\n\t\t\t...options.reservedPorts?.() ?? []\n\t\t],\n\t\tonNotice: (message) => options.onNotice(message)\n\t});\n\tapp.post(\"/api/remote/frontend\", async (context) => {\n\t\tif (context.env.listener !== \"local\") return context.json({ error: \"This action is only available on the host.\" }, 403);\n\t\tif (context.req.header(\"x-po-web-registration\") !== options.registrationToken) return context.json({ error: \"The web presentation server was not authenticated.\" }, 403);\n\t\tlet body;\n\t\ttry {\n\t\t\tbody = await context.req.json();\n\t\t} catch {\n\t\t\treturn context.json({ error: \"A loopback web origin is required.\" }, 400);\n\t\t}\n\t\tconst origin = typeof body === \"object\" && body !== null && \"origin\" in body ? body.origin : void 0;\n\t\tif (typeof origin !== \"string\") return context.json({ error: \"A loopback web origin is required.\" }, 400);\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = new URL(origin);\n\t\t} catch {\n\t\t\treturn context.json({ error: \"The web origin is invalid.\" }, 400);\n\t\t}\n\t\tif (parsed.protocol !== \"http:\" || ![\n\t\t\t\"127.0.0.1\",\n\t\t\t\"localhost\",\n\t\t\t\"[::1]\"\n\t\t].includes(parsed.hostname) || parsed.pathname !== \"/\" || parsed.search !== \"\" || parsed.hash !== \"\" || !parsed.port) return context.json({ error: \"The web origin must be a loopback HTTP listener.\" }, 400);\n\t\tfrontendOrigin = parsed.origin;\n\t\treturn context.json({ ok: true });\n\t});\n\tapp.post(REMOTE_HTTP_ROUTE, async (context) => {\n\t\tconst device = remote.authorize(getCookie(context, DEVICE_COOKIE, \"host\"));\n\t\tconst channel = device === void 0 ? void 0 : remote.channelFor(device, \"http\");\n\t\tif (!device || !channel) return context.json({ error: \"A sealed paired device is required.\" }, 401);\n\t\tlet envelope;\n\t\ttry {\n\t\t\tenvelope = await context.req.json();\n\t\t} catch {\n\t\t\treturn context.json({ error: \"The sealed request envelope was malformed.\" }, 400);\n\t\t}\n\t\tconst opened = channel.open(envelope);\n\t\tif (!opened.ok) return context.json({ error: `The sealed request was refused: ${opened.failure}.` }, 400);\n\t\tlet decoded;\n\t\ttry {\n\t\t\tdecoded = JSON.parse(new TextDecoder().decode(opened.plaintext));\n\t\t} catch {\n\t\t\treturn context.json({ error: \"The sealed HTTP request was malformed.\" }, 400);\n\t\t}\n\t\tconst inner = sealedRequest(decoded);\n\t\tconst body = decodedBody(inner?.body);\n\t\tif (!inner || !body) return context.json({ error: \"The sealed HTTP request was invalid.\" }, 400);\n\t\tconst target = new URL(inner.target, \"http://po.local\");\n\t\tconst headers = new Headers();\n\t\tfor (const [name, value] of inner.headers) {\n\t\t\tconst normalized = name.toLowerCase();\n\t\t\tif (FORBIDDEN_HEADERS.has(normalized) || normalized.startsWith(\"sec-\")) continue;\n\t\t\theaders.append(name, value);\n\t\t}\n\t\tconst action = stepUpActionFor(inner.method, target.pathname);\n\t\tconst stepUpKind = remote.trustKind(device) === \"device-key\" ? \"device-key\" : \"passkey\";\n\t\tconst peerLinkDenied = action === \"peer.link\" && isQuickTunnelHost(remote.publicOrigin()) && remote.trustKind(device) !== \"device-key\";\n\t\tconst stepUpNeeded = action !== void 0 && (action === \"peer.link\" || remote.stepUpRequired(action, device));\n\t\tlet stepUpDenied = false;\n\t\tif (action && stepUpNeeded) {\n\t\t\tconst assertion = headers.get(STEP_UP_HEADER);\n\t\t\tlet credential;\n\t\t\ttry {\n\t\t\t\tcredential = assertion ? JSON.parse(Buffer.from(assertion, \"base64url\").toString(\"utf8\")) : void 0;\n\t\t\t} catch {\n\t\t\t\tcredential = void 0;\n\t\t\t}\n\t\t\tconst ceremony = credential;\n\t\t\tif (stepUpKind === \"device-key\") stepUpDenied = !remote.finishDeviceStepUp(device, action, ceremony?.ceremonyId, ceremony?.signature);\n\t\t\telse if (typeof ceremony?.ceremonyId !== \"string\" || !await remote.passkeys().finishStepUp(ceremony.ceremonyId, `device:${device}`, action, ceremony.response)) stepUpDenied = true;\n\t\t}\n\t\theaders.delete(STEP_UP_HEADER);\n\t\tconst sealedStepUp = stepUpNeeded && !stepUpDenied ? \"verified\" : \"not-required\";\n\t\theaders.set(PO_API_CALLER_LOCALITY_HEADER, \"remote\");\n\t\theaders.set(PO_API_CALLER_DEVICE_ID_HEADER, device);\n\t\theaders.set(PO_API_CALLER_STEP_UP_HEADER, sealedStepUp);\n\t\tlet response;\n\t\tif (peerLinkDenied) response = context.json({ error: \"Linking hosts over a quick tunnel needs the Po app.\" }, 403);\n\t\telse if (stepUpDenied) {\n\t\t\tconst gesture = stepUpKind === \"device-key\" ? \"biometric confirmation\" : \"passkey gesture\";\n\t\t\tresponse = context.json({\n\t\t\t\terror: `This action needs a fresh ${gesture}.`,\n\t\t\t\taction,\n\t\t\t\tkind: stepUpKind\n\t\t\t}, 401);\n\t\t} else if (isSessionMcpHostRoute(target.pathname) && !isSessionMcpPhoneRoute(inner.method, target.pathname)) response = context.json({ error: \"Session MCP management is only available on the host.\" }, 403);\n\t\telse {\n\t\t\tconst internal = new Request(target, {\n\t\t\t\tmethod: inner.method,\n\t\t\t\theaders,\n\t\t\t\t...inner.method === \"GET\" || inner.method === \"HEAD\" ? {} : { body }\n\t\t\t});\n\t\t\tif (target.pathname === \"/api/remote\" || target.pathname.startsWith(\"/api/remote/\")) {\n\t\t\t\theaders.set(\"cookie\", context.req.header(\"cookie\") ?? \"\");\n\t\t\t\theaders.set(\"host\", context.req.header(\"host\") ?? \"\");\n\t\t\t\theaders.set(\"origin\", context.req.header(\"origin\") ?? \"\");\n\t\t\t\tresponse = await app.fetch(new Request(internal, { headers }), {\n\t\t\t\t\tlistener: \"tunnel\",\n\t\t\t\t\tsealedDeviceId: device,\n\t\t\t\t\tsealedStepUp\n\t\t\t\t});\n\t\t\t} else response = await options.forward(internal);\n\t\t}\n\t\tconst responseBody = Buffer.from(await response.arrayBuffer());\n\t\tconst sealed = channel.seal(new TextEncoder().encode(JSON.stringify({\n\t\t\tv: SEALED_HTTP_VERSION,\n\t\t\tstatus: response.status,\n\t\t\theaders: [...response.headers.entries()],\n\t\t\tbody: responseBody.toString(\"base64\")\n\t\t})));\n\t\treturn sealed.ok ? context.json(sealed.envelope) : context.json({ error: `The sealed response failed: ${sealed.failure}.` }, 503);\n\t});\n\tapp.on([\"POST\", \"DELETE\"], \"*\", async (context) => {\n\t\tif (!isPublicSessionMcpRoute(context.req.method, context.req.path) && !(context.req.method === \"POST\" && SESSION_PEER_ROUTES.has(context.req.path)) && !(context.req.method === \"POST\" && VOICE_PEER_ROUTES.has(context.req.path))) return context.notFound();\n\t\treturn options.forward(context.req.raw);\n\t});\n\tapp.on([\"GET\", \"HEAD\"], \"*\", async (context) => {\n\t\tif (inFileShareNamespace(context.req.raw, context.req.path)) {\n\t\t\tconst token = publicFileShareToken(context.req.raw, context.req.path);\n\t\t\treturn context.env.listener === \"tunnel\" && token !== void 0 ? fileShares.serve(token, context.req.method) : context.json({ error: \"Not found.\" }, 404);\n\t\t}\n\t\tif (isPublicSessionMcpRoute(context.req.method, context.req.path)) return options.forward(context.req.raw);\n\t\tif (context.req.path.startsWith(\"/api/\")) return context.json({ error: \"Not found.\" }, 404);\n\t\tif (context.req.path === \"/\" && remote.authorize(getCookie(context, \"po_device\", \"host\")) === void 0) return context.redirect(\"/pair\");\n\t\tif (context.req.path === \"/bundle-manifest.json\" || context.req.path.startsWith(\"/bundle-assets/\")) {\n\t\t\tconst from = new URL(context.req.url);\n\t\t\treturn await options.forward(new Request(new URL(`${from.pathname}${from.search}`, \"http://po.local\"), { method: context.req.method }));\n\t\t}\n\t\tif (!frontendOrigin) return context.json({ error: \"The web presentation server is unavailable.\" }, 503);\n\t\tconst from = new URL(context.req.url);\n\t\tconst target = new URL(`${from.pathname}${from.search}`, frontendOrigin);\n\t\tconst result = await fetch(target, {\n\t\t\tmethod: context.req.method,\n\t\t\tredirect: \"manual\"\n\t\t});\n\t\tconst headers = new Headers(result.headers);\n\t\theaders.delete(\"set-cookie\");\n\t\treturn new Response(result.body, {\n\t\t\tstatus: result.status,\n\t\t\theaders\n\t\t});\n\t});\n\treturn {\n\t\tremote,\n\t\tfileShares,\n\t\tfetchLocal: async (request) => app.fetch(request, { listener: \"local\" }),\n\t\ttunnelIntent,\n\t\trestoreTunnel: async (intent) => {\n\t\t\tconst parsed = store.settingsForRestore();\n\t\t\tconst tunnel = parsed?.settings.tunnel;\n\t\t\tif (closing || typeof intent?.hostname !== \"string\" || tunnel?.kind !== \"named\" || tunnel.hostname !== intent.hostname || parsed?.warnings.length !== 0 || remote.settings().tunnel.kind !== \"named\" || intent.closesAt !== void 0 && (!Number.isFinite(intent.closesAt) || intent.closesAt <= Date.now())) return {\n\t\t\t\tok: false,\n\t\t\t\terror: \"The named tunnel intent is no longer valid for automatic restore.\"\n\t\t\t};\n\t\t\tremote.updateSettings(parsed.settings);\n\t\t\treturn remote.enable(intent.closesAt);\n\t\t},\n\t\tclose: async () => {\n\t\t\tclosing = true;\n\t\t\tawait remote.close();\n\t\t}\n\t};\n}\n//#endregion\nexport { PO_REMOTE_ORIGIN_CONTRACT, PO_REMOTE_ORIGIN_SERVICE, createRemoteRuntime, relayDevProxySocket };\n\n//# sourceMappingURL=remoteRuntime.mjs.map","import { defineServiceContract } from \"./serverScope.mjs\";\n//#region src/schemas/sandboxIdentity.ts\nconst PO_SANDBOX_IDENTITY_SERVICE = \"po/sandbox-identity\";\n/** Global-scope contract: the server provides it, every scope below reads it. */\nconst PO_SANDBOX_IDENTITY_CONTRACT = defineServiceContract(PO_SANDBOX_IDENTITY_SERVICE, { scope: \"global\" });\nfunction readPoSandboxIdentity(context) {\n\treturn context.get(PO_SANDBOX_IDENTITY_SERVICE);\n}\n//#endregion\nexport { PO_SANDBOX_IDENTITY_CONTRACT, PO_SANDBOX_IDENTITY_SERVICE, readPoSandboxIdentity };\n\n//# sourceMappingURL=sandboxIdentity.mjs.map","import { readBoundedFile } from \"../platformFiles/index.mjs\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { BACKGROUND_CONTEXT } from \"@earendil-works/chord/context\";\nimport { getOrThrow } from \"@earendil-works/pi-durable/env\";\nimport { createBundleSigner } from \"@agimon-ai/po-web-security/node\";\n//#region src/services/bundlePublication/index.ts\nconst PUBLICATION_PREFIX = \"plugin-publications-\";\nconst OWNER_FILE = \"owner.json\";\nconst HOUR_MS = 36e5;\nconst UNOWNED_MAX_AGE_MS = 24 * HOUR_MS;\n/** Reclaims only old publication roots, never a live owner's assets or symlink targets. */\nasync function reapAbandonedPublications(fs, dir, isAlive) {\n\tconst listed = await fs.listDir(dir, BACKGROUND_CONTEXT);\n\tif (!listed.ok && listed.error.code === \"not_found\") return;\n\tconst now = Date.now();\n\tfor (const entry of getOrThrow(listed)) {\n\t\tif (entry.kind !== \"directory\" || !entry.name.startsWith(PUBLICATION_PREFIX)) continue;\n\t\tconst ownerPath = path.join(entry.path, OWNER_FILE);\n\t\tconst info = await fs.fileInfo(ownerPath, BACKGROUND_CONTEXT);\n\t\tlet owner;\n\t\tif (info.ok) {\n\t\t\tif (info.value.kind !== \"file\") continue;\n\t\t\tlet text;\n\t\t\ttry {\n\t\t\t\ttext = await readBoundedFile(fs, ownerPath, 4096, BACKGROUND_CONTEXT);\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst value = JSON.parse(Buffer.from(text).toString(\"utf8\"));\n\t\t\t\tif (typeof value === \"object\" && value !== null && \"pid\" in value && typeof value.pid === \"number\" && Number.isSafeInteger(value.pid) && value.pid > 0 && \"startedAt\" in value && typeof value.startedAt === \"number\" && Number.isFinite(value.startedAt) && value.startedAt > 0) owner = {\n\t\t\t\t\tpid: value.pid,\n\t\t\t\t\tstartedAt: value.startedAt\n\t\t\t\t};\n\t\t\t} catch {}\n\t\t} else if (info.error.code !== \"not_found\") continue;\n\t\tif (owner === void 0) {\n\t\t\tif (now - entry.mtimeMs <= UNOWNED_MAX_AGE_MS) continue;\n\t\t} else if (now - owner.startedAt <= HOUR_MS || isAlive(owner.pid)) continue;\n\t\tgetOrThrow(await fs.remove(entry.path, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}, BACKGROUND_CONTEXT));\n\t}\n}\n/**\n* Signs synchronized plugin generations without replacing the stable shell publication.\n*\n* Publications are retained by the exact identity and revision advertised to pages, so\n* a concurrent sync cannot pair an old manifest with bytes from a new generation.\n*/\nfunction createPluginBundlePublication(stateDir, onNotice = () => {}, owner) {\n\tlet signer;\n\ttry {\n\t\tsigner = createBundleSigner(stateDir, onNotice);\n\t} catch (error) {\n\t\tonNotice(`plugin compositions could not be signed: ${error instanceof Error ? error.message : String(error)}`);\n\t}\n\tconst byComposition = /* @__PURE__ */ new Map();\n\tconst byRoute = /* @__PURE__ */ new Map();\n\tconst publicationRoot = signer === void 0 ? void 0 : fs.mkdtempSync(path.join(stateDir, PUBLICATION_PREFIX));\n\tif (publicationRoot !== void 0 && owner !== void 0) fs.writeFileSync(path.join(publicationRoot, OWNER_FILE), JSON.stringify(owner));\n\tlet closed = false;\n\tconst routeKey = (compositionId, revision) => `${compositionId}:${String(revision)}`;\n\tconst publish = (compositionId, assetsDir, profile = \"web\") => {\n\t\tif (closed) return void 0;\n\t\tconst existing = byComposition.get(compositionId);\n\t\tif (existing !== void 0) return existing;\n\t\tif (signer === void 0 || publicationRoot === void 0) return void 0;\n\t\tconst stagingRoot = fs.mkdtempSync(path.join(publicationRoot, \".staging-\"));\n\t\tconst snapshot = path.join(stagingRoot, \"assets\");\n\t\ttry {\n\t\t\tfs.cpSync(assetsDir, snapshot, { recursive: true });\n\t\t\tconst signed = signer.sign(snapshot, profile);\n\t\t\tif (signed === void 0) {\n\t\t\t\tonNotice(`plugin composition '${compositionId}' is empty and cannot be published`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst retainedDirectory = path.join(publicationRoot, `${compositionId}-${String(signed.manifest.revision)}`);\n\t\t\tfs.renameSync(snapshot, retainedDirectory);\n\t\t\tconst published = {\n\t\t\t\tsigned,\n\t\t\t\tassetsDir: retainedDirectory\n\t\t\t};\n\t\t\tbyComposition.set(compositionId, published);\n\t\t\tbyRoute.set(routeKey(compositionId, signed.manifest.revision), published);\n\t\t\treturn published;\n\t\t} catch (error) {\n\t\t\tonNotice(`plugin composition '${compositionId}' could not be signed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\treturn;\n\t\t} finally {\n\t\t\tfs.rmSync(stagingRoot, {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true\n\t\t\t});\n\t\t}\n\t};\n\treturn {\n\t\tpublish,\n\t\trelease(compositionId) {\n\t\t\tconst bundle = byComposition.get(compositionId);\n\t\t\tif (!bundle) return;\n\t\t\tbyComposition.delete(compositionId);\n\t\t\tbyRoute.delete(routeKey(compositionId, bundle.signed.manifest.revision));\n\t\t\tfs.rmSync(bundle.assetsDir, {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true\n\t\t\t});\n\t\t},\n\t\tget: (compositionId, revision) => byRoute.get(routeKey(compositionId, revision)),\n\t\tpublicKey: () => signer?.publicKey(),\n\t\tattest: (tag, fields) => signer?.attest(tag, fields),\n\t\tclose: () => {\n\t\t\tif (closed) return;\n\t\t\tclosed = true;\n\t\t\tbyComposition.clear();\n\t\t\tbyRoute.clear();\n\t\t\tif (publicationRoot !== void 0) fs.rmSync(publicationRoot, {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\nexport { createPluginBundlePublication, reapAbandonedPublications };\n\n//# sourceMappingURL=index.mjs.map","import { HOST_CHANNEL_KEY_TAG } from \"./src/constants/remote.mjs\";\nimport { createPluginBundlePublication, reapAbandonedPublications } from \"./src/services/bundlePublication/index.mjs\";\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { NATIVE_ENTRY_PATH } from \"@agimon-ai/po-web-security\";\n//#region src/services/webCompositions/index.ts\nconst absolute = (file) => file.startsWith(\"/\") ? file : `/${file}`;\n/**\n* The file a signed manifest path names below `root`. Manifest segments are percent-encoded\n* (`@` and `+` in pnpm paths); the decoded file must still resolve inside `root`.\n*/\nfunction assetFile(root, assetPath) {\n\ttry {\n\t\tconst base = path.resolve(root);\n\t\tconst file = path.resolve(base, ...assetPath.slice(1).split(\"/\").map(decodeURIComponent));\n\t\treturn file.startsWith(`${base}${path.sep}`) && !file.includes(\"\\0\") ? file : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The build's plugin copies for exactly the given slots, in slot order. */\nfunction slotPlugins(build, slots) {\n\treturn slots.flatMap((slot) => build.plugins.filter((plugin) => plugin.slot === slot));\n}\n/**\n* The stylesheets of exactly the given slots, each loaded once: the stylesheets their code\n* imports first, then each slot's own stylesheet in slot order.\n*/\nfunction mountStylePaths(build, slots) {\n\tconst paths = slots.map((slot) => build.pluginStyles[slot]).filter((style) => style !== void 0);\n\tif (paths.length === 0 && build.baseStyle !== void 0) paths.push(build.baseStyle);\n\tconst imported = slotPlugins(build, slots).flatMap((plugin) => plugin.css);\n\treturn [...new Set([...imported, ...paths].map(absolute))];\n}\n/** Every file the given slots can load: their reachable files and static stylesheets, each once. */\nfunction mountAssetPaths(build, slots) {\n\treturn [...new Set(slotPlugins(build, slots).flatMap((plugin) => [...plugin.files, ...plugin.css]).map(absolute))];\n}\nconst sha256 = (value) => crypto.createHash(\"sha256\").update(value).digest(\"hex\");\n/**\n* Signs the global build once and hands each mount a composition naming its own plugins.\n*\n* Every mount of one build shares a publication id, so the bytes are counted per mount and\n* released only when the last mount leaves or moves to another build.\n*/\nfunction createWebCompositions(stateDirectory, onNotice, owner) {\n\tconst publication = createPluginBundlePublication(stateDirectory, onNotice, owner);\n\tlet shell;\n\tconst mounts = /* @__PURE__ */ new Map();\n\tconst nativeMounts = /* @__PURE__ */ new Map();\n\tconst apps = /* @__PURE__ */ new Map();\n\tconst references = /* @__PURE__ */ new Map();\n\tconst keyOf = (mount) => mount.scope === \"global\" ? \"global\" : mount.scope === \"workspace\" ? `workspace:${mount.workspaceId}` : `session:${mount.sessionId}`;\n\tconst release = (id) => {\n\t\tconst count = (references.get(id) ?? 0) - 1;\n\t\tif (count > 0) {\n\t\t\treferences.set(id, count);\n\t\t\treturn;\n\t\t}\n\t\treferences.delete(id);\n\t\tpublication.release(id);\n\t};\n\treturn {\n\t\tpublishShell(build) {\n\t\t\tshell = publication.publish(sha256(`shell:${build.key}`), build.webDirectory);\n\t\t\tif (!shell) throw new Error(\"Could not publish the global web shell.\");\n\t\t},\n\t\tshellTrust: () => shell === void 0 ? void 0 : {\n\t\t\tpublicKey: shell.signed.publicKey,\n\t\t\trevision: shell.signed.manifest.revision\n\t\t},\n\t\tpublish(mount, build, channels, slots) {\n\t\t\tconst id = sha256(`plugins:${build.key}`);\n\t\t\tconst published = publication.publish(id, build.pluginsDirectory);\n\t\t\tif (!published) throw new Error(`Could not publish ${keyOf(mount)} web composition.`);\n\t\t\tconst previous = mounts.get(keyOf(mount));\n\t\t\tif (previous?.id !== id) references.set(id, (references.get(id) ?? 0) + 1);\n\t\t\tconst revision = published.signed.manifest.revision;\n\t\t\tconst base = `/api/web-plugins/${id}/${String(revision)}`;\n\t\t\tconst signedPaths = new Set(published.signed.manifest.assets.map((asset) => asset.path));\n\t\t\tconst composition = {\n\t\t\t\tid,\n\t\t\t\tscope: mount.scope,\n\t\t\t\trevision,\n\t\t\t\tmanifestUrl: `${base}/manifest`,\n\t\t\t\trawAssetBaseUrl: `${base}/assets`,\n\t\t\t\tverifiedAssetBaseUrl: `/verified-plugins/${id}/${String(revision)}`,\n\t\t\t\tpluginEntries: slotPlugins(build, slots).map((plugin) => [plugin.slot, absolute(plugin.entry)]),\n\t\t\t\tassetPaths: mountAssetPaths(build, slots).filter((file) => signedPaths.has(file)),\n\t\t\t\tstylePaths: mountStylePaths(build, slots).filter((style) => signedPaths.has(style)),\n\t\t\t\tchannels: [...channels],\n\t\t\t\tplugins: [...slots]\n\t\t\t};\n\t\t\tmounts.set(keyOf(mount), composition);\n\t\t\tif (previous !== void 0 && previous.id !== id) release(previous.id);\n\t\t\treturn composition;\n\t\t},\n\t\tget: (mount) => mounts.get(keyOf(mount)),\n\t\tremove: (mount) => {\n\t\t\tconst previous = mounts.get(keyOf(mount));\n\t\t\tmounts.delete(keyOf(mount));\n\t\t\tif (previous) release(previous.id);\n\t\t},\n\t\t/**\n\t\t* Publishes the native composition for one mount. Signed under the `native` profile, so it can\n\t\t* never be served or verified as a web bundle. Shares reference counting with web publications.\n\t\t*/\n\t\tpublishNative(mount, build, channels, pluginIds) {\n\t\t\tconst id = sha256(`native:${build.key}`);\n\t\t\tconst published = publication.publish(id, build.pluginsDirectory, \"native\");\n\t\t\tif (!published) throw new Error(`Could not publish ${keyOf(mount)} native composition.`);\n\t\t\tconst previous = nativeMounts.get(keyOf(mount));\n\t\t\tif (previous?.id !== id) references.set(id, (references.get(id) ?? 0) + 1);\n\t\t\tconst revision = published.signed.manifest.revision;\n\t\t\tconst base = `/api/web-plugins/${id}/${String(revision)}`;\n\t\t\tconst composition = {\n\t\t\t\tid,\n\t\t\t\tscope: mount.scope,\n\t\t\t\trevision,\n\t\t\t\tmanifestUrl: `${base}/manifest`,\n\t\t\t\trawAssetBaseUrl: `${base}/assets`,\n\t\t\t\tentryPath: NATIVE_ENTRY_PATH,\n\t\t\t\tchannels: [...channels],\n\t\t\t\tplugins: [...pluginIds]\n\t\t\t};\n\t\t\tnativeMounts.set(keyOf(mount), composition);\n\t\t\tif (previous !== void 0 && previous.id !== id) release(previous.id);\n\t\t\treturn composition;\n\t\t},\n\t\tgetNative: (mount) => nativeMounts.get(keyOf(mount)),\n\t\tremoveNative: (mount) => {\n\t\t\tconst previous = nativeMounts.get(keyOf(mount));\n\t\t\tnativeMounts.delete(keyOf(mount));\n\t\t\tif (previous) release(previous.id);\n\t\t},\n\t\t/**\n\t\t* Publishes one platform's app bundle under the `app` profile, so it can never be served or\n\t\t* verified as a composition. A new key releases the previous bundle; a failure leaves it serving.\n\t\t*/\n\t\tpublishApp(platform, build) {\n\t\t\tconst id = sha256(`app:${platform}:${build.key}`);\n\t\t\tconst previous = apps.get(platform);\n\t\t\tif (previous?.id === id) return;\n\t\t\tconst published = publication.publish(id, build.directory, \"app\");\n\t\t\tif (!published) return;\n\t\t\tconst revision = published.signed.manifest.revision;\n\t\t\tconst base = `/api/web-plugins/${id}/${String(revision)}`;\n\t\t\tapps.set(platform, {\n\t\t\t\tid,\n\t\t\t\trevision,\n\t\t\t\tmanifestUrl: `${base}/manifest`,\n\t\t\t\trawAssetBaseUrl: `${base}/assets`,\n\t\t\t\tfingerprint: build.fingerprint,\n\t\t\t\t...build.builtAt === void 0 ? {} : { builtAt: build.builtAt }\n\t\t\t});\n\t\t\tif (previous !== void 0) publication.release(previous.id);\n\t\t},\n\t\tapps: () => Object.fromEntries(apps),\n\t\t/**\n\t\t* Signs `po/host-channel-key/v1` with the shell publication's signer, the key the pairing QR pins\n\t\t* as `s`. Undefined until the shell is published.\n\t\t*/\n\t\tattestHost: (fields) => shell === void 0 ? void 0 : publication.attest(HOST_CHANNEL_KEY_TAG, fields),\n\t\tpublicKey: () => publication.publicKey(),\n\t\tasync request(request) {\n\t\t\tconst url = new URL(request.url);\n\t\t\tif ((url.pathname === \"/bundle-manifest.json\" || url.pathname.startsWith(\"/bundle-assets/\")) && request.method !== \"GET\" && request.method !== \"HEAD\") return new Response(null, { status: 405 });\n\t\t\tif (url.pathname === \"/bundle-manifest.json\") {\n\t\t\t\tif (!shell) return new Response(null, { status: 404 });\n\t\t\t\treturn Response.json(shell.signed);\n\t\t\t}\n\t\t\tconst shellAsset = /^\\/bundle-assets\\/(\\d+)(\\/.*)$/u.exec(url.pathname);\n\t\t\tif (shellAsset) {\n\t\t\t\tif (!shell || Number(shellAsset[1]) !== shell.signed.manifest.revision) return new Response(null, { status: 404 });\n\t\t\t\tconst asset = shell.signed.manifest.assets.find((entry) => entry.path === shellAsset[2]);\n\t\t\t\tif (!asset) return new Response(null, { status: 404 });\n\t\t\t\tconst file = assetFile(shell.assetsDir, asset.path);\n\t\t\t\tif (!file) return new Response(null, { status: 404 });\n\t\t\t\tconst bytes = await fs.promises.readFile(file);\n\t\t\t\treturn new Response(request.method === \"HEAD\" ? null : bytes, { headers: {\n\t\t\t\t\t\"content-type\": asset.contentType,\n\t\t\t\t\t\"x-content-type-options\": \"nosniff\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tconst match = /^\\/api\\/web-plugins\\/([a-f0-9]{64})\\/(\\d+)\\/(manifest|assets(?:\\/.*)?)$/u.exec(url.pathname);\n\t\t\tif (!match) return void 0;\n\t\t\tif (request.method !== \"GET\" && request.method !== \"HEAD\") return new Response(null, { status: 405 });\n\t\t\tconst bundle = publication.get(match[1], Number(match[2]));\n\t\t\tif (!bundle) return Response.json({ error: \"Plugin generation not found.\" }, { status: 404 });\n\t\t\tif (match[3] === \"manifest\") return Response.json(bundle.signed);\n\t\t\tconst assetPath = match[3].slice(6);\n\t\t\tconst asset = bundle.signed.manifest.assets.find((candidate) => candidate.path === assetPath);\n\t\t\tif (!asset) return Response.json({ error: \"Plugin asset not found.\" }, { status: 404 });\n\t\t\tconst file = assetFile(bundle.assetsDir, asset.path);\n\t\t\tif (!file) return Response.json({ error: \"Plugin asset not found.\" }, { status: 404 });\n\t\t\tconst bytes = await fs.promises.readFile(file);\n\t\t\treturn new Response(request.method === \"HEAD\" ? null : bytes, { headers: {\n\t\t\t\t\"content-type\": asset.contentType,\n\t\t\t\t\"cache-control\": \"private, max-age=31536000, immutable\",\n\t\t\t\t\"x-content-type-options\": \"nosniff\"\n\t\t\t} });\n\t\t},\n\t\tclose() {\n\t\t\tmounts.clear();\n\t\t\tnativeMounts.clear();\n\t\t\tapps.clear();\n\t\t\treferences.clear();\n\t\t\tpublication.close();\n\t\t}\n\t};\n}\n//#endregion\nexport { createWebCompositions, mountAssetPaths, mountStylePaths, reapAbandonedPublications };\n\n//# sourceMappingURL=webCompositions.mjs.map","import { defineServiceContract } from \"./serverScope.mjs\";\n//#region src/schemas/workspaceSandboxes.ts\nconst PO_WORKSPACE_SANDBOXES_SERVICE = \"po/workspace-sandboxes\";\n/** Global-scope contract: the server provides it, a root's global plugin registers into it. */\nconst PO_WORKSPACE_SANDBOXES_CONTRACT = defineServiceContract(PO_WORKSPACE_SANDBOXES_SERVICE, { scope: \"global\" });\nfunction readPoWorkspaceSandboxes(context) {\n\treturn context.get(PO_WORKSPACE_SANDBOXES_SERVICE);\n}\n//#endregion\nexport { PO_WORKSPACE_SANDBOXES_CONTRACT, PO_WORKSPACE_SANDBOXES_SERVICE, readPoWorkspaceSandboxes };\n\n//# sourceMappingURL=workspaceSandboxes.mjs.map","//#region src/services/workspaceSandboxes/index.ts\n/** An in-memory sandbox provider registry; `close` ends registration and keeps what was registered. */\nfunction createWorkspaceSandboxRegistry() {\n\tconst providers = /* @__PURE__ */ new Map();\n\tlet closed = false;\n\treturn {\n\t\tregister(provider) {\n\t\t\tif (closed) throw new Error(`Sandbox provider \"${provider.id}\" registered after the registry closed.`);\n\t\t\tif (provider.id === \"\") throw new Error(\"A sandbox provider needs an id.\");\n\t\t\tif (providers.has(provider.id)) throw new Error(`Sandbox provider \"${provider.id}\" is already registered.`);\n\t\t\tproviders.set(provider.id, provider);\n\t\t\treturn () => {\n\t\t\t\tif (providers.get(provider.id) === provider) providers.delete(provider.id);\n\t\t\t};\n\t\t},\n\t\tget: (id) => providers.get(id),\n\t\tlist: () => [...providers.values()],\n\t\tclose() {\n\t\t\tclosed = true;\n\t\t}\n\t};\n}\n//#endregion\nexport { createWorkspaceSandboxRegistry };\n\n//# sourceMappingURL=index.mjs.map","import { Type } from \"typebox\";\n//#region src/schemas/mode.ts\nconst MINOR_MODE_CATALOG_SOURCE = \"@agimon-ai/po/mode-catalog\";\nconst PO_MINOR_MODE_CATALOG_SERVICE = \"po/minor-mode-catalog\";\nconst MINOR_MODE_TOOL_NAME = \"minor_mode\";\nconst MINOR_MODE_ACTION_TIMEOUT_MS = 3e4;\nconst MINOR_MODE_MAX_RECORDS = 128;\nconst MINOR_MODE_MAX_ACTIONS = 16;\nconst MINOR_MODE_MAX_PARAMETERS = 16;\nconst MINOR_MODE_MAX_ENUM_CHOICES = 32;\nconst MINOR_MODE_MAX_ARGUMENT_LENGTH = 4096;\nconst MAX_SOURCE_LENGTH = 128;\nconst MAX_ID_LENGTH = 128;\nconst MAX_GENERATION_LENGTH = 256;\nconst MAX_LABEL_LENGTH = 48;\nconst MAX_DESCRIPTION_LENGTH = 240;\nconst MAX_DETAIL_LENGTH = 160;\nconst MINOR_MODE_ERROR_CODE = {\n\tactionAborted: \"MINOR_MODE_ACTION_ABORTED\",\n\tactionDisabled: \"MINOR_MODE_ACTION_DISABLED\",\n\tactionNotFound: \"MINOR_MODE_ACTION_NOT_FOUND\",\n\tactionTimeout: \"MINOR_MODE_ACTION_TIMEOUT\",\n\tinvalidArguments: \"MINOR_MODE_INVALID_ARGUMENTS\",\n\tmodeBusy: \"MINOR_MODE_BUSY\",\n\tmodeNotFound: \"MINOR_MODE_NOT_FOUND\",\n\townerFailed: \"MINOR_MODE_OWNER_FAILED\",\n\tregistrationConflict: \"MINOR_MODE_REGISTRATION_CONFLICT\",\n\tsessionReplaced: \"MINOR_MODE_SESSION_REPLACED\",\n\tstaleRegistration: \"MINOR_MODE_STALE_REGISTRATION\",\n\tunsupportedContext: \"MINOR_MODE_UNSUPPORTED_CONTEXT\"\n};\nconst MinorModeSourceSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: MAX_SOURCE_LENGTH,\n\tpattern: \"^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$\"\n});\nconst MinorModeIdSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: MAX_ID_LENGTH,\n\tpattern: \"^[a-z0-9][a-z0-9._:-]*$\"\n});\nconst MinorModeParameterNameSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: MAX_ID_LENGTH,\n\tpattern: \"^[a-z][A-Za-z0-9._:-]*$\"\n});\nconst GenerationSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: MAX_GENERATION_LENGTH\n});\nconst LabelSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: MAX_LABEL_LENGTH\n});\nconst DescriptionSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: MAX_DESCRIPTION_LENGTH\n});\nconst OperationIdSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: MAX_GENERATION_LENGTH\n});\nconst ModeTextColorSchema = Type.Union([\n\tType.Literal(\"accent\"),\n\tType.Literal(\"warning\"),\n\tType.Literal(\"mdHeading\"),\n\tType.Literal(\"muted\"),\n\tType.Literal(\"dim\")\n]);\nconst MinorModeSessionKindSchema = Type.Union([Type.Literal(\"tui\"), Type.Literal(\"headless\")]);\nconst MinorModeActivationSchema = Type.Union([\n\tType.Literal(\"inactive\"),\n\tType.Literal(\"activating\"),\n\tType.Literal(\"active\"),\n\tType.Literal(\"deactivating\")\n]);\nconst MinorModeConditionSchema = Type.Union([\n\tType.Literal(\"ready\"),\n\tType.Literal(\"paused\"),\n\tType.Literal(\"blocked\"),\n\tType.Literal(\"limited\"),\n\tType.Literal(\"queued\"),\n\tType.Literal(\"degraded\"),\n\tType.Literal(\"failed\")\n]);\nconst MinorModeScalarSchema = Type.Union([\n\tType.String({ maxLength: MINOR_MODE_MAX_ARGUMENT_LENGTH }),\n\tType.Number(),\n\tType.Boolean()\n]);\nconst ParameterBase = {\n\tname: MinorModeParameterNameSchema,\n\tlabel: LabelSchema,\n\tdescription: Type.Optional(DescriptionSchema),\n\trequired: Type.Boolean()\n};\nconst MinorModeActionParameterSchema = Type.Union([\n\tType.Object({\n\t\t...ParameterBase,\n\t\tkind: Type.Literal(\"string\"),\n\t\tminLength: Type.Optional(Type.Integer({\n\t\t\tminimum: 0,\n\t\t\tmaximum: MINOR_MODE_MAX_ARGUMENT_LENGTH\n\t\t})),\n\t\tmaxLength: Type.Optional(Type.Integer({\n\t\t\tminimum: 1,\n\t\t\tmaximum: MINOR_MODE_MAX_ARGUMENT_LENGTH\n\t\t}))\n\t}, { additionalProperties: false }),\n\tType.Object({\n\t\t...ParameterBase,\n\t\tkind: Type.Literal(\"number\"),\n\t\tinteger: Type.Optional(Type.Boolean()),\n\t\tminimum: Type.Optional(Type.Number()),\n\t\tmaximum: Type.Optional(Type.Number())\n\t}, { additionalProperties: false }),\n\tType.Object({\n\t\t...ParameterBase,\n\t\tkind: Type.Literal(\"boolean\")\n\t}, { additionalProperties: false }),\n\tType.Object({\n\t\t...ParameterBase,\n\t\tkind: Type.Literal(\"enum\"),\n\t\tchoices: Type.Array(Type.Object({\n\t\t\tvalue: Type.String({\n\t\t\t\tminLength: 1,\n\t\t\t\tmaxLength: MAX_ID_LENGTH\n\t\t\t}),\n\t\t\tlabel: LabelSchema\n\t\t}, { additionalProperties: false }), {\n\t\t\tminItems: 1,\n\t\t\tmaxItems: 32\n\t\t})\n\t}, { additionalProperties: false })\n]);\nconst MinorModeActionDescriptorSchema = Type.Object({\n\tid: MinorModeIdSchema,\n\tlabel: LabelSchema,\n\tdescription: DescriptionSchema,\n\tcontexts: Type.Array(MinorModeSessionKindSchema, {\n\t\tminItems: 1,\n\t\tmaxItems: 2,\n\t\tuniqueItems: true\n\t}),\n\tparameters: Type.Array(MinorModeActionParameterSchema, { maxItems: 16 })\n}, { additionalProperties: false });\nconst MinorModeDescriptorSchema = Type.Object({\n\tsource: MinorModeSourceSchema,\n\tid: MinorModeIdSchema,\n\tlabel: LabelSchema,\n\tdescription: DescriptionSchema,\n\torder: Type.Integer({\n\t\tminimum: 0,\n\t\tmaximum: 1e3\n\t}),\n\tactions: Type.Array(MinorModeActionDescriptorSchema, { maxItems: 16 })\n}, { additionalProperties: false });\nconst MinorModeActionAvailabilitySchema = Type.Object({\n\tid: MinorModeIdSchema,\n\tenabled: Type.Boolean(),\n\tdisabledReason: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: MAX_DETAIL_LENGTH\n\t}))\n}, { additionalProperties: false });\nconst MinorModeStateSchema = Type.Object({\n\tactivation: MinorModeActivationSchema,\n\tcondition: MinorModeConditionSchema,\n\tdetail: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: MAX_DETAIL_LENGTH\n\t})),\n\tcolor: Type.Optional(ModeTextColorSchema),\n\tmodelContextVariant: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: MAX_ID_LENGTH\n\t})),\n\tactions: Type.Array(MinorModeActionAvailabilitySchema, { maxItems: 16 })\n}, { additionalProperties: false });\nconst MinorModeRegistrationRefSchema = Type.Object({\n\tsource: MinorModeSourceSchema,\n\tid: MinorModeIdSchema,\n\townerGeneration: GenerationSchema,\n\tregistrationId: GenerationSchema\n}, { additionalProperties: false });\nconst MinorModeRecordSchema = Type.Object({\n\tdescriptor: MinorModeDescriptorSchema,\n\tstate: MinorModeStateSchema,\n\townerGeneration: GenerationSchema,\n\tregistrationId: GenerationSchema,\n\tstateRevision: Type.Integer({ minimum: 0 })\n}, { additionalProperties: false });\nconst MinorModeCatalogSnapshotSchema = Type.Object({\n\thostGeneration: GenerationSchema,\n\trevision: Type.Integer({ minimum: 0 }),\n\tmodes: Type.Array(MinorModeRecordSchema, { maxItems: 128 })\n}, { additionalProperties: false });\nconst MinorModeArgumentsSchema = Type.Record(MinorModeParameterNameSchema, MinorModeScalarSchema, { maxProperties: 16 });\nconst MinorModeToolInputSchema = Type.Object({\n\taction: Type.Union([Type.Literal(\"list\"), Type.Literal(\"invoke\")]),\n\tsource: Type.Optional(MinorModeSourceSchema),\n\tid: Type.Optional(MinorModeIdSchema),\n\townerGeneration: Type.Optional(GenerationSchema),\n\tregistrationId: Type.Optional(GenerationSchema),\n\tmodeAction: Type.Optional(MinorModeIdSchema),\n\targuments: Type.Optional(MinorModeArgumentsSchema)\n}, { additionalProperties: false });\nconst MinorModeToolResultSchema = Type.Unknown();\nconst MinorModeActionRequestSchema = Type.Object({\n\toperationId: OperationIdSchema,\n\tmode: MinorModeRegistrationRefSchema,\n\tactionId: MinorModeIdSchema,\n\targuments: MinorModeArgumentsSchema\n}, { additionalProperties: false });\nconst MinorModeActionResponseSchema = Type.Object({\n\toperationId: OperationIdSchema,\n\tcatalogRevision: Type.Integer({ minimum: 0 }),\n\tmode: MinorModeRecordSchema,\n\tmessage: Type.Optional(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: MAX_DETAIL_LENGTH\n\t}))\n}, { additionalProperties: false });\n/**\n* The custom session entry the catalog host journals whenever its projection\n* changes. It rides Pi's entry_appended frames, so any RPC client (the web\n* cockpit) sees minor-mode state live and on replay without a new protocol.\n*/\nconst PO_MINOR_MODE_ENTRY_TYPE = \"po-minor-modes\";\nfunction readMinorModeCatalog(context) {\n\treturn context.get(PO_MINOR_MODE_CATALOG_SERVICE);\n}\nfunction requireMinorModeCatalog(context) {\n\tconst catalog = readMinorModeCatalog(context);\n\tif (!catalog) throw new Error(\"Po minor-mode catalog is unavailable.\");\n\treturn catalog;\n}\n//#endregion\nexport { ModeTextColorSchema as A, MinorModeRegistrationRefSchema as C, MinorModeStateSchema as D, MinorModeSourceSchema as E, PO_MINOR_MODE_ENTRY_TYPE as M, readMinorModeCatalog as N, MinorModeToolInputSchema as O, requireMinorModeCatalog as P, MinorModeRecordSchema as S, MinorModeSessionKindSchema as T, MinorModeCatalogSnapshotSchema as _, MINOR_MODE_MAX_ARGUMENT_LENGTH as a, MinorModeIdSchema as b, MINOR_MODE_MAX_RECORDS as c, MinorModeActionDescriptorSchema as d, MinorModeActionParameterSchema as f, MinorModeArgumentsSchema as g, MinorModeActivationSchema as h, MINOR_MODE_MAX_ACTIONS as i, PO_MINOR_MODE_CATALOG_SERVICE as j, MinorModeToolResultSchema as k, MINOR_MODE_TOOL_NAME as l, MinorModeActionResponseSchema as m, MINOR_MODE_CATALOG_SOURCE as n, MINOR_MODE_MAX_ENUM_CHOICES as o, MinorModeActionRequestSchema as p, MINOR_MODE_ERROR_CODE as r, MINOR_MODE_MAX_PARAMETERS as s, MINOR_MODE_ACTION_TIMEOUT_MS as t, MinorModeActionAvailabilitySchema as u, MinorModeConditionSchema as v, MinorModeScalarSchema as w, MinorModeParameterNameSchema as x, MinorModeDescriptorSchema as y };\n\n//# sourceMappingURL=mode-CKUTHAVr.mjs.map","import { Worker } from \"node:worker_threads\";\nimport path from \"node:path\";\nimport { sign } from \"node:crypto\";\nimport { connect } from \"node:http2\";\nimport { request } from \"node:https\";\n//#region src/services/shellTitleController/mainThread.ts\nconst BRAILLE_FRAMES = [\n\t\"⠋\",\n\t\"⠙\",\n\t\"⠹\",\n\t\"⠸\",\n\t\"⠼\",\n\t\"⠴\",\n\t\"⠦\",\n\t\"⠧\",\n\t\"⠇\",\n\t\"⠏\"\n];\n/** Animates on the main thread, for hosts where a worker could not be started. */\nfunction createMainThreadTitleController() {\n\tlet frameIndex = 0;\n\tlet timer;\n\tconst stopAnimation = () => {\n\t\tif (timer) clearInterval(timer);\n\t\ttimer = void 0;\n\t\tframeIndex = 0;\n\t};\n\treturn {\n\t\tset(title, write) {\n\t\t\tstopAnimation();\n\t\t\twrite(title);\n\t\t},\n\t\tstart(title, write) {\n\t\t\tstopAnimation();\n\t\t\tconst render = () => {\n\t\t\t\twrite(`${BRAILLE_FRAMES[frameIndex % BRAILLE_FRAMES.length]} ${title}`);\n\t\t\t\tframeIndex += 1;\n\t\t\t};\n\t\t\trender();\n\t\t\ttimer = setInterval(render, 80);\n\t\t},\n\t\tstop(title, write) {\n\t\t\tstopAnimation();\n\t\t\twrite(title);\n\t\t},\n\t\tdispose(title, write) {\n\t\t\tstopAnimation();\n\t\t\twrite(title);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/services/shellTitleController/index.ts\n/**\n* The animator runs off the main thread so a busy agent turn cannot stall the\n* spinner. It is an inline eval source rather than a shipped file because the\n* package is bundled per entry, and a separate worker module would have to be\n* located on disk at runtime.\n*/\nconst TITLE_WORKER_SOURCE = `\nconst { writeSync } = require('node:fs');\nconst { parentPort, workerData } = require('node:worker_threads');\nlet frameIndex = 0;\nlet timer;\nconst writeTitle = (title) => writeSync(1, '\\\\u001b]0;' + title + '\\\\u0007');\nconst stop = () => {\n  if (timer) clearInterval(timer);\n  timer = undefined;\n  frameIndex = 0;\n};\nparentPort.on('message', (command) => {\n  stop();\n  if (command.action === 'start') {\n    const render = () => {\n      writeTitle(workerData.frames[frameIndex % workerData.frames.length] + ' ' + command.title);\n      frameIndex += 1;\n    };\n    render();\n    timer = setInterval(render, workerData.intervalMs);\n    return;\n  }\n  writeTitle(command.title);\n  if (command.action === 'dispose') parentPort.close();\n});\n`;\n/**\n* Animates from a worker thread, replaying the last command on the main thread\n* if the worker never started, failed, or exited under us. The worker is\n* unreferenced so a pending frame never holds the process open.\n*/\nfunction createWorkerTitleController() {\n\tconst fallback = createMainThreadTitleController();\n\tlet lastCommand;\n\tlet lastWrite;\n\tlet worker;\n\tconst fallBack = () => {\n\t\tworker = void 0;\n\t\tif (!lastCommand || !lastWrite) return;\n\t\tfallback[lastCommand.action](lastCommand.title, lastWrite);\n\t};\n\ttry {\n\t\tconst titleWorker = new Worker(TITLE_WORKER_SOURCE, {\n\t\t\teval: true,\n\t\t\tworkerData: {\n\t\t\t\tframes: BRAILLE_FRAMES,\n\t\t\t\tintervalMs: 80\n\t\t\t}\n\t\t});\n\t\ttitleWorker.unref();\n\t\ttitleWorker.once(\"error\", fallBack);\n\t\ttitleWorker.once(\"exit\", (code) => {\n\t\t\tif (code !== 0 && worker === titleWorker) fallBack();\n\t\t});\n\t\tworker = titleWorker;\n\t} catch {\n\t\tworker = void 0;\n\t}\n\tconst dispatch = (command, write) => {\n\t\tlastCommand = command;\n\t\tlastWrite = write;\n\t\tif (!worker) {\n\t\t\tfallback[command.action](command.title, write);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tworker.postMessage(command);\n\t\t} catch {\n\t\t\tfallBack();\n\t\t}\n\t};\n\treturn {\n\t\tset: (title, write) => dispatch({\n\t\t\taction: \"set\",\n\t\t\ttitle\n\t\t}, write),\n\t\tstart: (title, write) => dispatch({\n\t\t\taction: \"start\",\n\t\t\ttitle\n\t\t}, write),\n\t\tstop: (title, write) => dispatch({\n\t\t\taction: \"stop\",\n\t\t\ttitle\n\t\t}, write),\n\t\tdispose: (title, write) => dispatch({\n\t\t\taction: \"dispose\",\n\t\t\ttitle\n\t\t}, write)\n\t};\n}\n//#endregion\n//#region src/services/notificationText/index.ts\nconst ATTENTION_SUBTITLE = \"Approval or feedback required\";\nconst ATTENTION_TITLE = \"Po needs your input\";\nconst ELLIPSIS = \"…\";\nconst MAX_BODY_LENGTH = 240;\nconst MAX_PROMPT_TITLE_LENGTH = 36;\nconst SETTLED_BODY = \"The agent finished its work and is waiting for you.\";\nconst SETTLED_TITLE = \"Po finished\";\nconst SHELL_TITLE_SEPARATOR = \" - \";\nconst SHELL_TITLE_PREFIX = \"π\";\nfunction collapseWhitespace(value) {\n\treturn value.replace(/\\s+/g, \" \").trim();\n}\nfunction truncate(value, maxLength) {\n\treturn value.length > maxLength ? `${value.slice(0, maxLength - 1)}${ELLIPSIS}` : value;\n}\n/** The first user prompt, shortened to fit a shell tab. A blank prompt names nothing. */\nfunction promptTitle(prompt) {\n\tconst normalized = collapseWhitespace(prompt);\n\treturn normalized ? truncate(normalized, MAX_PROMPT_TITLE_LENGTH) : void 0;\n}\n/**\n* The idle shell-tab title: `π - <label> - <repository>`.\n*\n* The session name wins over the first prompt because the user chose it. With\n* neither, the repository alone still tells two tabs apart.\n*/\nfunction shellTabTitle({ cwd, sessionName, prompt }) {\n\tconst repository = path.basename(cwd);\n\tconst label = sessionName ?? prompt;\n\treturn label ? `${SHELL_TITLE_PREFIX}${SHELL_TITLE_SEPARATOR}${label}${SHELL_TITLE_SEPARATOR}${repository}` : `${SHELL_TITLE_PREFIX}${SHELL_TITLE_SEPARATOR}${repository}`;\n}\n/** Notification bodies are one line in a system panel, so they collapse and truncate. */\nfunction notificationBody(body) {\n\treturn truncate(collapseWhitespace(body), MAX_BODY_LENGTH);\n}\n/** Sent while the agent holds the turn and something is blocking on the user. */\nfunction attentionNotification(body) {\n\treturn {\n\t\ttitle: ATTENTION_TITLE,\n\t\tsubtitle: ATTENTION_SUBTITLE,\n\t\tbody\n\t};\n}\n/** Sent once a run has stopped, subtitled with whichever name the user recognises. */\nfunction settledNotification({ cwd, sessionName }) {\n\treturn {\n\t\ttitle: SETTLED_TITLE,\n\t\tsubtitle: sessionName ?? path.basename(cwd),\n\t\tbody: SETTLED_BODY\n\t};\n}\n//#endregion\n//#region src/services/systemNotification/index.ts\nconst CMUX_COMMAND = \"cmux\";\nconst COMMAND_TIMEOUT_MS = 3e3;\nconst DARWIN_PLATFORM = \"darwin\";\nconst OSASCRIPT_COMMAND = \"osascript\";\nconst OSASCRIPT_EXPRESSION_FLAG = \"-e\";\nasync function execute(pi, command, args) {\n\ttry {\n\t\treturn (await pi.exec(command, args, { timeout: COMMAND_TIMEOUT_MS })).code === 0;\n\t} catch {\n\t\treturn false;\n\t}\n}\n/**\n* Delivers one desktop notification on a best-effort basis.\n*\n* cmux is tried first because it routes the notification to the window the\n* session actually lives in. Only macOS has a second option worth attempting,\n* and a host with neither stays silent rather than failing the turn.\n*/\nasync function sendSystemNotification(pi, notification, platform = process.platform) {\n\tconst body = notificationBody(notification.body);\n\tif (await execute(pi, CMUX_COMMAND, [\n\t\t\"notify\",\n\t\t\"--title\",\n\t\tnotification.title,\n\t\t\"--subtitle\",\n\t\tnotification.subtitle,\n\t\t\"--body\",\n\t\tbody\n\t]) || platform !== DARWIN_PLATFORM) return;\n\tawait execute(pi, OSASCRIPT_COMMAND, [\n\t\tOSASCRIPT_EXPRESSION_FLAG,\n\t\t\"on run argv\",\n\t\tOSASCRIPT_EXPRESSION_FLAG,\n\t\t\"display notification (item 3 of argv) with title (item 1 of argv) subtitle (item 2 of argv)\",\n\t\tOSASCRIPT_EXPRESSION_FLAG,\n\t\t\"end run\",\n\t\tnotification.title,\n\t\tnotification.subtitle,\n\t\tbody\n\t]);\n}\n//#endregion\n//#region src/services/nativePushSender/sync.ts\nconst MAX_RESPONSE_BYTES = 65536;\nfunction signPushJwt(header, claims, key, algorithm) {\n\tconst input = [header, claims].map((part) => Buffer.from(JSON.stringify(part)).toString(\"base64url\")).join(\".\");\n\tconst signature = sign(\"sha256\", Buffer.from(input), {\n\t\tkey,\n\t\tdsaEncoding: \"ieee-p1363\"\n\t});\n\tif (algorithm === \"ES256\" && signature.length !== 64) throw new Error(\"Invalid signing key\");\n\treturn `${input}.${signature.toString(\"base64url\")}`;\n}\nfunction createPushTransport() {\n\tconst pending = /* @__PURE__ */ new Set();\n\treturn {\n\t\trequest(input) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst url = new URL(input.url);\n\t\t\t\tlet size = 0;\n\t\t\t\tconst chunks = [];\n\t\t\t\tlet done = false;\n\t\t\t\tlet dispose = () => {};\n\t\t\t\tconst finish = (error, status = 0) => {\n\t\t\t\t\tif (done) return;\n\t\t\t\t\tdone = true;\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tpending.delete(cancel);\n\t\t\t\t\tdispose();\n\t\t\t\t\tif (error) reject(error);\n\t\t\t\t\telse resolve({\n\t\t\t\t\t\tstatus,\n\t\t\t\t\t\tbody: Buffer.concat(chunks).toString(\"utf8\")\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tconst cancel = () => finish(/* @__PURE__ */ new Error(\"Push request cancelled\"));\n\t\t\t\tconst timer = setTimeout(() => finish(/* @__PURE__ */ new Error(\"Push request timed out\")), input.timeoutMs);\n\t\t\t\tpending.add(cancel);\n\t\t\t\tconst data = (chunk) => {\n\t\t\t\t\tsize += chunk.length;\n\t\t\t\t\tif (size > MAX_RESPONSE_BYTES) finish(/* @__PURE__ */ new Error(\"Push response too large\"));\n\t\t\t\t\telse chunks.push(Buffer.from(chunk));\n\t\t\t\t};\n\t\t\t\tif (input.http2) {\n\t\t\t\t\tconst session = connect(url.origin);\n\t\t\t\t\tdispose = () => session.destroy();\n\t\t\t\t\tsession.on(\"error\", (error) => finish(error));\n\t\t\t\t\tconst stream = session.request({\n\t\t\t\t\t\t\":method\": \"POST\",\n\t\t\t\t\t\t\":path\": url.pathname,\n\t\t\t\t\t\t...input.headers\n\t\t\t\t\t});\n\t\t\t\t\tlet status = 0;\n\t\t\t\t\tstream.on(\"response\", (headers) => {\n\t\t\t\t\t\tstatus = Number(headers[\":status\"]);\n\t\t\t\t\t});\n\t\t\t\t\tstream.on(\"data\", data);\n\t\t\t\t\tstream.on(\"error\", (error) => finish(error));\n\t\t\t\t\tstream.on(\"end\", () => finish(void 0, status));\n\t\t\t\t\tstream.end(input.body);\n\t\t\t\t} else {\n\t\t\t\t\tconst req = request(url, {\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: input.headers\n\t\t\t\t\t}, (response) => {\n\t\t\t\t\t\tresponse.on(\"data\", data);\n\t\t\t\t\t\tresponse.on(\"error\", (error) => finish(error));\n\t\t\t\t\t\tresponse.on(\"end\", () => finish(void 0, response.statusCode));\n\t\t\t\t\t});\n\t\t\t\t\tdispose = () => req.destroy();\n\t\t\t\t\treq.on(\"error\", (error) => finish(error));\n\t\t\t\t\treq.end(input.body);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tclose() {\n\t\t\tfor (const cancel of pending) cancel();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/services/nativePushSender/index.ts\nconst MAX_PAYLOAD_BYTES = 4096;\nconst APNS_TOPIC = \"ai.po.app\";\nconst APNS_REASONS = /* @__PURE__ */ new Set([\n\t\"BadCollapseId\",\n\t\"BadDeviceToken\",\n\t\"BadExpirationDate\",\n\t\"BadMessageId\",\n\t\"BadPriority\",\n\t\"BadTopic\",\n\t\"DeviceTokenNotForTopic\",\n\t\"DuplicateHeaders\",\n\t\"IdleTimeout\",\n\t\"InvalidPushType\",\n\t\"MissingDeviceToken\",\n\t\"MissingTopic\",\n\t\"PayloadEmpty\",\n\t\"TopicDisallowed\",\n\t\"BadCertificate\",\n\t\"BadCertificateEnvironment\",\n\t\"ExpiredProviderToken\",\n\t\"Forbidden\",\n\t\"InvalidProviderToken\",\n\t\"MissingProviderToken\",\n\t\"BadPath\",\n\t\"MethodNotAllowed\",\n\t\"Unregistered\",\n\t\"PayloadTooLarge\",\n\t\"TooManyProviderTokenUpdates\",\n\t\"TooManyRequests\",\n\t\"InternalServerError\",\n\t\"ServiceUnavailable\",\n\t\"Shutdown\"\n]);\nconst OAUTH_URL = \"https://oauth2.googleapis.com/token\";\nconst FCM_ERROR_TYPE = \"type.googleapis.com/google.firebase.fcm.v1.FcmError\";\nconst encoder = new TextEncoder();\nfunction parse(body) {\n\ttry {\n\t\tconst value = JSON.parse(body);\n\t\treturn value && typeof value === \"object\" ? value : {};\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction payload(notification, build) {\n\tconst text = {\n\t\ttitle: notification.title,\n\t\tsubtitle: notification.subtitle,\n\t\tbody: notification.body\n\t};\n\tlet result = JSON.stringify(build(text));\n\tfor (const field of [\n\t\t\"body\",\n\t\t\"subtitle\",\n\t\t\"title\"\n\t]) {\n\t\tif (encoder.encode(result).length <= MAX_PAYLOAD_BYTES) break;\n\t\tconst points = Array.from(text[field]);\n\t\tlet low = 0;\n\t\tlet high = points.length;\n\t\twhile (low < high) {\n\t\t\tconst middle = Math.ceil((low + high) / 2);\n\t\t\ttext[field] = points.slice(0, middle).join(\"\");\n\t\t\tif (encoder.encode(JSON.stringify(build(text))).length <= MAX_PAYLOAD_BYTES) low = middle;\n\t\t\telse high = middle - 1;\n\t\t}\n\t\ttext[field] = points.slice(0, low).join(\"\");\n\t\tresult = JSON.stringify(build(text));\n\t}\n\tif (encoder.encode(result).length > MAX_PAYLOAD_BYTES) throw new Error(\"Push payload too large\");\n\treturn result;\n}\nfunction createNativePushSender(options) {\n\tconst transport = createPushTransport();\n\tconst request = options.request ?? transport.request;\n\tconst now = options.now ?? Date.now;\n\tconst timeoutMs = Number.isFinite(options.timeoutMs) ? Math.max(1, Math.min(options.timeoutMs, 3e4)) : 1e4;\n\tlet closed = false;\n\tlet apnsJwt;\n\tlet oauth;\n\tlet oauthPending;\n\tasync function accessToken() {\n\t\tif (oauth && now() < oauth.expires) return oauth.value;\n\t\tif (oauthPending) return oauthPending;\n\t\toauthPending = (async () => {\n\t\t\tconst credentials = options.fcm;\n\t\t\tconst issued = Math.floor(now() / 1e3);\n\t\t\tconst assertion = signPushJwt({\n\t\t\t\talg: \"RS256\",\n\t\t\t\ttyp: \"JWT\"\n\t\t\t}, {\n\t\t\t\tiss: credentials.clientEmail,\n\t\t\t\tscope: \"https://www.googleapis.com/auth/firebase.messaging\",\n\t\t\t\taud: OAUTH_URL,\n\t\t\t\tiat: issued,\n\t\t\t\texp: issued + 3600\n\t\t\t}, credentials.privateKey, \"RS256\");\n\t\t\tconst response = await request({\n\t\t\t\turl: OAUTH_URL,\n\t\t\t\theaders: { \"content-type\": \"application/x-www-form-urlencoded\" },\n\t\t\t\tbody: new URLSearchParams({\n\t\t\t\t\tgrant_type: \"urn:ietf:params:oauth:grant-type:jwt-bearer\",\n\t\t\t\t\tassertion\n\t\t\t\t}).toString(),\n\t\t\t\ttimeoutMs\n\t\t\t});\n\t\t\tconst data = parse(response.body);\n\t\t\tif (response.status !== 200 || typeof data.access_token !== \"string\" || !data.access_token || typeof data.expires_in !== \"number\" || !Number.isFinite(data.expires_in) || data.expires_in <= 0) throw new Error(\"OAuth failed\");\n\t\t\toauth = {\n\t\t\t\tvalue: data.access_token,\n\t\t\t\texpires: now() + Math.max(0, Math.min(data.expires_in, 3600) - 60) * 1e3\n\t\t\t};\n\t\t\treturn oauth.value;\n\t\t})();\n\t\ttry {\n\t\t\treturn await oauthPending;\n\t\t} finally {\n\t\t\toauthPending = void 0;\n\t\t}\n\t}\n\treturn {\n\t\tasync send(registration, notification, sessionId) {\n\t\t\tconst provider = registration.platform === \"ios\" ? \"apns\" : \"fcm\";\n\t\t\tif (closed || !options[provider]) {\n\t\t\t\toptions.diagnostic?.({\n\t\t\t\t\tprovider,\n\t\t\t\t\toutcome: \"unavailable\"\n\t\t\t\t});\n\t\t\t\treturn { invalid: false };\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst data = {\n\t\t\t\t\t...registration.hostRef ? { hostRef: registration.hostRef } : {},\n\t\t\t\t\t...sessionId ? { sessionId } : {}\n\t\t\t\t};\n\t\t\t\tlet response;\n\t\t\t\tlet reason;\n\t\t\t\tif (registration.platform === \"ios\") {\n\t\t\t\t\tconst credentials = options.apns;\n\t\t\t\t\tif (!apnsJwt || now() >= apnsJwt.expires) apnsJwt = {\n\t\t\t\t\t\tvalue: signPushJwt({\n\t\t\t\t\t\t\talg: \"ES256\",\n\t\t\t\t\t\t\tkid: credentials.keyId\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tiss: credentials.teamId,\n\t\t\t\t\t\t\tiat: Math.floor(now() / 1e3)\n\t\t\t\t\t\t}, credentials.key, \"ES256\"),\n\t\t\t\t\t\texpires: now() + 3e6\n\t\t\t\t\t};\n\t\t\t\t\tresponse = await request({\n\t\t\t\t\t\turl: `https://${registration.environment === \"development\" ? \"api.sandbox.push.apple.com\" : \"api.push.apple.com\"}/3/device/${encodeURIComponent(registration.token)}`,\n\t\t\t\t\t\thttp2: true,\n\t\t\t\t\t\ttimeoutMs,\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tauthorization: `bearer ${apnsJwt.value}`,\n\t\t\t\t\t\t\t\"apns-topic\": APNS_TOPIC,\n\t\t\t\t\t\t\t\"apns-push-type\": \"alert\",\n\t\t\t\t\t\t\t\"apns-priority\": \"10\",\n\t\t\t\t\t\t\t\"apns-expiration\": \"0\",\n\t\t\t\t\t\t\t\"content-type\": \"application/json\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: payload(notification, (text) => ({\n\t\t\t\t\t\t\taps: {\n\t\t\t\t\t\t\t\talert: text,\n\t\t\t\t\t\t\t\tsound: \"default\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\tbody: data\n\t\t\t\t\t\t}))\n\t\t\t\t\t});\n\t\t\t\t\tconst value = parse(response.body).reason;\n\t\t\t\t\tif (typeof value === \"string\" && APNS_REASONS.has(value)) reason = value;\n\t\t\t\t\tif (response.status === 410 && reason === \"Unregistered\" || response.status === 400 && reason === \"BadDeviceToken\") {\n\t\t\t\t\t\toptions.diagnostic?.({\n\t\t\t\t\t\t\tprovider,\n\t\t\t\t\t\t\toutcome: \"invalid\",\n\t\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\t\t...reason ? { reason } : {}\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn { invalid: true };\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst body = payload(notification, (text) => ({ message: {\n\t\t\t\t\t\ttoken: registration.token,\n\t\t\t\t\t\tdata,\n\t\t\t\t\t\tnotification: {\n\t\t\t\t\t\t\ttitle: text.title,\n\t\t\t\t\t\t\tbody: [text.subtitle, text.body].filter(Boolean).join(\"\\n\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tandroid: {\n\t\t\t\t\t\t\tttl: \"0s\",\n\t\t\t\t\t\t\tpriority: \"HIGH\",\n\t\t\t\t\t\t\tnotification: { channel_id: \"po-notifications\" }\n\t\t\t\t\t\t}\n\t\t\t\t\t} }));\n\t\t\t\t\tconst token = await accessToken();\n\t\t\t\t\tif (closed) return { invalid: false };\n\t\t\t\t\tresponse = await request({\n\t\t\t\t\t\turl: `https://fcm.googleapis.com/v1/projects/${encodeURIComponent(options.fcm.projectId)}/messages:send`,\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tauthorization: `Bearer ${token}`,\n\t\t\t\t\t\t\t\"content-type\": \"application/json\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody,\n\t\t\t\t\t\ttimeoutMs\n\t\t\t\t\t});\n\t\t\t\t\tconst error = parse(response.body).error;\n\t\t\t\t\tif (response.status === 404 && error && typeof error === \"object\" && \"details\" in error && Array.isArray(error.details) && error.details.some((detail) => detail && typeof detail === \"object\" && \"@type\" in detail && detail[\"@type\"] === FCM_ERROR_TYPE && \"errorCode\" in detail && detail.errorCode === \"UNREGISTERED\")) {\n\t\t\t\t\t\toptions.diagnostic?.({\n\t\t\t\t\t\t\tprovider,\n\t\t\t\t\t\t\toutcome: \"invalid\",\n\t\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\t\t...reason ? { reason } : {}\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn { invalid: true };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (response.status < 200 || response.status >= 300) options.diagnostic?.({\n\t\t\t\t\tprovider,\n\t\t\t\t\toutcome: \"failed\",\n\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t...reason ? { reason } : {}\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\toptions.diagnostic?.({\n\t\t\t\t\tprovider,\n\t\t\t\t\toutcome: \"failed\"\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn { invalid: false };\n\t\t},\n\t\tclose() {\n\t\t\tclosed = true;\n\t\t\tapnsJwt = void 0;\n\t\t\toauth = void 0;\n\t\t\ttransport.close();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/services/notificationPolicy/index.ts\nconst DEFAULT_ASK_USER_BODY = \"The agent is waiting for your feedback.\";\nconst RPC_MODE = \"rpc\";\n/**\n* A dialog is worth interrupting the user for only while the agent holds the turn.\n*\n* Outside a run the user opened the dialog themselves and is already looking at\n* it. An ask-user prompt is announced by its own event, so the dialog it then\n* opens must stay silent or the same question notifies twice.\n*/\nfunction warrantsAttentionNotification({ agentRunning, askUserBlocked }) {\n\treturn agentRunning && !askUserBlocked;\n}\n/** A queued follow-up means the agent keeps working, so the run has not stopped for the user. */\nfunction warrantsSettledNotification(hasPendingMessages) {\n\treturn !hasPendingMessages;\n}\n/** Terminal title escapes only mean something on an attached terminal; RPC output stays clean. */\nfunction supportsShellTitle({ hasUI, mode }) {\n\treturn hasUI && mode !== RPC_MODE;\n}\n/** The question an ask-user prompt is blocking on, or a stand-in when it asked none. */\nfunction askUserPromptBody(questions) {\n\treturn questions[0]?.question ?? DEFAULT_ASK_USER_BODY;\n}\n//#endregion\nexport { askUserPromptBody, attentionNotification, createMainThreadTitleController, createNativePushSender, createWorkerTitleController, notificationBody, promptTitle, sendSystemNotification, settledNotification, shellTabTitle, supportsShellTitle, warrantsAttentionNotification, warrantsSettledNotification };\n\n//# sourceMappingURL=index.mjs.map","import { Type } from \"typebox\";\nimport { Check, Errors } from \"typebox/value\";\n//#region src/schemas/mcpProjection.ts\n/** Schema revision of the neutral MCP projection shared across Po packages. */\nconst PO_MCP_PROJECTION_VERSION = 1;\n/** The portable MCP document revision represented by `agent-plugin-v1`. */\nconst AGENT_PLUGIN_MCP_SCHEMA_URL = \"https://agent-plugins.org/schemas/1.0.0/mcp.schema.json\";\n/** Cordis service name for the immutable MCP projection of one Pi session. */\nconst PO_MCP_PROJECTION_SERVICE = \"po/mcp-projection\";\n/** Session-local provider for MCP resources selected by domain. */\nconst PO_MCP_PROJECTION_RESOLVER_SERVICE = \"po/mcp-projection-resolver\";\nconst PoMcpProjectionAllowlistSchema = Type.Object({\n\tservers: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tproxy: Type.Optional(Type.Array(Type.String({ minLength: 1 })))\n}, { additionalProperties: false });\n/**\n* The person's own MCP config in their Po home, loaded into every repository's sessions.\n* A repository entry with the same name wins over it.\n*/\nconst PO_USER_MCP_CONFIG_FILE = \"mcp.json\";\nconst PoMcpNativeProjectionSourceSchema = Type.Object({\n\tsourceId: Type.String({ minLength: 1 }),\n\towner: Type.Union([\n\t\tType.Literal(\"user\"),\n\t\tType.Literal(\"repository\"),\n\t\tType.Literal(\"plugin\")\n\t]),\n\tformat: Type.Literal(\"native\"),\n\tconfigPath: Type.String({ minLength: 1 }),\n\tcontentDigest: Type.String({ minLength: 1 })\n}, { additionalProperties: false });\nconst PoMcpAgentPluginProjectionSourceSchema = Type.Object({\n\tsourceId: Type.String({ minLength: 1 }),\n\towner: Type.Literal(\"plugin\"),\n\tformat: Type.Literal(\"agent-plugin-v1\"),\n\tconfigPath: Type.String({ minLength: 1 }),\n\tcontentDigest: Type.String({ minLength: 1 }),\n\tpluginId: Type.String({ minLength: 1 }),\n\tpluginRoot: Type.String({ minLength: 1 }),\n\tpluginDataDirectory: Type.String({ minLength: 1 }),\n\tmcpSchemaUrl: Type.Literal(AGENT_PLUGIN_MCP_SCHEMA_URL)\n}, { additionalProperties: false });\n/** One native Po layer or one portable Agent Plugin MCP document. */\nconst PoMcpProjectionSourceSchema = Type.Union([PoMcpNativeProjectionSourceSchema, PoMcpAgentPluginProjectionSourceSchema]);\nconst PoMcpProjectionSchema = Type.Object({\n\tversion: Type.Literal(1),\n\tenabled: Type.Boolean(),\n\t/** Content identity supplied by the projection producer. */\n\tfingerprint: Type.String({ minLength: 1 }),\n\trepoRoot: Type.String({ minLength: 1 }),\n\tstagingDirectory: Type.String({ minLength: 1 }),\n\tgeneratedConfigPath: Type.Optional(Type.String({ minLength: 1 })),\n\tsources: Type.Array(PoMcpProjectionSourceSchema),\n\tallowlist: Type.Optional(PoMcpProjectionAllowlistSchema)\n}, { additionalProperties: false });\nfunction deepFreeze(value) {\n\tif (typeof value !== \"object\" || value === null || Object.isFrozen(value)) return value;\n\tfor (const child of Object.values(value)) deepFreeze(child);\n\treturn Object.freeze(value);\n}\nfunction projectionError(value) {\n\tconst [first] = Errors(PoMcpProjectionSchema, value);\n\treturn /* @__PURE__ */ new Error(`Invalid Po MCP projection${first ? ` at ${first.instancePath || \"/\"}: ${first.message}` : \"\"}`);\n}\n/** Runtime guard used when a projection crosses a JSON persistence boundary. */\nfunction isPoMcpProjection(value) {\n\treturn Check(PoMcpProjectionSchema, value);\n}\n/**\n* Builds the explicit fail-closed state used when a Po session has no MCP\n* projection. The root and staging path remain visible for diagnostics, while\n* the empty source list prevents an MCP consumer from falling back to cwd.\n*/\nfunction createDisabledPoMcpProjection({ repoRoot, stagingDirectory }) {\n\treturn deepFreeze({\n\t\tversion: 1,\n\t\tenabled: false,\n\t\tfingerprint: JSON.stringify({\n\t\t\tversion: 1,\n\t\t\tenabled: false,\n\t\t\trepoRoot\n\t\t}),\n\t\trepoRoot,\n\t\tstagingDirectory,\n\t\tsources: []\n\t});\n}\n/** Creates a generation-bound, immutable Cordis service value. */\nfunction createPoMcpProjectionService({ sessionId, generation, projection }) {\n\tif (!sessionId) throw new Error(\"Po MCP projection service requires a session id\");\n\tif (!generation) throw new Error(\"Po MCP projection service requires a generation\");\n\tif (!isPoMcpProjection(projection)) throw projectionError(projection);\n\tconst snapshot = deepFreeze(structuredClone(projection));\n\treturn Object.freeze({\n\t\tsessionId,\n\t\tgeneration,\n\t\tgetSnapshot: () => snapshot\n\t});\n}\n/** Reads the MCP projection provider from one Po session's Cordis root. */\nfunction readPoMcpProjectionService(root) {\n\treturn root.get(PO_MCP_PROJECTION_SERVICE);\n}\n/** Reads the MCP projection provider or reports that the Po session is incomplete. */\nfunction requirePoMcpProjectionService(root) {\n\tconst service = readPoMcpProjectionService(root);\n\tif (!service) throw new Error(\"Po MCP projection is unavailable. Load the Po Config core.\");\n\treturn service;\n}\n//#endregion\nexport { AGENT_PLUGIN_MCP_SCHEMA_URL, PO_MCP_PROJECTION_RESOLVER_SERVICE, PO_MCP_PROJECTION_SERVICE, PO_MCP_PROJECTION_VERSION, PO_USER_MCP_CONFIG_FILE, PoMcpAgentPluginProjectionSourceSchema, PoMcpNativeProjectionSourceSchema, PoMcpProjectionAllowlistSchema, PoMcpProjectionSchema, PoMcpProjectionSourceSchema, createDisabledPoMcpProjection, createPoMcpProjectionService, isPoMcpProjection, readPoMcpProjectionService, requirePoMcpProjectionService };\n\n//# sourceMappingURL=mcpProjection.mjs.map","import { PoMcpProjectionSourceSchema } from \"./mcpProjection.mjs\";\nimport { Type } from \"typebox\";\nimport { Check, Errors } from \"typebox/value\";\n//#region src/schemas/mcpSession.ts\n/** Environment variable carrying the neutral MCP session wire document. */\nconst PO_MCP_SESSION_ENV_VAR = \"PO_MCP_SESSION\";\nconst PoMcpSessionAllowlistSchema = Type.Object({\n\tservers: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tproxy: Type.Optional(Type.Array(Type.String({ minLength: 1 })))\n}, { additionalProperties: false });\nconst PoMcpSessionConfigSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean()),\n\trepoRoot: Type.String({ minLength: 1 }),\n\tstagingDirectory: Type.String({ minLength: 1 }),\n\tgeneratedConfigPath: Type.Optional(Type.String({ minLength: 1 })),\n\tpluginConfigPaths: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n\tsources: Type.Optional(Type.Array(PoMcpProjectionSourceSchema)),\n\tallowlist: Type.Optional(PoMcpSessionAllowlistSchema)\n}, { additionalProperties: false });\nfunction sessionConfigError(value) {\n\tconst [first] = Errors(PoMcpSessionConfigSchema, value);\n\treturn /* @__PURE__ */ new Error(`Invalid Po MCP session config${first ? ` at ${first.instancePath || \"/\"}: ${first.message}` : \"\"}`);\n}\n/** Serializes one validated session document for a child process boundary. */\nfunction serializePoMcpSessionConfig(config) {\n\tif (!Check(PoMcpSessionConfigSchema, config)) throw sessionConfigError(config);\n\treturn JSON.stringify(config);\n}\n/** Parses a session wire document. Invalid input resolves to the fail-closed absence state. */\nfunction parsePoMcpSessionConfig(value) {\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(value);\n\t} catch {\n\t\treturn;\n\t}\n\treturn Check(PoMcpSessionConfigSchema, parsed) ? parsed : void 0;\n}\n/** Reads a session document without adding feature-specific fallback policy. */\nfunction readPoMcpSessionConfig(environment) {\n\tconst value = environment[PO_MCP_SESSION_ENV_VAR];\n\treturn value === void 0 ? void 0 : parsePoMcpSessionConfig(value);\n}\n/** Builds the environment fragment inherited by an MCP-enabled child process. */\nfunction poMcpSessionEnvironment(config) {\n\treturn { [PO_MCP_SESSION_ENV_VAR]: serializePoMcpSessionConfig(config) };\n}\n//#endregion\nexport { PO_MCP_SESSION_ENV_VAR, PoMcpSessionAllowlistSchema, PoMcpSessionConfigSchema, parsePoMcpSessionConfig, poMcpSessionEnvironment, readPoMcpSessionConfig, serializePoMcpSessionConfig };\n\n//# sourceMappingURL=mcpSession.mjs.map","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { expandDomainNames, loadDomains, loadDomainsAsync } from \"@agimon-ai/po-config/domains\";\nimport { parse, stringify } from \"yaml\";\n//#region src/services/mcpFilter/core.ts\n/** Server name in .mcp.json whose upstreams are declared in mcp-config.yaml. */\nconst PROXY_SERVER_NAME = \"agiflow-proxy\";\nconst PROXY_CONFIG_FILE = \"mcp-config.yaml\";\nconst CONFIG_ARGUMENT = \"--config\";\n/** Drops servers that are not on the allowlist. An empty list means keep all. */\nfunction filterMcpServers(config, allowed) {\n\tif (!allowed || allowed.length === 0) return config;\n\tconst servers = config.mcpServers ?? {};\n\tconst kept = {};\n\tfor (const [name, definition] of Object.entries(servers)) if (allowed.includes(name)) kept[name] = definition;\n\treturn {\n\t\t...config,\n\t\tmcpServers: kept\n\t};\n}\n/**\n* Rewrites the proxy's upstream list, keeping only allowed servers.\n*\n* Entries are removed rather than marked disabled so a filtered upstream cannot\n* be reached even if the proxy ignores the disabled flag. Comments in the\n* source file are not preserved; the result is a per-run temporary file.\n*/\nfunction filterProxyConfig(yamlText, allowed) {\n\tif (!allowed || allowed.length === 0) return yamlText;\n\tconst config = parse(yamlText) ?? {};\n\tconst servers = config.mcpServers ?? {};\n\tconst kept = {};\n\tconst dropped = [];\n\tfor (const [name, definition] of Object.entries(servers)) if (allowed.includes(name)) kept[name] = definition;\n\telse dropped.push(name);\n\treturn `${[\n\t\t\"# Generated by po for this run. Do not edit.\",\n\t\t`# Upstreams kept: ${Object.keys(kept).join(\", \") || \"(none)\"}`,\n\t\t`# Upstreams removed by the domain allowlist: ${dropped.join(\", \") || \"(none)\"}`,\n\t\t\"\"\n\t].join(\"\\n\")}${stringify({\n\t\t...config,\n\t\tmcpServers: kept\n\t})}`;\n}\n/**\n* Unions the mcp allowlists of the selected domains in a loaded manifest.\n*\n* Returns undefined when any selected domain omits `mcp`, which means \"give me\n* everything\". Filtering only kicks in once every selected domain has opted in,\n* so a domain that has not been migrated yet cannot silently lose its tools.\n*/\nfunction mcpAllowlistOf(manifest, domainNames) {\n\tconst expanded = expandDomainNames(manifest, domainNames);\n\tif (expanded.length === 0) return void 0;\n\tconst servers = /* @__PURE__ */ new Set();\n\tconst proxy = /* @__PURE__ */ new Set();\n\tfor (const name of expanded) {\n\t\tconst allowlist = manifest.domains[name]?.mcp;\n\t\tif (!allowlist) return void 0;\n\t\tfor (const server of allowlist.servers ?? []) servers.add(server);\n\t\tfor (const upstream of allowlist.proxy ?? []) proxy.add(upstream);\n\t}\n\treturn {\n\t\tservers: [...servers],\n\t\tproxy: [...proxy]\n\t};\n}\n/** `resolveMcpAllowlist` over an injected FileSystem. */\nasync function resolveMcpAllowlistAsync(fs, repoRoot, domainNames, context, homeDirectory) {\n\treturn mcpAllowlistOf(await loadDomainsAsync(fs, repoRoot, context, homeDirectory), domainNames);\n}\n//#endregion\n//#region src/services/mcpFilter/index.ts\n/**\n* Unions the mcp allowlists of the selected domains; see `mcpAllowlistOf`.\n*\n* Node-only: reads domains through the sync config shim. Use `resolveMcpAllowlistAsync` with a FileSystem.\n*/\nfunction resolveMcpAllowlist(repoRoot, domainNames) {\n\treturn mcpAllowlistOf(loadDomains(repoRoot), domainNames);\n}\nasync function copyFileIfPresent(source, target) {\n\ttry {\n\t\tawait fs.promises.copyFile(source, target);\n\t\treturn true;\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") return false;\n\t\tthrow error;\n\t}\n}\n/**\n* Copies a generated MCP config out of the run directory so another frontend\n* can use it, keeping the proxy's --config pointing at the copy.\n*\n* The run directory is deleted when the harness exits, so emitting for\n* claude.sh or codex.sh has to relocate both files together.\n*/\nasync function persistMcpConfig(sourceConfigPath, temporaryDirectory, targetDirectory) {\n\tawait fs.promises.mkdir(targetDirectory, { recursive: true });\n\tconst config = JSON.parse(await fs.promises.readFile(sourceConfigPath, \"utf8\"));\n\tconst servers = config.mcpServers ?? {};\n\tconst proxy = servers[PROXY_SERVER_NAME];\n\tconst generatedProxyConfig = path.join(temporaryDirectory, PROXY_CONFIG_FILE);\n\tif (proxy) {\n\t\tconst args = [...proxy.args ?? []];\n\t\tconst configIndex = args.indexOf(CONFIG_ARGUMENT);\n\t\tif (configIndex !== -1) {\n\t\t\tconst targetProxyConfig = path.join(targetDirectory, PROXY_CONFIG_FILE);\n\t\t\tif (await copyFileIfPresent(generatedProxyConfig, targetProxyConfig)) {\n\t\t\t\targs[configIndex + 1] = targetProxyConfig;\n\t\t\t\tservers[PROXY_SERVER_NAME] = {\n\t\t\t\t\t...proxy,\n\t\t\t\t\targs\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\tconst targetPath = path.join(targetDirectory, \"mcp.json\");\n\tawait fs.promises.writeFile(targetPath, `${JSON.stringify({\n\t\t...config,\n\t\tmcpServers: servers\n\t}, null, 2)}\\n`, { mode: 384 });\n\treturn targetPath;\n}\n/**\n* Applies the allowlist to a merged MCP config, writing a filtered proxy config\n* into the run directory and repointing the proxy at it when needed.\n*/\nasync function applyMcpAllowlist(config, allowlist, repoRoot, temporaryDirectory) {\n\tif (!allowlist) return config;\n\tconst filtered = filterMcpServers(config, allowlist.servers);\n\tconst servers = filtered.mcpServers ?? {};\n\tconst proxy = servers[PROXY_SERVER_NAME];\n\tif (!proxy || !allowlist.proxy || allowlist.proxy.length === 0) return filtered;\n\tconst args = [...proxy.args ?? []];\n\tconst configIndex = args.indexOf(CONFIG_ARGUMENT);\n\tif (configIndex === -1 || !args[configIndex + 1]) return filtered;\n\tconst sourcePath = path.resolve(repoRoot, args[configIndex + 1]);\n\tlet sourceConfig;\n\ttry {\n\t\tsourceConfig = await fs.promises.readFile(sourcePath, \"utf8\");\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") return filtered;\n\t\tthrow error;\n\t}\n\tconst targetPath = path.join(temporaryDirectory, PROXY_CONFIG_FILE);\n\tawait fs.promises.writeFile(targetPath, filterProxyConfig(sourceConfig, allowlist.proxy), { mode: 384 });\n\targs[configIndex + 1] = targetPath;\n\treturn {\n\t\t...filtered,\n\t\tmcpServers: {\n\t\t\t...servers,\n\t\t\t[PROXY_SERVER_NAME]: {\n\t\t\t\t...proxy,\n\t\t\t\targs\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\nexport { filterMcpServers as a, PROXY_SERVER_NAME as i, persistMcpConfig as n, filterProxyConfig as o, resolveMcpAllowlist as r, resolveMcpAllowlistAsync as s, applyMcpAllowlist as t };\n\n//# sourceMappingURL=mcpFilter-CKUbKmxz.mjs.map","import path from \"node:path\";\nimport { getOrThrow, nodeHost, writeFileAtomic } from \"@agimon-ai/po-core/platform\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport { AGENT_PLUGIN_MCP_SCHEMA_URL } from \"@agimon-ai/po-core/mcpProjection\";\nimport fs from \"node:fs\";\n//#region src/services/agentPluginMcp/normalize.ts\n/** Pure Agent Plugin MCP normalisation shared by the async API and the deprecated Node-only sync shim. */\n/** Same token grammar as node:http `validateHeaderName` (RFC 9110 tchar). */\nconst HTTP_TOKEN = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/u;\n/** Same rejected characters as node:http `validateHeaderValue`. */\nconst INVALID_HEADER_VALUE_CHARACTER = /[^\\t\\x20-\\x7e\\x80-\\xff]/u;\nconst IPV4_OCTET = \"(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\";\nconst IPV4_ADDRESS = new RegExp(`^${IPV4_OCTET}(?:\\\\.${IPV4_OCTET}){3}$`, \"u\");\nfunction isIPv4(value) {\n\treturn IPV4_ADDRESS.test(value);\n}\nconst RESERVED_ENVIRONMENT_KEYS = /* @__PURE__ */ new Set([\"PLUGIN_ROOT\", \"PLUGIN_DATA\"]);\nconst PROXY_SERVER_ALIASES = /* @__PURE__ */ new Set([\"mcp-proxy\", \"agiflow-proxy\"]);\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction onlyKeys(value, allowed, label) {\n\tconst unexpected = Object.keys(value).find((key) => !allowed.includes(key));\n\tif (unexpected) throw new Error(`${label} contains unsupported field \"${unexpected}\"`);\n}\nfunction nonEmptyString(value, label) {\n\tif (typeof value !== \"string\" || value.length === 0) throw new Error(`${label} must be a non-empty string`);\n\treturn value;\n}\nfunction optionalStringArray(value, label) {\n\tif (value === void 0) return void 0;\n\tif (!Array.isArray(value)) throw new Error(`${label} must be an array of strings`);\n\treturn value.map((item, index) => {\n\t\tif (typeof item !== \"string\") throw new Error(`${label}[${index}] must be a string`);\n\t\treturn item;\n\t});\n}\nfunction optionalStringRecord(value, label) {\n\tif (value === void 0) return void 0;\n\tif (!isObject(value)) throw new Error(`${label} must be an object of string values`);\n\treturn Object.fromEntries(Object.entries(value).map(([key, item]) => {\n\t\tif (typeof item !== \"string\") throw new Error(`${label}.${key} must be a string`);\n\t\treturn [key, item];\n\t}));\n}\nfunction expandPluginPlaceholders(value, pluginRoot, pluginDataDirectory) {\n\treturn value.replace(/\\$\\{PLUGIN_(ROOT|DATA)\\}/gu, (placeholder) => placeholder === \"${PLUGIN_ROOT}\" ? pluginRoot : pluginDataDirectory);\n}\nfunction isInside(root, candidate) {\n\tconst relative = path.relative(root, candidate);\n\treturn relative === \"\" || !relative.startsWith(`..${path.sep}`) && relative !== \"..\" && !path.isAbsolute(relative);\n}\nfunction normalizeEnvironment(value, pluginRoot, pluginDataDirectory) {\n\tconst declared = optionalStringRecord(value, \"env\") ?? {};\n\tfor (const key of Object.keys(declared)) {\n\t\tconst reservedKey = process.platform === \"win32\" ? key.toUpperCase() : key;\n\t\tif (RESERVED_ENVIRONMENT_KEYS.has(reservedKey)) throw new Error(`env key \"${key}\" is reserved by Agent Plugins`);\n\t}\n\treturn {\n\t\t...Object.fromEntries(Object.entries(declared).map(([key, item]) => [key, expandPluginPlaceholders(item, pluginRoot, pluginDataDirectory)])),\n\t\tPLUGIN_ROOT: pluginRoot,\n\t\tPLUGIN_DATA: pluginDataDirectory\n\t};\n}\nfunction isLoopbackHost(hostname) {\n\tconst bareHostname = hostname.startsWith(\"[\") && hostname.endsWith(\"]\") ? hostname.slice(1, -1) : hostname;\n\tif (bareHostname.toLowerCase() === \"localhost\") return true;\n\tif (isIPv4(bareHostname)) return bareHostname.split(\".\")[0] === \"127\";\n\treturn bareHostname === \"::1\";\n}\nfunction normalizeUrl(value) {\n\tconst raw = nonEmptyString(value, \"url\");\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(raw);\n\t} catch {\n\t\tthrow new Error(\"url must be an absolute HTTP(S) URL\");\n\t}\n\tif (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") throw new Error(\"url must use http or https\");\n\tif (parsed.username || parsed.password) throw new Error(\"url must not contain user information\");\n\tif (parsed.hash) throw new Error(\"url must not contain a fragment\");\n\tif (parsed.protocol === \"http:\" && !isLoopbackHost(parsed.hostname)) throw new Error(\"non-loopback MCP URLs must use https\");\n\treturn raw;\n}\nfunction normalizeHeaders(value) {\n\tconst headers = optionalStringRecord(value, \"headers\");\n\tif (!headers) return void 0;\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const [name, item] of Object.entries(headers)) {\n\t\tconst canonical = name.toLowerCase();\n\t\tif (seen.has(canonical)) throw new Error(`headers contain duplicate name \"${name}\"`);\n\t\tseen.add(canonical);\n\t\tif (!HTTP_TOKEN.test(name) || INVALID_HEADER_VALUE_CHARACTER.test(item)) throw new Error(`header \"${name}\" is invalid`);\n\t}\n\treturn headers;\n}\nfunction stagedInternalPath(source, contents, stagingDirectory) {\n\tconst digest = createHash(\"sha256\").update(source.sourceId).update(\"\\0\").update(source.contentDigest).update(\"\\0\").update(contents).digest(\"hex\").slice(0, 20);\n\treturn path.join(stagingDirectory, `agent-plugin-mcp-${digest}.internal.json`);\n}\nfunction emptyResult(diagnostic) {\n\treturn {\n\t\tclaudeConfig: { mcpServers: {} },\n\t\tserverNames: [],\n\t\tdroppedServers: [],\n\t\tdiagnostics: [diagnostic]\n\t};\n}\nfunction sourceLabel(source) {\n\treturn `Agent Plugin MCP source \"${source.sourceId}\"`;\n}\n/** Checks the projection identity before any file is touched. */\nfunction assertProjectionSource(source) {\n\tif (source.mcpSchemaUrl !== AGENT_PLUGIN_MCP_SCHEMA_URL) throw new Error(`unsupported schema \"${String(source.mcpSchemaUrl)}\"`);\n\tif (!path.isAbsolute(source.pluginRoot) || !path.isAbsolute(source.pluginDataDirectory)) throw new Error(\"pluginRoot and pluginDataDirectory must be absolute\");\n}\nfunction assertRootConfigPath(configPath, pluginRoot) {\n\tif (path.dirname(configPath) !== pluginRoot || path.basename(configPath) !== \"mcp.json\") throw new Error(\"portable plugin config must be root mcp.json\");\n}\n/** Verifies the digest and document shape of the raw mcp.json bytes; returns its server map. */\nfunction parseMcpDocument(source, bytes, label) {\n\tif (createHash(\"sha256\").update(bytes).digest(\"hex\") !== source.contentDigest) throw new Error(\"content digest does not match the projection\");\n\tconst parsed = JSON.parse(new TextDecoder(\"utf-8\", { ignoreBOM: true }).decode(bytes));\n\tif (!isObject(parsed)) throw new Error(\"document must be an object\");\n\tonlyKeys(parsed, [\"$schema\", \"mcpServers\"], label);\n\tif (parsed.$schema !== source.mcpSchemaUrl) throw new Error(\"$schema does not match the projected schema\");\n\tif (!isObject(parsed.mcpServers)) throw new Error(\"mcpServers must be an object\");\n\treturn parsed.mcpServers;\n}\n/** Whether a declared server is skipped (empty name), dropped by the allowlist or wrapper rule, or normalised. */\nfunction serverDisposition(name, options) {\n\tif (!name) return \"empty\";\n\tconst allowed = options.allowedServers;\n\tconst keepAll = !allowed || allowed.length === 0;\n\tconst stripProxyWrappers = options.stripProxyWrappers ?? true;\n\tif (!keepAll && !allowed.includes(name) || stripProxyWrappers && PROXY_SERVER_ALIASES.has(name)) return \"dropped\";\n\treturn \"keep\";\n}\nfunction emptyServerDiagnostic(label) {\n\treturn `${label} contains an empty server name; that entry was skipped.`;\n}\nfunction skippedServerDiagnostic(label, name, error) {\n\treturn `${label} skipped server \"${name}\": ${error instanceof Error ? error.message : String(error)}`;\n}\nfunction disabledResult(label, error) {\n\treturn emptyResult(`${label} was disabled: ${error instanceof Error ? error.message : String(error)}`);\n}\n/** The declared transport of one server; stdio declarations are also checked for unsupported fields. */\nfunction serverType(raw, name) {\n\tif (!isObject(raw)) throw new Error(\"definition must be an object\");\n\tconst type = nonEmptyString(raw.type, \"type\");\n\tif (type === \"stdio\") onlyKeys(raw, [\n\t\t\"type\",\n\t\t\"command\",\n\t\t\"args\",\n\t\t\"env\",\n\t\t\"cwd\"\n\t], `server \"${name}\"`);\n\treturn type;\n}\nfunction stdioServer(name, config) {\n\treturn {\n\t\tinternal: {\n\t\t\tname,\n\t\t\ttransport: \"stdio\",\n\t\t\tconfig\n\t\t},\n\t\tclaude: {\n\t\t\ttype: \"stdio\",\n\t\t\t...config\n\t\t}\n\t};\n}\n/** A streamable-http or sse server; any other type is unsupported. */\nfunction remoteServer(raw, name, type) {\n\tif (type === \"streamable-http\" || type === \"sse\") {\n\t\tonlyKeys(raw, [\n\t\t\t\"type\",\n\t\t\t\"url\",\n\t\t\t\"headers\"\n\t\t], `server \"${name}\"`);\n\t\tconst url = normalizeUrl(raw.url);\n\t\tconst headers = normalizeHeaders(raw.headers);\n\t\tconst transport = type === \"streamable-http\" ? \"http\" : \"sse\";\n\t\tconst config = {\n\t\t\turl,\n\t\t\t...headers ? { headers } : {}\n\t\t};\n\t\treturn {\n\t\t\tinternal: {\n\t\t\t\tname,\n\t\t\t\ttransport,\n\t\t\t\tconfig\n\t\t\t},\n\t\t\tclaude: {\n\t\t\t\ttype: transport,\n\t\t\t\t...config\n\t\t\t}\n\t\t};\n\t}\n\tthrow new Error(`unsupported transport type \"${type}\"`);\n}\nfunction stagedContents(internalServers) {\n\treturn `${JSON.stringify({ mcpServers: internalServers }, null, 2)}\\n`;\n}\nfunction stagedCacheKey(source, configPath, contents) {\n\treturn createHash(\"sha256\").update(\"agent-plugin-v1\\0\").update(source.sourceId).update(\"\\0\").update(source.contentDigest).update(\"\\0\").update(configPath).update(\"\\0\").update(contents).digest(\"hex\");\n}\n/** The containment base and expanded path of a declared cwd, or undefined when the plugin root is the default. */\nfunction workingDirectoryCandidate(declared, pluginRoot, pluginDataDirectory) {\n\tif (declared === void 0) return void 0;\n\tconst cwd = nonEmptyString(declared, \"cwd\");\n\tif (cwd.startsWith(\"./\")) return {\n\t\tbase: pluginRoot,\n\t\tcandidate: path.resolve(pluginRoot, cwd)\n\t};\n\tconst expanded = expandPluginPlaceholders(cwd, pluginRoot, pluginDataDirectory);\n\tif (cwd === \"${PLUGIN_ROOT}\" || cwd.startsWith(\"${PLUGIN_ROOT}/\")) return {\n\t\tbase: pluginRoot,\n\t\tcandidate: path.resolve(expanded)\n\t};\n\tif (cwd === \"${PLUGIN_DATA}\" || cwd.startsWith(\"${PLUGIN_DATA}/\")) return {\n\t\tbase: pluginDataDirectory,\n\t\tcandidate: path.resolve(expanded)\n\t};\n\tthrow new Error(\"cwd must start with ./, ${PLUGIN_ROOT}, or ${PLUGIN_DATA}\");\n}\n/** Rejects a command that is neither a bare executable name nor a ./ path; true when it must be resolved. */\nfunction isPluginRelativeCommand(command) {\n\tif (command.startsWith(\"./\")) return true;\n\tif (command === \".\" || command === \"..\" || /[\\s/\\\\]/u.test(command)) throw new Error(\"command must be a bare executable name or a ./ path inside the plugin\");\n\treturn false;\n}\n//#endregion\n//#region src/services/agentPluginMcp/sync.ts\nfunction realContainedPath$1(root, candidate, label) {\n\tlet realCandidate;\n\ttry {\n\t\trealCandidate = fs.realpathSync(candidate);\n\t} catch {\n\t\tthrow new Error(`${label} does not exist`);\n\t}\n\tif (!isInside(root, realCandidate)) throw new Error(`${label} escapes its allowed plugin directory`);\n\treturn realCandidate;\n}\nfunction normalizeCommand$1(command, pluginRoot) {\n\tif (!isPluginRelativeCommand(command)) return command;\n\tconst resolved = realContainedPath$1(pluginRoot, path.resolve(pluginRoot, command), \"command\");\n\tif (!fs.statSync(resolved).isFile()) throw new Error(\"command must resolve to a regular file\");\n\ttry {\n\t\tfs.accessSync(resolved, fs.constants.X_OK);\n\t} catch {\n\t\tthrow new Error(\"command must resolve to an executable file\");\n\t}\n\treturn resolved;\n}\nfunction normalizeWorkingDirectory$1(declared, pluginRoot, pluginDataDirectory) {\n\tconst declaredCwd = workingDirectoryCandidate(declared, pluginRoot, pluginDataDirectory);\n\tif (!declaredCwd) return pluginRoot;\n\tconst resolved = realContainedPath$1(declaredCwd.base, declaredCwd.candidate, \"cwd\");\n\tif (!fs.statSync(resolved).isDirectory()) throw new Error(\"cwd must resolve to a directory\");\n\treturn resolved;\n}\nfunction normalizeServer$1(raw, pluginRoot, pluginDataDirectory, name) {\n\tconst type = serverType(raw, name);\n\tconst declaration = raw;\n\tif (type !== \"stdio\") return remoteServer(declaration, name, type);\n\tconst command = normalizeCommand$1(nonEmptyString(declaration.command, \"command\"), pluginRoot);\n\tconst args = optionalStringArray(declaration.args, \"args\")?.map((item) => expandPluginPlaceholders(item, pluginRoot, pluginDataDirectory));\n\tconst env = normalizeEnvironment(declaration.env, pluginRoot, pluginDataDirectory);\n\tconst cwd = normalizeWorkingDirectory$1(declaration.cwd, pluginRoot, pluginDataDirectory);\n\treturn stdioServer(name, {\n\t\tcommand,\n\t\t...args ? { args } : {},\n\t\tenv,\n\t\tcwd\n\t});\n}\nfunction writeStagedInternalConfig$1(target, contents, stagingDirectory) {\n\tfs.mkdirSync(stagingDirectory, {\n\t\tmode: 448,\n\t\trecursive: true\n\t});\n\tfs.chmodSync(stagingDirectory, 448);\n\tconst temporaryPath = `${target}.${process.pid}-${randomUUID()}.tmp`;\n\ttry {\n\t\tfs.writeFileSync(temporaryPath, contents, {\n\t\t\tflag: \"wx\",\n\t\t\tmode: 384\n\t\t});\n\t\ttry {\n\t\t\tfs.renameSync(temporaryPath, target);\n\t\t} catch (error) {\n\t\t\tconst code = error.code;\n\t\t\tif (code !== \"EEXIST\" && code !== \"EPERM\") throw error;\n\t\t\tconst stat = fs.lstatSync(target);\n\t\t\tif (stat.isSymbolicLink() || !stat.isFile() || fs.readFileSync(target, \"utf8\") !== contents) throw new Error(\"content-addressed staging path is occupied by different content\");\n\t\t}\n\t\tfs.chmodSync(target, 384);\n\t} finally {\n\t\tfs.rmSync(temporaryPath, { force: true });\n\t}\n}\n/**\n* Validates one Agent Plugins v1 `mcp.json` and stages a native mcp-proxy layer.\n*\n* Server validation is isolated: one malformed server is diagnosed and skipped.\n* Document/schema, source identity, or plugin-boundary failures reject the whole\n* source. Only the two portable plugin placeholders are expanded; the staged\n* layer is tagged `internal`, so legacy `${ENV}` interpolation cannot run again.\n*\n* @deprecated Node-only sync shim; use normalizeAgentPluginMcpSourceAsync. Removed in M2.\n*/\nfunction normalizeAgentPluginMcpSource(source, options) {\n\tconst label = sourceLabel(source);\n\ttry {\n\t\tassertProjectionSource(source);\n\t\tconst pluginRoot = fs.realpathSync(source.pluginRoot);\n\t\ttry {\n\t\t\tconst dataStat = fs.lstatSync(source.pluginDataDirectory);\n\t\t\tif (dataStat.isSymbolicLink() || !dataStat.isDirectory()) throw new Error(\"pluginDataDirectory must be a real directory\");\n\t\t} catch (error) {\n\t\t\tif (error.code !== \"ENOENT\") throw error;\n\t\t\tfs.mkdirSync(source.pluginDataDirectory, {\n\t\t\t\tmode: 448,\n\t\t\t\trecursive: true\n\t\t\t});\n\t\t}\n\t\tfs.chmodSync(source.pluginDataDirectory, 448);\n\t\tfs.accessSync(source.pluginDataDirectory, fs.constants.W_OK);\n\t\tconst pluginDataDirectory = fs.realpathSync(source.pluginDataDirectory);\n\t\tconst configPath = realContainedPath$1(pluginRoot, source.configPath, \"mcp.json\");\n\t\tassertRootConfigPath(configPath, pluginRoot);\n\t\tconst servers = parseMcpDocument(source, fs.readFileSync(configPath), label);\n\t\tconst internalServers = Object.create(null);\n\t\tconst claudeServers = Object.create(null);\n\t\tconst droppedServers = [];\n\t\tconst diagnostics = [];\n\t\tfor (const [name, rawServer] of Object.entries(servers)) {\n\t\t\tconst disposition = serverDisposition(name, options);\n\t\t\tif (disposition === \"empty\") {\n\t\t\t\tdiagnostics.push(emptyServerDiagnostic(label));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (disposition === \"dropped\") {\n\t\t\t\tdroppedServers.push(name);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst normalized = normalizeServer$1(rawServer, pluginRoot, pluginDataDirectory, name);\n\t\t\t\tinternalServers[name] = normalized.internal;\n\t\t\t\tclaudeServers[name] = normalized.claude;\n\t\t\t} catch (error) {\n\t\t\t\tdroppedServers.push(name);\n\t\t\t\tdiagnostics.push(skippedServerDiagnostic(label, name, error));\n\t\t\t}\n\t\t}\n\t\tconst contents = stagedContents(internalServers);\n\t\tconst target = stagedInternalPath(source, contents, options.stagingDirectory);\n\t\twriteStagedInternalConfig$1(target, contents, options.stagingDirectory);\n\t\treturn {\n\t\t\tconfigSource: {\n\t\t\t\tpath: target,\n\t\t\t\tformat: \"internal\",\n\t\t\t\tcacheKey: stagedCacheKey(source, configPath, contents)\n\t\t\t},\n\t\t\tclaudeConfig: { mcpServers: claudeServers },\n\t\t\tserverNames: Object.keys(internalServers),\n\t\t\tdroppedServers,\n\t\t\tdiagnostics\n\t\t};\n\t} catch (error) {\n\t\treturn disabledResult(label, error);\n\t}\n}\nconst AGENT_PLUGIN_SCHEMA = \"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json\";\nfunction isPlainObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction stablePluginIdentity(entry) {\n\tconst source = entry.source;\n\tconst identity = source?.type === \"git\" ? [\n\t\t\"git\",\n\t\tsource.url,\n\t\tsource.path ?? \"\"\n\t] : source?.type === \"npm\" ? [\n\t\t\"npm\",\n\t\tsource.registry ?? \"\",\n\t\tsource.package\n\t] : [\"local\", fs.realpathSync(entry.directory)];\n\treturn createHash(\"sha256\").update(JSON.stringify(identity)).digest(\"hex\");\n}\nfunction rootAgentPluginSchema(entry) {\n\tconst manifestPath = path.join(entry.directory, \"plugin.json\");\n\tif (entry.manifest?.path === manifestPath && entry.manifest.agentPluginSchema === AGENT_PLUGIN_SCHEMA) return AGENT_PLUGIN_SCHEMA;\n\ttry {\n\t\tconst stat = fs.lstatSync(manifestPath);\n\t\tif (stat.isSymbolicLink() || !stat.isFile()) return void 0;\n\t\tconst parsed = JSON.parse(fs.readFileSync(manifestPath, \"utf8\"));\n\t\treturn isPlainObject(parsed) && parsed.$schema === AGENT_PLUGIN_SCHEMA ? AGENT_PLUGIN_SCHEMA : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/** One plugin's MCP config as a projection source, or nothing when it ships none. Shared by sync and settings. */\nasync function pluginMcpSource(entry, pluginDataRoot) {\n\tif (entry.mcp === false) return void 0;\n\tconst pluginRoot = fs.realpathSync(entry.directory);\n\tconst agentPlugin = rootAgentPluginSchema(entry) === AGENT_PLUGIN_SCHEMA;\n\tconst configPath = path.join(pluginRoot, agentPlugin ? \"mcp.json\" : \".mcp.json\");\n\tlet stat;\n\ttry {\n\t\tstat = await fs.promises.lstat(configPath);\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") return void 0;\n\t\tthrow error;\n\t}\n\tif (!stat.isFile() || stat.isSymbolicLink()) return void 0;\n\tconst content = await fs.promises.readFile(configPath);\n\tconst contentDigest = createHash(\"sha256\").update(content).digest(\"hex\");\n\tconst pluginId = stablePluginIdentity(entry);\n\tconst sourceId = `plugin:${pluginId}`;\n\tif (!agentPlugin) return {\n\t\tsourceId,\n\t\towner: \"plugin\",\n\t\tformat: \"native\",\n\t\tconfigPath,\n\t\tcontentDigest\n\t};\n\treturn {\n\t\tsourceId,\n\t\towner: \"plugin\",\n\t\tformat: \"agent-plugin-v1\",\n\t\tconfigPath,\n\t\tcontentDigest,\n\t\tpluginId,\n\t\tpluginRoot,\n\t\tpluginDataDirectory: path.join(pluginDataRoot, pluginId),\n\t\tmcpSchemaUrl: AGENT_PLUGIN_MCP_SCHEMA_URL\n\t};\n}\n//#endregion\n//#region src/services/agentPluginMcp/index.ts\nasync function realContainedPath(fs, root, candidate, label, context) {\n\tconst real = await fs.canonicalPath(candidate, context);\n\tif (!real.ok) throw new Error(`${label} does not exist`);\n\tif (!isInside(root, real.value)) throw new Error(`${label} escapes its allowed plugin directory`);\n\treturn real.value;\n}\nasync function normalizeCommand(fs, command, pluginRoot, context) {\n\tif (!isPluginRelativeCommand(command)) return command;\n\tconst resolved = await realContainedPath(fs, pluginRoot, path.resolve(pluginRoot, command), \"command\", context);\n\tif (getOrThrow(await fs.fileInfo(resolved, context)).kind !== \"file\") throw new Error(\"command must resolve to a regular file\");\n\tconst mode = await nodeHost.fileMode(resolved);\n\tif (mode !== void 0 && (mode & 73) === 0) throw new Error(\"command must resolve to an executable file\");\n\treturn resolved;\n}\nasync function normalizeWorkingDirectory(fs, declared, pluginRoot, pluginDataDirectory, context) {\n\tconst declaredCwd = workingDirectoryCandidate(declared, pluginRoot, pluginDataDirectory);\n\tif (!declaredCwd) return pluginRoot;\n\tconst resolved = await realContainedPath(fs, declaredCwd.base, declaredCwd.candidate, \"cwd\", context);\n\tif (getOrThrow(await fs.fileInfo(resolved, context)).kind !== \"directory\") throw new Error(\"cwd must resolve to a directory\");\n\treturn resolved;\n}\nasync function normalizeServer(fs, raw, pluginRoot, pluginDataDirectory, name, context) {\n\tconst type = serverType(raw, name);\n\tconst declaration = raw;\n\tif (type !== \"stdio\") return remoteServer(declaration, name, type);\n\tconst command = await normalizeCommand(fs, nonEmptyString(declaration.command, \"command\"), pluginRoot, context);\n\tconst args = optionalStringArray(declaration.args, \"args\")?.map((item) => expandPluginPlaceholders(item, pluginRoot, pluginDataDirectory));\n\tconst env = normalizeEnvironment(declaration.env, pluginRoot, pluginDataDirectory);\n\tconst cwd = await normalizeWorkingDirectory(fs, declaration.cwd, pluginRoot, pluginDataDirectory, context);\n\treturn stdioServer(name, {\n\t\tcommand,\n\t\t...args ? { args } : {},\n\t\tenv,\n\t\tcwd\n\t});\n}\n/** Owner-only plugin data directory; a symbolic link or non-directory rejects the source. */\nasync function preparePluginDataDirectory(fs, directory, context) {\n\tconst info = await fs.fileInfo(directory, context);\n\tif (info.ok) {\n\t\tif (info.value.kind !== \"directory\") throw new Error(\"pluginDataDirectory must be a real directory\");\n\t} else if (info.error.code === \"not_found\") getOrThrow(await fs.createDir(directory, { recursive: true }, context));\n\telse throw info.error;\n\tawait nodeHost.setMode(directory, 448);\n\treturn getOrThrow(await fs.canonicalPath(directory, context));\n}\n/**\n* Content-addressed and owner-only. The name hashes the contents, so replacing an\n* existing staged file through a uniquely named temporary file never changes what it holds.\n*/\nasync function writeStagedInternalConfig(fs, target, contents, stagingDirectory, context) {\n\tgetOrThrow(await fs.createDir(stagingDirectory, { recursive: true }, context));\n\tawait nodeHost.setMode(stagingDirectory, 448);\n\tawait writeFileAtomic(fs, target, contents, context);\n\tawait nodeHost.setMode(target, 384);\n}\n/**\n* Validates one Agent Plugins v1 `mcp.json` and stages a native mcp-proxy layer,\n* reading and writing through the injected file system.\n*\n* Server validation is isolated: one malformed server is diagnosed and skipped.\n* Document/schema, source identity, or plugin-boundary failures reject the whole\n* source. Only the two portable plugin placeholders are expanded; the staged\n* layer is tagged `internal`, so legacy `${ENV}` interpolation cannot run again.\n*/\nasync function normalizeAgentPluginMcpSourceAsync(fs, source, options, context) {\n\tconst label = sourceLabel(source);\n\ttry {\n\t\tassertProjectionSource(source);\n\t\tconst pluginRoot = getOrThrow(await fs.canonicalPath(source.pluginRoot, context));\n\t\tconst pluginDataDirectory = await preparePluginDataDirectory(fs, source.pluginDataDirectory, context);\n\t\tconst configPath = await realContainedPath(fs, pluginRoot, source.configPath, \"mcp.json\", context);\n\t\tassertRootConfigPath(configPath, pluginRoot);\n\t\tconst servers = parseMcpDocument(source, getOrThrow(await fs.readBinaryFile(configPath, context)), label);\n\t\tconst internalServers = Object.create(null);\n\t\tconst claudeServers = Object.create(null);\n\t\tconst droppedServers = [];\n\t\tconst diagnostics = [];\n\t\tfor (const [name, rawServer] of Object.entries(servers)) {\n\t\t\tconst disposition = serverDisposition(name, options);\n\t\t\tif (disposition === \"empty\") {\n\t\t\t\tdiagnostics.push(emptyServerDiagnostic(label));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (disposition === \"dropped\") {\n\t\t\t\tdroppedServers.push(name);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst normalized = await normalizeServer(fs, rawServer, pluginRoot, pluginDataDirectory, name, context);\n\t\t\t\tinternalServers[name] = normalized.internal;\n\t\t\t\tclaudeServers[name] = normalized.claude;\n\t\t\t} catch (error) {\n\t\t\t\tdroppedServers.push(name);\n\t\t\t\tdiagnostics.push(skippedServerDiagnostic(label, name, error));\n\t\t\t}\n\t\t}\n\t\tconst contents = stagedContents(internalServers);\n\t\tconst target = stagedInternalPath(source, contents, options.stagingDirectory);\n\t\tawait writeStagedInternalConfig(fs, target, contents, options.stagingDirectory, context);\n\t\treturn {\n\t\t\tconfigSource: {\n\t\t\t\tpath: target,\n\t\t\t\tformat: \"internal\",\n\t\t\t\tcacheKey: stagedCacheKey(source, configPath, contents)\n\t\t\t},\n\t\t\tclaudeConfig: { mcpServers: claudeServers },\n\t\t\tserverNames: Object.keys(internalServers),\n\t\t\tdroppedServers,\n\t\t\tdiagnostics\n\t\t};\n\t} catch (error) {\n\t\treturn disabledResult(label, error);\n\t}\n}\n//#endregion\nexport { normalizeAgentPluginMcpSource, normalizeAgentPluginMcpSourceAsync, pluginMcpSource };\n\n//# sourceMappingURL=agentPluginMcp.mjs.map","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { findPluginManifestPath, isRemotePluginSource } from \"@agimon-ai/po-config/domains\";\nimport { spawn } from \"node:child_process\";\nimport { poHomeDirectory } from \"@agimon-ai/po-core/piSettings\";\n//#region src/services/pluginMaterializer/index.ts\nconst AGENT_PLUGIN_SCHEMA = \"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json\";\nconst INSTALL_MARKER = \".po-plugin.json\";\nconst INSTALL_MARKER_VERSION = 1;\nconst OUTPUT_LIMIT = 65536;\n/** The staging project that declares the one npm plugin being installed. */\nconst STAGING_PACKAGE_NAME = \"po-plugin-staging\";\nconst LATEST_TAG = \"latest\";\nfunction appendOutput(current, chunk) {\n\tconst next = current + chunk.toString(\"utf8\");\n\treturn next.length <= OUTPUT_LIMIT ? next : next.slice(-65536);\n}\nfunction runCommand(command, args, options = {}) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(command, args, {\n\t\t\tcwd: options.cwd,\n\t\t\tenv: options.environment ?? process.env,\n\t\t\tstdio: [\n\t\t\t\t\"ignore\",\n\t\t\t\t\"pipe\",\n\t\t\t\t\"pipe\"\n\t\t\t]\n\t\t});\n\t\tlet stdout = \"\";\n\t\tlet stderr = \"\";\n\t\tchild.stdout.on(\"data\", (chunk) => {\n\t\t\tstdout = appendOutput(stdout, chunk);\n\t\t});\n\t\tchild.stderr.on(\"data\", (chunk) => {\n\t\t\tstderr = appendOutput(stderr, chunk);\n\t\t});\n\t\tchild.once(\"error\", (error) => {\n\t\t\treject(new Error(`Failed to run ${command}: ${error.message}`, { cause: error }));\n\t\t});\n\t\tchild.once(\"close\", (code, signal) => {\n\t\t\tif (code === 0) {\n\t\t\t\tresolve(stdout.trim());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst outcome = signal ? `signal ${signal}` : `exit code ${code ?? \"unknown\"}`;\n\t\t\tconst details = stderr.trim() || stdout.trim();\n\t\t\treject(/* @__PURE__ */ new Error(`${command} ${args.join(\" \")} failed with ${outcome}${details ? `\\n${details}` : \"\"}`));\n\t\t});\n\t});\n}\nfunction assertContained(root, candidate, label) {\n\tconst relative = path.relative(root, candidate);\n\tif (relative === \"\" || !relative.startsWith(\"..\") && !path.isAbsolute(relative)) return;\n\tthrow new Error(`${label} resolves outside ${root}`);\n}\nasync function materializeGitSource(source, workspace) {\n\tconst checkout = path.join(workspace, \"checkout\");\n\tconst pluginRoot = source.path ? path.resolve(checkout, source.path) : checkout;\n\tif (source.path) assertContained(checkout, pluginRoot, \"Git plugin path\");\n\tconst cloneArgs = [\"clone\", \"--filter=blob:none\"];\n\tif (source.path) cloneArgs.push(\"--sparse\", \"--no-checkout\");\n\tcloneArgs.push(source.url, checkout);\n\tconst environment = {\n\t\t...process.env,\n\t\tGIT_TERMINAL_PROMPT: \"0\"\n\t};\n\tawait runCommand(\"git\", cloneArgs, { environment });\n\tif (source.path) await runCommand(\"git\", [\n\t\t\"sparse-checkout\",\n\t\t\"set\",\n\t\t\"--no-cone\",\n\t\t\"--\",\n\t\tsource.path\n\t], {\n\t\tcwd: checkout,\n\t\tenvironment\n\t});\n\tif (source.sha) {\n\t\tawait runCommand(\"git\", [\"checkout\", source.sha], {\n\t\t\tcwd: checkout,\n\t\t\tenvironment\n\t\t});\n\t\tconst checkedOutSha = await runCommand(\"git\", [\"rev-parse\", \"HEAD\"], {\n\t\t\tcwd: checkout,\n\t\t\tenvironment\n\t\t});\n\t\tif (checkedOutSha.toLowerCase() !== source.sha.toLowerCase()) throw new Error(`Checked out Git SHA ${checkedOutSha} does not match requested SHA ${source.sha}`);\n\t} else if (source.ref) await runCommand(\"git\", [\"checkout\", source.ref], {\n\t\tcwd: checkout,\n\t\tenvironment\n\t});\n\telse if (source.path) await runCommand(\"git\", [\"checkout\"], {\n\t\tcwd: checkout,\n\t\tenvironment\n\t});\n\treturn pluginRoot;\n}\n/**\n* Installs an npm plugin into the staging workspace with upm: a one-dependency\n* project, never a spawned package manager. upm runs no lifecycle scripts, and\n* its store is Po's shared `<po home>/store`.\n*/\nasync function materializeNpmSource(source, workspace) {\n\tconst prefix = path.join(workspace, \"npm\");\n\tawait fs.promises.mkdir(prefix, { recursive: true });\n\tawait fs.promises.writeFile(path.join(prefix, \"package.json\"), `${JSON.stringify({\n\t\tname: STAGING_PACKAGE_NAME,\n\t\tprivate: true,\n\t\tdependencies: { [source.package]: source.version ?? LATEST_TAG }\n\t}, null, 2)}\\n`);\n\tconst { installRuntimePackages } = await import(\"@agimon-ai/po-core/runtimePackages\");\n\tawait installRuntimePackages({\n\t\tdir: prefix,\n\t\tpoHome: poHomeDirectory(),\n\t\t...source.registry ? { registry: source.registry } : {}\n\t});\n\tconst pluginRoot = path.resolve(prefix, \"node_modules\", ...source.package.split(\"/\"));\n\tassertContained(path.join(prefix, \"node_modules\"), pluginRoot, \"npm plugin package\");\n\treturn fs.promises.realpath(pluginRoot);\n}\nconst DEFAULT_MATERIALIZERS = {\n\tgit: materializeGitSource,\n\tnpm: materializeNpmSource\n};\nasync function pathType(target) {\n\ttry {\n\t\treturn (await fs.promises.lstat(target)).isDirectory() ? \"directory\" : \"other\";\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") return \"missing\";\n\t\tthrow error;\n\t}\n}\nfunction optionalManifestString(manifest, key) {\n\tconst value = manifest[key];\n\treturn typeof value === \"string\" && value.trim() ? value.trim() : void 0;\n}\nfunction validatePluginManifest(pluginRoot, manifestPath) {\n\ttry {\n\t\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf8\"));\n\t\tif (typeof manifest !== \"object\" || manifest === null || Array.isArray(manifest)) throw new Error(\"manifest must contain a JSON object\");\n\t\tconst record = manifest;\n\t\tconst agentPluginSchema = manifestPath === path.join(pluginRoot, \"plugin.json\") && record.$schema === AGENT_PLUGIN_SCHEMA ? AGENT_PLUGIN_SCHEMA : void 0;\n\t\tconst name = optionalManifestString(record, \"name\");\n\t\tconst version = optionalManifestString(record, \"version\");\n\t\tconst description = optionalManifestString(record, \"description\");\n\t\treturn {\n\t\t\tskillDiscovery: agentPluginSchema ? \"direct-children\" : \"recursive\",\n\t\t\tmanifest: {\n\t\t\t\tpath: manifestPath,\n\t\t\t\t...name ? { name } : {},\n\t\t\t\t...version ? { version } : {},\n\t\t\t\t...description ? { description } : {},\n\t\t\t\t...agentPluginSchema ? { agentPluginSchema } : {}\n\t\t\t}\n\t\t};\n\t} catch (error) {\n\t\tthrow new Error(`Invalid plugin manifest ${manifestPath}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });\n\t}\n}\nasync function inspectInstallation(entry) {\n\tconst type = await pathType(entry.directory);\n\tif (type === \"missing\") return false;\n\tif (type !== \"directory\") throw new Error(`Remote plugin cache path is not a directory: ${entry.directory}`);\n\tif (!entry.source || !isRemotePluginSource(entry.source)) throw new Error(`Remote plugin entry is missing its source: ${entry.name ?? entry.directory}`);\n\tlet marker;\n\ttry {\n\t\tmarker = JSON.parse(await fs.promises.readFile(path.join(entry.directory, INSTALL_MARKER), \"utf8\"));\n\t} catch (error) {\n\t\tthrow new Error(`Remote plugin cache is not managed by Po: ${entry.directory}`, { cause: error });\n\t}\n\tif (marker.version !== INSTALL_MARKER_VERSION || JSON.stringify(marker.source) !== JSON.stringify(entry.source)) throw new Error(`Remote plugin cache metadata does not match ${entry.name ?? entry.directory}: ${entry.directory}`);\n\tconst manifestPath = findPluginManifestPath(entry.directory);\n\tif (!manifestPath) throw new Error(`Remote plugin cache is missing a supported plugin manifest: ${entry.directory}`);\n\treturn validatePluginManifest(entry.directory, manifestPath);\n}\nasync function copyPluginSource(sourceRoot, destination) {\n\tif (await pathType(sourceRoot) !== \"directory\") throw new Error(`Materialized plugin source is not a directory: ${sourceRoot}`);\n\tawait fs.promises.cp(sourceRoot, destination, {\n\t\trecursive: true,\n\t\tfilter: (candidate) => path.basename(candidate) !== \".git\"\n\t});\n}\nfunction isRenameRace(error) {\n\tconst code = error.code;\n\treturn code === \"EEXIST\" || code === \"ENOTEMPTY\";\n}\nasync function installRemotePlugin(entry, materializers) {\n\tif (!entry.source || !isRemotePluginSource(entry.source)) return entry;\n\tconst existingManifest = await inspectInstallation(entry);\n\tif (existingManifest) return {\n\t\t...entry,\n\t\t...existingManifest\n\t};\n\tconst parent = path.dirname(entry.directory);\n\tawait fs.promises.mkdir(parent, {\n\t\trecursive: true,\n\t\tmode: 448\n\t});\n\tif (await pathType(parent) !== \"directory\") throw new Error(`Remote plugin cache root is not a directory: ${parent}`);\n\tawait fs.promises.chmod(parent, 448);\n\tconst workspace = await fs.promises.mkdtemp(path.join(parent, \".plugin-staging-\"));\n\tconst installation = path.join(workspace, \"installation\");\n\ttry {\n\t\tawait copyPluginSource(entry.source.type === \"git\" ? await materializers.git(entry.source, workspace) : await materializers.npm(entry.source, workspace), installation);\n\t\tconst manifestPath = findPluginManifestPath(installation);\n\t\tif (!manifestPath) throw new Error(`Remote plugin ${entry.name ?? entry.directory} does not contain a supported plugin manifest`);\n\t\tvalidatePluginManifest(installation, manifestPath);\n\t\tconst markerPath = path.join(installation, INSTALL_MARKER);\n\t\tif (await pathType(markerPath) !== \"missing\") throw new Error(`Remote plugin contains reserved cache metadata path: ${INSTALL_MARKER}`);\n\t\tconst marker = {\n\t\t\tversion: INSTALL_MARKER_VERSION,\n\t\t\tsource: entry.source\n\t\t};\n\t\tawait fs.promises.writeFile(markerPath, `${JSON.stringify(marker, null, 2)}\\n`, {\n\t\t\tflag: \"wx\",\n\t\t\tmode: 384\n\t\t});\n\t\ttry {\n\t\t\tawait fs.promises.rename(installation, entry.directory);\n\t\t} catch (error) {\n\t\t\tif (!isRenameRace(error)) throw error;\n\t\t\tawait fs.promises.rm(installation, {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true\n\t\t\t});\n\t\t\tconst racedManifest = await inspectInstallation(entry);\n\t\t\tif (!racedManifest) throw new Error(`Remote plugin installation race left no cache: ${entry.directory}`);\n\t\t\treturn {\n\t\t\t\t...entry,\n\t\t\t\t...racedManifest\n\t\t\t};\n\t\t}\n\t\tconst installedManifest = await inspectInstallation(entry);\n\t\tif (!installedManifest) throw new Error(`Remote plugin installation left no cache: ${entry.directory}`);\n\t\treturn {\n\t\t\t...entry,\n\t\t\t...installedManifest\n\t\t};\n\t} catch (error) {\n\t\tthrow new Error(`Failed to install remote plugin ${entry.name ?? entry.directory}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });\n\t} finally {\n\t\tawait fs.promises.rm(workspace, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t}\n}\n/** Downloads selected remote plugins once into their content-addressed cache directories. */\nasync function materializePluginEntries(entries, options = {}) {\n\tconst materializers = {\n\t\tgit: options.materializers?.git ?? DEFAULT_MATERIALIZERS.git,\n\t\tnpm: options.materializers?.npm ?? DEFAULT_MATERIALIZERS.npm\n\t};\n\treturn Promise.all(entries.map((entry) => installRemotePlugin(entry, materializers)));\n}\n//#endregion\nexport { materializePluginEntries as t };\n\n//# sourceMappingURL=pluginMaterializer-D9-oDF-b.mjs.map","//#region src/services/toolNames/index.ts\n/**\n* Translation from Claude tool names to Pi tool names.\n*\n* Agent definitions inside a domain's plugins are authored with Claude names and\n* have to be rewritten before Pi loads them. Pi and Po name their tools in lower\n* snake case (`read`, `exec`, `load_skill`) while Claude uses PascalCase, so a\n* name already written for Pi or Po passes through without a second table.\n*/\nconst CLAUDE_TO_PI = /* @__PURE__ */ new Map([\n\t[\"Read\", \"read\"],\n\t[\"Edit\", \"edit\"],\n\t[\"Write\", \"write\"],\n\t[\"Bash\", \"bash\"],\n\t[\"Glob\", \"find\"],\n\t[\"Grep\", \"grep\"],\n\t[\"Agent\", \"subagent\"]\n]);\nconst PO_TOOL_NAME = /^[a-z][a-z0-9_]*$/;\nconst MCP_TOOL = \"mcp\";\nconst SKILL_TOOL = \"Skill\";\nconst MCP_TOOL_PREFIX = \"mcp__\";\nconst WEB_TOOLS = /* @__PURE__ */ new Set([\"WebFetch\", \"WebSearch\"]);\n/**\n* Pi's name for a tool named in an agent definition.\n*\n* Returns undefined for Skill, which Pi discovers rather than declares. Web and\n* MCP tools all collapse onto Pi's single `mcp` tool. Pi and Po names such as\n* `exec` pass through unchanged, and an unrecognised Claude name throws rather\n* than reaching Pi as a tool it will silently ignore.\n*/\nfunction toPiToolName(tool) {\n\tif (tool === SKILL_TOOL) return void 0;\n\tif (WEB_TOOLS.has(tool) || tool.startsWith(MCP_TOOL_PREFIX)) return MCP_TOOL;\n\tconst mapped = CLAUDE_TO_PI.get(tool);\n\tif (mapped) return mapped;\n\tif (PO_TOOL_NAME.test(tool)) return tool;\n\tthrow new Error(`Unsupported agent tool: ${tool}`);\n}\n//#endregion\nexport { toPiToolName as t };\n\n//# sourceMappingURL=toolNames-L4VE90mU.mjs.map","import { t as applyMcpAllowlist } from \"./mcpFilter-CKUbKmxz.mjs\";\nimport { t as toPiToolName } from \"./toolNames-L4VE90mU.mjs\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { globalPoConfigDirectory } from \"@agimon-ai/po-config/config\";\nimport { PO_MCP_PROJECTION_VERSION } from \"@agimon-ai/po-core/mcpProjection\";\nimport { parse, stringify } from \"yaml\";\nimport { poHomeDirectory } from \"@agimon-ai/po-core/piSettings\";\nimport crypto, { createHash } from \"node:crypto\";\nimport os from \"node:os\";\nimport { normalizeAgentPluginMcpSource, pluginMcpSource } from \"@agimon-ai/po-config/agentPluginMcp\";\n//#region src/services/skillCacheLocation/syncLabel.ts\nconst LABEL_MAX_LENGTH = 48;\n/** Keeps a repository or worktree name usable as one path segment. */\nfunction sanitizeSyncLabel(value, fallback) {\n\tconst normalized = value.normalize(\"NFKD\").replace(/[\\u0300-\\u036f]/gu, \"\").replace(/[^A-Za-z0-9._-]+/gu, \"-\").replace(/^[._-]+|[._-]+$/gu, \"\").slice(0, LABEL_MAX_LENGTH).replace(/[._-]+$/gu, \"\");\n\treturn normalized === \"\" || normalized === \".\" || normalized === \"..\" ? fallback : normalized;\n}\n//#endregion\n//#region src/services/skillCacheLocation/index.ts\nconst SYNC_DIRECTORY = \"sync\";\nconst WORKTREES_DIRECTORY = \"worktrees\";\nconst SKILL_CACHE_SEGMENTS = [\"cache\", \"skills\"];\nconst GIT_DIRECTORY = \".git\";\nconst COMMON_DIRECTORY_FILE = \"commondir\";\nconst IDENTITY_HEX_LENGTH = 32;\nconst DEFAULT_REPOSITORY_LABEL = \"repo\";\nconst DEFAULT_WORKTREE_LABEL = \"worktree\";\n/**\n* The home-scoped skill manifest cache for one worktree.\n*\n* This mirrors the namespace the Po launcher publishes into, so a session\n* that stages resources through the launcher and one that stages them through a\n* `/domains` switch hit the same manifests instead of rescanning every tree.\n* Two worktrees of one repository stay separate, and a checkout reached through\n* a symlink resolves to the same identity as the real path.\n*/\nfunction resolveSkillCacheDirectory(repositoryRoot, homeDirectory = os.homedir()) {\n\tconst root = canonicalPath(repositoryRoot);\n\tconst commonDirectory = gitCommonDirectory(root);\n\tconst repositoryToken = commonDirectory ? `git:${commonDirectory}` : `root:${root}`;\n\tconst repositoryId = identityHash(repositoryToken);\n\tconst worktreeId = identityHash(`${repositoryToken}\\0worktree:${root}`);\n\tconst repoLabel = repositoryLabel(commonDirectory, root);\n\tconst worktreeLabel = sanitizeSyncLabel(path.basename(root), DEFAULT_WORKTREE_LABEL);\n\treturn path.join(poHomeDirectory(path.resolve(homeDirectory)), SYNC_DIRECTORY, `${repoLabel}--${repositoryId}`, WORKTREES_DIRECTORY, `${worktreeLabel}--${worktreeId}`, ...SKILL_CACHE_SEGMENTS);\n}\nfunction canonicalPath(target) {\n\tconst absolute = path.resolve(target);\n\ttry {\n\t\treturn fs.realpathSync.native(absolute);\n\t} catch {\n\t\treturn absolute;\n\t}\n}\nfunction readGitDirectory(repositoryRoot) {\n\tconst gitPath = path.join(repositoryRoot, GIT_DIRECTORY);\n\ttry {\n\t\tconst stat = fs.statSync(gitPath);\n\t\tif (stat.isDirectory()) return canonicalPath(gitPath);\n\t\tif (!stat.isFile()) return void 0;\n\t\tconst match = /^gitdir:\\s*(.+)$/imu.exec(fs.readFileSync(gitPath, \"utf8\").trim());\n\t\treturn match?.[1] ? canonicalPath(path.resolve(repositoryRoot, match[1].trim())) : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction gitCommonDirectory(repositoryRoot) {\n\tconst gitDirectory = readGitDirectory(repositoryRoot);\n\tif (!gitDirectory) return void 0;\n\ttry {\n\t\tconst relative = fs.readFileSync(path.join(gitDirectory, COMMON_DIRECTORY_FILE), \"utf8\").trim();\n\t\treturn relative ? canonicalPath(path.resolve(gitDirectory, relative)) : gitDirectory;\n\t} catch {\n\t\treturn gitDirectory;\n\t}\n}\nfunction identityHash(value) {\n\treturn crypto.createHash(\"sha256\").update(value, \"utf8\").digest(\"hex\").slice(0, IDENTITY_HEX_LENGTH);\n}\nfunction repositoryLabel(commonDirectory, repositoryRoot) {\n\tif (!commonDirectory) return sanitizeSyncLabel(path.basename(repositoryRoot), DEFAULT_REPOSITORY_LABEL);\n\tconst base = path.basename(commonDirectory);\n\treturn sanitizeSyncLabel(base === GIT_DIRECTORY ? path.basename(path.dirname(commonDirectory)) : base, DEFAULT_REPOSITORY_LABEL);\n}\n//#endregion\n//#region src/services/resourceCollector/agentDefinition.ts\nconst DISPATCHER_AGENT_NAME = \"agiflow-dispatcher\";\nfunction splitFrontmatter(content) {\n\tconst match = content.match(/^---\\r?\\n([\\s\\S]*?)\\r?\\n---\\r?\\n?([\\s\\S]*)$/);\n\tif (!match) throw new Error(\"Resource is missing YAML frontmatter\");\n\treturn {\n\t\tattributes: parse(match[1]),\n\t\tbody: match[2] ?? \"\"\n\t};\n}\nconst CLAUDE_MODEL_ALIASES = {\n\tsonnet: \"anthropic/claude-sonnet-4-6\",\n\topus: \"anthropic/claude-opus-4-6\",\n\thaiku: \"anthropic/claude-haiku-4-5\"\n};\nfunction assertSafeAgentName(name) {\n\tconst trimmed = name.trim();\n\tif (!trimmed || trimmed !== name || trimmed === \".\" || trimmed === \"..\" || trimmed.includes(\"\\0\") || /[\\\\/]/.test(trimmed)) throw new Error(`Unsafe agent name: ${JSON.stringify(name)}`);\n\treturn trimmed;\n}\nfunction normalizeClaudeModel(value) {\n\tif (typeof value === \"string\") return CLAUDE_MODEL_ALIASES[value.toLowerCase()] ?? value;\n\tif (Array.isArray(value)) return value.map((entry) => normalizeClaudeModel(entry));\n\treturn value;\n}\n/** Rewrites a Claude-authored agent definition into the form Pi loads. */\nfunction adaptAgentDefinition(content) {\n\tconst { attributes, body } = splitFrontmatter(content);\n\tconst rawName = typeof attributes.name === \"string\" ? attributes.name : void 0;\n\tif (!rawName) throw new Error(\"Agent definition requires a name\");\n\tconst name = assertSafeAgentName(rawName);\n\tconst hasTools = Object.hasOwn(attributes, \"tools\");\n\tconst rawTools = Array.isArray(attributes.tools) ? attributes.tools.map(String) : typeof attributes.tools === \"string\" ? attributes.tools.split(\",\").map((tool) => tool.trim()).filter(Boolean) : [];\n\tconst mappedTools = [...new Set(rawTools.map(toPiToolName).filter((tool) => Boolean(tool)))];\n\tconst converted = {\n\t\t...attributes,\n\t\tinheritProjectContext: true,\n\t\tinheritSkills: true,\n\t\tsystemPromptMode: attributes.systemPromptMode ?? \"replace\"\n\t};\n\tif (hasTools) converted.tools = Array.isArray(attributes.tools) ? mappedTools : mappedTools.join(\", \");\n\telse delete converted.tools;\n\tif (converted.model !== void 0) converted.model = normalizeClaudeModel(converted.model);\n\tif (converted.fallbackModels !== void 0) converted.fallbackModels = normalizeClaudeModel(converted.fallbackModels);\n\tif (converted.memory === \"project\" || converted.memory === \"user\") converted.memory = {\n\t\tscope: converted.memory,\n\t\tpath: name\n\t};\n\telse if (converted.memory !== void 0 && (typeof converted.memory !== \"object\" || converted.memory === null || Array.isArray(converted.memory))) throw new Error(\"Unsupported memory declaration\");\n\tdelete converted.permissionMode;\n\treturn {\n\t\tname,\n\t\tcontent: `---\\n${stringify(converted).trim()}\\n---\\n\\n${body.trimStart()}`\n\t};\n}\n//#endregion\n//#region src/services/resourceCollector/index.ts\nconst DISPATCHER_TOOLS = [\n\t\"read\",\n\t\"grep\",\n\t\"find\",\n\t\"ls\",\n\t\"bash\",\n\t\"launch_workflow\",\n\t\"list_workflows\"\n];\nconst SKILL_MANIFEST_VERSION = 4;\nconst SKILL_MANIFEST_HASH_LENGTH = 16;\nconst PLUGIN_DATA_DIRECTORY = \"plugin-data\";\nfunction isJsonObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction canonicalJson(value) {\n\tconst normalize = (candidate) => {\n\t\tif (Array.isArray(candidate)) return candidate.map(normalize);\n\t\tif (!isJsonObject(candidate)) return candidate;\n\t\treturn Object.fromEntries(Object.entries(candidate).sort(([left], [right]) => left.localeCompare(right)).map(([key, child]) => [key, normalize(child)]));\n\t};\n\treturn JSON.stringify(normalize(value));\n}\nfunction projectionFingerprint(input) {\n\treturn createHash(\"sha256\").update(canonicalJson(input)).digest(\"hex\");\n}\nfunction skillManifestPath(repoRoot, skillRoot, discovery, cacheDirectory) {\n\tconst key = createHash(\"sha256\").update(`${path.resolve(skillRoot)}\\0${discovery}`).digest(\"hex\").slice(0, SKILL_MANIFEST_HASH_LENGTH);\n\treturn path.join(cacheDirectory ?? resolveSkillCacheDirectory(repoRoot), `${key}.json`);\n}\nfunction fileMatches(previous) {\n\ttry {\n\t\tconst stat = fs.statSync(previous.path);\n\t\treturn stat.isFile() && stat.size === previous.size && stat.mtimeMs === previous.mtimeMs && stat.ctimeMs === previous.ctimeMs;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction directoryMatches(previous) {\n\ttry {\n\t\tconst stat = fs.statSync(previous.path);\n\t\treturn stat.isDirectory() && stat.mtimeMs === previous.mtimeMs && stat.ctimeMs === previous.ctimeMs;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction readSkillManifest(manifestPath, root, discovery) {\n\ttry {\n\t\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf8\"));\n\t\tif (manifest.version !== SKILL_MANIFEST_VERSION || manifest.root !== path.resolve(root) || manifest.discovery !== discovery || !Array.isArray(manifest.files) || !Array.isArray(manifest.directories) || !manifest.files.every(fileMatches) || !manifest.directories.every(directoryMatches)) return;\n\t\treturn manifest;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction writeSkillManifest(manifestPath, manifest) {\n\tfs.mkdirSync(path.dirname(manifestPath), {\n\t\trecursive: true,\n\t\tmode: 448\n\t});\n\tconst temporary = `${manifestPath}.${process.pid}.${Date.now()}.tmp`;\n\tfs.writeFileSync(temporary, `${JSON.stringify(manifest, null, 2)}\\n`, { mode: 384 });\n\ttry {\n\t\tfs.renameSync(temporary, manifestPath);\n\t} catch (error) {\n\t\tfs.rmSync(temporary, { force: true });\n\t\tif (!fs.existsSync(manifestPath)) throw error;\n\t}\n}\nasync function pathExists(target) {\n\ttry {\n\t\tawait fs.promises.access(target);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nasync function readSkillManifestAsync(manifestPath, root, discovery) {\n\ttry {\n\t\tconst manifest = JSON.parse(await fs.promises.readFile(manifestPath, \"utf8\"));\n\t\tif (manifest.version !== SKILL_MANIFEST_VERSION || manifest.root !== path.resolve(root) || manifest.discovery !== discovery || !Array.isArray(manifest.files) || !Array.isArray(manifest.directories)) return;\n\t\tfor (const previous of manifest.files) {\n\t\t\tconst stat = await fs.promises.stat(previous.path);\n\t\t\tif (!stat.isFile() || stat.size !== previous.size || stat.mtimeMs !== previous.mtimeMs || stat.ctimeMs !== previous.ctimeMs) return;\n\t\t}\n\t\tfor (const previous of manifest.directories) {\n\t\t\tconst stat = await fs.promises.stat(previous.path);\n\t\t\tif (!stat.isDirectory() || stat.mtimeMs !== previous.mtimeMs || stat.ctimeMs !== previous.ctimeMs) return;\n\t\t}\n\t\treturn manifest;\n\t} catch {\n\t\treturn;\n\t}\n}\nasync function writeSkillManifestAsync(manifestPath, manifest) {\n\tawait fs.promises.mkdir(path.dirname(manifestPath), {\n\t\trecursive: true,\n\t\tmode: 448\n\t});\n\tconst temporary = `${manifestPath}.${process.pid}.${Date.now()}.tmp`;\n\tawait fs.promises.writeFile(temporary, `${JSON.stringify(manifest, null, 2)}\\n`, { mode: 384 });\n\ttry {\n\t\tawait fs.promises.rename(temporary, manifestPath);\n\t} catch (error) {\n\t\tawait fs.promises.rm(temporary, { force: true });\n\t\tif (!await pathExists(manifestPath)) throw error;\n\t}\n}\n/**\n* A directory entry resolved through any symlink, or undefined for a broken one.\n*\n* `readdir` reports symlinks with lstat semantics, so a symlinked skill\n* directory answers false to both `isDirectory()` and `isFile()` and would be\n* skipped by a naive branch. Pi stats through the link instead\n* (dist/core/skills.js:171-183) and treats a failing stat as a broken link to\n* skip, which is what keeps a shared skill published as a symlink visible.\n*/\nfunction resolveEntryKind(entry, candidate) {\n\tif (!entry.isSymbolicLink()) return {\n\t\tdirectory: entry.isDirectory(),\n\t\tfile: entry.isFile()\n\t};\n\ttry {\n\t\tconst stat = fs.statSync(candidate);\n\t\treturn {\n\t\t\tdirectory: stat.isDirectory(),\n\t\t\tfile: stat.isFile()\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\nasync function resolveEntryKindAsync(entry, candidate) {\n\tif (!entry.isSymbolicLink()) return {\n\t\tdirectory: entry.isDirectory(),\n\t\tfile: entry.isFile()\n\t};\n\ttry {\n\t\tconst stat = await fs.promises.stat(candidate);\n\t\treturn {\n\t\t\tdirectory: stat.isDirectory(),\n\t\t\tfile: stat.isFile()\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* The skill's declared name, or the name of the directory holding it.\n*\n* Pi falls back to the containing directory rather than rejecting the file\n* (dist/core/skills.js:245). Rejecting is worse than one missing skill here:\n* this walk feeds the whole resource collection, so a single unnamed SKILL.md\n* from a third-party plugin would fail session launch outright rather than\n* degrade.\n*/\nfunction skillName(filePath, attributes) {\n\tconst declared = typeof attributes.name === \"string\" ? attributes.name.trim() : \"\";\n\tif (declared) return declared;\n\tconst fallback = path.basename(path.dirname(filePath));\n\tif (!fallback) throw new Error(`Resource requires a name: ${filePath}`);\n\treturn fallback;\n}\nfunction scanSkillManifest(root, discovery) {\n\tconst directories = [];\n\tconst files = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst walk = (directory, depth) => {\n\t\tif (!fs.existsSync(directory)) return;\n\t\tconst realDirectory = fs.realpathSync(directory);\n\t\tif (visited.has(realDirectory)) return;\n\t\tvisited.add(realDirectory);\n\t\tconst directoryStat = fs.statSync(directory);\n\t\tdirectories.push({\n\t\t\tpath: directory,\n\t\t\tmtimeMs: directoryStat.mtimeMs,\n\t\t\tctimeMs: directoryStat.ctimeMs\n\t\t});\n\t\tfor (const entry of fs.readdirSync(directory, { withFileTypes: true })) {\n\t\t\tconst candidate = path.join(directory, entry.name);\n\t\t\tconst kind = resolveEntryKind(entry, candidate);\n\t\t\tif (!kind) continue;\n\t\t\tif (kind.directory) {\n\t\t\t\tif (discovery === \"recursive\" || depth === 0) walk(candidate, depth + 1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!kind.file || entry.name !== \"SKILL.md\" || discovery === \"direct-children\" && depth !== 1) continue;\n\t\t\tconst content = fs.readFileSync(candidate, \"utf8\");\n\t\t\tconst { attributes } = splitFrontmatter(content);\n\t\t\tconst stat = fs.statSync(candidate);\n\t\t\tfiles.push({\n\t\t\t\tpath: candidate,\n\t\t\t\tname: skillName(candidate, attributes),\n\t\t\t\t...typeof attributes.description === \"string\" ? { description: attributes.description.trim() } : {},\n\t\t\t\tdigest: createHash(\"sha256\").update(content).digest(\"hex\"),\n\t\t\t\tsize: stat.size,\n\t\t\t\tmtimeMs: stat.mtimeMs,\n\t\t\t\tctimeMs: stat.ctimeMs\n\t\t\t});\n\t\t}\n\t};\n\tconst resolvedRoot = path.resolve(root);\n\twalk(resolvedRoot, 0);\n\tfiles.sort((left, right) => left.path.localeCompare(right.path));\n\tdirectories.sort((left, right) => left.path.localeCompare(right.path));\n\treturn {\n\t\tversion: SKILL_MANIFEST_VERSION,\n\t\troot: resolvedRoot,\n\t\tdiscovery,\n\t\tfiles,\n\t\tdirectories\n\t};\n}\n/** Cached skill metadata and exact files, ready for Pi without a second tree walk. */\nfunction discoverSkills(repoRoot, root, discovery = \"recursive\", cacheDirectory) {\n\tif (!fs.existsSync(root)) return [];\n\tconst manifestPath = skillManifestPath(repoRoot, root, discovery, cacheDirectory);\n\tconst cached = readSkillManifest(manifestPath, root, discovery);\n\tconst manifest = cached ?? scanSkillManifest(root, discovery);\n\tif (!cached) writeSkillManifest(manifestPath, manifest);\n\treturn manifest.files.map(({ name, path: filePath, description, digest }) => ({\n\t\tname,\n\t\tpath: filePath,\n\t\tdigest,\n\t\t...description === void 0 ? {} : { description }\n\t}));\n}\nasync function scanSkillManifestAsync(root, discovery) {\n\tconst directories = [];\n\tconst files = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst walk = async (directory, depth) => {\n\t\tlet entries;\n\t\ttry {\n\t\t\tconst realDirectory = await fs.promises.realpath(directory);\n\t\t\tif (visited.has(realDirectory)) return;\n\t\t\tvisited.add(realDirectory);\n\t\t\tconst directoryStat = await fs.promises.stat(directory);\n\t\t\tdirectories.push({\n\t\t\t\tpath: directory,\n\t\t\t\tmtimeMs: directoryStat.mtimeMs,\n\t\t\t\tctimeMs: directoryStat.ctimeMs\n\t\t\t});\n\t\t\tentries = await fs.promises.readdir(directory, { withFileTypes: true });\n\t\t} catch (error) {\n\t\t\tif (error.code === \"ENOENT\") return;\n\t\t\tthrow error;\n\t\t}\n\t\tfor (const entry of entries) {\n\t\t\tconst candidate = path.join(directory, entry.name);\n\t\t\tconst kind = await resolveEntryKindAsync(entry, candidate);\n\t\t\tif (!kind) continue;\n\t\t\tif (kind.directory) {\n\t\t\t\tif (discovery === \"recursive\" || depth === 0) await walk(candidate, depth + 1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!kind.file || entry.name !== \"SKILL.md\" || discovery === \"direct-children\" && depth !== 1) continue;\n\t\t\tconst content = await fs.promises.readFile(candidate, \"utf8\");\n\t\t\tconst { attributes } = splitFrontmatter(content);\n\t\t\tconst stat = await fs.promises.stat(candidate);\n\t\t\tfiles.push({\n\t\t\t\tpath: candidate,\n\t\t\t\tname: skillName(candidate, attributes),\n\t\t\t\t...typeof attributes.description === \"string\" ? { description: attributes.description.trim() } : {},\n\t\t\t\tdigest: createHash(\"sha256\").update(content).digest(\"hex\"),\n\t\t\t\tsize: stat.size,\n\t\t\t\tmtimeMs: stat.mtimeMs,\n\t\t\t\tctimeMs: stat.ctimeMs\n\t\t\t});\n\t\t}\n\t};\n\tconst resolvedRoot = path.resolve(root);\n\tawait walk(resolvedRoot, 0);\n\tfiles.sort((left, right) => left.path.localeCompare(right.path));\n\tdirectories.sort((left, right) => left.path.localeCompare(right.path));\n\treturn {\n\t\tversion: SKILL_MANIFEST_VERSION,\n\t\troot: resolvedRoot,\n\t\tdiscovery,\n\t\tfiles,\n\t\tdirectories\n\t};\n}\nasync function discoverSkillsAsync(repoRoot, root, discovery = \"recursive\", cacheDirectory) {\n\tif (!await pathExists(root)) return [];\n\tconst manifestPath = skillManifestPath(repoRoot, root, discovery, cacheDirectory);\n\tconst cached = await readSkillManifestAsync(manifestPath, root, discovery);\n\tconst manifest = cached ?? await scanSkillManifestAsync(root, discovery);\n\tif (!cached) await writeSkillManifestAsync(manifestPath, manifest);\n\treturn manifest.files.map(({ name, path: filePath, description, digest }) => ({\n\t\tname,\n\t\tpath: filePath,\n\t\tdigest,\n\t\t...description === void 0 ? {} : { description }\n\t}));\n}\nasync function markdownFilesAsync(directory) {\n\tlet entries;\n\ttry {\n\t\tentries = await fs.promises.readdir(directory, { withFileTypes: true });\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") return [];\n\t\tthrow error;\n\t}\n\tconst results = [];\n\tfor (const entry of entries) {\n\t\tconst candidate = path.join(directory, entry.name);\n\t\tif (entry.isDirectory()) results.push(...await markdownFilesAsync(candidate));\n\t\tif (entry.isFile() && entry.name.endsWith(\".md\")) results.push(candidate);\n\t}\n\treturn results;\n}\nasync function frontmatterNameAsync(filePath) {\n\tconst { attributes } = splitFrontmatter(await fs.promises.readFile(filePath, \"utf8\"));\n\tif (typeof attributes.name !== \"string\") throw new Error(`Resource requires a name: ${filePath}`);\n\treturn attributes.name;\n}\nasync function assertUniqueAsync(resources, kind) {\n\tconst seen = /* @__PURE__ */ new Map();\n\tconst digestByName = /* @__PURE__ */ new Map();\n\tfor (const resource of resources) {\n\t\tconst previous = seen.get(resource.name);\n\t\tconst digest = resource.digest ?? createHash(\"sha256\").update(await fs.promises.readFile(resource.path)).digest(\"hex\");\n\t\tif (previous && digestByName.get(resource.name) !== digest) throw new Error(`Conflicting ${kind} \"${resource.name}\": ${previous} and ${resource.path}`);\n\t\tseen.set(resource.name, resource.path);\n\t\tdigestByName.set(resource.name, digest);\n\t}\n}\nfunction dispatcherAgentSource() {\n\tconst attributes = {\n\t\tname: DISPATCHER_AGENT_NAME,\n\t\tdescription: \"Selects and launches Agiflow workflows for one loop pass without implementing the work.\",\n\t\tthinking: \"high\",\n\t\tsystemPromptMode: \"replace\",\n\t\tinheritProjectContext: true,\n\t\tinheritSkills: true,\n\t\ttools: DISPATCHER_TOOLS.join(\", \"),\n\t\tdefaultContext: \"fresh\",\n\t\tdefaultProgress: false\n\t};\n\tconst body = [\n\t\t\"You are the Agiflow workflow dispatcher.\",\n\t\t\"Reason about the supplied dispatch context and launch eligible workflows.\",\n\t\t\"Launch workflows without monitoring them. After dispatching, report and exit.\",\n\t\t\"Follow the task restrictions exactly. Do not implement jobs or edit repository files.\"\n\t].join(\"\\n\");\n\treturn `---\\n${stringify(attributes).trim()}\\n---\\n\\n${body}\\n`;\n}\nfunction mergeMcpConfigs(configPaths) {\n\tconst merged = { mcpServers: {} };\n\tconst servers = merged.mcpServers;\n\tconst sources = /* @__PURE__ */ new Map();\n\tfor (const configPath of configPaths) {\n\t\tif (!fs.existsSync(configPath)) continue;\n\t\tconst incoming = JSON.parse(fs.readFileSync(configPath, \"utf8\")).mcpServers ?? {};\n\t\tfor (const [name, definition] of Object.entries(incoming)) {\n\t\t\tconst previous = servers[name];\n\t\t\tif (previous && JSON.stringify(previous) !== JSON.stringify(definition)) throw new Error(`Conflicting MCP server \"${name}\": ${sources.get(name)} and ${configPath}`);\n\t\t\tservers[name] = definition;\n\t\t\tsources.set(name, configPath);\n\t\t}\n\t}\n\treturn merged;\n}\nasync function mergeMcpConfigsAsync(configPaths) {\n\tconst merged = { mcpServers: {} };\n\tconst servers = merged.mcpServers;\n\tconst sources = /* @__PURE__ */ new Map();\n\tfor (const configPath of configPaths) {\n\t\tlet content;\n\t\ttry {\n\t\t\tcontent = await fs.promises.readFile(configPath, \"utf8\");\n\t\t} catch (error) {\n\t\t\tif (error.code === \"ENOENT\") continue;\n\t\t\tthrow error;\n\t\t}\n\t\tconst incoming = JSON.parse(content).mcpServers ?? {};\n\t\tfor (const [name, definition] of Object.entries(incoming)) {\n\t\t\tconst previous = servers[name];\n\t\t\tif (previous && JSON.stringify(previous) !== JSON.stringify(definition)) throw new Error(`Conflicting MCP server \"${name}\": ${sources.get(name)} and ${configPath}`);\n\t\t\tservers[name] = definition;\n\t\t\tsources.set(name, configPath);\n\t\t}\n\t}\n\treturn merged;\n}\nasync function mergeProjectedMcpConfigs(sources, stagingDirectory) {\n\tconst merged = { mcpServers: {} };\n\tconst servers = merged.mcpServers;\n\tconst origins = /* @__PURE__ */ new Map();\n\tconst userOwned = /* @__PURE__ */ new Set();\n\tfor (const source of sources) {\n\t\tlet config;\n\t\tif (source.format === \"agent-plugin-v1\") config = normalizeAgentPluginMcpSource(source, {\n\t\t\tstagingDirectory,\n\t\t\tstripProxyWrappers: false\n\t\t}).claudeConfig;\n\t\telse {\n\t\t\tlet content;\n\t\t\ttry {\n\t\t\t\tcontent = await fs.promises.readFile(source.configPath, \"utf8\");\n\t\t\t} catch (error) {\n\t\t\t\tif (error.code === \"ENOENT\") continue;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tconfig = JSON.parse(content);\n\t\t}\n\t\tconst incoming = config.mcpServers ?? {};\n\t\tfor (const [name, definition] of Object.entries(incoming)) {\n\t\t\tconst previous = servers[name];\n\t\t\tif (previous && !userOwned.has(name) && JSON.stringify(previous) !== JSON.stringify(definition)) throw new Error(`Conflicting MCP server \"${name}\": ${origins.get(name)} and ${source.configPath}`);\n\t\t\tservers[name] = definition;\n\t\t\torigins.set(name, source.configPath);\n\t\t\tif (source.owner === \"user\") userOwned.add(name);\n\t\t\telse userOwned.delete(name);\n\t\t}\n\t}\n\treturn merged;\n}\nfunction escapeRegExp(value) {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n/** Matches a resource name against a subset filter. Undefined keeps everything. */\nfunction keepsName(allowed, name) {\n\tif (!allowed) return true;\n\treturn allowed.some((pattern) => pattern.includes(\"*\") ? new RegExp(`^${pattern.split(\"*\").map(escapeRegExp).join(\".*\")}$`).test(name) : pattern === name);\n}\n/** Stages only the MCP slice shared by Po and compatibility frontends. */\nasync function stageMcpResources(repoRoot, plugins, options) {\n\tconst pluginEntries = plugins.map((plugin) => typeof plugin === \"string\" ? { directory: plugin } : plugin);\n\tconst pluginMcpConfigPaths = [];\n\tconst pluginMcpSources = [];\n\tconst mcpSources = [];\n\tconst pluginDataRoot = options.pluginDataRoot ?? path.join(globalPoConfigDirectory(), PLUGIN_DATA_DIRECTORY);\n\tconst repositoryMcpPath = path.join(repoRoot, \".mcp.json\");\n\tawait fs.promises.mkdir(options.temporaryDirectory, {\n\t\tmode: 448,\n\t\trecursive: true\n\t});\n\tawait fs.promises.chmod(options.temporaryDirectory, 448);\n\tif (options.enabled && options.userMcpConfigPath && await pathExists(options.userMcpConfigPath)) {\n\t\tconst content = await fs.promises.readFile(options.userMcpConfigPath);\n\t\tmcpSources.push({\n\t\t\tsourceId: \"user:mcp.json\",\n\t\t\towner: \"user\",\n\t\t\tformat: \"native\",\n\t\t\tconfigPath: options.userMcpConfigPath,\n\t\t\tcontentDigest: createHash(\"sha256\").update(content).digest(\"hex\")\n\t\t});\n\t}\n\tif (options.enabled && await pathExists(repositoryMcpPath)) {\n\t\tconst content = await fs.promises.readFile(repositoryMcpPath);\n\t\tmcpSources.push({\n\t\t\tsourceId: \"repository:.mcp.json\",\n\t\t\towner: \"repository\",\n\t\t\tformat: \"native\",\n\t\t\tconfigPath: repositoryMcpPath,\n\t\t\tcontentDigest: createHash(\"sha256\").update(content).digest(\"hex\")\n\t\t});\n\t}\n\tif (options.enabled) for (const entry of pluginEntries) {\n\t\tconst source = await pluginMcpSource(entry, pluginDataRoot);\n\t\tif (!source) continue;\n\t\tmcpSources.push(source);\n\t\tpluginMcpSources.push(source);\n\t\tpluginMcpConfigPaths.push(source.configPath);\n\t}\n\tlet mcpConfigPath;\n\tif (options.enabled) {\n\t\tmcpConfigPath = path.join(options.temporaryDirectory, \"mcp.json\");\n\t\tconst merged = await applyMcpAllowlist(await mergeProjectedMcpConfigs(mcpSources, options.temporaryDirectory), options.mcpAllowlist, repoRoot, options.temporaryDirectory);\n\t\tawait fs.promises.writeFile(mcpConfigPath, `${JSON.stringify(merged, null, 2)}\\n`, { mode: 384 });\n\t}\n\tconst projectionWithoutRuntimePath = {\n\t\tversion: PO_MCP_PROJECTION_VERSION,\n\t\tenabled: options.enabled,\n\t\trepoRoot,\n\t\t...mcpConfigPath ? { generatedConfigPath: mcpConfigPath } : {},\n\t\tsources: options.enabled ? mcpSources : [],\n\t\t...options.mcpAllowlist ? { allowlist: structuredClone(options.mcpAllowlist) } : {}\n\t};\n\treturn {\n\t\tmcpConfigPath,\n\t\tmcpProjection: {\n\t\t\t...projectionWithoutRuntimePath,\n\t\t\tstagingDirectory: options.temporaryDirectory,\n\t\t\tfingerprint: projectionFingerprint(projectionWithoutRuntimePath)\n\t\t},\n\t\tpluginMcpSources,\n\t\tpluginMcpConfigPaths\n\t};\n}\n/**\n* Stages every resource the selected domains contribute, ready for one Pi session.\n*\n* The caller owns the returned cleanup(): the temporary directory holding agents\n* and the generated MCP config has to outlive this function and be removed once\n* the session that reads it is done.\n*/\nasync function collectResources(repoRoot, plugins, options) {\n\tconst pluginEntries = plugins.map((plugin) => typeof plugin === \"string\" ? { directory: plugin } : plugin);\n\tconst ownsDirectory = options.temporaryDirectory === void 0;\n\tconst temporaryDirectory = options.temporaryDirectory ?? await fs.promises.mkdtemp(path.join(os.tmpdir(), \"po-\"));\n\tawait fs.promises.mkdir(temporaryDirectory, {\n\t\tmode: 448,\n\t\trecursive: true\n\t});\n\tawait fs.promises.chmod(temporaryDirectory, 448);\n\tconst sharedSkills = path.join(repoRoot, \".claude\", \"skills\");\n\tconst sharedSkillSources = options.sharedSkills === false ? [] : await discoverSkillsAsync(repoRoot, sharedSkills, \"recursive\", options.skillCacheDirectory);\n\tconst skillDirectories = [];\n\tconst skillSources = [];\n\tconst agentSources = [];\n\tfor (const entry of pluginEntries) {\n\t\tconst pluginDirectory = entry.directory;\n\t\tconst skills = path.join(pluginDirectory, \"skills\");\n\t\tif (await pathExists(skills)) {\n\t\t\tconst found = (await discoverSkillsAsync(repoRoot, skills, entry.skillDiscovery ?? \"recursive\", options.skillCacheDirectory)).filter((skill) => keepsName(entry.skills, skill.name));\n\t\t\tskillDirectories.push(...found.map((skill) => skill.path));\n\t\t\tskillSources.push(...found);\n\t\t}\n\t\tconst agentFiles = await markdownFilesAsync(path.join(pluginDirectory, \"agents\"));\n\t\tconst agentNames = await Promise.all(agentFiles.map((filePath) => frontmatterNameAsync(filePath)));\n\t\tagentSources.push(...agentFiles.map((filePath, index) => ({\n\t\t\tname: agentNames[index] ?? \"\",\n\t\t\tpath: filePath\n\t\t})).filter((agent) => keepsName(entry.agents, agent.name)));\n\t}\n\tawait assertUniqueAsync(skillSources, \"skill\");\n\tawait assertUniqueAsync(sharedSkillSources, \"skill\");\n\tconst pluginSkillNames = new Set(skillSources.map((skill) => skill.name));\n\tconst fallbackSharedSkills = sharedSkillSources.filter((skill) => !pluginSkillNames.has(skill.name));\n\tskillDirectories.push(...fallbackSharedSkills.map((skill) => skill.path));\n\tskillSources.push(...fallbackSharedSkills);\n\tawait assertUniqueAsync(agentSources, \"agent\");\n\tif (agentSources.some((source) => source.name === \"agiflow-dispatcher\")) throw new Error(`Conflicting agent \"${DISPATCHER_AGENT_NAME}\": reserved by the agent harness`);\n\tconst agentDirectories = [];\n\tconst outputDirectory = path.join(temporaryDirectory, \"agents\");\n\tawait fs.promises.rm(outputDirectory, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n\tif (options.agents) {\n\t\tawait fs.promises.mkdir(outputDirectory, { mode: 448 });\n\t\tfor (const source of agentSources) {\n\t\t\tconst adapted = adaptAgentDefinition(await fs.promises.readFile(source.path, \"utf8\"));\n\t\t\tawait fs.promises.writeFile(path.join(outputDirectory, `${assertSafeAgentName(adapted.name)}.md`), adapted.content, { mode: 384 });\n\t\t}\n\t\tawait fs.promises.writeFile(path.join(outputDirectory, `${DISPATCHER_AGENT_NAME}.md`), dispatcherAgentSource(), { mode: 384 });\n\t\tagentDirectories.push(outputDirectory);\n\t}\n\tconst { mcpConfigPath, mcpProjection, pluginMcpSources, pluginMcpConfigPaths } = await stageMcpResources(repoRoot, pluginEntries, {\n\t\tenabled: options.mcp,\n\t\ttemporaryDirectory,\n\t\t...options.mcpAllowlist ? { mcpAllowlist: options.mcpAllowlist } : {},\n\t\t...options.pluginDataRoot ? { pluginDataRoot: options.pluginDataRoot } : {},\n\t\t...options.userMcpConfigPath ? { userMcpConfigPath: options.userMcpConfigPath } : {}\n\t});\n\treturn {\n\t\ttemporaryDirectory,\n\t\tskillDirectories,\n\t\tskillSources,\n\t\tskillCount: skillSources.length,\n\t\tagentCount: agentSources.length,\n\t\tagentDirectories,\n\t\tmcpConfigPath,\n\t\tmcpProjection,\n\t\tpluginMcpSources,\n\t\tpluginMcpConfigPaths,\n\t\tcleanup: () => ownsDirectory ? fs.promises.rm(temporaryDirectory, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t}) : Promise.resolve()\n\t};\n}\n//#endregion\nexport { mergeMcpConfigsAsync as a, adaptAgentDefinition as c, mergeMcpConfigs as i, resolveSkillCacheDirectory as l, discoverSkills as n, stageMcpResources as o, discoverSkillsAsync as r, DISPATCHER_AGENT_NAME as s, collectResources as t, sanitizeSyncLabel as u };\n\n//# sourceMappingURL=resourceCollector-DoXqQLuN.mjs.map","import path from \"node:path\";\nimport fs from \"node:fs\";\nimport { getOrThrow, nodeHost } from \"@agimon-ai/po-core/platform\";\n//#region src/services/theme/defaultTheme.ts\nconst DEFAULT_THEME_NAME = \"po-dark\";\nconst DEFAULT_THEME = {\n\t$schema: \"https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json\",\n\tname: DEFAULT_THEME_NAME,\n\tvars: {\n\t\tbg: \"#1c1c1c\",\n\t\tbgAlt: \"#171717\",\n\t\tbgActive: \"#2b2b2b\",\n\t\tbgHover: \"#2b2b2b\",\n\t\tfg: \"#dedede\",\n\t\tfgAlt: \"#b0b0b0\",\n\t\tgrey: \"#343434\",\n\t\tgreyAlt: \"#555555\",\n\t\tblue: \"#8cb5cc\",\n\t\tdarkBlue: \"#284b64\",\n\t\tcyan: \"#8fc8c7\",\n\t\tgreen: \"#81cca3\",\n\t\tlightGreen: \"#a5d9b5\",\n\t\tteal: \"#8ec1ab\",\n\t\torange: \"#d3ad83\",\n\t\tred: \"#e99185\",\n\t\tviolet: \"#b0a0ce\",\n\t\tmagenta: \"#c19aae\",\n\t\tyellow: \"#d6be82\",\n\t\tlightYellow: \"#e1cf9e\",\n\t\tcomment: \"#a4a4a4\",\n\t\tdiffAddedBg: \"#152d20\",\n\t\tdiffRemovedBg: \"#35201b\"\n\t},\n\tcolors: {\n\t\taccent: \"green\",\n\t\tborder: \"greyAlt\",\n\t\tborderAccent: \"green\",\n\t\tborderMuted: \"grey\",\n\t\tsuccess: \"green\",\n\t\terror: \"red\",\n\t\twarning: \"yellow\",\n\t\tmuted: \"fgAlt\",\n\t\tdim: \"comment\",\n\t\ttext: \"fg\",\n\t\tthinkingText: \"fgAlt\",\n\t\tselectedBg: \"bgHover\",\n\t\tuserMessageBg: \"bgActive\",\n\t\tuserMessageText: \"fg\",\n\t\tcustomMessageBg: \"#292c2a\",\n\t\tcustomMessageText: \"fg\",\n\t\tcustomMessageLabel: \"green\",\n\t\ttoolPendingBg: \"bgAlt\",\n\t\ttoolSuccessBg: \"diffAddedBg\",\n\t\ttoolErrorBg: \"diffRemovedBg\",\n\t\ttoolTitle: \"green\",\n\t\ttoolOutput: \"fg\",\n\t\tmdHeading: \"magenta\",\n\t\tmdLink: \"blue\",\n\t\tmdLinkUrl: \"comment\",\n\t\tmdCode: \"cyan\",\n\t\tmdCodeBlock: \"lightYellow\",\n\t\tmdCodeBlockBorder: \"greyAlt\",\n\t\tmdQuote: \"fgAlt\",\n\t\tmdQuoteBorder: \"greyAlt\",\n\t\tmdHr: \"greyAlt\",\n\t\tmdListBullet: \"green\",\n\t\ttoolDiffAdded: \"lightGreen\",\n\t\ttoolDiffRemoved: \"red\",\n\t\ttoolDiffContext: \"fgAlt\",\n\t\tsyntaxComment: \"comment\",\n\t\tsyntaxKeyword: \"blue\",\n\t\tsyntaxFunction: \"magenta\",\n\t\tsyntaxVariable: \"violet\",\n\t\tsyntaxString: \"green\",\n\t\tsyntaxNumber: \"orange\",\n\t\tsyntaxType: \"yellow\",\n\t\tsyntaxOperator: \"orange\",\n\t\tsyntaxPunctuation: \"fgAlt\",\n\t\tthinkingOff: \"grey\",\n\t\tthinkingMinimal: \"fgAlt\",\n\t\tthinkingLow: \"darkBlue\",\n\t\tthinkingMedium: \"blue\",\n\t\tthinkingHigh: \"teal\",\n\t\tthinkingXhigh: \"magenta\",\n\t\tthinkingMax: \"red\",\n\t\tbashMode: \"lightGreen\"\n\t},\n\texport: {\n\t\tpageBg: \"bg\",\n\t\tcardBg: \"bgAlt\",\n\t\tinfoBg: \"#3b3526\"\n\t}\n};\n/** Where the default theme goes in `temporaryDirectory`, and its file content. */\nfunction defaultThemeFile(temporaryDirectory) {\n\treturn {\n\t\tpath: path.join(temporaryDirectory, `${DEFAULT_THEME_NAME}.json`),\n\t\tcontent: `${JSON.stringify(DEFAULT_THEME, null, 2)}\\n`\n\t};\n}\n//#endregion\n//#region src/services/theme/sync.ts\n/** @deprecated Node-only sync shim; use writeDefaultThemeFile. Removed in M2. */\nasync function writeDefaultTheme(temporaryDirectory) {\n\tconst { path, content } = defaultThemeFile(temporaryDirectory);\n\tawait fs.promises.writeFile(path, content, { mode: 384 });\n\treturn path;\n}\n//#endregion\n//#region src/services/theme/index.ts\nconst AGENT_IDENTITY_COLORS = [\n\t\"accent\",\n\t\"mdCode\",\n\t\"toolDiffAdded\",\n\t\"warning\",\n\t\"mdHeading\",\n\t\"syntaxNumber\"\n];\nfunction agentIdentityColorIndex(identity) {\n\tlet hash = 2166136261;\n\tfor (const character of identity) {\n\t\thash ^= character.charCodeAt(0);\n\t\thash = Math.imul(hash, 16777619);\n\t}\n\treturn (hash >>> 0) % AGENT_IDENTITY_COLORS.length;\n}\n/** Stable semantic color shared by every UI surface that identifies an agent run. */\nfunction agentIdentityColor(identity) {\n\treturn AGENT_IDENTITY_COLORS[agentIdentityColorIndex(identity)];\n}\n/**\n* Prefer the identity's stable color, then walk the palette to avoid reusing a\n* color already visible on the same surface. Once every color is occupied,\n* reuse the stable preference rather than changing existing assignments.\n*/\nfunction allocateAgentIdentityColor(identity, occupied) {\n\tconst preferredIndex = agentIdentityColorIndex(identity);\n\tfor (let offset = 0; offset < AGENT_IDENTITY_COLORS.length; offset++) {\n\t\tconst color = AGENT_IDENTITY_COLORS[(preferredIndex + offset) % AGENT_IDENTITY_COLORS.length];\n\t\tif (!occupied.has(color)) return color;\n\t}\n\treturn AGENT_IDENTITY_COLORS[preferredIndex];\n}\n/** Writes the default theme into `temporaryDirectory` through `fs`, readable by its owner only, and returns its path. */\nasync function writeDefaultThemeFile(fs, temporaryDirectory, context) {\n\tconst { path, content } = defaultThemeFile(temporaryDirectory);\n\tgetOrThrow(await fs.writeFile(path, content, context));\n\tawait nodeHost.setMode(path, 384);\n\treturn path;\n}\n//#endregion\nexport { DEFAULT_THEME as a, writeDefaultTheme as i, allocateAgentIdentityColor as n, DEFAULT_THEME_NAME as o, writeDefaultThemeFile as r, agentIdentityColor as t };\n\n//# sourceMappingURL=theme-BX_hfErv.mjs.map","import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { globalPoConfigDirectory } from '@agimon-ai/po-config/config';\nimport { resolvePluginEntries, resolveSharedSkills } from '@agimon-ai/po-config/domains';\nimport type { DomainMcpAllowlist, PluginEntry } from '@agimon-ai/po-config/domains';\nimport { loadMajorModesConfig, resolveLayers } from '@agimon-ai/po-config/majorModes';\nimport type { MajorModesConfig } from '@agimon-ai/po-config/majorModes';\nimport { applyProfileEnvironment, buildPersonaPrompt, resolveProfile } from '@agimon-ai/po-config/profiles';\nimport type { AgentProfile } from '@agimon-ai/po-config/profiles';\nimport { PO_USER_MCP_CONFIG_FILE } from '@agimon-ai/po-core/mcpProjection';\nimport { PO_MCP_SESSION_ENV_VAR } from '@agimon-ai/po-core/mcpSession';\nimport {\n  createHarnessTelemetry,\n  HARNESS_EVENT,\n  type HarnessTelemetry,\n} from '@agimon-ai/po-core/runtimeLogSinkTelemetry';\nimport { resolveMcpAllowlist } from '@agimon-ai/po-domain/mcp';\nimport { materializePluginEntries } from '@agimon-ai/po-domain/plugins';\nimport { collectResources, type HarnessResources } from '@agimon-ai/po-domain/resources';\nimport { DEFAULT_THEME_NAME, writeDefaultTheme } from '@agimon-ai/po-ui/theme';\n\nimport { createHarnessSession } from '../../composition/harnessState';\nimport type { HarnessOptions } from '../../composition/types/harness';\n\nconst PRIVATE_FILE_MODE = 0o600;\nconst RESOLVE_CONFIG_PHASE = 'resolve_config';\nconst COLLECT_RESOURCES_PHASE = 'collect_resources';\nconst BUILD_CONTEXT_PHASE = 'build_context';\n\n/**\n * Everything a command needs, resolved once.\n *\n * All three commands need the same expensive preparation (domains resolved,\n * plugins collected into a temp directory, environment assembled), so it is\n * built here and handed to whichever command runs.\n */\nexport interface HarnessContext {\n  options: HarnessOptions;\n  environment: NodeJS.ProcessEnv;\n  resources: HarnessResources;\n  plugins: PluginEntry[];\n  profile?: string;\n  personaDirectory?: string;\n  /** Root personaDirectory resolves against, when a profile supplied one. */\n  personaRoot?: string;\n  mcpAllowlist?: DomainMcpAllowlist;\n  majorModesConfig: MajorModesConfig;\n  selectedLayers: string[];\n  defaultThemePath: string;\n  cleanup(): Promise<void>;\n}\n\n/**\n * Applies the provider environment a preset needs.\n *\n * Exported so a session server can apply the same rules before anything reads them.\n */\nexport function configurePreset(\n  options: Pick<HarnessOptions, 'preset' | 'piArgs'>,\n  environment: NodeJS.ProcessEnv,\n): void {\n  if (options.preset === 'kimi') {\n    if (!environment.KIMI_API_KEY && environment.KIMI_CODE_API_KEY) {\n      environment.KIMI_API_KEY = environment.KIMI_CODE_API_KEY;\n    }\n    if (!environment.KIMI_API_KEY) {\n      throw new Error('KIMI_API_KEY or KIMI_CODE_API_KEY is required for the kimi preset');\n    }\n  }\n}\n\n/** Resolves the optional persona and environment profile selected for this run. */\nexport function resolveHarnessProfile(options: HarnessOptions): AgentProfile | undefined {\n  return options.profile ? resolveProfile(options.configRoot ?? options.repoRoot, options.profile) : undefined;\n}\n\n/**\n * Resolves the full matrix and stages every resource Pi will need.\n *\n * The caller owns the returned cleanup(): the temporary directory holding\n * skills, agents, and the generated MCP config has to outlive this function\n * and be removed once the selected command is done with it.\n */\nexport async function buildHarnessContext(\n  options: HarnessOptions,\n  telemetry: HarnessTelemetry = createHarnessTelemetry({ cwd: options.cwd, env: options.environment ?? process.env }),\n): Promise<HarnessContext> {\n  // A worktree reads its workspace's configuration; resources still come from the checkout.\n  const configRoot = options.configRoot ?? options.repoRoot;\n  // Everything up to collectResources reads configuration off disk, so a single\n  // malformed modes.yaml or profiles.yaml surfaces here as a failed launch\n  // with no other record.\n  const configured = await telemetry\n    .runInSpan(`po_pi.${RESOLVE_CONFIG_PHASE}`, { 'harness.phase': RESOLVE_CONFIG_PHASE }, async () => {\n      const majorModesConfig = loadMajorModesConfig(configRoot, options.homeDirectory, options.environment);\n      const selectedLayers = resolveLayers(majorModesConfig, options.majorMode);\n      const profile = resolveHarnessProfile(options);\n      if (!fs.existsSync(options.cwd) || !fs.statSync(options.cwd).isDirectory()) {\n        throw new Error(`Working directory does not exist: ${options.cwd}`);\n      }\n      return {\n        majorModesConfig,\n        selectedLayers,\n        profile,\n        plugins: await materializePluginEntries(\n          resolvePluginEntries(configRoot, options.domains, options.pluginDirectories),\n        ),\n        mcpAllowlist: resolveMcpAllowlist(configRoot, options.domains),\n        sharedSkills: resolveSharedSkills(configRoot, options.domains),\n      };\n    })\n    .catch(async (error: unknown) => {\n      await telemetry.recordError(HARNESS_EVENT.configLoadFailed, error, {\n        'harness.phase': RESOLVE_CONFIG_PHASE,\n        'harness.major_mode': options.majorMode,\n        'harness.domain_count': options.domains.length,\n      });\n      throw error;\n    });\n\n  const { majorModesConfig, selectedLayers, profile, plugins, mcpAllowlist } = configured;\n  const personaDirectory = profile?.persona;\n  // A global profile's persona lives beside the global config, not in the repo.\n  const personaRoot = profile?.personaRoot ?? configRoot;\n  const resources = await telemetry\n    .runInSpan(\n      `po_pi.${COLLECT_RESOURCES_PHASE}`,\n      { 'harness.plugin.count': plugins.length, 'harness.agents': options.agents, 'harness.mcp': options.mcp },\n      () =>\n        collectResources(options.repoRoot, plugins, {\n          agents: options.agents,\n          mcp: options.mcp,\n          // Set by a caller that stages into a directory it owns.\n          temporaryDirectory: options.resourceDirectory,\n          // Per repository, under the global home, so it outlives this process's resources.\n          skillCacheDirectory:\n            options.resourceDirectory === undefined\n              ? path.join(\n                  globalPoConfigDirectory(options.homeDirectory ?? os.homedir()),\n                  'cache',\n                  'skills',\n                  crypto.createHash('sha256').update(path.resolve(options.repoRoot)).digest('hex').slice(0, 32),\n                )\n              : path.join(options.resourceDirectory, 'cache', 'skills'),\n          mcpAllowlist,\n          sharedSkills: configured.sharedSkills,\n          pluginDataRoot: path.join(globalPoConfigDirectory(options.homeDirectory ?? os.homedir()), 'plugin-data'),\n          userMcpConfigPath: path.join(\n            globalPoConfigDirectory(options.homeDirectory ?? os.homedir()),\n            PO_USER_MCP_CONFIG_FILE,\n          ),\n        }),\n    )\n    .catch(async (error: unknown) => {\n      // Conflicting skills, agents, or MCP servers all fail here, and the plugin\n      // that caused it is only identifiable from the message.\n      await telemetry.recordError(HARNESS_EVENT.resourceCollectionFailed, error, {\n        'harness.phase': COLLECT_RESOURCES_PHASE,\n        'harness.plugin.count': plugins.length,\n      });\n      throw error;\n    });\n\n  try {\n    const defaultThemePath = await writeDefaultTheme(resources.temporaryDirectory);\n    const environment = { ...(options.environment ?? process.env) };\n    // The file-backed projection published through Cordis is authoritative.\n    // Never let a legacy parent-process projection leak into this Po session.\n    delete environment[PO_MCP_SESSION_ENV_VAR];\n    const profileEnvironment = applyProfileEnvironment(environment, profile?.env ?? {});\n\n    configurePreset(options, environment);\n    environment.NX_DAEMON ??= 'false';\n    environment.PO_THEME ||= DEFAULT_THEME_NAME;\n    environment.CLAUDE_PROJECT_DIR = options.repoRoot;\n    environment.CODEX_REPO_ROOT = options.repoRoot;\n    environment.ORIGINAL_REPO_PATH ||= options.repoRoot;\n    environment.MCP_UI_VIEWER ??= '';\n\n    const personaPrompt = personaDirectory ? buildPersonaPrompt(personaRoot, personaDirectory) : undefined;\n    let personaFile: string | undefined;\n    if (personaPrompt) {\n      personaFile = path.join(resources.temporaryDirectory, 'persona.md');\n      await fs.promises.writeFile(personaFile, `${personaPrompt}\\n`, { mode: PRIVATE_FILE_MODE });\n    }\n\n    // One write, describing the child rather than this process. The state file\n    // is the child's authority and the environment is what it projects for the\n    // hooks and packages that can only read an environment.\n    createHarnessSession(\n      {\n        root: options.repoRoot,\n        majorMode: options.majorMode,\n        temporaryDirectory: resources.temporaryDirectory,\n        domains: options.domains,\n        layers: selectedLayers,\n        profile: profile?.name,\n        profileIdentity: profile?.identity,\n        profileVoice: profile?.voice,\n        profileEnvironment,\n        personaFile,\n        skillDirectories: resources.skillDirectories,\n        agentDirectories: resources.agentDirectories,\n        additionalDirectories: options.additionalDirectories,\n        childExtensions: [],\n        pluginDirectories: options.pluginDirectories,\n        agents: options.agents,\n        mcp: options.mcp,\n        mcpConfigPath: resources.mcpConfigPath,\n        mcpProjection: resources.mcpProjection,\n        allowProtectedWrites: options.allowProtectedWrites,\n      },\n      { directory: resources.temporaryDirectory, environment },\n    );\n    if (options.agents) {\n      environment.PI_SUBAGENT_EXTRA_AGENT_DIRS = resources.agentDirectories.join(path.delimiter);\n      environment.PI_SUBAGENT_EXTRA_SKILL_DIRS = resources.skillDirectories.join(path.delimiter);\n    }\n\n    return {\n      options,\n      environment,\n      resources,\n      plugins,\n      profile: profile?.name,\n      personaDirectory,\n      personaRoot,\n      mcpAllowlist,\n      majorModesConfig,\n      selectedLayers,\n      defaultThemePath,\n      cleanup: resources.cleanup.bind(resources),\n    };\n  } catch (error) {\n    // Preparation failed after the temp directory existed, so nothing will be\n    // handed back to clean it up.\n    await telemetry.recordError(HARNESS_EVENT.contextBuildFailed, error, {\n      'harness.phase': BUILD_CONTEXT_PHASE,\n      'harness.major_mode': options.majorMode,\n      ...(profile?.name ? { 'harness.profile': profile.name } : {}),\n    });\n    await resources.cleanup();\n    throw error;\n  }\n}\n","import MagicString from 'magic-string';\nimport { parseAst } from 'rolldown/parseAst';\nimport { transformSync } from 'rolldown/utils';\n\n/** Called at the top of every loop body and function body; throws once the run must stop. */\nexport const GUARD_NAME = '__po_g';\n/** Every `import(x)` becomes a call to this host function, which loads another script body. */\nexport const IMPORT_NAME = '__po_import';\n\nconst MAX_SOURCE_CHARS = 64 * 1024;\nconst GUARD_CALL = `${GUARD_NAME}();`;\nconst LOOP_TYPES = new Set(['WhileStatement', 'DoWhileStatement', 'ForStatement', 'ForInStatement', 'ForOfStatement']);\nconst FUNCTION_TYPES = new Set(['FunctionDeclaration', 'FunctionExpression', 'ArrowFunctionExpression']);\nconst IMPORT_KEYWORD = 'import';\nconst BASE64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n/** How a body is wrapped: the exec script runs at once, an imported one becomes a function of `args`. */\nconst WRAPPERS = {\n  main: ['(async function __po_main(){', '\\n})()'],\n  import: ['(async function (args){', '\\n})'],\n} as const;\n\nexport class ScriptCompileError extends Error {\n  override readonly name = 'SyntaxError';\n}\n\ninterface AstNode {\n  readonly type: string;\n  readonly start: number;\n  readonly end: number;\n  readonly body?: AstNode | readonly AstNode[];\n  readonly expression?: boolean;\n  readonly [key: string]: unknown;\n}\n\nfunction isNode(value: unknown): value is AstNode {\n  return typeof value === 'object' && value !== null && typeof (value as { type?: unknown }).type === 'string';\n}\n\nexport interface CompiledScript {\n  readonly code: string;\n  /** 1-based line in the submitted body for a 1-based line of `code`, when known. */\n  readonly lineOf: (line: number) => number | undefined;\n}\n\n/** The first source line each generated line maps to, from a v3 source map's `mappings`. */\nfunction sourceLines(mappings: string): (number | undefined)[] {\n  const lines: (number | undefined)[] = [];\n  let sourceLine = 0;\n  for (const group of mappings.split(';')) {\n    let first: number | undefined;\n    for (const segment of group.split(',')) {\n      const fields: number[] = [];\n      let value = 0;\n      let shift = 0;\n      for (const char of segment) {\n        const digit = BASE64.indexOf(char);\n        value += (digit & 31) << shift;\n        if (digit & 32) shift += 5;\n        else {\n          fields.push(value & 1 ? -(value >>> 1) : value >>> 1);\n          value = 0;\n          shift = 0;\n        }\n      }\n      if (fields.length < 4) continue;\n      sourceLine += fields[2] as number;\n      first ??= sourceLine + 1;\n    }\n    lines.push(first);\n  }\n  return lines;\n}\n\nfunction insertGuards(code: string, program: AstNode): string {\n  const output = new MagicString(code);\n  const visit = (node: AstNode): void => {\n    if (node.type === 'ImportExpression') {\n      output.overwrite(node.start, node.start + IMPORT_KEYWORD.length, IMPORT_NAME, { contentOnly: true });\n    }\n    if (LOOP_TYPES.has(node.type) && isNode(node.body)) {\n      const body = node.body;\n      if (body.type === 'BlockStatement') output.appendLeft(body.start + 1, GUARD_CALL);\n      else {\n        output.prependRight(body.start, `{${GUARD_CALL}`);\n        output.appendLeft(body.end, '}');\n      }\n    } else if (node.type === 'StaticBlock') {\n      output.appendLeft(code.indexOf('{', node.start) + 1, GUARD_CALL);\n    } else if (FUNCTION_TYPES.has(node.type) && isNode(node.body)) {\n      const body = node.body;\n      if (node.type === 'ArrowFunctionExpression' && node.expression) {\n        output.prependRight(body.start, `(${GUARD_NAME}(),`);\n        output.appendLeft(body.end, ')');\n      } else output.appendLeft(body.start + 1, GUARD_CALL);\n    }\n    for (const [key, value] of Object.entries(node)) {\n      if (key === 'parent') continue;\n      if (Array.isArray(value)) for (const child of value) if (isNode(child)) visit(child);\n      if (isNode(value)) visit(value);\n    }\n  };\n  visit(program);\n  return output.toString();\n}\n\n/**\n * Turns a model-written TypeScript body into guarded JavaScript whose loops and functions call the\n * guard, so a runaway script stops even after an `await`. `main` runs the body as an async IIFE;\n * `import` evaluates to an async function of `args`. Lines of the body stay on the wrapper's line.\n */\nexport function compileModule(source: string, kind: keyof typeof WRAPPERS = 'main'): CompiledScript {\n  if (source.length > MAX_SOURCE_CHARS) throw new ScriptCompileError(`Script exceeds ${MAX_SOURCE_CHARS} characters.`);\n  for (const name of [GUARD_NAME, IMPORT_NAME]) {\n    if (source.includes(name)) throw new ScriptCompileError(`\"${name}\" is reserved.`);\n  }\n  const [before, after] = WRAPPERS[kind];\n  const stripped = transformSync('script.ts', `${before}${source}${after}`, {\n    lang: 'ts',\n    sourceType: 'script',\n    target: 'es2022',\n    sourcemap: true,\n  });\n  if (stripped.errors.length > 0) {\n    throw new ScriptCompileError(stripped.errors.map((error) => error.message).join('\\n'));\n  }\n  let program: AstNode;\n  try {\n    program = parseAst(stripped.code, { lang: 'js', sourceType: 'script' }, 'script.js') as unknown as AstNode;\n  } catch (error) {\n    const message = error instanceof Error ? error.message : String(error);\n    if (/import statement/u.test(message)) {\n      throw new ScriptCompileError('Static import statements are not supported; use await import(...) instead.');\n    }\n    throw new ScriptCompileError(message);\n  }\n  const lines = sourceLines(stripped.map?.mappings ?? '');\n  return { code: insertGuards(stripped.code, program), lineOf: (line) => lines[line - 1] };\n}\n\n/** The guarded JavaScript of an exec body. */\nexport function compileScript(source: string): string {\n  return compileModule(source).code;\n}\n","import { GUARD_NAME } from './compile';\n\n/** The context realm's own intrinsics, so values the script sees are its own kind. */\nexport interface ScriptRealm {\n  readonly Error: ErrorConstructor;\n  readonly Promise: PromiseConstructor;\n  readonly Object: ObjectConstructor;\n  readonly Array: ArrayConstructor;\n  readonly Function: FunctionConstructor;\n}\n\nexport interface Membrane {\n  /** A host value as the script may see it. */\n  wrap(value: unknown): unknown;\n  /** A script value as the host may keep it after the run: proxies become their targets. */\n  exportValue(value: unknown): unknown;\n  /** Removes tracked listeners and revokes every proxy. */\n  end(): void;\n}\n\ntype AnyFunction = (...args: unknown[]) => unknown;\n\nconst ALWAYS_HIDDEN: readonly PropertyKey[] = ['constructor', '__proto__', 'prototype'];\nconst REMOVER_FOR: Readonly<Record<string, string>> = {\n  on: 'off',\n  once: 'off',\n  addListener: 'removeListener',\n  prependListener: 'removeListener',\n  prependOnceListener: 'removeListener',\n  addEventListener: 'removeEventListener',\n};\nconst GUARD_CALLS = new RegExp(`${GUARD_NAME}\\\\(\\\\)[;,]`, 'gu');\nconst EXPORT_DEPTH = 6;\n\nfunction isObjectLike(value: unknown): value is object {\n  return (typeof value === 'object' && value !== null) || typeof value === 'function';\n}\n\nfunction messageOf(error: unknown): string {\n  if (isObjectLike(error) && 'message' in error) return String((error as { message: unknown }).message);\n  return String(error);\n}\n\n/**\n * Wraps live host objects for a script so callbacks cannot crash the process, listeners and\n * proxies end with the run, and the obvious prototype climbs are hidden. Hardening, not a boundary.\n */\nexport function createMembrane(\n  realm: ScriptRealm,\n  options: { readonly deny?: readonly string[]; readonly onDiagnostic?: (message: string) => void } = {},\n): Membrane {\n  const hidden = new Set<PropertyKey>([...ALWAYS_HIDDEN, ...(options.deny ?? [])]);\n  const proxyOf = new WeakMap<object, object>();\n  const targetOf = new WeakMap<object, object>();\n  const callbackOf = new WeakMap<object, AnyFunction>();\n  const revokers: (() => void)[] = [];\n  const subscriptions: { target: object; remover: string; event: unknown; listener: unknown }[] = [];\n  let ended = false;\n\n  const report = (message: string): void => options.onDiagnostic?.(message);\n  const isScriptValue = (value: object): boolean => value instanceof realm.Object;\n\n  const toScriptError = (error: unknown): Error => {\n    const scriptError = new realm.Error(messageOf(error));\n    if (isObjectLike(error) && 'name' in error && typeof error.name === 'string') scriptError.name = error.name;\n    return scriptError;\n  };\n\n  const safeCallback = (callback: AnyFunction): AnyFunction => {\n    const existing = callbackOf.get(callback);\n    if (existing) return existing;\n    const safe = function (this: unknown, ...args: unknown[]): unknown {\n      if (ended) return undefined;\n      try {\n        const result = Reflect.apply(callback, wrap(this), args.map(wrap));\n        if (isObjectLike(result) && typeof (result as { then?: unknown }).then === 'function') {\n          return Promise.resolve(result).then(unwrap, (error: unknown) => {\n            report(`A callback passed to a live object rejected: ${messageOf(error)}`);\n            return undefined;\n          });\n        }\n        return unwrap(result);\n      } catch (error) {\n        report(`A callback passed to a live object threw: ${messageOf(error)}`);\n        return undefined;\n      }\n    };\n    // Playwright serialises functions for the page; send the script's source without guard calls.\n    Object.defineProperty(safe, 'toString', {\n      value: () => Function.prototype.toString.call(callback).replace(GUARD_CALLS, ''),\n    });\n    callbackOf.set(callback, safe);\n    return safe;\n  };\n\n  function unwrap(value: unknown, depth = 0): unknown {\n    if (!isObjectLike(value)) return value;\n    const target = targetOf.get(value);\n    if (target) return target;\n    if (typeof value === 'function') return isScriptValue(value) ? safeCallback(value as AnyFunction) : value;\n    if (depth > 2 || !isScriptValue(value)) return value;\n    if (Array.isArray(value)) return value.map((item) => unwrap(item, depth + 1));\n    if (Object.getPrototypeOf(value) !== realm.Object.prototype) return value;\n    return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, unwrap(item, depth + 1)]));\n  }\n\n  const subscriber = (target: object, method: AnyFunction, remover: string): AnyFunction => {\n    return (...args: unknown[]) => {\n      const hostArgs = args.map((argument) => unwrap(argument));\n      const result = Reflect.apply(method, target, hostArgs);\n      const listener = hostArgs.find((argument) => typeof argument === 'function');\n      if (listener) subscriptions.push({ target, remover, event: hostArgs[0], listener });\n      return result;\n    };\n  };\n\n  function makeProxy(target: object): object {\n    // A bound constructor has no nonconfigurable prototype, so hidden prototype properties stay hidden.\n    const shadow = typeof target === 'function' ? function () {}.bind(undefined) : Object.create(null);\n    const { proxy, revoke } = Proxy.revocable(shadow as object, {\n      get: (_shadow, key) => {\n        if (hidden.has(key)) return undefined;\n        let value: unknown;\n        try {\n          value = Reflect.get(target, key, target);\n        } catch (error) {\n          throw toScriptError(error);\n        }\n        if (typeof value === 'function' && typeof key === 'string' && key in REMOVER_FOR) {\n          return wrap(subscriber(target, value as AnyFunction, REMOVER_FOR[key] as string));\n        }\n        return wrap(value);\n      },\n      set: (_shadow, key, value) => !hidden.has(key) && Reflect.set(target, key, unwrap(value), target),\n      has: (_shadow, key) => !hidden.has(key) && Reflect.has(target, key),\n      ownKeys: () => Reflect.ownKeys(target).filter((key) => !hidden.has(key)),\n      getOwnPropertyDescriptor: (_shadow, key) => {\n        if (hidden.has(key)) return undefined;\n        const descriptor = Reflect.getOwnPropertyDescriptor(target, key);\n        if (!descriptor) return undefined;\n        return {\n          configurable: true,\n          enumerable: descriptor.enumerable ?? false,\n          writable: true,\n          value: wrap(Reflect.get(target, key, target)),\n        };\n      },\n      defineProperty: () => false,\n      deleteProperty: (_shadow, key) => !hidden.has(key) && Reflect.deleteProperty(target, key),\n      getPrototypeOf: () => null,\n      setPrototypeOf: () => false,\n      preventExtensions: () => false,\n      construct: (_shadow, args: unknown[]) => {\n        if (ended) throw new realm.Error('This object is no longer available; the exec run ended.');\n        try {\n          // ponytail: subclassing and cross-realm instanceof are unsupported; preserve the host constructor.\n          return wrap(\n            Reflect.construct(\n              target as AnyFunction,\n              args.map((argument) => unwrap(argument)),\n            ),\n          ) as object;\n        } catch (error) {\n          throw toScriptError(error);\n        }\n      },\n      apply: (_shadow, thisArg, args: unknown[]) => {\n        if (ended) throw new realm.Error('This object is no longer available; the exec run ended.');\n        try {\n          return wrap(\n            Reflect.apply(\n              target as AnyFunction,\n              unwrap(thisArg),\n              args.map((argument) => unwrap(argument)),\n            ),\n          );\n        } catch (error) {\n          throw toScriptError(error);\n        }\n      },\n    });\n    revokers.push(revoke);\n    proxyOf.set(target, proxy);\n    targetOf.set(proxy, target);\n    return proxy;\n  }\n\n  function wrap(value: unknown): unknown {\n    if (!isObjectLike(value)) return value;\n    if (targetOf.has(value) || isScriptValue(value)) return value;\n    const existing = proxyOf.get(value);\n    if (existing) return existing;\n    if (value instanceof Promise) {\n      const scriptPromise = new realm.Promise((resolve, reject) => {\n        value.then(\n          (settled: unknown) => resolve(wrap(settled)),\n          (error: unknown) => reject(toScriptError(error)),\n        );\n      });\n      // An unawaited rejection stays visible to `await`, but never reaches the process handler.\n      scriptPromise.catch(() => undefined);\n      return scriptPromise;\n    }\n    if (Array.isArray(value)) return realm.Array.from(value, (item: unknown) => wrap(item));\n    return makeProxy(value);\n  }\n\n  const exportValue = (value: unknown, depth = 0): unknown => {\n    if (!isObjectLike(value)) return value;\n    const target = targetOf.get(value);\n    if (target) return target;\n    if (depth >= EXPORT_DEPTH || !isScriptValue(value)) return value;\n    if (Array.isArray(value)) return value.map((item) => exportValue(item, depth + 1));\n    if (value instanceof realm.Error) return value;\n    return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, exportValue(item, depth + 1)]));\n  };\n\n  const end = (): void => {\n    if (ended) return;\n    ended = true;\n    for (const { target, remover, event, listener } of subscriptions.reverse()) {\n      try {\n        const remove = Reflect.get(target, remover, target);\n        if (typeof remove === 'function') Reflect.apply(remove, target, [event, listener]);\n      } catch (error) {\n        report(`Could not remove a listener the script added: ${messageOf(error)}`);\n      }\n    }\n    for (const revoke of revokers) revoke();\n  };\n\n  return { wrap, exportValue, end };\n}\n","import vm from 'node:vm';\n\nimport type {\n  PoIsolateErrorKind,\n  PoIsolateRequest,\n  PoIsolateResult,\n  PoIsolateService,\n} from '@agimon-ai/po-core/platform';\n\nimport { compileModule, GUARD_NAME, IMPORT_NAME, ScriptCompileError, type CompiledScript } from './compile';\nimport { createMembrane, type ScriptRealm } from './membrane';\n\n/** Long asynchronous runs do not get an hours-long synchronous watchdog. */\nconst MAX_SYNC_TIMEOUT_MS = 120_000;\nconst SYNC_TIMEOUT_MARGIN_MS = 100;\n/** Guards consult the host abort check this often; the deadline itself is checked on every call. */\nconst ABORT_CHECK_MASK = 1023;\nconst SCRIPT_FILE = 'script.js';\n\n// Runs once per context before user code; captures `Date.now` so the script cannot tamper with it.\nconst PRELUDE = `(function (shouldStop, deadline) {\n  'use strict';\n  const now = Date.now;\n  let tripped = false;\n  let calls = 0;\n  class LimitError extends Error {\n    constructor() { super('Execution limit reached'); this.name = 'LimitError'; }\n  }\n  Object.defineProperty(globalThis, '${GUARD_NAME}', {\n    value: function () {\n      if (tripped || now() > deadline || ((++calls & ${ABORT_CHECK_MASK}) === 0 && shouldStop())) {\n        tripped = true;\n        throw new LimitError();\n      }\n    },\n  });\n})`;\n\nclass LimitReached extends Error {\n  constructor(readonly kind: 'timeout' | 'aborted') {\n    super(kind === 'timeout' ? 'Script exceeded its deadline.' : 'Script was aborted.');\n  }\n}\n\nfunction failure(\n  kind: PoIsolateErrorKind,\n  name: string,\n  message: string,\n  extra: { line?: number; stack?: string } = {},\n): PoIsolateResult {\n  return { ok: false, error: { kind, name, message, ...extra } };\n}\n\n/** A compiled body the run evaluated, by its vm filename; imported ones carry their id. */\ntype RunFiles = Map<string, { readonly id?: string; readonly compiled: CompiledScript }>;\n\n/** The innermost stack frame in one of the run's files, as a line of that file's compiled code. */\nfunction locate(stack: string, files: RunFiles) {\n  for (const frame of stack.split('\\n')) {\n    for (const [filename, file] of files) {\n      for (const prefix of [' ', '(']) {\n        const at = frame.indexOf(`${prefix}${filename}:`);\n        if (at < 0) continue;\n        const line = Number(/^\\d+/u.exec(frame.slice(at + prefix.length + filename.length + 1))?.[0]);\n        if (line > 0) return { file, line };\n      }\n    }\n  }\n  return undefined;\n}\n\nfunction describe(error: unknown, files: RunFiles, aborted: boolean, deadlineMs: number): PoIsolateResult {\n  if (error instanceof LimitReached) {\n    return error.kind === 'timeout'\n      ? failure('timeout', 'TimeoutError', `Script exceeded ${deadlineMs} ms.`)\n      : failure('aborted', 'AbortError', 'Script was aborted.');\n  }\n  const record = (typeof error === 'object' && error !== null ? error : {}) as {\n    name?: unknown;\n    message?: unknown;\n    code?: unknown;\n    stack?: unknown;\n  };\n  if (record.code === 'ERR_SCRIPT_EXECUTION_TIMEOUT' || record.name === 'LimitError') {\n    return aborted\n      ? failure('aborted', 'AbortError', 'Script was aborted.')\n      : failure(\n          'timeout',\n          'TimeoutError',\n          `Script exceeded ${record.code === 'ERR_SCRIPT_EXECUTION_TIMEOUT' ? Math.min(deadlineMs, MAX_SYNC_TIMEOUT_MS) : deadlineMs} ms.`,\n        );\n  }\n  const name = typeof record.name === 'string' ? record.name : 'Error';\n  const message = typeof record.message === 'string' ? record.message : String(error);\n  const stack = typeof record.stack === 'string' ? record.stack : '';\n  const found = locate(stack, files);\n  if (!found) return failure('error', name, message);\n  const at = found.file.compiled.code.split('\\n')[found.line - 1]?.trim().slice(0, 200) ?? '';\n  const line = found.file.compiled.lineOf(found.line);\n  if (found.file.id === undefined) {\n    return failure('error', name, at ? `${message}\\n    at: ${at}` : message, line === undefined ? {} : { line });\n  }\n  return failure('error', name, `${message}\\n    at ${found.file.id}:${line ?? '?'}: ${at}`);\n}\n\n/** Runs one script on the main thread in a fresh `vm` context with guarded code and wrapped globals. */\nexport async function runScript(request: PoIsolateRequest): Promise<PoIsolateResult> {\n  const files: RunFiles = new Map();\n  let main: CompiledScript;\n  try {\n    main = compileModule(request.source);\n    files.set(SCRIPT_FILE, { compiled: main });\n  } catch (error) {\n    const message = error instanceof Error ? error.message : String(error);\n    return failure('compile', error instanceof ScriptCompileError ? error.name : 'SyntaxError', message);\n  }\n  const context = vm.createContext(Object.create(null), {\n    name: 'po-codemode',\n    codeGeneration: { strings: false, wasm: false },\n  });\n  const realm = vm.runInContext('({ Error, Promise, Object, Array, Function })', context) as ScriptRealm;\n  const membrane = createMembrane(realm, { deny: request.deny, onDiagnostic: request.onDiagnostic });\n  const deadline = Date.now() + request.deadlineMs;\n  let stopped = false;\n  let lastYield = Date.now();\n  let syncTimedOut = false;\n  // A guarded callback resumed after an await has the same synchronous budget as the initial body.\n  const heartbeat = setInterval(() => {\n    lastYield = Date.now();\n  }, 1_000);\n  heartbeat.unref();\n  const shouldStop = (): boolean => {\n    syncTimedOut ||= Date.now() - lastYield > MAX_SYNC_TIMEOUT_MS;\n    return stopped || syncTimedOut || request.signal.aborted || Date.now() > deadline;\n  };\n  const modules = new Map<string, unknown>();\n  const imports = new Map<string, Promise<unknown>>();\n  // Imported bodies share this context, its guard and deadline; each id compiles once per run.\n  const loadImport = async (specifier: string): Promise<unknown> => {\n    if (!request.resolveImport) throw new Error('import() is not available on this host.');\n    if (shouldStop()) throw new Error('The exec run ended.');\n    const resolved = await request.resolveImport(String(specifier));\n    if (shouldStop()) throw new Error('The exec run ended.');\n    const { id } = resolved;\n    if (modules.has(id)) return modules.get(id);\n    if (resolved.kind === 'module') {\n      modules.set(id, resolved.exports);\n      return resolved.exports;\n    }\n    let compiled: CompiledScript;\n    try {\n      compiled = compileModule(resolved.source, 'import');\n    } catch (error) {\n      throw new SyntaxError(`${id}: ${error instanceof Error ? error.message : String(error)}`);\n    }\n    files.set(id, { id, compiled });\n    const loaded = new vm.Script(compiled.code, { filename: id }).runInContext(context) as Record<string, unknown>;\n    loaded.default = loaded;\n    modules.set(id, loaded);\n    return loaded;\n  };\n  const importScript = (specifier: unknown): Promise<unknown> => {\n    const key = String(specifier);\n    let pending = imports.get(key);\n    if (!pending) {\n      pending = loadImport(key);\n      imports.set(key, pending);\n      void pending.catch(() => imports.delete(key));\n    }\n    return pending;\n  };\n  let timer: ReturnType<typeof setTimeout> | undefined;\n  let onAbort: (() => void) | undefined;\n  try {\n    (vm.runInContext(PRELUDE, context) as (stop: unknown, at: number) => void)(membrane.wrap(shouldStop), deadline);\n    Object.defineProperty(context, IMPORT_NAME, { value: membrane.wrap(importScript) });\n    for (const [name, value] of Object.entries(request.globals)) {\n      Object.defineProperty(context, name, { value: membrane.wrap(value), enumerable: true });\n    }\n    const limit = new Promise<never>((_resolve, reject) => {\n      timer = setTimeout(() => reject(new LimitReached('timeout')), request.deadlineMs);\n      onAbort = () => reject(new LimitReached('aborted'));\n      if (request.signal.aborted) onAbort();\n      else request.signal.addEventListener('abort', onAbort, { once: true });\n    });\n    const script = new vm.Script(main.code, { filename: SCRIPT_FILE });\n    const completion = script.runInContext(context, {\n      timeout: Math.min(request.deadlineMs, MAX_SYNC_TIMEOUT_MS) + SYNC_TIMEOUT_MARGIN_MS,\n    }) as Promise<unknown>;\n    completion.catch(() => undefined);\n    const value = await Promise.race([completion, limit]);\n    if (shouldStop()) throw new LimitReached(request.signal.aborted ? 'aborted' : 'timeout');\n    return { ok: true, value: membrane.exportValue(value) };\n  } catch (error) {\n    return describe(error, files, request.signal.aborted, syncTimedOut ? MAX_SYNC_TIMEOUT_MS : request.deadlineMs);\n  } finally {\n    stopped = true;\n    clearTimeout(timer);\n    clearInterval(heartbeat);\n    if (onAbort) request.signal.removeEventListener('abort', onAbort);\n    membrane.end();\n  }\n}\n\n/** Node binding of `po/isolate`: live objects on the main thread, guarded against runaway loops. */\nexport function createNodeIsolate(): PoIsolateService {\n  return { abiVersion: 1, liveObjects: true, run: runScript };\n}\n","import { createHash } from 'node:crypto';\nimport { mkdir, symlink } from 'node:fs/promises';\nimport { isBuiltin } from 'node:module';\nimport path from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport type { PoNpm } from '@agimon-ai/po-core/platform';\nimport { writeFileAtomic } from '@agimon-ai/po-core/runtimeJson';\n\nimport { ensureRuntimeImportPackage } from '../../composition/layerPackageInstaller';\nimport { withSyncLock } from '../../composition/syncService';\n\ninterface NodeNpmOptions {\n  readonly poHome: string;\n  readonly homeDirectory: string;\n  readonly temporaryDirectory: string;\n  readonly environment: Readonly<Record<string, string | undefined>>;\n}\n\nconst PACKAGE_SPEC =\n  /^(?<name>(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*)(?:@(?<version>[a-zA-Z0-9.*~^<>=|+ -]+))?(?<subpath>\\/.*)?$/u;\nconst hash = (value: string): string => createHash('sha256').update(value).digest('hex');\n\n/** Registry packages only. The version is kept out of the Node import specifier. */\nexport function parseNpmSpecifier(specifier: string) {\n  const match = specifier.startsWith('npm:') ? PACKAGE_SPEC.exec(specifier.slice(4)) : null;\n  const name = match?.groups?.name;\n  const version = match?.groups?.version ?? '*';\n  const subpath = match?.groups?.subpath ?? '';\n  if (\n    !name ||\n    !version.trim() ||\n    subpath\n      .split('/')\n      .slice(1)\n      .some((segment) => !segment || segment === '.' || segment === '..' || !/^[a-zA-Z0-9_.-]+$/u.test(segment))\n  ) {\n    throw new Error(`Invalid npm import ${JSON.stringify(specifier)}. Use npm:package@version/subpath.`);\n  }\n  return { name, version, module: `${name}${subpath}`, selector: `${name}@${version}` };\n}\n\n/** Trusted Node packages in the hub's one upm runtime, shared across all sessions. */\nexport function createNodeNpm(options: NodeNpmOptions): PoNpm {\n  const directory = path.join(options.poHome, 'runtime');\n  const bridges = new Map<string, string>();\n  return {\n    async import(specifier, { signal }) {\n      signal?.throwIfAborted();\n      const parsed = parseNpmSpecifier(specifier);\n      const builtin = isBuiltin(parsed.name);\n      const alias = `__po_codemode_${hash(parsed.name)}`;\n      const module = builtin ? `${alias}${parsed.module.slice(parsed.name.length)}` : parsed.module;\n      await withSyncLock(options.poHome, signal, async () => {\n        await ensureRuntimeImportPackage(parsed.name, parsed.version, {\n          homeDirectory: options.homeDirectory,\n          environment: { ...options.environment, PO_HOME: options.poHome },\n        });\n        if (builtin) {\n          // A bare builtin ignores node_modules. Each package needs its own stable alias.\n          await symlink(\n            path.join(directory, 'node_modules', parsed.name),\n            path.join(directory, 'node_modules', alias),\n            'junction',\n          ).catch((error: NodeJS.ErrnoException) => {\n            if (error.code !== 'EEXIST') throw error;\n          });\n        }\n      });\n      signal?.throwIfAborted();\n      const bridgeDirectory = path.join(directory, '.codemode');\n      await mkdir(bridgeDirectory, { recursive: true });\n      const bridge = path.join(bridgeDirectory, `${hash(parsed.module)}.mjs`);\n      let url = bridges.get(bridge);\n      if (!url) {\n        writeFileAtomic(bridge, `import * as value from ${JSON.stringify(module)};\\nexport { value };\\n`);\n        url = pathToFileURL(bridge).href;\n        bridges.set(bridge, url);\n      }\n      signal?.throwIfAborted();\n      // ponytail: package code has Node authority and cannot be preempted; a worker/process is the upgrade path.\n      const loaded = await import(url);\n      signal?.throwIfAborted();\n      return loaded.value as Record<string, unknown>;\n    },\n  };\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport {\n  type DeclaredServerPackage,\n  type PoServerBundleOwner,\n  declaredServerPackagesOf,\n  orderServerPackages,\n} from '@agimon-ai/po-core/serverPlugin';\n\nimport type { ExtensionComposition } from '../cli/extensionAssembler';\n\nfunction packageRootOf(entry: string): string {\n  let directory = path.dirname(fs.realpathSync(entry));\n  for (;;) {\n    if (fs.existsSync(path.join(directory, 'package.json'))) return directory;\n    const parent = path.dirname(directory);\n    if (parent === directory) throw new Error(`No package manifest owns ${entry}`);\n    directory = parent;\n  }\n}\n\n/** One server package a composition set selects, with the built entry a host imports. */\nexport interface ServerPackageCandidate {\n  readonly declaration: DeclaredServerPackage;\n  /** Absolute, symlink-resolved path of the package's built `dist` entry. */\n  readonly module: string;\n  /** Every major mode and layer that admitted the package. */\n  readonly owners: readonly PoServerBundleOwner[];\n}\n\n/**\n * The server packages the given compositions select, in host installation order.\n *\n * Each composition contributes the packages owning its selected entries, and\n * each package records which major mode and layer admitted it. A package that\n * two different directories claim is ambiguous, and a built entry that resolves\n * outside its package is refused.\n */\nexport function serverPackageCandidates(compositions: readonly ExtensionComposition[]): ServerPackageCandidate[] {\n  const packages = new Map<string, { declaration: DeclaredServerPackage; owners: PoServerBundleOwner[] }>();\n  for (const composition of compositions) {\n    const majorMode = composition.majorMode?.name;\n    if (!majorMode) throw new Error('A server bundle composition needs its major mode');\n    const roots = new Set(composition.packageEntries.map(packageRootOf));\n    for (const root of roots) {\n      const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')) as Record<string, unknown>;\n      for (const declaration of declaredServerPackagesOf(root, manifest)) {\n        const previous = packages.get(declaration.packageName);\n        if (previous && previous.declaration.packageDir !== root) {\n          throw new Error(`Ambiguous server bundle package: ${declaration.packageName}`);\n        }\n        const candidate = previous ?? { declaration, owners: [] };\n        const layers = composition.selections\n          .filter(\n            (selection) => selection.outcome === 'resolved' && selection.path && packageRootOf(selection.path) === root,\n          )\n          .map((selection) => selection.layer);\n        // Fixed host packages have no layer selection; default is always explicitly admitted.\n        for (const layer of new Set(layers.length > 0 ? layers : ['default'])) {\n          if (!candidate.owners.some((owner) => owner.majorMode === majorMode && owner.layer === layer)) {\n            candidate.owners.push({ majorMode, layer });\n          }\n        }\n        packages.set(declaration.packageName, candidate);\n      }\n    }\n  }\n  return orderServerPackages([...packages.values()].map(({ declaration }) => declaration)).map((declaration) => {\n    const module = fs.realpathSync(path.resolve(declaration.packageDir, declaration.dist));\n    const relative = path.relative(declaration.packageDir, module);\n    if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {\n      throw new Error(`Server entry escapes package: ${declaration.packageName}`);\n    }\n    return { declaration, module, owners: packages.get(declaration.packageName)!.owners };\n  });\n}\n","/** One package entry a scope loads, identified by the URL its current content imports from. */\nexport interface ScopePackageIdentity {\n  /** The resolved entry file, stable across rebuilds. */\n  readonly module: string;\n  /** Content-addressed import URL from `packageUrls`; a new URL means new content. */\n  readonly url: string;\n  /**\n   * What else decides whether the scope loads this entry (ownership, selected mode). A\n   * change remounts the scope without importing anything new.\n   */\n  readonly selection?: string;\n}\n\nexport interface ScopeChange {\n  /** No identities were recorded for this scope before. */\n  readonly first: boolean;\n  /** URLs that are new to the scope: added entries and entries whose content changed. */\n  readonly changed: readonly string[];\n  /** Entries whose URL is the same but whose selection changed. */\n  readonly reselected: readonly string[];\n  /** Entries the scope no longer loads. */\n  readonly removed: readonly string[];\n  /** Previously committed URLs that a newer URL of the same entry replaces. */\n  readonly superseded: readonly string[];\n}\n\nexport interface PackageReloadCheck {\n  /**\n   * Compares a scope's current identities with the ones it last committed. Nothing is\n   * recorded until `commit`, so a reload that fails is retried by the next check.\n   */\n  diff(scope: string, identities: readonly ScopePackageIdentity[]): ScopeChange;\n  commit(scope: string, identities: readonly ScopePackageIdentity[]): void;\n  forget(scope: string): void;\n}\n\nexport function createPackageReloadCheck(): PackageReloadCheck {\n  const committed = new Map<string, ReadonlyMap<string, ScopePackageIdentity>>();\n  const byModule = (identities: readonly ScopePackageIdentity[]) =>\n    new Map(identities.map((identity) => [identity.module, identity]));\n  return {\n    diff(scope, identities) {\n      const previous = committed.get(scope);\n      const current = byModule(identities);\n      if (previous === undefined)\n        return {\n          first: true,\n          changed: [...new Set(identities.map((identity) => identity.url))],\n          reselected: [],\n          removed: [],\n          superseded: [],\n        };\n      const kept = [...current.values()].filter((identity) => previous.get(identity.module)?.url === identity.url);\n      return {\n        first: false,\n        changed: [\n          ...new Set(\n            [...current.values()]\n              .filter((identity) => previous.get(identity.module)?.url !== identity.url)\n              .map((identity) => identity.url),\n          ),\n        ],\n        reselected: kept\n          .filter((identity) => previous.get(identity.module)?.selection !== identity.selection)\n          .map((identity) => identity.module),\n        removed: [...previous.keys()].filter((module) => !current.has(module)),\n        superseded: [\n          ...new Set(\n            [...current.values()].flatMap((identity) => {\n              const before = previous.get(identity.module)?.url;\n              return before !== undefined && before !== identity.url ? [before] : [];\n            }),\n          ),\n        ],\n      };\n    },\n    commit(scope, identities) {\n      committed.set(scope, byModule(identities));\n    },\n    forget(scope) {\n      committed.delete(scope);\n    },\n  };\n}\n\n/**\n * Imports each URL once per process.\n *\n * Package URLs are content-addressed, so a URL already imported is the same code: a\n * reload re-imports only the URLs whose content changed. Native `import()` caches by URL\n * too; this keeps that guarantee explicit and observable for the loaders that take an\n * `importer` seam. A failed import is not cached, so the poison set decides retries.\n */\nexport function createLiveModuleCache(\n  importer: (url: string) => Promise<unknown> = (url) => import(url),\n): (url: string) => Promise<unknown> {\n  const modules = new Map<string, Promise<unknown>>();\n  return (url) => {\n    let module = modules.get(url);\n    if (module === undefined) {\n      module = importer(url);\n      modules.set(url, module);\n      module.catch(() => {\n        if (modules.get(url) === module) modules.delete(url);\n      });\n    }\n    return module;\n  };\n}\n","import { loadMajorModesConfig, resolveLayers } from '@agimon-ai/po-config/majorModes';\nimport type { LiveMcpPluginEntry } from '@agimon-ai/po-core/mcpFacet';\nimport type { PoApiScope } from '@agimon-ai/po-core/packageApi';\nimport type { LiveServerPackageEntry } from '@agimon-ai/po-core/serverPlugin';\n\nimport type { ExtensionComposition } from '../cli/extensionAssembler';\nimport { rootCompositions } from '../cli/sessionComposition';\nimport { compositionPackageRoots } from '../web';\nimport { serverPackageCandidates } from './index';\nimport { type McpPluginCandidate, mcpPluginCandidates } from './mcpBundle';\nimport { createLiveModuleCache, createPackageReloadCheck, type ScopeChange } from './packageReloadCheck';\nimport { createPackageUrls } from './packageUrl';\n\nexport interface BundlerServiceOptions {\n  readonly homeDirectory: string;\n  readonly environment: NodeJS.ProcessEnv;\n  /** Installed host payload: import its packages in place without writing content snapshots beside them. */\n  readonly immutableRoot?: string;\n  /** Called after a root's compositions are resolved, so the caller can watch what they read. */\n  readonly onCompositions?: (root: string, compositions: readonly ExtensionComposition[]) => void;\n}\n\nexport interface RootSelection {\n  readonly root: string;\n  readonly majorMode: string;\n  readonly activeLayers: string[];\n}\n\ninterface RootMcp {\n  readonly candidates: McpPluginCandidate[];\n  readonly entries: LiveMcpPluginEntry[];\n}\n\ninterface RootMemo {\n  compositions?: ExtensionComposition[];\n  selection?: RootSelection;\n  packageEntries?: Promise<LiveServerPackageEntry[]>;\n  mcp?: Promise<RootMcp>;\n}\n\n/**\n * Process-level owner of what Po compiles and loads: content-addressed package URLs, the\n * live module cache, the poison set, per-scope reload tracking, and a per-root memo of the\n * compositions and entries a root selects. Every reader shares one computation until\n * `invalidate`; the caller decides when (a finished sync or a watched change).\n */\nexport function createBundlerService(options: BundlerServiceOptions) {\n  /** Mutable packages get content-addressed URLs; the host's installed payload imports in place. */\n  const packageUrls = createPackageUrls({ immutableRoot: options.immutableRoot });\n  /** URLs whose live import timed out or threw; skipped by every loader until the content changes. */\n  const poisoned = new Set<string>();\n  /** Imports each content-addressed URL once, so a reload imports only what changed. */\n  const importer = createLiveModuleCache();\n  /** The package identities each mounted global and workspace scope last loaded. */\n  const reloadCheck = createPackageReloadCheck();\n  const memos = new Map<string, RootMemo>();\n  const memoFor = (root: string): RootMemo => {\n    let memo = memos.get(root);\n    if (memo === undefined) {\n      memo = {};\n      memos.set(root, memo);\n    }\n    return memo;\n  };\n  /** A pending load shared by every reader; a failed one is dropped so the next reader retries. */\n  const shared = <T>(\n    read: () => Promise<T> | undefined,\n    write: (value: Promise<T> | undefined) => void,\n    load: () => Promise<T>,\n  ) => {\n    const existing = read();\n    if (existing !== undefined) return existing;\n    const loading = load();\n    write(loading);\n    loading.catch(() => {\n      if (read() === loading) write(undefined);\n    });\n    return loading;\n  };\n\n  /**\n   * Every composition the root's config can select, one per major mode, resolved live.\n   * A package sync has not prepared yet is left out with a diagnostic.\n   */\n  const compositions = (root: string): ExtensionComposition[] => {\n    const memo = memoFor(root);\n    if (memo.compositions === undefined) {\n      memo.compositions = rootCompositions({\n        root,\n        homeDirectory: options.homeDirectory,\n        environment: options.environment,\n        tolerateUnsynced: true,\n      });\n      options.onCompositions?.(root, memo.compositions);\n    }\n    return memo.compositions;\n  };\n\n  const defaultSelection = (root: string): RootSelection => {\n    const memo = memoFor(root);\n    if (memo.selection === undefined) {\n      const config = loadMajorModesConfig(root, options.homeDirectory, options.environment);\n      const majorMode = config.defaultMajorMode;\n      memo.selection = { root, majorMode, activeLayers: resolveLayers(config, majorMode) };\n    }\n    return memo.selection;\n  };\n\n  /** The root's server package entries, each with the URL its current package content imports from. */\n  const packageEntries = (root: string): Promise<LiveServerPackageEntry[]> => {\n    const memo = memoFor(root);\n    return shared(\n      () => memo.packageEntries,\n      (value) => (memo.packageEntries = value),\n      async () => {\n        const entries: LiveServerPackageEntry[] = [];\n        for (const { declaration, module, owners } of serverPackageCandidates(compositions(root)))\n          entries.push({\n            packageName: declaration.packageName,\n            entry: declaration.entry,\n            module,\n            url: await packageUrls.urlFor(module),\n            scopes: declaration.scopes,\n            owners,\n            required: declaration.required === true,\n          });\n        return entries;\n      },\n    );\n  };\n\n  /** The root's MCP plugin candidates and their entries with current URLs. */\n  const mcpEntries = (root: string): Promise<RootMcp> => {\n    const memo = memoFor(root);\n    return shared(\n      () => memo.mcp,\n      (value) => (memo.mcp = value),\n      async () => {\n        const candidates = mcpPluginCandidates(compositions(root));\n        const entries: LiveMcpPluginEntry[] = [];\n        for (const { declaration, module, owners } of candidates)\n          entries.push({\n            packageName: declaration.packageName,\n            ...(declaration.ui === undefined ? {} : { widgets: declaration.ui.widgets }),\n            entry: declaration.entry,\n            module,\n            url: await packageUrls.urlFor(module),\n            owners,\n          });\n        return { candidates, entries };\n      },\n    );\n  };\n\n  /**\n   * What a global or workspace scope loads: one identity per server package entry in that scope.\n   * The URL changes with package content; `selection` carries ownership and the root's\n   * default mode, so a modes.yaml change that selects a package in or out is reloaded too.\n   */\n  const scopeIdentities = (root: string, scope: PoApiScope, entries: readonly LiveServerPackageEntry[]) => {\n    const { majorMode, activeLayers } = defaultSelection(root);\n    return entries\n      .filter((entry) => entry.scopes.includes(scope))\n      .map((entry) => ({\n        module: entry.module,\n        url: entry.url,\n        selection: JSON.stringify([entry.owners, entry.required === true, majorMode, activeLayers]),\n      }));\n  };\n\n  return {\n    packageUrls,\n    poisoned,\n    importer,\n    compositions,\n    defaultSelection,\n    packageEntries,\n    mcpEntries,\n    /** Every package root the root's config can select, over all its major modes or only `majorMode`'s. */\n    packageRoots: (root: string, majorMode?: string): string[] =>\n      compositionPackageRoots(\n        compositions(root).filter(\n          (composition) => majorMode === undefined || composition.majorMode?.name === majorMode,\n        ),\n      ),\n    /** How the scope's current entries differ from what it last committed. */\n    diffScope: async (key: string, root: string, scope: PoApiScope): Promise<ScopeChange> =>\n      reloadCheck.diff(key, scopeIdentities(root, scope, await packageEntries(root))),\n    /** Records what a scope installed, so the next diff compares against it. */\n    commitScope: (key: string, root: string, scope: PoApiScope, entries: readonly LiveServerPackageEntry[]): void =>\n      reloadCheck.commit(key, scopeIdentities(root, scope, entries)),\n    forgetScope: (key: string): void => reloadCheck.forget(key),\n    /** Drops every root's memo; the next reader recomputes from disk. */\n    invalidate: (): void => memos.clear(),\n  };\n}\n\nexport type BundlerService = ReturnType<typeof createBundlerService>;\n","import { randomUUID } from 'node:crypto';\nimport { constants } from 'node:fs';\nimport fs from 'node:fs/promises';\nimport os from 'node:os';\nimport path from 'node:path';\n\nconst MAX_RECORDING_BYTES = 128 * 1024 * 1024;\nconst MAX_STORE_BYTES = 512 * 1024 * 1024;\nconst MAX_RECORDINGS = 8;\nconst RETENTION_MS = 24 * 60 * 60 * 1000;\nconst CHUNK_BYTES = 1024 * 1024;\nconst SAFE_ID = /^[a-zA-Z0-9-]{1,128}$/u;\n\ntype Recording = {\n  sessionId: string;\n  grantId: string;\n  artifactId: string;\n  sizeBytes: number;\n  completedAt: string;\n  file: string;\n};\n\n/** Imports only grant-bound native IPC receipts, never browser-provided paths. */\nexport class ComputerUseRecordingStore {\n  private readonly recordings = new Map<string, Recording>();\n  private readonly imports = new Map<string, Promise<unknown>>();\n  private closed = false;\n  private readonly incarnations = new Map<string, number>();\n  constructor(\n    private readonly directory: string,\n    private readonly stagingRoot = path.join(os.tmpdir(), 'po-computer-use'),\n  ) {}\n\n  private async prune(): Promise<void> {\n    let bytes = [...this.recordings.values()].reduce((total, item) => total + item.sizeBytes, 0);\n    for (const [id, item] of this.recordings) {\n      if (\n        Date.now() - Date.parse(item.completedAt) < RETENTION_MS &&\n        this.recordings.size <= MAX_RECORDINGS &&\n        bytes <= MAX_STORE_BYTES\n      )\n        break;\n      this.recordings.delete(id);\n      this.imports.delete(`${item.sessionId}\\0${item.grantId}`);\n      bytes -= item.sizeBytes;\n      await fs.rm(item.file, { force: true });\n    }\n  }\n\n  async importStop(sessionId: string, grantId: string, value: unknown): Promise<unknown> {\n    if (this.closed) throw new Error('Recording storage is closed.');\n    const key = `${sessionId}\\0${grantId}`;\n    const previous = this.imports.get(key);\n    if (previous) return previous;\n    const pending = this.importReceipt(sessionId, grantId, value);\n    this.imports.set(key, pending);\n    try {\n      const result = await pending;\n      if (!(result as { artifact?: unknown } | undefined)?.artifact) this.imports.delete(key);\n      return result;\n    } catch {\n      this.imports.delete(key);\n      throw new Error('Native recording import failed.');\n    }\n  }\n\n  private async importReceipt(sessionId: string, grantId: string, value: unknown): Promise<unknown> {\n    const receipt = value as {\n      stopped?: unknown;\n      artifact?: { kind?: unknown; path?: unknown; contentType?: unknown; audioScope?: unknown };\n    } | null;\n    if (receipt?.stopped !== true || receipt.artifact === undefined) return { stopped: receipt?.stopped === true };\n    const incarnation = this.incarnations.get(sessionId) ?? 0;\n    const artifact = receipt.artifact;\n    if (\n      !SAFE_ID.test(grantId) ||\n      artifact.kind !== 'screen_recording' ||\n      artifact.contentType !== 'video/mp4' ||\n      (artifact.audioScope !== 'target_application' && artifact.audioScope !== 'target_application_and_microphone')\n    )\n      throw new Error('Invalid native recording receipt.');\n    const grantDirectory = path.join(this.stagingRoot, grantId);\n    const source = path.join(grantDirectory, 'recording.mp4');\n    if (artifact.path !== source) throw new Error('Invalid native recording location.');\n    for (const directory of [this.stagingRoot, grantDirectory]) {\n      const stat = await fs.lstat(directory);\n      if (!stat.isDirectory() || stat.isSymbolicLink() || (stat.mode & 0o077) !== 0)\n        throw new Error('Recording staging is not private.');\n    }\n    const input = await fs.open(source, constants.O_RDONLY | constants.O_NOFOLLOW);\n    const artifactId = randomUUID();\n    const destination = path.join(this.directory, `${artifactId}.mp4`);\n    const temporary = `${destination}.tmp`;\n    let output: Awaited<ReturnType<typeof fs.open>> | undefined;\n    try {\n      const stat = await input.stat();\n      if (!stat.isFile() || stat.size < 1 || stat.size > MAX_RECORDING_BYTES)\n        throw new Error('Recording exceeds the permitted size.');\n      await fs.mkdir(this.directory, { recursive: true, mode: 0o700 });\n      const root = await fs.lstat(this.directory);\n      if (!root.isDirectory() || root.isSymbolicLink() || (root.mode & 0o077) !== 0)\n        throw new Error('Recording storage is not private.');\n      output = await fs.open(temporary, 'wx', 0o600);\n      const buffer = Buffer.alloc(CHUNK_BYTES);\n      let copied = 0;\n      while (true) {\n        const { bytesRead } = await input.read(buffer, 0, buffer.length, null);\n        if (bytesRead === 0) break;\n        copied += bytesRead;\n        if (copied > MAX_RECORDING_BYTES || copied > stat.size) throw new Error('Recording changed during import.');\n        await output.writeFile(buffer.subarray(0, bytesRead));\n      }\n      if (copied !== stat.size) throw new Error('Recording changed during import.');\n      await output.sync();\n      await output.close();\n      output = undefined;\n      if (this.closed || (this.incarnations.get(sessionId) ?? 0) !== incarnation)\n        throw new Error('Recording storage is closed.');\n      await fs.rename(temporary, destination);\n      if (this.closed || (this.incarnations.get(sessionId) ?? 0) !== incarnation) {\n        await fs.rm(destination, { force: true });\n        throw new Error('Recording storage is closed.');\n      }\n      const item = {\n        sessionId,\n        grantId,\n        artifactId,\n        sizeBytes: copied,\n        completedAt: new Date().toISOString(),\n        file: destination,\n      };\n      this.recordings.set(artifactId, item);\n      await this.prune();\n      await fs.unlink(source);\n      await fs.rmdir(grantDirectory);\n      return {\n        stopped: true,\n        artifact: { artifactId, status: 'ready', sizeBytes: copied, completedAt: item.completedAt },\n      };\n    } catch {\n      this.recordings.delete(artifactId);\n      await fs.rm(temporary, { force: true });\n      await fs.rm(destination, { force: true });\n      throw new Error('Native recording import failed.');\n    } finally {\n      await output?.close();\n      await input.close();\n    }\n  }\n\n  async forgetSession(sessionId: string): Promise<void> {\n    this.incarnations.set(sessionId, (this.incarnations.get(sessionId) ?? 0) + 1);\n    const files: string[] = [];\n    for (const [id, item] of this.recordings) {\n      if (item.sessionId !== sessionId) continue;\n      this.recordings.delete(id);\n      files.push(item.file);\n    }\n    for (const key of this.imports.keys()) if (key.startsWith(`${sessionId}\\0`)) this.imports.delete(key);\n    await Promise.all(files.map((file) => fs.rm(file, { force: true })));\n  }\n\n  async close(): Promise<void> {\n    this.closed = true;\n    await Promise.allSettled(this.imports.values());\n    this.imports.clear();\n    this.recordings.clear();\n    await fs.rm(this.directory, { recursive: true, force: true });\n  }\n\n  async read(sessionId: string, artifactId: string, range: string | undefined): Promise<Response> {\n    if (this.closed) return new Response(null, { status: 404 });\n    await this.prune();\n    const item = this.recordings.get(artifactId);\n    if (!item || item.sessionId !== sessionId) return new Response(null, { status: 404 });\n    const match = /^bytes=(\\d+)-(\\d+)$/u.exec(range ?? '');\n    const start = Number(match?.[1]);\n    const requestedEnd = Number(match?.[2]);\n    if (\n      !match ||\n      !Number.isSafeInteger(start) ||\n      !Number.isSafeInteger(requestedEnd) ||\n      start < 0 ||\n      start >= item.sizeBytes ||\n      requestedEnd < start ||\n      requestedEnd - start >= CHUNK_BYTES\n    )\n      return new Response(null, { status: 416 });\n    const end = Math.min(requestedEnd, item.sizeBytes - 1);\n    const input = await fs.open(item.file, constants.O_RDONLY | constants.O_NOFOLLOW).catch(() => undefined);\n    if (input === undefined) return new Response(null, { status: 410 });\n    try {\n      const bytes = Buffer.alloc(end - start + 1);\n      const { bytesRead } = await input.read(bytes, 0, bytes.length, start);\n      if (bytesRead !== bytes.length) return new Response(null, { status: 410 });\n      return new Response(bytes, {\n        status: 206,\n        headers: {\n          'content-type': 'video/mp4',\n          'content-range': `bytes ${start}-${end}/${item.sizeBytes}`,\n          'accept-ranges': 'bytes',\n          'cache-control': 'no-store',\n          'content-length': String(bytes.length),\n        },\n      });\n    } finally {\n      await input.close();\n    }\n  }\n}\n","import { randomUUID, timingSafeEqual } from 'node:crypto';\nimport fs from 'node:fs/promises';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport type { PoComputerUseHostBinding } from '@agimon-ai/po-core/hubChannel';\nimport { poApiCallerFrom } from '@agimon-ai/po-core/packageApi';\n\nimport { ComputerUseRecordingStore } from './computerUseRecordings';\n\nconst VERSION = 1;\nconst MAX_BYTES = 8 * 1024 * 1024;\nconst DESKTOP_HEADER = 'x-po-desktop';\ntype Transport = Pick<NodeJS.Process, 'send' | 'connected' | 'on' | 'off'>;\n\n/** The capability is discovered over the inherited Desktop IPC channel, never from environment flags. */\nexport async function createComputerUseBinding(\n  transport: Transport = process,\n  remotePolicy: {\n    isDeviceAuthorized?: (deviceId: string) => boolean;\n    stepUpRequired?: () => boolean;\n  } = {},\n): Promise<PoComputerUseHostBinding | undefined> {\n  if (!transport.send || !transport.connected) return undefined;\n  const recordings = new ComputerUseRecordingStore(await fs.mkdtemp(path.join(os.tmpdir(), 'po-recordings-')));\n  let available = false;\n  let enabled = false;\n  let closed = false;\n  let token = '';\n  let generation: string | undefined;\n  const ownedSessions = new Set<string>();\n  const revokedSessions = new Set<string>();\n  const listeners = new Map<() => void, string | undefined>();\n  const delegations = new Map<\n    string,\n    { deviceId: string; approved: boolean; abort: AbortController; grantId?: string; expiresAt?: number }\n  >();\n  const nativeAuthorized = (headers: Headers): boolean => {\n    const proof = headers.get(DESKTOP_HEADER) ?? '';\n    return available && /^[a-f0-9]{64}$/u.test(proof) && timingSafeEqual(Buffer.from(proof), Buffer.from(token));\n  };\n  const remoteCaller = (headers: Headers) => {\n    const caller = poApiCallerFrom(headers);\n    return caller?.locality === 'remote' && remotePolicy.isDeviceAuthorized?.(caller.deviceId) === true\n      ? caller\n      : undefined;\n  };\n  const notify = (sessionId?: string): void => {\n    for (const [listener, session] of listeners)\n      if (sessionId === undefined || session === undefined || session === sessionId) listener();\n  };\n  const revoke = (sessionId: string, retainRecording = false): void => {\n    const delegated = delegations.get(sessionId);\n    if (delegated === undefined) return;\n    if (!retainRecording) delegations.delete(sessionId);\n    delegated.expiresAt = undefined;\n    delegated.abort.abort();\n    revokedSessions.add(sessionId);\n    if (delegated.grantId !== undefined && available) {\n      void exchange(\n        { type: 'po:computer-use:request', sessionId, operation: 'stop', payload: { grantId: delegated.grantId } },\n        30_000,\n      )\n        .then((result) => recordings.importStop(sessionId, delegated.grantId!, result.result))\n        .catch(() => close());\n    }\n    notify(sessionId);\n  };\n  const pending = new Map<string, { finish: (value?: Record<string, unknown>, error?: Error) => void }>();\n  const send = (value: object): void => {\n    if (closed || !transport.connected) throw new Error('Desktop computer use is disconnected.');\n    transport.send!(value, (error: Error | null) => {\n      if (error) close();\n    });\n  };\n  const close = (): void => {\n    if (closed) return;\n    closed = true;\n    available = false;\n    token = '';\n    transport.off('message', onMessage);\n    transport.off('disconnect', close);\n    transport.off('exit', close);\n    for (const request of pending.values())\n      request.finish(undefined, new Error('Desktop computer use is disconnected.'));\n    pending.clear();\n    for (const sessionId of delegations.keys()) revoke(sessionId);\n    notify();\n    listeners.clear();\n    void recordings.close().catch(() => process.emitWarning('Computer-use recording cleanup failed.'));\n    // Keep ownership pinned while the server is alive, including after Desktop disconnects.\n  };\n  const onMessage = (value: unknown): void => {\n    if (!value || typeof value !== 'object' || Array.isArray(value)) return;\n    const message = value as Record<string, unknown>;\n    if (message.version !== VERSION) return;\n    if (message.type === 'po:computer-use:availability' && typeof message.enabled === 'boolean') {\n      enabled = message.enabled;\n      // Native stop/expiry also notifies availability without changing the global setting.\n      for (const sessionId of delegations.keys()) revoke(sessionId, true);\n      notify();\n      return;\n    }\n    if (typeof message.requestId !== 'string') return;\n    if (message.type !== 'po:computer-use:ready' && message.type !== 'po:computer-use:response') return;\n    if (Buffer.byteLength(JSON.stringify(message)) > MAX_BYTES) {\n      close();\n      return;\n    }\n    pending.get(message.requestId)?.finish(message);\n  };\n  transport.on('message', onMessage);\n  transport.on('disconnect', close);\n  transport.on('exit', close);\n\n  const exchange = (\n    value: Record<string, unknown>,\n    timeoutMs: number,\n    signal?: AbortSignal,\n  ): Promise<Record<string, unknown>> =>\n    new Promise((resolve, reject) => {\n      signal?.throwIfAborted();\n      if (closed || pending.size >= 128) throw new Error('Desktop computer-use transport is unavailable or busy.');\n      const requestId = randomUUID();\n      const cancel = (): void => {\n        try {\n          send({ type: 'po:computer-use:cancel', version: VERSION, requestId });\n        } catch {\n          /* Already disconnected. */\n        }\n      };\n      const finish = (result?: Record<string, unknown>, error?: Error): void => {\n        if (!pending.delete(requestId)) return;\n        clearTimeout(timer);\n        signal?.removeEventListener('abort', onAbort);\n        if (error) reject(error);\n        else resolve(result!);\n      };\n      const onAbort = (): void => {\n        cancel();\n        finish(undefined, new Error('Desktop computer-use request was cancelled.'));\n      };\n      const timer = setTimeout(() => {\n        cancel();\n        finish(undefined, new Error('Desktop computer-use request timed out.'));\n      }, timeoutMs);\n      pending.set(requestId, { finish });\n      signal?.addEventListener('abort', onAbort, { once: true });\n      try {\n        const message = { ...value, version: VERSION, requestId };\n        if (Buffer.byteLength(JSON.stringify(message)) > MAX_BYTES)\n          throw new Error('Desktop computer-use request is too large.');\n        send(message);\n      } catch (error) {\n        finish(undefined, error instanceof Error ? error : new Error(String(error)));\n      }\n    });\n\n  try {\n    const ready = await exchange({ type: 'po:computer-use:hello' }, 1_500);\n    if (\n      ready.type !== 'po:computer-use:ready' ||\n      typeof ready.token !== 'string' ||\n      !/^[a-f0-9]{64}$/u.test(ready.token)\n    ) {\n      throw new Error('Invalid Desktop capability handshake.');\n    }\n    token = ready.token;\n    available = true;\n    enabled = ready.enabled === true;\n  } catch {\n    close();\n    return undefined;\n  }\n\n  return {\n    get available() {\n      return available;\n    },\n    get enabled() {\n      return available && enabled;\n    },\n    authorize: nativeAuthorized,\n    readRecording: (scope, artifactId, range) => recordings.read(scope.sessionId, artifactId, range),\n    authorizeActivation(headers) {\n      if (!available || !enabled) return false;\n      if (nativeAuthorized(headers)) return true;\n      const caller = remoteCaller(headers);\n      return (\n        caller !== undefined &&\n        (remotePolicy.stepUpRequired?.() === true ? caller.stepUp === 'verified' : caller.stepUp === 'not-required')\n      );\n    },\n    authorizePending(sessionId, headers) {\n      if (nativeAuthorized(headers)) return true;\n      const caller = remoteCaller(headers);\n      const delegated = delegations.get(sessionId);\n      return (\n        available &&\n        enabled &&\n        caller !== undefined &&\n        delegated !== undefined &&\n        delegated.deviceId === caller.deviceId &&\n        delegated.expiresAt === undefined &&\n        !delegated.abort.signal.aborted\n      );\n    },\n    authorizeRecording(sessionId, headers) {\n      if (nativeAuthorized(headers)) return true;\n      const caller = remoteCaller(headers);\n      const delegated = delegations.get(sessionId);\n      return (\n        available && caller !== undefined && delegated?.approved === true && delegated.deviceId === caller.deviceId\n      );\n    },\n    authorizeSession(sessionId, headers) {\n      if (nativeAuthorized(headers)) return true;\n      const caller = remoteCaller(headers);\n      const delegated = delegations.get(sessionId);\n      if (available && enabled && caller !== undefined && !ownedSessions.has(sessionId)) return true;\n      return (\n        available &&\n        enabled &&\n        caller !== undefined &&\n        delegated?.approved === true &&\n        delegated.expiresAt !== undefined &&\n        delegated.expiresAt > Date.now() &&\n        delegated.deviceId === caller.deviceId &&\n        !delegated.abort.signal.aborted\n      );\n    },\n    claimSession(sessionId, headers) {\n      if (!available || !enabled) throw new Error('Desktop computer use is unavailable.');\n      const caller = headers === undefined ? undefined : remoteCaller(headers);\n      if (caller !== undefined) {\n        const previous = delegations.get(sessionId);\n        if (previous !== undefined && previous.deviceId !== caller.deviceId)\n          throw new Error('This session belongs to another paired device.');\n        if (previous?.abort.signal.aborted) {\n          previous.abort = new AbortController();\n          previous.grantId = undefined;\n        }\n        if (previous === undefined)\n          delegations.set(sessionId, {\n            deviceId: caller.deviceId,\n            approved: false,\n            abort: new AbortController(),\n          });\n      } else if (headers !== undefined && !nativeAuthorized(headers)) {\n        throw new Error('Native or paired authorization is required.');\n      }\n      revokedSessions.delete(sessionId);\n      ownedSessions.add(sessionId);\n    },\n    revokeDevice(deviceId) {\n      for (const [sessionId, delegated] of delegations) if (delegated.deviceId === deviceId) revoke(sessionId);\n    },\n    authorizePermissions(headers, change) {\n      if (!available) return false;\n      if (nativeAuthorized(headers)) return true;\n      const caller = remoteCaller(headers);\n      if (caller === undefined) return false;\n      if (!change) return true;\n      return remotePolicy.stepUpRequired?.() === true ? caller.stepUp === 'verified' : caller.stepUp === 'not-required';\n    },\n    async permissions(permission) {\n      if (!available) throw new Error('Desktop is unavailable.');\n      const result = await exchange(\n        { type: 'po:desktop:permissions', ...(permission === undefined ? {} : { permission }) },\n        // A request can wait on the person answering a macOS prompt.\n        permission === undefined ? 10_000 : 120_000,\n      );\n      if (result.ok !== true)\n        throw new Error(typeof result.error === 'string' ? result.error : 'Desktop permission request failed.');\n      return result.result;\n    },\n    ownsSession: (sessionId) => ownedSessions.has(sessionId),\n    forgetSession: (sessionId) => {\n      revoke(sessionId);\n      void recordings\n        .forgetSession(sessionId)\n        .catch(() => process.emitWarning('Computer-use recording cleanup failed.'));\n      // Keep private history pinned to Desktop, but never replay device approval after restart.\n    },\n    subscribe(listener, sessionId) {\n      listeners.set(listener, sessionId);\n      return () => {\n        listeners.delete(listener);\n      };\n    },\n    async request(scope, request) {\n      if (!available) throw new Error('Desktop computer use is unavailable.');\n      if (revokedSessions.has(scope.sessionId) && request.operation !== 'stop' && request.operation !== 'status')\n        throw new Error('Computer-use delegation was revoked.');\n      if (request.operation !== 'status' && request.operation !== 'targets' && !ownedSessions.has(scope.sessionId)) {\n        throw new Error('This session has not been authorized by Desktop.');\n      }\n      const delegated = delegations.get(scope.sessionId);\n      if (delegated !== undefined && remotePolicy.isDeviceAuthorized?.(delegated.deviceId) !== true) {\n        revoke(scope.sessionId);\n        if (request.operation !== 'stop') throw new Error('The paired device was revoked.');\n      }\n      if (request.operation === 'stop' && delegated !== undefined) {\n        delegated.expiresAt = undefined;\n        delegated.abort.abort();\n      }\n      const signal =\n        delegated === undefined || request.operation === 'stop'\n          ? request.signal\n          : request.signal === undefined\n            ? delegated.abort.signal\n            : AbortSignal.any([request.signal, delegated.abort.signal]);\n      const result = await exchange(\n        {\n          type: 'po:computer-use:request',\n          sessionId: scope.sessionId,\n          operation: request.operation,\n          ...(request.payload === undefined ? {} : { payload: request.payload }),\n        },\n        request.operation === 'activate' ? 120_000 : 30_000,\n        signal,\n      );\n      if (\n        typeof result.hostGeneration !== 'string' ||\n        (generation !== undefined && generation !== result.hostGeneration)\n      ) {\n        close();\n        throw new Error('Desktop generation changed. Authorize a new session.');\n      }\n      generation = result.hostGeneration;\n      if (result.ok !== true)\n        throw new Error(typeof result.error === 'string' ? result.error : 'Desktop request failed.');\n      if (request.operation === 'activate' && delegated !== undefined) {\n        if (\n          delegations.get(scope.sessionId) !== delegated ||\n          delegated.abort.signal.aborted ||\n          remotePolicy.isDeviceAuthorized?.(delegated.deviceId) !== true\n        )\n          throw new Error('The paired activation was revoked.');\n        delegated.approved = true;\n        const grant = result.result as { grantId?: unknown; expiresAt?: unknown } | undefined;\n        if (typeof grant?.expiresAt === 'number') delegated.expiresAt = grant.expiresAt;\n        if (typeof grant?.grantId === 'string') delegated.grantId = grant.grantId;\n      }\n      if (request.operation === 'stop') {\n        if (delegated !== undefined) delegated.expiresAt = undefined;\n        const grantId = (request.payload as { grantId?: unknown } | undefined)?.grantId;\n        if (typeof grantId !== 'string') throw new Error('Recording finalization requires its grant.');\n        return recordings.importStop(scope.sessionId, grantId, result.result);\n      }\n      return result.result;\n    },\n    close() {\n      if (closed) return;\n      try {\n        send({ type: 'po:computer-use:close', version: VERSION });\n      } finally {\n        close();\n      }\n    },\n  };\n}\n","import type { PoHubSessionCreateRequest, PoHubSessionScope } from '@agimon-ai/po-core/hubChannel';\nimport { definePoPluginMethod, type PoPluginRegistry } from '@agimon-ai/po-core/pluginProtocol';\nimport { Type, type Static } from 'typebox';\n\n/**\n * The global methods a contained server offers its host, over the token-gated protocol socket: the host creates,\n * closes and hands over the container's sessions with them. The host's HTTP routes cover the rest (revive, restart, resume).\n */\nexport const CONTAINED_SESSIONS_SERVICE = 'po-contained-sessions';\n\nconst Text = Type.String({ minLength: 1 });\nconst Texts = Type.Array(Type.String());\nconst Address = { service: CONTAINED_SESSIONS_SERVICE, scope: 'global', direction: 'client-to-server' } as const;\n\n/** A session request as the host sends it. A workflow context or a reservation never crosses the boundary. */\nconst CreateSessionInput = Type.Object(\n  {\n    cwd: Text,\n    name: Type.String(),\n    /** Reopens this saved session of the container instead of creating one. */\n    sessionId: Type.Optional(Text),\n    parentSessionId: Type.Optional(Text),\n    sessionProvenance: Type.Optional(Text),\n    selection: Type.Optional(\n      Type.Object({\n        majorMode: Type.Optional(Type.String()),\n        minorModes: Type.Optional(Texts),\n        profile: Type.Optional(Type.String()),\n        domains: Type.Optional(Texts),\n      }),\n    ),\n    model: Type.Optional(Type.String()),\n    thinking: Type.Optional(Type.String()),\n    appendSystemPrompt: Type.Optional(Type.String()),\n    tools: Type.Optional(Texts),\n  },\n  { additionalProperties: false },\n);\nexport type ContainedCreateSessionInput = Static<typeof CreateSessionInput>;\n\nexport const containedCreateSessionMethod = definePoPluginMethod({\n  ...Address,\n  method: 'createSession',\n  input: CreateSessionInput,\n  output: Type.Object({ sessionId: Text, cwd: Text, workspaceId: Type.Optional(Text) }),\n});\n\nexport const containedCloseSessionMethod = definePoPluginMethod({\n  ...Address,\n  method: 'closeSession',\n  input: Type.Object({ sessionId: Text, keepDormant: Type.Optional(Type.Boolean()) }, { additionalProperties: false }),\n  output: Type.Null(),\n});\n\n/** The open-session record of a host session whose files the host moved into the container. */\nconst AdoptedRecord = Type.Object(\n  {\n    sessionId: Text,\n    workspaceId: Text,\n    cwd: Text,\n    repoRoot: Type.Optional(Text),\n    groupingRoot: Type.Optional(Text),\n    name: Type.String(),\n    createdAt: Text,\n    parentSessionId: Type.Optional(Text),\n    sessionProvenance: Type.Optional(Text),\n    groups: Type.Optional(Texts),\n  },\n  { additionalProperties: false },\n);\nexport type ContainedAdoptedRecord = Static<typeof AdoptedRecord>;\n\nexport const containedAdoptSessionMethod = definePoPluginMethod({\n  ...Address,\n  method: 'adoptSession',\n  input: Type.Object({ sessionId: Text, record: AdoptedRecord }, { additionalProperties: false }),\n  output: Type.Null(),\n});\n\n/** The host request a contained server receives, rebuilt from what crossed the socket. */\nexport function containedSessionRequest(input: ContainedCreateSessionInput): PoHubSessionCreateRequest {\n  const { sessionId: _sessionId, ...request } = input;\n  return request;\n}\n\n/** What crosses the socket for a host request: everything but in-process capabilities and the abort signal. */\nexport function containedCreateInput(\n  request: PoHubSessionCreateRequest,\n  sessionId: string | undefined,\n): ContainedCreateSessionInput {\n  return {\n    cwd: request.cwd,\n    name: request.name,\n    ...(sessionId === undefined ? {} : { sessionId }),\n    ...(request.parentSessionId === undefined ? {} : { parentSessionId: request.parentSessionId }),\n    ...(request.sessionProvenance === undefined ? {} : { sessionProvenance: request.sessionProvenance }),\n    ...(request.selection === undefined\n      ? {}\n      : {\n          selection: {\n            ...(request.selection.majorMode === undefined ? {} : { majorMode: request.selection.majorMode }),\n            ...(request.selection.minorModes === undefined ? {} : { minorModes: [...request.selection.minorModes] }),\n            ...(request.selection.profile === undefined ? {} : { profile: request.selection.profile }),\n            ...(request.selection.domains === undefined ? {} : { domains: [...request.selection.domains] }),\n          },\n        }),\n    ...(request.model === undefined ? {} : { model: request.model }),\n    ...(request.thinking === undefined ? {} : { thinking: request.thinking }),\n    ...(request.appendSystemPrompt === undefined ? {} : { appendSystemPrompt: request.appendSystemPrompt }),\n    ...(request.tools === undefined ? {} : { tools: [...request.tools] }),\n  };\n}\n\n/** Mounts the contained session methods on a contained server's hub. Returns the unmount. */\nexport function registerContainedSessionMethods(\n  registry: PoPluginRegistry,\n  sessions: {\n    open(request: PoHubSessionCreateRequest, sessionId?: string): Promise<PoHubSessionScope>;\n    close(sessionId: string, keepDormant: boolean): Promise<void>;\n    /** Lists a handed-over session as dormant. Rejects a record of another workspace or another id. */\n    adopt?(record: ContainedAdoptedRecord): Promise<void>;\n  },\n): () => void {\n  const unmountCreate = registry.register({ scope: 'global' }, containedCreateSessionMethod, async (input, caller) => {\n    const opened = await sessions.open(\n      { ...containedSessionRequest(input), ...(caller.signal === undefined ? {} : { signal: caller.signal }) },\n      input.sessionId,\n    );\n    return {\n      sessionId: opened.sessionId,\n      cwd: opened.cwd,\n      ...(opened.workspaceId === undefined ? {} : { workspaceId: opened.workspaceId }),\n    };\n  });\n  const unmountClose = registry.register({ scope: 'global' }, containedCloseSessionMethod, async (input) => {\n    await sessions.close(input.sessionId, input.keepDormant === true);\n    return null;\n  });\n  const unmountAdopt =\n    sessions.adopt === undefined\n      ? () => undefined\n      : registry.register({ scope: 'global' }, containedAdoptSessionMethod, async (input) => {\n          if (input.record.sessionId !== input.sessionId) throw new Error('The adopted record names another session.');\n          await sessions.adopt?.(input.record);\n          return null;\n        });\n  return () => {\n    unmountCreate();\n    unmountClose();\n    unmountAdopt();\n  };\n}\n","import { execFile } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { promisify } from 'node:util';\n\nimport { globalPoConfigDirectory } from '@agimon-ai/po-config/config';\n\nconst WORKSPACES_FOLDER = 'workspace';\nconst DIRECTORY_MODE = 0o700;\nconst GIT_TIMEOUT_MS = 15_000;\n\nconst run = promisify(execFile);\n\n/**\n * Creates `~/.po/workspace/<name>` for a workspace added by name alone.\n *\n * The folder is made a git repository because workspace admission resolves a\n * path to its nearest repository root; an empty folder would otherwise resolve\n * to an ancestor such as home, which a `.po` directory marks as a root.\n */\nexport async function createDefaultWorkspaceFolder(name: string, homeDirectory: string): Promise<string> {\n  if (name === '' || path.basename(name) !== name || name === '.' || name === '..')\n    throw new Error(`\"${name}\" cannot be used as a workspace folder name.`);\n  const folder = path.join(globalPoConfigDirectory(homeDirectory), WORKSPACES_FOLDER, name);\n  await fs.promises.mkdir(folder, { recursive: true, mode: DIRECTORY_MODE });\n  if (!fs.existsSync(path.join(folder, '.git'))) {\n    await run('git', ['init', '--quiet'], { cwd: folder, timeout: GIT_TIMEOUT_MS, windowsHide: true });\n  }\n  return folder;\n}\n","import path from 'node:path';\n\nimport { registerChatgptAuthProvider } from '@agimon-ai/po-core/chatgptAuth';\nimport type { ModelGatewayDefaultModel, ModelGatewayHostRuntime } from '@agimon-ai/po-core/modelGateway';\nimport { modelConfigDirectory, modelSettingsDirectory } from '@agimon-ai/po-core/piSettings';\nimport { ModelRuntime, SettingsManager } from '@earendil-works/pi-coding-agent';\n\n/** What the host lends a contained workspace's model gateway: its own models and credentials, and its default. */\nexport interface HostModelGateway {\n  readonly modelRuntime: ModelGatewayHostRuntime;\n  /** The host's settings default, read again each time the gateway builds its catalogue. */\n  defaultModel(): ModelGatewayDefaultModel | undefined;\n}\n\n/**\n * The host's model runtime for container gateways, read from the same `auth.json` and `models.json` a host session\n * reads. ponytail: providers that Pi extensions register (a local bridge) are not in it; containers see only the\n * providers the files and the ChatGPT sign-in configure.\n */\nexport async function createHostModelGateway(agentDirectory: string, homeDirectory: string): Promise<HostModelGateway> {\n  const modelDirectory = modelConfigDirectory(agentDirectory, homeDirectory);\n  const settingsDirectory = modelSettingsDirectory(agentDirectory, homeDirectory);\n  const modelRuntime = await ModelRuntime.create({\n    authPath: path.join(modelDirectory, 'auth.json'),\n    modelsPath: path.join(modelDirectory, 'models.json'),\n    refreshOnCreate: false,\n  });\n  registerChatgptAuthProvider(modelRuntime);\n  return {\n    modelRuntime,\n    defaultModel: () => {\n      const settings = SettingsManager.create(settingsDirectory, settingsDirectory);\n      const provider = settings.getDefaultProvider();\n      const id = settings.getDefaultModel();\n      if (!provider || !id) return undefined;\n      const thinkingLevel = settings.getModelThinkingLevel(provider, id) ?? settings.getDefaultThinkingLevel();\n      return { provider, id, ...(thinkingLevel === undefined ? {} : { thinkingLevel }) };\n    },\n  };\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { PoBackgroundWorkSnapshot } from '@agimon-ai/po-core/backgroundWork';\n\n/** Superseded package versions held in memory before a restart is pending. */\nexport const SUPERSEDED_LIMIT = 8;\n/** Quiet time before an idle restart, re-checked once it elapses. */\nexport const RESTART_DEBOUNCE_MS = 30_000;\n/** Live intent and deliberate recycle state; normal shutdown removes it. */\nexport const RECYCLE_FILE = 'recycle.json';\n/** Temporary failure: a supervisor restarts the server on the same port and token. */\nexport const RESTART_EXIT_CODE = 75;\n\n/**\n * Background work a restart would kill, matching po-autostop's gate: runners (open\n * terminals and background commands) and running subagents. Workflow runs are left out,\n * as they are there. Subagents count because a restart ends them mid-run just like a turn.\n */\nconst RESTART_BLOCKING_PROVIDERS: readonly string[] = ['po-runner', 'team-direct-runs', 'po-task'];\nconst RUNNER_PROVIDER = 'po-runner';\nconst RUNNER_WORKING_STATUS = 'running';\n\n/** True when a session's background-work snapshot holds work a restart would kill; fails closed. */\nexport function holdsRestart(snapshot: PoBackgroundWorkSnapshot): boolean {\n  if (snapshot.errors.some((error) => RESTART_BLOCKING_PROVIDERS.includes(error.provider))) return true;\n  return snapshot.items.some((item) => {\n    if (!RESTART_BLOCKING_PROVIDERS.includes(item.provider)) return false;\n    // A runner item without a status is not known to be done.\n    if (item.provider !== RUNNER_PROVIDER || item.status === undefined) return true;\n    return item.status === RUNNER_WORKING_STATUS;\n  });\n}\n\n/** Test-only: lowers the superseded-version limit so e2e tests can force an idle restart. */\nexport const TEST_IDLE_RESTART_LIMIT_ENV = 'PO_TEST_IDLE_RESTART_LIMIT';\n/** Test-only: shortens the idle-restart debounce for e2e tests. */\nexport const TEST_IDLE_RESTART_DEBOUNCE_ENV = 'PO_TEST_IDLE_RESTART_DEBOUNCE_MS';\n\nfunction parseTestOverride(environment: NodeJS.ProcessEnv, name: string, minimum: number): number | undefined {\n  const raw = environment[name];\n  if (raw === undefined || raw === '') return undefined;\n  const value = Number(raw);\n  if (!Number.isSafeInteger(value) || value < minimum)\n    throw new Error(`${name} must be an integer of at least ${String(minimum)}; got '${raw}'.`);\n  return value;\n}\n\n/**\n * Test-only overrides for the idle restart limit and debounce, read from the environment.\n * Production never sets these; an invalid value fails startup rather than being ignored.\n */\nexport function testIdleRestartOverrides(\n  environment: NodeJS.ProcessEnv,\n): Pick<IdleRestartOptions, 'limit' | 'debounceMs'> {\n  const limit = parseTestOverride(environment, TEST_IDLE_RESTART_LIMIT_ENV, 1);\n  const debounceMs = parseTestOverride(environment, TEST_IDLE_RESTART_DEBOUNCE_ENV, 0);\n  return { ...(limit === undefined ? {} : { limit }), ...(debounceMs === undefined ? {} : { debounceMs }) };\n}\n\nexport interface IdleRestartOptions {\n  /** True while any session runs a turn or a compaction, or a terminal is open. */\n  readonly busy: () => Promise<boolean>;\n  /** Starts the restart. Called at most once. */\n  readonly restart: () => void;\n  readonly limit?: number;\n  readonly debounceMs?: number;\n  readonly setTimer?: (callback: () => void, ms: number) => () => void;\n  readonly onError?: (error: unknown) => void;\n}\n\nexport interface IdleRestart {\n  /** Records package URLs replaced by newer ones; each URL counts once. */\n  supersede(urls: readonly string[]): void;\n  /** Re-arms the debounce when a restart is pending; call when activity may have stopped. */\n  poke(): void;\n  readonly pending: () => boolean;\n  supersededCount(): number;\n  pendingAgeMs(): number;\n  dispose(): void;\n}\n\nconst defaultTimer = (callback: () => void, ms: number): (() => void) => {\n  const timer = setTimeout(callback, ms);\n  timer.unref();\n  return () => clearTimeout(timer);\n};\n\n/**\n * Restarts the server at idle once old package versions pile up in memory.\n *\n * Native `import()` never unloads a module, so every superseded URL stays resident. At\n * `limit` the restart is pending; it fires after `debounceMs` with no busy work, and the\n * busy check runs again when the debounce elapses, so a turn that started meanwhile\n * defers it to the next poke.\n */\nexport function createIdleRestart(options: IdleRestartOptions): IdleRestart {\n  const limit = options.limit ?? SUPERSEDED_LIMIT;\n  const debounceMs = options.debounceMs ?? RESTART_DEBOUNCE_MS;\n  const setTimer = options.setTimer ?? defaultTimer;\n  const superseded = new Set<string>();\n  let cancel: (() => void) | undefined;\n  let fired = false;\n  let pendingSince: number | undefined;\n  const pending = () => superseded.size >= limit;\n  const poke = (): void => {\n    if (!pending() || fired) return;\n    cancel?.();\n    cancel = setTimer(() => {\n      cancel = undefined;\n      void options\n        .busy()\n        .then((busy) => {\n          if (busy || fired) return;\n          fired = true;\n          options.restart();\n        })\n        .catch((error: unknown) => options.onError?.(error));\n    }, debounceMs);\n  };\n  return {\n    supersede(urls) {\n      for (const url of urls) superseded.add(url);\n      if (pending() && pendingSince === undefined) pendingSince = Date.now();\n      poke();\n    },\n    poke,\n    pending,\n    supersededCount: () => superseded.size,\n    pendingAgeMs: () => (pendingSince === undefined || fired ? 0 : Math.max(0, Date.now() - pendingSince)),\n    dispose() {\n      cancel?.();\n      cancel = undefined;\n      fired = true;\n    },\n  };\n}\n\nexport interface RecycleState {\n  sessionIds: string[];\n  kind?: 'live';\n  crashRestores?: number[];\n  tunnel?: { hostname: string; closesAt?: number };\n}\n\nexport function writeRecycleFile(\n  directory: string,\n  sessionIds: readonly string[],\n  details: Omit<RecycleState, 'sessionIds'> = {},\n): void {\n  fs.mkdirSync(directory, { recursive: true });\n  const target = path.join(directory, RECYCLE_FILE);\n  const staging = `${target}.${String(process.pid)}.tmp`;\n  fs.writeFileSync(staging, `${JSON.stringify({ ...details, sessionIds }, null, 2)}\\n`);\n  fs.renameSync(staging, target);\n}\n\n/** Accept legacy recycle records, never trust arbitrary extra fields or tunnel secrets. */\nexport function readRecycleState(directory: string): RecycleState | undefined {\n  try {\n    const file = path.join(directory, RECYCLE_FILE);\n    if (fs.statSync(file).size > 1024 * 1024) return undefined;\n    const parsed = JSON.parse(fs.readFileSync(file, 'utf8')) as Partial<RecycleState> | null;\n    if (!parsed || !Array.isArray(parsed.sessionIds) || (parsed.kind !== undefined && parsed.kind !== 'live'))\n      return undefined;\n    const tunnel = parsed.tunnel;\n    return {\n      sessionIds: [...new Set(parsed.sessionIds.filter((id): id is string => typeof id === 'string'))],\n      ...(parsed.kind === 'live' ? { kind: 'live' } : {}),\n      crashRestores: Array.isArray(parsed.crashRestores)\n        ? parsed.crashRestores.filter((at): at is number => Number.isSafeInteger(at) && at >= 0)\n        : [],\n      ...(tunnel &&\n      typeof tunnel.hostname === 'string' &&\n      (tunnel.closesAt === undefined || (Number.isSafeInteger(tunnel.closesAt) && tunnel.closesAt >= 0))\n        ? {\n            tunnel: {\n              hostname: tunnel.hostname,\n              ...(tunnel.closesAt === undefined ? {} : { closesAt: tunnel.closesAt }),\n            },\n          }\n        : {}),\n    };\n  } catch {\n    return undefined;\n  }\n}\n\n/** Two automatic crash restores in 15 minutes, then require an explicit Wake. */\nexport function prepareSessionRestore(state: RecycleState | undefined, now = Date.now()) {\n  const crashRestores = (state?.crashRestores ?? []).filter((at) => at > now - 15 * 60_000 && at <= now);\n  const crash = state?.kind === 'live' && state.sessionIds.length > 0;\n  const blocked = crash && crashRestores.length >= 2;\n  if (crash && !blocked) crashRestores.push(now);\n  return { sessionIds: blocked ? [] : (state?.sessionIds ?? []), crashRestores, blocked };\n}\n\nexport function readRecycleFile(directory: string): string[] {\n  return readRecycleState(directory)?.sessionIds ?? [];\n}\n\nexport function removeRecycleFile(directory: string): void {\n  fs.rmSync(path.join(directory, RECYCLE_FILE), { force: true });\n}\n\n/** Reopens exactly the recycled sessions, then deletes the file whatever the outcome. */\nexport async function reopenRecycledSessions(\n  directory: string,\n  reopen: (sessionId: string) => Promise<void>,\n  onError: (sessionId: string, error: unknown) => void,\n  options: { sessionIds?: readonly string[]; removeAfter?: boolean } = {},\n): Promise<string[]> {\n  const ids = options.sessionIds ?? readRecycleFile(directory);\n  const reopened: string[] = [];\n  try {\n    for (const id of ids) {\n      try {\n        await reopen(id);\n        reopened.push(id);\n      } catch (error) {\n        onError(id, error);\n      }\n    }\n  } finally {\n    if (options.removeAfter !== false) removeRecycleFile(directory);\n  }\n  return reopened;\n}\n","export function isPromise(object) {\n    const isObjectOrFunction = (typeof object === 'object' && object !== null) ||\n        typeof object === 'function';\n    return (isObjectOrFunction && typeof object.then === 'function');\n}\n//# sourceMappingURL=isPromise.js.map","export function stringifyServiceIdentifier(serviceIdentifier) {\n    switch (typeof serviceIdentifier) {\n        case 'string':\n        case 'symbol':\n            return serviceIdentifier.toString();\n        case 'function':\n            return serviceIdentifier.name;\n        default:\n            throw new Error(`Unexpected ${typeof serviceIdentifier} service id type`);\n    }\n}\n//# sourceMappingURL=stringifyServiceIdentifier.js.map","const islazyServiceIdentifierSymbol = Symbol.for('@inversifyjs/common/islazyServiceIdentifier');\nexport class LazyServiceIdentifier {\n    [islazyServiceIdentifierSymbol];\n    #buildServiceId;\n    constructor(buildServiceId) {\n        this.#buildServiceId = buildServiceId;\n        this[islazyServiceIdentifierSymbol] = true;\n    }\n    static is(value) {\n        return (typeof value === 'object' &&\n            value !== null &&\n            value[islazyServiceIdentifierSymbol] === true);\n    }\n    unwrap() {\n        return this.#buildServiceId();\n    }\n}\n//# sourceMappingURL=LazyServiceIdentifier.js.map","/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n(function (Reflect) {\n    // Metadata Proposal\n    // https://rbuckton.github.io/reflect-metadata/\n    (function (factory) {\n        var root = typeof globalThis === \"object\" ? globalThis :\n            typeof global === \"object\" ? global :\n                typeof self === \"object\" ? self :\n                    typeof this === \"object\" ? this :\n                        sloppyModeThis();\n        var exporter = makeExporter(Reflect);\n        if (typeof root.Reflect !== \"undefined\") {\n            exporter = makeExporter(root.Reflect, exporter);\n        }\n        factory(exporter, root);\n        if (typeof root.Reflect === \"undefined\") {\n            root.Reflect = Reflect;\n        }\n        function makeExporter(target, previous) {\n            return function (key, value) {\n                Object.defineProperty(target, key, { configurable: true, writable: true, value: value });\n                if (previous)\n                    previous(key, value);\n            };\n        }\n        function sloppyModeThis() {\n            throw new ReferenceError(\"globalThis could not be found. Please polyfill globalThis before loading this module.\");\n        }\n    })(function (exporter, root) {\n        // feature test for Symbol support\n        var supportsSymbol = typeof Symbol === \"function\";\n        var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : fail(\"Symbol.toPrimitive not found.\");\n        var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : fail(\"Symbol.iterator not found.\");\n        // Load global or shim versions of Map, Set, and WeakMap\n        var functionPrototype = Object.getPrototypeOf(Function);\n        var _Map = typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : fail(\"A valid Map constructor could not be found.\");\n        var _Set = typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : fail(\"A valid Set constructor could not be found.\");\n        var _WeakMap = typeof WeakMap === \"function\" ? WeakMap : fail(\"A valid WeakMap constructor could not be found.\");\n        var registrySymbol = supportsSymbol ? Symbol.for(\"@reflect-metadata:registry\") : undefined;\n        var metadataRegistry = GetOrCreateMetadataRegistry();\n        var metadataProvider = CreateMetadataProvider(metadataRegistry);\n        /**\n         * Applies a set of decorators to a property of a target object.\n         * @param decorators An array of decorators.\n         * @param target The target object.\n         * @param propertyKey (Optional) The property key to decorate.\n         * @param attributes (Optional) The property descriptor for the target key.\n         * @remarks Decorators are applied in reverse order.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     Example = Reflect.decorate(decoratorsArray, Example);\n         *\n         *     // property (on constructor)\n         *     Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     Object.defineProperty(Example, \"staticMethod\",\n         *         Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n         *             Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n         *\n         *     // method (on prototype)\n         *     Object.defineProperty(Example.prototype, \"method\",\n         *         Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n         *             Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n         *\n         */\n        function decorate(decorators, target, propertyKey, attributes) {\n            if (!IsUndefined(propertyKey)) {\n                if (!IsArray(decorators))\n                    throw new TypeError();\n                if (!IsObject(target))\n                    throw new TypeError();\n                if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))\n                    throw new TypeError();\n                if (IsNull(attributes))\n                    attributes = undefined;\n                propertyKey = ToPropertyKey(propertyKey);\n                return DecorateProperty(decorators, target, propertyKey, attributes);\n            }\n            else {\n                if (!IsArray(decorators))\n                    throw new TypeError();\n                if (!IsConstructor(target))\n                    throw new TypeError();\n                return DecorateConstructor(decorators, target);\n            }\n        }\n        exporter(\"decorate\", decorate);\n        // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n        // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n        /**\n         * A default metadata decorator factory that can be used on a class, class member, or parameter.\n         * @param metadataKey The key for the metadata entry.\n         * @param metadataValue The value for the metadata entry.\n         * @returns A decorator function.\n         * @remarks\n         * If `metadataKey` is already defined for the target and target key, the\n         * metadataValue for that key will be overwritten.\n         * @example\n         *\n         *     // constructor\n         *     @Reflect.metadata(key, value)\n         *     class Example {\n         *     }\n         *\n         *     // property (on constructor, TypeScript only)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         static staticProperty;\n         *     }\n         *\n         *     // property (on prototype, TypeScript only)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         property;\n         *     }\n         *\n         *     // method (on constructor)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         static staticMethod() { }\n         *     }\n         *\n         *     // method (on prototype)\n         *     class Example {\n         *         @Reflect.metadata(key, value)\n         *         method() { }\n         *     }\n         *\n         */\n        function metadata(metadataKey, metadataValue) {\n            function decorator(target, propertyKey) {\n                if (!IsObject(target))\n                    throw new TypeError();\n                if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))\n                    throw new TypeError();\n                OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n            }\n            return decorator;\n        }\n        exporter(\"metadata\", metadata);\n        /**\n         * Define a unique metadata entry on the target.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param metadataValue A value that contains attached metadata.\n         * @param target The target object on which to define metadata.\n         * @param propertyKey (Optional) The property key for the target.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example);\n         *\n         *     // property (on constructor)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n         *\n         *     // decorator factory as metadata-producing annotation.\n         *     function MyAnnotation(options): Decorator {\n         *         return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n         *     }\n         *\n         */\n        function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n        }\n        exporter(\"defineMetadata\", defineMetadata);\n        /**\n         * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function hasMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"hasMetadata\", hasMetadata);\n        /**\n         * Gets a value indicating whether the target object has the provided metadata key defined.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function hasOwnMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"hasOwnMetadata\", hasOwnMetadata);\n        /**\n         * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function getMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"getMetadata\", getMetadata);\n        /**\n         * Gets the metadata value for the provided metadata key on the target object.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function getOwnMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"getOwnMetadata\", getOwnMetadata);\n        /**\n         * Gets the metadata keys defined on the target object or its prototype chain.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns An array of unique metadata keys.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getMetadataKeys(Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n         *\n         */\n        function getMetadataKeys(target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryMetadataKeys(target, propertyKey);\n        }\n        exporter(\"getMetadataKeys\", getMetadataKeys);\n        /**\n         * Gets the unique metadata keys defined on the target object.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns An array of unique metadata keys.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.getOwnMetadataKeys(Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n         *\n         */\n        function getOwnMetadataKeys(target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            return OrdinaryOwnMetadataKeys(target, propertyKey);\n        }\n        exporter(\"getOwnMetadataKeys\", getOwnMetadataKeys);\n        /**\n         * Deletes the metadata entry from the target object with the provided key.\n         * @param metadataKey A key used to store and retrieve metadata.\n         * @param target The target object on which the metadata is defined.\n         * @param propertyKey (Optional) The property key for the target.\n         * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n         * @example\n         *\n         *     class Example {\n         *         // property declarations are not part of ES6, though they are valid in TypeScript:\n         *         // static staticProperty;\n         *         // property;\n         *\n         *         constructor(p) { }\n         *         static staticMethod(p) { }\n         *         method(p) { }\n         *     }\n         *\n         *     // constructor\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n         *\n         *     // property (on constructor)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n         *\n         *     // property (on prototype)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n         *\n         *     // method (on constructor)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n         *\n         *     // method (on prototype)\n         *     result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n         *\n         */\n        function deleteMetadata(metadataKey, target, propertyKey) {\n            if (!IsObject(target))\n                throw new TypeError();\n            if (!IsUndefined(propertyKey))\n                propertyKey = ToPropertyKey(propertyKey);\n            var provider = GetMetadataProvider(target, propertyKey, /*Create*/ false);\n            if (IsUndefined(provider))\n                return false;\n            return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);\n        }\n        exporter(\"deleteMetadata\", deleteMetadata);\n        function DecorateConstructor(decorators, target) {\n            for (var i = decorators.length - 1; i >= 0; --i) {\n                var decorator = decorators[i];\n                var decorated = decorator(target);\n                if (!IsUndefined(decorated) && !IsNull(decorated)) {\n                    if (!IsConstructor(decorated))\n                        throw new TypeError();\n                    target = decorated;\n                }\n            }\n            return target;\n        }\n        function DecorateProperty(decorators, target, propertyKey, descriptor) {\n            for (var i = decorators.length - 1; i >= 0; --i) {\n                var decorator = decorators[i];\n                var decorated = decorator(target, propertyKey, descriptor);\n                if (!IsUndefined(decorated) && !IsNull(decorated)) {\n                    if (!IsObject(decorated))\n                        throw new TypeError();\n                    descriptor = decorated;\n                }\n            }\n            return descriptor;\n        }\n        // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n        function OrdinaryHasMetadata(MetadataKey, O, P) {\n            var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n            if (hasOwn)\n                return true;\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (!IsNull(parent))\n                return OrdinaryHasMetadata(MetadataKey, parent, P);\n            return false;\n        }\n        // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n        function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ false);\n            if (IsUndefined(provider))\n                return false;\n            return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));\n        }\n        // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n        function OrdinaryGetMetadata(MetadataKey, O, P) {\n            var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n            if (hasOwn)\n                return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (!IsNull(parent))\n                return OrdinaryGetMetadata(MetadataKey, parent, P);\n            return undefined;\n        }\n        // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n        function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ false);\n            if (IsUndefined(provider))\n                return;\n            return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);\n        }\n        // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n        function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n            var provider = GetMetadataProvider(O, P, /*Create*/ true);\n            provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);\n        }\n        // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n        function OrdinaryMetadataKeys(O, P) {\n            var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n            var parent = OrdinaryGetPrototypeOf(O);\n            if (parent === null)\n                return ownKeys;\n            var parentKeys = OrdinaryMetadataKeys(parent, P);\n            if (parentKeys.length <= 0)\n                return ownKeys;\n            if (ownKeys.length <= 0)\n                return parentKeys;\n            var set = new _Set();\n            var keys = [];\n            for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n                var key = ownKeys_1[_i];\n                var hasKey = set.has(key);\n                if (!hasKey) {\n                    set.add(key);\n                    keys.push(key);\n                }\n            }\n            for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n                var key = parentKeys_1[_a];\n                var hasKey = set.has(key);\n                if (!hasKey) {\n                    set.add(key);\n                    keys.push(key);\n                }\n            }\n            return keys;\n        }\n        // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n        // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n        function OrdinaryOwnMetadataKeys(O, P) {\n            var provider = GetMetadataProvider(O, P, /*create*/ false);\n            if (!provider) {\n                return [];\n            }\n            return provider.OrdinaryOwnMetadataKeys(O, P);\n        }\n        // 6 ECMAScript Data Types and Values\n        // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n        function Type(x) {\n            if (x === null)\n                return 1 /* Null */;\n            switch (typeof x) {\n                case \"undefined\": return 0 /* Undefined */;\n                case \"boolean\": return 2 /* Boolean */;\n                case \"string\": return 3 /* String */;\n                case \"symbol\": return 4 /* Symbol */;\n                case \"number\": return 5 /* Number */;\n                case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n                default: return 6 /* Object */;\n            }\n        }\n        // 6.1.1 The Undefined Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n        function IsUndefined(x) {\n            return x === undefined;\n        }\n        // 6.1.2 The Null Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n        function IsNull(x) {\n            return x === null;\n        }\n        // 6.1.5 The Symbol Type\n        // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n        function IsSymbol(x) {\n            return typeof x === \"symbol\";\n        }\n        // 6.1.7 The Object Type\n        // https://tc39.github.io/ecma262/#sec-object-type\n        function IsObject(x) {\n            return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n        }\n        // 7.1 Type Conversion\n        // https://tc39.github.io/ecma262/#sec-type-conversion\n        // 7.1.1 ToPrimitive(input [, PreferredType])\n        // https://tc39.github.io/ecma262/#sec-toprimitive\n        function ToPrimitive(input, PreferredType) {\n            switch (Type(input)) {\n                case 0 /* Undefined */: return input;\n                case 1 /* Null */: return input;\n                case 2 /* Boolean */: return input;\n                case 3 /* String */: return input;\n                case 4 /* Symbol */: return input;\n                case 5 /* Number */: return input;\n            }\n            var hint = PreferredType === 3 /* String */ ? \"string\" : PreferredType === 5 /* Number */ ? \"number\" : \"default\";\n            var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n            if (exoticToPrim !== undefined) {\n                var result = exoticToPrim.call(input, hint);\n                if (IsObject(result))\n                    throw new TypeError();\n                return result;\n            }\n            return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n        }\n        // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n        // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n        function OrdinaryToPrimitive(O, hint) {\n            if (hint === \"string\") {\n                var toString_1 = O.toString;\n                if (IsCallable(toString_1)) {\n                    var result = toString_1.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n                var valueOf = O.valueOf;\n                if (IsCallable(valueOf)) {\n                    var result = valueOf.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n            }\n            else {\n                var valueOf = O.valueOf;\n                if (IsCallable(valueOf)) {\n                    var result = valueOf.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n                var toString_2 = O.toString;\n                if (IsCallable(toString_2)) {\n                    var result = toString_2.call(O);\n                    if (!IsObject(result))\n                        return result;\n                }\n            }\n            throw new TypeError();\n        }\n        // 7.1.2 ToBoolean(argument)\n        // https://tc39.github.io/ecma262/2016/#sec-toboolean\n        function ToBoolean(argument) {\n            return !!argument;\n        }\n        // 7.1.12 ToString(argument)\n        // https://tc39.github.io/ecma262/#sec-tostring\n        function ToString(argument) {\n            return \"\" + argument;\n        }\n        // 7.1.14 ToPropertyKey(argument)\n        // https://tc39.github.io/ecma262/#sec-topropertykey\n        function ToPropertyKey(argument) {\n            var key = ToPrimitive(argument, 3 /* String */);\n            if (IsSymbol(key))\n                return key;\n            return ToString(key);\n        }\n        // 7.2 Testing and Comparison Operations\n        // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n        // 7.2.2 IsArray(argument)\n        // https://tc39.github.io/ecma262/#sec-isarray\n        function IsArray(argument) {\n            return Array.isArray\n                ? Array.isArray(argument)\n                : argument instanceof Object\n                    ? argument instanceof Array\n                    : Object.prototype.toString.call(argument) === \"[object Array]\";\n        }\n        // 7.2.3 IsCallable(argument)\n        // https://tc39.github.io/ecma262/#sec-iscallable\n        function IsCallable(argument) {\n            // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n            return typeof argument === \"function\";\n        }\n        // 7.2.4 IsConstructor(argument)\n        // https://tc39.github.io/ecma262/#sec-isconstructor\n        function IsConstructor(argument) {\n            // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n            return typeof argument === \"function\";\n        }\n        // 7.2.7 IsPropertyKey(argument)\n        // https://tc39.github.io/ecma262/#sec-ispropertykey\n        function IsPropertyKey(argument) {\n            switch (Type(argument)) {\n                case 3 /* String */: return true;\n                case 4 /* Symbol */: return true;\n                default: return false;\n            }\n        }\n        // 7.3 Operations on Objects\n        // https://tc39.github.io/ecma262/#sec-operations-on-objects\n        // 7.3.9 GetMethod(V, P)\n        // https://tc39.github.io/ecma262/#sec-getmethod\n        function GetMethod(V, P) {\n            var func = V[P];\n            if (func === undefined || func === null)\n                return undefined;\n            if (!IsCallable(func))\n                throw new TypeError();\n            return func;\n        }\n        // 7.4 Operations on Iterator Objects\n        // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n        function GetIterator(obj) {\n            var method = GetMethod(obj, iteratorSymbol);\n            if (!IsCallable(method))\n                throw new TypeError(); // from Call\n            var iterator = method.call(obj);\n            if (!IsObject(iterator))\n                throw new TypeError();\n            return iterator;\n        }\n        // 7.4.4 IteratorValue(iterResult)\n        // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n        function IteratorValue(iterResult) {\n            return iterResult.value;\n        }\n        // 7.4.5 IteratorStep(iterator)\n        // https://tc39.github.io/ecma262/#sec-iteratorstep\n        function IteratorStep(iterator) {\n            var result = iterator.next();\n            return result.done ? false : result;\n        }\n        // 7.4.6 IteratorClose(iterator, completion)\n        // https://tc39.github.io/ecma262/#sec-iteratorclose\n        function IteratorClose(iterator) {\n            var f = iterator[\"return\"];\n            if (f)\n                f.call(iterator);\n        }\n        // 9.1 Ordinary Object Internal Methods and Internal Slots\n        // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n        // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n        // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n        function OrdinaryGetPrototypeOf(O) {\n            var proto = Object.getPrototypeOf(O);\n            if (typeof O !== \"function\" || O === functionPrototype)\n                return proto;\n            // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n            // Try to determine the superclass constructor. Compatible implementations\n            // must either set __proto__ on a subclass constructor to the superclass constructor,\n            // or ensure each class has a valid `constructor` property on its prototype that\n            // points back to the constructor.\n            // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n            // This is the case when in ES6 or when using __proto__ in a compatible browser.\n            if (proto !== functionPrototype)\n                return proto;\n            // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n            var prototype = O.prototype;\n            var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n            if (prototypeProto == null || prototypeProto === Object.prototype)\n                return proto;\n            // If the constructor was not a function, then we cannot determine the heritage.\n            var constructor = prototypeProto.constructor;\n            if (typeof constructor !== \"function\")\n                return proto;\n            // If we have some kind of self-reference, then we cannot determine the heritage.\n            if (constructor === O)\n                return proto;\n            // we have a pretty good guess at the heritage.\n            return constructor;\n        }\n        function fail(e) {\n            throw e;\n        }\n        // Global metadata registry\n        // - Allows `import \"reflect-metadata\"` and `import \"reflect-metadata/no-conflict\"` to interoperate.\n        // - Uses isolated metadata if `Reflect` is frozen before the registry can be installed.\n        /**\n         * Creates a registry used to allow multiple `reflect-metadata` providers.\n         */\n        function CreateMetadataRegistry() {\n            var fallback;\n            if (!IsUndefined(registrySymbol) &&\n                typeof root.Reflect !== \"undefined\" &&\n                !(registrySymbol in root.Reflect) &&\n                typeof root.Reflect.defineMetadata === \"function\") {\n                // interoperate with older version of `reflect-metadata` that did not support a registry.\n                fallback = CreateFallbackProvider(root.Reflect);\n            }\n            var first;\n            var second;\n            var rest;\n            var targetProviderMap = new _WeakMap();\n            var registry = {\n                registerProvider: registerProvider,\n                getProvider: getProvider,\n                setProvider: setProvider,\n            };\n            return registry;\n            function registerProvider(provider) {\n                if (!Object.isExtensible(registry)) {\n                    throw new Error(\"Cannot add provider to a frozen registry.\");\n                }\n                switch (true) {\n                    case fallback === provider: break;\n                    case IsUndefined(first):\n                        first = provider;\n                        break;\n                    case first === provider: break;\n                    case IsUndefined(second):\n                        second = provider;\n                        break;\n                    case second === provider: break;\n                    default:\n                        if (rest === undefined)\n                            rest = new _Set();\n                        rest.add(provider);\n                        break;\n                }\n            }\n            function getProviderNoCache(O, P) {\n                if (!IsUndefined(first)) {\n                    if (first.isProviderFor(O, P))\n                        return first;\n                    if (!IsUndefined(second)) {\n                        if (second.isProviderFor(O, P))\n                            return first;\n                        if (!IsUndefined(rest)) {\n                            var iterator = GetIterator(rest);\n                            while (true) {\n                                var next = IteratorStep(iterator);\n                                if (!next) {\n                                    return undefined;\n                                }\n                                var provider = IteratorValue(next);\n                                if (provider.isProviderFor(O, P)) {\n                                    IteratorClose(iterator);\n                                    return provider;\n                                }\n                            }\n                        }\n                    }\n                }\n                if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {\n                    return fallback;\n                }\n                return undefined;\n            }\n            function getProvider(O, P) {\n                var providerMap = targetProviderMap.get(O);\n                var provider;\n                if (!IsUndefined(providerMap)) {\n                    provider = providerMap.get(P);\n                }\n                if (!IsUndefined(provider)) {\n                    return provider;\n                }\n                provider = getProviderNoCache(O, P);\n                if (!IsUndefined(provider)) {\n                    if (IsUndefined(providerMap)) {\n                        providerMap = new _Map();\n                        targetProviderMap.set(O, providerMap);\n                    }\n                    providerMap.set(P, provider);\n                }\n                return provider;\n            }\n            function hasProvider(provider) {\n                if (IsUndefined(provider))\n                    throw new TypeError();\n                return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);\n            }\n            function setProvider(O, P, provider) {\n                if (!hasProvider(provider)) {\n                    throw new Error(\"Metadata provider not registered.\");\n                }\n                var existingProvider = getProvider(O, P);\n                if (existingProvider !== provider) {\n                    if (!IsUndefined(existingProvider)) {\n                        return false;\n                    }\n                    var providerMap = targetProviderMap.get(O);\n                    if (IsUndefined(providerMap)) {\n                        providerMap = new _Map();\n                        targetProviderMap.set(O, providerMap);\n                    }\n                    providerMap.set(P, provider);\n                }\n                return true;\n            }\n        }\n        /**\n         * Gets or creates the shared registry of metadata providers.\n         */\n        function GetOrCreateMetadataRegistry() {\n            var metadataRegistry;\n            if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n                metadataRegistry = root.Reflect[registrySymbol];\n            }\n            if (IsUndefined(metadataRegistry)) {\n                metadataRegistry = CreateMetadataRegistry();\n            }\n            if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n                Object.defineProperty(root.Reflect, registrySymbol, {\n                    enumerable: false,\n                    configurable: false,\n                    writable: false,\n                    value: metadataRegistry\n                });\n            }\n            return metadataRegistry;\n        }\n        function CreateMetadataProvider(registry) {\n            // [[Metadata]] internal slot\n            // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n            var metadata = new _WeakMap();\n            var provider = {\n                isProviderFor: function (O, P) {\n                    var targetMetadata = metadata.get(O);\n                    if (IsUndefined(targetMetadata))\n                        return false;\n                    return targetMetadata.has(P);\n                },\n                OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata,\n                OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata,\n                OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata,\n                OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys,\n                OrdinaryDeleteMetadata: OrdinaryDeleteMetadata,\n            };\n            metadataRegistry.registerProvider(provider);\n            return provider;\n            function GetOrCreateMetadataMap(O, P, Create) {\n                var targetMetadata = metadata.get(O);\n                var createdTargetMetadata = false;\n                if (IsUndefined(targetMetadata)) {\n                    if (!Create)\n                        return undefined;\n                    targetMetadata = new _Map();\n                    metadata.set(O, targetMetadata);\n                    createdTargetMetadata = true;\n                }\n                var metadataMap = targetMetadata.get(P);\n                if (IsUndefined(metadataMap)) {\n                    if (!Create)\n                        return undefined;\n                    metadataMap = new _Map();\n                    targetMetadata.set(P, metadataMap);\n                    if (!registry.setProvider(O, P, provider)) {\n                        targetMetadata.delete(P);\n                        if (createdTargetMetadata) {\n                            metadata.delete(O);\n                        }\n                        throw new Error(\"Wrong provider for target.\");\n                    }\n                }\n                return metadataMap;\n            }\n            // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n            function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return false;\n                return ToBoolean(metadataMap.has(MetadataKey));\n            }\n            // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n            function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return undefined;\n                return metadataMap.get(MetadataKey);\n            }\n            // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n            function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);\n                metadataMap.set(MetadataKey, MetadataValue);\n            }\n            // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n            // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n            function OrdinaryOwnMetadataKeys(O, P) {\n                var keys = [];\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return keys;\n                var keysObj = metadataMap.keys();\n                var iterator = GetIterator(keysObj);\n                var k = 0;\n                while (true) {\n                    var next = IteratorStep(iterator);\n                    if (!next) {\n                        keys.length = k;\n                        return keys;\n                    }\n                    var nextValue = IteratorValue(next);\n                    try {\n                        keys[k] = nextValue;\n                    }\n                    catch (e) {\n                        try {\n                            IteratorClose(iterator);\n                        }\n                        finally {\n                            throw e;\n                        }\n                    }\n                    k++;\n                }\n            }\n            function OrdinaryDeleteMetadata(MetadataKey, O, P) {\n                var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n                if (IsUndefined(metadataMap))\n                    return false;\n                if (!metadataMap.delete(MetadataKey))\n                    return false;\n                if (metadataMap.size === 0) {\n                    var targetMetadata = metadata.get(O);\n                    if (!IsUndefined(targetMetadata)) {\n                        targetMetadata.delete(P);\n                        if (targetMetadata.size === 0) {\n                            metadata.delete(targetMetadata);\n                        }\n                    }\n                }\n                return true;\n            }\n        }\n        function CreateFallbackProvider(reflect) {\n            var defineMetadata = reflect.defineMetadata, hasOwnMetadata = reflect.hasOwnMetadata, getOwnMetadata = reflect.getOwnMetadata, getOwnMetadataKeys = reflect.getOwnMetadataKeys, deleteMetadata = reflect.deleteMetadata;\n            var metadataOwner = new _WeakMap();\n            var provider = {\n                isProviderFor: function (O, P) {\n                    var metadataPropertySet = metadataOwner.get(O);\n                    if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {\n                        return true;\n                    }\n                    if (getOwnMetadataKeys(O, P).length) {\n                        if (IsUndefined(metadataPropertySet)) {\n                            metadataPropertySet = new _Set();\n                            metadataOwner.set(O, metadataPropertySet);\n                        }\n                        metadataPropertySet.add(P);\n                        return true;\n                    }\n                    return false;\n                },\n                OrdinaryDefineOwnMetadata: defineMetadata,\n                OrdinaryHasOwnMetadata: hasOwnMetadata,\n                OrdinaryGetOwnMetadata: getOwnMetadata,\n                OrdinaryOwnMetadataKeys: getOwnMetadataKeys,\n                OrdinaryDeleteMetadata: deleteMetadata,\n            };\n            return provider;\n        }\n        /**\n         * Gets the metadata provider for an object. If the object has no metadata provider and this is for a create operation,\n         * then this module's metadata provider is assigned to the object.\n         */\n        function GetMetadataProvider(O, P, Create) {\n            var registeredProvider = metadataRegistry.getProvider(O, P);\n            if (!IsUndefined(registeredProvider)) {\n                return registeredProvider;\n            }\n            if (Create) {\n                if (metadataRegistry.setProvider(O, P, metadataProvider)) {\n                    return metadataProvider;\n                }\n                throw new Error(\"Illegal state.\");\n            }\n            return undefined;\n        }\n    });\n})(Reflect || (Reflect = {}));\n","// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters\nexport function getOwnReflectMetadata(target, metadataKey, propertyKey) {\n    return Reflect.getOwnMetadata(metadataKey, target, propertyKey);\n}\n//# sourceMappingURL=getOwnReflectMetadata.js.map","export function setReflectMetadata(target, metadataKey, metadata, propertyKey) {\n    Reflect.defineMetadata(metadataKey, metadata, target, propertyKey);\n}\n//# sourceMappingURL=setReflectMetadata.js.map","import { getOwnReflectMetadata } from './getOwnReflectMetadata.js';\nexport function updateOwnReflectMetadata(target, metadataKey, buildDefaultValue, callback, propertyKey) {\n    const metadata = getOwnReflectMetadata(target, metadataKey, propertyKey) ??\n        buildDefaultValue();\n    const updatedMetadata = callback(metadata);\n    Reflect.defineMetadata(metadataKey, updatedMetadata, target, propertyKey);\n}\n//# sourceMappingURL=updateOwnReflectMetadata.js.map","import { getOwnReflectMetadata, setReflectMetadata, updateOwnReflectMetadata, } from '@inversifyjs/reflect-metadata-utils';\nconst ID_METADATA = '@inversifyjs/container/bindingId';\nexport function getContainerModuleId() {\n    const bindingId = getOwnReflectMetadata(Object, ID_METADATA) ?? 0;\n    if (bindingId === Number.MAX_SAFE_INTEGER) {\n        setReflectMetadata(Object, ID_METADATA, Number.MIN_SAFE_INTEGER);\n    }\n    else {\n        updateOwnReflectMetadata(Object, ID_METADATA, () => bindingId, (id) => id + 1);\n    }\n    return bindingId;\n}\n//# sourceMappingURL=getContainerModuleId.js.map","import { getContainerModuleId } from '../actions/getContainerModuleId.js';\nexport class ContainerModule {\n    #id;\n    #load;\n    constructor(load) {\n        this.#id = getContainerModuleId();\n        this.#load = load;\n    }\n    get id() {\n        return this.#id;\n    }\n    load(options) {\n        return this.#load(options);\n    }\n}\n//# sourceMappingURL=ContainerModule.js.map","import { getOwnReflectMetadata, setReflectMetadata, updateOwnReflectMetadata, } from '@inversifyjs/reflect-metadata-utils';\nconst ID_METADATA = '@inversifyjs/container/bindingId';\nexport function getBindingId() {\n    const bindingId = getOwnReflectMetadata(Object, ID_METADATA) ?? 0;\n    if (bindingId === Number.MAX_SAFE_INTEGER) {\n        setReflectMetadata(Object, ID_METADATA, Number.MIN_SAFE_INTEGER);\n    }\n    else {\n        updateOwnReflectMetadata(Object, ID_METADATA, () => bindingId, (id) => id + 1);\n    }\n    return bindingId;\n}\n//# sourceMappingURL=getBindingId.js.map","export const bindingScopeValues = {\n    Request: 'Request',\n    Singleton: 'Singleton',\n    Transient: 'Transient',\n};\n//# sourceMappingURL=BindingScope.js.map","export const bindingTypeValues = {\n    ConstantValue: 'ConstantValue',\n    DynamicValue: 'DynamicValue',\n    Factory: 'Factory',\n    Instance: 'Instance',\n    ResolvedValue: 'ResolvedValue',\n    ServiceRedirection: 'ServiceRedirection',\n};\n//# sourceMappingURL=BindingType.js.map","import { chain } from '../../common/calculations/chain.js';\nimport { OneToManyMapStar } from '../../common/models/OneToManyMapStar.js';\nimport { WeakList } from '../../common/models/WeakList.js';\nvar ActivationRelationKind;\n(function (ActivationRelationKind) {\n    ActivationRelationKind[\"moduleId\"] = \"moduleId\";\n    ActivationRelationKind[\"serviceId\"] = \"serviceId\";\n})(ActivationRelationKind || (ActivationRelationKind = {}));\nexport class ActivationsService {\n    #activationMaps;\n    #getParent;\n    #serviceToActivationSubscribersOnceMap;\n    constructor(getParent, activationMaps) {\n        this.#activationMaps =\n            activationMaps ??\n                new OneToManyMapStar({\n                    moduleId: {\n                        isOptional: true,\n                    },\n                    serviceId: {\n                        isOptional: false,\n                    },\n                });\n        this.#getParent = getParent;\n        // We don't want to clone subscribers\n        this.#serviceToActivationSubscribersOnceMap = new Map();\n    }\n    static build(getParent) {\n        return new ActivationsService(getParent);\n    }\n    add(activation, relation) {\n        this.#activationMaps.add(activation, relation);\n        this.#triggerActivationAdded(relation[ActivationRelationKind.serviceId], activation);\n    }\n    subscribeOnce(serviceIdentifier, subscriber) {\n        let subscribersOnce = this.#serviceToActivationSubscribersOnceMap.get(serviceIdentifier);\n        if (subscribersOnce === undefined) {\n            subscribersOnce = new WeakList();\n            this.#serviceToActivationSubscribersOnceMap.set(serviceIdentifier, subscribersOnce);\n        }\n        subscribersOnce.push(subscriber);\n    }\n    clone() {\n        const clone = new ActivationsService(this.#getParent, this.#activationMaps.clone());\n        return clone;\n    }\n    get(serviceIdentifier) {\n        const activations = this.#activationMaps.get(ActivationRelationKind.serviceId, serviceIdentifier);\n        const parentActivations = this.#getParent()?.get(serviceIdentifier);\n        if (activations === undefined) {\n            return parentActivations;\n        }\n        if (parentActivations === undefined) {\n            return activations;\n        }\n        return chain(activations, parentActivations);\n    }\n    removeAllByModuleId(moduleId) {\n        this.#activationMaps.removeByRelation(ActivationRelationKind.moduleId, moduleId);\n    }\n    removeAllByServiceId(serviceId) {\n        this.#activationMaps.removeByRelation(ActivationRelationKind.serviceId, serviceId);\n    }\n    #triggerActivationAdded(serviceId, activation) {\n        const subscribersOnce = this.#serviceToActivationSubscribersOnceMap.get(serviceId);\n        if (subscribersOnce !== undefined) {\n            for (const subscriber of subscribersOnce) {\n                subscriber.onActivationAdded(serviceId, activation);\n            }\n            this.#serviceToActivationSubscribersOnceMap.delete(serviceId);\n        }\n    }\n}\n//# sourceMappingURL=ActivationsService.js.map","export const classMetadataReflectKey = '@inversifyjs/core/classMetadataReflectKey';\n//# sourceMappingURL=classMetadataReflectKey.js.map","export function getDefaultClassMetadata() {\n    return {\n        constructorArguments: [],\n        lifecycle: {\n            postConstructMethodNames: new Set(),\n            preDestroyMethodNames: new Set(),\n        },\n        properties: new Map(),\n        scope: undefined,\n    };\n}\n//# sourceMappingURL=getDefaultClassMetadata.js.map","export const pendingClassMetadataCountReflectKey = '@inversifyjs/core/pendingClassMetadataCountReflectKey';\n//# sourceMappingURL=pendingClassMetadataCountReflectKey.js.map","import { getOwnReflectMetadata } from '@inversifyjs/reflect-metadata-utils';\nimport { pendingClassMetadataCountReflectKey } from '../../reflectMetadata/data/pendingClassMetadataCountReflectKey.js';\nexport function isPendingClassMetadata(type) {\n    const pendingClassMetadataCount = getOwnReflectMetadata(type, pendingClassMetadataCountReflectKey);\n    return (pendingClassMetadataCount !== undefined && pendingClassMetadataCount !== 0);\n}\n//# sourceMappingURL=isPendingClassMetadata.js.map","const isAppErrorSymbol = Symbol.for('@inversifyjs/core/InversifyCoreError');\nexport class InversifyCoreError extends Error {\n    [isAppErrorSymbol];\n    kind;\n    constructor(kind, message, options) {\n        super(message, options);\n        this[isAppErrorSymbol] = true;\n        this.kind = kind;\n    }\n    static is(value) {\n        return (typeof value === 'object' &&\n            value !== null &&\n            value[isAppErrorSymbol] === true);\n    }\n    static isErrorOfKind(value, kind) {\n        return InversifyCoreError.is(value) && value.kind === kind;\n    }\n}\n//# sourceMappingURL=InversifyCoreError.js.map","export var InversifyCoreErrorKind;\n(function (InversifyCoreErrorKind) {\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"injectionDecoratorConflict\"] = 0] = \"injectionDecoratorConflict\";\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"missingInjectionDecorator\"] = 1] = \"missingInjectionDecorator\";\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"planning\"] = 2] = \"planning\";\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"planningMaxDepthExceeded\"] = 3] = \"planningMaxDepthExceeded\";\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"resolution\"] = 4] = \"resolution\";\n    InversifyCoreErrorKind[InversifyCoreErrorKind[\"unknown\"] = 5] = \"unknown\";\n})(InversifyCoreErrorKind || (InversifyCoreErrorKind = {}));\n//# sourceMappingURL=InversifyCoreErrorKind.js.map","export var MaybeClassElementMetadataKind;\n(function (MaybeClassElementMetadataKind) {\n    MaybeClassElementMetadataKind[MaybeClassElementMetadataKind[\"unknown\"] = 32] = \"unknown\";\n})(MaybeClassElementMetadataKind || (MaybeClassElementMetadataKind = {}));\n//# sourceMappingURL=MaybeClassElementMetadataKind.js.map","import { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { MaybeClassElementMetadataKind } from '../models/MaybeClassElementMetadataKind.js';\nexport function throwAtInvalidClassMetadata(type, classMetadata) {\n    const errors = [];\n    for (let i = 0; i < classMetadata.constructorArguments.length; ++i) {\n        const constructorArgument = classMetadata.constructorArguments[i];\n        if (constructorArgument === undefined ||\n            constructorArgument.kind === MaybeClassElementMetadataKind.unknown) {\n            errors.push(`  - Missing or incomplete metadata for type \"${type.name}\" at constructor argument with index ${i.toString()}.\nEvery constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`);\n        }\n    }\n    for (const [propertyKey, property] of classMetadata.properties) {\n        if (property.kind === MaybeClassElementMetadataKind.unknown) {\n            errors.push(`  - Missing or incomplete metadata for type \"${type.name}\" at property \"${propertyKey.toString()}\".\nThis property must be decorated either with @inject or @multiInject decorator.`);\n        }\n    }\n    if (errors.length === 0) {\n        throw new InversifyCoreError(InversifyCoreErrorKind.unknown, `Unexpected class metadata for type \"${type.name}\" with uncompletion traces.\nThis might be caused by one of the following reasons:\n\n1. A third party library is targeting inversify reflection metadata.\n2. A bug is causing the issue. Consider submiting an issue to fix it.`);\n    }\n    throw new InversifyCoreError(InversifyCoreErrorKind.missingInjectionDecorator, `Invalid class metadata at type ${type.name}:\n\n${errors.join('\\n\\n')}`);\n}\n//# sourceMappingURL=throwAtInvalidClassMetadata.js.map","import { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nexport function validateConstructorMetadataArray(type, value) {\n    const undefinedIndexes = [];\n    if (value.length < type.length) {\n        throw new InversifyCoreError(InversifyCoreErrorKind.missingInjectionDecorator, `Found unexpected missing metadata on type \"${type.name}\". \"${type.name}\" constructor requires at least ${type.length.toString()} arguments, found ${value.length.toString()} instead.\nAre you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?\n\nIf you're using typescript and want to rely on auto injection, set \"emitDecoratorMetadata\" compiler option to true`);\n    }\n    // Using a for loop to ensure empty values are traversed as well\n    for (let i = 0; i < value.length; ++i) {\n        const element = value[i];\n        if (element === undefined) {\n            undefinedIndexes.push(i);\n        }\n    }\n    if (undefinedIndexes.length > 0) {\n        throw new InversifyCoreError(InversifyCoreErrorKind.missingInjectionDecorator, `Found unexpected missing metadata on type \"${type.name}\" at constructor indexes \"${undefinedIndexes.join('\", \"')}\".\n\nAre you using @inject, @multiInject or @unmanaged decorators at those indexes?\n\nIf you're using typescript and want to rely on auto injection, set \"emitDecoratorMetadata\" compiler option to true`);\n    }\n}\n//# sourceMappingURL=validateConstructorMetadataArray.js.map","import { getOwnReflectMetadata } from '@inversifyjs/reflect-metadata-utils';\nimport { classMetadataReflectKey } from '../../reflectMetadata/data/classMetadataReflectKey.js';\nimport { getDefaultClassMetadata } from './getDefaultClassMetadata.js';\nimport { isPendingClassMetadata } from './isPendingClassMetadata.js';\nimport { throwAtInvalidClassMetadata } from './throwAtInvalidClassMetadata.js';\nimport { validateConstructorMetadataArray } from './validateConstructorMetadataArray.js';\nexport function getClassMetadata(type) {\n    const classMetadata = getOwnReflectMetadata(type, classMetadataReflectKey) ??\n        getDefaultClassMetadata();\n    if (isPendingClassMetadata(type)) {\n        throwAtInvalidClassMetadata(type, classMetadata);\n    }\n    else {\n        validateConstructorMetadataArray(type, classMetadata.constructorArguments);\n        return classMetadata;\n    }\n}\n//# sourceMappingURL=getClassMetadata.js.map","import { getClassMetadata } from '../../metadata/calculations/getClassMetadata.js';\nimport { getBindingId } from '../actions/getBindingId.js';\nimport { bindingTypeValues } from '../models/BindingType.js';\nexport function buildInstanceBinding(autobindOptions, serviceIdentifier) {\n    const classMetadata = getClassMetadata(serviceIdentifier);\n    const scope = classMetadata.scope ?? autobindOptions.scope;\n    return {\n        cache: {\n            isRight: false,\n            value: undefined,\n        },\n        id: getBindingId(),\n        implementationType: serviceIdentifier,\n        isSatisfiedBy: () => true,\n        moduleId: undefined,\n        onActivation: undefined,\n        onDeactivation: undefined,\n        scope,\n        serviceIdentifier,\n        type: bindingTypeValues.Instance,\n    };\n}\n//# sourceMappingURL=buildInstanceBinding.js.map","import { OneToManyMapStar, } from '../../common/models/OneToManyMapStar.js';\nimport { buildInstanceBinding } from '../calculations/buildInstanceBinding.js';\nimport { cloneBinding } from '../calculations/cloneBinding.js';\nvar BindingRelationKind;\n(function (BindingRelationKind) {\n    BindingRelationKind[\"id\"] = \"id\";\n    BindingRelationKind[\"moduleId\"] = \"moduleId\";\n    BindingRelationKind[\"serviceId\"] = \"serviceId\";\n})(BindingRelationKind || (BindingRelationKind = {}));\nclass OneToManyBindingMapStar extends OneToManyMapStar {\n    _buildNewInstance(spec) {\n        return new OneToManyBindingMapStar(spec);\n    }\n    _cloneModel(model) {\n        return cloneBinding(model);\n    }\n}\nexport class BindingService {\n    #autobindOptions;\n    #bindingMaps;\n    #getParent;\n    constructor(getParent, autobindOptions, bindingMaps) {\n        this.#bindingMaps =\n            bindingMaps ??\n                new OneToManyBindingMapStar({\n                    id: {\n                        isOptional: false,\n                    },\n                    moduleId: {\n                        isOptional: true,\n                    },\n                    serviceId: {\n                        isOptional: false,\n                    },\n                });\n        this.#getParent = getParent;\n        this.#autobindOptions = autobindOptions;\n    }\n    static build(getParent, autobindOptions) {\n        return new BindingService(getParent, autobindOptions);\n    }\n    clone() {\n        const clone = new BindingService(this.#getParent, this.#autobindOptions, this.#bindingMaps.clone());\n        return clone;\n    }\n    get(serviceIdentifier) {\n        const bindings = this.getNonParentBindings(serviceIdentifier) ??\n            this.#getParent()?.get(serviceIdentifier);\n        if (bindings !== undefined) {\n            return bindings;\n        }\n        const autoBoundBinding = this.#tryAutobind(serviceIdentifier);\n        return autoBoundBinding === undefined\n            ? autoBoundBinding\n            : [autoBoundBinding];\n    }\n    *getChained(serviceIdentifier) {\n        const currentBindings = this.getNonParentBindings(serviceIdentifier);\n        if (currentBindings !== undefined) {\n            yield* currentBindings;\n        }\n        const parent = this.#getParent();\n        if (parent === undefined) {\n            if (currentBindings === undefined) {\n                const autobindBindings = this.#tryAutobind(serviceIdentifier);\n                if (autobindBindings !== undefined) {\n                    yield autobindBindings;\n                }\n            }\n        }\n        else {\n            yield* parent.getChained(serviceIdentifier);\n        }\n    }\n    getBoundServices() {\n        const serviceIdentifierSet = new Set(this.#bindingMaps.getAllKeys(BindingRelationKind.serviceId));\n        const parent = this.#getParent();\n        if (parent !== undefined) {\n            for (const serviceIdentifier of parent.getBoundServices()) {\n                serviceIdentifierSet.add(serviceIdentifier);\n            }\n        }\n        return serviceIdentifierSet;\n    }\n    getById(id) {\n        return (this.#bindingMaps.get(BindingRelationKind.id, id) ??\n            this.#getParent()?.getById(id));\n    }\n    getByModuleId(moduleId) {\n        return (this.#bindingMaps.get(BindingRelationKind.moduleId, moduleId) ??\n            this.#getParent()?.getByModuleId(moduleId));\n    }\n    getNonParentBindings(serviceId) {\n        return this.#bindingMaps.get(BindingRelationKind.serviceId, serviceId);\n    }\n    getNonParentBoundServices() {\n        return this.#bindingMaps.getAllKeys(BindingRelationKind.serviceId);\n    }\n    removeById(id) {\n        this.#bindingMaps.removeByRelation(BindingRelationKind.id, id);\n    }\n    removeAllByModuleId(moduleId) {\n        this.#bindingMaps.removeByRelation(BindingRelationKind.moduleId, moduleId);\n    }\n    removeAllByServiceId(serviceId) {\n        this.#bindingMaps.removeByRelation(BindingRelationKind.serviceId, serviceId);\n    }\n    set(binding) {\n        const relation = {\n            [BindingRelationKind.id]: binding.id,\n            [BindingRelationKind.serviceId]: binding.serviceIdentifier,\n        };\n        if (binding.moduleId !== undefined) {\n            relation[BindingRelationKind.moduleId] = binding.moduleId;\n        }\n        this.#bindingMaps.add(binding, relation);\n    }\n    #tryAutobind(serviceIdentifier) {\n        if (this.#autobindOptions === undefined ||\n            typeof serviceIdentifier !== 'function') {\n            return undefined;\n        }\n        const binding = buildInstanceBinding(this.#autobindOptions, serviceIdentifier);\n        this.set(binding);\n        return binding;\n    }\n}\n//# sourceMappingURL=BindingService.js.map","import { chain } from '../../common/calculations/chain.js';\nimport { OneToManyMapStar } from '../../common/models/OneToManyMapStar.js';\nvar DeactivationRelationKind;\n(function (DeactivationRelationKind) {\n    DeactivationRelationKind[\"moduleId\"] = \"moduleId\";\n    DeactivationRelationKind[\"serviceId\"] = \"serviceId\";\n})(DeactivationRelationKind || (DeactivationRelationKind = {}));\nexport class DeactivationsService {\n    #deactivationMaps;\n    #getParent;\n    constructor(getParent, deactivationMaps) {\n        this.#deactivationMaps =\n            deactivationMaps ??\n                new OneToManyMapStar({\n                    moduleId: {\n                        isOptional: true,\n                    },\n                    serviceId: {\n                        isOptional: false,\n                    },\n                });\n        this.#getParent = getParent;\n    }\n    static build(getParent) {\n        return new DeactivationsService(getParent);\n    }\n    add(deactivation, relation) {\n        this.#deactivationMaps.add(deactivation, relation);\n    }\n    clone() {\n        const clone = new DeactivationsService(this.#getParent, this.#deactivationMaps.clone());\n        return clone;\n    }\n    get(serviceIdentifier) {\n        const deactivationIterables = [];\n        const deactivations = this.#deactivationMaps.get(DeactivationRelationKind.serviceId, serviceIdentifier);\n        if (deactivations !== undefined) {\n            deactivationIterables.push(deactivations);\n        }\n        const parentDeactivations = this.#getParent()?.get(serviceIdentifier);\n        if (parentDeactivations !== undefined) {\n            deactivationIterables.push(parentDeactivations);\n        }\n        if (deactivationIterables.length === 0) {\n            return undefined;\n        }\n        return chain(...deactivationIterables);\n    }\n    removeAllByModuleId(moduleId) {\n        this.#deactivationMaps.removeByRelation(DeactivationRelationKind.moduleId, moduleId);\n    }\n    removeAllByServiceId(serviceId) {\n        this.#deactivationMaps.removeByRelation(DeactivationRelationKind.serviceId, serviceId);\n    }\n}\n//# sourceMappingURL=DeactivationsService.js.map","export function getDefaultPendingClassMetadataCount() {\n    return 0;\n}\n//# sourceMappingURL=getDefaultPendingClassMetadataCount.js.map","import { updateOwnReflectMetadata } from '@inversifyjs/reflect-metadata-utils';\nimport { pendingClassMetadataCountReflectKey } from '../../reflectMetadata/data/pendingClassMetadataCountReflectKey.js';\nimport { getDefaultPendingClassMetadataCount } from '../calculations/getDefaultPendingClassMetadataCount.js';\nimport { MaybeClassElementMetadataKind } from '../models/MaybeClassElementMetadataKind.js';\nexport function decrementPendingClassMetadataCount(type) {\n    return (metadata) => {\n        if (metadata !== undefined &&\n            metadata.kind === MaybeClassElementMetadataKind.unknown) {\n            updateOwnReflectMetadata(type, pendingClassMetadataCountReflectKey, getDefaultPendingClassMetadataCount, (count) => count - 1);\n        }\n    };\n}\n//# sourceMappingURL=decrementPendingClassMetadataCount.js.map","export var ClassElementMetadataKind;\n(function (ClassElementMetadataKind) {\n    ClassElementMetadataKind[ClassElementMetadataKind[\"multipleInjection\"] = 0] = \"multipleInjection\";\n    ClassElementMetadataKind[ClassElementMetadataKind[\"singleInjection\"] = 1] = \"singleInjection\";\n    ClassElementMetadataKind[ClassElementMetadataKind[\"unmanaged\"] = 2] = \"unmanaged\";\n})(ClassElementMetadataKind || (ClassElementMetadataKind = {}));\n//# sourceMappingURL=ClassElementMetadataKind.js.map","import { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { ClassElementMetadataKind } from '../models/ClassElementMetadataKind.js';\nexport function buildClassElementMetadataFromMaybeClassElementMetadata(buildDefaultMetadata, buildMetadataFromMaybeManagedMetadata) {\n    return (...params) => (metadata) => {\n        if (metadata === undefined) {\n            return buildDefaultMetadata(...params);\n        }\n        if (metadata.kind === ClassElementMetadataKind.unmanaged) {\n            throw new InversifyCoreError(InversifyCoreErrorKind.injectionDecoratorConflict, 'Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found');\n        }\n        return buildMetadataFromMaybeManagedMetadata(metadata, ...params);\n    };\n}\n//# sourceMappingURL=buildClassElementMetadataFromMaybeClassElementMetadata.js.map","import { ClassElementMetadataKind } from '../models/ClassElementMetadataKind.js';\nexport function buildDefaultManagedMetadata(kind, serviceIdentifier, options) {\n    if (kind === ClassElementMetadataKind.multipleInjection) {\n        return {\n            chained: options?.chained ?? false,\n            kind,\n            name: undefined,\n            optional: false,\n            tags: new Map(),\n            value: serviceIdentifier,\n        };\n    }\n    else {\n        return {\n            kind,\n            name: undefined,\n            optional: false,\n            tags: new Map(),\n            value: serviceIdentifier,\n        };\n    }\n}\n//# sourceMappingURL=buildDefaultManagedMetadata.js.map","import { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { MaybeClassElementMetadataKind } from '../models/MaybeClassElementMetadataKind.js';\nexport function assertMetadataFromTypescriptIfManaged(metadata) {\n    if (metadata.kind !== MaybeClassElementMetadataKind.unknown &&\n        metadata.isFromTypescriptParamType !== true) {\n        throw new InversifyCoreError(InversifyCoreErrorKind.injectionDecoratorConflict, 'Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found');\n    }\n}\n//# sourceMappingURL=assertMetadataFromTypescriptIfManaged.js.map","import { ClassElementMetadataKind } from '../models/ClassElementMetadataKind.js';\nimport { assertMetadataFromTypescriptIfManaged } from './assertMetadataFromTypescriptIfManaged.js';\nexport function buildManagedMetadataFromMaybeManagedMetadata(metadata, kind, serviceIdentifier, options) {\n    assertMetadataFromTypescriptIfManaged(metadata);\n    if (kind === ClassElementMetadataKind.multipleInjection) {\n        return {\n            ...metadata,\n            chained: options?.chained ?? false,\n            kind,\n            value: serviceIdentifier,\n        };\n    }\n    else {\n        return {\n            ...metadata,\n            kind,\n            value: serviceIdentifier,\n        };\n    }\n}\n//# sourceMappingURL=buildManagedMetadataFromMaybeManagedMetadata.js.map","import { buildClassElementMetadataFromMaybeClassElementMetadata } from './buildClassElementMetadataFromMaybeClassElementMetadata.js';\nimport { buildDefaultManagedMetadata } from './buildDefaultManagedMetadata.js';\nimport { buildManagedMetadataFromMaybeManagedMetadata } from './buildManagedMetadataFromMaybeManagedMetadata.js';\nexport const buildManagedMetadataFromMaybeClassElementMetadata = buildClassElementMetadataFromMaybeClassElementMetadata(buildDefaultManagedMetadata, buildManagedMetadataFromMaybeManagedMetadata);\n//# sourceMappingURL=buildManagedMetadataFromMaybeClassElementMetadata.js.map","export function updateMaybeClassMetadataConstructorArgument(updateMetadata, index) {\n    return (classMetadata) => {\n        const propertyMetadata = classMetadata.constructorArguments[index];\n        classMetadata.constructorArguments[index] =\n            updateMetadata(propertyMetadata);\n        return classMetadata;\n    };\n}\n//# sourceMappingURL=updateMaybeClassMetadataConstructorArgument.js.map","export function updateMaybeClassMetadataProperty(updateMetadata, propertyKey) {\n    return (classMetadata) => {\n        const propertyMetadata = classMetadata.properties.get(propertyKey);\n        classMetadata.properties.set(propertyKey, updateMetadata(propertyMetadata));\n        return classMetadata;\n    };\n}\n//# sourceMappingURL=updateMaybeClassMetadataProperty.js.map","export var DecoratorInfoKind;\n(function (DecoratorInfoKind) {\n    DecoratorInfoKind[DecoratorInfoKind[\"method\"] = 0] = \"method\";\n    DecoratorInfoKind[DecoratorInfoKind[\"parameter\"] = 1] = \"parameter\";\n    DecoratorInfoKind[DecoratorInfoKind[\"property\"] = 2] = \"property\";\n})(DecoratorInfoKind || (DecoratorInfoKind = {}));\n//# sourceMappingURL=DecoratorInfoKind.js.map","import { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { DecoratorInfoKind } from '../models/DecoratorInfoKind.js';\nexport function getDecoratorInfo(target, propertyKey, parameterIndexOrDescriptor) {\n    if (parameterIndexOrDescriptor === undefined) {\n        if (propertyKey === undefined) {\n            throw new InversifyCoreError(InversifyCoreErrorKind.unknown, 'Unexpected undefined property and index values');\n        }\n        return {\n            kind: DecoratorInfoKind.property,\n            property: propertyKey,\n            targetClass: target.constructor,\n        };\n    }\n    if (typeof parameterIndexOrDescriptor === 'number') {\n        return {\n            index: parameterIndexOrDescriptor,\n            kind: DecoratorInfoKind.parameter,\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n            targetClass: target,\n        };\n    }\n    return {\n        kind: DecoratorInfoKind.method,\n        method: propertyKey,\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n        targetClass: target,\n    };\n}\n//# sourceMappingURL=getDecoratorInfo.js.map","import { DecoratorInfoKind } from '../models/DecoratorInfoKind.js';\nexport function stringifyDecoratorInfo(decoratorTargetInfo) {\n    switch (decoratorTargetInfo.kind) {\n        case DecoratorInfoKind.method:\n            return `[class: \"${decoratorTargetInfo.targetClass.name}\", method: \"${decoratorTargetInfo.method.toString()}\"]`;\n        case DecoratorInfoKind.parameter:\n            return `[class: \"${decoratorTargetInfo.targetClass.name}\", index: \"${decoratorTargetInfo.index.toString()}\"]`;\n        case DecoratorInfoKind.property:\n            return `[class: \"${decoratorTargetInfo.targetClass.name}\", property: \"${decoratorTargetInfo.property.toString()}\"]`;\n    }\n}\n//# sourceMappingURL=stringifyDecoratorInfo.js.map","import { getDecoratorInfo } from '../../decorator/calculations/getDecoratorInfo.js';\nimport { stringifyDecoratorInfo } from '../../decorator/calculations/stringifyDecoratorInfo.js';\nimport { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nexport function handleInjectionError(target, propertyKey, parameterIndex, error) {\n    if (InversifyCoreError.isErrorOfKind(error, InversifyCoreErrorKind.injectionDecoratorConflict)) {\n        const info = getDecoratorInfo(target, propertyKey, parameterIndex);\n        throw new InversifyCoreError(InversifyCoreErrorKind.injectionDecoratorConflict, `Unexpected injection error.\n\nCause:\n\n${error.message}\n\nDetails\n\n${stringifyDecoratorInfo(info)}`, { cause: error });\n    }\n    throw error;\n}\n//# sourceMappingURL=handleInjectionError.js.map","import { updateOwnReflectMetadata } from '@inversifyjs/reflect-metadata-utils';\nimport { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { classMetadataReflectKey } from '../../reflectMetadata/data/classMetadataReflectKey.js';\nimport { updateMaybeClassMetadataConstructorArgument } from '../actions/updateMaybeClassMetadataConstructorArgument.js';\nimport { updateMaybeClassMetadataProperty } from '../actions/updateMaybeClassMetadataProperty.js';\nimport { getDefaultClassMetadata } from '../calculations/getDefaultClassMetadata.js';\nimport { handleInjectionError } from '../calculations/handleInjectionError.js';\nexport function injectBase(updateMetadata, updatePendingClassMetadataCount) {\n    const decorator = (target, propertyKey, parameterIndexOrDescriptor) => {\n        try {\n            if (parameterIndexOrDescriptor === undefined) {\n                injectProperty(updateMetadata, updatePendingClassMetadataCount)(target, propertyKey);\n            }\n            else {\n                if (typeof parameterIndexOrDescriptor === 'number') {\n                    injectParameter(updateMetadata, updatePendingClassMetadataCount)(target, propertyKey, parameterIndexOrDescriptor);\n                }\n                else {\n                    injectMethod(updateMetadata, updatePendingClassMetadataCount)(target, propertyKey, parameterIndexOrDescriptor);\n                }\n            }\n        }\n        catch (error) {\n            handleInjectionError(target, propertyKey, parameterIndexOrDescriptor, error);\n        }\n    };\n    return decorator;\n}\nfunction buildComposedUpdateMetadata(updateMetadata, updatePendingClassMetadataCount) {\n    return (target) => {\n        const updateTargetPendingClassMetadataCount = updatePendingClassMetadataCount(target);\n        return (metadata) => {\n            updateTargetPendingClassMetadataCount(metadata);\n            return updateMetadata(metadata);\n        };\n    };\n}\nfunction injectMethod(updateMetadata, updatePendingClassMetadataCount) {\n    const buildComposedUpdateMetadataFromTarget = buildComposedUpdateMetadata(updateMetadata, updatePendingClassMetadataCount);\n    return (target, propertyKey, descriptor) => {\n        if (isPropertySetter(descriptor)) {\n            updateOwnReflectMetadata(target.constructor, classMetadataReflectKey, getDefaultClassMetadata, updateMaybeClassMetadataProperty(buildComposedUpdateMetadataFromTarget(target), propertyKey));\n        }\n        else {\n            throw new InversifyCoreError(InversifyCoreErrorKind.injectionDecoratorConflict, `Found an @inject decorator in a non setter property method.\nFound @inject decorator at method \"${propertyKey.toString()}\" at class \"${target.constructor.name}\"`);\n        }\n    };\n}\nfunction injectParameter(updateMetadata, updatePendingClassMetadataCount) {\n    const buildComposedUpdateMetadataFromTarget = buildComposedUpdateMetadata(updateMetadata, updatePendingClassMetadataCount);\n    return (target, propertyKey, parameterIndex) => {\n        if (isConstructorParameter(target, propertyKey)) {\n            updateOwnReflectMetadata(target, classMetadataReflectKey, getDefaultClassMetadata, updateMaybeClassMetadataConstructorArgument(buildComposedUpdateMetadataFromTarget(target), parameterIndex));\n        }\n        else {\n            throw new InversifyCoreError(InversifyCoreErrorKind.injectionDecoratorConflict, `Found an @inject decorator in a non constructor parameter.\nFound @inject decorator at method \"${propertyKey?.toString() ?? ''}\" at class \"${target.constructor.name}\"`);\n        }\n    };\n}\nfunction injectProperty(updateMetadata, updatePendingClassMetadataCount) {\n    const buildComposedUpdateMetadataFromTarget = buildComposedUpdateMetadata(updateMetadata, updatePendingClassMetadataCount);\n    return (target, propertyKey) => {\n        updateOwnReflectMetadata(target.constructor, classMetadataReflectKey, getDefaultClassMetadata, updateMaybeClassMetadataProperty(buildComposedUpdateMetadataFromTarget(target), propertyKey));\n    };\n}\nfunction isConstructorParameter(target, propertyKey) {\n    return typeof target === 'function' && propertyKey === undefined;\n}\nfunction isPropertySetter(descriptor) {\n    return descriptor.set !== undefined;\n}\n//# sourceMappingURL=injectBase.js.map","import { decrementPendingClassMetadataCount } from '../actions/decrementPendingClassMetadataCount.js';\nimport { buildManagedMetadataFromMaybeClassElementMetadata } from '../calculations/buildManagedMetadataFromMaybeClassElementMetadata.js';\nimport { ClassElementMetadataKind } from '../models/ClassElementMetadataKind.js';\nimport { injectBase } from './injectBase.js';\nexport function inject(serviceIdentifier) {\n    const updateMetadata = buildManagedMetadataFromMaybeClassElementMetadata(ClassElementMetadataKind.singleInjection, serviceIdentifier);\n    return injectBase(updateMetadata, decrementPendingClassMetadataCount);\n}\n//# sourceMappingURL=inject.js.map","export const classIsInjectableFlagReflectKey = '@inversifyjs/core/classIsInjectableFlagReflectKey';\n//# sourceMappingURL=classIsInjectableFlagReflectKey.js.map","import { getOwnReflectMetadata, setReflectMetadata, } from '@inversifyjs/reflect-metadata-utils';\nimport { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { classIsInjectableFlagReflectKey } from '../../reflectMetadata/data/classIsInjectableFlagReflectKey.js';\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport function setIsInjectableFlag(target) {\n    const isInjectableFlag = getOwnReflectMetadata(target, classIsInjectableFlagReflectKey);\n    if (isInjectableFlag !== undefined) {\n        throw new InversifyCoreError(InversifyCoreErrorKind.injectionDecoratorConflict, `Cannot apply @injectable decorator multiple times at class \"${target.name}\"`);\n    }\n    setReflectMetadata(target, classIsInjectableFlagReflectKey, true);\n}\n//# sourceMappingURL=setIsInjectableFlag.js.map","export const typescriptParameterTypesReflectKey = 'design:paramtypes';\n//# sourceMappingURL=typescriptDesignParameterTypesReflectKey.js.map","import { ClassElementMetadataKind } from '../models/ClassElementMetadataKind.js';\nexport function buildClassElementMetadataFromTypescriptParameterType(type) {\n    return {\n        isFromTypescriptParamType: true,\n        kind: ClassElementMetadataKind.singleInjection,\n        name: undefined,\n        optional: false,\n        tags: new Map(),\n        value: type,\n    };\n}\n//# sourceMappingURL=buildClassElementMetadataFromTypescriptParameterType.js.map","const NON_USERLAND_TYPES = [\n    Array,\n    BigInt,\n    Boolean,\n    Function,\n    Number,\n    Object,\n    String,\n];\nexport function isUserlandEmittedType(type) {\n    return !NON_USERLAND_TYPES.includes(type);\n}\n//# sourceMappingURL=isUserlandEmittedType.js.map","import { getOwnReflectMetadata, updateOwnReflectMetadata, } from '@inversifyjs/reflect-metadata-utils';\nimport { classMetadataReflectKey } from '../../reflectMetadata/data/classMetadataReflectKey.js';\nimport { typescriptParameterTypesReflectKey } from '../../reflectMetadata/data/typescriptDesignParameterTypesReflectKey.js';\nimport { buildClassElementMetadataFromTypescriptParameterType } from '../calculations/buildClassElementMetadataFromTypescriptParameterType.js';\nimport { getDefaultClassMetadata } from '../calculations/getDefaultClassMetadata.js';\nimport { isUserlandEmittedType } from '../calculations/isUserlandEmittedType.js';\nexport function updateClassMetadataWithTypescriptParameterTypes(target) {\n    const typescriptConstructorArguments = getOwnReflectMetadata(target, typescriptParameterTypesReflectKey);\n    if (typescriptConstructorArguments !== undefined) {\n        updateOwnReflectMetadata(target, classMetadataReflectKey, getDefaultClassMetadata, updateMaybeClassMetadataWithTypescriptClassMetadata(typescriptConstructorArguments));\n    }\n}\nfunction updateMaybeClassMetadataWithTypescriptClassMetadata(typescriptConstructorArguments) {\n    return (classMetadata) => {\n        typescriptConstructorArguments.forEach((constructorArgumentType, index) => {\n            if (classMetadata.constructorArguments[index] === undefined &&\n                isUserlandEmittedType(constructorArgumentType)) {\n                classMetadata.constructorArguments[index] =\n                    buildClassElementMetadataFromTypescriptParameterType(constructorArgumentType);\n            }\n        });\n        return classMetadata;\n    };\n}\n//# sourceMappingURL=updateClassMetadataWithTypescriptParameterTypes.js.map","import { updateOwnReflectMetadata } from '@inversifyjs/reflect-metadata-utils';\nimport { classMetadataReflectKey } from '../../reflectMetadata/data/classMetadataReflectKey.js';\nimport { setIsInjectableFlag } from '../actions/setIsInjectableFlag.js';\nimport { updateClassMetadataWithTypescriptParameterTypes } from '../actions/updateClassMetadataWithTypescriptParameterTypes.js';\nimport { getDefaultClassMetadata } from '../calculations/getDefaultClassMetadata.js';\nexport function injectable(scope) {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n    return (target) => {\n        setIsInjectableFlag(target);\n        updateClassMetadataWithTypescriptParameterTypes(target);\n        if (scope !== undefined) {\n            updateOwnReflectMetadata(target, classMetadataReflectKey, getDefaultClassMetadata, (metadata) => ({\n                ...metadata,\n                scope,\n            }));\n        }\n    };\n}\n//# sourceMappingURL=injectable.js.map","import { ClassElementMetadataKind } from '../models/ClassElementMetadataKind.js';\nexport function buildDefaultUnmanagedMetadata() {\n    return {\n        kind: ClassElementMetadataKind.unmanaged,\n    };\n}\n//# sourceMappingURL=buildDefaultUnmanagedMetadata.js.map","import { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { assertMetadataFromTypescriptIfManaged } from './assertMetadataFromTypescriptIfManaged.js';\nimport { buildDefaultUnmanagedMetadata } from './buildDefaultUnmanagedMetadata.js';\nexport function buildUnmanagedMetadataFromMaybeManagedMetadata(metadata) {\n    assertMetadataFromTypescriptIfManaged(metadata);\n    if (hasManagedMetadata(metadata)) {\n        throw new InversifyCoreError(InversifyCoreErrorKind.injectionDecoratorConflict, 'Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections');\n    }\n    return buildDefaultUnmanagedMetadata();\n}\nfunction hasManagedMetadata(metadata) {\n    return (metadata.name !== undefined || metadata.optional || metadata.tags.size > 0);\n}\n//# sourceMappingURL=buildUnmanagedMetadataFromMaybeManagedMetadata.js.map","import { buildClassElementMetadataFromMaybeClassElementMetadata } from './buildClassElementMetadataFromMaybeClassElementMetadata.js';\nimport { buildDefaultUnmanagedMetadata } from './buildDefaultUnmanagedMetadata.js';\nimport { buildUnmanagedMetadataFromMaybeManagedMetadata } from './buildUnmanagedMetadataFromMaybeManagedMetadata.js';\nexport const buildUnmanagedMetadataFromMaybeClassElementMetadata = buildClassElementMetadataFromMaybeClassElementMetadata(buildDefaultUnmanagedMetadata, buildUnmanagedMetadataFromMaybeManagedMetadata);\n//# sourceMappingURL=buildUnmanagedMetadataFromMaybeClassElementMetadata.js.map","import { decrementPendingClassMetadataCount } from '../actions/decrementPendingClassMetadataCount.js';\nimport { buildUnmanagedMetadataFromMaybeClassElementMetadata } from '../calculations/buildUnmanagedMetadataFromMaybeClassElementMetadata.js';\nimport { injectBase } from './injectBase.js';\nexport function unmanaged() {\n    const updateMetadata = buildUnmanagedMetadataFromMaybeClassElementMetadata();\n    return injectBase(updateMetadata, decrementPendingClassMetadataCount);\n}\n//# sourceMappingURL=unmanaged.js.map","export var ResolvedValueElementMetadataKind;\n(function (ResolvedValueElementMetadataKind) {\n    ResolvedValueElementMetadataKind[ResolvedValueElementMetadataKind[\"multipleInjection\"] = 0] = \"multipleInjection\";\n    ResolvedValueElementMetadataKind[ResolvedValueElementMetadataKind[\"singleInjection\"] = 1] = \"singleInjection\";\n})(ResolvedValueElementMetadataKind || (ResolvedValueElementMetadataKind = {}));\n//# sourceMappingURL=ResolvedValueElementMetadataKind.js.map","export class BindingConstraintsImplementation {\n    #node;\n    constructor(node) {\n        this.#node = node;\n    }\n    get name() {\n        return this.#node.elem.name;\n    }\n    get serviceIdentifier() {\n        return this.#node.elem.serviceIdentifier;\n    }\n    get tags() {\n        return this.#node.elem.tags;\n    }\n    getAncestor() {\n        this.#node.elem.getAncestorsCalled = true;\n        if (this.#node.previous === undefined) {\n            return undefined;\n        }\n        return new BindingConstraintsImplementation(this.#node.previous);\n    }\n}\n//# sourceMappingURL=BindingConstraintsImplementation.js.map","const REDIRECTION_KEY = 'redirection';\nexport function isPlanServiceRedirectionBindingNode(node) {\n    return REDIRECTION_KEY in node;\n}\n//# sourceMappingURL=isPlanServiceRedirectionBindingNode.js.map","import { isPlanServiceRedirectionBindingNode } from '../../planning/calculations/isPlanServiceRedirectionBindingNode.js';\nfunction resolveBindingNode(params, planBindingNode) {\n    if (isPlanServiceRedirectionBindingNode(planBindingNode)) {\n        return resolveServiceRedirectionBindingNode(params, planBindingNode);\n    }\n    return [planBindingNode.resolve(params)];\n}\nexport function resolveServiceRedirectionBindingNode(params, node) {\n    if (node.redirection.bindings === undefined) {\n        return [];\n    }\n    if (Array.isArray(node.redirection.bindings)) {\n        return node.redirection.bindings.flatMap((binding) => resolveBindingNode(params, binding));\n    }\n    return resolveBindingNode(params, node.redirection.bindings);\n}\n//# sourceMappingURL=resolveServiceRedirectionBindingNode.js.map","import { isPromise } from '@inversifyjs/common';\nimport { isPlanServiceRedirectionBindingNode } from '../../planning/calculations/isPlanServiceRedirectionBindingNode.js';\nimport { resolveServiceRedirectionBindingNode } from './resolveServiceRedirectionBindingNode.js';\nexport function resolveMultipleBindingServiceNode(params, bindings) {\n    const resolvedValues = [];\n    for (const binding of bindings) {\n        if (isPlanServiceRedirectionBindingNode(binding)) {\n            resolvedValues.push(...resolveServiceRedirectionBindingNode(params, binding));\n        }\n        else {\n            resolvedValues.push(binding.resolve(params));\n        }\n    }\n    if (resolvedValues.some(isPromise)) {\n        return Promise.all(resolvedValues);\n    }\n    return resolvedValues;\n}\n//# sourceMappingURL=resolveMultipleBindingServiceNode.js.map","import { resolveMultipleBindingServiceNode } from '../../resolution/actions/resolveMultipleBindingServiceNode.js';\nexport class PlanMultipleBindingServiceNodeImplementation {\n    bindings;\n    serviceIdentifier;\n    isContextFree;\n    constructor(bindings, serviceIdentifier) {\n        this.bindings = bindings;\n        this.serviceIdentifier = serviceIdentifier;\n        this.isContextFree = true;\n    }\n    resolve(params) {\n        return resolveMultipleBindingServiceNode(params, this.bindings);\n    }\n}\n//# sourceMappingURL=PlanMultipleBindingServiceNodeImplementation.js.map","export const isDynamicallyResolvableBindingNodeSymbol = Symbol.for('@inversifyjs/core/DynamicallyResolvableBindingNode');\n//# sourceMappingURL=DynamicallyResolvableBindingNode.js.map","import { isDynamicallyResolvableBindingNodeSymbol, } from '../models/DynamicallyResolvableBindingNode.js';\nexport function isDynamicallyResolvableBindingNode(node) {\n    return (node[isDynamicallyResolvableBindingNodeSymbol] === true);\n}\n//# sourceMappingURL=isDynamicallyResolvableBindingNode.js.map","import { isDynamicallyResolvableBindingNode } from '../calculations/isDynamicallyResolvableBindingNode.js';\nconst UNDEFINED_RESOLVE = () => undefined;\nconst RESOLVE_KEY = 'resolve';\nexport class PlanSingleBindingServiceNodeImplementation {\n    serviceIdentifier;\n    isContextFree;\n    resolve;\n    #binding;\n    constructor(serviceIdentifier) {\n        this.serviceIdentifier = serviceIdentifier;\n        this.isContextFree = true;\n        this.resolve = UNDEFINED_RESOLVE;\n    }\n    get bindings() {\n        return this.#binding;\n    }\n    set bindings(value) {\n        this.#binding = value;\n        if (value === undefined) {\n            this.resolve = UNDEFINED_RESOLVE;\n        }\n        else {\n            /*\n             * Binding nodes exposing an own `resolve` property provide `this`\n             * independent closures. Reusing them avoids a bound function trampoline\n             * in the resolution hot path. Prototype `resolve` methods rely on\n             * `this`, so they are bound to the binding node instead.\n             */\n            this.resolve = Object.hasOwn(value, RESOLVE_KEY)\n                ? value.resolve\n                : value.resolve.bind(value);\n            // eslint-disable-next-line @typescript-eslint/no-explicit-any\n            if (isDynamicallyResolvableBindingNode(value)) {\n                // Weak reference to avoid memory leaks. A strong reference would prevent the service node from being garbage collected.\n                const serviceNodeWeakReference = new WeakRef(this);\n                value.addOnResolverChangedHandler((newResolver) => {\n                    const serviceNode = serviceNodeWeakReference.deref();\n                    if (serviceNode !== undefined) {\n                        serviceNode.resolve = newResolver;\n                    }\n                });\n            }\n        }\n    }\n}\n//# sourceMappingURL=PlanSingleBindingServiceNode.js.map","import { buildInstanceBinding } from '../../binding/calculations/buildInstanceBinding.js';\nexport function buildFilteredServiceBindings(params, bindingConstraints, options) {\n    const serviceIdentifier = options?.customServiceIdentifier ?? bindingConstraints.serviceIdentifier;\n    const serviceBindings = options?.chained === true\n        ? [...params.operations.getBindingsChained(serviceIdentifier)]\n        : [...(params.operations.getBindings(serviceIdentifier) ?? [])];\n    const filteredBindings = serviceBindings.filter((binding) => binding.isSatisfiedBy(bindingConstraints));\n    if (filteredBindings.length === 0 &&\n        params.autobindOptions !== undefined &&\n        typeof serviceIdentifier === 'function') {\n        const binding = buildInstanceBinding(params.autobindOptions, serviceIdentifier);\n        params.operations.setBinding(binding);\n        if (binding.isSatisfiedBy(bindingConstraints)) {\n            filteredBindings.push(binding);\n        }\n    }\n    return filteredBindings;\n}\n//# sourceMappingURL=buildFilteredServiceBindings.js.map","import { stringifyServiceIdentifier } from '@inversifyjs/common';\nimport { bindingTypeValues } from '../models/BindingType.js';\nexport function stringifyBinding(binding) {\n    switch (binding.type) {\n        case bindingTypeValues.Instance:\n            return `[ type: \"${binding.type}\", serviceIdentifier: \"${stringifyServiceIdentifier(binding.serviceIdentifier)}\", scope: \"${binding.scope}\", implementationType: \"${binding.implementationType.name}\" ]`;\n        case bindingTypeValues.ServiceRedirection:\n            return `[ type: \"${binding.type}\", serviceIdentifier: \"${stringifyServiceIdentifier(binding.serviceIdentifier)}\", redirection: \"${stringifyServiceIdentifier(binding.targetServiceIdentifier)}\" ]`;\n        default:\n            return `[ type: \"${binding.type}\", serviceIdentifier: \"${stringifyServiceIdentifier(binding.serviceIdentifier)}\", scope: \"${binding.scope}\" ]`;\n    }\n}\n//# sourceMappingURL=stringifyBinding.js.map","import { stringifyServiceIdentifier, } from '@inversifyjs/common';\nimport { stringifyBinding } from '../../binding/calculations/stringifyBinding.js';\nimport { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nconst SINGLE_SERVICE_NODE_BINDINGS = 1;\nexport function throwErrorWhenUnexpectedBindingsAmountFound(bindingNodes, isOptional, bindingConstraintNode) {\n    const serviceIdentifier = bindingConstraintNode.elem.serviceIdentifier;\n    const parentServiceIdentifier = bindingConstraintNode.previous?.elem.serviceIdentifier;\n    if (Array.isArray(bindingNodes)) {\n        throwErrorWhenMultipleUnexpectedBindingsAmountFound(bindingNodes, isOptional, serviceIdentifier, parentServiceIdentifier, bindingConstraintNode.elem);\n    }\n    else {\n        throwErrorWhenSingleUnexpectedBindingFound(bindingNodes, isOptional, serviceIdentifier, parentServiceIdentifier, bindingConstraintNode.elem);\n    }\n}\nfunction throwBindingNotFoundError(serviceIdentifier, parentServiceIdentifier, bindingConstraints) {\n    const errorMessage = `No bindings found for service: \"${stringifyServiceIdentifier(serviceIdentifier)}\".\n\nTrying to resolve bindings for \"${stringifyParentServiceIdentifier(serviceIdentifier, parentServiceIdentifier)}\".${stringifyBindingConstraints(bindingConstraints)}`;\n    throw new InversifyCoreError(InversifyCoreErrorKind.planning, errorMessage);\n}\nfunction throwErrorWhenMultipleUnexpectedBindingsAmountFound(bindingNodes, isOptional, serviceIdentifier, parentServiceIdentifier, bindingConstraints) {\n    if (bindingNodes.length === SINGLE_SERVICE_NODE_BINDINGS) {\n        return;\n    }\n    if (bindingNodes.length === 0) {\n        if (!isOptional) {\n            throwBindingNotFoundError(serviceIdentifier, parentServiceIdentifier, bindingConstraints);\n        }\n    }\n    else {\n        const errorMessage = `Ambiguous bindings found for service: \"${stringifyServiceIdentifier(serviceIdentifier)}\".\n\nRegistered bindings:\n\n${bindingNodes.map((bindingNode) => stringifyBinding(bindingNode.binding)).join('\\n')}\n\nTrying to resolve bindings for \"${stringifyParentServiceIdentifier(serviceIdentifier, parentServiceIdentifier)}\".${stringifyBindingConstraints(bindingConstraints)}`;\n        throw new InversifyCoreError(InversifyCoreErrorKind.planning, errorMessage);\n    }\n}\nfunction throwErrorWhenSingleUnexpectedBindingFound(bindingNode, isOptional, serviceIdentifier, parentServiceIdentifier, bindingConstraints) {\n    if (bindingNode === undefined && !isOptional) {\n        throwBindingNotFoundError(serviceIdentifier, parentServiceIdentifier, bindingConstraints);\n    }\n}\nfunction stringifyParentServiceIdentifier(serviceIdentifier, parentServiceIdentifier) {\n    return parentServiceIdentifier === undefined\n        ? `${stringifyServiceIdentifier(serviceIdentifier)} (Root service)`\n        : stringifyServiceIdentifier(parentServiceIdentifier);\n}\nfunction stringifyBindingConstraints(bindingConstraints) {\n    const stringifiedTags = bindingConstraints.tags.size === 0\n        ? ''\n        : `\n- tags:\n  - ${[...bindingConstraints.tags.keys()].map((key) => key.toString()).join('\\n  - ')}`;\n    return `\n\nBinding constraints:\n- service identifier: ${stringifyServiceIdentifier(bindingConstraints.serviceIdentifier)}\n- name: ${bindingConstraints.name?.toString() ?? '-'}${stringifiedTags}`;\n}\n//# sourceMappingURL=throwErrorWhenUnexpectedBindingsAmountFound.js.map","import { BindingConstraintsImplementation, } from '../../binding/models/BindingConstraintsImplementation.js';\nimport { PlanMultipleBindingServiceNodeImplementation } from '../models/PlanMultipleBindingServiceNodeImplementation.js';\nimport { PlanSingleBindingServiceNodeImplementation } from '../models/PlanSingleBindingServiceNode.js';\nimport { buildFilteredServiceBindings } from './buildFilteredServiceBindings.js';\nimport { throwErrorWhenUnexpectedBindingsAmountFound } from './throwErrorWhenUnexpectedBindingsAmountFound.js';\nexport function curryBuildPlanServiceNodeFromOptions(buildServiceNodeBindings) {\n    return (params, bindingConstraintsList, options) => {\n        const serviceIdentifier = options.serviceIdentifier;\n        const updatedBindingConstraintsList = bindingConstraintsList.concat({\n            getAncestorsCalled: false,\n            name: options.name,\n            serviceIdentifier,\n            tags: options.tags,\n        });\n        const bindingConstraints = new BindingConstraintsImplementation(updatedBindingConstraintsList.last);\n        const chained = options.isMultiple && options.chained;\n        const filteredServiceBindings = buildFilteredServiceBindings(params, bindingConstraints, {\n            chained,\n        });\n        const serviceNodeBindings = [];\n        if (options.isMultiple) {\n            const serviceNode = new PlanMultipleBindingServiceNodeImplementation(serviceNodeBindings, serviceIdentifier);\n            serviceNodeBindings.push(...buildServiceNodeBindings(params, updatedBindingConstraintsList, filteredServiceBindings, serviceNode, options));\n            serviceNode.isContextFree =\n                !updatedBindingConstraintsList.last.elem.getAncestorsCalled;\n            return serviceNode;\n        }\n        const serviceNode = new PlanSingleBindingServiceNodeImplementation(serviceIdentifier);\n        serviceNodeBindings.push(...buildServiceNodeBindings(params, updatedBindingConstraintsList, filteredServiceBindings, serviceNode, options));\n        serviceNode.isContextFree =\n            !updatedBindingConstraintsList.last.elem.getAncestorsCalled;\n        throwErrorWhenUnexpectedBindingsAmountFound(serviceNodeBindings, options.optional, updatedBindingConstraintsList.last);\n        const [planBindingNode] = serviceNodeBindings;\n        serviceNode.bindings = planBindingNode;\n        return serviceNode;\n    };\n}\n//# sourceMappingURL=curryBuildPlanServiceNodeFromOptions.js.map","const isLazyPlanServiceNodeSymbol = Symbol.for('@inversifyjs/core/LazyPlanServiceNode');\nexport class LazyPlanServiceNode {\n    [isLazyPlanServiceNodeSymbol];\n    _serviceIdentifier;\n    _serviceNode;\n    constructor(serviceNode, serviceIdentifier) {\n        this[isLazyPlanServiceNodeSymbol] = true;\n        this._serviceNode = serviceNode;\n        this._serviceIdentifier = serviceIdentifier;\n    }\n    get bindings() {\n        return this._getNode().bindings;\n    }\n    get isContextFree() {\n        return this._getNode().isContextFree;\n    }\n    get serviceIdentifier() {\n        return this._serviceIdentifier;\n    }\n    set bindings(bindings) {\n        this._getNode().bindings = bindings;\n    }\n    set isContextFree(isContextFree) {\n        this._getNode().isContextFree = isContextFree;\n    }\n    static is(value) {\n        return (typeof value === 'object' &&\n            value !== null &&\n            value[isLazyPlanServiceNodeSymbol] ===\n                true);\n    }\n    invalidate() {\n        this._serviceNode = undefined;\n    }\n    isExpanded() {\n        return this._serviceNode !== undefined;\n    }\n    resolve(params) {\n        return this._getNode().resolve(params);\n    }\n    _getNode() {\n        if (this._serviceNode === undefined) {\n            this._serviceNode = this._buildPlanServiceNode();\n        }\n        return this._serviceNode;\n    }\n}\n//# sourceMappingURL=LazyPlanServiceNode.js.map","export function buildBuildServiceNodeOptionsFromPlanParamsConstraints(constraints) {\n    const tags = new Map();\n    if (constraints.tag !== undefined) {\n        tags.set(constraints.tag.key, constraints.tag.value);\n    }\n    if (constraints.isMultiple) {\n        return {\n            chained: constraints.chained,\n            isMultiple: constraints.isMultiple,\n            name: constraints.name,\n            optional: constraints.isOptional ?? false,\n            serviceIdentifier: constraints.serviceIdentifier,\n            tags,\n        };\n    }\n    return {\n        isMultiple: constraints.isMultiple,\n        name: constraints.name,\n        optional: constraints.isOptional ?? false,\n        serviceIdentifier: constraints.serviceIdentifier,\n        tags,\n    };\n}\n//# sourceMappingURL=buildBuildServiceNodeOptionsFromPlanParamsConstraints.js.map","export class SingleImmutableLinkedList {\n    last;\n    length;\n    constructor(last, length) {\n        this.last = last;\n        this.length = length;\n    }\n    concat(elem) {\n        return new SingleImmutableLinkedList({\n            elem,\n            previous: this.last,\n        }, this.length + 1);\n    }\n    [Symbol.iterator]() {\n        let node = this.last;\n        return {\n            next: () => {\n                if (node === undefined) {\n                    return {\n                        done: true,\n                        value: undefined,\n                    };\n                }\n                const elem = node.elem;\n                node = node.previous;\n                return {\n                    done: false,\n                    value: elem,\n                };\n            },\n        };\n    }\n}\n//# sourceMappingURL=SingleImmutableLinkedList.js.map","import { SingleImmutableLinkedList } from '../../common/models/SingleImmutableLinkedList.js';\nexport function buildPlanBindingConstraintsList(params) {\n    const tags = new Map();\n    if (params.rootConstraints.tag !== undefined) {\n        tags.set(params.rootConstraints.tag.key, params.rootConstraints.tag.value);\n    }\n    return new SingleImmutableLinkedList({\n        elem: {\n            getAncestorsCalled: false,\n            name: params.rootConstraints.name,\n            serviceIdentifier: params.rootConstraints.serviceIdentifier,\n            tags,\n        },\n        previous: undefined,\n    }, 1);\n}\n//# sourceMappingURL=buildPlanBindingConstraintsList.js.map","import { BindingConstraintsImplementation, } from '../../binding/models/BindingConstraintsImplementation.js';\nimport { buildBuildServiceNodeOptionsFromPlanParamsConstraints } from '../../common/calculations/buildBuildServiceNodeOptionsFromPlanParamsConstraints.js';\nimport { buildFilteredServiceBindings } from '../calculations/buildFilteredServiceBindings.js';\nimport { buildPlanBindingConstraintsList } from '../calculations/buildPlanBindingConstraintsList.js';\nimport { throwErrorWhenUnexpectedBindingsAmountFound } from '../calculations/throwErrorWhenUnexpectedBindingsAmountFound.js';\nimport { PlanMultipleBindingServiceNodeImplementation } from '../models/PlanMultipleBindingServiceNodeImplementation.js';\nimport { PlanSingleBindingServiceNodeImplementation } from '../models/PlanSingleBindingServiceNode.js';\nexport function curryBuildPlanServiceNode(buildServiceNodeBindings) {\n    return (params) => {\n        const bindingConstraintsList = buildPlanBindingConstraintsList(params);\n        const bindingConstraints = new BindingConstraintsImplementation(bindingConstraintsList.last);\n        const chained = params.rootConstraints.isMultiple && params.rootConstraints.chained;\n        const filteredServiceBindings = buildFilteredServiceBindings(params, bindingConstraints, {\n            chained,\n        });\n        const serviceNodeBindings = [];\n        if (params.rootConstraints.isMultiple) {\n            const serviceNode = new PlanMultipleBindingServiceNodeImplementation(serviceNodeBindings, params.rootConstraints.serviceIdentifier);\n            serviceNodeBindings.push(...buildServiceNodeBindings(params, bindingConstraintsList, filteredServiceBindings, serviceNode, buildBuildServiceNodeOptionsFromPlanParamsConstraints(params.rootConstraints)));\n            serviceNode.isContextFree =\n                !bindingConstraintsList.last.elem.getAncestorsCalled;\n            return serviceNode;\n        }\n        const serviceNode = new PlanSingleBindingServiceNodeImplementation(params.rootConstraints.serviceIdentifier);\n        serviceNodeBindings.push(...buildServiceNodeBindings(params, bindingConstraintsList, filteredServiceBindings, serviceNode, buildBuildServiceNodeOptionsFromPlanParamsConstraints(params.rootConstraints)));\n        serviceNode.isContextFree =\n            !bindingConstraintsList.last.elem.getAncestorsCalled;\n        throwErrorWhenUnexpectedBindingsAmountFound(serviceNodeBindings, params.rootConstraints.isOptional ?? false, bindingConstraintsList.last);\n        const [planBindingNode] = serviceNodeBindings;\n        serviceNode.bindings = planBindingNode;\n        return serviceNode;\n    };\n}\n//# sourceMappingURL=curryBuildPlanServiceNode.js.map","import { isPromise } from '@inversifyjs/common';\nexport function cacheResolvedValue(binding, resolvedValue) {\n    if (isPromise(resolvedValue)) {\n        binding.cache = {\n            isRight: true,\n            value: resolvedValue,\n        };\n        return resolvedValue.then((syncResolvedValue) => cacheSyncResolvedValue(binding, syncResolvedValue));\n    }\n    return cacheSyncResolvedValue(binding, resolvedValue);\n}\nfunction cacheSyncResolvedValue(binding, resolvedValue) {\n    binding.cache = {\n        isRight: true,\n        value: resolvedValue,\n    };\n    return resolvedValue;\n}\n//# sourceMappingURL=cacheResolvedValue.js.map","export async function resolveBindingActivationsFromIteratorAsync(params, value, activationsIterator) {\n    let activatedValue = await value;\n    let activationIteratorResult = activationsIterator.next();\n    while (activationIteratorResult.done !== true) {\n        activatedValue = await activationIteratorResult.value(params.context, activatedValue);\n        activationIteratorResult = activationsIterator.next();\n    }\n    return activatedValue;\n}\n//# sourceMappingURL=resolveBindingActivationsFromIteratorAsync.js.map","import { isPromise } from '@inversifyjs/common';\nimport { resolveBindingActivationsFromIteratorAsync } from './resolveBindingActivationsFromIteratorAsync.js';\nexport function resolveBindingActivationsFromIterator(params, value, activationsIterator) {\n    let activatedValue = value;\n    let activationIteratorResult = activationsIterator.next();\n    while (activationIteratorResult.done !== true) {\n        const nextActivatedValue = activationIteratorResult.value(params.context, activatedValue);\n        if (isPromise(nextActivatedValue)) {\n            return resolveBindingActivationsFromIteratorAsync(params, nextActivatedValue, activationsIterator);\n        }\n        else {\n            activatedValue = nextActivatedValue;\n        }\n        activationIteratorResult = activationsIterator.next();\n    }\n    return activatedValue;\n}\n//# sourceMappingURL=resolveBindingActivationsFromIterator.js.map","import { isPromise } from '@inversifyjs/common';\nimport { resolveBindingActivationsFromIterator } from './resolveBindingActivationsFromIterator.js';\nimport { resolveBindingActivationsFromIteratorAsync } from './resolveBindingActivationsFromIteratorAsync.js';\nexport function resolveBindingServiceActivations(params, serviceIdentifier, value) {\n    const activations = params.context.getActivations(serviceIdentifier);\n    if (activations === undefined) {\n        return value;\n    }\n    if (isPromise(value)) {\n        return resolveBindingActivationsFromIteratorAsync(params, value, activations[Symbol.iterator]());\n    }\n    return resolveBindingActivationsFromIterator(params, value, activations[Symbol.iterator]());\n}\n//# sourceMappingURL=resolveBindingServiceActivations.js.map","import { isPromise } from '@inversifyjs/common';\nimport { resolveBindingServiceActivations } from './resolveBindingServiceActivations.js';\nexport function resolveBindingActivations(params, binding, value) {\n    let activationResult = value;\n    if (binding.onActivation !== undefined) {\n        const onActivation = binding.onActivation;\n        if (isPromise(activationResult)) {\n            activationResult = activationResult.then((resolved) => onActivation(params.context, resolved));\n        }\n        else {\n            activationResult = onActivation(params.context, activationResult);\n        }\n    }\n    return resolveBindingServiceActivations(params, binding.serviceIdentifier, activationResult);\n}\n//# sourceMappingURL=resolveBindingActivations.js.map","import { bindingScopeValues, } from '../../binding/models/BindingScope.js';\nimport { cacheResolvedValue } from './cacheResolvedValue.js';\nimport { resolveBindingActivations } from './resolveBindingActivations.js';\nexport function resolveScoped(node, resolve) {\n    const binding = node.binding;\n    switch (binding.scope) {\n        case bindingScopeValues.Singleton: {\n            return (params) => {\n                if (binding.cache.isRight) {\n                    return binding.cache.value;\n                }\n                const resolvedValue = resolveBindingActivations(params, binding, resolve(params, node));\n                return cacheResolvedValue(binding, resolvedValue);\n            };\n        }\n        case bindingScopeValues.Request: {\n            return (params) => {\n                if (params.requestScopeCache?.has(binding.id) === true) {\n                    return params.requestScopeCache.get(binding.id);\n                }\n                const resolvedValue = resolveBindingActivations(params, binding, resolve(params, node));\n                (params.requestScopeCache ??= new Map()).set(binding.id, resolvedValue);\n                return resolvedValue;\n            };\n        }\n        case bindingScopeValues.Transient:\n            return (params) => resolveBindingActivations(params, binding, resolve(params, node));\n    }\n}\n//# sourceMappingURL=resolveScoped.js.map","import { resolveScoped } from '../../resolution/actions/resolveScoped.js';\nexport class ConstantValueBindingNode {\n    binding;\n    resolve;\n    constructor(binding) {\n        this.binding = binding;\n        this.resolve = resolveScoped(this, (_params, node) => node.binding.value);\n    }\n}\n//# sourceMappingURL=ConstantValueBindingNode.js.map","import { bindingScopeValues, } from '../../binding/models/BindingScope.js';\nimport { cacheResolvedValue } from './cacheResolvedValue.js';\nexport function resolveScopedWithNoActivations(binding, resolve) {\n    switch (binding.scope) {\n        case bindingScopeValues.Singleton: {\n            return (params) => {\n                if (binding.cache.isRight) {\n                    return binding.cache.value;\n                }\n                const resolvedValue = resolve(params);\n                return cacheResolvedValue(binding, resolvedValue);\n            };\n        }\n        case bindingScopeValues.Request: {\n            return (params) => {\n                if (params.requestScopeCache?.has(binding.id) === true) {\n                    return params.requestScopeCache.get(binding.id);\n                }\n                const resolvedValue = resolve(params);\n                (params.requestScopeCache ??= new Map()).set(binding.id, resolvedValue);\n                return resolvedValue;\n            };\n        }\n        case bindingScopeValues.Transient:\n            return resolve;\n    }\n}\n//# sourceMappingURL=resolveScopedWithNoActivations.js.map","import { isPromise } from '@inversifyjs/common';\nimport { resolveBindingActivationsFromIterator } from './resolveBindingActivationsFromIterator.js';\nimport { resolveBindingActivationsFromIteratorAsync } from './resolveBindingActivationsFromIteratorAsync.js';\nexport function resolveServiceActivations(serviceIdentifier) {\n    return (params, value) => {\n        const activations = params.context.getActivations(serviceIdentifier);\n        if (activations === undefined) {\n            return value;\n        }\n        if (isPromise(value)) {\n            return resolveBindingActivationsFromIteratorAsync(params, value, activations[Symbol.iterator]());\n        }\n        return resolveBindingActivationsFromIterator(params, value, activations[Symbol.iterator]());\n    };\n}\n//# sourceMappingURL=resolveServiceActivations.js.map","import { resolveScopedWithNoActivations } from '../../resolution/actions/resolveScopedWithNoActivations.js';\nimport { resolveServiceActivations } from '../../resolution/actions/resolveServiceActivations.js';\n/**\n * Builds a resolver for dynamic value binding nodes with no binding\n * activation.\n *\n * `node.binding.value(params.context)` is inlined so the resolution hot path\n * avoids an extra callback hop when activations can be skipped.\n */\nexport function buildNoActivationsDynamicValueBindingNodeResolver(node, areServiceActivations) {\n    const serviceIdentifier = node.binding.serviceIdentifier;\n    const resolveActivations = areServiceActivations\n        ? resolveServiceActivations(serviceIdentifier)\n        : undefined;\n    const resolveNode = resolveActivations === undefined\n        ? (params) => node.binding.value(params.context)\n        : (params) => resolveActivations(params, node.binding.value(params.context));\n    return resolveScopedWithNoActivations(node.binding, resolveNode);\n}\n//# sourceMappingURL=buildNoActivationsDynamicValueBindingNodeResolver.js.map","import { resolveScoped } from '../../resolution/actions/resolveScoped.js';\nimport { buildNoActivationsDynamicValueBindingNodeResolver } from '../calculations/buildNoActivationsDynamicValueBindingNodeResolver.js';\nimport { isDynamicallyResolvableBindingNodeSymbol, } from './DynamicallyResolvableBindingNode.js';\nconst resolveScopedDynamicValueBindingNode = (node) => resolveScoped(node, (params, node) => node.binding.value(params.context));\nexport class DynamicValueBindingNode {\n    binding;\n    [isDynamicallyResolvableBindingNodeSymbol];\n    resolve;\n    #onResolverChangedHandlers;\n    constructor(binding, params) {\n        this.binding = binding;\n        this[isDynamicallyResolvableBindingNodeSymbol] = true;\n        const areServiceActivations = params.operations.getActivations(binding.serviceIdentifier) !== undefined;\n        this.#onResolverChangedHandlers = undefined;\n        this.resolve = this.#buildDynamicValueBindingNodeResolver(areServiceActivations);\n        if (!areServiceActivations && this.#areNoBindingActivationsDefined()) {\n            params.operations.subscribeActivationAddedOnce(binding.serviceIdentifier, this);\n        }\n    }\n    onActivationAdded() {\n        this.resolve = this.#buildDynamicValueBindingNodeResolver(true);\n        if (this.#onResolverChangedHandlers !== undefined) {\n            for (const handler of this.#onResolverChangedHandlers) {\n                handler(this.resolve);\n            }\n        }\n    }\n    addOnResolverChangedHandler(callback) {\n        if (this.#onResolverChangedHandlers === undefined) {\n            this.#onResolverChangedHandlers = [];\n        }\n        this.#onResolverChangedHandlers.push(callback);\n    }\n    #buildDynamicValueBindingNodeResolver(areServiceActivations) {\n        if (this.#areNoBindingActivationsDefined()) {\n            return buildNoActivationsDynamicValueBindingNodeResolver(this, areServiceActivations);\n        }\n        return resolveScopedDynamicValueBindingNode(this);\n    }\n    #areNoBindingActivationsDefined() {\n        return this.binding.onActivation === undefined;\n    }\n}\n//# sourceMappingURL=DynamicValueBindingNode.js.map","import { resolveScoped } from '../../resolution/actions/resolveScoped.js';\nexport class FactoryBindingNodeImplementation {\n    binding;\n    resolve;\n    constructor(binding) {\n        this.binding = binding;\n        this.resolve = resolveScoped(this, (params, node) => node.binding.factory(params.context));\n    }\n}\n//# sourceMappingURL=FactoryBindingNodeImplementation.js.map","import { isPromise } from '@inversifyjs/common';\nexport function resolveInstanceBindingConstructorParams(params, node) {\n    const constructorResolvedValues = [];\n    let promiseValueFound = false;\n    for (const constructorParam of node.constructorParams) {\n        const resolvedValue = constructorParam.resolve(params);\n        if (!promiseValueFound && isPromise(resolvedValue)) {\n            promiseValueFound = true;\n        }\n        constructorResolvedValues.push(resolvedValue);\n    }\n    return promiseValueFound\n        ? Promise.all(constructorResolvedValues)\n        : constructorResolvedValues;\n}\n//# sourceMappingURL=resolveInstanceBindingConstructorParams.js.map","import { isPromise } from '@inversifyjs/common';\nexport function resolveInstanceBindingNode(resolveInstanceBindingConstructorParams, resolveInstanceBindingNodeAsyncFromConstructorParams, resolveInstanceBindingNodeFromConstructorParams) {\n    return (params, node) => {\n        const constructorValues = resolveInstanceBindingConstructorParams(params, node);\n        if (isPromise(constructorValues)) {\n            return resolveInstanceBindingNodeAsyncFromConstructorParams(constructorValues, params, node);\n        }\n        return resolveInstanceBindingNodeFromConstructorParams(constructorValues, params, node);\n    };\n}\n//# sourceMappingURL=resolveInstanceBindingNode.js.map","import { isPromise } from '@inversifyjs/common';\nimport { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nexport function resolvePostConstruct(instance, binding, postConstructMethodName) {\n    const postConstructResult = invokePostConstruct(instance, binding, postConstructMethodName);\n    if (isPromise(postConstructResult)) {\n        return postConstructResult.then(() => instance);\n    }\n    return instance;\n}\nfunction invokePostConstruct(instance, binding, postConstructMethodName) {\n    if (postConstructMethodName in instance) {\n        if (typeof instance[postConstructMethodName] === 'function') {\n            let postConstructResult;\n            try {\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n                postConstructResult = instance[postConstructMethodName]();\n            }\n            catch (error) {\n                throw new InversifyCoreError(InversifyCoreErrorKind.resolution, `Unexpected error found when calling \"${postConstructMethodName.toString()}\" @postConstruct decorated method on class \"${binding.implementationType.name}\"`, {\n                    cause: error,\n                });\n            }\n            if (isPromise(postConstructResult)) {\n                return invokePostConstructAsync(binding, postConstructMethodName, postConstructResult);\n            }\n        }\n        else {\n            throw new InversifyCoreError(InversifyCoreErrorKind.resolution, `Expecting a \"${postConstructMethodName.toString()}\" method when resolving \"${binding.implementationType.name}\" class @postConstruct decorated method, a non function property was found instead.`);\n        }\n    }\n    else {\n        throw new InversifyCoreError(InversifyCoreErrorKind.resolution, `Expecting a \"${postConstructMethodName.toString()}\" property when resolving \"${binding.implementationType.name}\" class @postConstruct decorated method, none found.`);\n    }\n}\nasync function invokePostConstructAsync(binding, postConstructMethodName, postConstructResult) {\n    try {\n        await postConstructResult;\n    }\n    catch (error) {\n        throw new InversifyCoreError(InversifyCoreErrorKind.resolution, `Unexpected error found when calling \"${postConstructMethodName.toString()}\" @postConstruct decorated method on class \"${binding.implementationType.name}\"`, {\n            cause: error,\n        });\n    }\n}\n//# sourceMappingURL=resolvePostConstruct.js.map","import { isPromise } from '@inversifyjs/common';\nimport { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { ClassElementMetadataKind } from '../../metadata/models/ClassElementMetadataKind.js';\nexport function setInstanceProperties(params, instance, node) {\n    const propertyAssignmentPromises = [];\n    for (const [propertyKey, propertyNode] of node.propertyParams) {\n        const metadata = node.classMetadata.properties.get(propertyKey);\n        if (metadata === undefined) {\n            throw new InversifyCoreError(InversifyCoreErrorKind.resolution, `Expecting metadata at property \"${propertyKey.toString()}\", none found`);\n        }\n        if (metadata.kind !== ClassElementMetadataKind.unmanaged &&\n            propertyNode.bindings !== undefined) {\n            instance[propertyKey] = propertyNode.resolve(params);\n            if (isPromise(instance[propertyKey])) {\n                propertyAssignmentPromises.push((async () => {\n                    instance[propertyKey] = await instance[propertyKey];\n                })());\n            }\n        }\n    }\n    if (propertyAssignmentPromises.length > 0) {\n        return Promise.all(propertyAssignmentPromises).then(() => undefined);\n    }\n}\n//# sourceMappingURL=setInstanceProperties.js.map","import { isPromise } from '@inversifyjs/common';\nimport { resolvePostConstruct } from './resolvePostConstruct.js';\nimport { setInstanceProperties } from './setInstanceProperties.js';\nfunction resolveAllPostConstructMethods(instance, binding, postConstructMethodNames) {\n    if (postConstructMethodNames.size === 0) {\n        return instance;\n    }\n    let result = instance;\n    for (const methodName of postConstructMethodNames) {\n        if (isPromise(result)) {\n            result = result.then((resolvedInstance) => resolvePostConstruct(resolvedInstance, binding, methodName));\n        }\n        else {\n            result = resolvePostConstruct(result, binding, methodName);\n        }\n    }\n    return result;\n}\nexport function resolveInstanceBindingNodeFromConstructorParams(constructorValues, params, node) {\n    const instance = new node.binding.implementationType(...constructorValues);\n    const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n    if (isPromise(propertiesAssignmentResult)) {\n        return propertiesAssignmentResult.then(() => resolveAllPostConstructMethods(instance, node.binding, node.classMetadata.lifecycle.postConstructMethodNames));\n    }\n    return resolveAllPostConstructMethods(instance, node.binding, node.classMetadata.lifecycle.postConstructMethodNames);\n}\n//# sourceMappingURL=resolveInstanceBindingNodeFromConstructorParams.js.map","import { resolveInstanceBindingNodeFromConstructorParams } from './resolveInstanceBindingNodeFromConstructorParams.js';\nexport async function resolveInstanceBindingNodeAsyncFromConstructorParams(constructorValues, params, node) {\n    const constructorResolvedValues = await constructorValues;\n    return resolveInstanceBindingNodeFromConstructorParams(constructorResolvedValues, params, node);\n}\n//# sourceMappingURL=resolveInstanceBindingNodeAsyncFromConstructorParams.js.map","import { isPromise } from '@inversifyjs/common';\nimport { setInstanceProperties } from '../../resolution/actions/setInstanceProperties.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * instance bindings with two or more constructor arguments. Equivalent to\n * `buildConstructorArgumentsResolverJit`, but implemented with a plain closure\n * instead of the `Function` constructor, so it works in environments\n * enforcing a strict Content Security Policy (no `unsafe-eval`).\n *\n * When the bound class has no properties to inject,\n * `node.classMetadata.properties` is empty and the returned `resolveNode`\n * never performs any property related check, matching the zero-property\n * fast path performance of `buildConstructorArgumentsResolverJit`.\n */\nexport function buildConstructorArgumentsResolver(node, \n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nresolveAsyncValues, resolveActivations) {\n    const constructorArgumentsCount = node.classMetadata.constructorArguments.length;\n    function resolveConstructorValues(params) {\n        const values = new Array(constructorArgumentsCount);\n        for (let index = 0; index < constructorArgumentsCount; index++) {\n            values[index] = node.constructorParams[index].resolve(params);\n        }\n        return values;\n    }\n    if (node.classMetadata.properties.size === 0) {\n        if (resolveActivations === undefined) {\n            return function resolveNode(params) {\n                const values = resolveConstructorValues(params);\n                function build(...resolvedValues) {\n                    return new node.binding.implementationType(...resolvedValues);\n                }\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return\n                return resolveAsyncValues(...values, build);\n            };\n        }\n        return function resolveNode(params) {\n            const values = resolveConstructorValues(params);\n            const build = (...resolvedValues) => resolveActivations(params, new node.binding.implementationType(...resolvedValues));\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return\n            return resolveAsyncValues(...values, build);\n        };\n    }\n    if (resolveActivations === undefined) {\n        return function resolveNode(params) {\n            const values = resolveConstructorValues(params);\n            function build(...resolvedValues) {\n                const instance = new node.binding.implementationType(...resolvedValues);\n                const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n                if (isPromise(propertiesAssignmentResult)) {\n                    return propertiesAssignmentResult.then(() => instance);\n                }\n                return instance;\n            }\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return\n            return resolveAsyncValues(...values, build);\n        };\n    }\n    return function resolveNode(params) {\n        const values = resolveConstructorValues(params);\n        const build = (...resolvedValues) => {\n            const instance = new node.binding.implementationType(...resolvedValues);\n            const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n            if (isPromise(propertiesAssignmentResult)) {\n                return propertiesAssignmentResult.then(() => resolveActivations(params, instance));\n            }\n            return resolveActivations(params, instance);\n        };\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return\n        return resolveAsyncValues(...values, build);\n    };\n}\n//# sourceMappingURL=buildConstructorArgumentsResolver.js.map","import { isPromise } from '@inversifyjs/common';\nconst TWO_PARAMS = 2;\nconst THREE_PARAMS = 3;\nconst FOUR_PARAMS = 4;\nexport function resolveFour(value1, value2, value3, value4, build) {\n    if (isPromise(value1)) {\n        if (isPromise(value2)) {\n            if (isPromise(value3)) {\n                if (isPromise(value4)) {\n                    return new Promise((resolve, reject) => {\n                        let resolvedValues = 0;\n                        let resolvedValue1;\n                        let resolvedValue2;\n                        let resolvedValue3;\n                        let resolvedValue4;\n                        void value1\n                            .then((resolvedValue) => {\n                            if (++resolvedValues === FOUR_PARAMS) {\n                                resolve(build(resolvedValue, resolvedValue2, resolvedValue3, resolvedValue4));\n                            }\n                            else {\n                                resolvedValue1 = resolvedValue;\n                            }\n                        })\n                            .catch(reject);\n                        void value2\n                            .then((resolvedValue) => {\n                            if (++resolvedValues === FOUR_PARAMS) {\n                                resolve(build(resolvedValue1, resolvedValue, resolvedValue3, resolvedValue4));\n                            }\n                            else {\n                                resolvedValue2 = resolvedValue;\n                            }\n                        })\n                            .catch(reject);\n                        void value3\n                            .then((resolvedValue) => {\n                            if (++resolvedValues === FOUR_PARAMS) {\n                                resolve(build(resolvedValue1, resolvedValue2, resolvedValue, resolvedValue4));\n                            }\n                            else {\n                                resolvedValue3 = resolvedValue;\n                            }\n                        })\n                            .catch(reject);\n                        void value4\n                            .then((resolvedValue) => {\n                            if (++resolvedValues === FOUR_PARAMS) {\n                                resolve(build(resolvedValue1, resolvedValue2, resolvedValue3, resolvedValue));\n                            }\n                            else {\n                                resolvedValue4 = resolvedValue;\n                            }\n                        })\n                            .catch(reject);\n                    });\n                }\n                return new Promise((resolve, reject) => {\n                    let resolvedValues = 0;\n                    let resolvedValue1;\n                    let resolvedValue2;\n                    let resolvedValue3;\n                    void value1\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue, resolvedValue2, resolvedValue3, value4));\n                        }\n                        else {\n                            resolvedValue1 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value2\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue1, resolvedValue, resolvedValue3, value4));\n                        }\n                        else {\n                            resolvedValue2 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value3\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue1, resolvedValue2, resolvedValue, value4));\n                        }\n                        else {\n                            resolvedValue3 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                });\n            }\n            if (isPromise(value4)) {\n                return new Promise((resolve, reject) => {\n                    let resolvedValues = 0;\n                    let resolvedValue1;\n                    let resolvedValue2;\n                    let resolvedValue4;\n                    void value1\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue, resolvedValue2, value3, resolvedValue4));\n                        }\n                        else {\n                            resolvedValue1 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value2\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue1, resolvedValue, value3, resolvedValue4));\n                        }\n                        else {\n                            resolvedValue2 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value4\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue1, resolvedValue2, value3, resolvedValue));\n                        }\n                        else {\n                            resolvedValue4 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                });\n            }\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue1;\n                let resolvedValue2;\n                void value1\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue, resolvedValue2, value3, value4));\n                    }\n                    else {\n                        resolvedValue1 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value2\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue1, resolvedValue, value3, value4));\n                    }\n                    else {\n                        resolvedValue2 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        if (isPromise(value3)) {\n            if (isPromise(value4)) {\n                return new Promise((resolve, reject) => {\n                    let resolvedValues = 0;\n                    let resolvedValue1;\n                    let resolvedValue3;\n                    let resolvedValue4;\n                    void value1\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue, value2, resolvedValue3, resolvedValue4));\n                        }\n                        else {\n                            resolvedValue1 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value3\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue1, value2, resolvedValue, resolvedValue4));\n                        }\n                        else {\n                            resolvedValue3 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value4\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue1, value2, resolvedValue3, resolvedValue));\n                        }\n                        else {\n                            resolvedValue4 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                });\n            }\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue1;\n                let resolvedValue3;\n                void value1\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue, value2, resolvedValue3, value4));\n                    }\n                    else {\n                        resolvedValue1 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value3\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue1, value2, resolvedValue, value4));\n                    }\n                    else {\n                        resolvedValue3 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        if (isPromise(value4)) {\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue1;\n                let resolvedValue4;\n                void value1\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue, value2, value3, resolvedValue4));\n                    }\n                    else {\n                        resolvedValue1 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value4\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue1, value2, value3, resolvedValue));\n                    }\n                    else {\n                        resolvedValue4 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        return value1.then(async (resolvedValue1) => build(resolvedValue1, value2, value3, value4));\n    }\n    if (isPromise(value2)) {\n        if (isPromise(value3)) {\n            if (isPromise(value4)) {\n                return new Promise((resolve, reject) => {\n                    let resolvedValues = 0;\n                    let resolvedValue2;\n                    let resolvedValue3;\n                    let resolvedValue4;\n                    void value2\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(value1, resolvedValue, resolvedValue3, resolvedValue4));\n                        }\n                        else {\n                            resolvedValue2 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value3\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(value1, resolvedValue2, resolvedValue, resolvedValue4));\n                        }\n                        else {\n                            resolvedValue3 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value4\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(value1, resolvedValue2, resolvedValue3, resolvedValue));\n                        }\n                        else {\n                            resolvedValue4 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                });\n            }\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue2;\n                let resolvedValue3;\n                void value2\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(value1, resolvedValue, resolvedValue3, value4));\n                    }\n                    else {\n                        resolvedValue2 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value3\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(value1, resolvedValue2, resolvedValue, value4));\n                    }\n                    else {\n                        resolvedValue3 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        if (isPromise(value4)) {\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue2;\n                let resolvedValue4;\n                void value2\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(value1, resolvedValue, value3, resolvedValue4));\n                    }\n                    else {\n                        resolvedValue2 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value4\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(value1, resolvedValue2, value3, resolvedValue));\n                    }\n                    else {\n                        resolvedValue4 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        return value2.then(async (resolvedValue2) => build(value1, resolvedValue2, value3, value4));\n    }\n    if (isPromise(value3)) {\n        if (isPromise(value4)) {\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue3;\n                let resolvedValue4;\n                void value3\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(value1, value2, resolvedValue, resolvedValue4));\n                    }\n                    else {\n                        resolvedValue3 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value4\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(value1, value2, resolvedValue3, resolvedValue));\n                    }\n                    else {\n                        resolvedValue4 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        return value3.then(async (resolvedValue3) => build(value1, value2, resolvedValue3, value4));\n    }\n    if (isPromise(value4)) {\n        return value4.then(async (resolvedValue4) => build(value1, value2, value3, resolvedValue4));\n    }\n    return build(value1, value2, value3, value4);\n}\n//# sourceMappingURL=resolveFour.js.map","import { isPromise } from '@inversifyjs/common';\nimport { setInstanceProperties } from '../../resolution/actions/setInstanceProperties.js';\nimport { resolveFour } from './resolveFour.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * four-argument instance bindings. Equivalent to\n * `buildConstructorArgumentsResolverJit` with `resolveFour`, but implemented\n * with a plain closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n *\n * When the bound class has no properties to inject,\n * `node.classMetadata.properties` is empty and the returned `resolveNode`\n * never performs any property related check, matching the zero-property\n * fast path performance of `buildConstructorArgumentsResolverJit` with\n * `resolveFour`.\n */\nexport function buildFourConstructorArgumentResolver(node, resolveActivations) {\n    if (node.classMetadata.properties.size === 0) {\n        if (resolveActivations === undefined) {\n            return function resolveNode(params) {\n                const resolvedValue0 = node.constructorParams[0].resolve(params);\n                const resolvedValue1 = node.constructorParams[1].resolve(params);\n                const resolvedValue2 = node.constructorParams[2].resolve(params);\n                const resolvedValue3 = node.constructorParams[3].resolve(params);\n                return resolveFour(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3, (resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3) => new node.binding.implementationType(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3));\n            };\n        }\n        return function resolveNode(params) {\n            const resolvedValue0 = node.constructorParams[0].resolve(params);\n            const resolvedValue1 = node.constructorParams[1].resolve(params);\n            const resolvedValue2 = node.constructorParams[2].resolve(params);\n            const resolvedValue3 = node.constructorParams[3].resolve(params);\n            return resolveFour(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3, (resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3) => resolveActivations(params, new node.binding.implementationType(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3)));\n        };\n    }\n    if (resolveActivations === undefined) {\n        const finalizeInstance = (params, instance) => {\n            const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n            if (isPromise(propertiesAssignmentResult)) {\n                return propertiesAssignmentResult.then(() => instance);\n            }\n            return instance;\n        };\n        return function resolveNode(params) {\n            const resolvedValue0 = node.constructorParams[0].resolve(params);\n            const resolvedValue1 = node.constructorParams[1].resolve(params);\n            const resolvedValue2 = node.constructorParams[2].resolve(params);\n            const resolvedValue3 = node.constructorParams[3].resolve(params);\n            return resolveFour(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3, (resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3) => finalizeInstance(params, new node.binding.implementationType(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3)));\n        };\n    }\n    const finalizeInstance = (params, instance) => {\n        const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n        if (isPromise(propertiesAssignmentResult)) {\n            return propertiesAssignmentResult.then(() => resolveActivations(params, instance));\n        }\n        return resolveActivations(params, instance);\n    };\n    return function resolveNode(params) {\n        const resolvedValue0 = node.constructorParams[0].resolve(params);\n        const resolvedValue1 = node.constructorParams[1].resolve(params);\n        const resolvedValue2 = node.constructorParams[2].resolve(params);\n        const resolvedValue3 = node.constructorParams[3].resolve(params);\n        return resolveFour(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3, (resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3) => finalizeInstance(params, new node.binding.implementationType(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3)));\n    };\n}\n//# sourceMappingURL=buildFourConstructorArgumentResolver.js.map","import { isPromise } from '@inversifyjs/common';\nimport { setInstanceProperties } from '../../resolution/actions/setInstanceProperties.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * one-argument instance bindings. Equivalent to\n * `buildOneConstructorArgumentResolverJit`, but implemented with a plain\n * closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n *\n * When the bound class has no properties to inject,\n * `node.classMetadata.properties` is empty and the returned `resolveNode`\n * never performs any property related check, matching the zero-property\n * fast path performance of `buildOneConstructorArgumentResolverJit`.\n */\nexport function buildOneConstructorArgumentResolver(node, resolveActivations) {\n    if (node.classMetadata.properties.size === 0) {\n        if (resolveActivations === undefined) {\n            return function resolveNode(params) {\n                const resolvedValue = node.constructorParams[0].resolve(params);\n                if (isPromise(resolvedValue)) {\n                    return resolvedValue.then((resolvedValue) => new node.binding.implementationType(resolvedValue));\n                }\n                return new node.binding.implementationType(resolvedValue);\n            };\n        }\n        return function resolveNode(params) {\n            const resolvedValue = node.constructorParams[0].resolve(params);\n            if (isPromise(resolvedValue)) {\n                return resolvedValue.then((resolvedValue) => resolveActivations(params, new node.binding.implementationType(resolvedValue)));\n            }\n            return resolveActivations(params, new node.binding.implementationType(resolvedValue));\n        };\n    }\n    if (resolveActivations === undefined) {\n        const finalizeInstance = (params, instance) => {\n            const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n            if (isPromise(propertiesAssignmentResult)) {\n                return propertiesAssignmentResult.then(() => instance);\n            }\n            return instance;\n        };\n        return function resolveNode(params) {\n            const resolvedValue = node.constructorParams[0].resolve(params);\n            if (isPromise(resolvedValue)) {\n                return resolvedValue.then((resolvedValue) => finalizeInstance(params, new node.binding.implementationType(resolvedValue)));\n            }\n            return finalizeInstance(params, new node.binding.implementationType(resolvedValue));\n        };\n    }\n    const finalizeInstance = (params, instance) => {\n        const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n        if (isPromise(propertiesAssignmentResult)) {\n            return propertiesAssignmentResult.then(() => resolveActivations(params, instance));\n        }\n        return resolveActivations(params, instance);\n    };\n    return function resolveNode(params) {\n        const resolvedValue = node.constructorParams[0].resolve(params);\n        if (isPromise(resolvedValue)) {\n            return resolvedValue.then((resolvedValue) => finalizeInstance(params, new node.binding.implementationType(resolvedValue)));\n        }\n        return finalizeInstance(params, new node.binding.implementationType(resolvedValue));\n    };\n}\n//# sourceMappingURL=buildOneConstructorArgumentResolver.js.map","import { isPromise } from '@inversifyjs/common';\nconst TWO_PARAMS = 2;\nconst THREE_PARAMS = 3;\nexport function resolveThree(value1, value2, value3, build) {\n    if (isPromise(value1)) {\n        if (isPromise(value2)) {\n            if (isPromise(value3)) {\n                return new Promise((resolve, reject) => {\n                    let resolvedValues = 0;\n                    let resolvedValue1;\n                    let resolvedValue2;\n                    let resolvedValue3;\n                    void value1\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue, resolvedValue2, resolvedValue3));\n                        }\n                        else {\n                            resolvedValue1 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value2\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue1, resolvedValue, resolvedValue3));\n                        }\n                        else {\n                            resolvedValue2 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                    void value3\n                        .then((resolvedValue) => {\n                        if (++resolvedValues === THREE_PARAMS) {\n                            resolve(build(resolvedValue1, resolvedValue2, resolvedValue));\n                        }\n                        else {\n                            resolvedValue3 = resolvedValue;\n                        }\n                    })\n                        .catch(reject);\n                });\n            }\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue1;\n                let resolvedValue2;\n                void value1\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue, resolvedValue2, value3));\n                    }\n                    else {\n                        resolvedValue1 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value2\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue1, resolvedValue, value3));\n                    }\n                    else {\n                        resolvedValue2 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        if (isPromise(value3)) {\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue1;\n                let resolvedValue3;\n                void value1\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue, value2, resolvedValue3));\n                    }\n                    else {\n                        resolvedValue1 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value3\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(resolvedValue1, value2, resolvedValue));\n                    }\n                    else {\n                        resolvedValue3 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        return value1.then(async (resolvedValue1) => build(resolvedValue1, value2, value3));\n    }\n    if (isPromise(value2)) {\n        if (isPromise(value3)) {\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue2;\n                let resolvedValue3;\n                void value2\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(value1, resolvedValue, resolvedValue3));\n                    }\n                    else {\n                        resolvedValue2 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value3\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === TWO_PARAMS) {\n                        resolve(build(value1, resolvedValue2, resolvedValue));\n                    }\n                    else {\n                        resolvedValue3 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        return value2.then(async (resolvedValue2) => build(value1, resolvedValue2, value3));\n    }\n    if (isPromise(value3)) {\n        return value3.then(async (resolvedValue3) => build(value1, value2, resolvedValue3));\n    }\n    return build(value1, value2, value3);\n}\n//# sourceMappingURL=resolveThree.js.map","import { isPromise } from '@inversifyjs/common';\nimport { setInstanceProperties } from '../../resolution/actions/setInstanceProperties.js';\nimport { resolveThree } from './resolveThree.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * three-argument instance bindings. Equivalent to\n * `buildConstructorArgumentsResolverJit` with `resolveThree`, but implemented\n * with a plain closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n *\n * When the bound class has no properties to inject,\n * `node.classMetadata.properties` is empty and the returned `resolveNode`\n * never performs any property related check, matching the zero-property\n * fast path performance of `buildConstructorArgumentsResolverJit` with\n * `resolveThree`.\n */\nexport function buildThreeConstructorArgumentResolver(node, resolveActivations) {\n    if (node.classMetadata.properties.size === 0) {\n        if (resolveActivations === undefined) {\n            return function resolveNode(params) {\n                const resolvedValue0 = node.constructorParams[0].resolve(params);\n                const resolvedValue1 = node.constructorParams[1].resolve(params);\n                const resolvedValue2 = node.constructorParams[2].resolve(params);\n                return resolveThree(resolvedValue0, resolvedValue1, resolvedValue2, (resolvedValue0, resolvedValue1, resolvedValue2) => new node.binding.implementationType(resolvedValue0, resolvedValue1, resolvedValue2));\n            };\n        }\n        return function resolveNode(params) {\n            const resolvedValue0 = node.constructorParams[0].resolve(params);\n            const resolvedValue1 = node.constructorParams[1].resolve(params);\n            const resolvedValue2 = node.constructorParams[2].resolve(params);\n            return resolveThree(resolvedValue0, resolvedValue1, resolvedValue2, (resolvedValue0, resolvedValue1, resolvedValue2) => resolveActivations(params, new node.binding.implementationType(resolvedValue0, resolvedValue1, resolvedValue2)));\n        };\n    }\n    if (resolveActivations === undefined) {\n        const finalizeInstance = (params, instance) => {\n            const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n            if (isPromise(propertiesAssignmentResult)) {\n                return propertiesAssignmentResult.then(() => instance);\n            }\n            return instance;\n        };\n        return function resolveNode(params) {\n            const resolvedValue0 = node.constructorParams[0].resolve(params);\n            const resolvedValue1 = node.constructorParams[1].resolve(params);\n            const resolvedValue2 = node.constructorParams[2].resolve(params);\n            return resolveThree(resolvedValue0, resolvedValue1, resolvedValue2, (resolvedValue0, resolvedValue1, resolvedValue2) => finalizeInstance(params, new node.binding.implementationType(resolvedValue0, resolvedValue1, resolvedValue2)));\n        };\n    }\n    const finalizeInstance = (params, instance) => {\n        const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n        if (isPromise(propertiesAssignmentResult)) {\n            return propertiesAssignmentResult.then(() => resolveActivations(params, instance));\n        }\n        return resolveActivations(params, instance);\n    };\n    return function resolveNode(params) {\n        const resolvedValue0 = node.constructorParams[0].resolve(params);\n        const resolvedValue1 = node.constructorParams[1].resolve(params);\n        const resolvedValue2 = node.constructorParams[2].resolve(params);\n        return resolveThree(resolvedValue0, resolvedValue1, resolvedValue2, (resolvedValue0, resolvedValue1, resolvedValue2) => finalizeInstance(params, new node.binding.implementationType(resolvedValue0, resolvedValue1, resolvedValue2)));\n    };\n}\n//# sourceMappingURL=buildThreeConstructorArgumentResolver.js.map","import { isPromise } from '@inversifyjs/common';\nconst PARAMS = 2;\nexport function resolveTwo(value1, value2, build) {\n    if (isPromise(value1)) {\n        if (isPromise(value2)) {\n            return new Promise((resolve, reject) => {\n                let resolvedValues = 0;\n                let resolvedValue1;\n                let resolvedValue2;\n                void value1\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === PARAMS) {\n                        resolve(build(resolvedValue, resolvedValue2));\n                    }\n                    else {\n                        resolvedValue1 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n                void value2\n                    .then((resolvedValue) => {\n                    if (++resolvedValues === PARAMS) {\n                        resolve(build(resolvedValue1, resolvedValue));\n                    }\n                    else {\n                        resolvedValue2 = resolvedValue;\n                    }\n                })\n                    .catch(reject);\n            });\n        }\n        return value1.then(async (resolvedValue1) => build(resolvedValue1, value2));\n    }\n    if (isPromise(value2)) {\n        return value2.then(async (resolvedValue2) => build(value1, resolvedValue2));\n    }\n    return build(value1, value2);\n}\n//# sourceMappingURL=resolveTwo.js.map","import { isPromise } from '@inversifyjs/common';\nimport { setInstanceProperties } from '../../resolution/actions/setInstanceProperties.js';\nimport { resolveTwo } from './resolveTwo.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * two-argument instance bindings. Equivalent to\n * `buildConstructorArgumentsResolverJit` with `resolveTwo`, but implemented with a\n * plain closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n *\n * When the bound class has no properties to inject,\n * `node.classMetadata.properties` is empty and the returned `resolveNode`\n * never performs any property related check, matching the zero-property\n * fast path performance of `buildConstructorArgumentsResolverJit` with\n * `resolveTwo`.\n */\nexport function buildTwoConstructorArgumentResolver(node, resolveActivations) {\n    if (node.classMetadata.properties.size === 0) {\n        if (resolveActivations === undefined) {\n            return function resolveNode(params) {\n                const resolvedValue0 = node.constructorParams[0].resolve(params);\n                const resolvedValue1 = node.constructorParams[1].resolve(params);\n                return resolveTwo(resolvedValue0, resolvedValue1, (resolvedValue0, resolvedValue1) => new node.binding.implementationType(resolvedValue0, resolvedValue1));\n            };\n        }\n        return function resolveNode(params) {\n            const resolvedValue0 = node.constructorParams[0].resolve(params);\n            const resolvedValue1 = node.constructorParams[1].resolve(params);\n            return resolveTwo(resolvedValue0, resolvedValue1, (resolvedValue0, resolvedValue1) => resolveActivations(params, new node.binding.implementationType(resolvedValue0, resolvedValue1)));\n        };\n    }\n    if (resolveActivations === undefined) {\n        const finalizeInstance = (params, instance) => {\n            const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n            if (isPromise(propertiesAssignmentResult)) {\n                return propertiesAssignmentResult.then(() => instance);\n            }\n            return instance;\n        };\n        return function resolveNode(params) {\n            const resolvedValue0 = node.constructorParams[0].resolve(params);\n            const resolvedValue1 = node.constructorParams[1].resolve(params);\n            return resolveTwo(resolvedValue0, resolvedValue1, (resolvedValue0, resolvedValue1) => finalizeInstance(params, new node.binding.implementationType(resolvedValue0, resolvedValue1)));\n        };\n    }\n    const finalizeInstance = (params, instance) => {\n        const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n        if (isPromise(propertiesAssignmentResult)) {\n            return propertiesAssignmentResult.then(() => resolveActivations(params, instance));\n        }\n        return resolveActivations(params, instance);\n    };\n    return function resolveNode(params) {\n        const resolvedValue0 = node.constructorParams[0].resolve(params);\n        const resolvedValue1 = node.constructorParams[1].resolve(params);\n        return resolveTwo(resolvedValue0, resolvedValue1, (resolvedValue0, resolvedValue1) => finalizeInstance(params, new node.binding.implementationType(resolvedValue0, resolvedValue1)));\n    };\n}\n//# sourceMappingURL=buildTwoConstructorArgumentResolver.js.map","import { isPromise } from '@inversifyjs/common';\nimport { setInstanceProperties } from '../../resolution/actions/setInstanceProperties.js';\n/**\n * Builds a `resolveNode` for a zero-argument instance binding without\n * relying on the `Function` constructor.\n *\n * `buildZeroConstructorArgumentsResolverJit` generates a brand new function\n * from source text for every binding to keep the `new ctor()` call site\n * monomorphic in V8's eyes. That approach requires `unsafe-eval` (or an\n * equivalent CSP trusted types allowance), so it cannot be used in\n * environments enforcing a strict Content Security Policy.\n *\n * This function provides the same behavior using a plain closure instead,\n * so it works under CSP restrictions at the cost of the per-binding\n * monomorphic optimization described above.\n *\n * When the bound class has no properties to inject,\n * `node.classMetadata.properties` is empty and the returned `resolveNode`\n * never performs any property related check, matching the zero-property\n * fast path performance of `buildZeroConstructorArgumentsResolverJit`.\n */\nexport function buildZeroConstructorArgumentsResolver(node, resolveActivations) {\n    if (node.classMetadata.properties.size === 0) {\n        if (resolveActivations === undefined) {\n            return function resolveNode(_params) {\n                return new node.binding.implementationType();\n            };\n        }\n        return function resolveNode(params) {\n            return resolveActivations(params, new node.binding.implementationType());\n        };\n    }\n    if (resolveActivations === undefined) {\n        return function resolveNode(params) {\n            const instance = new node.binding.implementationType();\n            const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n            if (isPromise(propertiesAssignmentResult)) {\n                return propertiesAssignmentResult.then(() => instance);\n            }\n            return instance;\n        };\n    }\n    return function resolveNode(params) {\n        const instance = new node.binding.implementationType();\n        const propertiesAssignmentResult = setInstanceProperties(params, instance, node);\n        if (isPromise(propertiesAssignmentResult)) {\n            return propertiesAssignmentResult.then(() => resolveActivations(params, instance));\n        }\n        return resolveActivations(params, instance);\n    };\n}\n//# sourceMappingURL=buildZeroConstructorArgumentsResolver.js.map","import { isPromise } from '@inversifyjs/common';\n/**\n * CSP-safe counterpart to `buildResolveMany`.\n *\n * `buildResolveMany` emits a fixed-arity helper with the `Function`\n * constructor so it cannot run under a strict Content Security Policy.\n * This helper accepts a variable number of resolved values followed by a\n * `build` callback and uses `Promise.all` when any value is async.\n */\nexport function resolveMany(\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n...args) {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n    const build = args[args.length - 1];\n    const values = args.slice(0, -1);\n    for (const value of values) {\n        if (isPromise(value)) {\n            return Promise.all(values).then(\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\n            (resolvedValues) => build(...resolvedValues));\n        }\n    }\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\n    return build(...values);\n}\n//# sourceMappingURL=resolveMany.js.map","import { resolveScopedWithNoActivations } from '../../resolution/actions/resolveScopedWithNoActivations.js';\nimport { resolveServiceActivations } from '../../resolution/actions/resolveServiceActivations.js';\nimport { buildConstructorArgumentsResolver } from './buildConstructorArgumentsResolver.js';\nimport { buildFourConstructorArgumentResolver } from './buildFourConstructorArgumentResolver.js';\nimport { buildOneConstructorArgumentResolver } from './buildOneConstructorArgumentResolver.js';\nimport { buildThreeConstructorArgumentResolver } from './buildThreeConstructorArgumentResolver.js';\nimport { buildTwoConstructorArgumentResolver } from './buildTwoConstructorArgumentResolver.js';\nimport { buildZeroConstructorArgumentsResolver } from './buildZeroConstructorArgumentsResolver.js';\nimport { resolveMany } from './resolveMany.js';\nconst ZERO_CONSTRUCTOR_ARGUMENTS = 0;\nconst ONE_CONSTRUCTOR_ARGUMENT = 1;\nconst TWO_CONSTRUCTOR_ARGUMENTS = 2;\nconst THREE_CONSTRUCTOR_ARGUMENTS = 3;\nconst FOUR_CONSTRUCTOR_ARGUMENTS = 4;\n/**\n * Builds a resolver for instance binding nodes with\n * no post construct methods and no binding activation.\n *\n * Unlike the JIT path, specialized CSP resolvers key only on constructor\n * arity: property injection is handled inside those resolvers via\n * `setInstanceProperties`, so mixed ctor/property graphs must not be\n * dispatched as if properties were extra constructor arguments.\n */\nexport function buildNoActivationsInstanceBindingNodeResolver(node, areServiceActivations) {\n    const serviceIdentifier = node.binding.serviceIdentifier;\n    const resolveActivations = areServiceActivations\n        ? resolveServiceActivations(serviceIdentifier)\n        : undefined;\n    let resolveNode;\n    switch (node.classMetadata.constructorArguments.length) {\n        case ZERO_CONSTRUCTOR_ARGUMENTS:\n            resolveNode = buildZeroConstructorArgumentsResolver(node, resolveActivations);\n            break;\n        case ONE_CONSTRUCTOR_ARGUMENT:\n            resolveNode = buildOneConstructorArgumentResolver(node, resolveActivations);\n            break;\n        case TWO_CONSTRUCTOR_ARGUMENTS:\n            resolveNode = buildTwoConstructorArgumentResolver(node, resolveActivations);\n            break;\n        case THREE_CONSTRUCTOR_ARGUMENTS:\n            resolveNode = buildThreeConstructorArgumentResolver(node, resolveActivations);\n            break;\n        case FOUR_CONSTRUCTOR_ARGUMENTS:\n            resolveNode = buildFourConstructorArgumentResolver(node, resolveActivations);\n            break;\n        default:\n            resolveNode = buildConstructorArgumentsResolver(node, resolveMany, resolveActivations);\n    }\n    return resolveScopedWithNoActivations(node.binding, resolveNode);\n}\n//# sourceMappingURL=buildNoActivationsInstanceBindingNodeResolver.js.map","/*\n * Monotonically increasing id used to make every generated function's\n * source text unique (see buildZeroConstructorArgumentsResolveNode below).\n */\nlet nextGeneratedResolverId = 0;\nexport function getGeneratedResolverId() {\n    return nextGeneratedResolverId++;\n}\n//# sourceMappingURL=getGeneratedResolverId.js.map","import { getGeneratedResolverId } from './getGeneratedResolverId.js';\nexport function buildConstructorArgumentsResolverJit(node, implementationType, \n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nresolveAsyncValues, resolveActivations) {\n    const id = getGeneratedResolverId().toString();\n    const constructorArgumentsCount = node.classMetadata.constructorArguments.length;\n    const constructorArgumentIndexes = Array.from({ length: constructorArgumentsCount }, (_, index) => index);\n    const constructorValuesConcatenation = constructorArgumentIndexes\n        .map((index) => `value$${index.toString()}`)\n        .join(', ');\n    let constructorValuesDeclarations = '';\n    for (const index of constructorArgumentIndexes) {\n        constructorValuesDeclarations += `const value$${index.toString()} = node$${id}.constructorParams[${index.toString()}].resolve(params$${id});\\n`;\n    }\n    const propertiesArgumentsCount = node.classMetadata.properties.size;\n    const propertiesArgumentIndexes = Array.from({ length: propertiesArgumentsCount }, (_, index) => index);\n    const propertiesValuesConcatenation = propertiesArgumentIndexes\n        .map((index) => `property$${index.toString()}`)\n        .join(', ');\n    let propertyValuesDeclarations = `let propertyIterator = node$${id}.propertyParams.entries();\\n`;\n    for (const index of propertiesArgumentIndexes) {\n        propertyValuesDeclarations += `const propertyNode$${index.toString()} = propertyIterator.next().value;\n  const propertyKey$${index.toString()} = propertyNode$${index.toString()}[0];\n  const propertyBound$${index.toString()} = propertyNode$${index.toString()}[1].bindings !== undefined;\n  const property$${index.toString()} = propertyBound$${index.toString()} ? propertyNode$${index.toString()}[1].resolve(params$${id}) : undefined;\\n`;\n    }\n    const propertyAssignments = propertiesArgumentIndexes\n        .map((index) => `if (propertyBound$${index.toString()}) { instance[propertyKey$${index.toString()}] = property$${index.toString()}; }`)\n        .join('      \\n');\n    const resolveAsyncValuesArguments = [\n        constructorValuesConcatenation,\n        propertiesValuesConcatenation,\n    ]\n        .filter((value) => value.length > 0)\n        .join(', ');\n    const resolveAsyncValuesBuildArguments = resolveAsyncValuesArguments;\n    if (resolveActivations === undefined) {\n        const buildResolveNodeBody = propertiesArgumentsCount === 0\n            ? `return function resolveNode$${id}(params$${id}) {\n  ${constructorValuesDeclarations}\n\n  return resolveAsyncValues$${id}(\n    ${constructorValuesConcatenation},\n    function (${constructorValuesConcatenation}) {\n      return new ctor$${id}(${constructorValuesConcatenation});\n    },\n  );\n}`\n            : `return function resolveNode$${id}(params$${id}) {\n  ${constructorValuesDeclarations}\n\n  ${propertyValuesDeclarations}\n\n  return resolveAsyncValues$${id}(\n    ${resolveAsyncValuesArguments},\n    function (${resolveAsyncValuesBuildArguments}) {\n      const instance = new ctor$${id}(${constructorValuesConcatenation});\n\n      ${propertyAssignments}\n\n      return instance;\n    },\n  );\n}`;\n        const buildResolveNode = new Function(`node$${id}`, `ctor$${id}`, `resolveAsyncValues$${id}`, buildResolveNodeBody);\n        return buildResolveNode(node, implementationType, resolveAsyncValues);\n    }\n    const buildResolveNodeBody = propertiesArgumentsCount === 0\n        ? `return function resolveNode$${id}(params$${id}) {\n  ${constructorValuesDeclarations}\n\n  return resolveAsyncValues$${id}(\n    ${constructorValuesConcatenation},\n    function (${constructorValuesConcatenation}) {\n      return activate$${id}(\n        params$${id},\n        new ctor$${id}(${constructorValuesConcatenation}),\n      );\n    },\n  );\n}`\n        : `return function resolveNode$${id}(params$${id}) {\n  ${constructorValuesDeclarations}\n\n  ${propertyValuesDeclarations}\n\n  return resolveAsyncValues$${id}(\n    ${resolveAsyncValuesArguments},\n    function (${resolveAsyncValuesBuildArguments}) {\n      const instance = new ctor$${id}(${constructorValuesConcatenation});\n\n      ${propertyAssignments}\n\n      return activate$${id}(\n        params$${id},\n        instance,\n      );\n    },\n  );\n}`;\n    const buildResolveNode = new Function(`node$${id}`, `ctor$${id}`, `activate$${id}`, `resolveAsyncValues$${id}`, buildResolveNodeBody);\n    return buildResolveNode(node, implementationType, resolveActivations, resolveAsyncValues);\n}\n//# sourceMappingURL=buildConstructorArgumentsResolverJit.js.map","import { isPromise } from '@inversifyjs/common';\nimport { getGeneratedResolverId } from './getGeneratedResolverId.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolveNode, but\n * for one-argument instance bindings.\n */\nexport function buildOneConstructorArgumentResolverJit(node, implementationType, resolveActivations) {\n    const id = getGeneratedResolverId().toString();\n    if (resolveActivations === undefined) {\n        const buildResolveNode = new Function(`node$${id}`, `ctor$${id}`, `isPromise$${id}`, `return function resolveNode$${id}(params$${id}) {\n        const resolvedValue$${id} = node$${id}.constructorParams[0].resolve(params$${id});\n\n        if (isPromise$${id}(resolvedValue$${id})) {\n          return resolvedValue$${id}.then(function (resolvedValue$${id}) {\n            return new ctor$${id}(resolvedValue$${id});\n          });\n        }\n\n        return new ctor$${id}(resolvedValue$${id});\n      };`);\n        return buildResolveNode(node, implementationType, isPromise);\n    }\n    const buildResolveNode = new Function(`node$${id}`, `ctor$${id}`, `activate$${id}`, `isPromise$${id}`, `return function resolveNode$${id}(params$${id}) {\n        const resolvedValue$${id} = node$${id}.constructorParams[0].resolve(params$${id});\n\n        if (isPromise$${id}(resolvedValue$${id})) {\n          return resolvedValue$${id}.then(function (resolvedValue$${id}) {\n            return activate$${id}(params$${id}, new ctor$${id}(resolvedValue$${id}));\n          });\n        }\n\n        return activate$${id}(params$${id}, new ctor$${id}(resolvedValue$${id}));\n      };`);\n    return buildResolveNode(node, implementationType, resolveActivations, isPromise);\n}\n//# sourceMappingURL=buildOneConstructorArgumentResolverJit.js.map","import { isPromise } from '@inversifyjs/common';\nimport { getGeneratedResolverId } from './getGeneratedResolverId.js';\n/**\n * Same rationale as buildOneConstructorArgumentResolverJit, but\n * for zero-argument instance bindings with one property.\n */\nexport function buildOnePropertyArgumentResolverJit(node, implementationType, resolveActivations) {\n    const id = getGeneratedResolverId().toString();\n    if (resolveActivations === undefined) {\n        const buildResolveNode = new Function(`node$${id}`, `ctor$${id}`, `isPromise$${id}`, `return function resolveNode$${id}(params$${id}) {\n        const propertyEntry$${id} = node$${id}.propertyParams.entries().next().value;\n        const propertyKey$${id} = propertyEntry$${id}[0];\n        const instance$${id} = new ctor$${id}();\n\n        if (propertyEntry$${id}[1].bindings === undefined) {\n          return instance$${id};\n        }\n\n        const resolvedValue$${id} = propertyEntry$${id}[1].resolve(params$${id});\n\n        if (isPromise$${id}(resolvedValue$${id})) {\n          return resolvedValue$${id}.then(function (resolvedValue$${id}) {\n            instance$${id}[propertyKey$${id}] = resolvedValue$${id};\n            return instance$${id};\n          });\n        }\n\n        instance$${id}[propertyKey$${id}] = resolvedValue$${id};\n        return instance$${id};\n      };`);\n        return buildResolveNode(node, implementationType, isPromise);\n    }\n    const buildResolveNode = new Function(`node$${id}`, `ctor$${id}`, `activate$${id}`, `isPromise$${id}`, `return function resolveNode$${id}(params$${id}) {\n        const propertyEntry$${id} = node$${id}.propertyParams.entries().next().value;\n        const propertyKey$${id} = propertyEntry$${id}[0];\n        const instance$${id} = new ctor$${id}();\n\n        if (propertyEntry$${id}[1].bindings === undefined) {\n          return activate$${id}(params$${id}, instance$${id});\n        }\n\n        const resolvedValue$${id} = propertyEntry$${id}[1].resolve(params$${id});\n\n        if (isPromise$${id}(resolvedValue$${id})) {\n          return resolvedValue$${id}.then(function (resolvedValue$${id}) {\n            instance$${id}[propertyKey$${id}] = resolvedValue$${id};\n            return activate$${id}(params$${id}, instance$${id});\n          });\n        }\n\n        instance$${id}[propertyKey$${id}] = resolvedValue$${id};\n        return activate$${id}(params$${id}, instance$${id});\n      };`);\n    return buildResolveNode(node, implementationType, resolveActivations, isPromise);\n}\n//# sourceMappingURL=buildOnePropertyArgumentResolverJit.js.map","import { isPromise } from '@inversifyjs/common';\nimport { getGeneratedResolverId } from './getGeneratedResolverId.js';\nexport function buildResolveMany(node) {\n    const id = getGeneratedResolverId().toString();\n    const argumentsCount = node.classMetadata.constructorArguments.length +\n        node.classMetadata.properties.size;\n    const argumentIndexes = Array.from({ length: argumentsCount }, (_, index) => index);\n    const valueConcatenation = argumentIndexes\n        .map((index) => `value$${index.toString()}`)\n        .join(', ');\n    const resolvedValueConcatenation = argumentIndexes\n        .map((index) => `resolvedValue$${index.toString()}`)\n        .join(', ');\n    const parametersConcatenation = [valueConcatenation, `build$${id}`]\n        .filter((value) => value.length > 0)\n        .join(', ');\n    const isPromiseChecks = argumentIndexes\n        .map((index) => `isPromise$${id}(value$${index.toString()})`)\n        .join(' || ') || 'false';\n    const buildResolveManyFunction = new Function(`isPromise$${id}`, `return function resolveMany$${id}(${parametersConcatenation}) {\n  if (${isPromiseChecks}) {\n    return Promise.all([${valueConcatenation}]).then(\n      function ([${resolvedValueConcatenation}]) {\n        return build$${id}(${resolvedValueConcatenation});\n      },\n    );\n  }\n\n  return build$${id}(${valueConcatenation});\n};`);\n    return buildResolveManyFunction(isPromise);\n}\n//# sourceMappingURL=buildResolveMany.js.map","import { getGeneratedResolverId } from './getGeneratedResolverId.js';\n/**\n * Builds a `resolveNode` for a zero-argument instance binding by generating\n * a brand new function via the `Function` constructor for every binding.\n *\n * This is not just an inlining trick: the `Function` constructor result is\n * cached by V8 keyed on the *exact source text* passed to it. If every\n * binding generated the exact same source text (e.g. always naming the\n * constructor parameter `ctor`), V8 would transparently reuse the very same\n * compiled function (and its feedback vector) for every binding sharing\n * this code path. Since that single shared `new ctor()` call site would\n * then observe a different class on every binding, its type feedback would\n * become polymorphic/megamorphic across all of them, defeating the purpose\n * of generating specialized code and forcing V8 back to the generic,\n * non-inlined construction path.\n *\n * Suffixing every identifier with a per-binding id keeps the source text\n * (and therefore the compiled function and its feedback) unique per\n * binding, so the `new ctor()` call site stays monomorphic and V8 can\n * inline/optimize it as if it had been hand-written for that one class.\n */\nexport function buildZeroConstructorArgumentsResolverJit(implementationType, resolveActivations) {\n    const id = getGeneratedResolverId().toString();\n    if (resolveActivations === undefined) {\n        const buildResolveNode = \n        // eslint-disable-next-line @typescript-eslint/no-implied-eval\n        new Function(`ctor$${id}`, `return function resolveNode$${id}(params$${id}) {\n        return new ctor$${id}();\n      };`);\n        return buildResolveNode(implementationType);\n    }\n    const buildResolveNode = \n    // eslint-disable-next-line @typescript-eslint/no-implied-eval\n    new Function(`ctor$${id}`, `activate$${id}`, `return function resolveNode$${id}(params$${id}) {\n        return activate$${id}(params$${id}, new ctor$${id}());\n      };`);\n    return buildResolveNode(implementationType, resolveActivations);\n}\n//# sourceMappingURL=buildZeroConstructorArgumentsResolverJit.js.map","import { resolveScopedWithNoActivations } from '../../resolution/actions/resolveScopedWithNoActivations.js';\nimport { resolveServiceActivations } from '../../resolution/actions/resolveServiceActivations.js';\nimport { buildConstructorArgumentsResolverJit } from './buildConstructorArgumentsResolverJit.js';\nimport { buildOneConstructorArgumentResolverJit } from './buildOneConstructorArgumentResolverJit.js';\nimport { buildOnePropertyArgumentResolverJit } from './buildOnePropertyArgumentResolverJit.js';\nimport { buildResolveMany } from './buildResolveMany.js';\nimport { buildZeroConstructorArgumentsResolverJit } from './buildZeroConstructorArgumentsResolverJit.js';\nimport { resolveFour } from './resolveFour.js';\nimport { resolveThree } from './resolveThree.js';\nimport { resolveTwo } from './resolveTwo.js';\nconst ZERO_CONSTRUCTOR_ARGUMENTS = 0;\nconst ONE_CONSTRUCTOR_ARGUMENT = 1;\nconst TWO_CONSTRUCTOR_ARGUMENTS = 2;\nconst THREE_CONSTRUCTOR_ARGUMENTS = 3;\nconst FOUR_CONSTRUCTOR_ARGUMENTS = 4;\n/**\n * Builds a resolver for instance binding nodes with\n * no post construct methods and no binding activation.\n *\n * The resolution logic is inlined in a single closure to minimize function\n * call dispatch overhead: this is the hottest resolution path. Common small\n * constructor arities are specialized to avoid constructor values array\n * allocations and spread construct calls.\n */\nexport function buildNoActivationsInstanceBindingNodeResolverJit(node, areServiceActivations) {\n    const implementationType = node.binding.implementationType;\n    const serviceIdentifier = node.binding.serviceIdentifier;\n    const resolveActivations = areServiceActivations\n        ? resolveServiceActivations(serviceIdentifier)\n        : undefined;\n    let resolveNode;\n    switch (node.classMetadata.constructorArguments.length +\n        node.classMetadata.properties.size) {\n        case ZERO_CONSTRUCTOR_ARGUMENTS:\n            resolveNode = buildZeroConstructorArgumentsResolverJit(implementationType, resolveActivations);\n            break;\n        case ONE_CONSTRUCTOR_ARGUMENT:\n            resolveNode =\n                node.classMetadata.properties.size === 0\n                    ? buildOneConstructorArgumentResolverJit(node, implementationType, resolveActivations)\n                    : buildOnePropertyArgumentResolverJit(node, implementationType, resolveActivations);\n            break;\n        case TWO_CONSTRUCTOR_ARGUMENTS:\n            resolveNode = buildConstructorArgumentsResolverJit(node, implementationType, resolveTwo, resolveActivations);\n            break;\n        case THREE_CONSTRUCTOR_ARGUMENTS:\n            resolveNode = buildConstructorArgumentsResolverJit(node, implementationType, resolveThree, resolveActivations);\n            break;\n        case FOUR_CONSTRUCTOR_ARGUMENTS:\n            resolveNode = buildConstructorArgumentsResolverJit(node, implementationType, resolveFour, resolveActivations);\n            break;\n        default:\n            resolveNode = buildConstructorArgumentsResolverJit(node, implementationType, buildResolveMany(node), resolveActivations);\n    }\n    return resolveScopedWithNoActivations(node.binding, resolveNode);\n}\n//# sourceMappingURL=buildNoActivationsInstanceBindingNodeResolverJit.js.map","import { bindingScopeValues } from '../../binding/models/BindingScope.js';\nimport { resolveInstanceBindingConstructorParams } from '../../resolution/actions/resolveInstanceBindingConstructorParams.js';\nimport { resolveInstanceBindingNode as curryResolveInstanceBindingNode } from '../../resolution/actions/resolveInstanceBindingNode.js';\nimport { resolveInstanceBindingNodeAsyncFromConstructorParams } from '../../resolution/actions/resolveInstanceBindingNodeAsyncFromConstructorParams.js';\nimport { resolveInstanceBindingNodeFromConstructorParams } from '../../resolution/actions/resolveInstanceBindingNodeFromConstructorParams.js';\nimport { resolveScoped } from '../../resolution/actions/resolveScoped.js';\nimport { buildNoActivationsInstanceBindingNodeResolver } from '../calculations/buildNoActivationsInstanceBindingNodeResolver.js';\nimport { buildNoActivationsInstanceBindingNodeResolverJit } from '../calculations/buildNoActivationsInstanceBindingNodeResolverJit.js';\nimport { isDynamicallyResolvableBindingNodeSymbol, } from './DynamicallyResolvableBindingNode.js';\nconst resolveInstanceBindingNode = curryResolveInstanceBindingNode(resolveInstanceBindingConstructorParams, resolveInstanceBindingNodeAsyncFromConstructorParams, resolveInstanceBindingNodeFromConstructorParams);\nconst resolveScopedInstanceBindingNode = (node) => resolveScoped(node, resolveInstanceBindingNode);\nexport class InstanceBindingNodeImplementation {\n    binding;\n    classMetadata;\n    [isDynamicallyResolvableBindingNodeSymbol];\n    constructorParams;\n    propertyParams;\n    resolve;\n    #jitEnabled;\n    #onResolverChangedHandlers;\n    constructor(binding, classMetadata, params) {\n        this.binding = binding;\n        this.classMetadata = classMetadata;\n        this[isDynamicallyResolvableBindingNodeSymbol] = true;\n        this.constructorParams = [];\n        this.propertyParams = new Map();\n        this.#jitEnabled = params.jitEnabled;\n        const areServiceActivations = params.operations.getActivations(binding.serviceIdentifier) !== undefined;\n        this.#onResolverChangedHandlers = undefined;\n        this.resolve = this.#buildInstanceBindingNodeResolver(areServiceActivations);\n        if (!areServiceActivations &&\n            this.#areNoBindingActivationsNorPostConstructsDefined()) {\n            params.operations.subscribeActivationAddedOnce(binding.serviceIdentifier, this);\n        }\n    }\n    onActivationAdded() {\n        this.resolve = this.#buildInstanceBindingNodeResolver(true);\n        if (this.#onResolverChangedHandlers !== undefined) {\n            for (const handler of this.#onResolverChangedHandlers) {\n                handler(this.resolve);\n            }\n        }\n    }\n    addOnResolverChangedHandler(callback) {\n        if (this.#onResolverChangedHandlers === undefined) {\n            this.#onResolverChangedHandlers = [];\n        }\n        this.#onResolverChangedHandlers.push(callback);\n    }\n    #buildInstanceBindingNodeResolver(areServiceActivations) {\n        if (this.#areNoBindingActivationsNorPostConstructsDefined()) {\n            if (this.#jitEnabled &&\n                this.binding.scope !== bindingScopeValues.Singleton) {\n                return buildNoActivationsInstanceBindingNodeResolverJit(this, areServiceActivations);\n            }\n            else {\n                return buildNoActivationsInstanceBindingNodeResolver(this, areServiceActivations);\n            }\n        }\n        return resolveScopedInstanceBindingNode(this);\n    }\n    #areNoBindingActivationsNorPostConstructsDefined() {\n        return (this.classMetadata.lifecycle.postConstructMethodNames.size === 0 &&\n            this.binding.onActivation === undefined);\n    }\n}\n//# sourceMappingURL=InstanceBindingNodeImplementation.js.map","import { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nexport class PlanServiceRedirectionBindingNodeImplementation {\n    binding;\n    #redirection;\n    #resolve;\n    constructor(binding) {\n        this.binding = binding;\n        this.#redirection = undefined;\n        this.#resolve = undefined;\n    }\n    get redirection() {\n        return this.#redirection;\n    }\n    set redirection(value) {\n        this.#redirection = value;\n        if (value.bindings === undefined) {\n            this.#resolve = () => undefined;\n        }\n        else {\n            if (Array.isArray(value.bindings)) {\n                this.#resolve = () => {\n                    throw new InversifyCoreError(InversifyCoreErrorKind.planning, 'Unexpected resolver call for multiple bindings redirection');\n                };\n            }\n            else {\n                this.#resolve = (params) => \n                // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n                value.bindings.resolve(params);\n            }\n        }\n    }\n    resolve(params) {\n        return this.#resolve(params);\n    }\n}\n//# sourceMappingURL=PlanServiceRedirectionBindingNodeImplementation.js.map","import { isPromise } from '@inversifyjs/common';\nexport function resolveResolvedValueBindingParams(params, node) {\n    const paramsResolvedValues = [];\n    let promiseValueFound = false;\n    for (const param of node.params) {\n        const resolvedValue = param.resolve(params);\n        if (!promiseValueFound && isPromise(resolvedValue)) {\n            promiseValueFound = true;\n        }\n        paramsResolvedValues.push(resolvedValue);\n    }\n    return promiseValueFound\n        ? Promise.all(paramsResolvedValues)\n        : paramsResolvedValues;\n}\n//# sourceMappingURL=resolveResolvedValueBindingParams.js.map","import { isPromise } from '@inversifyjs/common';\nimport { resolveResolvedValueBindingParams } from './resolveResolvedValueBindingParams.js';\nexport function resolveResolvedValueBindingNode(params, node) {\n    const paramValues = \n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    resolveResolvedValueBindingParams(params, node);\n    if (isPromise(paramValues)) {\n        return paramValues.then((resolvedParamValues) => node.binding.factory(...resolvedParamValues));\n    }\n    return node.binding.factory(...paramValues);\n}\n//# sourceMappingURL=resolveResolvedValueBindingNode.js.map","import { resolveFour } from './resolveFour.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * four-argument resolved value bindings. Equivalent to\n * `buildResolvedValueArgumentsResolverJit` with `resolveFour`, but implemented\n * with a plain closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n */\nexport function buildFourResolvedValueArgumentResolver(node, resolveActivations) {\n    if (resolveActivations === undefined) {\n        return function resolveNode(params) {\n            const resolvedValue0 = node.params[0].resolve(params);\n            const resolvedValue1 = node.params[1].resolve(params);\n            const resolvedValue2 = node.params[2].resolve(params);\n            const resolvedValue3 = node.params[3].resolve(params);\n            return resolveFour(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3, (resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3) => node.binding.factory(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3));\n        };\n    }\n    return function resolveNode(params) {\n        const resolvedValue0 = node.params[0].resolve(params);\n        const resolvedValue1 = node.params[1].resolve(params);\n        const resolvedValue2 = node.params[2].resolve(params);\n        const resolvedValue3 = node.params[3].resolve(params);\n        return resolveFour(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3, (resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3) => resolveActivations(params, node.binding.factory(resolvedValue0, resolvedValue1, resolvedValue2, resolvedValue3)));\n    };\n}\n//# sourceMappingURL=buildFourResolvedValueArgumentResolver.js.map","import { isPromise } from '@inversifyjs/common';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * one-argument resolved value bindings. Equivalent to\n * `buildOneResolvedValueArgumentResolverJit`, but implemented with a plain\n * closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n */\nexport function buildOneResolvedValueArgumentResolver(node, resolveActivations) {\n    if (resolveActivations === undefined) {\n        return function resolveNode(params) {\n            const resolvedValue = node.params[0].resolve(params);\n            if (isPromise(resolvedValue)) {\n                return resolvedValue.then((resolvedValue) => node.binding.factory(resolvedValue));\n            }\n            return node.binding.factory(resolvedValue);\n        };\n    }\n    return function resolveNode(params) {\n        const resolvedValue = node.params[0].resolve(params);\n        if (isPromise(resolvedValue)) {\n            return resolvedValue.then((resolvedValue) => resolveActivations(params, node.binding.factory(resolvedValue)));\n        }\n        return resolveActivations(params, node.binding.factory(resolvedValue));\n    };\n}\n//# sourceMappingURL=buildOneResolvedValueArgumentResolver.js.map","import { resolveThree } from './resolveThree.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * three-argument resolved value bindings. Equivalent to\n * `buildResolvedValueArgumentsResolverJit` with `resolveThree`, but implemented\n * with a plain closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n */\nexport function buildThreeResolvedValueArgumentResolver(node, resolveActivations) {\n    if (resolveActivations === undefined) {\n        return function resolveNode(params) {\n            const resolvedValue0 = node.params[0].resolve(params);\n            const resolvedValue1 = node.params[1].resolve(params);\n            const resolvedValue2 = node.params[2].resolve(params);\n            return resolveThree(resolvedValue0, resolvedValue1, resolvedValue2, (resolvedValue0, resolvedValue1, resolvedValue2) => node.binding.factory(resolvedValue0, resolvedValue1, resolvedValue2));\n        };\n    }\n    return function resolveNode(params) {\n        const resolvedValue0 = node.params[0].resolve(params);\n        const resolvedValue1 = node.params[1].resolve(params);\n        const resolvedValue2 = node.params[2].resolve(params);\n        return resolveThree(resolvedValue0, resolvedValue1, resolvedValue2, (resolvedValue0, resolvedValue1, resolvedValue2) => resolveActivations(params, node.binding.factory(resolvedValue0, resolvedValue1, resolvedValue2)));\n    };\n}\n//# sourceMappingURL=buildThreeResolvedValueArgumentResolver.js.map","import { resolveTwo } from './resolveTwo.js';\n/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * two-argument resolved value bindings. Equivalent to\n * `buildResolvedValueArgumentsResolverJit` with `resolveTwo`, but implemented\n * with a plain closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n */\nexport function buildTwoResolvedValueArgumentResolver(node, resolveActivations) {\n    if (resolveActivations === undefined) {\n        return function resolveNode(params) {\n            const resolvedValue0 = node.params[0].resolve(params);\n            const resolvedValue1 = node.params[1].resolve(params);\n            return resolveTwo(resolvedValue0, resolvedValue1, (resolvedValue0, resolvedValue1) => node.binding.factory(resolvedValue0, resolvedValue1));\n        };\n    }\n    return function resolveNode(params) {\n        const resolvedValue0 = node.params[0].resolve(params);\n        const resolvedValue1 = node.params[1].resolve(params);\n        return resolveTwo(resolvedValue0, resolvedValue1, (resolvedValue0, resolvedValue1) => resolveActivations(params, node.binding.factory(resolvedValue0, resolvedValue1)));\n    };\n}\n//# sourceMappingURL=buildTwoResolvedValueArgumentResolver.js.map","/**\n * Same rationale as buildZeroConstructorArgumentsResolver, but for\n * zero-argument resolved value bindings. Equivalent to\n * `buildZeroResolvedValueArgumentsResolverJit`, but implemented with a plain\n * closure instead of the `Function` constructor, so it works in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n */\nexport function buildZeroResolvedValueArgumentsResolver(node, resolveActivations) {\n    if (resolveActivations === undefined) {\n        return function resolveNode(_params) {\n            return node.binding.factory();\n        };\n    }\n    return function resolveNode(params) {\n        return resolveActivations(params, node.binding.factory());\n    };\n}\n//# sourceMappingURL=buildZeroResolvedValueArgumentsResolver.js.map","import { resolveResolvedValueBindingNode } from '../../resolution/actions/resolveResolvedValueBindingNode.js';\nimport { resolveScopedWithNoActivations } from '../../resolution/actions/resolveScopedWithNoActivations.js';\nimport { resolveServiceActivations } from '../../resolution/actions/resolveServiceActivations.js';\nimport { buildFourResolvedValueArgumentResolver } from './buildFourResolvedValueArgumentResolver.js';\nimport { buildOneResolvedValueArgumentResolver } from './buildOneResolvedValueArgumentResolver.js';\nimport { buildThreeResolvedValueArgumentResolver } from './buildThreeResolvedValueArgumentResolver.js';\nimport { buildTwoResolvedValueArgumentResolver } from './buildTwoResolvedValueArgumentResolver.js';\nimport { buildZeroResolvedValueArgumentsResolver } from './buildZeroResolvedValueArgumentsResolver.js';\nconst ZERO_PARAMS = 0;\nconst ONE_PARAM = 1;\nconst TWO_PARAMS = 2;\nconst THREE_PARAMS = 3;\nconst FOUR_PARAMS = 4;\n/**\n * Builds a resolver for resolved value binding nodes with no binding\n * activation.\n *\n * Unlike the JIT path, specialized CSP resolvers are implemented with plain\n * closures instead of the `Function` constructor, so they work in\n * environments enforcing a strict Content Security Policy (no\n * `unsafe-eval`).\n */\nexport function buildNoActivationsResolvedValueBindingNodeResolver(node, areServiceActivations) {\n    const serviceIdentifier = node.binding.serviceIdentifier;\n    const resolveActivations = areServiceActivations\n        ? resolveServiceActivations(serviceIdentifier)\n        : undefined;\n    let resolveNode;\n    switch (node.binding.metadata.arguments.length) {\n        case ZERO_PARAMS:\n            resolveNode = buildZeroResolvedValueArgumentsResolver(node, resolveActivations);\n            break;\n        case ONE_PARAM:\n            resolveNode = buildOneResolvedValueArgumentResolver(node, resolveActivations);\n            break;\n        case TWO_PARAMS:\n            resolveNode = buildTwoResolvedValueArgumentResolver(node, resolveActivations);\n            break;\n        case THREE_PARAMS:\n            resolveNode = buildThreeResolvedValueArgumentResolver(node, resolveActivations);\n            break;\n        case FOUR_PARAMS:\n            resolveNode = buildFourResolvedValueArgumentResolver(node, resolveActivations);\n            break;\n        default:\n            resolveNode =\n                resolveActivations === undefined\n                    ? (params) => resolveResolvedValueBindingNode(params, node)\n                    : (params) => resolveActivations(params, resolveResolvedValueBindingNode(params, node));\n    }\n    return resolveScopedWithNoActivations(node.binding, resolveNode);\n}\n//# sourceMappingURL=buildNoActivationsResolvedValueBindingNodeResolver.js.map","import { isPromise } from '@inversifyjs/common';\nimport { getGeneratedResolverId } from './getGeneratedResolverId.js';\nexport function buildOneResolvedValueArgumentResolverJit(node, resolveActivations) {\n    const id = getGeneratedResolverId().toString();\n    if (resolveActivations === undefined) {\n        const buildResolveNode = new Function(`node$${id}`, `isPromise$${id}`, `return function resolveNode$${id}(params$${id}) {\n      const resolvedValue$${id} = node$${id}.params[0].resolve(params$${id});\n\n      if (isPromise$${id}(resolvedValue$${id})) {\n        return resolvedValue$${id}.then(function (resolvedValue$${id}) {\n          return node$${id}.binding.factory(resolvedValue$${id});\n        });\n      }\n\n      return node$${id}.binding.factory(resolvedValue$${id});\n    };`);\n        return buildResolveNode(node, isPromise);\n    }\n    const buildResolveNode = new Function(`node$${id}`, `activate$${id}`, `isPromise$${id}`, `return function resolveNode$${id}(params$${id}) {\n      const resolvedValue$${id} = node$${id}.params[0].resolve(params$${id});\n\n      if (isPromise$${id}(resolvedValue$${id})) {\n        return resolvedValue$${id}.then(function (resolvedValue$${id}) {\n          return activate$${id}(params$${id}, node$${id}.binding.factory(resolvedValue$${id}));\n        });\n      }\n\n      return activate$${id}(params$${id}, node$${id}.binding.factory(resolvedValue$${id}));\n    };`);\n    return buildResolveNode(node, resolveActivations, isPromise);\n}\n//# sourceMappingURL=buildOneResolvedValueArgumentResolverJit.js.map","import { getGeneratedResolverId } from './getGeneratedResolverId.js';\nexport function buildResolvedValueArgumentsResolverJit(node, \n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nresolveAsyncValues, resolveActivations) {\n    const id = getGeneratedResolverId().toString();\n    const argumentIndexes = Array.from({ length: node.binding.metadata.arguments.length }, (_, index) => index);\n    const resolvedValueConcatenation = argumentIndexes\n        .map((index) => `value$${index.toString()}`)\n        .join(', ');\n    let resolvedValueDeclarations = '';\n    for (const index of argumentIndexes) {\n        resolvedValueDeclarations += `const value$${index.toString()} = node$${id}.params[${index.toString()}].resolve(params$${id});\\n`;\n    }\n    if (resolveActivations === undefined) {\n        const buildResolveNode = new Function(`node$${id}`, `resolveAsyncValues$${id}`, `return function resolveNode$${id}(params$${id}) {\n  ${resolvedValueDeclarations}\n\n  return resolveAsyncValues$${id}(\n    ${resolvedValueConcatenation},\n    function (${resolvedValueConcatenation}) {\n      return node$${id}.binding.factory(${resolvedValueConcatenation});\n    },\n  );\n}`);\n        return buildResolveNode(node, resolveAsyncValues);\n    }\n    const buildResolveNode = new Function(`node$${id}`, `activate$${id}`, `resolveAsyncValues$${id}`, `return function resolveNode$${id}(params$${id}) {\n  ${resolvedValueDeclarations}\n\n  return resolveAsyncValues$${id}(\n    ${resolvedValueConcatenation},\n    function (${resolvedValueConcatenation}) {\n      return activate$${id}(\n        params$${id},\n        node$${id}.binding.factory(${resolvedValueConcatenation}),\n      );\n    },\n  );\n}`);\n    return buildResolveNode(node, resolveActivations, resolveAsyncValues);\n}\n//# sourceMappingURL=buildResolvedValueArgumentsResolverJit.js.map","import { getGeneratedResolverId } from './getGeneratedResolverId.js';\nexport function buildZeroResolvedValueArgumentsResolverJit(node, resolveActivations) {\n    const id = getGeneratedResolverId().toString();\n    if (resolveActivations === undefined) {\n        const buildResolveNode = new Function(`node$${id}`, `return function resolveNode$${id}(params$${id}) {\n      return node$${id}.binding.factory();\n    };`);\n        return buildResolveNode(node);\n    }\n    const buildResolveNode = new Function(`node$${id}`, `activate$${id}`, `return function resolveNode$${id}(params$${id}) {\n      return activate$${id}(params$${id}, node$${id}.binding.factory());\n    };`);\n    return buildResolveNode(node, resolveActivations);\n}\n//# sourceMappingURL=buildZeroResolvedValueArgumentsResolverJit.js.map","import { resolveScopedWithNoActivations } from '../../resolution/actions/resolveScopedWithNoActivations.js';\nimport { resolveServiceActivations } from '../../resolution/actions/resolveServiceActivations.js';\nimport { buildOneResolvedValueArgumentResolverJit } from './buildOneResolvedValueArgumentResolverJit.js';\nimport { buildResolvedValueArgumentsResolverJit } from './buildResolvedValueArgumentsResolverJit.js';\nimport { buildZeroResolvedValueArgumentsResolverJit } from './buildZeroResolvedValueArgumentsResolverJit.js';\nimport { resolveFour } from './resolveFour.js';\nimport { resolveMany } from './resolveMany.js';\nimport { resolveThree } from './resolveThree.js';\nimport { resolveTwo } from './resolveTwo.js';\nconst ZERO_PARAMS = 0;\nconst ONE_PARAM = 1;\nconst TWO_PARAMS = 2;\nconst THREE_PARAMS = 3;\nconst FOUR_PARAMS = 4;\n/**\n * Builds a resolver for resolved value binding nodes with no binding\n * activation.\n *\n * The resolution logic is specialized by argument arity to minimize function\n * call dispatch overhead on the hottest resolution path.\n */\nexport function buildNoActivationsResolvedValueBindingNodeResolverJit(node, areServiceActivations) {\n    const serviceIdentifier = node.binding.serviceIdentifier;\n    const resolveActivations = areServiceActivations\n        ? resolveServiceActivations(serviceIdentifier)\n        : undefined;\n    let resolveNode;\n    switch (node.binding.metadata.arguments.length) {\n        case ZERO_PARAMS:\n            resolveNode = buildZeroResolvedValueArgumentsResolverJit(node, resolveActivations);\n            break;\n        case ONE_PARAM:\n            resolveNode = buildOneResolvedValueArgumentResolverJit(node, resolveActivations);\n            break;\n        case TWO_PARAMS:\n            resolveNode = buildResolvedValueArgumentsResolverJit(node, resolveTwo, resolveActivations);\n            break;\n        case THREE_PARAMS:\n            resolveNode = buildResolvedValueArgumentsResolverJit(node, resolveThree, resolveActivations);\n            break;\n        case FOUR_PARAMS:\n            resolveNode = buildResolvedValueArgumentsResolverJit(node, resolveFour, resolveActivations);\n            break;\n        default:\n            resolveNode = buildResolvedValueArgumentsResolverJit(node, resolveMany, resolveActivations);\n    }\n    return resolveScopedWithNoActivations(node.binding, resolveNode);\n}\n//# sourceMappingURL=buildNoActivationsResolvedValueBindingNodeResolverJit.js.map","import { bindingScopeValues } from '../../binding/models/BindingScope.js';\nimport { resolveResolvedValueBindingNode } from '../../resolution/actions/resolveResolvedValueBindingNode.js';\nimport { resolveScoped } from '../../resolution/actions/resolveScoped.js';\nimport { buildNoActivationsResolvedValueBindingNodeResolver } from '../calculations/buildNoActivationsResolvedValueBindingNodeResolver.js';\nimport { buildNoActivationsResolvedValueBindingNodeResolverJit } from '../calculations/buildNoActivationsResolvedValueBindingNodeResolverJit.js';\nimport { isDynamicallyResolvableBindingNodeSymbol, } from './DynamicallyResolvableBindingNode.js';\nconst resolveScopedResolvedValueBindingNode = (node) => resolveScoped(node, resolveResolvedValueBindingNode);\nexport class ResolvedValueBindingNodeImplementation {\n    binding;\n    [isDynamicallyResolvableBindingNodeSymbol];\n    params;\n    resolve;\n    #jitEnabled;\n    #onResolverChangedHandlers;\n    constructor(binding, params) {\n        this.binding = binding;\n        this[isDynamicallyResolvableBindingNodeSymbol] = true;\n        this.params = [];\n        this.#jitEnabled = params.jitEnabled;\n        const areServiceActivations = params.operations.getActivations(binding.serviceIdentifier) !== undefined;\n        this.#onResolverChangedHandlers = undefined;\n        this.resolve = this.#buildResolvedValueBindingNodeResolver(areServiceActivations);\n        if (!areServiceActivations && this.#areNoBindingActivationsDefined()) {\n            params.operations.subscribeActivationAddedOnce(binding.serviceIdentifier, this);\n        }\n    }\n    onActivationAdded() {\n        this.resolve = this.#buildResolvedValueBindingNodeResolver(true);\n        if (this.#onResolverChangedHandlers !== undefined) {\n            for (const handler of this.#onResolverChangedHandlers) {\n                handler(this.resolve);\n            }\n        }\n    }\n    addOnResolverChangedHandler(callback) {\n        if (this.#onResolverChangedHandlers === undefined) {\n            this.#onResolverChangedHandlers = [];\n        }\n        this.#onResolverChangedHandlers.push(callback);\n    }\n    #buildResolvedValueBindingNodeResolver(areServiceActivations) {\n        if (this.#areNoBindingActivationsDefined()) {\n            if (this.#jitEnabled &&\n                this.binding.scope !== bindingScopeValues.Singleton) {\n                return buildNoActivationsResolvedValueBindingNodeResolverJit(this, areServiceActivations);\n            }\n            else {\n                return buildNoActivationsResolvedValueBindingNodeResolver(this, areServiceActivations);\n            }\n        }\n        return resolveScopedResolvedValueBindingNode(this);\n    }\n    #areNoBindingActivationsDefined() {\n        return this.binding.onActivation === undefined;\n    }\n}\n//# sourceMappingURL=ResolvedValueBindingNodeImplementation.js.map","import { bindingTypeValues, } from '../../binding/models/BindingType.js';\nimport { isPlanServiceRedirectionBindingNode } from '../calculations/isPlanServiceRedirectionBindingNode.js';\nimport { ConstantValueBindingNode } from '../models/ConstantValueBindingNode.js';\nimport { DynamicValueBindingNode } from '../models/DynamicValueBindingNode.js';\nimport { FactoryBindingNodeImplementation } from '../models/FactoryBindingNodeImplementation.js';\nimport { InstanceBindingNodeImplementation } from '../models/InstanceBindingNodeImplementation.js';\nimport { PlanServiceRedirectionBindingNodeImplementation } from '../models/PlanServiceRedirectionBindingNodeImplementation.js';\nimport { ResolvedValueBindingNodeImplementation } from '../models/ResolvedValueBindingNodeImplementation.js';\nexport function curryBuildServiceNodeBindings(subplan) {\n    const buildInstancePlanBindingNode = curryBuildInstancePlanBindingNode(subplan);\n    const buildResolvedValuePlanBindingNode = curryBuildResolvedValuePlanBindingNode(subplan);\n    const buildServiceNodeBindings = (params, bindingConstraintsList, serviceBindings, parentNode, buildServiceNodeOptions) => {\n        const serviceIdentifier = isPlanServiceRedirectionBindingNode(parentNode)\n            ? parentNode.binding.targetServiceIdentifier\n            : parentNode.serviceIdentifier;\n        params.servicesBranch.push(serviceIdentifier);\n        const planBindingNodes = [];\n        for (const binding of serviceBindings) {\n            if (binding.type === bindingTypeValues.Factory) {\n                planBindingNodes.push(new FactoryBindingNodeImplementation(binding));\n                continue;\n            }\n            switch (binding.type) {\n                case bindingTypeValues.ConstantValue: {\n                    planBindingNodes.push(new ConstantValueBindingNode(binding));\n                    break;\n                }\n                case bindingTypeValues.DynamicValue: {\n                    planBindingNodes.push(new DynamicValueBindingNode(binding, params));\n                    break;\n                }\n                case bindingTypeValues.Instance: {\n                    planBindingNodes.push(buildInstancePlanBindingNode(params, binding, bindingConstraintsList));\n                    break;\n                }\n                case bindingTypeValues.ResolvedValue: {\n                    planBindingNodes.push(buildResolvedValuePlanBindingNode(params, binding, bindingConstraintsList));\n                    break;\n                }\n                case bindingTypeValues.ServiceRedirection: {\n                    const planBindingNode = buildServiceRedirectionPlanBindingNode(params, bindingConstraintsList, binding, buildServiceNodeOptions);\n                    planBindingNodes.push(planBindingNode);\n                    break;\n                }\n            }\n        }\n        params.servicesBranch.pop();\n        return planBindingNodes;\n    };\n    const buildServiceRedirectionPlanBindingNode = curryBuildServiceRedirectionPlanBindingNode(subplan);\n    return buildServiceNodeBindings;\n}\nfunction curryBuildInstancePlanBindingNode(subplan) {\n    return (params, binding, bindingConstraintsList) => {\n        const classMetadata = params.operations.getClassMetadata(binding.implementationType);\n        const childNode = new InstanceBindingNodeImplementation(binding, classMetadata, params);\n        const subplanParams = {\n            autobindOptions: params.autobindOptions,\n            jitEnabled: params.jitEnabled,\n            node: childNode,\n            operations: params.operations,\n            servicesBranch: params.servicesBranch,\n        };\n        return subplan(subplanParams, bindingConstraintsList);\n    };\n}\nfunction curryBuildResolvedValuePlanBindingNode(subplan) {\n    return (params, binding, bindingConstraintsList) => {\n        const childNode = new ResolvedValueBindingNodeImplementation(binding, params);\n        const subplanParams = {\n            autobindOptions: params.autobindOptions,\n            jitEnabled: params.jitEnabled,\n            node: childNode,\n            operations: params.operations,\n            servicesBranch: params.servicesBranch,\n        };\n        return subplan(subplanParams, bindingConstraintsList);\n    };\n}\nfunction curryBuildServiceRedirectionPlanBindingNode(subplan) {\n    return (params, bindingConstraintsList, binding, buildServiceNodeOptions) => {\n        const childNode = new PlanServiceRedirectionBindingNodeImplementation(binding);\n        const subplanParams = {\n            autobindOptions: params.autobindOptions,\n            buildServiceNodeOptions: {\n                ...buildServiceNodeOptions,\n                serviceIdentifier: binding.targetServiceIdentifier,\n            },\n            jitEnabled: params.jitEnabled,\n            node: childNode,\n            operations: params.operations,\n            servicesBranch: params.servicesBranch,\n        };\n        return subplan(subplanParams, bindingConstraintsList);\n    };\n}\n//# sourceMappingURL=curryBuildServiceNodeBindings.js.map","import { LazyServiceIdentifier, } from '@inversifyjs/common';\nimport { ClassElementMetadataKind } from '../../metadata/models/ClassElementMetadataKind.js';\nexport function buildBuildServiceNodeOptionsFromClassElementMetadata(elementMetadata) {\n    const serviceIdentifier = LazyServiceIdentifier.is(elementMetadata.value)\n        ? elementMetadata.value.unwrap()\n        : elementMetadata.value;\n    if (elementMetadata.kind === ClassElementMetadataKind.multipleInjection) {\n        return {\n            chained: elementMetadata.chained,\n            isMultiple: true,\n            name: elementMetadata.name,\n            optional: elementMetadata.optional,\n            serviceIdentifier,\n            tags: elementMetadata.tags,\n        };\n    }\n    return {\n        isMultiple: false,\n        name: elementMetadata.name,\n        optional: elementMetadata.optional,\n        serviceIdentifier,\n        tags: elementMetadata.tags,\n    };\n}\n//# sourceMappingURL=buildBuildServiceNodeOptionsFromClassElementMetadata.js.map","import { LazyServiceIdentifier, } from '@inversifyjs/common';\nimport { ResolvedValueElementMetadataKind } from '../../metadata/models/ResolvedValueElementMetadataKind.js';\nexport function buildBuildServiceNodeOptionsFromResolvedValueElementMetadata(elementMetadata) {\n    const serviceIdentifier = LazyServiceIdentifier.is(elementMetadata.value)\n        ? elementMetadata.value.unwrap()\n        : elementMetadata.value;\n    if (elementMetadata.kind === ResolvedValueElementMetadataKind.multipleInjection) {\n        return {\n            chained: elementMetadata.chained,\n            isMultiple: true,\n            name: elementMetadata.name,\n            optional: elementMetadata.optional,\n            serviceIdentifier,\n            tags: elementMetadata.tags,\n        };\n    }\n    return {\n        isMultiple: false,\n        name: elementMetadata.name,\n        optional: elementMetadata.optional,\n        serviceIdentifier,\n        tags: elementMetadata.tags,\n    };\n}\n//# sourceMappingURL=buildBuildServiceNodeOptionsFromResolvedValueElementMetadata.js.map","const CONSTRUCTOR_NO_PARAM_NODE = {\n    isNoParam: true,\n    resolve: () => undefined,\n};\nexport function buildConstructorNoParamNode() {\n    return CONSTRUCTOR_NO_PARAM_NODE;\n}\n//# sourceMappingURL=buildConstructorNoParamNode.js.map","import { bindingTypeValues } from '../../binding/models/BindingType.js';\nexport function isInstanceBindingNode(node) {\n    return node.binding.type === bindingTypeValues.Instance;\n}\n//# sourceMappingURL=isInstanceBindingNode.js.map","import { LazyServiceIdentifier, } from '@inversifyjs/common';\nexport function tryBuildGetPlanOptionsFromBuildServiceNodeOptions(options) {\n    let tag;\n    if (options.tags.size === 0) {\n        tag = undefined;\n    }\n    else if (options.tags.size === 1) {\n        const [key, value] = options.tags.entries().next()\n            .value;\n        tag = { key, value };\n    }\n    else {\n        return undefined;\n    }\n    const serviceIdentifier = LazyServiceIdentifier.is(options.serviceIdentifier)\n        ? options.serviceIdentifier.unwrap()\n        : options.serviceIdentifier;\n    if (options.isMultiple) {\n        return {\n            chained: options.chained,\n            isMultiple: true,\n            name: options.name,\n            optional: options.optional,\n            serviceIdentifier,\n            tag,\n        };\n    }\n    else {\n        return {\n            isMultiple: false,\n            name: options.name,\n            optional: options.optional,\n            serviceIdentifier,\n            tag,\n        };\n    }\n}\n//# sourceMappingURL=tryBuildGetPlanOptionsFromBuildServiceNodeOptions.js.map","import { LazyServiceIdentifier, } from '@inversifyjs/common';\nimport { ClassElementMetadataKind } from '../../metadata/models/ClassElementMetadataKind.js';\nexport function tryBuildGetPlanOptionsFromManagedClassElementMetadata(elementMetadata) {\n    let tag;\n    if (elementMetadata.tags.size === 0) {\n        tag = undefined;\n    }\n    else if (elementMetadata.tags.size === 1) {\n        const [key, value] = elementMetadata.tags\n            .entries()\n            .next().value;\n        tag = { key, value };\n    }\n    else {\n        return undefined;\n    }\n    const serviceIdentifier = LazyServiceIdentifier.is(elementMetadata.value)\n        ? elementMetadata.value.unwrap()\n        : elementMetadata.value;\n    if (elementMetadata.kind === ClassElementMetadataKind.multipleInjection) {\n        return {\n            chained: elementMetadata.chained,\n            isMultiple: true,\n            name: elementMetadata.name,\n            optional: elementMetadata.optional,\n            serviceIdentifier,\n            tag,\n        };\n    }\n    else {\n        return {\n            isMultiple: false,\n            name: elementMetadata.name,\n            optional: elementMetadata.optional,\n            serviceIdentifier,\n            tag,\n        };\n    }\n}\n//# sourceMappingURL=tryBuildGetPlanOptionsFromManagedClassElementMetadata.js.map","import { LazyServiceIdentifier, } from '@inversifyjs/common';\nimport { ResolvedValueElementMetadataKind } from '../../metadata/models/ResolvedValueElementMetadataKind.js';\nexport function tryBuildGetPlanOptionsFromResolvedValueElementMetadata(resolvedValueElementMetadata) {\n    let tag;\n    if (resolvedValueElementMetadata.tags.size === 0) {\n        tag = undefined;\n    }\n    else if (resolvedValueElementMetadata.tags.size === 1) {\n        const [key, value] = resolvedValueElementMetadata.tags.entries().next().value;\n        tag = { key, value };\n    }\n    else {\n        return undefined;\n    }\n    const serviceIdentifier = LazyServiceIdentifier.is(resolvedValueElementMetadata.value)\n        ? resolvedValueElementMetadata.value.unwrap()\n        : resolvedValueElementMetadata.value;\n    if (resolvedValueElementMetadata.kind ===\n        ResolvedValueElementMetadataKind.multipleInjection) {\n        return {\n            chained: resolvedValueElementMetadata.chained,\n            isMultiple: true,\n            name: resolvedValueElementMetadata.name,\n            optional: resolvedValueElementMetadata.optional,\n            serviceIdentifier,\n            tag,\n        };\n    }\n    else {\n        return {\n            isMultiple: false,\n            name: resolvedValueElementMetadata.name,\n            optional: resolvedValueElementMetadata.optional,\n            serviceIdentifier,\n            tag,\n        };\n    }\n}\n//# sourceMappingURL=tryBuildGetPlanOptionsFromResolvedValueElementMetadata.js.map","import { LazyPlanServiceNode } from '../models/LazyPlanServiceNode.js';\nexport function cacheNonRootPlanServiceNode(getPlanOptions, operations, planServiceNode, context) {\n    if (getPlanOptions !== undefined &&\n        ((LazyPlanServiceNode.is(planServiceNode) &&\n            !planServiceNode.isExpanded()) ||\n            planServiceNode.isContextFree)) {\n        const planResult = {\n            tree: {\n                root: planServiceNode,\n            },\n        };\n        operations.setPlan(getPlanOptions, planResult);\n    }\n    else {\n        operations.setNonCachedServiceNode(planServiceNode, context);\n    }\n}\n//# sourceMappingURL=cacheNonRootPlanServiceNode.js.map","import { buildBuildServiceNodeOptionsFromClassElementMetadata } from '../../common/calculations/buildBuildServiceNodeOptionsFromClassElementMetadata.js';\nimport { buildBuildServiceNodeOptionsFromResolvedValueElementMetadata } from '../../common/calculations/buildBuildServiceNodeOptionsFromResolvedValueElementMetadata.js';\nimport { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { ClassElementMetadataKind } from '../../metadata/models/ClassElementMetadataKind.js';\nimport { buildConstructorNoParamNode } from '../calculations/buildConstructorNoParamNode.js';\nimport { isInstanceBindingNode } from '../calculations/isInstanceBindingNode.js';\nimport { isPlanServiceRedirectionBindingNode } from '../calculations/isPlanServiceRedirectionBindingNode.js';\nimport { tryBuildGetPlanOptionsFromBuildServiceNodeOptions } from '../calculations/tryBuildGetPlanOptionsFromBuildServiceNodeOptions.js';\nimport { tryBuildGetPlanOptionsFromManagedClassElementMetadata } from '../calculations/tryBuildGetPlanOptionsFromManagedClassElementMetadata.js';\nimport { tryBuildGetPlanOptionsFromResolvedValueElementMetadata } from '../calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.js';\nimport { LazyPlanServiceNode } from '../models/LazyPlanServiceNode.js';\nimport { cacheNonRootPlanServiceNode } from './cacheNonRootPlanServiceNode.js';\nconst MAX_PLAN_DEPTH = 500;\nclass LazySubPlanServiceNode extends LazyPlanServiceNode {\n    #params;\n    #buildLazyPlanServiceNodeFromOptions;\n    #bindingConstraintsList;\n    #options;\n    constructor(params, buildLazyPlanServiceNodeFromOptions, bindingConstraintsList, options, serviceNode) {\n        super(serviceNode, options.serviceIdentifier);\n        this.#buildLazyPlanServiceNodeFromOptions =\n            buildLazyPlanServiceNodeFromOptions;\n        this.#params = params;\n        this.#bindingConstraintsList = bindingConstraintsList;\n        this.#options = options;\n    }\n    _buildPlanServiceNode() {\n        return this.#buildLazyPlanServiceNodeFromOptions(this.#params, this.#bindingConstraintsList, this.#options);\n    }\n}\nexport function currySubplan(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions) {\n    const subplanInstanceBindingNode = currySubplanInstanceBindingNode(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions);\n    const subplanRedirectionBindingNode = currySubplanRedirectionBindingNode(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions);\n    const subplanResolvedValueBindingNode = currySubplanResolvedValueBindingNode(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions);\n    return (params, bindingConstraintsList) => {\n        if (isInstanceBindingNode(params.node)) {\n            return subplanInstanceBindingNode(params, params.node, bindingConstraintsList);\n        }\n        else {\n            if (isPlanServiceRedirectionBindingNode(params.node)) {\n                return subplanRedirectionBindingNode(params, params.node, bindingConstraintsList);\n            }\n            else {\n                return subplanResolvedValueBindingNode(params, params.node, bindingConstraintsList);\n            }\n        }\n    };\n}\nfunction currySubplanInstanceBindingNode(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions) {\n    const handlePlanServiceNodeBuildFromClassElementMetadata = curryHandlePlanServiceNodeBuildFromClassElementMetadata(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions);\n    return (params, node, bindingConstraintsList) => {\n        const classMetadata = node.classMetadata;\n        for (const [index, elementMetadata,] of classMetadata.constructorArguments.entries()) {\n            node.constructorParams[index] =\n                handlePlanServiceNodeBuildFromClassElementMetadata(params, bindingConstraintsList, elementMetadata) ?? buildConstructorNoParamNode();\n        }\n        for (const [propertyKey, elementMetadata] of classMetadata.properties) {\n            const planServiceNode = handlePlanServiceNodeBuildFromClassElementMetadata(params, bindingConstraintsList, elementMetadata);\n            if (planServiceNode !== undefined) {\n                node.propertyParams.set(propertyKey, planServiceNode);\n            }\n        }\n        return params.node;\n    };\n}\nfunction currySubplanRedirectionBindingNode(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions) {\n    const handlePlanServiceNodeBuildFromRedirectionSubplanParams = curryHandlePlanServiceNodeBuildFromRedirectionSubplanParams(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions);\n    return (params, node, bindingConstraintsList) => {\n        const redirectionSubplanParams = {\n            autobindOptions: params.autobindOptions,\n            buildServiceNodeOptions: params.buildServiceNodeOptions,\n            jitEnabled: params.jitEnabled,\n            node,\n            operations: params.operations,\n            servicesBranch: params.servicesBranch,\n        };\n        node.redirection = handlePlanServiceNodeBuildFromRedirectionSubplanParams(redirectionSubplanParams, bindingConstraintsList);\n        return node;\n    };\n}\nfunction currySubplanResolvedValueBindingNode(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions) {\n    const handlePlanServiceNodeBuildFromResolvedValueElementMetadata = curryHandlePlanServiceNodeBuildFromResolvedValueElementMetadata(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions);\n    return (params, node, bindingConstraintsList) => {\n        const resolvedValueMetadata = node.binding.metadata;\n        for (const [index, elementMetadata,] of resolvedValueMetadata.arguments.entries()) {\n            node.params[index] =\n                handlePlanServiceNodeBuildFromResolvedValueElementMetadata(params, bindingConstraintsList, elementMetadata);\n        }\n        return params.node;\n    };\n}\nfunction curryHandlePlanServiceNodeBuildFromClassElementMetadata(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions) {\n    return (params, bindingConstraintsList, elementMetadata) => {\n        if (elementMetadata.kind === ClassElementMetadataKind.unmanaged) {\n            return undefined;\n        }\n        if (bindingConstraintsList.length > MAX_PLAN_DEPTH) {\n            throw new InversifyCoreError(InversifyCoreErrorKind.planningMaxDepthExceeded, 'Maximum plan depth exceeded. This is likely caused by a circular dependency.');\n        }\n        const getPlanOptions = tryBuildGetPlanOptionsFromManagedClassElementMetadata(elementMetadata);\n        if (getPlanOptions !== undefined) {\n            const planResult = params.operations.getPlan(getPlanOptions);\n            if (planResult !== undefined && planResult.tree.root.isContextFree) {\n                return planResult.tree.root;\n            }\n        }\n        const options = buildBuildServiceNodeOptionsFromClassElementMetadata(elementMetadata);\n        const serviceNode = buildPlanServiceNodeFromOptions(params, bindingConstraintsList, options);\n        const lazyPlanServiceNode = new LazySubPlanServiceNode(params, buildLazyPlanServiceNodeFromOptions, bindingConstraintsList, options, serviceNode);\n        cacheNonRootPlanServiceNode(getPlanOptions, params.operations, lazyPlanServiceNode, {\n            bindingConstraintsList,\n            buildServiceNodeOptions: options,\n        });\n        return lazyPlanServiceNode;\n    };\n}\nfunction curryHandlePlanServiceNodeBuildFromRedirectionSubplanParams(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions) {\n    return (params, bindingConstraintsList) => {\n        const getPlanOptions = tryBuildGetPlanOptionsFromBuildServiceNodeOptions(params.buildServiceNodeOptions);\n        if (getPlanOptions !== undefined) {\n            const planResult = params.operations.getPlan(getPlanOptions);\n            if (planResult !== undefined && planResult.tree.root.isContextFree) {\n                return planResult.tree.root;\n            }\n        }\n        const options = params.buildServiceNodeOptions;\n        const serviceNode = buildPlanServiceNodeFromOptions(params, bindingConstraintsList, options);\n        const lazyPlanServiceNode = new LazySubPlanServiceNode(params, buildLazyPlanServiceNodeFromOptions, bindingConstraintsList, options, serviceNode);\n        cacheNonRootPlanServiceNode(getPlanOptions, params.operations, lazyPlanServiceNode, {\n            bindingConstraintsList,\n            buildServiceNodeOptions: options,\n        });\n        return lazyPlanServiceNode;\n    };\n}\nfunction curryHandlePlanServiceNodeBuildFromResolvedValueElementMetadata(buildLazyPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions) {\n    return (params, bindingConstraintsList, elementMetadata) => {\n        if (bindingConstraintsList.length > MAX_PLAN_DEPTH) {\n            throw new InversifyCoreError(InversifyCoreErrorKind.planningMaxDepthExceeded, 'Maximum plan depth exceeded. This is likely caused by a circular dependency.');\n        }\n        const getPlanOptions = tryBuildGetPlanOptionsFromResolvedValueElementMetadata(elementMetadata);\n        if (getPlanOptions !== undefined) {\n            const planResult = params.operations.getPlan(getPlanOptions);\n            if (planResult !== undefined && planResult.tree.root.isContextFree) {\n                return planResult.tree.root;\n            }\n        }\n        const options = buildBuildServiceNodeOptionsFromResolvedValueElementMetadata(elementMetadata);\n        const serviceNode = buildPlanServiceNodeFromOptions(params, bindingConstraintsList, options);\n        const lazyPlanServiceNode = new LazySubPlanServiceNode(params, buildLazyPlanServiceNodeFromOptions, bindingConstraintsList, options, serviceNode);\n        cacheNonRootPlanServiceNode(getPlanOptions, params.operations, lazyPlanServiceNode, {\n            bindingConstraintsList,\n            buildServiceNodeOptions: options,\n        });\n        return lazyPlanServiceNode;\n    };\n}\n//# sourceMappingURL=currySubplan.js.map","import { buildGetPlanOptionsFromPlanParams } from '../calculations/buildGetPlanOptionsFromPlanParams.js';\nimport { curryBuildPlanServiceNodeFromOptions } from '../calculations/curryBuildPlanServiceNodeFromOptions.js';\nimport { handlePlanError } from '../calculations/handlePlanError.js';\nimport { LazyPlanServiceNode } from '../models/LazyPlanServiceNode.js';\nimport { curryBuildPlanServiceNode } from './curryBuildPlanServiceNode.js';\nimport { curryBuildServiceNodeBindings } from './curryBuildServiceNodeBindings.js';\nimport { currySubplan } from './currySubplan.js';\nclass LazyRootPlanServiceNode extends LazyPlanServiceNode {\n    #params;\n    constructor(params, serviceNode) {\n        super(serviceNode, serviceNode.serviceIdentifier);\n        this.#params = params;\n    }\n    _buildPlanServiceNode() {\n        return buildPlanServiceNode(this.#params);\n    }\n}\nexport const buildPlanServiceNodeFromOptions = curryBuildPlanServiceNodeFromOptions(circularBuildServiceNodeBindings);\nconst subplan = currySubplan(buildPlanServiceNodeFromOptions, buildPlanServiceNodeFromOptions);\nconst buildServiceNodeBindings = curryBuildServiceNodeBindings(subplan);\nfunction circularBuildServiceNodeBindings(params, bindingConstraintsList, serviceBindings, parentNode, buildServiceNodeOptions) {\n    return buildServiceNodeBindings(params, bindingConstraintsList, serviceBindings, parentNode, buildServiceNodeOptions);\n}\nconst buildPlanServiceNode = curryBuildPlanServiceNode(buildServiceNodeBindings);\nexport function plan(params) {\n    try {\n        const getPlanOptions = buildGetPlanOptionsFromPlanParams(params);\n        const planResultFromCache = params.operations.getPlan(getPlanOptions);\n        if (planResultFromCache !== undefined) {\n            return planResultFromCache;\n        }\n        const serviceNode = buildPlanServiceNode(params);\n        const planResult = {\n            tree: {\n                root: new LazyRootPlanServiceNode(params, serviceNode),\n            },\n        };\n        // Set the plan result in the cache no matter what, even if the plan is context dependent\n        params.operations.setPlan(getPlanOptions, planResult);\n        return planResult;\n    }\n    catch (error) {\n        handlePlanError(params, error);\n    }\n}\n//# sourceMappingURL=plan.js.map","export var CacheBindingInvalidationKind;\n(function (CacheBindingInvalidationKind) {\n    CacheBindingInvalidationKind[\"bindingAdded\"] = \"bindingAdded\";\n    CacheBindingInvalidationKind[\"bindingRemoved\"] = \"bindingRemoved\";\n})(CacheBindingInvalidationKind || (CacheBindingInvalidationKind = {}));\n//# sourceMappingURL=CacheBindingInvalidationKind.js.map","import { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { curryBuildPlanServiceNodeFromOptions } from './curryBuildPlanServiceNodeFromOptions.js';\nexport function curryLazyBuildPlanServiceNodeFromOptions(buildServiceNodeBindings) {\n    const buildPlanServiceNodeFromOptions = curryBuildPlanServiceNodeFromOptions(buildServiceNodeBindings);\n    return (params, bindingConstraintsList, options) => {\n        try {\n            return buildPlanServiceNodeFromOptions(params, bindingConstraintsList, options);\n        }\n        catch (error) {\n            if (InversifyCoreError.isErrorOfKind(error, InversifyCoreErrorKind.planning)) {\n                return undefined;\n            }\n            throw error;\n        }\n    };\n}\n//# sourceMappingURL=curryLazyBuildPlanServiceNodeFromOptions.js.map","import { BindingConstraintsImplementation, } from '../../binding/models/BindingConstraintsImplementation.js';\nimport { isStackOverflowError } from '../../error/calculations/isStackOverflowError.js';\nimport { InversifyCoreError } from '../../error/models/InversifyCoreError.js';\nimport { InversifyCoreErrorKind } from '../../error/models/InversifyCoreErrorKind.js';\nimport { curryLazyBuildPlanServiceNodeFromOptions } from '../calculations/curryLazyBuildPlanServiceNodeFromOptions.js';\nimport { LazyPlanServiceNode } from '../models/LazyPlanServiceNode.js';\nimport { curryBuildServiceNodeBindings } from './curryBuildServiceNodeBindings.js';\nimport { currySubplan } from './currySubplan.js';\nimport { buildPlanServiceNodeFromOptions } from './plan.js';\nconst subplan = currySubplan(buildPlanServiceNodeFromOptions, circularLazyBuildPlanServiceNodeFromOptions);\nconst buildServiceNodeBindings = curryBuildServiceNodeBindings(subplan);\nconst lazyBuildPlanServiceNodeFromOptions = curryLazyBuildPlanServiceNodeFromOptions(buildServiceNodeBindings);\nfunction circularLazyBuildPlanServiceNodeFromOptions(params, bindingConstraintsList, options) {\n    return lazyBuildPlanServiceNodeFromOptions(params, bindingConstraintsList, options);\n}\n/**\n * Attach a binding to a service node if the binding is context-free.\n * @param params The plan parameters.\n * @param serviceNode The service node to attach the binding to.\n * @param binding The binding to attach.\n * @param bindingConstraintsList The list of binding constraints.\n * @param chainedBindings Whether the bindings are chained.\n * @returns True if the binding requires ancestor metadata, false otherwise.\n */\nexport function addServiceNodeBindingIfContextFree(params, serviceNode, binding, bindingConstraintsList, buildServiceNodeOptions) {\n    if (LazyPlanServiceNode.is(serviceNode) && !serviceNode.isExpanded()) {\n        return {\n            isContextFreeBinding: true,\n            shouldInvalidateServiceNode: false,\n        };\n    }\n    const bindingConstraints = new BindingConstraintsImplementation(bindingConstraintsList.last);\n    if (!binding.isSatisfiedBy(bindingConstraints) ||\n        bindingConstraintsList.last.elem.getAncestorsCalled) {\n        return {\n            isContextFreeBinding: !bindingConstraintsList.last.elem.getAncestorsCalled,\n            shouldInvalidateServiceNode: false,\n        };\n    }\n    return addServiceNodeSatisfiedBindingIfContextFree(params, serviceNode, binding, bindingConstraintsList, buildServiceNodeOptions);\n}\nfunction addServiceNodeSatisfiedBindingIfContextFree(params, serviceNode, binding, bindingConstraintsList, buildServiceNodeOptions) {\n    let serviceNodeBinding;\n    try {\n        [serviceNodeBinding] = buildServiceNodeBindings(params, bindingConstraintsList, [binding], serviceNode, buildServiceNodeOptions);\n    }\n    catch (error) {\n        if (isStackOverflowError(error) ||\n            InversifyCoreError.isErrorOfKind(error, InversifyCoreErrorKind.planningMaxDepthExceeded)) {\n            /**\n             * We could potentially detect if we managed to traverse at least one iteration of the circular dependency loop.\n             * If so, the binding is context free if and only if bindingConstraintsList.last.elem.getAncestorsCalled is false.\n             *\n             * Having said that, computing this does not solve an underlying issue with circular dependencies: further cache\n             * refreshes are likely to encounter the same issue again and again. Recovering from stack overflow errors constantly\n             * is not feasible, so we prefer to declare the binding as non context free, asking for a more aggressive cache\n             * invalidation strategy, which is likely to be a cache clear.\n             */\n            return {\n                isContextFreeBinding: false,\n                shouldInvalidateServiceNode: true,\n            };\n        }\n        throw error;\n    }\n    return addServiceNodeBindingNodeIfContextFree(serviceNode, serviceNodeBinding);\n}\nfunction addServiceNodeBindingNodeIfContextFree(serviceNode, serviceNodeBinding) {\n    if (Array.isArray(serviceNode.bindings)) {\n        serviceNode.bindings.push(serviceNodeBinding);\n    }\n    else {\n        if (serviceNode.bindings === undefined) {\n            serviceNode.bindings = serviceNodeBinding;\n        }\n        else {\n            if (!LazyPlanServiceNode.is(serviceNode)) {\n                throw new InversifyCoreError(InversifyCoreErrorKind.planning, 'Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue');\n            }\n            return {\n                isContextFreeBinding: true,\n                shouldInvalidateServiceNode: true,\n            };\n        }\n    }\n    return {\n        isContextFreeBinding: true,\n        shouldInvalidateServiceNode: false,\n    };\n}\n//# sourceMappingURL=addServiceNodeBindingIfContextFree.js.map","export var InversifyContainerErrorKind;\n(function (InversifyContainerErrorKind) {\n    InversifyContainerErrorKind[InversifyContainerErrorKind[\"invalidOperation\"] = 0] = \"invalidOperation\";\n})(InversifyContainerErrorKind || (InversifyContainerErrorKind = {}));\n//# sourceMappingURL=InversifyContainerErrorKind.js.map","import { ActivationsService, bindingScopeValues, BindingService, DeactivationsService, PlanResultCacheService, } from '@inversifyjs/core';\nimport { BindingManager } from './BindingManager.js';\nimport { ContainerModuleManager } from './ContainerModuleManager.js';\nimport { DeactivationParamsManager } from './DeactivationParamsManager.js';\nimport { PlanParamsOperationsManager } from './PlanParamsOperationsManager.js';\nimport { PlanResultCacheManager } from './PlanResultCacheManager.js';\nimport { PluginManager } from './PluginManager.js';\nimport { ServiceReferenceManager } from './ServiceReferenceManager.js';\nimport { ServiceResolutionManager } from './ServiceResolutionManager.js';\nimport { SnapshotManager } from './SnapshotManager.js';\nconst DEFAULT_DEFAULT_SCOPE = bindingScopeValues.Transient;\nconst DEFAULT_JITLESS = true;\nexport class Container {\n    #bindingManager;\n    #containerModuleManager;\n    #pluginManager;\n    #serviceReferenceManager;\n    #serviceResolutionManager;\n    #snapshotManager;\n    constructor(options) {\n        const autobind = options?.autobind ?? false;\n        const defaultScope = options?.defaultScope ?? DEFAULT_DEFAULT_SCOPE;\n        const jitless = options?.jitless ?? DEFAULT_JITLESS;\n        this.#serviceReferenceManager = this.#buildServiceReferenceManager(options, autobind, defaultScope, jitless);\n        const planParamsOperationsManager = new PlanParamsOperationsManager(this.#serviceReferenceManager);\n        const planResultCacheManager = new PlanResultCacheManager(planParamsOperationsManager, this.#serviceReferenceManager);\n        const deactivationParamsManager = new DeactivationParamsManager(this.#serviceReferenceManager);\n        this.#bindingManager = new BindingManager(deactivationParamsManager.deactivationParams, defaultScope, planResultCacheManager, this.#serviceReferenceManager);\n        this.#containerModuleManager = new ContainerModuleManager(this.#bindingManager, deactivationParamsManager.deactivationParams, defaultScope, planResultCacheManager, this.#serviceReferenceManager);\n        this.#serviceResolutionManager = new ServiceResolutionManager(planParamsOperationsManager, this.#serviceReferenceManager, autobind, defaultScope, !jitless);\n        this.#pluginManager = new PluginManager(this, this.#serviceReferenceManager, this.#serviceResolutionManager);\n        this.#snapshotManager = new SnapshotManager(this.#serviceReferenceManager);\n    }\n    bind(serviceIdentifier) {\n        return this.#bindingManager.bind(serviceIdentifier);\n    }\n    get(serviceIdentifier, options) {\n        return this.#serviceResolutionManager.get(serviceIdentifier, options);\n    }\n    getAll(serviceIdentifier, options) {\n        return this.#serviceResolutionManager.getAll(serviceIdentifier, options);\n    }\n    async getAllAsync(serviceIdentifier, options) {\n        return this.#serviceResolutionManager.getAllAsync(serviceIdentifier, options);\n    }\n    async getAsync(serviceIdentifier, options) {\n        return this.#serviceResolutionManager.getAsync(serviceIdentifier, options);\n    }\n    isBound(serviceIdentifier, options) {\n        return this.#bindingManager.isBound(serviceIdentifier, options);\n    }\n    isCurrentBound(serviceIdentifier, options) {\n        return this.#bindingManager.isCurrentBound(serviceIdentifier, options);\n    }\n    async loadAsync(...modules) {\n        return this.#containerModuleManager.loadAsync(...modules);\n    }\n    load(...modules) {\n        this.#containerModuleManager.load(...modules);\n    }\n    onActivation(serviceIdentifier, activation) {\n        this.#serviceReferenceManager.activationService.add(activation, {\n            serviceId: serviceIdentifier,\n        });\n    }\n    onDeactivation(serviceIdentifier, deactivation) {\n        this.#serviceReferenceManager.deactivationService.add(deactivation, {\n            serviceId: serviceIdentifier,\n        });\n    }\n    register(pluginConstructor) {\n        this.#pluginManager.register(this, pluginConstructor);\n    }\n    restore() {\n        this.#snapshotManager.restore();\n    }\n    async rebindAsync(serviceIdentifier) {\n        return this.#bindingManager.rebindAsync(serviceIdentifier);\n    }\n    rebind(serviceIdentifier) {\n        return this.#bindingManager.rebind(serviceIdentifier);\n    }\n    snapshot() {\n        this.#snapshotManager.snapshot();\n    }\n    async unbindAsync(identifier) {\n        await this.#bindingManager.unbindAsync(identifier);\n    }\n    async unbindAllAsync() {\n        await this.#bindingManager.unbindAllAsync();\n    }\n    unbindAll() {\n        this.#bindingManager.unbindAll();\n    }\n    unbind(identifier) {\n        this.#bindingManager.unbind(identifier);\n    }\n    async unloadAsync(...modules) {\n        return this.#containerModuleManager.unloadAsync(...modules);\n    }\n    unload(...modules) {\n        this.#containerModuleManager.unload(...modules);\n    }\n    #buildAutobindOptions(autobind, defaultScope) {\n        if (autobind) {\n            return { scope: defaultScope };\n        }\n        return undefined;\n    }\n    #buildServiceReferenceManager(options, autobind, defaultScope, jitless) {\n        const autobindOptions = this.#buildAutobindOptions(autobind, defaultScope);\n        if (options?.parent === undefined) {\n            return new ServiceReferenceManager(ActivationsService.build(() => undefined), BindingService.build(() => undefined, autobindOptions), DeactivationsService.build(() => undefined), new PlanResultCacheService(!jitless));\n        }\n        const planResultCacheService = new PlanResultCacheService(!jitless);\n        const parent = options.parent;\n        parent.#serviceReferenceManager.planResultCacheService.subscribe(planResultCacheService);\n        return new ServiceReferenceManager(ActivationsService.build(() => parent.#serviceReferenceManager.activationService), BindingService.build(() => parent.#serviceReferenceManager.bindingService, autobindOptions), DeactivationsService.build(() => parent.#serviceReferenceManager.deactivationService), planResultCacheService);\n    }\n}\n//# sourceMappingURL=Container.js.map","\n\nimport { fileURLToPath } from \"node:url\";\nimport { arch, platform } from \"node:process\";\n\n\nconst BASE_PACKAGE_NAME = \"sqlite-vec\";\nconst ENTRYPOINT_BASE_NAME = \"vec0\";\nconst supportedPlatforms = [[\"darwin\",\"x64\"],[\"linux\",\"x64\"],[\"darwin\",\"arm64\"],[\"win32\",\"x64\"],[\"linux\",\"arm64\"]];\n\nconst invalidPlatformErrorMessage = `Unsupported platform for ${BASE_PACKAGE_NAME}, on a ${platform}-${arch} machine. Supported platforms are (${supportedPlatforms\n  .map(([p, a]) => `${p}-${a}`)\n  .join(\",\")}). Consult the ${BASE_PACKAGE_NAME} NPM package README for details.`;\n\nconst extensionNotFoundErrorMessage = packageName => `Loadble extension for ${BASE_PACKAGE_NAME} not found. Was the ${packageName} package installed?`;\n\nfunction validPlatform(platform, arch) {\n  return (\n    supportedPlatforms.find(([p, a]) => platform === p && arch === a) !== undefined\n  );\n}\nfunction extensionSuffix(platform) {\n  if (platform === \"win32\") return \"dll\";\n  if (platform === \"darwin\") return \"dylib\";\n  return \"so\";\n}\nfunction platformPackageName(platform, arch) {\n  const os = platform === \"win32\" ? \"windows\" : platform;\n  return `${BASE_PACKAGE_NAME}-${os}-${arch}`;\n}\n\nfunction getLoadablePath() {\n  if (!validPlatform(platform, arch)) {\n    throw new Error(\n      invalidPlatformErrorMessage\n    );\n  }\n  const packageName = platformPackageName(platform, arch);\n  const loadablePath = fileURLToPath(import.meta.resolve(packageName + \"/\" + ENTRYPOINT_BASE_NAME + \".\" + extensionSuffix(platform)));\n  return loadablePath;\n}\n\nfunction load(db) {\n  db.loadExtension(getLoadablePath());\n}\n\nexport {getLoadablePath, load};\n","export function assertError(err) {\n    if (!isError(err)) {\n        throw new Error(\"Parameter was not an error\");\n    }\n}\nexport function isError(err) {\n    return ((!!err &&\n        typeof err === \"object\" &&\n        objectToString(err) === \"[object Error]\") ||\n        err instanceof Error);\n}\nfunction objectToString(obj) {\n    return Object.prototype.toString.call(obj);\n}\n","const NAME = \"Layerr\";\nlet __name = NAME;\nexport function getGlobalName() {\n    return __name;\n}\nexport function setGlobalName(name = null) {\n    __name = name ?? NAME;\n}\n","import { isError } from \"./error.js\";\nexport function parseArguments(args) {\n    let options, shortMessage = \"\";\n    if (args.length === 0) {\n        options = {};\n    }\n    else if (isError(args[0])) {\n        options = {\n            cause: args[0],\n        };\n        shortMessage = args.slice(1).join(\" \") || \"\";\n    }\n    else if (args[0] && typeof args[0] === \"object\") {\n        options = Object.assign({}, args[0]);\n        shortMessage = args.slice(1).join(\" \") || \"\";\n    }\n    else if (typeof args[0] === \"string\") {\n        options = {};\n        shortMessage = shortMessage = args.join(\" \") || \"\";\n    }\n    else {\n        throw new Error(\"Invalid arguments passed to Layerr\");\n    }\n    return {\n        options,\n        shortMessage,\n    };\n}\n","import { assertError, isError } from \"./error.js\";\nimport { getGlobalName } from \"./global.js\";\nimport { parseArguments } from \"./tools.js\";\nexport class Layerr extends Error {\n    constructor(errorOptionsOrMessage, messageText) {\n        const args = [...arguments];\n        const { options, shortMessage } = parseArguments(args);\n        let message = shortMessage;\n        if (options.cause) {\n            message = `${message}: ${options.cause.message}`;\n        }\n        super(message);\n        this.message = message;\n        if (options.name && typeof options.name === \"string\") {\n            this.name = options.name;\n        }\n        else {\n            this.name = getGlobalName();\n        }\n        if (options.cause) {\n            Object.defineProperty(this, \"_cause\", { value: options.cause });\n        }\n        Object.defineProperty(this, \"_info\", { value: {} });\n        if (options.info && typeof options.info === \"object\") {\n            Object.assign(this._info, options.info);\n        }\n        if (Error.captureStackTrace) {\n            const ctor = options.constructorOpt || this.constructor;\n            Error.captureStackTrace(this, ctor);\n        }\n    }\n    static cause(err) {\n        assertError(err);\n        if (!err._cause)\n            return null;\n        return isError(err._cause)\n            ? err._cause\n            : null;\n    }\n    static fullStack(err) {\n        assertError(err);\n        const cause = Layerr.cause(err);\n        if (cause) {\n            return `${err.stack}\\ncaused by: ${Layerr.fullStack(cause)}`;\n        }\n        return err.stack ?? \"\";\n    }\n    static info(err) {\n        assertError(err);\n        const output = {};\n        const cause = Layerr.cause(err);\n        if (cause) {\n            Object.assign(output, Layerr.info(cause));\n        }\n        if (err._info) {\n            Object.assign(output, err._info);\n        }\n        return output;\n    }\n    toString() {\n        let output = this.name ||\n            this.constructor.name ||\n            this.constructor.prototype.name;\n        if (this.message) {\n            output = `${output}: ${this.message}`;\n        }\n        return output;\n    }\n}\n","import crypto from 'node:crypto';\nimport { Layerr } from 'layerr';\n\nconst B32_CHARACTERS = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nconst MAX_ULID = \"7ZZZZZZZZZZZZZZZZZZZZZZZZZ\";\nconst MIN_ULID = \"00000000000000000000000000\";\nconst ULID_REGEX = /^[0-7][0-9a-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}$/;\nconst UUID_REGEX = /^[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/;\n\n// Code from https://github.com/devbanana/crockford-base32/blob/develop/src/index.ts\nfunction crockfordEncode(input) {\n    const output = [];\n    let bitsRead = 0;\n    let buffer = 0;\n    const reversedInput = new Uint8Array(input.slice().reverse());\n    for (const byte of reversedInput) {\n        buffer |= byte << bitsRead;\n        bitsRead += 8;\n        while (bitsRead >= 5) {\n            output.unshift(buffer & 0x1f);\n            buffer >>>= 5;\n            bitsRead -= 5;\n        }\n    }\n    if (bitsRead > 0) {\n        output.unshift(buffer & 0x1f);\n    }\n    return output.map(byte => B32_CHARACTERS.charAt(byte)).join(\"\");\n}\nfunction crockfordDecode(input) {\n    const sanitizedInput = input.toUpperCase().split(\"\").reverse().join(\"\");\n    const output = [];\n    let bitsRead = 0;\n    let buffer = 0;\n    for (const character of sanitizedInput) {\n        const byte = B32_CHARACTERS.indexOf(character);\n        if (byte === -1) {\n            throw new Error(`Invalid base 32 character found in string: ${character}`);\n        }\n        buffer |= byte << bitsRead;\n        bitsRead += 5;\n        while (bitsRead >= 8) {\n            output.unshift(buffer & 0xff);\n            buffer >>>= 8;\n            bitsRead -= 8;\n        }\n    }\n    if (bitsRead >= 5 || buffer > 0) {\n        output.unshift(buffer & 0xff);\n    }\n    return new Uint8Array(output);\n}\n\n// These values should NEVER change. The values are precisely for\n// generating ULIDs.\nconst ENCODING = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"; // Crockford's Base32\nconst ENCODING_LEN = 32; // from ENCODING.length;\nconst TIME_MAX = 281474976710655; // from Math.pow(2, 48) - 1;\nconst TIME_LEN = 10;\nconst RANDOM_LEN = 16;\nconst ERROR_INFO = Object.freeze({\n    source: \"ulid\"\n});\n/**\n * Decode time from a ULID\n * @param id The ULID\n * @returns The decoded timestamp\n */\nfunction decodeTime(id) {\n    if (id.length !== TIME_LEN + RANDOM_LEN) {\n        throw new Layerr({\n            info: {\n                code: \"DEC_TIME_MALFORMED\",\n                ...ERROR_INFO\n            }\n        }, \"Malformed ULID\");\n    }\n    const time = id\n        .substr(0, TIME_LEN)\n        .toUpperCase()\n        .split(\"\")\n        .reverse()\n        .reduce((carry, char, index) => {\n        const encodingIndex = ENCODING.indexOf(char);\n        if (encodingIndex === -1) {\n            throw new Layerr({\n                info: {\n                    code: \"DEC_TIME_CHAR\",\n                    ...ERROR_INFO\n                }\n            }, `Time decode error: Invalid character: ${char}`);\n        }\n        return (carry += encodingIndex * Math.pow(ENCODING_LEN, index));\n    }, 0);\n    if (time > TIME_MAX) {\n        throw new Layerr({\n            info: {\n                code: \"DEC_TIME_CHAR\",\n                ...ERROR_INFO\n            }\n        }, `Malformed ULID: timestamp too large: ${time}`);\n    }\n    return time;\n}\n/**\n * Detect the best PRNG (pseudo-random number generator)\n * @param root The root to check from (global/window)\n * @returns The PRNG function\n */\nfunction detectPRNG(root) {\n    const rootLookup = root || detectRoot();\n    const globalCrypto = (rootLookup && (rootLookup.crypto || rootLookup.msCrypto)) ||\n        (typeof crypto !== \"undefined\" ? crypto : null);\n    if (typeof globalCrypto?.getRandomValues === \"function\") {\n        return () => {\n            const buffer = new Uint8Array(1);\n            globalCrypto.getRandomValues(buffer);\n            return buffer[0] / 0xff;\n        };\n    }\n    else if (typeof globalCrypto?.randomBytes === \"function\") {\n        return () => globalCrypto.randomBytes(1).readUInt8() / 0xff;\n    }\n    else if (crypto?.randomBytes) {\n        return () => crypto.randomBytes(1).readUInt8() / 0xff;\n    }\n    throw new Layerr({\n        info: {\n            code: \"PRNG_DETECT\",\n            ...ERROR_INFO\n        }\n    }, \"Failed to find a reliable PRNG\");\n}\nfunction detectRoot() {\n    if (inWebWorker())\n        return self;\n    if (typeof window !== \"undefined\") {\n        return window;\n    }\n    if (typeof global !== \"undefined\") {\n        return global;\n    }\n    if (typeof globalThis !== \"undefined\") {\n        return globalThis;\n    }\n    return null;\n}\nfunction encodeRandom(len, prng) {\n    let str = \"\";\n    for (; len > 0; len--) {\n        str = randomChar(prng) + str;\n    }\n    return str;\n}\n/**\n * Encode the time portion of a ULID\n * @param now The current timestamp\n * @param len Length to generate\n * @returns The encoded time\n */\nfunction encodeTime(now, len) {\n    if (isNaN(now)) {\n        throw new Layerr({\n            info: {\n                code: \"ENC_TIME_NAN\",\n                ...ERROR_INFO\n            }\n        }, `Time must be a number: ${now}`);\n    }\n    else if (now > TIME_MAX) {\n        throw new Layerr({\n            info: {\n                code: \"ENC_TIME_SIZE_EXCEED\",\n                ...ERROR_INFO\n            }\n        }, `Cannot encode a time larger than ${TIME_MAX}: ${now}`);\n    }\n    else if (now < 0) {\n        throw new Layerr({\n            info: {\n                code: \"ENC_TIME_NEG\",\n                ...ERROR_INFO\n            }\n        }, `Time must be positive: ${now}`);\n    }\n    else if (Number.isInteger(now) === false) {\n        throw new Layerr({\n            info: {\n                code: \"ENC_TIME_TYPE\",\n                ...ERROR_INFO\n            }\n        }, `Time must be an integer: ${now}`);\n    }\n    let mod, str = \"\";\n    for (let currentLen = len; currentLen > 0; currentLen--) {\n        mod = now % ENCODING_LEN;\n        str = ENCODING.charAt(mod) + str;\n        now = (now - mod) / ENCODING_LEN;\n    }\n    return str;\n}\n/**\n * Fix a ULID's Base32 encoding -\n * i and l (case-insensitive) will be treated as 1 and o (case-insensitive) will be treated as 0.\n * hyphens are ignored during decoding.\n * @param id The ULID\n * @returns The cleaned up ULID\n */\nfunction fixULIDBase32(id) {\n    return id.replace(/i/gi, \"1\").replace(/l/gi, \"1\").replace(/o/gi, \"0\").replace(/-/g, \"\");\n}\nfunction incrementBase32(str) {\n    let done = undefined, index = str.length, char, charIndex, output = str;\n    const maxCharIndex = ENCODING_LEN - 1;\n    while (!done && index-- >= 0) {\n        char = output[index];\n        charIndex = ENCODING.indexOf(char);\n        if (charIndex === -1) {\n            throw new Layerr({\n                info: {\n                    code: \"B32_INC_ENC\",\n                    ...ERROR_INFO\n                }\n            }, \"Incorrectly encoded string\");\n        }\n        if (charIndex === maxCharIndex) {\n            output = replaceCharAt(output, index, ENCODING[0]);\n            continue;\n        }\n        done = replaceCharAt(output, index, ENCODING[charIndex + 1]);\n    }\n    if (typeof done === \"string\") {\n        return done;\n    }\n    throw new Layerr({\n        info: {\n            code: \"B32_INC_INVALID\",\n            ...ERROR_INFO\n        }\n    }, \"Failed incrementing string\");\n}\nfunction inWebWorker() {\n    // @ts-ignore\n    return typeof WorkerGlobalScope !== \"undefined\" && self instanceof WorkerGlobalScope;\n}\n/**\n * Check if a ULID is valid\n * @param id The ULID to test\n * @returns True if valid, false otherwise\n * @example\n *   isValid(\"01HNZX8JGFACFA36RBXDHEQN6E\"); // true\n *   isValid(\"\"); // false\n */\nfunction isValid(id) {\n    return (typeof id === \"string\" &&\n        id.length === TIME_LEN + RANDOM_LEN &&\n        id\n            .toUpperCase()\n            .split(\"\")\n            .every(char => ENCODING.indexOf(char) !== -1));\n}\n/**\n * Create a ULID factory to generate monotonically-increasing\n *  ULIDs\n * @param prng The PRNG to use\n * @returns A ulid factory\n * @example\n *  const ulid = monotonicFactory();\n *  ulid(); // \"01HNZXD07M5CEN5XA66EMZSRZW\"\n */\nfunction monotonicFactory(prng) {\n    const currentPRNG = prng || detectPRNG();\n    let lastTime = 0, lastRandom;\n    return function _ulid(seedTime) {\n        const seed = isNaN(seedTime) ? Date.now() : seedTime;\n        if (seed <= lastTime) {\n            const incrementedRandom = (lastRandom = incrementBase32(lastRandom));\n            return encodeTime(lastTime, TIME_LEN) + incrementedRandom;\n        }\n        lastTime = seed;\n        const newRandom = (lastRandom = encodeRandom(RANDOM_LEN, currentPRNG));\n        return encodeTime(seed, TIME_LEN) + newRandom;\n    };\n}\nfunction randomChar(prng) {\n    let rand = Math.floor(prng() * ENCODING_LEN);\n    if (rand === ENCODING_LEN) {\n        rand = ENCODING_LEN - 1;\n    }\n    return ENCODING.charAt(rand);\n}\nfunction replaceCharAt(str, index, char) {\n    if (index > str.length - 1) {\n        return str;\n    }\n    return str.substr(0, index) + char + str.substr(index + 1);\n}\n/**\n * Generate a ULID\n * @param seedTime Optional time seed\n * @param prng Optional PRNG function\n * @returns A ULID string\n * @example\n *  ulid(); // \"01HNZXD07M5CEN5XA66EMZSRZW\"\n */\nfunction ulid(seedTime, prng) {\n    const currentPRNG = prng || detectPRNG();\n    const seed = isNaN(seedTime) ? Date.now() : seedTime;\n    return encodeTime(seed, TIME_LEN) + encodeRandom(RANDOM_LEN, currentPRNG);\n}\n/**\n * Convert a ULID to a UUID\n * @param ulid The ULID to convert\n * @returns A UUID string\n */\nfunction ulidToUUID(ulid) {\n    const isValid = ULID_REGEX.test(ulid);\n    if (!isValid) {\n        throw new Layerr({ info: { code: \"INVALID_ULID\", ...ERROR_INFO } }, \"Invalid ULID\");\n    }\n    const uint8Array = crockfordDecode(ulid);\n    let uuid = Array.from(uint8Array)\n        .map(byte => byte.toString(16).padStart(2, \"0\"))\n        .join(\"\");\n    uuid =\n        uuid.substring(0, 8) +\n            \"-\" +\n            uuid.substring(8, 12) +\n            \"-\" +\n            uuid.substring(12, 16) +\n            \"-\" +\n            uuid.substring(16, 20) +\n            \"-\" +\n            uuid.substring(20);\n    return uuid;\n}\n/**\n * Convert a UUID to a ULID\n * @param uuid The UUID to convert\n * @returns A ULID string\n */\nfunction uuidToULID(uuid) {\n    const isValid = UUID_REGEX.test(uuid);\n    if (!isValid) {\n        throw new Layerr({ info: { code: \"INVALID_UUID\", ...ERROR_INFO } }, \"Invalid UUID\");\n    }\n    const uint8Array = new Uint8Array(uuid\n        .replace(/-/g, \"\")\n        .match(/.{1,2}/g)\n        .map(byte => parseInt(byte, 16)));\n    return crockfordEncode(uint8Array);\n}\n\nexport { B32_CHARACTERS, MAX_ULID, MIN_ULID, ULID_REGEX, UUID_REGEX, decodeTime, detectPRNG, encodeTime, fixULIDBase32, isValid, monotonicFactory, ulid, ulidToUUID, uuidToULID };\n","import{i as e,n as t}from\"./logSinkConfig-BnOw8fWp.mjs\";import{inject as n,injectable as r}from\"inversify\";import\"reflect-metadata\";import{mkdir as i,stat as a}from\"node:fs/promises\";import{dirname as o}from\"node:path\";import{DatabaseSync as s}from\"node:sqlite\";import*as c from\"sqlite-vec\";import{ulid as l}from\"ulidx\";const u={LogStorageService:Symbol.for(`LogStorageService`),EmbeddingService:Symbol.for(`EmbeddingService`),LogQueryService:Symbol.for(`LogQueryService`),LogMetricsService:Symbol.for(`LogMetricsService`),MetricPointService:Symbol.for(`MetricPointService`),HostProcessSamplerService:Symbol.for(`HostProcessSamplerService`),LogSearchService:Symbol.for(`LogSearchService`),SemanticSearchService:Symbol.for(`SemanticSearchService`),LogRetentionService:Symbol.for(`LogRetentionService`),HttpServerHealthCheck:Symbol.for(`HttpServerHealthCheck`),HttpServerManager:Symbol.for(`HttpServerManager`),Database:Symbol.for(`Database`),Logger:Symbol.for(`Logger`),HttpServer:Symbol.for(`HttpServer`),McpServer:Symbol.for(`McpServer`)};function d(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function f(e,t){return function(n,r){t(n,r,e)}}function p(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}const m=[`gen_ai.usage.input_tokens`,`gen_ai.usage.prompt_tokens`,`llm.usage.input_tokens`,`input_tokens`,`prompt_tokens`,`usage.input_tokens`,`usage.prompt_tokens`,`response.usage.input_tokens`,`response.usage.prompt_tokens`,`usageMetadata.promptTokenCount`,`promptTokenCount`],h=[`gen_ai.usage.output_tokens`,`gen_ai.usage.completion_tokens`,`llm.usage.output_tokens`,`output_tokens`,`completion_tokens`,`usage.output_tokens`,`usage.completion_tokens`,`response.usage.output_tokens`,`response.usage.completion_tokens`,`usageMetadata.candidatesTokenCount`,`candidatesTokenCount`],g=[`gen_ai.usage.total_tokens`,`llm.usage.total_tokens`,`total_tokens`,`usage.total_tokens`,`response.usage.total_tokens`,`usageMetadata.totalTokenCount`,`totalTokenCount`],_=[`gen_ai.usage.cache_read.input_tokens`,`gen_ai.usage.cache_read_tokens`,`gen_ai.usage.cache_creation.input_tokens`,`gen_ai.usage.cache_write_tokens`,`input_tokens_details.cached_tokens`,`usage.input_tokens_details.cached_tokens`,`response.usage.input_tokens_details.cached_tokens`,`usage.metadata.cached_tokens`,`metadata.cached_tokens`,`cached_tokens`],v=[`gen_ai.usage.reasoning.output_tokens`,`gen_ai.usage.reasoning_tokens`,`output_tokens_details.reasoning_tokens`,`usage.output_tokens_details.reasoning_tokens`,`response.usage.output_tokens_details.reasoning_tokens`,`usage.metadata.reasoning_tokens`,`metadata.reasoning_tokens`,`reasoning_tokens`],y=[`model_proxy.model`,`gen_ai.response.model`,`gen_ai.request.model`,`llm.response.model`,`llm.request.model`,`response.model`,`model`,`modelVersion`,`requestedModel`],b=[`model_proxy.provider`,`gen_ai.provider.name`,`gen_ai.system`,`llm.provider`,`provider`,`provider_name`,`model_provider`];function x(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t||t[0]!==`{`&&t[0]!==`[`)return e;try{return JSON.parse(t)}catch{return e}}function S(e,t){let n=x(e);if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n[t];if(r!==void 0)return x(r);let i=n;for(let e of t.split(`.`))if(i=x(i),!i||typeof i!=`object`||Array.isArray(i)||(i=i[e],i===void 0))return;return x(i)}function C(e,t){for(let n of t){let t=S(e,n);if(t!=null&&t!==``)return t}}function w(e){if(typeof e==`number`&&Number.isFinite(e))return Math.max(0,e);if(typeof e==`bigint`)return Number(e);if(typeof e==`string`){let t=Number(e);if(Number.isFinite(t))return Math.max(0,t)}return null}function T(e,t){return w(C(e,t))}function E(e,t){let n=C(e,t);return typeof n==`string`&&n.trim().length>0?n.trim():typeof n==`number`||typeof n==`boolean`?String(n):null}function ee(e){let t=T(e,m),n=T(e,h),r=T(e,g),i=T(e,_),a=T(e,v),o=t??0,s=n??0;return{inputTokens:o,outputTokens:s,totalTokens:r??o+s,cachedInputTokens:i??0,reasoningOutputTokens:a??0,hasUsage:t!==null||n!==null||r!==null||i!==null||a!==null}}function te(e){return{model:E(e,y),provider:E(e,b)}}function D(e){let t=e.toLowerCase();return t.includes(`gen_ai.usage`)||t.includes(`llm.usage`)||/(^|[._-])(input|output|prompt|completion|total|cached|reasoning|candidates?)_?tokens?($|[._-])/.test(t)||/(^|[._-])(prompt|candidates|total)tokencount($|[._-])/.test(t)}function O(e){return w(e)!==null}const k=864e5,ne={day:k,week:7*k,month:30*k},re={day:`hour`,week:`day`,month:`day`,all:`week`};function A(e){return String(e).padStart(2,`0`)}function ie(e,t){let n=`${e.getFullYear()}-${A(e.getMonth()+1)}-${A(e.getDate())}`;return t===`hour`?`${n} ${A(e.getHours())}:00`:t===`month`?`${e.getFullYear()}-${A(e.getMonth()+1)}`:n}function ae(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case`hour`:return new Date(n,r,i,e.getHours());case`week`:{let e=new Date(n,r,i);return e.setDate(e.getDate()-(e.getDay()+6)%7),e}case`month`:return new Date(n,r,1);default:return new Date(n,r,i)}}function oe(e){return e}function se(e){if(!e)return{};try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}function ce(e){let t=ee(e);return{inputTokens:t.inputTokens,outputTokens:t.outputTokens,totalTokens:t.totalTokens,cachedInputTokens:t.cachedInputTokens,reasoningOutputTokens:t.reasoningOutputTokens,usageEventCount:+!!t.hasUsage,hasUsage:t.hasUsage}}function j(){return{inputTokens:0,outputTokens:0,totalTokens:0,cachedInputTokens:0,reasoningOutputTokens:0,usageEventCount:0}}function M(e,t){e.inputTokens+=t.inputTokens,e.outputTokens+=t.outputTokens,e.totalTokens+=t.totalTokens,e.cachedInputTokens+=t.cachedInputTokens,e.reasoningOutputTokens+=t.reasoningOutputTokens,e.usageEventCount+=t.usageEventCount}function N(e,t){t&&(e[t]=(e[t]??0)+1)}function P(e){return e?(Array.isArray(e)?e:[e]).flatMap(e=>e.split(`,`)).map(e=>e.trim()).filter(e=>e.length>0):[]}function F(e,t){return t.length===0||e!==null&&t.includes(e)}function I(e){return Math.round(e*100)/100}function L(e,t){if(e.length===0)return 0;let n=[...e].sort((e,t)=>e-t);return n[Math.min(n.length-1,Math.max(0,Math.ceil(n.length*t)-1))]??0}function R(e){let t=e.map(e=>e.inputTokens),n=e.map(e=>e.outputTokens),r=e.map(e=>e.totalTokens),i=e=>e.reduce((e,t)=>e+t,0),a=e=>e.length===0?0:I(i(e)/e.length);return{samples:e.length,avgInputTokens:a(t),p50InputTokens:L(t,.5),p90InputTokens:L(t,.9),avgOutputTokens:a(n),p50OutputTokens:L(n,.5),p90OutputTokens:L(n,.9),avgTotalTokens:a(r),p50TotalTokens:L(r,.5),p90TotalTokens:L(r,.9)}}function z(e,t){return t===0?100:I(e/t*100)}function B(e){return e.endsWith(`.tool_token_sample`)}function V(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim().length>0)return t.trim();if(typeof t==`number`||typeof t==`boolean`)return String(t)}return null}function le(e){let t=e.metadata,n=e.raw.message??``,r=V(t,`error_type`)??e.raw.error_type,i=t.success,a=t[`tool.result.error`],o=i===!1||i===`false`||a===!0||a===`true`,s=V(t,`decision`),c=V(t,`browse_tool.error.category`);return c===`caller_validation`||c===`caller_execution`?`caller_error`:c===`spec_failure`?`expected_failure`:c===`page_state`?`page_state`:c===`infrastructure_failure`?`infrastructure_failure`:n.includes(`api_error`)?`api_error`:n.includes(`api_retries_exhausted`)?`api_retries_exhausted`:n.includes(`api_refusal`)?`api_refusal`:(n.includes(`tool_result`)||n.includes(`tool error`))&&o?`tool_failure`:n.includes(`tool_decision`)&&s===`reject`?`tool_rejected`:e.raw.level===`error`||e.raw.level===`fatal`||r?`log_error`:null}function H(e){let t=le(e);return e.raw.signal_type===`span`&&t!==`log_error`?null:t}function ue(e,t){return e.message!==`Selected LLM provider`&&e.message!==`LLM provider attempt failed`?null:V(t,`tool`)}function U(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,` `)}function de(e,t){let n=t===`job`?`workflow.job.finished`:`workflow.run.finished`;if(e.raw.message!==n)return!1;let r=t===`job`?`workflow.job.outcome`:`workflow.outcome`;return V(e.metadata,r)===`failed`}let W=class{storage;constructor(e){this.storage=e}async getMetrics(e={},t={}){await this.storage.ensureInitialized();let n=this.storage.getSqliteClient(),r=P(e.model),i=P(e.provider),a=t.period??`all`,o=t.bucket??re[a],s=a===`all`||e.startTime?e:{...e,startTime:new Date(Date.now()-ne[a])},{whereSql:c,params:l}=this.buildWhereClause(s),u=oe(n.prepare(`\n            SELECT\n              id, timestamp, level, message, service, metadata, error_type, error_message,\n              session_id, workflow_run_id, workflow_name, job_name, job_id, agent_name,\n              workflow_run_key, workflow_id, workflow_workspace, step_name, phase,\n              signal_type, duration_ms\n            FROM logs\n            ${c}\n            ORDER BY timestamp ASC\n          `).all(...l)),d=/* @__PURE__ */ new Map;for(let e of u)if(e.workflow_run_key&&e.workflow_run_id){let t=d.get(e.workflow_run_key)??/* @__PURE__ */ new Set;t.add(e.workflow_run_id),d.set(e.workflow_run_key,t)}let f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new Map;for(let e of u)e.workflow_run_id&&(e.message===`workflow.run.started`||e.message===`workflow.run.finished`)&&e.workflow_name&&(f.set(e.workflow_run_id,e.workflow_name),p.set(U(e.workflow_name),e.workflow_name));let m=u.map(e=>{let t=se(e.metadata),n=te(t),r=ce(t),i=e.workflow_run_key?d.get(e.workflow_run_key):void 0,a=e.workflow_run_id??(i?.size===1?[...i][0]:void 0)??null,o=(a?f.get(a):void 0)??(e.workflow_name?p.get(U(e.workflow_name))??e.workflow_name:null);return{raw:{...e,workflow_run_id:a,workflow_name:o},timestamp:new Date(Number(e.timestamp)),metadata:t,model:n.model,provider:n.provider??ue(e,t),tokenUsage:r,hasUsage:r.hasUsage}}).filter(t=>(!e.workflowName||t.raw.workflow_name===e.workflowName)&&F(t.model,r)&&F(t.provider,i)),h=t.groupBy??`workflow-run`,g=t.sort??`last-seen`,_=t.toolSort??`p90-total-tokens`,v=t.limit??50,y=t.toolLimit??20,b=this.buildGroups(m,h),x=this.sortGroups(b,g),S=this.buildToolRows(m),C=this.sortToolRows(S,_),w=this.buildTotals(b);return{generatedAt:/* @__PURE__ */ new Date,groupBy:h,sort:g,toolSort:_,period:a,bucket:o,timeline:this.buildTimeline(m,o),filters:{startTime:s.startTime?.toISOString(),endTime:s.endTime?.toISOString(),sessionId:e.sessionId,workflowRunId:e.workflowRunId,workflowName:e.workflowName,jobName:e.jobName,stepName:e.stepName,agentName:e.agentName,service:P(e.service),model:r,provider:i},totals:{...w,returnedGroups:Math.min(x.length,v)},groups:x.slice(0,v),tools:{returnedTools:Math.min(C.length,y),rows:C.slice(0,y)}}}buildWhereClause(e){let t=`WHERE 1 = 1`,n=[],r=(e,r)=>{r&&(t+=` AND ${e} = ?`,n.push(r))},i=P(e.service);return i.length>0&&(t+=` AND service IN (${i.map(()=>`?`).join(`,`)})`,n.push(...i)),r(`session_id`,e.sessionId),r(`workflow_run_id`,e.workflowRunId),r(`job_name`,e.jobName),r(`job_id`,e.jobId),r(`agent_name`,e.agentName),r(`workflow_run_key`,e.workflowRunKey),r(`workflow_workspace`,e.workflowWorkspace),r(`step_name`,e.stepName),r(`phase`,e.phase),e.startTime&&(t+=` AND timestamp >= ?`,n.push(e.startTime.getTime())),e.endTime&&(t+=` AND timestamp <= ?`,n.push(e.endTime.getTime())),{whereSql:t,params:n}}buildTimeline(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let e=ae(r.timestamp,t),i=e.getTime(),a=n.get(i);a||(a={bucketStart:e.toISOString(),label:ie(e,t),totalRecords:0,issueCount:0,...j()},n.set(i,a)),a.totalRecords+=1,r.hasUsage&&!B(r.raw.message)&&M(a,r.tokenUsage),H(r)&&(a.issueCount+=1)}return[...n.entries()].sort(([e],[t])=>e-t).map(([,e])=>e)}buildGroups(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let e=this.groupKey(r,t),i=n.get(e);i||(i=this.createGroup(e,r),n.set(e,i)),this.addRowToGroup(i,r,t)}return[...n.values()].map(e=>this.clearAmbiguousContext({...e,tokenCoveragePercent:e.usageEventCount>0?100:0},t))}groupKey(e,t){switch(t){case`session`:return e.raw.session_id??`unknown`;case`workflow-name`:return e.raw.workflow_name??e.raw.workflow_id??`unknown`;case`job`:return[e.raw.workflow_run_id??e.raw.workflow_run_key??e.raw.workflow_name??`unknown`,e.raw.job_name??`unknown`].join(` / `);case`step`:return[e.raw.workflow_run_id??e.raw.workflow_run_key??e.raw.workflow_name??`unknown`,e.raw.step_name??`unknown`].join(` / `);case`agent`:return e.raw.agent_name??e.raw.service??`unknown`;case`model`:return e.model??`unknown`;case`provider`:return e.provider??`unknown`;default:return e.raw.workflow_run_id??e.raw.workflow_run_key??`unknown`}}createGroup(e,t){return{key:e,sessionId:t.raw.session_id,workflowRunKey:t.raw.workflow_run_key,workflowRunId:t.raw.workflow_run_id,workflowName:t.raw.workflow_name,jobName:t.raw.job_name,stepName:t.raw.step_name,agentName:t.raw.agent_name,model:t.model,provider:t.provider,firstSeen:null,lastSeen:null,totalRecords:0,logRecords:0,spanRecords:0,issueCount:0,failed:!1,byCategory:{},models:{},providers:{},tokenCoveragePercent:0,...j()}}addRowToGroup(e,t,n){e.totalRecords+=1,(t.raw.signal_type??`log`)===`span`?e.spanRecords+=1:e.logRecords+=1,(!e.firstSeen||t.timestamp<e.firstSeen)&&(e.firstSeen=t.timestamp),(!e.lastSeen||t.timestamp>e.lastSeen)&&(e.lastSeen=t.timestamp),!e.sessionId&&t.raw.session_id&&(e.sessionId=t.raw.session_id),!e.workflowRunKey&&t.raw.workflow_run_key&&(e.workflowRunKey=t.raw.workflow_run_key),!e.workflowRunId&&t.raw.workflow_run_id&&(e.workflowRunId=t.raw.workflow_run_id),!e.workflowName&&t.raw.workflow_name&&(e.workflowName=t.raw.workflow_name),!e.jobName&&t.raw.job_name&&(e.jobName=t.raw.job_name),!e.stepName&&t.raw.step_name&&(e.stepName=t.raw.step_name),!e.agentName&&t.raw.agent_name&&(e.agentName=t.raw.agent_name),!e.model&&t.model&&(e.model=t.model),!e.provider&&t.provider&&(e.provider=t.provider),N(e.models,t.model),N(e.providers,t.provider),t.hasUsage&&!B(t.raw.message)&&M(e,t.tokenUsage);let r=H(t);r&&(e.issueCount+=1,e.byCategory[r]=(e.byCategory[r]??0)+1),de(t,n)&&(e.failed=!0)}clearAmbiguousContext(e,t){switch(t){case`session`:return{...e,workflowRunKey:null,workflowRunId:null,workflowName:null,jobName:null,stepName:null,model:null,provider:null};case`workflow-name`:return{...e,sessionId:null,workflowRunKey:null,workflowRunId:null,jobName:null,stepName:null,agentName:null,model:null,provider:null};case`job`:return{...e,sessionId:null,stepName:null,agentName:null,model:null,provider:null};case`step`:return{...e,sessionId:null,jobName:null,agentName:null,model:null,provider:null};case`agent`:return{...e,sessionId:null,workflowRunKey:null,workflowRunId:null,workflowName:null,jobName:null,stepName:null,model:null,provider:null};case`model`:return{...e,sessionId:null,workflowRunKey:null,workflowRunId:null,workflowName:null,jobName:null,stepName:null,agentName:null,provider:null};case`provider`:return{...e,sessionId:null,workflowRunKey:null,workflowRunId:null,workflowName:null,jobName:null,stepName:null,agentName:null,model:null};default:return{...e,sessionId:null,jobName:null,stepName:null,agentName:null,model:null,provider:null}}}sortGroups(e,t){return[...e].sort((e,n)=>t===`total-tokens`?n.totalTokens-e.totalTokens||(n.lastSeen?.getTime()??0)-(e.lastSeen?.getTime()??0):t===`issues`&&n.issueCount-e.issueCount||(n.lastSeen?.getTime()??0)-(e.lastSeen?.getTime()??0))}buildTotals(e){let t={...j(),totalRecords:0,logRecords:0,spanRecords:0,groupCount:e.length,returnedGroups:e.length,failedGroups:0,issueCount:0,tokenCoveragePercent:100,models:{},providers:{}};for(let n of e){t.totalRecords+=n.totalRecords,t.logRecords+=n.logRecords,t.spanRecords+=n.spanRecords,t.issueCount+=n.issueCount,n.failed&&(t.failedGroups+=1),M(t,n);for(let[e,r]of Object.entries(n.models))t.models[e]=(t.models[e]??0)+r;for(let[e,r]of Object.entries(n.providers))t.providers[e]=(t.providers[e]??0)+r}return t.tokenCoveragePercent=z(e.filter(e=>e.usageEventCount>0).length,e.length),t}buildToolRows(e){let t=/* @__PURE__ */ new Map;for(let n of e){if(!B(n.raw.message)||!n.hasUsage)continue;let e=V(n.metadata,`model_proxy.tool.name`,`model_proxy.tool_name`,`codex.tool.name`,`tool.name`,`tool_name`)??`unknown`,r=V(n.metadata,`model_proxy.token_attribution`,`codex.token_attribution`,`token_attribution`)===`toolOutputImpact`?`toolOutputImpact`:`toolCallTurn`,i=t.get(e);i||(i={toolName:e,models:{},providers:{},samples:{toolCallTurn:[],toolOutputImpact:[]}},t.set(e,i)),N(i.models,n.model),N(i.providers,n.provider),i.samples[r].push(n.tokenUsage)}return[...t.values()].map(e=>({toolName:e.toolName,invocationCount:Math.max(e.samples.toolCallTurn.length,e.samples.toolOutputImpact.length),models:e.models,providers:e.providers,toolCallTurn:R(e.samples.toolCallTurn),toolOutputImpact:R(e.samples.toolOutputImpact)}))}sortToolRows(e,t){return[...e].sort((e,n)=>t===`avg-total-tokens`?Math.max(n.toolCallTurn.avgTotalTokens,n.toolOutputImpact.avgTotalTokens)-Math.max(e.toolCallTurn.avgTotalTokens,e.toolOutputImpact.avgTotalTokens)||n.invocationCount-e.invocationCount:t===`invocations`?n.invocationCount-e.invocationCount:Math.max(n.toolCallTurn.p90TotalTokens,n.toolOutputImpact.p90TotalTokens)-Math.max(e.toolCallTurn.p90TotalTokens,e.toolOutputImpact.p90TotalTokens)||n.invocationCount-e.invocationCount)}};W=p([r(),f(0,n(u.LogStorageService)),d(`design:paramtypes`,[Object])],W);const G=`\n  id, timestamp, level, message, trace_id, span_id, parent_span_id,\n  service, hostname, pid, metadata, error_type, error_message, error_stack,\n  session_id, workflow_run_id, workflow_name, job_name, job_id, agent_name,\n  parent_session_id, workflow_run_key, workflow_id, workflow_workspace,\n  step_name, phase, signal_type, duration_ms, created_at\n`;function K(e){return e}let q=class{storage;constructor(e){this.storage=e}async getSqlite(){return await this.storage.ensureInitialized(),this.storage.getSqliteClient()}mapRow(e){return{id:e.id,timestamp:new Date(Number(e.timestamp)),level:e.level,message:e.message,traceId:e.trace_id,spanId:e.span_id,parentSpanId:e.parent_span_id,service:e.service,hostname:e.hostname,pid:e.pid,metadata:e.metadata?JSON.parse(e.metadata):null,errorType:e.error_type,errorMessage:e.error_message,errorStack:e.error_stack,sessionId:e.session_id,workflowRunId:e.workflow_run_id,workflowName:e.workflow_name,jobName:e.job_name,jobId:e.job_id,agentName:e.agent_name,parentSessionId:e.parent_session_id,workflowRunKey:e.workflow_run_key,workflowId:e.workflow_id,workflowWorkspace:e.workflow_workspace,stepName:e.step_name,phase:e.phase,signalType:e.signal_type??`log`,durationMs:e.duration_ms,createdAt:new Date(Number(e.created_at))}}buildWhereClause(e){let t=`WHERE 1 = 1`,n=[];if(e.level){let r=Array.isArray(e.level)?e.level:[e.level];t+=` AND level IN (${r.map(()=>`?`).join(`,`)})`,n.push(...r)}if(e.service){let r=Array.isArray(e.service)?e.service:[e.service];t+=` AND service IN (${r.map(()=>`?`).join(`,`)})`,n.push(...r)}return e.traceId&&(t+=` AND trace_id = ?`,n.push(e.traceId)),e.spanId&&(t+=` AND span_id = ?`,n.push(e.spanId)),`errorType`in e&&e.errorType&&(t+=` AND error_type = ?`,n.push(e.errorType)),e.sessionId&&(t+=` AND session_id = ?`,n.push(e.sessionId)),e.workflowRunId&&(t+=` AND workflow_run_id = ?`,n.push(e.workflowRunId)),e.workflowName&&(t+=` AND workflow_name = ?`,n.push(e.workflowName)),e.jobName&&(t+=` AND job_name = ?`,n.push(e.jobName)),e.jobId&&(t+=` AND job_id = ?`,n.push(e.jobId)),e.agentName&&(t+=` AND agent_name = ?`,n.push(e.agentName)),`parentSessionId`in e&&e.parentSessionId&&(t+=` AND parent_session_id = ?`,n.push(e.parentSessionId)),e.workflowRunKey&&(t+=` AND workflow_run_key = ?`,n.push(e.workflowRunKey)),`workflowId`in e&&e.workflowId&&(t+=` AND workflow_id = ?`,n.push(e.workflowId)),e.workflowWorkspace&&(t+=` AND workflow_workspace = ?`,n.push(e.workflowWorkspace)),e.stepName&&(t+=` AND step_name = ?`,n.push(e.stepName)),e.phase&&(t+=` AND phase = ?`,n.push(e.phase)),`signalType`in e&&e.signalType&&(t+=` AND COALESCE(signal_type, 'log') = ?`,n.push(e.signalType)),e.startTime&&(t+=` AND timestamp >= ?`,n.push(e.startTime.getTime())),e.endTime&&(t+=` AND timestamp <= ?`,n.push(e.endTime.getTime())),{whereSql:t,params:n}}async filterByLevel(e,t=100){try{let n=await this.getSqlite(),{whereSql:r,params:i}=this.buildWhereClause({level:e});return K(n.prepare(`\n          SELECT ${G}\n          FROM logs\n          ${r}\n          ORDER BY timestamp DESC\n          LIMIT ?\n        `).all(...i,t)).map(e=>this.mapRow(e))}catch(e){throw Error(`Failed to filter by level: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async filterByTrace(e,t={},n){try{let r=await this.getSqlite(),{whereSql:i,params:a}=this.buildWhereClause({...t,traceId:e});return K(r.prepare(`\n          SELECT ${G}\n          FROM logs\n          ${i}\n          ORDER BY timestamp ASC, (parent_span_id IS NOT NULL), rowid\n          ${n===void 0?``:`LIMIT ?`}\n        `).all(...a,...n===void 0?[]:[n])).map(e=>this.mapRow(e))}catch(e){throw Error(`Failed to filter by trace: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async filterByTimeRange(e,t){try{return K((await this.getSqlite()).prepare(`\n          SELECT ${G}\n          FROM logs\n          WHERE timestamp >= ? AND timestamp <= ?\n          ORDER BY timestamp ASC\n        `).all(e.getTime(),t.getTime())).map(e=>this.mapRow(e))}catch(e){throw Error(`Failed to filter by time range: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async filterByService(e){try{let t=await this.getSqlite(),n=Array.isArray(e)?e:[e];return K(t.prepare(`\n          SELECT ${G}\n          FROM logs\n          WHERE service IN (${n.map(()=>`?`).join(`,`)})\n          ORDER BY timestamp ASC\n        `).all(...n)).map(e=>this.mapRow(e))}catch(e){throw Error(`Failed to filter by service: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async filterByColumn(e,t,n=1e3){try{return K((await this.getSqlite()).prepare(`\n          SELECT ${G}\n          FROM logs\n          WHERE ${e} = ?\n          ORDER BY timestamp ASC\n          LIMIT ?\n        `).all(t,n)).map(e=>this.mapRow(e))}catch(t){throw Error(`Failed to filter by ${e}: ${t instanceof Error?t.message:String(t)}`,{cause:t})}}async filterBySession(e,t=1e3){return this.filterByColumn(`session_id`,e,t)}async filterByWorkflowRun(e,t=1e3){return this.filterByColumn(`workflow_run_id`,e,t)}async filterByWorkflowName(e,t=1e3){return this.filterByColumn(`workflow_name`,e,t)}classifyAgentIssue(e){let t=e.metadata??{},n=e.message??``,r=e=>e==null?null:typeof e==`string`?e:JSON.stringify(e)??null,i=r(t.tool_name)??r(t[`tool.name`]),a=r(t.error_type)??e.errorType,o=r(t.status_code),s=r(t.model),c=t.success,l=t[`tool.result.error`],u=c===!1||c===`false`||l===!0||l===`true`,d=r(t.decision),f=r(t[`browse_tool.error.category`]),p=null,m=null;if(f===`caller_validation`||f===`caller_execution`?(p=`caller_error`,m=r(t[`error.message`])??e.errorMessage):f===`spec_failure`?(p=`expected_failure`,m=r(t[`error.message`])??e.errorMessage):f===`page_state`?(p=`page_state`,m=r(t[`error.message`])??e.errorMessage):f===`infrastructure_failure`?(p=`infrastructure_failure`,m=r(t[`error.message`])??e.errorMessage):n.includes(`api_error`)?(p=`api_error`,m=r(t.error)??e.errorMessage):n.includes(`api_retries_exhausted`)?(p=`api_retries_exhausted`,m=r(t.error)):n.includes(`api_refusal`)?(p=`api_refusal`,m=r(t.category)??r(t.reason)):(n.includes(`tool_result`)||n.includes(`tool error`))&&u?(p=`tool_failure`,m=r(t.tool_input)??r(t.error)??e.errorMessage):n.includes(`tool_decision`)&&d===`reject`?(p=`tool_rejected`,m=r(t.source)):(e.level===`error`||e.level===`fatal`||e.errorType)&&(p=`log_error`,m=e.errorMessage??n),!p||e.signalType===`span`&&p!==`log_error`)return null;let h=(m??n).toLowerCase().replace(/[0-9a-f]{8}-[0-9a-f-]{27,}/g,`<id>`).replace(/\\b\\d+\\b/g,`<n>`).slice(0,300),g=[p,e.service,i??``,a??``,h].join(`|`);return{category:p,timestamp:e.timestamp,level:e.level,message:n,service:e.service,sessionId:e.sessionId,workflowRunId:e.workflowRunId,workflowName:e.workflowName,jobName:e.jobName,jobId:e.jobId,agentName:e.agentName,stepName:e.stepName,tool:i,errorType:a,statusCode:o,model:s,detail:m?m.slice(0,500):null,traceId:e.traceId,spanId:e.spanId,fingerprint:g,occurrenceCount:1}}async analyzeAgentIssues(e={},t={}){try{let n=await this.getSqlite(),r=t.scanLimit??5e4,i=t.sampleLimit??100,{whereSql:a,params:o}=this.buildWhereClause(e),s=K(n.prepare(`\n          SELECT ${G}\n          FROM logs\n          ${a}\n          ORDER BY timestamp DESC\n          LIMIT ?\n        `).all(...o,r)),c=n.prepare(`SELECT COUNT(*) AS count FROM logs ${a}`).get(...o)?.count??s.length,l={},u={},d={},f={},p=[],m=/* @__PURE__ */ new Map;for(let e of s){let t=this.classifyAgentIssue(this.mapRow(e));if(!t)continue;l[t.category]=(l[t.category]??0)+1,t.tool&&(u[t.tool]=(u[t.tool]??0)+1),t.errorType&&(d[t.errorType]=(d[t.errorType]??0)+1),t.sessionId&&(f[t.sessionId]=(f[t.sessionId]??0)+1),p.push(t);let n=`${t.traceId??t.sessionId??t.workflowRunId??`global`}|${t.fingerprint}`,r=m.get(n);r?r.occurrenceCount+=1:m.set(n,t)}return{scanned:s.length,matchingLogs:c,truncated:s.length<c,coveragePercent:c===0?100:Math.round(s.length/c*1e4)/100,oldestScannedTimestamp:s.length>0?new Date(Number(s[s.length-1].timestamp)):null,totalIssues:p.length,uniqueIncidents:m.size,byCategory:l,byTool:u,byErrorType:d,bySession:f,issues:[...m.values()].slice(0,i)}}catch(e){throw Error(`Failed to analyze agent issues: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async filterByJob(e,t=1e3){return this.filterByColumn(`job_name`,e,t)}async getTraceTimeline(e,t={},n){try{let r=await this.filterByTrace(e,t,n),i=[];for(let e=0;e<r.length;e+=1){let t=r[e];i.push({timestamp:t.timestamp,service:t.service,spanId:t.spanId??null,parentSpanId:t.parentSpanId??null,level:t.level,message:t.message,duration:t.durationMs??void 0,signalType:t.signalType??`log`,errorType:t.errorType,errorMessage:t.errorMessage})}return i}catch(e){throw Error(`Failed to get trace timeline: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async getStatistics(e,t=`both`,n=`log`,r={}){try{let i=await this.getSqlite(),{whereSql:a,params:o}=this.buildWhereClause({...r,...e?{startTime:e.start,endTime:e.end}:{},...n===`all`?{}:{signalType:n}}),s=`service, level, COUNT(*) as count`,c=`GROUP BY service, level`;return t===`level`?(s=`'' as service, level, COUNT(*) as count`,c=`GROUP BY level`):t===`service`?(s=`service, '' as level, COUNT(*) as count`,c=`GROUP BY service`):t===`agent`?(s=`COALESCE(agent_name, 'unknown') as service, '' as level, COUNT(*) as count`,c=`GROUP BY COALESCE(agent_name, 'unknown')`):t===`workflow`?(s=`COALESCE(workflow_name, workflow_id, 'unknown') as service, '' as level, COUNT(*) as count`,c=`GROUP BY COALESCE(workflow_name, workflow_id, 'unknown')`):t===`job`?(s=`COALESCE(job_name, 'unknown') as service, '' as level, COUNT(*) as count`,c=`GROUP BY COALESCE(job_name, 'unknown')`):t===`signal`&&(s=`COALESCE(signal_type, 'log') as service, '' as level, COUNT(*) as count`,c=`GROUP BY COALESCE(signal_type, 'log')`),K(i.prepare(`\n          SELECT ${s}\n          FROM logs\n          ${a}\n          ${c}\n        `).all(...o)).map(e=>({service:e.service,level:e.level,count:Number(e.count)}))}catch(e){throw Error(`Failed to get statistics: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async getActiveServices(e={},t){try{let n=await this.getSqlite(),{whereSql:r,params:i}=this.buildWhereClause(e);return K(n.prepare(`SELECT DISTINCT service FROM logs ${r} ORDER BY service ASC ${t===void 0?``:`LIMIT ?`}`).all(...i,...t===void 0?[]:[t])).map(e=>e.service)}catch(e){throw Error(`Failed to get active services: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async countByLevel(e){try{let t=await this.getSqlite(),n=Array.isArray(e)?e:[e],r=t.prepare(`\n          SELECT COUNT(*) as count\n          FROM logs\n          WHERE level IN (${n.map(()=>`?`).join(`,`)})\n        `).all(...n);return Number(K(r)[0]?.count??0)}catch(e){throw Error(`Failed to count by level: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async countByService(e){try{let t=await this.getSqlite(),n=Array.isArray(e)?e:[e],r=t.prepare(`\n          SELECT COUNT(*) as count\n          FROM logs\n          WHERE service IN (${n.map(()=>`?`).join(`,`)})\n        `).all(...n);return Number(K(r)[0]?.count??0)}catch(e){throw Error(`Failed to count by service: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async countByTrace(e){try{let t=K((await this.getSqlite()).prepare(`SELECT COUNT(*) as count FROM logs WHERE trace_id = ?`).all(e));return Number(t[0]?.count??0)}catch(e){throw Error(`Failed to count by trace: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async queryLogs(e){try{let t=await this.getSqlite(),{order:n=`desc`,limit:r=25,offset:i=0,...a}=e,o=n===`asc`?`ASC`:`DESC`,{whereSql:s,params:c}=this.buildWhereClause(a),l=K(t.prepare(`\n          SELECT COUNT(*) as count\n          FROM logs\n          ${s}\n        `).all(...c));return{logs:K(t.prepare(`\n          SELECT ${G}\n          FROM logs\n          ${s}\n          ORDER BY timestamp ${o}\n          LIMIT ?\n          OFFSET ?\n        `).all(...c,r,i)).map(e=>this.mapRow(e)),total:Number(l[0]?.count??0)}}catch(e){throw Error(`Failed to query logs: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}};q=p([r(),f(0,n(u.LogStorageService)),d(`design:paramtypes`,[Object])],q);function fe(e){return e}const pe=/* @__PURE__ */ new Set([`AND`,`OR`,`NOT`]),me=/^[A-Za-z0-9_]+\\*?$/;function J(e,t){let n=``;for(let r=0;r<e.length;r+=1){let i=e[r];n+=i.charCodeAt(0)<=31?t:i}return n}function Y(e){let t=J(e,` `).trim();return t?`\"${t.replace(/\"/g,`\"\"`)}\"`:``}function he(e){let t=[],n=``,r=``,i=!1,a=()=>{let e=n.trim();if(e)for(let n of e.split(/\\s+/))t.push({value:n,quoted:!1});n=``},o=()=>{t.push({value:r,quoted:!0}),r=``};for(let t of e)t===`\"`?(i?o():a(),i=!i):i?r+=t:n+=t;return i?o():a(),t}function ge(e){return he(e).map(e=>{if(e.quoted)return Y(e.value);let t=J(e.value,``).trim();return t?pe.has(t)||me.test(t)?t:Y(t):``}).filter(Boolean).join(` `).trim()}function X(e,t,n,r,i){let a=e[t];typeof a==`string`&&(r.push(`${n} = ?`),i.push(a))}let Z=class{storage;constructor(e){this.storage=e}async getSqlite(){return await this.storage.ensureInitialized(),this.storage.getSqliteClient()}buildSearchSql(e,t={}){let n=ge(e);if(!n)throw Error(`Search query is empty after sanitization`);let r=[`logs_search MATCH ?`],i=[n];if(t.service){let e=Array.isArray(t.service)?t.service:[t.service];r.push(`logs.service IN (${e.map(()=>`?`).join(`,`)})`),i.push(...e)}if(t.level){let e=Array.isArray(t.level)?t.level:[t.level];r.push(`logs.level IN (${e.map(()=>`?`).join(`,`)})`),i.push(...e)}return X(t,`traceId`,`logs.trace_id`,r,i),X(t,`spanId`,`logs.span_id`,r,i),X(t,`errorType`,`logs.error_type`,r,i),X(t,`sessionId`,`logs.session_id`,r,i),X(t,`workflowRunId`,`logs.workflow_run_id`,r,i),X(t,`workflowName`,`logs.workflow_name`,r,i),X(t,`jobName`,`logs.job_name`,r,i),X(t,`jobId`,`logs.job_id`,r,i),X(t,`agentName`,`logs.agent_name`,r,i),X(t,`parentSessionId`,`logs.parent_session_id`,r,i),X(t,`workflowRunKey`,`logs.workflow_run_key`,r,i),X(t,`workflowId`,`logs.workflow_id`,r,i),X(t,`workflowWorkspace`,`logs.workflow_workspace`,r,i),X(t,`stepName`,`logs.step_name`,r,i),X(t,`phase`,`logs.phase`,r,i),X(t,`signalType`,`COALESCE(logs.signal_type, 'log')`,r,i),t.startTime&&(r.push(`logs.timestamp >= ?`),i.push(t.startTime.getTime())),t.endTime&&(r.push(`logs.timestamp <= ?`),i.push(t.endTime.getTime())),{whereSql:`WHERE ${r.join(` AND `)}`,params:i}}mapSearchRow(e){return{id:e.id,timestamp:new Date(e.timestamp),level:e.level,message:e.message,traceId:e.traceId,spanId:e.spanId,parentSpanId:e.parentSpanId,service:e.service,hostname:e.hostname,pid:e.pid,metadata:e.metadata?JSON.parse(e.metadata):null,errorType:e.errorType,errorMessage:e.errorMessage,errorStack:e.errorStack,sessionId:e.sessionId,workflowRunId:e.workflowRunId,workflowName:e.workflowName,jobName:e.jobName,jobId:e.jobId,agentName:e.agentName,parentSessionId:e.parentSessionId,workflowRunKey:e.workflowRunKey,workflowId:e.workflowId,workflowWorkspace:e.workflowWorkspace,stepName:e.stepName,phase:e.phase,signalType:e.signalType??`log`,durationMs:e.durationMs,createdAt:new Date(e.createdAt),rank:e.rank}}async searchLogs(e,t={},n=100){let{results:r}=await this.searchLogsPaginated(e,{...t,offset:0},n);return r}async searchLogsPaginated(e,t={},n=100){try{let r=await this.getSqlite(),{whereSql:i,params:a}=this.buildSearchSql(e,t),o=t.offset??0,s=`\n        SELECT COUNT(*) as total\n        FROM logs_search\n        JOIN logs ON logs.rowid = logs_search.rowid\n        ${i}\n      `,c=`\n        SELECT\n          logs.id as id,\n          logs.timestamp as timestamp,\n          logs.level as level,\n          logs.message as message,\n          logs.trace_id as traceId,\n          logs.span_id as spanId,\n          logs.parent_span_id as parentSpanId,\n          logs.service as service,\n          logs.hostname as hostname,\n          logs.pid as pid,\n          logs.metadata as metadata,\n          logs.error_type as errorType,\n          logs.error_message as errorMessage,\n          logs.error_stack as errorStack,\n          logs.session_id as sessionId,\n          logs.workflow_run_id as workflowRunId,\n          logs.workflow_name as workflowName,\n          logs.job_name as jobName,\n          logs.job_id as jobId,\n          logs.agent_name as agentName,\n          logs.parent_session_id as parentSessionId,\n          logs.workflow_run_key as workflowRunKey,\n          logs.workflow_id as workflowId,\n          logs.workflow_workspace as workflowWorkspace,\n          logs.step_name as stepName,\n          logs.phase as phase,\n          logs.signal_type as signalType,\n          logs.duration_ms as durationMs,\n          logs.created_at as createdAt,\n          logs_search.rank as rank\n        FROM logs_search\n        JOIN logs ON logs.rowid = logs_search.rowid\n        ${i}\n        ORDER BY rank\n        LIMIT ?\n        OFFSET ?\n      `,l=r.prepare(s).get(...a);return{results:fe(r.prepare(c).all(...a,n,o)).map(e=>this.mapSearchRow(e)),total:Number(l.total??0)}}catch(e){throw Error(`Failed to search logs: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}rankResults(e){return e.sort((e,t)=>e.rank-t.rank)}};Z=p([r(),f(0,n(u.LogStorageService)),d(`design:paramtypes`,[Object])],Z);function Q(e){return e}let $=class{sqlite=null;embeddingWriter=null;databasePath=null;useInMemory=!1;setEmbeddingWriter(e){this.embeddingWriter=e}async openReadOnlyDatabase(e){if(this.sqlite)throw Error(`Database is already open.`);if(!(await a(e)).isFile())throw Error(`Log database path is not a file.`);let t=new s(e,{readOnly:!0});try{t.prepare(`SELECT id, timestamp, message FROM logs LIMIT 0`).all(),t.exec(`PRAGMA busy_timeout = 5000`),this.sqlite=t,this.databasePath=e,this.useInMemory=!1}catch(e){throw t.close(),e}}async initializeDatabase(e,t=!1){try{let n=t?`:memory:`:e;if(this.databasePath=n,this.useInMemory=t,!t){let e=o(n);await i(e,{recursive:!0})}this.sqlite=new s(n,{allowExtension:!0}),c.load(this.sqlite),this.sqlite.exec(`PRAGMA busy_timeout = 5000`),t||this.sqlite.exec(`PRAGMA journal_mode = WAL`),this.sqlite.exec(`PRAGMA foreign_keys = ON`),this.sqlite.exec(`\n        CREATE TABLE IF NOT EXISTS logs (\n          id text PRIMARY KEY NOT NULL,\n          timestamp integer NOT NULL,\n          level text NOT NULL,\n          message text NOT NULL,\n          trace_id text,\n          span_id text,\n          parent_span_id text,\n          service text NOT NULL,\n          hostname text,\n          pid integer,\n          metadata text,\n          error_type text,\n          error_message text,\n          error_stack text,\n          session_id text,\n          workflow_run_id text,\n          workflow_name text,\n          job_name text,\n          job_id text,\n          agent_name text,\n          parent_session_id text,\n          workflow_run_key text,\n          workflow_id text,\n          workflow_workspace text,\n          step_name text,\n          phase text,\n          signal_type text,\n          duration_ms integer,\n          created_at integer NOT NULL\n        )\n      `),this.ensureLogColumns({session_id:`text`,workflow_run_id:`text`,workflow_name:`text`,job_name:`text`,job_id:`text`,agent_name:`text`,parent_session_id:`text`,workflow_run_key:`text`,workflow_id:`text`,workflow_workspace:`text`,step_name:`text`,phase:`text`,signal_type:`text`,duration_ms:`integer`}),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_timestamp_idx ON logs (timestamp)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_level_idx ON logs (level)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_trace_id_idx ON logs (trace_id)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_span_id_idx ON logs (span_id)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_parent_span_id_idx ON logs (parent_span_id)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_service_idx ON logs (service)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_error_type_idx ON logs (error_type)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_session_id_idx ON logs (session_id)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_workflow_run_id_idx ON logs (workflow_run_id)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_job_name_idx ON logs (job_name)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_agent_name_idx ON logs (agent_name)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_workflow_run_key_idx ON logs (workflow_run_key)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_workflow_workspace_idx ON logs (workflow_workspace)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_step_name_idx ON logs (step_name)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS logs_signal_type_idx ON logs (signal_type)`),this.sqlite.exec(`\n        CREATE TABLE IF NOT EXISTS hook_tracking (\n          session_id text NOT NULL,\n          workspace_key text NOT NULL,\n          checkpoint_id text NOT NULL,\n          updated_at integer NOT NULL,\n          PRIMARY KEY (session_id, workspace_key)\n        )\n      `),this.sqlite.exec(`\n        CREATE TABLE IF NOT EXISTS log_embeddings (\n          log_id text PRIMARY KEY NOT NULL,\n          embedding text NOT NULL,\n          service text NOT NULL,\n          level text NOT NULL,\n          created_at integer NOT NULL,\n          FOREIGN KEY (log_id) REFERENCES logs(id) ON DELETE CASCADE\n        ) STRICT\n      `),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS log_embeddings_service_idx ON log_embeddings (service)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS log_embeddings_level_idx ON log_embeddings (level)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS log_embeddings_created_at_idx ON log_embeddings (created_at)`),this.sqlite.exec(`\n        CREATE TABLE IF NOT EXISTS metric_points (\n          id text PRIMARY KEY NOT NULL,\n          timestamp integer NOT NULL,\n          service text NOT NULL,\n          metric text NOT NULL,\n          value real NOT NULL,\n          unit text,\n          pid integer,\n          hostname text,\n          attributes text\n        ) STRICT\n      `),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS metric_points_timestamp_metric_idx ON metric_points (timestamp, metric)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS metric_points_service_idx ON metric_points (service)`),this.sqlite.exec(`CREATE INDEX IF NOT EXISTS metric_points_pid_idx ON metric_points (pid)`),this.sqlite.exec(`\n        CREATE VIRTUAL TABLE IF NOT EXISTS logs_search USING fts5(\n          id UNINDEXED,\n          message,\n          error_message,\n          content='logs',\n          content_rowid='rowid'\n        )\n      `),this.sqlite.exec(`\n        CREATE TRIGGER IF NOT EXISTS logs_ai AFTER INSERT ON logs BEGIN\n          INSERT INTO logs_search(rowid, id, message, error_message)\n          VALUES (new.rowid, new.id, new.message, new.error_message);\n        END;\n      `),this.sqlite.exec(`\n        CREATE TRIGGER IF NOT EXISTS logs_ad AFTER DELETE ON logs BEGIN\n          INSERT INTO logs_search(logs_search, rowid, id, message, error_message)\n          VALUES ('delete', old.rowid, old.id, old.message, old.error_message);\n        END;\n      `),this.sqlite.exec(`\n        CREATE TRIGGER IF NOT EXISTS logs_au AFTER UPDATE ON logs BEGIN\n          INSERT INTO logs_search(logs_search, rowid, id, message, error_message)\n          VALUES ('delete', old.rowid, old.id, old.message, old.error_message);\n          INSERT INTO logs_search(rowid, id, message, error_message)\n          VALUES (new.rowid, new.id, new.message, new.error_message);\n        END;\n      `)}catch(e){throw Error(`Failed to initialize database: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}ensureLogColumns(e){if(!this.sqlite)return;let t=new Set(this.sqlite.prepare(`PRAGMA table_info(logs)`).all().map(e=>e.name));for(let[n,r]of Object.entries(e))t.has(n)||this.sqlite.exec(`ALTER TABLE logs ADD COLUMN ${n} ${r}`)}getDefaultDbPath(){return e({packageName:t}).dbPath}isInitialized(){return this.sqlite!==null}async ensureInitialized(){this.sqlite||await this.initializeDatabase(this.getDefaultDbPath())}mapRow(e){return{id:e.id,timestamp:new Date(Number(e.timestamp)),level:e.level,message:e.message,traceId:e.trace_id,spanId:e.span_id,parentSpanId:e.parent_span_id,service:e.service,hostname:e.hostname,pid:e.pid,metadata:e.metadata?JSON.parse(e.metadata):null,errorType:e.error_type,errorMessage:e.error_message,errorStack:e.error_stack,sessionId:e.session_id,workflowRunId:e.workflow_run_id,workflowName:e.workflow_name,jobName:e.job_name,jobId:e.job_id,agentName:e.agent_name,parentSessionId:e.parent_session_id,workflowRunKey:e.workflow_run_key,workflowId:e.workflow_id,workflowWorkspace:e.workflow_workspace,stepName:e.step_name,phase:e.phase,signalType:e.signal_type??`log`,durationMs:e.duration_ms,createdAt:new Date(Number(e.created_at))}}prepareLogRecord(e){let t=/* @__PURE__ */ new Date;return{id:e.id??l(),timestamp:e.timestamp??t,level:e.level,message:e.message,traceId:e.traceId??null,spanId:e.spanId??null,parentSpanId:e.parentSpanId??null,service:e.service,hostname:e.hostname??null,pid:e.pid??null,metadata:e.metadata??null,errorType:e.errorType??null,errorMessage:e.errorMessage??null,errorStack:e.errorStack??null,sessionId:e.sessionId??null,workflowRunId:e.workflowRunId??null,workflowName:e.workflowName??null,jobName:e.jobName??null,jobId:e.jobId??null,agentName:e.agentName??null,parentSessionId:e.parentSessionId??null,workflowRunKey:e.workflowRunKey??null,workflowId:e.workflowId??null,workflowWorkspace:e.workflowWorkspace??null,stepName:e.stepName??null,phase:e.phase??null,signalType:e.signalType??`log`,durationMs:e.durationMs??null,createdAt:e.createdAt??t}}getDatabaseClient(){if(!this.sqlite)throw Error(`Database not initialized. Call initializeDatabase() first.`);return this.sqlite}getSqliteClient(){if(!this.sqlite)throw Error(`Database not initialized. Call initializeDatabase() first.`);return this.sqlite}getDatabasePath(){return this.useInMemory||this.databasePath===`:memory:`?null:this.databasePath}async getDatabaseSizeBytes(){let e=this.getDatabasePath();if(!e)return null;let t=[e,`${e}-wal`,`${e}-shm`];return(await Promise.all(t.map(async e=>{try{return(await a(e)).size}catch{return 0}}))).reduce((e,t)=>e+t,0)}async getLiveDataBytes(){let e=this.getSqliteClient(),{page_count:t}=e.prepare(`PRAGMA page_count`).get(),{freelist_count:n}=e.prepare(`PRAGMA freelist_count`).get(),{page_size:r}=e.prepare(`PRAGMA page_size`).get();return(t-n)*r}async deleteOldestEntries(e){if(!Number.isInteger(e)||e<=0)return 0;let t=this.getSqliteClient();t.exec(`BEGIN IMMEDIATE`);try{let{cutoff:n}=t.prepare(`\n        SELECT MAX(timestamp) AS cutoff FROM (\n          SELECT timestamp FROM (\n            SELECT timestamp FROM logs\n            UNION ALL\n            SELECT timestamp FROM metric_points\n          ) ORDER BY timestamp LIMIT ?\n        )\n      `).get(e),r=t.prepare(`DELETE FROM logs WHERE timestamp <= ?`).run(n),i=t.prepare(`DELETE FROM metric_points WHERE timestamp <= ?`).run(n);return t.exec(`COMMIT`),Number(r.changes)+Number(i.changes)}catch(e){throw t.exec(`ROLLBACK`),Error(`Failed to delete oldest entries: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async compactDatabase(){try{if(!this.sqlite)throw Error(`Database not initialized`);this.sqlite.exec(`PRAGMA wal_checkpoint(TRUNCATE)`),this.sqlite.exec(`VACUUM`),this.sqlite.exec(`PRAGMA wal_checkpoint(TRUNCATE)`)}catch(e){throw Error(`Failed to compact database: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async insertLog(e){try{let t=this.getSqliteClient(),n=this.prepareLogRecord(e);return t.prepare(`\n            INSERT INTO logs (\n              id, timestamp, level, message, trace_id, span_id, parent_span_id,\n              service, hostname, pid, metadata, error_type, error_message,\n              error_stack, session_id, workflow_run_id, workflow_name, job_name,\n              job_id, agent_name, parent_session_id, workflow_run_key, workflow_id,\n              workflow_workspace, step_name, phase, signal_type, duration_ms, created_at\n            )\n            VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n          `).run(n.id,n.timestamp.getTime(),n.level,n.message,n.traceId,n.spanId,n.parentSpanId,n.service,n.hostname,n.pid,n.metadata?JSON.stringify(n.metadata):null,n.errorType,n.errorMessage,n.errorStack,n.sessionId,n.workflowRunId,n.workflowName,n.jobName,n.jobId,n.agentName,n.parentSessionId,n.workflowRunKey,n.workflowId,n.workflowWorkspace,n.stepName,n.phase,n.signalType,n.durationMs,n.createdAt.getTime()),await this.tryIndexEmbeddings([n]),n}catch(e){throw Error(`Failed to insert log: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async insertBatch(e){try{if(e.length===0)return[];let t=this.getSqliteClient(),n=e.map(e=>this.prepareLogRecord(e));t.exec(`BEGIN`);try{let e=t.prepare(`\n          INSERT INTO logs (\n            id, timestamp, level, message, trace_id, span_id, parent_span_id,\n            service, hostname, pid, metadata, error_type, error_message,\n            error_stack, session_id, workflow_run_id, workflow_name, job_name,\n            job_id, agent_name, parent_session_id, workflow_run_key, workflow_id,\n            workflow_workspace, step_name, phase, signal_type, duration_ms, created_at\n          )\n          VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n        `);for(let t of n)e.run(t.id,t.timestamp.getTime(),t.level,t.message,t.traceId,t.spanId,t.parentSpanId,t.service,t.hostname,t.pid,t.metadata?JSON.stringify(t.metadata):null,t.errorType,t.errorMessage,t.errorStack,t.sessionId,t.workflowRunId,t.workflowName,t.jobName,t.jobId,t.agentName,t.parentSessionId,t.workflowRunKey,t.workflowId,t.workflowWorkspace,t.stepName,t.phase,t.signalType,t.durationMs,t.createdAt.getTime());t.exec(`COMMIT`)}catch(e){throw t.exec(`ROLLBACK`),e}return await this.tryIndexEmbeddings(n),n}catch(e){throw Error(`Failed to insert batch: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async tryIndexEmbeddings(e){this.embeddingWriter&&e.length!==0&&this.embeddingWriter(e).catch(e=>{console.warn(`Failed to index semantic embeddings: ${e instanceof Error?e.message:String(e)}`)})}async queryLogs(e={}){try{let t=this.getSqliteClient(),n=`WHERE 1 = 1`,r=[];if(e.level){let t=Array.isArray(e.level)?e.level:[e.level];t.length===1?(n+=` AND level = ?`,r.push(t[0])):(n+=` AND level IN (${t.map(()=>`?`).join(`,`)})`,r.push(...t))}if(e.service){let t=Array.isArray(e.service)?e.service:[e.service];t.length===1?(n+=` AND service = ?`,r.push(t[0])):(n+=` AND service IN (${t.map(()=>`?`).join(`,`)})`,r.push(...t))}e.traceId&&(n+=` AND trace_id = ?`,r.push(e.traceId)),e.spanId&&(n+=` AND span_id = ?`,r.push(e.spanId)),e.errorType&&(n+=` AND error_type = ?`,r.push(e.errorType)),e.sessionId&&(n+=` AND session_id = ?`,r.push(e.sessionId)),e.workflowRunId&&(n+=` AND workflow_run_id = ?`,r.push(e.workflowRunId)),e.workflowName&&(n+=` AND workflow_name = ?`,r.push(e.workflowName)),e.jobName&&(n+=` AND job_name = ?`,r.push(e.jobName));let i=[[`job_id`,e.jobId],[`agent_name`,e.agentName],[`parent_session_id`,e.parentSessionId],[`workflow_run_key`,e.workflowRunKey],[`workflow_id`,e.workflowId],[`workflow_workspace`,e.workflowWorkspace],[`step_name`,e.stepName],[`phase`,e.phase]];for(let[e,t]of i)t&&(n+=` AND ${e} = ?`,r.push(t));e.signalType&&(n+=` AND COALESCE(signal_type, 'log') = ?`,r.push(e.signalType)),e.startTime&&(n+=` AND timestamp >= ?`,r.push(e.startTime.getTime())),e.endTime&&(n+=` AND timestamp <= ?`,r.push(e.endTime.getTime()));let a=e.limit??100,o=e.offset??0;return Q(t.prepare(`\n          SELECT *\n          FROM logs\n          ${n}\n          ORDER BY timestamp DESC\n          LIMIT ?\n          OFFSET ?\n        `).all(...r,a,o)).map(e=>this.mapRow(e))}catch(e){throw Error(`Failed to query logs: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async deleteAllLogs(){try{let e=this.getSqliteClient().prepare(`DELETE FROM logs`).run();return Number(e.changes??0)}catch(e){throw Error(`Failed to delete all logs: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async getHookCheckpoint(e,t){try{return Q(this.getSqliteClient().prepare(`\n          SELECT checkpoint_id\n          FROM hook_tracking\n          WHERE session_id = ? AND workspace_key = ?\n          LIMIT 1\n        `).all(e,t))[0]?.checkpoint_id??null}catch(e){throw Error(`Failed to get hook checkpoint: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async setHookCheckpoint(e,t,n){try{this.getSqliteClient().prepare(`\n          INSERT INTO hook_tracking (session_id, workspace_key, checkpoint_id, updated_at)\n          VALUES (?, ?, ?, ?)\n          ON CONFLICT(session_id, workspace_key) DO UPDATE SET\n            checkpoint_id = excluded.checkpoint_id,\n            updated_at = excluded.updated_at\n        `).run(e,t,n,Math.floor(Date.now()/1e3))}catch(e){throw Error(`Failed to set hook checkpoint: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async disconnect(){this.sqlite&&(this.sqlite.close(),this.sqlite=null,this.databasePath=null,this.useInMemory=!1)}};$=p([r()],$);export{D as a,f as c,W as i,d as l,Z as n,O as o,q as r,p as s,$ as t,u};\n//# sourceMappingURL=LogStorageService-FUtAkl3y.mjs.map","import e from\"node:fs/promises\";import t from\"node:path\";import n from\"node:os\";import{execFileSync as r}from\"node:child_process\";import{PortRegistryService as i}from\"@agimon-ai/foundation-port-registry\";import{z as a}from\"zod\";const o=t.join(n.homedir(),`.process-registry`,`processes.turso.sqlite`),s=`${o}.lock`,c=75,l=80,u=5e3,d=`PROCESS_REGISTRY_TAG`,f=`PROCESS_REGISTRY_OWNER_KIND`,p=`PROCESS_REGISTRY_OWNER_ID`,m=e=>t.resolve(e);function h(e){let t=_(e),n=_(process.env[d]),r=[...t??[],...n??[]];if(r.length!==0)return Array.from(new Set(r))}function g(e,n){if(!e)return;let r=t.resolve(e);return t.extname(r)?t.join(t.dirname(r),n):t.join(r,n)}function _(e){if(e===void 0)return;let t=(Array.isArray(e)?e:e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)).map(e=>e.trim()).filter(e=>e.length>0);return t.length>0?t:void 0}const v=1,y=a.enum([`service`,`tool`]),b=a.enum([`ephemeral`,`durable`]),x=a.enum([`direct`,`process-group`]),S=a.record(a.string(),a.unknown()),C=a.object({ownerKind:a.string().trim().min(1).optional(),ownerId:a.string().trim().min(1).optional(),resourceKey:a.string().trim().min(1).optional(),worktreePath:a.string().trim().min(1).optional(),launchId:a.string().trim().min(1).optional(),leaseId:a.string().trim().min(1).optional()}),w=a.object({processGroupId:a.number().int().min(1).optional(),processStartedAt:a.string().trim().min(1).optional(),terminationMode:x.optional(),lifetime:b.optional()}),T=a.object({repositoryPath:a.string().trim().min(1,`repositoryPath is required`),serviceName:a.string().trim().min(1,`serviceName is required`),serviceType:y,environment:a.string().trim().min(1).optional(),pid:a.number().int().min(1),port:a.number().int().min(1).max(65535).optional(),host:a.string().trim().min(1).optional(),command:a.string().trim().min(1).optional(),args:a.array(a.string()).optional(),tags:a.array(a.string().trim().min(1)).optional(),metadata:S.optional(),createdAt:a.string().trim().min(1),updatedAt:a.string().trim().min(1)}).extend(C.shape).extend(w.shape),E=a.object({version:a.literal(1),updatedAt:a.string().trim().min(1),entries:a.array(T)}),D=a.object({repositoryPath:a.string().trim().min(1),serviceName:a.string().trim().min(1),serviceType:y.default(`service`),environment:a.string().trim().min(1).optional(),pid:a.number().int().min(1),port:a.number().int().min(1).max(65535).optional(),host:a.string().trim().min(1).optional(),command:a.string().trim().min(1).optional(),args:a.array(a.string()).optional(),tags:a.array(a.string().trim().min(1)).optional(),metadata:S.optional(),force:a.boolean().optional()}).extend(C.shape).extend(w.shape),O=a.object({repositoryPath:a.string().trim().min(1),serviceName:a.string().trim().min(1),serviceType:y.optional(),pid:a.number().int().min(1).optional(),environment:a.string().trim().min(1).optional(),tags:a.array(a.string().trim().min(1)).optional(),force:a.boolean().optional(),kill:a.boolean().optional().default(!0),releasePort:a.boolean().optional().default(!0)}).extend(C.partial().shape),k=a.object({repositoryPath:a.string().trim().min(1).optional(),serviceType:y.optional(),serviceName:a.string().trim().min(1).optional(),environment:a.string().trim().min(1).optional(),tags:a.array(a.string().trim().min(1)).optional(),liveOnly:a.boolean().optional()}).extend(C.partial().omit({launchId:!0,leaseId:!0}).shape),A=k.extend({pid:a.number().int().min(1).optional(),launchId:a.string().trim().min(1).optional(),leaseId:a.string().trim().min(1).optional(),force:a.boolean().optional(),kill:a.boolean().optional().default(!0),releasePort:a.boolean().optional().default(!0)}),j=a.object({success:a.boolean(),pid:a.number().int().min(1).optional(),record:T.optional(),error:a.string().optional()}),M=a.object({success:a.boolean(),scanned:a.number().int().min(0),removed:a.number().int().min(0),error:a.string().optional()}),N=a.object({success:a.boolean(),released:a.number().int().min(0),error:a.string().optional()});var P=class extends Error{code;constructor(e,t,n){super(e,n),this.name=`ProcessRegistryError`,this.code=t}};const F=`process_registrations`,I=`registry_metadata`,L=`legacy_json_import_v1`,R=6e3,z=`REGISTRY_READ_FAILED`,B=new Map;var V=class n{registryPath;legacyRegistryPath;sqlite=null;initialization=null;constructor(e=o,t,r=new i(process.env.PORT_REGISTRY_PATH)){this.portRegistry=r,this.registryPath=n.resolveRegistryPath(e),this.legacyRegistryPath=n.resolveLegacyRegistryPath(e)}static resolveRegistryPath(e){let r=n.resolveInputPath(e??o),i=t.extname(r);return i===`.json`?r.slice(0,-i.length)+`.sqlite`:i===`.sqlite`||i===`.db`?r:t.join(r,`processes.sqlite`)}async registerProcess(e){let t=D.parse(e),n=await this.getDb(),r=m(t.repositoryPath),i=t.serviceType??`service`,a=t.environment??process.env.NODE_ENV??`development`,o=h(t.tags),s=t.worktreePath?m(t.worktreePath):void 0,c=t.processStartedAt??this.readProcessStartedAt(t.pid);if(t.terminationMode===`process-group`&&t.processGroupId!==t.pid)return this.createFailureResponse(`Process-group termination requires processGroupId to equal the registered pid`);for(let e=0;e<3;e+=1){let e=this.findRegistrationRow(n,r,t.serviceName,i,a,{ownerKind:t.ownerKind,ownerId:t.ownerId,resourceKey:t.resourceKey,worktreePath:s}),l=e?this.toRecord(e):void 0;if(l&&l.pid!==t.pid&&this.isProcessRunning(l.pid)){if(!(t.force??!1))return this.createFailureResponse(`Process already registered for ${t.serviceName} in requested scope`);await this.terminateProcess(l)}let u=await this.withImmediateTransaction(n,()=>{let l=this.findRegistrationRow(n,r,t.serviceName,i,a,{ownerKind:t.ownerKind,ownerId:t.ownerId,resourceKey:t.resourceKey,worktreePath:s});if(l?.id!==e?.id||l?.pid!==e?.pid)return;if(l?.pid===t.pid){let e=this.toRecord(l),r=new Date().toISOString();return n.prepare(`UPDATE ${F}\n             SET port = ?, host = ?, command = ?, args_json = ?, tags_json = ?, metadata_json = ?,\n                 owner_kind = ?, owner_id = ?, resource_key = ?, worktree_path = ?, launch_id = ?, lease_id = ?,\n                 process_group_id = ?, process_started_at = ?, termination_mode = ?, lifetime = ?, updated_at = ?\n             WHERE id = ?`).run(t.port??e.port??null,t.host??e.host??null,t.command??e.command??null,JSON.stringify(t.args??e.args??[]),JSON.stringify(o??e.tags??[]),JSON.stringify(t.metadata??e.metadata??{}),t.ownerKind??e.ownerKind??null,t.ownerId??e.ownerId??null,t.resourceKey??e.resourceKey??null,s??e.worktreePath??null,t.launchId??e.launchId??null,t.leaseId??e.leaseId??null,t.processGroupId??e.processGroupId??null,c??e.processStartedAt??null,t.terminationMode??e.terminationMode??null,t.lifetime??e.lifetime??null,r,l.id),n.prepare(`SELECT * FROM ${F} WHERE id = ?`).get(l.id)}l&&n.prepare(`DELETE FROM ${F} WHERE id = ? AND pid = ?`).run(l.id,l.pid);let u=new Date().toISOString(),d=n.prepare(`INSERT INTO ${F} (\n               repository_path, service_name, service_type, environment, pid, port, host,\n               command, args_json, tags_json, metadata_json, owner_kind, owner_id, resource_key, worktree_path,\n               launch_id, lease_id, process_group_id, process_started_at, termination_mode, lifetime,\n               created_at, updated_at\n             ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(r,t.serviceName,i,a,t.pid,t.port??null,t.host??null,t.command??null,t.args?JSON.stringify(t.args):null,o?JSON.stringify(o):null,t.metadata?JSON.stringify(t.metadata):null,t.ownerKind??null,t.ownerId??null,t.resourceKey??null,s??null,t.launchId??null,t.leaseId??null,t.processGroupId??null,c??null,t.terminationMode??null,t.lifetime??null,u,u);return n.prepare(`SELECT * FROM ${F} WHERE id = ?`).get(Number(d.lastInsertRowid))});if(u)return l&&l.pid!==t.pid&&await this.releaseAssociatedPort(l),this.createSuccessResponse(t.pid,this.toRecord(u))}return this.createFailureResponse(`Process registration for ${t.serviceName} changed during 3 replacement attempts`)}async releaseProcess(e){let t=O.parse(e),n=await this.releaseProcesses(t);return n.success?this.createSuccessResponse():this.createFailureResponse(n.error??`No matching process entry for ${t.serviceName}`)}async releaseProcesses(e){let t=A.parse(e),n=await this.getDb(),r=this.normalizeReleaseFilters(t),i=this.queryRows(n,r,!0).filter(e=>this.matchesTags(this.toRecord(e).tags,r.tags));if(i.length===0)return N.parse({success:!0,released:0});let a=[],o=0;for(let e of i){let i=this.toRecord(e);try{t.kill&&this.isProcessRunning(i.pid)&&(this.assertDestructiveReleaseOwnership(i,r,t.force??!1),await this.terminateProcess(i));let a=this.removeRows(n,[e]);if(a!==1)throw Error(`Refusing release because the process registration changed`);o+=a,t.releasePort&&await this.releaseAssociatedPort(i)}catch(e){a.push(`${i.serviceName} (pid ${i.pid}): ${e instanceof Error?e.message:String(e)}`)}}return N.parse({success:a.length===0,released:o,...a.length>0?{error:a.join(`; `)}:{}})}async listProcesses(e={}){let t=k.parse(e),n=await this.getDb(),r=this.normalizeListFilters(t);return this.queryRows(n,r).map(e=>this.toRecord(e)).filter(e=>this.matchesTags(e.tags,r.tags)).filter(e=>t.liveOnly!==!0||this.isProcessRunning(e.pid))}async cleanupStaleProcesses(e={}){let t=k.parse(e),n=await this.getDb(),r=this.normalizeListFilters(t),i=this.queryRows(n,r).filter(e=>this.matchesTags(this.toRecord(e).tags,r.tags)),a=[];await Promise.all(i.map(async e=>{(!await this.pathExists(e.repository_path)||!this.isProcessRunning(e.pid))&&a.push(e)}));for(let e of a)await this.releaseAssociatedPort(this.toRecord(e));let o=this.removeRows(n,a);return M.parse({success:!0,scanned:i.length,removed:o})}close(){this.sqlite?.close(),this.sqlite=null,this.initialization=null}static resolveInputPath(e){return t.isAbsolute(e)?e:t.join(process.cwd(),e)}static resolveLegacyRegistryPath(e){let r=n.resolveInputPath(e),i=t.extname(r);return i===`.json`?r:i===`.sqlite`||i===`.db`?r.slice(0,-i.length)+`.json`:t.join(r,`processes.json`)}async getDb(){return this.sqlite?this.sqlite:(this.initialization||=this.initializeDatabase(),this.initialization)}async initializeDatabase(){try{await e.mkdir(t.dirname(this.registryPath),{recursive:!0});let{Database:n}=await import(`@tursodatabase/database/compat`),r=new n(this.registryPath,{experimental:[`multiprocess_wal`],timeout:R});return r.pragma(`busy_timeout = ${R}`,{}),r.pragma(`journal_mode = WAL`,{}),r.pragma(`synchronous = NORMAL`,{}),r.exec(`\n        CREATE TABLE IF NOT EXISTS ${I} (\n          key TEXT PRIMARY KEY,\n          value TEXT NOT NULL\n        );\n        CREATE TABLE IF NOT EXISTS ${F} (\n          id INTEGER PRIMARY KEY AUTOINCREMENT,\n          repository_path TEXT NOT NULL,\n          service_name TEXT NOT NULL,\n          service_type TEXT NOT NULL,\n          environment TEXT NOT NULL,\n          pid INTEGER NOT NULL,\n          port INTEGER,\n          host TEXT,\n          command TEXT,\n          args_json TEXT,\n          tags_json TEXT,\n          metadata_json TEXT,\n          owner_kind TEXT,\n          owner_id TEXT,\n          resource_key TEXT,\n          worktree_path TEXT,\n          launch_id TEXT,\n          lease_id TEXT,\n          process_group_id INTEGER,\n          process_started_at TEXT,\n          termination_mode TEXT,\n          lifetime TEXT,\n          created_at TEXT NOT NULL,\n          updated_at TEXT NOT NULL\n        );\n      `),this.ensureOwnershipColumns(r),this.removeLegacyScopeConstraint(r),r.exec(`\n        CREATE UNIQUE INDEX IF NOT EXISTS process_registrations_owner_scope_uidx\n          ON ${F} (\n            repository_path, service_name, service_type, environment,\n            COALESCE(owner_kind, ''), COALESCE(owner_id, ''), COALESCE(resource_key, ''),\n            COALESCE(worktree_path, '')\n          );\n        CREATE INDEX IF NOT EXISTS process_registrations_scope_idx\n          ON ${F} (repository_path, service_name, service_type, environment);\n        CREATE INDEX IF NOT EXISTS process_registrations_pid_idx ON ${F} (pid);\n        CREATE INDEX IF NOT EXISTS process_registrations_lease_idx ON ${F} (lease_id);\n        CREATE INDEX IF NOT EXISTS process_registrations_owner_idx\n          ON ${F} (repository_path, owner_kind, owner_id, resource_key, worktree_path);\n      `),this.sqlite=r,await this.importLegacyJson(r),r}catch(e){throw this.sqlite?.close(),this.sqlite=null,this.initialization=null,new P(`Failed to initialize registry database: ${e instanceof Error?e.message:String(e)}`,z,{cause:e})}}ensureOwnershipColumns(e){let t=new Set(e.prepare(`PRAGMA table_info(${F})`).all().map(e=>e.name));for(let[n,r]of[[`owner_kind`,`TEXT`],[`owner_id`,`TEXT`],[`resource_key`,`TEXT`],[`worktree_path`,`TEXT`],[`launch_id`,`TEXT`],[`lease_id`,`TEXT`],[`process_group_id`,`INTEGER`],[`process_started_at`,`TEXT`],[`termination_mode`,`TEXT`],[`lifetime`,`TEXT`]])t.has(n)||e.exec(`ALTER TABLE ${F} ADD COLUMN ${n} ${r}`)}removeLegacyScopeConstraint(e){if(!e.prepare(`SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ?`).get(F)?.sql?.includes(`UNIQUE (repository_path, service_name, service_type, environment)`))return;e.exec(`\n      DROP INDEX IF EXISTS process_registrations_scope_idx;\n      DROP INDEX IF EXISTS process_registrations_pid_idx;\n      DROP INDEX IF EXISTS process_registrations_lease_idx;\n      DROP INDEX IF EXISTS process_registrations_owner_idx;\n      ALTER TABLE ${F} RENAME TO ${F}_legacy_scope;\n      CREATE TABLE ${F} (\n        id INTEGER PRIMARY KEY AUTOINCREMENT,\n        repository_path TEXT NOT NULL,\n        service_name TEXT NOT NULL,\n        service_type TEXT NOT NULL,\n        environment TEXT NOT NULL,\n        pid INTEGER NOT NULL,\n        port INTEGER,\n        host TEXT,\n        command TEXT,\n        args_json TEXT,\n        tags_json TEXT,\n        metadata_json TEXT,\n        owner_kind TEXT,\n        owner_id TEXT,\n        resource_key TEXT,\n        worktree_path TEXT,\n        launch_id TEXT,\n        lease_id TEXT,\n        process_group_id INTEGER,\n        process_started_at TEXT,\n        termination_mode TEXT,\n        lifetime TEXT,\n        created_at TEXT NOT NULL,\n        updated_at TEXT NOT NULL\n      );\n    `);let t=new Date().toISOString();e.prepare(`INSERT INTO ${F} (\n        id, repository_path, service_name, service_type, environment, pid, port, host, command,\n        args_json, tags_json, metadata_json, owner_kind, owner_id, resource_key, worktree_path,\n        launch_id, lease_id, process_group_id, process_started_at, termination_mode, lifetime,\n        created_at, updated_at\n      )\n      SELECT\n        id, repository_path, service_name, service_type, environment, pid, port, host, command,\n        args_json, tags_json, metadata_json, owner_kind, owner_id, resource_key, worktree_path,\n        launch_id, lease_id, process_group_id, process_started_at, termination_mode, lifetime,\n        COALESCE(created_at, updated_at, ?), COALESCE(updated_at, created_at, ?)\n      FROM ${F}_legacy_scope`).run(t,t),e.exec(`DROP TABLE ${F}_legacy_scope`)}async importLegacyJson(t){if(t.prepare(`SELECT value FROM ${I} WHERE key = ?`).get(L))return;let n=null;try{let t=await e.readFile(this.legacyRegistryPath,`utf-8`);n=E.parse(JSON.parse(t))}catch(e){if(e.code!==`ENOENT`)throw e}t.transaction(e=>{let n=t.prepare(`INSERT OR IGNORE INTO ${F} (\n           repository_path, service_name, service_type, environment, pid, port, host,\n           command, args_json, tags_json, metadata_json, created_at, updated_at\n         ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let t of e?.entries??[])n.run(m(t.repositoryPath),t.serviceName,t.serviceType,t.environment??``,t.pid,t.port??null,t.host??null,t.command??null,t.args?JSON.stringify(t.args):null,t.tags?JSON.stringify(t.tags):null,t.metadata?JSON.stringify(t.metadata):null,t.createdAt,t.updatedAt);t.prepare(`INSERT OR REPLACE INTO ${I} (key, value) VALUES (?, ?)`).run(L,this.legacyRegistryPath)})(n)}async withImmediateTransaction(e,t){let n=B.get(this.registryPath)??Promise.resolve(),r=()=>void 0,i=new Promise(e=>{r=e}),a=n.catch(()=>void 0).then(()=>i);B.set(this.registryPath,a),await n.catch(()=>void 0);try{e.exec(`BEGIN IMMEDIATE`);try{let n=t();return e.exec(`COMMIT`),n}catch(t){throw e.inTransaction&&e.exec(`ROLLBACK`),t}}finally{r(),B.get(this.registryPath)===a&&B.delete(this.registryPath)}}queryRows(e,t,n=!1){let r=this.buildWhereClause(t,n);return e.prepare(`SELECT * FROM ${F}${r.sql} ORDER BY id`).all(...r.params)}findRegistrationRow(e,t,n,r,i,a){return e.prepare(`SELECT * FROM ${F}\n         WHERE repository_path = ? AND service_name = ? AND service_type = ? AND environment = ?\n           AND owner_kind IS ? AND owner_id IS ? AND resource_key IS ? AND worktree_path IS ?\n         LIMIT 1`).get(t,n,r,i,a.ownerKind??null,a.ownerId??null,a.resourceKey??null,a.worktreePath??null)}buildWhereClause(e,t=!1){let n=[],r=[],i=(e,t)=>{t!==void 0&&(n.push(`${e} = ?`),r.push(t))};return i(`repository_path`,e.repositoryPath),i(`service_name`,e.serviceName),i(`service_type`,e.serviceType),i(`environment`,e.environment),i(`owner_kind`,e.ownerKind),i(`owner_id`,e.ownerId),i(`resource_key`,e.resourceKey),i(`worktree_path`,e.worktreePath),i(`launch_id`,e.launchId),i(`lease_id`,e.leaseId),t&&typeof e.pid==`number`&&i(`pid`,e.pid),{sql:n.length>0?` WHERE ${n.join(` AND `)}`:``,params:r}}removeRows(e,t){return t.length===0?0:e.transaction(t=>{let n=e.prepare(`DELETE FROM ${F}\n         WHERE id = ? AND pid = ? AND launch_id IS ? AND lease_id IS ? AND process_started_at IS ?`),r=0;for(let e of t)r+=n.run(e.id,e.pid,e.launch_id,e.lease_id,e.process_started_at).changes;return r})(t)}normalizeListFilters(e){return{...e.repositoryPath?{repositoryPath:m(e.repositoryPath)}:{},...e.serviceName?{serviceName:e.serviceName}:{},...e.serviceType?{serviceType:e.serviceType}:{},...e.environment?{environment:e.environment}:{},...e.ownerKind?{ownerKind:e.ownerKind}:{},...e.ownerId?{ownerId:e.ownerId}:{},...e.resourceKey?{resourceKey:e.resourceKey}:{},...e.worktreePath?{worktreePath:m(e.worktreePath)}:{},...e.tags?{tags:H(e.tags)}:{}}}normalizeReleaseFilters(e){return{...this.normalizeListFilters(e),...typeof e.pid==`number`?{pid:e.pid}:{},...e.launchId?{launchId:e.launchId}:{},...e.leaseId?{leaseId:e.leaseId}:{},...typeof e.force==`boolean`?{force:e.force}:{}}}toRecord(e){return T.parse({repositoryPath:e.repository_path,serviceName:e.service_name,serviceType:e.service_type,...e.environment?{environment:e.environment}:{},pid:e.pid,...e.port?{port:e.port}:{},...e.host?{host:e.host}:{},...e.command?{command:e.command}:{},...this.parseJsonArrayField(`args`,e.args_json),...this.parseJsonArrayField(`tags`,e.tags_json),...this.parseMetadata(e.metadata_json),...e.owner_kind?{ownerKind:e.owner_kind}:{},...e.owner_id?{ownerId:e.owner_id}:{},...e.resource_key?{resourceKey:e.resource_key}:{},...e.worktree_path?{worktreePath:e.worktree_path}:{},...e.launch_id?{launchId:e.launch_id}:{},...e.lease_id?{leaseId:e.lease_id}:{},...e.process_group_id?{processGroupId:e.process_group_id}:{},...e.process_started_at?{processStartedAt:e.process_started_at}:{},...e.termination_mode?{terminationMode:e.termination_mode}:{},...e.lifetime?{lifetime:e.lifetime}:{},createdAt:e.created_at,updatedAt:e.updated_at})}parseJsonArrayField(e,t){if(!t)return{};let n=JSON.parse(t);if(!Array.isArray(n)||!n.every(e=>typeof e==`string`))throw new P(`Stored process ${e} are invalid`,z);return{[e]:n}}parseMetadata(e){if(!e)return{};let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))throw new P(`Stored process metadata is invalid`,z);return{metadata:t}}matchesTags(e,t){return!t||t.length===0?!0:!!e?.some(e=>t.includes(e))}isProcessRunning(e){try{return process.kill(e,0),!0}catch{return!1}}readProcessStartedAt(e){if(process.platform!==`win32`)try{return r(`ps`,[`-o`,`lstart=`,`-p`,String(e)],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim()||void 0}catch{return}}processIdentityMatches(e){return e.processStartedAt?this.readProcessStartedAt(e.pid)===e.processStartedAt:!1}assertDestructiveReleaseOwnership(e,t,n){if(!e.processStartedAt)throw Error(`Refusing to terminate legacy pid ${e.pid} without process start identity`);if(!n&&!(e.ownerKind&&e.ownerKind===t.ownerKind&&e.ownerId&&e.ownerId===t.ownerId&&e.resourceKey&&e.resourceKey===t.resourceKey&&e.worktreePath&&e.worktreePath===t.worktreePath&&e.launchId&&e.launchId===t.launchId&&e.leaseId&&e.leaseId===t.leaseId&&e.pid===t.pid))throw Error(`Refusing to terminate pid ${e.pid} without its exact owner lease and worktree identity`)}processTarget(e){if(e.terminationMode!==`process-group`)return e.pid;if(e.processGroupId!==e.pid)throw Error(`Refusing unsafe process-group cleanup for pid ${e.pid}`);return-e.processGroupId}isProcessTargetRunning(e){try{return process.kill(e,0),!0}catch{return!1}}signalProcessTarget(e,t){try{process.kill(e,t)}catch(n){if(n.code!==`ESRCH`)throw Error(`Failed to send ${t} to process target ${e}`,{cause:n})}}async terminateProcess(e){let t=this.processTarget(e);if(this.isProcessTargetRunning(t)){if(!this.processIdentityMatches(e))throw Error(`Refusing to terminate pid ${e.pid} because its process identity changed`);if(this.signalProcessTarget(t,`SIGTERM`),!await this.waitForProcessTargetExit(t)){if(this.isProcessRunning(e.pid)&&!this.processIdentityMatches(e))throw Error(`Refusing to escalate pid ${e.pid} because its process identity changed`);if(this.signalProcessTarget(t,`SIGKILL`),!await this.waitForProcessTargetExit(t))throw Error(`Process target ${t} did not exit after SIGKILL`)}}}async waitForProcessTargetExit(e){let t=Date.now()+2e3;for(;Date.now()<t;){if(!this.isProcessTargetRunning(e))return!0;await this.delay(100)}return!this.isProcessTargetRunning(e)}async releaseAssociatedPort(e){if(e.port)try{let t=await this.portRegistry.releasePort({repositoryPath:e.repositoryPath,serviceName:e.serviceName,serviceType:e.serviceType,environment:e.environment,pid:e.pid,force:!1});if(!t.success&&t.error&&!t.error.includes(`No matching registry entry`))throw Error(t.error)}catch{return}}async pathExists(t){try{return await e.access(t),!0}catch{return!1}}createSuccessResponse(e,t){return j.parse({success:!0,...typeof e==`number`?{pid:e}:{},...t?{record:t}:{}})}createFailureResponse(e){return j.parse({success:!1,error:e})}delay(e){return new Promise(t=>setTimeout(t,e))}};function H(e){if(e!==void 0)return Array.from(new Set(e.map(e=>e.trim()).filter(e=>e.length>0)))}export{f as C,g as D,h as E,p as S,m as T,s as _,N as a,c as b,T as c,x as d,v as f,y as g,A as h,S as i,j as l,O as m,k as n,M as o,D as p,b as r,P as s,V as t,E as u,o as v,d as w,u as x,l as y};\n//# sourceMappingURL=ProcessRegistryService.mjs.map","import{c as e,i as t,l as n,n as r,r as i,s as a,t as o,u as s}from\"./LogStorageService-FUtAkl3y.mjs\";import{i as c,n as l,r as u}from\"./logSinkConfig-BnOw8fWp.mjs\";import d,{createRequire as f}from\"node:module\";import{Container as ee,ContainerModule as te,inject as p,injectable as m,unmanaged as h}from\"inversify\";import\"reflect-metadata\";import{existsSync as g,readFileSync as ne}from\"node:fs\";import _,{mkdir as v,readFile as y,writeFile as b}from\"node:fs/promises\";import{homedir as re,hostname as ie}from\"node:os\";import x,{dirname as ae,join as S}from\"node:path\";import{execFile as oe,spawn as C}from\"node:child_process\";import{promisify as w}from\"node:util\";import{fileURLToPath as T}from\"node:url\";import{CLAIM_METADATA_KEY as se,DEFAULT_PORT_RANGE as E,PortRegistryService as D}from\"@agimon-ai/foundation-port-registry\";import{ProcessRegistryService as O,resolveSiblingRegistryPath as k}from\"@agimon-ai/foundation-process-registry\";import{ulid as A}from\"ulidx\";function ce(e){return e?[`1`,`true`,`yes`,`on`].includes(e.trim().toLowerCase()):!1}function j(e=process.env){return ce(e.LOG_SINK_ENABLE_EMBEDDINGS)}var M;function le(){let e=f(import.meta.url).resolve(`ruvector-onnx-embeddings-wasm`),t=ae(e),n=S(t,`ruvector_onnx_embeddings_wasm.js`),r=ne(n,`utf-8`),i=new d(n);return i.filename=n,i.paths=d._nodeModulePaths(t),i._compile(r,n),i.exports}let N=class{static{M=this}storage;static DEFAULT_MODEL=`all-MiniLM-L6-v2`;static VECTOR_DIMENSION=384;static CACHE_DIR=S(re(),`.log-sink-mcp`);embedderPromise=null;modelUnavailable=!1;loaderPromise=null;constructor(e){this.storage=e}get modelName(){return process.env.LOG_SINK_EMBEDDING_MODEL??M.DEFAULT_MODEL}isEnabled(){return j()}async loadLoader(){return this.loaderPromise||=import(`ruvector-onnx-embeddings-wasm/loader.js`).catch(e=>{let t=e&&typeof e==`object`&&`code`in e?String(e.code):``,n=e instanceof Error?e.message:String(e);if(t===`ERR_MODULE_NOT_FOUND`||t===`MODULE_NOT_FOUND`||n.includes(`ruvector-onnx`))return null;throw e}),this.loaderPromise}async getEmbedder(){if(this.modelUnavailable)throw Error(`Embedding model is not available locally`);if(!this.isEnabled())throw this.modelUnavailable=!0,Error(`Embedding support is disabled until LOG_SINK_ENABLE_EMBEDDINGS is enabled`);if(!this.embedderPromise){let e=await this.loadLoader();if(!e)throw this.modelUnavailable=!0,Error(`Embedding model support is disabled because ruvector-onnx-embeddings-wasm is not installed`);await v(M.CACHE_DIR,{recursive:!0});let t=le();this.embedderPromise=this.createEmbedderWithCache(e,t).catch(e=>{throw this.embedderPromise=null,this.modelUnavailable=!0,e})}return this.embedderPromise}async createEmbedderWithCache(e,t){let n=this.modelName,r=e.MODELS[n];if(!r)throw Error(`Unknown embedding model: ${n}`);let i=S(M.CACHE_DIR,n),a=S(i,`model.onnx`),o=S(i,`tokenizer.json`),s,c;if(g(a)&&g(o))[s,c]=await Promise.all([y(a).then(e=>new Uint8Array(e)),y(o,`utf-8`)]);else{await v(i,{recursive:!0});let[e,t]=await Promise.all([fetch(r.model).then(e=>{if(!e.ok)throw Error(`Failed to download model: ${e.status}`);return e.arrayBuffer()}),fetch(r.tokenizer).then(e=>{if(!e.ok)throw Error(`Failed to download tokenizer: ${e.status}`);return e.text()})]);s=new Uint8Array(e),c=t,await Promise.all([b(a,s),b(o,c)])}let l=new t.WasmEmbedderConfig().setMaxLength(r.maxLength).setNormalize(!0).setPooling(0);return t.WasmEmbedder.withConfig(s,c,l)}async isAvailable(){if(this.modelUnavailable)return!1;try{return await this.getEmbedder(),!0}catch{return!1}}buildEmbeddingText(e){let t=e.metadata?typeof e.metadata==`string`?e.metadata:JSON.stringify(e.metadata):``;return[`service: ${e.service}`,`level: ${e.level}`,`message: ${e.message}`,e.errorType?`errorType: ${e.errorType}`:null,e.errorMessage?`errorMessage: ${e.errorMessage}`:null,t?`metadata: ${t}`:null].filter(Boolean).join(`\n`)}normalizeVector(e){let t=Math.sqrt(e.reduce((e,t)=>e+t*t,0));return t===0?e:e.map(e=>e/t)}toVector(e){if(e instanceof Float32Array||e instanceof Float64Array)return Array.from(e);if(Array.isArray(e)&&e.length>0&&typeof e[0]==`number`)return e;if(Array.isArray(e)&&e.length>0&&Array.isArray(e[0]))return e[0];throw Error(`Unexpected embedding output shape`)}async embedText(e){let t=await this.getEmbedder(),n=this.normalizeVector(this.toVector(t.embedOne(e)));if(n.length!==M.VECTOR_DIMENSION)throw Error(`Unexpected embedding dimension ${n.length}, expected ${M.VECTOR_DIMENSION}`);return n}async indexLogs(e){if(e.length!==0)try{let t=[];for(let n of e)t.push({log:n,embedding:await this.embedText(this.buildEmbeddingText(n))});let n=this.storage.getSqliteClient(),r=n.prepare(`\n        INSERT INTO log_embeddings (log_id, embedding, service, level, created_at)\n        VALUES (?, vec_f32(?), ?, ?, ?)\n        ON CONFLICT(log_id) DO UPDATE SET\n          embedding = excluded.embedding,\n          service = excluded.service,\n          level = excluded.level,\n          created_at = excluded.created_at\n      `);n.exec(`BEGIN`);try{for(let e of t)r.run(e.log.id,new Uint8Array(new Float32Array(e.embedding).buffer),e.log.service,e.log.level,Math.floor(e.log.createdAt.getTime()/1e3));n.exec(`COMMIT`)}catch(e){throw n.exec(`ROLLBACK`),e}}catch(e){console.warn(`Skipping semantic embedding indexing: ${e instanceof Error?e.message:String(e)}`)}}};N=M=a([m(),e(0,p(s.LogStorageService)),n(`design:paramtypes`,[Object])],N);const P=w(oe),F=`host`,I=`process.cpu.percent`,L=`process.memory.rss`,R=[`-Ao`,`pid=,ppid=,pgid=,time=,rss=,lstart=,args=`],z=/^(?:node(?:js)?|workerd|wrangler|cmux|tsserver|esbuild|vite|metro|bun|deno|python(?:\\d+(?:\\.\\d+)*)?)$/i,B=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)$/,V=/^(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)$/,H=/^\\d{1,2}$/,U=/^\\d{2}:\\d{2}:\\d{2}$/,ue=/^\\d{4}$/;function de(e){return e.replace(/(\\b(?:Cookie|Set-Cookie)\\s*:\\s*)[^\\r\\n\"']+/gi,`$1[redacted]`).replace(/((?:^|\\s)(?:--header|-H)(?:=|\\s+))(?:\"[^\"]*\"|'[^']*'|[^\\s]+)/g,`$1[redacted]`).replace(/(\\b(?:Bearer|Basic)\\s+)[^\\s\"'<>]+/gi,`$1[redacted]`).replace(/((?:^|\\s)--?[\\w.-]*(?:token|secret|password|api[-_]?key|authorization|cookie|credential)[\\w.-]*(?:=|\\s+))(?:\"[^\"]*\"|'[^']*'|[^\\s]+)/gi,`$1[redacted]`).replace(/(\\b[A-Z_]*(?:TOKEN|SECRET|PASSWORD|PASSWD|API_KEY|PRIVATE_KEY|CREDENTIAL|COOKIE|AUTHORIZATION)[A-Z_]*=)(?:\"[^\"]*\"|'[^']*'|[^\\s]+)/gi,`$1[redacted]`).replace(/[a-z][a-z0-9+.-]*:\\/\\/[^\\s\"'<>]+/gi,e=>{try{let t=new URL(e);return t.username=``,t.password=``,t.search=``,t.hash=``,t.href}catch{return`[redacted-url]`}})}function fe(e){let[t,n=`0`]=e.split(`.`),r=(t??``).split(`-`),i=r.length>1?r[1]??``:r[0]??``,a=r.length>1?Number(r[0]):0,o=i.split(`:`).map(Number);if(o.some(Number.isNaN)||Number.isNaN(a))return NaN;let[s,c,l]=o.length===3?o:o.length===2?[0,o[0],o[1]]:[0,0,o[0]];return a*86400+(s??0)*3600+(c??0)*60+(l??0)+Number(`0.${n}`)}function pe(e){let t=(e.trim().split(/\\s+/,1)[0]??``).split(/[\\\\/]/).pop()??``;return z.test(t)}function me(e){let[t,n,r,i,a]=e,o=V.test(n??``)&&H.test(r??``)||H.test(n??``)&&V.test(r??``);if(B.test(t??``)&&o&&U.test(i??``)&&ue.test(a??``))return e.slice(0,5).join(` `)}function he(e){let t=[];for(let n of e.split(`\n`)){let e=n.trim();if(!e)continue;let[r,i,a,o,s,...c]=e.split(/\\s+/),l=c.length>=6?me(c):void 0,u=l?c.slice(5):c,d=fe(o??``),f={pid:Number(r),ppid:Number(i),pgid:Number(a),...l?{startedAt:l}:{},cpuSeconds:d,rssBytes:Number(s)*1024,command:u.join(` `)};Number.isInteger(f.pid)&&Number.isInteger(f.ppid)&&Number.isInteger(f.pgid)&&!Number.isNaN(d)&&!Number.isNaN(f.rssBytes)&&t.push(f)}return t}const ge=async()=>{let{stdout:e}=await P(`ps`,R,{maxBuffer:8388608});return he(e)};let W=class{metrics;timer=null;previous=/* @__PURE__ */ new Map;lister=ge;host=ie();generation=0;pendingSample;constructor(e){this.metrics=e}setProcessLister(e){this.lister=e}start(e=15e3){this.timer||(this.sample().catch(()=>{}),this.timer=setInterval(()=>{this.sample().catch(()=>{})},e),this.timer.unref?.())}stop(){this.generation++,this.timer&&clearInterval(this.timer),this.timer=null,this.previous.clear()}sample(e=Date.now()){return this.pendingSample??=this.collect(e,this.generation).finally(()=>{this.pendingSample=void 0}),this.pendingSample}async collect(e,t){let n=await this.lister();if(t!==this.generation)return 0;let r=new Set(n.map(e=>e.pid)),i=[],a=/* @__PURE__ */ new Map,o=new Date(e);for(let t of n){if(a.set(t.pid,{cpuSeconds:t.cpuSeconds,at:e,...t.startedAt?{startedAt:t.startedAt}:{}}),!pe(t.command))continue;let n={command:de(t.command).slice(0,160),ppid:t.ppid,pgid:t.pgid,...t.startedAt?{processStartedAt:t.startedAt}:{},orphaned:t.ppid===1&&t.pgid!==t.pid&&!r.has(t.pgid)};i.push({timestamp:o,service:F,metric:L,value:t.rssBytes,unit:`bytes`,pid:t.pid,hostname:this.host,attributes:n});let s=this.previous.get(t.pid);if(!s)continue;let c=e-s.at;if(c<=0||s.startedAt&&t.startedAt&&s.startedAt!==t.startedAt)continue;let l=t.cpuSeconds-s.cpuSeconds;if(l<0)continue;let u=l*1e3*100/c;u<.5||i.push({timestamp:o,service:F,metric:I,value:Number(u.toFixed(2)),unit:`percent`,pid:t.pid,hostname:this.host,attributes:n})}return this.previous=a,i.length===0?0:this.metrics.record(i)}};W=a([m(),e(0,p(s.MetricPointService)),n(`design:paramtypes`,[Object])],W);let G=class{defaultTimeout=5e3;async check(e,t=this.defaultTimeout){try{let n=`http://localhost:${e}/health`,r=new AbortController,i=setTimeout(()=>r.abort(),t);try{let t=await fetch(n,{signal:r.signal,headers:{\"Content-Type\":`application/json`}});if(clearTimeout(i),!t.ok)return{healthy:!1,error:`HTTP error ${t.status}: ${t.statusText}`};let a=await t.json();return a.status===`healthy`?{healthy:!0,port:e,serviceName:a.serviceName??a.service,...a.version?{version:a.version}:{}}:{healthy:!1,error:`Unexpected health status: ${a.status||`unknown`}`}}catch(e){return clearTimeout(i),e instanceof Error?e.name===`AbortError`?{healthy:!1,error:`Health check timed out after ${t}ms`}:`code`in e&&e.code===`ECONNREFUSED`?{healthy:!1,error:`Connection refused - server not running`}:{healthy:!1,error:`Network error: ${e.message}`}:{healthy:!1,error:`Unknown error: ${String(e)}`}}}catch(e){return{healthy:!1,error:e instanceof Error?e.message:String(e)}}}};G=a([m()],G);const _e=T(import.meta.url),K=x.dirname(_e),q=`LOG_SINK_HTTP_CLAIM_TOKEN`;let J=class{healthCheck;repositoryPath;environment;serviceName=`log-sink-mcp-http`;serviceType=`tool`;host=`127.0.0.1`;defaultPort;defaultDbPath;registryPath;portRegistry;processRegistry;pendingStarts=/* @__PURE__ */ new Map;healthMonitors=/* @__PURE__ */ new Map;constructor(e,t,n){this.healthCheck=e;let r=c({cwd:t?x.resolve(t):process.cwd(),packageName:l});this.repositoryPath=r.repositoryPath,this.defaultPort=r.port,this.defaultDbPath=r.dbPath,this.environment=u(r.scope),this.registryPath=n||process.env.PORT_REGISTRY_PATH,this.portRegistry=new D(this.registryPath),this.processRegistry=new O(k(this.registryPath,`processes.json`))}async getRegistration(){let e=await this.portRegistry.getPort({repositoryPath:this.repositoryPath,serviceName:this.serviceName,serviceType:this.serviceType,environment:this.environment});return!e.success||!e.record?null:{port:e.record.port,pid:e.record.pid,environment:e.record.environment??this.environment,host:e.record.host,metadata:e.record.metadata}}async releaseService(e){let t=await this.portRegistry.releasePort({repositoryPath:this.repositoryPath,serviceName:this.serviceName,serviceType:this.serviceType,environment:this.environment,...e?{pid:e}:{}});if(!t.success&&!t.error?.includes(`No matching registry entry`))throw Error(t.error||`Failed to release registry entry`)}async releaseProcess(e){let t=await this.processRegistry.releaseProcess({repositoryPath:this.repositoryPath,serviceName:this.serviceName,serviceType:this.serviceType,environment:this.environment,...e?{pid:e}:{},kill:!1,releasePort:!1});if(!t.success&&!t.error?.includes(`No matching process entry`))throw Error(t.error||`Failed to release process entry`)}async fileExists(e){try{return await _.access(e),!0}catch{return!1}}async startHttpServer(e,t,n){let r=[x.resolve(K,`cli.mjs`),x.resolve(K,`..`,`dist`,`cli.mjs`),x.resolve(K,`..`,`..`,`dist`,`cli.mjs`)],i=[x.resolve(K,`..`,`cli.ts`),x.resolve(K,`..`,`..`,`src`,`cli.ts`)],a;for(let e of r)if(await this.fileExists(e)){a=e;break}let o;if(!a){for(let e of i)if(await this.fileExists(e)){o=e;break}}let s,c;if(a)s=process.execPath,c=[a,`http-serve`,`--port`,e.toString()];else if(o)s=process.execPath,c=[`--import`,`tsx`,o,`http-serve`,`--port`,e.toString()];else throw Error(`Cannot find log-sink MCP CLI in any expected location`);let l=x.resolve(t),u=x.dirname(l);await _.mkdir(u,{recursive:!0});let d=x.join(u,`http.log`);await this.fileExists(d)&&(await _.stat(d)).size>5242880&&await _.rename(d,`${d}.1`);let f=await _.open(d,`a`);try{let e=C(s,[...c,`--db-path`,l],{detached:!0,stdio:[`ignore`,f.fd,f.fd],env:{...process.env,...this.registryPath?{PORT_REGISTRY_PATH:this.registryPath}:{},NODE_ENV:this.environment,[q]:n}});e.unref();let t=e.pid;if(!t)throw Error(`Failed to spawn HTTP server - no PID returned`);return t}finally{await f.close()}}async waitForHealthyRegisteredService(e,t){let n=Date.now()+5e3;for(;Date.now()<n;){let r=await this.getRegistration(),i=t===void 0||r?.pid===t,a=n-Date.now();if(a<=0)break;if(r?.port===e&&i){let t=await this.healthCheck.check(e,Math.min(500,a));if(t.healthy&&t.serviceName===this.serviceName)return{running:!0,port:e,pid:r.pid,...t.version?{version:t.version}:{}}}let o=Math.min(250,n-Date.now());o>0&&await new Promise(e=>setTimeout(e,o))}return null}async terminateRegisteredService(e){let t=await this.processRegistry.releaseProcess({repositoryPath:this.repositoryPath,serviceName:this.serviceName,serviceType:this.serviceType,environment:this.environment,pid:e,kill:!0,releasePort:!0,force:!0}),n=t.error?.includes(`process registration changed`)===!0;if(!t.success&&!n)throw Error(t.error||`Failed to terminate registered HTTP server pid ${e}`)}isPendingClaim(e){return e.metadata?.[se]!==void 0}async killProcess(e){try{process.kill(e,0),process.kill(e,`SIGTERM`),await new Promise(e=>setTimeout(e,1e3));try{process.kill(e,0),process.kill(e,`SIGKILL`)}catch{}}catch{}}ensureRunning(e=this.defaultPort,t=this.defaultDbPath){let n=JSON.stringify([e,x.resolve(t)]),r=this.pendingStarts.get(n);return r||(r=this.startOrReuse(e,t).finally(()=>this.pendingStarts.delete(n)),this.pendingStarts.set(n,r)),r}async startOrReuse(e,t){try{let n=await this.getRegistration();if(n){let e=this.isPendingClaim(n)?await this.waitForHealthyRegisteredService(n.port):await this.waitForHealthyRegisteredService(n.port,n.pid);if(e)return e;if(this.isPendingClaim(n))return{running:!1,port:n.port,pid:n.pid,error:`Another process owns the HTTP startup claim for port ${n.port}`};n.pid&&await this.terminateRegisteredService(n.pid),await this.releaseProcess(n.pid),await this.releaseService(n.pid)}let r=e;for(let e=0;e<3;e+=1){let e=r===void 0?E.max:Math.max(E.max,r),n=await this.portRegistry.claimPort({repositoryPath:this.repositoryPath,serviceName:this.serviceName,serviceType:this.serviceType,environment:this.environment,host:this.host,pid:process.pid,...r===void 0?{}:{preferredPort:r},portRange:{min:E.min,max:e},metadata:{dbPath:x.resolve(t)}});if(!n.success||n.port===void 0)throw Error(n.error||`Failed to claim a port for the HTTP server`);if(n.outcome===`existing`)return await this.waitForHealthyRegisteredService(n.port)??{running:!1,port:n.port,pid:n.record?.pid,error:`HTTP server owner on port ${n.port} did not become healthy`};let i=n.claimToken;if(!i)throw Error(`Port registry granted a claim without an ownership token`);let a=n.port,o;try{o=await this.startHttpServer(a,t,i)}catch(e){throw await this.portRegistry.releaseClaim({repositoryPath:this.repositoryPath,serviceName:this.serviceName,serviceType:this.serviceType,environment:this.environment,claimToken:i}),e}let s=await this.waitForHealthyRegisteredService(a,o);if(s)return s;await this.killProcess(o),await this.releaseProcess(o),await this.releaseService(o),await this.portRegistry.releaseClaim({repositoryPath:this.repositoryPath,serviceName:this.serviceName,serviceType:this.serviceType,environment:this.environment,claimToken:i}),r=a+1}return{running:!1,error:`Failed to start po-logsink HTTP server after retries`}}catch(e){return{running:!1,error:e instanceof Error?e.message:String(e)}}}async stop(){try{let e=await this.getRegistration();if(!e)return!1;try{if(e.pid&&process.kill(e.pid,`SIGTERM`),await new Promise(e=>setTimeout(e,1e3)),e.pid)try{process.kill(e.pid,0),process.kill(e.pid,`SIGKILL`)}catch{}}catch{}return await this.releaseProcess(e.pid),await this.releaseService(e.pid),!0}catch(e){throw Error(`Failed to stop HTTP server: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}startHealthMonitor(e,t=1e4){if(!Number.isFinite(t)||t<=0)throw RangeError(`Health interval must be positive`);let n=JSON.stringify([x.resolve(e),t]),r=this.healthMonitors.get(n);if(!r){let i=!1,a=0,o,s=e=>{i||(o=setTimeout(()=>void c(),e).unref())},c=async()=>{if(!i){try{let t=await this.getStatus();if(i)return;t.running?a=0:(a++,await this.ensureRunning(void 0,e))}catch{a++}s(a?Math.min(2e3*2**(a-1),6e4):t)}};r={references:0,stop:()=>{i=!0,o&&clearTimeout(o)}},this.healthMonitors.set(n,r),s(t)}let i=r;i.references++;let a=!1;return()=>{a||(a=!0,--i.references===0&&(i.stop(),this.healthMonitors.get(n)===i&&this.healthMonitors.delete(n)))}}async getStatus(){try{let e=await this.getRegistration();if(!e)return{running:!1,error:`No HTTP server registered`};let t=await this.healthCheck.check(e.port);return t.healthy&&t.serviceName===this.serviceName?{running:!0,port:e.port,pid:e.pid,...t.version?{version:t.version}:{}}:{running:!1,port:e.port,pid:e.pid,error:t.error}}catch(e){return{running:!1,error:e instanceof Error?e.message:String(e)}}}};J=a([m(),e(0,p(s.HttpServerHealthCheck)),e(1,h()),e(2,h()),n(`design:paramtypes`,[Object,String,String])],J);let Y=class{storage;sizeRetentionTimer=null;sizeRetentionRunPromise=null;constructor(e){this.storage=e}async getSqlite(){return await this.storage.ensureInitialized(),this.storage.getSqliteClient()}async cleanupOldLogs(e){try{let t=await this.getSqlite(),n=/* @__PURE__ */ new Date;n.setDate(n.getDate()-e);let r=t.prepare(`DELETE FROM logs WHERE timestamp <= ?`).run(n.getTime());return Number(r.changes??0)}catch(e){throw Error(`Failed to cleanup old logs: ${e instanceof Error?e.message:String(e)}`)}}async clearAllLogs(){try{return await this.storage.deleteAllLogs()}catch(e){throw Error(`Failed to clear all logs: ${e instanceof Error?e.message:String(e)}`)}}async cleanupOversizedDatabase(e){try{if(!Number.isFinite(e.maxBytes)||e.maxBytes<=0)throw Error(`maxBytes must be a positive number`);if(!Number.isFinite(e.intervalMs)||e.intervalMs<=0)throw Error(`intervalMs must be a positive number`);let t=e.batchSize??1e3,n=Math.min(e.targetBytes??Math.floor(e.maxBytes*.9),e.maxBytes);if(!Number.isFinite(n)||n<=0)throw Error(`targetBytes must be a positive number`);if(!Number.isInteger(t)||t<=0)throw Error(`batchSize must be a positive integer`);let r=await this.storage.getDatabaseSizeBytes();if(r===null||r<=e.maxBytes)return{sizeBeforeBytes:r,sizeAfterBytes:r,deletedEntries:0,iterations:0,trimmed:!1};let i=await this.storage.getLiveDataBytes(),a=0,o=0;for(;i>n;){let e=await this.storage.deleteOldestEntries(t);if(e===0)break;a+=e,o+=1,i=await this.storage.getLiveDataBytes()}return await this.storage.compactDatabase(),{sizeBeforeBytes:r,sizeAfterBytes:await this.storage.getDatabaseSizeBytes(),deletedEntries:a,iterations:o,trimmed:a>0}}catch(e){throw Error(`Failed to cleanup oversized database: ${e instanceof Error?e.message:String(e)}`)}}startSizeRetentionMonitor(e){this.stopSizeRetentionMonitor();let t=async()=>{this.sizeRetentionRunPromise||(this.sizeRetentionRunPromise=(async()=>{try{await this.cleanupOversizedDatabase(e)}catch(e){console.warn(`Failed to run periodic database retention: ${e instanceof Error?e.message:String(e)}`)}finally{this.sizeRetentionRunPromise=null}})(),await this.sizeRetentionRunPromise)};return t(),this.sizeRetentionTimer=setInterval(()=>{t()},e.intervalMs),this.sizeRetentionTimer.unref?.(),()=>{this.stopSizeRetentionMonitor()}}stopSizeRetentionMonitor(){this.sizeRetentionTimer&&=(clearInterval(this.sizeRetentionTimer),null)}};Y=a([m(),e(0,p(s.LogStorageService)),n(`design:paramtypes`,[Object])],Y);function ve(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}let X=class{storage;constructor(e){this.storage=e}async getSqlite(){return await this.storage.ensureInitialized(),this.storage.getSqliteClient()}async record(e){if(e.length===0)return 0;let t=await this.getSqlite(),n=t.prepare(`INSERT INTO metric_points (id, timestamp, service, metric, value, unit, pid, hostname, attributes)\n       VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`);t.exec(`BEGIN`);try{for(let t of e)n.run(A(),(t.timestamp??/* @__PURE__ */ new Date).getTime(),t.service,t.metric,t.value,t.unit??null,t.pid??null,t.hostname??null,t.attributes?JSON.stringify(t.attributes):null);return t.exec(`COMMIT`),e.length}catch(e){throw t.exec(`ROLLBACK`),Error(`Failed to record metric points: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async summarize(e={}){let t=await this.getSqlite(),n=[],r=[];e.since&&(n.push(`timestamp >= ?`),r.push(e.since.getTime())),e.until&&(n.push(`timestamp <= ?`),r.push(e.until.getTime())),e.metrics?.length&&(n.push(`metric IN (${e.metrics.map(()=>`?`).join(`, `)})`),r.push(...e.metrics)),e.excludeMetrics?.length&&(n.push(`metric NOT IN (${e.excludeMetrics.map(()=>`?`).join(`, `)})`),r.push(...e.excludeMetrics)),e.services?.length&&(n.push(`service IN (${e.services.map(()=>`?`).join(`, `)})`),r.push(...e.services)),e.pid!==void 0&&(n.push(`pid = ?`),r.push(e.pid));let i=n.length>0?`WHERE ${n.join(` AND `)}`:``,a=e.limit??50;return t.prepare(`WITH filtered AS (\n           SELECT\n             service,\n             metric,\n             pid,\n             hostname,\n             unit,\n             value,\n             timestamp,\n             attributes,\n             CASE\n               WHEN json_valid(attributes)\n                 THEN COALESCE(CAST(json_extract(attributes, '$.processStartedAt') AS TEXT), '')\n               ELSE ''\n             END AS process_instance\n           FROM metric_points\n           ${i}\n         ),\n         series AS (\n           SELECT\n             service,\n             metric,\n             pid,\n             process_instance,\n             MAX(hostname) AS hostname,\n             MAX(unit) AS unit,\n             COUNT(*) AS samples,\n             MIN(value) AS min_value,\n             MAX(value) AS max_value,\n             AVG(value) AS avg_value,\n             MAX(timestamp) AS latest_at\n           FROM filtered\n           GROUP BY service, metric, pid, process_instance\n         ),\n         ranked AS (\n           SELECT\n             *,\n             ROW_NUMBER() OVER (\n               PARTITION BY metric\n               ORDER BY max_value DESC, latest_at DESC, service ASC, pid ASC\n             ) AS metric_rank\n           FROM series\n         )\n         SELECT\n           ranked.service,\n           ranked.metric,\n           ranked.pid,\n           ranked.hostname,\n           ranked.unit,\n           ranked.samples,\n           ranked.min_value,\n           ranked.max_value,\n           ranked.avg_value,\n           ranked.latest_at,\n           (SELECT newest.value\n              FROM filtered AS newest\n             WHERE newest.service = ranked.service\n               AND newest.metric = ranked.metric\n               AND newest.pid IS ranked.pid\n               AND newest.process_instance = ranked.process_instance\n             ORDER BY newest.timestamp DESC\n             LIMIT 1) AS latest_value,\n           (SELECT newest.attributes\n              FROM filtered AS newest\n             WHERE newest.service = ranked.service\n               AND newest.metric = ranked.metric\n               AND newest.pid IS ranked.pid\n               AND newest.process_instance = ranked.process_instance\n             ORDER BY newest.timestamp DESC\n             LIMIT 1) AS latest_attributes\n         FROM ranked\n         WHERE metric_rank <= ?\n         ORDER BY metric ASC, max_value DESC, latest_at DESC`).all(...r,a).map(e=>({service:e.service,metric:e.metric,pid:e.pid,hostname:e.hostname,unit:e.unit,samples:Number(e.samples),min:e.min_value,max:e.max_value,avg:e.avg_value,latest:e.latest_value,latestAt:new Date(Number(e.latest_at)).toISOString(),attributes:ve(e.latest_attributes)}))}async listMetrics(){return(await this.getSqlite()).prepare(`SELECT DISTINCT metric FROM metric_points ORDER BY metric ASC`).all().map(e=>e.metric)}};X=a([m(),e(0,p(s.LogStorageService)),n(`design:paramtypes`,[Object])],X);function Z(e){return e}function Q(e,t,n,r,i){let a=e[t];typeof a==`string`&&(r.push(`${n} = ?`),i.push(a))}let $=class{storage;searchService;embeddings;constructor(e,t,n){this.storage=e,this.searchService=t,this.embeddings=n}async isAvailable(){return this.embeddings.isAvailable()}mapRow(e){let t=1/(1+e.distance);return{id:e.id,timestamp:new Date(e.timestamp),level:e.level,message:e.message,traceId:e.traceId,spanId:e.spanId,parentSpanId:e.parentSpanId,service:e.service,hostname:e.hostname,pid:e.pid,metadata:e.metadata?JSON.parse(e.metadata):null,errorType:e.errorType,errorMessage:e.errorMessage,errorStack:e.errorStack,sessionId:e.sessionId,workflowRunId:e.workflowRunId,workflowName:e.workflowName,jobName:e.jobName,jobId:e.jobId,agentName:e.agentName,parentSessionId:e.parentSessionId,workflowRunKey:e.workflowRunKey,workflowId:e.workflowId,workflowWorkspace:e.workflowWorkspace,stepName:e.stepName,phase:e.phase,signalType:e.signalType??`log`,durationMs:e.durationMs,createdAt:new Date(e.createdAt),distance:e.distance,score:t}}mapFallbackRow(e){return{...e,distance:1/0,score:1/(1+Math.max(0,Math.abs(e.rank)))}}buildFilterSql(e={}){let t=[`1 = 1`],n=[];if(e.service){let r=Array.isArray(e.service)?e.service:[e.service];t.push(`logs.service IN (${r.map(()=>`?`).join(`,`)})`),n.push(...r)}if(e.level){let r=Array.isArray(e.level)?e.level:[e.level];t.push(`logs.level IN (${r.map(()=>`?`).join(`,`)})`),n.push(...r)}return Q(e,`traceId`,`logs.trace_id`,t,n),Q(e,`spanId`,`logs.span_id`,t,n),Q(e,`errorType`,`logs.error_type`,t,n),Q(e,`sessionId`,`logs.session_id`,t,n),Q(e,`workflowRunId`,`logs.workflow_run_id`,t,n),Q(e,`workflowName`,`logs.workflow_name`,t,n),Q(e,`jobName`,`logs.job_name`,t,n),Q(e,`jobId`,`logs.job_id`,t,n),Q(e,`agentName`,`logs.agent_name`,t,n),Q(e,`parentSessionId`,`logs.parent_session_id`,t,n),Q(e,`workflowRunKey`,`logs.workflow_run_key`,t,n),Q(e,`workflowId`,`logs.workflow_id`,t,n),Q(e,`workflowWorkspace`,`logs.workflow_workspace`,t,n),Q(e,`stepName`,`logs.step_name`,t,n),Q(e,`phase`,`logs.phase`,t,n),Q(e,`signalType`,`COALESCE(logs.signal_type, 'log')`,t,n),e.startTime&&(t.push(`logs.timestamp >= ?`),n.push(e.startTime.getTime())),e.endTime&&(t.push(`logs.timestamp <= ?`),n.push(e.endTime.getTime())),{whereSql:`WHERE ${t.join(` AND `)}`,params:n}}async indexMissingLogs(e={},t=100){let n=this.storage.getSqliteClient(),r=0;for(;;){let{whereSql:i,params:a}=this.buildFilterSql(e),o=Z(n.prepare(`\n          SELECT\n            logs.id as id,\n            logs.timestamp as timestamp,\n            logs.level as level,\n            logs.message as message,\n            logs.trace_id as traceId,\n            logs.span_id as spanId,\n            logs.parent_span_id as parentSpanId,\n            logs.service as service,\n            logs.hostname as hostname,\n            logs.pid as pid,\n            logs.metadata as metadata,\n            logs.error_type as errorType,\n            logs.error_message as errorMessage,\n            logs.error_stack as errorStack,\n            logs.session_id as sessionId,\n            logs.workflow_run_id as workflowRunId,\n            logs.workflow_name as workflowName,\n            logs.job_name as jobName,\n            logs.job_id as jobId,\n            logs.agent_name as agentName,\n            logs.parent_session_id as parentSessionId,\n            logs.workflow_run_key as workflowRunKey,\n            logs.workflow_id as workflowId,\n            logs.workflow_workspace as workflowWorkspace,\n            logs.step_name as stepName,\n            logs.phase as phase,\n            logs.signal_type as signalType,\n            logs.duration_ms as durationMs,\n            logs.created_at as createdAt\n          FROM logs\n          LEFT JOIN log_embeddings ON log_embeddings.log_id = logs.id\n          ${i}\n            AND log_embeddings.log_id IS NULL\n          ORDER BY logs.timestamp ASC\n          LIMIT ?\n        `).all(...a,t));if(o.length===0)return r;await this.embeddings.indexLogs(o.map(e=>({id:e.id,timestamp:new Date(e.timestamp),level:e.level,message:e.message,traceId:e.traceId,spanId:e.spanId,parentSpanId:e.parentSpanId,service:e.service,hostname:e.hostname,pid:e.pid,metadata:e.metadata?JSON.parse(e.metadata):null,errorType:e.errorType,errorMessage:e.errorMessage,errorStack:e.errorStack,sessionId:e.sessionId,workflowRunId:e.workflowRunId,workflowName:e.workflowName,jobName:e.jobName,jobId:e.jobId,agentName:e.agentName,parentSessionId:e.parentSessionId,workflowRunKey:e.workflowRunKey,workflowId:e.workflowId,workflowWorkspace:e.workflowWorkspace,stepName:e.stepName,phase:e.phase,signalType:e.signalType??`log`,durationMs:e.durationMs,createdAt:new Date(e.createdAt)}))),r+=o.length}}async searchLogs(e,t={},n=100){let{results:r}=await this.searchLogsPaginated(e,{...t,offset:0},n);return r}async searchLogsPaginated(e,t={},n=100){try{if(await this.storage.ensureInitialized(),!await this.embeddings.isAvailable()){let r=await this.searchService.searchLogsPaginated(e,t,n);return{results:r.results.map(e=>this.mapFallbackRow(e)),total:r.total}}await this.indexMissingLogs(t);let r=this.storage.getSqliteClient(),i=await this.embeddings.embedText(e),a=JSON.stringify(i),{whereSql:o,params:s}=this.buildFilterSql(t),c=t.offset??0,l=`\n        SELECT COUNT(*) as total\n        FROM log_embeddings\n        JOIN logs ON logs.id = log_embeddings.log_id\n        ${o}\n      `,u=`\n        SELECT\n          logs.id as id,\n          logs.timestamp as timestamp,\n          logs.level as level,\n          logs.message as message,\n          logs.trace_id as traceId,\n          logs.span_id as spanId,\n          logs.parent_span_id as parentSpanId,\n          logs.service as service,\n          logs.hostname as hostname,\n          logs.pid as pid,\n          logs.metadata as metadata,\n          logs.error_type as errorType,\n          logs.error_message as errorMessage,\n          logs.error_stack as errorStack,\n          logs.session_id as sessionId,\n          logs.workflow_run_id as workflowRunId,\n          logs.workflow_name as workflowName,\n          logs.job_name as jobName,\n          logs.job_id as jobId,\n          logs.agent_name as agentName,\n          logs.parent_session_id as parentSessionId,\n          logs.workflow_run_key as workflowRunKey,\n          logs.workflow_id as workflowId,\n          logs.workflow_workspace as workflowWorkspace,\n          logs.step_name as stepName,\n          logs.phase as phase,\n          logs.signal_type as signalType,\n          logs.duration_ms as durationMs,\n          logs.created_at as createdAt,\n          vec_distance_cosine(log_embeddings.embedding, vec_f32(?)) as distance\n        FROM log_embeddings\n        JOIN logs ON logs.id = log_embeddings.log_id\n        ${o}\n        ORDER BY distance ASC\n        LIMIT ?\n        OFFSET ?\n      `,d=r.prepare(l).get(...s);return{results:Z(r.prepare(u).all(a,...s,n,c)).map(e=>this.mapRow(e)),total:Number(d.total??0)}}catch(r){let i=await this.searchService.searchLogsPaginated(e,t,n);return console.warn(`Semantic search unavailable, falling back to FTS: ${r instanceof Error?r.message:String(r)}`),{results:i.results.map(e=>this.mapFallbackRow(e)),total:i.total}}}};$=a([m(),e(0,p(s.LogStorageService)),e(1,p(s.LogSearchService)),e(2,p(s.EmbeddingService)),n(`design:paramtypes`,[Object,Object,Object])],$);const ye=new te(e=>{e.bind(s.LogStorageService).to(o).inSingletonScope(),e.bind(s.EmbeddingService).to(N).inSingletonScope(),e.bind(s.LogQueryService).to(i).inSingletonScope(),e.bind(s.LogMetricsService).to(t).inSingletonScope(),e.bind(s.MetricPointService).to(X).inSingletonScope(),e.bind(s.HostProcessSamplerService).to(W).inSingletonScope(),e.bind(s.LogSearchService).to(r).inSingletonScope(),e.bind(s.SemanticSearchService).to($).inSingletonScope(),e.bind(s.LogRetentionService).to(Y).inSingletonScope(),e.bind(s.HttpServerHealthCheck).to(G).inSingletonScope(),e.bind(s.HttpServerManager).to(J).inSingletonScope()});function be(){let e=new ee;e.load(ye);let t=e.get(s.LogStorageService);if(j()){let n=e.get(s.EmbeddingService);t.setEmbeddingWriter(e=>n.indexLogs(e))}return e}export{L as i,q as n,I as r,be as t};\n//# sourceMappingURL=container-DATXzAs6.mjs.map","import{u as e}from\"./LogStorageService-FUtAkl3y.mjs\";import{t}from\"./container-DATXzAs6.mjs\";import{i as n}from\"./node-BHLaIwwU.mjs\";import{coerceArgs as r,formatZodError as i}from\"@agimon-ai/foundation-validator\";import{Server as a}from\"@modelcontextprotocol/server\";import{z as o}from\"zod\";import{serveStdio as s}from\"@modelcontextprotocol/server/stdio\";const c=o.object({sessionId:o.string().optional().describe(`Agent session id to scope the analysis to one agent launch`),workflowRunId:o.string().optional().describe(`Workflow run id to scope to all jobs of one workflow run`),workflowName:o.string().optional().describe(`Workflow name to scope to all runs of a workflow type`),jobName:o.string().optional().describe(`Workflow job name to scope to a single job`),jobId:o.string().optional().describe(`Workflow job execution id to scope by`),agentName:o.string().optional().describe(`Agent identity to scope by`),workflowRunKey:o.string().optional().describe(`Workflow run key to scope by`),workflowWorkspace:o.string().optional().describe(`Workflow workspace to scope by`),stepName:o.string().optional().describe(`Workflow step name to scope by`),phase:o.string().optional().describe(`Workflow phase to scope by`),service:o.union([o.string(),o.array(o.string())]).optional().describe(`Agent/service name(s) to scope by (e.g. claude-code, codex)`),startTime:o.string().optional().describe(`Start time for the analysis window (ISO 8601 format)`),endTime:o.string().optional().describe(`End time for the analysis window (ISO 8601 format)`),limit:o.number().min(1).max(1e3).optional().default(100).describe(`Maximum number of issue samples to return`),scanLimit:o.number().min(1).max(1e5).optional().default(5e4).describe(`Maximum matching log records to scan; the response reports when this truncates the window`)});var l=class t{static TOOL_NAME=`analyze_agent_issues`;queryService;constructor(t){this.queryService=t.get(e.LogQueryService)}getInputSchema(){return c}getDefinition(){return{name:t.TOOL_NAME,description:`Detect and aggregate agent-run problems (failed tool calls, API errors, refusals, retries exhausted, rejected tools, error logs) for reviewing agent performance and improving the repo harness. Filter by session id, workflow run id, workflow name, job name, or agent/service. Returns counts by category/tool/error-type plus sample issues with the tool, input, and error context needed to diagnose them.`,inputSchema:o.toJSONSchema(c,{reused:`inline`})}}async execute(e){try{let t=c.parse(e),n=await this.queryService.analyzeAgentIssues({sessionId:t.sessionId,workflowRunId:t.workflowRunId,workflowName:t.workflowName,jobName:t.jobName,jobId:t.jobId,agentName:t.agentName,workflowRunKey:t.workflowRunKey,workflowWorkspace:t.workflowWorkspace,stepName:t.stepName,phase:t.phase,service:t.service,startTime:t.startTime?new Date(t.startTime):void 0,endTime:t.endTime?new Date(t.endTime):void 0},{sampleLimit:t.limit,scanLimit:t.scanLimit});return{content:[{type:`text`,text:JSON.stringify({...n,issues:n.issues.map(e=>({...e,timestamp:e.timestamp.toISOString()}))},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Error analyzing agent issues: ${e instanceof Error?e.message:`Unknown error`}`}],isError:!0}}}};const u=o.object({startTime:o.string().optional().describe(`Start time for statistics (ISO 8601 format)`),endTime:o.string().optional().describe(`End time for statistics (ISO 8601 format)`),groupBy:o.enum([`level`,`service`,`both`,`agent`,`workflow`,`job`,`signal`]).optional().default(`both`).describe(`Dimension used to group statistics.`),signalType:o.enum([`log`,`span`,`all`]).optional().default(`log`).describe(`Count log records by default, span records, or 'all' signals.`)});var d=class t{static TOOL_NAME=`get_log_stats`;queryService;constructor(t){this.queryService=t.get(e.LogQueryService)}getInputSchema(){return u}getDefinition(){return{name:t.TOOL_NAME,description:`Get aggregate log statistics including counts by level, service, or both. Useful for dashboards and monitoring.`,inputSchema:o.toJSONSchema(u,{reused:`inline`})}}async execute(e){try{let t=u.parse(e),n;(t.startTime||t.endTime)&&(n={start:t.startTime?new Date(t.startTime):/* @__PURE__ */ new Date(0),end:t.endTime?new Date(t.endTime):/* @__PURE__ */ new Date});let r=await this.queryService.getStatistics(n,t.groupBy,t.signalType);return{content:[{type:`text`,text:JSON.stringify({timeRange:n,groupBy:t.groupBy,signalType:t.signalType,totalEntries:r.reduce((e,t)=>e+t.count,0),statistics:r.map(e=>({service:e.service,level:e.level,count:e.count,value:t.groupBy===`level`?e.level:e.service}))},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Error getting log stats: ${e instanceof Error?e.message:`Unknown error`}`}],isError:!0}}}};const f=o.object({});var p=class t{static TOOL_NAME=`get_services`;queryService;constructor(t){this.queryService=t.get(e.LogQueryService)}getInputSchema(){return f}getDefinition(){return{name:t.TOOL_NAME,description:`List all active services that have sent logs. Returns service names sorted alphabetically.`,inputSchema:o.toJSONSchema(f,{reused:`inline`})}}async execute(e){try{let e=await this.queryService.getActiveServices();return{content:[{type:`text`,text:JSON.stringify({count:e.length,services:e.sort()},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Error getting services: ${e instanceof Error?e.message:`Unknown error`}`}],isError:!0}}}};const m=o.object({traceId:o.string().describe(`OTEL trace ID (32 hex characters)`)});var h=class t{static TOOL_NAME=`get_trace_timeline`;queryService;constructor(t){this.queryService=t.get(e.LogQueryService)}getInputSchema(){return m}getDefinition(){return{name:t.TOOL_NAME,description:`Reconstruct the chronological timeline of a distributed trace. Returns all spans in order with timing, service hops, and log messages.`,inputSchema:o.toJSONSchema(m,{reused:`inline`})}}async execute(e){try{let t=m.parse(e),n=await this.queryService.getTraceTimeline(t.traceId);return{content:[{type:`text`,text:JSON.stringify({traceId:t.traceId,count:n.length,timeline:n.map(e=>({timestamp:e.timestamp.toISOString(),service:e.service,spanId:e.spanId,parentSpanId:e.parentSpanId,level:e.level,message:e.message,duration:e.duration,signalType:e.signalType,errorType:e.errorType,errorMessage:e.errorMessage}))},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Error getting trace timeline: ${e instanceof Error?e.message:`Unknown error`}`}],isError:!0}}}};let g=/* @__PURE__ */ function(e){return e.TRACE=`trace`,e.DEBUG=`debug`,e.INFO=`info`,e.WARN=`warn`,e.ERROR=`error`,e.FATAL=`fatal`,e}({});const _=o.enum([`trace`,`debug`,`info`,`warn`,`error`,`fatal`]),v=o.enum([`fts`,`semantic`,`hybrid`]),y=o.object({searchQuery:o.string().optional().describe(`Text to search for. Common punctuation such as hyphens is escaped safely; quoted phrases, prefix matching with *, and boolean operators AND/OR/NOT are supported.`),query:o.string().optional().describe(`Alias for searchQuery. Use this for full-text search while also applying structured filters.`),mode:v.optional().default(`hybrid`).describe(`Search strategy to use`),service:o.union([o.string(),o.array(o.string())]).optional().describe(`Service name(s) to filter by`),level:o.union([_,o.array(_)]).optional().describe(`Log level(s) to filter by`),traceId:o.string().optional().describe(`Trace ID to filter by (OTEL format: 32 hex characters)`),spanId:o.string().optional().describe(`Span ID to filter by`),errorType:o.string().optional().describe(`Error type to filter by`),sessionId:o.string().optional().describe(`Agent session id to filter by`),workflowRunId:o.string().optional().describe(`Workflow run id to filter by`),workflowName:o.string().optional().describe(`Workflow name to filter by`),jobName:o.string().optional().describe(`Workflow job name to filter by`),jobId:o.string().optional().describe(`Workflow job execution id to filter by`),agentName:o.string().optional().describe(`Agent name to filter by`),parentSessionId:o.string().optional().describe(`Parent agent session id to filter by`),workflowRunKey:o.string().optional().describe(`Stable workflow run key to filter by`),workflowId:o.string().optional().describe(`Workflow file id to filter by`),workflowWorkspace:o.string().optional().describe(`Workflow workspace to filter by`),stepName:o.string().optional().describe(`Workflow step name to filter by`),phase:o.string().optional().describe(`Workflow phase to filter by`),signalType:o.enum([`log`,`span`]).optional().describe(`Telemetry signal type to filter by`),startTime:o.string().optional().describe(`Start time for log range (ISO 8601 format)`),endTime:o.string().optional().describe(`End time for log range (ISO 8601 format)`),limit:o.number().min(1).max(1e3).optional().default(100).describe(`Maximum number of search results to return`)});var b=class t{static TOOL_NAME=`search_logs`;queryService;searchService;semanticSearchService;constructor(t){this.queryService=t.get(e.LogQueryService),this.searchService=t.get(e.LogSearchService),this.semanticSearchService=t.get(e.SemanticSearchService)}getInputSchema(){return y}getDefinition(){return{name:t.TOOL_NAME,description:`Search and query log entries. Supports structured filters such as level, service, trace/session/workflow fields, time range, and optional full-text query using FTS5, local semantic embeddings, or both.`,inputSchema:o.toJSONSchema(y,{reused:`inline`})}}async execute(e){try{let t=y.parse(e),n=this.buildFilters(t),r=this.getSearchQuery(t),i=t.mode??`hybrid`,a=r?await this.searchByText(r,n,i,t.limit):await this.queryByFilters(n,t.limit);return{content:[{type:`text`,text:JSON.stringify({mode:r?i:`filter`,count:a.length,query:r,filters:Object.keys(n).length>0?this.serializeFilters(n):void 0,results:a.map(e=>this.serializeResult(e,!!r))},null,2)}]}}catch(e){return{content:[{type:`text`,text:`Error searching logs: ${e instanceof Error?e.message:`Unknown error`}`}],isError:!0}}}buildFilters(e){let t={};return e.service&&(t.service=e.service),e.level&&(t.level=e.level),e.traceId&&(t.traceId=e.traceId),e.spanId&&(t.spanId=e.spanId),e.errorType&&(t.errorType=e.errorType),e.sessionId&&(t.sessionId=e.sessionId),e.workflowRunId&&(t.workflowRunId=e.workflowRunId),e.workflowName&&(t.workflowName=e.workflowName),e.jobName&&(t.jobName=e.jobName),e.jobId&&(t.jobId=e.jobId),e.agentName&&(t.agentName=e.agentName),e.parentSessionId&&(t.parentSessionId=e.parentSessionId),e.workflowRunKey&&(t.workflowRunKey=e.workflowRunKey),e.workflowId&&(t.workflowId=e.workflowId),e.workflowWorkspace&&(t.workflowWorkspace=e.workflowWorkspace),e.stepName&&(t.stepName=e.stepName),e.phase&&(t.phase=e.phase),e.signalType&&(t.signalType=e.signalType),e.startTime&&(t.startTime=this.parseDate(e.startTime,`startTime`)),e.endTime&&(t.endTime=this.parseDate(e.endTime,`endTime`)),t}getSearchQuery(e){return(e.searchQuery??e.query)?.trim()||void 0}parseDate(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))throw Error(`Invalid ${t}: expected ISO 8601 timestamp`);return n}async queryByFilters(e,t){let n=Object.keys(e).length>0,r=!!(e.sessionId||e.workflowRunId||e.workflowName||e.jobName||e.traceId||e.spanId||e.startTime||e.endTime||e.service&&!e.level);return(await this.queryService.queryLogs({...e,level:n?e.level:[`info`,`warn`,`error`,`fatal`],order:r?`asc`:`desc`,limit:t})).logs}async searchByText(e,t,n,r){return n===`semantic`?this.semanticSearchService.searchLogs(e,t,r):n===`fts`?this.searchService.searchLogs(e,t,r):this.searchHybrid(e,t,r)}serializeFilters(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t instanceof Date?t.toISOString():t]))}serializeResult(e,t){let n=typeof e.score==`number`?e.score:typeof e.rank==`number`?this.getFallbackScore(e.rank):void 0;return{...t?{score:n,rank:e.rank,distance:e.distance,sources:e.sources}:{},id:e.id,timestamp:e.timestamp.toISOString(),level:e.level,message:e.message,service:e.service,traceId:e.traceId,spanId:e.spanId,parentSpanId:e.parentSpanId,hostname:e.hostname,pid:e.pid,metadata:e.metadata,errorType:e.errorType,errorMessage:e.errorMessage,errorStack:e.errorStack,sessionId:e.sessionId,workflowRunId:e.workflowRunId,workflowName:e.workflowName,jobName:e.jobName,jobId:e.jobId,agentName:e.agentName,parentSessionId:e.parentSessionId,workflowRunKey:e.workflowRunKey,workflowId:e.workflowId,workflowWorkspace:e.workflowWorkspace,stepName:e.stepName,phase:e.phase,signalType:e.signalType,durationMs:e.durationMs}}getFallbackScore(e){return 1/(1+Math.max(0,Math.abs(e)))}async searchHybrid(e,t,n){let r=Math.max(n*2,50),i=this.searchService.searchLogs(e,t,r),a=await this.semanticSearchService.isAvailable(),o=await i;if(!a)return o;let s=await this.semanticSearchService.searchLogs(e,t,r),c=/* @__PURE__ */ new Map;return o.forEach((e,t)=>{c.set(e.id,{result:e,score:.65*(1/(1+t)),rank:e.rank,sources:/* @__PURE__ */ new Set([`fts`])})}),s.forEach((e,t)=>{let n=c.get(e.id),r=.35*(1/(1+t));n?(n.score+=r,n.sources.add(`semantic`),n.distance=e.distance,n.result={...n.result,...e}):c.set(e.id,{result:e,score:r,distance:e.distance,sources:/* @__PURE__ */ new Set([`semantic`])})}),Array.from(c.values()).sort((e,t)=>t.score-e.score).slice(0,n).map(e=>({...e.result,score:e.score,sources:Array.from(e.sources),rank:e.rank,distance:e.distance}))}};const x=`@agimon-ai/po-logsink`;let S;function C(){return S??=n({serviceName:x,workspaceRoot:process.cwd(),discoverEndpoint:!1}),S}async function w(e,t,n){let r=await C();return r.runInSpan(e,{attributes:t},async()=>{try{return await n()}catch(n){throw r.logger.error(`${e} failed`,{attributes:t,exception:n}),n}})}function T(e){let n=new a({name:`po-logsink`,version:`0.1.0`},{capabilities:{tools:{}}}),s=e??t(),c=[new b(s),new l(s),new h(s),new d(s),new p(s)],u=new Map(c.map(e=>[e.getDefinition().name,e]));return n.setRequestHandler(`tools/list`,async()=>w(`mcp.server.list_tools`,{\"mcp.service\":x},async()=>({tools:c.map(e=>{let t=e.getDefinition();if(t.inputSchema.type!==`object`)throw Error(`Tool ${t.name} must declare an object input schema`);return{...t,inputSchema:{...t.inputSchema,type:`object`}}})}))),n.setRequestHandler(`tools/call`,async e=>{let{name:t,arguments:n}=e.params;return w(`mcp.server.call_tool`,{\"mcp.service\":x,\"mcp.tool.name\":t},async()=>{let e=u.get(t);if(!e)return{content:[{type:`text`,text:`Unknown tool: ${t}`}],isError:!0};let a=r(n??{},e.getInputSchema());try{return await e.execute(a)}catch(n){return n instanceof o.ZodError?{content:[{type:`text`,text:i(n,{schemaName:t,schema:e.getInputSchema()})}],isError:!0}:{content:[{type:`text`,text:`Error executing tool ${t}: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}})}),n}var E=class{createServer;canRestart;handle=null;started=!1;constructor(e){this.createServer=typeof e==`function`?e:()=>e,this.canRestart=typeof e==`function`}async start(){if(this.handle)throw Error(`MCP stdio server is already running`);if(this.started&&!this.canRestart)throw Error(`Cannot restart a preconstructed MCP server; provide a server factory instead`);this.handle=s(this.createServer,{legacy:`reject`}),this.started=!0}async stop(){this.handle&&=(await this.handle.close(),null)}};export{h as a,l as c,g as i,T as n,p as o,b as r,d as s,E as t};\n//# sourceMappingURL=stdio-DVTvHUla.mjs.map","import{z as e}from\"zod\";const t=e.string().trim().min(1).max(1024),n=e.union([t,e.array(t).min(1).max(100)]),r=e.iso.datetime({offset:!0}),i=e.number().int().min(1).max(1e3).optional(),a={sessionId:t.optional(),workflowRunId:t.optional(),workflowName:t.optional(),jobName:t.optional(),jobId:t.optional(),agentName:t.optional(),workflowRunKey:t.optional(),workflowWorkspace:t.optional(),stepName:t.optional(),phase:t.optional(),service:n.optional(),startTime:r.optional(),endTime:r.optional()},o=(e,t)=>{e.startTime&&e.endTime&&Date.parse(e.startTime)>Date.parse(e.endTime)&&t.addIssue({code:`custom`,message:`startTime must not be after endTime`,path:[`endTime`]})},s=e.enum([`trace`,`debug`,`info`,`warn`,`error`,`fatal`]),c=e.string().regex(/^[a-fA-F0-9]{32}$/,`Expected a 32-character hexadecimal trace ID`),l={status:e.object({}).strict(),search:e.object({...a,query:e.string().trim().min(1).max(4096).optional(),mode:e.literal(`fts`).optional(),level:e.union([s,e.array(s).min(1).max(6)]).optional(),traceId:c.optional(),spanId:e.string().regex(/^[a-fA-F0-9]{16}$/).optional(),errorType:t.optional(),parentSessionId:t.optional(),workflowId:t.optional(),signalType:e.enum([`log`,`span`]).optional(),order:e.enum([`asc`,`desc`]).optional().describe(`Chronological order for filter-only queries. Omit when query is supplied; FTS ranks by relevance.`),limit:i}).strict().superRefine(o).refine(e=>!e.query||e.order===void 0,{message:`order is filter-only. Omit order for relevance-ranked FTS search.`,path:[`order`]}),agentIssues:e.object({...a,limit:i,scanLimit:e.number().int().min(1).max(1e5).optional()}).strict().superRefine(o),trace:e.object({...a,traceId:c,limit:i}).strict().superRefine(o),stats:e.object({...a,groupBy:e.enum([`level`,`service`,`both`,`agent`,`workflow`,`job`,`signal`]).optional(),signalType:e.enum([`log`,`span`,`all`]).optional()}).strict().superRefine(o),services:e.object({...a,limit:i}).strict().superRefine(o),metrics:e.object({...a,model:n.optional(),provider:n.optional(),limit:i,toolLimit:i,groupBy:e.enum([`session`,`workflow-run`,`workflow-name`,`job`,`step`,`agent`,`model`,`provider`]).optional(),sort:e.enum([`last-seen`,`total-tokens`,`issues`]).optional(),toolSort:e.enum([`p90-total-tokens`,`avg-total-tokens`,`invocations`]).optional(),period:e.enum([`day`,`week`,`month`,`all`]).optional(),bucket:e.enum([`hour`,`day`,`week`,`month`]).optional()}).strict().superRefine(o)},u={status:e.toJSONSchema(l.status,{io:`input`,reused:`inline`}),search:e.toJSONSchema(l.search,{io:`input`,reused:`inline`}),agentIssues:e.toJSONSchema(l.agentIssues,{io:`input`,reused:`inline`}),trace:e.toJSONSchema(l.trace,{io:`input`,reused:`inline`}),stats:e.toJSONSchema(l.stats,{io:`input`,reused:`inline`}),services:e.toJSONSchema(l.services,{io:`input`,reused:`inline`}),metrics:e.toJSONSchema(l.metrics,{io:`input`,reused:`inline`})};function d(e,t){if(!Object.hasOwn(l,e))throw Error(`Unknown log query method: ${String(e)}`);return l[e].parse(t)}export{u as LOG_QUERY_INPUT_SCHEMAS,d as parseLogQueryInput};\n//# sourceMappingURL=queryContracts.mjs.map","import { execFile } from 'node:child_process';\nimport { setTimeout as sleep } from 'node:timers/promises';\nimport { fileURLToPath } from 'node:url';\nimport { promisify } from 'node:util';\n\nimport { resolveLogSinkPort } from '@agimon-ai/po-logsink';\n\n// Collector coordination allows a 5 s existing-owner probe and three 5 s\n// startup probes plus retry cleanup. Keep the nonfatal host deadline aligned.\nconst START_TIMEOUT_MS = 30_000;\nconst DISCOVERY_TIMEOUT_MS = 4_000;\nconst HEALTH_TIMEOUT_MS = 750;\nconst DISCOVERY_INTERVAL_MS = 1_100;\n\nconst execFileAsync = promisify(execFile);\n\nasync function healthy(env: NodeJS.ProcessEnv, timeoutMs = HEALTH_TIMEOUT_MS): Promise<boolean> {\n  // Registry discovery may wait on a broken daemon's health endpoint. The\n  // server must still start, without allowing that endpoint to select a local\n  // fallback or hold the startup path indefinitely.\n  let timer: NodeJS.Timeout | undefined;\n  try {\n    const result = await Promise.race([\n      resolveLogSinkPort({ env, healthCheck: true }),\n      new Promise<undefined>((resolve) => {\n        timer = setTimeout(() => resolve(undefined), timeoutMs);\n      }),\n    ]);\n    return result !== undefined;\n  } finally {\n    if (timer) clearTimeout(timer);\n  }\n}\n\n/** Attach to the shared daemon or start it through its published CLI. Never own its shutdown. */\nexport async function ensureGlobalLogSink(options: {\n  cwd: string;\n  env: NodeJS.ProcessEnv;\n  notice: (message: string) => void;\n}): Promise<void> {\n  const { cwd, env, notice } = options;\n  const startupDeadline = Date.now() + START_TIMEOUT_MS;\n  let failure: string | undefined;\n  try {\n    if (await healthy(env)) return;\n    const cli = fileURLToPath(import.meta.resolve('@agimon-ai/po-logsink/cli'));\n    await execFileAsync(process.execPath, [cli, 'start', '--global', '--http-only'], {\n      cwd,\n      env,\n      timeout: Math.max(1, startupDeadline - Date.now() - DISCOVERY_TIMEOUT_MS),\n      maxBuffer: 64 * 1024,\n    });\n  } catch (error) {\n    const metadata = (typeof error === 'object' && error !== null ? error : {}) as {\n      code?: unknown;\n      signal?: unknown;\n      killed?: unknown;\n    };\n    const code =\n      typeof metadata.code === 'number' && Number.isInteger(metadata.code)\n        ? metadata.code\n        : typeof metadata.code === 'string' && /^[A-Z0-9_]{1,32}$/u.test(metadata.code)\n          ? metadata.code\n          : 'unknown';\n    const signal =\n      typeof metadata.signal === 'string' && /^SIG[A-Z0-9]{1,16}$/u.test(metadata.signal) ? metadata.signal : 'none';\n    failure = `launcher failed (code=${code}, signal=${signal}, killed=${metadata.killed === true})`;\n  }\n\n  const deadline = Math.min(startupDeadline, Date.now() + DISCOVERY_TIMEOUT_MS);\n  while (Date.now() < deadline) {\n    if (await healthy(env, Math.min(HEALTH_TIMEOUT_MS, deadline - Date.now()))) return;\n    if (Date.now() + DISCOVERY_INTERVAL_MS > deadline) break;\n    await sleep(DISCOVERY_INTERVAL_MS);\n  }\n\n  notice(`Global log sink unavailable: ${failure ?? 'healthy discovery timed out'}. Telemetry remains nonfatal.`);\n}\n","import { createPrivateKey } from 'node:crypto';\n\nimport type { HeadlessHub } from '@agimon-ai/po-core/headlessHub';\nimport {\n  createPoNotificationEntryData,\n  isPoNotificationEntryData,\n  PO_NOTIFICATION_ENTRY_TYPE,\n} from '@agimon-ai/po-core/notification';\nimport { BACKGROUND_CONTEXT, readBoundedFile, type FileSystem } from '@agimon-ai/po-core/platform';\nimport type { RemoteRuntime } from '@agimon-ai/po-core/remoteRuntime';\nimport {\n  attentionNotification,\n  createNativePushSender,\n  notificationBody,\n  settledNotification,\n} from '@agimon-ai/po-notification';\n\ntype Sender = ReturnType<typeof createNativePushSender>;\ntype Credentials = Parameters<typeof createNativePushSender>[0];\ntype Remote = RemoteRuntime['remote'];\ntype Registration = Parameters<Sender['send']>[0];\nconst MAX_CREDENTIAL_BYTES = 64 * 1024;\nconst FANOUT = 4;\nconst MAX_PENDING = 64;\nconst SEND_TIMEOUT_MS = 10_000;\n\n/** Startup-only host credential loading. Diagnostics deliberately exclude paths and caught errors. */\nexport async function loadNativePushCredentials(\n  environment: NodeJS.ProcessEnv,\n  fs: FileSystem,\n  notice: (message: string) => void,\n): Promise<Credentials> {\n  const credentials: Credentials = { timeoutMs: SEND_TIMEOUT_MS };\n  const read = async (file: string) =>\n    new TextDecoder().decode(await readBoundedFile(fs, file, MAX_CREDENTIAL_BYTES, BACKGROUND_CONTEXT));\n  try {\n    const { PO_APNS_KEY_FILE: file, PO_APNS_KEY_ID: keyId, PO_APNS_TEAM_ID: teamId } = environment;\n    if (!file || !keyId || !teamId || !/^[A-Z0-9]{10}$/u.test(keyId) || !/^[A-Z0-9]{10}$/u.test(teamId))\n      throw new Error('Unavailable credentials');\n    const key = await read(file);\n    const parsed = createPrivateKey(key);\n    if (parsed.asymmetricKeyType !== 'ec' || parsed.asymmetricKeyDetails?.namedCurve !== 'prime256v1')\n      throw new Error('Invalid key');\n    credentials.apns = { key, keyId, teamId };\n  } catch {\n    notice('Native push APNs disabled: missing or invalid credentials.');\n  }\n  try {\n    const file = environment.PO_FCM_SERVICE_ACCOUNT_FILE;\n    if (!file) throw new Error('Unavailable credentials');\n    const value: unknown = JSON.parse(await read(file));\n    if (!value || typeof value !== 'object') throw new Error('Invalid account');\n    const account = value as Record<string, unknown>;\n    const { client_email: clientEmail, private_key: privateKey, project_id: projectId } = account;\n    if (\n      account.type !== 'service_account' ||\n      typeof clientEmail !== 'string' ||\n      !/^[^\\s@]+@[^\\s@]+$/u.test(clientEmail) ||\n      typeof projectId !== 'string' ||\n      !/^[a-z][a-z0-9-]{4,61}[a-z0-9]$/u.test(projectId) ||\n      typeof privateKey !== 'string'\n    )\n      throw new Error('Invalid account');\n    const parsed = createPrivateKey(privateKey);\n    if (parsed.asymmetricKeyType !== 'rsa' || (parsed.asymmetricKeyDetails?.modulusLength ?? 0) < 2048)\n      throw new Error('Invalid key');\n    credentials.fcm = { clientEmail, privateKey, projectId };\n  } catch {\n    notice('Native push FCM disabled: missing or invalid credentials.');\n  }\n  return credentials;\n}\n\nfunction endpoint(registration: Registration): string {\n  return JSON.stringify([\n    registration.platform,\n    registration.token,\n    registration.hostRef ?? null,\n    registration.platform === 'ios' ? registration.environment : null,\n  ]);\n}\n\n/** One live subscription for the entire hub, with no transcript reads or socket dependency. */\nexport function subscribeNativePush(\n  hub: Pick<HeadlessHub, 'onEvent' | 'snapshot' | 'sessionService'>,\n  remote: Pick<Remote, 'state' | 'listNativePushRegistrations' | 'clearNativePushRegistration'>,\n  sender: Sender,\n  notice: (message: string) => void,\n): () => void {\n  type Job = {\n    owners: ReturnType<Remote['listNativePushRegistrations']>;\n    notification: Parameters<Sender['send']>[1];\n    sessionId: string;\n  };\n  const pending: Job[] = [];\n  let active = 0;\n  let closed = false;\n  const pump = (): void => {\n    while (!closed && active < FANOUT && pending.length > 0) {\n      const job = pending.shift()!;\n      if (remote.state().status !== 'on') continue;\n      const current = remote.listNativePushRegistrations();\n      const owners = job.owners.filter((owner) =>\n        current.some(\n          (held) =>\n            held.notificationId === owner.notificationId &&\n            endpoint(held.registration) === endpoint(owner.registration),\n        ),\n      );\n      if (owners.length === 0) continue;\n      active++;\n      void sender\n        .send(owners[0]!.registration, job.notification, job.sessionId)\n        .then((result) => {\n          if (!closed && result.invalid)\n            for (const owner of owners) remote.clearNativePushRegistration(owner.notificationId, owner.registration);\n        })\n        .catch(() => notice('Native push delivery failed.'))\n        .finally(() => {\n          active--;\n          pump();\n        });\n    }\n  };\n  const enqueue = (notification: Job['notification'] | undefined, sessionId: string): void => {\n    if (!notification || closed || remote.state().status !== 'on') return;\n    const groups = new Map<string, Job['owners']>();\n    for (const owner of remote.listNativePushRegistrations()) {\n      const key = endpoint(owner.registration);\n      const group = groups.get(key);\n      if (group) group.push(owner);\n      else groups.set(key, [owner]);\n    }\n    for (const owners of groups.values()) {\n      if (pending.length + active >= MAX_PENDING) break; // Best effort, never an outbox.\n      pending.push({ owners, notification, sessionId });\n    }\n    pump();\n  };\n  type Session = ReturnType<HeadlessHub['snapshot']>[number];\n  type Tracked = {\n    session: Session;\n    running: boolean;\n    run: number;\n    dialogs: Set<string>;\n    warned: boolean;\n  };\n  const tracked = new Map<string, Tracked>();\n  const finished = async (sessionId: string, held: Tracked, run: number): Promise<void> => {\n    if (held.session.parentSessionId !== undefined || remote.state().status !== 'on') return;\n    const current = () =>\n      !closed && tracked.get(sessionId) === held && held.run === run && held.session.phase === 'idle';\n    try {\n      // Hub summaries do not maintain pendingMessageCount. Only the host knows its queue.\n      const state = await hub.sessionService.readExecutionState?.(sessionId);\n      if (!current() || remote.state().status !== 'on') return;\n      if (!state) throw new Error('Execution state unavailable');\n      if (state.isIdle && !state.hasPendingMessages)\n        enqueue(\n          createPoNotificationEntryData(settledNotification({ cwd: held.session.cwd, sessionName: held.session.name })),\n          sessionId,\n        );\n    } catch {\n      // ponytail: mirrors without a state reader stay quiet; add a mirror reader for completion parity.\n      if (current() && remote.state().status === 'on' && !held.warned) {\n        held.warned = true;\n        notice('Native push completion check unavailable.');\n      }\n    }\n  };\n  const track = (session: Session): void => {\n    let held = tracked.get(session.id);\n    if (!held) {\n      held = { session, running: false, run: 0, dialogs: new Set(), warned: false };\n      tracked.set(session.id, held);\n    }\n    held.session = session;\n    if (session.phase === 'turn' && !held.running) {\n      held.running = true;\n      held.run++;\n      held.dialogs.clear();\n    } else if (session.phase === 'idle' && held.running) {\n      held.running = false;\n      void finished(session.id, held, held.run);\n    }\n  };\n  for (const session of hub.snapshot()) track(session);\n  const unsubscribe = hub.onEvent((event) => {\n    if (closed) return;\n    if (event.kind === 'upsert') {\n      track(event.session);\n      return;\n    }\n    if (event.kind === 'removed') {\n      tracked.delete(event.sessionId);\n      return;\n    }\n    if (event.kind !== 'frame') return;\n    const { frame, sessionId } = event;\n    if (frame.type === 'extension_ui_request') {\n      const held = tracked.get(sessionId);\n      if (\n        !held ||\n        held.session.parentSessionId !== undefined ||\n        held.session.phase !== 'turn' ||\n        typeof frame.method !== 'string' ||\n        !['select', 'confirm', 'input', 'editor'].includes(frame.method) ||\n        typeof frame.id !== 'string' ||\n        !frame.id.trim() ||\n        held.dialogs.has(frame.id)\n      )\n        return;\n      held.dialogs.add(frame.id);\n      const text = [frame.message, frame.title].find(\n        (value): value is string => typeof value === 'string' && !!value.trim(),\n      );\n      enqueue(\n        createPoNotificationEntryData({\n          ...attentionNotification(notificationBody(text ?? 'A question is waiting for your answer.')),\n          subtitle: held.session.name,\n        }),\n        sessionId,\n      );\n      return;\n    }\n    if (frame.type !== 'entry_appended') return;\n    const entry = frame.entry;\n    if (\n      entry &&\n      typeof entry === 'object' &&\n      'customType' in entry &&\n      entry.customType === PO_NOTIFICATION_ENTRY_TYPE &&\n      'data' in entry &&\n      isPoNotificationEntryData(entry.data)\n    )\n      enqueue(entry.data, sessionId);\n  });\n  return () => {\n    closed = true;\n    pending.length = 0;\n    tracked.clear();\n    unsubscribe();\n    sender.close();\n  };\n}\n","import { monitorEventLoopDelay, performance } from 'node:perf_hooks';\n\nimport { memoryDiagnosticAttributes } from '@agimon-ai/po-core/platform';\n\nexport interface RuntimeResourceSample {\n  monotonicMs: number;\n  cpu: NodeJS.CpuUsage;\n  memory: NodeJS.MemoryUsage;\n}\n\n/** Process CPU percent uses one logical core as 100%, not the whole host. */\nexport function resourceAttributes(\n  previous: RuntimeResourceSample,\n  current: RuntimeResourceSample,\n): Record<string, number> {\n  const elapsed = Math.max(1, current.monotonicMs - previous.monotonicMs);\n  const user = Math.max(0, current.cpu.user - previous.cpu.user);\n  const system = Math.max(0, current.cpu.system - previous.cpu.system);\n  return {\n    host_pid: process.pid,\n    interval_ms: elapsed,\n    cpu_percent: ((user + system) / (elapsed * 1_000)) * 100,\n    cpu_user_ms: user / 1_000,\n    cpu_system_ms: system / 1_000,\n    rss_bytes: current.memory.rss,\n    heap_used_bytes: current.memory.heapUsed,\n    heap_total_bytes: current.memory.heapTotal,\n    external_bytes: current.memory.external,\n    array_buffers_bytes: current.memory.arrayBuffers,\n  };\n}\n\n/** One bounded exporter per server, never one stream or unbounded queue per session. */\nexport function monitorRuntimeResources(options: {\n  record(attributes: Record<string, number>): Promise<unknown>;\n  counts(): Record<string, number>;\n  warn(message: string): void;\n  intervalMs?: number;\n}): () => void {\n  const interval = options.intervalMs ?? 10_000;\n  if (!Number.isFinite(interval) || interval < 1) throw new RangeError('Resource interval must be positive');\n  const snapshot = (): RuntimeResourceSample => ({\n    monotonicMs: performance.now(),\n    cpu: process.cpuUsage(),\n    memory: process.memoryUsage(),\n  });\n  let previous = snapshot();\n  let utilization = performance.eventLoopUtilization();\n  let pending = false;\n  const histogram = monitorEventLoopDelay({ resolution: 20 });\n  histogram.enable();\n  const timer = setInterval(() => {\n    if (pending) return;\n    pending = true;\n    try {\n      const current = snapshot();\n      const currentUtilization = performance.eventLoopUtilization();\n      const deltaUtilization = performance.eventLoopUtilization(currentUtilization, utilization);\n      const attributes = {\n        ...resourceAttributes(previous, current),\n        ...memoryDiagnosticAttributes(),\n        ...options.counts(),\n        event_loop_utilization: deltaUtilization.utilization,\n        event_loop_p99_ms: histogram.count ? histogram.percentile(99) / 1e6 : 0,\n        event_loop_max_ms: histogram.count ? histogram.max / 1e6 : 0,\n      };\n      previous = current;\n      utilization = currentUtilization;\n      histogram.reset();\n      void Promise.resolve(options.record(attributes))\n        .catch((error: unknown) => {\n          options.warn(`Resource telemetry failed: ${String(error)}`);\n        })\n        .finally(() => {\n          pending = false;\n        });\n    } catch (error) {\n      pending = false;\n      options.warn(`Resource sampling failed: ${String(error)}`);\n    }\n  }, interval);\n  timer.unref();\n  return () => {\n    clearInterval(timer);\n    histogram.disable();\n  };\n}\n","import type { HeadlessHub, HeadlessHubSession } from '@agimon-ai/po-core/headlessHub';\nimport type { HeadlessSessionHost } from '@agimon-ai/po-core/headlessSessionHost';\nimport type { OpenSessionRecord, WorkspaceRecord } from '@agimon-ai/po-core/history';\nimport type {\n  PoHubChannel,\n  PoHubChannelHost,\n  PoHubSessionApiRequest,\n  PoHubSessionCreateRequest,\n  PoHubSessionScope,\n} from '@agimon-ai/po-core/hubChannel';\nimport { MODEL_GATEWAY_FRAME_TYPE, runModelGateway, type ModelGatewayRunner } from '@agimon-ai/po-core/modelGateway';\nimport { definePoPluginMethod } from '@agimon-ai/po-core/pluginProtocol';\nimport {\n  createProtocolClient,\n  createTextLink,\n  PoChannelsContract,\n  PoHubContract,\n  PoSessionContract,\n  SESSION_GROUPS_CHANGED_FRAME,\n  type ChannelsRef,\n  type HubNotice,\n  type HubRef,\n  type HubSessionView,\n  type JsonValue,\n  type ProtocolClient,\n  type SessionRef,\n  type TranscriptPage,\n  type TranscriptPageRequest,\n} from '@agimon-ai/po-core/sessionProtocol';\nimport type { PoWorkspaceSandboxEndpoint, PoWorkspaceSandboxes } from '@agimon-ai/po-core/workspaceSandboxes';\nimport { Type } from 'typebox';\nimport WebSocket from 'ws';\n\nimport {\n  containedAdoptSessionMethod,\n  containedCloseSessionMethod,\n  containedCreateInput,\n  containedCreateSessionMethod,\n} from './containedSessions';\nimport type { HostModelGateway } from './hostModelGateway';\n\ntype Link = ReturnType<typeof createTextLink>['link'];\n\n/** Why a contained workspace cannot open, or reach, a session right now. */\nexport const SANDBOX_UNREACHABLE = \"This workspace's sandbox is not running, so its sessions are unavailable.\";\nconst RECONNECT_MS = 2_000;\nconst CONNECT_TIMEOUT_MS = 15_000;\n/** How long opening a session waits for a container that runs but does not listen yet. */\nconst START_WAIT_MS = 60_000;\nconst MIRROR_WAIT_MS = 60_000;\nconst TOKEN_HEADER = 'x-po-token';\n/** The largest protocol message the host accepts from a container, as a contained server accepts from its host. */\nconst MAX_PAYLOAD_BYTES = 8 * 1024 * 1024;\nconst Json = Type.Unsafe<JsonValue>({});\n\n/**\n * Session plugin methods the host forwards to the container, and nothing else: never `mcp.apps`, `voice.control`,\n * anything of the machine API or login, and never a global `/api/plugins/*` route.\n */\nexport const FORWARDED_SESSION_METHODS: readonly { readonly service: string; readonly method: string }[] = [\n  { service: 'browse', method: 'frame' },\n  { service: 'browse', method: 'snapshot' },\n  { service: 'browse', method: 'close' },\n];\n\nexport interface SandboxRouterOptions {\n  readonly hub: HeadlessHub;\n  readonly sandboxes: Pick<PoWorkspaceSandboxes, 'get'>;\n  /** The host's workspace records; a record with `sandbox` is contained. */\n  readonly workspaces: () => readonly WorkspaceRecord[];\n  /** Registers a contained workspace on the hub, available only while its container link is up. */\n  announceWorkspace(workspaceId: string, available: boolean): void;\n  /** A mirror's web and native compositions, published from the host's global composition. */\n  sessionCompositions(sessionId: string): Pick<HeadlessHubSession, 'webComposition' | 'nativeComposition'>;\n  /** Drops what `sessionCompositions` published for a closed mirror. */\n  forgetCompositions(sessionId: string): void;\n  /** The host's models for container gateways; undefined runs no gateway. */\n  modelGateway?(): Promise<HostModelGateway | undefined>;\n  /** Opens a protocol link to a container. Defaults to a WebSocket with the token in a header. */\n  openLink?(endpoint: PoWorkspaceSandboxEndpoint): Promise<Link>;\n  readonly fetch?: typeof fetch;\n  readonly reconnectMs?: number;\n  readonly startWaitMs?: number;\n  /** A workspace's container link came up: host sessions waiting to be adopted can be retried. */\n  onLinked?(workspaceId: string): void;\n  onNotice(message: string): void;\n}\n\n/** Routes sessions of contained workspaces into their containers, through mirrors on the host hub. */\nexport interface SandboxRouter {\n  /** Links every contained workspace in the background; links come back by themselves after a drop. */\n  start(): void;\n  /** Whether the workspace is contained (its record names a sandbox). */\n  contains(workspaceId: string | undefined): boolean;\n  /** Whether the workspace's container link is up. */\n  connected(workspaceId: string): boolean;\n  /** The mirror host of a live container session. */\n  mirror(sessionId: string): HeadlessSessionHost | undefined;\n  mirrors(): readonly HeadlessSessionHost[];\n  /** Whether the session is a container session: a live mirror or a dormant container record. */\n  owns(sessionId: string): boolean;\n  /** Container sessions that are recorded but not running. */\n  dormant(): readonly OpenSessionRecord[];\n  openSession(workspaceId: string, request: PoHubSessionCreateRequest, sessionId?: string): Promise<PoHubSessionScope>;\n  /** The hub closed the mirror: closes the container session unless the container ended it or the host shuts down. */\n  closeSession(\n    sessionId: string,\n    options?: { readonly keepDormant?: boolean; readonly disposeOnly?: boolean },\n  ): Promise<void>;\n  /**\n   * Removes a container session for good, with its files, in the container. `workspaceId` names the container of a\n   * session the host just handed over, before the container lists it.\n   */\n  removeSession(sessionId: string, workspaceId?: string): Promise<void>;\n  /** Registers a host session the host just closed and moved into the container as a dormant container session. */\n  adoptSession(workspaceId: string, record: OpenSessionRecord): Promise<void>;\n  /** Ends the workspace's mirrors and drops its link without closing container sessions, for switching it off. */\n  release(workspaceId: string): Promise<void>;\n  setDormantGroups(sessionId: string, groups: readonly string[]): Promise<void>;\n  revive(sessionId: string): Promise<void>;\n  restart(sessionId: string): Promise<void>;\n  resume(sessionId: string, targetSessionId: string): Promise<string>;\n  resumeWorkspace(workspaceId: string, targetSessionId: string): Promise<string>;\n  history(workspaceId: string): Promise<unknown[]>;\n  /** A live container session's saved history, read in its container. */\n  sessionHistory(sessionId: string): Promise<unknown[]>;\n  /** A dormant container session's saved transcript, read in its container. */\n  readTranscript(sessionId: string, request: TranscriptPageRequest): Promise<TranscriptPage>;\n  requestSessionApi(scope: PoHubSessionScope, request: PoHubSessionApiRequest): Promise<Response>;\n  /** Drops every mirror and link without closing container sessions: the containers keep them. */\n  dispose(): Promise<void>;\n}\n\ninterface Mirror {\n  readonly sessionId: string;\n  readonly link: ContainerLink;\n  readonly host: HeadlessSessionHost;\n  readonly channels: ChannelsRef;\n  view: HubSessionView;\n  /** The container ended it: closing the mirror must not close the container session again. */\n  ended: boolean;\n  end(): void;\n  emit(frame: Record<string, unknown>): void;\n  dispose(): void;\n}\n\ninterface ContainerLink {\n  readonly workspaceId: string;\n  readonly client: ProtocolClient;\n  endpoint: PoWorkspaceSandboxEndpoint | undefined;\n  hub: HubRef | undefined;\n  /** Settles once the first connection and the `po.hub` reference are up, or failed. */\n  ready: Promise<boolean>;\n  dormant: OpenSessionRecord[];\n  gateway: { runner: ModelGatewayRunner; abort: AbortController; channelsOf: string | undefined } | undefined;\n  readonly creating: Set<string>;\n  /** Container sessions the host just closed, ignored until the container list drops them. */\n  readonly closing: Set<string>;\n  readonly seenNotices: Set<string>;\n  reconnect: ReturnType<typeof setTimeout> | undefined;\n  lastError: string | undefined;\n  disposed: boolean;\n  stops: (() => void)[];\n}\n\nfunction message(error: unknown): string {\n  return error instanceof Error ? error.message : String(error);\n}\n\n/** A held reference's value, or `fallback` while it is still loading. */\nfunction readyValue<T>(readable: { readonly value: T }, fallback: T): T {\n  try {\n    return readable.value;\n  } catch {\n    // Not live yet: the subscription delivers the value once it is.\n    return fallback;\n  }\n}\n\n/** A text protocol link over a WebSocket to a container's loopback listener; the token travels as a header. */\nasync function openWebSocketLink(endpoint: PoWorkspaceSandboxEndpoint): Promise<Link> {\n  const socket = new WebSocket(`${endpoint.origin.replace(/^http/u, 'ws')}/api/ws`, {\n    headers: { [TOKEN_HEADER]: endpoint.token },\n    maxPayload: MAX_PAYLOAD_BYTES,\n  });\n  const port = createTextLink({\n    send: (text) => {\n      if (socket.readyState === WebSocket.OPEN) socket.send(text);\n    },\n    close: () => socket.close(),\n  });\n  socket.on('message', (data: WebSocket.RawData) =>\n    port.deliver((Array.isArray(data) ? Buffer.concat(data) : Buffer.from(data as ArrayBuffer)).toString('utf8')),\n  );\n  socket.on('close', () => port.ended('socket closed'));\n  await new Promise<void>((resolve, reject) => {\n    const timer = setTimeout(() => {\n      socket.terminate();\n      reject(new Error('The sandbox did not answer in time.'));\n    }, CONNECT_TIMEOUT_MS);\n    socket.once('open', () => {\n      clearTimeout(timer);\n      resolve();\n    });\n    socket.once('error', (error) => {\n      clearTimeout(timer);\n      reject(error);\n    });\n  });\n  socket.on('error', () => port.ended('socket failed'));\n  return port.link;\n}\n\nfunction dormantRecord(view: HubSessionView, workspaceId: string): OpenSessionRecord {\n  return {\n    sessionId: view.id,\n    workspaceId,\n    cwd: view.cwd,\n    name: view.name,\n    createdAt: view.createdAt,\n    ...(view.parentSessionId === undefined ? {} : { parentSessionId: view.parentSessionId }),\n    ...(view.sessionProvenance === undefined ? {} : { sessionProvenance: view.sessionProvenance }),\n    ...(view.groups === undefined ? {} : { groups: [...view.groups] }),\n  };\n}\n\nconst sameList = (left: readonly string[] | undefined, right: readonly string[] | undefined): boolean =>\n  JSON.stringify(left ?? []) === JSON.stringify(right ?? []);\n\n/** The empty channel view a gateway watches until a container session gives it a real one. */\nconst NO_CHANNELS = { latest: { value: {}, subscribe: () => () => undefined } } as unknown as Pick<\n  ChannelsRef,\n  'latest'\n>;\n\nexport function createSandboxRouter(options: SandboxRouterOptions): SandboxRouter {\n  const { hub } = options;\n  const notice = (text: string): void => options.onNotice(text);\n  const doFetch = options.fetch ?? fetch;\n  const reconnectMs = options.reconnectMs ?? RECONNECT_MS;\n  const startWaitMs = options.startWaitMs ?? START_WAIT_MS;\n  const openLink = (endpoint: PoWorkspaceSandboxEndpoint): Promise<Link> =>\n    options.openLink === undefined ? openWebSocketLink(endpoint) : options.openLink(endpoint);\n  const links = new Map<string, ContainerLink>();\n  const mirrors = new Map<string, Mirror>();\n  const mirrorWaiters = new Set<() => void>();\n  let disposed = false;\n\n  const record = (workspaceId: string | undefined): WorkspaceRecord | undefined =>\n    workspaceId === undefined ? undefined : options.workspaces().find((entry) => entry.id === workspaceId);\n  const contains = (workspaceId: string | undefined): boolean => record(workspaceId)?.sandbox !== undefined;\n\n  const linkOfSession = (sessionId: string): ContainerLink | undefined =>\n    mirrors.get(sessionId)?.link ??\n    [...links.values()].find((link) => link.dormant.some((entry) => entry.sessionId === sessionId));\n\n  /** Runs `fn` against the container in a root of the link's client, failing at once while the link is down. */\n  const remote = <T>(link: ContainerLink, fn: (hubRef: HubRef, ctx: never) => Promise<T>, signal?: AbortSignal) => {\n    const hubRef = link.hub;\n    if (disposed || hubRef === undefined || !link.client.connected || hubRef.status !== 'live')\n      return Promise.reject(new Error(SANDBOX_UNREACHABLE));\n    return link.client.host.root((ctx) => fn(hubRef, ctx as never), signal === undefined ? {} : { signal });\n  };\n\n  /** A request to the container's own HTTP API, with its token. */\n  const containerFetch = async (link: ContainerLink, pathname: string, init: RequestInit = {}): Promise<Response> => {\n    const endpoint = link.endpoint;\n    if (endpoint === undefined || !link.client.connected) throw new Error(SANDBOX_UNREACHABLE);\n    const headers = new Headers(init.headers);\n    headers.set(TOKEN_HEADER, endpoint.token);\n    return doFetch(new URL(pathname, endpoint.origin), { ...init, headers });\n  };\n  const containerJson = async (link: ContainerLink, pathname: string, init: RequestInit = {}): Promise<unknown> => {\n    const response = await containerFetch(link, pathname, {\n      ...init,\n      ...(init.body === undefined ? {} : { headers: { 'content-type': 'application/json' } }),\n    });\n    const body = (await response.json().catch(() => ({}))) as { error?: unknown };\n    if (!response.ok)\n      throw new Error(typeof body.error === 'string' ? body.error : `The sandbox answered ${String(response.status)}.`);\n    return body;\n  };\n  const sessionPath = (link: ContainerLink, sessionId: string, suffix = '') =>\n    `/api/workspaces/${encodeURIComponent(link.workspaceId)}/sessions/${encodeURIComponent(sessionId)}${suffix}`;\n\n  const waitForMirror = (sessionId: string, previous?: HeadlessSessionHost): Promise<void> =>\n    new Promise<void>((resolve, reject) => {\n      const check = (): boolean => {\n        const current = mirrors.get(sessionId);\n        if (current === undefined || current.host === previous || hub.session(sessionId)?.host !== current.host)\n          return false;\n        clearTimeout(timer);\n        mirrorWaiters.delete(waiter);\n        resolve();\n        return true;\n      };\n      const waiter = (): void => {\n        check();\n      };\n      const timer = setTimeout(() => {\n        mirrorWaiters.delete(waiter);\n        reject(new Error(`The sandbox session ${sessionId} did not appear on the host in time.`));\n      }, MIRROR_WAIT_MS);\n      if (!check()) mirrorWaiters.add(waiter);\n    });\n\n  const gatewayFollow = (link: ContainerLink): void => {\n    const gateway = link.gateway;\n    if (gateway === undefined) return;\n    if (gateway.channelsOf !== undefined && mirrors.get(gateway.channelsOf)?.link === link) return;\n    const next = [...mirrors.values()].find((mirror) => mirror.link === link);\n    gateway.channelsOf = next?.sessionId;\n    gateway.runner.useChannels(next?.channels ?? NO_CHANNELS);\n  };\n\n  /** Merges the container session's channels into the host session, one session-mounted channel per frame type. */\n  const mergeChannels = (link: ContainerLink, sessionId: string, channels: ChannelsRef): (() => void) => {\n    const mounted = new Map<string, () => void>();\n    const publishers = new Map<string, PoHubChannelHost>();\n    /** The host connection that sent the last receive of a type: the next change of that type answers it only. */\n    const requesters = new Map<string, string>();\n    const last = new Map<string, string>();\n    const mount = (frameType: string): void => {\n      if (frameType === MODEL_GATEWAY_FRAME_TYPE || mounted.has(frameType)) return;\n      const channel: PoHubChannel = {\n        frameType,\n        start(channelHost) {\n          publishers.set(frameType, channelHost);\n          return {\n            payloadFor: () => (readyValue(channels.latest, {}) as Record<string, unknown>)[frameType],\n            close: () => publishers.delete(frameType),\n          };\n        },\n        receive(_scope, payload, connection) {\n          requesters.set(frameType, connection.connectionId);\n          void remote(link, (_hubRef, ctx) =>\n            channels.receive({ type: frameType, payload: payload as JsonValue }, ctx),\n          ).catch((error: unknown) => notice(`Sandbox channel ${frameType} for ${sessionId}: ${message(error)}`));\n        },\n        disconnected(connection) {\n          for (const [type, connectionId] of requesters)\n            if (connectionId === connection.connectionId) requesters.delete(type);\n        },\n      };\n      mounted.set(frameType, hub.registerChannel(channel, { scope: 'session', sessionId }));\n    };\n    // ponytail: a container publishes a targeted reply to its only connection, the host, so the host cannot tell it\n    // from a broadcast. The next change after a receive goes to the requester alone.\n    const apply = (latest: unknown): void => {\n      for (const [frameType, payload] of Object.entries((latest ?? {}) as Record<string, unknown>)) {\n        if (frameType === MODEL_GATEWAY_FRAME_TYPE) continue;\n        mount(frameType);\n        const text = JSON.stringify(payload);\n        if (last.get(frameType) === text) continue;\n        last.set(frameType, text);\n        const channelHost = publishers.get(frameType);\n        const requester = requesters.get(frameType);\n        requesters.delete(frameType);\n        if (requester !== undefined && channelHost?.publishToConnection?.(requester, sessionId, payload) === true)\n          continue;\n        channelHost?.publish(sessionId, payload);\n      }\n    };\n    apply(readyValue(channels.latest, {}));\n    const stop = channels.latest.subscribe(apply);\n    return () => {\n      stop();\n      for (const unmount of mounted.values()) unmount();\n      mounted.clear();\n    };\n  };\n\n  /** Registers the allowlisted invoke forwards for one mirror session; the host's auth runs before each. */\n  const forwardMethods = (link: ContainerLink, sessionId: string): (() => void) => {\n    const unregister = FORWARDED_SESSION_METHODS.map(({ service, method }) =>\n      hub.pluginRegistry.register(\n        { scope: 'session', sessionId },\n        definePoPluginMethod({\n          service,\n          method,\n          scope: 'session',\n          direction: 'client-to-server',\n          input: Json,\n          output: Json,\n        }),\n        (input, caller) =>\n          remote(\n            link,\n            // The mount comes from this registration, never from the payload.\n            (hubRef, ctx) =>\n              hubRef.invoke(\n                { mount: { scope: 'session', sessionId }, service, method, input },\n                ctx,\n              ) as Promise<JsonValue>,\n            caller.signal,\n          ),\n      ),\n    );\n    return () => {\n      for (const stop of unregister) stop();\n    };\n  };\n\n  const createMirror = async (link: ContainerLink, view: HubSessionView): Promise<void> => {\n    const sessionId = view.id;\n    link.creating.add(sessionId);\n    let session: SessionRef | undefined;\n    let channels: ChannelsRef | undefined;\n    try {\n      session = await link.client.host.get(PoSessionContract, { sessionId });\n      channels = await link.client.host.get(PoChannelsContract, { sessionId });\n      if (disposed || link.disposed || hub.session(sessionId) !== undefined) {\n        session.release();\n        channels.release();\n        return;\n      }\n      const heldSession = session;\n      const heldChannels = channels;\n      let resolveExit!: (code: number) => void;\n      const exited = new Promise<number>((resolve) => {\n        resolveExit = resolve;\n      });\n      const presentation = new Set<(frame: Record<string, unknown>) => void>();\n      const call = (name: string, args: readonly unknown[]): Promise<unknown> =>\n        remote(link, (_hubRef, ctx) =>\n          (heldSession as unknown as Record<string, (...input: unknown[]) => Promise<unknown>>)[name]!.call(\n            heldSession,\n            ...args,\n            ctx,\n          ),\n        );\n      const readState = async () => {\n        const state = readyValue(heldSession.state, null);\n        return { ...state?.snapshot, sessionId, isStreaming: (mirror.view.phase ?? 'idle') !== 'idle' };\n      };\n      // A stand-in for the hub: the protocol forwards `po.session`, so only what the hub itself calls is here.\n      const runtime = {\n        sessionId,\n        laneName: 'main',\n        exited,\n        session: { snapshot: async () => ({}) },\n        readState,\n        readEntries: async () => ({ entries: [], leafId: null }),\n        submitPrompt: async (text: string) => ({\n          settled: call('prompt', [{ text, waitFor: 'settled' }]).then(() => undefined),\n        }),\n        abort: () => call('abort', []),\n        steer: (text: string) => call('steer', [text]),\n        setGroups: (groups: readonly string[]) => call('setGroups', [[...groups]]),\n      } as unknown as HeadlessSessionHost['runtime'];\n      const host: HeadlessSessionHost = {\n        runtime,\n        agentSession: {\n          session: heldSession,\n          root: (fn, rootOptions) => link.client.host.root(fn, rootOptions),\n          connected: () => link.client.connected && link.hub?.status === 'live',\n        },\n        host: undefined,\n        toolSurface: {} as HeadlessSessionHost['toolSurface'],\n        mcpSurface: {} as HeadlessSessionHost['mcpSurface'],\n        preparePackages: () => undefined,\n        activatePackages: async () => undefined,\n        canDispatch: () => false,\n        onPresentationFrame: (listener) => {\n          presentation.add(listener);\n          return () => presentation.delete(listener);\n        },\n        // Dialog answers travel as `extensionUiResponse` on the forwarded session, so nothing answers here.\n        respondToExtensionUi: () => false,\n        dispose: async () => undefined,\n      };\n      const stops: (() => void)[] = [];\n      const mirror: Mirror = {\n        sessionId,\n        link,\n        host,\n        channels: heldChannels,\n        view,\n        ended: false,\n        end() {\n          if (mirror.ended) return;\n          mirror.ended = true;\n          resolveExit(0);\n        },\n        emit(frame) {\n          for (const listener of presentation) listener(frame);\n        },\n        dispose() {\n          for (const stop of stops.splice(0)) stop();\n          presentation.clear();\n          heldSession.release();\n          heldChannels.release();\n          resolveExit(0);\n        },\n      };\n      // The container ended this runtime (a close or a restart): the mirror ends with it.\n      stops.push(heldSession.alive.subscribe((alive) => !alive && mirror.end()));\n      mirrors.set(sessionId, mirror);\n      try {\n        hub.register({\n          id: sessionId,\n          workspaceId: link.workspaceId,\n          name: view.name,\n          cwd: view.cwd,\n          createdAt: view.createdAt,\n          ...(view.parentSessionId === undefined ? {} : { parentSessionId: view.parentSessionId }),\n          ...(view.sessionProvenance === undefined ? {} : { sessionProvenance: view.sessionProvenance }),\n          groups: [...(view.groups ?? [])],\n          everPrompted: view.everPrompted,\n          ...(view.lastSettledAt === undefined ? {} : { lastSettledAt: view.lastSettledAt }),\n          ...(view.phase === 'idle' ? {} : { phase: view.phase }),\n          awaitingInput: view.awaitingInput,\n          ...options.sessionCompositions(sessionId),\n          host,\n        });\n      } catch (error) {\n        mirrors.delete(sessionId);\n        mirror.dispose();\n        throw error;\n      }\n      stops.push(forwardMethods(link, sessionId), mergeChannels(link, sessionId, heldChannels));\n      gatewayFollow(link);\n      replayNotices(link);\n      for (const waiter of mirrorWaiters) waiter();\n    } catch (error) {\n      session?.release();\n      channels?.release();\n      if (!disposed) notice(`Sandbox session ${sessionId} could not be mirrored: ${message(error)}`);\n    } finally {\n      link.creating.delete(sessionId);\n    }\n  };\n\n  /** Replays the container's changes of a live session as the frames the host hub reads. */\n  const updateMirror = (mirror: Mirror, view: HubSessionView): void => {\n    const previous = mirror.view;\n    mirror.view = view;\n    const wasIdle = (previous.phase ?? 'idle') === 'idle';\n    const isIdle = (view.phase ?? 'idle') === 'idle';\n    if (wasIdle && !isIdle) mirror.emit({ type: 'agent_start' });\n    if (previous.name !== view.name) mirror.emit({ type: 'session_info_changed', name: view.name });\n    if (!sameList(previous.groups, view.groups))\n      mirror.emit({ type: SESSION_GROUPS_CHANGED_FRAME, groups: [...(view.groups ?? [])] });\n    if (previous.awaitingInput && !view.awaitingInput) mirror.emit({ type: 'extension_ui_answered' });\n    if (!wasIdle && isIdle) mirror.emit({ type: 'agent_settled' });\n  };\n\n  /** Notification and dialog notices of mirrored sessions reach the host hub, then are acknowledged. */\n  const replayNotices = (link: ContainerLink): void => {\n    const hubRef = link.hub;\n    if (hubRef === undefined) return;\n    const pending = readyValue(hubRef.pending, [] as HubNotice[]);\n    for (const entry of pending) {\n      const mirror = mirrors.get(entry.sessionId);\n      // A notice of a session not mirrored yet stays pending on the container until its mirror exists.\n      if (mirror === undefined || mirror.link !== link || link.seenNotices.has(entry.id)) continue;\n      link.seenNotices.add(entry.id);\n      mirror.emit(entry.frame);\n      void remote(link, (ref, ctx) => ref.ackNotice({ id: entry.id }, ctx)).catch((error: unknown) =>\n        notice(`Sandbox notice acknowledgement failed: ${message(error)}`),\n      );\n    }\n    const live = new Set(pending.map((entry) => entry.id));\n    for (const id of link.seenNotices) if (!live.has(id)) link.seenNotices.delete(id);\n  };\n\n  const syncSessions = (link: ContainerLink): void => {\n    const hubRef = link.hub;\n    if (hubRef === undefined || link.disposed) return;\n    const views = readyValue(hubRef.sessions, undefined);\n    if (views === undefined) return;\n    const live = new Map<string, HubSessionView>();\n    const dormant: OpenSessionRecord[] = [];\n    for (const view of Object.values(views)) {\n      if (view.workspaceId !== undefined && view.workspaceId !== link.workspaceId) continue;\n      if (view.dormant === true) dormant.push(dormantRecord(view, link.workspaceId));\n      else live.set(view.id, view);\n    }\n    for (const id of link.closing) if (!live.has(id)) link.closing.delete(id);\n    for (const [id, mirror] of mirrors) {\n      if (mirror.link !== link) continue;\n      const view = live.get(id);\n      // A new creation time is a new runtime under the same id (a restart): that mirror ends and a new one starts.\n      if (view === undefined || view.createdAt !== mirror.view.createdAt) mirror.end();\n      else updateMirror(mirror, view);\n    }\n    for (const [id, view] of live)\n      if (!mirrors.has(id) && !link.creating.has(id) && !link.closing.has(id) && hub.session(id) === undefined)\n        void createMirror(link, view);\n    const before = new Map(link.dormant.map((entry) => [entry.sessionId, JSON.stringify(entry)]));\n    link.dormant = dormant;\n    for (const entry of dormant)\n      if (before.get(entry.sessionId) !== JSON.stringify(entry)) hub.notifyDormantChanged(entry.sessionId);\n    for (const id of before.keys())\n      if (!dormant.some((entry) => entry.sessionId === id) && !live.has(id)) hub.notifySessionRemoved(id);\n  };\n\n  const startGateway = async (link: ContainerLink, hubRef: HubRef): Promise<void> => {\n    const host = await options.modelGateway?.();\n    if (host === undefined || link.disposed || link.gateway !== undefined) return;\n    const abort = new AbortController();\n    const runner = runModelGateway({\n      hub: hubRef,\n      channels: NO_CHANNELS,\n      modelRuntime: host.modelRuntime,\n      defaultModel: () => host.defaultModel(),\n      signal: abort.signal,\n      onNotice: (text) => notice(`Workspace ${link.workspaceId} ${text}`),\n    });\n    link.gateway = { runner, abort, channelsOf: undefined };\n    gatewayFollow(link);\n  };\n\n  const scheduleReconnect = (link: ContainerLink): void => {\n    if (disposed || link.disposed || link.reconnect !== undefined) return;\n    link.reconnect = setTimeout(() => {\n      link.reconnect = undefined;\n      void connect(link);\n    }, reconnectMs);\n    link.reconnect.unref?.();\n  };\n\n  const connect = async (link: ContainerLink): Promise<boolean> => {\n    try {\n      await link.client.connect();\n      if (link.hub === undefined) {\n        const hubRef = await link.client.host.get(PoHubContract, {});\n        if (link.disposed) {\n          hubRef.release();\n          return false;\n        }\n        link.hub = hubRef;\n        link.stops.push(\n          hubRef.sessions.subscribe(() => syncSessions(link)),\n          hubRef.pending.subscribe(() => replayNotices(link)),\n        );\n        void startGateway(link, hubRef).catch((error: unknown) =>\n          notice(`Workspace ${link.workspaceId} model gateway did not start: ${message(error)}`),\n        );\n      }\n      link.lastError = undefined;\n      syncSessions(link);\n      options.onLinked?.(link.workspaceId);\n      return true;\n    } catch (error) {\n      if (!disposed && !link.disposed) {\n        // Retried every few seconds: each new reason is reported once.\n        if (link.lastError !== message(error)) notice(`Workspace ${link.workspaceId} sandbox link: ${message(error)}`);\n        link.lastError = message(error);\n        scheduleReconnect(link);\n      }\n      return false;\n    }\n  };\n\n  /** The workspace's link, made on first use. Settles false when the sandbox cannot be reached now. */\n  const ensureLink = (workspaceId: string): ContainerLink | undefined => {\n    if (disposed) return undefined;\n    const existing = links.get(workspaceId);\n    if (existing !== undefined) return existing;\n    const provider = options.sandboxes.get(record(workspaceId)?.sandbox ?? '');\n    const endpointOf = provider?.endpoint;\n    if (endpointOf === undefined) return undefined;\n    const link: ContainerLink = {\n      workspaceId,\n      client: createProtocolClient({\n        name: `po-host-${workspaceId}`,\n        // Read again for every dial: a restarted container listens elsewhere with a new token.\n        openLink: async () => {\n          const endpoint = await endpointOf(workspaceId);\n          if (endpoint === undefined) throw new Error(SANDBOX_UNREACHABLE);\n          link.endpoint = endpoint;\n          return openLink(endpoint);\n        },\n      }),\n      endpoint: undefined,\n      hub: undefined,\n      ready: Promise.resolve(false),\n      dormant: [],\n      gateway: undefined,\n      creating: new Set(),\n      closing: new Set(),\n      seenNotices: new Set(),\n      reconnect: undefined,\n      lastError: undefined,\n      disposed: false,\n      stops: [],\n    };\n    link.stops.push(\n      link.client.onConnectionStateChange(({ state }) => {\n        if (link.disposed) return;\n        options.announceWorkspace(workspaceId, state === 'connected');\n        if (state === 'disconnected') scheduleReconnect(link);\n      }),\n    );\n    links.set(workspaceId, link);\n    link.ready = connect(link);\n    return link;\n  };\n\n  const liveLink = async (workspaceId: string): Promise<ContainerLink> => {\n    const link = ensureLink(workspaceId);\n    if (link === undefined) throw new Error(SANDBOX_UNREACHABLE);\n    await link.ready;\n    // A container that runs but does not listen yet (it is still starting) gets a bounded wait; one with no\n    // running container fails at once.\n    const until = Date.now() + startWaitMs;\n    while (!link.client.connected || link.hub === undefined) {\n      if (await connect(link)) break;\n      if (link.endpoint === undefined || Date.now() >= until || disposed) throw new Error(SANDBOX_UNREACHABLE);\n      await new Promise((resolve) => setTimeout(resolve, reconnectMs));\n    }\n    return link;\n  };\n\n  const disposeMirror = (mirror: Mirror): void => {\n    if (mirrors.get(mirror.sessionId) === mirror) mirrors.delete(mirror.sessionId);\n    mirror.dispose();\n    options.forgetCompositions(mirror.sessionId);\n    gatewayFollow(mirror.link);\n    // A container session that restarted under the same id is mirrored again once the hub has let this one go.\n    setTimeout(() => syncSessions(mirror.link), 0);\n  };\n\n  const ownedLink = (sessionId: string): ContainerLink => {\n    const link = linkOfSession(sessionId);\n    if (link === undefined) throw new Error('Session not found.');\n    return link;\n  };\n\n  return {\n    start() {\n      for (const entry of options.workspaces()) if (entry.sandbox !== undefined) ensureLink(entry.id);\n    },\n    contains,\n    connected: (workspaceId) => {\n      const link = links.get(workspaceId);\n      return link !== undefined && link.client.connected && link.hub !== undefined;\n    },\n    mirror: (sessionId) => mirrors.get(sessionId)?.host,\n    mirrors: () => [...mirrors.values()].map((mirror) => mirror.host),\n    owns: (sessionId) => linkOfSession(sessionId) !== undefined,\n    dormant: () =>\n      [...links.values()].flatMap((link) => link.dormant.filter((entry) => hub.session(entry.sessionId) === undefined)),\n    async openSession(workspaceId, request, sessionId) {\n      request.signal?.throwIfAborted();\n      if (request.workflowContext !== undefined || request.reservationId !== undefined)\n        throw new Error('Workflow steps and reserved sessions cannot run in a sandboxed workspace yet.');\n      const link = await liveLink(workspaceId);\n      const opened = await remote(\n        link,\n        (hubRef, ctx) =>\n          hubRef.invoke(\n            {\n              mount: { scope: 'global' },\n              service: containedCreateSessionMethod.service,\n              method: containedCreateSessionMethod.method,\n              input: containedCreateInput(request, sessionId) as unknown as JsonValue,\n            },\n            ctx,\n          ) as Promise<{ sessionId: string; cwd: string; workspaceId?: string }>,\n        request.signal,\n      );\n      if (opened.workspaceId !== undefined && opened.workspaceId !== workspaceId)\n        notice(`The sandbox of ${workspaceId} opened session ${opened.sessionId} in workspace ${opened.workspaceId}.`);\n      await waitForMirror(opened.sessionId);\n      return { sessionId: opened.sessionId, cwd: opened.cwd, workspaceId };\n    },\n    async closeSession(sessionId, closeOptions = {}) {\n      const mirror = mirrors.get(sessionId);\n      if (mirror === undefined) return;\n      try {\n        if (!mirror.ended && closeOptions.disposeOnly !== true) {\n          mirror.link.closing.add(sessionId);\n          await remote(mirror.link, (hubRef, ctx) =>\n            hubRef.invoke(\n              {\n                mount: { scope: 'global' },\n                service: containedCloseSessionMethod.service,\n                method: containedCloseSessionMethod.method,\n                input: { sessionId, ...(closeOptions.keepDormant === true ? { keepDormant: true } : {}) },\n              },\n              ctx,\n            ),\n          ).catch((error: unknown) => {\n            mirror.link.closing.delete(sessionId);\n            throw error;\n          });\n        }\n      } finally {\n        disposeMirror(mirror);\n      }\n    },\n    async removeSession(sessionId, workspaceId) {\n      const link =\n        linkOfSession(sessionId) ??\n        (workspaceId === undefined ? undefined : ensureLink(workspaceId)) ??\n        ownedLink(sessionId);\n      await containerJson(link, sessionPath(link, sessionId), { method: 'DELETE' });\n    },\n    async adoptSession(workspaceId, record) {\n      const link = ensureLink(workspaceId);\n      if (link === undefined) throw new Error(SANDBOX_UNREACHABLE);\n      await remote(link, (hubRef, ctx) =>\n        hubRef.invoke(\n          {\n            mount: { scope: 'global' },\n            service: containedAdoptSessionMethod.service,\n            method: containedAdoptSessionMethod.method,\n            input: { sessionId: record.sessionId, record: record as unknown as JsonValue },\n          },\n          ctx,\n        ),\n      );\n    },\n    async release(workspaceId) {\n      const link = links.get(workspaceId);\n      if (link === undefined) return;\n      links.delete(workspaceId);\n      link.disposed = true;\n      if (link.reconnect !== undefined) clearTimeout(link.reconnect);\n      link.gateway?.abort.abort(new Error('The sandbox was switched off.'));\n      for (const stop of link.stops.splice(0)) stop();\n      // The hub closes each ended mirror, which only lets it go: the container is already stopped.\n      for (const mirror of mirrors.values()) if (mirror.link === link) mirror.end();\n      for (const entry of link.dormant) hub.notifySessionRemoved(entry.sessionId);\n      link.dormant = [];\n      link.hub?.release();\n      link.client.dispose();\n    },\n    async setDormantGroups(sessionId, groups) {\n      const link = ownedLink(sessionId);\n      await containerJson(link, sessionPath(link, sessionId, '/groups'), {\n        method: 'PUT',\n        body: JSON.stringify({ groups }),\n      });\n    },\n    async revive(sessionId) {\n      if (mirrors.has(sessionId)) return;\n      const link = ownedLink(sessionId);\n      await containerJson(link, sessionPath(link, sessionId, '/revive'), { method: 'POST' });\n      await waitForMirror(sessionId);\n    },\n    async restart(sessionId) {\n      const mirror = mirrors.get(sessionId);\n      if (mirror === undefined) throw new Error('Session not found.');\n      await containerJson(mirror.link, sessionPath(mirror.link, sessionId, '/restart'), { method: 'POST' });\n      await waitForMirror(sessionId, mirror.host);\n    },\n    async resume(sessionId, targetSessionId) {\n      const mirror = mirrors.get(sessionId);\n      if (mirror === undefined) throw new Error('Session not found.');\n      const body = (await containerJson(mirror.link, sessionPath(mirror.link, sessionId, '/resume'), {\n        method: 'POST',\n        body: JSON.stringify({ targetSessionId }),\n      })) as { sessionId: string };\n      await waitForMirror(body.sessionId);\n      return body.sessionId;\n    },\n    async resumeWorkspace(workspaceId, targetSessionId) {\n      const link = await liveLink(workspaceId);\n      const body = (await containerJson(link, `/api/workspaces/${encodeURIComponent(workspaceId)}/resume`, {\n        method: 'POST',\n        body: JSON.stringify({ targetSessionId }),\n      })) as { sessionId: string };\n      await waitForMirror(body.sessionId);\n      return body.sessionId;\n    },\n    async history(workspaceId) {\n      const link = await liveLink(workspaceId);\n      const body = (await containerJson(link, `/api/workspaces/${encodeURIComponent(workspaceId)}/history`)) as {\n        sessions?: unknown[];\n      };\n      return body.sessions ?? [];\n    },\n    async sessionHistory(sessionId) {\n      const link = ownedLink(sessionId);\n      const body = (await containerJson(link, sessionPath(link, sessionId, '/history'))) as { sessions?: unknown[] };\n      return body.sessions ?? [];\n    },\n    async readTranscript(sessionId, request) {\n      const link = ownedLink(sessionId);\n      const query = new URLSearchParams();\n      if (request.cursor !== undefined) query.set('cursor', request.cursor);\n      if (request.direction !== undefined) query.set('direction', request.direction);\n      if (request.limit !== undefined) query.set('limit', String(request.limit));\n      const search = query.size === 0 ? '' : `?${query.toString()}`;\n      // A stale cursor comes back as the container's own 'STALE_TRANSCRIPT_CURSOR' error, which the host answers 409.\n      return (await containerJson(link, sessionPath(link, sessionId, `/transcript${search}`))) as TranscriptPage;\n    },\n    async requestSessionApi(scope, request) {\n      const mirror = mirrors.get(scope.sessionId);\n      if (mirror === undefined) return Response.json({ error: 'Session not found.' }, { status: 404 });\n      if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(request.basePath))\n        return Response.json({ error: 'Invalid session API base path.' }, { status: 400 });\n      if (!request.path.startsWith('/') || request.path.startsWith('//') || request.path.includes('#'))\n        return Response.json({ error: 'Invalid session API path.' }, { status: 400 });\n      const headers = new Headers(request.headers);\n      for (const name of ['host', 'authorization', TOKEN_HEADER, 'content-length']) headers.delete(name);\n      try {\n        return await containerFetch(\n          mirror.link,\n          sessionPath(mirror.link, scope.sessionId, `/plugins/${request.basePath}${request.path}`),\n          {\n            method: request.method,\n            headers,\n            ...(request.body === undefined || request.body === null\n              ? {}\n              : { body: request.body as unknown as RequestInit['body'] }),\n            ...(request.signal === undefined ? {} : { signal: request.signal }),\n          },\n        );\n      } catch (error) {\n        return Response.json({ error: message(error) }, { status: 503 });\n      }\n    },\n    async dispose() {\n      disposed = true;\n      for (const mirror of mirrors.values()) {\n        mirrors.delete(mirror.sessionId);\n        mirror.dispose();\n      }\n      for (const link of links.values()) {\n        link.disposed = true;\n        if (link.reconnect !== undefined) clearTimeout(link.reconnect);\n        link.gateway?.abort.abort(new Error('The host is shutting down.'));\n        for (const stop of link.stops.splice(0)) stop();\n        link.hub?.release();\n        link.client.dispose();\n      }\n      links.clear();\n      mirrorWaiters.clear();\n    },\n  };\n}\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport {\n  createOpenSessionRegistry,\n  validateDurableSessionFile,\n  type OpenSessionRecord,\n  type OpenSessionRegistry,\n} from '@agimon-ai/po-core/history';\nimport type { PoWorkspaceSandboxProvider } from '@agimon-ai/po-core/workspaceSandboxes';\n\n/**\n * Sessions follow their workspace into and out of its sandbox. A sandbox runs with its own Po home `P` on host disk\n * (agent folder `P/agent`), so handing a session over is a rename of its own files between the host's Po home and\n * `P`. The host moves files in `P` only while the sandbox is stopped, or files of a session the host itself just\n * closed, and writes `P/agent/server/open-sessions.json` only before the sandbox starts.\n */\n\n/** Why a session imported from a sandbox cannot resume on the host. */\nexport const CONTAINER_WORKTREE_GONE = 'This session ran in a container worktree that no longer exists.';\nconst DURABLE_SESSIONS = path.join('server', 'sessions', 'durable-v1');\nconst DELIVERY = path.join('session', 'delivery');\nconst SERVER = 'server';\nconst AGENT = 'agent';\nconst PACKAGE_STATE_PREFIX = 'po-';\nconst SQLITE = '.sqlite';\nconst SIDECARS = ['', '-wal', '-shm'] as const;\nconst LOCK_SUFFIXES = ['.po-v4.lock', '.po-v4.lock.recovery'] as const;\nconst HASH_LENGTH = 16;\n\n/** One Po home: its root and its agent folder. */\nexport interface SessionHome {\n  readonly poHome: string;\n  readonly agentDir: string;\n}\n\n/** A session entry, relative to the Po home or to its agent folder. */\nexport interface SessionEntry {\n  readonly base: 'poHome' | 'agentDir';\n  readonly relative: string;\n}\n\nexport interface MoveOutcome {\n  readonly moved: readonly string[];\n  /** Entries left where they were, with the reason. */\n  readonly skipped: readonly { readonly path: string; readonly reason: string }[];\n}\n\nconst isLock = (name: string): boolean => LOCK_SUFFIXES.some((suffix) => name.endsWith(suffix));\nconst sessionHash = (sessionId: string): string =>\n  createHash('sha256').update(sessionId).digest('hex').slice(0, HASH_LENGTH);\n\nfunction names(directory: string): string[] {\n  try {\n    return fs.readdirSync(directory);\n  } catch {\n    // A folder that does not exist holds no entries of this session.\n    return [];\n  }\n}\n\n/** The home a sandbox Po home `P` implies: its agent folder is `P/agent`. */\nexport function sandboxSessionHome(poHome: string): SessionHome {\n  return { poHome, agentDir: path.join(poHome, AGENT) };\n}\n\n/**\n * The entries that belong to one session alone: its durable database and sidecars, its po-session delivery database,\n * and in each `po-*` package folder the entries named for it (the id, `<id>.*`, or the id's 16-hex sha256 prefix,\n * which plan pointers and file-edit timelines use). Never auth, models, server state, shared databases or locks.\n */\nexport function selectSessionEntries(agentDir: string, poHome: string, sessionId: string): SessionEntry[] {\n  if (sessionId === '' || sessionId.includes('/') || sessionId.includes('\\\\') || sessionId.startsWith('.')) return [];\n  const entries: SessionEntry[] = [];\n  const present = (base: string, relative: string): boolean =>\n    fs.lstatSync(path.join(base, relative), { throwIfNoEntry: false }) !== undefined;\n  for (const suffix of SIDECARS) {\n    const relative = path.join(DURABLE_SESSIONS, `${sessionId}${SQLITE}${suffix}`);\n    if (present(agentDir, relative)) entries.push({ base: 'agentDir', relative });\n  }\n  for (const suffix of SIDECARS) {\n    const relative = path.join(DELIVERY, `${sessionId}${SQLITE}${suffix}`);\n    if (present(poHome, relative)) entries.push({ base: 'poHome', relative });\n  }\n  const hash = sessionHash(sessionId);\n  for (const folder of names(agentDir)) {\n    if (!folder.startsWith(PACKAGE_STATE_PREFIX)) continue;\n    const folderPath = path.join(agentDir, folder);\n    if (!fs.lstatSync(folderPath, { throwIfNoEntry: false })?.isDirectory()) continue;\n    for (const name of names(folderPath)) {\n      if (isLock(name)) continue;\n      if (name === sessionId || name.startsWith(`${sessionId}.`) || name.includes(hash))\n        entries.push({ base: 'agentDir', relative: path.join(folder, name) });\n    }\n  }\n  return entries;\n}\n\n/** Why `entry` cannot move: a symbolic link or anything that is not a regular file or folder, at any depth. */\nfunction unsafeEntry(entry: string): string | undefined {\n  const info = fs.lstatSync(entry);\n  if (info.isSymbolicLink()) return 'symbolic link';\n  if (info.isFile()) return undefined;\n  if (!info.isDirectory()) return 'not a regular file or folder';\n  for (const name of fs.readdirSync(entry)) {\n    const reason = unsafeEntry(path.join(entry, name));\n    if (reason !== undefined) return `${reason} inside`;\n  }\n  return undefined;\n}\n\n/**\n * Moves one file or folder by rename (both sides share a filesystem). Skips a missing source, a target name that\n * already exists, and a source that is or holds a symbolic link or anything but regular files and folders.\n */\nexport function moveEntries(from: string, to: string): MoveOutcome {\n  if (fs.lstatSync(from, { throwIfNoEntry: false }) === undefined) return { moved: [], skipped: [] };\n  if (fs.lstatSync(to, { throwIfNoEntry: false }) !== undefined)\n    return { moved: [], skipped: [{ path: from, reason: 'already exists at the target' }] };\n  const reason = unsafeEntry(from);\n  if (reason !== undefined) return { moved: [], skipped: [{ path: from, reason }] };\n  fs.mkdirSync(path.dirname(to), { recursive: true });\n  fs.renameSync(from, to);\n  return { moved: [to], skipped: [] };\n}\n\n/** Moves every entry of one session from one Po home to another. Entries already moved are skipped quietly. */\nexport function moveSession(sessionId: string, from: SessionHome, to: SessionHome): MoveOutcome {\n  const moved: string[] = [];\n  const skipped: { path: string; reason: string }[] = [];\n  for (const entry of selectSessionEntries(from.agentDir, from.poHome, sessionId)) {\n    const outcome = moveEntries(path.join(from[entry.base], entry.relative), path.join(to[entry.base], entry.relative));\n    moved.push(...outcome.moved);\n    skipped.push(...outcome.skipped);\n  }\n  return { moved, skipped };\n}\n\n/** Deletes `*.po-v4.lock` and `*.po-v4.lock.recovery` under `root`. Symbolic links are neither followed nor removed. */\nexport function clearStaleLocks(root: string): string[] {\n  const removed: string[] = [];\n  for (const name of names(root)) {\n    const entry = path.join(root, name);\n    const info = fs.lstatSync(entry, { throwIfNoEntry: false });\n    if (info?.isDirectory()) removed.push(...clearStaleLocks(entry));\n    else if (info?.isFile() && isLock(name)) {\n      fs.rmSync(entry, { force: true });\n      removed.push(entry);\n    }\n  }\n  return removed;\n}\n\nconst inside = (root: string, candidate: string): boolean => {\n  const relative = path.relative(root, candidate);\n  return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n};\n\n/**\n * The sandbox's open-session records the host may take: those of this workspace whose folder is its root or inside\n * it. Records whose folder is missing on host disk (a container worktree) are kept, and listed as unresumable.\n */\nexport function importRecords(\n  records: readonly OpenSessionRecord[],\n  workspace: { readonly id: string; readonly root: string },\n  exists: (file: string) => boolean = fs.existsSync,\n): { records: OpenSessionRecord[]; unresumable: string[] } {\n  const kept = records.filter(\n    (record) =>\n      record.workspaceId === workspace.id && path.isAbsolute(record.cwd) && inside(workspace.root, record.cwd),\n  );\n  return { records: kept, unresumable: kept.filter((record) => !exists(record.cwd)).map((record) => record.sessionId) };\n}\n\n/** The session ids a Po home holds: its durable databases and its open-session records. */\nfunction sessionIdsIn(home: SessionHome, records: readonly OpenSessionRecord[]): string[] {\n  const ids = new Set(records.map((record) => record.sessionId));\n  for (const name of names(path.join(home.agentDir, DURABLE_SESSIONS)))\n    if (name.endsWith(SQLITE)) ids.add(name.slice(0, -SQLITE.length));\n  return [...ids];\n}\n\n/** A provider that runs its sandboxes with a Po home on host disk, so sessions can be handed over. */\nexport type HandoffProvider = PoWorkspaceSandboxProvider &\n  Required<Pick<PoWorkspaceSandboxProvider, 'sessionHome' | 'start' | 'stop'>>;\n\nexport function handoffProvider(provider: PoWorkspaceSandboxProvider | undefined): HandoffProvider | undefined {\n  return provider?.sessionHome !== undefined && provider.start !== undefined && provider.stop !== undefined\n    ? (provider as HandoffProvider)\n    : undefined;\n}\n\nexport interface SandboxSessionHandoffOptions {\n  readonly host: SessionHome;\n  /** The host's open-session registry. */\n  readonly openSessions: OpenSessionRegistry;\n  /** Saved, not live, host sessions of a workspace. */\n  savedSessionIds(workspace: { readonly id: string; readonly root: string }): Promise<readonly string[]>;\n  isLive(sessionId: string): boolean;\n  /** Registers a dormant session in the workspace's running sandbox; rejects while it cannot be reached. */\n  adopt(workspaceId: string, record: OpenSessionRecord): Promise<void>;\n  onNotice(message: string): void;\n}\n\nexport interface SandboxSessionHandoff {\n  /**\n   * Before the sandbox starts: moves saved host sessions and their records into it, then starts it. Answers the\n   * sessions whose host records moved.\n   */\n  switchOn(\n    workspace: { readonly id: string; readonly root: string },\n    provider: HandoffProvider,\n  ): Promise<readonly string[]>;\n  /** Stops the sandbox, then moves its sessions and records back to the host. Answers the imported records. */\n  switchOff(\n    workspace: { readonly id: string; readonly root: string },\n    provider: HandoffProvider,\n  ): Promise<readonly string[]>;\n  /**\n   * A host session of a sandboxed workspace closed: its files move into the sandbox and, when it stays dormant, the\n   * sandbox adopts its record. While the sandbox cannot be reached the host record stays, pending.\n   */\n  sessionClosed(sessionId: string, workspaceId: string, keepDormant: boolean, provider: HandoffProvider): Promise<void>;\n  /**\n   * Adopts the workspace's pending host records, moving any file a crash left behind. The first call of a run also\n   * moves saved host sessions an interrupted switch left on the host. Idempotent.\n   */\n  retry(workspace: { readonly id: string; readonly root: string }, provider: HandoffProvider): Promise<void>;\n  /** The workspace a closed host session was handed to in this run, so its removal goes to the sandbox. */\n  handedOff(sessionId: string): string | undefined;\n  forget(sessionId: string): void;\n}\n\nexport function createSandboxSessionHandoff(options: SandboxSessionHandoffOptions): SandboxSessionHandoff {\n  const { host, openSessions } = options;\n  const handedOff = new Map<string, string>();\n  /** Workspaces whose leftover saved host sessions were moved in this run. */\n  const swept = new Set<string>();\n  const report = (sessionId: string, outcome: MoveOutcome): void => {\n    for (const skipped of outcome.skipped)\n      options.onNotice(`Session ${sessionId}: ${skipped.path} was not moved (${skipped.reason}).`);\n  };\n  const homeOf = async (workspaceId: string, provider: HandoffProvider): Promise<SessionHome> =>\n    sandboxSessionHome(await provider.sessionHome(workspaceId));\n\n  const adoptPending = async (workspaceId: string, provider: HandoffProvider): Promise<void> => {\n    const sandbox = await homeOf(workspaceId, provider);\n    for (const record of openSessions.list()) {\n      if (record.workspaceId !== workspaceId || options.isLive(record.sessionId)) continue;\n      report(record.sessionId, moveSession(record.sessionId, host, sandbox));\n      handedOff.set(record.sessionId, workspaceId);\n      try {\n        await options.adopt(workspaceId, record);\n      } catch (error) {\n        // Kept: the next link to the sandbox adopts it.\n        options.onNotice(\n          `Session ${record.sessionId} waits for its sandbox: ${error instanceof Error ? error.message : String(error)}`,\n        );\n        continue;\n      }\n      openSessions.remove(record.sessionId);\n    }\n  };\n\n  return {\n    async switchOn(workspace, provider) {\n      // Nothing of this workspace may run while its records are written.\n      await provider.stop(workspace.id);\n      const sandbox = await homeOf(workspace.id, provider);\n      clearStaleLocks(sandbox.poHome);\n      const records = openSessions\n        .list()\n        .filter((record) => record.workspaceId === workspace.id && !options.isLive(record.sessionId));\n      const ids = new Set([\n        ...(await options.savedSessionIds(workspace)),\n        ...records.map((record) => record.sessionId),\n      ]);\n      for (const sessionId of ids) {\n        if (options.isLive(sessionId)) continue;\n        report(sessionId, moveSession(sessionId, host, sandbox));\n      }\n      const sandboxRecords = createOpenSessionRegistry({\n        directory: path.join(sandbox.agentDir, SERVER),\n        onNotice: (text) => options.onNotice(text),\n      });\n      for (const record of records) {\n        if (!sandboxRecords.add(record)) throw new Error(`Session ${record.sessionId} could not be handed over.`);\n        openSessions.remove(record.sessionId);\n      }\n      await provider.start(workspace);\n      return records.map((record) => record.sessionId);\n    },\n    async switchOff(workspace, provider) {\n      await provider.stop(workspace.id);\n      const sandbox = await homeOf(workspace.id, provider);\n      clearStaleLocks(sandbox.poHome);\n      const sandboxRecords = createOpenSessionRegistry({\n        directory: path.join(sandbox.agentDir, SERVER),\n        onNotice: (text) => options.onNotice(text),\n      });\n      const invalid = new Set<string>();\n      for (const sessionId of sessionIdsIn(sandbox, sandboxRecords.list())) {\n        const outcome = moveSession(sessionId, sandbox, host);\n        report(sessionId, outcome);\n        const database = path.join(host.agentDir, DURABLE_SESSIONS, `${sessionId}${SQLITE}`);\n        if (!outcome.moved.includes(database)) continue;\n        try {\n          validateDurableSessionFile(database);\n        } catch (error) {\n          invalid.add(sessionId);\n          options.onNotice(\n            `Session ${sessionId} from the sandbox is not readable here: ${error instanceof Error ? error.message : String(error)}`,\n          );\n        }\n      }\n      const imported = importRecords(\n        sandboxRecords.list().filter((record) => !invalid.has(record.sessionId)),\n        workspace,\n      );\n      const added: string[] = [];\n      for (const record of imported.records)\n        if (openSessions.add(record)) {\n          sandboxRecords.remove(record.sessionId);\n          added.push(record.sessionId);\n        }\n      // A record whose session left the sandbox would list a session the sandbox no longer has.\n      for (const record of sandboxRecords.list())\n        if (!fs.existsSync(path.join(sandbox.agentDir, DURABLE_SESSIONS, `${record.sessionId}${SQLITE}`)))\n          sandboxRecords.remove(record.sessionId);\n      for (const sessionId of imported.unresumable)\n        options.onNotice(`Session ${sessionId} ran in a container worktree and cannot resume here.`);\n      for (const [sessionId, workspaceId] of handedOff) if (workspaceId === workspace.id) handedOff.delete(sessionId);\n      swept.delete(workspace.id);\n      return added;\n    },\n    async sessionClosed(sessionId, workspaceId, keepDormant, provider) {\n      const sandbox = await homeOf(workspaceId, provider);\n      report(sessionId, moveSession(sessionId, host, sandbox));\n      handedOff.set(sessionId, workspaceId);\n      if (!keepDormant) return;\n      await adoptPending(workspaceId, provider);\n    },\n    async retry(workspace, provider) {\n      if (!swept.has(workspace.id)) {\n        swept.add(workspace.id);\n        const sandbox = await homeOf(workspace.id, provider);\n        for (const sessionId of await options.savedSessionIds(workspace))\n          if (!options.isLive(sessionId)) report(sessionId, moveSession(sessionId, host, sandbox));\n      }\n      await adoptPending(workspace.id, provider);\n    },\n    handedOff: (sessionId) => handedOff.get(sessionId),\n    forget: (sessionId) => {\n      handedOff.delete(sessionId);\n    },\n  };\n}\n","//#region src/constants/voiceTools.ts\nconst PO_VOICE_TOOLS_SERVICE = \"po/voice-tools\";\nconst VOICE_DESCRIBE_TOOL_NAME = \"describe_voice_tools\";\nconst VOICE_USE_TOOL_NAME = \"use_voice_tools\";\nconst VOICE_FACADE_TOOL_NAMES = [VOICE_DESCRIBE_TOOL_NAME, VOICE_USE_TOOL_NAME];\nconst VOICE_NARRATE_TOOL_NAME = \"narrate\";\nconst VOICE_MODE_TOOL_NAMES = [...VOICE_FACADE_TOOL_NAMES, VOICE_NARRATE_TOOL_NAME];\nconst VOICE_TOOL_DEFAULT_TIMEOUT_MS = 1e4;\nconst VOICE_TOOL_MAX_TIMEOUT_MS = 3e4;\nconst VOICE_TOOL_MAX_BATCH_ITEMS = 16;\nconst VOICE_TOOL_MAX_INPUT_BYTES = 65536;\nconst VOICE_TOOL_MAX_BATCH_BYTES = 262144;\nconst VOICE_TOOL_MAX_SCHEMA_BYTES = 32768;\nconst VOICE_TOOL_MAX_JSON_DEPTH = 16;\nconst VOICE_TOOL_TERMINAL_OPERATION_LIMIT = 256;\nconst VOICE_TOOL_MAX_IDENTIFIER_LENGTH = 128;\nconst VOICE_TOOL_MAX_LABEL_LENGTH = 96;\nconst VOICE_TOOL_MAX_DESCRIPTION_LENGTH = 240;\nconst VOICE_TOOL_MAX_ERROR_MESSAGE_LENGTH = 240;\nconst VOICE_TOOL_MAX_DOMAIN_COUNT = 32;\nconst SAFE_IDENTIFIER = /^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$/u;\nconst SAFE_NAME = /^[a-z][a-z0-9_:-]*$/u;\nconst MAX_ORDER = 1e3;\nconst VOICE_TOOL_ERROR_CODE = {\n\thostUnavailable: \"VOICE_TOOL_HOST_UNAVAILABLE\",\n\tinactive: \"VOICE_TOOL_INACTIVE\",\n\tstaleSession: \"VOICE_TOOL_STALE_SESSION\",\n\tstaleCatalog: \"VOICE_TOOL_STALE_CATALOG\",\n\tnotFound: \"VOICE_TOOL_NOT_FOUND\",\n\tnameConflict: \"VOICE_TOOL_NAME_CONFLICT\",\n\tinvalidInput: \"VOICE_TOOL_INVALID_INPUT\",\n\tinvalidResult: \"VOICE_TOOL_INVALID_RESULT\",\n\texecutionFailed: \"VOICE_TOOL_EXECUTION_FAILED\",\n\ttimeout: \"VOICE_TOOL_TIMEOUT\",\n\taborted: \"VOICE_TOOL_ABORTED\",\n\tcancelled: \"VOICE_TOOL_CANCELLED\",\n\tregistrationDisposed: \"VOICE_TOOL_REGISTRATION_DISPOSED\",\n\tsessionShutdown: \"VOICE_TOOL_SESSION_SHUTDOWN\",\n\tbatchStopped: \"VOICE_TOOL_BATCH_STOPPED\",\n\treloadQueued: \"VOICE_TOOL_RELOAD_QUEUED\",\n\tinvalidRequest: \"VOICE_TOOL_INVALID_REQUEST\"\n};\nconst VOICE_TOOL_HOST_UNAVAILABLE = VOICE_TOOL_ERROR_CODE.hostUnavailable;\nconst VOICE_TOOL_INACTIVE = VOICE_TOOL_ERROR_CODE.inactive;\nconst VOICE_TOOL_STALE_SESSION = VOICE_TOOL_ERROR_CODE.staleSession;\nconst VOICE_TOOL_STALE_CATALOG = VOICE_TOOL_ERROR_CODE.staleCatalog;\nconst VOICE_TOOL_NOT_FOUND = VOICE_TOOL_ERROR_CODE.notFound;\nconst VOICE_TOOL_NAME_CONFLICT = VOICE_TOOL_ERROR_CODE.nameConflict;\nconst VOICE_TOOL_INVALID_INPUT = VOICE_TOOL_ERROR_CODE.invalidInput;\nconst VOICE_TOOL_INVALID_RESULT = VOICE_TOOL_ERROR_CODE.invalidResult;\nconst VOICE_TOOL_TIMEOUT = VOICE_TOOL_ERROR_CODE.timeout;\nconst VOICE_TOOL_ABORTED = VOICE_TOOL_ERROR_CODE.aborted;\nconst VOICE_TOOL_EXECUTION_FAILED = VOICE_TOOL_ERROR_CODE.executionFailed;\nconst VOICE_TOOL_BATCH_STOPPED = VOICE_TOOL_ERROR_CODE.batchStopped;\nconst PO_VOICE_SOURCE = \"@agimon-ai/po-voice\";\nconst PO_VOICE_AUTO_MODE_ID = \"voice-auto\";\n//#endregion\nexport { MAX_ORDER, PO_VOICE_AUTO_MODE_ID, PO_VOICE_SOURCE, PO_VOICE_TOOLS_SERVICE, SAFE_IDENTIFIER, SAFE_NAME, VOICE_DESCRIBE_TOOL_NAME, VOICE_FACADE_TOOL_NAMES, VOICE_MODE_TOOL_NAMES, VOICE_NARRATE_TOOL_NAME, VOICE_TOOL_ABORTED, VOICE_TOOL_BATCH_STOPPED, VOICE_TOOL_DEFAULT_TIMEOUT_MS, VOICE_TOOL_ERROR_CODE, VOICE_TOOL_EXECUTION_FAILED, VOICE_TOOL_HOST_UNAVAILABLE, VOICE_TOOL_INACTIVE, VOICE_TOOL_INVALID_INPUT, VOICE_TOOL_INVALID_RESULT, VOICE_TOOL_MAX_BATCH_BYTES, VOICE_TOOL_MAX_BATCH_ITEMS, VOICE_TOOL_MAX_DESCRIPTION_LENGTH, VOICE_TOOL_MAX_DOMAIN_COUNT, VOICE_TOOL_MAX_ERROR_MESSAGE_LENGTH, VOICE_TOOL_MAX_IDENTIFIER_LENGTH, VOICE_TOOL_MAX_INPUT_BYTES, VOICE_TOOL_MAX_JSON_DEPTH, VOICE_TOOL_MAX_LABEL_LENGTH, VOICE_TOOL_MAX_SCHEMA_BYTES, VOICE_TOOL_MAX_TIMEOUT_MS, VOICE_TOOL_NAME_CONFLICT, VOICE_TOOL_NOT_FOUND, VOICE_TOOL_STALE_CATALOG, VOICE_TOOL_STALE_SESSION, VOICE_TOOL_TERMINAL_OPERATION_LIMIT, VOICE_TOOL_TIMEOUT, VOICE_USE_TOOL_NAME };\n\n//# sourceMappingURL=voiceTools.mjs.map","import { MAX_ORDER, SAFE_IDENTIFIER, SAFE_NAME, VOICE_TOOL_MAX_TIMEOUT_MS } from \"../constants/voiceTools.mjs\";\nimport { Type } from \"typebox\";\n//#region src/schemas/voiceTools.ts\nconst VoiceToolDescriptorSchema = Type.Object({\n\tsource: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128,\n\t\tpattern: SAFE_IDENTIFIER.source\n\t}),\n\tid: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128,\n\t\tpattern: SAFE_IDENTIFIER.source\n\t}),\n\tname: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128,\n\t\tpattern: SAFE_NAME.source\n\t}),\n\tlabel: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t}),\n\tdescription: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 240\n\t}),\n\torder: Type.Integer({\n\t\tminimum: 0,\n\t\tmaximum: MAX_ORDER\n\t}),\n\tinputSchema: Type.Unknown(),\n\tresultSchema: Type.Unknown(),\n\ttimeoutMs: Type.Optional(Type.Integer({\n\t\tminimum: 1,\n\t\tmaximum: VOICE_TOOL_MAX_TIMEOUT_MS\n\t}))\n}, { additionalProperties: false });\nconst VoiceToolBatchCallSchema = Type.Object({\n\tname: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128,\n\t\tpattern: SAFE_NAME.source,\n\t\tdescription: \"Capability name exactly as describe_voice_tools reported it.\"\n\t}),\n\tinput: Type.Unknown({ description: \"Arguments for this capability, shaped by the input_schema that describe_voice_tools returns when called with names. Pass an empty object for a capability that takes none.\" })\n}, { additionalProperties: false });\nconst VoiceToolDescribeInputSchema = Type.Object({ names: Type.Optional(Type.Array(Type.String({\n\tminLength: 1,\n\tmaxLength: 128,\n\tpattern: SAFE_NAME.source\n}), {\n\tmaxItems: 16,\n\tdescription: \"Capabilities to describe in full, including their input schemas. Omit to list every registered capability by name and description only.\"\n})) }, { additionalProperties: false });\nconst VoiceToolCatalogTokenSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 512,\n\tdescription: \"Opaque catalog token from the most recent describe_voice_tools result, copied verbatim. It is invalidated whenever a capability registers or deregisters and whenever autonomous voice is activated or deactivated.\"\n});\nconst VoiceToolUseInputSchema = Type.Object({\n\tcatalogToken: VoiceToolCatalogTokenSchema,\n\tcalls: Type.Array(VoiceToolBatchCallSchema, {\n\t\tminItems: 1,\n\t\tmaxItems: 16,\n\t\tdescription: \"Capability calls to run in this order. All of them are validated before any of them run, so a single invalid call rejects the whole batch.\"\n\t})\n}, { additionalProperties: false });\nconst VoiceToolErrorCodeSchema = Type.Union([\n\tType.Literal(\"VOICE_TOOL_HOST_UNAVAILABLE\"),\n\tType.Literal(\"VOICE_TOOL_INACTIVE\"),\n\tType.Literal(\"VOICE_TOOL_STALE_SESSION\"),\n\tType.Literal(\"VOICE_TOOL_STALE_CATALOG\"),\n\tType.Literal(\"VOICE_TOOL_NOT_FOUND\"),\n\tType.Literal(\"VOICE_TOOL_NAME_CONFLICT\"),\n\tType.Literal(\"VOICE_TOOL_INVALID_INPUT\"),\n\tType.Literal(\"VOICE_TOOL_INVALID_RESULT\"),\n\tType.Literal(\"VOICE_TOOL_EXECUTION_FAILED\"),\n\tType.Literal(\"VOICE_TOOL_TIMEOUT\"),\n\tType.Literal(\"VOICE_TOOL_ABORTED\"),\n\tType.Literal(\"VOICE_TOOL_CANCELLED\"),\n\tType.Literal(\"VOICE_TOOL_REGISTRATION_DISPOSED\"),\n\tType.Literal(\"VOICE_TOOL_SESSION_SHUTDOWN\"),\n\tType.Literal(\"VOICE_TOOL_BATCH_STOPPED\"),\n\tType.Literal(\"VOICE_TOOL_RELOAD_QUEUED\"),\n\tType.Literal(\"VOICE_TOOL_INVALID_REQUEST\")\n]);\nconst VoiceToolErrorSchema = Type.Object({\n\tcode: VoiceToolErrorCodeSchema,\n\tmessage: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 240\n\t}),\n\tretryable: Type.Optional(Type.Boolean())\n}, { additionalProperties: false });\nconst VoiceToolConflictDiagnosticSchema = Type.Object({\n\tname: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t}),\n\tmessage: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 240\n\t}),\n\tclaims: Type.Array(Type.Object({\n\t\tsource: Type.String({\n\t\t\tminLength: 1,\n\t\t\tmaxLength: 128\n\t\t}),\n\t\tid: Type.String({\n\t\t\tminLength: 1,\n\t\t\tmaxLength: 128\n\t\t})\n\t}, { additionalProperties: false }), {\n\t\tminItems: 2,\n\t\tmaxItems: 16\n\t})\n}, { additionalProperties: false });\nconst VoiceToolCatalogEntrySchema = Type.Object({\n\tsource: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t}),\n\tid: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t}),\n\tname: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t}),\n\tlabel: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 96\n\t}),\n\tdescription: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 240\n\t}),\n\torder: Type.Integer({\n\t\tminimum: 0,\n\t\tmaximum: MAX_ORDER\n\t}),\n\tinputSchema: Type.Unknown(),\n\tenabled: Type.Boolean()\n}, { additionalProperties: false });\nconst VoiceToolCatalogSnapshotSchema = Type.Object({\n\thostGeneration: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 256\n\t}),\n\tcatalogRevision: Type.Integer({ minimum: 0 }),\n\tcatalogToken: VoiceToolCatalogTokenSchema,\n\ttools: Type.Array(VoiceToolCatalogEntrySchema, { maxItems: 128 }),\n\tconflicts: Type.Array(VoiceToolConflictDiagnosticSchema, { maxItems: 128 }),\n\tunknownNames: Type.Array(Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t}), { maxItems: 16 })\n}, { additionalProperties: false });\nconst VoiceToolBatchItemResultSchema = Type.Object({\n\tindex: Type.Integer({\n\t\tminimum: 0,\n\t\tmaximum: 16\n\t}),\n\tname: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 128\n\t}),\n\tstatus: Type.Union([\n\t\tType.Literal(\"completed\"),\n\t\tType.Literal(\"failed\"),\n\t\tType.Literal(\"cancelled\"),\n\t\tType.Literal(\"not_executed\"),\n\t\tType.Literal(\"preflight_failed\")\n\t]),\n\tresult: Type.Optional(Type.Unknown()),\n\terror: Type.Optional(VoiceToolErrorSchema)\n}, { additionalProperties: false });\nconst VoiceToolBatchResultSchema = Type.Object({\n\tstatus: Type.Union([\n\t\tType.Literal(\"completed\"),\n\t\tType.Literal(\"rejected\"),\n\t\tType.Literal(\"cancelled\"),\n\t\tType.Literal(\"stopped\")\n\t]),\n\tcatalogToken: VoiceToolCatalogTokenSchema,\n\tresults: Type.Array(VoiceToolBatchItemResultSchema, { maxItems: 16 }),\n\terrors: Type.Optional(Type.Array(VoiceToolErrorSchema, { maxItems: 16 }))\n}, { additionalProperties: false });\n//#endregion\nexport { VoiceToolBatchCallSchema, VoiceToolBatchItemResultSchema, VoiceToolBatchResultSchema, VoiceToolCatalogEntrySchema, VoiceToolCatalogSnapshotSchema, VoiceToolCatalogTokenSchema, VoiceToolConflictDiagnosticSchema, VoiceToolDescribeInputSchema, VoiceToolDescriptorSchema, VoiceToolErrorCodeSchema, VoiceToolErrorSchema, VoiceToolUseInputSchema };\n\n//# sourceMappingURL=voiceTools.mjs.map","import { VOICE_TOOL_MAX_DOMAIN_COUNT, VOICE_TOOL_MAX_IDENTIFIER_LENGTH } from \"@agimon-ai/po-core/voiceTools\";\n//#region src/types/domains.ts\n/** The npm name this package registers its voice tools and contributions under. */\nconst DOMAIN_SOURCE = \"@agimon-ai/po-domain\";\n/**\n* The only names a domain, an operation or a handoff token may carry.\n*\n* Selections arrive from the model and from the command line, and every one of\n* them ends up in a filesystem path or a process environment variable, so the\n* shape is constrained once here and reused by the schema and the validator.\n*/\nconst SAFE_DOMAIN_NAME = /^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$/u;\n//#endregion\n//#region src/services/domainText/index.ts\nconst DOMAIN_SEPARATOR = \",\";\nconst DOMAIN_COMMAND = \"domains\";\n/** Footer status key the cockpit's domains axis reads. */\nconst DOMAIN_STATUS_KEY = \"po-domain\";\n/** What an empty selection reads as, which is a real state rather than an error. */\nconst NONE = \"(none)\";\n/** Splits the comma-separated argument the command and the autocomplete share. */\nfunction splitDomains(value) {\n\treturn value.split(DOMAIN_SEPARATOR).map((item) => item.trim()).filter(Boolean);\n}\n/** The published axis content: the active domains in the same comma-separated shape splitDomains reads. */\nfunction domainStatus(domains) {\n\treturn domains.join(DOMAIN_SEPARATOR);\n}\n/** Picker rows for the domain multi-select. */\nfunction domainItems(names, descriptions = {}) {\n\treturn names.map((name) => ({\n\t\tvalue: name,\n\t\tlabel: name,\n\t\t...descriptions[name] ? { description: descriptions[name] } : {}\n\t}));\n}\nfunction domainSummary(listing) {\n\treturn `Active domains: ${listing.effective.join(\", \") || \"(none)\"}\\nAvailable domains: ${listing.available.join(\", \")}\\nUse /${DOMAIN_COMMAND} <name[,name...]> to switch.`;\n}\nfunction switchedSummary(domains) {\n\treturn `Switched domains to: ${domains.join(\", \") || \"(none)\"}`;\n}\nfunction unchangedSummary(domains) {\n\treturn `Domains already active: ${domains.join(\", \") || \"(none)\"}`;\n}\nfunction pickerTitle(listing) {\n\treturn `Domains (active: ${listing.effective.join(\", \") || \"(none)\"})`;\n}\nconst MARK_ON = \"[x]\";\nconst MARK_OFF = \"[ ]\";\nconst OPTION_PREFIX = /^\\[[ x]\\] /;\n/**\n* Rows for a single-pick select where domains compose: each row shows the\n* membership it would flip, so a client without a multi-select still reaches\n* every set one toggle at a time.\n*/\nfunction domainToggleOptions(listing) {\n\tconst active = new Set(listing.effective);\n\treturn listing.available.map((name) => `${active.has(name) ? MARK_ON : MARK_OFF} ${name}`);\n}\n/** The domain a toggle row names. */\nfunction toggleOptionDomain(option) {\n\treturn option.replace(OPTION_PREFIX, \"\").trim();\n}\n/** The effective set with one domain flipped, order preserved for the rest. */\nfunction toggledDomains(effective, name) {\n\treturn effective.includes(name) ? effective.filter((domain) => domain !== name) : [...effective, name];\n}\n/**\n* Deduplicates a requested selection and rejects anything unsafe.\n*\n* Bounded before the manifest is read, because a selection large enough to\n* matter comes from the model rather than from a person typing the command.\n*/\nfunction normalizeDomainNames(values) {\n\tif (values.length > VOICE_TOOL_MAX_DOMAIN_COUNT) throw new Error(`A maximum of ${VOICE_TOOL_MAX_DOMAIN_COUNT} domains may be selected.`);\n\tconst result = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const value of values) {\n\t\tconst name = value.trim();\n\t\tif (!name || name.length > VOICE_TOOL_MAX_IDENTIFIER_LENGTH || !SAFE_DOMAIN_NAME.test(name)) throw new Error(`Invalid domain name: ${value}`);\n\t\tif (seen.has(name)) continue;\n\t\tseen.add(name);\n\t\tresult.push(name);\n\t}\n\treturn result;\n}\nfunction errorMessage(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\nfunction transitionError(result) {\n\treturn /* @__PURE__ */ new Error(`Domain transition was ${result.outcome}: ${result.diagnostics.join(\", \")}`);\n}\n//#endregion\nexport { DOMAIN_SOURCE as _, domainStatus as a, errorMessage as c, splitDomains as d, switchedSummary as f, unchangedSummary as g, transitionError as h, domainItems as i, normalizeDomainNames as l, toggledDomains as m, DOMAIN_STATUS_KEY as n, domainSummary as o, toggleOptionDomain as p, NONE as r, domainToggleOptions as s, DOMAIN_COMMAND as t, pickerTitle as u, SAFE_DOMAIN_NAME as v };\n\n//# sourceMappingURL=domainText-D0iurn8D.mjs.map","import { a as majorModeSummary, i as majorModeOptionLabel, n as applySummary, o as optionName, r as majorModeItems, t as MAJOR_MODE_COMMAND } from \"./majorModeText-DuWMOhxX.mjs\";\n//#region src/services/statusLine/index.ts\nconst STATUS_KEY = \"po-major-mode\";\n/** Compact footer text for the selected major mode, domains, and profile. */\nfunction statusText(majorMode, domains, profile) {\n\treturn [\n\t\tprofile ? `*${profile}*` : void 0,\n\t\t`[${majorMode}]`,\n\t\tdomains.join(\",\")\n\t].filter((part) => Boolean(part)).join(\":\");\n}\n//#endregion\n//#region src/types/majorMode.ts\n/** The npm name this package registers its voice tool and contributions under. */\nconst MAJOR_MODE_SOURCE = \"@agimon-ai/po-major-mode\";\n//#endregion\nexport { MAJOR_MODE_COMMAND, MAJOR_MODE_SOURCE, STATUS_KEY, applySummary, majorModeItems, majorModeOptionLabel, majorModeSummary, optionName, statusText };\n\n//# sourceMappingURL=index.mjs.map","import type { PoHeadlessSelection } from '@agimon-ai/po-core/headless';\nimport { domainStatus } from '@agimon-ai/po-domain';\nimport { statusText } from '@agimon-ai/po-major-mode';\nexport function publishHeadlessSelectionStatus(\n  setStatus: (source: string, text: string | undefined) => void,\n  selection: PoHeadlessSelection,\n): void {\n  setStatus('po-major-mode', statusText(selection.majorMode, selection.domains, selection.profile));\n  setStatus('po-domain', domainStatus(selection.domains));\n  setStatus('po-profile', selection.profile);\n}\n","import type { PoHubSessionCreateRequest } from '@agimon-ai/po-core/hubChannel';\nimport { parseArgs } from '@earendil-works/pi-coding-agent';\n\nconst SESSION_ID_OPTION = '--session-id';\nconst NAME_OPTION = '--name';\nconst PROFILE_OPTION = '--profile';\nconst DOMAINS_OPTION = '--domains';\nconst NO_DOMAINS_OPTION = '--no-domains';\nconst MODEL_OPTION = '--model';\nconst THINKING_OPTION = '--thinking';\nconst APPEND_SYSTEM_PROMPT_OPTION = '--append-system-prompt';\nexport interface SessionIdentity {\n  sessionId: string;\n  sessionName: string;\n}\n\n/** Settles the direct session identity from explicit arguments or caller defaults. */\nexport function resolveSessionIdentity(\n  agentArgs: readonly string[],\n  fallback: SessionIdentity,\n): { agentArgs: string[]; identity: SessionIdentity } {\n  const args = [...agentArgs];\n  const identity = { ...fallback };\n  for (const [option, key] of [\n    [SESSION_ID_OPTION, 'sessionId'],\n    [NAME_OPTION, 'sessionName'],\n  ] as const) {\n    const index = args.indexOf(option);\n    const value = index === -1 ? undefined : args[index + 1];\n    if (value !== undefined && !value.startsWith('-')) identity[key] = value;\n    else args.push(option, identity[key]);\n  }\n  if (!/^[a-zA-Z0-9_-]+$/u.test(identity.sessionId)) throw new Error('Invalid session id.');\n  return { agentArgs: args, identity };\n}\n\nconst MAJOR_MODE_OPTION = '--major-mode';\n\n/** Selection axes a request pins, which later inherited defaults must not replace. */\nexport type PinnedSelectionAxis = 'majorMode' | 'domains' | 'profile';\n\n/**\n * The harness arguments for a session a package created with explicit settings.\n *\n * Translating to flags keeps one validation path: the same parser that checks\n * a `po --major-mode ... --model ...` launch checks these. Minor modes have\n * no flag; the caller seeds them into the selection state directly.\n */\nexport function sessionSelectionArgs(\n  request: Pick<PoHubSessionCreateRequest, 'selection' | 'model' | 'thinking' | 'appendSystemPrompt'>,\n): {\n  args: string[];\n  pinned: PinnedSelectionAxis[];\n} {\n  const { selection, model, thinking, appendSystemPrompt } = request;\n  const args: string[] = [];\n  const pinned: PinnedSelectionAxis[] = [];\n  if (selection?.majorMode !== undefined) {\n    args.push(MAJOR_MODE_OPTION, selection.majorMode);\n    pinned.push('majorMode');\n  }\n  if (selection?.profile !== undefined) {\n    args.push(PROFILE_OPTION, selection.profile);\n    pinned.push('profile');\n  }\n  if (selection?.domains !== undefined) {\n    if (selection.domains.length === 0) args.push(NO_DOMAINS_OPTION);\n    else args.push(DOMAINS_OPTION, selection.domains.join(','));\n    pinned.push('domains');\n  }\n  if (model !== undefined) args.push(MODEL_OPTION, model);\n  if (thinking !== undefined) args.push(THINKING_OPTION, thinking);\n  // Unknown to the harness parser, so it reaches Pi, which appends it to the system prompt.\n  if (appendSystemPrompt !== undefined) args.push(APPEND_SYSTEM_PROMPT_OPTION, appendSystemPrompt);\n  return { args, pinned };\n}\n\nconst DOMAIN_OPTION = '--domain';\nconst APPENDED_PROMPT_SEPARATOR = '\\n\\n';\n\n/**\n * The session request a launch's own arguments make, for a launch session that runs in a sandbox, where the host\n * builds no harness. The selection axes are those the arguments name, as on the host, with the values the harness\n * parser settled. The model, thinking level and appended system prompt come from the Pi arguments it left, after\n * preset aliases resolved. Flags direct headless mode refuses on the host, such as `--tools`, are not carried.\n */\nexport function launchSessionRequest(\n  agentArgs: readonly string[],\n  options: {\n    readonly majorMode: string;\n    readonly profile?: string;\n    readonly domains: readonly string[];\n    readonly piArgs: readonly string[];\n  },\n): Pick<PoHubSessionCreateRequest, 'selection' | 'model' | 'thinking' | 'appendSystemPrompt'> {\n  const named = (...flags: string[]): boolean =>\n    agentArgs.some((arg) => flags.some((flag) => arg === flag || arg.startsWith(`${flag}=`)));\n  const selection = {\n    ...(named(MAJOR_MODE_OPTION) ? { majorMode: options.majorMode } : {}),\n    ...(named(PROFILE_OPTION) && options.profile !== undefined ? { profile: options.profile } : {}),\n    ...(named(NO_DOMAINS_OPTION)\n      ? { domains: [] }\n      : named(DOMAINS_OPTION, DOMAIN_OPTION)\n        ? { domains: [...options.domains] }\n        : {}),\n  };\n  const pi = parseArgs([...options.piArgs]);\n  const model =\n    pi.model !== undefined && pi.provider !== undefined && !pi.model.includes('/')\n      ? `${pi.provider}/${pi.model}`\n      : pi.model;\n  return {\n    ...(Object.keys(selection).length === 0 ? {} : { selection }),\n    ...(model === undefined ? {} : { model }),\n    ...(pi.thinking === undefined ? {} : { thinking: pi.thinking }),\n    ...(pi.appendSystemPrompt === undefined || pi.appendSystemPrompt.length === 0\n      ? {}\n      : { appendSystemPrompt: pi.appendSystemPrompt.join(APPENDED_PROMPT_SEPARATOR) }),\n  };\n}\n\n/**\n * The agent arguments with the major mode pinned to a relaunch target.\n *\n * Any prior selection is dropped so repeated switches never accumulate flags.\n * The new pair goes last, the position launcher scripts already use, which\n * also keeps a leading script path intact when the agent runs via node.\n */\nexport function relaunchAgentArgs(args: readonly string[], majorMode: string): string[] {\n  const kept: string[] = [];\n  let skipValue = false;\n  for (const argument of args) {\n    if (skipValue) {\n      skipValue = false;\n      continue;\n    }\n    if (argument === MAJOR_MODE_OPTION) {\n      skipValue = true;\n      continue;\n    }\n    kept.push(argument);\n  }\n  return [...kept, MAJOR_MODE_OPTION, majorMode];\n}\n","import type { PoWorkspaceSandboxProvider } from '@agimon-ai/po-core/workspaceSandboxes';\n\n/** Bound one cleanup phase without hiding its failure or preventing later phases. */\nexport async function withShutdownDeadline(operation: () => unknown, label: string, timeoutMs = 2_000): Promise<void> {\n  let timer: ReturnType<typeof setTimeout> | undefined;\n  try {\n    await Promise.race([\n      Promise.resolve().then(operation),\n      new Promise<never>((_resolve, reject) => {\n        timer = setTimeout(() => reject(new Error(`${label} exceeded ${timeoutMs}ms`)), timeoutMs);\n      }),\n    ]);\n  } finally {\n    if (timer !== undefined) clearTimeout(timer);\n  }\n}\n\n/** Docker sends SIGTERM and waits up to ten seconds; the engine finishes a stop it already accepted. */\nexport const SANDBOX_STOP_DEADLINE_MS = 8_000;\n\n/**\n * Whether the server is ending on the person's own clean stop: a normal exit or a termination signal. An idle\n * restart (exit 75), a reload by the supervisor and a crash are not, so the running sandboxes survive them.\n */\nexport function isCleanUserStop(cleanShutdown: boolean, signal: AbortSignal): boolean {\n  return cleanShutdown || (signal.aborted && signal.reason !== 'crash');\n}\n\n/** Runs every sandbox provider's clean-stop hook together; one failing provider is reported and never blocks another. */\nexport async function stopSandboxProviders(\n  providers: readonly PoWorkspaceSandboxProvider[],\n  notice: (message: string) => void,\n): Promise<void> {\n  await Promise.all(\n    providers.map(async (provider) => {\n      if (provider.onCleanStop === undefined) return;\n      try {\n        await provider.onCleanStop();\n      } catch (error) {\n        notice(\n          `Stopping the ${provider.id} sandboxes failed: ${error instanceof Error ? error.message : String(error)}`,\n        );\n      }\n    }),\n  );\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\n/** Quiet time after the last event before a change is reported, so a build in progress reports once. */\nconst SETTLE_MS = 300;\n/** Safety net for what a watcher misses (dropped events, unwatched installs): report a change this often. */\nconst REVALIDATE_MS = 60_000;\n\nexport interface WatchTarget {\n  /** A directory to watch. A missing one is skipped; the revalidation tick covers it. */\n  readonly path: string;\n  readonly recursive?: boolean;\n  /** Which changed paths, relative to `path`, count. Every path counts when omitted. */\n  readonly include?: (relative: string) => boolean;\n}\n\nexport interface WatcherServiceOptions {\n  /** Called once per settled burst of changes, and on every revalidation tick. */\n  readonly onChange: () => void;\n  readonly onNotice: (message: string) => void;\n  readonly settleMs?: number;\n  readonly revalidateMs?: number;\n}\n\n/**\n * Debounced file watching over directories, with a periodic revalidation tick. It knows\n * nothing about what the paths mean; the caller decides what a change invalidates.\n * Watchers are not persistent, so they never keep the process alive.\n */\nexport function createWatcherService(options: WatcherServiceOptions) {\n  const settleMs = options.settleMs ?? SETTLE_MS;\n  const watchers = new Map<string, fs.FSWatcher>();\n  let pending: NodeJS.Timeout | undefined;\n  const changed = () => {\n    if (pending !== undefined) clearTimeout(pending);\n    pending = setTimeout(() => {\n      pending = undefined;\n      options.onChange();\n    }, settleMs);\n    pending.unref();\n  };\n  const tick = setInterval(options.onChange, options.revalidateMs ?? REVALIDATE_MS);\n  tick.unref();\n\n  return {\n    /** Watches a directory once; adding the same path again is a no-op. */\n    add(target: WatchTarget): void {\n      if (watchers.has(target.path) || !fs.existsSync(target.path)) return;\n      try {\n        const watcher = fs.watch(\n          target.path,\n          { recursive: target.recursive === true, persistent: false },\n          (_, file) => {\n            if (file === null || target.include === undefined || target.include(file)) changed();\n          },\n        );\n        // ponytail: a failed watcher (removed directory, descriptor limit) is dropped and the\n        // revalidation tick covers it; re-add on the next composition if that proves too slow.\n        watcher.on('error', (error) => {\n          options.onNotice(`Stopped watching ${target.path}: ${error.message}`);\n          watcher.close();\n          watchers.delete(target.path);\n        });\n        watchers.set(target.path, watcher);\n      } catch (error) {\n        options.onNotice(`Could not watch ${target.path}: ${error instanceof Error ? error.message : String(error)}`);\n      }\n    },\n    close(): void {\n      clearInterval(tick);\n      if (pending !== undefined) clearTimeout(pending);\n      for (const watcher of watchers.values()) watcher.close();\n      watchers.clear();\n    },\n  };\n}\n\n/** Changes under a package root that matter: anything outside its `node_modules` (snapshots live there). */\nexport const outsideNodeModules = (relative: string): boolean => relative.split(path.sep)[0] !== 'node_modules';\n\nexport type WatcherService = ReturnType<typeof createWatcherService>;\n","import path from 'node:path';\n\nimport { loadPoConfigLayers } from '@agimon-ai/po-config/config';\n\ninterface WebTemplateDecision {\n  id?: string;\n  mount: { scope: 'global' } | { scope: 'workspace'; workspaceId: string };\n}\n\n/**\n * Resolve presentation from the server launch, never the selected session or workspace.\n * `host` picks the config key: `web.template` for the cockpit, `native.template` for the phone app.\n */\nexport function resolveWebTemplateDecision(options: {\n  cwd: string;\n  launchWorkspaceId?: string;\n  workspaces: readonly { id: string; root: string }[];\n  homeDirectory: string;\n  environment: NodeJS.ProcessEnv;\n  notice: (message: string) => void;\n  host?: 'web' | 'native';\n}): WebTemplateDecision {\n  const host = options.host ?? 'web';\n  // ponytail: without initial admission, a member checkout outside its canonical workspace\n  // root falls back to global config. Resolving it must not admit or sync a new workspace.\n  const workspace =\n    options.workspaces.find((candidate) => candidate.id === options.launchWorkspaceId) ??\n    options.workspaces\n      .filter((candidate) => {\n        const relative = path.relative(candidate.root, options.cwd);\n        return relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);\n      })\n      .sort((left, right) => right.root.length - left.root.length)[0];\n  const mount: WebTemplateDecision['mount'] =\n    workspace === undefined ? { scope: 'global' } : { scope: 'workspace', workspaceId: workspace.id };\n  try {\n    const id = loadPoConfigLayers(workspace?.root, options.homeDirectory, options.environment).valueAt([\n      host,\n      'template',\n    ]);\n    return { ...(typeof id === 'string' ? { id } : {}), mount };\n  } catch (error) {\n    options.notice(\n      `${host === 'web' ? 'Web' : 'Native'} template configuration unavailable: ${error instanceof Error ? error.message : String(error)}`,\n    );\n    return { mount };\n  }\n}\n","import { identifyWorkspace, readWorkspaceMarker } from '@agimon-ai/po-core/history';\n\nimport { resolveWorkspaceRoot } from '../../composition/repository';\n\n/**\n * The recorded workspace a directory's checkout belongs to: its root, a\n * subdirectory, or a worktree whose git data names it. An exact root match wins\n * without reading the checkout's marker. Undefined for a\n * directory that is not a checkout of any recorded workspace, or whose\n * workspace root has gone, so a caller never admits a new workspace by accident.\n */\nexport function checkoutWorkspaceId(records: readonly { id: string; root: string }[], cwd: string): string | undefined {\n  const checkoutRoot = resolveWorkspaceRoot(cwd);\n  const exact = records.find((record) => record.root === checkoutRoot);\n  if (exact !== undefined) return exact.id;\n  const identity = identifyWorkspace({ records, checkoutRoot, marker: readWorkspaceMarker(checkoutRoot) });\n  if (identity.moved || !records.some((record) => record.id === identity.id)) return undefined;\n  return identity.id;\n}\n","import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport net from 'node:net';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { createSettingsApi } from '@agimon-ai/po-config';\nimport { globalPoConfigDirectory } from '@agimon-ai/po-config/config';\nimport { loadMajorModesConfig, resolveLayers } from '@agimon-ai/po-config/majorModes';\nimport { resolveProfile } from '@agimon-ai/po-config/profiles';\nimport { readPoBackgroundWorkService } from '@agimon-ai/po-core/backgroundWork';\nimport {\n  createHeadlessHub,\n  type HeadlessHub,\n  type HeadlessHubOptions,\n  type HeadlessHubSession,\n  type HeadlessWorkspace,\n} from '@agimon-ai/po-core/headlessHub';\nimport { serveHeadlessServer } from '@agimon-ai/po-core/headlessServer';\nimport type { HeadlessSessionHost, HeadlessSessionHostOptions } from '@agimon-ai/po-core/headlessSessionHost';\nimport { createHeadlessSessionManager } from '@agimon-ai/po-core/headlessSessionManager';\nimport {\n  createOpenSessionRegistry,\n  createRequestReceipts,\n  createWorkspaceRegistry,\n  identifyWorkspace,\n  listSavedSessionRecords,\n  listSavedSessions,\n  readSqliteTranscript,\n  readWorkspaceMarker,\n  writeWorkspaceMarker,\n} from '@agimon-ai/po-core/history';\nimport type { OpenSessionRecord, SavedSessionExecution, WorkspaceRecord } from '@agimon-ai/po-core/history';\nimport { WORKFLOW_STEP_SESSION_PROVENANCE } from '@agimon-ai/po-core/hubChannel';\nimport type {\n  PoHubSessionApiRequest,\n  PoHubSessionCreateRequest,\n  PoHubSessionScope,\n} from '@agimon-ai/po-core/hubChannel';\nimport { loadMcpPlugins, mcpUiResource, type LoadedMcpPlugins } from '@agimon-ai/po-core/mcpFacet';\nimport { createModelGatewayContainer, type ModelGatewayContainer } from '@agimon-ai/po-core/modelGateway';\nimport { createNodePlatform } from '@agimon-ai/po-core/nodePlatform';\nimport { createServerExecutionBudget, PO_SHARE_FILE_REMOTE_OFF_MESSAGE } from '@agimon-ai/po-core/packageApi';\nimport type { PoApiHandler, PoHostMediaArbitration, PoPeerAgentRegistry } from '@agimon-ai/po-core/packageApi';\nimport { serveSessionApis, type PackageApiServer } from '@agimon-ai/po-core/packageApiServer';\nimport { piAgentDirectory, poHomeDirectory } from '@agimon-ai/po-core/piSettings';\nimport {\n  BACKGROUND_CONTEXT,\n  nodeHost,\n  readSessionFileDirectories,\n  removeSessionFiles,\n} from '@agimon-ai/po-core/platform';\nimport { createRemoteRuntime, PO_REMOTE_ORIGIN_CONTRACT, type RemoteRuntime } from '@agimon-ai/po-core/remoteRuntime';\nimport type {\n  HeadlessSessionCloseOptions,\n  HeadlessSessionManager,\n} from '@agimon-ai/po-core/runtimeHeadlessSessionManager';\nimport { createHarnessTelemetry } from '@agimon-ai/po-core/runtimeLogSinkTelemetry';\nimport { PO_SANDBOX_IDENTITY_CONTRACT, type PoSandboxIdentity } from '@agimon-ai/po-core/sandboxIdentity';\nimport {\n  loadServerPackages,\n  selectedServerProviderOverrides,\n  type LoadedServerPackages,\n} from '@agimon-ai/po-core/serverPlugin';\nimport { createServerTelemetry } from '@agimon-ai/po-core/serverTelemetry';\nimport { createWebCompositions, reapAbandonedPublications } from '@agimon-ai/po-core/webCompositions';\nimport { createWorkspaceSandboxRegistry, PO_WORKSPACE_SANDBOXES_CONTRACT } from '@agimon-ai/po-core/workspaceSandboxes';\nimport { readMinorModeCatalog } from '@agimon-ai/po-minor-mode';\nimport { createNativePushSender } from '@agimon-ai/po-notification';\n\nimport { HARNESS_STATE_KEYS, HARNESS_STATE_POINTER, updateHarnessState } from '../../composition/harnessState';\nimport { missingLayerPackageSpecifiers } from '../../composition/layerPackageInstaller';\nimport { resolveWorkspaceRoot } from '../../composition/repository';\nimport { globalWebPluginRoots, processIsAlive, readSyncPointer, syncPointerPath } from '../../composition/syncService';\nimport { poPackageRoot } from '../cli/entryResolution';\nimport { createLayerResolvers, resolveExtensionComposition, unsyncedSelectors } from '../cli/extensionAssembler';\nimport { buildHarnessContext } from '../cli/harnessContext';\nimport { createNodeIsolate } from '../isolate';\nimport {\n  type GlobalNativeBuildRecord,\n  mountNativePluginIds,\n  NATIVE_APP_PLATFORMS,\n  readGlobalNativeBuildRecord,\n  readGlobalNativeBuildStatus,\n  readNativeAppBuild,\n} from '../native';\nimport { createNodeNpm } from '../npm';\nimport {\n  compositionPackageRoots,\n  type GlobalWebBuildRecord,\n  mountWebPluginSlots,\n  newestGlobalWebBuildKey,\n  readGlobalWebBuildRecord,\n  readGlobalWebBuildStatus,\n  unslottedWebPackages,\n} from '../web';\nimport { createBackgroundSync, createKeyedPickup, createSyncCheckpoints, syncedBuildKeys } from './backgroundSync';\nimport { createBundlerService } from './bundlerService';\nimport { createComputerUseBinding } from './computerUseBinding';\nimport { registerContainedSessionMethods } from './containedSessions';\nimport { createDefaultWorkspaceFolder } from './defaultWorkspace';\nimport { createHostModelGateway, type HostModelGateway } from './hostModelGateway';\nimport {\n  createIdleRestart,\n  holdsRestart,\n  prepareSessionRestore,\n  readRecycleState,\n  removeRecycleFile,\n  reopenRecycledSessions,\n  RESTART_EXIT_CODE,\n  testIdleRestartOverrides,\n  writeRecycleFile,\n} from './idleRestart';\nimport { ensureGlobalLogSink } from './logSink';\nimport { readMcpAppBuild } from './mcpAppBuild';\nimport { loadNativePushCredentials, subscribeNativePush } from './nativePush';\nimport { monitorRuntimeResources } from './runtimeResources';\nimport { createSandboxRouter, SANDBOX_UNREACHABLE, type SandboxRouter } from './sandboxRouter';\nimport {\n  CONTAINER_WORKTREE_GONE,\n  createSandboxSessionHandoff,\n  handoffProvider,\n  type HandoffProvider,\n  type SandboxSessionHandoff,\n} from './sandboxSessionHandoff';\nimport { publishHeadlessSelectionStatus } from './selectionStatus';\nimport {\n  launchSessionRequest,\n  type PinnedSelectionAxis,\n  resolveSessionIdentity,\n  sessionSelectionArgs,\n} from './sessionArguments';\nimport { isCleanUserStop, SANDBOX_STOP_DEADLINE_MS, stopSandboxProviders, withShutdownDeadline } from './shutdown';\nimport type { ServeOptions, ServerRuntimeEnvironment } from './types';\nimport { createWatcherService, outsideNodeModules } from './watcherService';\nimport { resolveWebTemplateDecision } from './webTemplateDecision';\nimport { checkoutWorkspaceId } from './workspaceCheckout';\n\n/** The largest protocol message a contained server accepts from its host. */\nconst CONTAINED_MAX_PAYLOAD_BYTES = 8 * 1024 * 1024;\n/** The base path of po-config's settings API, the one API a sandboxed workspace still answers on the host. */\nconst SETTINGS_API = 'settings';\n\n/** Whether a listen address stays on this machine: `localhost`, `127.0.0.0/8`, or `::1`. */\nfunction isLoopbackHost(host: string): boolean {\n  const address = host.startsWith('[') && host.endsWith(']') ? host.slice(1, -1) : host;\n  if (address.toLowerCase() === 'localhost') return true;\n  if (net.isIPv4(address)) return address.startsWith('127.');\n  if (!net.isIPv6(address)) return false;\n  const lower = address.toLowerCase();\n  return (\n    lower === '::1' || (lower.startsWith('::ffff:') && net.isIPv4(lower.slice(7)) && lower.slice(7).startsWith('127.'))\n  );\n}\n\n/**\n * The installed payload a contained server imports in place, so it never writes package snapshots into a\n * read-only runtime. An installed Po sits at `<payload>/node_modules/@agimon-ai/po`; a source checkout is\n * its own package root.\n */\nfunction containedImmutableRoot(packageRoot: string): string {\n  const scopeDirectory = path.dirname(packageRoot);\n  return path.basename(path.dirname(scopeDirectory)) === 'node_modules'\n    ? path.resolve(packageRoot, '../../..')\n    : packageRoot;\n}\n\nfunction errorMessage(error: unknown): string {\n  return error instanceof Error ? error.message : String(error);\n}\n\n/** Whether the host itself serves the workspace: admitted here and not run by a sandbox. */\nfunction servedOnHost(workspace: HeadlessWorkspace): boolean {\n  return workspace.available !== false && workspace.sandbox === undefined;\n}\n\n/** A workspace's live sandbox state, as the hub carries it. */\ntype SandboxStatusFields = Pick<HeadlessWorkspace, 'sandboxState' | 'sandboxReason'>;\n\n/** The hub's view of a workspace record: one mapping, so every registration carries its sandbox and its state. */\nfunction hubWorkspace(\n  record: WorkspaceRecord,\n  available: boolean,\n  status: SandboxStatusFields = {},\n): HeadlessWorkspace {\n  return {\n    id: record.id,\n    root: record.root,\n    ...(record.name === undefined ? {} : { name: record.name }),\n    ...(record.sandbox === undefined ? {} : { sandbox: record.sandbox }),\n    ...(status.sandboxState === undefined ? {} : { sandboxState: status.sandboxState }),\n    ...(status.sandboxReason === undefined ? {} : { sandboxReason: status.sandboxReason }),\n    available,\n  };\n}\n\nconst sameSandboxStatus = (left: SandboxStatusFields, right: SandboxStatusFields): boolean =>\n  left.sandboxState === right.sandboxState && left.sandboxReason === right.sandboxReason;\n\nasync function bounded(operation: Promise<unknown>, label: string, notice: (message: string) => void): Promise<void> {\n  try {\n    await withShutdownDeadline(() => operation, label);\n  } catch (error) {\n    notice(`${label} failed: ${error instanceof Error ? error.message : String(error)}`);\n  }\n}\n\nexport async function runServerRuntime(options: ServeOptions, runtime: ServerRuntimeEnvironment): Promise<number> {\n  const {\n    cwd: baseCwd,\n    environment: incomingEnvironment,\n    notice: rawNotice,\n    resolveHarnessOptions,\n    signal,\n    onExtensionCheck,\n    automation,\n  } = runtime;\n  // Only a contained server, reached through its sandbox's port forward, listens beyond loopback.\n  if (options.host !== undefined && options.contained !== true && !isLoopbackHost(options.host))\n    throw new Error(`--host ${options.host} is not a loopback address. Only a --contained server may listen on it.`);\n  const sandboxIdentity: PoSandboxIdentity | undefined =\n    options.contained === true\n      ? Object.freeze({\n          contained: true,\n          ...(options.workspaceId === undefined ? {} : { workspaceId: options.workspaceId }),\n        })\n      : undefined;\n  // Keep this selection local to this server and its admitted sessions. The\n  // process environment may also serve unrelated hosts and must not be changed.\n  const baseEnvironment: NodeJS.ProcessEnv = { ...incomingEnvironment, LOG_SINK_INSTANCE: 'global' };\n  const executionBudget = createServerExecutionBudget(baseEnvironment);\n  await ensureGlobalLogSink({ cwd: baseCwd, env: baseEnvironment, notice: rawNotice }).catch((error: unknown) =>\n    rawNotice(`Global log sink unavailable: ${error instanceof Error ? error.message : String(error)}`),\n  );\n  // Telemetry's own warnings stay on the raw channel, so a failing sink cannot feed itself.\n  const telemetry = createServerTelemetry({ cwd: baseCwd, env: baseEnvironment, warn: rawNotice });\n  const notice = (message: string): void => {\n    rawNotice(message);\n    void telemetry\n      .recordEvent('po_server.notice', { message })\n      .catch((error: unknown) => rawNotice(`notice telemetry failed: ${String(error)}`));\n  };\n  const homeDirectory = baseEnvironment.HOME ?? os.homedir();\n  const serverDirectory = path.join(piAgentDirectory(baseEnvironment), 'server');\n  const temporaryDirectory = path.resolve(\n    baseEnvironment.TMPDIR || baseEnvironment.TMP || baseEnvironment.TEMP || os.tmpdir(),\n  );\n  // One host platform for every composition root this server runs: hub, workspaces and sessions.\n  const platform = {\n    ...createNodePlatform({\n      homeDirectory,\n      temporaryDirectory,\n      sessionsRoot: path.join(serverDirectory, 'sessions'),\n    }),\n    isolate: createNodeIsolate(),\n    npm: createNodeNpm({\n      poHome: poHomeDirectory(homeDirectory, baseEnvironment),\n      homeDirectory,\n      temporaryDirectory,\n      environment: baseEnvironment,\n    }),\n  };\n  /** Called on a watched change; assigned once every scope can be checked. */\n  let pickUpChange = (): void => undefined;\n  const watcher = createWatcherService({ onChange: () => pickUpChange(), onNotice: notice });\n  const isConfig = (file: string) => /\\.ya?ml$/u.test(file);\n  // The Po home's documents layer under every root's own .po copy.\n  watcher.add({ path: globalPoConfigDirectory(homeDirectory), include: isConfig });\n  /** Compiles and loads packages once per content; every scope and session selects from it. */\n  const bundler = createBundlerService({\n    homeDirectory,\n    environment: baseEnvironment,\n    // Desktop owns this installed payload. Writing package snapshots into it breaks the app's signature.\n    // A contained server runs from a read-only runtime and says so with its flag, not the environment.\n    ...(sandboxIdentity !== undefined\n      ? { immutableRoot: containedImmutableRoot(poPackageRoot()) }\n      : baseEnvironment.PO_DISTRIBUTION === 'desktop' && baseEnvironment.PO_PACKAGE_ROOT\n        ? { immutableRoot: path.resolve(baseEnvironment.PO_PACKAGE_ROOT, '../../..') }\n        : {}),\n    // What a root's compositions read: its .po documents and every repo-local package it selects.\n    // Versioned and installed packages change only through sync or upm, which check every scope.\n    onCompositions: (root, compositions) => {\n      watcher.add({ path: path.join(root, '.po'), include: isConfig });\n      for (const packageRoot of compositionPackageRoots(compositions))\n        if (!packageRoot.includes(`${path.sep}node_modules${path.sep}`))\n          watcher.add({ path: packageRoot, recursive: true, include: outsideNodeModules });\n    },\n  });\n  // This native history has no agent lane and is deliberately outside the session-history catalog.\n  const requestReceipts = createRequestReceipts({ directory: path.join(serverDirectory, 'request-receipts-v1') });\n  const activeMedia = new Set<() => boolean>();\n  const mediaArbitration: PoHostMediaArbitration = {\n    register(busy) {\n      activeMedia.add(busy);\n      return () => {\n        activeMedia.delete(busy);\n      };\n    },\n    available(busy) {\n      return activeMedia.has(busy) && [...activeMedia].every((other) => other === busy || !other());\n    },\n  };\n  const activePeerAgents = new Map<string, { fetch(request: Request): Promise<Response>; hubToken: string }>();\n  const peerAgents: PoPeerAgentRegistry = {\n    register(sessionId, agent, hubToken) {\n      if (activePeerAgents.has(sessionId)) throw new Error(`Voice peer agent '${sessionId}' is already registered.`);\n      const entry = { fetch: (request: Request) => agent.fetch(request), hubToken };\n      activePeerAgents.set(sessionId, entry);\n      return () => {\n        if (activePeerAgents.get(sessionId) === entry) activePeerAgents.delete(sessionId);\n      };\n    },\n    get: (sessionId) => activePeerAgents.get(sessionId),\n  };\n  const workspaces = createWorkspaceRegistry({ directory: serverDirectory, onNotice: notice });\n  // A contained server's workspace keeps its host id: its checkout root is recorded under that id before anything\n  // admits it, so an exact root match names it and the container's session ids belong to the host's workspace.\n  if (sandboxIdentity?.workspaceId !== undefined) {\n    const containedRoot = resolveWorkspaceRoot(baseCwd);\n    for (const record of workspaces.list())\n      if (record.root === containedRoot && record.id !== sandboxIdentity.workspaceId) workspaces.remove(record.id);\n    if (!workspaces.list().some((record) => record.id === sandboxIdentity.workspaceId && record.root === containedRoot))\n      workspaces.add({ id: sandboxIdentity.workspaceId, root: containedRoot });\n  }\n  // Bound on the global scope before it is served, so a root's global plugin can register a provider while\n  // it loads. Closed once the global scope is up.\n  const sandboxes = createWorkspaceSandboxRegistry();\n  // Workspaces whose scope this process served. The hub cannot serve one twice, so a workspace that gets\n  // a sandbox and is cleared again in the same run is marked available again instead of readmitted.\n  const servedWorkspaces = new Set<string>();\n  // Beside the journals it names, because a record pointing at a sessions\n  // directory it is not stored next to is a record that can outlive its target.\n  const openSessions = createOpenSessionRegistry({\n    directory: serverDirectory,\n    onNotice: notice,\n  });\n  const recycled = readRecycleState(serverDirectory);\n  const restorePlan = prepareSessionRestore(recycled);\n  const recoverySessionIds = new Set(restorePlan.sessionIds);\n  let recoveryTunnel = recycled?.tunnel;\n  let persistRecovery = (): void => {};\n  let cleanShutdown = false;\n  let recoveryWork: Promise<unknown> = Promise.resolve();\n  let recovering = false;\n  const recordLiveSession = (\n    created: Awaited<ReturnType<HeadlessHub['create']>>,\n    repoRoot: string,\n    groupingRoot: string,\n  ): void => {\n    if (created.workspaceId === undefined) throw new Error('The new session has no workspace.');\n    const saved = openSessions.add({\n      sessionId: created.id,\n      workspaceId: created.workspaceId,\n      cwd: created.cwd,\n      repoRoot,\n      groupingRoot,\n      name: created.name,\n      createdAt: created.createdAt,\n      ...(created.parentSessionId === undefined ? {} : { parentSessionId: created.parentSessionId }),\n      ...(created.sessionProvenance === undefined ? {} : { sessionProvenance: created.sessionProvenance }),\n      ...(created.groups === undefined || created.groups.length === 0 ? {} : { groups: [...created.groups] }),\n    });\n    if (saved === false) throw new Error('The new session could not be durably recorded.');\n    recoverySessionIds.add(created.id);\n    persistRecovery();\n  };\n  let lastBudgetSnapshot = '';\n  let nextEventLoopTick = performance.now() + 1_000;\n  const eventLoopMonitor = setInterval(() => {\n    const now = performance.now();\n    const budget = executionBudget.getSnapshot();\n    const snapshot = JSON.stringify(budget);\n    if (snapshot !== lastBudgetSnapshot) {\n      lastBudgetSnapshot = snapshot;\n      void telemetry\n        .recordEvent('po_server.execution_budget', {\n          host_pid: process.pid,\n          running_jobs: budget.running,\n          queued_jobs: budget.queued,\n          limit: budget.limit,\n        })\n        .catch((error: unknown) => notice(`execution budget telemetry failed: ${String(error)}`));\n    }\n    const delay = Math.max(0, now - nextEventLoopTick);\n    nextEventLoopTick = now + 1_000;\n    if (delay >= 100)\n      void telemetry\n        .recordEvent('po_server.event_loop_delay', { duration_ms: Math.round(delay) })\n        .catch((error: unknown) => notice(`event loop telemetry failed: ${String(error)}`));\n  }, 1_000);\n  eventLoopMonitor.unref();\n  const harnessTelemetry = createHarnessTelemetry({\n    cwd: baseCwd,\n    env: baseEnvironment,\n    warn: notice,\n    deferSpans: true,\n  });\n  const baseSessionManager = createHeadlessSessionManager({\n    publishSelectionStatus: publishHeadlessSelectionStatus,\n    contextGroups: (context) =>\n      (readMinorModeCatalog(context)?.list() ?? [])\n        .filter(({ state }) => state.activation === 'active')\n        .map(({ descriptor }) => ({ id: descriptor.id, label: descriptor.label, kind: 'minor' })),\n  });\n  type SessionSetup = {\n    cleanup: () => Promise<void>;\n    bundle: LoadedServerPackages;\n    mcpBundle: LoadedMcpPlugins;\n  };\n  type SessionArtifacts = SessionSetup & { apis: PackageApiServer };\n  /** The server's environment rooted at one configuration root, with no harness state of its own. */\n  const rootEnvironment = (root: string): NodeJS.ProcessEnv => {\n    const environment: NodeJS.ProcessEnv = { ...baseEnvironment, PO_ROOT: root };\n    for (const key of [HARNESS_STATE_POINTER, ...Object.values(HARNESS_STATE_KEYS)]) delete environment[key];\n    return environment;\n  };\n  const pendingSessions = new Map<string, SessionSetup>();\n  /** The last harness context built to report each repository's MCP projection, kept while it is current. */\n  const repositoryContexts = new Map<string, { cleanup(): Promise<void> }>();\n  const sessionArtifacts = new Map<string, SessionArtifacts>();\n  /** Each host's session package root, where its session services (background work included) live. */\n  const sessionServiceRoots = new WeakMap<HeadlessSessionHost, Parameters<HeadlessSessionHost['preparePackages']>[0]>();\n  let mountSessionApis:\n    | ((options: HeadlessSessionHostOptions, host: HeadlessSessionHost) => Promise<PackageApiServer>)\n    | undefined;\n  /**\n   * Shutdown runs every session through the same close path a user-initiated\n   * close uses, so without this the registry would be emptied by the very event\n   * it exists to survive.\n   */\n  let shuttingDown = false;\n  persistRecovery = () => {\n    if (shuttingDown || signal.aborted) return;\n    try {\n      writeRecycleFile(serverDirectory, [...recoverySessionIds], {\n        kind: 'live',\n        crashRestores: restorePlan.crashRestores,\n        ...(recoveryTunnel === undefined ? {} : { tunnel: recoveryTunnel }),\n      });\n    } catch (error) {\n      notice(`Could not persist crash recovery: ${error instanceof Error ? error.message : String(error)}`);\n    }\n  };\n\n  const removeSessionOutputs = async (sessionId: string): Promise<void> => {\n    // A container session's files live in its container, which removes them, as do a host session's the host just\n    // handed over.\n    const handedTo = handoff?.handedOff(sessionId);\n    if (router !== undefined && (router.owns(sessionId) || handedTo !== undefined)) {\n      await router.removeSession(sessionId, handedTo);\n      handoff?.forget(sessionId);\n      openSessions.remove(sessionId);\n      return;\n    }\n    const directories = await readSessionFileDirectories(platform.sessions, sessionId);\n    await removeSessionFiles({\n      platform,\n      sessionId,\n      environment: baseEnvironment,\n      artifactDirectory: path.join(\n        directories?.agentDirectory ?? piAgentDirectory(baseEnvironment, homeDirectory),\n        'po-artifacts',\n        sessionId,\n      ),\n      ...(directories === undefined ? {} : { directories }),\n    });\n    // Leave the record available for a retry until both output roots have been removed.\n    openSessions.remove(sessionId);\n  };\n\n  /** Routes the sessions of contained workspaces into their containers; host servers only. */\n  let router: SandboxRouter | undefined;\n  /** Hands sessions over between the host and a sandbox's Po home when a workspace switches; host servers only. */\n  let handoff: SandboxSessionHandoff | undefined;\n  /** The sandboxed workspace's provider, when it runs with a Po home on host disk that sessions can move into. */\n  const handoffProviderOf = (workspaceId: string | undefined): HandoffProvider | undefined => {\n    const sandbox = workspaces.list().find((workspace) => workspace.id === workspaceId)?.sandbox;\n    return sandbox === undefined ? undefined : handoffProvider(sandboxes.get(sandbox));\n  };\n  /** The host's own part of a sandbox's state: a handover in progress, or a switch that failed. */\n  const sandboxTransitions = new Map<string, SandboxStatusFields>();\n  /** Set once the global scope has loaded, so a provider missing by then is missing for good. */\n  let sandboxProvidersSettled = false;\n  /**\n   * A workspace's live sandbox state. A sandboxed one: the host's transition, else running while linked, else what\n   * its provider reports. A local one: unavailable only when every provider that reports availability cannot run\n   * sandboxes now, so the switch can say why it is off.\n   */\n  const sandboxStatus = (record: WorkspaceRecord): SandboxStatusFields => {\n    if (record.sandbox === undefined) {\n      const reports = sandboxes\n        .list()\n        .map((provider) => provider.availability?.())\n        .filter((report) => report !== undefined);\n      const blocked = reports.find((report) => !report.available);\n      return blocked === undefined || blocked.available || reports.some((report) => report.available)\n        ? {}\n        : { sandboxState: 'unavailable', sandboxReason: blocked.reason };\n    }\n    // A switch that is starting the sandbox gives way to running, or to a failure its provider reports.\n    const transition = sandboxTransitions.get(record.id);\n    if (transition !== undefined && transition.sandboxState !== 'starting') return transition;\n    if (router?.connected(record.id) === true) return { sandboxState: 'running' };\n    const provider = sandboxes.get(record.sandbox);\n    if (provider === undefined)\n      return sandboxProvidersSettled\n        ? { sandboxState: 'unavailable', sandboxReason: `The sandbox provider '${record.sandbox}' is not installed.` }\n        : {};\n    const availability = provider.availability?.();\n    if (availability !== undefined && !availability.available)\n      return { sandboxState: 'unavailable', sandboxReason: availability.reason };\n    const status = provider.status?.(record.id);\n    if (status?.state === 'failed') return { sandboxState: 'failed', sandboxReason: status.reason };\n    // Running in the provider but not linked yet still counts as starting, as does a provider still checking.\n    return (\n      transition ??\n      (status !== undefined || (provider.availability !== undefined && availability === undefined)\n        ? { sandboxState: 'starting' }\n        : {})\n    );\n  };\n  const hubEntry = (record: WorkspaceRecord, available: boolean): HeadlessWorkspace =>\n    hubWorkspace(record, available, sandboxStatus(record));\n  /** Registers the workspace again when its availability or sandbox state changed, so clients see it live. */\n  const refreshWorkspace = (workspaceId: string): void => {\n    const record = workspaces.list().find((workspace) => workspace.id === workspaceId);\n    const known = hub.workspaces().find((workspace) => workspace.id === workspaceId);\n    // A record whose sandbox changed is registered by the switch itself.\n    if (record === undefined || known === undefined || known.sandbox !== record.sandbox) return;\n    const available =\n      record.sandbox === undefined ? known.available !== false : router?.connected(workspaceId) === true;\n    const entry = hubEntry(record, available);\n    if (available === (known.available !== false) && sameSandboxStatus(entry, known)) return;\n    hub.registerWorkspace(entry);\n  };\n  const refreshWorkspaces = (): void => {\n    for (const workspace of hub.workspaces()) refreshWorkspace(workspace.id);\n  };\n  const stopSandboxWatches: (() => void)[] = [];\n  /**\n   * A host session of a workspace that is now sandboxed closed: it follows the workspace into the sandbox, and the\n   * host scope, kept only for host sessions, unloads with the last of them.\n   */\n  const handOffClosedSession = async (sessionId: string, workspaceId: string, keepDormant: boolean): Promise<void> => {\n    const provider = handoffProviderOf(workspaceId);\n    if (provider === undefined || handoff === undefined) return;\n    try {\n      await handoff.sessionClosed(sessionId, workspaceId, keepDormant, provider);\n    } catch (error) {\n      notice(`Session ${sessionId} could not follow its workspace into the sandbox: ${errorMessage(error)}`);\n    }\n    const hostSessionsLeft = baseSessionManager\n      .sessions()\n      .some(\n        (host) =>\n          host.runtime.sessionId !== sessionId && hub.session(host.runtime.sessionId)?.workspaceId === workspaceId,\n      );\n    if (hostSessionsLeft || !servedWorkspaces.has(workspaceId)) return;\n    servedWorkspaces.delete(workspaceId);\n    await hub\n      .unloadWorkspaceScope?.(workspaceId)\n      .catch((error: unknown) => notice(`Workspace '${workspaceId}' scope did not unload: ${errorMessage(error)}`));\n  };\n  const closeManagedSession = async (sessionId: string, options?: HeadlessSessionCloseOptions): Promise<void> => {\n    // A container session never had a host record or host outputs; at shutdown its mirror only lets go.\n    if (router?.mirror(sessionId) !== undefined) {\n      await router.closeSession(sessionId, { keepDormant: options?.keepDormant === true, disposeOnly: shuttingDown });\n      return;\n    }\n    // The hub has already unregistered the session; its record still names the workspace.\n    const closingWorkspaceId = openSessions.list().find((record) => record.sessionId === sessionId)?.workspaceId;\n    // A released session keeps its record, which is what lists it as dormant.\n    if (!shuttingDown) {\n      recoverySessionIds.delete(sessionId);\n      persistRecovery();\n      if (options?.keepDormant !== true) openSessions.remove(sessionId);\n    }\n    const artifacts = sessionArtifacts.get(sessionId);\n    sessionArtifacts.delete(sessionId);\n    webCompositions?.remove({ scope: 'session', sessionId });\n    webCompositions?.removeNative({ scope: 'session', sessionId });\n    const failures: unknown[] = [];\n    // The host goes first, as on the create-failure path: it stops the running turn and\n    // dispatches session_shutdown while the packages that own those hooks are still installed.\n    try {\n      await withShutdownDeadline(\n        () => baseSessionManager.closeSession(sessionId),\n        `Session '${sessionId}' runtime shutdown`,\n      );\n    } catch (error) {\n      failures.push(error);\n    }\n    try {\n      await withShutdownDeadline(() => artifacts?.apis.close(), `Session '${sessionId}' API shutdown`);\n    } catch (error) {\n      failures.push(error);\n    }\n    try {\n      await withShutdownDeadline(() => artifacts?.cleanup(), `Session '${sessionId}' artifact cleanup`);\n    } catch (error) {\n      failures.push(error);\n    }\n    if (failures.length > 0) throw new AggregateError(failures, `Session '${sessionId}' shutdown failed`);\n    if (!shuttingDown && closingWorkspaceId !== undefined)\n      await handOffClosedSession(sessionId, closingWorkspaceId, options?.keepDormant === true);\n  };\n\n  const sessionManager: HeadlessSessionManager = {\n    async create(sessionOptions) {\n      const setup = pendingSessions.get(sessionOptions.sessionId);\n      let host: HeadlessSessionHost;\n      try {\n        host = await baseSessionManager.create(sessionOptions);\n      } catch (error) {\n        if (setup !== undefined && pendingSessions.delete(sessionOptions.sessionId))\n          await setup.cleanup().catch((cleanupError: unknown) => notice(String(cleanupError)));\n        throw error;\n      }\n      if (setup === undefined || mountSessionApis === undefined) return host;\n      try {\n        const apis = await mountSessionApis(sessionOptions, host);\n        pendingSessions.delete(sessionOptions.sessionId);\n        sessionArtifacts.set(sessionOptions.sessionId, { ...setup, apis });\n        return host;\n      } catch (error) {\n        pendingSessions.delete(sessionOptions.sessionId);\n        await baseSessionManager\n          .closeSession(sessionOptions.sessionId)\n          .catch((closeError: unknown) => notice(String(closeError)));\n        await setup.cleanup().catch((cleanupError: unknown) => notice(String(cleanupError)));\n        throw error;\n      }\n    },\n    get: (sessionId) => baseSessionManager.get(sessionId) ?? router?.mirror(sessionId),\n    sessions: () => [...baseSessionManager.sessions(), ...(router?.mirrors() ?? [])],\n    closeSession: closeManagedSession,\n    async close() {\n      const ids = sessionManager.sessions().map((session) => session.runtime.sessionId);\n      const outcomes = await Promise.allSettled(ids.map((id) => closeManagedSession(id)));\n      const failures = outcomes\n        .filter((outcome): outcome is PromiseRejectedResult => outcome.status === 'rejected')\n        .map((outcome) => outcome.reason);\n      if (failures.length > 0) throw new AggregateError(failures, 'Headless session shutdown failed');\n    },\n  };\n\n  let requestSessionApi: (scope: PoHubSessionScope, request: PoHubSessionApiRequest) => Promise<Response> = async () =>\n    Response.json({ error: 'Session API unavailable.' }, { status: 404 });\n  /** Assigned once the shared API context exists: the host-side APIs of a workspace whose scope it does not serve. */\n  let unservedWorkspaceApi: NonNullable<HeadlessHubOptions['unservedWorkspaceApi']> = () => undefined;\n  let openSession: (\n    request: PoHubSessionCreateRequest,\n    sessionId?: string,\n    groupingWorkspaceId?: string,\n  ) => Promise<PoHubSessionScope> = async () => {\n    throw new Error('The cockpit session service is not ready.');\n  };\n  let admitWorkspace: (\n    root: string,\n    name?: string,\n  ) => Promise<HeadlessWorkspace & { available: boolean }> = async () => {\n    throw new Error('Workspace admission is not ready.');\n  };\n  let dormantSessions: () => readonly OpenSessionRecord[] = () => [];\n  let reviveSession: (sessionId: string) => Promise<void> = async () => {\n    throw new Error('Session revival is not ready.');\n  };\n  let remoteRuntime: RemoteRuntime | undefined;\n  let stopNativePush: (() => void) | undefined;\n  const computerUse = await createComputerUseBinding(process, {\n    isDeviceAuthorized: (id) => remoteRuntime?.remote.isDeviceAuthorized(id) === true,\n    stepUpRequired: () => remoteRuntime?.remote.stepUpRequired('computer-use.activate') === true,\n  });\n  let hub!: HeadlessHub;\n  /** Assigned once the global builds can be read; no session opens before then. */\n  let publishSessionCompositions: NonNullable<HeadlessHubOptions['publishSessionCompositions']> = () => ({});\n  hub = createHeadlessHub({\n    manager: sessionManager,\n    platform,\n    // Throws for an unknown profile; the hub reports that and shows the session without an avatar.\n    resolveProfileIdentity: (root, profile) => {\n      const identity = resolveProfile(root, profile, homeDirectory).identity;\n      return identity === undefined ? undefined : { displayName: identity.name, icon: identity.icon };\n    },\n    // The session mounts only its major mode's plugins, republished when the mode changes.\n    publishSessionCompositions: (sessionId, root, majorMode) => publishSessionCompositions(sessionId, root, majorMode),\n    admitWorkspace: async ({ root, name }) => {\n      const byName = root === undefined || root.trim() === '';\n      const admitted = await admitWorkspace(\n        byName ? await createDefaultWorkspaceFolder(name ?? '', homeDirectory) : root,\n        name,\n      );\n      // A channel admitting a folder by name gets a host workspace; a sandboxed one is not that.\n      if (byName && admitted.sandbox !== undefined)\n        throw new Error(\n          `Workspace '${admitted.name ?? admitted.id}' runs in a sandbox and cannot be admitted by name.`,\n        );\n      return admitted;\n    },\n    dormantSessions: () => dormantSessions(),\n    reviveSession: (sessionId) => reviveSession(sessionId),\n    onWorkspaceRemoved: (workspaceId) => {\n      workspaces.remove(workspaceId);\n      bundler.forgetScope(`workspace:${workspaceId}`);\n      webCompositions?.remove({ scope: 'workspace', workspaceId });\n      webCompositions?.removeNative({ scope: 'workspace', workspaceId });\n    },\n    createSession: async (request, placement) => {\n      if (placement === undefined) return openSession(request);\n      // A workspace package's top-level session must run in a checkout of that same workspace.\n      if (checkoutWorkspaceId(workspaces.list(), request.cwd) !== placement.workspaceId)\n        throw new Error('The session directory is outside this workspace.');\n      return openSession(request, undefined, placement.workspaceId);\n    },\n    sessionReservations: {\n      read(id, parentSessionId) {\n        if (!cockpit) throw new Error('Session setup is not ready.');\n        return cockpit.sessionReservations.read(id, parentSessionId);\n      },\n      async prepare(id, parentSessionId, cwd) {\n        if (!cockpit) throw new Error('Session setup is not ready.');\n        return cockpit.sessionReservations.prepare(id, parentSessionId, cwd);\n      },\n      async complete(id, parentSessionId) {\n        if (!cockpit) throw new Error('Session setup is not ready.');\n        return cockpit.sessionReservations.complete(id, parentSessionId);\n      },\n    },\n    onNotice: notice,\n    hubToken: () => attachToken,\n    requestSessionApi: (scope, request) => requestSessionApi(scope, request),\n    unservedWorkspaceApi: (workspaceId, basePath) => unservedWorkspaceApi(workspaceId, basePath),\n    ...(computerUse === undefined ? {} : { computerUse }),\n  });\n  // A contained server holds no credentials: its sessions call models through the host's gateway.\n  const modelGateway: ModelGatewayContainer | undefined =\n    sandboxIdentity === undefined ? undefined : createModelGatewayContainer({ hub });\n  /** Assigned once the global builds can be read: a mirror's compositions come from the global composition. */\n  let publishMirrorCompositions: (\n    sessionId: string,\n  ) => Pick<HeadlessHubSession, 'webComposition' | 'nativeComposition'> = () => ({});\n  let hostModels: Promise<HostModelGateway | undefined> | undefined;\n  if (sandboxIdentity === undefined)\n    router = createSandboxRouter({\n      hub,\n      sandboxes,\n      workspaces: () => workspaces.list(),\n      announceWorkspace: (workspaceId) => refreshWorkspace(workspaceId),\n      sessionCompositions: (sessionId) => publishMirrorCompositions(sessionId),\n      forgetCompositions: (sessionId) => {\n        webCompositions?.remove({ scope: 'session', sessionId });\n        webCompositions?.removeNative({ scope: 'session', sessionId });\n      },\n      // The host's own models and credentials, created once the first container needs them.\n      modelGateway: () =>\n        (hostModels ??= createHostModelGateway(piAgentDirectory(baseEnvironment, homeDirectory), homeDirectory).catch(\n          (error: unknown) => {\n            notice(\n              `The host models for sandboxes could not load: ${error instanceof Error ? error.message : String(error)}`,\n            );\n            hostModels = undefined;\n            return undefined;\n          },\n        )),\n      // Host sessions closed while the link was down, and leftovers of an interrupted switch, follow on each link.\n      onLinked: (workspaceId) => {\n        // A start, or a failure reported earlier, is over once the sandbox answers.\n        const transition = sandboxTransitions.get(workspaceId)?.sandboxState;\n        if (transition === 'starting' || transition === 'failed') sandboxTransitions.delete(workspaceId);\n        refreshWorkspace(workspaceId);\n        const provider = handoffProviderOf(workspaceId);\n        const workspace = workspaces.list().find((entry) => entry.id === workspaceId);\n        if (provider === undefined || workspace === undefined || handoff === undefined) return;\n        void handoff\n          .retry(workspace, provider)\n          .catch((error: unknown) =>\n            notice(`Workspace '${workspaceId}' handover retry failed: ${errorMessage(error)}`),\n          );\n      },\n      onNotice: notice,\n    });\n  if (router !== undefined) {\n    const linkedRouter = router;\n    handoff = createSandboxSessionHandoff({\n      host: { poHome: poHomeDirectory(homeDirectory, baseEnvironment), agentDir: path.dirname(serverDirectory) },\n      openSessions,\n      savedSessionIds: async (workspace) =>\n        (\n          await listSavedSessionRecords(\n            platform.sessions,\n            workspace.root,\n            new Set(hub.snapshot().map((active) => active.id)),\n            workspace.id,\n          )\n        ).map((saved) => saved.summary.id),\n      // A session the hub let go of still runs until its host has closed.\n      isLive: (sessionId) => hub.session(sessionId) !== undefined || baseSessionManager.get(sessionId) !== undefined,\n      adopt: (workspaceId, record) => linkedRouter.adoptSession(workspaceId, record),\n      onNotice: notice,\n    });\n  }\n  /** Started by the idle restart once the server is serving; until then a restart waits. */\n  let requestRestart: (() => void) | undefined;\n  const idleRestart = createIdleRestart({\n    ...testIdleRestartOverrides(baseEnvironment),\n    busy: async () => {\n      // A container session's turn is not visible here, and a host restart drops its mirror: count it as busy.\n      if (recovering || (router?.mirrors().length ?? 0) > 0) return true;\n      const hosts = sessionManager.sessions();\n      // Running runners (open terminals) and subagents block like a turn: a restart kills them.\n      const working = hosts.some((host) => {\n        const root = sessionServiceRoots.get(host);\n        const service = root === undefined ? undefined : readPoBackgroundWorkService(root);\n        return service !== undefined && holdsRestart(service.snapshot());\n      });\n      if (working) return true;\n      const states = await Promise.all(hosts.map((host) => host.runtime.readState()));\n      return states.some((state) => state.isStreaming || state.isCompacting);\n    },\n    restart: () => requestRestart?.(),\n    onError: (error) => notice(`Idle restart check failed: ${error instanceof Error ? error.message : String(error)}`),\n  });\n  // Any hub event may be the end of a turn, so it re-arms a pending restart's debounce.\n  const stopIdleRestartPoke = hub.onEvent(() => idleRestart.poke());\n  const stopPersistSessionNames = hub.onEvent((event) => {\n    if (event.kind !== 'upsert') return;\n    const record = openSessions.list().find((entry) => entry.sessionId === event.session.id);\n    const groups = event.session.groups ?? [];\n    const sameGroups =\n      groups.length === (record?.groups ?? []).length &&\n      groups.every((group, index) => record?.groups?.[index] === group);\n    if (record === undefined || (record.name === event.session.name && sameGroups)) return;\n    openSessions.add({ ...record, name: event.session.name, groups });\n  });\n  let harnessContext: Awaited<ReturnType<typeof buildHarnessContext>> | undefined;\n  let launchWorkspaceId: string | undefined;\n  let cockpit: Awaited<ReturnType<typeof serveHeadlessServer>> | undefined;\n  let attachToken: string | undefined;\n  let webCompositions: ReturnType<typeof createWebCompositions> | undefined;\n  const stopResourceMonitor = monitorRuntimeResources({\n    record: (attributes) => telemetry.recordEvent('po_server.resources', attributes),\n    counts: () => {\n      const budget = executionBudget.getSnapshot();\n      return {\n        sessions: sessionManager.sessions().length,\n        running_jobs: budget.running,\n        queued_jobs: budget.queued,\n        job_limit: budget.limit,\n        superseded_module_count: idleRestart.supersededCount(),\n        idle_restart_pending_age_ms: idleRestart.pendingAgeMs(),\n      };\n    },\n    warn: notice,\n  });\n\n  try {\n    await telemetry.runInSpan('po_server.startup', {}, async () => {\n      const token = fs.readFileSync(options.tokenFile, 'utf8').trim();\n      if (!token) throw new Error('The attach token file is empty.');\n      attachToken = token;\n\n      const resolved = resolveSessionIdentity(options.agentArgs, {\n        sessionId: options.sessionId ?? crypto.randomUUID(),\n        sessionName: options.sessionName,\n      });\n\n      const globalRoot = globalPoConfigDirectory(homeDirectory);\n      const publicationDirectory = path.join(globalRoot, 'server');\n      await reapAbandonedPublications(platform.env(baseCwd), publicationDirectory, processIsAlive).catch(\n        (error: unknown) =>\n          notice(`Abandoned publication cleanup failed: ${error instanceof Error ? error.message : String(error)}`),\n      );\n      webCompositions = createWebCompositions(publicationDirectory, notice, {\n        pid: nodeHost.processId(),\n        startedAt: Date.now(),\n      });\n      /** Assigned once every scope can be checked; a sync that exits sooner is picked up then. */\n      let pickUpSync: () => Promise<void> = async () => undefined;\n      // Sync is the only producer of artifacts; this server starts it in the background and\n      // reads what it prepared. PO_AUTO_SYNC=0 turns that off.\n      const backgroundSync = createBackgroundSync({\n        environment: baseEnvironment,\n        onNotice: notice,\n        onExit: () => pickUpSync(),\n        // The host serves a contained workspace's web and native UI, so its sync builds only packages.\n        ...(sandboxIdentity === undefined ? {} : { skipArtifactBuilds: true }),\n      });\n      const syncCheckpoints = createSyncCheckpoints({\n        globalRoot,\n        homeDirectory,\n        environment: baseEnvironment,\n        background: backgroundSync,\n        onNotice: notice,\n      });\n      // A manual `po sync` moves the pointer without this server's background sync exiting, and\n      // names each app bundle it exported from a source checkout in `app-<platform>.json`.\n      watcher.add({\n        path: path.dirname(syncPointerPath(globalRoot)),\n        include: (file) => file === path.basename(syncPointerPath(globalRoot)) || /^app-[a-z]+\\.json$/u.test(file),\n      });\n      /** What the root opened without: packages that do not resolve yet and web plugins with no slot. */\n      const unsyncedOf = (root: string): string[] => {\n        try {\n          const compositions = bundler.compositions(root);\n          const unslotted =\n            webBuild === undefined ? [] : unslottedWebPackages(webBuild, compositionPackageRoots(compositions));\n          return [...new Set([...unsyncedSelectors(compositions), ...unslotted])];\n        } catch (error) {\n          notice(`'${root}' sync state could not be read: ${error instanceof Error ? error.message : String(error)}`);\n          return [];\n        }\n      };\n      const workspaceLabel = (root: string, name?: string) => `Workspace '${name ?? path.basename(root)}'`;\n      /** A checkpoint: request a background sync when the root changed since the last one, and warn. */\n      const syncCheckpoint = (root: string, label: string, request = true) =>\n        syncCheckpoints.check({ root, label, unsynced: unsyncedOf(root) }, request);\n      let webBuild: GlobalWebBuildRecord | undefined;\n      /**\n       * Publishes one mount out of the current global build, naming only the plugin slots its root\n       * resolves. A session mount passes its major mode, so it names only that mode's slots.\n       */\n      const publishWebMount = (\n        mount: ScopeMount | { scope: 'session'; sessionId: string },\n        root: string,\n        majorMode?: string,\n      ) =>\n        webBuild === undefined\n          ? undefined\n          : webCompositions?.publish(\n              mount,\n              webBuild,\n              hub.channelTypes(),\n              mountWebPluginSlots(webBuild, bundler.packageRoots(root, majorMode)),\n            );\n      let nativeBuild: GlobalNativeBuildRecord | undefined;\n      /** Publishes one mount's native composition out of the current global native build. */\n      const publishNativeMount = (\n        mount: ScopeMount | { scope: 'session'; sessionId: string },\n        root: string,\n        majorMode?: string,\n      ) =>\n        nativeBuild === undefined\n          ? undefined\n          : webCompositions?.publishNative(\n              mount,\n              nativeBuild,\n              hub.channelTypes(),\n              mountNativePluginIds(nativeBuild, bundler.packageRoots(root, majorMode)),\n            );\n      publishSessionCompositions = (sessionId, root, majorMode) => ({\n        webComposition: publishWebMount({ scope: 'session', sessionId }, root, majorMode),\n        nativeComposition: publishNativeMount({ scope: 'session', sessionId }, root, majorMode),\n      });\n      // A container session's checkout is never read on the host, so its plugins come from the global composition.\n      publishMirrorCompositions = (sessionId) => ({\n        webComposition: publishWebMount({ scope: 'session', sessionId }, globalRoot),\n        nativeComposition: publishNativeMount({ scope: 'session', sessionId }, globalRoot),\n      });\n      const pickUpWebBuild = createKeyedPickup(\n        (key) => readGlobalWebBuildRecord(globalRoot, key),\n        (build, key) => {\n          notice(`Publishing global web build ${key}.`);\n          webBuild = build;\n          webCompositions?.publishShell(build);\n        },\n      );\n      const pickUpNativeBuild = createKeyedPickup(\n        (key) => readGlobalNativeBuildRecord(globalRoot, key),\n        (build, key) => {\n          notice(`Publishing global native build ${key}.`);\n          nativeBuild = build;\n        },\n      );\n      /** The keys these roots derive the way sync does, each only when its build exists. */\n      const ownBuildKeys = (): { webKey?: string; nativeKey?: string } => {\n        const pluginRoots = globalWebPluginRoots(globalRoot, homeDirectory, baseEnvironment, notice);\n        const web = readGlobalWebBuildStatus({ poHome: globalRoot, pluginRoots, environment: baseEnvironment });\n        const native = readGlobalNativeBuildStatus({ poHome: globalRoot, pluginRoots });\n        return {\n          ...(web.status === 'current' ? { webKey: web.key } : {}),\n          ...(native.status === 'current' ? { nativeKey: native.key } : {}),\n        };\n      };\n      const currentBuildKeys = () => {\n        const pointer = readSyncPointer(globalRoot);\n        return syncedBuildKeys({\n          pointer,\n          ownsPointer: syncCheckpoints.ownsPointer(pointer),\n          published: { web: webBuild !== undefined, native: nativeBuild !== undefined },\n          ownKeys: ownBuildKeys,\n          newestWebKey: () => newestGlobalWebBuildKey(globalRoot),\n        });\n      };\n      /**\n       * Read-only: picks up the global web and native builds sync's pointer names, publishing\n       * the shell only when a key changed, then republishes every shared mount. Never builds;\n       * a missing build leaves the previous one serving. Clients pick a new composition up at\n       * their next refreshWebPluginCompositions.\n       */\n      const refreshWebBuild = (): void => {\n        const keys = currentBuildKeys();\n        if (pickUpNativeBuild(keys.nativeKey) === 'missing')\n          notice(`The global native build ${String(keys.nativeKey)} is missing; run po sync.`);\n        if (pickUpWebBuild(keys.webKey) === 'missing')\n          notice(`The global web build ${String(keys.webKey)} is missing; run po sync.`);\n        const mounts = hub\n          .workspaces()\n          .filter(servedOnHost)\n          .map((workspace) => ({\n            root: workspace.root,\n            mount: { scope: 'workspace', workspaceId: workspace.id } as const,\n          }));\n        for (const publish of [publishNativeMount, publishWebMount]) {\n          publish({ scope: 'global' }, globalRoot);\n          for (const { root, mount } of mounts) publish(mount, root);\n        }\n        for (const platform of NATIVE_APP_PLATFORMS) {\n          const app = readNativeAppBuild(globalRoot, platform);\n          if (app !== undefined) webCompositions?.publishApp(platform, app);\n        }\n      };\n      const loadComposition = async (\n        root: string,\n        scope: 'global' | 'workspace' | 'session',\n        selection?: { root: string; majorMode: string; activeLayers: string[] },\n      ) => {\n        const selected = selection ?? bundler.defaultSelection(root);\n        return telemetry.runInSpan('po_server.composition_load', { scope }, async () =>\n          loadServerPackages(scope, {\n            entries: await bundler.packageEntries(root),\n            majorMode: selected.majorMode,\n            activeLayers: selected.activeLayers,\n            retainCandidates: scope === 'session',\n            onNotice: notice,\n            poisoned: bundler.poisoned,\n            importer: bundler.importer,\n          }),\n        );\n      };\n      type ScopeMount = { scope: 'global' } | { scope: 'workspace'; workspaceId: string };\n      const scopeKey = (mount: ScopeMount) => (mount.scope === 'global' ? 'global' : `workspace:${mount.workspaceId}`);\n      const scopeChecks = new Map<string, Promise<void>>();\n      /**\n       * The reload check for one served global or workspace scope: recompute its package URLs\n       * and, only when they changed, load the new set and install it. Unchanged URLs come from\n       * the module cache and the scope skips them, so only changed packages import and restart;\n       * a package no longer selected stays installed. A scope this server has not served yet is\n       * left to its admission. Checks of one scope run one at a time; a changed package whose\n       * new build fails gets its previous build back, and the check retries next time. Runs on a\n       * watched change, a finished sync and an upm change, never on the session path.\n       */\n      const checkScope = (root: string, mount: ScopeMount): Promise<void> => {\n        const key = scopeKey(mount);\n        const run = (scopeChecks.get(key) ?? Promise.resolve()).then(async () => {\n          // A sync that finished since the last check may name new builds without touching packages.\n          try {\n            refreshWebBuild();\n          } catch (error) {\n            notice(`Web build check failed: ${error instanceof Error ? error.message : String(error)}`);\n          }\n          const change = await bundler.diffScope(key, root, mount.scope);\n          if (\n            change.first ||\n            (change.changed.length === 0 && change.reselected.length === 0 && change.removed.length === 0)\n          )\n            return;\n          const bundle = await loadComposition(root, mount.scope);\n          await hub.installPackages(mount, bundle.packages);\n          bundler.commitScope(key, root, mount.scope, bundle.entries);\n          idleRestart.supersede(change.superseded);\n          publishWebMount(mount, root);\n          publishNativeMount(mount, root);\n          notice(\n            `Reloaded ${mount.scope === 'global' ? 'global' : `workspace '${mount.workspaceId}'`} packages (${String(change.changed.length)} changed, ${String(change.removed.length)} no longer selected).`,\n          );\n        });\n        const settled = run.catch((error: unknown) =>\n          notice(\n            `Extension check of ${key} failed and retries at the next check: ${error instanceof Error ? error.message : String(error)}`,\n          ),\n        );\n        scopeChecks.set(key, settled);\n        void settled.then(() => {\n          if (scopeChecks.get(key) === settled) scopeChecks.delete(key);\n        });\n        return settled;\n      };\n      const loadSessionMcp = async (\n        root: string,\n        selection: { majorMode: string; activeLayers: readonly string[] },\n      ): Promise<LoadedMcpPlugins> => {\n        return telemetry.runInSpan('po_server.mcp_bundle_load', {}, async () => {\n          const { candidates, entries } = await bundler.mcpEntries(root);\n          let app: ReturnType<typeof readMcpAppBuild>;\n          try {\n            app = readMcpAppBuild({ poHome: globalRoot, candidates });\n          } catch (error) {\n            notice(`The MCP app build could not be read: ${error instanceof Error ? error.message : String(error)}`);\n          }\n          if (app !== undefined && app.build === undefined) {\n            notice(`MCP app build ${app.key} is not synced yet; this session runs without MCP widgets.`);\n            syncCheckpoints.requestMissing(`mcp-app:${app.key}`, 'the MCP app build is missing');\n          }\n          const built = app?.build;\n          return loadMcpPlugins({\n            entries,\n            ...(built === undefined ? {} : { uiResource: mcpUiResource(built.html, built.sha256) }),\n            majorMode: selection.majorMode,\n            activeLayers: selection.activeLayers,\n            retainCandidates: true,\n            onNotice: notice,\n            poisoned: bundler.poisoned,\n            importer: bundler.importer,\n          });\n        });\n      };\n      const sharedApiContext = {\n        homeDirectory,\n        environment: baseEnvironment,\n        hubToken: token,\n        sessionService: hub.sessionService,\n        mediaArbitration,\n        executionBudget,\n        peerAgents,\n        directEvents: hub.directEvents,\n        requestApi: (mount: Parameters<HeadlessHub['requestApi']>[0], basePath: string, request: Request) =>\n          hub.requestApi(mount, basePath, request),\n        // Listed for settings, sandboxed ones too, so a switched-on workspace can be switched off again. Host packages\n        // still never resolve a sandboxed checkout to run anything in it (`resolveRepository` below).\n        repositories: () =>\n          hub.workspaces().map((workspace) => ({\n            id: workspace.id,\n            path: workspace.root,\n            name: workspace.root.split('/').at(-1) ?? workspace.id,\n            active: hub.snapshot().some((session) => session.workspaceId === workspace.id),\n          })),\n        resolveRepository: (id: string) =>\n          hub.workspaces().find((workspace) => workspace.id === id && workspace.sandbox === undefined)?.root,\n        // Read per call: the listener starts after the global scope is served.\n        serverOrigin: () => {\n          if (cockpit === undefined) throw new Error('The headless server is not listening yet.');\n          return cockpit.url;\n        },\n        /**\n         * Package readiness and the MCP projection, resolved live from the repository. The\n         * context stays until the next read replaces it: the projection names its staged files.\n         */\n        readRepositorySync: async (id: string) => {\n          const workspace = hub.workspaces().find((candidate) => candidate.id === id);\n          if (workspace?.sandbox !== undefined)\n            throw new Error('A sandboxed workspace is prepared inside its sandbox, not on the host.');\n          const root = workspace?.root;\n          if (!root) return undefined;\n          const environment = rootEnvironment(root);\n          const config = loadMajorModesConfig(root, homeDirectory, environment);\n          const missing = missingLayerPackageSpecifiers(\n            config,\n            Object.keys(config.layers),\n            createLayerResolvers(root, environment),\n          );\n          const context = await buildHarnessContext(\n            resolveHarnessOptions({ args: ['--cwd', root], cwd: root, environment }),\n          );\n          const previous = repositoryContexts.get(root);\n          repositoryContexts.set(root, context);\n          await previous?.cleanup().catch((error: unknown) => notice(String(error)));\n          const status = syncCheckpoint(\n            root,\n            workspaceLabel(root, hub.workspaces().find((workspace) => workspace.id === id)?.name),\n            false,\n          );\n          return {\n            fresh: missing.length === 0 && status.reasons.length === 0,\n            reasons: [\n              ...missing.map((specifier) => `configured package is not installed: ${specifier}`),\n              ...status.reasons,\n            ],\n            syncing: status.syncing,\n            mcpProjection: context.resources.mcpProjection,\n          };\n        },\n        onNotice: notice,\n        ...(computerUse?.permissions === undefined\n          ? {}\n          : {\n              desktopPermissions: {\n                authorize: (headers: Headers, change: boolean) =>\n                  computerUse.authorizePermissions?.(headers, change) === true,\n                request: (permission?: string) => computerUse.permissions!(permission),\n              },\n            }),\n      };\n      /**\n       * A sandboxed workspace's settings, answered on the host while it serves no scope for it, so the person can\n       * still see and change them and switch the sandbox off. Reading and writing its `.po` YAML is data only: the host\n       * never loads its composition, runs git or executes anything from it. Closed once it runs on the host again.\n       */\n      const sandboxedSettings = new Map<string, { root: string; handler: PoApiHandler; release: () => void }>();\n      const releaseSandboxedSettings = (workspaceId: string): void => {\n        sandboxedSettings.get(workspaceId)?.release();\n        sandboxedSettings.delete(workspaceId);\n      };\n      unservedWorkspaceApi = (workspaceId, basePath) => {\n        const record = workspaces.list().find((workspace) => workspace.id === workspaceId);\n        const held = sandboxedSettings.get(workspaceId);\n        if (held !== undefined && (record?.sandbox === undefined || held.root !== record.root))\n          releaseSandboxedSettings(workspaceId);\n        if (basePath !== SETTINGS_API || record?.sandbox === undefined) return undefined;\n        const current = sandboxedSettings.get(workspaceId);\n        if (current !== undefined) return current.handler;\n        const env = platform.env(record.root);\n        const handler = createSettingsApi(env).start({\n          ...sharedApiContext,\n          scope: 'workspace',\n          workspaceId,\n          workspaceRoot: record.root,\n          cwd: record.root,\n          resolveRepository: () => undefined,\n        });\n        sandboxedSettings.set(workspaceId, {\n          root: record.root,\n          handler,\n          release: () => {\n            handler.close();\n            void env.cleanup(BACKGROUND_CONTEXT).catch((error: unknown) => notice(String(error)));\n          },\n        });\n        return handler;\n      };\n      stopSandboxWatches.push(() => {\n        for (const workspaceId of sandboxedSettings.keys()) releaseSandboxedSettings(workspaceId);\n      });\n      fs.mkdirSync(globalRoot, { recursive: true, mode: 0o700 });\n      const globalBundle = await loadComposition(globalRoot, 'global');\n      // A contained server has no remote access or native push: its host owns both.\n      if (sandboxIdentity === undefined) {\n        remoteRuntime = createRemoteRuntime({\n          homeDirectory,\n          registrationToken: token,\n          onTunnelIntentChanged: (intent) => {\n            recoveryTunnel = intent;\n            persistRecovery();\n          },\n          onDeviceDropped: (id) => computerUse?.revokeDevice?.(id),\n          reservedPorts: () => [options.webPort],\n          bundleTrust: () => webCompositions?.shellTrust(),\n          attestHost: (fields) => webCompositions?.attestHost(fields),\n          onNotice: notice,\n          forward: async (request) => {\n            if (!cockpit || !attachToken)\n              return Response.json({ error: 'The headless server is not ready.' }, { status: 503 });\n            const from = new URL(request.url);\n            const headers = new Headers(request.headers);\n            headers.set('x-po-token', attachToken);\n            return fetch(\n              new URL(`${from.pathname}${from.search}`, cockpit.url),\n              new Request(request, { headers, redirect: 'manual' }),\n            );\n          },\n          acceptProtocol: (pathname, link, deviceId) => {\n            if (!cockpit) throw new Error('The headless protocol listener is not ready.');\n            return cockpit.acceptProtocol(pathname, link, {\n              'x-po-api-caller-locality': 'remote',\n              'x-po-api-caller-device-id': deviceId,\n              'x-po-api-caller-step-up': 'not-required',\n            });\n          },\n        });\n        const pushCredentials = await loadNativePushCredentials(baseEnvironment, platform.env(baseCwd), notice);\n        const pushSender = createNativePushSender({\n          ...pushCredentials,\n          diagnostic: ({ provider, outcome, status, reason }) =>\n            notice(\n              `Native push ${provider}: ${outcome}${status === undefined ? '' : ` ${status}`}${reason ? ` ${reason}` : ''}.`,\n            ),\n        });\n        stopNativePush = subscribeNativePush(hub, remoteRuntime.remote, pushSender, notice);\n      }\n      try {\n        // The hub resets its global scope when serving fails, so any retry must bind the registry again.\n        const globalScope = await hub.sessionParentScope(undefined);\n        // Only the long-lived hub that owns the Po home runs sandboxes: a one-shot automation run binds no registry,\n        // so no provider starts a container lifecycle or a clean-stop hook that would stop shared containers.\n        if (automation === undefined) await globalScope.bind(PO_WORKSPACE_SANDBOXES_CONTRACT, sandboxes);\n        if (sandboxIdentity !== undefined) await globalScope.bind(PO_SANDBOX_IDENTITY_CONTRACT, sandboxIdentity);\n        await globalScope.bind(PO_REMOTE_ORIGIN_CONTRACT, {\n          current: () => remoteRuntime?.remote.publicOrigin(),\n          revision: () => remoteRuntime?.remote.publicOriginRevision() ?? 0,\n        });\n        await hub.serveScope(\n          {\n            ...sharedApiContext,\n            scope: 'global',\n            requestReceipts: requestReceipts.receipts,\n            ...(sandboxIdentity === undefined\n              ? { remoteControl: { fetch: (request: Request) => remoteRuntime!.fetchLocal(request) } }\n              : {}),\n          },\n          globalBundle.packages,\n        );\n      } finally {\n        sandboxes.close();\n        sandboxProvidersSettled = true;\n      }\n      // Each provider's own changes (its engine check, a container starting or failing) reach clients live.\n      for (const provider of sandboxes.list())\n        if (provider.onStatusChange !== undefined) stopSandboxWatches.push(provider.onStatusChange(refreshWorkspaces));\n      bundler.commitScope('global', globalRoot, 'global', globalBundle.entries);\n      refreshWebBuild();\n      syncCheckpoint(globalRoot, 'The global scope');\n      // Server start covers app launch and Po updates: sync exits at once when nothing changed.\n      if (!backgroundSync.syncing) backgroundSync.request('server start');\n      const admissions = new Map<string, Promise<HeadlessWorkspace & { available: boolean }>>();\n      // A member checkout is any checkout other than its workspace root, such as a worktree.\n      const isMemberCheckout = (from: string, workspace: { root: string }): boolean =>\n        resolveWorkspaceRoot(from) !== workspace.root;\n      admitWorkspace = async (from, requestedName) => {\n        if (!fs.statSync(from, { throwIfNoEntry: false })?.isDirectory()) throw new Error(`Folder not found: ${from}`);\n        const checkoutRoot = resolveWorkspaceRoot(from);\n        // A sandboxed workspace is registered and nothing else: the host never reads or writes its marker (it lives\n        // behind the repository's `.git` pointer, which the sandbox controls), loads its composition, or serves its\n        // scope. It is available only while the host is linked to its sandbox, which then runs its sessions. An\n        // exact root match is settled before the marker is read.\n        const admitSandboxed = (sandboxed: WorkspaceRecord): HeadlessWorkspace & { available: boolean } => {\n          const requested = requestedName?.trim() || undefined;\n          const record =\n            requested === undefined || requested === sandboxed.name ? sandboxed : { ...sandboxed, name: requested };\n          // The stored sandbox survives: `add` keeps it when the incoming record omits the key.\n          if (record !== sandboxed)\n            workspaces.add({\n              id: record.id,\n              root: record.root,\n              ...(record.name === undefined ? {} : { name: record.name }),\n            });\n          const available = router?.connected(record.id) === true;\n          const entry = { ...hubEntry(record, available), available };\n          const known = hub.workspaces().find((workspace) => workspace.id === record.id);\n          if (\n            known === undefined ||\n            (known.available !== false) !== available ||\n            known.name !== entry.name ||\n            known.sandbox !== entry.sandbox ||\n            !sameSandboxStatus(known, entry)\n          ) {\n            if (known === undefined) notice(`Workspace '${record.id}' runs in sandbox '${String(record.sandbox)}'.`);\n            hub.registerWorkspace(entry);\n          }\n          return entry;\n        };\n        const sandboxedHere = workspaces\n          .list()\n          .find((workspace) => workspace.sandbox !== undefined && workspace.root === checkoutRoot);\n        if (sandboxedHere !== undefined) return admitSandboxed(sandboxedHere);\n        // Ids are persisted, never re-derived from the path: a checkout of an admitted repository\n        // joins its workspace, and a repository that moved keeps its id and sessions.\n        const { id, root, moved } = identifyWorkspace({\n          records: workspaces.list(),\n          checkoutRoot,\n          marker: readWorkspaceMarker(checkoutRoot),\n        });\n        const record = workspaces.list().find((workspace) => workspace.id === id);\n        if (record?.sandbox !== undefined) return admitSandboxed(record);\n        // A name given now replaces the stored one; readmitting without a name keeps it.\n        const name = requestedName?.trim() || record?.name;\n        const named = name === undefined ? {} : { name };\n        const renamed = record !== undefined && name !== record.name;\n        const existing = hub.workspaces().find((workspace) => workspace.id === id);\n        if (existing !== undefined && existing.available !== false && existing.root === root) {\n          syncCheckpoint(root, workspaceLabel(root, name));\n          if (renamed) {\n            workspaces.add({ id, root, ...named });\n            hub.registerWorkspace(hubEntry({ id, root, ...named }, true));\n          }\n          return { ...existing, ...named, available: true };\n        }\n        const pending = admissions.get(id);\n        if (pending) return pending;\n        const wasRemembered = record !== undefined;\n        if (!wasRemembered || moved || renamed) workspaces.add({ id, root, ...named });\n        if (moved) notice(`Workspace '${id}' moved to '${root}'.`);\n        hub.registerWorkspace(hubEntry({ id, root, ...named }, false));\n        const admission = (async () => {\n          // Admission only reads what sync prepared; a package it has not prepared yet is left\n          // out with a warning and a background sync, and mounts when that sync finishes.\n          const bundle = await loadComposition(root, 'workspace');\n          await hub.serveScope(\n            {\n              ...sharedApiContext,\n              scope: 'workspace',\n              workspaceId: id,\n              workspaceRoot: root,\n              cwd: root,\n              resolveRepository: (requestedId) => (requestedId === id ? root : undefined),\n            },\n            bundle.packages,\n          );\n          servedWorkspaces.add(id);\n          bundler.commitScope(`workspace:${id}`, root, 'workspace', bundle.entries);\n          // A missing web build leaves the workspace usable; the next checkpoint picks one up.\n          try {\n            refreshWebBuild();\n            publishWebMount({ scope: 'workspace', workspaceId: id }, root);\n            publishNativeMount({ scope: 'workspace', workspaceId: id }, root);\n          } catch (error) {\n            notice(\n              `Workspace '${id}' web build check failed: ${error instanceof Error ? error.message : String(error)}`,\n            );\n          }\n          syncCheckpoint(root, workspaceLabel(root, name));\n          // Serving the scope registered it without its sandbox state.\n          refreshWorkspace(id);\n          try {\n            if (readWorkspaceMarker(root) === undefined) writeWorkspaceMarker(root, id);\n          } catch (error) {\n            notice(\n              `Workspace '${root}' id could not be recorded in its git data: ${error instanceof Error ? error.message : String(error)}`,\n            );\n          }\n          return { id, root, ...named, available: true };\n        })();\n        admissions.set(id, admission);\n        try {\n          return await admission;\n        } catch (error) {\n          if (!wasRemembered) {\n            await hub.removeWorkspace(id);\n            workspaces.remove(id);\n          }\n          throw error;\n        } finally {\n          admissions.delete(id);\n        }\n      };\n      for (const record of openSessions.list()) {\n        if (workspaces.list().some((workspace) => workspace.id === record.workspaceId)) continue;\n        try {\n          const candidate = record.groupingRoot ?? record.cwd;\n          const root = resolveWorkspaceRoot(candidate);\n          // The recorded id is kept as is. It may be a legacy path hash, and journals, open-session\n          // records and MCP audiences all refer to it.\n          if (\n            (record.groupingRoot === undefined || root === candidate) &&\n            !workspaces.list().some((workspace) => workspace.root === root)\n          )\n            workspaces.add({ id: record.workspaceId, root });\n          else\n            notice(\n              `Session '${record.sessionId}' no longer resolves to its recorded workspace; skipping registration.`,\n            );\n        } catch (error) {\n          notice(\n            `Session '${record.sessionId}' workspace could not be registered: ${error instanceof Error ? error.message : String(error)}`,\n          );\n        }\n      }\n      for (const workspace of workspaces.list()) {\n        hub.registerWorkspace(hubEntry(workspace, false));\n        try {\n          // A sandboxed workspace is never resolved here; admission registers it unavailable.\n          const root = workspace.sandbox === undefined ? resolveWorkspaceRoot(workspace.root) : workspace.root;\n          if (root !== workspace.root) {\n            notice(\n              `Workspace '${workspace.root}' no longer resolves to its recorded identity; leaving it unavailable.`,\n            );\n            continue;\n          }\n          await admitWorkspace(workspace.root);\n        } catch (error) {\n          notice(\n            `Workspace '${workspace.root}' could not be restored: ${error instanceof Error ? error.message : String(error)}`,\n          );\n        }\n      }\n\n      const sessionHostOptions = (\n        context: Awaited<ReturnType<typeof buildHarnessContext>>,\n        bundle: LoadedServerPackages,\n        mcpBundle: LoadedMcpPlugins,\n        identity: {\n          sessionId: string;\n          sessionName: string;\n          parentSessionId?: string;\n          sessionProvenance?: string;\n        },\n        workspace: { id: string; root: string },\n        explicit: {\n          pinned: readonly PinnedSelectionAxis[];\n          minorModes?: readonly string[];\n          allowedTools?: readonly string[];\n          initialFastMode?: boolean;\n          initialAgentLocked?: boolean;\n          resume?: boolean;\n        } = { pinned: [] },\n      ): HeadlessSessionHostOptions => {\n        const policyOptions = context.options;\n        const sessionSelection = {\n          root: policyOptions.repoRoot,\n          majorMode: policyOptions.majorMode,\n          activeLayers: context.selectedLayers,\n          domains: policyOptions.domains,\n          profile: context.profile,\n          state: { 'minor-mode': [...(explicit.minorModes ?? [])] },\n        };\n        // Composed from this session's own root, environment and selection, never from the\n        // process, and without the bootstrap: no PO_COMPOSED, no composition claim.\n        const sessionEnvironment = context.environment;\n        // The prompt-cache namespace keys on this, so publish it before the host reads the state.\n        updateHarnessState(\n          {\n            compositionFingerprint: resolveExtensionComposition({\n              majorMode: policyOptions.majorMode,\n              layers: [...context.selectedLayers],\n              majorModesConfig: loadMajorModesConfig(\n                policyOptions.configRoot ?? policyOptions.repoRoot,\n                homeDirectory,\n                sessionEnvironment,\n              ),\n              resolvers: createLayerResolvers(policyOptions.configRoot ?? policyOptions.repoRoot, sessionEnvironment),\n              tolerateUnsynced: true,\n            }).fingerprint,\n          },\n          sessionEnvironment,\n        );\n        return {\n          cwd: policyOptions.cwd,\n          repoRoot: policyOptions.repoRoot,\n          platform,\n          sessionId: identity.sessionId,\n          workspaceId: workspace.id,\n          groupingRoot: workspace.root,\n          sessionName: identity.sessionName,\n          ...(explicit.initialFastMode === undefined ? {} : { initialFastMode: explicit.initialFastMode }),\n          ...(explicit.initialAgentLocked === undefined ? {} : { initialAgentLocked: explicit.initialAgentLocked }),\n          ...(explicit.resume ? { resume: true } : {}),\n          ...(identity.parentSessionId === undefined ? {} : { parentSessionId: identity.parentSessionId }),\n          ...(identity.sessionProvenance === undefined ? {} : { sessionProvenance: identity.sessionProvenance }),\n          agentArgs: policyOptions.piArgs,\n          environment: Object.freeze({ ...context.environment }),\n          selection: sessionSelection,\n          ...(explicit.allowedTools === undefined ? {} : { allowedTools: explicit.allowedTools }),\n          selectionOverrides: (['majorMode', 'domains', 'profile'] as const).filter((axis) => {\n            if (explicit.pinned.includes(axis)) return true;\n            const flag = axis === 'majorMode' ? '--major-mode' : `--${axis}`;\n            return (\n              identity.sessionId === resolved.identity.sessionId &&\n              resolved.agentArgs.some((arg) => arg === flag || arg.startsWith(`${flag}=`))\n            );\n          }),\n          inheritedSelection: () => {\n            const environment = { ...baseEnvironment };\n            for (const key of [HARNESS_STATE_POINTER, ...Object.values(HARNESS_STATE_KEYS)]) delete environment[key];\n            const defaults = resolveHarnessOptions({\n              args: ['--cwd', policyOptions.cwd],\n              cwd: policyOptions.cwd,\n              environment,\n              ...(policyOptions.configRoot === undefined ? {} : { configRoot: policyOptions.configRoot }),\n            });\n            return { majorMode: defaults.majorMode, domains: defaults.domains, profile: defaults.profile };\n          },\n          candidates: bundle.entries,\n          providerOverrides: () => selectedServerProviderOverrides(bundle.packages, sessionEnvironment),\n          mcpPlugins: mcpBundle.plugins,\n          ...(modelGateway === undefined\n            ? {}\n            : { modelDependencies: (hostOptions) => modelGateway.modelDependencies(hostOptions) }),\n          resolveSelection: (requested) => {\n            const config = loadMajorModesConfig(\n              policyOptions.configRoot ?? policyOptions.repoRoot,\n              policyOptions.homeDirectory,\n              policyOptions.environment ?? baseEnvironment,\n            );\n            return {\n              ...requested,\n              activeLayers: resolveLayers(config, requested.majorMode),\n            };\n          },\n          telemetry,\n          onNotice: notice,\n        };\n      };\n\n      mountSessionApis = async (sessionOptions, host) =>\n        serveSessionApis({\n          // Workspace and global contracts reach the session's packages as native services.\n          parentScope: await hub.sessionParentScope(sessionOptions.workspaceId),\n          sessionId: sessionOptions.sessionId,\n          platform,\n          cwd: sessionOptions.cwd,\n          environment: sessionOptions.environment,\n          directEvents: hub.directEvents,\n          requestApi: (mount, basePath, request) => hub.requestApi(mount, basePath, request),\n          publishActivity: (activity) => hub.setSessionActivity?.(sessionOptions.sessionId, activity),\n          // Read per call: shares follow the remote runtime's current tunnel.\n          shareFile: (filePath, label) =>\n            remoteRuntime === undefined\n              ? Promise.reject(new Error(PO_SHARE_FILE_REMOTE_OFF_MESSAGE))\n              : remoteRuntime.fileShares.mint({\n                  sessionId: sessionOptions.sessionId,\n                  cwd: sessionOptions.cwd,\n                  path: filePath,\n                  label,\n                }),\n          ...(computerUse === undefined\n            ? {}\n            : {\n                computerUse: {\n                  get available() {\n                    return computerUse.available;\n                  },\n                  get enabled() {\n                    return computerUse.enabled === true;\n                  },\n                  authorize: (headers: Headers) =>\n                    computerUse.authorizeSession?.(sessionOptions.sessionId, headers) === true ||\n                    computerUse.authorize?.(headers) === true,\n                  authorizeRecording: (headers: Headers) =>\n                    computerUse.authorizeRecording?.(sessionOptions.sessionId, headers) === true,\n                  authorizeActivation: (headers: Headers) => computerUse.authorizeActivation?.(headers) === true,\n                  claim: (headers?: Headers) => computerUse.claimSession?.(sessionOptions.sessionId, headers),\n                  fetchRecording: (artifactId: string, range: string) =>\n                    computerUse.readRecording?.(\n                      { sessionId: sessionOptions.sessionId, cwd: sessionOptions.cwd },\n                      artifactId,\n                      range,\n                    ) ?? Promise.resolve(Response.json({ error: 'Not found.' }, { status: 404 })),\n                  subscribe: (listener: () => void) =>\n                    computerUse.subscribe?.(listener, sessionOptions.sessionId) ?? (() => undefined),\n                },\n              }),\n          hubToken: token,\n          sessionService: hub.sessionService,\n          mediaArbitration,\n          executionBudget,\n          editPresence: hub.editPresence,\n          peerAgents,\n          pluginRegistry: hub.pluginRegistry,\n          apis: [],\n          packages: pendingSessions.get(sessionOptions.sessionId)?.bundle.packages ?? [],\n          workspaceId: sessionOptions.workspaceId,\n          // The checkout, which MCP authorizes against; sessionContext carries both roots.\n          workspaceRoot: sessionOptions.repoRoot,\n          ...(host.sessionContext === undefined ? {} : { sessionContext: host.sessionContext }),\n          homeDirectory,\n          mountChannel: (channel) => {\n            const dispose = hub.registerChannel(channel, { scope: 'session', sessionId: sessionOptions.sessionId });\n            return { mounted: true, dispose };\n          },\n          preparePackages: (root) => {\n            sessionServiceRoots.set(host, root);\n            host.preparePackages(root);\n          },\n          activatePackages: host.activatePackages,\n          canDispatch: host.canDispatch,\n          telemetry,\n          onNotice: notice,\n        });\n\n      requestSessionApi = async (scope, request) => {\n        // A container session's panels call the container's own HTTP API, with its token.\n        if (router?.mirror(scope.sessionId) !== undefined) return router.requestSessionApi(scope, request);\n        const session = hub.session(scope.sessionId);\n        const artifacts = sessionArtifacts.get(scope.sessionId);\n        if (session === undefined || session.cwd !== scope.cwd || artifacts === undefined)\n          return Response.json({ error: 'Session not found.' }, { status: 404 });\n        if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(request.basePath))\n          return Response.json({ error: 'Invalid session API base path.' }, { status: 400 });\n        if (!request.path.startsWith('/') || request.path.startsWith('//') || request.path.includes('#'))\n          return Response.json({ error: 'Invalid session API path.' }, { status: 400 });\n        const body = request.body === null || request.body === undefined ? undefined : request.body;\n        return artifacts.apis.request(\n          new Request(`http://po.local/api/plugins/${request.basePath}${request.path}`, {\n            method: request.method,\n            headers: request.headers,\n            ...(body === undefined ? {} : { body }),\n            ...(request.signal === undefined ? {} : { signal: request.signal }),\n          }),\n        );\n      };\n\n      // An unclean boot restores recorded identities, never an extra random launch session.\n      if (!options.noSession && recycled === undefined) {\n        const initialOptions = resolveHarnessOptions({\n          args: resolved.agentArgs,\n          cwd: baseCwd,\n          environment: baseEnvironment,\n        });\n        const initialWorkspace = await admitWorkspace(initialOptions.repoRoot);\n        launchWorkspaceId = initialWorkspace.id;\n        // A sandboxed folder's launch session runs in its sandbox; nothing below may run on the host.\n        if (initialWorkspace.sandbox !== undefined) {\n          if (router === undefined) throw new Error(SANDBOX_UNREACHABLE);\n          // The model, thinking level and selection the launch arguments ask for go with it.\n          await router.openSession(initialWorkspace.id, {\n            cwd: baseCwd,\n            name: resolved.identity.sessionName,\n            signal,\n            ...launchSessionRequest(resolved.agentArgs, initialOptions),\n          });\n        } else {\n          harnessContext = await buildHarnessContext(\n            resolveHarnessOptions({ args: resolved.agentArgs, cwd: baseCwd, environment: baseEnvironment }),\n            harnessTelemetry,\n          );\n          const activeHarnessContext = harnessContext;\n          try {\n            const initialBundle = await loadComposition(harnessContext.options.repoRoot, 'session', {\n              root: harnessContext.options.repoRoot,\n              majorMode: harnessContext.options.majorMode,\n              activeLayers: harnessContext.selectedLayers,\n            });\n            const initialMcpBundle = await loadSessionMcp(harnessContext.options.repoRoot, {\n              majorMode: harnessContext.options.majorMode,\n              activeLayers: harnessContext.selectedLayers,\n            });\n            pendingSessions.set(resolved.identity.sessionId, {\n              cleanup: () => activeHarnessContext.cleanup(),\n              bundle: initialBundle,\n              mcpBundle: initialMcpBundle,\n            });\n            const created = await hub.create(\n              sessionHostOptions(harnessContext, initialBundle, initialMcpBundle, resolved.identity, initialWorkspace),\n            );\n            recordLiveSession(created, harnessContext.options.repoRoot, initialWorkspace.root);\n          } catch (error) {\n            pendingSessions.delete(resolved.identity.sessionId);\n            await activeHarnessContext.cleanup().catch((cleanupError: unknown) => notice(String(cleanupError)));\n            throw error;\n          }\n          await bounded(harnessTelemetry.flush(), 'initial composition telemetry flush', notice);\n        }\n      }\n\n      const reservedOpens = new Map<string, Promise<PoHubSessionScope>>();\n      /**\n       * The sandboxed workspace this session would join, decided before any host preparation. The\n       * inherited workspace (placement or parent link) wins; otherwise the checkout's own root is\n       * matched without reading its marker, and only then the marker names an owner.\n       */\n      const sandboxedWorkspaceOf = (\n        request: PoHubSessionCreateRequest,\n        groupingWorkspaceId?: string,\n      ): string | undefined => {\n        const records = workspaces.list();\n        const inherited =\n          groupingWorkspaceId ??\n          (request.parentSessionId\n            ? (hub.session(request.parentSessionId)?.workspaceId ??\n              [...openSessions.list(), ...(router?.dormant() ?? [])].find(\n                (record) => record.sessionId === request.parentSessionId,\n              )?.workspaceId)\n            : undefined);\n        const owner = inherited ?? checkoutWorkspaceId(records, request.cwd);\n        return records.find((record) => record.id === owner && record.sandbox !== undefined)?.id;\n      };\n      openSession = async (request, sessionId, groupingWorkspaceId) => {\n        request.signal?.throwIfAborted();\n        // A sandboxed workspace's sessions run in its sandbox: the host prepares nothing and records nothing.\n        const sandboxed = sandboxedWorkspaceOf(request, groupingWorkspaceId);\n        if (sandboxed !== undefined) {\n          if (router === undefined) throw new Error(SANDBOX_UNREACHABLE);\n          return router.openSession(sandboxed, request, sessionId);\n        }\n        if (\n          request.workflowContext !== undefined &&\n          (request.reservationId !== undefined ||\n            sessionId !== undefined ||\n            request.parentSessionId !== request.workflowContext.run.ownerSessionId ||\n            request.sessionProvenance !== WORKFLOW_STEP_SESSION_PROVENANCE)\n        ) {\n          throw new Error('Workflow context requires a new, unreserved step session owned by its workflow session.');\n        }\n        if (request.reservationId !== undefined) {\n          if (!request.parentSessionId || !cockpit) throw new Error('A reserved session requires its owning parent.');\n          const prepared = await cockpit.sessionReservations.prepare(\n            request.reservationId,\n            request.parentSessionId,\n            request.cwd,\n          );\n          if (sessionId !== undefined && sessionId !== prepared.sessionId)\n            throw new Error('Reserved session identity cannot change.');\n          sessionId = prepared.sessionId;\n          const existing = hub.session(sessionId);\n          if (existing) {\n            if (existing.cwd !== prepared.cwd || existing.parentSessionId !== request.parentSessionId)\n              throw new Error('Reserved session target does not match.');\n            return { sessionId, cwd: existing.cwd, workspaceId: existing.workspaceId };\n          }\n          if (openSessions.list().some((record) => record.sessionId === sessionId))\n            throw new Error('Resume the recorded session instead of recreating it.');\n          const pending = reservedOpens.get(sessionId);\n          if (pending) return pending;\n          request = { ...request, cwd: prepared.cwd };\n        }\n        const identity = {\n          sessionId: sessionId ?? crypto.randomUUID(),\n          sessionName: request.name,\n          parentSessionId: request.parentSessionId,\n          sessionProvenance: request.sessionProvenance,\n        };\n        // Membership follows the parent link, whatever the session is called or wherever its\n        // checkout lives. Without a known parent, the checkout's own identity decides.\n        const inheritedWorkspaceId =\n          groupingWorkspaceId ??\n          (request.parentSessionId\n            ? (hub.session(request.parentSessionId)?.workspaceId ??\n              openSessions.list().find((record) => record.sessionId === request.parentSessionId)?.workspaceId)\n            : undefined);\n        const explicit = sessionSelectionArgs(request);\n        const openStartedAt = Date.now();\n        const start = (async (): Promise<PoHubSessionScope> => {\n          // Snapshot only for creation. Explicit-ID resumes retain their own durable Fast state.\n          const parent =\n            request.parentSessionId !== undefined && (sessionId === undefined || request.reservationId !== undefined)\n              ? sessionManager.get(request.parentSessionId)\n              : undefined;\n          let initialFastMode: boolean | undefined;\n          if (parent !== undefined) {\n            const state = await parent.runtime.readState();\n            if (typeof state.fastMode !== 'boolean') throw new Error('Parent Fast mode must be a boolean.');\n            initialFastMode = state.fastMode;\n          }\n          const childIdentity = resolveSessionIdentity([], identity);\n          const childEnvironment = { ...baseEnvironment, ...request.environment };\n          for (const key of [HARNESS_STATE_POINTER, ...Object.values(HARNESS_STATE_KEYS)]) delete childEnvironment[key];\n          // The workspace is settled first: a member checkout reads its workspace's configuration.\n          const workspace =\n            inheritedWorkspaceId === undefined\n              ? await admitWorkspace(request.cwd)\n              : hub\n                  .workspaces()\n                  .find((candidate) => candidate.id === inheritedWorkspaceId && candidate.available !== false);\n          if (workspace === undefined) throw new Error('The session workspace is unavailable.');\n          if (workspace.sandbox !== undefined) throw new Error(SANDBOX_UNREACHABLE);\n          // Shared scopes reload on watched changes, never here. The session's own packages, MCP\n          // plugins and Pi factories load below from the current URLs; running sessions keep\n          // the set they were created with until restarted.\n          syncCheckpoint(globalRoot, 'The global scope');\n          if (inheritedWorkspaceId !== undefined)\n            // Without an inherited workspace, admitWorkspace above already ran this checkpoint.\n            syncCheckpoint(workspace.root, workspaceLabel(workspace.root, workspace.name));\n          // A member checkout composes from its workspace's configuration.\n          const member = isMemberCheckout(request.cwd, workspace);\n          const childContext = await buildHarnessContext(\n            resolveHarnessOptions({\n              args: ['--cwd', request.cwd, ...childIdentity.agentArgs, ...explicit.args],\n              cwd: request.cwd,\n              environment: childEnvironment,\n              ...(member ? { configRoot: workspace.root } : {}),\n            }),\n            harnessTelemetry,\n          );\n          try {\n            // A member checkout (a worktree) has no node_modules or builds of its own, so its\n            // packages, local ones included, load from the workspace checkout that sync prepared.\n            const compositionRoot = childContext.options.configRoot ?? childContext.options.repoRoot;\n            const bundle = await loadComposition(compositionRoot, 'session', {\n              root: compositionRoot,\n              majorMode: childContext.options.majorMode,\n              activeLayers: childContext.selectedLayers,\n            });\n            const mcpBundle = await loadSessionMcp(compositionRoot, {\n              majorMode: childContext.options.majorMode,\n              activeLayers: childContext.selectedLayers,\n            });\n            request.signal?.throwIfAborted();\n            pendingSessions.set(identity.sessionId, {\n              cleanup: () => childContext.cleanup(),\n              bundle,\n              mcpBundle,\n            });\n            const created = await hub.create({\n              ...sessionHostOptions(childContext, bundle, mcpBundle, identity, workspace, {\n                pinned: explicit.pinned,\n                ...(initialFastMode === undefined ? {} : { initialFastMode }),\n                ...(request.reservationId === undefined ? {} : { initialAgentLocked: true }),\n                ...(sessionId !== undefined && request.reservationId === undefined ? { resume: true } : {}),\n                ...(request.selection?.minorModes === undefined ? {} : { minorModes: request.selection.minorModes }),\n                ...(request.tools === undefined ? {} : { allowedTools: request.tools }),\n              }),\n              ...(request.workflowContext === undefined ? {} : { workflowContext: request.workflowContext }),\n            });\n            request.signal?.throwIfAborted();\n            recordLiveSession(created, childContext.options.repoRoot, workspace.root);\n            return { sessionId: identity.sessionId, cwd: childContext.options.cwd, workspaceId: created.workspaceId };\n          } catch (error) {\n            if (hub.session(identity.sessionId)) await hub.closeSession(identity.sessionId);\n            else {\n              pendingSessions.delete(identity.sessionId);\n              await childContext.cleanup().catch((cleanupError: unknown) => notice(String(cleanupError)));\n            }\n            throw error;\n          }\n        })();\n        void start\n          .then(\n            () => 'success',\n            () => 'failure',\n          )\n          .then((outcome) =>\n            telemetry.recordEvent('po_server.session_open', { duration_ms: Date.now() - openStartedAt, outcome }),\n          )\n          .catch((error: unknown) => rawNotice(`session open telemetry failed: ${String(error)}`));\n        if (request.reservationId !== undefined) reservedOpens.set(identity.sessionId, start);\n        try {\n          return await start;\n        } finally {\n          if (reservedOpens.get(identity.sessionId) === start) reservedOpens.delete(identity.sessionId);\n        }\n      };\n      // A contained server's host creates and closes its sessions over the protocol socket.\n      if (sandboxIdentity !== undefined)\n        registerContainedSessionMethods(hub.pluginRegistry, {\n          open: (request, sessionId) => openSession(request, sessionId),\n          close: (sessionId, keepDormant) =>\n            hub.closeSession(sessionId, keepDormant ? { keepDormant: true } : undefined),\n          // A host session the host moved in here after closing it: listed dormant, like one closed here.\n          adopt: async (record) => {\n            if (record.workspaceId !== sandboxIdentity.workspaceId)\n              throw new Error('The adopted session belongs to another workspace.');\n            if (hub.session(record.sessionId) !== undefined) return;\n            if (!openSessions.add(record)) throw new Error('The adopted session could not be durably recorded.');\n            hub.notifyDormantChanged(record.sessionId);\n          },\n        });\n      // The checkpoint for package installs and removals (upm add/remove), finished syncs and\n      // watched changes: every root recomputes, and each scope re-imports only moved URLs.\n      const checkAllScopes = async (): Promise<void> => {\n        bundler.invalidate();\n        syncCheckpoints.invalidate();\n        await checkScope(globalRoot, { scope: 'global' });\n        for (const workspace of hub.workspaces())\n          if (servedOnHost(workspace))\n            await checkScope(workspace.root, { scope: 'workspace', workspaceId: workspace.id });\n      };\n      onExtensionCheck?.(checkAllScopes);\n      /**\n       * A finished background sync goes through the same live reload: the read-only refresh\n       * republishes a changed build, and each scope re-imports only packages whose URLs moved.\n       * Session packages and the MCP app switch at the next session. The warnings are re-read\n       * without requesting another sync, so a sync that could not fix a root never loops.\n       */\n      pickUpSync = async () => {\n        await checkAllScopes();\n        syncCheckpoint(globalRoot, 'The global scope', false);\n        for (const workspace of hub.workspaces())\n          if (servedOnHost(workspace))\n            syncCheckpoint(workspace.root, workspaceLabel(workspace.root, workspace.name), false);\n      };\n      pickUpChange = () => {\n        void pickUpSync().catch((error: unknown) => notice(`Extension reload failed: ${String(error)}`));\n      };\n    });\n\n    const workspaceResumes = new Map<string, Promise<string>>();\n    // History is listed on every page view, so each unreadable file is reported once per server.\n    const reportedUnreadable = new Set<string>();\n    const unreadableHistory = (sessionId: string, error: unknown): void => {\n      if (reportedUnreadable.has(sessionId)) return;\n      reportedUnreadable.add(sessionId);\n      notice(\n        `Saved session ${sessionId} is hidden from History: ${error instanceof Error ? error.message : String(error)}`,\n      );\n    };\n    const savedHistory = async (workspaceId: string) => {\n      const root = hub.workspaces().find((workspace) => workspace.id === workspaceId && servedOnHost(workspace))?.root;\n      if (!root) throw new Error('Workspace not found.');\n      return listSavedSessionRecords(\n        platform.sessions,\n        root,\n        new Set(hub.snapshot().map((active) => active.id)),\n        workspaceId,\n        unreadableHistory,\n      );\n    };\n    const validateExecution = (target: SavedSessionExecution, workspaceId: string): void => {\n      const root = hub.workspaces().find((workspace) => workspace.id === workspaceId && servedOnHost(workspace))?.root;\n      if (!root || target.groupingRoot !== root || (target.workspaceId && target.workspaceId !== workspaceId))\n        throw new Error('Saved session does not belong to this workspace.');\n      if (resolveWorkspaceRoot(target.cwd) !== target.repoRoot)\n        throw new Error('Saved session checkout is unavailable.');\n    };\n    const reviving = new Map<string, Promise<void>>();\n    const reviveRecord = (record: OpenSessionRecord): Promise<void> => {\n      // A container session wakes in its container; its mirror appears once it runs.\n      if (router?.owns(record.sessionId) === true) return router.revive(record.sessionId);\n      const pending = reviving.get(record.sessionId);\n      if (pending) return pending;\n      if (sessionManager.get(record.sessionId)) return Promise.resolve();\n      // A record taken back from a sandbox whose folder was a container worktree.\n      if (!fs.existsSync(record.cwd)) return Promise.reject(new Error(CONTAINER_WORKTREE_GONE));\n      const opening = (async () => {\n        // A failed wake may be transient, for example while another server still\n        // owns the journal. Keep the record so the user can retry after resolving\n        // the conflict instead of losing the session from the cockpit.\n        const groupingRoot = hub\n          .workspaces()\n          .find((workspace) => workspace.id === record.workspaceId && workspace.available !== false)?.root;\n        if (!groupingRoot || (record.groupingRoot !== undefined && groupingRoot !== record.groupingRoot))\n          throw new Error('The session workspace is unavailable.');\n        if (record.repoRoot !== undefined && resolveWorkspaceRoot(record.cwd) !== record.repoRoot)\n          throw new Error('The session checkout has changed.');\n        await openSession(\n          {\n            cwd: record.cwd,\n            signal,\n            name: record.name,\n            ...(record.parentSessionId === undefined ? {} : { parentSessionId: record.parentSessionId }),\n            ...(record.sessionProvenance === undefined ? {} : { sessionProvenance: record.sessionProvenance }),\n          },\n          record.sessionId,\n          record.workspaceId,\n        );\n        // Groups edited while dormant live only on the record; the journal adopts them now.\n        const groups = record.groups ?? [];\n        const opened = hub.session(record.sessionId)?.groups ?? [];\n        if (groups.length !== opened.length || groups.some((group, index) => opened[index] !== group))\n          await hub.runtime(record.sessionId)?.setGroups(groups);\n      })();\n      reviving.set(record.sessionId, opening);\n      void opening.finally(() => reviving.delete(record.sessionId)).catch(() => undefined);\n      return opening;\n    };\n    /** Host records, then the dormant sessions each linked container lists. */\n    const allDormant = (): readonly OpenSessionRecord[] => [...openSessions.list(), ...(router?.dormant() ?? [])];\n    dormantSessions = allDormant;\n    reviveSession = (sessionId) => {\n      const record = allDormant().find((item) => item.sessionId === sessionId);\n      return record ? reviveRecord(record) : Promise.reject(new Error('The session has no saved record.'));\n    };\n    cockpit = await serveHeadlessServer({\n      port: options.webPort,\n      ...(options.host === undefined ? {} : { host: options.host }),\n      // A contained server answers only its host, which holds the token.\n      ...(sandboxIdentity === undefined\n        ? {}\n        : { publicRoutes: false, webSocketMaxPayload: CONTAINED_MAX_PAYLOAD_BYTES }),\n      headlessHub: hub,\n      token: attachToken,\n      sessionMcpPublicOrigin: () => remoteRuntime?.remote.publicOrigin(),\n      sessionMcpStateDir: serverDirectory,\n      sessionMcpPublicOriginRevision: () => remoteRuntime?.remote.publicOriginRevision() ?? 0,\n      isSessionPersisted: (sessionId, cwd) =>\n        openSessions.list().some((record) => record.sessionId === sessionId && record.cwd === cwd),\n      setWorkspaceSandbox: async (workspaceId, sandbox) => {\n        const record = workspaces.list().find((workspace) => workspace.id === workspaceId);\n        if (record === undefined) return { error: 'Workspace not found.' };\n        if (sandbox !== null && sandboxes.get(sandbox) === undefined)\n          return { error: `Sandbox provider '${sandbox}' is not registered.` };\n        // Refuse before any session moves: a sandbox that cannot start would strand them until it comes back.\n        const blocked =\n          sandbox === null || sandbox === record.sandbox ? undefined : sandboxes.get(sandbox)?.availability?.();\n        if (blocked !== undefined && !blocked.available) return { error: blocked.reason };\n        const previous = record.sandbox;\n        const switchingOff = previous !== undefined && previous !== (sandbox ?? undefined);\n        const switchingOn = sandbox !== null && sandbox !== previous;\n        const offProvider = switchingOff ? handoffProvider(sandboxes.get(previous)) : undefined;\n        const onProvider = switchingOn ? handoffProvider(sandboxes.get(sandbox)) : undefined;\n        const failed = (error: unknown): void => {\n          sandboxTransitions.set(workspaceId, { sandboxState: 'failed', sandboxReason: errorMessage(error) });\n          refreshWorkspace(workspaceId);\n        };\n        // Sessions follow the workspace out: the host lets go of its mirrors, the sandbox stops, and only then do its\n        // sessions move back to the host.\n        if (offProvider !== undefined && handoff !== undefined) {\n          sandboxTransitions.set(workspaceId, { sandboxState: 'stopping' });\n          refreshWorkspace(workspaceId);\n          try {\n            await router?.release(workspaceId);\n            for (const sessionId of await handoff.switchOff(record, offProvider)) hub.notifyDormantChanged(sessionId);\n          } catch (error) {\n            failed(error);\n            // Linked again if its sandbox still runs.\n            router?.start();\n            return { error: `The workspace's sessions could not leave its sandbox: ${errorMessage(error)}` };\n          }\n        }\n        sandboxTransitions.delete(workspaceId);\n        // Recorded before the handover, so no new session of the workspace starts on the host meanwhile.\n        workspaces.setSandbox(workspaceId, sandbox ?? undefined);\n        const updated = workspaces.list().find((workspace) => workspace.id === workspaceId) ?? record;\n        // A sandboxed workspace is unavailable on the host until its sandbox links. A cleared one is admitted again\n        // as a local workspace.\n        if (updated.sandbox !== undefined) {\n          if (onProvider !== undefined && handoff !== undefined)\n            sandboxTransitions.set(workspaceId, { sandboxState: 'starting' });\n          const entry = hubEntry(updated, router?.connected(workspaceId) === true);\n          hub.registerWorkspace(entry);\n          if (onProvider !== undefined && handoff !== undefined) {\n            // Saved host sessions and their records move into the sandbox, then it starts. Live host sessions follow\n            // as they close; the host scope stays for them, without reloads.\n            try {\n              for (const sessionId of await handoff.switchOn(updated, onProvider)) hub.notifySessionRemoved(sessionId);\n            } catch (error) {\n              failed(error);\n              return { error: `The workspace's sandbox did not start: ${errorMessage(error)}` };\n            }\n            // Starting until the host links to it, then running.\n            router?.start();\n          }\n          return { workspace: hub.workspaces().find((workspace) => workspace.id === workspaceId) ?? entry };\n        }\n        if (servedWorkspaces.has(workspaceId)) {\n          const entry = hubEntry(updated, true);\n          hub.registerWorkspace(entry);\n          return { workspace: entry };\n        }\n        // Registered unavailable first, so admission serves the scope instead of answering the sandboxed entry.\n        hub.registerWorkspace(hubEntry(updated, false));\n        const admitted = await admitWorkspace(updated.root);\n        return { workspace: hub.workspaces().find((workspace) => workspace.id === workspaceId) ?? admitted };\n      },\n      workspaceHistory: async (workspaceId) =>\n        router?.contains(workspaceId) === true\n          ? ((await router.history(workspaceId)) as Awaited<ReturnType<typeof savedHistory>>[number]['summary'][])\n          : (await savedHistory(workspaceId)).map((record) => record.summary),\n      resumeWorkspaceSession: async (workspaceId, targetSessionId) => {\n        if (router?.contains(workspaceId) === true) return router.resumeWorkspace(workspaceId, targetSessionId);\n        const key = `${workspaceId}\\0${targetSessionId}`;\n        const pending = workspaceResumes.get(key);\n        if (pending) return pending;\n        const resume = (async () => {\n          const target = (await savedHistory(workspaceId)).find((item) => item.summary.id === targetSessionId);\n          if (!target)\n            throw new Error('Saved Pi 1.0 session not found in this workspace. Earlier sessions cannot be resumed.');\n          if (!fs.existsSync(target.execution.cwd)) throw new Error(CONTAINER_WORKTREE_GONE);\n          validateExecution(target.execution, workspaceId);\n          await openSession(\n            {\n              cwd: target.execution.cwd,\n              name: target.summary.name ?? 'untitled',\n              ...(target.execution.parentSessionId ? { parentSessionId: target.execution.parentSessionId } : {}),\n              ...(target.execution.sessionProvenance ? { sessionProvenance: target.execution.sessionProvenance } : {}),\n            },\n            target.summary.id,\n            workspaceId,\n          );\n          return target.summary.id;\n        })();\n        workspaceResumes.set(key, resume);\n        try {\n          return await resume;\n        } finally {\n          workspaceResumes.delete(key);\n        }\n      },\n      sessionHistory: (session) => {\n        // A container session's history lives in its container.\n        if (router?.mirror(session.id) !== undefined)\n          return router.sessionHistory(session.id) as ReturnType<typeof listSavedSessions>;\n        const workspaceRoot = hub.workspaces().find((workspace) => workspace.id === session.workspaceId)?.root;\n        if (!workspaceRoot) throw new Error('Session workspace not found.');\n        return listSavedSessions(\n          platform.sessions,\n          workspaceRoot,\n          new Set(hub.snapshot().map((active) => active.id)),\n          session.workspaceId,\n          unreadableHistory,\n        );\n      },\n      readDormantTranscript: (record, request, context) => {\n        // A dormant container session's transcript is read in its container.\n        if (router?.owns(record.sessionId) === true) return router.readTranscript(record.sessionId, request);\n        const workspaceRoot = hub.workspaces().find((workspace) => workspace.id === record.workspaceId)?.root;\n        if (!workspaceRoot || (record.groupingRoot !== undefined && record.groupingRoot !== workspaceRoot))\n          throw new Error('Saved transcript unavailable.');\n        const owner = resolveWorkspaceRoot(record.cwd);\n        if (record.repoRoot !== undefined && record.repoRoot !== owner)\n          throw new Error('Saved transcript checkout has changed.');\n        return readSqliteTranscript(platform.sessions, record.sessionId, request, context, {\n          sessionId: record.sessionId,\n          workspaceRoot: owner,\n          workspaceId: record.workspaceId,\n          groupingRoot: workspaceRoot,\n        });\n      },\n      restartSession: async (session) => {\n        if (router?.mirror(session.id) !== undefined) {\n          await router.restart(session.id);\n          return;\n        }\n        const record = openSessions.list().find((entry) => entry.sessionId === session.id);\n        const workspaceRoot = hub\n          .workspaces()\n          .find((workspace) => workspace.id === session.workspaceId && workspace.available !== false)?.root;\n        if (!workspaceRoot) throw new Error('Session workspace not found.');\n        await hub.closeSession(session.id);\n        try {\n          await openSession(\n            {\n              cwd: session.cwd,\n              name: session.name,\n              ...(session.parentSessionId === undefined ? {} : { parentSessionId: session.parentSessionId }),\n              ...(session.sessionProvenance === undefined ? {} : { sessionProvenance: session.sessionProvenance }),\n            },\n            session.id,\n            session.workspaceId,\n          );\n        } catch (error) {\n          // The journal lease allows one writer, so the new host cannot open before the old\n          // one closes. Keep the closed session as dormant so it can be revived after a fix.\n          if (record !== undefined) openSessions.add(record);\n          throw error;\n        }\n      },\n      resumeSession: async (session, targetSessionId) => {\n        if (router?.mirror(session.id) !== undefined) return router.resume(session.id, targetSessionId);\n        const workspaceId = session.workspaceId;\n        if (!workspaceId || !hub.workspaces().some((workspace) => workspace.id === workspaceId))\n          throw new Error('Session workspace not found.');\n        const target = (await savedHistory(workspaceId)).find((item) => item.summary.id === targetSessionId);\n        if (!target)\n          throw new Error('Saved Pi 1.0 session not found in this workspace. Earlier sessions cannot be resumed.');\n        validateExecution(target.execution, workspaceId);\n        const closedRecord = openSessions.list().find((entry) => entry.sessionId === session.id);\n        await hub.closeSession(session.id);\n        try {\n          await openSession(\n            {\n              cwd: target.execution.cwd,\n              name: target.summary.name ?? 'untitled',\n              ...(target.execution.parentSessionId ? { parentSessionId: target.execution.parentSessionId } : {}),\n              ...(target.execution.sessionProvenance ? { sessionProvenance: target.execution.sessionProvenance } : {}),\n            },\n            target.summary.id,\n            workspaceId,\n          );\n        } catch (error) {\n          // Same as restart: the session given up for the resume stays revivable.\n          if (closedRecord !== undefined) openSessions.add(closedRecord);\n          throw error;\n        }\n        return target.summary.id;\n      },\n      dormantSessions: allDormant,\n      removeDormantSession: (record: OpenSessionRecord) => removeSessionOutputs(record.sessionId),\n      removeSessionFiles: removeSessionOutputs,\n      setDormantGroups: async (record: OpenSessionRecord, groups: readonly string[]) => {\n        if (router?.owns(record.sessionId) === true) return router.setDormantGroups(record.sessionId, groups);\n        if (!openSessions.add({ ...record, groups: [...groups] }))\n          throw new Error('The session groups could not be durably recorded.');\n      },\n      reviveSession: reviveRecord,\n      requestAsset: (request) => webCompositions?.request(request) ?? Promise.resolve(undefined),\n      compositions: () => {\n        // A sandboxed workspace has no host composition, and its folder is never read here.\n        const workspaces = hub.workspaces().filter((workspace) => workspace.sandbox === undefined);\n        const decision = {\n          cwd: baseCwd,\n          launchWorkspaceId,\n          workspaces,\n          homeDirectory,\n          environment: baseEnvironment,\n          notice,\n        };\n        return {\n          global: webCompositions?.get({ scope: 'global' }),\n          nativeGlobal: webCompositions?.getNative({ scope: 'global' }),\n          nativeApp: webCompositions?.apps(),\n          publicKey: webCompositions?.publicKey(),\n          shell: webCompositions?.shellTrust(),\n          template: resolveWebTemplateDecision(decision),\n          nativeTemplate: resolveWebTemplateDecision({ ...decision, host: 'native' }),\n          workspaces: hub.workspaces().map((workspace) =>\n            workspace.sandbox === undefined\n              ? {\n                  ...workspace,\n                  webComposition: webCompositions?.get({ scope: 'workspace', workspaceId: workspace.id }),\n                  nativeComposition: webCompositions?.getNative({ scope: 'workspace', workspaceId: workspace.id }),\n                }\n              : // Listed with no host plugins, so its sessions (mirrors with global compositions) still mount.\n                { ...workspace, webComposition: null, nativeComposition: null },\n          ),\n        };\n      },\n      telemetry,\n      onNotice: notice,\n    });\n    notice(`protocol on ${cockpit.url}/api/ws`);\n    // Containers that run or were taken back show their sessions, live and dormant, through mirrors.\n    router?.start();\n    let resolveShutdown!: (exitCode: number) => void;\n    const shutdown = new Promise<number>((resolve) => {\n      resolveShutdown = resolve;\n    });\n    requestRestart = () => {\n      // Only sessions live right now reopen; dormant ones stay dormant.\n      const ids = openSessions\n        .list()\n        .map((record) => record.sessionId)\n        .filter((id) => sessionManager.get(id) !== undefined);\n      try {\n        writeRecycleFile(serverDirectory, ids, {\n          crashRestores: restorePlan.crashRestores,\n          ...(recoveryTunnel === undefined ? {} : { tunnel: recoveryTunnel }),\n        });\n        persistRecovery = () => {};\n      } catch (error) {\n        notice(`Could not write the recycle file: ${error instanceof Error ? error.message : String(error)}`);\n      }\n      notice(`Restarting at idle to release superseded extension versions (${String(ids.length)} sessions reopen).`);\n      resolveShutdown(RESTART_EXIT_CODE);\n    };\n    persistRecovery();\n    if (restorePlan.blocked)\n      notice(\n        'Automatic crash restore paused after two attempts in 15 minutes. Sessions remain dormant; use Wake to retry.',\n      );\n    const stop = (): void => {\n      cleanShutdown = signal.reason !== 'crash';\n      resolveShutdown(0);\n    };\n    signal.addEventListener('abort', stop, { once: true });\n    if (signal.aborted) stop();\n    // Serial recovery starts only after listen. Wake joins the same per-session promise.\n    recovering = true;\n    const restoredSessions = reopenRecycledSessions(\n      serverDirectory,\n      async (sessionId) => {\n        if (signal.aborted || shuttingDown) return;\n        const record = openSessions.list().find((entry) => entry.sessionId === sessionId);\n        try {\n          if (record === undefined) throw new Error('its record is gone.');\n          await reviveRecord(record);\n        } catch (error) {\n          recoverySessionIds.delete(sessionId);\n          throw error;\n        } finally {\n          persistRecovery();\n        }\n      },\n      (sessionId, error) =>\n        notice(\n          `Session '${sessionId}' did not reopen after the restart: ${error instanceof Error ? error.message : String(error)}`,\n        ),\n      { sessionIds: restorePlan.sessionIds, removeAfter: false },\n    ).catch((error: unknown) => notice(`Crash restore failed: ${String(error)}`));\n    let restoredTunnel: Promise<unknown> | undefined;\n    if (recycled?.tunnel !== undefined && !signal.aborted) {\n      restoredTunnel = remoteRuntime\n        ?.restoreTunnel(recycled.tunnel)\n        .then((result) => {\n          if (!result.ok) notice(`Remote access did not restore: ${result.error}`);\n        })\n        .catch((error: unknown) => notice(`Remote access did not restore: ${String(error)}`))\n        .finally(() => {\n          recoveryTunnel = remoteRuntime?.tunnelIntent();\n          persistRecovery();\n        });\n    }\n    recoveryWork = Promise.allSettled([restoredSessions, restoredTunnel]).then(() => {\n      recovering = false;\n      idleRestart.poke();\n    });\n    if (automation !== undefined && !signal.aborted) {\n      void automation({\n        hub,\n        sessionHost: (sessionId) => sessionManager.get(sessionId),\n        openSession: (request) => openSession(request),\n        closeSession: (sessionId) => closeManagedSession(sessionId),\n        signal,\n      })\n        .then((exitCode) => resolveShutdown(exitCode))\n        .catch((error: unknown) => {\n          notice(`Native automation failed: ${error instanceof Error ? error.message : String(error)}`);\n          resolveShutdown(1);\n        });\n    }\n    try {\n      const exitCode = await shutdown;\n      if (exitCode === 0 && signal.reason !== 'crash') cleanShutdown = true;\n      return exitCode;\n    } finally {\n      signal.removeEventListener('abort', stop);\n    }\n  } finally {\n    shuttingDown = true;\n    persistRecovery = () => {};\n    const cleanUserStop = isCleanUserStop(cleanShutdown, signal);\n    // Started first so container stops overlap the rest of shutdown, and awaited before the global scope unloads.\n    const sandboxesStopped =\n      cleanUserStop && automation === undefined\n        ? withShutdownDeadline(\n            () => stopSandboxProviders(sandboxes.list(), notice),\n            'sandbox stop',\n            SANDBOX_STOP_DEADLINE_MS,\n          ).catch((error: unknown) =>\n            notice(`sandbox stop failed: ${error instanceof Error ? error.message : String(error)}`),\n          )\n        : Promise.resolve();\n    if (cleanUserStop) {\n      try {\n        removeRecycleFile(serverDirectory);\n      } catch (error) {\n        notice(`Could not remove crash recovery state: ${String(error)}`);\n      }\n    }\n    idleRestart.dispose();\n    stopIdleRestartPoke();\n    stopResourceMonitor();\n    executionBudget.close();\n    watcher.close();\n    stopPersistSessionNames();\n    stopNativePush?.();\n    for (const stop of stopSandboxWatches.splice(0)) stop();\n    modelGateway?.dispose();\n    clearInterval(eventLoopMonitor);\n    await bounded(telemetry.recordEvent('po_server.shutdown'), 'shutdown telemetry', notice);\n    await bounded(\n      withShutdownDeadline(() => cockpit?.close(), 'listener shutdown'),\n      'listener shutdown',\n      notice,\n    );\n    await bounded(remoteRuntime?.close() ?? Promise.resolve(), 'remote control shutdown', notice);\n    await bounded(\n      withShutdownDeadline(() => recoveryWork, 'crash recovery shutdown'),\n      'crash recovery shutdown',\n      notice,\n    );\n    // Session hooks and MCP owners must unwind before their shared hub services.\n    // Each session phase has its own deadline, so one stalled session cannot block the rest.\n    try {\n      await sessionManager.close();\n    } catch (error) {\n      notice(error instanceof Error ? error.message : String(error));\n    }\n    await bounded(router?.dispose() ?? Promise.resolve(), 'sandbox router shutdown', notice);\n    await sandboxesStopped;\n    await bounded(\n      withShutdownDeadline(() => hub.close(), 'hub shutdown'),\n      'hub shutdown',\n      notice,\n    );\n    await bounded(\n      withShutdownDeadline(() => requestReceipts.close(), 'receipt shutdown'),\n      'receipt shutdown',\n      notice,\n    );\n    await bounded(\n      withShutdownDeadline(() => computerUse?.close?.(), 'computer use shutdown'),\n      'computer use shutdown',\n      notice,\n    );\n    await bounded(\n      withShutdownDeadline(() => webCompositions?.close(), 'web composition shutdown'),\n      'web composition shutdown',\n      notice,\n    );\n    const pendingCleanups = [...pendingSessions.values()].map((setup) =>\n      bounded(\n        withShutdownDeadline(() => setup.cleanup(), 'pending session cleanup'),\n        'pending session cleanup',\n        notice,\n      ),\n    );\n    pendingSessions.clear();\n    await Promise.allSettled(pendingCleanups);\n    await Promise.allSettled(\n      [...repositoryContexts.values()].map((context) =>\n        bounded(context.cleanup(), 'repository context cleanup', notice),\n      ),\n    );\n    repositoryContexts.clear();\n    await bounded(harnessTelemetry.flush(), 'harness telemetry flush', notice);\n    await bounded(harnessTelemetry.shutdown(), 'harness telemetry shutdown', notice);\n    await bounded(telemetry.flush(), 'server telemetry flush', notice);\n    await bounded(telemetry.shutdown(), 'server telemetry shutdown', notice);\n  }\n}\n","import path from 'node:path';\n\nimport { defaultDomainsForMajorMode } from '@agimon-ai/po-config/domains';\n\nimport type { HarnessOutputFormat, HarnessPreset, ParsedHarnessArgs } from '../composition/types/harness';\nimport {\n  ADD_DIRECTORY_OPTION,\n  DEFAULT_MAJOR_MODE,\n  DOMAIN_OPTION,\n  DOMAINS_OPTION,\n  PO_PRESET_ENV,\n  MAJOR_MODE_OPTION,\n  matchesOption,\n  PROFILE_OPTION,\n  parseCsv,\n  parseMajorMode,\n  parseProfileValue,\n  REMOVED_LAYER_OPTION,\n  REMOVED_LAYERS_OPTION,\n  REMOVED_TARGET_OPTION,\n  readOption,\n  resolveAdditionalDirectories,\n  resolveInheritedMajorMode,\n  resolveInheritedProfile,\n} from './matrixOptions';\n\nconst KIMI_FOR_CODING = 'kimi-for-coding';\nconst KIMI_FOR_CODING_HIGHSPEED = 'kimi-for-coding-highspeed';\nconst KIMI_K2_6 = 'kimi-k2.6';\nconst DEFAULT_PRESET = 'default';\nconst KIMI_PRESET = 'kimi';\nconst KIMI_CODING_PREFIX = 'kimi-coding/';\nconst NATIVE_FORMAT = 'native';\nconst KIMI_CODE_MODEL_ENV = 'KIMI_CODE_MODEL';\nconst MODEL_OPTION = '--model';\nconst MODEL_SHORT_OPTION = '-m';\nconst MODE_OPTION = '--mode';\nconst THINKING_OPTION = '--thinking';\nconst PROFILES_OPTION = '--profiles';\nconst NO_DOMAINS_OPTION = '--no-domains';\nconst PRESET_OPTION = '--preset';\nconst EFFORT_OPTION = '--effort';\nconst OUTPUT_FORMAT_OPTION = '--output-format';\nconst VIBE_LINT_FORMAT = 'vibe-lint';\nconst STREAM_JSON_FORMAT = 'stream-json';\nconst JSON_FORMAT = 'json';\nconst EXPLAIN_OPTION = '--explain';\nconst EMIT_MCP_OPTION = '--emit-mcp';\nconst PLUGIN_DIRECTORY_OPTION = '--plugin-dir';\nconst CWD_OPTION = '--cwd';\nconst CD_OPTION = '--cd';\nconst ALLOW_PROTECTED_WRITES_OPTION = '--allow-protected-writes';\nconst MCP_OPTION = '--mcp';\nconst AGENTS_OPTION = '--agents';\nconst NO_MCP_OPTION = '--no-mcp';\nconst NO_AGENTS_OPTION = '--no-agents';\nconst VERBOSE_OPTION = '--verbose';\nconst DANGEROUSLY_SKIP_PERMISSIONS_OPTION = '--dangerously-skip-permissions';\nconst HELP_OPTION = '--help';\nconst HELP_SHORT_OPTION = '-h';\nconst VERSION_OPTION = '--version';\nconst VERSION_SHORT_OPTION = '-v';\n\nconst KIMI_ALIASES = new Map([\n  ['k2p5', KIMI_FOR_CODING],\n  ['k2p6', KIMI_FOR_CODING],\n  ['k2p7', KIMI_FOR_CODING],\n  ['kimi-k2.5', KIMI_FOR_CODING],\n  [KIMI_K2_6, KIMI_FOR_CODING],\n  ['kimi-k2.7-code', KIMI_FOR_CODING],\n  [KIMI_FOR_CODING, KIMI_FOR_CODING],\n  [KIMI_FOR_CODING_HIGHSPEED, KIMI_FOR_CODING_HIGHSPEED],\n]);\n\nfunction parsePreset(value: string): HarnessPreset {\n  if (value === DEFAULT_PRESET || value === KIMI_PRESET) return value;\n  throw new Error(`Unsupported preset: ${value}`);\n}\n\nfunction modelValue(args: string[]): { index: number; value: string; inline: boolean } | undefined {\n  for (let index = 0; index < args.length; index += 1) {\n    if (args[index] === MODEL_OPTION || args[index] === MODEL_SHORT_OPTION) {\n      const value = args[index + 1];\n      if (value) return { index, value, inline: false };\n    }\n    if (args[index]?.startsWith(`${MODEL_OPTION}=`)) {\n      return { index, value: args[index].slice(`${MODEL_OPTION}=`.length), inline: true };\n    }\n  }\n  return undefined;\n}\n\nfunction replaceModel(args: string[], value: string): void {\n  const selected = modelValue(args);\n  if (!selected) {\n    args.unshift(MODEL_OPTION, value);\n  } else if (selected.inline) {\n    args[selected.index] = `${MODEL_OPTION}=${value}`;\n  } else {\n    args[selected.index + 1] = value;\n  }\n}\n\nfunction normalizeProviderArgs(preset: HarnessPreset, piArgs: string[], environment: NodeJS.ProcessEnv): void {\n  const selected = modelValue(piArgs);\n  if (preset === KIMI_PRESET) {\n    const value = selected?.value ?? environment[KIMI_CODE_MODEL_ENV] ?? KIMI_FOR_CODING;\n    const unqualified = value.includes('/') ? value.slice(value.indexOf('/') + 1) : value;\n    replaceModel(piArgs, `${KIMI_CODING_PREFIX}${KIMI_ALIASES.get(unqualified) ?? unqualified}`);\n  }\n}\n\n/**\n * Answers `--help` and `--version` without reading the environment.\n *\n * The caller only looks at `help` and `version` for these, and never launches,\n * so the options carry defaults rather than a resolved matrix. This exists so a\n * stale export cannot break the one command that explains how to fix it.\n */\nfunction parseInformationalArgs(args: string[], currentDirectory: string): ParsedHarnessArgs | undefined {\n  const help = args.some((arg) => arg === HELP_OPTION || arg === HELP_SHORT_OPTION);\n  const version = args.some((arg) => arg === VERSION_OPTION || arg === VERSION_SHORT_OPTION);\n  if (!help && !version) return undefined;\n  return {\n    options: {\n      cwd: currentDirectory,\n      profile: undefined,\n      domains: [],\n      majorMode: DEFAULT_MAJOR_MODE,\n      explain: false,\n      emitMcp: undefined,\n      pluginDirectories: [],\n      additionalDirectories: [],\n      preset: DEFAULT_PRESET,\n      outputFormat: NATIVE_FORMAT,\n      allowProtectedWrites: false,\n      mcp: true,\n      agents: true,\n      piArgs: [],\n    },\n    help,\n    version,\n  };\n}\n\nexport function parseHarnessArgs(\n  args: string[],\n  environment: NodeJS.ProcessEnv = process.env,\n  currentDirectory = process.cwd(),\n  defaultMajorMode: string = DEFAULT_MAJOR_MODE,\n  defaultDomains?: readonly string[],\n  defaultProfile?: string,\n): ParsedHarnessArgs {\n  const informational = parseInformationalArgs(args, currentDirectory);\n  if (informational) return informational;\n\n  // An inherited profile wins: a nested run stays on the persona its parent\n  // chose rather than snapping back to the repository default.\n  let profile = resolveInheritedProfile(environment) ?? defaultProfile;\n  let profileProvided = false;\n  let majorMode = resolveInheritedMajorMode(environment, defaultMajorMode);\n  let majorModeProvided = false;\n  const domains: string[] = [];\n  // Directory options are collected verbatim and resolved once after the loop,\n  // so a relative path means the same thing regardless of where --cwd appears\n  // in the argument list.\n  const pluginDirectoryValues: string[] = [];\n  const additionalDirectoryValues: string[] = [];\n  const piArgs: string[] = [];\n  let cwd = currentDirectory;\n  let preset = parsePreset(environment[PO_PRESET_ENV] ?? DEFAULT_PRESET);\n  let outputFormat: HarnessOutputFormat = NATIVE_FORMAT;\n  let domainsDisabled = false;\n  let allowProtectedWrites = false;\n  let mcp = true;\n  let agents = true;\n  let help = false;\n  let version = false;\n  let explain = false;\n  let emitMcp: string | undefined;\n\n  for (let index = 0; index < args.length; index += 1) {\n    const arg = args[index]!;\n\n    if (matchesOption(arg, REMOVED_TARGET_OPTION)) {\n      throw new Error(`${REMOVED_TARGET_OPTION} was replaced by ${MAJOR_MODE_OPTION}`);\n    }\n    if (matchesOption(arg, REMOVED_LAYER_OPTION)) {\n      throw new Error(`${REMOVED_LAYER_OPTION} was replaced by ${MAJOR_MODE_OPTION}`);\n    }\n    if (matchesOption(arg, REMOVED_LAYERS_OPTION)) {\n      throw new Error(`${REMOVED_LAYERS_OPTION} was removed; select one major mode with ${MAJOR_MODE_OPTION}`);\n    }\n    if (matchesOption(arg, PROFILES_OPTION)) {\n      throw new Error(`${PROFILES_OPTION} was replaced by ${DOMAINS_OPTION}`);\n    }\n\n    const majorModeMatch = readOption(args, index, MAJOR_MODE_OPTION);\n    if (majorModeMatch) {\n      if (majorModeProvided) throw new Error(`${MAJOR_MODE_OPTION} can only be provided once`);\n      majorMode = parseMajorMode(majorModeMatch.value, MAJOR_MODE_OPTION);\n      majorModeProvided = true;\n      index = majorModeMatch.nextIndex;\n      continue;\n    }\n\n    const profileMatch = readOption(args, index, PROFILE_OPTION);\n    if (profileMatch) {\n      if (profileProvided) throw new Error(`${PROFILE_OPTION} can only be provided once`);\n      profile = parseProfileValue(profileMatch.value, PROFILE_OPTION);\n      profileProvided = true;\n      index = profileMatch.nextIndex;\n      continue;\n    }\n\n    const domainMatch = readOption(args, index, DOMAINS_OPTION) ?? readOption(args, index, DOMAIN_OPTION);\n    if (domainMatch) {\n      domains.push(...parseCsv(domainMatch.value));\n      index = domainMatch.nextIndex;\n      continue;\n    }\n\n    const emitMcpMatch = readOption(args, index, EMIT_MCP_OPTION);\n    if (emitMcpMatch) {\n      emitMcp = path.resolve(currentDirectory, emitMcpMatch.value);\n      index = emitMcpMatch.nextIndex;\n      continue;\n    }\n\n    const pluginDirectoryMatch = readOption(args, index, PLUGIN_DIRECTORY_OPTION);\n    if (pluginDirectoryMatch) {\n      pluginDirectoryValues.push(pluginDirectoryMatch.value);\n      index = pluginDirectoryMatch.nextIndex;\n      continue;\n    }\n\n    const addDirectoryMatch = readOption(args, index, ADD_DIRECTORY_OPTION);\n    if (addDirectoryMatch) {\n      additionalDirectoryValues.push(addDirectoryMatch.value);\n      index = addDirectoryMatch.nextIndex;\n      continue;\n    }\n\n    const presetMatch = readOption(args, index, PRESET_OPTION);\n    if (presetMatch) {\n      preset = parsePreset(presetMatch.value);\n      index = presetMatch.nextIndex;\n      continue;\n    }\n\n    const cwdMatch = readOption(args, index, CWD_OPTION) ?? readOption(args, index, CD_OPTION);\n    if (cwdMatch) {\n      cwd = path.resolve(currentDirectory, cwdMatch.value);\n      index = cwdMatch.nextIndex;\n      continue;\n    }\n\n    const effortMatch = readOption(args, index, EFFORT_OPTION);\n    if (effortMatch) {\n      if (effortMatch.inline) piArgs.push(`${THINKING_OPTION}=${effortMatch.value}`);\n      else piArgs.push(THINKING_OPTION, effortMatch.value);\n      index = effortMatch.nextIndex;\n      continue;\n    }\n\n    const outputFormatMatch = readOption(args, index, OUTPUT_FORMAT_OPTION);\n    if (outputFormatMatch) {\n      const requested = outputFormatMatch.value;\n      if (requested === VIBE_LINT_FORMAT) {\n        outputFormat = VIBE_LINT_FORMAT;\n      } else {\n        const mode = requested === STREAM_JSON_FORMAT ? JSON_FORMAT : requested;\n        if (outputFormatMatch.inline) piArgs.push(`${MODE_OPTION}=${mode}`);\n        else piArgs.push(MODE_OPTION, mode);\n      }\n      index = outputFormatMatch.nextIndex;\n      continue;\n    }\n\n    if (arg === NO_DOMAINS_OPTION) domainsDisabled = true;\n    else if (arg === EXPLAIN_OPTION) explain = true;\n    else if (arg === ALLOW_PROTECTED_WRITES_OPTION) allowProtectedWrites = true;\n    else if (arg === MCP_OPTION) mcp = true;\n    else if (arg === AGENTS_OPTION) agents = true;\n    else if (arg === NO_MCP_OPTION) mcp = false;\n    else if (arg === NO_AGENTS_OPTION) agents = false;\n    else if (arg === HELP_OPTION || arg === HELP_SHORT_OPTION) help = true;\n    else if (arg === VERSION_OPTION || arg === VERSION_SHORT_OPTION) version = true;\n    // Accepted for Claude Code compatibility and deliberately not forwarded.\n    else if (arg !== VERBOSE_OPTION && arg !== DANGEROUSLY_SKIP_PERMISSIONS_OPTION) piArgs.push(arg);\n  }\n\n  if (domainsDisabled && domains.length > 0) {\n    throw new Error(`${NO_DOMAINS_OPTION} cannot be combined with ${DOMAINS_OPTION}`);\n  }\n  if (!domainsDisabled && domains.length === 0 && pluginDirectoryValues.length === 0) {\n    domains.push(...defaultDomainsForMajorMode(majorMode, environment, defaultDomains));\n  }\n  normalizeProviderArgs(preset, piArgs, environment);\n\n  return {\n    options: {\n      cwd,\n      profile,\n      domains,\n      majorMode,\n      explain,\n      emitMcp,\n      pluginDirectories: pluginDirectoryValues.map((value) => path.resolve(currentDirectory, value)),\n      additionalDirectories: [\n        ...new Set([\n          ...resolveAdditionalDirectories(environment, currentDirectory),\n          ...additionalDirectoryValues.map((value) => path.resolve(currentDirectory, value)),\n        ]),\n      ],\n      preset,\n      outputFormat,\n      allowProtectedWrites,\n      mcp,\n      agents,\n      piArgs,\n    },\n    help,\n    version,\n  };\n}\n","import os from 'node:os';\nimport path from 'node:path';\n\nimport { loadPoConfig } from '@agimon-ai/po-config/config';\nimport { loadDomains } from '@agimon-ai/po-config/domains';\nimport { HARNESS_STATE_KEYS } from '@agimon-ai/po-config/harnessState';\nimport { loadMajorModesConfig } from '@agimon-ai/po-config/majorModes';\nimport { loadProfileCatalog } from '@agimon-ai/po-config/profiles';\nimport type { HarnessFailureReporter } from '@agimon-ai/po-core/runtimeLogSinkTelemetry';\n\nimport { readHarnessState } from '../composition/harnessState';\nimport { resolveWorkspaceRoot } from '../composition/repository';\nimport type { HarnessOptions } from '../composition/types/harness';\nimport { parseHarnessArgs } from './options';\n\nexport interface ResolveHarnessOptionsInput {\n  /** Raw launcher arguments, as the binary received them. */\n  args: readonly string[];\n  environment?: NodeJS.ProcessEnv;\n  cwd?: string;\n  /** Reads configuration from this root instead of the checkout's own. */\n  configRoot?: string;\n  /** Reports a malformed inherited harness state without failing the run. */\n  report?: HarnessFailureReporter;\n}\n\n/**\n * Settles the configuration root and the full option matrix for one run.\n *\n * Two passes are required: the first reads --cwd without touching repository\n * configuration, which keeps a run resolvable even when modes.yaml is\n * malformed, and the second applies the defaults that root supplies. An\n * inherited root wins, which is how a nested run stays pinned to the outer\n * repository rather than re-deriving one from its own cwd. When no configured\n * repository exists, the selected working directory is the configuration root.\n */\nexport function resolveHarnessOptions(input: ResolveHarnessOptionsInput): HarnessOptions {\n  const environment = input.environment ?? process.env;\n  const cwd = input.cwd ?? process.cwd();\n  const args = [...input.args];\n\n  const initial = parseHarnessArgs(args, environment, cwd);\n  const inheritedRoot = readHarnessState(environment, input.report).root;\n  const repoRoot = inheritedRoot ? path.resolve(inheritedRoot) : resolveWorkspaceRoot(initial.options.cwd);\n  const homeDirectory = initial.options.homeDirectory ?? environment.HOME ?? os.homedir();\n  const configRoot = input.configRoot ?? repoRoot;\n  const defaults = loadPoConfig(configRoot, homeDirectory, environment).selection;\n  const selectedEnvironment = { ...environment };\n  for (const axis of ['majorMode', 'domains', 'profile'] as const) {\n    const value = defaults?.[axis];\n    if (value !== undefined && selectedEnvironment[HARNESS_STATE_KEYS[axis]] === undefined)\n      selectedEnvironment[HARNESS_STATE_KEYS[axis]] = Array.isArray(value) ? value.join(',') : value;\n  }\n  const parsed = parseHarnessArgs(\n    args,\n    selectedEnvironment,\n    cwd,\n    loadMajorModesConfig(configRoot, homeDirectory, environment).defaultMajorMode,\n    loadDomains(configRoot, homeDirectory).defaultDomains,\n    loadProfileCatalog(configRoot, homeDirectory).defaultProfile,\n  );\n  return {\n    repoRoot,\n    ...(input.configRoot === undefined ? {} : { configRoot }),\n    ...parsed.options,\n    homeDirectory,\n    ...(input.environment === undefined ? {} : { environment: input.environment }),\n  };\n}\n","import type { ServeOptions } from '../../builders/server/types';\nexport type { ServeOptions } from '../../builders/server/types';\nexport {\n  resolveSessionIdentity,\n  relaunchAgentArgs,\n  type SessionIdentity,\n} from '../../builders/server/sessionArguments';\nconst TOKEN_FILE_OPTION = '--auth-token-file';\nconst WEB_OPTION = '--web';\nconst NAME_OPTION = '--name';\nconst SESSION_ID_OPTION = '--session-id';\nconst CONTAINED_OPTION = '--contained';\nconst WORKSPACE_ID_OPTION = '--workspace-id';\nconst HOST_OPTION = '--host';\nconst AGENT_SEPARATOR = '--';\nconst DEFAULT_WEB_PORT = 7533;\nconst DEFAULT_SESSION_NAME = 'untitled';\n\nexport const SERVE_USAGE = `po-server ${TOKEN_FILE_OPTION} <file> [--no-session] [${NAME_OPTION} <name>] [${SESSION_ID_OPTION} <id>] [${WEB_OPTION} [port]] [${HOST_OPTION} <address>] [${CONTAINED_OPTION} [${WORKSPACE_ID_OPTION} <id>]] [${AGENT_SEPARATOR} <agent arguments>]`;\n\n/**\n * Parses the server's own arguments, leaving the agent's untouched.\n *\n * The token is read from a file rather than a flag because command arguments are visible to other local processes.\n */\nexport function parseServeOptions(argv: readonly string[]): ServeOptions {\n  let noSession = false;\n  let tokenFile: string | undefined;\n  let webPort = DEFAULT_WEB_PORT;\n  let sessionName: string | undefined;\n  let sessionId: string | undefined;\n  let contained = false;\n  let workspaceId: string | undefined;\n  let host: string | undefined;\n  const agentArgs: string[] = [];\n\n  for (let index = 0; index < argv.length; index += 1) {\n    const argument = argv[index];\n    if (argument === '--no-session') {\n      noSession = true;\n      continue;\n    }\n    if (argument === CONTAINED_OPTION) {\n      contained = true;\n      continue;\n    }\n    if (argument === AGENT_SEPARATOR) {\n      agentArgs.push(...argv.slice(index + 1));\n      break;\n    }\n    if (argument === WEB_OPTION) {\n      // The port is optional, so only consume the next token when it reads as\n      // one; otherwise it belongs to whatever flag follows.\n      const value = argv[index + 1];\n      if (value !== undefined && /^\\d+$/u.test(value)) {\n        const parsed = Number.parseInt(value, 10);\n        if (parsed < 1 || parsed > 65535) throw new Error(`${WEB_OPTION} expects a port number, received \"${value}\".`);\n        webPort = parsed;\n        index += 1;\n      } else {\n        webPort = DEFAULT_WEB_PORT;\n      }\n      continue;\n    }\n    if (\n      argument === TOKEN_FILE_OPTION ||\n      argument === NAME_OPTION ||\n      argument === SESSION_ID_OPTION ||\n      argument === WORKSPACE_ID_OPTION ||\n      argument === HOST_OPTION\n    ) {\n      const value = argv[index + 1];\n      if (value === undefined || value.startsWith('-')) throw new Error(`${argument} requires a value.`);\n      if (argument === TOKEN_FILE_OPTION) tokenFile = value;\n      else if (argument === NAME_OPTION) sessionName = value;\n      else if (argument === WORKSPACE_ID_OPTION) workspaceId = value;\n      else if (argument === HOST_OPTION) host = value;\n      else {\n        if (value.includes('/')) throw new Error(`${SESSION_ID_OPTION} must not contain \"/\".`);\n        sessionId = value;\n      }\n      index += 1;\n      continue;\n    }\n    throw new Error(`Unknown option ${argument}. Usage: ${SERVE_USAGE}`);\n  }\n\n  if (!tokenFile) throw new Error(`${TOKEN_FILE_OPTION} is required. Usage: ${SERVE_USAGE}`);\n  if (workspaceId !== undefined && !contained)\n    throw new Error(`${WORKSPACE_ID_OPTION} is only valid with ${CONTAINED_OPTION}. Usage: ${SERVE_USAGE}`);\n  return {\n    ...(noSession ? { noSession: true } : {}),\n    ...(contained ? { contained: true } : {}),\n    ...(workspaceId === undefined ? {} : { workspaceId }),\n    ...(host === undefined ? {} : { host }),\n    tokenFile,\n    agentArgs,\n    webPort,\n    sessionName: sessionName ?? DEFAULT_SESSION_NAME,\n    sessionId,\n  };\n}\n","import os from 'node:os';\nimport path from 'node:path';\n\nimport { initializeGlobalPoConfig } from '@agimon-ai/po-config';\nimport { poHomeDirectory, removePoPiSettings } from '@agimon-ai/po-core/piSettings';\n\nimport { runServerRuntime } from '../../builders/server/runtime';\nimport { registerPoHost, retireLegacyPoHome } from '../../composition/poHomeMigration';\nimport { resolveHarnessOptions } from '../harnessOptions';\nimport { parseServeOptions } from './options';\n\n/** Removes Po's leftover entries from Pi's default user agent directory, once per server start. */\nfunction removeLegacyPiIntegration(homeDirectory: string): void {\n  try {\n    for (const removed of removePoPiSettings(path.join(homeDirectory, '.pi', 'agent'))) {\n      process.stderr.write(`[po-server] Removed Po's Pi entry: ${removed}\\n`);\n    }\n  } catch (error) {\n    process.stderr.write(\n      `[po-server] Could not remove Po's Pi entries: ${error instanceof Error ? error.message : String(error)}\\n`,\n    );\n  }\n}\n\n/**\n * Registers this host, then deletes `~/.pi/.po` once no older host can be using it.\n * Never fatal: a failure here leaves the old directory for the next start.\n */\nfunction registerAndRetireLegacyHome(homeDirectory: string, environment: NodeJS.ProcessEnv): () => void {\n  const poHome = poHomeDirectory(homeDirectory, environment);\n  let release = (): void => undefined;\n  try {\n    release = registerPoHost(poHome);\n    const retired = retireLegacyPoHome(homeDirectory, poHome);\n    if (retired.status === 'removed') process.stderr.write('[po-server] Removed the old ~/.pi/.po directory.\\n');\n    if (retired.status === 'deferred') process.stderr.write(`[po-server] Kept ~/.pi/.po for now: ${retired.reason}\\n`);\n  } catch (error) {\n    process.stderr.write(\n      `[po-server] Could not retire ~/.pi/.po: ${error instanceof Error ? error.message : String(error)}\\n`,\n    );\n  }\n  return release;\n}\n\nexport async function runServer(\n  args: readonly string[],\n  /** Aborting stops the server gracefully, as a termination signal does. */\n  stopSignal?: AbortSignal,\n): Promise<number> {\n  const options = parseServeOptions(args);\n  const environment = Object.freeze({ ...process.env });\n  const homeDirectory = environment.HOME ?? os.homedir();\n  initializeGlobalPoConfig(homeDirectory);\n  removeLegacyPiIntegration(homeDirectory);\n  const releaseHost = registerAndRetireLegacyHome(homeDirectory, environment);\n  const controller = new AbortController();\n  const stop = () => controller.abort();\n  process.on('SIGINT', stop);\n  process.on('SIGTERM', stop);\n  // An IPC parent owns this server's lifetime. Its channel closes even when the\n  // parent is killed before it can forward a termination signal.\n  process.on('disconnect', stop);\n  const externalStop = () => controller.abort(stopSignal?.reason);\n  stopSignal?.addEventListener('abort', externalStop, { once: true });\n  if (stopSignal?.aborted) externalStop();\n  try {\n    return await runServerRuntime(options, {\n      cwd: process.cwd(),\n      environment,\n      signal: controller.signal,\n      resolveHarnessOptions,\n      notice: (message) => void process.stderr.write(`[po-server] ${message}\\n`),\n    });\n  } finally {\n    process.off('SIGINT', stop);\n    process.off('SIGTERM', stop);\n    process.off('disconnect', stop);\n    stopSignal?.removeEventListener('abort', externalStop);\n    releaseHost();\n  }\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,593,594,595,596,597,598,599,600,601,602,605,607,608,609,611,612,613,614,615,616,617,618,619,620,637,638,639,640,641,642,643,644,645,646,647,660,669,670,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,945,946,947,948,949,950,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,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AQ,WAAW;EACnB,QAAQ,WAAW,WAAW,MAAM,MAAM;EAC1C,eAAe,OAAO,oBAAoB,SAAS,YAAY;CAChE;AACD;;;;;;;;;;;;;;;AAkBA,IAAM,mBAAmB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AACA,IAAM,cAAc;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AACA,IAAM,mBAAmB,CAAC;AAC1B,IAAM,cAAc,CAAC;AACrB,SAAS,SAAS,KAAK,QAAQ;CAC9B,MAAM,OAAO,IAAI,MAAM,GAAG,EAAE;CAC5B,iBAAiB,QAAQ;CACzB,YAAY,SAAS,MAAM,OAAO,UAAU,CAAC,CAAC,CAAC;AAChD;AACA,KAAK,MAAM,OAAO,kB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