@ljoukov/llm 3.0.4 → 3.0.8

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
@@ -74,7 +74,33 @@ type LlmModelEvent = {
74
74
  type LlmBlockedEvent = {
75
75
  readonly type: "blocked";
76
76
  };
77
- type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlockedEvent;
77
+ type LlmToolCallStartedEvent = {
78
+ readonly type: "tool_call";
79
+ readonly phase: "started";
80
+ readonly turn: number;
81
+ readonly toolIndex: number;
82
+ readonly toolName: string;
83
+ readonly toolId: string;
84
+ readonly callKind: "function" | "custom";
85
+ readonly callId?: string;
86
+ readonly input: unknown;
87
+ };
88
+ type LlmToolCallCompletedEvent = {
89
+ readonly type: "tool_call";
90
+ readonly phase: "completed";
91
+ readonly turn: number;
92
+ readonly toolIndex: number;
93
+ readonly toolName: string;
94
+ readonly toolId: string;
95
+ readonly callKind: "function" | "custom";
96
+ readonly callId?: string;
97
+ readonly input: unknown;
98
+ readonly output: unknown;
99
+ readonly error?: string;
100
+ readonly durationMs?: number;
101
+ };
102
+ type LlmToolCallStreamEvent = LlmToolCallStartedEvent | LlmToolCallCompletedEvent;
103
+ type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlockedEvent | LlmToolCallStreamEvent;
78
104
  type LlmProvider = "openai" | "chatgpt" | "gemini" | "fireworks";
79
105
  declare const LLM_TEXT_MODEL_IDS: readonly ["gpt-5.3-codex", "gpt-5.3-codex-spark", "gpt-5.2", "gpt-5.1-codex-mini", "chatgpt-gpt-5.3-codex", "chatgpt-gpt-5.3-codex-spark", "chatgpt-gpt-5.2", "chatgpt-gpt-5.1-codex-mini", "kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b", "gemini-3-pro-preview", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest"];
80
106
  type LlmTextModelId = (typeof LLM_TEXT_MODEL_IDS)[number];
@@ -240,6 +266,23 @@ type LlmToolCallResult = {
240
266
  readonly output: unknown;
241
267
  readonly error?: string;
242
268
  readonly callId?: string;
269
+ readonly startedAt?: string;
270
+ readonly completedAt?: string;
271
+ readonly durationMs?: number;
272
+ readonly metrics?: Record<string, unknown>;
273
+ };
274
+ type LlmToolLoopStepTiming = {
275
+ readonly startedAt: string;
276
+ readonly completedAt: string;
277
+ readonly totalMs: number;
278
+ readonly queueWaitMs: number;
279
+ readonly connectionSetupMs: number;
280
+ readonly activeGenerationMs: number;
281
+ readonly toolExecutionMs: number;
282
+ readonly waitToolMs: number;
283
+ readonly schedulerDelayMs: number;
284
+ readonly providerRetryDelayMs: number;
285
+ readonly providerAttempts: number;
243
286
  };
244
287
  type LlmToolLoopStep = {
245
288
  readonly step: number;
@@ -249,6 +292,7 @@ type LlmToolLoopStep = {
249
292
  readonly toolCalls: readonly LlmToolCallResult[];
250
293
  readonly usage?: LlmUsageTokens;
251
294
  readonly costUsd: number;
295
+ readonly timing?: LlmToolLoopStepTiming;
252
296
  };
253
297
  type LlmToolLoopResult = {
254
298
  readonly text: string;
@@ -256,15 +300,39 @@ type LlmToolLoopResult = {
256
300
  readonly steps: readonly LlmToolLoopStep[];
257
301
  readonly totalCostUsd: number;
258
302
  };
303
+ type LlmToolLoopSteeringMessage = {
304
+ readonly role?: "user";
305
+ readonly content: string | readonly LlmContentPart[];
306
+ };
307
+ type LlmToolLoopSteeringInput = string | LlmToolLoopSteeringMessage | readonly LlmToolLoopSteeringMessage[];
308
+ type LlmToolLoopSteeringAppendResult = {
309
+ readonly accepted: boolean;
310
+ readonly queuedCount: number;
311
+ };
312
+ type LlmToolLoopSteeringChannel = {
313
+ readonly append: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
314
+ readonly steer: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
315
+ readonly pendingCount: () => number;
316
+ readonly close: () => void;
317
+ };
259
318
  type LlmToolLoopRequest = LlmInput & {
260
319
  readonly model: LlmTextModelId;
261
320
  readonly tools: LlmToolSet;
262
321
  readonly modelTools?: readonly LlmToolConfig[];
263
322
  readonly maxSteps?: number;
264
323
  readonly openAiReasoningEffort?: OpenAiReasoningEffort;
324
+ readonly steering?: LlmToolLoopSteeringChannel;
265
325
  readonly onEvent?: (event: LlmStreamEvent) => void;
266
326
  readonly signal?: AbortSignal;
267
327
  };
328
+ type LlmToolLoopStream = {
329
+ readonly events: AsyncIterable<LlmStreamEvent>;
330
+ readonly result: Promise<LlmToolLoopResult>;
331
+ readonly append: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
332
+ readonly steer: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
333
+ readonly pendingSteeringCount: () => number;
334
+ readonly abort: () => void;
335
+ };
268
336
  declare function toGeminiJsonSchema(schema: z.ZodType, options?: {
269
337
  name?: string;
270
338
  }): JsonSchema;
@@ -279,7 +347,9 @@ declare function generateJson<T>(request: LlmJsonRequest<T>): Promise<{
279
347
  readonly rawText: string;
280
348
  readonly result: LlmTextResult;
281
349
  }>;
350
+ declare function createToolLoopSteeringChannel(): LlmToolLoopSteeringChannel;
282
351
  declare function runToolLoop(request: LlmToolLoopRequest): Promise<LlmToolLoopResult>;
352
+ declare function streamToolLoop(request: LlmToolLoopRequest): LlmToolLoopStream;
283
353
  declare function generateImages(request: LlmGenerateImagesRequest): Promise<LlmImageData[]>;
284
354
  declare function generateImageInBatches(request: LlmGenerateImagesRequest & {
285
355
  batchSize: number;
@@ -302,11 +372,22 @@ declare function loadEnvFromFile(filePath: string, { override }?: {
302
372
  override?: boolean;
303
373
  }): void;
304
374
 
375
+ type ModelConcurrencyProvider = "openai" | "google" | "fireworks";
376
+ type ModelConcurrencyConfig = {
377
+ readonly globalCap?: number;
378
+ readonly providerCaps?: Partial<Record<ModelConcurrencyProvider, number>>;
379
+ readonly modelCaps?: Record<string, number>;
380
+ readonly providerModelCaps?: Partial<Record<ModelConcurrencyProvider, Record<string, number>>>;
381
+ };
382
+ declare function configureModelConcurrency(config?: ModelConcurrencyConfig): void;
383
+ declare function resetModelConcurrencyConfig(): void;
384
+
305
385
  type AgentSubagentToolPromptPattern = "codex" | "none";
306
386
  type AgentSubagentToolConfig = {
307
387
  readonly enabled?: boolean;
308
388
  readonly maxAgents?: number;
309
389
  readonly maxDepth?: number;
390
+ readonly minWaitTimeoutMs?: number;
310
391
  readonly defaultWaitTimeoutMs?: number;
311
392
  readonly maxWaitTimeoutMs?: number;
312
393
  readonly promptPattern?: AgentSubagentToolPromptPattern;
@@ -378,31 +459,31 @@ type AgentFilesystemToolsOptions = {
378
459
  };
379
460
  declare const codexReadFileInputSchema: z.ZodObject<{
380
461
  file_path: z.ZodString;
381
- offset: z.ZodOptional<z.ZodNumber>;
382
- limit: z.ZodOptional<z.ZodNumber>;
383
- mode: z.ZodOptional<z.ZodEnum<{
462
+ offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
463
+ limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
464
+ mode: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
384
465
  slice: "slice";
385
466
  indentation: "indentation";
386
- }>>;
387
- indentation: z.ZodOptional<z.ZodObject<{
388
- anchor_line: z.ZodOptional<z.ZodNumber>;
389
- max_levels: z.ZodOptional<z.ZodNumber>;
390
- include_siblings: z.ZodOptional<z.ZodBoolean>;
391
- include_header: z.ZodOptional<z.ZodBoolean>;
392
- max_lines: z.ZodOptional<z.ZodNumber>;
393
- }, z.core.$strip>>;
467
+ }>>>;
468
+ indentation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
469
+ anchor_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
470
+ max_levels: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
471
+ include_siblings: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
472
+ include_header: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
473
+ max_lines: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
474
+ }, z.core.$strip>>>;
394
475
  }, z.core.$strip>;
395
476
  declare const codexListDirInputSchema: z.ZodObject<{
396
477
  dir_path: z.ZodString;
397
- offset: z.ZodOptional<z.ZodNumber>;
398
- limit: z.ZodOptional<z.ZodNumber>;
399
- depth: z.ZodOptional<z.ZodNumber>;
478
+ offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
479
+ limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
480
+ depth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
400
481
  }, z.core.$strip>;
401
482
  declare const codexGrepFilesInputSchema: z.ZodObject<{
402
483
  pattern: z.ZodString;
403
- include: z.ZodOptional<z.ZodString>;
404
- path: z.ZodOptional<z.ZodString>;
405
- limit: z.ZodOptional<z.ZodNumber>;
484
+ include: z.ZodOptional<z.ZodNullable<z.ZodString>>;
485
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
486
+ limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
406
487
  }, z.core.$strip>;
407
488
  declare const applyPatchInputSchema: z.ZodObject<{
408
489
  input: z.ZodString;
@@ -509,8 +590,57 @@ type RunAgentLoopRequest = Omit<LlmToolLoopRequest, "tools"> & {
509
590
  readonly subagentTool?: AgentSubagentToolSelection;
510
591
  readonly subagent_tool?: AgentSubagentToolSelection;
511
592
  readonly subagents?: AgentSubagentToolSelection;
593
+ readonly telemetry?: AgentTelemetrySelection;
594
+ };
595
+ type AgentLoopStream = {
596
+ readonly events: AsyncIterable<LlmStreamEvent>;
597
+ readonly result: Promise<LlmToolLoopResult>;
598
+ readonly append: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
599
+ readonly steer: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
600
+ readonly pendingSteeringCount: () => number;
601
+ readonly abort: () => void;
512
602
  };
513
603
  declare function runAgentLoop(request: RunAgentLoopRequest): Promise<LlmToolLoopResult>;
604
+ declare function streamAgentLoop(request: RunAgentLoopRequest): AgentLoopStream;
605
+ type AgentTelemetryBaseEvent = {
606
+ readonly timestamp: string;
607
+ readonly runId: string;
608
+ readonly parentRunId?: string;
609
+ readonly depth: number;
610
+ readonly model: LlmToolLoopRequest["model"];
611
+ };
612
+ type AgentRunStartedTelemetryEvent = AgentTelemetryBaseEvent & {
613
+ readonly type: "agent.run.started";
614
+ readonly inputMode: "string" | "messages";
615
+ readonly customToolCount: number;
616
+ readonly mergedToolCount: number;
617
+ readonly filesystemToolsEnabled: boolean;
618
+ readonly subagentToolsEnabled: boolean;
619
+ };
620
+ type AgentRunStreamTelemetryEvent = AgentTelemetryBaseEvent & {
621
+ readonly type: "agent.run.stream";
622
+ readonly event: LlmStreamEvent;
623
+ };
624
+ type AgentRunCompletedTelemetryEvent = AgentTelemetryBaseEvent & {
625
+ readonly type: "agent.run.completed";
626
+ readonly success: boolean;
627
+ readonly durationMs: number;
628
+ readonly stepCount?: number;
629
+ readonly toolCallCount?: number;
630
+ readonly totalCostUsd?: number;
631
+ readonly usage?: LlmUsageTokens;
632
+ readonly error?: string;
633
+ };
634
+ type AgentTelemetryEvent = AgentRunStartedTelemetryEvent | AgentRunStreamTelemetryEvent | AgentRunCompletedTelemetryEvent;
635
+ type AgentTelemetrySink = {
636
+ readonly emit: (event: AgentTelemetryEvent) => void | Promise<void>;
637
+ readonly flush?: () => void | Promise<void>;
638
+ };
639
+ type AgentTelemetryConfig = {
640
+ readonly sink: AgentTelemetrySink;
641
+ readonly includeLlmStreamEvents?: boolean;
642
+ };
643
+ type AgentTelemetrySelection = AgentTelemetrySink | AgentTelemetryConfig;
514
644
 
515
645
  declare const CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION = "Use the `apply_patch` tool to edit files. This is a FREEFORM tool, so do not wrap the patch in JSON.";
516
646
  declare const CODEX_APPLY_PATCH_LARK_GRAMMAR: string;
@@ -599,4 +729,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
599
729
  declare function isFireworksModelId(value: string): value is FireworksModelId;
600
730
  declare function resolveFireworksModelId(model: string): string | undefined;
601
731
 
602
- export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentPathInfo, type AgentPathKind, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type ChatGptAuthProfile, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CreateApplyPatchToolOptions, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, 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 GeminiReadFilesToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type LlmBaseRequest, type LlmBlockedEvent, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFunctionTool, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmModelEvent, type LlmModelId, type LlmProvider, type LlmStreamEvent, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmToolCallContext, type LlmToolCallResult, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopStep, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, OPENAI_MODEL_IDS, type OpenAiModelId, type RunAgentLoopRequest, appendMarkdownSourcesSection, applyPatch, configureGemini, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReadFilesTool, createReplaceTool, createRgSearchTool, createWriteFileTool, customTool, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runToolLoop, sanitisePartForLogging, streamJson, streamText, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
732
+ export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type AgentTelemetryConfig, type AgentTelemetryEvent, type AgentTelemetrySelection, type AgentTelemetrySink, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type ChatGptAuthProfile, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CreateApplyPatchToolOptions, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, 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 GeminiReadFilesToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type LlmBaseRequest, type LlmBlockedEvent, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFunctionTool, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmModelEvent, type LlmModelId, type LlmProvider, type LlmStreamEvent, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, 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 RunAgentLoopRequest, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReadFilesTool, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createWriteFileTool, customTool, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
package/dist/index.d.ts CHANGED
@@ -74,7 +74,33 @@ type LlmModelEvent = {
74
74
  type LlmBlockedEvent = {
75
75
  readonly type: "blocked";
76
76
  };
77
- type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlockedEvent;
77
+ type LlmToolCallStartedEvent = {
78
+ readonly type: "tool_call";
79
+ readonly phase: "started";
80
+ readonly turn: number;
81
+ readonly toolIndex: number;
82
+ readonly toolName: string;
83
+ readonly toolId: string;
84
+ readonly callKind: "function" | "custom";
85
+ readonly callId?: string;
86
+ readonly input: unknown;
87
+ };
88
+ type LlmToolCallCompletedEvent = {
89
+ readonly type: "tool_call";
90
+ readonly phase: "completed";
91
+ readonly turn: number;
92
+ readonly toolIndex: number;
93
+ readonly toolName: string;
94
+ readonly toolId: string;
95
+ readonly callKind: "function" | "custom";
96
+ readonly callId?: string;
97
+ readonly input: unknown;
98
+ readonly output: unknown;
99
+ readonly error?: string;
100
+ readonly durationMs?: number;
101
+ };
102
+ type LlmToolCallStreamEvent = LlmToolCallStartedEvent | LlmToolCallCompletedEvent;
103
+ type LlmStreamEvent = LlmTextDeltaEvent | LlmUsageEvent | LlmModelEvent | LlmBlockedEvent | LlmToolCallStreamEvent;
78
104
  type LlmProvider = "openai" | "chatgpt" | "gemini" | "fireworks";
79
105
  declare const LLM_TEXT_MODEL_IDS: readonly ["gpt-5.3-codex", "gpt-5.3-codex-spark", "gpt-5.2", "gpt-5.1-codex-mini", "chatgpt-gpt-5.3-codex", "chatgpt-gpt-5.3-codex-spark", "chatgpt-gpt-5.2", "chatgpt-gpt-5.1-codex-mini", "kimi-k2.5", "glm-5", "minimax-m2.1", "gpt-oss-120b", "gemini-3-pro-preview", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-flash-latest", "gemini-flash-lite-latest"];
80
106
  type LlmTextModelId = (typeof LLM_TEXT_MODEL_IDS)[number];
@@ -240,6 +266,23 @@ type LlmToolCallResult = {
240
266
  readonly output: unknown;
241
267
  readonly error?: string;
242
268
  readonly callId?: string;
269
+ readonly startedAt?: string;
270
+ readonly completedAt?: string;
271
+ readonly durationMs?: number;
272
+ readonly metrics?: Record<string, unknown>;
273
+ };
274
+ type LlmToolLoopStepTiming = {
275
+ readonly startedAt: string;
276
+ readonly completedAt: string;
277
+ readonly totalMs: number;
278
+ readonly queueWaitMs: number;
279
+ readonly connectionSetupMs: number;
280
+ readonly activeGenerationMs: number;
281
+ readonly toolExecutionMs: number;
282
+ readonly waitToolMs: number;
283
+ readonly schedulerDelayMs: number;
284
+ readonly providerRetryDelayMs: number;
285
+ readonly providerAttempts: number;
243
286
  };
244
287
  type LlmToolLoopStep = {
245
288
  readonly step: number;
@@ -249,6 +292,7 @@ type LlmToolLoopStep = {
249
292
  readonly toolCalls: readonly LlmToolCallResult[];
250
293
  readonly usage?: LlmUsageTokens;
251
294
  readonly costUsd: number;
295
+ readonly timing?: LlmToolLoopStepTiming;
252
296
  };
253
297
  type LlmToolLoopResult = {
254
298
  readonly text: string;
@@ -256,15 +300,39 @@ type LlmToolLoopResult = {
256
300
  readonly steps: readonly LlmToolLoopStep[];
257
301
  readonly totalCostUsd: number;
258
302
  };
303
+ type LlmToolLoopSteeringMessage = {
304
+ readonly role?: "user";
305
+ readonly content: string | readonly LlmContentPart[];
306
+ };
307
+ type LlmToolLoopSteeringInput = string | LlmToolLoopSteeringMessage | readonly LlmToolLoopSteeringMessage[];
308
+ type LlmToolLoopSteeringAppendResult = {
309
+ readonly accepted: boolean;
310
+ readonly queuedCount: number;
311
+ };
312
+ type LlmToolLoopSteeringChannel = {
313
+ readonly append: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
314
+ readonly steer: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
315
+ readonly pendingCount: () => number;
316
+ readonly close: () => void;
317
+ };
259
318
  type LlmToolLoopRequest = LlmInput & {
260
319
  readonly model: LlmTextModelId;
261
320
  readonly tools: LlmToolSet;
262
321
  readonly modelTools?: readonly LlmToolConfig[];
263
322
  readonly maxSteps?: number;
264
323
  readonly openAiReasoningEffort?: OpenAiReasoningEffort;
324
+ readonly steering?: LlmToolLoopSteeringChannel;
265
325
  readonly onEvent?: (event: LlmStreamEvent) => void;
266
326
  readonly signal?: AbortSignal;
267
327
  };
328
+ type LlmToolLoopStream = {
329
+ readonly events: AsyncIterable<LlmStreamEvent>;
330
+ readonly result: Promise<LlmToolLoopResult>;
331
+ readonly append: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
332
+ readonly steer: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
333
+ readonly pendingSteeringCount: () => number;
334
+ readonly abort: () => void;
335
+ };
268
336
  declare function toGeminiJsonSchema(schema: z.ZodType, options?: {
269
337
  name?: string;
270
338
  }): JsonSchema;
@@ -279,7 +347,9 @@ declare function generateJson<T>(request: LlmJsonRequest<T>): Promise<{
279
347
  readonly rawText: string;
280
348
  readonly result: LlmTextResult;
281
349
  }>;
350
+ declare function createToolLoopSteeringChannel(): LlmToolLoopSteeringChannel;
282
351
  declare function runToolLoop(request: LlmToolLoopRequest): Promise<LlmToolLoopResult>;
352
+ declare function streamToolLoop(request: LlmToolLoopRequest): LlmToolLoopStream;
283
353
  declare function generateImages(request: LlmGenerateImagesRequest): Promise<LlmImageData[]>;
284
354
  declare function generateImageInBatches(request: LlmGenerateImagesRequest & {
285
355
  batchSize: number;
@@ -302,11 +372,22 @@ declare function loadEnvFromFile(filePath: string, { override }?: {
302
372
  override?: boolean;
303
373
  }): void;
304
374
 
375
+ type ModelConcurrencyProvider = "openai" | "google" | "fireworks";
376
+ type ModelConcurrencyConfig = {
377
+ readonly globalCap?: number;
378
+ readonly providerCaps?: Partial<Record<ModelConcurrencyProvider, number>>;
379
+ readonly modelCaps?: Record<string, number>;
380
+ readonly providerModelCaps?: Partial<Record<ModelConcurrencyProvider, Record<string, number>>>;
381
+ };
382
+ declare function configureModelConcurrency(config?: ModelConcurrencyConfig): void;
383
+ declare function resetModelConcurrencyConfig(): void;
384
+
305
385
  type AgentSubagentToolPromptPattern = "codex" | "none";
306
386
  type AgentSubagentToolConfig = {
307
387
  readonly enabled?: boolean;
308
388
  readonly maxAgents?: number;
309
389
  readonly maxDepth?: number;
390
+ readonly minWaitTimeoutMs?: number;
310
391
  readonly defaultWaitTimeoutMs?: number;
311
392
  readonly maxWaitTimeoutMs?: number;
312
393
  readonly promptPattern?: AgentSubagentToolPromptPattern;
@@ -378,31 +459,31 @@ type AgentFilesystemToolsOptions = {
378
459
  };
379
460
  declare const codexReadFileInputSchema: z.ZodObject<{
380
461
  file_path: z.ZodString;
381
- offset: z.ZodOptional<z.ZodNumber>;
382
- limit: z.ZodOptional<z.ZodNumber>;
383
- mode: z.ZodOptional<z.ZodEnum<{
462
+ offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
463
+ limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
464
+ mode: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
384
465
  slice: "slice";
385
466
  indentation: "indentation";
386
- }>>;
387
- indentation: z.ZodOptional<z.ZodObject<{
388
- anchor_line: z.ZodOptional<z.ZodNumber>;
389
- max_levels: z.ZodOptional<z.ZodNumber>;
390
- include_siblings: z.ZodOptional<z.ZodBoolean>;
391
- include_header: z.ZodOptional<z.ZodBoolean>;
392
- max_lines: z.ZodOptional<z.ZodNumber>;
393
- }, z.core.$strip>>;
467
+ }>>>;
468
+ indentation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
469
+ anchor_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
470
+ max_levels: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
471
+ include_siblings: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
472
+ include_header: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
473
+ max_lines: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
474
+ }, z.core.$strip>>>;
394
475
  }, z.core.$strip>;
395
476
  declare const codexListDirInputSchema: z.ZodObject<{
396
477
  dir_path: z.ZodString;
397
- offset: z.ZodOptional<z.ZodNumber>;
398
- limit: z.ZodOptional<z.ZodNumber>;
399
- depth: z.ZodOptional<z.ZodNumber>;
478
+ offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
479
+ limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
480
+ depth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
400
481
  }, z.core.$strip>;
401
482
  declare const codexGrepFilesInputSchema: z.ZodObject<{
402
483
  pattern: z.ZodString;
403
- include: z.ZodOptional<z.ZodString>;
404
- path: z.ZodOptional<z.ZodString>;
405
- limit: z.ZodOptional<z.ZodNumber>;
484
+ include: z.ZodOptional<z.ZodNullable<z.ZodString>>;
485
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
486
+ limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
406
487
  }, z.core.$strip>;
407
488
  declare const applyPatchInputSchema: z.ZodObject<{
408
489
  input: z.ZodString;
@@ -509,8 +590,57 @@ type RunAgentLoopRequest = Omit<LlmToolLoopRequest, "tools"> & {
509
590
  readonly subagentTool?: AgentSubagentToolSelection;
510
591
  readonly subagent_tool?: AgentSubagentToolSelection;
511
592
  readonly subagents?: AgentSubagentToolSelection;
593
+ readonly telemetry?: AgentTelemetrySelection;
594
+ };
595
+ type AgentLoopStream = {
596
+ readonly events: AsyncIterable<LlmStreamEvent>;
597
+ readonly result: Promise<LlmToolLoopResult>;
598
+ readonly append: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
599
+ readonly steer: (input: LlmToolLoopSteeringInput) => LlmToolLoopSteeringAppendResult;
600
+ readonly pendingSteeringCount: () => number;
601
+ readonly abort: () => void;
512
602
  };
513
603
  declare function runAgentLoop(request: RunAgentLoopRequest): Promise<LlmToolLoopResult>;
604
+ declare function streamAgentLoop(request: RunAgentLoopRequest): AgentLoopStream;
605
+ type AgentTelemetryBaseEvent = {
606
+ readonly timestamp: string;
607
+ readonly runId: string;
608
+ readonly parentRunId?: string;
609
+ readonly depth: number;
610
+ readonly model: LlmToolLoopRequest["model"];
611
+ };
612
+ type AgentRunStartedTelemetryEvent = AgentTelemetryBaseEvent & {
613
+ readonly type: "agent.run.started";
614
+ readonly inputMode: "string" | "messages";
615
+ readonly customToolCount: number;
616
+ readonly mergedToolCount: number;
617
+ readonly filesystemToolsEnabled: boolean;
618
+ readonly subagentToolsEnabled: boolean;
619
+ };
620
+ type AgentRunStreamTelemetryEvent = AgentTelemetryBaseEvent & {
621
+ readonly type: "agent.run.stream";
622
+ readonly event: LlmStreamEvent;
623
+ };
624
+ type AgentRunCompletedTelemetryEvent = AgentTelemetryBaseEvent & {
625
+ readonly type: "agent.run.completed";
626
+ readonly success: boolean;
627
+ readonly durationMs: number;
628
+ readonly stepCount?: number;
629
+ readonly toolCallCount?: number;
630
+ readonly totalCostUsd?: number;
631
+ readonly usage?: LlmUsageTokens;
632
+ readonly error?: string;
633
+ };
634
+ type AgentTelemetryEvent = AgentRunStartedTelemetryEvent | AgentRunStreamTelemetryEvent | AgentRunCompletedTelemetryEvent;
635
+ type AgentTelemetrySink = {
636
+ readonly emit: (event: AgentTelemetryEvent) => void | Promise<void>;
637
+ readonly flush?: () => void | Promise<void>;
638
+ };
639
+ type AgentTelemetryConfig = {
640
+ readonly sink: AgentTelemetrySink;
641
+ readonly includeLlmStreamEvents?: boolean;
642
+ };
643
+ type AgentTelemetrySelection = AgentTelemetrySink | AgentTelemetryConfig;
514
644
 
515
645
  declare const CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION = "Use the `apply_patch` tool to edit files. This is a FREEFORM tool, so do not wrap the patch in JSON.";
516
646
  declare const CODEX_APPLY_PATCH_LARK_GRAMMAR: string;
@@ -599,4 +729,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
599
729
  declare function isFireworksModelId(value: string): value is FireworksModelId;
600
730
  declare function resolveFireworksModelId(model: string): string | undefined;
601
731
 
602
- export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentPathInfo, type AgentPathKind, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type ChatGptAuthProfile, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CreateApplyPatchToolOptions, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, 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 GeminiReadFilesToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type LlmBaseRequest, type LlmBlockedEvent, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFunctionTool, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmModelEvent, type LlmModelId, type LlmProvider, type LlmStreamEvent, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmToolCallContext, type LlmToolCallResult, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopStep, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, OPENAI_MODEL_IDS, type OpenAiModelId, type RunAgentLoopRequest, appendMarkdownSourcesSection, applyPatch, configureGemini, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReadFilesTool, createReplaceTool, createRgSearchTool, createWriteFileTool, customTool, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runToolLoop, sanitisePartForLogging, streamJson, streamText, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
732
+ export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type AgentTelemetryConfig, type AgentTelemetryEvent, type AgentTelemetrySelection, type AgentTelemetrySink, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type ChatGptAuthProfile, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CreateApplyPatchToolOptions, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, 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 GeminiReadFilesToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type LlmBaseRequest, type LlmBlockedEvent, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFunctionTool, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmModelEvent, type LlmModelId, type LlmProvider, type LlmStreamEvent, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, 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 RunAgentLoopRequest, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReadFilesTool, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createWriteFileTool, customTool, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiModelId, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool };