@ljoukov/llm 7.0.11 → 7.0.12

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
@@ -162,11 +162,38 @@ type LlmToolOutputContentItem = {
162
162
  type LlmImageSize = "1K" | "2K" | "4K";
163
163
  type LlmThinkingLevel = "low" | "medium" | "high";
164
164
  type LlmWebSearchMode = "cached" | "live";
165
+ type LlmOpenAiShellNetworkPolicy = {
166
+ readonly type: "disabled";
167
+ } | {
168
+ readonly type: "allowlist";
169
+ readonly allowedDomains: readonly string[];
170
+ readonly domainSecrets?: readonly {
171
+ readonly domain: string;
172
+ readonly name: string;
173
+ readonly value: string;
174
+ }[];
175
+ };
176
+ type LlmOpenAiShellEnvironment = {
177
+ readonly type?: "container-auto";
178
+ readonly fileIds?: readonly string[];
179
+ readonly memoryLimit?: "1g" | "4g" | "16g" | "64g" | null;
180
+ readonly networkPolicy?: LlmOpenAiShellNetworkPolicy;
181
+ } | {
182
+ readonly type: "container-reference";
183
+ readonly containerId: string;
184
+ };
165
185
  type LlmToolConfig = {
166
186
  readonly type: "web-search";
167
187
  readonly mode?: LlmWebSearchMode;
168
188
  } | {
169
189
  readonly type: "code-execution";
190
+ } | {
191
+ /**
192
+ * OpenAI hosted shell tool. Runs commands in an OpenAI-managed container,
193
+ * not on the caller's local machine.
194
+ */
195
+ readonly type: "shell";
196
+ readonly environment?: LlmOpenAiShellEnvironment;
170
197
  };
171
198
  type LlmTextDeltaEvent = {
172
199
  readonly type: "delta";
@@ -1010,4 +1037,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
1010
1037
  declare function isFireworksModelId(value: string): value is FireworksModelId;
1011
1038
  declare function resolveFireworksModelId(model: string): string | undefined;
1012
1039
 
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 };
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 };
package/dist/index.d.ts CHANGED
@@ -162,11 +162,38 @@ type LlmToolOutputContentItem = {
162
162
  type LlmImageSize = "1K" | "2K" | "4K";
163
163
  type LlmThinkingLevel = "low" | "medium" | "high";
164
164
  type LlmWebSearchMode = "cached" | "live";
165
+ type LlmOpenAiShellNetworkPolicy = {
166
+ readonly type: "disabled";
167
+ } | {
168
+ readonly type: "allowlist";
169
+ readonly allowedDomains: readonly string[];
170
+ readonly domainSecrets?: readonly {
171
+ readonly domain: string;
172
+ readonly name: string;
173
+ readonly value: string;
174
+ }[];
175
+ };
176
+ type LlmOpenAiShellEnvironment = {
177
+ readonly type?: "container-auto";
178
+ readonly fileIds?: readonly string[];
179
+ readonly memoryLimit?: "1g" | "4g" | "16g" | "64g" | null;
180
+ readonly networkPolicy?: LlmOpenAiShellNetworkPolicy;
181
+ } | {
182
+ readonly type: "container-reference";
183
+ readonly containerId: string;
184
+ };
165
185
  type LlmToolConfig = {
166
186
  readonly type: "web-search";
167
187
  readonly mode?: LlmWebSearchMode;
168
188
  } | {
169
189
  readonly type: "code-execution";
190
+ } | {
191
+ /**
192
+ * OpenAI hosted shell tool. Runs commands in an OpenAI-managed container,
193
+ * not on the caller's local machine.
194
+ */
195
+ readonly type: "shell";
196
+ readonly environment?: LlmOpenAiShellEnvironment;
170
197
  };
171
198
  type LlmTextDeltaEvent = {
172
199
  readonly type: "delta";
@@ -1010,4 +1037,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
1010
1037
  declare function isFireworksModelId(value: string): value is FireworksModelId;
1011
1038
  declare function resolveFireworksModelId(model: string): string | undefined;
1012
1039
 
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 };
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 };
package/dist/index.js CHANGED
@@ -6082,12 +6082,40 @@ function toGeminiTools(tools) {
6082
6082
  return { googleSearch: {} };
6083
6083
  case "code-execution":
6084
6084
  return { codeExecution: {} };
6085
+ case "shell":
6086
+ throw new Error("Gemini provider does not support the OpenAI shell tool.");
6085
6087
  default:
6086
6088
  throw new Error("Unsupported tool configuration");
6087
6089
  }
