@ljoukov/llm 7.0.9 → 7.0.11

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
@@ -19,6 +19,17 @@ declare function estimateCallCostUsd({ modelId, tokens, responseImages, imageSiz
19
19
  imageSize?: string;
20
20
  }): number;
21
21
 
22
+ 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
+ type OpenAiModelId = (typeof OPENAI_MODEL_IDS)[number];
24
+ declare function isOpenAiModelId(value: string): value is OpenAiModelId;
25
+ 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
+ declare const EXPERIMENTAL_CHATGPT_MODEL_PREFIX: "experimental-chatgpt-";
27
+ type ListedChatGptModelId = (typeof CHATGPT_MODEL_IDS)[number];
28
+ type ExperimentalChatGptModelId = `${typeof EXPERIMENTAL_CHATGPT_MODEL_PREFIX}${string}`;
29
+ type ChatGptModelId = ListedChatGptModelId | ExperimentalChatGptModelId;
30
+ declare function isExperimentalChatGptModelId(value: string): value is ExperimentalChatGptModelId;
31
+ declare function isChatGptModelId(value: string): value is ChatGptModelId;
32
+
22
33
  type LlmTelemetryOperation = "generateText" | "streamText" | "generateJson" | "streamJson" | "generateImages";
23
34
  type LlmTelemetryBaseEvent = {
24
35
  readonly timestamp: string;
@@ -207,12 +218,12 @@ type LlmToolCallCompletedEvent = {
207
218
  type LlmToolCallStreamEvent = LlmToolCallStartedEvent | LlmToolCallCompletedEvent;
208
219
  type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlockedEvent | LlmToolCallStreamEvent;
209
220
  type LlmProvider = "openai" | "chatgpt" | "gemini" | "fireworks";
210
- declare const LLM_TEXT_MODEL_IDS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "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"];
211
- type LlmTextModelId = (typeof LLM_TEXT_MODEL_IDS)[number];
221
+ 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"];
222
+ type LlmTextModelId = (typeof LLM_TEXT_MODEL_IDS)[number] | ExperimentalChatGptModelId;
212
223
  declare const LLM_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
213
224
  type LlmImageModelId = (typeof LLM_IMAGE_MODEL_IDS)[number];
214
- declare const LLM_MODEL_IDS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "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"];
215
- type LlmModelId = (typeof LLM_MODEL_IDS)[number];
225
+ 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"];
226
+ type LlmModelId = LlmTextModelId | LlmImageModelId;
216
227
  declare function isLlmTextModelId(value: string): value is LlmTextModelId;
217
228
  declare function isLlmImageModelId(value: string): value is LlmImageModelId;
218
229
  declare function isLlmModelId(value: string): value is LlmModelId;
@@ -975,13 +986,6 @@ declare function refreshChatGptOauthToken(refreshToken: string, fallback?: {
975
986
  }): Promise<ChatGptAuthProfile>;
976
987
  declare function getChatGptAuthProfile(): Promise<ChatGptAuthProfile>;
977
988
 
978
- declare const OPENAI_MODEL_IDS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
979
- type OpenAiModelId = (typeof OPENAI_MODEL_IDS)[number];
980
- declare function isOpenAiModelId(value: string): value is OpenAiModelId;
981
- declare const CHATGPT_MODEL_IDS: readonly ["chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark"];
982
- type ChatGptModelId = (typeof CHATGPT_MODEL_IDS)[number];
983
- declare function isChatGptModelId(value: string): value is ChatGptModelId;
984
-
985
989
  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"];
986
990
  declare const GEMINI_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
987
991
  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"];
@@ -1006,4 +1010,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
1006
1010
  declare function isFireworksModelId(value: string): value is FireworksModelId;
1007
1011
  declare function resolveFireworksModelId(model: string): string | undefined;
1008
1012
 
1009
- 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, 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 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 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, 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 };
1013
+ 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 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 };
package/dist/index.d.ts CHANGED
@@ -19,6 +19,17 @@ declare function estimateCallCostUsd({ modelId, tokens, responseImages, imageSiz
19
19
  imageSize?: string;
20
20
  }): number;
21
21
 
