@umituz/web-ai 1.0.8 → 1.0.10
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/{AIErrors-CSk4nvN1.d.ts → AIErrors-TuSFl--T.d.ts} +1 -1
- package/dist/{AIErrors-Dq9o95R_.d.cts → AIErrors-_IyXRWj1.d.cts} +1 -1
- package/dist/{cancellation-error-CpkPd67D.d.cts → cancellation-error-_39nYWwz.d.cts} +3 -3
- package/dist/{cancellation-error-Ci8fQhNF.d.ts → cancellation-error-hYcE9AS9.d.ts} +3 -3
- package/dist/chat/index.d.cts +4 -4
- package/dist/chat/index.d.ts +4 -4
- package/dist/{chat.service-BRtiA7H9.d.cts → chat.service-8MaW9pum.d.cts} +2 -2
- package/dist/{chat.service-Cqga2h1e.d.ts → chat.service-B4Isrckn.d.ts} +2 -2
- package/dist/content/index.d.cts +7 -7
- package/dist/content/index.d.ts +7 -7
- package/dist/core/index.cjs +90 -10
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +14 -27
- package/dist/core/index.d.ts +14 -27
- package/dist/core/index.js +86 -11
- package/dist/core/index.js.map +1 -1
- package/dist/{create-ai-DW7eHMBF.d.ts → create-ai-D-oEWzf9.d.ts} +3 -3
- package/dist/{create-ai-DeOpUgZ-.d.cts → create-ai-DRysRImc.d.cts} +3 -3
- package/dist/hooks/index.d.cts +9 -9
- package/dist/hooks/index.d.ts +9 -9
- package/dist/{index-Ca5o4gBK.d.ts → index-1e91KRYU.d.ts} +1 -1
- package/dist/{index-itgxPeLz.d.cts → index-Dv8gRzAu.d.cts} +1 -1
- package/dist/{index-DDzvTDg0.d.ts → index-OhvYUTXf.d.cts} +1 -2
- package/dist/{index-DDzvTDg0.d.cts → index-OhvYUTXf.d.ts} +1 -2
- package/dist/index.cjs +391 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +385 -13
- package/dist/index.js.map +1 -1
- package/dist/{provider.factory-CJuI08Xr.d.ts → provider.factory-B9RNUTYj.d.ts} +1 -1
- package/dist/{provider.factory-DG2CYFgh.d.cts → provider.factory-Ce6Een1G.d.cts} +1 -1
- package/dist/providers/index.cjs +381 -0
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +61 -11
- package/dist/providers/index.d.ts +61 -11
- package/dist/providers/index.js +380 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/{requestQueue-D-RCbxuR.d.ts → requestQueue-AP6n_bRH.d.ts} +4 -4
- package/dist/{requestQueue-O6f8VBl5.d.cts → requestQueue-D89wx91Q.d.cts} +4 -4
- package/dist/{request-deduplicator.util-NDo0_n1y.d.cts → tool-call-accumulator-C7KhaXZA.d.cts} +20 -1
- package/dist/{request-deduplicator.util-NDo0_n1y.d.ts → tool-call-accumulator-C7KhaXZA.d.ts} +20 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { C as ChatMessage, F as FinishReason, G as GenerationResult, P as ProviderHealth, S as StructuredGeneration, a as StructuredTextRequest, T as TextRequest, b as TextTier, c as TokenUsage } from './index-
|
|
2
|
-
export { A as AIError, a as AIErrorMetadata, b as AIErrorType, b as GroqErrorType, T as TEXT_TIERS, c as TierModelMap, U as USER_FRIENDLY_ERROR_MESSAGES, i as isTextTier, m as mergeTierOverrides, r as resolveModel } from './index-
|
|
3
|
-
export { AIErrorBody, AccessCounted, AccessTimestamped, AgentContext, AiError, AiErrorCode, ApiKeyValidationRule,
|
|
1
|
+
export { C as ChatMessage, F as FinishReason, G as GenerationResult, P as ProviderHealth, S as StructuredGeneration, a as StructuredTextRequest, T as TextRequest, b as TextTier, c as TokenUsage } from './index-OhvYUTXf.cjs';
|
|
2
|
+
export { A as AIError, a as AIErrorMetadata, b as AIErrorType, b as GroqErrorType, T as TEXT_TIERS, c as TierModelMap, U as USER_FRIENDLY_ERROR_MESSAGES, i as isTextTier, m as mergeTierOverrides, r as resolveModel } from './index-Dv8gRzAu.cjs';
|
|
3
|
+
export { AIErrorBody, AccessCounted, AccessTimestamped, AgentContext, AiError, AiErrorCode, ApiKeyValidationRule, CHUNK_MAX_CHARS, CHUNK_OVERLAP_CHARS, CHUNK_TEXT_LIMIT, CODE_MESSAGES, ChunkOptions, CompositeExecutor, ContextBudget, ContextMessage, ContextRole, DEFAULT_AI_IDENTITY, DEFAULT_API_KEY_RULE, DEFAULT_EMBED_BATCH_SIZE, DEFAULT_ERROR_CLASSIFICATION_RULE, DEFAULT_GENERATION, DEFAULT_HTTP_STATUS_RULE, DEFAULT_RETRY_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY_MS, DEFAULT_RETRY_JITTER_FACTOR, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RETRY_MAX_DELAY_MS, DEFAULT_TASK_POLICIES, DebounceManager, DebounceOptions, DedupeExecutor, DedupeExecutorOptions, DiffChangeCount, DiffLine, EmbeddingsBatchAdapter, ErrorClassificationRule, ExponentialBackoffParams, FailoverErrorLike, FetchLike, GENERATION_BOUNDS, GenerationSettings, GroqError, GroqErrorMetadata, HttpStatusClassificationRule, IRequestExecutor, JSON_CODE_BLOCK_PATTERN, JSON_OBJECT_PATTERN, JsonResponseParser, LeadingEdgeParams, LoggedError, MEMORY_MAX_ITEMS, MEMORY_TOTAL_LIMIT, MICROS_PER_UNIT, MarkdownSegment, MemoryLike, ModelPricing, ModelWithProvider, NormalizedSseChunk, ParsedSseEvent, ProjectContext, ProviderErrorShape, QueueExecutor, RESEARCH_MAX_OUTPUT_TOKENS, RESEARCH_QUERY_MAX, RESEARCH_QUERY_MIN, RESEARCH_REPORT_MIN_CHARS, RESEARCH_SNIPPET_MAX_CHARS, RESEARCH_TEMPERATURE, ResearchSource, ResearchStreamEvent, RetryExecutor, SEARCH_MAX_RESULTS, SSE_BRIDGE_EVENTS, SSE_DONE_MARKER, SSE_PREFIX, STATUS_TO_CODE, SYSTEM_PROMPT_VERSION, SearchTopic, SseDeltaExtractor, SseResponseOptions, StreamCallbacks, StreamEvent, StreamingParserCallbacks, StreamingResponseParser, StructuredPromptBuilder, SystemPromptInput, TEXT_EXTRACT_PER_FILE_LIMIT, TEXT_EXTRACT_TOTAL_LIMIT, TRANSIENT_ERROR_CODES, TaskPlan, TaskPolicy, TaskState, ThrottleManager, ThrottleOptions, ToolSchema, ToolValidationResult, ToolValidatorFunction, TrailingDelayParams, UsageRecordData, UsageRecordInput, VectorCandidate, VectorMatch, WebSearchInput, WebSearchResponse, WebSearchResult, ZodLikeIssue, ZodLikeSchema, accumulateReport, aiErrorMessage, asObjectArray, asRecord, asStringArray, asTrimmedOptionalString, batchEmbed, buildCacheKey, buildContext, buildHttpStatusFallback, buildResearchMessages, buildSystemPrompt, buildUsageData, calculateCacheHitRate, calculateExponentialBackoff, calculateTrailingDelay, canFailover, canStartTask, capText, chunkText, clampScore, classifyHttpStatus, computeCostMicros, cosineSimilarity, countChanges, createSseResponse, debounce, debounceManager, defaultSseDeltaExtractor, deriveSnippetTitle, describeAIErrorType, diffLines, dotProduct, errorFromStatus, errorFromUnknown, estimateMessageTokens, estimateTokens, extractErrorMessageFromJsonBody, extractErrorMessageFromResponse, extractJsonArray, extractJsonCandidate, extractJsonFromCodeFence, extractJsonObject, extractSseDataPayload, extractText, failoverCandidate, findTopKSimilar, formatCost, formatErrorForLogging, formatSseEvent, generateRandomBase36Suffix, isAuthErrorType, isRetryableErrorType, isSseDataLine, isSseDoneMarker, isTextLike, isTransientError, isValidApiKey, isWithinWindow, magnitude, nextAttemptDelayMs, normalizeGenerationSettings, normalizeSources, normalizeSseChunk, oneOfCatalog, parseSseEvent, planTaskFailure, readSseResponse, repairCommonJsonDefects, replayFirst, resolveUserFriendlyErrorMessage, resolveUserFriendlyMessage, searchWeb, selectLeastRecentlyUsedKey, selectMemories, shouldCallOnLeadingEdge, splitMarkdown, splitSseLines, sseStreamResponse, throttle, throttleManager, validateApiKey, validateToolArgs } from './core/index.cjs';
|
|
4
4
|
export { C as CacheManager, a as CacheOptions, b as CacheStats, c as cacheManager } from './cache-manager-Df9LLYGA.cjs';
|
|
5
|
-
export { Q as QueueOptions, R as RequestDeduplicator, a as RequestQueue, b as RetryManager, c as RetryOptions, r as requestDeduplicator, d as requestQueue, e as retryManager, w as withRetry } from './
|
|
6
|
-
export { A as AnyProvider, C as CostEstimateRequest, I as IAIProvider, a as IMediaProvider, b as IProviderBase, c as ITextGenerator, d as ITextProvider, P as ProviderCapability, e as ProviderFactory, f as ProviderFactoryConfig, T as TextGenerationOptions, g as createProviderFactory, i as isMediaProvider, h as isTextProvider } from './provider.factory-
|
|
7
|
-
export { API_ENDPOINTS, AnthropicHttpTransport, AnthropicProvider, AnthropicRequestBuilder, AppContainer, AudioTranscriptionAdapter, AudioTranscriptionRequest, AudioTranscriptionResult, AuthenticationError, BaseAIProvider, BaseAIProvider as BaseProvider, BaseProviderConfig, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, EmbeddingsAdapter, EmbeddingsRequest, EmbeddingsResult, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerationFailedError, GroqChatRequestBuilder, GroqConfigStore, GroqHttpClient, GroqHttpClientDeps, GroqHttpTransport, GroqProvider, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_SIZES, ImageAdapter, ImageRequest, ImageResult, ImageSize, OpenAiCompatibleConfig, ProviderError, PrunaProgressStage, PrunaProvider, PrunaRequest, SPEECH_INPUT_MAX, SPEECH_VOICES, SpeechAdapter, SpeechRequest, SpeechResult, SpeechVoice, StructuredJsonRequest, TIMEOUTS, TimeoutError, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generatePruna, generateWithPruna, getProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage } from './providers/index.cjs';
|
|
8
|
-
export { A as AIProviderConfig, a as ANTHROPIC_API_VERSION, b as ANTHROPIC_DEFAULT_MAX_TOKENS, c as ANTHROPIC_MODELS, d as ANTHROPIC_TIERS, e as AnthropicEffort, f as AnthropicMessagesRequest, g as AnthropicMessagesResponse, h as AnthropicProviderConfig, i as AnthropicStopReason, j as AnthropicStreamEvent, G as GroqChatChunk, k as GroqChatRequest, l as GroqChatResponse, m as GroqChoice, n as GroqChunkChoice, o as GroqConfig, p as GroqErrorResponse, q as GroqGenerationConfig, r as GroqMessage, s as GroqMessageRole, t as GroqProviderConfig, u as GroqReasoningEffort, v as GroqUsage, S as StreamRequestOptions, w as createAI } from './create-ai-
|
|
9
|
-
export { C as CancellationError, G as GenerateOptions, a as GenerationStage, I as IGroqChatService, b as IGroqHttpClient, c as ImageToImageInput, d as ImageToVideoInput, P as PrunaAspectRatio, e as PrunaInput, f as PrunaModelId, g as PrunaOutput, h as PrunaPredictionResponse, i as PrunaResolution, j as PrunaResult, S as StreamingCallbacks, k as StructuredGenerationOptions, T as TextGenerationService, l as TextToImageInput, m as TextToVideoInput } from './cancellation-error-
|
|
10
|
-
export { C as ChatConfig, a as ChatConversation, b as ChatMessageSender, c as ChatMessageType, d as ChatService, e as ChatTokenUsage, f as ConversationMessage, D as DEFAULT_PROMPT_STRATEGY, I as IChatService, g as IChatStorage, h as IMessageFormatter, S as SendMessageInput, i as SendMessageResult, j as SystemPromptStrategy, U as UseChatOptions, k as UseChatReturn, l as extractTokenUsage } from './chat.service-
|
|
5
|
+
export { A as AssistantToolCall, Q as QueueOptions, R as RequestDeduplicator, a as RequestQueue, b as RetryManager, c as RetryOptions, T as ToolCallAccumulator, W as WireToolCallDelta, r as requestDeduplicator, d as requestQueue, e as retryManager, w as withRetry } from './tool-call-accumulator-C7KhaXZA.cjs';
|
|
6
|
+
export { A as AnyProvider, C as CostEstimateRequest, I as IAIProvider, a as IMediaProvider, b as IProviderBase, c as ITextGenerator, d as ITextProvider, P as ProviderCapability, e as ProviderFactory, f as ProviderFactoryConfig, T as TextGenerationOptions, g as createProviderFactory, i as isMediaProvider, h as isTextProvider } from './provider.factory-Ce6Een1G.cjs';
|
|
7
|
+
export { API_ENDPOINTS, AdapterChatMessage, AdapterChatRole, AdapterConfig, AdapterRequest, AnthropicHttpTransport, AnthropicProvider, AnthropicRequestBuilder, AppContainer, AudioTranscriptionAdapter, AudioTranscriptionRequest, AudioTranscriptionResult, AuthenticationError, BaseAIProvider, BaseAIProvider as BaseProvider, BaseProviderConfig, ChatAdapter, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, EmbeddingsAdapter, EmbeddingsRequest, EmbeddingsResult, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerationFailedError, GroqChatRequestBuilder, GroqConfigStore, GroqHttpClient, GroqHttpClientDeps, GroqHttpTransport, GroqProvider, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_SIZES, ImageAdapter, ImageRequest, ImageResult, ImageSize, OpenAiCompatibleConfig, ProviderError, ProviderEvent, PrunaProgressStage, PrunaProvider, PrunaRequest, RequestImage, SPEECH_INPUT_MAX, SPEECH_VOICES, SpeechAdapter, SpeechRequest, SpeechResult, SpeechVoice, StructuredJsonRequest, TIMEOUTS, TimeoutError, ToolDefinition, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAnthropicAdapter, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiCompatibleAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generatePruna, generateWithPruna, getProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage } from './providers/index.cjs';
|
|
8
|
+
export { A as AIProviderConfig, a as ANTHROPIC_API_VERSION, b as ANTHROPIC_DEFAULT_MAX_TOKENS, c as ANTHROPIC_MODELS, d as ANTHROPIC_TIERS, e as AnthropicEffort, f as AnthropicMessagesRequest, g as AnthropicMessagesResponse, h as AnthropicProviderConfig, i as AnthropicStopReason, j as AnthropicStreamEvent, G as GroqChatChunk, k as GroqChatRequest, l as GroqChatResponse, m as GroqChoice, n as GroqChunkChoice, o as GroqConfig, p as GroqErrorResponse, q as GroqGenerationConfig, r as GroqMessage, s as GroqMessageRole, t as GroqProviderConfig, u as GroqReasoningEffort, v as GroqUsage, S as StreamRequestOptions, w as createAI } from './create-ai-DRysRImc.cjs';
|
|
9
|
+
export { C as CancellationError, G as GenerateOptions, a as GenerationStage, I as IGroqChatService, b as IGroqHttpClient, c as ImageToImageInput, d as ImageToVideoInput, P as PrunaAspectRatio, e as PrunaInput, f as PrunaModelId, g as PrunaOutput, h as PrunaPredictionResponse, i as PrunaResolution, j as PrunaResult, S as StreamingCallbacks, k as StructuredGenerationOptions, T as TextGenerationService, l as TextToImageInput, m as TextToVideoInput } from './cancellation-error-_39nYWwz.cjs';
|
|
10
|
+
export { C as ChatConfig, a as ChatConversation, b as ChatMessageSender, c as ChatMessageType, d as ChatService, e as ChatTokenUsage, f as ConversationMessage, D as DEFAULT_PROMPT_STRATEGY, I as IChatService, g as IChatStorage, h as IMessageFormatter, S as SendMessageInput, i as SendMessageResult, j as SystemPromptStrategy, U as UseChatOptions, k as UseChatReturn, l as extractTokenUsage } from './chat.service-8MaW9pum.cjs';
|
|
11
11
|
export { ChatIdGenerator, chatIdGenerator, messageFormatter } from './chat/index.cjs';
|
|
12
12
|
export { B as BlogGenerationRequest, a as BlogType, C as CONTENT_WIZARD_STEPS, b as ContentCalendarEntry, c as ContentTone, d as ContentType, e as ContentWizardData, f as ContentWizardStep, g as ContentWizardType, E as Emotion, G as GeneratedBlog, h as GeneratedSocialContent, i as GeneratedVideoScript, I as IMAGE_WIZARD_STEPS, j as ImageWizardData, k as ImageWizardStep, P as PLATFORM_SPECS, l as PlatformSpecs, S as Sentiment, m as SocialContentRequest, n as SocialPlatform, V as VIDEO_WIZARD_STEPS, o as ValidationResult, p as VideoGenerationType, q as VideoScriptRequest, r as VideoWizardData, s as VideoWizardStep, W as WizardConfig, t as WizardData, u as WizardStep, v as buildContentRequest, w as buildImageRequest, x as buildVideoRequest } from './index-BulSkB2L.cjs';
|
|
13
|
-
export { A as ABTestComparison, a as ABTestPrediction, b as ABTestRequest, c as ABTestVariant, d as AIErrorCode, e as ASPECT_RATIO_OPTIONS, f as AspectRatio, C as ContentAnalysisRequest, g as ContentAnalysisResult, G as ContentGenerationResult, h as CreditCost, i as GENERATION_COSTS, j as GenerationMetadata, k as GenerationProgress, l as GenerationStatus, m as GenerationType, I as IMAGE_QUALITY_OPTIONS, n as ImageGenerationInput, o as ImageQuality, K as KeywordAnalysis, M as MOTION_OPTIONS, P as ProviderQuotaExhaustedError, p as ProviderUnavailableError, S as SEOOptimizationRequest, q as SEOOptimizationResult, r as SEOScoreBreakdown, s as STYLE_PRESETS, t as SentimentAnalysisResult, V as VIDEO_DURATION_OPTIONS_SECONDS, u as VIDEO_QUALITY_OPTIONS, v as VideoGenerationInput, w as VideoQuality, x as calculateCreditCost } from './AIErrors-
|
|
14
|
-
export { A as ABTestService, a as AIContentService, b as ASPECT_RATIO_VALUES, c as AnalysisService, B as BlogService, C as ContentCalendarService, G as GenerationExecutor, I as IAIContentService, d as IMAGE_QUALITY_VALUES, e as ImagePromptService, M as MediaGenerationService, P as PromptBuilder, Q as QueueConfig, R as RequestPriority, S as SeoService, f as SocialService, V as VIDEO_DURATION_OPTIONS, g as VIDEO_QUALITY_VALUES, h as VideoScriptService, i as batchRequest, j as extractJSON, k as getDimensionsForAspectRatio, l as getRecommendedQuality, m as isValidJSON, p as parseAIResponse, s as safeJSONParse } from './requestQueue-
|
|
13
|
+
export { A as ABTestComparison, a as ABTestPrediction, b as ABTestRequest, c as ABTestVariant, d as AIErrorCode, e as ASPECT_RATIO_OPTIONS, f as AspectRatio, C as ContentAnalysisRequest, g as ContentAnalysisResult, G as ContentGenerationResult, h as CreditCost, i as GENERATION_COSTS, j as GenerationMetadata, k as GenerationProgress, l as GenerationStatus, m as GenerationType, I as IMAGE_QUALITY_OPTIONS, n as ImageGenerationInput, o as ImageQuality, K as KeywordAnalysis, M as MOTION_OPTIONS, P as ProviderQuotaExhaustedError, p as ProviderUnavailableError, S as SEOOptimizationRequest, q as SEOOptimizationResult, r as SEOScoreBreakdown, s as STYLE_PRESETS, t as SentimentAnalysisResult, V as VIDEO_DURATION_OPTIONS_SECONDS, u as VIDEO_QUALITY_OPTIONS, v as VideoGenerationInput, w as VideoQuality, x as calculateCreditCost } from './AIErrors-_IyXRWj1.cjs';
|
|
14
|
+
export { A as ABTestService, a as AIContentService, b as ASPECT_RATIO_VALUES, c as AnalysisService, B as BlogService, C as ContentCalendarService, G as GenerationExecutor, I as IAIContentService, d as IMAGE_QUALITY_VALUES, e as ImagePromptService, M as MediaGenerationService, P as PromptBuilder, Q as QueueConfig, R as RequestPriority, S as SeoService, f as SocialService, V as VIDEO_DURATION_OPTIONS, g as VIDEO_QUALITY_VALUES, h as VideoScriptService, i as batchRequest, j as extractJSON, k as getDimensionsForAspectRatio, l as getRecommendedQuality, m as isValidJSON, p as parseAIResponse, s as safeJSONParse } from './requestQueue-D89wx91Q.cjs';
|
|
15
15
|
import './ProviderConfig-DIFa9nmG.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { C as ChatMessage, F as FinishReason, G as GenerationResult, P as ProviderHealth, S as StructuredGeneration, a as StructuredTextRequest, T as TextRequest, b as TextTier, c as TokenUsage } from './index-
|
|
2
|
-
export { A as AIError, a as AIErrorMetadata, b as AIErrorType, b as GroqErrorType, T as TEXT_TIERS, c as TierModelMap, U as USER_FRIENDLY_ERROR_MESSAGES, i as isTextTier, m as mergeTierOverrides, r as resolveModel } from './index-
|
|
3
|
-
export { AIErrorBody, AccessCounted, AccessTimestamped, AgentContext, AiError, AiErrorCode, ApiKeyValidationRule,
|
|
1
|
+
export { C as ChatMessage, F as FinishReason, G as GenerationResult, P as ProviderHealth, S as StructuredGeneration, a as StructuredTextRequest, T as TextRequest, b as TextTier, c as TokenUsage } from './index-OhvYUTXf.js';
|
|
2
|
+
export { A as AIError, a as AIErrorMetadata, b as AIErrorType, b as GroqErrorType, T as TEXT_TIERS, c as TierModelMap, U as USER_FRIENDLY_ERROR_MESSAGES, i as isTextTier, m as mergeTierOverrides, r as resolveModel } from './index-1e91KRYU.js';
|
|
3
|
+
export { AIErrorBody, AccessCounted, AccessTimestamped, AgentContext, AiError, AiErrorCode, ApiKeyValidationRule, CHUNK_MAX_CHARS, CHUNK_OVERLAP_CHARS, CHUNK_TEXT_LIMIT, CODE_MESSAGES, ChunkOptions, CompositeExecutor, ContextBudget, ContextMessage, ContextRole, DEFAULT_AI_IDENTITY, DEFAULT_API_KEY_RULE, DEFAULT_EMBED_BATCH_SIZE, DEFAULT_ERROR_CLASSIFICATION_RULE, DEFAULT_GENERATION, DEFAULT_HTTP_STATUS_RULE, DEFAULT_RETRY_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY_MS, DEFAULT_RETRY_JITTER_FACTOR, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RETRY_MAX_DELAY_MS, DEFAULT_TASK_POLICIES, DebounceManager, DebounceOptions, DedupeExecutor, DedupeExecutorOptions, DiffChangeCount, DiffLine, EmbeddingsBatchAdapter, ErrorClassificationRule, ExponentialBackoffParams, FailoverErrorLike, FetchLike, GENERATION_BOUNDS, GenerationSettings, GroqError, GroqErrorMetadata, HttpStatusClassificationRule, IRequestExecutor, JSON_CODE_BLOCK_PATTERN, JSON_OBJECT_PATTERN, JsonResponseParser, LeadingEdgeParams, LoggedError, MEMORY_MAX_ITEMS, MEMORY_TOTAL_LIMIT, MICROS_PER_UNIT, MarkdownSegment, MemoryLike, ModelPricing, ModelWithProvider, NormalizedSseChunk, ParsedSseEvent, ProjectContext, ProviderErrorShape, QueueExecutor, RESEARCH_MAX_OUTPUT_TOKENS, RESEARCH_QUERY_MAX, RESEARCH_QUERY_MIN, RESEARCH_REPORT_MIN_CHARS, RESEARCH_SNIPPET_MAX_CHARS, RESEARCH_TEMPERATURE, ResearchSource, ResearchStreamEvent, RetryExecutor, SEARCH_MAX_RESULTS, SSE_BRIDGE_EVENTS, SSE_DONE_MARKER, SSE_PREFIX, STATUS_TO_CODE, SYSTEM_PROMPT_VERSION, SearchTopic, SseDeltaExtractor, SseResponseOptions, StreamCallbacks, StreamEvent, StreamingParserCallbacks, StreamingResponseParser, StructuredPromptBuilder, SystemPromptInput, TEXT_EXTRACT_PER_FILE_LIMIT, TEXT_EXTRACT_TOTAL_LIMIT, TRANSIENT_ERROR_CODES, TaskPlan, TaskPolicy, TaskState, ThrottleManager, ThrottleOptions, ToolSchema, ToolValidationResult, ToolValidatorFunction, TrailingDelayParams, UsageRecordData, UsageRecordInput, VectorCandidate, VectorMatch, WebSearchInput, WebSearchResponse, WebSearchResult, ZodLikeIssue, ZodLikeSchema, accumulateReport, aiErrorMessage, asObjectArray, asRecord, asStringArray, asTrimmedOptionalString, batchEmbed, buildCacheKey, buildContext, buildHttpStatusFallback, buildResearchMessages, buildSystemPrompt, buildUsageData, calculateCacheHitRate, calculateExponentialBackoff, calculateTrailingDelay, canFailover, canStartTask, capText, chunkText, clampScore, classifyHttpStatus, computeCostMicros, cosineSimilarity, countChanges, createSseResponse, debounce, debounceManager, defaultSseDeltaExtractor, deriveSnippetTitle, describeAIErrorType, diffLines, dotProduct, errorFromStatus, errorFromUnknown, estimateMessageTokens, estimateTokens, extractErrorMessageFromJsonBody, extractErrorMessageFromResponse, extractJsonArray, extractJsonCandidate, extractJsonFromCodeFence, extractJsonObject, extractSseDataPayload, extractText, failoverCandidate, findTopKSimilar, formatCost, formatErrorForLogging, formatSseEvent, generateRandomBase36Suffix, isAuthErrorType, isRetryableErrorType, isSseDataLine, isSseDoneMarker, isTextLike, isTransientError, isValidApiKey, isWithinWindow, magnitude, nextAttemptDelayMs, normalizeGenerationSettings, normalizeSources, normalizeSseChunk, oneOfCatalog, parseSseEvent, planTaskFailure, readSseResponse, repairCommonJsonDefects, replayFirst, resolveUserFriendlyErrorMessage, resolveUserFriendlyMessage, searchWeb, selectLeastRecentlyUsedKey, selectMemories, shouldCallOnLeadingEdge, splitMarkdown, splitSseLines, sseStreamResponse, throttle, throttleManager, validateApiKey, validateToolArgs } from './core/index.js';
|
|
4
4
|
export { C as CacheManager, a as CacheOptions, b as CacheStats, c as cacheManager } from './cache-manager-Df9LLYGA.js';
|
|
5
|
-
export { Q as QueueOptions, R as RequestDeduplicator, a as RequestQueue, b as RetryManager, c as RetryOptions, r as requestDeduplicator, d as requestQueue, e as retryManager, w as withRetry } from './
|
|
6
|
-
export { A as AnyProvider, C as CostEstimateRequest, I as IAIProvider, a as IMediaProvider, b as IProviderBase, c as ITextGenerator, d as ITextProvider, P as ProviderCapability, e as ProviderFactory, f as ProviderFactoryConfig, T as TextGenerationOptions, g as createProviderFactory, i as isMediaProvider, h as isTextProvider } from './provider.factory-
|
|
7
|
-
export { API_ENDPOINTS, AnthropicHttpTransport, AnthropicProvider, AnthropicRequestBuilder, AppContainer, AudioTranscriptionAdapter, AudioTranscriptionRequest, AudioTranscriptionResult, AuthenticationError, BaseAIProvider, BaseAIProvider as BaseProvider, BaseProviderConfig, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, EmbeddingsAdapter, EmbeddingsRequest, EmbeddingsResult, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerationFailedError, GroqChatRequestBuilder, GroqConfigStore, GroqHttpClient, GroqHttpClientDeps, GroqHttpTransport, GroqProvider, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_SIZES, ImageAdapter, ImageRequest, ImageResult, ImageSize, OpenAiCompatibleConfig, ProviderError, PrunaProgressStage, PrunaProvider, PrunaRequest, SPEECH_INPUT_MAX, SPEECH_VOICES, SpeechAdapter, SpeechRequest, SpeechResult, SpeechVoice, StructuredJsonRequest, TIMEOUTS, TimeoutError, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generatePruna, generateWithPruna, getProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage } from './providers/index.js';
|
|
8
|
-
export { A as AIProviderConfig, a as ANTHROPIC_API_VERSION, b as ANTHROPIC_DEFAULT_MAX_TOKENS, c as ANTHROPIC_MODELS, d as ANTHROPIC_TIERS, e as AnthropicEffort, f as AnthropicMessagesRequest, g as AnthropicMessagesResponse, h as AnthropicProviderConfig, i as AnthropicStopReason, j as AnthropicStreamEvent, G as GroqChatChunk, k as GroqChatRequest, l as GroqChatResponse, m as GroqChoice, n as GroqChunkChoice, o as GroqConfig, p as GroqErrorResponse, q as GroqGenerationConfig, r as GroqMessage, s as GroqMessageRole, t as GroqProviderConfig, u as GroqReasoningEffort, v as GroqUsage, S as StreamRequestOptions, w as createAI } from './create-ai-
|
|
9
|
-
export { C as CancellationError, G as GenerateOptions, a as GenerationStage, I as IGroqChatService, b as IGroqHttpClient, c as ImageToImageInput, d as ImageToVideoInput, P as PrunaAspectRatio, e as PrunaInput, f as PrunaModelId, g as PrunaOutput, h as PrunaPredictionResponse, i as PrunaResolution, j as PrunaResult, S as StreamingCallbacks, k as StructuredGenerationOptions, T as TextGenerationService, l as TextToImageInput, m as TextToVideoInput } from './cancellation-error-
|
|
10
|
-
export { C as ChatConfig, a as ChatConversation, b as ChatMessageSender, c as ChatMessageType, d as ChatService, e as ChatTokenUsage, f as ConversationMessage, D as DEFAULT_PROMPT_STRATEGY, I as IChatService, g as IChatStorage, h as IMessageFormatter, S as SendMessageInput, i as SendMessageResult, j as SystemPromptStrategy, U as UseChatOptions, k as UseChatReturn, l as extractTokenUsage } from './chat.service-
|
|
5
|
+
export { A as AssistantToolCall, Q as QueueOptions, R as RequestDeduplicator, a as RequestQueue, b as RetryManager, c as RetryOptions, T as ToolCallAccumulator, W as WireToolCallDelta, r as requestDeduplicator, d as requestQueue, e as retryManager, w as withRetry } from './tool-call-accumulator-C7KhaXZA.js';
|
|
6
|
+
export { A as AnyProvider, C as CostEstimateRequest, I as IAIProvider, a as IMediaProvider, b as IProviderBase, c as ITextGenerator, d as ITextProvider, P as ProviderCapability, e as ProviderFactory, f as ProviderFactoryConfig, T as TextGenerationOptions, g as createProviderFactory, i as isMediaProvider, h as isTextProvider } from './provider.factory-B9RNUTYj.js';
|
|
7
|
+
export { API_ENDPOINTS, AdapterChatMessage, AdapterChatRole, AdapterConfig, AdapterRequest, AnthropicHttpTransport, AnthropicProvider, AnthropicRequestBuilder, AppContainer, AudioTranscriptionAdapter, AudioTranscriptionRequest, AudioTranscriptionResult, AuthenticationError, BaseAIProvider, BaseAIProvider as BaseProvider, BaseProviderConfig, ChatAdapter, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, EmbeddingsAdapter, EmbeddingsRequest, EmbeddingsResult, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerationFailedError, GroqChatRequestBuilder, GroqConfigStore, GroqHttpClient, GroqHttpClientDeps, GroqHttpTransport, GroqProvider, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_SIZES, ImageAdapter, ImageRequest, ImageResult, ImageSize, OpenAiCompatibleConfig, ProviderError, ProviderEvent, PrunaProgressStage, PrunaProvider, PrunaRequest, RequestImage, SPEECH_INPUT_MAX, SPEECH_VOICES, SpeechAdapter, SpeechRequest, SpeechResult, SpeechVoice, StructuredJsonRequest, TIMEOUTS, TimeoutError, ToolDefinition, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAnthropicAdapter, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiCompatibleAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generatePruna, generateWithPruna, getProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage } from './providers/index.js';
|
|
8
|
+
export { A as AIProviderConfig, a as ANTHROPIC_API_VERSION, b as ANTHROPIC_DEFAULT_MAX_TOKENS, c as ANTHROPIC_MODELS, d as ANTHROPIC_TIERS, e as AnthropicEffort, f as AnthropicMessagesRequest, g as AnthropicMessagesResponse, h as AnthropicProviderConfig, i as AnthropicStopReason, j as AnthropicStreamEvent, G as GroqChatChunk, k as GroqChatRequest, l as GroqChatResponse, m as GroqChoice, n as GroqChunkChoice, o as GroqConfig, p as GroqErrorResponse, q as GroqGenerationConfig, r as GroqMessage, s as GroqMessageRole, t as GroqProviderConfig, u as GroqReasoningEffort, v as GroqUsage, S as StreamRequestOptions, w as createAI } from './create-ai-D-oEWzf9.js';
|
|
9
|
+
export { C as CancellationError, G as GenerateOptions, a as GenerationStage, I as IGroqChatService, b as IGroqHttpClient, c as ImageToImageInput, d as ImageToVideoInput, P as PrunaAspectRatio, e as PrunaInput, f as PrunaModelId, g as PrunaOutput, h as PrunaPredictionResponse, i as PrunaResolution, j as PrunaResult, S as StreamingCallbacks, k as StructuredGenerationOptions, T as TextGenerationService, l as TextToImageInput, m as TextToVideoInput } from './cancellation-error-hYcE9AS9.js';
|
|
10
|
+
export { C as ChatConfig, a as ChatConversation, b as ChatMessageSender, c as ChatMessageType, d as ChatService, e as ChatTokenUsage, f as ConversationMessage, D as DEFAULT_PROMPT_STRATEGY, I as IChatService, g as IChatStorage, h as IMessageFormatter, S as SendMessageInput, i as SendMessageResult, j as SystemPromptStrategy, U as UseChatOptions, k as UseChatReturn, l as extractTokenUsage } from './chat.service-B4Isrckn.js';
|
|
11
11
|
export { ChatIdGenerator, chatIdGenerator, messageFormatter } from './chat/index.js';
|
|
12
12
|
export { B as BlogGenerationRequest, a as BlogType, C as CONTENT_WIZARD_STEPS, b as ContentCalendarEntry, c as ContentTone, d as ContentType, e as ContentWizardData, f as ContentWizardStep, g as ContentWizardType, E as Emotion, G as GeneratedBlog, h as GeneratedSocialContent, i as GeneratedVideoScript, I as IMAGE_WIZARD_STEPS, j as ImageWizardData, k as ImageWizardStep, P as PLATFORM_SPECS, l as PlatformSpecs, S as Sentiment, m as SocialContentRequest, n as SocialPlatform, V as VIDEO_WIZARD_STEPS, o as ValidationResult, p as VideoGenerationType, q as VideoScriptRequest, r as VideoWizardData, s as VideoWizardStep, W as WizardConfig, t as WizardData, u as WizardStep, v as buildContentRequest, w as buildImageRequest, x as buildVideoRequest } from './index-BUVULo3h.js';
|
|
13
|
-
export { A as ABTestComparison, a as ABTestPrediction, b as ABTestRequest, c as ABTestVariant, d as AIErrorCode, e as ASPECT_RATIO_OPTIONS, f as AspectRatio, C as ContentAnalysisRequest, g as ContentAnalysisResult, G as ContentGenerationResult, h as CreditCost, i as GENERATION_COSTS, j as GenerationMetadata, k as GenerationProgress, l as GenerationStatus, m as GenerationType, I as IMAGE_QUALITY_OPTIONS, n as ImageGenerationInput, o as ImageQuality, K as KeywordAnalysis, M as MOTION_OPTIONS, P as ProviderQuotaExhaustedError, p as ProviderUnavailableError, S as SEOOptimizationRequest, q as SEOOptimizationResult, r as SEOScoreBreakdown, s as STYLE_PRESETS, t as SentimentAnalysisResult, V as VIDEO_DURATION_OPTIONS_SECONDS, u as VIDEO_QUALITY_OPTIONS, v as VideoGenerationInput, w as VideoQuality, x as calculateCreditCost } from './AIErrors-
|
|
14
|
-
export { A as ABTestService, a as AIContentService, b as ASPECT_RATIO_VALUES, c as AnalysisService, B as BlogService, C as ContentCalendarService, G as GenerationExecutor, I as IAIContentService, d as IMAGE_QUALITY_VALUES, e as ImagePromptService, M as MediaGenerationService, P as PromptBuilder, Q as QueueConfig, R as RequestPriority, S as SeoService, f as SocialService, V as VIDEO_DURATION_OPTIONS, g as VIDEO_QUALITY_VALUES, h as VideoScriptService, i as batchRequest, j as extractJSON, k as getDimensionsForAspectRatio, l as getRecommendedQuality, m as isValidJSON, p as parseAIResponse, s as safeJSONParse } from './requestQueue-
|
|
13
|
+
export { A as ABTestComparison, a as ABTestPrediction, b as ABTestRequest, c as ABTestVariant, d as AIErrorCode, e as ASPECT_RATIO_OPTIONS, f as AspectRatio, C as ContentAnalysisRequest, g as ContentAnalysisResult, G as ContentGenerationResult, h as CreditCost, i as GENERATION_COSTS, j as GenerationMetadata, k as GenerationProgress, l as GenerationStatus, m as GenerationType, I as IMAGE_QUALITY_OPTIONS, n as ImageGenerationInput, o as ImageQuality, K as KeywordAnalysis, M as MOTION_OPTIONS, P as ProviderQuotaExhaustedError, p as ProviderUnavailableError, S as SEOOptimizationRequest, q as SEOOptimizationResult, r as SEOScoreBreakdown, s as STYLE_PRESETS, t as SentimentAnalysisResult, V as VIDEO_DURATION_OPTIONS_SECONDS, u as VIDEO_QUALITY_OPTIONS, v as VideoGenerationInput, w as VideoQuality, x as calculateCreditCost } from './AIErrors-TuSFl--T.js';
|
|
14
|
+
export { A as ABTestService, a as AIContentService, b as ASPECT_RATIO_VALUES, c as AnalysisService, B as BlogService, C as ContentCalendarService, G as GenerationExecutor, I as IAIContentService, d as IMAGE_QUALITY_VALUES, e as ImagePromptService, M as MediaGenerationService, P as PromptBuilder, Q as QueueConfig, R as RequestPriority, S as SeoService, f as SocialService, V as VIDEO_DURATION_OPTIONS, g as VIDEO_QUALITY_VALUES, h as VideoScriptService, i as batchRequest, j as extractJSON, k as getDimensionsForAspectRatio, l as getRecommendedQuality, m as isValidJSON, p as parseAIResponse, s as safeJSONParse } from './requestQueue-AP6n_bRH.js';
|
|
15
15
|
import './ProviderConfig-DIFa9nmG.js';
|
package/dist/index.js
CHANGED
|
@@ -1139,6 +1139,83 @@ ${paragraph}`;
|
|
|
1139
1139
|
return chunks.map((chunk) => chunk.length > maxChars ? chunk.slice(0, maxChars) : chunk).filter((chunk) => chunk.length > 0);
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
|
+
// src/core/parsers/text-extract.ts
|
|
1143
|
+
var TEXT_MIME_PREFIX = "text/";
|
|
1144
|
+
var TEXT_MIME_TYPES = /* @__PURE__ */ new Set([
|
|
1145
|
+
"application/json",
|
|
1146
|
+
"application/xml",
|
|
1147
|
+
"application/yaml",
|
|
1148
|
+
"application/x-yaml",
|
|
1149
|
+
"application/javascript",
|
|
1150
|
+
"application/typescript",
|
|
1151
|
+
"application/x-sh",
|
|
1152
|
+
"application/sql",
|
|
1153
|
+
"text/csv"
|
|
1154
|
+
]);
|
|
1155
|
+
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
1156
|
+
"txt",
|
|
1157
|
+
"md",
|
|
1158
|
+
"markdown",
|
|
1159
|
+
"csv",
|
|
1160
|
+
"tsv",
|
|
1161
|
+
"json",
|
|
1162
|
+
"xml",
|
|
1163
|
+
"yaml",
|
|
1164
|
+
"yml",
|
|
1165
|
+
"toml",
|
|
1166
|
+
"ini",
|
|
1167
|
+
"js",
|
|
1168
|
+
"mjs",
|
|
1169
|
+
"cjs",
|
|
1170
|
+
"ts",
|
|
1171
|
+
"tsx",
|
|
1172
|
+
"jsx",
|
|
1173
|
+
"py",
|
|
1174
|
+
"rb",
|
|
1175
|
+
"go",
|
|
1176
|
+
"rs",
|
|
1177
|
+
"java",
|
|
1178
|
+
"kt",
|
|
1179
|
+
"swift",
|
|
1180
|
+
"c",
|
|
1181
|
+
"h",
|
|
1182
|
+
"cpp",
|
|
1183
|
+
"hpp",
|
|
1184
|
+
"cs",
|
|
1185
|
+
"php",
|
|
1186
|
+
"sh",
|
|
1187
|
+
"bash",
|
|
1188
|
+
"zsh",
|
|
1189
|
+
"sql",
|
|
1190
|
+
"html",
|
|
1191
|
+
"css",
|
|
1192
|
+
"scss",
|
|
1193
|
+
"env"
|
|
1194
|
+
]);
|
|
1195
|
+
var TEXT_EXTRACT_PER_FILE_LIMIT = 24e3;
|
|
1196
|
+
var TEXT_EXTRACT_TOTAL_LIMIT = 48e3;
|
|
1197
|
+
function isTextLike(mimeType, name) {
|
|
1198
|
+
if (mimeType.startsWith(TEXT_MIME_PREFIX) || TEXT_MIME_TYPES.has(mimeType)) return true;
|
|
1199
|
+
const extension = name.split(".").pop()?.toLowerCase() ?? "";
|
|
1200
|
+
return TEXT_EXTENSIONS.has(extension);
|
|
1201
|
+
}
|
|
1202
|
+
function extractText(bytes) {
|
|
1203
|
+
let out = "";
|
|
1204
|
+
const decoder = new TextDecoder("utf-8", { fatal: false });
|
|
1205
|
+
const chunkSize = 65536;
|
|
1206
|
+
for (let offset = 0; offset < bytes.length; offset += chunkSize) {
|
|
1207
|
+
out += decoder.decode(bytes.subarray(offset, Math.min(offset + chunkSize, bytes.length)), {
|
|
1208
|
+
stream: offset + chunkSize < bytes.length
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
return out.split("\0").join("");
|
|
1212
|
+
}
|
|
1213
|
+
function capText(text, limit) {
|
|
1214
|
+
if (text.length <= limit) return text;
|
|
1215
|
+
return `${text.slice(0, limit)}
|
|
1216
|
+
[truncated]`;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1142
1219
|
// src/core/calculations/random-base36-suffix.ts
|
|
1143
1220
|
var BASE_36_RADIX = 36;
|
|
1144
1221
|
var DECIMAL_OFFSET = 2;
|
|
@@ -1374,17 +1451,19 @@ function buildSystemPrompt(input = {}) {
|
|
|
1374
1451
|
const now = input.now ?? /* @__PURE__ */ new Date();
|
|
1375
1452
|
const identity = input.identity ?? DEFAULT_AI_IDENTITY;
|
|
1376
1453
|
const parts = [identity, `Current date: ${now.toISOString().slice(0, 10)}.`];
|
|
1454
|
+
const projectName = input.project?.name;
|
|
1377
1455
|
const projectInstructions = input.project?.instructions?.trim();
|
|
1378
|
-
if (projectInstructions) {
|
|
1456
|
+
if (projectName && projectInstructions) {
|
|
1379
1457
|
parts.push(
|
|
1380
|
-
`The user is working inside the project "${
|
|
1458
|
+
`The user is working inside the project "${projectName}". Follow these project instructions:
|
|
1381
1459
|
${projectInstructions}`
|
|
1382
1460
|
);
|
|
1383
1461
|
}
|
|
1462
|
+
const agentName = input.agent?.name;
|
|
1384
1463
|
const agentInstructions = input.agent?.instructions?.trim();
|
|
1385
|
-
if (agentInstructions) {
|
|
1464
|
+
if (agentName && agentInstructions) {
|
|
1386
1465
|
parts.push(
|
|
1387
|
-
`You are operating as the agent "${
|
|
1466
|
+
`You are operating as the agent "${agentName}". Follow these agent instructions:
|
|
1388
1467
|
${agentInstructions}`
|
|
1389
1468
|
);
|
|
1390
1469
|
}
|
|
@@ -1586,11 +1665,7 @@ function resolveTimestamp(value) {
|
|
|
1586
1665
|
const parsed = Date.parse(value);
|
|
1587
1666
|
return Number.isNaN(parsed) ? 0 : parsed;
|
|
1588
1667
|
}
|
|
1589
|
-
function
|
|
1590
|
-
if (str.length <= maxLength) return str;
|
|
1591
|
-
return str.slice(0, Math.max(maxLength, 0));
|
|
1592
|
-
}
|
|
1593
|
-
function selectMemories(rows, maxItems = MEMORY_MAX_ITEMS, totalLimit = MEMORY_TOTAL_LIMIT) {
|
|
1668
|
+
function selectMemories(rows, maxItems = MEMORY_MAX_ITEMS, totalLimit = MEMORY_TOTAL_LIMIT, capper = capText) {
|
|
1594
1669
|
const ordered = [...rows].sort((a, b) => {
|
|
1595
1670
|
if (a.pinned !== b.pinned) return a.pinned ? -1 : 1;
|
|
1596
1671
|
return resolveTimestamp(b.updatedAt) - resolveTimestamp(a.updatedAt);
|
|
@@ -1601,7 +1676,7 @@ function selectMemories(rows, maxItems = MEMORY_MAX_ITEMS, totalLimit = MEMORY_T
|
|
|
1601
1676
|
if (out.length >= maxItems || used >= totalLimit) break;
|
|
1602
1677
|
const content = row.content.trim();
|
|
1603
1678
|
if (content.length === 0) continue;
|
|
1604
|
-
const capped =
|
|
1679
|
+
const capped = capper(content, totalLimit - used);
|
|
1605
1680
|
out.push(capped);
|
|
1606
1681
|
used += capped.length;
|
|
1607
1682
|
}
|
|
@@ -2600,7 +2675,7 @@ var AnthropicProvider = class {
|
|
|
2600
2675
|
}
|
|
2601
2676
|
}
|
|
2602
2677
|
toGenerationResult(response, fallbackModel) {
|
|
2603
|
-
const text =
|
|
2678
|
+
const text = extractText2(response.content);
|
|
2604
2679
|
const finishReason = mapAnthropicStopReason(response.stop_reason);
|
|
2605
2680
|
if (text.length === 0) {
|
|
2606
2681
|
if (finishReason === "refusal") {
|
|
@@ -2628,7 +2703,7 @@ var AnthropicProvider = class {
|
|
|
2628
2703
|
};
|
|
2629
2704
|
}
|
|
2630
2705
|
};
|
|
2631
|
-
function
|
|
2706
|
+
function extractText2(blocks) {
|
|
2632
2707
|
return blocks.filter((block) => block.type === "text").map((block) => block.text).join("");
|
|
2633
2708
|
}
|
|
2634
2709
|
function refusalTextFor(finishReason) {
|
|
@@ -5435,6 +5510,303 @@ function createOpenAiImageAdapter(config) {
|
|
|
5435
5510
|
};
|
|
5436
5511
|
}
|
|
5437
5512
|
|
|
5513
|
+
// src/providers/adapters/openai-compatible.adapter.ts
|
|
5514
|
+
function toWireMessage(message) {
|
|
5515
|
+
if (message.role === "tool") {
|
|
5516
|
+
return { role: "tool", content: message.content, tool_call_id: message.toolCallId ?? "" };
|
|
5517
|
+
}
|
|
5518
|
+
if (message.role === "assistant" && message.toolCalls && message.toolCalls.length > 0) {
|
|
5519
|
+
return {
|
|
5520
|
+
role: "assistant",
|
|
5521
|
+
content: message.content,
|
|
5522
|
+
tool_calls: message.toolCalls.map((call) => ({
|
|
5523
|
+
id: call.id,
|
|
5524
|
+
type: "function",
|
|
5525
|
+
function: { name: call.name, arguments: call.arguments }
|
|
5526
|
+
}))
|
|
5527
|
+
};
|
|
5528
|
+
}
|
|
5529
|
+
if (message.role === "user") return { role: "user", content: message.content };
|
|
5530
|
+
return { role: message.role, content: message.content };
|
|
5531
|
+
}
|
|
5532
|
+
function mergeImages(messages, images) {
|
|
5533
|
+
if (images.length === 0) return [...messages];
|
|
5534
|
+
const parts = images.map((image) => ({
|
|
5535
|
+
type: "image_url",
|
|
5536
|
+
image_url: { url: `data:${image.mimeType};base64,${image.dataBase64}` }
|
|
5537
|
+
}));
|
|
5538
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
5539
|
+
const message = messages[index];
|
|
5540
|
+
if (message.role !== "user") continue;
|
|
5541
|
+
const textParts = typeof message.content === "string" ? message.content.length > 0 ? [{ type: "text", text: message.content }] : [] : message.content;
|
|
5542
|
+
return [
|
|
5543
|
+
...messages.slice(0, index),
|
|
5544
|
+
{ role: "user", content: [...textParts, ...parts] },
|
|
5545
|
+
...messages.slice(index + 1)
|
|
5546
|
+
];
|
|
5547
|
+
}
|
|
5548
|
+
return [...messages, { role: "user", content: [...parts] }];
|
|
5549
|
+
}
|
|
5550
|
+
async function extractErrorDetail(response) {
|
|
5551
|
+
try {
|
|
5552
|
+
const body = await response.json();
|
|
5553
|
+
return body.error;
|
|
5554
|
+
} catch {
|
|
5555
|
+
return void 0;
|
|
5556
|
+
}
|
|
5557
|
+
}
|
|
5558
|
+
async function* parseSseEvent2(rawEvent, toolCallAccumulator) {
|
|
5559
|
+
for (const line of rawEvent.split("\n")) {
|
|
5560
|
+
if (!line.startsWith("data:")) continue;
|
|
5561
|
+
const payload = line.slice(5).trim();
|
|
5562
|
+
if (payload.length === 0 || payload === "[DONE]") continue;
|
|
5563
|
+
let chunk;
|
|
5564
|
+
try {
|
|
5565
|
+
chunk = JSON.parse(payload);
|
|
5566
|
+
} catch {
|
|
5567
|
+
continue;
|
|
5568
|
+
}
|
|
5569
|
+
const delta = chunk.choices?.[0]?.delta;
|
|
5570
|
+
if (delta?.reasoning) {
|
|
5571
|
+
yield { type: "delta", channel: "reasoning", text: delta.reasoning };
|
|
5572
|
+
}
|
|
5573
|
+
if (delta?.content) {
|
|
5574
|
+
yield { type: "delta", channel: "answer", text: delta.content };
|
|
5575
|
+
}
|
|
5576
|
+
if (delta?.tool_calls) {
|
|
5577
|
+
for (const toolCallDelta of delta.tool_calls) toolCallAccumulator.push(toolCallDelta);
|
|
5578
|
+
}
|
|
5579
|
+
if (chunk.usage) {
|
|
5580
|
+
yield {
|
|
5581
|
+
type: "usage",
|
|
5582
|
+
usage: {
|
|
5583
|
+
inputTokens: chunk.usage.prompt_tokens ?? 0,
|
|
5584
|
+
outputTokens: chunk.usage.completion_tokens ?? 0,
|
|
5585
|
+
reasoningTokens: chunk.usage.completion_tokens_details?.reasoning_tokens
|
|
5586
|
+
}
|
|
5587
|
+
};
|
|
5588
|
+
}
|
|
5589
|
+
}
|
|
5590
|
+
}
|
|
5591
|
+
async function* parseSseStream(body) {
|
|
5592
|
+
const reader = body.getReader();
|
|
5593
|
+
const decoder = new TextDecoder();
|
|
5594
|
+
const toolCallAccumulator = new ToolCallAccumulator();
|
|
5595
|
+
let buffer = "";
|
|
5596
|
+
try {
|
|
5597
|
+
while (true) {
|
|
5598
|
+
const { done, value } = await reader.read();
|
|
5599
|
+
if (done) break;
|
|
5600
|
+
buffer += decoder.decode(value, { stream: true });
|
|
5601
|
+
let separator = buffer.indexOf("\n\n");
|
|
5602
|
+
while (separator !== -1) {
|
|
5603
|
+
const rawEvent = buffer.slice(0, separator);
|
|
5604
|
+
buffer = buffer.slice(separator + 2);
|
|
5605
|
+
separator = buffer.indexOf("\n\n");
|
|
5606
|
+
yield* parseSseEvent2(rawEvent, toolCallAccumulator);
|
|
5607
|
+
}
|
|
5608
|
+
}
|
|
5609
|
+
} catch (err) {
|
|
5610
|
+
throw errorFromUnknown(err);
|
|
5611
|
+
} finally {
|
|
5612
|
+
reader.releaseLock();
|
|
5613
|
+
}
|
|
5614
|
+
const calls = toolCallAccumulator.finish();
|
|
5615
|
+
if (calls.length > 0) yield { type: "tool_calls", calls };
|
|
5616
|
+
}
|
|
5617
|
+
function createOpenAiCompatibleAdapter(config) {
|
|
5618
|
+
return {
|
|
5619
|
+
async *stream(req) {
|
|
5620
|
+
const timeout = AbortSignal.timeout(config.timeoutMs);
|
|
5621
|
+
const signal = req.signal ? AbortSignal.any([req.signal, timeout]) : timeout;
|
|
5622
|
+
let response;
|
|
5623
|
+
try {
|
|
5624
|
+
response = await fetch(`${config.baseUrl}/chat/completions`, {
|
|
5625
|
+
method: "POST",
|
|
5626
|
+
headers: {
|
|
5627
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
5628
|
+
"Content-Type": "application/json"
|
|
5629
|
+
},
|
|
5630
|
+
body: JSON.stringify({
|
|
5631
|
+
model: req.externalModelId,
|
|
5632
|
+
messages: mergeImages(req.messages.map(toWireMessage), req.images ?? []),
|
|
5633
|
+
temperature: req.temperature,
|
|
5634
|
+
max_completion_tokens: req.maxOutputTokens,
|
|
5635
|
+
top_p: req.topP,
|
|
5636
|
+
stream: true,
|
|
5637
|
+
stream_options: { include_usage: true },
|
|
5638
|
+
...req.tools && req.tools.length > 0 ? {
|
|
5639
|
+
tools: req.tools.map((tool) => ({ type: "function", function: tool })),
|
|
5640
|
+
tool_choice: "auto"
|
|
5641
|
+
} : {}
|
|
5642
|
+
}),
|
|
5643
|
+
signal
|
|
5644
|
+
});
|
|
5645
|
+
} catch (err) {
|
|
5646
|
+
throw errorFromUnknown(err);
|
|
5647
|
+
}
|
|
5648
|
+
if (!response.ok || !response.body) {
|
|
5649
|
+
const detail = await extractErrorDetail(response);
|
|
5650
|
+
throw errorFromStatus(response.status, detail?.message, detail);
|
|
5651
|
+
}
|
|
5652
|
+
yield* parseSseStream(response.body);
|
|
5653
|
+
}
|
|
5654
|
+
};
|
|
5655
|
+
}
|
|
5656
|
+
|
|
5657
|
+
// src/providers/adapters/anthropic.adapter.ts
|
|
5658
|
+
var ANTHROPIC_VERSION = "2023-06-01";
|
|
5659
|
+
var ERROR_TYPE_TO_CODE = {
|
|
5660
|
+
invalid_request_error: "invalid_request",
|
|
5661
|
+
authentication_error: "invalid_key",
|
|
5662
|
+
permission_error: "invalid_key",
|
|
5663
|
+
not_found_error: "model_unavailable",
|
|
5664
|
+
request_too_large: "invalid_request",
|
|
5665
|
+
rate_limit_error: "rate_limited",
|
|
5666
|
+
overloaded_error: "capacity",
|
|
5667
|
+
api_error: "upstream_error"
|
|
5668
|
+
};
|
|
5669
|
+
function mergeImages2(messages, images) {
|
|
5670
|
+
if (images.length === 0) return [...messages];
|
|
5671
|
+
const blocks = images.map((image) => ({
|
|
5672
|
+
type: "image",
|
|
5673
|
+
source: { type: "base64", media_type: image.mimeType, data: image.dataBase64 }
|
|
5674
|
+
}));
|
|
5675
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
5676
|
+
const message = messages[index];
|
|
5677
|
+
if (message.role !== "user") continue;
|
|
5678
|
+
const textBlocks = typeof message.content === "string" ? message.content.length > 0 ? [{ type: "text", text: message.content }] : [] : message.content;
|
|
5679
|
+
return [
|
|
5680
|
+
...messages.slice(0, index),
|
|
5681
|
+
{ role: "user", content: [...textBlocks, ...blocks] },
|
|
5682
|
+
...messages.slice(index + 1)
|
|
5683
|
+
];
|
|
5684
|
+
}
|
|
5685
|
+
return [...messages, { role: "user", content: [...blocks] }];
|
|
5686
|
+
}
|
|
5687
|
+
async function extractErrorDetail2(response) {
|
|
5688
|
+
try {
|
|
5689
|
+
const body = await response.json();
|
|
5690
|
+
return body.error?.message;
|
|
5691
|
+
} catch {
|
|
5692
|
+
return void 0;
|
|
5693
|
+
}
|
|
5694
|
+
}
|
|
5695
|
+
function wireError(error) {
|
|
5696
|
+
const code = error.type && ERROR_TYPE_TO_CODE[error.type] || "upstream_error";
|
|
5697
|
+
return new AiError(code, error.message);
|
|
5698
|
+
}
|
|
5699
|
+
function* parseAnthropicEvent(rawEvent) {
|
|
5700
|
+
for (const line of rawEvent.split("\n")) {
|
|
5701
|
+
if (!line.startsWith("data:")) continue;
|
|
5702
|
+
const payload = line.slice(5).trim();
|
|
5703
|
+
if (payload.length === 0) continue;
|
|
5704
|
+
try {
|
|
5705
|
+
yield JSON.parse(payload);
|
|
5706
|
+
} catch {
|
|
5707
|
+
continue;
|
|
5708
|
+
}
|
|
5709
|
+
}
|
|
5710
|
+
}
|
|
5711
|
+
function mergeOutputTokens(previous, outputTokens) {
|
|
5712
|
+
return {
|
|
5713
|
+
inputTokens: previous?.inputTokens ?? 0,
|
|
5714
|
+
outputTokens,
|
|
5715
|
+
reasoningTokens: previous?.reasoningTokens
|
|
5716
|
+
};
|
|
5717
|
+
}
|
|
5718
|
+
async function* parseAnthropicStream(body) {
|
|
5719
|
+
const reader = body.getReader();
|
|
5720
|
+
const decoder = new TextDecoder();
|
|
5721
|
+
let buffer = "";
|
|
5722
|
+
let usage = null;
|
|
5723
|
+
let usageEmitted = false;
|
|
5724
|
+
const flushUsage = function* () {
|
|
5725
|
+
if (usage && !usageEmitted && (usage.inputTokens > 0 || usage.outputTokens > 0)) {
|
|
5726
|
+
usageEmitted = true;
|
|
5727
|
+
yield { type: "usage", usage };
|
|
5728
|
+
}
|
|
5729
|
+
};
|
|
5730
|
+
try {
|
|
5731
|
+
while (true) {
|
|
5732
|
+
const { done, value } = await reader.read();
|
|
5733
|
+
if (done) break;
|
|
5734
|
+
buffer += decoder.decode(value, { stream: true });
|
|
5735
|
+
let separator = buffer.indexOf("\n\n");
|
|
5736
|
+
while (separator !== -1) {
|
|
5737
|
+
const rawEvent = buffer.slice(0, separator);
|
|
5738
|
+
buffer = buffer.slice(separator + 2);
|
|
5739
|
+
separator = buffer.indexOf("\n\n");
|
|
5740
|
+
for (const event of parseAnthropicEvent(rawEvent)) {
|
|
5741
|
+
if (event.error) throw wireError(event.error);
|
|
5742
|
+
if (event.type === "message_start" && event.message?.usage) {
|
|
5743
|
+
usage = {
|
|
5744
|
+
inputTokens: event.message.usage.input_tokens ?? 0,
|
|
5745
|
+
outputTokens: 0,
|
|
5746
|
+
reasoningTokens: void 0
|
|
5747
|
+
};
|
|
5748
|
+
} else if (event.type === "message_delta" && event.usage) {
|
|
5749
|
+
usage = mergeOutputTokens(usage, event.usage.output_tokens ?? 0);
|
|
5750
|
+
} else if (event.type === "message_stop") {
|
|
5751
|
+
yield* flushUsage();
|
|
5752
|
+
} else if (event.delta?.type === "text_delta" && event.delta.text) {
|
|
5753
|
+
yield { type: "delta", channel: "answer", text: event.delta.text };
|
|
5754
|
+
} else if (event.delta?.type === "thinking_delta" && event.delta.thinking) {
|
|
5755
|
+
yield { type: "delta", channel: "reasoning", text: event.delta.thinking };
|
|
5756
|
+
}
|
|
5757
|
+
}
|
|
5758
|
+
}
|
|
5759
|
+
}
|
|
5760
|
+
yield* flushUsage();
|
|
5761
|
+
} catch (err) {
|
|
5762
|
+
throw err instanceof AiError ? err : errorFromUnknown(err);
|
|
5763
|
+
} finally {
|
|
5764
|
+
reader.releaseLock();
|
|
5765
|
+
}
|
|
5766
|
+
}
|
|
5767
|
+
function createAnthropicAdapter(config) {
|
|
5768
|
+
return {
|
|
5769
|
+
async *stream(req) {
|
|
5770
|
+
const timeout = AbortSignal.timeout(config.timeoutMs);
|
|
5771
|
+
const signal = req.signal ? AbortSignal.any([req.signal, timeout]) : timeout;
|
|
5772
|
+
const system = req.messages.filter((message) => message.role === "system").map((message) => message.content).join("\n\n");
|
|
5773
|
+
const messages = mergeImages2(
|
|
5774
|
+
req.messages.filter((message) => message.role !== "system").map((message) => {
|
|
5775
|
+
if (message.role === "user") return { role: "user", content: message.content };
|
|
5776
|
+
return { role: "assistant", content: message.content };
|
|
5777
|
+
}),
|
|
5778
|
+
req.images ?? []
|
|
5779
|
+
);
|
|
5780
|
+
let response;
|
|
5781
|
+
try {
|
|
5782
|
+
response = await fetch(`${config.baseUrl}/v1/messages`, {
|
|
5783
|
+
method: "POST",
|
|
5784
|
+
headers: {
|
|
5785
|
+
"x-api-key": config.apiKey,
|
|
5786
|
+
"anthropic-version": ANTHROPIC_VERSION,
|
|
5787
|
+
"Content-Type": "application/json"
|
|
5788
|
+
},
|
|
5789
|
+
body: JSON.stringify({
|
|
5790
|
+
model: req.externalModelId,
|
|
5791
|
+
messages,
|
|
5792
|
+
...system.length > 0 ? { system } : {},
|
|
5793
|
+
max_tokens: req.maxOutputTokens,
|
|
5794
|
+
stream: true
|
|
5795
|
+
}),
|
|
5796
|
+
signal
|
|
5797
|
+
});
|
|
5798
|
+
} catch (err) {
|
|
5799
|
+
throw errorFromUnknown(err);
|
|
5800
|
+
}
|
|
5801
|
+
if (!response.ok || !response.body) {
|
|
5802
|
+
const detail = await extractErrorDetail2(response);
|
|
5803
|
+
throw errorFromStatus(response.status, detail);
|
|
5804
|
+
}
|
|
5805
|
+
yield* parseAnthropicStream(response.body);
|
|
5806
|
+
}
|
|
5807
|
+
};
|
|
5808
|
+
}
|
|
5809
|
+
|
|
5438
5810
|
// src/content/domain/calculations/ContentCreditCost.ts
|
|
5439
5811
|
var CREDIT_COSTS = {
|
|
5440
5812
|
"text-to-image": { standard: 1, hd: 2, "4k": 4 },
|
|
@@ -7029,6 +7401,6 @@ function buildVideoRequest(data) {
|
|
|
7029
7401
|
}
|
|
7030
7402
|
}
|
|
7031
7403
|
|
|
7032
|
-
export { ABTestService, AIContentService, AIError, AIErrorType, ANTHROPIC_API_VERSION, ANTHROPIC_DEFAULT_MAX_TOKENS, ANTHROPIC_MODELS, ANTHROPIC_TIERS, API_ENDPOINTS, ASPECT_RATIO_OPTIONS, ASPECT_RATIO_VALUES, AiError, AnalysisService, AnthropicHttpTransport, AnthropicProvider, AnthropicRequestBuilder, AuthenticationError, BaseProvider as BaseAIProvider, BaseProvider, BlogService, CHUNK_MAX_CHARS, CHUNK_OVERLAP_CHARS, CHUNK_TEXT_LIMIT, CODE_MESSAGES, CONTENT_WIZARD_STEPS, CacheManager, CancellationError, ChatIdGenerator, ChatService, CompositeExecutor, ContentCalendarService, DEFAULT_AI_IDENTITY, DEFAULT_API_KEY_RULE, DEFAULT_BASE_URL, DEFAULT_EMBED_BATCH_SIZE, DEFAULT_ERROR_CLASSIFICATION_RULE, DEFAULT_GENERATION, DEFAULT_GENERATION_CONFIG, DEFAULT_HTTP_STATUS_RULE, DEFAULT_MODELS, DEFAULT_PROMPT_STRATEGY, DEFAULT_RETRY_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY_MS, DEFAULT_RETRY_JITTER_FACTOR, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RETRY_MAX_DELAY_MS, DEFAULT_TASK_POLICIES, DebounceManager, DedupeExecutor, FalProvider, GEMINI_TIERS, GENERATION_BOUNDS, CREDIT_COSTS as GENERATION_COSTS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerationExecutor, GenerationFailedError, GroqChatRequestBuilder, GroqConfigStore, GroqError, AIErrorType as GroqErrorType, GroqHttpClient, GroqHttpTransport, GroqProvider, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_QUALITY_OPTIONS, IMAGE_QUALITY_VALUES, IMAGE_SIZES, IMAGE_WIZARD_STEPS, ImagePromptService, JSON_CODE_BLOCK_PATTERN, JSON_OBJECT_PATTERN, JsonResponseParser, MEMORY_MAX_ITEMS, MEMORY_TOTAL_LIMIT, MICROS_PER_UNIT, MOTION_OPTIONS, MediaGenerationService, PromptBuilder, ProviderError, ProviderFactory, ProviderQuotaExhaustedError, ProviderUnavailableError, PrunaProvider, QueueExecutor, RESEARCH_MAX_OUTPUT_TOKENS, RESEARCH_QUERY_MAX, RESEARCH_QUERY_MIN, RESEARCH_REPORT_MIN_CHARS, RESEARCH_SNIPPET_MAX_CHARS, RESEARCH_TEMPERATURE, RequestDeduplicator, RequestPriority, RequestQueue, RetryExecutor, RetryManager, SEARCH_MAX_RESULTS, SPEECH_INPUT_MAX, SPEECH_VOICES, SSE_BRIDGE_EVENTS, SSE_DONE_MARKER, SSE_PREFIX, STATUS_TO_CODE, STYLE_PRESETS, SYSTEM_PROMPT_VERSION, SeoService, SocialService, StreamingResponseParser, StructuredPromptBuilder, TEXT_TIERS, TIMEOUTS, TRANSIENT_ERROR_CODES, TextGenerationService, ThrottleManager, TimeoutError, ToolCallAccumulator, USER_FRIENDLY_ERROR_MESSAGES, VIDEO_DURATION_OPTIONS, VIDEO_DURATION_OPTIONS_SECONDS, VIDEO_QUALITY_OPTIONS, VIDEO_QUALITY_VALUES, VIDEO_WIZARD_STEPS, ValidationError2 as ValidationError, VideoScriptService, accumulateReport, aiErrorMessage, asObjectArray, asRecord, asStringArray, asTrimmedOptionalString, batchEmbed, batchRequest, buildCacheKey, buildContentRequest, buildContext, buildHttpStatusFallback, buildImageRequest, buildResearchMessages, buildSystemPrompt, buildUsageData, buildVideoRequest, cacheManager, calculateCacheHitRate, calculateContentCreditCost as calculateCreditCost, calculateExponentialBackoff, calculateTrailingDelay, canFailover, canStartTask, chatIdGenerator, chunkText, clampScore, classifyHttpStatus, computeCostMicros, configureProvider, consumeAnthropicStream, consumeGroqStream, cosineSimilarity, countChanges, createAI, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createProviderFactory, createPrunaProvider, createSseResponse, createSystemMessage, createUserMessage, debounce, debounceManager, defaultEffortForModel, defaultSseDeltaExtractor, deriveSnippetTitle, describeAIErrorType, diffLines, dotProduct, errorFromStatus, errorFromUnknown, estimateMessageTokens, estimateTokens, extractContentFromSsePayload, extractErrorMessageFromJsonBody, extractErrorMessageFromResponse, extractJSON, extractJsonArray, extractJsonCandidate, extractJsonFromCodeFence, extractJsonObject, extractSseDataPayload, extractTextFromMessages, extractTokenUsage, failoverCandidate, findTopKSimilar, formatCost, formatErrorForLogging, formatMessagesForDisplay, formatSseEvent, generateImageThenVideo, generate as generatePruna, generateRandomBase36Suffix, generateWithPruna, getDimensionsForAspectRatio, getProvider, getRecommendedQuality, isAuthErrorType, isMediaProvider, isRetryableErrorType, isSseDataLine, isSseDoneMarker, isTextProvider, isTextTier, isTransientError, isValidApiKey, isValidJSON, isWithinWindow, magnitude, mapAnthropicStopReason, mergeTierOverrides, messageFormatter, nextAttemptDelayMs, normalizeGenerationSettings, normalizeSources, normalizeSseChunk, oneOfCatalog, parseAIResponse, parseSseEvent, planTaskFailure, pollForResult, promptToMessages, readSseResponse, repairCommonJsonDefects, replayFirst, requestDeduplicator, requestQueue, requestStructuredJson, resetProvider, resolveModel, resolveUserFriendlyErrorMessage, resolveUserFriendlyMessage, retryManager, safeJSONParse, searchWeb, selectLeastRecentlyUsedKey, selectMemories, shouldCallOnLeadingEdge, splitMarkdown, splitSseLines, sseStreamResponse, submitPrediction, throttle, throttleManager, toGroqMessages, uploadImage, validateApiKey, validateToolArgs, withRetry };
|
|
7404
|
+
export { ABTestService, AIContentService, AIError, AIErrorType, ANTHROPIC_API_VERSION, ANTHROPIC_DEFAULT_MAX_TOKENS, ANTHROPIC_MODELS, ANTHROPIC_TIERS, API_ENDPOINTS, ASPECT_RATIO_OPTIONS, ASPECT_RATIO_VALUES, AiError, AnalysisService, AnthropicHttpTransport, AnthropicProvider, AnthropicRequestBuilder, AuthenticationError, BaseProvider as BaseAIProvider, BaseProvider, BlogService, CHUNK_MAX_CHARS, CHUNK_OVERLAP_CHARS, CHUNK_TEXT_LIMIT, CODE_MESSAGES, CONTENT_WIZARD_STEPS, CacheManager, CancellationError, ChatIdGenerator, ChatService, CompositeExecutor, ContentCalendarService, DEFAULT_AI_IDENTITY, DEFAULT_API_KEY_RULE, DEFAULT_BASE_URL, DEFAULT_EMBED_BATCH_SIZE, DEFAULT_ERROR_CLASSIFICATION_RULE, DEFAULT_GENERATION, DEFAULT_GENERATION_CONFIG, DEFAULT_HTTP_STATUS_RULE, DEFAULT_MODELS, DEFAULT_PROMPT_STRATEGY, DEFAULT_RETRY_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY_MS, DEFAULT_RETRY_JITTER_FACTOR, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RETRY_MAX_DELAY_MS, DEFAULT_TASK_POLICIES, DebounceManager, DedupeExecutor, FalProvider, GEMINI_TIERS, GENERATION_BOUNDS, CREDIT_COSTS as GENERATION_COSTS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerationExecutor, GenerationFailedError, GroqChatRequestBuilder, GroqConfigStore, GroqError, AIErrorType as GroqErrorType, GroqHttpClient, GroqHttpTransport, GroqProvider, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_QUALITY_OPTIONS, IMAGE_QUALITY_VALUES, IMAGE_SIZES, IMAGE_WIZARD_STEPS, ImagePromptService, JSON_CODE_BLOCK_PATTERN, JSON_OBJECT_PATTERN, JsonResponseParser, MEMORY_MAX_ITEMS, MEMORY_TOTAL_LIMIT, MICROS_PER_UNIT, MOTION_OPTIONS, MediaGenerationService, PromptBuilder, ProviderError, ProviderFactory, ProviderQuotaExhaustedError, ProviderUnavailableError, PrunaProvider, QueueExecutor, RESEARCH_MAX_OUTPUT_TOKENS, RESEARCH_QUERY_MAX, RESEARCH_QUERY_MIN, RESEARCH_REPORT_MIN_CHARS, RESEARCH_SNIPPET_MAX_CHARS, RESEARCH_TEMPERATURE, RequestDeduplicator, RequestPriority, RequestQueue, RetryExecutor, RetryManager, SEARCH_MAX_RESULTS, SPEECH_INPUT_MAX, SPEECH_VOICES, SSE_BRIDGE_EVENTS, SSE_DONE_MARKER, SSE_PREFIX, STATUS_TO_CODE, STYLE_PRESETS, SYSTEM_PROMPT_VERSION, SeoService, SocialService, StreamingResponseParser, StructuredPromptBuilder, TEXT_EXTRACT_PER_FILE_LIMIT, TEXT_EXTRACT_TOTAL_LIMIT, TEXT_TIERS, TIMEOUTS, TRANSIENT_ERROR_CODES, TextGenerationService, ThrottleManager, TimeoutError, ToolCallAccumulator, USER_FRIENDLY_ERROR_MESSAGES, VIDEO_DURATION_OPTIONS, VIDEO_DURATION_OPTIONS_SECONDS, VIDEO_QUALITY_OPTIONS, VIDEO_QUALITY_VALUES, VIDEO_WIZARD_STEPS, ValidationError2 as ValidationError, VideoScriptService, accumulateReport, aiErrorMessage, asObjectArray, asRecord, asStringArray, asTrimmedOptionalString, batchEmbed, batchRequest, buildCacheKey, buildContentRequest, buildContext, buildHttpStatusFallback, buildImageRequest, buildResearchMessages, buildSystemPrompt, buildUsageData, buildVideoRequest, cacheManager, calculateCacheHitRate, calculateContentCreditCost as calculateCreditCost, calculateExponentialBackoff, calculateTrailingDelay, canFailover, canStartTask, capText, chatIdGenerator, chunkText, clampScore, classifyHttpStatus, computeCostMicros, configureProvider, consumeAnthropicStream, consumeGroqStream, cosineSimilarity, countChanges, createAI, createAnthropicAdapter, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiCompatibleAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createProviderFactory, createPrunaProvider, createSseResponse, createSystemMessage, createUserMessage, debounce, debounceManager, defaultEffortForModel, defaultSseDeltaExtractor, deriveSnippetTitle, describeAIErrorType, diffLines, dotProduct, errorFromStatus, errorFromUnknown, estimateMessageTokens, estimateTokens, extractContentFromSsePayload, extractErrorMessageFromJsonBody, extractErrorMessageFromResponse, extractJSON, extractJsonArray, extractJsonCandidate, extractJsonFromCodeFence, extractJsonObject, extractSseDataPayload, extractText, extractTextFromMessages, extractTokenUsage, failoverCandidate, findTopKSimilar, formatCost, formatErrorForLogging, formatMessagesForDisplay, formatSseEvent, generateImageThenVideo, generate as generatePruna, generateRandomBase36Suffix, generateWithPruna, getDimensionsForAspectRatio, getProvider, getRecommendedQuality, isAuthErrorType, isMediaProvider, isRetryableErrorType, isSseDataLine, isSseDoneMarker, isTextLike, isTextProvider, isTextTier, isTransientError, isValidApiKey, isValidJSON, isWithinWindow, magnitude, mapAnthropicStopReason, mergeTierOverrides, messageFormatter, nextAttemptDelayMs, normalizeGenerationSettings, normalizeSources, normalizeSseChunk, oneOfCatalog, parseAIResponse, parseSseEvent, planTaskFailure, pollForResult, promptToMessages, readSseResponse, repairCommonJsonDefects, replayFirst, requestDeduplicator, requestQueue, requestStructuredJson, resetProvider, resolveModel, resolveUserFriendlyErrorMessage, resolveUserFriendlyMessage, retryManager, safeJSONParse, searchWeb, selectLeastRecentlyUsedKey, selectMemories, shouldCallOnLeadingEdge, splitMarkdown, splitSseLines, sseStreamResponse, submitPrediction, throttle, throttleManager, toGroqMessages, uploadImage, validateApiKey, validateToolArgs, withRetry };
|
|
7033
7405
|
//# sourceMappingURL=index.js.map
|
|
7034
7406
|
//# sourceMappingURL=index.js.map
|