@agntn/tools 0.2.4 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { AddImmutable, AddImmutableDeferred, AddOptional, AddOptionalDeferred, AddReadonly, AddReadonlyDeferred, Any, ArrayOptions, BigInt, BigIntPattern, Boolean, Broaden, Call, CallConstruct, CanComposite, Capitalize, CapitalizeAction, CapitalizeDeferred, CapitalizeInstantiate, Codec, CollapseToObject, Compare, CompareResultDisjoint, CompareResultEqual, CompareResultLeftInside, CompareResultRightInside, Composite, Conditional, ConditionalAction, ConditionalDeferred, ConditionalInstantiate, Constructor, ConstructorOptions, ConstructorParameters, ConstructorParametersAction, ConstructorParametersDeferred, ConstructorParametersInstantiate, ConvertToIntegerKey, Cyclic, CyclicCandidates, CyclicCheck, CyclicDependencies, CyclicExtends, CyclicOptions, CyclicTarget, Decode, DecodeBuilder, Deferred, Dependent, DependentOptions, Distribute, Encode, EncodeBuilder, Enum, Evaluate, EvaluateAction, EvaluateDeferred, EvaluateDependent, EvaluateEnum, EvaluateInstantiate, EvaluateIntersect, EvaluateTemplateLiteral, EvaluateType, EvaluateUnion, EvaluateUnionFast, Exclude, ExcludeAction, ExcludeDeferred, ExcludeInstantiate, Extends, Extract, ExtractAction, ExtractDeferred, ExtractInstantiate, Flatten, FunctionOptions, Generic, Identifier, Immutable, Index, IndexAction, IndexDeferred, IndexInstantiate, Infer, InstanceType, InstanceTypeAction, InstanceTypeDeferred, InstanceTypeInstantiate, Instantiate, InstantiateCyclic, Integer, IntegerKey, IntegerPattern, Interface, InterfaceAction, InterfaceDeferred, InterfaceInstantiate, Intersect, IntersectOptions, InvalidLiteralValue, IsAny, IsArray, IsBigInt, IsBoolean, IsCall, IsCodec, IsConstructor, IsCyclic, IsDeferred, IsDependent, IsEnum, IsEnumValue, IsFunction, IsGeneric, IsIdentifier, IsImmutable, IsInfer, IsInteger, IsInterfaceDeferred, IsIntersect, IsKind, IsLiteral, IsLiteralBigInt, IsLiteralBoolean, IsLiteralNumber, IsLiteralString, IsLiteralValue, IsNever, IsNull, IsNumber, IsObject, IsOptional, IsParameter, IsReadonly, IsRecord, IsRef, IsRefine, IsRefinement, IsRest, IsSchema, IsString, IsSymbol, IsTemplateLiteral, IsTemplateLiteralDeferred, IsTemplateLiteralFinite, IsTemplateLiteralPattern, IsThis, IsTuple, IsTypeScriptEnumLike, IsUndefined, IsUnion, IsUnknown, IsUnsafe, IsVoid, KeyOf, KeyOfAction, KeyOfDeferred, KeyOfInstantiate, KeysToIndexer, Literal, LiteralTypeName, Lowercase, LowercaseAction, LowercaseDeferred, LowercaseInstantiate, Mapped, MappedAction, MappedDeferred, MappedInstantiate, Module, ModuleDeferred, ModuleInstantiate, Narrow, Never, NeverPattern, NonNullable, NonNullableAction, NonNullableDeferred, NonNullableInstantiate, Null, Number, NumberKey, NumberPattern, ObjectOptions, Omit, OmitAction, OmitDeferred, OmitInstantiate, Optional, Parameter, Parameters, ParametersAction, ParametersDeferred, ParametersInstantiate, ParsePatternIntoTypes, ParseTemplateIntoTypes, Partial, PartialAction, PartialDeferred, PartialInstantiate, Pick, PickAction, PickDeferred, PickInstantiate, Priority, PropertyKeys, PropertyValues, Readonly, ReadonlyObject, ReadonlyObjectAction, ReadonlyObjectDeferred, ReadonlyObjectInstantiate, ReadonlyType, Record, RecordAction, RecordDeferred, RecordFromPattern, RecordInstantiate, RecordKey, RecordOptions, RecordPattern, RecordPatternToType, RecordValue, Ref, RefInstantiate, Refine, RefineAdd, RemoveImmutable, RemoveImmutableDeferred, RemoveOptional, RemoveOptionalDeferred, RemoveReadonly, RemoveReadonlyDeferred, Required, RequiredAction, RequiredArray, RequiredDeferred, RequiredInstantiate, Rest, ReturnType, ReturnTypeAction, ReturnTypeDeferred, ReturnTypeInstantiate, Script, Static, StaticAny, StaticArray, StaticBigInt, StaticBoolean, StaticCodec, StaticConstructor, StaticCyclic, StaticDecode, StaticDependent, StaticDirection, StaticEncode, StaticEnum, StaticEvaluate, StaticFunction, StaticInstantiatedParameters, StaticInteger, StaticIntersect, StaticLiteral, StaticNever, StaticNull, StaticNumber, StaticObject, StaticParse, StaticProperties, StaticRecord, StaticRef, StaticString, StaticSymbol, StaticTemplateLiteral, StaticThis, StaticTuple, StaticType, StaticUndefined, StaticUnion, StaticUnknown, StaticUnsafe, StaticVoid, String, StringKey, StringPattern, Symbol, TAddImmutable, TAddImmutableDeferred, TAddOptional, TAddOptionalDeferred, TAddReadonly, TAddReadonlyDeferred, TAny, TArray, TArrayOptions, TBigInt, TBoolean, TBroaden, TCall, TCallConstruct, TCanComposite, TCapitalize, TCapitalizeAction, TCapitalizeDeferred, TCapitalizeInstantiate, TCodec, TCollapseToObject, TCompare, TCompareResult, TComposite, TConditional, TConditionalAction, TConditionalDeferred, TConditionalInstantiate, TConstructor, TConstructorParameters, TConstructorParametersAction, TConstructorParametersDeferred, TConstructorParametersInstantiate, TConvertToIntegerKey, TCyclic, TCyclicCandidates, TCyclicCheck, TCyclicDependencies, TCyclicExtends, TCyclicTarget, TDecodeCallback, TDeferred, TDependent, TDistribute, TEncodeCallback, TEnum, TEnumValue, TEvaluate, TEvaluateAction, TEvaluateDeferred, TEvaluateDependent, TEvaluateEnum, TEvaluateInstantiate, TEvaluateIntersect, TEvaluateTemplateLiteral, TEvaluateType, TEvaluateUnion, TEvaluateUnionFast, TExclude, TExcludeAction, TExcludeDeferred, TExcludeInstantiate, TExtends, TExtract, TExtractAction, TExtractDeferred, TExtractInstantiate, TFlatten, TFormat, TFunction, TGeneric, TIdentifier, TImmutable, TIndex, TIndexAction, TIndexDeferred, TIndexInstantiate, TInfer, TInstanceType, TInstanceTypeAction, TInstanceTypeDeferred, TInstanceTypeInstantiate, TInstantiate, TInstantiateCyclic, TInteger, TIntegerKey, TInterface, TInterfaceAction, TInterfaceDeferred, TInterfaceInstantiate, TIntersect, TIntersectOptions, TIsTemplateLiteralFinite, TIsTemplateLiteralPattern, TKeyOf, TKeyOfAction, TKeyOfDeferred, TKeyOfInstantiate, TKeysToIndexer, TLiteral, TLiteralTypeName, TLiteralValue, TLowercase, TLowercaseAction, TLowercaseDeferred, TLowercaseInstantiate, TMapped, TMappedAction, TMappedDeferred, TMappedInstantiate, TModule, TModuleDeferred, TModuleInstantiate, TNarrow, TNever, TNonNullable, TNonNullableAction, TNonNullableDeferred, TNonNullableInstantiate, TNull, TNumber, TNumberKey, TNumberOptions, TObject, TObjectOptions, TOmit, TOmitAction, TOmitDeferred, TOmitInstantiate, TOptional, TParameter, TParameters, TParametersAction, TParametersDeferred, TParametersInstantiate, TParsePatternIntoTypes, TParseTemplateIntoTypes, TPartial, TPartialAction, TPartialDeferred, TPartialInstantiate, TPick, TPickAction, TPickDeferred, TPickInstantiate, TPriority, TProperties, TPropertyKeys, TPropertyValues, TReadonly, TReadonlyObject, TReadonlyObjectAction, TReadonlyObjectDeferred, TReadonlyObjectInstantiate, TRecord, TRecordAction, TRecordDeferred, TRecordInstantiate, TRecordKey, TRecordPattern, TRecordPatternToType, TRecordValue, TRef, TRefInstantiate, TRefine, TRefineAdd, TRefineCheckCallback, TRefineErrorCallback, TRefinement, TRemoveImmutable, TRemoveImmutableDeferred, TRemoveOptional, TRemoveOptionalDeferred, TRemoveReadonly, TRemoveReadonlyDeferred, TRequired, TRequiredAction, TRequiredArray, TRequiredDeferred, TRequiredInstantiate, TRest, TReturnType, TReturnTypeAction, TReturnTypeDeferred, TReturnTypeInstantiate, TSchema, TSchemaOptions, TScript, TScriptOptions, TStaticElements, TString, TStringKey, TStringOptions, TSymbol, TTemplateLiteral, TTemplateLiteralDecode, TTemplateLiteralDecodeUnsafe, TTemplateLiteralDeferred, TTemplateLiteralEncode, TTemplateLiteralFromString, TTemplateLiteralFromTypes, TTemplateLiteralStatic, TThis, TTuple, TTupleOptions, TTupleToIntersect, TTupleToUnion, TTypeScriptEnumLike, TTypeScriptEnumToEnumValues, TUncapitalize, TUncapitalizeAction, TUncapitalizeDeferred, TUncapitalizeInstantiate, TUndefined, TUnion, TUnionLast, TUnionToIntersect, TUnionToTuple, TUnknown, TUnsafe, TUppercase, TUppercaseAction, TUppercaseDeferred, TUppercaseInstantiate, TVoid, TWith, TWithAction, TWithDeferred, TWithInstantiate, TemplateLiteral, TemplateLiteralCreate, TemplateLiteralDecode, TemplateLiteralDecodeUnsafe, TemplateLiteralDeferred, TemplateLiteralEncode, TemplateLiteralFromString, TemplateLiteralFromTypes, This, Tuple, TupleOptions, TypeScriptEnumToEnumValues, Uncapitalize, UncapitalizeAction, UncapitalizeDeferred, UncapitalizeInstantiate, Undefined, Union, UnionOptions, Unknown, Unsafe, Uppercase, UppercaseAction, UppercaseDeferred, UppercaseInstantiate, Void, With, WithAction, WithDeferred, WithInstantiate, _Array_, _Function_, _Object_, index_d_exports, result_d_exports } from "./_chunks/libs/typebox.mjs";
1
+ import { AddImmutable, AddImmutableDeferred, AddOptional, AddOptionalDeferred, AddReadonly, AddReadonlyDeferred, Any, ArrayOptions, BigInt, BigIntPattern, Boolean, Broaden, Call, CallConstruct, Capitalize, CapitalizeAction, CapitalizeDeferred, CapitalizeInstantiate, Codec, CollapseToObject, Compare, CompareResultDisjoint, CompareResultEqual, CompareResultLeftInside, CompareResultRightInside, Composite, Conditional, ConditionalAction, ConditionalDeferred, ConditionalInstantiate, Constructor, ConstructorOptions, ConstructorParameters, ConstructorParametersAction, ConstructorParametersDeferred, ConstructorParametersInstantiate, ConvertToIntegerKey, Cyclic, CyclicCandidates, CyclicCheck, CyclicDependencies, CyclicExtends, CyclicOptions, CyclicTarget, Decode, DecodeBuilder, Deferred, Dependent, DependentOptions, Distribute, Encode, EncodeBuilder, Enum, Evaluate, EvaluateAction, EvaluateDeferred, EvaluateDependent, EvaluateEnum, EvaluateInstantiate, EvaluateIntersect, EvaluatePropertyIntersect, EvaluatePropertyUnion, EvaluateTemplateLiteral, EvaluateType, EvaluateUnion, EvaluateUnionFast, Exclude, ExcludeAction, ExcludeDeferred, ExcludeInstantiate, Extends, Extract, ExtractAction, ExtractDeferred, ExtractInstantiate, Flatten, FunctionOptions, Generic, Identifier, Immutable, Index, IndexAction, IndexDeferred, IndexInstantiate, Infer, InstanceType, InstanceTypeAction, InstanceTypeDeferred, InstanceTypeInstantiate, Instantiate, InstantiateCyclic, Integer, IntegerKey, IntegerPattern, Interface, InterfaceAction, InterfaceDeferred, InterfaceInstantiate, Intersect, IntersectOptions, InvalidLiteralValue, IsAny, IsArray, IsBigInt, IsBoolean, IsCall, IsCodec, IsConstructor, IsCyclic, IsDeferred, IsDependent, IsEnum, IsEnumValue, IsFunction, IsGeneric, IsIdentifier, IsImmutable, IsInfer, IsInteger, IsInterfaceDeferred, IsIntersect, IsKind, IsLiteral, IsLiteralBigInt, IsLiteralBoolean, IsLiteralNumber, IsLiteralString, IsLiteralValue, IsNever, IsNull, IsNumber, IsObject, IsOptional, IsParameter, IsReadonly, IsRecord, IsRef, IsRefine, IsRefinement, IsRest, IsSchema, IsString, IsSymbol, IsTemplateLiteral, IsTemplateLiteralDeferred, IsTemplateLiteralFinite, IsTemplateLiteralPattern, IsThis, IsTuple, IsTypeScriptEnumLike, IsUndefined, IsUnion, IsUnknown, IsUnsafe, IsVoid, KeyOf, KeyOfAction, KeyOfDeferred, KeyOfInstantiate, KeysToIndexer, Literal, LiteralTypeName, Lowercase, LowercaseAction, LowercaseDeferred, LowercaseInstantiate, Mapped, MappedAction, MappedDeferred, MappedInstantiate, Module, ModuleDeferred, ModuleInstantiate, Narrow, Never, NeverPattern, NonNullable, NonNullableAction, NonNullableDeferred, NonNullableInstantiate, Null, Number, NumberKey, NumberPattern, ObjectOptions, Omit, OmitAction, OmitDeferred, OmitInstantiate, Optional, Parameter, Parameters, ParametersAction, ParametersDeferred, ParametersInstantiate, ParsePatternIntoTypes, ParseTemplateIntoTypes, Partial, PartialAction, PartialDeferred, PartialInstantiate, Pick, PickAction, PickDeferred, PickInstantiate, Priority, PropertyKeys, PropertyValues, Readonly, ReadonlyObject, ReadonlyObjectAction, ReadonlyObjectDeferred, ReadonlyObjectInstantiate, ReadonlyType, Record, RecordAction, RecordDeferred, RecordFromPattern, RecordInstantiate, RecordKey, RecordOptions, RecordPattern, RecordPatternToType, RecordValue, Ref, RefInstantiate, Refine, RefineAdd, RemoveImmutable, RemoveImmutableDeferred, RemoveOptional, RemoveOptionalDeferred, RemoveReadonly, RemoveReadonlyDeferred, Required, RequiredAction, RequiredArray, RequiredDeferred, RequiredInstantiate, Rest, ReturnType, ReturnTypeAction, ReturnTypeDeferred, ReturnTypeInstantiate, Script, Static, StaticAny, StaticArray, StaticBigInt, StaticBoolean, StaticCodec, StaticConstructor, StaticCyclic, StaticDecode, StaticDependent, StaticDirection, StaticEncode, StaticEnum, StaticEvaluate, StaticFunction, StaticInstantiatedParameters, StaticInteger, StaticIntersect, StaticLiteral, StaticNever, StaticNull, StaticNumber, StaticObject, StaticParse, StaticProperties, StaticRecord, StaticRef, StaticString, StaticSymbol, StaticTemplateLiteral, StaticThis, StaticTuple, StaticType, StaticUndefined, StaticUnion, StaticUnknown, StaticUnsafe, StaticVoid, String, StringKey, StringPattern, Symbol, TAddImmutable, TAddImmutableDeferred, TAddOptional, TAddOptionalDeferred, TAddReadonly, TAddReadonlyDeferred, TAny, TArray, TArrayOptions, TBigInt, TBoolean, TBroaden, TCall, TCallConstruct, TCapitalize, TCapitalizeAction, TCapitalizeDeferred, TCapitalizeInstantiate, TCodec, TCollapseToObject, TCompare, TCompareResult, TComposite, TConditional, TConditionalAction, TConditionalDeferred, TConditionalInstantiate, TConstructor, TConstructorParameters, TConstructorParametersAction, TConstructorParametersDeferred, TConstructorParametersInstantiate, TConvertToIntegerKey, TCyclic, TCyclicCandidates, TCyclicCheck, TCyclicDependencies, TCyclicExtends, TCyclicTarget, TDecodeCallback, TDeferred, TDependent, TDistribute, TEncodeCallback, TEnum, TEnumValue, TEvaluate, TEvaluateAction, TEvaluateDeferred, TEvaluateDependent, TEvaluateEnum, TEvaluateInstantiate, TEvaluateIntersect, TEvaluatePropertyIntersect, TEvaluatePropertyUnion, TEvaluateTemplateLiteral, TEvaluateType, TEvaluateUnion, TEvaluateUnionFast, TExclude, TExcludeAction, TExcludeDeferred, TExcludeInstantiate, TExtends, TExtract, TExtractAction, TExtractDeferred, TExtractInstantiate, TFlatten, TFormat, TFunction, TGeneric, TIdentifier, TImmutable, TIndex, TIndexAction, TIndexDeferred, TIndexInstantiate, TInfer, TInstanceType, TInstanceTypeAction, TInstanceTypeDeferred, TInstanceTypeInstantiate, TInstantiate, TInstantiateCyclic, TInteger, TIntegerKey, TInterface, TInterfaceAction, TInterfaceDeferred, TInterfaceInstantiate, TIntersect, TIntersectOptions, TIsTemplateLiteralFinite, TIsTemplateLiteralPattern, TKeyOf, TKeyOfAction, TKeyOfDeferred, TKeyOfInstantiate, TKeysToIndexer, TLiteral, TLiteralTypeName, TLiteralValue, TLowercase, TLowercaseAction, TLowercaseDeferred, TLowercaseInstantiate, TMapped, TMappedAction, TMappedDeferred, TMappedInstantiate, TModule, TModuleDeferred, TModuleInstantiate, TNarrow, TNever, TNonNullable, TNonNullableAction, TNonNullableDeferred, TNonNullableInstantiate, TNull, TNumber, TNumberKey, TNumberOptions, TObject, TObjectOptions, TOmit, TOmitAction, TOmitDeferred, TOmitInstantiate, TOptional, TParameter, TParameters, TParametersAction, TParametersDeferred, TParametersInstantiate, TParsePatternIntoTypes, TParseTemplateIntoTypes, TPartial, TPartialAction, TPartialDeferred, TPartialInstantiate, TPick, TPickAction, TPickDeferred, TPickInstantiate, TPriority, TProperties, TPropertyKeys, TPropertyValues, TReadonly, TReadonlyObject, TReadonlyObjectAction, TReadonlyObjectDeferred, TReadonlyObjectInstantiate, TRecord, TRecordAction, TRecordDeferred, TRecordInstantiate, TRecordKey, TRecordPattern, TRecordPatternToType, TRecordValue, TRef, TRefInstantiate, TRefine, TRefineAdd, TRefineCheckCallback, TRefineErrorCallback, TRefinement, TRemoveImmutable, TRemoveImmutableDeferred, TRemoveOptional, TRemoveOptionalDeferred, TRemoveReadonly, TRemoveReadonlyDeferred, TRequired, TRequiredAction, TRequiredArray, TRequiredDeferred, TRequiredInstantiate, TRest, TReturnType, TReturnTypeAction, TReturnTypeDeferred, TReturnTypeInstantiate, TSchema, TSchemaOptions, TScript, TScriptOptions, TStaticElements, TString, TStringKey, TStringOptions, TSymbol, TTemplateLiteral, TTemplateLiteralDecode, TTemplateLiteralDecodeUnsafe, TTemplateLiteralDeferred, TTemplateLiteralEncode, TTemplateLiteralFromString, TTemplateLiteralFromTypes, TTemplateLiteralStatic, TThis, TTuple, TTupleOptions, TTupleToIntersect, TTupleToUnion, TTypeScriptEnumLike, TTypeScriptEnumToEnumValues, TUncapitalize, TUncapitalizeAction, TUncapitalizeDeferred, TUncapitalizeInstantiate, TUndefined, TUnion, TUnionLast, TUnionToIntersect, TUnionToTuple, TUnknown, TUnsafe, TUppercase, TUppercaseAction, TUppercaseDeferred, TUppercaseInstantiate, TVoid, TWith, TWithAction, TWithDeferred, TWithInstantiate, TemplateLiteral, TemplateLiteralCreate, TemplateLiteralDecode, TemplateLiteralDecodeUnsafe, TemplateLiteralDeferred, TemplateLiteralEncode, TemplateLiteralFromString, TemplateLiteralFromTypes, This, Tuple, TupleOptions, TypeScriptEnumToEnumValues, Uncapitalize, UncapitalizeAction, UncapitalizeDeferred, UncapitalizeInstantiate, Undefined, Union, UnionOptions, Unknown, Unsafe, Uppercase, UppercaseAction, UppercaseDeferred, UppercaseInstantiate, Void, With, WithAction, WithDeferred, WithInstantiate, _Array_, _Function_, _Object_, index_d_exports, result_d_exports } from "./_chunks/libs/typebox.mjs";
2
2
  import { Icon, InputCheck, InputIssue, ToolAnswer, ToolAsk, ToolCallContext, ToolCliHints, ToolContent, ToolDefinition, ToolDefinitionError, ToolEffect, ToolInputError, ToolProgress, ToolQuestion, ToolResult, defineTool, indexTools, invokeTool, resultText, sanitizeLine, sanitizeText, validateInput, wireSchema } from "./_chunks/index.mjs";