22
+ 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
+ type OpenAiModelId = (typeof OPENAI_MODEL_IDS)[number];
24
+ declare function isOpenAiModelId(value: string): value is OpenAiModelId;
25
+ 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
+ declare const EXPERIMENTAL_CHATGPT_MODEL_PREFIX: "experimental-chatgpt-";
27
+ type ListedChatGptModelId = (typeof CHATGPT_MODEL_IDS)[number];
28
+ type ExperimentalChatGptModelId = `${typeof EXPERIMENTAL_CHATGPT_MODEL_PREFIX}${string}`;
29
+ type ChatGptModelId = ListedChatGptModelId | ExperimentalChatGptModelId;
30
+ declare function isExperimentalChatGptModelId(value: string): value is ExperimentalChatGptModelId;
31
+ declare function isChatGptModelId(value: string): value is ChatGptModelId;
32
+
22
33
  type LlmTelemetryOperation = "generateText" | "streamText" | "generateJson" | "streamJson" | "generateImages";
23
34
  type LlmTelemetryBaseEvent = {
24
35
  readonly timestamp: string;
@@ -207,12 +218,12 @@ type LlmToolCallCompletedEvent = {
207
218
  type LlmToolCallStreamEvent = LlmToolCallStartedEvent | LlmToolCallCompletedEvent;
208
219
  type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlockedEvent | LlmToolCallStreamEvent;
209
220
  type LlmProvider = "openai" | "chatgpt" | "gemini" | "fireworks";
210
- declare const LLM_TEXT_MODEL_IDS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "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"];
211
- type LlmTextModelId = (typeof LLM_TEXT_MODEL_IDS)[number];
221
+ 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"];
222
+ type LlmTextModelId = (typeof LLM_TEXT_MODEL_IDS)[number] | ExperimentalChatGptModelId;
212
223
  declare const LLM_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
213
224
  type LlmImageModelId = (typeof LLM_IMAGE_MODEL_IDS)[number];
214
- declare const LLM_MODEL_IDS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "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"];
215
- type LlmModelId = (typeof LLM_MODEL_IDS)[number];
225
+ 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"];
226
+ type LlmModelId = LlmTextModelId | LlmImageModelId;
216
227
  declare function isLlmTextModelId(value: string): value is LlmTextModelId;
217
228
  declare function isLlmImageModelId(value: string): value is LlmImageModelId;
218
229
  declare function isLlmModelId(value: string): value is LlmModelId;
@@ -975,13 +986,6 @@ declare function refreshChatGptOauthToken(refreshToken: string, fallback?: {
975
986
  }): Promise<ChatGptAuthProfile>;
976
987
  declare function getChatGptAuthProfile(): Promise<ChatGptAuthProfile>;
977
988
 
978
- declare const OPENAI_MODEL_IDS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
979
- type OpenAiModelId = (typeof OPENAI_MODEL_IDS)[number];
980
- declare function isOpenAiModelId(value: string): value is OpenAiModelId;
981
- declare const CHATGPT_MODEL_IDS: readonly ["chatgpt-gpt-5.4", "chatgpt-gpt-5.4-fast", "chatgpt-gpt-5.4-mini", "chatgpt-gpt-5.3-codex-spark"];
982
- type ChatGptModelId = (typeof CHATGPT_MODEL_IDS)[number];
983
- declare function isChatGptModelId(value: string): value is ChatGptModelId;
984
-
985
989
  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"];
986
990
  declare const GEMINI_IMAGE_MODEL_IDS: readonly ["gemini-3-pro-image-preview", "gemini-3.1-flash-image-preview"];
987
991
  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"];
@@ -1006,4 +1010,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
1006
1010
  declare function isFireworksModelId(value: string): value is FireworksModelId;
1007
1011
  declare function resolveFireworksModelId(model: string): string | undefined;
1008
1012
 
1009
- 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, 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 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 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, 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 };
1013
+ 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 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 };
package/dist/index.js CHANGED
@@ -205,7 +205,61 @@ function getGeminiImagePricing(modelId) {
205
205
  return void 0;
206
206
  }
207
207
 
