@ljoukov/llm 7.0.12 → 7.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -5,23 +5,79 @@ 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 OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS: readonly ["1024x1024", "1536x1024", "1024x1536", "2048x2048", "2048x1152", "3840x2160", "2160x3840"];
48
+ type OpenAiGptImage2PopularResolution = (typeof OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS)[number];
49
+ declare const OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION: "auto";
50
+ declare const OPENAI_GPT_IMAGE_2_RESOLUTIONS: readonly ["1024x1024", "1536x1024", "1024x1536", "2048x2048", "2048x1152", "3840x2160", "2160x3840", "auto"];
51
+ type OpenAiGptImage2ListedResolution = (typeof OPENAI_GPT_IMAGE_2_RESOLUTIONS)[number];
52
+ type OpenAiGptImage2CustomResolution = `${number}x${number}`;
53
+ type OpenAiGptImage2Resolution = OpenAiGptImage2ListedResolution | OpenAiGptImage2CustomResolution;
54
+ declare const OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS: {
55
+ readonly maxEdgePixels: 3840;
56
+ readonly edgeMultiplePixels: 16;
57
+ readonly maxLongToShortEdgeRatio: 3;
58
+ readonly minTotalPixels: 655360;
59
+ readonly maxTotalPixels: 8294400;
60
+ readonly experimentalTotalPixelsThreshold: 3686400;
61
+ };
62
+ type OpenAiGptImage2ResolutionValidationResult = {
63
+ readonly valid: true;
64
+ } | {
65
+ readonly valid: false;
66
+ readonly reason: string;
67
+ };
68
+ declare function validateOpenAiGptImage2Resolution(value: string): OpenAiGptImage2ResolutionValidationResult;
69
+ declare const OPENAI_GPT_IMAGE_2_QUALITY_LEVELS: readonly ["low", "medium", "high", "auto"];
70
+ type OpenAiGptImage2Quality = (typeof OPENAI_GPT_IMAGE_2_QUALITY_LEVELS)[number];
71
+ declare const OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS: readonly ["png", "jpeg", "webp"];
72
+ type OpenAiGptImage2OutputFormat = (typeof OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS)[number];
73
+ declare const OPENAI_GPT_IMAGE_2_BACKGROUNDS: readonly ["opaque", "auto"];
74
+ type OpenAiGptImage2Background = (typeof OPENAI_GPT_IMAGE_2_BACKGROUNDS)[number];
75
+ declare const OPENAI_GPT_IMAGE_2_MODERATION_LEVELS: readonly ["low", "auto"];
76
+ type OpenAiGptImage2Moderation = (typeof OPENAI_GPT_IMAGE_2_MODERATION_LEVELS)[number];
77
+ declare const OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS: readonly [0, 1, 2, 3];
78
+ type OpenAiGptImage2PartialImageCount = (typeof OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS)[number];
79
+ declare const OPENAI_GPT_IMAGE_2_NUM_IMAGES: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
80
+ type OpenAiGptImage2NumImages = (typeof OPENAI_GPT_IMAGE_2_NUM_IMAGES)[number];
25
81
  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
82
  declare const EXPERIMENTAL_CHATGPT_MODEL_PREFIX: "experimental-chatgpt-";
27
83
  type ListedChatGptModelId = (typeof CHATGPT_MODEL_IDS)[number];
@@ -45,6 +101,7 @@ type LlmCallStartedTelemetryEvent = LlmTelemetryBaseEvent & {
45
101
  readonly responseModalities?: readonly string[];
46
102
  readonly imagePromptCount?: number;
47
103
  readonly styleImageCount?: number;
104
+ readonly numImagesPerPrompt?: number;
48
105
  readonly maxAttempts?: number;
49
106
  readonly streamMode?: "partial" | "final";
50
107
  };
@@ -247,9 +304,9 @@ type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlo
247
304
  type LlmProvider = "openai" | "chatgpt" | "gemini" | "fireworks";
248
305
  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
306
  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"];
