@umituz/web-ai 1.0.6 → 1.0.8

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.
Files changed (41) hide show
  1. package/dist/{AIErrors-CLjXRty-.d.ts → AIErrors-CSk4nvN1.d.ts} +1 -1
  2. package/dist/{AIErrors-DjZXUiLT.d.cts → AIErrors-Dq9o95R_.d.cts} +1 -1
  3. package/dist/{cancellation-error-CkMn5Kft.d.ts → cancellation-error-Ci8fQhNF.d.ts} +3 -3
  4. package/dist/{cancellation-error-Cj7fJyCg.d.cts → cancellation-error-CpkPd67D.d.cts} +3 -3
  5. package/dist/chat/index.d.cts +4 -4
  6. package/dist/chat/index.d.ts +4 -4
  7. package/dist/{chat.service-9M-KpLo-.d.cts → chat.service-BRtiA7H9.d.cts} +2 -2
  8. package/dist/{chat.service-B4FLFxR1.d.ts → chat.service-Cqga2h1e.d.ts} +2 -2
  9. package/dist/content/index.d.cts +7 -7
  10. package/dist/content/index.d.ts +7 -7
  11. package/dist/core/index.cjs +815 -0
  12. package/dist/core/index.cjs.map +1 -1
  13. package/dist/core/index.d.cts +418 -4
  14. package/dist/core/index.d.ts +418 -4
  15. package/dist/core/index.js +747 -1
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/{create-ai-0eZFFqTw.d.ts → create-ai-DW7eHMBF.d.ts} +3 -3
  18. package/dist/{create-ai-BrKR_5fQ.d.cts → create-ai-DeOpUgZ-.d.cts} +3 -3
  19. package/dist/hooks/index.d.cts +9 -9
  20. package/dist/hooks/index.d.ts +9 -9
  21. package/dist/{index-DIHz8_OJ.d.ts → index-Ca5o4gBK.d.ts} +1 -1
  22. package/dist/{index-fXjxTR5W.d.cts → index-DDzvTDg0.d.cts} +1 -1
  23. package/dist/{index-fXjxTR5W.d.ts → index-DDzvTDg0.d.ts} +1 -1
  24. package/dist/{index-DKHNcMbl.d.cts → index-itgxPeLz.d.cts} +1 -1
  25. package/dist/index.cjs +1011 -14
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +10 -10
  28. package/dist/index.d.ts +10 -10
  29. package/dist/index.js +934 -15
  30. package/dist/index.js.map +1 -1
  31. package/dist/{provider.factory-BwPnqSEU.d.ts → provider.factory-CJuI08Xr.d.ts} +1 -1
  32. package/dist/{provider.factory-DyfJtR8M.d.cts → provider.factory-DG2CYFgh.d.cts} +1 -1
  33. package/dist/providers/index.cjs +196 -0
  34. package/dist/providers/index.cjs.map +1 -1
  35. package/dist/providers/index.d.cts +79 -10
  36. package/dist/providers/index.d.ts +79 -10
  37. package/dist/providers/index.js +188 -1
  38. package/dist/providers/index.js.map +1 -1
  39. package/dist/{requestQueue-CvxWxC-z.d.ts → requestQueue-D-RCbxuR.d.ts} +4 -4
  40. package/dist/{requestQueue-CkJ6Xc9K.d.cts → requestQueue-O6f8VBl5.d.cts} +4 -4
  41. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
- export { C as ChatMessage, F as FinishReason, G as GenerationResult, P as ProviderHealth, S as StreamCallbacks, a as StructuredGeneration, b as StructuredTextRequest, T as TextRequest, c as TextTier, d as TokenUsage } from '../index-fXjxTR5W.js';
2
- import { A as AIError, b as AIErrorType, a as AIErrorMetadata } from '../index-DIHz8_OJ.js';
3
- export { T as TEXT_TIERS, c as TierModelMap, U as USER_FRIENDLY_ERROR_MESSAGES, i as isTextTier, m as mergeTierOverrides, r as resolveModel } from '../index-DIHz8_OJ.js';
1
+ import { c as TokenUsage, C as ChatMessage } from '../index-DDzvTDg0.js';
2
+ export { F as FinishReason, G as GenerationResult, P as ProviderHealth, S as StructuredGeneration, a as StructuredTextRequest, T as TextRequest, b as TextTier } from '../index-DDzvTDg0.js';
3
+ import { A as AIError, b as AIErrorType, a as AIErrorMetadata } from '../index-Ca5o4gBK.js';
4
+ export { T as TEXT_TIERS, c as TierModelMap, U as USER_FRIENDLY_ERROR_MESSAGES, i as isTextTier, m as mergeTierOverrides, r as resolveModel } from '../index-Ca5o4gBK.js';
4
5
  import { b as RetryManager, c as RetryOptions, a as RequestQueue, R as RequestDeduplicator } from '../request-deduplicator.util-NDo0_n1y.js';
