@ljoukov/llm 7.0.12 → 7.0.14
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/README.md +58 -3
- package/dist/index.cjs +572 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -23
- package/dist/index.d.ts +94 -23
- package/dist/index.js +555 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -5,23 +5,82 @@ import { ResponseTextConfig } from 'openai/resources/responses/responses';
|
|
|
5
5
|
|
|
6
6
|
type LlmUsageTokens = {
|
|
7
7
|
readonly promptTokens?: number;
|
|
8
|
+
readonly promptTextTokens?: number;
|
|
9
|
+
readonly promptImageTokens?: number;
|
|
8
10
|
readonly cachedTokens?: number;
|
|
9
11
|
readonly responseTokens?: number;
|
|
12
|
+
readonly responseTextTokens?: number;
|
|
10
13
|
readonly responseImageTokens?: number;
|
|
11
14
|
readonly thinkingTokens?: number;
|
|
12
15
|
readonly totalTokens?: number;
|
|
13
16
|
readonly toolUsePromptTokens?: number;
|
|
14
17
|
};
|
|
15
|
-
declare function estimateCallCostUsd({ modelId, tokens, responseImages, imageSize, }: {
|
|
18
|
+
declare function estimateCallCostUsd({ modelId, tokens, responseImages, imageSize, imageQuality, }: {
|
|
16
19
|
modelId: string;
|
|
17
20
|
tokens: LlmUsageTokens | undefined;
|
|
18
21
|
responseImages: number;
|
|
19
22
|
imageSize?: string;
|
|
23
|
+
imageQuality?: string;
|
|
20
24
|
}): number;
|
|
21
25
|
|
|
26
|
+
declare const GEMINI_TEXT_MODEL_IDS: readonly ["gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest"];
|
|
27
|
+
declare const GEMINI_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
28
|
+
declare const GEMINI_MODEL_IDS: readonly ["gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
29
|
+
type GeminiModelId = (typeof GEMINI_MODEL_IDS)[number];
|
|
30
|
+
type GeminiTextModelId = (typeof GEMINI_TEXT_MODEL_IDS)[number];
|
|
31
|
+
type GeminiImageModelId = (typeof GEMINI_IMAGE_MODEL_IDS)[number];
|
|
32
|
+
declare function isGeminiModelId(value: string): value is GeminiModelId;
|
|
33
|
+
declare function isGeminiTextModelId(value: string): value is GeminiTextModelId;
|
|
34
|
+
declare function isGeminiImageModelId(value: string): value is GeminiImageModelId;
|
|
35
|
+
type GeminiConfiguration = {
|
|
36
|
+
readonly projectId?: string;
|
|
37
|
+
readonly location?: string;
|
|
38
|
+
};
|
|
39
|
+
declare function configureGemini(options?: GeminiConfiguration): void;
|
|
40
|
+
|
|
22
41
|
declare const OPENAI_MODEL_IDS: readonly ["gpt-5.5", "gpt-5.5-fast", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
|
|
23
42
|
type OpenAiModelId = (typeof OPENAI_MODEL_IDS)[number];
|
|
24
43
|
declare function isOpenAiModelId(value: string): value is OpenAiModelId;
|
|
44
|
+
declare const OPENAI_IMAGE_MODEL_IDS: readonly ["gpt-image-2"];
|
|
45
|
+
type OpenAiImageModelId = (typeof OPENAI_IMAGE_MODEL_IDS)[number];
|
|
46
|
+
declare function isOpenAiImageModelId(value: string): value is OpenAiImageModelId;
|
|
47
|
+
declare const CHATGPT_IMAGE_MODEL_IDS: readonly ["chatgpt-gpt-image-2"];
|
|
48
|
+
type ChatGptImageModelId = (typeof CHATGPT_IMAGE_MODEL_IDS)[number];
|
|
49
|
+
declare function isChatGptImageModelId(value: string): value is ChatGptImageModelId;
|
|
50
|
+
declare const OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS: readonly ["1024x1024", "1536x1024", "1024x1536", "2048x2048", "2048x1152", "3840x2160", "2160x3840"];
|
|
51
|
+
type OpenAiGptImage2PopularResolution = (typeof OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS)[number];
|
|
52
|
+
declare const OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION: "auto";
|
|
53
|
+
declare const OPENAI_GPT_IMAGE_2_RESOLUTIONS: readonly ["1024x1024", "1536x1024", "1024x1536", "2048x2048", "2048x1152", "3840x2160", "2160x3840", "auto"];
|
|
54
|
+
type OpenAiGptImage2ListedResolution = (typeof OPENAI_GPT_IMAGE_2_RESOLUTIONS)[number];
|
|
55
|
+
type OpenAiGptImage2CustomResolution = `${number}x${number}`;
|
|
56
|
+
type OpenAiGptImage2Resolution = OpenAiGptImage2ListedResolution | OpenAiGptImage2CustomResolution;
|
|
57
|
+
declare const OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS: {
|
|
58
|
+
readonly maxEdgePixels: 3840;
|
|
59
|
+
readonly edgeMultiplePixels: 16;
|
|
60
|
+
readonly maxLongToShortEdgeRatio: 3;
|
|
61
|
+
readonly minTotalPixels: 655360;
|
|
62
|
+
readonly maxTotalPixels: 8294400;
|
|
63
|
+
readonly experimentalTotalPixelsThreshold: 3686400;
|
|
64
|
+
};
|
|
65
|
+
type OpenAiGptImage2ResolutionValidationResult = {
|
|
66
|
+
readonly valid: true;
|
|
67
|
+
} | {
|
|
68
|
+
readonly valid: false;
|
|
69
|
+
readonly reason: string;
|
|
70
|
+
};
|
|
71
|
+
declare function validateOpenAiGptImage2Resolution(value: string): OpenAiGptImage2ResolutionValidationResult;
|
|
72
|
+
declare const OPENAI_GPT_IMAGE_2_QUALITY_LEVELS: readonly ["low", "medium", "high", "auto"];
|
|
73
|
+
type OpenAiGptImage2Quality = (typeof OPENAI_GPT_IMAGE_2_QUALITY_LEVELS)[number];
|
|
74
|
+
declare const OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS: readonly ["png", "jpeg", "webp"];
|
|
75
|
+
type OpenAiGptImage2OutputFormat = (typeof OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS)[number];
|
|
76
|
+
declare const OPENAI_GPT_IMAGE_2_BACKGROUNDS: readonly ["opaque", "auto"];
|
|
77
|
+
type OpenAiGptImage2Background = (typeof OPENAI_GPT_IMAGE_2_BACKGROUNDS)[number];
|
|
78
|
+
declare const OPENAI_GPT_IMAGE_2_MODERATION_LEVELS: readonly ["low", "auto"];
|
|
79
|
+
type OpenAiGptImage2Moderation = (typeof OPENAI_GPT_IMAGE_2_MODERATION_LEVELS)[number];
|
|
80
|
+
declare const OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS: readonly [0, 1, 2, 3];
|
|
81
|
+
type OpenAiGptImage2PartialImageCount = (typeof OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS)[number];
|
|
82
|
+
declare const OPENAI_GPT_IMAGE_2_NUM_IMAGES: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
83
|
+
type OpenAiGptImage2NumImages = (typeof OPENAI_GPT_IMAGE_2_NUM_IMAGES)[number];
|
|
25
84
|
declare const CHATGPT_MODEL_IDS: readonly ["chatgpt-gpt-5.5", "chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark"];
|
|
26
85
|
declare const EXPERIMENTAL_CHATGPT_MODEL_PREFIX: "experimental-chatgpt-";
|
|
27
86
|
type ListedChatGptModelId = (typeof CHATGPT_MODEL_IDS)[number];
|
|
@@ -29,6 +88,7 @@ type ExperimentalChatGptModelId = `${typeof EXPERIMENTAL_CHATGPT_MODEL_PREFIX}${
|
|
|
29
88
|
type ChatGptModelId = ListedChatGptModelId | ExperimentalChatGptModelId;
|
|
30
89
|
declare function isExperimentalChatGptModelId(value: string): value is ExperimentalChatGptModelId;
|
|
31
90
|
declare function isChatGptModelId(value: string): value is ChatGptModelId;
|
|
91
|
+
declare function resolveChatGptImageProviderModel(_model: ChatGptImageModelId): string;
|
|
32
92
|
|
|
33
93
|
type LlmTelemetryOperation = "generateText" | "streamText" | "generateJson" | "streamJson" | "generateImages";
|
|
34
94
|
type LlmTelemetryBaseEvent = {
|
|
@@ -45,6 +105,7 @@ type LlmCallStartedTelemetryEvent = LlmTelemetryBaseEvent & {
|
|
|
45
105
|
readonly responseModalities?: readonly string[];
|
|
46
106
|
readonly imagePromptCount?: number;
|
|
47
107
|
readonly styleImageCount?: number;
|
|
108
|
+
readonly numImagesPerPrompt?: number;
|
|
48
109
|
readonly maxAttempts?: number;
|
|
49
110
|
readonly streamMode?: "partial" | "final";
|
|
50
111
|
};
|
|
@@ -247,9 +308,9 @@ type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlo
|
|
|
247
308
|
type LlmProvider = "openai" | "chatgpt" | "gemini" | "fireworks";
|
|
248
309
|
declare const LLM_TEXT_MODEL_IDS: readonly ["gpt-5.5", "gpt-5.5-fast", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "chatgpt-gpt-5.5", "chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark", "kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest"];
|
|
249
310
|
type LlmTextModelId = (typeof LLM_TEXT_MODEL_IDS)[number] | ExperimentalChatGptModelId;
|
|
250
|
-
declare const LLM_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
311
|
+
declare const LLM_IMAGE_MODEL_IDS: readonly ["gpt-image-2", "chatgpt-gpt-image-2", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
251
312
|
type LlmImageModelId = (typeof LLM_IMAGE_MODEL_IDS)[number];
|
|
252
|
-
declare const LLM_MODEL_IDS: readonly ["gpt-5.5", "gpt-5.5-fast", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "chatgpt-gpt-5.5", "chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark", "kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
313
|
+
declare const LLM_MODEL_IDS: readonly ["gpt-5.5", "gpt-5.5-fast", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "chatgpt-gpt-5.5", "chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark", "kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest", "gpt-image-2", "chatgpt-gpt-image-2", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
253
314
|
type LlmModelId = LlmTextModelId | LlmImageModelId;
|
|
254
315
|
declare function isLlmTextModelId(value: string): value is LlmTextModelId;
|
|
255
316
|
declare function isLlmImageModelId(value: string): value is LlmImageModelId;
|
|
@@ -363,18 +424,43 @@ type LlmImageData = {
|
|
|
363
424
|
readonly mimeType?: string;
|
|
364
425
|
readonly data: Buffer$1;
|
|
365
426
|
};
|
|
366
|
-
type
|
|
367
|
-
|
|
427
|
+
type LlmOpenAiImageResolution = OpenAiGptImage2Resolution;
|
|
428
|
+
type LlmOpenAiImageQuality = OpenAiGptImage2Quality;
|
|
429
|
+
type LlmOpenAiImageOutputFormat = OpenAiGptImage2OutputFormat;
|
|
430
|
+
type LlmOpenAiImageBackground = OpenAiGptImage2Background;
|
|
431
|
+
type LlmOpenAiImageModeration = OpenAiGptImage2Moderation;
|
|
432
|
+
type LlmOpenAiImagePartialImageCount = OpenAiGptImage2PartialImageCount;
|
|
433
|
+
type LlmOpenAiImageNumImages = OpenAiGptImage2NumImages;
|
|
434
|
+
type LlmGenerateImagesRequestBase = {
|
|
368
435
|
readonly stylePrompt: string;
|
|
369
436
|
readonly styleImages?: readonly LlmImageData[];
|
|
370
437
|
readonly imagePrompts: readonly string[];
|
|
438
|
+
readonly telemetry?: TelemetrySelection;
|
|
439
|
+
readonly signal?: AbortSignal;
|
|
440
|
+
};
|
|
441
|
+
type LlmOpenAiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
442
|
+
readonly model: OpenAiImageModelId;
|
|
443
|
+
readonly imageResolution?: LlmOpenAiImageResolution;
|
|
444
|
+
readonly imageQuality?: LlmOpenAiImageQuality;
|
|
445
|
+
readonly outputFormat?: LlmOpenAiImageOutputFormat;
|
|
446
|
+
readonly outputCompression?: number;
|
|
447
|
+
readonly background?: LlmOpenAiImageBackground;
|
|
448
|
+
readonly moderation?: LlmOpenAiImageModeration;
|
|
449
|
+
readonly partialImages?: LlmOpenAiImagePartialImageCount;
|
|
450
|
+
readonly numImages?: LlmOpenAiImageNumImages;
|
|
451
|
+
};
|
|
452
|
+
type LlmChatGptGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
453
|
+
readonly model: ChatGptImageModelId;
|
|
454
|
+
readonly numImages?: LlmOpenAiImageNumImages;
|
|
455
|
+
};
|
|
456
|
+
type LlmGeminiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
457
|
+
readonly model: GeminiImageModelId;
|
|
371
458
|
readonly imageGradingPrompt: string;
|
|
372
459
|
readonly maxAttempts?: number;
|
|
373
460
|
readonly imageAspectRatio?: string;
|
|
374
461
|
readonly imageSize?: LlmImageSize;
|
|
375
|
-
readonly telemetry?: TelemetrySelection;
|
|
376
|
-
readonly signal?: AbortSignal;
|
|
377
462
|
};
|
|
463
|
+
type LlmGenerateImagesRequest = LlmOpenAiGenerateImagesRequest | LlmChatGptGenerateImagesRequest | LlmGeminiGenerateImagesRequest;
|
|
378
464
|
type LlmFunctionTool<Schema extends z.ZodType, Output> = {
|
|
379
465
|
readonly type?: "function";
|
|
380
466
|
readonly description?: string;
|
|
@@ -1013,21 +1099,6 @@ declare function refreshChatGptOauthToken(refreshToken: string, fallback?: {
|
|
|
1013
1099
|
}): Promise<ChatGptAuthProfile>;
|
|
1014
1100
|
declare function getChatGptAuthProfile(): Promise<ChatGptAuthProfile>;
|
|
1015
1101
|
|
|
1016
|
-
declare const GEMINI_TEXT_MODEL_IDS: readonly ["gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest"];
|
|
1017
|
-
declare const GEMINI_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
1018
|
-
declare const GEMINI_MODEL_IDS: readonly ["gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
1019
|
-
type GeminiModelId = (typeof GEMINI_MODEL_IDS)[number];
|
|
1020
|
-
type GeminiTextModelId = (typeof GEMINI_TEXT_MODEL_IDS)[number];
|
|
1021
|
-
type GeminiImageModelId = (typeof GEMINI_IMAGE_MODEL_IDS)[number];
|
|
1022
|
-
declare function isGeminiModelId(value: string): value is GeminiModelId;
|
|
1023
|
-
declare function isGeminiTextModelId(value: string): value is GeminiTextModelId;
|
|
1024
|
-
declare function isGeminiImageModelId(value: string): value is GeminiImageModelId;
|
|
1025
|
-
type GeminiConfiguration = {
|
|
1026
|
-
readonly projectId?: string;
|
|
1027
|
-
readonly location?: string;
|
|
1028
|
-
};
|
|
1029
|
-
declare function configureGemini(options?: GeminiConfiguration): void;
|
|
1030
|
-
|
|
1031
1102
|
declare const FIREWORKS_MODEL_IDS: readonly ["kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b"];
|
|
1032
1103
|
type FireworksModelId = (typeof FIREWORKS_MODEL_IDS)[number];
|
|
1033
1104
|
declare const FIREWORKS_DEFAULT_KIMI_MODEL: FireworksModelId;
|
|
@@ -1037,4 +1108,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
|
|
|
1037
1108
|
declare function isFireworksModelId(value: string): value is FireworksModelId;
|
|
1038
1109
|
declare function resolveFireworksModelId(model: string): string | undefined;
|
|
1039
1110
|
|
|
1040
|
-
export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLogLineSink, type AgentLoggingConfig, type AgentLoggingSelection, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, type AssessmentSubagentInput, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type CandidateAssessment, type CandidateEvolutionOptions, type CandidateEvolutionResult, type CandidateEvolutionSnapshot, type CandidateEvolutionStats, type CandidateFeedbackEntry, type CandidateIssue, type CandidateProposal, type CandidateRecord, type ChatGptAuthProfile, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CodexViewImageToolInput, type CreateApplyPatchToolOptions, DEFAULT_FILE_TTL_SECONDS, DEFAULT_SIGNED_URL_TTL_SECONDS, EXPERIMENTAL_CHATGPT_MODEL_PREFIX, type ExperimentalChatGptModelId, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, type FeedbackScope, type FireworksModelId, GEMINI_IMAGE_MODEL_IDS, GEMINI_MODEL_IDS, GEMINI_TEXT_MODEL_IDS, type GeminiGlobToolInput, type GeminiGrepSearchToolInput, type GeminiImageModelId, type GeminiListDirectoryToolInput, type GeminiModelId, type GeminiReadFileToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, type GenerationSubagent, type GenerationSubagentInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type ListedChatGptModelId, type LlmBaseRequest, type LlmBlockedEvent, type LlmCallCompletedTelemetryEvent, type LlmCallStartedTelemetryEvent, type LlmCallStreamTelemetryEvent, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFileCreateParams, type LlmFileDeleted, type LlmFileUploadBackend, type LlmFileUploadEvent, type LlmFileUploadMetrics, type LlmFileUploadMode, type LlmFileUploadSource, type LlmFunctionTool, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputFilePart, type LlmInputImagePart, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmMediaResolution, type LlmModelEvent, type LlmModelId, type LlmOpenAiShellEnvironment, type LlmOpenAiShellNetworkPolicy, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, type LlmTelemetryOperation, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmThinkingLevel, type LlmToolCallCompletedEvent, type LlmToolCallContext, type LlmToolCallResult, type LlmToolCallStartedEvent, type LlmToolCallStreamEvent, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopSteeringAppendResult, type LlmToolLoopSteeringChannel, type LlmToolLoopSteeringInput, type LlmToolLoopSteeringMessage, type LlmToolLoopStep, type LlmToolLoopStream, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, type ModelConcurrencyConfig, type ModelConcurrencyProvider, OPENAI_MODEL_IDS, type OpenAiModelId, type ParentSelectionConfig, type ParentSelectionMidpoint, type PostCheckRejection, type PostGenerationCheckInput, type RunAgentLoopRequest, type TelemetryConfig, type TelemetryEvent, type TelemetrySelection, type TelemetrySink, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, configureTelemetry, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, createWriteFileTool, customTool, emptyFileUploadMetrics, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, files, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
|
|
1111
|
+
export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLogLineSink, type AgentLoggingConfig, type AgentLoggingSelection, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, type AssessmentSubagentInput, CHATGPT_IMAGE_MODEL_IDS, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type CandidateAssessment, type CandidateEvolutionOptions, type CandidateEvolutionResult, type CandidateEvolutionSnapshot, type CandidateEvolutionStats, type CandidateFeedbackEntry, type CandidateIssue, type CandidateProposal, type CandidateRecord, type ChatGptAuthProfile, type ChatGptImageModelId, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CodexViewImageToolInput, type CreateApplyPatchToolOptions, DEFAULT_FILE_TTL_SECONDS, DEFAULT_SIGNED_URL_TTL_SECONDS, EXPERIMENTAL_CHATGPT_MODEL_PREFIX, type ExperimentalChatGptModelId, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, type FeedbackScope, type FireworksModelId, GEMINI_IMAGE_MODEL_IDS, GEMINI_MODEL_IDS, GEMINI_TEXT_MODEL_IDS, type GeminiGlobToolInput, type GeminiGrepSearchToolInput, type GeminiImageModelId, type GeminiListDirectoryToolInput, type GeminiModelId, type GeminiReadFileToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, type GenerationSubagent, type GenerationSubagentInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type ListedChatGptModelId, type LlmBaseRequest, type LlmBlockedEvent, type LlmCallCompletedTelemetryEvent, type LlmCallStartedTelemetryEvent, type LlmCallStreamTelemetryEvent, type LlmChatGptGenerateImagesRequest, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFileCreateParams, type LlmFileDeleted, type LlmFileUploadBackend, type LlmFileUploadEvent, type LlmFileUploadMetrics, type LlmFileUploadMode, type LlmFileUploadSource, type LlmFunctionTool, type LlmGeminiGenerateImagesRequest, type LlmGenerateImagesRequest, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputFilePart, type LlmInputImagePart, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmMediaResolution, type LlmModelEvent, type LlmModelId, type LlmOpenAiGenerateImagesRequest, type LlmOpenAiImageBackground, type LlmOpenAiImageModeration, type LlmOpenAiImageNumImages, type LlmOpenAiImageOutputFormat, type LlmOpenAiImagePartialImageCount, type LlmOpenAiImageQuality, type LlmOpenAiImageResolution, type LlmOpenAiShellEnvironment, type LlmOpenAiShellNetworkPolicy, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, type LlmTelemetryOperation, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmThinkingLevel, type LlmToolCallCompletedEvent, type LlmToolCallContext, type LlmToolCallResult, type LlmToolCallStartedEvent, type LlmToolCallStreamEvent, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopSteeringAppendResult, type LlmToolLoopSteeringChannel, type LlmToolLoopSteeringInput, type LlmToolLoopSteeringMessage, type LlmToolLoopStep, type LlmToolLoopStream, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, type ModelConcurrencyConfig, type ModelConcurrencyProvider, OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION, OPENAI_GPT_IMAGE_2_BACKGROUNDS, OPENAI_GPT_IMAGE_2_MODERATION_LEVELS, OPENAI_GPT_IMAGE_2_NUM_IMAGES, OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS, OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS, OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS, OPENAI_GPT_IMAGE_2_QUALITY_LEVELS, OPENAI_GPT_IMAGE_2_RESOLUTIONS, OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS, OPENAI_IMAGE_MODEL_IDS, OPENAI_MODEL_IDS, type OpenAiGptImage2Background, type OpenAiGptImage2CustomResolution, type OpenAiGptImage2ListedResolution, type OpenAiGptImage2Moderation, type OpenAiGptImage2NumImages, type OpenAiGptImage2OutputFormat, type OpenAiGptImage2PartialImageCount, type OpenAiGptImage2PopularResolution, type OpenAiGptImage2Quality, type OpenAiGptImage2Resolution, type OpenAiGptImage2ResolutionValidationResult, type OpenAiImageModelId, type OpenAiModelId, type ParentSelectionConfig, type ParentSelectionMidpoint, type PostCheckRejection, type PostGenerationCheckInput, type RunAgentLoopRequest, type TelemetryConfig, type TelemetryEvent, type TelemetrySelection, type TelemetrySink, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, configureTelemetry, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, createWriteFileTool, customTool, emptyFileUploadMetrics, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, files, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptImageModelId, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiImageModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveChatGptImageProviderModel, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool, validateOpenAiGptImage2Resolution };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,23 +5,82 @@ import { ResponseTextConfig } from 'openai/resources/responses/responses';
|
|
|
5
5
|
|
|
6
6
|
type LlmUsageTokens = {
|
|
7
7
|
readonly promptTokens?: number;
|
|
8
|
+
readonly promptTextTokens?: number;
|
|
9
|
+
readonly promptImageTokens?: number;
|
|
8
10
|
readonly cachedTokens?: number;
|
|
9
11
|
readonly responseTokens?: number;
|
|
12
|
+
readonly responseTextTokens?: number;
|
|
10
13
|
readonly responseImageTokens?: number;
|
|
11
14
|
readonly thinkingTokens?: number;
|
|
12
15
|
readonly totalTokens?: number;
|
|
13
16
|
readonly toolUsePromptTokens?: number;
|
|
14
17
|
};
|
|
15
|
-
declare function estimateCallCostUsd({ modelId, tokens, responseImages, imageSize, }: {
|
|
18
|
+
declare function estimateCallCostUsd({ modelId, tokens, responseImages, imageSize, imageQuality, }: {
|
|
16
19
|
modelId: string;
|
|
17
20
|
tokens: LlmUsageTokens | undefined;
|
|
18
21
|
responseImages: number;
|
|
19
22
|
imageSize?: string;
|
|
23
|
+
imageQuality?: string;
|
|
20
24
|
}): number;
|
|
21
25
|
|
|
26
|
+
declare const GEMINI_TEXT_MODEL_IDS: readonly ["gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest"];
|
|
27
|
+
declare const GEMINI_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
28
|
+
declare const GEMINI_MODEL_IDS: readonly ["gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
29
|
+
type GeminiModelId = (typeof GEMINI_MODEL_IDS)[number];
|
|
30
|
+
type GeminiTextModelId = (typeof GEMINI_TEXT_MODEL_IDS)[number];
|
|
31
|
+
type GeminiImageModelId = (typeof GEMINI_IMAGE_MODEL_IDS)[number];
|
|
32
|
+
declare function isGeminiModelId(value: string): value is GeminiModelId;
|
|
33
|
+
declare function isGeminiTextModelId(value: string): value is GeminiTextModelId;
|
|
34
|
+
declare function isGeminiImageModelId(value: string): value is GeminiImageModelId;
|
|
35
|
+
type GeminiConfiguration = {
|
|
36
|
+
readonly projectId?: string;
|
|
37
|
+
readonly location?: string;
|
|
38
|
+
};
|
|
39
|
+
declare function configureGemini(options?: GeminiConfiguration): void;
|
|
40
|
+
|
|
22
41
|
declare const OPENAI_MODEL_IDS: readonly ["gpt-5.5", "gpt-5.5-fast", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
|
|
23
42
|
type OpenAiModelId = (typeof OPENAI_MODEL_IDS)[number];
|
|
24
43
|
declare function isOpenAiModelId(value: string): value is OpenAiModelId;
|
|
44
|
+
declare const OPENAI_IMAGE_MODEL_IDS: readonly ["gpt-image-2"];
|
|
45
|
+
type OpenAiImageModelId = (typeof OPENAI_IMAGE_MODEL_IDS)[number];
|
|
46
|
+
declare function isOpenAiImageModelId(value: string): value is OpenAiImageModelId;
|
|
47
|
+
declare const CHATGPT_IMAGE_MODEL_IDS: readonly ["chatgpt-gpt-image-2"];
|
|
48
|
+
type ChatGptImageModelId = (typeof CHATGPT_IMAGE_MODEL_IDS)[number];
|
|
49
|
+
declare function isChatGptImageModelId(value: string): value is ChatGptImageModelId;
|
|
50
|
+
declare const OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS: readonly ["1024x1024", "1536x1024", "1024x1536", "2048x2048", "2048x1152", "3840x2160", "2160x3840"];
|
|
51
|
+
type OpenAiGptImage2PopularResolution = (typeof OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS)[number];
|
|
52
|
+
declare const OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION: "auto";
|
|
53
|
+
declare const OPENAI_GPT_IMAGE_2_RESOLUTIONS: readonly ["1024x1024", "1536x1024", "1024x1536", "2048x2048", "2048x1152", "3840x2160", "2160x3840", "auto"];
|
|
54
|
+
type OpenAiGptImage2ListedResolution = (typeof OPENAI_GPT_IMAGE_2_RESOLUTIONS)[number];
|
|
55
|
+
type OpenAiGptImage2CustomResolution = `${number}x${number}`;
|
|
56
|
+
type OpenAiGptImage2Resolution = OpenAiGptImage2ListedResolution | OpenAiGptImage2CustomResolution;
|
|
57
|
+
declare const OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS: {
|
|
58
|
+
readonly maxEdgePixels: 3840;
|
|
59
|
+
readonly edgeMultiplePixels: 16;
|
|
60
|
+
readonly maxLongToShortEdgeRatio: 3;
|
|
61
|
+
readonly minTotalPixels: 655360;
|
|
62
|
+
readonly maxTotalPixels: 8294400;
|
|
63
|
+
readonly experimentalTotalPixelsThreshold: 3686400;
|
|
64
|
+
};
|
|
65
|
+
type OpenAiGptImage2ResolutionValidationResult = {
|
|
66
|
+
readonly valid: true;
|
|
67
|
+
} | {
|
|
68
|
+
readonly valid: false;
|
|
69
|
+
readonly reason: string;
|
|
70
|
+
};
|
|
71
|
+
declare function validateOpenAiGptImage2Resolution(value: string): OpenAiGptImage2ResolutionValidationResult;
|
|
72
|
+
declare const OPENAI_GPT_IMAGE_2_QUALITY_LEVELS: readonly ["low", "medium", "high", "auto"];
|
|
73
|
+
type OpenAiGptImage2Quality = (typeof OPENAI_GPT_IMAGE_2_QUALITY_LEVELS)[number];
|
|
74
|
+
declare const OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS: readonly ["png", "jpeg", "webp"];
|
|
75
|
+
type OpenAiGptImage2OutputFormat = (typeof OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS)[number];
|
|
76
|
+
declare const OPENAI_GPT_IMAGE_2_BACKGROUNDS: readonly ["opaque", "auto"];
|
|
77
|
+
type OpenAiGptImage2Background = (typeof OPENAI_GPT_IMAGE_2_BACKGROUNDS)[number];
|
|
78
|
+
declare const OPENAI_GPT_IMAGE_2_MODERATION_LEVELS: readonly ["low", "auto"];
|
|
79
|
+
type OpenAiGptImage2Moderation = (typeof OPENAI_GPT_IMAGE_2_MODERATION_LEVELS)[number];
|
|
80
|
+
declare const OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS: readonly [0, 1, 2, 3];
|
|
81
|
+
type OpenAiGptImage2PartialImageCount = (typeof OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS)[number];
|
|
82
|
+
declare const OPENAI_GPT_IMAGE_2_NUM_IMAGES: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
83
|
+
type OpenAiGptImage2NumImages = (typeof OPENAI_GPT_IMAGE_2_NUM_IMAGES)[number];
|
|
25
84
|
declare const CHATGPT_MODEL_IDS: readonly ["chatgpt-gpt-5.5", "chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark"];
|
|
26
85
|
declare const EXPERIMENTAL_CHATGPT_MODEL_PREFIX: "experimental-chatgpt-";
|
|
27
86
|
type ListedChatGptModelId = (typeof CHATGPT_MODEL_IDS)[number];
|
|
@@ -29,6 +88,7 @@ type ExperimentalChatGptModelId = `${typeof EXPERIMENTAL_CHATGPT_MODEL_PREFIX}${
|
|
|
29
88
|
type ChatGptModelId = ListedChatGptModelId | ExperimentalChatGptModelId;
|
|
30
89
|
declare function isExperimentalChatGptModelId(value: string): value is ExperimentalChatGptModelId;
|
|
31
90
|
declare function isChatGptModelId(value: string): value is ChatGptModelId;
|
|
91
|
+
declare function resolveChatGptImageProviderModel(_model: ChatGptImageModelId): string;
|
|
32
92
|
|
|
33
93
|
type LlmTelemetryOperation = "generateText" | "streamText" | "generateJson" | "streamJson" | "generateImages";
|
|
34
94
|
type LlmTelemetryBaseEvent = {
|
|
@@ -45,6 +105,7 @@ type LlmCallStartedTelemetryEvent = LlmTelemetryBaseEvent & {
|
|
|
45
105
|
readonly responseModalities?: readonly string[];
|
|
46
106
|
readonly imagePromptCount?: number;
|
|
47
107
|
readonly styleImageCount?: number;
|
|
108
|
+
readonly numImagesPerPrompt?: number;
|
|
48
109
|
readonly maxAttempts?: number;
|
|
49
110
|
readonly streamMode?: "partial" | "final";
|
|
50
111
|
};
|
|
@@ -247,9 +308,9 @@ type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlo
|
|
|
247
308
|
type LlmProvider = "openai" | "chatgpt" | "gemini" | "fireworks";
|
|
248
309
|
declare const LLM_TEXT_MODEL_IDS: readonly ["gpt-5.5", "gpt-5.5-fast", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "chatgpt-gpt-5.5", "chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark", "kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest"];
|
|
249
310
|
type LlmTextModelId = (typeof LLM_TEXT_MODEL_IDS)[number] | ExperimentalChatGptModelId;
|
|
250
|
-
declare const LLM_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
311
|
+
declare const LLM_IMAGE_MODEL_IDS: readonly ["gpt-image-2", "chatgpt-gpt-image-2", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
251
312
|
type LlmImageModelId = (typeof LLM_IMAGE_MODEL_IDS)[number];
|
|
252
|
-
declare const LLM_MODEL_IDS: readonly ["gpt-5.5", "gpt-5.5-fast", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "chatgpt-gpt-5.5", "chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark", "kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
313
|
+
declare const LLM_MODEL_IDS: readonly ["gpt-5.5", "gpt-5.5-fast", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "chatgpt-gpt-5.5", "chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark", "kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest", "gpt-image-2", "chatgpt-gpt-image-2", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
253
314
|
type LlmModelId = LlmTextModelId | LlmImageModelId;
|
|
254
315
|
declare function isLlmTextModelId(value: string): value is LlmTextModelId;
|
|
255
316
|
declare function isLlmImageModelId(value: string): value is LlmImageModelId;
|
|
@@ -363,18 +424,43 @@ type LlmImageData = {
|
|
|
363
424
|
readonly mimeType?: string;
|
|
364
425
|
readonly data: Buffer$1;
|
|
365
426
|
};
|
|
366
|
-
type
|
|
367
|
-
|
|
427
|
+
type LlmOpenAiImageResolution = OpenAiGptImage2Resolution;
|
|
428
|
+
type LlmOpenAiImageQuality = OpenAiGptImage2Quality;
|
|
429
|
+
type LlmOpenAiImageOutputFormat = OpenAiGptImage2OutputFormat;
|
|
430
|
+
type LlmOpenAiImageBackground = OpenAiGptImage2Background;
|
|
431
|
+
type LlmOpenAiImageModeration = OpenAiGptImage2Moderation;
|
|
432
|
+
type LlmOpenAiImagePartialImageCount = OpenAiGptImage2PartialImageCount;
|
|
433
|
+
type LlmOpenAiImageNumImages = OpenAiGptImage2NumImages;
|
|
434
|
+
type LlmGenerateImagesRequestBase = {
|
|
368
435
|
readonly stylePrompt: string;
|
|
369
436
|
readonly styleImages?: readonly LlmImageData[];
|
|
370
437
|
readonly imagePrompts: readonly string[];
|
|
438
|
+
readonly telemetry?: TelemetrySelection;
|
|
439
|
+
readonly signal?: AbortSignal;
|
|
440
|
+
};
|
|
441
|
+
type LlmOpenAiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
442
|
+
readonly model: OpenAiImageModelId;
|
|
443
|
+
readonly imageResolution?: LlmOpenAiImageResolution;
|
|
444
|
+
readonly imageQuality?: LlmOpenAiImageQuality;
|
|
445
|
+
readonly outputFormat?: LlmOpenAiImageOutputFormat;
|
|
446
|
+
readonly outputCompression?: number;
|
|
447
|
+
readonly background?: LlmOpenAiImageBackground;
|
|
448
|
+
readonly moderation?: LlmOpenAiImageModeration;
|
|
449
|
+
readonly partialImages?: LlmOpenAiImagePartialImageCount;
|
|
450
|
+
readonly numImages?: LlmOpenAiImageNumImages;
|
|
451
|
+
};
|
|
452
|
+
type LlmChatGptGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
453
|
+
readonly model: ChatGptImageModelId;
|
|
454
|
+
readonly numImages?: LlmOpenAiImageNumImages;
|
|
455
|
+
};
|
|
456
|
+
type LlmGeminiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
457
|
+
readonly model: GeminiImageModelId;
|
|
371
458
|
readonly imageGradingPrompt: string;
|
|
372
459
|
readonly maxAttempts?: number;
|
|
373
460
|
readonly imageAspectRatio?: string;
|
|
374
461
|
readonly imageSize?: LlmImageSize;
|
|
375
|
-
readonly telemetry?: TelemetrySelection;
|
|
376
|
-
readonly signal?: AbortSignal;
|
|
377
462
|
};
|
|
463
|
+
type LlmGenerateImagesRequest = LlmOpenAiGenerateImagesRequest | LlmChatGptGenerateImagesRequest | LlmGeminiGenerateImagesRequest;
|
|
378
464
|
type LlmFunctionTool<Schema extends z.ZodType, Output> = {
|
|
379
465
|
readonly type?: "function";
|
|
380
466
|
readonly description?: string;
|
|
@@ -1013,21 +1099,6 @@ declare function refreshChatGptOauthToken(refreshToken: string, fallback?: {
|
|
|
1013
1099
|
}): Promise<ChatGptAuthProfile>;
|
|
1014
1100
|
declare function getChatGptAuthProfile(): Promise<ChatGptAuthProfile>;
|
|
1015
1101
|
|
|
1016
|
-
declare const GEMINI_TEXT_MODEL_IDS: readonly ["gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest"];
|
|
1017
|
-
declare const GEMINI_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
1018
|
-
declare const GEMINI_MODEL_IDS: readonly ["gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
|
|
1019
|
-
type GeminiModelId = (typeof GEMINI_MODEL_IDS)[number];
|
|
1020
|
-
type GeminiTextModelId = (typeof GEMINI_TEXT_MODEL_IDS)[number];
|
|
1021
|
-
type GeminiImageModelId = (typeof GEMINI_IMAGE_MODEL_IDS)[number];
|
|
1022
|
-
declare function isGeminiModelId(value: string): value is GeminiModelId;
|
|
1023
|
-
declare function isGeminiTextModelId(value: string): value is GeminiTextModelId;
|
|
1024
|
-
declare function isGeminiImageModelId(value: string): value is GeminiImageModelId;
|
|
1025
|
-
type GeminiConfiguration = {
|
|
1026
|
-
readonly projectId?: string;
|
|
1027
|
-
readonly location?: string;
|
|
1028
|
-
};
|
|
1029
|
-
declare function configureGemini(options?: GeminiConfiguration): void;
|
|
1030
|
-
|
|
1031
1102
|
declare const FIREWORKS_MODEL_IDS: readonly ["kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b"];
|
|
1032
1103
|
type FireworksModelId = (typeof FIREWORKS_MODEL_IDS)[number];
|
|
1033
1104
|
declare const FIREWORKS_DEFAULT_KIMI_MODEL: FireworksModelId;
|
|
@@ -1037,4 +1108,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
|
|
|
1037
1108
|
declare function isFireworksModelId(value: string): value is FireworksModelId;
|
|
1038
1109
|
declare function resolveFireworksModelId(model: string): string | undefined;
|
|
1039
1110
|
|
|
1040
|
-
export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLogLineSink, type AgentLoggingConfig, type AgentLoggingSelection, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, type AssessmentSubagentInput, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type CandidateAssessment, type CandidateEvolutionOptions, type CandidateEvolutionResult, type CandidateEvolutionSnapshot, type CandidateEvolutionStats, type CandidateFeedbackEntry, type CandidateIssue, type CandidateProposal, type CandidateRecord, type ChatGptAuthProfile, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CodexViewImageToolInput, type CreateApplyPatchToolOptions, DEFAULT_FILE_TTL_SECONDS, DEFAULT_SIGNED_URL_TTL_SECONDS, EXPERIMENTAL_CHATGPT_MODEL_PREFIX, type ExperimentalChatGptModelId, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, type FeedbackScope, type FireworksModelId, GEMINI_IMAGE_MODEL_IDS, GEMINI_MODEL_IDS, GEMINI_TEXT_MODEL_IDS, type GeminiGlobToolInput, type GeminiGrepSearchToolInput, type GeminiImageModelId, type GeminiListDirectoryToolInput, type GeminiModelId, type GeminiReadFileToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, type GenerationSubagent, type GenerationSubagentInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type ListedChatGptModelId, type LlmBaseRequest, type LlmBlockedEvent, type LlmCallCompletedTelemetryEvent, type LlmCallStartedTelemetryEvent, type LlmCallStreamTelemetryEvent, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFileCreateParams, type LlmFileDeleted, type LlmFileUploadBackend, type LlmFileUploadEvent, type LlmFileUploadMetrics, type LlmFileUploadMode, type LlmFileUploadSource, type LlmFunctionTool, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputFilePart, type LlmInputImagePart, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmMediaResolution, type LlmModelEvent, type LlmModelId, type LlmOpenAiShellEnvironment, type LlmOpenAiShellNetworkPolicy, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, type LlmTelemetryOperation, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmThinkingLevel, type LlmToolCallCompletedEvent, type LlmToolCallContext, type LlmToolCallResult, type LlmToolCallStartedEvent, type LlmToolCallStreamEvent, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopSteeringAppendResult, type LlmToolLoopSteeringChannel, type LlmToolLoopSteeringInput, type LlmToolLoopSteeringMessage, type LlmToolLoopStep, type LlmToolLoopStream, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, type ModelConcurrencyConfig, type ModelConcurrencyProvider, OPENAI_MODEL_IDS, type OpenAiModelId, type ParentSelectionConfig, type ParentSelectionMidpoint, type PostCheckRejection, type PostGenerationCheckInput, type RunAgentLoopRequest, type TelemetryConfig, type TelemetryEvent, type TelemetrySelection, type TelemetrySink, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, configureTelemetry, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, createWriteFileTool, customTool, emptyFileUploadMetrics, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, files, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
|
|
1111
|
+
export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLogLineSink, type AgentLoggingConfig, type AgentLoggingSelection, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, type AssessmentSubagentInput, CHATGPT_IMAGE_MODEL_IDS, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type CandidateAssessment, type CandidateEvolutionOptions, type CandidateEvolutionResult, type CandidateEvolutionSnapshot, type CandidateEvolutionStats, type CandidateFeedbackEntry, type CandidateIssue, type CandidateProposal, type CandidateRecord, type ChatGptAuthProfile, type ChatGptImageModelId, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CodexViewImageToolInput, type CreateApplyPatchToolOptions, DEFAULT_FILE_TTL_SECONDS, DEFAULT_SIGNED_URL_TTL_SECONDS, EXPERIMENTAL_CHATGPT_MODEL_PREFIX, type ExperimentalChatGptModelId, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, type FeedbackScope, type FireworksModelId, GEMINI_IMAGE_MODEL_IDS, GEMINI_MODEL_IDS, GEMINI_TEXT_MODEL_IDS, type GeminiGlobToolInput, type GeminiGrepSearchToolInput, type GeminiImageModelId, type GeminiListDirectoryToolInput, type GeminiModelId, type GeminiReadFileToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, type GenerationSubagent, type GenerationSubagentInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type ListedChatGptModelId, type LlmBaseRequest, type LlmBlockedEvent, type LlmCallCompletedTelemetryEvent, type LlmCallStartedTelemetryEvent, type LlmCallStreamTelemetryEvent, type LlmChatGptGenerateImagesRequest, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFileCreateParams, type LlmFileDeleted, type LlmFileUploadBackend, type LlmFileUploadEvent, type LlmFileUploadMetrics, type LlmFileUploadMode, type LlmFileUploadSource, type LlmFunctionTool, type LlmGeminiGenerateImagesRequest, type LlmGenerateImagesRequest, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputFilePart, type LlmInputImagePart, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmMediaResolution, type LlmModelEvent, type LlmModelId, type LlmOpenAiGenerateImagesRequest, type LlmOpenAiImageBackground, type LlmOpenAiImageModeration, type LlmOpenAiImageNumImages, type LlmOpenAiImageOutputFormat, type LlmOpenAiImagePartialImageCount, type LlmOpenAiImageQuality, type LlmOpenAiImageResolution, type LlmOpenAiShellEnvironment, type LlmOpenAiShellNetworkPolicy, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, type LlmTelemetryOperation, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmThinkingLevel, type LlmToolCallCompletedEvent, type LlmToolCallContext, type LlmToolCallResult, type LlmToolCallStartedEvent, type LlmToolCallStreamEvent, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopSteeringAppendResult, type LlmToolLoopSteeringChannel, type LlmToolLoopSteeringInput, type LlmToolLoopSteeringMessage, type LlmToolLoopStep, type LlmToolLoopStream, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, type ModelConcurrencyConfig, type ModelConcurrencyProvider, OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION, OPENAI_GPT_IMAGE_2_BACKGROUNDS, OPENAI_GPT_IMAGE_2_MODERATION_LEVELS, OPENAI_GPT_IMAGE_2_NUM_IMAGES, OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS, OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS, OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS, OPENAI_GPT_IMAGE_2_QUALITY_LEVELS, OPENAI_GPT_IMAGE_2_RESOLUTIONS, OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS, OPENAI_IMAGE_MODEL_IDS, OPENAI_MODEL_IDS, type OpenAiGptImage2Background, type OpenAiGptImage2CustomResolution, type OpenAiGptImage2ListedResolution, type OpenAiGptImage2Moderation, type OpenAiGptImage2NumImages, type OpenAiGptImage2OutputFormat, type OpenAiGptImage2PartialImageCount, type OpenAiGptImage2PopularResolution, type OpenAiGptImage2Quality, type OpenAiGptImage2Resolution, type OpenAiGptImage2ResolutionValidationResult, type OpenAiImageModelId, type OpenAiModelId, type ParentSelectionConfig, type ParentSelectionMidpoint, type PostCheckRejection, type PostGenerationCheckInput, type RunAgentLoopRequest, type TelemetryConfig, type TelemetryEvent, type TelemetrySelection, type TelemetrySink, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, configureTelemetry, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, createWriteFileTool, customTool, emptyFileUploadMetrics, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, files, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptImageModelId, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiImageModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveChatGptImageProviderModel, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool, validateOpenAiGptImage2Resolution };
|