307
+ declare const LLM_IMAGE_MODEL_IDS: readonly ["gpt-image-2", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
251
308
  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"];
309
+ 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", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
253
310
  type LlmModelId = LlmTextModelId | LlmImageModelId;
254
311
  declare function isLlmTextModelId(value: string): value is LlmTextModelId;
255
312
  declare function isLlmImageModelId(value: string): value is LlmImageModelId;
@@ -363,18 +420,39 @@ type LlmImageData = {
363
420
  readonly mimeType?: string;
364
421
  readonly data: Buffer$1;
365
422
  };
366
- type LlmGenerateImagesRequest = {
367
- readonly model: LlmImageModelId;
423
+ type LlmOpenAiImageResolution = OpenAiGptImage2Resolution;
424
+ type LlmOpenAiImageQuality = OpenAiGptImage2Quality;
425
+ type LlmOpenAiImageOutputFormat = OpenAiGptImage2OutputFormat;
426
+ type LlmOpenAiImageBackground = OpenAiGptImage2Background;
427
+ type LlmOpenAiImageModeration = OpenAiGptImage2Moderation;
428
+ type LlmOpenAiImagePartialImageCount = OpenAiGptImage2PartialImageCount;
429
+ type LlmOpenAiImageNumImages = OpenAiGptImage2NumImages;
430
+ type LlmGenerateImagesRequestBase = {
368
431
  readonly stylePrompt: string;
369
432
  readonly styleImages?: readonly LlmImageData[];
370
433
  readonly imagePrompts: readonly string[];
434
+ readonly telemetry?: TelemetrySelection;
435
+ readonly signal?: AbortSignal;
436
+ };
437
+ type LlmOpenAiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
438
+ readonly model: OpenAiImageModelId;
439
+ readonly imageResolution?: LlmOpenAiImageResolution;
440
+ readonly imageQuality?: LlmOpenAiImageQuality;
441
+ readonly outputFormat?: LlmOpenAiImageOutputFormat;
442
+ readonly outputCompression?: number;
443
+ readonly background?: LlmOpenAiImageBackground;
444
+ readonly moderation?: LlmOpenAiImageModeration;
445
+ readonly partialImages?: LlmOpenAiImagePartialImageCount;
446
+ readonly numImages?: LlmOpenAiImageNumImages;
447
+ };
448
+ type LlmGeminiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
449
+ readonly model: GeminiImageModelId;
371
450
  readonly imageGradingPrompt: string;
372
451
  readonly maxAttempts?: number;
373
452
  readonly imageAspectRatio?: string;
374
453
  readonly imageSize?: LlmImageSize;
375
- readonly telemetry?: TelemetrySelection;
376
- readonly signal?: AbortSignal;
377
454
  };
