@umituz/web-ai 1.0.7 → 1.0.9
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-CLjXRty-.d.ts → AIErrors-CSk4nvN1.d.ts} +1 -1
- package/dist/{AIErrors-DjZXUiLT.d.cts → AIErrors-Dq9o95R_.d.cts} +1 -1
- package/dist/{cancellation-error-CkMn5Kft.d.ts → cancellation-error-Ci8fQhNF.d.ts} +3 -3
- package/dist/{cancellation-error-Cj7fJyCg.d.cts → cancellation-error-CpkPd67D.d.cts} +3 -3
- package/dist/chat/index.d.cts +4 -4
- package/dist/chat/index.d.ts +4 -4
- package/dist/{chat.service-9M-KpLo-.d.cts → chat.service-BRtiA7H9.d.cts} +2 -2
- package/dist/{chat.service-B4FLFxR1.d.ts → chat.service-Cqga2h1e.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 +560 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +218 -5
- package/dist/core/index.d.ts +218 -5
- package/dist/core/index.js +519 -1
- package/dist/core/index.js.map +1 -1
- package/dist/{create-ai-0eZFFqTw.d.ts → create-ai-DW7eHMBF.d.ts} +3 -3
- package/dist/{create-ai-BrKR_5fQ.d.cts → create-ai-DeOpUgZ-.d.cts} +3 -3
- package/dist/hooks/index.d.cts +9 -9
- package/dist/hooks/index.d.ts +9 -9
- package/dist/{index-DIHz8_OJ.d.ts → index-Ca5o4gBK.d.ts} +1 -1
- package/dist/{index-fXjxTR5W.d.cts → index-DDzvTDg0.d.cts} +1 -1
- package/dist/{index-fXjxTR5W.d.ts → index-DDzvTDg0.d.ts} +1 -1
- package/dist/{index-DKHNcMbl.d.cts → index-itgxPeLz.d.cts} +1 -1
- package/dist/index.cjs +562 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +521 -3
- package/dist/index.js.map +1 -1
- package/dist/{provider.factory-BwPnqSEU.d.ts → provider.factory-CJuI08Xr.d.ts} +1 -1
- package/dist/{provider.factory-DyfJtR8M.d.cts → provider.factory-DG2CYFgh.d.cts} +1 -1
- package/dist/providers/index.d.cts +9 -9
- package/dist/providers/index.d.ts +9 -9
- package/dist/{requestQueue-CvxWxC-z.d.ts → requestQueue-D-RCbxuR.d.ts} +4 -4
- package/dist/{requestQueue-CkJ6Xc9K.d.cts → requestQueue-O6f8VBl5.d.cts} +4 -4
- package/package.json +1 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { A as AIError, b as AIErrorType, a as AIErrorMetadata } from '../index-
|
|
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-
|
|
1
|
+
import { c as TokenUsage, C as ChatMessage } from '../index-DDzvTDg0.cjs';
|
|
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.cjs';
|
|
3
|
+
import { A as AIError, b as AIErrorType, a as AIErrorMetadata } from '../index-itgxPeLz.cjs';
|
|
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-itgxPeLz.cjs';
|
|
5
5
|
import { b as RetryManager, c as RetryOptions, a as RequestQueue, R as RequestDeduplicator } from '../request-deduplicator.util-NDo0_n1y.cjs';
|
|
6
6
|
export { Q as QueueOptions, r as requestDeduplicator, d as requestQueue, e as retryManager, w as withRetry } from '../request-deduplicator.util-NDo0_n1y.cjs';
|
|
7
7
|
export { C as CacheManager, a as CacheOptions, b as CacheStats, c as cacheManager } from '../cache-manager-Df9LLYGA.cjs';
|
|
@@ -55,6 +55,22 @@ declare function buildHttpStatusFallback(status: number, statusText: string): st
|
|
|
55
55
|
declare function extractErrorMessageFromResponse(response: Response): Promise<string>;
|
|
56
56
|
declare function describeAIErrorType(type: AIErrorType): string;
|
|
57
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
|
+
|
|
58
74
|
interface IRequestExecutor<TArgs extends unknown[], TResult> {
|
|
59
75
|
execute(fn: (...args: TArgs) => Promise<TResult>, ...args: TArgs): Promise<TResult>;
|
|
60
76
|
}
|
|
@@ -217,6 +233,12 @@ interface ChunkOptions {
|
|
|
217
233
|
}
|
|
218
234
|
declare function chunkText(text: string, options?: ChunkOptions): string[];
|
|
219
235
|
|
|
236
|
+
declare const TEXT_EXTRACT_PER_FILE_LIMIT = 24000;
|
|
237
|
+
declare const TEXT_EXTRACT_TOTAL_LIMIT = 48000;
|
|
238
|
+
declare function isTextLike(mimeType: string, name: string): boolean;
|
|
239
|
+
declare function extractText(bytes: Uint8Array): string;
|
|
240
|
+
declare function capText(text: string, limit: number): string;
|
|
241
|
+
|
|
220
242
|
interface AccessTimestamped {
|
|
221
243
|
readonly lastAccess: number;
|
|
222
244
|
}
|
|
@@ -408,6 +430,197 @@ declare function searchWeb(env: {
|
|
|
408
430
|
readonly TAVILY_BASE_URL?: string;
|
|
409
431
|
}, input: WebSearchInput, fetchImpl?: FetchLike): Promise<WebSearchResponse>;
|
|
410
432
|
|
|
433
|
+
type StreamEvent<TToolCall = unknown> = {
|
|
434
|
+
readonly type: 'delta';
|
|
435
|
+
readonly channel: 'answer' | 'reasoning';
|
|
436
|
+
readonly text: string;
|
|
437
|
+
} | {
|
|
438
|
+
readonly type: 'usage';
|
|
439
|
+
readonly usage: {
|
|
440
|
+
readonly inputTokens: number;
|
|
441
|
+
readonly outputTokens: number;
|
|
442
|
+
readonly reasoningTokens?: number;
|
|
443
|
+
};
|
|
444
|
+
} | {
|
|
445
|
+
readonly type: 'tool_call';
|
|
446
|
+
readonly toolCall: TToolCall;
|
|
447
|
+
} | {
|
|
448
|
+
readonly type: 'done';
|
|
449
|
+
readonly messageId: string;
|
|
450
|
+
} | {
|
|
451
|
+
readonly type: 'error';
|
|
452
|
+
readonly code: string;
|
|
453
|
+
readonly message: string;
|
|
454
|
+
};
|
|
455
|
+
declare function formatSseEvent(event: StreamEvent): string;
|
|
456
|
+
declare function sseStreamResponse(events: AsyncIterable<StreamEvent>): Response;
|
|
457
|
+
declare function replayFirst<T>(first: T, rest: AsyncIterable<T>): AsyncIterable<T>;
|
|
458
|
+
|
|
459
|
+
interface MarkdownSegment {
|
|
460
|
+
readonly kind: 'text' | 'code';
|
|
461
|
+
readonly text: string;
|
|
462
|
+
readonly language?: string;
|
|
463
|
+
}
|
|
464
|
+
declare function splitMarkdown(source: string): MarkdownSegment[];
|
|
465
|
+
declare function deriveSnippetTitle(code: string): string;
|
|
466
|
+
|
|
467
|
+
interface DiffLine {
|
|
468
|
+
readonly type: 'same' | 'add' | 'remove';
|
|
469
|
+
readonly text: string;
|
|
470
|
+
}
|
|
471
|
+
interface DiffChangeCount {
|
|
472
|
+
readonly added: number;
|
|
473
|
+
readonly removed: number;
|
|
474
|
+
}
|
|
475
|
+
declare function diffLines(before: string, after: string): DiffLine[];
|
|
476
|
+
declare function countChanges(lines: readonly DiffLine[]): DiffChangeCount;
|
|
477
|
+
|
|
478
|
+
declare const MEMORY_MAX_ITEMS = 20;
|
|
479
|
+
declare const MEMORY_TOTAL_LIMIT = 4000;
|
|
480
|
+
interface MemoryLike {
|
|
481
|
+
readonly content: string;
|
|
482
|
+
readonly pinned: boolean;
|
|
483
|
+
readonly updatedAt: Date | string | number;
|
|
484
|
+
}
|
|
485
|
+
declare function selectMemories(rows: readonly MemoryLike[], maxItems?: number, totalLimit?: number, capper?: (text: string, limit: number) => string): string[];
|
|
486
|
+
|
|
487
|
+
declare const RESEARCH_QUERY_MIN = 4;
|
|
488
|
+
declare const RESEARCH_QUERY_MAX = 400;
|
|
489
|
+
declare const RESEARCH_MAX_OUTPUT_TOKENS = 2048;
|
|
490
|
+
declare const RESEARCH_TEMPERATURE = 0.2;
|
|
491
|
+
declare const RESEARCH_REPORT_MIN_CHARS = 40;
|
|
492
|
+
declare const RESEARCH_SNIPPET_MAX_CHARS = 1000;
|
|
493
|
+
interface ResearchSource {
|
|
494
|
+
readonly title: string;
|
|
495
|
+
readonly url: string;
|
|
496
|
+
readonly snippet: string;
|
|
497
|
+
}
|
|
498
|
+
interface ResearchStreamEvent {
|
|
499
|
+
readonly type: string;
|
|
500
|
+
readonly channel?: 'answer' | 'reasoning' | string;
|
|
501
|
+
readonly text?: string;
|
|
502
|
+
readonly usage?: TokenUsage;
|
|
503
|
+
}
|
|
504
|
+
declare function normalizeSources(results: readonly WebSearchResult[], maxSnippetChars?: number): ResearchSource[];
|
|
505
|
+
declare function buildResearchMessages(query: string, sources: readonly ResearchSource[], systemPersona?: string): ChatMessage[];
|
|
506
|
+
declare function accumulateReport(stream: AsyncIterable<ResearchStreamEvent>): Promise<{
|
|
507
|
+
report: string;
|
|
508
|
+
usage: TokenUsage | null;
|
|
509
|
+
}>;
|
|
510
|
+
|
|
511
|
+
interface EmbeddingsBatchAdapter {
|
|
512
|
+
embed(req: {
|
|
513
|
+
externalModelId: string;
|
|
514
|
+
input: string[];
|
|
515
|
+
}): Promise<{
|
|
516
|
+
vectors: number[][];
|
|
517
|
+
inputTokens: number | null;
|
|
518
|
+
}>;
|
|
519
|
+
}
|
|
520
|
+
declare const DEFAULT_EMBED_BATCH_SIZE = 32;
|
|
521
|
+
declare function batchEmbed(adapter: EmbeddingsBatchAdapter, externalModelId: string, texts: readonly string[], batchSize?: number): Promise<{
|
|
522
|
+
vectors: number[][];
|
|
523
|
+
inputTokens: number | null;
|
|
524
|
+
}>;
|
|
525
|
+
declare function dotProduct(a: readonly number[], b: readonly number[]): number;
|
|
526
|
+
declare function magnitude(v: readonly number[]): number;
|
|
527
|
+
declare function cosineSimilarity(a: readonly number[], b: readonly number[]): number;
|
|
528
|
+
interface VectorCandidate<T = unknown> {
|
|
529
|
+
readonly id: string;
|
|
530
|
+
readonly vector: readonly number[];
|
|
531
|
+
readonly data?: T;
|
|
532
|
+
}
|
|
533
|
+
interface VectorMatch<T = unknown> {
|
|
534
|
+
readonly id: string;
|
|
535
|
+
readonly similarity: number;
|
|
536
|
+
readonly data?: T;
|
|
537
|
+
}
|
|
538
|
+
declare function findTopKSimilar<T = unknown>(queryVector: readonly number[], candidates: readonly VectorCandidate<T>[], k?: number): VectorMatch<T>[];
|
|
539
|
+
|
|
540
|
+
interface GenerationSettings {
|
|
541
|
+
temperature?: number;
|
|
542
|
+
maxOutputTokens?: number;
|
|
543
|
+
topP?: number;
|
|
544
|
+
}
|
|
545
|
+
declare const GENERATION_BOUNDS: {
|
|
546
|
+
readonly temperature: {
|
|
547
|
+
readonly min: 0;
|
|
548
|
+
readonly max: 2;
|
|
549
|
+
};
|
|
550
|
+
readonly topP: {
|
|
551
|
+
readonly min: 0;
|
|
552
|
+
readonly max: 1;
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
declare const DEFAULT_GENERATION: Required<GenerationSettings>;
|
|
556
|
+
declare function normalizeGenerationSettings(requested: GenerationSettings | undefined, maxModelTokens?: number): Required<GenerationSettings>;
|
|
557
|
+
|
|
558
|
+
interface StreamCallbacks<TToolCall = unknown> {
|
|
559
|
+
onDelta(channel: 'answer' | 'reasoning', text: string): void;
|
|
560
|
+
onUsage?(usage: {
|
|
561
|
+
inputTokens: number;
|
|
562
|
+
outputTokens: number;
|
|
563
|
+
reasoningTokens?: number;
|
|
564
|
+
}): void;
|
|
565
|
+
onToolCall?(toolCall: TToolCall): void;
|
|
566
|
+
onDone?(messageId: string): void;
|
|
567
|
+
onError?(code: string, message: string): void;
|
|
568
|
+
}
|
|
569
|
+
type ParsedSseEvent<TToolCall = unknown> = {
|
|
570
|
+
readonly type: 'delta';
|
|
571
|
+
readonly channel: 'answer' | 'reasoning';
|
|
572
|
+
readonly text: string;
|
|
573
|
+
} | {
|
|
574
|
+
readonly type: 'usage';
|
|
575
|
+
readonly usage: {
|
|
576
|
+
readonly inputTokens: number;
|
|
577
|
+
readonly outputTokens: number;
|
|
578
|
+
readonly reasoningTokens?: number;
|
|
579
|
+
};
|
|
580
|
+
} | {
|
|
581
|
+
readonly type: 'tool_call';
|
|
582
|
+
readonly toolCall: TToolCall;
|
|
583
|
+
} | {
|
|
584
|
+
readonly type: 'done';
|
|
585
|
+
readonly messageId: string;
|
|
586
|
+
} | {
|
|
587
|
+
readonly type: 'error';
|
|
588
|
+
readonly code: string;
|
|
589
|
+
readonly message: string;
|
|
590
|
+
};
|
|
591
|
+
declare function parseSseEvent<TToolCall = unknown>(rawEvent: string): ParsedSseEvent<TToolCall> | null;
|
|
592
|
+
declare function readSseResponse<TToolCall = unknown>(response: Response, callbacks: StreamCallbacks<TToolCall>): Promise<void>;
|
|
593
|
+
|
|
594
|
+
type ToolValidationResult = {
|
|
595
|
+
readonly ok: true;
|
|
596
|
+
} | {
|
|
597
|
+
readonly ok: false;
|
|
598
|
+
readonly error: string;
|
|
599
|
+
};
|
|
600
|
+
type ToolValidatorFunction = (args: Record<string, unknown>) => {
|
|
601
|
+
ok: true;
|
|
602
|
+
} | {
|
|
603
|
+
ok: false;
|
|
604
|
+
error: string;
|
|
605
|
+
};
|
|
606
|
+
interface ZodLikeIssue {
|
|
607
|
+
readonly path: readonly (string | number)[];
|
|
608
|
+
readonly message: string;
|
|
609
|
+
}
|
|
610
|
+
interface ZodLikeSchema {
|
|
611
|
+
safeParse(data: unknown): {
|
|
612
|
+
readonly success: true;
|
|
613
|
+
readonly data?: unknown;
|
|
614
|
+
} | {
|
|
615
|
+
readonly success: false;
|
|
616
|
+
readonly error: {
|
|
617
|
+
readonly issues: readonly ZodLikeIssue[];
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
type ToolSchema = ToolValidatorFunction | ZodLikeSchema;
|
|
622
|
+
declare function validateToolArgs(toolKey: string, args: Record<string, unknown>, schemas: Record<string, ToolSchema>): ToolValidationResult;
|
|
623
|
+
|
|
411
624
|
declare const SSE_PREFIX: "data: ";
|
|
412
625
|
declare const SSE_DONE_MARKER: "[DONE]";
|
|
413
626
|
declare const JSON_CODE_BLOCK_PATTERN: RegExp;
|
|
@@ -419,4 +632,4 @@ declare const DEFAULT_RETRY_MAX_DELAY_MS = 10000;
|
|
|
419
632
|
declare const DEFAULT_RETRY_BACKOFF_MULTIPLIER = 2;
|
|
420
633
|
declare const DEFAULT_RETRY_JITTER_FACTOR = 0.1;
|
|
421
634
|
|
|
422
|
-
export { AIError, type AIErrorBody, AIErrorMetadata, AIErrorType, type AccessCounted, type AccessTimestamped, type AgentContext, type ApiKeyValidationRule, type AssistantToolCall, CHUNK_MAX_CHARS, CHUNK_OVERLAP_CHARS, CHUNK_TEXT_LIMIT, type ChunkOptions, CompositeExecutor, type ContextBudget, type ContextMessage, type ContextRole, DEFAULT_AI_IDENTITY, 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, DEFAULT_TASK_POLICIES, DebounceManager, type DebounceOptions, DedupeExecutor, type DedupeExecutorOptions, type ErrorClassificationRule, type ExponentialBackoffParams, type FailoverErrorLike, type FetchLike, GroqError, type GroqErrorMetadata, AIErrorType as GroqErrorType, type HttpStatusClassificationRule, type IRequestExecutor, JSON_CODE_BLOCK_PATTERN, JSON_OBJECT_PATTERN, JsonResponseParser, type LeadingEdgeParams, type LoggedError, MICROS_PER_UNIT, type ModelPricing, type ModelWithProvider, type NormalizedSseChunk, type ProjectContext, QueueExecutor, RequestDeduplicator, RequestQueue, RetryExecutor, RetryManager, RetryOptions, SEARCH_MAX_RESULTS, SSE_BRIDGE_EVENTS, SSE_DONE_MARKER, SSE_PREFIX, SYSTEM_PROMPT_VERSION, type SearchTopic, type SseDeltaExtractor, type SseResponseOptions, type StreamingParserCallbacks, StreamingResponseParser, StructuredPromptBuilder, type SystemPromptInput, TRANSIENT_ERROR_CODES, type TaskPlan, type TaskPolicy, type TaskState, ThrottleManager, type ThrottleOptions, TokenUsage, ToolCallAccumulator, type TrailingDelayParams, type UsageRecordData, type UsageRecordInput, type WebSearchInput, type WebSearchResponse, type WebSearchResult, type WireToolCallDelta, asObjectArray, asRecord, asStringArray, asTrimmedOptionalString, buildCacheKey, buildContext, buildHttpStatusFallback, buildSystemPrompt, buildUsageData, calculateCacheHitRate, calculateExponentialBackoff, calculateTrailingDelay, canFailover, canStartTask, chunkText, clampScore, classifyHttpStatus, computeCostMicros, createSseResponse, debounce, debounceManager, defaultSseDeltaExtractor, describeAIErrorType, estimateMessageTokens, estimateTokens, extractErrorMessageFromJsonBody, extractErrorMessageFromResponse, extractJsonArray, extractJsonCandidate, extractJsonFromCodeFence, extractJsonObject, extractSseDataPayload, failoverCandidate, formatCost, formatErrorForLogging, generateRandomBase36Suffix, isAuthErrorType, isRetryableErrorType, isSseDataLine, isSseDoneMarker, isTransientError, isValidApiKey, isWithinWindow, nextAttemptDelayMs, normalizeSseChunk, oneOfCatalog, planTaskFailure, repairCommonJsonDefects, resolveUserFriendlyErrorMessage, resolveUserFriendlyMessage, searchWeb, selectLeastRecentlyUsedKey, shouldCallOnLeadingEdge, splitSseLines, throttle, throttleManager, validateApiKey };
|
|
635
|
+
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, TEXT_EXTRACT_PER_FILE_LIMIT, TEXT_EXTRACT_TOTAL_LIMIT, 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, 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 };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { A as AIError, b as AIErrorType, a as AIErrorMetadata } from '../index-
|
|
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-
|
|
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';
|
|
5
5
|
import { b as RetryManager, c as RetryOptions, a as RequestQueue, R as RequestDeduplicator } from '../request-deduplicator.util-NDo0_n1y.js';
|
|
6
6
|
export { Q as QueueOptions, r as requestDeduplicator, d as requestQueue, e as retryManager, w as withRetry } from '../request-deduplicator.util-NDo0_n1y.js';
|
|
7
7
|
export { C as CacheManager, a as CacheOptions, b as CacheStats, c as cacheManager } from '../cache-manager-Df9LLYGA.js';
|
|
@@ -55,6 +55,22 @@ declare function buildHttpStatusFallback(status: number, statusText: string): st
|
|
|
55
55
|
declare function extractErrorMessageFromResponse(response: Response): Promise<string>;
|
|
56
56
|
declare function describeAIErrorType(type: AIErrorType): string;
|
|
57
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
|
+
|
|
58
74
|
interface IRequestExecutor<TArgs extends unknown[], TResult> {
|
|
59
75
|
execute(fn: (...args: TArgs) => Promise<TResult>, ...args: TArgs): Promise<TResult>;
|
|
60
76
|
}
|
|
@@ -217,6 +233,12 @@ interface ChunkOptions {
|
|
|
217
233
|
}
|
|
218
234
|
declare function chunkText(text: string, options?: ChunkOptions): string[];
|
|
219
235
|
|
|
236
|
+
declare const TEXT_EXTRACT_PER_FILE_LIMIT = 24000;
|
|
237
|
+
declare const TEXT_EXTRACT_TOTAL_LIMIT = 48000;
|
|
238
|
+
declare function isTextLike(mimeType: string, name: string): boolean;
|
|
239
|
+
declare function extractText(bytes: Uint8Array): string;
|
|
240
|
+
declare function capText(text: string, limit: number): string;
|
|
241
|
+
|
|
220
242
|
interface AccessTimestamped {
|
|
221
243
|
readonly lastAccess: number;
|
|
222
244
|
}
|
|
@@ -408,6 +430,197 @@ declare function searchWeb(env: {
|
|
|
408
430
|
readonly TAVILY_BASE_URL?: string;
|
|
409
431
|
}, input: WebSearchInput, fetchImpl?: FetchLike): Promise<WebSearchResponse>;
|
|
410
432
|
|
|
433
|
+
type StreamEvent<TToolCall = unknown> = {
|
|
434
|
+
readonly type: 'delta';
|
|
435
|
+
readonly channel: 'answer' | 'reasoning';
|
|
436
|
+
readonly text: string;
|
|
437
|
+
} | {
|
|
438
|
+
readonly type: 'usage';
|
|
439
|
+
readonly usage: {
|
|
440
|
+
readonly inputTokens: number;
|
|
441
|
+
readonly outputTokens: number;
|
|
442
|
+
readonly reasoningTokens?: number;
|
|
443
|
+
};
|
|
444
|
+
} | {
|
|
445
|
+
readonly type: 'tool_call';
|
|
446
|
+
readonly toolCall: TToolCall;
|
|
447
|
+
} | {
|
|
448
|
+
readonly type: 'done';
|
|
449
|
+
readonly messageId: string;
|
|
450
|
+
} | {
|
|
451
|
+
readonly type: 'error';
|
|
452
|
+
readonly code: string;
|
|
453
|
+
readonly message: string;
|
|
454
|
+
};
|
|
455
|
+
declare function formatSseEvent(event: StreamEvent): string;
|
|
456
|
+
declare function sseStreamResponse(events: AsyncIterable<StreamEvent>): Response;
|
|
457
|
+
declare function replayFirst<T>(first: T, rest: AsyncIterable<T>): AsyncIterable<T>;
|
|
458
|
+
|
|
459
|
+
interface MarkdownSegment {
|
|
460
|
+
readonly kind: 'text' | 'code';
|
|
461
|
+
readonly text: string;
|
|
462
|
+
readonly language?: string;
|
|
463
|
+
}
|
|
464
|
+
declare function splitMarkdown(source: string): MarkdownSegment[];
|
|
465
|
+
declare function deriveSnippetTitle(code: string): string;
|
|
466
|
+
|
|
467
|
+
interface DiffLine {
|
|
468
|
+
readonly type: 'same' | 'add' | 'remove';
|
|
469
|
+
readonly text: string;
|
|
470
|
+
}
|
|
471
|
+
interface DiffChangeCount {
|
|
472
|
+
readonly added: number;
|
|
473
|
+
readonly removed: number;
|
|
474
|
+
}
|
|
475
|
+
declare function diffLines(before: string, after: string): DiffLine[];
|
|
476
|
+
declare function countChanges(lines: readonly DiffLine[]): DiffChangeCount;
|
|
477
|
+
|
|
478
|
+
declare const MEMORY_MAX_ITEMS = 20;
|
|
479
|
+
declare const MEMORY_TOTAL_LIMIT = 4000;
|
|
480
|
+
interface MemoryLike {
|
|
481
|
+
readonly content: string;
|
|
482
|
+
readonly pinned: boolean;
|
|
483
|
+
readonly updatedAt: Date | string | number;
|
|
484
|
+
}
|
|
485
|
+
declare function selectMemories(rows: readonly MemoryLike[], maxItems?: number, totalLimit?: number, capper?: (text: string, limit: number) => string): string[];
|
|
486
|
+
|
|
487
|
+
declare const RESEARCH_QUERY_MIN = 4;
|
|
488
|
+
declare const RESEARCH_QUERY_MAX = 400;
|
|
489
|
+
declare const RESEARCH_MAX_OUTPUT_TOKENS = 2048;
|
|
490
|
+
declare const RESEARCH_TEMPERATURE = 0.2;
|
|
491
|
+
declare const RESEARCH_REPORT_MIN_CHARS = 40;
|
|
492
|
+
declare const RESEARCH_SNIPPET_MAX_CHARS = 1000;
|
|
493
|
+
interface ResearchSource {
|
|
494
|
+
readonly title: string;
|
|
495
|
+
readonly url: string;
|
|
496
|
+
readonly snippet: string;
|
|
497
|
+
}
|
|
498
|
+
interface ResearchStreamEvent {
|
|
499
|
+
readonly type: string;
|
|
500
|
+
readonly channel?: 'answer' | 'reasoning' | string;
|
|
501
|
+
readonly text?: string;
|
|
502
|
+
readonly usage?: TokenUsage;
|
|
503
|
+
}
|
|
504
|
+
declare function normalizeSources(results: readonly WebSearchResult[], maxSnippetChars?: number): ResearchSource[];
|
|
505
|
+
declare function buildResearchMessages(query: string, sources: readonly ResearchSource[], systemPersona?: string): ChatMessage[];
|
|
506
|
+
declare function accumulateReport(stream: AsyncIterable<ResearchStreamEvent>): Promise<{
|
|
507
|
+
report: string;
|
|
508
|
+
usage: TokenUsage | null;
|
|
509
|
+
}>;
|
|
510
|
+
|
|
511
|
+
interface EmbeddingsBatchAdapter {
|
|
512
|
+
embed(req: {
|
|
513
|
+
externalModelId: string;
|
|
514
|
+
input: string[];
|
|
515
|
+
}): Promise<{
|
|
516
|
+
vectors: number[][];
|
|
517
|
+
inputTokens: number | null;
|
|
518
|
+
}>;
|
|
519
|
+
}
|
|
520
|
+
declare const DEFAULT_EMBED_BATCH_SIZE = 32;
|
|
521
|
+
declare function batchEmbed(adapter: EmbeddingsBatchAdapter, externalModelId: string, texts: readonly string[], batchSize?: number): Promise<{
|
|
522
|
+
vectors: number[][];
|
|
523
|
+
inputTokens: number | null;
|
|
524
|
+
}>;
|
|
525
|
+
declare function dotProduct(a: readonly number[], b: readonly number[]): number;
|
|
526
|
+
declare function magnitude(v: readonly number[]): number;
|
|
527
|
+
declare function cosineSimilarity(a: readonly number[], b: readonly number[]): number;
|
|
528
|
+
interface VectorCandidate<T = unknown> {
|
|
529
|
+
readonly id: string;
|
|
530
|
+
readonly vector: readonly number[];
|
|
531
|
+
readonly data?: T;
|
|
532
|
+
}
|
|
533
|
+
interface VectorMatch<T = unknown> {
|
|
534
|
+
readonly id: string;
|
|
535
|
+
readonly similarity: number;
|
|
536
|
+
readonly data?: T;
|
|
537
|
+
}
|
|
538
|
+
declare function findTopKSimilar<T = unknown>(queryVector: readonly number[], candidates: readonly VectorCandidate<T>[], k?: number): VectorMatch<T>[];
|
|
539
|
+
|
|
540
|
+
interface GenerationSettings {
|
|
541
|
+
temperature?: number;
|
|
542
|
+
maxOutputTokens?: number;
|
|
543
|
+
topP?: number;
|
|
544
|
+
}
|
|
545
|
+
declare const GENERATION_BOUNDS: {
|
|
546
|
+
readonly temperature: {
|
|
547
|
+
readonly min: 0;
|
|
548
|
+
readonly max: 2;
|
|
549
|
+
};
|
|
550
|
+
readonly topP: {
|
|
551
|
+
readonly min: 0;
|
|
552
|
+
readonly max: 1;
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
declare const DEFAULT_GENERATION: Required<GenerationSettings>;
|
|
556
|
+
declare function normalizeGenerationSettings(requested: GenerationSettings | undefined, maxModelTokens?: number): Required<GenerationSettings>;
|
|
557
|
+
|
|
558
|
+
interface StreamCallbacks<TToolCall = unknown> {
|
|
559
|
+
onDelta(channel: 'answer' | 'reasoning', text: string): void;
|
|
560
|
+
onUsage?(usage: {
|
|
561
|
+
inputTokens: number;
|
|
562
|
+
outputTokens: number;
|
|
563
|
+
reasoningTokens?: number;
|
|
564
|
+
}): void;
|
|
565
|
+
onToolCall?(toolCall: TToolCall): void;
|
|
566
|
+
onDone?(messageId: string): void;
|
|
567
|
+
onError?(code: string, message: string): void;
|
|
568
|
+
}
|
|
569
|
+
type ParsedSseEvent<TToolCall = unknown> = {
|
|
570
|
+
readonly type: 'delta';
|
|
571
|
+
readonly channel: 'answer' | 'reasoning';
|
|
572
|
+
readonly text: string;
|
|
573
|
+
} | {
|
|
574
|
+
readonly type: 'usage';
|
|
575
|
+
readonly usage: {
|
|
576
|
+
readonly inputTokens: number;
|
|
577
|
+
readonly outputTokens: number;
|
|
578
|
+
readonly reasoningTokens?: number;
|
|
579
|
+
};
|
|
580
|
+
} | {
|
|
581
|
+
readonly type: 'tool_call';
|
|
582
|
+
readonly toolCall: TToolCall;
|
|
583
|
+
} | {
|
|
584
|
+
readonly type: 'done';
|
|
585
|
+
readonly messageId: string;
|
|
586
|
+
} | {
|
|
587
|
+
readonly type: 'error';
|
|
588
|
+
readonly code: string;
|
|
589
|
+
readonly message: string;
|
|
590
|
+
};
|
|
591
|
+
declare function parseSseEvent<TToolCall = unknown>(rawEvent: string): ParsedSseEvent<TToolCall> | null;
|
|
592
|
+
declare function readSseResponse<TToolCall = unknown>(response: Response, callbacks: StreamCallbacks<TToolCall>): Promise<void>;
|
|
593
|
+
|
|
594
|
+
type ToolValidationResult = {
|
|
595
|
+
readonly ok: true;
|
|
596
|
+
} | {
|
|
597
|
+
readonly ok: false;
|
|
598
|
+
readonly error: string;
|
|
599
|
+
};
|
|
600
|
+
type ToolValidatorFunction = (args: Record<string, unknown>) => {
|
|
601
|
+
ok: true;
|
|
602
|
+
} | {
|
|
603
|
+
ok: false;
|
|
604
|
+
error: string;
|
|
605
|
+
};
|
|
606
|
+
interface ZodLikeIssue {
|
|
607
|
+
readonly path: readonly (string | number)[];
|
|
608
|
+
readonly message: string;
|
|
609
|
+
}
|
|
610
|
+
interface ZodLikeSchema {
|
|
611
|
+
safeParse(data: unknown): {
|
|
612
|
+
readonly success: true;
|
|
613
|
+
readonly data?: unknown;
|
|
614
|
+
} | {
|
|
615
|
+
readonly success: false;
|
|
616
|
+
readonly error: {
|
|
617
|
+
readonly issues: readonly ZodLikeIssue[];
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
type ToolSchema = ToolValidatorFunction | ZodLikeSchema;
|
|
622
|
+
declare function validateToolArgs(toolKey: string, args: Record<string, unknown>, schemas: Record<string, ToolSchema>): ToolValidationResult;
|
|
623
|
+
|
|
411
624
|
declare const SSE_PREFIX: "data: ";
|
|
412
625
|
declare const SSE_DONE_MARKER: "[DONE]";
|
|
413
626
|
declare const JSON_CODE_BLOCK_PATTERN: RegExp;
|
|
@@ -419,4 +632,4 @@ declare const DEFAULT_RETRY_MAX_DELAY_MS = 10000;
|
|
|
419
632
|
declare const DEFAULT_RETRY_BACKOFF_MULTIPLIER = 2;
|
|
420
633
|
declare const DEFAULT_RETRY_JITTER_FACTOR = 0.1;
|
|
421
634
|
|
|
422
|
-
export { AIError, type AIErrorBody, AIErrorMetadata, AIErrorType, type AccessCounted, type AccessTimestamped, type AgentContext, type ApiKeyValidationRule, type AssistantToolCall, CHUNK_MAX_CHARS, CHUNK_OVERLAP_CHARS, CHUNK_TEXT_LIMIT, type ChunkOptions, CompositeExecutor, type ContextBudget, type ContextMessage, type ContextRole, DEFAULT_AI_IDENTITY, 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, DEFAULT_TASK_POLICIES, DebounceManager, type DebounceOptions, DedupeExecutor, type DedupeExecutorOptions, type ErrorClassificationRule, type ExponentialBackoffParams, type FailoverErrorLike, type FetchLike, GroqError, type GroqErrorMetadata, AIErrorType as GroqErrorType, type HttpStatusClassificationRule, type IRequestExecutor, JSON_CODE_BLOCK_PATTERN, JSON_OBJECT_PATTERN, JsonResponseParser, type LeadingEdgeParams, type LoggedError, MICROS_PER_UNIT, type ModelPricing, type ModelWithProvider, type NormalizedSseChunk, type ProjectContext, QueueExecutor, RequestDeduplicator, RequestQueue, RetryExecutor, RetryManager, RetryOptions, SEARCH_MAX_RESULTS, SSE_BRIDGE_EVENTS, SSE_DONE_MARKER, SSE_PREFIX, SYSTEM_PROMPT_VERSION, type SearchTopic, type SseDeltaExtractor, type SseResponseOptions, type StreamingParserCallbacks, StreamingResponseParser, StructuredPromptBuilder, type SystemPromptInput, TRANSIENT_ERROR_CODES, type TaskPlan, type TaskPolicy, type TaskState, ThrottleManager, type ThrottleOptions, TokenUsage, ToolCallAccumulator, type TrailingDelayParams, type UsageRecordData, type UsageRecordInput, type WebSearchInput, type WebSearchResponse, type WebSearchResult, type WireToolCallDelta, asObjectArray, asRecord, asStringArray, asTrimmedOptionalString, buildCacheKey, buildContext, buildHttpStatusFallback, buildSystemPrompt, buildUsageData, calculateCacheHitRate, calculateExponentialBackoff, calculateTrailingDelay, canFailover, canStartTask, chunkText, clampScore, classifyHttpStatus, computeCostMicros, createSseResponse, debounce, debounceManager, defaultSseDeltaExtractor, describeAIErrorType, estimateMessageTokens, estimateTokens, extractErrorMessageFromJsonBody, extractErrorMessageFromResponse, extractJsonArray, extractJsonCandidate, extractJsonFromCodeFence, extractJsonObject, extractSseDataPayload, failoverCandidate, formatCost, formatErrorForLogging, generateRandomBase36Suffix, isAuthErrorType, isRetryableErrorType, isSseDataLine, isSseDoneMarker, isTransientError, isValidApiKey, isWithinWindow, nextAttemptDelayMs, normalizeSseChunk, oneOfCatalog, planTaskFailure, repairCommonJsonDefects, resolveUserFriendlyErrorMessage, resolveUserFriendlyMessage, searchWeb, selectLeastRecentlyUsedKey, shouldCallOnLeadingEdge, splitSseLines, throttle, throttleManager, validateApiKey };
|
|
635
|
+
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, TEXT_EXTRACT_PER_FILE_LIMIT, TEXT_EXTRACT_TOTAL_LIMIT, 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, 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 };
|