6088
6090
  });
6089
6091
  }
6090
- function toOpenAiTools(tools) {
6092
+ function toOpenAiShellEnvironment(environment) {
6093
+ if (environment?.type === "container-reference") {
6094
+ return {
6095
+ type: "container_reference",
6096
+ container_id: environment.containerId
6097
+ };
6098
+ }
6099
+ return {
6100
+ type: "container_auto",
6101
+ ...environment?.fileIds ? { file_ids: Array.from(environment.fileIds) } : {},
6102
+ ...environment?.memoryLimit !== void 0 ? { memory_limit: environment.memoryLimit } : {},
6103
+ ...environment?.networkPolicy ? {
6104
+ network_policy: environment.networkPolicy.type === "allowlist" ? {
6105
+ type: "allowlist",
6106
+ allowed_domains: Array.from(environment.networkPolicy.allowedDomains),
6107
+ ...environment.networkPolicy.domainSecrets ? {
6108
+ domain_secrets: environment.networkPolicy.domainSecrets.map((secret) => ({
6109
+ domain: secret.domain,
6110
+ name: secret.name,
6111
+ value: secret.value
6112
+ }))
6113
+ } : {}
6114
+ } : { type: "disabled" }
6115
+ } : {}
6116
+ };
6117
+ }
6118
+ function toOpenAiTools(tools, options) {
6091
6119
  if (!tools || tools.length === 0) {
6092
6120
  return void 0;
6093
6121
  }
@@ -6100,6 +6128,15 @@ function toOpenAiTools(tools) {
6100
6128
  case "code-execution": {
6101
6129
  return { type: "code_interpreter", container: { type: "auto" } };
6102
6130
  }
6131
+ case "shell": {
6132
+ if (options.provider !== "openai") {
6133
+ throw new Error("OpenAI shell tool is only supported for OpenAI API models.");
6134
+ }
6135
+ return {
6136
+ type: "shell",
6137
+ environment: toOpenAiShellEnvironment(tool2.environment)
6138
+ };
6139
+ }
6103
6140
  default:
6104
6141
  throw new Error("Unsupported tool configuration");
6105
6142
  }
@@ -7698,6 +7735,8 @@ async function runTextCall(params) {
7698
7735
  let responseRole;
7699
7736
  let latestUsage;
7700
7737
  let responseImages = 0;
7738
+ let sawResponseDelta = false;
7739
+ let sawThoughtDelta = false;
7701
7740
  const pushEvent = (event) => {
7702
7741
  queue.push(event);
7703
7742
  params.onEvent?.(event);
@@ -7708,8 +7747,10 @@ async function runTextCall(params) {
7708
7747
  }
7709
7748
  responseParts.push({ type: "text", text, ...channel === "thought" ? { thought: true } : {} });
7710
7749
  if (channel === "thought") {
7750
+ sawThoughtDelta = true;
7711
7751
  callLogger?.appendThoughtDelta(text);
7712
7752
  } else {
7753
+ sawResponseDelta = true;
7713
7754
  callLogger?.appendResponseDelta(text);
7714
7755
  }
7715
7756
  pushEvent({ type: "delta", channel, text });
@@ -7749,7 +7790,7 @@ async function runTextCall(params) {
7749
7790
  }),
7750
7791
  { model: request.model, provider: "openai" }
7751
7792
  );
7752
- const openAiTools = toOpenAiTools(request.tools);
7793
+ const openAiTools = toOpenAiTools(request.tools, { provider: "openai" });
7753
7794
  const reasoningEffort = resolveOpenAiReasoningEffort(
7754
7795
  modelForProvider,
7755
7796
  request.thinkingLevel
@@ -7810,12 +7851,17 @@ async function runTextCall(params) {
7810
7851
  );
7811
7852
  }
7812
7853
  latestUsage = extractOpenAiUsageTokens(finalResponse.usage);
7813
- if (responseParts.length === 0) {
7854
+ if (!sawResponseDelta || !sawThoughtDelta) {
7855
+ const needsResponseFallback = !sawResponseDelta;
7856
+ const needsThoughtFallback = !sawThoughtDelta;
7814
7857
  const fallback = extractOpenAiResponseParts(finalResponse);
7815
7858
  blocked = blocked || fallback.blocked;
7816
7859
  for (const part of fallback.parts) {
7817
7860
  if (part.type === "text") {
7818
- pushDelta(part.thought === true ? "thought" : "response", part.text);
7861
+ const channel = part.thought === true ? "thought" : "response";
7862
+ if (channel === "response" && needsResponseFallback || channel === "thought" && needsThoughtFallback) {
7863
+ pushDelta(channel, part.text);
7864
+ }
7819
7865
  } else if (part.type === "inlineData") {
7820
7866
  pushInline(part.data, part.mimeType);
7821
7867
  }
@@ -7832,7 +7878,7 @@ async function runTextCall(params) {
7832
7878
  provider: "chatgpt"
7833
7879
  });
7834
7880
  const reasoningEffort = resolveOpenAiReasoningEffort(request.model, request.thinkingLevel);
7835
- const openAiTools = toOpenAiTools(request.tools);
7881
+ const openAiTools = toOpenAiTools(request.tools, { provider: "chatgpt" });
7836
7882
  const requestPayload = {
7837
7883
  model: modelForProvider,
7838
7884
  store: false,
@@ -7851,18 +7897,18 @@ async function runTextCall(params) {
7851
7897
  },
7852
7898
  ...openAiTools ? { tools: openAiTools } : {}
7853
7899
  };
7854
- let sawResponseDelta = false;
7855
- let sawThoughtDelta = false;
7900
+ let sawResponseDelta2 = false;
7901
+ let sawThoughtDelta2 = false;
7856
7902
  const result2 = await collectChatGptCodexResponseWithRetry({
7857
7903
  request: requestPayload,
7858
7904
  signal,
7859
7905
  onDelta: (delta) => {
7860
7906
  if (delta.thoughtDelta) {
7861
- sawThoughtDelta = true;
7907
+ sawThoughtDelta2 = true;
7862
7908
  pushDelta("thought", delta.thoughtDelta);
7863
7909
  }
7864
7910
  if (delta.textDelta) {
7865
- sawResponseDelta = true;
7911
+ sawResponseDelta2 = true;
7866
7912
  pushDelta("response", delta.textDelta);
7867
7913
  }
7868
7914
  }
@@ -7878,10 +7924,10 @@ async function runTextCall(params) {
7878
7924
  latestUsage = extractChatGptUsageTokens(result2.usage);
7879
7925
  const fallbackText = typeof result2.text === "string" ? result2.text : "";
7880
7926
  const fallbackThoughts = typeof result2.reasoningSummaryText === "string" && result2.reasoningSummaryText.length > 0 ? result2.reasoningSummaryText : typeof result2.reasoningText === "string" ? result2.reasoningText : "";
7881
- if (!sawThoughtDelta && fallbackThoughts.length > 0) {
7927
+ if (!sawThoughtDelta2 && fallbackThoughts.length > 0) {
7882
7928
  pushDelta("thought", fallbackThoughts);
7883
7929
  }
7884
- if (!sawResponseDelta && fallbackText.length > 0) {
7930
+ if (!sawResponseDelta2 && fallbackText.length > 0) {
7885
7931
  pushDelta("response", fallbackText);
7886
7932
  }
7887
7933
  } else if (provider === "fireworks") {
@@ -8601,7 +8647,7 @@ async function runToolLoop(request) {
8601
8647
  try {
8602
8648
  if (providerInfo.provider === "openai") {
8603
8649
  const openAiAgentTools = buildOpenAiToolsFromToolSet(request.tools);
8604
- const openAiNativeTools = toOpenAiTools(request.modelTools);
8650
+ const openAiNativeTools = toOpenAiTools(request.modelTools, { provider: "openai" });
8605
8651
  const openAiTools = openAiNativeTools ? [...openAiNativeTools, ...openAiAgentTools] : [...openAiAgentTools];
8606
8652
  const reasoningEffort = resolveOpenAiReasoningEffort(
8607
8653
  providerInfo.model,
@@ -9004,7 +9050,7 @@ async function runToolLoop(request) {
9004
9050
  }
9005
9051
  if (providerInfo.provider === "chatgpt") {
9006
9052
  const openAiAgentTools = buildOpenAiToolsFromToolSet(request.tools);
9007
- const openAiNativeTools = toOpenAiTools(request.modelTools);
9053
+ const openAiNativeTools = toOpenAiTools(request.modelTools, { provider: "chatgpt" });
9008
9054
  const openAiTools = openAiNativeTools ? [...openAiNativeTools, ...openAiAgentTools] : [...openAiAgentTools];
9009
9055
  const reasoningEffort = resolveOpenAiReasoningEffort(request.model, request.thinkingLevel);
9010
9056
  const toolLoopInput = toChatGptInput(contents, {