455
+ type LlmGenerateImagesRequest = LlmOpenAiGenerateImagesRequest | LlmGeminiGenerateImagesRequest;
378
456
  type LlmFunctionTool<Schema extends z.ZodType, Output> = {
379
457
  readonly type?: "function";
380
458
  readonly description?: string;
@@ -1013,21 +1091,6 @@ declare function refreshChatGptOauthToken(refreshToken: string, fallback?: {
1013
1091
  }): Promise<ChatGptAuthProfile>;
1014
1092
  declare function getChatGptAuthProfile(): Promise<ChatGptAuthProfile>;
1015
1093
 
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
1094
  declare const FIREWORKS_MODEL_IDS: readonly ["kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b"];
1032
1095
  type FireworksModelId = (typeof FIREWORKS_MODEL_IDS)[number];
1033
1096
  declare const FIREWORKS_DEFAULT_KIMI_MODEL: FireworksModelId;
@@ -1037,4 +1100,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
1037
1100
  declare function isFireworksModelId(value: string): value is FireworksModelId;
1038
1101
  declare function resolveFireworksModelId(model: string): string | undefined;
1039
1102
 
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 };
1103
+ 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 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, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiImageModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool, validateOpenAiGptImage2Resolution };
package/dist/index.d.ts CHANGED
@@ -5,23 +5,79 @@ 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 OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS: readonly ["1024x1024", "1536x1024", "1024x1536", "2048x2048", "2048x1152", "3840x2160", "2160x3840"];
48
+ type OpenAiGptImage2PopularResolution = (typeof OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS)[number];
49
+ declare const OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION: "auto";
50
+ declare const OPENAI_GPT_IMAGE_2_RESOLUTIONS: readonly ["1024x1024", "1536x1024", "1024x1536", "2048x2048", "2048x1152", "3840x2160", "2160x3840", "auto"];
51
+ type OpenAiGptImage2ListedResolution = (typeof OPENAI_GPT_IMAGE_2_RESOLUTIONS)[number];
52
+ type OpenAiGptImage2CustomResolution = `${number}x${number}`;
53
+ type OpenAiGptImage2Resolution = OpenAiGptImage2ListedResolution | OpenAiGptImage2CustomResolution;
54
+ declare const OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS: {
55
+ readonly maxEdgePixels: 3840;
56
+ readonly edgeMultiplePixels: 16;
57
+ readonly maxLongToShortEdgeRatio: 3;
58
+ readonly minTotalPixels: 655360;
59
+ readonly maxTotalPixels: 8294400;
60
+ readonly experimentalTotalPixelsThreshold: 3686400;
61
+ };
62
+ type OpenAiGptImage2ResolutionValidationResult = {
63
+ readonly valid: true;
64
+ } | {
65
+ readonly valid: false;
66
+ readonly reason: string;
67
+ };
68
+ declare function validateOpenAiGptImage2Resolution(value: string): OpenAiGptImage2ResolutionValidationResult;
69
+ declare const OPENAI_GPT_IMAGE_2_QUALITY_LEVELS: readonly ["low", "medium", "high", "auto"];
70
+ type OpenAiGptImage2Quality = (typeof OPENAI_GPT_IMAGE_2_QUALITY_LEVELS)[number];
71
+ declare const OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS: readonly ["png", "jpeg", "webp"];
72
+ type OpenAiGptImage2OutputFormat = (typeof OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS)[number];
73
+ declare const OPENAI_GPT_IMAGE_2_BACKGROUNDS: readonly ["opaque", "auto"];
74
+ type OpenAiGptImage2Background = (typeof OPENAI_GPT_IMAGE_2_BACKGROUNDS)[number];
75
+ declare const OPENAI_GPT_IMAGE_2_MODERATION_LEVELS: readonly ["low", "auto"];
76
+ type OpenAiGptImage2Moderation = (typeof OPENAI_GPT_IMAGE_2_MODERATION_LEVELS)[number];
77
+ declare const OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS: readonly [0, 1, 2, 3];
78
+ type OpenAiGptImage2PartialImageCount = (typeof OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS)[number];
79
+ declare const OPENAI_GPT_IMAGE_2_NUM_IMAGES: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
80
+ type OpenAiGptImage2NumImages = (typeof OPENAI_GPT_IMAGE_2_NUM_IMAGES)[number];
25
81
  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
82
  declare const EXPERIMENTAL_CHATGPT_MODEL_PREFIX: "experimental-chatgpt-";
27
83
  type ListedChatGptModelId = (typeof CHATGPT_MODEL_IDS)[number];
@@ -45,6 +101,7 @@ type LlmCallStartedTelemetryEvent = LlmTelemetryBaseEvent & {
45
101
  readonly responseModalities?: readonly string[];
46
102
  readonly imagePromptCount?: number;
47
103
  readonly styleImageCount?: number;
104
+ readonly numImagesPerPrompt?: number;
48
105
  readonly maxAttempts?: number;
49
106
  readonly streamMode?: "partial" | "final";
50
107
  };
@@ -247,9 +304,9 @@ type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlo
247
304
  type LlmProvider = "openai" | "chatgpt" | "gemini" | "fireworks";
248
305
  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
306
  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"];