5
6
  export { Q as QueueOptions, r as requestDeduplicator, d as requestQueue, e as retryManager, w as withRetry } from '../request-deduplicator.util-NDo0_n1y.js';
6
7
  export { C as CacheManager, a as CacheOptions, b as CacheStats, c as cacheManager } from '../cache-manager-Df9LLYGA.js';
@@ -54,6 +55,22 @@ declare function buildHttpStatusFallback(status: number, statusText: string): st
54
55
  declare function extractErrorMessageFromResponse(response: Response): Promise<string>;
55
56
  declare function describeAIErrorType(type: AIErrorType): string;
56
57
 
58
+ type AiErrorCode = 'invalid_key' | 'missing_key' | 'rate_limited' | 'capacity' | 'timeout' | 'invalid_request' | 'model_unavailable' | 'upstream_error' | 'network' | 'cancelled';
59
+ declare const STATUS_TO_CODE: Readonly<Record<number, AiErrorCode>>;
60
+ declare const CODE_MESSAGES: Readonly<Record<AiErrorCode, string>>;
61
+ declare class AiError extends Error {
62
+ readonly code: AiErrorCode;
63
+ constructor(code: AiErrorCode, message?: string);
64
+ get userMessage(): string;
65
+ }
66
+ declare function aiErrorMessage(code: AiErrorCode): string;
67
+ interface ProviderErrorShape {
68
+ readonly type?: string;
69
+ readonly code?: string;
70
+ }
71
+ declare function errorFromStatus(status: number, detail?: string, provider?: ProviderErrorShape): AiError;
72
+ declare function errorFromUnknown(err: unknown): AiError;
73
+
57
74
  interface IRequestExecutor<TArgs extends unknown[], TResult> {
58
75
  execute(fn: (...args: TArgs) => Promise<TResult>, ...args: TArgs): Promise<TResult>;
59
76
  }
@@ -140,6 +157,27 @@ declare function asTrimmedOptionalString(value: unknown): string | undefined;
140
157
  declare function clampScore(value: unknown, min: number, max: number): number | null;
141
158
  declare function oneOfCatalog<T extends readonly string[]>(catalog: T, value: unknown): T[number] | null;
142
159
 
160
+ declare const TRANSIENT_ERROR_CODES: ReadonlySet<string>;
161
+ interface FailoverErrorLike {
162
+ readonly code?: string;
163
+ readonly type?: string;
164
+ readonly status?: number;
165
+ }
166
+ declare function isTransientError(err: unknown): boolean;
167
+ declare function canFailover(err: unknown, streamedChars: number): boolean;
168
+ interface ModelWithProvider {
169
+ readonly model: {
170
+ readonly id: string;
171
+ readonly capabilities?: {
172
+ readonly streaming?: boolean;
173
+ };
174
+ };
175
+ readonly provider: {
176
+ readonly id: string;
177
+ };
178
+ }
179
+ declare function failoverCandidate<T extends ModelWithProvider>(primary: T, fallback: T | null): T | null;
180
+
143
181
  declare function isSseDataLine(line: string): boolean;
144
182
  declare function extractSseDataPayload(line: string): string;
145
183
  declare function isSseDoneMarker(payload: string): boolean;
@@ -186,6 +224,101 @@ declare class StructuredPromptBuilder {
186
224
  build(): string;
187
225
  }
188
226
 
