@ljoukov/llm 4.0.12 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -4
- package/dist/index.cjs +2026 -547
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -13
- package/dist/index.d.ts +85 -13
- package/dist/index.js +1986 -510
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -32,12 +32,27 @@ type LlmInlineDataPart = {
|
|
|
32
32
|
type: "inlineData";
|
|
33
33
|
data: string;
|
|
34
34
|
mimeType?: string;
|
|
35
|
+
filename?: string;
|
|
36
|
+
};
|
|
37
|
+
type LlmInputImagePart = {
|
|
38
|
+
type: "input_image";
|
|
39
|
+
image_url?: string | null;
|
|
40
|
+
file_id?: string | null;
|
|
41
|
+
detail?: "auto" | "low" | "high";
|
|
42
|
+
filename?: string | null;
|
|
43
|
+
};
|
|
44
|
+
type LlmInputFilePart = {
|
|
45
|
+
type: "input_file";
|
|
46
|
+
file_data?: string | null;
|
|
47
|
+
file_id?: string | null;
|
|
48
|
+
file_url?: string | null;
|
|
49
|
+
filename?: string | null;
|
|
35
50
|
};
|
|
36
51
|
type LlmContentPart = {
|
|
37
52
|
type: "text";
|
|
38
53
|
text: string;
|
|
39
54
|
thought?: boolean;
|
|
40
|
-
} | LlmInlineDataPart;
|
|
55
|
+
} | LlmInlineDataPart | LlmInputImagePart | LlmInputFilePart;
|
|
41
56
|
type LlmContent = {
|
|
42
57
|
readonly role: LlmRole;
|
|
43
58
|
readonly parts: readonly LlmContentPart[];
|
|
@@ -45,17 +60,7 @@ type LlmContent = {
|
|
|
45
60
|
type LlmToolOutputContentItem = {
|
|
46
61
|
readonly type: "input_text";
|
|
47
62
|
readonly text: string;
|
|
48
|
-
} |
|
|
49
|
-
readonly type: "input_image";
|
|
50
|
-
readonly image_url: string;
|
|
51
|
-
readonly detail?: "auto";
|
|
52
|
-
} | {
|
|
53
|
-
readonly type: "input_file";
|
|
54
|
-
readonly file_data?: string | null;
|
|
55
|
-
readonly file_id?: string | null;
|
|
56
|
-
readonly file_url?: string | null;
|
|
57
|
-
readonly filename?: string | null;
|
|
58
|
-
};
|
|
63
|
+
} | LlmInputImagePart | LlmInputFilePart;
|
|
59
64
|
type LlmImageSize = "1K" | "2K" | "4K";
|
|
60
65
|
type LlmThinkingLevel = "low" | "medium" | "high";
|
|
61
66
|
type LlmWebSearchMode = "cached" | "live";
|
|
@@ -374,6 +379,70 @@ declare function stripCodexCitationMarkers(value: string): {
|
|
|
374
379
|
};
|
|
375
380
|
declare function appendMarkdownSourcesSection(value: string, sources: readonly string[]): string;
|
|
376
381
|
|
|
382
|
+
declare const DEFAULT_FILE_TTL_SECONDS: number;
|
|
383
|
+
type LlmFilePurpose = "user_data";
|
|
384
|
+
type LlmStoredFile = {
|
|
385
|
+
readonly id: string;
|
|
386
|
+
readonly bytes: number;
|
|
387
|
+
readonly created_at: number;
|
|
388
|
+
readonly filename: string;
|
|
389
|
+
readonly object: "file";
|
|
390
|
+
readonly purpose: LlmFilePurpose;
|
|
391
|
+
readonly status: "uploaded" | "processed" | "error";
|
|
392
|
+
readonly expires_at?: number;
|
|
393
|
+
};
|
|
394
|
+
type LlmFileDeleted = {
|
|
395
|
+
readonly id: string;
|
|
396
|
+
readonly deleted: boolean;
|
|
397
|
+
readonly object: "file";
|
|
398
|
+
};
|
|
399
|
+
type LlmFileUploadSource = "files_api" | "prompt_inline_offload" | "tool_output_spill" | "provider_mirror";
|
|
400
|
+
type LlmFileUploadBackend = "openai" | "gemini" | "vertex";
|
|
401
|
+
type LlmFileUploadMode = "files.create" | "uploads" | "mirror";
|
|
402
|
+
type LlmFileUploadEvent = {
|
|
403
|
+
readonly timestamp: string;
|
|
404
|
+
readonly source: LlmFileUploadSource;
|
|
405
|
+
readonly backend: LlmFileUploadBackend;
|
|
406
|
+
readonly mode: LlmFileUploadMode;
|
|
407
|
+
readonly filename: string;
|
|
408
|
+
readonly bytes: number;
|
|
409
|
+
readonly durationMs: number;
|
|
410
|
+
readonly mimeType?: string;
|
|
411
|
+
readonly fileId?: string;
|
|
412
|
+
readonly mirrorId?: string;
|
|
413
|
+
readonly fileUri?: string;
|
|
414
|
+
};
|
|
415
|
+
type LlmFileUploadMetrics = {
|
|
416
|
+
readonly count: number;
|
|
417
|
+
readonly totalBytes: number;
|
|
418
|
+
readonly totalLatencyMs: number;
|
|
419
|
+
readonly events: readonly LlmFileUploadEvent[];
|
|
420
|
+
};
|
|
421
|
+
type LlmFileCreateParams = {
|
|
422
|
+
readonly path: string;
|
|
423
|
+
readonly filename?: string;
|
|
424
|
+
readonly mimeType?: string;
|
|
425
|
+
readonly purpose?: LlmFilePurpose;
|
|
426
|
+
readonly expiresAfterSeconds?: number;
|
|
427
|
+
} | {
|
|
428
|
+
readonly data: string | ArrayBuffer | ArrayBufferView;
|
|
429
|
+
readonly filename: string;
|
|
430
|
+
readonly mimeType?: string;
|
|
431
|
+
readonly purpose?: LlmFilePurpose;
|
|
432
|
+
readonly expiresAfterSeconds?: number;
|
|
433
|
+
};
|
|
434
|
+
declare function emptyFileUploadMetrics(): LlmFileUploadMetrics;
|
|
435
|
+
declare function filesCreate(params: LlmFileCreateParams): Promise<LlmStoredFile>;
|
|
436
|
+
declare function filesRetrieve(fileId: string): Promise<LlmStoredFile>;
|
|
437
|
+
declare function filesDelete(fileId: string): Promise<LlmFileDeleted>;
|
|
438
|
+
declare function filesContent(fileId: string): Promise<Response>;
|
|
439
|
+
declare const files: {
|
|
440
|
+
readonly create: typeof filesCreate;
|
|
441
|
+
readonly retrieve: typeof filesRetrieve;
|
|
442
|
+
readonly delete: typeof filesDelete;
|
|
443
|
+
readonly content: typeof filesContent;
|
|
444
|
+
};
|
|
445
|
+
|
|
377
446
|
/**
|
|
378
447
|
* Loads `.env.local` from `process.cwd()` once.
|
|
379
448
|
*
|
|
@@ -642,6 +711,9 @@ type AgentRunCompletedTelemetryEvent = AgentTelemetryBaseEvent & {
|
|
|
642
711
|
readonly toolCallCount?: number;
|
|
643
712
|
readonly totalCostUsd?: number;
|
|
644
713
|
readonly usage?: LlmUsageTokens;
|
|
714
|
+
readonly uploadCount?: number;
|
|
715
|
+
readonly uploadBytes?: number;
|
|
716
|
+
readonly uploadLatencyMs?: number;
|
|
645
717
|
readonly error?: string;
|
|
646
718
|
};
|
|
647
719
|
type AgentTelemetryEvent = AgentRunStartedTelemetryEvent | AgentRunStreamTelemetryEvent | AgentRunCompletedTelemetryEvent;
|
|
@@ -880,4 +952,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
|
|
|
880
952
|
declare function isFireworksModelId(value: string): value is FireworksModelId;
|
|
881
953
|
declare function resolveFireworksModelId(model: string): string | undefined;
|
|
882
954
|
|
|
883
|
-
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 AgentTelemetryConfig, type AgentTelemetryEvent, type AgentTelemetrySelection, type AgentTelemetrySink, 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, 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 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 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, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, 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, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
|
|
955
|
+
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 AgentTelemetryConfig, type AgentTelemetryEvent, type AgentTelemetrySelection, type AgentTelemetrySink, 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, 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 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 LlmModelEvent, type LlmModelId, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, 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, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, 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, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
|
package/dist/index.d.ts
CHANGED
|
@@ -32,12 +32,27 @@ type LlmInlineDataPart = {
|
|
|
32
32
|
type: "inlineData";
|
|
33
33
|
data: string;
|
|
34
34
|
mimeType?: string;
|
|
35
|
+
filename?: string;
|
|
36
|
+
};
|
|
37
|
+
type LlmInputImagePart = {
|
|
38
|
+
type: "input_image";
|
|
39
|
+
image_url?: string | null;
|
|
40
|
+
file_id?: string | null;
|
|
41
|
+
detail?: "auto" | "low" | "high";
|
|
42
|
+
filename?: string | null;
|
|
43
|
+
};
|
|
44
|
+
type LlmInputFilePart = {
|
|
45
|
+
type: "input_file";
|
|
46
|
+
file_data?: string | null;
|
|
47
|
+
file_id?: string | null;
|
|
48
|
+
file_url?: string | null;
|
|
49
|
+
filename?: string | null;
|
|
35
50
|
};
|
|
36
51
|
type LlmContentPart = {
|
|
37
52
|
type: "text";
|
|
38
53
|
text: string;
|
|
39
54
|
thought?: boolean;
|
|
40
|
-
} | LlmInlineDataPart;
|
|
55
|
+
} | LlmInlineDataPart | LlmInputImagePart | LlmInputFilePart;
|
|
41
56
|
type LlmContent = {
|
|
42
57
|
readonly role: LlmRole;
|
|
43
58
|
readonly parts: readonly LlmContentPart[];
|
|
@@ -45,17 +60,7 @@ type LlmContent = {
|
|
|
45
60
|
type LlmToolOutputContentItem = {
|
|
46
61
|
readonly type: "input_text";
|
|
47
62
|
readonly text: string;
|
|
48
|
-
} |
|
|
49
|
-
readonly type: "input_image";
|
|
50
|
-
readonly image_url: string;
|
|
51
|
-
readonly detail?: "auto";
|
|
52
|
-
} | {
|
|
53
|
-
readonly type: "input_file";
|
|
54
|
-
readonly file_data?: string | null;
|
|
55
|
-
readonly file_id?: string | null;
|
|
56
|
-
readonly file_url?: string | null;
|
|
57
|
-
readonly filename?: string | null;
|
|
58
|
-
};
|
|
63
|
+
} | LlmInputImagePart | LlmInputFilePart;
|
|
59
64
|
type LlmImageSize = "1K" | "2K" | "4K";
|
|
60
65
|
type LlmThinkingLevel = "low" | "medium" | "high";
|
|
61
66
|
type LlmWebSearchMode = "cached" | "live";
|
|
@@ -374,6 +379,70 @@ declare function stripCodexCitationMarkers(value: string): {
|
|
|
374
379
|
};
|
|
375
380
|
declare function appendMarkdownSourcesSection(value: string, sources: readonly string[]): string;
|
|
376
381
|
|
|
382
|
+
declare const DEFAULT_FILE_TTL_SECONDS: number;
|
|
383
|
+
type LlmFilePurpose = "user_data";
|
|
384
|
+
type LlmStoredFile = {
|
|
385
|
+
readonly id: string;
|
|
386
|
+
readonly bytes: number;
|
|
387
|
+
readonly created_at: number;
|
|
388
|
+
readonly filename: string;
|
|
389
|
+
readonly object: "file";
|
|
390
|
+
readonly purpose: LlmFilePurpose;
|
|
391
|
+
readonly status: "uploaded" | "processed" | "error";
|
|
392
|
+
readonly expires_at?: number;
|
|
393
|
+
};
|
|
394
|
+
type LlmFileDeleted = {
|
|
395
|
+
readonly id: string;
|
|
396
|
+
readonly deleted: boolean;
|
|
397
|
+
readonly object: "file";
|
|
398
|
+
};
|
|
399
|
+
type LlmFileUploadSource = "files_api" | "prompt_inline_offload" | "tool_output_spill" | "provider_mirror";
|
|
400
|
+
type LlmFileUploadBackend = "openai" | "gemini" | "vertex";
|
|
401
|
+
type LlmFileUploadMode = "files.create" | "uploads" | "mirror";
|
|
402
|
+
type LlmFileUploadEvent = {
|
|
403
|
+
readonly timestamp: string;
|
|
404
|
+
readonly source: LlmFileUploadSource;
|
|
405
|
+
readonly backend: LlmFileUploadBackend;
|
|
406
|
+
readonly mode: LlmFileUploadMode;
|
|
407
|
+
readonly filename: string;
|
|
408
|
+
readonly bytes: number;
|
|
409
|
+
readonly durationMs: number;
|
|
410
|
+
readonly mimeType?: string;
|
|
411
|
+
readonly fileId?: string;
|
|
412
|
+
readonly mirrorId?: string;
|
|
413
|
+
readonly fileUri?: string;
|
|
414
|
+
};
|
|
415
|
+
type LlmFileUploadMetrics = {
|
|
416
|
+
readonly count: number;
|
|
417
|
+
readonly totalBytes: number;
|
|
418
|
+
readonly totalLatencyMs: number;
|
|
419
|
+
readonly events: readonly LlmFileUploadEvent[];
|
|
420
|
+
};
|
|
421
|
+
type LlmFileCreateParams = {
|
|
422
|
+
readonly path: string;
|
|
423
|
+
readonly filename?: string;
|
|
424
|
+
readonly mimeType?: string;
|
|
425
|
+
readonly purpose?: LlmFilePurpose;
|
|
426
|
+
readonly expiresAfterSeconds?: number;
|
|
427
|
+
} | {
|
|
428
|
+
readonly data: string | ArrayBuffer | ArrayBufferView;
|
|
429
|
+
readonly filename: string;
|
|
430
|
+
readonly mimeType?: string;
|
|
431
|
+
readonly purpose?: LlmFilePurpose;
|
|
432
|
+
readonly expiresAfterSeconds?: number;
|
|
433
|
+
};
|
|
434
|
+
declare function emptyFileUploadMetrics(): LlmFileUploadMetrics;
|
|
435
|
+
declare function filesCreate(params: LlmFileCreateParams): Promise<LlmStoredFile>;
|
|
436
|
+
declare function filesRetrieve(fileId: string): Promise<LlmStoredFile>;
|
|
437
|
+
declare function filesDelete(fileId: string): Promise<LlmFileDeleted>;
|
|
438
|
+
declare function filesContent(fileId: string): Promise<Response>;
|
|
439
|
+
declare const files: {
|
|
440
|
+
readonly create: typeof filesCreate;
|
|
441
|
+
readonly retrieve: typeof filesRetrieve;
|
|
442
|
+
readonly delete: typeof filesDelete;
|
|
443
|
+
readonly content: typeof filesContent;
|
|
444
|
+
};
|
|
445
|
+
|
|
377
446
|
/**
|
|
378
447
|
* Loads `.env.local` from `process.cwd()` once.
|
|
379
448
|
*
|
|
@@ -642,6 +711,9 @@ type AgentRunCompletedTelemetryEvent = AgentTelemetryBaseEvent & {
|
|
|
642
711
|
readonly toolCallCount?: number;
|
|
643
712
|
readonly totalCostUsd?: number;
|
|
644
713
|
readonly usage?: LlmUsageTokens;
|
|
714
|
+
readonly uploadCount?: number;
|
|
715
|
+
readonly uploadBytes?: number;
|
|
716
|
+
readonly uploadLatencyMs?: number;
|
|
645
717
|
readonly error?: string;
|
|
646
718
|
};
|
|
647
719
|
type AgentTelemetryEvent = AgentRunStartedTelemetryEvent | AgentRunStreamTelemetryEvent | AgentRunCompletedTelemetryEvent;
|
|
@@ -880,4 +952,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
|
|
|
880
952
|
declare function isFireworksModelId(value: string): value is FireworksModelId;
|
|
881
953
|
declare function resolveFireworksModelId(model: string): string | undefined;
|
|
882
954
|
|
|
883
|
-
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 AgentTelemetryConfig, type AgentTelemetryEvent, type AgentTelemetrySelection, type AgentTelemetrySink, 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, 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 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 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, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, 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, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
|
|
955
|
+
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 AgentTelemetryConfig, type AgentTelemetryEvent, type AgentTelemetrySelection, type AgentTelemetrySink, 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, 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 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 LlmModelEvent, type LlmModelId, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, 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, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, 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, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool };
|