208
+ // src/openai/models.ts
209
+ var OPENAI_MODEL_IDS = [
210
+ "gpt-5.5",
211
+ "gpt-5.5-fast",
212
+ "gpt-5.4",
213
+ "gpt-5.4-mini",
214
+ "gpt-5.4-nano"
215
+ ];
216
+ function isOpenAiModelId(value) {
217
+ return OPENAI_MODEL_IDS.includes(value);
218
+ }
219
+ var CHATGPT_MODEL_IDS = [
220
+ "chatgpt-gpt-5.5",
221
+ "chatgpt-gpt-5.5-fast",
222
+ "chatgpt-gpt-5.4",
223
+ "chatgpt-gpt-5.4-fast",
224
+ "chatgpt-gpt-5.4-mini",
225
+ "chatgpt-gpt-5.3-codex-spark"
226
+ ];
227
+ var FAST_MODEL_SUFFIX = "-fast";
228
+ var OPENAI_PRIORITY_MODEL_IDS = ["gpt-5.5-fast"];
229
+ var CHATGPT_PRIORITY_MODEL_IDS = ["chatgpt-gpt-5.5-fast", "chatgpt-gpt-5.4-fast"];
230
+ var EXPERIMENTAL_CHATGPT_MODEL_PREFIX = "experimental-chatgpt-";
231
+ function isExperimentalChatGptModelId(value) {
232
+ return value.startsWith(EXPERIMENTAL_CHATGPT_MODEL_PREFIX) && value.length > EXPERIMENTAL_CHATGPT_MODEL_PREFIX.length;
233
+ }
234
+ function isChatGptModelId(value) {
235
+ return CHATGPT_MODEL_IDS.includes(value) || isExperimentalChatGptModelId(value);
236
+ }
237
+ function stripFastSuffix(model) {
238
+ return model.endsWith(FAST_MODEL_SUFFIX) ? model.slice(0, -FAST_MODEL_SUFFIX.length) : model;
239
+ }
240
+ function resolveOpenAiProviderModel(model) {
241
+ return OPENAI_PRIORITY_MODEL_IDS.includes(model) ? stripFastSuffix(model) : model;
242
+ }
243
+ function resolveOpenAiServiceTier(model) {
244
+ return OPENAI_PRIORITY_MODEL_IDS.includes(model) ? "priority" : void 0;
245
+ }
246
+ function stripChatGptPrefix(model) {
247
+ if (isExperimentalChatGptModelId(model)) {
248
+ return model.slice(EXPERIMENTAL_CHATGPT_MODEL_PREFIX.length);
249
+ }
250
+ return model.slice("chatgpt-".length);
251
+ }
252
+ function resolveChatGptProviderModel(model) {
253
+ const providerModel = stripChatGptPrefix(model);
254
+ return CHATGPT_PRIORITY_MODEL_IDS.includes(model) ? stripFastSuffix(providerModel) : providerModel;
255
+ }
256
+ function resolveChatGptServiceTier(model) {
257
+ return CHATGPT_PRIORITY_MODEL_IDS.includes(model) ? "priority" : void 0;
258
+ }
259
+
208
260
  // src/openai/pricing.ts
261
+ var OPENAI_GPT_55_FAST_MODEL_IDS = ["gpt-5.5-fast", "chatgpt-gpt-5.5-fast"];
262
+ var OPENAI_GPT_55_STANDARD_MODEL_IDS = ["gpt-5.5", "chatgpt-gpt-5.5"];
209
263
  var OPENAI_GPT_54_FAST_MODEL_IDS = ["gpt-5.4-fast", "chatgpt-gpt-5.4-fast"];
210
264
  var OPENAI_GPT_54_MINI_MODEL_IDS = ["gpt-5.4-mini", "chatgpt-gpt-5.4-mini"];
211
265
  var OPENAI_GPT_54_NANO_MODEL_IDS = ["gpt-5.4-nano"];
@@ -214,6 +268,16 @@ var OPENAI_GPT_53_CODEX_SPARK_MODEL_IDS = [
214
268
  "chatgpt-gpt-5.3-codex-spark"
215
269
  ];
216
270
  var OPENAI_GPT_54_STANDARD_MODEL_IDS = ["gpt-5.4", "chatgpt-gpt-5.4"];