3
- export { type AddImmutable, type AddImmutableDeferred, type AddOptional, type AddOptionalDeferred, type AddReadonly, type AddReadonlyDeferred, type Any, type _Array_ as Array, type _Array_, type ArrayOptions, type BigInt, type BigIntPattern, type Boolean, type Broaden, type Call, type CallConstruct, type CanComposite, type Capitalize, type CapitalizeAction, type CapitalizeDeferred, type CapitalizeInstantiate, type Codec, type CollapseToObject, type Compare, type CompareResultDisjoint, type CompareResultEqual, type CompareResultLeftInside, type CompareResultRightInside, type Composite, type Conditional, type ConditionalAction, type ConditionalDeferred, type ConditionalInstantiate, type Constructor, type ConstructorOptions, type ConstructorParameters, type ConstructorParametersAction, type ConstructorParametersDeferred, type ConstructorParametersInstantiate, type ConvertToIntegerKey, type Cyclic, type CyclicCandidates, type CyclicCheck, type CyclicDependencies, type CyclicExtends, type CyclicOptions, type CyclicTarget, type Decode, type DecodeBuilder, type Deferred, type Dependent, type DependentOptions, type Distribute, type Encode, type EncodeBuilder, type Enum, type Evaluate, type EvaluateAction, type EvaluateDeferred, type EvaluateDependent, type EvaluateEnum, type EvaluateInstantiate, type EvaluateIntersect, type EvaluateTemplateLiteral, type EvaluateType, type EvaluateUnion, type EvaluateUnionFast, type Exclude, type ExcludeAction, type ExcludeDeferred, type ExcludeInstantiate, type Extends, type result_d_exports as ExtendsResult, type Extract, type ExtractAction, type ExtractDeferred, type ExtractInstantiate, type Flatten, type _Function_ as Function, type _Function_, type FunctionOptions, type Generic, Icon, type Identifier, type Immutable, type Index, type IndexAction, type IndexDeferred, type IndexInstantiate, type Infer, InputCheck, InputIssue, type InstanceType, type InstanceTypeAction, type InstanceTypeDeferred, type InstanceTypeInstantiate, type Instantiate, type InstantiateCyclic, type Integer, type IntegerKey, type IntegerPattern, type Interface, type InterfaceAction, type InterfaceDeferred, type InterfaceInstantiate, type Intersect, type IntersectOptions, type InvalidLiteralValue, type IsAny, type IsArray, type IsBigInt, type IsBoolean, type IsCall, type IsCodec, type IsConstructor, type IsCyclic, type IsDeferred, type IsDependent, type IsEnum, type IsEnumValue, type IsFunction, type IsGeneric, type IsIdentifier, type IsImmutable, type IsInfer, type IsInteger, type IsInterfaceDeferred, type IsIntersect, type IsKind, type IsLiteral, type IsLiteralBigInt, type IsLiteralBoolean, type IsLiteralNumber, type IsLiteralString, type IsLiteralValue, type IsNever, type IsNull, type IsNumber, type IsObject, type IsOptional, type IsParameter, type IsReadonly, type IsRecord, type IsRef, type IsRefine, type IsRefinement, type IsRest, type IsSchema, type IsString, type IsSymbol, type IsTemplateLiteral, type IsTemplateLiteralDeferred, type IsTemplateLiteralFinite, type IsTemplateLiteralPattern, type IsThis, type IsTuple, type IsTypeScriptEnumLike, type IsUndefined, type IsUnion, type IsUnknown, type IsUnsafe, type IsVoid, type KeyOf, type KeyOfAction, type KeyOfDeferred, type KeyOfInstantiate, type KeysToIndexer, type Literal, type LiteralTypeName, type Lowercase, type LowercaseAction, type LowercaseDeferred, type LowercaseInstantiate, type Mapped, type MappedAction, type MappedDeferred, type MappedInstantiate, type Module, type ModuleDeferred, type ModuleInstantiate, type Narrow, type Never, type NeverPattern, type NonNullable, type NonNullableAction, type NonNullableDeferred, type NonNullableInstantiate, type Null, type Number, type NumberKey, type NumberPattern, type _Object_ as Object, type _Object_, type ObjectOptions, type Omit, type OmitAction, type OmitDeferred, type OmitInstantiate, type Optional, type Parameter, type Parameters, type ParametersAction, type ParametersDeferred, type ParametersInstantiate, type ParsePatternIntoTypes, type ParseTemplateIntoTypes, type Partial, type PartialAction, type PartialDeferred, type PartialInstantiate, type Pick, type PickAction, type PickDeferred, type PickInstantiate, type Priority, type PropertyKeys, type PropertyValues, type Readonly, type ReadonlyObject, type ReadonlyObjectAction, type ReadonlyObjectDeferred, type ReadonlyObjectInstantiate, type ReadonlyType, type Record, type RecordAction, type RecordDeferred, type RecordFromPattern, type RecordInstantiate, type RecordKey, type RecordOptions, type RecordPattern, type RecordPatternToType, type RecordValue, type Ref, type RefInstantiate, type Refine, type RefineAdd, type RemoveImmutable, type RemoveImmutableDeferred, type RemoveOptional, type RemoveOptionalDeferred, type RemoveReadonly, type RemoveReadonlyDeferred, type Required, type RequiredAction, type RequiredArray, type RequiredDeferred, type RequiredInstantiate, type Rest, type ReturnType, type ReturnTypeAction, type ReturnTypeDeferred, type ReturnTypeInstantiate, type Script, type Static, type StaticAny, type StaticArray, type StaticBigInt, type StaticBoolean, type StaticCodec, type StaticConstructor, type StaticCyclic, type StaticDecode, type StaticDependent, type StaticDirection, type StaticEncode, type StaticEnum, type StaticEvaluate, type StaticFunction, type StaticInstantiatedParameters, type StaticInteger, type StaticIntersect, type StaticLiteral, type StaticNever, type StaticNull, type StaticNumber, type StaticObject, type StaticParse, type StaticProperties, type StaticRecord, type StaticRef, type StaticString, type StaticSymbol, type StaticTemplateLiteral, type StaticThis, type StaticTuple, type StaticType, type StaticUndefined, type StaticUnion, type StaticUnknown, type StaticUnsafe, type StaticVoid, type String, type StringKey, type StringPattern, type Symbol, type TAddImmutable, type TAddImmutableDeferred, type TAddOptional, type TAddOptionalDeferred, type TAddReadonly, type TAddReadonlyDeferred, type TAny, type TArray, type TArrayOptions, type TBigInt, type TBoolean, type TBroaden, type TCall, type TCallConstruct, type TCanComposite, type TCapitalize, type TCapitalizeAction, type TCapitalizeDeferred, type TCapitalizeInstantiate, type TCodec, type TCollapseToObject, type TCompare, type TCompareResult, type TComposite, type TConditional, type TConditionalAction, type TConditionalDeferred, type TConditionalInstantiate, type TConstructor, type TConstructorParameters, type TConstructorParametersAction, type TConstructorParametersDeferred, type TConstructorParametersInstantiate, type TConvertToIntegerKey, type TCyclic, type TCyclicCandidates, type TCyclicCheck, type TCyclicDependencies, type TCyclicExtends, type TCyclicTarget, type TDecodeCallback, type TDeferred, type TDependent, type TDistribute, type TEncodeCallback, type TEnum, type TEnumValue, type TEvaluate, type TEvaluateAction, type TEvaluateDeferred, type TEvaluateDependent, type TEvaluateEnum, type TEvaluateInstantiate, type TEvaluateIntersect, type TEvaluateTemplateLiteral, type TEvaluateType, type TEvaluateUnion, type TEvaluateUnionFast, type TExclude, type TExcludeAction, type TExcludeDeferred, type TExcludeInstantiate, type TExtends, type TExtract, type TExtractAction, type TExtractDeferred, type TExtractInstantiate, type TFlatten, type TFormat, type TFunction, type TGeneric, type TIdentifier, type TImmutable, type TIndex, type TIndexAction, type TIndexDeferred, type TIndexInstantiate, type TInfer, type TInstanceType, type TInstanceTypeAction, type TInstanceTypeDeferred, type TInstanceTypeInstantiate, type TInstantiate, type TInstantiateCyclic, type TInteger, type TIntegerKey, type TInterface, type TInterfaceAction, type TInterfaceDeferred, type TInterfaceInstantiate, type TIntersect, type TIntersectOptions, type TIsTemplateLiteralFinite, type TIsTemplateLiteralPattern, type TKeyOf, type TKeyOfAction, type TKeyOfDeferred, type TKeyOfInstantiate, type TKeysToIndexer, type TLiteral, type TLiteralTypeName, type TLiteralValue, type TLowercase, type TLowercaseAction, type TLowercaseDeferred, type TLowercaseInstantiate, type TMapped, type TMappedAction, type TMappedDeferred, type TMappedInstantiate, type TModule, type TModuleDeferred, type TModuleInstantiate, type TNarrow, type TNever, type TNonNullable, type TNonNullableAction, type TNonNullableDeferred, type TNonNullableInstantiate, type TNull, type TNumber, type TNumberKey, type TNumberOptions, type TObject, type TObjectOptions, type TOmit, type TOmitAction, type TOmitDeferred, type TOmitInstantiate, type TOptional, type TParameter, type TParameters, type TParametersAction, type TParametersDeferred, type TParametersInstantiate, type TParsePatternIntoTypes, type TParseTemplateIntoTypes, type TPartial, type TPartialAction, type TPartialDeferred, type TPartialInstantiate, type TPick, type TPickAction, type TPickDeferred, type TPickInstantiate, type TPriority, type TProperties, type TPropertyKeys, type TPropertyValues, type TReadonly, type TReadonlyObject, type TReadonlyObjectAction, type TReadonlyObjectDeferred, type TReadonlyObjectInstantiate, type TRecord, type TRecordAction, type TRecordDeferred, type TRecordInstantiate, type TRecordKey, type TRecordPattern, type TRecordPatternToType, type TRecordValue, type TRef, type TRefInstantiate, type TRefine, type TRefineAdd, type TRefineCheckCallback, type TRefineErrorCallback, type TRefinement, type TRemoveImmutable, type TRemoveImmutableDeferred, type TRemoveOptional, type TRemoveOptionalDeferred, type TRemoveReadonly, type TRemoveReadonlyDeferred, type TRequired, type TRequiredAction, type TRequiredArray, type TRequiredDeferred, type TRequiredInstantiate, type TRest, type TReturnType, type TReturnTypeAction, type TReturnTypeDeferred, type TReturnTypeInstantiate, type TSchema, type TSchemaOptions, type TScript, type TScriptOptions, type TStaticElements, type TString, type TStringKey, type TStringOptions, type TSymbol, type TTemplateLiteral, type TTemplateLiteralDecode, type TTemplateLiteralDecodeUnsafe, type TTemplateLiteralDeferred, type TTemplateLiteralEncode, type TTemplateLiteralFromString, type TTemplateLiteralFromTypes, type TTemplateLiteralStatic, type TThis, type TTuple, type TTupleOptions, type TTupleToIntersect, type TTupleToUnion, type TTypeScriptEnumLike, type TTypeScriptEnumToEnumValues, type TUncapitalize, type TUncapitalizeAction, type TUncapitalizeDeferred, type TUncapitalizeInstantiate, type TUndefined, type TUnion, type TUnionLast, type TUnionToIntersect, type TUnionToTuple, type TUnknown, type TUnsafe, type TUppercase, type TUppercaseAction, type TUppercaseDeferred, type TUppercaseInstantiate, type TVoid, type TWith, type TWithAction, type TWithDeferred, type TWithInstantiate, type TemplateLiteral, type TemplateLiteralCreate, type TemplateLiteralDecode, type TemplateLiteralDecodeUnsafe, type TemplateLiteralDeferred, type TemplateLiteralEncode, type TemplateLiteralFromString, type TemplateLiteralFromTypes, type This, ToolAnswer, ToolAsk, ToolCallContext, ToolCliHints, ToolContent, ToolDefinition, ToolDefinitionError, ToolEffect, ToolInputError, ToolProgress, ToolQuestion, ToolResult, type Tuple, type TupleOptions, index_d_exports as Type, type TypeScriptEnumToEnumValues, type Uncapitalize, type UncapitalizeAction, type UncapitalizeDeferred, type UncapitalizeInstantiate, type Undefined, type Union, type UnionOptions, type Unknown, type Unsafe, type Uppercase, type UppercaseAction, type UppercaseDeferred, type UppercaseInstantiate, type Void, type With, type WithAction, type WithDeferred, type WithInstantiate, defineTool, indexTools, invokeTool, resultText, sanitizeLine, sanitizeText, validateInput, wireSchema };
3
+ export { type AddImmutable, type AddImmutableDeferred, type AddOptional, type AddOptionalDeferred, type AddReadonly, type AddReadonlyDeferred, type Any, type _Array_ as Array, type _Array_, type ArrayOptions, type BigInt, type BigIntPattern, type Boolean, type Broaden, type Call, type CallConstruct, type Capitalize, type CapitalizeAction, type CapitalizeDeferred, type CapitalizeInstantiate, type Codec, type CollapseToObject, type Compare, type CompareResultDisjoint, type CompareResultEqual, type CompareResultLeftInside, type CompareResultRightInside, type Composite, type Conditional, type ConditionalAction, type ConditionalDeferred, type ConditionalInstantiate, type Constructor, type ConstructorOptions, type ConstructorParameters, type ConstructorParametersAction, type ConstructorParametersDeferred, type ConstructorParametersInstantiate, type ConvertToIntegerKey, type Cyclic, type CyclicCandidates, type CyclicCheck, type CyclicDependencies, type CyclicExtends, type CyclicOptions, type CyclicTarget, type Decode, type DecodeBuilder, type Deferred, type Dependent, type DependentOptions, type Distribute, type Encode, type EncodeBuilder, type Enum, type Evaluate, type EvaluateAction, type EvaluateDeferred, type EvaluateDependent, type EvaluateEnum, type EvaluateInstantiate, type EvaluateIntersect, type EvaluatePropertyIntersect, type EvaluatePropertyUnion, type EvaluateTemplateLiteral, type EvaluateType, type EvaluateUnion, type EvaluateUnionFast, type Exclude, type ExcludeAction, type ExcludeDeferred, type ExcludeInstantiate, type Extends, type result_d_exports as ExtendsResult, type Extract, type ExtractAction, type ExtractDeferred, type ExtractInstantiate, type Flatten, type _Function_ as Function, type _Function_, type FunctionOptions, type Generic, Icon, type Identifier, type Immutable, type Index, type IndexAction, type IndexDeferred, type IndexInstantiate, type Infer, InputCheck, InputIssue, type InstanceType, type InstanceTypeAction, type InstanceTypeDeferred, type InstanceTypeInstantiate, type Instantiate, type InstantiateCyclic, type Integer, type IntegerKey, type IntegerPattern, type Interface, type InterfaceAction, type InterfaceDeferred, type InterfaceInstantiate, type Intersect, type IntersectOptions, type InvalidLiteralValue, type IsAny, type IsArray, type IsBigInt, type IsBoolean, type IsCall, type IsCodec, type IsConstructor, type IsCyclic, type IsDeferred, type IsDependent, type IsEnum, type IsEnumValue, type IsFunction, type IsGeneric, type IsIdentifier, type IsImmutable, type IsInfer, type IsInteger, type IsInterfaceDeferred, type IsIntersect, type IsKind, type IsLiteral, type IsLiteralBigInt, type IsLiteralBoolean, type IsLiteralNumber, type IsLiteralString, type IsLiteralValue, type IsNever, type IsNull, type IsNumber, type IsObject, type IsOptional, type IsParameter, type IsReadonly, type IsRecord, type IsRef, type IsRefine, type IsRefinement, type IsRest, type IsSchema, type IsString, type IsSymbol, type IsTemplateLiteral, type IsTemplateLiteralDeferred, type IsTemplateLiteralFinite, type IsTemplateLiteralPattern, type IsThis, type IsTuple, type IsTypeScriptEnumLike, type IsUndefined, type IsUnion, type IsUnknown, type IsUnsafe, type IsVoid, type KeyOf, type KeyOfAction, type KeyOfDeferred, type KeyOfInstantiate, type KeysToIndexer, type Literal, type LiteralTypeName, type Lowercase, type LowercaseAction, type LowercaseDeferred, type LowercaseInstantiate, type Mapped, type MappedAction, type MappedDeferred, type MappedInstantiate, type Module, type ModuleDeferred, type ModuleInstantiate, type Narrow, type Never, type NeverPattern, type NonNullable, type NonNullableAction, type NonNullableDeferred, type NonNullableInstantiate, type Null, type Number, type NumberKey, type NumberPattern, type _Object_ as Object, type _Object_, type ObjectOptions, type Omit, type OmitAction, type OmitDeferred, type OmitInstantiate, type Optional, type Parameter, type Parameters, type ParametersAction, type ParametersDeferred, type ParametersInstantiate, type ParsePatternIntoTypes, type ParseTemplateIntoTypes, type Partial, type PartialAction, type PartialDeferred, type PartialInstantiate, type Pick, type PickAction, type PickDeferred, type PickInstantiate, type Priority, type PropertyKeys, type PropertyValues, type Readonly, type ReadonlyObject, type ReadonlyObjectAction, type ReadonlyObjectDeferred, type ReadonlyObjectInstantiate, type ReadonlyType, type Record, type RecordAction, type RecordDeferred, type RecordFromPattern, type RecordInstantiate, type RecordKey, type RecordOptions, type RecordPattern, type RecordPatternToType, type RecordValue, type Ref, type RefInstantiate, type Refine, type RefineAdd, type RemoveImmutable, type RemoveImmutableDeferred, type RemoveOptional, type RemoveOptionalDeferred, type RemoveReadonly, type RemoveReadonlyDeferred, type Required, type RequiredAction, type RequiredArray, type RequiredDeferred, type RequiredInstantiate, type Rest, type ReturnType, type ReturnTypeAction, type ReturnTypeDeferred, type ReturnTypeInstantiate, type Script, type Static, type StaticAny, type StaticArray, type StaticBigInt, type StaticBoolean, type StaticCodec, type StaticConstructor, type StaticCyclic, type StaticDecode, type StaticDependent, type StaticDirection, type StaticEncode, type StaticEnum, type StaticEvaluate, type StaticFunction, type StaticInstantiatedParameters, type StaticInteger, type StaticIntersect, type StaticLiteral, type StaticNever, type StaticNull, type StaticNumber, type StaticObject, type StaticParse, type StaticProperties, type StaticRecord, type StaticRef, type StaticString, type StaticSymbol, type StaticTemplateLiteral, type StaticThis, type StaticTuple, type StaticType, type StaticUndefined, type StaticUnion, type StaticUnknown, type StaticUnsafe, type StaticVoid, type String, type StringKey, type StringPattern, type Symbol, type TAddImmutable, type TAddImmutableDeferred, type TAddOptional, type TAddOptionalDeferred, type TAddReadonly, type TAddReadonlyDeferred, type TAny, type TArray, type TArrayOptions, type TBigInt, type TBoolean, type TBroaden, type TCall, type TCallConstruct, type TCapitalize, type TCapitalizeAction, type TCapitalizeDeferred, type TCapitalizeInstantiate, type TCodec, type TCollapseToObject, type TCompare, type TCompareResult, type TComposite, type TConditional, type TConditionalAction, type TConditionalDeferred, type TConditionalInstantiate, type TConstructor, type TConstructorParameters, type TConstructorParametersAction, type TConstructorParametersDeferred, type TConstructorParametersInstantiate, type TConvertToIntegerKey, type TCyclic, type TCyclicCandidates, type TCyclicCheck, type TCyclicDependencies, type TCyclicExtends, type TCyclicTarget, type TDecodeCallback, type TDeferred, type TDependent, type TDistribute, type TEncodeCallback, type TEnum, type TEnumValue, type TEvaluate, type TEvaluateAction, type TEvaluateDeferred, type TEvaluateDependent, type TEvaluateEnum, type TEvaluateInstantiate, type TEvaluateIntersect, type TEvaluatePropertyIntersect, type TEvaluatePropertyUnion, type TEvaluateTemplateLiteral, type TEvaluateType, type TEvaluateUnion, type TEvaluateUnionFast, type TExclude, type TExcludeAction, type TExcludeDeferred, type TExcludeInstantiate, type TExtends, type TExtract, type TExtractAction, type TExtractDeferred, type TExtractInstantiate, type TFlatten, type TFormat, type TFunction, type TGeneric, type TIdentifier, type TImmutable, type TIndex, type TIndexAction, type TIndexDeferred, type TIndexInstantiate, type TInfer, type TInstanceType, type TInstanceTypeAction, type TInstanceTypeDeferred, type TInstanceTypeInstantiate, type TInstantiate, type TInstantiateCyclic, type TInteger, type TIntegerKey, type TInterface, type TInterfaceAction, type TInterfaceDeferred, type TInterfaceInstantiate, type TIntersect, type TIntersectOptions, type TIsTemplateLiteralFinite, type TIsTemplateLiteralPattern, type TKeyOf, type TKeyOfAction, type TKeyOfDeferred, type TKeyOfInstantiate, type TKeysToIndexer, type TLiteral, type TLiteralTypeName, type TLiteralValue, type TLowercase, type TLowercaseAction, type TLowercaseDeferred, type TLowercaseInstantiate, type TMapped, type TMappedAction, type TMappedDeferred, type TMappedInstantiate, type TModule, type TModuleDeferred, type TModuleInstantiate, type TNarrow, type TNever, type TNonNullable, type TNonNullableAction, type TNonNullableDeferred, type TNonNullableInstantiate, type TNull, type TNumber, type TNumberKey, type TNumberOptions, type TObject, type TObjectOptions, type TOmit, type TOmitAction, type TOmitDeferred, type TOmitInstantiate, type TOptional, type TParameter, type TParameters, type TParametersAction, type TParametersDeferred, type TParametersInstantiate, type TParsePatternIntoTypes, type TParseTemplateIntoTypes, type TPartial, type TPartialAction, type TPartialDeferred, type TPartialInstantiate, type TPick, type TPickAction, type TPickDeferred, type TPickInstantiate, type TPriority, type TProperties, type TPropertyKeys, type TPropertyValues, type TReadonly, type TReadonlyObject, type TReadonlyObjectAction, type TReadonlyObjectDeferred, type TReadonlyObjectInstantiate, type TRecord, type TRecordAction, type TRecordDeferred, type TRecordInstantiate, type TRecordKey, type TRecordPattern, type TRecordPatternToType, type TRecordValue, type TRef, type TRefInstantiate, type TRefine, type TRefineAdd, type TRefineCheckCallback, type TRefineErrorCallback, type TRefinement, type TRemoveImmutable, type TRemoveImmutableDeferred, type TRemoveOptional, type TRemoveOptionalDeferred, type TRemoveReadonly, type TRemoveReadonlyDeferred, type TRequired, type TRequiredAction, type TRequiredArray, type TRequiredDeferred, type TRequiredInstantiate, type TRest, type TReturnType, type TReturnTypeAction, type TReturnTypeDeferred, type TReturnTypeInstantiate, type TSchema, type TSchemaOptions, type TScript, type TScriptOptions, type TStaticElements, type TString, type TStringKey, type TStringOptions, type TSymbol, type TTemplateLiteral, type TTemplateLiteralDecode, type TTemplateLiteralDecodeUnsafe, type TTemplateLiteralDeferred, type TTemplateLiteralEncode, type TTemplateLiteralFromString, type TTemplateLiteralFromTypes, type TTemplateLiteralStatic, type TThis, type TTuple, type TTupleOptions, type TTupleToIntersect, type TTupleToUnion, type TTypeScriptEnumLike, type TTypeScriptEnumToEnumValues, type TUncapitalize, type TUncapitalizeAction, type TUncapitalizeDeferred, type TUncapitalizeInstantiate, type TUndefined, type TUnion, type TUnionLast, type TUnionToIntersect, type TUnionToTuple, type TUnknown, type TUnsafe, type TUppercase, type TUppercaseAction, type TUppercaseDeferred, type TUppercaseInstantiate, type TVoid, type TWith, type TWithAction, type TWithDeferred, type TWithInstantiate, type TemplateLiteral, type TemplateLiteralCreate, type TemplateLiteralDecode, type TemplateLiteralDecodeUnsafe, type TemplateLiteralDeferred, type TemplateLiteralEncode, type TemplateLiteralFromString, type TemplateLiteralFromTypes, type This, ToolAnswer, ToolAsk, ToolCallContext, ToolCliHints, ToolContent, ToolDefinition, ToolDefinitionError, ToolEffect, ToolInputError, ToolProgress, ToolQuestion, ToolResult, type Tuple, type TupleOptions, index_d_exports as Type, type TypeScriptEnumToEnumValues, type Uncapitalize, type UncapitalizeAction, type UncapitalizeDeferred, type UncapitalizeInstantiate, type Undefined, type Union, type UnionOptions, type Unknown, type Unsafe, type Uppercase, type UppercaseAction, type UppercaseDeferred, type UppercaseInstantiate, type Void, type With, type WithAction, type WithDeferred, type WithInstantiate, defineTool, indexTools, invokeTool, resultText, sanitizeLine, sanitizeText, validateInput, wireSchema };
package/dist/mcp.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ToolDefinition } from "./_chunks/index.mjs";
2
- import { McpServerInfo, callTool, errorResult, listTools, toolAnnotations } from "./_chunks/mcp-answers.mjs";
2
+ import { McpHost, McpServerInfo, callTool, errorResult, listTools, toolAnnotations } from "./_chunks/mcp-answers.mjs";
3
3
  import { Server } from "@modelcontextprotocol/server";
