@hiper2d/ai-agents 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -540,8 +540,11 @@ declare function getProviderSignatureFields(aiType: string, signature?: string):
|
|
|
540
540
|
* - xAI Grok 4.7 (docs.x.ai/developers/model-capabilities/text/reasoning, 2026-09-22):
|
|
541
541
|
* low|medium|high|xhigh, default high, sent on the Responses API as `reasoning: {effort}`.
|
|
542
542
|
* Chat Completions has no equivalent. Grok 4.6 and earlier had no knob at all.
|
|
543
|
-
*
|
|
544
|
-
*
|
|
543
|
+
* - Moonshot Kimi K3 (platform.kimi.ai/docs/guide/use-reasoning-effort, 2026-09-22):
|
|
544
|
+
* low|high|max, default max, top-level on Chat Completions. Moonshot shipped the lower
|
|
545
|
+
* levels after launch; K3 accepted only "max" when this agent was written.
|
|
546
|
+
* Qwen accepts reasoning_effort but ignores it (thinking_budget is its knob); MiniMax exposes
|
|
547
|
+
* no effort parameter.
|
|
545
548
|
*/
|
|
546
549
|
type OpenAIReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
547
550
|
type AnthropicReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
@@ -552,6 +555,7 @@ type FuguReasoningEffort = 'high' | 'xhigh' | 'max';
|
|
|
552
555
|
type MetaReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
553
556
|
type MistralReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
554
557
|
type XaiReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh';
|
|
558
|
+
type KimiReasoningEffort = 'low' | 'high' | 'max';
|
|
555
559
|
/** The shared scale, lowest first. */
|
|
556
560
|
declare const REASONING_EFFORT_SCALE: readonly ReasoningEffort[];
|
|
557
561
|
declare const OPENAI_REASONING_EFFORTS: readonly OpenAIReasoningEffort[];
|
|
@@ -563,6 +567,7 @@ declare const FUGU_REASONING_EFFORTS: readonly FuguReasoningEffort[];
|
|
|
563
567
|
declare const META_REASONING_EFFORTS: readonly MetaReasoningEffort[];
|
|
564
568
|
declare const MISTRAL_REASONING_EFFORTS: readonly MistralReasoningEffort[];
|
|
565
569
|
declare const XAI_REASONING_EFFORTS: readonly XaiReasoningEffort[];
|
|
570
|
+
declare const KIMI_REASONING_EFFORTS: readonly KimiReasoningEffort[];
|
|
566
571
|
/** Clamps `effort` to the nearest level in `allowed` (by rank on the shared scale, ties go up). */
|
|
567
572
|
declare function clampReasoningEffort<T extends ReasoningEffort>(effort: ReasoningEffort, allowed: readonly T[]): T;
|
|
568
573
|
declare const toOpenAIEffort: (effort: ReasoningEffort) => OpenAIReasoningEffort;
|
|
@@ -574,6 +579,7 @@ declare const toMetaEffort: (effort: ReasoningEffort) => MetaReasoningEffort;
|
|
|
574
579
|
declare const toFuguEffort: (effort: ReasoningEffort) => FuguReasoningEffort;
|
|
575
580
|
declare const toMistralEffort: (effort: ReasoningEffort) => MistralReasoningEffort;
|
|
576
581
|
declare const toXaiEffort: (effort: ReasoningEffort) => XaiReasoningEffort;
|
|
582
|
+
declare const toKimiEffort: (effort: ReasoningEffort) => KimiReasoningEffort;
|
|
577
583
|
|
|
578
584
|
/**
|
|
579
585
|
* Unified token usage utilities for all AI providers
|
|
@@ -1736,4 +1742,4 @@ declare class MiniMaxAgent extends AbstractAgent {
|
|
|
1736
1742
|
doAskText(messages: AIMessage[]): Promise<[string, string, TokenUsage$1?, string?]>;
|
|
1737
1743
|
}
|
|
1738
1744
|
|
|
1739
|
-
export { type AIMessage, ANTHROPIC_REASONING_EFFORTS, API_KEY_CONSTANTS, AbstractAgent, type AgentActivityData, AgentFactory, type AgentLoggingConfig, type AnthropicReasoningEffort, type AnthropicTokenUsage, type ApiKeyMap, type BeforeAskHook, BotResponseError, BudgetController, type BudgetControllerOptions, BudgetExceededError, type BudgetLimit, type BudgetVerdict, CACHE_TIER_MARKER, ClaudeAgent, type CostCalculationOptions, DEEPSEEK_PEAK_SCHEDULE, DEEPSEEK_REASONING_EFFORTS, DEFAULT_LOGGING_CONFIG, DEFAULT_MAX_OUTPUT_TOKENS, type DeepSeekReasoningEffort, type DeepSeekTokenUsage, DeepSeekV2Agent, FUGU_REASONING_EFFORTS, FuguAgent, type FuguReasoningEffort, GEMINI_AUDIO_TOKENS_PER_SECOND, GEMINI_REASONING_EFFORTS, GLM_REASONING_EFFORTS, type GeminiReasoningEffort, GlmAgent, type GlmReasoningEffort, GoogleAgent, type GoogleSttOptions, type GoogleSttResult, type GoogleTokenUsage, type GoogleTtsAudioOptions, type GoogleTtsResult, GoogleVoiceAgent, Gpt5Agent, GrokAgent, type GrokTokenUsage, InMemorySpendStore, type JsonSchemaOptions, KimiAgent, type KimiTokenUsage, type LLMModel, LLM_CONSTANTS, type LlmLogger, type LoggingConfig, MESSAGE_ROLE, META_REASONING_EFFORTS, MISTRAL_REASONING_EFFORTS, MODEL_PRICING, MetaAgent, type MetaReasoningEffort, type MetaTokenUsage, MiniMaxAgent, MistralAgent, type MistralReasoningEffort, type MistralTokenUsage, type Modality, ModelAuthenticationError, type ModelConfig, ModelError, ModelInvalidResponseError, ModelOverloadError, type ModelPricing, ModelQuotaExceededError, ModelRateLimitError, ModelRefusalError, type ModelTag, ModelUnavailableError, OPENAI_REASONING_EFFORTS, type OpenAIReasoningEffort, type OpenAITokenUsage, type OpenAiSttOptions, type OpenAiSttResult, type OpenAiTtsAudioOptions, type OpenAiTtsVoice, OpenAiVoiceAgent, type PeakPricing, type PricingUnit, type ProviderSchema, type TokenUsage as ProviderTokenUsage, type ProviderType, QwenAgent, REASONING_EFFORT_SCALE, type ReasoningEffort, SUPPORTED_VOICE_PROVIDERS, type SpeechRequest, type SpeechResult, type SpeechUsage, type SpendInput, type SpendKind, type SpendLedger, type SpendLedgers, type SpendStore, type SpendWindow, SupportedAiKeyNames, SupportedAiModels, type TokenPairUsage, type TokenUsage$1 as TokenUsage, type TranscriptionRequest, type TranscriptionResult, type TranscriptionUsage, VOICE_MODEL_CONSTANTS, VOICE_MODEL_PRICING, VOICE_PROVIDER_API_KEY, type VoiceAgent, VoiceAgentFactory, type VoiceModelPricing, type VoiceProvider, XAI_REASONING_EFFORTS, type XaiReasoningEffort, ZodSchemaConverter, applySpend, buildGoogleTtsPrompt, calculateAnthropicCost, calculateCost, calculateDeepSeekCost, calculateGeminiSttCost, calculateGeminiTtsCost, calculateGoogleCost, calculateGrokCost, calculateKimiCost, calculateMetaCost, calculateMistralCost, calculateModelCost, calculateOpenAICost, calculateOpenAiSttCost, calculateOpenAiTtsCost, clampReasoningEffort, cleanResponse, createCatalog, createVoiceAgent, describeEmptyTtsResponse, evaluateBudget, extractAnthropicTokenUsage, extractTokenUsageFromResponse$2 as extractAnthropicTokenUsageFromResponse, extractDeepSeekTokenUsage, extractTokenUsageFromResponse$6 as extractDeepSeekTokenUsageFromResponse, extractFirstJsonObject, extractGoogleTokenUsage, extractTokenUsageFromResponse$1 as extractGoogleTokenUsageFromResponse, extractGrokTokenUsage, extractTokenUsageFromResponse$4 as extractGrokTokenUsageFromResponse, extractKimiTokenUsage, extractTokenUsageFromResponse$5 as extractKimiTokenUsageFromResponse, extractMetaTokenUsage, extractTokenUsageFromResponse$3 as extractMetaTokenUsageFromResponse, extractMistralTokenUsage, extractTokenUsageFromResponse as extractMistralTokenUsageFromResponse, extractOpenAITokenUsage, extractTokenUsageFromResponse$7 as extractOpenAITokenUsageFromResponse, extractTokenUsage, extractUsageAndCalculateCost, firstRefusal, generateGoogleTtsAudio, generateOpenAiTtsAudio, generateSchemaInstructions, getModelConfigByApiName, getModelDisplayName, getModelProviderName, getModelTags, getProviderSignatureFields, isBudgetExceededError, isHybridThinkingModel, isInPeakWindow, isPeakBilling, isWeekendAt, ledgerSpend, logger, mergeThinking, modelHasTag, modelIsFast, needsPromptBasedSchema, parseAndValidateLlmJson, pcmToWav, periodEnd, periodKey, safeValidateResponse, setBeforeAskHook, setLlmLogger, stableHashHex, stripInlineThinking, supportsNativeJsonSchema, toAnthropicEffort, toDeepSeekEffort, toFuguEffort, toGeminiEffort, toGlmEffort, toMetaEffort, toMistralEffort, toOpenAIEffort, toXaiEffort, transcribeWithGemini, transcribeWithOpenAi, validateResponse };
|
|
1745
|
+
export { type AIMessage, ANTHROPIC_REASONING_EFFORTS, API_KEY_CONSTANTS, AbstractAgent, type AgentActivityData, AgentFactory, type AgentLoggingConfig, type AnthropicReasoningEffort, type AnthropicTokenUsage, type ApiKeyMap, type BeforeAskHook, BotResponseError, BudgetController, type BudgetControllerOptions, BudgetExceededError, type BudgetLimit, type BudgetVerdict, CACHE_TIER_MARKER, ClaudeAgent, type CostCalculationOptions, DEEPSEEK_PEAK_SCHEDULE, DEEPSEEK_REASONING_EFFORTS, DEFAULT_LOGGING_CONFIG, DEFAULT_MAX_OUTPUT_TOKENS, type DeepSeekReasoningEffort, type DeepSeekTokenUsage, DeepSeekV2Agent, FUGU_REASONING_EFFORTS, FuguAgent, type FuguReasoningEffort, GEMINI_AUDIO_TOKENS_PER_SECOND, GEMINI_REASONING_EFFORTS, GLM_REASONING_EFFORTS, type GeminiReasoningEffort, GlmAgent, type GlmReasoningEffort, GoogleAgent, type GoogleSttOptions, type GoogleSttResult, type GoogleTokenUsage, type GoogleTtsAudioOptions, type GoogleTtsResult, GoogleVoiceAgent, Gpt5Agent, GrokAgent, type GrokTokenUsage, InMemorySpendStore, type JsonSchemaOptions, KIMI_REASONING_EFFORTS, KimiAgent, type KimiReasoningEffort, type KimiTokenUsage, type LLMModel, LLM_CONSTANTS, type LlmLogger, type LoggingConfig, MESSAGE_ROLE, META_REASONING_EFFORTS, MISTRAL_REASONING_EFFORTS, MODEL_PRICING, MetaAgent, type MetaReasoningEffort, type MetaTokenUsage, MiniMaxAgent, MistralAgent, type MistralReasoningEffort, type MistralTokenUsage, type Modality, ModelAuthenticationError, type ModelConfig, ModelError, ModelInvalidResponseError, ModelOverloadError, type ModelPricing, ModelQuotaExceededError, ModelRateLimitError, ModelRefusalError, type ModelTag, ModelUnavailableError, OPENAI_REASONING_EFFORTS, type OpenAIReasoningEffort, type OpenAITokenUsage, type OpenAiSttOptions, type OpenAiSttResult, type OpenAiTtsAudioOptions, type OpenAiTtsVoice, OpenAiVoiceAgent, type PeakPricing, type PricingUnit, type ProviderSchema, type TokenUsage as ProviderTokenUsage, type ProviderType, QwenAgent, REASONING_EFFORT_SCALE, type ReasoningEffort, SUPPORTED_VOICE_PROVIDERS, type SpeechRequest, type SpeechResult, type SpeechUsage, type SpendInput, type SpendKind, type SpendLedger, type SpendLedgers, type SpendStore, type SpendWindow, SupportedAiKeyNames, SupportedAiModels, type TokenPairUsage, type TokenUsage$1 as TokenUsage, type TranscriptionRequest, type TranscriptionResult, type TranscriptionUsage, VOICE_MODEL_CONSTANTS, VOICE_MODEL_PRICING, VOICE_PROVIDER_API_KEY, type VoiceAgent, VoiceAgentFactory, type VoiceModelPricing, type VoiceProvider, XAI_REASONING_EFFORTS, type XaiReasoningEffort, ZodSchemaConverter, applySpend, buildGoogleTtsPrompt, calculateAnthropicCost, calculateCost, calculateDeepSeekCost, calculateGeminiSttCost, calculateGeminiTtsCost, calculateGoogleCost, calculateGrokCost, calculateKimiCost, calculateMetaCost, calculateMistralCost, calculateModelCost, calculateOpenAICost, calculateOpenAiSttCost, calculateOpenAiTtsCost, clampReasoningEffort, cleanResponse, createCatalog, createVoiceAgent, describeEmptyTtsResponse, evaluateBudget, extractAnthropicTokenUsage, extractTokenUsageFromResponse$2 as extractAnthropicTokenUsageFromResponse, extractDeepSeekTokenUsage, extractTokenUsageFromResponse$6 as extractDeepSeekTokenUsageFromResponse, extractFirstJsonObject, extractGoogleTokenUsage, extractTokenUsageFromResponse$1 as extractGoogleTokenUsageFromResponse, extractGrokTokenUsage, extractTokenUsageFromResponse$4 as extractGrokTokenUsageFromResponse, extractKimiTokenUsage, extractTokenUsageFromResponse$5 as extractKimiTokenUsageFromResponse, extractMetaTokenUsage, extractTokenUsageFromResponse$3 as extractMetaTokenUsageFromResponse, extractMistralTokenUsage, extractTokenUsageFromResponse as extractMistralTokenUsageFromResponse, extractOpenAITokenUsage, extractTokenUsageFromResponse$7 as extractOpenAITokenUsageFromResponse, extractTokenUsage, extractUsageAndCalculateCost, firstRefusal, generateGoogleTtsAudio, generateOpenAiTtsAudio, generateSchemaInstructions, getModelConfigByApiName, getModelDisplayName, getModelProviderName, getModelTags, getProviderSignatureFields, isBudgetExceededError, isHybridThinkingModel, isInPeakWindow, isPeakBilling, isWeekendAt, ledgerSpend, logger, mergeThinking, modelHasTag, modelIsFast, needsPromptBasedSchema, parseAndValidateLlmJson, pcmToWav, periodEnd, periodKey, safeValidateResponse, setBeforeAskHook, setLlmLogger, stableHashHex, stripInlineThinking, supportsNativeJsonSchema, toAnthropicEffort, toDeepSeekEffort, toFuguEffort, toGeminiEffort, toGlmEffort, toKimiEffort, toMetaEffort, toMistralEffort, toOpenAIEffort, toXaiEffort, transcribeWithGemini, transcribeWithOpenAi, validateResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -540,8 +540,11 @@ declare function getProviderSignatureFields(aiType: string, signature?: string):
|
|
|
540
540
|
* - xAI Grok 4.7 (docs.x.ai/developers/model-capabilities/text/reasoning, 2026-09-22):
|
|
541
541
|
* low|medium|high|xhigh, default high, sent on the Responses API as `reasoning: {effort}`.
|
|
542
542
|
* Chat Completions has no equivalent. Grok 4.6 and earlier had no knob at all.
|
|
543
|
-
*
|
|
544
|
-
*
|
|
543
|
+
* - Moonshot Kimi K3 (platform.kimi.ai/docs/guide/use-reasoning-effort, 2026-09-22):
|
|
544
|
+
* low|high|max, default max, top-level on Chat Completions. Moonshot shipped the lower
|
|
545
|
+
* levels after launch; K3 accepted only "max" when this agent was written.
|
|
546
|
+
* Qwen accepts reasoning_effort but ignores it (thinking_budget is its knob); MiniMax exposes
|
|
547
|
+
* no effort parameter.
|
|
545
548
|
*/
|
|
546
549
|
type OpenAIReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
547
550
|
type AnthropicReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
@@ -552,6 +555,7 @@ type FuguReasoningEffort = 'high' | 'xhigh' | 'max';
|
|
|
552
555
|
type MetaReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
553
556
|
type MistralReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
554
557
|
type XaiReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh';
|
|
558
|
+
type KimiReasoningEffort = 'low' | 'high' | 'max';
|
|
555
559
|
/** The shared scale, lowest first. */
|
|
556
560
|
declare const REASONING_EFFORT_SCALE: readonly ReasoningEffort[];
|
|
557
561
|
declare const OPENAI_REASONING_EFFORTS: readonly OpenAIReasoningEffort[];
|
|
@@ -563,6 +567,7 @@ declare const FUGU_REASONING_EFFORTS: readonly FuguReasoningEffort[];
|
|
|
563
567
|
declare const META_REASONING_EFFORTS: readonly MetaReasoningEffort[];
|
|
564
568
|
declare const MISTRAL_REASONING_EFFORTS: readonly MistralReasoningEffort[];
|
|
565
569
|
declare const XAI_REASONING_EFFORTS: readonly XaiReasoningEffort[];
|
|
570
|
+
declare const KIMI_REASONING_EFFORTS: readonly KimiReasoningEffort[];
|
|
566
571
|
/** Clamps `effort` to the nearest level in `allowed` (by rank on the shared scale, ties go up). */
|
|
567
572
|
declare function clampReasoningEffort<T extends ReasoningEffort>(effort: ReasoningEffort, allowed: readonly T[]): T;
|
|
568
573
|
declare const toOpenAIEffort: (effort: ReasoningEffort) => OpenAIReasoningEffort;
|
|
@@ -574,6 +579,7 @@ declare const toMetaEffort: (effort: ReasoningEffort) => MetaReasoningEffort;
|
|
|
574
579
|
declare const toFuguEffort: (effort: ReasoningEffort) => FuguReasoningEffort;
|
|
575
580
|
declare const toMistralEffort: (effort: ReasoningEffort) => MistralReasoningEffort;
|
|
576
581
|
declare const toXaiEffort: (effort: ReasoningEffort) => XaiReasoningEffort;
|
|
582
|
+
declare const toKimiEffort: (effort: ReasoningEffort) => KimiReasoningEffort;
|
|
577
583
|
|
|
578
584
|
/**
|
|
579
585
|
* Unified token usage utilities for all AI providers
|
|
@@ -1736,4 +1742,4 @@ declare class MiniMaxAgent extends AbstractAgent {
|
|
|
1736
1742
|
doAskText(messages: AIMessage[]): Promise<[string, string, TokenUsage$1?, string?]>;
|
|
1737
1743
|
}
|
|
1738
1744
|
|
|
1739
|
-
export { type AIMessage, ANTHROPIC_REASONING_EFFORTS, API_KEY_CONSTANTS, AbstractAgent, type AgentActivityData, AgentFactory, type AgentLoggingConfig, type AnthropicReasoningEffort, type AnthropicTokenUsage, type ApiKeyMap, type BeforeAskHook, BotResponseError, BudgetController, type BudgetControllerOptions, BudgetExceededError, type BudgetLimit, type BudgetVerdict, CACHE_TIER_MARKER, ClaudeAgent, type CostCalculationOptions, DEEPSEEK_PEAK_SCHEDULE, DEEPSEEK_REASONING_EFFORTS, DEFAULT_LOGGING_CONFIG, DEFAULT_MAX_OUTPUT_TOKENS, type DeepSeekReasoningEffort, type DeepSeekTokenUsage, DeepSeekV2Agent, FUGU_REASONING_EFFORTS, FuguAgent, type FuguReasoningEffort, GEMINI_AUDIO_TOKENS_PER_SECOND, GEMINI_REASONING_EFFORTS, GLM_REASONING_EFFORTS, type GeminiReasoningEffort, GlmAgent, type GlmReasoningEffort, GoogleAgent, type GoogleSttOptions, type GoogleSttResult, type GoogleTokenUsage, type GoogleTtsAudioOptions, type GoogleTtsResult, GoogleVoiceAgent, Gpt5Agent, GrokAgent, type GrokTokenUsage, InMemorySpendStore, type JsonSchemaOptions, KimiAgent, type KimiTokenUsage, type LLMModel, LLM_CONSTANTS, type LlmLogger, type LoggingConfig, MESSAGE_ROLE, META_REASONING_EFFORTS, MISTRAL_REASONING_EFFORTS, MODEL_PRICING, MetaAgent, type MetaReasoningEffort, type MetaTokenUsage, MiniMaxAgent, MistralAgent, type MistralReasoningEffort, type MistralTokenUsage, type Modality, ModelAuthenticationError, type ModelConfig, ModelError, ModelInvalidResponseError, ModelOverloadError, type ModelPricing, ModelQuotaExceededError, ModelRateLimitError, ModelRefusalError, type ModelTag, ModelUnavailableError, OPENAI_REASONING_EFFORTS, type OpenAIReasoningEffort, type OpenAITokenUsage, type OpenAiSttOptions, type OpenAiSttResult, type OpenAiTtsAudioOptions, type OpenAiTtsVoice, OpenAiVoiceAgent, type PeakPricing, type PricingUnit, type ProviderSchema, type TokenUsage as ProviderTokenUsage, type ProviderType, QwenAgent, REASONING_EFFORT_SCALE, type ReasoningEffort, SUPPORTED_VOICE_PROVIDERS, type SpeechRequest, type SpeechResult, type SpeechUsage, type SpendInput, type SpendKind, type SpendLedger, type SpendLedgers, type SpendStore, type SpendWindow, SupportedAiKeyNames, SupportedAiModels, type TokenPairUsage, type TokenUsage$1 as TokenUsage, type TranscriptionRequest, type TranscriptionResult, type TranscriptionUsage, VOICE_MODEL_CONSTANTS, VOICE_MODEL_PRICING, VOICE_PROVIDER_API_KEY, type VoiceAgent, VoiceAgentFactory, type VoiceModelPricing, type VoiceProvider, XAI_REASONING_EFFORTS, type XaiReasoningEffort, ZodSchemaConverter, applySpend, buildGoogleTtsPrompt, calculateAnthropicCost, calculateCost, calculateDeepSeekCost, calculateGeminiSttCost, calculateGeminiTtsCost, calculateGoogleCost, calculateGrokCost, calculateKimiCost, calculateMetaCost, calculateMistralCost, calculateModelCost, calculateOpenAICost, calculateOpenAiSttCost, calculateOpenAiTtsCost, clampReasoningEffort, cleanResponse, createCatalog, createVoiceAgent, describeEmptyTtsResponse, evaluateBudget, extractAnthropicTokenUsage, extractTokenUsageFromResponse$2 as extractAnthropicTokenUsageFromResponse, extractDeepSeekTokenUsage, extractTokenUsageFromResponse$6 as extractDeepSeekTokenUsageFromResponse, extractFirstJsonObject, extractGoogleTokenUsage, extractTokenUsageFromResponse$1 as extractGoogleTokenUsageFromResponse, extractGrokTokenUsage, extractTokenUsageFromResponse$4 as extractGrokTokenUsageFromResponse, extractKimiTokenUsage, extractTokenUsageFromResponse$5 as extractKimiTokenUsageFromResponse, extractMetaTokenUsage, extractTokenUsageFromResponse$3 as extractMetaTokenUsageFromResponse, extractMistralTokenUsage, extractTokenUsageFromResponse as extractMistralTokenUsageFromResponse, extractOpenAITokenUsage, extractTokenUsageFromResponse$7 as extractOpenAITokenUsageFromResponse, extractTokenUsage, extractUsageAndCalculateCost, firstRefusal, generateGoogleTtsAudio, generateOpenAiTtsAudio, generateSchemaInstructions, getModelConfigByApiName, getModelDisplayName, getModelProviderName, getModelTags, getProviderSignatureFields, isBudgetExceededError, isHybridThinkingModel, isInPeakWindow, isPeakBilling, isWeekendAt, ledgerSpend, logger, mergeThinking, modelHasTag, modelIsFast, needsPromptBasedSchema, parseAndValidateLlmJson, pcmToWav, periodEnd, periodKey, safeValidateResponse, setBeforeAskHook, setLlmLogger, stableHashHex, stripInlineThinking, supportsNativeJsonSchema, toAnthropicEffort, toDeepSeekEffort, toFuguEffort, toGeminiEffort, toGlmEffort, toMetaEffort, toMistralEffort, toOpenAIEffort, toXaiEffort, transcribeWithGemini, transcribeWithOpenAi, validateResponse };
|
|
1745
|
+
export { type AIMessage, ANTHROPIC_REASONING_EFFORTS, API_KEY_CONSTANTS, AbstractAgent, type AgentActivityData, AgentFactory, type AgentLoggingConfig, type AnthropicReasoningEffort, type AnthropicTokenUsage, type ApiKeyMap, type BeforeAskHook, BotResponseError, BudgetController, type BudgetControllerOptions, BudgetExceededError, type BudgetLimit, type BudgetVerdict, CACHE_TIER_MARKER, ClaudeAgent, type CostCalculationOptions, DEEPSEEK_PEAK_SCHEDULE, DEEPSEEK_REASONING_EFFORTS, DEFAULT_LOGGING_CONFIG, DEFAULT_MAX_OUTPUT_TOKENS, type DeepSeekReasoningEffort, type DeepSeekTokenUsage, DeepSeekV2Agent, FUGU_REASONING_EFFORTS, FuguAgent, type FuguReasoningEffort, GEMINI_AUDIO_TOKENS_PER_SECOND, GEMINI_REASONING_EFFORTS, GLM_REASONING_EFFORTS, type GeminiReasoningEffort, GlmAgent, type GlmReasoningEffort, GoogleAgent, type GoogleSttOptions, type GoogleSttResult, type GoogleTokenUsage, type GoogleTtsAudioOptions, type GoogleTtsResult, GoogleVoiceAgent, Gpt5Agent, GrokAgent, type GrokTokenUsage, InMemorySpendStore, type JsonSchemaOptions, KIMI_REASONING_EFFORTS, KimiAgent, type KimiReasoningEffort, type KimiTokenUsage, type LLMModel, LLM_CONSTANTS, type LlmLogger, type LoggingConfig, MESSAGE_ROLE, META_REASONING_EFFORTS, MISTRAL_REASONING_EFFORTS, MODEL_PRICING, MetaAgent, type MetaReasoningEffort, type MetaTokenUsage, MiniMaxAgent, MistralAgent, type MistralReasoningEffort, type MistralTokenUsage, type Modality, ModelAuthenticationError, type ModelConfig, ModelError, ModelInvalidResponseError, ModelOverloadError, type ModelPricing, ModelQuotaExceededError, ModelRateLimitError, ModelRefusalError, type ModelTag, ModelUnavailableError, OPENAI_REASONING_EFFORTS, type OpenAIReasoningEffort, type OpenAITokenUsage, type OpenAiSttOptions, type OpenAiSttResult, type OpenAiTtsAudioOptions, type OpenAiTtsVoice, OpenAiVoiceAgent, type PeakPricing, type PricingUnit, type ProviderSchema, type TokenUsage as ProviderTokenUsage, type ProviderType, QwenAgent, REASONING_EFFORT_SCALE, type ReasoningEffort, SUPPORTED_VOICE_PROVIDERS, type SpeechRequest, type SpeechResult, type SpeechUsage, type SpendInput, type SpendKind, type SpendLedger, type SpendLedgers, type SpendStore, type SpendWindow, SupportedAiKeyNames, SupportedAiModels, type TokenPairUsage, type TokenUsage$1 as TokenUsage, type TranscriptionRequest, type TranscriptionResult, type TranscriptionUsage, VOICE_MODEL_CONSTANTS, VOICE_MODEL_PRICING, VOICE_PROVIDER_API_KEY, type VoiceAgent, VoiceAgentFactory, type VoiceModelPricing, type VoiceProvider, XAI_REASONING_EFFORTS, type XaiReasoningEffort, ZodSchemaConverter, applySpend, buildGoogleTtsPrompt, calculateAnthropicCost, calculateCost, calculateDeepSeekCost, calculateGeminiSttCost, calculateGeminiTtsCost, calculateGoogleCost, calculateGrokCost, calculateKimiCost, calculateMetaCost, calculateMistralCost, calculateModelCost, calculateOpenAICost, calculateOpenAiSttCost, calculateOpenAiTtsCost, clampReasoningEffort, cleanResponse, createCatalog, createVoiceAgent, describeEmptyTtsResponse, evaluateBudget, extractAnthropicTokenUsage, extractTokenUsageFromResponse$2 as extractAnthropicTokenUsageFromResponse, extractDeepSeekTokenUsage, extractTokenUsageFromResponse$6 as extractDeepSeekTokenUsageFromResponse, extractFirstJsonObject, extractGoogleTokenUsage, extractTokenUsageFromResponse$1 as extractGoogleTokenUsageFromResponse, extractGrokTokenUsage, extractTokenUsageFromResponse$4 as extractGrokTokenUsageFromResponse, extractKimiTokenUsage, extractTokenUsageFromResponse$5 as extractKimiTokenUsageFromResponse, extractMetaTokenUsage, extractTokenUsageFromResponse$3 as extractMetaTokenUsageFromResponse, extractMistralTokenUsage, extractTokenUsageFromResponse as extractMistralTokenUsageFromResponse, extractOpenAITokenUsage, extractTokenUsageFromResponse$7 as extractOpenAITokenUsageFromResponse, extractTokenUsage, extractUsageAndCalculateCost, firstRefusal, generateGoogleTtsAudio, generateOpenAiTtsAudio, generateSchemaInstructions, getModelConfigByApiName, getModelDisplayName, getModelProviderName, getModelTags, getProviderSignatureFields, isBudgetExceededError, isHybridThinkingModel, isInPeakWindow, isPeakBilling, isWeekendAt, ledgerSpend, logger, mergeThinking, modelHasTag, modelIsFast, needsPromptBasedSchema, parseAndValidateLlmJson, pcmToWav, periodEnd, periodKey, safeValidateResponse, setBeforeAskHook, setLlmLogger, stableHashHex, stripInlineThinking, supportsNativeJsonSchema, toAnthropicEffort, toDeepSeekEffort, toFuguEffort, toGeminiEffort, toGlmEffort, toKimiEffort, toMetaEffort, toMistralEffort, toOpenAIEffort, toXaiEffort, transcribeWithGemini, transcribeWithOpenAi, validateResponse };
|
package/dist/index.js
CHANGED
|
@@ -55,6 +55,7 @@ __export(src_exports, {
|
|
|
55
55
|
Gpt5Agent: () => Gpt5Agent,
|
|
56
56
|
GrokAgent: () => GrokAgent,
|
|
57
57
|
InMemorySpendStore: () => InMemorySpendStore,
|
|
58
|
+
KIMI_REASONING_EFFORTS: () => KIMI_REASONING_EFFORTS,
|
|
58
59
|
KimiAgent: () => KimiAgent,
|
|
59
60
|
LLM_CONSTANTS: () => LLM_CONSTANTS,
|
|
60
61
|
MESSAGE_ROLE: () => MESSAGE_ROLE,
|
|
@@ -161,6 +162,7 @@ __export(src_exports, {
|
|
|
161
162
|
toFuguEffort: () => toFuguEffort,
|
|
162
163
|
toGeminiEffort: () => toGeminiEffort,
|
|
163
164
|
toGlmEffort: () => toGlmEffort,
|
|
165
|
+
toKimiEffort: () => toKimiEffort,
|
|
164
166
|
toMetaEffort: () => toMetaEffort,
|
|
165
167
|
toMistralEffort: () => toMistralEffort,
|
|
166
168
|
toOpenAIEffort: () => toOpenAIEffort,
|
|
@@ -1142,6 +1144,7 @@ var SupportedAiModels = {
|
|
|
1142
1144
|
modelApiName: "grok-4.7",
|
|
1143
1145
|
apiKeyName: API_KEY_CONSTANTS.GROK,
|
|
1144
1146
|
hasThinking: true,
|
|
1147
|
+
reasoningEffort: "high",
|
|
1145
1148
|
temperature: 0.7
|
|
1146
1149
|
},
|
|
1147
1150
|
// Mistral models. Two hybrid entries since 2026-09-18: reasoning is off by default on the
|
|
@@ -1190,6 +1193,9 @@ var SupportedAiModels = {
|
|
|
1190
1193
|
hasThinking: true,
|
|
1191
1194
|
// Temperature is omitted from the request: kimi-k3 rejects any value other than 1.
|
|
1192
1195
|
// Speed samples: 17s (2026-08-04) and 28.9s (2026-08-05) — graded into the >25s tier.
|
|
1196
|
+
// Pinned 'high' 2026-09-22, down from Moonshot's 'max' default: K3 had no levels at
|
|
1197
|
+
// launch and the agent hardcoded max, so this is the first time the knob exists.
|
|
1198
|
+
reasoningEffort: "high",
|
|
1193
1199
|
tags: ["very-slow", "expensive"]
|
|
1194
1200
|
},
|
|
1195
1201
|
// Z.AI models — thinking-only entry (non-thinking variant retired 2026-08-05)
|
|
@@ -1704,6 +1710,7 @@ var FUGU_REASONING_EFFORTS = ["high", "xhigh", "max"];
|
|
|
1704
1710
|
var META_REASONING_EFFORTS = ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
1705
1711
|
var MISTRAL_REASONING_EFFORTS = ["minimal", "low", "medium", "high", "xhigh"];
|
|
1706
1712
|
var XAI_REASONING_EFFORTS = ["low", "medium", "high", "xhigh"];
|
|
1713
|
+
var KIMI_REASONING_EFFORTS = ["low", "high", "max"];
|
|
1707
1714
|
function clampReasoningEffort(effort, allowed) {
|
|
1708
1715
|
const rank = REASONING_EFFORT_SCALE.indexOf(effort);
|
|
1709
1716
|
let best = allowed[0];
|
|
@@ -1726,6 +1733,7 @@ var toMetaEffort = (effort) => clampReasoningEffort(effort, META_REASONING_EFFOR
|
|
|
1726
1733
|
var toFuguEffort = (effort) => clampReasoningEffort(effort, FUGU_REASONING_EFFORTS);
|
|
1727
1734
|
var toMistralEffort = (effort) => clampReasoningEffort(effort, MISTRAL_REASONING_EFFORTS);
|
|
1728
1735
|
var toXaiEffort = (effort) => clampReasoningEffort(effort, XAI_REASONING_EFFORTS);
|
|
1736
|
+
var toKimiEffort = (effort) => clampReasoningEffort(effort, KIMI_REASONING_EFFORTS);
|
|
1729
1737
|
|
|
1730
1738
|
// src/pricing/token-usage-utils.ts
|
|
1731
1739
|
function extractTokenUsage(response) {
|
|
@@ -4100,8 +4108,8 @@ var KimiAgent = class extends AbstractAgent {
|
|
|
4100
4108
|
model: this.model,
|
|
4101
4109
|
stream: false,
|
|
4102
4110
|
max_tokens: this.maxOutputTokens,
|
|
4103
|
-
//
|
|
4104
|
-
reasoning_effort: "max"
|
|
4111
|
+
// "max" is not in the OpenAI SDK's ReasoningEffort union, hence the cast.
|
|
4112
|
+
reasoning_effort: toKimiEffort(this.reasoningEffort ?? "max")
|
|
4105
4113
|
};
|
|
4106
4114
|
}
|
|
4107
4115
|
// Log message templates
|
|
@@ -5378,6 +5386,7 @@ var AgentFactory = class {
|
|
|
5378
5386
|
Gpt5Agent,
|
|
5379
5387
|
GrokAgent,
|
|
5380
5388
|
InMemorySpendStore,
|
|
5389
|
+
KIMI_REASONING_EFFORTS,
|
|
5381
5390
|
KimiAgent,
|
|
5382
5391
|
LLM_CONSTANTS,
|
|
5383
5392
|
MESSAGE_ROLE,
|
|
@@ -5484,6 +5493,7 @@ var AgentFactory = class {
|
|
|
5484
5493
|
toFuguEffort,
|
|
5485
5494
|
toGeminiEffort,
|
|
5486
5495
|
toGlmEffort,
|
|
5496
|
+
toKimiEffort,
|
|
5487
5497
|
toMetaEffort,
|
|
5488
5498
|
toMistralEffort,
|
|
5489
5499
|
toOpenAIEffort,
|