271
+ var OPENAI_GPT_55_PRICING = {
272
+ inputRate: 5 / 1e6,
273
+ cachedRate: 0.5 / 1e6,
274
+ outputRate: 30 / 1e6
275
+ };
276
+ var OPENAI_GPT_55_PRIORITY_PRICING = {
277
+ inputRate: 12.5 / 1e6,
278
+ cachedRate: 1.25 / 1e6,
279
+ outputRate: 75 / 1e6
280
+ };
217
281
  var OPENAI_GPT_54_PRICING = {
218
282
  inputRate: 2.5 / 1e6,
219
283
  cachedRate: 0.25 / 1e6,
@@ -235,6 +299,15 @@ var OPENAI_GPT_54_NANO_PRICING = {
235
299
  outputRate: 0.4 / 1e6
236
300
  };
237
301
  function getOpenAiPricing(modelId) {
302
+ if (isExperimentalChatGptModelId(modelId)) {
303
+ return OPENAI_GPT_54_PRICING;
304
+ }
305
+ if (OPENAI_GPT_55_FAST_MODEL_IDS.includes(modelId)) {
306
+ return OPENAI_GPT_55_PRIORITY_PRICING;
307
+ }
308
+ if (OPENAI_GPT_55_STANDARD_MODEL_IDS.includes(modelId)) {
309
+ return OPENAI_GPT_55_PRICING;
310
+ }
238
311
  if (OPENAI_GPT_54_FAST_MODEL_IDS.includes(modelId)) {
239
312
  return OPENAI_GPT_54_PRIORITY_PRICING;
240
313
  }
@@ -2719,35 +2792,6 @@ async function runOpenAiCall(fn, modelId, runOptions) {
2719
2792
  return getSchedulerForModel3(modelId).run(async () => fn(getOpenAiClient()), runOptions);
2720
2793
  }
2721
2794
 
2722
- // src/openai/models.ts
2723
- var OPENAI_MODEL_IDS = ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
2724
- function isOpenAiModelId(value) {
2725
- return OPENAI_MODEL_IDS.includes(value);
2726
- }
2727
- var CHATGPT_MODEL_IDS = [
2728
- "chatgpt-gpt-5.4",
2729
- "chatgpt-gpt-5.4-fast",
2730
- "chatgpt-gpt-5.4-mini",
2731
- "chatgpt-gpt-5.3-codex-spark"
2732
- ];
2733
- function isChatGptModelId(value) {
2734
- return CHATGPT_MODEL_IDS.includes(value);
2735
- }
2736
- function stripChatGptPrefix(model) {
2737
- return model.slice("chatgpt-".length);
2738
- }
2739
- function resolveChatGptProviderModel(model) {
2740
- switch (model) {
2741
- case "chatgpt-gpt-5.4-fast":
2742
- return "gpt-5.4";
2743
- default:
2744
- return stripChatGptPrefix(model);
2745
- }
2746
- }
2747
- function resolveChatGptServiceTier(model) {
2748
- return model === "chatgpt-gpt-5.4-fast" ? "priority" : void 0;
2749
- }
2750
-
2751
2795
  // src/agentLogging.ts
2752
2796
  import { AsyncLocalStorage } from "async_hooks";
2753
2797
  import { Buffer as Buffer3 } from "buffer";
@@ -4945,7 +4989,11 @@ function resolveProvider(model) {
4945
4989
  }
4946
4990
  }
4947
4991
  if (isOpenAiModelId(model)) {
4948
- return { provider: "openai", model };
4992
+ return {
4993
+ provider: "openai",
4994
+ model: resolveOpenAiProviderModel(model),
4995
+ serviceTier: resolveOpenAiServiceTier(model)
4996
+ };
4949
4997
  }
4950
4998
  throw new Error(`Unsupported text model: ${model}`);
4951
4999
  }