307
+ declare const LLM_IMAGE_MODEL_IDS: readonly ["gpt-image-2", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
251
308
  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"];
309
+ 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", "gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
253
310
  type LlmModelId = LlmTextModelId | LlmImageModelId;
254
311
  declare function isLlmTextModelId(value: string): value is LlmTextModelId;
255
312
  declare function isLlmImageModelId(value: string): value is LlmImageModelId;
@@ -363,18 +420,39 @@ type LlmImageData = {
363
420
  readonly mimeType?: string;
364
421
  readonly data: Buffer$1;
365
422
  };
366
- type LlmGenerateImagesRequest = {
367
- readonly model: LlmImageModelId;
423
+ type LlmOpenAiImageResolution = OpenAiGptImage2Resolution;
424
+ type LlmOpenAiImageQuality = OpenAiGptImage2Quality;
425
+ type LlmOpenAiImageOutputFormat = OpenAiGptImage2OutputFormat;
426
+ type LlmOpenAiImageBackground = OpenAiGptImage2Background;
427
+ type LlmOpenAiImageModeration = OpenAiGptImage2Moderation;
428
+ type LlmOpenAiImagePartialImageCount = OpenAiGptImage2PartialImageCount;
429
+ type LlmOpenAiImageNumImages = OpenAiGptImage2NumImages;
430
+ type LlmGenerateImagesRequestBase = {
368
431
  readonly stylePrompt: string;
369
432
  readonly styleImages?: readonly LlmImageData[];
370
433
  readonly imagePrompts: readonly string[];
434
+ readonly telemetry?: TelemetrySelection;
435
+ readonly signal?: AbortSignal;
436
+ };
437
+ type LlmOpenAiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
438
+ readonly model: OpenAiImageModelId;
439
+ readonly imageResolution?: LlmOpenAiImageResolution;
440
+ readonly imageQuality?: LlmOpenAiImageQuality;
441
+ readonly outputFormat?: LlmOpenAiImageOutputFormat;
442
+ readonly outputCompression?: number;
443
+ readonly background?: LlmOpenAiImageBackground;
444
+ readonly moderation?: LlmOpenAiImageModeration;
445
+ readonly partialImages?: LlmOpenAiImagePartialImageCount;
446
+ readonly numImages?: LlmOpenAiImageNumImages;
447
+ };
448
+ type LlmGeminiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
449
+ readonly model: GeminiImageModelId;
371
450
  readonly imageGradingPrompt: string;
372
451
  readonly maxAttempts?: number;
373
452
  readonly imageAspectRatio?: string;
374
453
  readonly imageSize?: LlmImageSize;
375
- readonly telemetry?: TelemetrySelection;
376
- readonly signal?: AbortSignal;
377
454
  };
455
+ type LlmGenerateImagesRequest = LlmOpenAiGenerateImagesRequest | LlmGeminiGenerateImagesRequest;
378
456
  type LlmFunctionTool<Schema extends z.ZodType, Output> = {
379
457
  readonly type?: "function";
380
458
  readonly description?: string;
@@ -1013,21 +1091,6 @@ declare function refreshChatGptOauthToken(refreshToken: string, fallback?: {
1013
1091
  }): Promise<ChatGptAuthProfile>;
1014
1092
  declare function getChatGptAuthProfile(): Promise<ChatGptAuthProfile>;
1015
1093
 
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
1094
  declare const FIREWORKS_MODEL_IDS: readonly ["kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b"];
1032
1095
  type FireworksModelId = (typeof FIREWORKS_MODEL_IDS)[number];
1033
1096
  declare const FIREWORKS_DEFAULT_KIMI_MODEL: FireworksModelId;
@@ -1037,4 +1100,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
1037
1100
  declare function isFireworksModelId(value: string): value is FireworksModelId;
1038
1101
  declare function resolveFireworksModelId(model: string): string | undefined;
1039
1102
 
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 };
1103
+ 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 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, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiImageModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool, validateOpenAiGptImage2Resolution };