4
4
  /**
5
5
  * Creates an unconnected MCP server exposing the tools.
@@ -20,10 +20,12 @@ import { Server } from "@modelcontextprotocol/server";
20
20
  * A client that declares `elicitation` gets `ask`, through `input_required` on both revisions.
21
21
  * A 2026 request carries its capabilities itself, a 2025 one declared them at `initialize`.
22
22
  *
23
+ * `host` is an {@link McpHost}: the HTTP request on an HTTP transport, the call's `_meta` on any.
24
+ *
23
25
  * @param info - Name, version and optional title, description, icons and website, sent as given.
24
26
  * @param tools - Tools to serve.
25
27
  * @returns {Server} Unconnected MCP server.
26
28
  * @throws {ToolDefinitionError} When two tools share a name.
27
29
  */
28
30
  export declare function createMcpServer(info: McpServerInfo, tools: readonly ToolDefinition[]): Server;
29
- export { type McpServerInfo, callTool, errorResult, listTools, toolAnnotations };
31
+ export { type McpHost, type McpServerInfo, callTool, errorResult, listTools, toolAnnotations };
package/dist/mcp.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { indexTools } from "./_chunks/src.mjs";
2
- import { callAsking, callTool, canAsk, copyIcons, errorResult, listTools, progressSteps, questionRound, toolAnnotations } from "./_chunks/mcp-answers.mjs";
2
+ import { callAsking, callTool, canAsk, copyIcons, errorResult, listTools, mcpHost, progressSteps, questionRound, toolAnnotations } from "./_chunks/mcp-answers.mjs";
3
3
  import { Server } from "@modelcontextprotocol/server";