@@ -7719,6 +7767,7 @@ async function runTextCall(params) {
7719
7767
  {
7720
7768
  model: modelForProvider,
7721
7769
  input: openAiInput,
7770
+ ...providerInfo.serviceTier ? { service_tier: providerInfo.serviceTier } : {},
7722
7771
  reasoning,
7723
7772
  text: openAiTextConfig,
7724
7773
  ...openAiTools ? { tools: openAiTools } : {},
@@ -7823,7 +7872,7 @@ async function runTextCall(params) {
7823
7872
  pushEvent({ type: "blocked" });
7824
7873
  }
7825
7874
  if (result2.model) {
7826
- modelVersion = providerInfo.serviceTier ? request.model : `chatgpt-${result2.model}`;
7875
+ modelVersion = providerInfo.serviceTier || isExperimentalChatGptModelId(request.model) ? request.model : `chatgpt-${result2.model}`;
7827
7876
  pushEvent({ type: "model", modelVersion });
7828
7877
  }
7829
7878
  latestUsage = extractChatGptUsageTokens(result2.usage);
@@ -8604,6 +8653,7 @@ async function runToolLoop(request) {
8604
8653
  const stepRequestPayload = {
8605
8654
  model: providerInfo.model,
8606
8655
  input: preparedInput,
8656
+ ...providerInfo.serviceTier ? { service_tier: providerInfo.serviceTier } : {},
8607
8657
  ...previousResponseId ? { previous_response_id: previousResponseId } : {},
8608
8658
  ...openAiTools.length > 0 ? { tools: openAiTools } : {},
8609
8659
  ...openAiTools.length > 0 ? { parallel_tool_calls: true } : {},
@@ -8632,6 +8682,7 @@ async function runToolLoop(request) {
8632
8682
  {
8633
8683
  model: providerInfo.model,
8634
8684
  input: preparedInput,
8685
+ ...providerInfo.serviceTier ? { service_tier: providerInfo.serviceTier } : {},
8635
8686
  ...previousResponseId ? { previous_response_id: previousResponseId } : {},
8636
8687
  ...openAiTools.length > 0 ? { tools: openAiTools } : {},
8637
8688
  ...openAiTools.length > 0 ? { parallel_tool_calls: true } : {},
@@ -9029,7 +9080,7 @@ async function runToolLoop(request) {
9029
9080
  }
9030
9081
  });
9031
9082
  const modelCompletedAtMs = Date.now();
9032
- modelVersion = response.model && !providerInfo.serviceTier ? `chatgpt-${response.model}` : request.model;
9083
+ modelVersion = response.model && !providerInfo.serviceTier && !isExperimentalChatGptModelId(request.model) ? `chatgpt-${response.model}` : request.model;
9033
9084
  usageTokens = extractChatGptUsageTokens(response.usage);
9034
9085
  const stepCostUsd = estimateCallCostUsd({
9035
9086
  modelId: modelVersion,
@@ -12639,8 +12690,11 @@ async function runAccessHook2(runtime, context) {
12639
12690
  await runtime.checkAccess(context);
12640
12691
  }
12641
12692
  function isCodexModel(model) {
12693
+ if (model.startsWith("experimental-chatgpt-")) {
12694
+ return true;
12695
+ }
12642
12696
  const normalized = model.startsWith("chatgpt-") ? model.slice("chatgpt-".length) : model;
12643
- return normalized.includes("codex") || normalized === "gpt-5.4" || normalized === "gpt-5.4-fast";
12697
+ return normalized.includes("codex") || normalized === "gpt-5.5" || normalized === "gpt-5.5-fast" || normalized === "gpt-5.4" || normalized === "gpt-5.4-fast";
12644
12698
  }
12645
12699
  function isGeminiModel(model) {
12646
12700
  return model.startsWith("gemini-");
@@ -14078,6 +14132,7 @@ export {
14078
14132
  CODEX_APPLY_PATCH_LARK_GRAMMAR,
14079
14133
  DEFAULT_FILE_TTL_SECONDS,
14080
14134
  DEFAULT_SIGNED_URL_TTL_SECONDS,
14135
+ EXPERIMENTAL_CHATGPT_MODEL_PREFIX,
14081
14136
  FIREWORKS_DEFAULT_GLM_MODEL,
14082
14137
  FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL,
14083
14138
  FIREWORKS_DEFAULT_KIMI_MODEL,
@@ -14132,6 +14187,7 @@ export {
14132
14187
  getChatGptAuthProfile,
14133
14188
  getCurrentToolCallContext,
14134
14189
  isChatGptModelId,
14190
+ isExperimentalChatGptModelId,
14135
14191
  isFireworksModelId,
14136
14192
  isGeminiImageModelId,
14137
14193
  isGeminiModelId,