227
+ declare const CHUNK_MAX_CHARS = 1200;
228
+ declare const CHUNK_OVERLAP_CHARS = 160;
229
+ declare const CHUNK_TEXT_LIMIT = 200000;
230
+ interface ChunkOptions {
231
+ maxChars?: number;
232
+ overlapChars?: number;
233
+ }
234
+ declare function chunkText(text: string, options?: ChunkOptions): string[];
235
+
236
+ interface AccessTimestamped {
237
+ readonly lastAccess: number;
238
+ }
239
+ declare function selectLeastRecentlyUsedKey<K, V extends AccessTimestamped>(entries: ReadonlyMap<K, V>): K | null;
240
+
241
+ interface ExponentialBackoffParams {
242
+ readonly attempt: number;
243
+ readonly initialDelay: number;
244
+ readonly maxDelay: number;
245
+ readonly backoffMultiplier: number;
246
+ readonly jitterFactor: number;
247
+ readonly random?: () => number;
248
+ }
249
+ declare function calculateExponentialBackoff(params: ExponentialBackoffParams): number;
250
+
251
+ declare function generateRandomBase36Suffix(length: number, random?: () => number): string;
252
+
253
+ interface AccessCounted {
254
+ readonly accessCount: number;
255
+ }
256
+ declare function calculateCacheHitRate(entries: ReadonlyArray<AccessCounted>): number;
257
+
258
+ interface LeadingEdgeParams {
259
+ readonly now: number;
260
+ readonly lastCallTime: number;
261
+ readonly interval: number;
262
+ readonly leadingEnabled: boolean;
263
+ readonly isThrottled: boolean;
264
+ }
265
+ declare function shouldCallOnLeadingEdge(params: LeadingEdgeParams): boolean;
266
+ interface TrailingDelayParams {
267
+ readonly interval: number;
268
+ readonly timeSinceLastCall: number;
269
+ }
270
+ declare function calculateTrailingDelay(params: TrailingDelayParams): number;
271
+ declare function isWithinWindow(now: number, lastCallTime: number, interval: number): boolean;
272
+
273
+ declare const MICROS_PER_UNIT = 1000000;
274
+ interface ModelPricing {
275
+ readonly inputPerMTok: number;
276
+ readonly outputPerMTok: number;
277
+ readonly currency: 'USD';
278
+ }
279
+ declare function computeCostMicros(pricing: ModelPricing, usage: Pick<TokenUsage, 'inputTokens' | 'outputTokens'>): number;
280
+ interface UsageRecordInput {
281
+ readonly usage: TokenUsage & {
282
+ readonly reasoningTokens?: number;
283
+ };
284
+ readonly pricing: ModelPricing;
285
+ readonly durationMs: number;
286
+ }
287
+ interface UsageRecordData {
288
+ readonly inputTokens: number;
289
+ readonly outputTokens: number;
290
+ readonly reasoningTokens: number;
291
+ readonly costMicros: number;
292
+ readonly durationMs: number;
293
+ }
294
+ declare function buildUsageData(input: UsageRecordInput): UsageRecordData;
295
+ declare function formatCost(costMicros: number): string;
296
+
297
+ interface TaskPolicy {
298
+ readonly maxAttempts: number;
299
+ readonly backoffBaseMs: number;
300
+ }
301
+ declare const DEFAULT_TASK_POLICIES: Record<string, TaskPolicy>;
302
+ declare function nextAttemptDelayMs(attempt: number, baseMs: number): number;
303
+ interface TaskState {
304
+ readonly status: string;
305
+ readonly nextAttemptAt?: string | null;
306
+ }
307
+ declare function canStartTask(task: TaskState, now?: Date): boolean;
308
+ interface TaskPlan {
309
+ readonly status: 'queued' | 'failed';
310
+ readonly nextAttemptAt: string | null;
311
+ readonly log: {
312
+ readonly at: string;
313
+ readonly level: 'info' | 'warn' | 'error';
314
+ readonly message: string;
315
+ };
316
+ }
317
+ declare function planTaskFailure(task: {
318
+ attempts: number;
319
+ maxAttempts: number;
320
+ }, errorDetail: string, backoffBaseMs: number, now?: Date): TaskPlan;
321
+
189
322
  declare const SSE_BRIDGE_EVENTS: {
190
323
  readonly delta: "delta";
191
324
  readonly done: "done";
@@ -201,6 +334,287 @@ interface SseResponseOptions {
201
334
  declare function defaultSseDeltaExtractor(payload: string): string | null;
202
335
  declare function createSseResponse(openUpstream: () => Promise<ReadableStream<Uint8Array>>, options: SseResponseOptions): Response;
203
336
 
337
+ interface WireToolCallDelta {
338
+ readonly index?: number;
339
+ readonly id?: string;
340
+ readonly function?: {
341
+ readonly name?: string;
342
+ readonly arguments?: string;
343
+ };
344
+ }
345
+ interface AssistantToolCall {
346
+ readonly id: string;
347
+ readonly name: string;
348
+ readonly arguments: string;
349
+ }
350
+ declare class ToolCallAccumulator {
351
+ private readonly slots;
352
+ push(delta: WireToolCallDelta): void;
353
+ finish(): AssistantToolCall[];
354
+ }
355
+
356
+ type ContextRole = 'system' | 'user' | 'assistant' | 'tool';
357
+ interface ContextMessage {
358
+ readonly role: ContextRole;
359
+ readonly content: string;
360
+ readonly toolCalls?: ReadonlyArray<{
361
+ id: string;
362
+ name: string;
363
+ arguments: string;
364
+ }>;
365
+ readonly toolCallId?: string;
366
+ }
367
+ interface ContextBudget {
368
+ readonly contextWindow: number;
369
+ readonly maxOutputTokens: number;
370
+ }
371
+ declare function estimateTokens(text: string): number;
372
+ declare function estimateMessageTokens(message: ContextMessage): number;
373
+ declare function buildContext<T extends ContextMessage = ContextMessage>(history: ReadonlyArray<T>, systemPrompt: string, budget: ContextBudget): T[];
374
+
375
+ declare const SYSTEM_PROMPT_VERSION = 2;
376
+ declare const DEFAULT_AI_IDENTITY: string;
377
+ interface ProjectContext {
378
+ name: string;
379
+ instructions: string;
380
+ }
381
+ interface AgentContext {
382
+ name: string;
383
+ instructions: string;
384
+ }
385
+ interface SystemPromptInput {
386
+ identity?: string;
387
+ settings?: {
388
+ systemExtra?: string;
389
+ };
390
+ project?: ProjectContext | null;
391
+ agent?: AgentContext | null;
392
+ attachments?: readonly {
393
+ name: string;
394
+ text: string;
395
+ }[];
396
+ memories?: readonly string[];
397
+ now?: Date;
398
+ }
399
+ declare function buildSystemPrompt(input?: SystemPromptInput): string;
400
+
401
+ type SearchTopic = 'general' | 'news';
402
+ interface WebSearchResult {
403
+ readonly title: string;
404
+ readonly url: string;
405
+ readonly content: string;
406
+ readonly score: number | null;
407
+ }
408
+ interface WebSearchResponse {
409
+ readonly query: string;
410
+ readonly answer: string | null;
411
+ readonly results: ReadonlyArray<WebSearchResult>;
412
+ readonly responseTime: number | null;
413
+ }
414
+ interface WebSearchInput {
415
+ readonly query: string;
416
+ readonly maxResults?: number;
417
+ readonly topic?: SearchTopic;
418
+ readonly includeAnswer?: boolean;
419
+ }
420
+ type FetchLike = (input: string, init: Record<string, unknown>) => Promise<Response>;
421
+ declare const SEARCH_MAX_RESULTS = 5;
422
+ declare function searchWeb(env: {
423
+ readonly TAVILY_API_KEY?: string;
424
+ readonly TAVILY_BASE_URL?: string;
425
+ }, input: WebSearchInput, fetchImpl?: FetchLike): Promise<WebSearchResponse>;
426
+
427
+ type StreamEvent<TToolCall = unknown> = {
428
+ readonly type: 'delta';
429
+ readonly channel: 'answer' | 'reasoning';
430
+ readonly text: string;
431
+ } | {
432
+ readonly type: 'usage';
433
+ readonly usage: {
434
+ readonly inputTokens: number;
435
+ readonly outputTokens: number;
436
+ readonly reasoningTokens?: number;
437
+ };
438
+ } | {
439
+ readonly type: 'tool_call';
440
+ readonly toolCall: TToolCall;
441
+ } | {
442
+ readonly type: 'done';
443
+ readonly messageId: string;
444
+ } | {
445
+ readonly type: 'error';
446
+ readonly code: string;
447
+ readonly message: string;
448
+ };
449
+ declare function formatSseEvent(event: StreamEvent): string;
450
+ declare function sseStreamResponse(events: AsyncIterable<StreamEvent>): Response;
451
+ declare function replayFirst<T>(first: T, rest: AsyncIterable<T>): AsyncIterable<T>;
452
+
453
+ interface MarkdownSegment {
454
+ readonly kind: 'text' | 'code';
455
+ readonly text: string;
456
+ readonly language?: string;
457
+ }
458
+ declare function splitMarkdown(source: string): MarkdownSegment[];
459
+ declare function deriveSnippetTitle(code: string): string;
460
+
461
+ interface DiffLine {
462
+ readonly type: 'same' | 'add' | 'remove';
463
+ readonly text: string;
464
+ }
465
+ interface DiffChangeCount {
466
+ readonly added: number;
467
+ readonly removed: number;
468
+ }
469
+ declare function diffLines(before: string, after: string): DiffLine[];
470
+ declare function countChanges(lines: readonly DiffLine[]): DiffChangeCount;
471
+
472
+ declare const MEMORY_MAX_ITEMS = 20;
473
+ declare const MEMORY_TOTAL_LIMIT = 4000;
474
+ interface MemoryLike {
475
+ readonly content: string;
476
+ readonly pinned: boolean;
477
+ readonly updatedAt: Date | string | number;
478
+ }
479
+ declare function selectMemories(rows: readonly MemoryLike[], maxItems?: number, totalLimit?: number): string[];
480
+
481
+ declare const RESEARCH_QUERY_MIN = 4;
482
+ declare const RESEARCH_QUERY_MAX = 400;
483
+ declare const RESEARCH_MAX_OUTPUT_TOKENS = 2048;
484
+ declare const RESEARCH_TEMPERATURE = 0.2;
485
+ declare const RESEARCH_REPORT_MIN_CHARS = 40;
486
+ declare const RESEARCH_SNIPPET_MAX_CHARS = 1000;
487
+ interface ResearchSource {
488
+ readonly title: string;
489
+ readonly url: string;
490
+ readonly snippet: string;
491
+ }
492
+ interface ResearchStreamEvent {
493
+ readonly type: string;
494
+ readonly channel?: 'answer' | 'reasoning' | string;
495
+ readonly text?: string;
496
+ readonly usage?: TokenUsage;
497
+ }
498
+ declare function normalizeSources(results: readonly WebSearchResult[], maxSnippetChars?: number): ResearchSource[];
499
+ declare function buildResearchMessages(query: string, sources: readonly ResearchSource[], systemPersona?: string): ChatMessage[];
500
+ declare function accumulateReport(stream: AsyncIterable<ResearchStreamEvent>): Promise<{
501
+ report: string;
502
+ usage: TokenUsage | null;
503
+ }>;
504
+
505
+ interface EmbeddingsBatchAdapter {
506
+ embed(req: {
507
+ externalModelId: string;
508
+ input: string[];
509
+ }): Promise<{
510
+ vectors: number[][];
511
+ inputTokens: number | null;
512
+ }>;
513
+ }
514
+ declare const DEFAULT_EMBED_BATCH_SIZE = 32;
515
+ declare function batchEmbed(adapter: EmbeddingsBatchAdapter, externalModelId: string, texts: readonly string[], batchSize?: number): Promise<{
516
+ vectors: number[][];
517
+ inputTokens: number | null;
518
+ }>;
519
+ declare function dotProduct(a: readonly number[], b: readonly number[]): number;
520
+ declare function magnitude(v: readonly number[]): number;
521
+ declare function cosineSimilarity(a: readonly number[], b: readonly number[]): number;
522
+ interface VectorCandidate<T = unknown> {
523
+ readonly id: string;
524
+ readonly vector: readonly number[];
525
+ readonly data?: T;
526
+ }
527
+ interface VectorMatch<T = unknown> {
528
+ readonly id: string;
529
+ readonly similarity: number;
530
+ readonly data?: T;
531
+ }
532
+ declare function findTopKSimilar<T = unknown>(queryVector: readonly number[], candidates: readonly VectorCandidate<T>[], k?: number): VectorMatch<T>[];
533
+
534
+ interface GenerationSettings {
535
+ temperature?: number;
536
+ maxOutputTokens?: number;
537
+ topP?: number;
538
+ }
539
+ declare const GENERATION_BOUNDS: {
540
+ readonly temperature: {
541
+ readonly min: 0;
542
+ readonly max: 2;
543
+ };
544
+ readonly topP: {
545
+ readonly min: 0;
546
+ readonly max: 1;
547
+ };
548
+ };
549
+ declare const DEFAULT_GENERATION: Required<GenerationSettings>;
550
+ declare function normalizeGenerationSettings(requested: GenerationSettings | undefined, maxModelTokens?: number): Required<GenerationSettings>;
551
+
552
+ interface StreamCallbacks<TToolCall = unknown> {
553
+ onDelta(channel: 'answer' | 'reasoning', text: string): void;
554
+ onUsage?(usage: {
555
+ inputTokens: number;
556
+ outputTokens: number;
557
+ reasoningTokens?: number;
558
+ }): void;
559
+ onToolCall?(toolCall: TToolCall): void;
560
+ onDone?(messageId: string): void;
561
+ onError?(code: string, message: string): void;
562
+ }
563
+ type ParsedSseEvent<TToolCall = unknown> = {
564
+ readonly type: 'delta';
565
+ readonly channel: 'answer' | 'reasoning';
566
+ readonly text: string;
567
+ } | {
568
+ readonly type: 'usage';
569
+ readonly usage: {
570
+ readonly inputTokens: number;
571
+ readonly outputTokens: number;
572
+ readonly reasoningTokens?: number;
573
+ };
574
+ } | {
575
+ readonly type: 'tool_call';
576
+ readonly toolCall: TToolCall;
577
+ } | {
578
+ readonly type: 'done';
579
+ readonly messageId: string;
580
+ } | {
581
+ readonly type: 'error';
582
+ readonly code: string;
583
+ readonly message: string;
584
+ };
585
+ declare function parseSseEvent<TToolCall = unknown>(rawEvent: string): ParsedSseEvent<TToolCall> | null;
586
+ declare function readSseResponse<TToolCall = unknown>(response: Response, callbacks: StreamCallbacks<TToolCall>): Promise<void>;
587
+
588
+ type ToolValidationResult = {
589
+ readonly ok: true;
590
+ } | {
591
+ readonly ok: false;
592
+ readonly error: string;
593
+ };
594
+ type ToolValidatorFunction = (args: Record<string, unknown>) => {
595
+ ok: true;
596
+ } | {
597
+ ok: false;
598
+ error: string;
599
+ };
600
+ interface ZodLikeIssue {
601
+ readonly path: readonly (string | number)[];
602
+ readonly message: string;
603
+ }
604
+ interface ZodLikeSchema {
605
+ safeParse(data: unknown): {
606
+ readonly success: true;
607
+ readonly data?: unknown;
608
+ } | {
609
+ readonly success: false;
610
+ readonly error: {
611
+ readonly issues: readonly ZodLikeIssue[];
612
+ };
613
+ };
614
+ }
615
+ type ToolSchema = ToolValidatorFunction | ZodLikeSchema;
616
+ declare function validateToolArgs(toolKey: string, args: Record<string, unknown>, schemas: Record<string, ToolSchema>): ToolValidationResult;
617
+
204
618
  declare const SSE_PREFIX: "data: ";
205
619
  declare const SSE_DONE_MARKER: "[DONE]";
206
620
  declare const JSON_CODE_BLOCK_PATTERN: RegExp;
@@ -212,4 +626,4 @@ declare const DEFAULT_RETRY_MAX_DELAY_MS = 10000;
212
626
  declare const DEFAULT_RETRY_BACKOFF_MULTIPLIER = 2;
213
627
  declare const DEFAULT_RETRY_JITTER_FACTOR = 0.1;
214
628
 
215
- export { AIError, type AIErrorBody, AIErrorMetadata, AIErrorType, type ApiKeyValidationRule, CompositeExecutor, DEFAULT_API_KEY_RULE, DEFAULT_ERROR_CLASSIFICATION_RULE, 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, DebounceManager, type DebounceOptions, DedupeExecutor, type DedupeExecutorOptions, type ErrorClassificationRule, GroqError, type GroqErrorMetadata, AIErrorType as GroqErrorType, type HttpStatusClassificationRule, type IRequestExecutor, JSON_CODE_BLOCK_PATTERN, JSON_OBJECT_PATTERN, JsonResponseParser, type LoggedError, type NormalizedSseChunk, QueueExecutor, RequestDeduplicator, RequestQueue, RetryExecutor, RetryManager, RetryOptions, SSE_BRIDGE_EVENTS, SSE_DONE_MARKER, SSE_PREFIX, type SseDeltaExtractor, type SseResponseOptions, type StreamingParserCallbacks, StreamingResponseParser, StructuredPromptBuilder, ThrottleManager, type ThrottleOptions, asObjectArray, asRecord, asStringArray, asTrimmedOptionalString, buildCacheKey, buildHttpStatusFallback, clampScore, classifyHttpStatus, createSseResponse, debounce, debounceManager, defaultSseDeltaExtractor, describeAIErrorType, extractErrorMessageFromJsonBody, extractErrorMessageFromResponse, extractJsonArray, extractJsonCandidate, extractJsonFromCodeFence, extractJsonObject, extractSseDataPayload, formatErrorForLogging, isAuthErrorType, isRetryableErrorType, isSseDataLine, isSseDoneMarker, isValidApiKey, normalizeSseChunk, oneOfCatalog, repairCommonJsonDefects, resolveUserFriendlyErrorMessage, resolveUserFriendlyMessage, splitSseLines, throttle, throttleManager, validateApiKey };
629
+ export { AIError, type AIErrorBody, AIErrorMetadata, AIErrorType, type AccessCounted, type AccessTimestamped, type AgentContext, AiError, type AiErrorCode, type ApiKeyValidationRule, type AssistantToolCall, CHUNK_MAX_CHARS, CHUNK_OVERLAP_CHARS, CHUNK_TEXT_LIMIT, CODE_MESSAGES, ChatMessage, type ChunkOptions, CompositeExecutor, type ContextBudget, type ContextMessage, type 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, type DebounceOptions, DedupeExecutor, type DedupeExecutorOptions, type DiffChangeCount, type DiffLine, type EmbeddingsBatchAdapter, type ErrorClassificationRule, type ExponentialBackoffParams, type FailoverErrorLike, type FetchLike, GENERATION_BOUNDS, type GenerationSettings, GroqError, type GroqErrorMetadata, AIErrorType as GroqErrorType, type HttpStatusClassificationRule, type IRequestExecutor, JSON_CODE_BLOCK_PATTERN, JSON_OBJECT_PATTERN, JsonResponseParser, type LeadingEdgeParams, type LoggedError, MEMORY_MAX_ITEMS, MEMORY_TOTAL_LIMIT, MICROS_PER_UNIT, type MarkdownSegment, type MemoryLike, type ModelPricing, type ModelWithProvider, type NormalizedSseChunk, type ParsedSseEvent, type ProjectContext, type ProviderErrorShape, QueueExecutor, RESEARCH_MAX_OUTPUT_TOKENS, RESEARCH_QUERY_MAX, RESEARCH_QUERY_MIN, RESEARCH_REPORT_MIN_CHARS, RESEARCH_SNIPPET_MAX_CHARS, RESEARCH_TEMPERATURE, RequestDeduplicator, RequestQueue, type ResearchSource, type ResearchStreamEvent, RetryExecutor, RetryManager, RetryOptions, SEARCH_MAX_RESULTS, SSE_BRIDGE_EVENTS, SSE_DONE_MARKER, SSE_PREFIX, STATUS_TO_CODE, SYSTEM_PROMPT_VERSION, type SearchTopic, type SseDeltaExtractor, type SseResponseOptions, type StreamCallbacks, type StreamEvent, type StreamingParserCallbacks, StreamingResponseParser, StructuredPromptBuilder, type SystemPromptInput, TRANSIENT_ERROR_CODES, type TaskPlan, type TaskPolicy, type TaskState, ThrottleManager, type ThrottleOptions, TokenUsage, ToolCallAccumulator, type ToolSchema, type ToolValidationResult, type ToolValidatorFunction, type TrailingDelayParams, type UsageRecordData, type UsageRecordInput, type VectorCandidate, type VectorMatch, type WebSearchInput, type WebSearchResponse, type WebSearchResult, type WireToolCallDelta, type ZodLikeIssue, type ZodLikeSchema, accumulateReport, aiErrorMessage, asObjectArray, asRecord, asStringArray, asTrimmedOptionalString, batchEmbed, buildCacheKey, buildContext, buildHttpStatusFallback, buildResearchMessages, buildSystemPrompt, buildUsageData, calculateCacheHitRate, calculateExponentialBackoff, calculateTrailingDelay, canFailover, canStartTask, 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, failoverCandidate, findTopKSimilar, formatCost, formatErrorForLogging, formatSseEvent, generateRandomBase36Suffix, isAuthErrorType, isRetryableErrorType, isSseDataLine, isSseDoneMarker, 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 };