4
4
  function createMcpServer(info, tools) {
5
5
  indexTools(tools);
@@ -14,7 +14,8 @@ function createMcpServer(info, tools) {
14
14
  }, { capabilities: { tools: {} } });
15
15
  server.setRequestHandler("tools/list", () => ({ tools: listTools(tools) }));
16
16
  server.setRequestHandler("tools/call", async (request, ctx) => {
17
- const progressToken = ctx.mcpReq._meta?.progressToken;
17
+ const meta = ctx.mcpReq._meta;
18
+ const progressToken = meta?.progressToken;
18
19
  const notify = (params) => {
19
20
  ctx.mcpReq.notify({
20
21
  method: "notifications/progress",
@@ -30,6 +31,10 @@ function createMcpServer(info, tools) {
30
31
  const round = canAsk(capabilities) ? questionRound(ctx.mcpReq.inputResponses, stateOf(ctx.mcpReq.requestState())) : void 0;
31
32
  const context = {
32
33
  signal: ctx.mcpReq.signal,
34
+ ...mcpHost({
35
+ request: ctx.http?.req,
36
+ meta
37
+ }),
33
38
  ...progressToken === void 0 ? {} : { progress: progressSteps(notify) }
34
39
  };
35
40
  const { name, arguments: args } = request.params;
package/dist/omp.d.mts CHANGED
@@ -36,6 +36,9 @@ export interface OmpToolOptions {
36
36
  * document verbatim, so `pattern` and `maxProperties` survive. A standalone
37
37
  * omptype schema would drop both.
38
38
  *
39
+ * Every tool says `strict: false`. OMP's OpenAI strict mode makes each optional field required
40
+ * and nullable, so the model fills them all with junk, and the core refuses even the `null`.
41
+ *
39
42
  * @param pi - OMP extension API.
40
43
  * @param tools - Tools to register.
41
44
  * @param options - Host `Text`, optional load mode and renderers.
package/dist/omp.mjs CHANGED
@@ -1,9 +1,11 @@
1
1
  import { indexTools, invokeTool, sanitizeLine, wireSchema } from "./_chunks/src.mjs";
2
+ import { throwWithCauses } from "./_chunks/causes.mjs";
2
3
  import { hostContext } from "./_chunks/updates.mjs";
3
4
  const APPROVAL = {
4
5
  read: "read",
5
6
  write: "write",
6
- destructive: "write"
7
+ destructive: "write",
8
+ exec: "exec"
7
9
  };
8
10
  function registerOmpTools(pi, tools, options) {
9
11
  indexTools(tools);
@@ -18,8 +20,10 @@ function registerOmpTools(pi, tools, options) {
18
20
  parameters: Type.Unsafe(wireSchema(tool)),
19
21
  approval: APPROVAL[tool.effect],
20
22
  loadMode: options.loadMode,
23
+ strict: false,
21
24
  async execute(_toolCallId, params, signal, onUpdate, ctx) {
22
- return await invokeTool(tool, params, hostContext(signal, onUpdate, ctx));
25
+ const context = hostContext(signal, onUpdate, ctx);
26
+ return await invokeTool(tool, params, context).catch(throwWithCauses);
23
27
  },
24
28
  renderCall(args, renderOptions, theme) {
25
29
  if (renderers?.renderCall) return renderers.renderCall(args, renderOptions, theme);
package/dist/pi.d.mts CHANGED
@@ -19,7 +19,11 @@ export interface PiToolOptions {
19
19
  readonly renderers?: Readonly<Record<string, PiRenderers>>;
20
20
  /** Questions to ask before a call runs, by tool name. A name off the tool list throws. */
21
21
  readonly confirm?: Readonly<Record<string, PiConfirm>>;
22
+ /** Pi's argument repair by tool name, run before validation. A name off the list throws. */
23
+ readonly prepareArguments?: Readonly<Record<string, PiPrepareArguments>>;
22
24
  }
25
+ /** Repairs raw model input before validation. Hand back what it doesn't recognise untouched. */
26
+ export type PiPrepareArguments = (args: unknown) => unknown;
23
27
  /** Builds the question for one call from its validated input; `undefined` skips it. */
24
28
  export type PiConfirm = (input: Readonly<Record<string, unknown>>) => PiQuestion | undefined | Promise<PiQuestion | undefined>;
25
29
  /** What `ctx.ui.confirm` shows. The adapter sanitizes both and keeps the message's lines. */
@@ -37,8 +41,8 @@ export interface PiRenderers extends Readonly<Pick<ToolDefinition, "renderCall"
37
41
  *
38
42
  * @param pi - Pi extension API.
39
43
  * @param tools - Tools to register.
40
- * @param options - Failure policy, host `Text`, renderers and questions.
44
+ * @param options - Failure policy, host `Text`, renderers, questions and argument repairs.
41
45
  * @throws {ToolDefinitionError} When two tools share a name, a tool has `describeCall` but no
42
- * `Text` came with it, or `confirm` names a tool that isn't in the list.
46
+ * `Text` came with it, or `confirm` or `prepareArguments` names a tool that isn't in the list.
43
47
  */
44
48
  export declare function registerPiTools(pi: ExtensionAPI, tools: readonly ToolDefinition$1[], options?: PiToolOptions): void;
package/dist/pi.mjs CHANGED
@@ -1,15 +1,18 @@
1
1
  import { ToolDefinitionError, ToolInputError, indexTools, invokeTool, resultText, sanitizeLine, sanitizeText, validateInput } from "./_chunks/src.mjs";
2
+ import { throwWithCauses } from "./_chunks/causes.mjs";
2
3
  import { hostContext } from "./_chunks/updates.mjs";
3
4
  function registerPiTools(pi, tools, options = {}) {
4
- const listed = indexTools(tools);
5
+ const names = [...indexTools(tools).keys()];
5
6
  const failures = options.failures ?? "throw";
6
- const stray = Object.keys(options.confirm ?? {}).find((name) => !listed.has(name));
7
- if (stray !== void 0) throw new ToolDefinitionError(`confirm names ${JSON.stringify(stray)}, which isn't in the tool list`);
7
+ refuseStray(names, "confirm", options.confirm);
8
+ refuseStray(names, "prepareArguments", options.prepareArguments);
8
9
  for (const tool of tools) {
9
10
  const renderers = byName(options.renderers, tool.name);
10
11
  const ask = byName(options.confirm, tool.name);
12
+ const prepare = byName(options.prepareArguments, tool.name);
11
13
  pi.registerTool({
12
14
  ...hostRenderers(tool, renderers, options.Text),
15
+ ...prepare === void 0 ? {} : { prepareArguments: prepare },
13
16
  name: tool.name,
14
17
  label: tool.title,
15
18
  description: tool.description,
@@ -18,13 +21,19 @@ function registerPiTools(pi, tools, options = {}) {
18
21
  parameters: tool.input,
19
22
  async execute(_toolCallId, params, signal, onUpdate, ctx) {
20
23
  if (ask) await approve(tool, ask, params, signal, ctx);
21
- const result = await invokeTool(tool, params, hostContext(signal, onUpdate, ctx));
24
+ const context = hostContext(signal, onUpdate, ctx);
25
+ const result = await invokeTool(tool, params, context).catch(throwWithCauses);
22
26
  if (result.isError && failures === "throw") throw new Error(resultText(result));
23
27
  return result;
24
28
  }
25
29
  });
26
30
  }
27
31
  }
32
+ function refuseStray(names, option, entries) {
33
+ const stray = Object.keys(entries ?? {}).find((name) => !names.includes(name));
34
+ if (stray === void 0) return;
35
+ throw new ToolDefinitionError(`${option} names ${JSON.stringify(stray)}, which isn't in the tool list`);
36
+ }
28
37
  function byName(entries, name) {
29
38
  return entries && Object.hasOwn(entries, name) ? entries[name] : void 0;
30
39
  }
@@ -1,8 +1,19 @@
1
1
  import { ToolDefinition } from "./_chunks/index.mjs";
2
+ import { McpHost } from "./_chunks/mcp-answers.mjs";
3
+ /** What SDK v1 keeps of the HTTP request. */
4
+ export interface ToolkitRequestInfo {
5
+ readonly headers: Readonly<Record<string, string | readonly string[] | undefined>>;
6
+ readonly url?: {
7
+ readonly href: string;
8
+ };
9
+ }
2
10
  /** The part of the SDK v1 request `extra` a handler reads: abort signal, progress and questions. */
3
11
  export interface ToolkitExtra {
4
12
  readonly signal?: AbortSignal;
13
+ /** Present on an HTTP transport. */
14
+ readonly requestInfo?: ToolkitRequestInfo;
5
15
  readonly _meta?: {
16
+ readonly [key: string]: unknown;
6
17
  readonly progressToken?: string | number;
7
18
  };
8
19
  readonly sendNotification?: (notification: {
@@ -64,6 +75,9 @@ export interface ToolkitTool {
64
75
  /**
65
76
  * Turns tools into toolkit entries that list what `listTools` lists and answer via `callTool`.
66
77
  *
78
+ * `host` is an {@link McpHost} with the call's `_meta` and a `Request` rebuilt from SDK v1's
79
+ * `requestInfo`: the caller's URL and headers, but no body and always `GET`.
80
+ *
67
81
  * Progress and questions need the toolkit's sessions: its stateless default answers in plain JSON.
68
82
  * `useMcpElicitation` also needs Nitro's `asyncContext`, since it finds the server in the request.
69
83
  *
@@ -75,4 +89,5 @@ export interface ToolkitTool {
75
89
  */
76
90
  export declare function toToolkitTools(info: {
77
91
  readonly name: string;
78
- }, tools: readonly ToolDefinition[], options?: ToolkitOptions): ToolkitTool[];
92
+ }, tools: readonly ToolDefinition[], options?: ToolkitOptions): ToolkitTool[];
93
+ export type { McpHost };
package/dist/toolkit.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./_chunks/src.mjs";
2
2
  import { hostAsk } from "./_chunks/questions.mjs";
3
- import { callTool, listTools, progressSteps } from "./_chunks/mcp-answers.mjs";
3
+ import { callTool, listTools, mcpHost, progressSteps } from "./_chunks/mcp-answers.mjs";
4
4
  import { z } from "zod";
5
5
  function toToolkitTools(info, tools, options = {}) {
6
6
  return listTools(tools).map((entry) => ({
@@ -35,6 +35,10 @@ function callContext(extra) {
35
35
  const send = extra?.sendNotification;
36
36
  return {
37
37
  signal: extra?.signal,
38
+ ...mcpHost({
39
+ request: rebuiltRequest(extra?.requestInfo),
40
+ meta: extra?._meta
41
+ }),
38
42
  ...progressToken === void 0 || send === void 0 ? {} : { progress: progressSteps((params) => {
39
43
  send({
40
44
  method: "notifications/progress",
@@ -46,6 +50,23 @@ function callContext(extra) {
46
50
  }) }
47
51
  };
48
52
  }
53
+ function rebuiltRequest(info) {
54
+ if (info?.url === void 0) return void 0;
55
+ const headers = new Headers();
56
+ for (const [name, value] of Object.entries(info.headers)) for (const item of [value ?? []].flat()) if (isHeader(name, item)) headers.append(name, item);
57
+ try {
58
+ return new Request(info.url.href, { headers });
59
+ } catch {
60
+ return;
61
+ }
62
+ }
63
+ function isHeader(name, value) {
64
+ try {
65
+ return new Headers([[name, value]]).has(name);
66
+ } catch {
67
+ return false;
68
+ }
69
+ }
49
70
  function formAsk(extra, elicitation) {
50
71
  const send = extra?.sendRequest;
51
72
  if (send === void 0 || elicitation?.().supports("form") !== true) return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agntn/tools",
3
- "version": "0.2.4",
3
+ "version": "0.3.1",
4
4
  "description": "One tool definition for MCP, Pi, OMP and the AI SDK",
5
5
  "homepage": "https://github.com/agntn/tools#readme",
6
6
  "bugs": "https://github.com/agntn/tools/issues",
@@ -54,21 +54,20 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@agntn/ox": "0.1.0",
57
- "@earendil-works/pi-coding-agent": "1.0.1",
58
- "@modelcontextprotocol/client": "2.2.0",
57
+ "@earendil-works/pi-coding-agent": "1.0.4",
58
+ "@modelcontextprotocol/client": "2.4.0",
59
59
  "@modelcontextprotocol/sdk": "1.32.1",
60
- "@modelcontextprotocol/server": "2.2.0",
61
- "@oh-my-pi/pi-coding-agent": "18.0.0",
62
- "@types/node": "26.2.0",
60
+ "@modelcontextprotocol/server": "2.4.0",
61
+ "@oh-my-pi/pi-coding-agent": "18.0.11",
62
+ "@types/node": "26.6.6",
63
63
  "ai": "7.0.127",
64
- "changelogen": "0.6.2",
65
64
  "h3": "2.0.1",
66
65
  "h3-mcp": "0.2.0",
67
66
  "obuild": "0.4.43",
68
- "typebox": "1.3.34",
67
+ "typebox": "1.4.3",
69
68
  "typescript": "7.0.2",
70
- "vite": "npm:@voidzero-dev/vite-plus-core@1.0.0",
71
- "vite-plus": "1.0.0",
69
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
70
+ "vite-plus": "1.4.0",
72
71
  "zod": "4.6.5"
73
72
  },
74
73
  "peerDependencies": {
@@ -109,7 +108,6 @@
109
108
  "typecheck": "tsc --noEmit --skipLibCheck",
110
109
  "typecheck:dist": "tsc -p tsconfig.dist.json && tsc -p test/copies",
111
110
  "test": "vp test run",
112
- "test:watch": "vp test watch",
113
- "release": "pnpm test && pnpm build && pnpm typecheck:dist && changelogen --release --push"
111
+ "test:watch": "vp test watch"
114
112
  }
115
113
  }