toolpack-sdk 2.6.0 → 2.7.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 +1 -0
- package/dist/index.cjs +135 -129
- package/dist/index.d.cts +92 -1
- package/dist/index.d.ts +92 -1
- package/dist/index.js +135 -129
- package/package.json +7 -6
package/dist/index.d.cts
CHANGED
|
@@ -242,6 +242,26 @@ interface ModeConfig {
|
|
|
242
242
|
* Shorthand for "no tool calls at all".
|
|
243
243
|
*/
|
|
244
244
|
blockAllTools: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Whether to auto-inject relevant skill content into the system prompt
|
|
247
|
+
* via BM25 matching of the user's message (skill interceptor).
|
|
248
|
+
* Default: false — opt-in only. Set to true to enable auto-injection.
|
|
249
|
+
*/
|
|
250
|
+
skillInterceptor?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Root directory for rule files.
|
|
253
|
+
* Auto-discovers:
|
|
254
|
+
* <rulesDir>/__global__/ → injected for all modes sharing this dir
|
|
255
|
+
* <rulesDir>/<mode-name>/ → injected for this mode only
|
|
256
|
+
* Defaults to '.toolpack/rules' if not set.
|
|
257
|
+
*/
|
|
258
|
+
rulesDir?: string;
|
|
259
|
+
/**
|
|
260
|
+
* When true, agent runs use provider.stream() instead of provider.generate().
|
|
261
|
+
* Keeps the TCP connection alive via incremental chunks, preventing NAT/proxy
|
|
262
|
+
* idle timeouts on long-running LLM calls (e.g. browser agent with large context).
|
|
263
|
+
*/
|
|
264
|
+
streaming?: boolean;
|
|
245
265
|
/**
|
|
246
266
|
* Response format constraint for all requests in this mode.
|
|
247
267
|
* - 'json_object': instructs the model to return valid JSON as its text content.
|
|
@@ -1253,11 +1273,13 @@ declare class AIClient extends EventEmitter {
|
|
|
1253
1273
|
private toolResultMaxChars;
|
|
1254
1274
|
private hitlConfig?;
|
|
1255
1275
|
private onToolConfirm?;
|
|
1276
|
+
/** @deprecated Internal use only — reads are unreliable under concurrent generate()/stream() calls. */
|
|
1256
1277
|
private currentRound;
|
|
1257
1278
|
private conversationId?;
|
|
1258
1279
|
private contextWindowConfig?;
|
|
1259
1280
|
private contextWindowStateManager?;
|
|
1260
1281
|
private providerModelCache;
|
|
1282
|
+
private ruleLoader;
|
|
1261
1283
|
constructor(config: AIClientConfig);
|
|
1262
1284
|
private getConversationId;
|
|
1263
1285
|
private getModelInfo;
|
|
@@ -1388,6 +1410,12 @@ declare class AIClient extends EventEmitter {
|
|
|
1388
1410
|
* For the "All" mode (empty systemPrompt), this is a no-op.
|
|
1389
1411
|
*/
|
|
1390
1412
|
private injectModeSystemPrompt;
|
|
1413
|
+
/**
|
|
1414
|
+
* Load and append rule content to the system prompt for the active mode.
|
|
1415
|
+
* Rules are always injected — appended after the mode system prompt so they
|
|
1416
|
+
* sit closest to the conversation (recency effect).
|
|
1417
|
+
*/
|
|
1418
|
+
private injectModeRules;
|
|
1391
1419
|
/**
|
|
1392
1420
|
* Inject the overriding system prompt (from AIClientConfig) into the request.
|
|
1393
1421
|
*/
|
|
@@ -1464,6 +1492,27 @@ declare class AnthropicAdapter extends ProviderAdapter {
|
|
|
1464
1492
|
private handleError;
|
|
1465
1493
|
}
|
|
1466
1494
|
|
|
1495
|
+
interface AnthropicVertexConfig {
|
|
1496
|
+
/** GCP project ID. Falls back to ANTHROPIC_VERTEX_PROJECT_ID / GOOGLE_CLOUD_PROJECT env vars. */
|
|
1497
|
+
projectId?: string;
|
|
1498
|
+
/** GCP region where Claude models are deployed. Defaults to 'us-east5'. */
|
|
1499
|
+
region?: string;
|
|
1500
|
+
}
|
|
1501
|
+
declare class AnthropicVertexAdapter extends ProviderAdapter {
|
|
1502
|
+
private client;
|
|
1503
|
+
constructor(config?: AnthropicVertexConfig);
|
|
1504
|
+
getDisplayName(): string;
|
|
1505
|
+
getModels(): Promise<ProviderModelInfo[]>;
|
|
1506
|
+
generate(request: CompletionRequest): Promise<CompletionResponse>;
|
|
1507
|
+
stream(request: CompletionRequest): AsyncGenerator<CompletionChunk>;
|
|
1508
|
+
embed(_request: EmbeddingRequest): Promise<EmbeddingResponse>;
|
|
1509
|
+
private sanitizeToolName;
|
|
1510
|
+
private restoreToolName;
|
|
1511
|
+
private toAnthropicMessages;
|
|
1512
|
+
private mapFinishReason;
|
|
1513
|
+
private handleError;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1467
1516
|
interface VertexAIConfig {
|
|
1468
1517
|
/** GCP project ID. Falls back to TOOLPACK_VERTEXAI_PROJECT or VERTEX_AI_PROJECT env vars. */
|
|
1469
1518
|
projectId?: string;
|
|
@@ -1480,10 +1529,19 @@ interface VertexAIConfig {
|
|
|
1480
1529
|
/** Inline service account credentials object. */
|
|
1481
1530
|
credentials?: Record<string, unknown>;
|
|
1482
1531
|
};
|
|
1532
|
+
/**
|
|
1533
|
+
* Thinking token budget for Gemini 2.5+ models.
|
|
1534
|
+
* Set to 0 to disable thinking entirely.
|
|
1535
|
+
* Omit to use the model's default budget.
|
|
1536
|
+
*/
|
|
1537
|
+
thinkingBudget?: number;
|
|
1483
1538
|
}
|
|
1484
1539
|
declare class VertexAIAdapter extends ProviderAdapter {
|
|
1485
1540
|
private ai;
|
|
1486
1541
|
private readonly location;
|
|
1542
|
+
private readonly thinkingBudget?;
|
|
1543
|
+
private readonly rawContentCache;
|
|
1544
|
+
private static readonly RAW_CONTENT_CACHE_MAX;
|
|
1487
1545
|
constructor(config?: VertexAIConfig);
|
|
1488
1546
|
getDisplayName(): string;
|
|
1489
1547
|
getModels(): Promise<ProviderModelInfo[]>;
|
|
@@ -2501,6 +2559,22 @@ declare function createMode(config: {
|
|
|
2501
2559
|
enabled: boolean;
|
|
2502
2560
|
};
|
|
2503
2561
|
};
|
|
2562
|
+
/**
|
|
2563
|
+
* Enable auto-injection of BM25-matched skill content into the system prompt.
|
|
2564
|
+
* Default: false — opt-in only.
|
|
2565
|
+
*/
|
|
2566
|
+
skillInterceptor?: boolean;
|
|
2567
|
+
/**
|
|
2568
|
+
* Root directory for rule files for this mode.
|
|
2569
|
+
* Auto-discovers __global__/ and <mode-name>/ subfolders within it.
|
|
2570
|
+
* Defaults to '.toolpack/rules' if not set.
|
|
2571
|
+
*/
|
|
2572
|
+
rulesDir?: string;
|
|
2573
|
+
/**
|
|
2574
|
+
* When true, agent runs use provider.stream() instead of provider.generate().
|
|
2575
|
+
* Prevents NAT/proxy idle timeouts on long-running LLM calls.
|
|
2576
|
+
*/
|
|
2577
|
+
streaming?: boolean;
|
|
2504
2578
|
}): ModeConfig;
|
|
2505
2579
|
|
|
2506
2580
|
/**
|
|
@@ -2925,6 +2999,10 @@ interface ProviderOptions {
|
|
|
2925
2999
|
keyFilename?: string;
|
|
2926
3000
|
credentials?: Record<string, unknown>;
|
|
2927
3001
|
};
|
|
3002
|
+
/** Vertex AI only: thinking token budget for Gemini 2.5+ models. Set to 0 to disable thinking. */
|
|
3003
|
+
thinkingBudget?: number;
|
|
3004
|
+
/** Anthropic Vertex only: GCP region where Claude models are deployed. Defaults to 'us-east5'. */
|
|
3005
|
+
region?: string;
|
|
2928
3006
|
}
|
|
2929
3007
|
interface ToolpackInitConfig {
|
|
2930
3008
|
/** Single provider shorthand (e.g. 'openai', 'anthropic', 'gemini') */
|
|
@@ -2945,6 +3023,10 @@ interface ToolpackInitConfig {
|
|
|
2945
3023
|
keyFilename?: string;
|
|
2946
3024
|
credentials?: Record<string, unknown>;
|
|
2947
3025
|
};
|
|
3026
|
+
/** Vertex AI only: thinking token budget for Gemini 2.5+ models. Set to 0 to disable thinking. */
|
|
3027
|
+
thinkingBudget?: number;
|
|
3028
|
+
/** Anthropic Vertex only: GCP region where Claude models are deployed. Defaults to 'us-east5'. */
|
|
3029
|
+
region?: string;
|
|
2948
3030
|
/** Load built-in tools (fs, http, etc.)? Default: false */
|
|
2949
3031
|
tools?: boolean;
|
|
2950
3032
|
/** Context window management configuration for automatic conversation pruning/summarization */
|
|
@@ -3726,4 +3808,13 @@ interface McpServerCapabilities {
|
|
|
3726
3808
|
|
|
3727
3809
|
declare function createSkillInterceptor(options?: SkillInterceptorOptions): ToolpackInterceptor;
|
|
3728
3810
|
|
|
3729
|
-
|
|
3811
|
+
declare class RuleLoader {
|
|
3812
|
+
private fileCache;
|
|
3813
|
+
private modeCache;
|
|
3814
|
+
loadForMode(modeName: string, rulesDir?: string): Promise<string>;
|
|
3815
|
+
private collectFromFolder;
|
|
3816
|
+
private collectRecursive;
|
|
3817
|
+
private readFileCached;
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
export { AGENT_MODE, AGENT_PLANNING_PROMPT, AGENT_WORKFLOW, AIClient, type AIClientConfig, type AddBypassRuleOptions, AnthropicAdapter, AnthropicVertexAdapter, type AnthropicVertexConfig, type AssembledPrompt, type AssemblerOptions, AuthenticationError, BM25SearchEngine, BUILT_IN_MODES, type BypassRuleType, CHAT_MODE, CHAT_WORKFLOW, CODING_MODE, CODING_PLANNING_PROMPT, CODING_WORKFLOW, CONFIG_DIR_NAME, CONFIG_FILE_NAME, type CompletionChunk, type CompletionOptions, type CompletionRequest, type CompletionResponse, type ConfirmationDecision, type ConfirmationLevel$1 as ConfirmationLevel, ConnectionError, type ContextPrunedEvent, type ContextWindowConfig, ContextWindowConfigError, ContextWindowExceededError, type ContextWindowExceededEvent, type ContextWindowState, ContextWindowStateManager, type ContextWindowStrategy, type ContextWindowWarningEvent, ConversationNotFoundError, type ConversationScope, type ConversationSearchOptions, type ConversationStore, type ConversationSummarizedEvent, DEFAULT_MODE_NAME, DEFAULT_TOOLS_CONFIG, DEFAULT_TOOL_SEARCH_CONFIG, DEFAULT_WORKFLOW, DEFAULT_WORKFLOW_CONFIG, type EmbeddingRequest, type EmbeddingResponse, type FileUploadRequest, type FileUploadResponse, GeminiAdapter, type GetOptions, type HitlConfig, type ImageDataPart, type ImageFilePart, type ImagePart, type ImageUrlPart, InMemoryConversationStore, type InMemoryConversationStoreConfig, InsufficientContextError, InvalidRequestError, type JsonRpcRequest, type JsonRpcResponse, type KnowledgeInstance, type McpAgentDefinition, type McpAuthConfig, McpClient, type McpClientConfig, McpConnectionError, type McpCustomAuthConfig, type McpJwtAuthConfig, type McpServerCapabilities, type McpServerConfig, type McpServerExposeConfig, type McpServerHandle, type McpStaticAuthConfig, McpTimeoutError, type McpTool, McpToolManager, type McpToolsConfig, type McpTransport, type MediaOptions, type MediaUploadStrategy, type Message, type MessageContent, type ModeBlockedHint, type ModeConfig, ModeRegistry, OllamaAdapter, type OllamaAdapterConfig, type OllamaModelInfo, OllamaProvider, type OllamaProviderEntry, type OnToolConfirmCallback, OpenAIAdapter, OpenRouterAdapter, type OpenRouterOptions, PageError, type Participant, type Plan, type PlanStep, Planner, type PromptMessage, ProviderAdapter, type ProviderConfig, ProviderError, type ProviderInfo, type ProviderModelInfo, type ProviderOptions, type PruneResult, RateLimitError, type RequestToolDefinition, type Role, RuleLoader, type RuntimeConfigStatus, SDKError, SQLiteConversationStore, type SQLiteConversationStoreConfig, type SearchHistoryEntry, type SearchOptions, type SearchResult, type Skill, type SkillInterceptorOptions, type SkillSection, type SkillToolsOptions, type SkillValidationMode, type SlmModelEntry, type StoredMessage, SummarizationError, type SummarizationOptions, type SummarizationResult, TOOLPACK_DIR_NAME, TOOL_SEARCH_NAME, type TextPart, TimeoutError, type ToolAnnotations, type ToolCall, type ToolCallFunction, type ToolCallMessage, type ToolCallRequest, type ToolCallResult, type ToolCategory, type ToolConfirmation, type ToolConfirmationRequestedEvent, type ToolConfirmationResolvedEvent, type ToolContext, type ToolDefinition, ToolDiscoveryCache, type ToolLogEvent, type ToolParameterProperty, type ToolParameters, type ToolProgressEvent, type ToolProject, type ToolProjectDependencies, type ToolProjectManifest, ToolRegistry, type ToolResult, ToolRouter, type ToolSchema, type ToolSearchConfig, Toolpack, type ToolpackConfig, type ToolpackInitConfig, type ToolpackInterceptor, type ToolpackMcpServerConfig, type ToolpackNextFunction, type ToolsConfig, type Usage, VertexAIAdapter, type VertexAIConfig, type WorkflowConfig, type WorkflowEvents, WorkflowExecutor, type WorkflowProgress, type WorkflowResult, addBypassRule, buildSummarizedHistory, cloudDeployTool, cloudListTool, cloudStatusTool, cloudToolsProject, codingExtractFunctionTool, codingFindReferencesTool, codingFindSymbolTool, codingGetCallHierarchyTool, codingGetDiagnosticsTool, codingGetExportsTool, codingGetImportsTool, codingGetOutlineTool, codingGetSymbolsTool, codingGoToDefinitionTool, codingMultiFileEditTool, codingRefactorRenameTool, codingToolsProject, countTokens, createContextWindowStateManager, createMcpToolProject, createMode, createSkillInterceptor, createSkillTools, createSummarizationReport, createSummarySystemMessage, createToolProject, dbCountTool, dbDeleteTool, dbInsertTool, dbQueryTool, dbSchemaTool, dbTablesTool, dbToolsProject, dbUpdateTool, diffApplyTool, diffCreateTool, diffPreviewTool, diffToolsProject, disconnectMcpToolProject, ensureGlobalConfigDir, ensureLocalConfigDir, estimateSummaryTokens, estimateTokenCount, execKillTool, execListProcessesTool, execReadOutputTool, execRunBackgroundTool, execRunBlockingTool, execRunShellTool, execRunTool, execTailOutputTool, execToolsProject, extractConversationKeypoints, fetchUrlAsBase64, fsAppendFileTool, fsBatchReadTool, fsBatchWriteTool, fsCopyTool, fsCreateDirTool, fsDeleteDirTool, fsDeleteFileTool, fsExistsTool, fsGlobTool, fsListDirTool, fsMoveTool, fsReadFileRangeTool, fsReadFileTool, fsReplaceInFileTool, fsSearchTool, fsStatTool, fsToolsProject, fsTreeTool, fsWriteFileTool, generateSummarizationPrompt, generateToolCategoriesPrompt, getContextWindowPercentage, getDefaultSlmModel, getGlobalConfigDir, getGlobalConfigPath, getGlobalToolpackDir, getLocalConfigDir, getLocalConfigPath, getLocalToolpackDir, getMessageStats, getMimeType, getOllamaBaseUrl, getOllamaProviderEntries, getRegisteredSlmModels, getRuntimeConfigStatus, getSafeOutputReserve, getToolSearchSchema, getToolpackConfig, getUserHomeDir, gitAddTool, gitBlameTool, gitBranchCreateTool, gitBranchListTool, gitCheckoutTool, gitCloneTool, gitCommitTool, gitDiffTool, gitLogTool, gitStatusTool, gitToolsProject, githubContentsGetTextTool, githubGraphqlExecuteTool, githubIssuesCommentsCreateTool, githubPrDiffGetTool, githubPrFilesListTool, githubPrReviewCommentsReplyTool, githubPrReviewThreadsListTool, githubPrReviewThreadsResolveTool, githubPrReviewsSubmitTool, githubToolsProject, groupMessagesByRole, handleContextWindowError, httpDeleteTool, httpDownloadTool, httpGetTool, httpPostTool, httpPutTool, httpToolsProject, initializeGlobalConfigIfFirstRun, isContextWindowError, isDataUri, isRegisteredSlm, isToolSearchTool, k8sApplyManifestTool, k8sDeleteResourceTool, k8sDescribeTool, k8sGetConfigMapTool, k8sGetLogsTool, k8sGetNamespacesTool, k8sListDeploymentsTool, k8sListPodsTool, k8sListServicesTool, k8sSwitchContextTool, k8sToolsProject, k8sWaitForDeploymentTool, loadFullConfig, loadRuntimeConfig, loadToolsConfig, mergeSummarizationResults, normalizeImagePart, ollamaRequest, ollamaStream, parseDataUri, parseSummarizationResponse, prepareSummarizationRequest, pruneMessages, readFileAsBase64, reloadToolpackConfig, removeBypassRule, saveToolsConfig, slackAuthTestTool, slackChatPostEphemeralTool, slackChatPostMessageTool, slackConversationsHistoryTool, slackConversationsRepliesTool, slackReactionsAddTool, slackToolsProject, systemCwdTool, systemDiskUsageTool, systemEnvTool, systemInfoTool, systemSetEnvTool, systemToolsProject, toDataUri, toolSearchDefinition, truncateMessage, validateSummarizationResult, webExtractLinksTool, webFeedTool, webFetchTool, webMapTool, webMetadataTool, webScrapeTool, webScreenshotTool, webSearchTool, webSitemapTool, webToolsProject, wouldExceedContextWindow };
|
package/dist/index.d.ts
CHANGED
|
@@ -242,6 +242,26 @@ interface ModeConfig {
|
|
|
242
242
|
* Shorthand for "no tool calls at all".
|
|
243
243
|
*/
|
|
244
244
|
blockAllTools: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Whether to auto-inject relevant skill content into the system prompt
|
|
247
|
+
* via BM25 matching of the user's message (skill interceptor).
|
|
248
|
+
* Default: false — opt-in only. Set to true to enable auto-injection.
|
|
249
|
+
*/
|
|
250
|
+
skillInterceptor?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Root directory for rule files.
|
|
253
|
+
* Auto-discovers:
|
|
254
|
+
* <rulesDir>/__global__/ → injected for all modes sharing this dir
|
|
255
|
+
* <rulesDir>/<mode-name>/ → injected for this mode only
|
|
256
|
+
* Defaults to '.toolpack/rules' if not set.
|
|
257
|
+
*/
|
|
258
|
+
rulesDir?: string;
|
|
259
|
+
/**
|
|
260
|
+
* When true, agent runs use provider.stream() instead of provider.generate().
|
|
261
|
+
* Keeps the TCP connection alive via incremental chunks, preventing NAT/proxy
|
|
262
|
+
* idle timeouts on long-running LLM calls (e.g. browser agent with large context).
|
|
263
|
+
*/
|
|
264
|
+
streaming?: boolean;
|
|
245
265
|
/**
|
|
246
266
|
* Response format constraint for all requests in this mode.
|
|
247
267
|
* - 'json_object': instructs the model to return valid JSON as its text content.
|
|
@@ -1253,11 +1273,13 @@ declare class AIClient extends EventEmitter {
|
|
|
1253
1273
|
private toolResultMaxChars;
|
|
1254
1274
|
private hitlConfig?;
|
|
1255
1275
|
private onToolConfirm?;
|
|
1276
|
+
/** @deprecated Internal use only — reads are unreliable under concurrent generate()/stream() calls. */
|
|
1256
1277
|
private currentRound;
|
|
1257
1278
|
private conversationId?;
|
|
1258
1279
|
private contextWindowConfig?;
|
|
1259
1280
|
private contextWindowStateManager?;
|
|
1260
1281
|
private providerModelCache;
|
|
1282
|
+
private ruleLoader;
|
|
1261
1283
|
constructor(config: AIClientConfig);
|
|
1262
1284
|
private getConversationId;
|
|
1263
1285
|
private getModelInfo;
|
|
@@ -1388,6 +1410,12 @@ declare class AIClient extends EventEmitter {
|
|
|
1388
1410
|
* For the "All" mode (empty systemPrompt), this is a no-op.
|
|
1389
1411
|
*/
|
|
1390
1412
|
private injectModeSystemPrompt;
|
|
1413
|
+
/**
|
|
1414
|
+
* Load and append rule content to the system prompt for the active mode.
|
|
1415
|
+
* Rules are always injected — appended after the mode system prompt so they
|
|
1416
|
+
* sit closest to the conversation (recency effect).
|
|
1417
|
+
*/
|
|
1418
|
+
private injectModeRules;
|
|
1391
1419
|
/**
|
|
1392
1420
|
* Inject the overriding system prompt (from AIClientConfig) into the request.
|
|
1393
1421
|
*/
|
|
@@ -1464,6 +1492,27 @@ declare class AnthropicAdapter extends ProviderAdapter {
|
|
|
1464
1492
|
private handleError;
|
|
1465
1493
|
}
|
|
1466
1494
|
|
|
1495
|
+
interface AnthropicVertexConfig {
|
|
1496
|
+
/** GCP project ID. Falls back to ANTHROPIC_VERTEX_PROJECT_ID / GOOGLE_CLOUD_PROJECT env vars. */
|
|
1497
|
+
projectId?: string;
|
|
1498
|
+
/** GCP region where Claude models are deployed. Defaults to 'us-east5'. */
|
|
1499
|
+
region?: string;
|
|
1500
|
+
}
|
|
1501
|
+
declare class AnthropicVertexAdapter extends ProviderAdapter {
|
|
1502
|
+
private client;
|
|
1503
|
+
constructor(config?: AnthropicVertexConfig);
|
|
1504
|
+
getDisplayName(): string;
|
|
1505
|
+
getModels(): Promise<ProviderModelInfo[]>;
|
|
1506
|
+
generate(request: CompletionRequest): Promise<CompletionResponse>;
|
|
1507
|
+
stream(request: CompletionRequest): AsyncGenerator<CompletionChunk>;
|
|
1508
|
+
embed(_request: EmbeddingRequest): Promise<EmbeddingResponse>;
|
|
1509
|
+
private sanitizeToolName;
|
|
1510
|
+
private restoreToolName;
|
|
1511
|
+
private toAnthropicMessages;
|
|
1512
|
+
private mapFinishReason;
|
|
1513
|
+
private handleError;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1467
1516
|
interface VertexAIConfig {
|
|
1468
1517
|
/** GCP project ID. Falls back to TOOLPACK_VERTEXAI_PROJECT or VERTEX_AI_PROJECT env vars. */
|
|
1469
1518
|
projectId?: string;
|
|
@@ -1480,10 +1529,19 @@ interface VertexAIConfig {
|
|
|
1480
1529
|
/** Inline service account credentials object. */
|
|
1481
1530
|
credentials?: Record<string, unknown>;
|
|
1482
1531
|
};
|
|
1532
|
+
/**
|
|
1533
|
+
* Thinking token budget for Gemini 2.5+ models.
|
|
1534
|
+
* Set to 0 to disable thinking entirely.
|
|
1535
|
+
* Omit to use the model's default budget.
|
|
1536
|
+
*/
|
|
1537
|
+
thinkingBudget?: number;
|
|
1483
1538
|
}
|
|
1484
1539
|
declare class VertexAIAdapter extends ProviderAdapter {
|
|
1485
1540
|
private ai;
|
|
1486
1541
|
private readonly location;
|
|
1542
|
+
private readonly thinkingBudget?;
|
|
1543
|
+
private readonly rawContentCache;
|
|
1544
|
+
private static readonly RAW_CONTENT_CACHE_MAX;
|
|
1487
1545
|
constructor(config?: VertexAIConfig);
|
|
1488
1546
|
getDisplayName(): string;
|
|
1489
1547
|
getModels(): Promise<ProviderModelInfo[]>;
|
|
@@ -2501,6 +2559,22 @@ declare function createMode(config: {
|
|
|
2501
2559
|
enabled: boolean;
|
|
2502
2560
|
};
|
|
2503
2561
|
};
|
|
2562
|
+
/**
|
|
2563
|
+
* Enable auto-injection of BM25-matched skill content into the system prompt.
|
|
2564
|
+
* Default: false — opt-in only.
|
|
2565
|
+
*/
|
|
2566
|
+
skillInterceptor?: boolean;
|
|
2567
|
+
/**
|
|
2568
|
+
* Root directory for rule files for this mode.
|
|
2569
|
+
* Auto-discovers __global__/ and <mode-name>/ subfolders within it.
|
|
2570
|
+
* Defaults to '.toolpack/rules' if not set.
|
|
2571
|
+
*/
|
|
2572
|
+
rulesDir?: string;
|
|
2573
|
+
/**
|
|
2574
|
+
* When true, agent runs use provider.stream() instead of provider.generate().
|
|
2575
|
+
* Prevents NAT/proxy idle timeouts on long-running LLM calls.
|
|
2576
|
+
*/
|
|
2577
|
+
streaming?: boolean;
|
|
2504
2578
|
}): ModeConfig;
|
|
2505
2579
|
|
|
2506
2580
|
/**
|
|
@@ -2925,6 +2999,10 @@ interface ProviderOptions {
|
|
|
2925
2999
|
keyFilename?: string;
|
|
2926
3000
|
credentials?: Record<string, unknown>;
|
|
2927
3001
|
};
|
|
3002
|
+
/** Vertex AI only: thinking token budget for Gemini 2.5+ models. Set to 0 to disable thinking. */
|
|
3003
|
+
thinkingBudget?: number;
|
|
3004
|
+
/** Anthropic Vertex only: GCP region where Claude models are deployed. Defaults to 'us-east5'. */
|
|
3005
|
+
region?: string;
|
|
2928
3006
|
}
|
|
2929
3007
|
interface ToolpackInitConfig {
|
|
2930
3008
|
/** Single provider shorthand (e.g. 'openai', 'anthropic', 'gemini') */
|
|
@@ -2945,6 +3023,10 @@ interface ToolpackInitConfig {
|
|
|
2945
3023
|
keyFilename?: string;
|
|
2946
3024
|
credentials?: Record<string, unknown>;
|
|
2947
3025
|
};
|
|
3026
|
+
/** Vertex AI only: thinking token budget for Gemini 2.5+ models. Set to 0 to disable thinking. */
|
|
3027
|
+
thinkingBudget?: number;
|
|
3028
|
+
/** Anthropic Vertex only: GCP region where Claude models are deployed. Defaults to 'us-east5'. */
|
|
3029
|
+
region?: string;
|
|
2948
3030
|
/** Load built-in tools (fs, http, etc.)? Default: false */
|
|
2949
3031
|
tools?: boolean;
|
|
2950
3032
|
/** Context window management configuration for automatic conversation pruning/summarization */
|
|
@@ -3726,4 +3808,13 @@ interface McpServerCapabilities {
|
|
|
3726
3808
|
|
|
3727
3809
|
declare function createSkillInterceptor(options?: SkillInterceptorOptions): ToolpackInterceptor;
|
|
3728
3810
|
|
|
3729
|
-
|
|
3811
|
+
declare class RuleLoader {
|
|
3812
|
+
private fileCache;
|
|
3813
|
+
private modeCache;
|
|
3814
|
+
loadForMode(modeName: string, rulesDir?: string): Promise<string>;
|
|
3815
|
+
private collectFromFolder;
|
|
3816
|
+
private collectRecursive;
|
|
3817
|
+
private readFileCached;
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
export { AGENT_MODE, AGENT_PLANNING_PROMPT, AGENT_WORKFLOW, AIClient, type AIClientConfig, type AddBypassRuleOptions, AnthropicAdapter, AnthropicVertexAdapter, type AnthropicVertexConfig, type AssembledPrompt, type AssemblerOptions, AuthenticationError, BM25SearchEngine, BUILT_IN_MODES, type BypassRuleType, CHAT_MODE, CHAT_WORKFLOW, CODING_MODE, CODING_PLANNING_PROMPT, CODING_WORKFLOW, CONFIG_DIR_NAME, CONFIG_FILE_NAME, type CompletionChunk, type CompletionOptions, type CompletionRequest, type CompletionResponse, type ConfirmationDecision, type ConfirmationLevel$1 as ConfirmationLevel, ConnectionError, type ContextPrunedEvent, type ContextWindowConfig, ContextWindowConfigError, ContextWindowExceededError, type ContextWindowExceededEvent, type ContextWindowState, ContextWindowStateManager, type ContextWindowStrategy, type ContextWindowWarningEvent, ConversationNotFoundError, type ConversationScope, type ConversationSearchOptions, type ConversationStore, type ConversationSummarizedEvent, DEFAULT_MODE_NAME, DEFAULT_TOOLS_CONFIG, DEFAULT_TOOL_SEARCH_CONFIG, DEFAULT_WORKFLOW, DEFAULT_WORKFLOW_CONFIG, type EmbeddingRequest, type EmbeddingResponse, type FileUploadRequest, type FileUploadResponse, GeminiAdapter, type GetOptions, type HitlConfig, type ImageDataPart, type ImageFilePart, type ImagePart, type ImageUrlPart, InMemoryConversationStore, type InMemoryConversationStoreConfig, InsufficientContextError, InvalidRequestError, type JsonRpcRequest, type JsonRpcResponse, type KnowledgeInstance, type McpAgentDefinition, type McpAuthConfig, McpClient, type McpClientConfig, McpConnectionError, type McpCustomAuthConfig, type McpJwtAuthConfig, type McpServerCapabilities, type McpServerConfig, type McpServerExposeConfig, type McpServerHandle, type McpStaticAuthConfig, McpTimeoutError, type McpTool, McpToolManager, type McpToolsConfig, type McpTransport, type MediaOptions, type MediaUploadStrategy, type Message, type MessageContent, type ModeBlockedHint, type ModeConfig, ModeRegistry, OllamaAdapter, type OllamaAdapterConfig, type OllamaModelInfo, OllamaProvider, type OllamaProviderEntry, type OnToolConfirmCallback, OpenAIAdapter, OpenRouterAdapter, type OpenRouterOptions, PageError, type Participant, type Plan, type PlanStep, Planner, type PromptMessage, ProviderAdapter, type ProviderConfig, ProviderError, type ProviderInfo, type ProviderModelInfo, type ProviderOptions, type PruneResult, RateLimitError, type RequestToolDefinition, type Role, RuleLoader, type RuntimeConfigStatus, SDKError, SQLiteConversationStore, type SQLiteConversationStoreConfig, type SearchHistoryEntry, type SearchOptions, type SearchResult, type Skill, type SkillInterceptorOptions, type SkillSection, type SkillToolsOptions, type SkillValidationMode, type SlmModelEntry, type StoredMessage, SummarizationError, type SummarizationOptions, type SummarizationResult, TOOLPACK_DIR_NAME, TOOL_SEARCH_NAME, type TextPart, TimeoutError, type ToolAnnotations, type ToolCall, type ToolCallFunction, type ToolCallMessage, type ToolCallRequest, type ToolCallResult, type ToolCategory, type ToolConfirmation, type ToolConfirmationRequestedEvent, type ToolConfirmationResolvedEvent, type ToolContext, type ToolDefinition, ToolDiscoveryCache, type ToolLogEvent, type ToolParameterProperty, type ToolParameters, type ToolProgressEvent, type ToolProject, type ToolProjectDependencies, type ToolProjectManifest, ToolRegistry, type ToolResult, ToolRouter, type ToolSchema, type ToolSearchConfig, Toolpack, type ToolpackConfig, type ToolpackInitConfig, type ToolpackInterceptor, type ToolpackMcpServerConfig, type ToolpackNextFunction, type ToolsConfig, type Usage, VertexAIAdapter, type VertexAIConfig, type WorkflowConfig, type WorkflowEvents, WorkflowExecutor, type WorkflowProgress, type WorkflowResult, addBypassRule, buildSummarizedHistory, cloudDeployTool, cloudListTool, cloudStatusTool, cloudToolsProject, codingExtractFunctionTool, codingFindReferencesTool, codingFindSymbolTool, codingGetCallHierarchyTool, codingGetDiagnosticsTool, codingGetExportsTool, codingGetImportsTool, codingGetOutlineTool, codingGetSymbolsTool, codingGoToDefinitionTool, codingMultiFileEditTool, codingRefactorRenameTool, codingToolsProject, countTokens, createContextWindowStateManager, createMcpToolProject, createMode, createSkillInterceptor, createSkillTools, createSummarizationReport, createSummarySystemMessage, createToolProject, dbCountTool, dbDeleteTool, dbInsertTool, dbQueryTool, dbSchemaTool, dbTablesTool, dbToolsProject, dbUpdateTool, diffApplyTool, diffCreateTool, diffPreviewTool, diffToolsProject, disconnectMcpToolProject, ensureGlobalConfigDir, ensureLocalConfigDir, estimateSummaryTokens, estimateTokenCount, execKillTool, execListProcessesTool, execReadOutputTool, execRunBackgroundTool, execRunBlockingTool, execRunShellTool, execRunTool, execTailOutputTool, execToolsProject, extractConversationKeypoints, fetchUrlAsBase64, fsAppendFileTool, fsBatchReadTool, fsBatchWriteTool, fsCopyTool, fsCreateDirTool, fsDeleteDirTool, fsDeleteFileTool, fsExistsTool, fsGlobTool, fsListDirTool, fsMoveTool, fsReadFileRangeTool, fsReadFileTool, fsReplaceInFileTool, fsSearchTool, fsStatTool, fsToolsProject, fsTreeTool, fsWriteFileTool, generateSummarizationPrompt, generateToolCategoriesPrompt, getContextWindowPercentage, getDefaultSlmModel, getGlobalConfigDir, getGlobalConfigPath, getGlobalToolpackDir, getLocalConfigDir, getLocalConfigPath, getLocalToolpackDir, getMessageStats, getMimeType, getOllamaBaseUrl, getOllamaProviderEntries, getRegisteredSlmModels, getRuntimeConfigStatus, getSafeOutputReserve, getToolSearchSchema, getToolpackConfig, getUserHomeDir, gitAddTool, gitBlameTool, gitBranchCreateTool, gitBranchListTool, gitCheckoutTool, gitCloneTool, gitCommitTool, gitDiffTool, gitLogTool, gitStatusTool, gitToolsProject, githubContentsGetTextTool, githubGraphqlExecuteTool, githubIssuesCommentsCreateTool, githubPrDiffGetTool, githubPrFilesListTool, githubPrReviewCommentsReplyTool, githubPrReviewThreadsListTool, githubPrReviewThreadsResolveTool, githubPrReviewsSubmitTool, githubToolsProject, groupMessagesByRole, handleContextWindowError, httpDeleteTool, httpDownloadTool, httpGetTool, httpPostTool, httpPutTool, httpToolsProject, initializeGlobalConfigIfFirstRun, isContextWindowError, isDataUri, isRegisteredSlm, isToolSearchTool, k8sApplyManifestTool, k8sDeleteResourceTool, k8sDescribeTool, k8sGetConfigMapTool, k8sGetLogsTool, k8sGetNamespacesTool, k8sListDeploymentsTool, k8sListPodsTool, k8sListServicesTool, k8sSwitchContextTool, k8sToolsProject, k8sWaitForDeploymentTool, loadFullConfig, loadRuntimeConfig, loadToolsConfig, mergeSummarizationResults, normalizeImagePart, ollamaRequest, ollamaStream, parseDataUri, parseSummarizationResponse, prepareSummarizationRequest, pruneMessages, readFileAsBase64, reloadToolpackConfig, removeBypassRule, saveToolsConfig, slackAuthTestTool, slackChatPostEphemeralTool, slackChatPostMessageTool, slackConversationsHistoryTool, slackConversationsRepliesTool, slackReactionsAddTool, slackToolsProject, systemCwdTool, systemDiskUsageTool, systemEnvTool, systemInfoTool, systemSetEnvTool, systemToolsProject, toDataUri, toolSearchDefinition, truncateMessage, validateSummarizationResult, webExtractLinksTool, webFeedTool, webFetchTool, webMapTool, webMetadataTool, webScrapeTool, webScreenshotTool, webSearchTool, webSitemapTool, webToolsProject, wouldExceedContextWindow };
|