toolpack-sdk 2.7.0 → 3.0.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/dist/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ChildProcess } from 'child_process';
1
2
  import * as zod from 'zod';
2
3
  import { EventEmitter } from 'events';
3
4
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
@@ -171,113 +172,49 @@ interface WorkflowResult {
171
172
  }
172
173
 
173
174
  /**
174
- * Configuration for an AI agent mode.
175
- * A mode shapes AI behavior by controlling which tools are available
176
- * and injecting a persona-specific system prompt.
175
+ * GitHub token resolution for toolpack github-tools.
176
+ *
177
+ * Resolution order (first match wins):
178
+ * 1. Explicit token passed by the caller (args.token)
179
+ * 2. GITHUB_PAT environment variable
180
+ * 3. GitHub App installation token — minted from GITHUB_APP_ID +
181
+ * GITHUB_APP_PRIVATE_KEY; installationId is looked up via the
182
+ * repo name when not supplied directly.
183
+ *
184
+ * Tokens are cached by installationId (50-minute TTL; GitHub tokens last 60).
177
185
  */
178
- interface ModeConfig {
179
- /** Unique identifier for the mode (e.g., "all", "ask", "code") */
180
- name: string;
181
- /** Human-readable display name (e.g., "All", "Ask", "Code") */
182
- displayName: string;
183
- /** Short description for UI tooltips */
184
- description: string;
185
- /**
186
- * System prompt prepended to every request in this mode.
187
- * Empty string means no system prompt injection (passthrough).
188
- */
189
- systemPrompt: string;
190
- /**
191
- * Base agent context configuration for this mode.
192
- * Controls whether working directory and tool categories are injected into system prompt.
193
- *
194
- * - undefined: Use global default behavior (include everything)
195
- * - false: Disable base context entirely
196
- * - object: Fine-grained control over what is included
197
- */
198
- baseContext?: {
199
- /** Include working directory in system prompt. Default: true */
200
- includeWorkingDirectory?: boolean;
201
- /** Include available tool categories. Default: true */
202
- includeToolCategories?: boolean;
203
- /** Custom base context string (overrides auto-generated). */
204
- custom?: string;
205
- } | false;
206
- /** Workflow configuration controlling planning, steps, and progress. */
207
- workflow?: WorkflowConfig;
208
- /**
209
- * Tool search configuration specific to this mode.
210
- * Overrides or extends the global toolSearch config.
211
- */
212
- toolSearch?: {
213
- /** Enable/disable tool search for this mode */
214
- enabled?: boolean;
215
- /** Tools to always include (never defer) for this mode */
216
- alwaysLoadedTools?: string[];
217
- /** Categories to always include for this mode */
218
- alwaysLoadedCategories?: string[];
219
- };
220
- /**
221
- * Tool categories allowed in this mode.
222
- * Empty array means all categories are allowed (unless blocked).
223
- */
224
- allowedToolCategories: string[];
225
- /**
226
- * Tool categories explicitly blocked in this mode.
227
- * Takes precedence over allowedToolCategories.
228
- */
229
- blockedToolCategories: string[];
230
- /**
231
- * Specific tool names allowed in this mode.
232
- * Empty array means all tools are allowed (unless blocked).
233
- */
234
- allowedTools: string[];
235
- /**
236
- * Specific tool names explicitly blocked in this mode.
237
- * Takes precedence over allowedTools.
238
- */
239
- blockedTools: string[];
240
- /**
241
- * If true, ALL tools are blocked regardless of other settings.
242
- * Shorthand for "no tool calls at all".
243
- */
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;
265
- /**
266
- * Response format constraint for all requests in this mode.
267
- * - 'json_object': instructs the model to return valid JSON as its text content.
268
- * Useful for evaluator/parser agents whose final response must be machine-readable.
269
- * Tool-call rounds are unaffected — the model still returns functionCall parts
270
- * normally; the format only applies to text content.
271
- * - 'text' (default): plain text, no constraint.
272
- */
273
- response_format?: 'text' | 'json_object';
186
+ declare class GithubTokenStore {
187
+ private tokenCache;
188
+ private installationIdCache;
189
+ resolve(repo?: string, explicitToken?: string, credentials?: ToolpackCredentials): Promise<string>;
190
+ private _lookupInstallationId;
191
+ private _mintInstallationToken;
274
192
  }
275
- /**
276
- * A lightweight reference to a mode, used in tool-blocked hints.
277
- */
278
- interface ModeBlockedHint {
279
- blockedToolNames: string[];
280
- suggestedMode: string;
193
+
194
+ interface ManagedProcess {
195
+ id: string;
196
+ command: string;
197
+ cwd?: string;
198
+ process: ChildProcess;
199
+ startedAt: string;
200
+ stdout: string;
201
+ stderr: string;
202
+ }
203
+ declare class ProcessRegistry {
204
+ private processes;
205
+ private nextId;
206
+ register(command: string, cwd: string | undefined, proc: ChildProcess): string;
207
+ get(id: string): ManagedProcess | undefined;
208
+ kill(id: string): boolean;
209
+ list(): {
210
+ id: string;
211
+ command: string;
212
+ cwd?: string;
213
+ startedAt: string;
214
+ alive: boolean;
215
+ pid: number | undefined;
216
+ }[];
217
+ remove(id: string): boolean;
281
218
  }
282
219
 
283
220
  /**
@@ -298,13 +235,38 @@ interface ToolParameters {
298
235
  properties: Record<string, ToolParameterProperty>;
299
236
  required?: string[];
300
237
  }
238
+ /**
239
+ * Per-tenant tool credentials passed via toolsConfig.additionalConfigurations.credentials.
240
+ * Each field is a programmatic override; tools fall back to the corresponding
241
+ * env var when the field is absent.
242
+ */
243
+ interface ToolpackCredentials {
244
+ /** GitHub personal access token. Fallback: GITHUB_PAT */
245
+ githubPat?: string;
246
+ /** GitHub App ID. Fallback: GITHUB_APP_ID */
247
+ githubAppId?: string;
248
+ /** GitHub App private key (PEM). Fallback: GITHUB_APP_PRIVATE_KEY */
249
+ githubAppPrivateKey?: string;
250
+ /** Slack bot token. Fallback: TOOLPACK_SLACK_BOT_TOKEN */
251
+ slackBotToken?: string;
252
+ /** Netlify auth token. Fallback: NETLIFY_AUTH_TOKEN */
253
+ netlifyAuthToken?: string;
254
+ }
301
255
  interface ToolContext {
302
256
  /** Absolute path to the workspace/project root */
303
257
  workspaceRoot: string;
304
- /** Tool-specific config from toolpack.config.json additionalConfigurations */
258
+ /**
259
+ * Tool-specific config from toolsConfig.additionalConfigurations.
260
+ * Includes credentials (ctx.config.credentials) and per-tool settings
261
+ * (ctx.config.gitClone, ctx.config.webSearch, etc.).
262
+ */
305
263
  config: Record<string, any>;
306
264
  /** Scoped logger — writes to toolpack-sdk.log */
307
265
  log: (message: string) => void;
266
+ /** Per-tenant background-process registry (exec-tools). */
267
+ processRegistry?: ProcessRegistry;
268
+ /** Per-tenant GitHub App installation-token cache (github-tools). */
269
+ githubTokenStore?: GithubTokenStore;
308
270
  }
309
271
  /**
310
272
  * Hints about tool behaviour sent to MCP clients in tools/list.
@@ -463,6 +425,128 @@ interface ToolsConfig {
463
425
  declare const DEFAULT_TOOL_SEARCH_CONFIG: ToolSearchConfig;
464
426
  declare const DEFAULT_TOOLS_CONFIG: ToolsConfig;
465
427
 
428
+ /**
429
+ * Configuration for an AI agent mode.
430
+ * A mode shapes AI behavior by controlling which tools are available
431
+ * and injecting a persona-specific system prompt.
432
+ */
433
+ interface ModeConfig {
434
+ /** Unique identifier for the mode (e.g., "all", "ask", "code") */
435
+ name: string;
436
+ /** Human-readable display name (e.g., "All", "Ask", "Code") */
437
+ displayName: string;
438
+ /** Short description for UI tooltips */
439
+ description: string;
440
+ /**
441
+ * System prompt prepended to every request in this mode.
442
+ * Empty string means no system prompt injection (passthrough).
443
+ */
444
+ systemPrompt: string;
445
+ /**
446
+ * Base agent context configuration for this mode.
447
+ * Controls whether working directory and tool categories are injected into system prompt.
448
+ *
449
+ * - undefined: Use global default behavior (include everything)
450
+ * - false: Disable base context entirely
451
+ * - object: Fine-grained control over what is included
452
+ */
453
+ baseContext?: {
454
+ /** Include working directory in system prompt. Default: true */
455
+ includeWorkingDirectory?: boolean;
456
+ /** Include available tool categories. Default: true */
457
+ includeToolCategories?: boolean;
458
+ /** Custom base context string (overrides auto-generated). */
459
+ custom?: string;
460
+ } | false;
461
+ /** Workflow configuration controlling planning, steps, and progress. */
462
+ workflow?: WorkflowConfig;
463
+ /**
464
+ * Tool search configuration specific to this mode.
465
+ * Overrides or extends the global toolSearch config.
466
+ */
467
+ toolSearch?: {
468
+ /** Enable/disable tool search for this mode */
469
+ enabled?: boolean;
470
+ /** Tools to always include (never defer) for this mode */
471
+ alwaysLoadedTools?: string[];
472
+ /** Categories to always include for this mode */
473
+ alwaysLoadedCategories?: string[];
474
+ };
475
+ /**
476
+ * Tool categories allowed in this mode.
477
+ * Empty array means all categories are allowed (unless blocked).
478
+ */
479
+ allowedToolCategories: string[];
480
+ /**
481
+ * Tool categories explicitly blocked in this mode.
482
+ * Takes precedence over allowedToolCategories.
483
+ */
484
+ blockedToolCategories: string[];
485
+ /**
486
+ * Specific tool names allowed in this mode.
487
+ * Empty array means all tools are allowed (unless blocked).
488
+ */
489
+ allowedTools: string[];
490
+ /**
491
+ * Specific tool names explicitly blocked in this mode.
492
+ * Takes precedence over allowedTools.
493
+ */
494
+ blockedTools: string[];
495
+ /**
496
+ * If true, ALL tools are blocked regardless of other settings.
497
+ * Shorthand for "no tool calls at all".
498
+ */
499
+ blockAllTools: boolean;
500
+ /**
501
+ * Whether to auto-inject relevant skill content into the system prompt
502
+ * via BM25 matching of the user's message (skill interceptor).
503
+ * Default: false — opt-in only. Set to true to enable auto-injection.
504
+ */
505
+ skillInterceptor?: boolean;
506
+ /**
507
+ * Root directory for rule files.
508
+ * Auto-discovers:
509
+ * <rulesDir>/__global__/ → injected for all modes sharing this dir
510
+ * <rulesDir>/<mode-name>/ → injected for this mode only
511
+ * Defaults to '.toolpack/rules' if not set.
512
+ */
513
+ rulesDir?: string;
514
+ /**
515
+ * When true, agent runs use provider.stream() instead of provider.generate().
516
+ * Keeps the TCP connection alive via incremental chunks, preventing NAT/proxy
517
+ * idle timeouts on long-running LLM calls (e.g. browser agent with large context).
518
+ */
519
+ streaming?: boolean;
520
+ /**
521
+ * Response format constraint for all requests in this mode.
522
+ * - 'json_object': instructs the model to return valid JSON as its text content.
523
+ * Useful for evaluator/parser agents whose final response must be machine-readable.
524
+ * Tool-call rounds are unaffected — the model still returns functionCall parts
525
+ * normally; the format only applies to text content.
526
+ * - 'text' (default): plain text, no constraint.
527
+ */
528
+ response_format?: 'text' | 'json_object';
529
+ /**
530
+ * Tools available only in this mode/agent.
531
+ * Resolved before the shared ToolRegistry — allows agent-specific tools
532
+ * without registering them globally.
533
+ */
534
+ customTools?: ToolDefinition[];
535
+ /**
536
+ * Tool behavior overrides for this mode/agent.
537
+ * Merged over the Toolpack-level ToolsConfig at request time.
538
+ * Use for per-agent autoExecute, maxToolRounds, resultMaxChars, etc.
539
+ */
540
+ toolsConfig?: Partial<ToolsConfig>;
541
+ }
542
+ /**
543
+ * A lightweight reference to a mode, used in tool-blocked hints.
544
+ */
545
+ interface ModeBlockedHint {
546
+ blockedToolNames: string[];
547
+ suggestedMode: string;
548
+ }
549
+
466
550
  type Role = 'system' | 'user' | 'assistant' | 'tool';
467
551
  interface TextPart {
468
552
  type: 'text';
@@ -546,7 +630,8 @@ interface RequestToolDefinition {
546
630
  description: string;
547
631
  parameters: Record<string, any>;
548
632
  category: string;
549
- execute: (args: Record<string, any>) => Promise<any>;
633
+ /** Same optional `ctx` as ToolDefinition.execute per-tenant credentials/runtime scoping. */
634
+ execute: (args: Record<string, any>, ctx?: ToolContext) => Promise<any>;
550
635
  cacheable?: boolean;
551
636
  confirmation?: ToolConfirmation;
552
637
  }
@@ -1010,6 +1095,27 @@ declare abstract class ProviderAdapter {
1010
1095
  countTokens(_messages: Message[], _model: string): Promise<number | null>;
1011
1096
  }
1012
1097
 
1098
+ interface CloneEntry {
1099
+ cloneDir: string;
1100
+ repo: string;
1101
+ sha: string;
1102
+ sizeBytes: number;
1103
+ lastAccessedAt: number;
1104
+ }
1105
+ declare class CloneState {
1106
+ readonly registry: Map<string, CloneEntry>;
1107
+ readonly mutexes: Map<string, Promise<void>>;
1108
+ totalBytes: number;
1109
+ acquireMutex(repo: string): Promise<() => void>;
1110
+ evictIfNeeded(requiredBytes: number, maxBytes: number): Promise<void>;
1111
+ }
1112
+
1113
+ declare class ToolRuntimeContext {
1114
+ readonly processRegistry: ProcessRegistry;
1115
+ readonly cloneState: CloneState;
1116
+ readonly githubTokenStore: GithubTokenStore;
1117
+ }
1118
+
1013
1119
  /**
1014
1120
  * Central registry for all tools (built-in + custom).
1015
1121
  * Handles registration, lookup, filtering by category, schema extraction,
@@ -1019,6 +1125,8 @@ declare class ToolRegistry {
1019
1125
  private tools;
1020
1126
  private projects;
1021
1127
  private config;
1128
+ /** Scoped runtime state created by loadBuiltIn(). Undefined when built-in tools are not loaded. */
1129
+ runtimeContext?: ToolRuntimeContext;
1022
1130
  /**
1023
1131
  * Register a tool (built-in or custom).
1024
1132
  */
@@ -1171,7 +1279,11 @@ interface ToolpackConfig {
1171
1279
  /** Context window management configuration for automatic conversation pruning/summarization */
1172
1280
  contextWindow?: ContextWindowConfig;
1173
1281
  }
1282
+ /**
1283
+ * @deprecated Pass config directly to Toolpack.init(). File-based config is no longer read by the SDK.
1284
+ */
1174
1285
  declare function getToolpackConfig(configPath?: string): ToolpackConfig;
1286
+ /** @deprecated No-op. The process-global config cache has been removed. */
1175
1287
  declare function reloadToolpackConfig(): void;
1176
1288
  interface OllamaProviderEntry {
1177
1289
  /** Provider type key, e.g. 'ollama-llama3' */
@@ -1273,13 +1385,12 @@ declare class AIClient extends EventEmitter {
1273
1385
  private toolResultMaxChars;
1274
1386
  private hitlConfig?;
1275
1387
  private onToolConfirm?;
1276
- /** @deprecated Internal use only — reads are unreliable under concurrent generate()/stream() calls. */
1277
- private currentRound;
1278
1388
  private conversationId?;
1279
1389
  private contextWindowConfig?;
1280
1390
  private contextWindowStateManager?;
1281
1391
  private providerModelCache;
1282
1392
  private ruleLoader;
1393
+ private requestSeq;
1283
1394
  constructor(config: AIClientConfig);
1284
1395
  private getConversationId;
1285
1396
  private getModelInfo;
@@ -1382,6 +1493,7 @@ declare class AIClient extends EventEmitter {
1382
1493
  * tool loop is immune to concurrent `setMode()` calls on this instance.
1383
1494
  */
1384
1495
  private enrichRequestWithTools;
1496
+ private toolDefinitionsToSchemas;
1385
1497
  private buildRequestToolMap;
1386
1498
  private requestToolToSchema;
1387
1499
  private mergeSchemas;
@@ -1399,6 +1511,7 @@ declare class AIClient extends EventEmitter {
1399
1511
  * owns the mode registry) before reaching the client; if an unresolved
1400
1512
  * name gets here, warn and fall back to the activeMode snapshot
1401
1513
  */
1514
+ private newRequestId;
1402
1515
  private resolveRequestMode;
1403
1516
  /**
1404
1517
  * Filter tool schemas based on mode permissions.
@@ -2165,11 +2278,13 @@ interface FullConfig {
2165
2278
  /**
2166
2279
  * Load the full config from toolpack.config.json.
2167
2280
  * Returns the entire parsed config object.
2281
+ * @deprecated Pass config directly to Toolpack.init(). File-based config is no longer read by the SDK.
2168
2282
  */
2169
2283
  declare function loadFullConfig(basePath?: string): FullConfig;
2170
2284
  /**
2171
2285
  * Load tools config from toolpack.config.json (tools section).
2172
2286
  * Falls back to defaults if the file doesn't exist or tools section is missing.
2287
+ * @deprecated Pass toolsConfig directly to Toolpack.init(). File-based config is no longer read by the SDK.
2173
2288
  */
2174
2289
  declare function loadToolsConfig(basePath?: string): ToolsConfig;
2175
2290
  /**
@@ -2753,6 +2868,18 @@ declare const CODING_WORKFLOW: WorkflowConfig;
2753
2868
  */
2754
2869
  declare const CHAT_WORKFLOW: WorkflowConfig;
2755
2870
 
2871
+ type LogLevel = 'error' | 'warn' | 'info' | 'debug' | 'trace';
2872
+ interface LoggingConfig {
2873
+ /** Enable file logging. Default: false */
2874
+ enabled?: boolean;
2875
+ /** Log file path. Default: '<cwd>/toolpack-sdk.log' */
2876
+ filePath?: string;
2877
+ /** Log level. Default: 'info' */
2878
+ level?: LogLevel;
2879
+ /** Mirror log output to console (stderr for error/warn, stdout for others). Default: false */
2880
+ console?: boolean;
2881
+ }
2882
+
2756
2883
  type ToolpackNextFunction = (request?: CompletionRequest) => Promise<CompletionResponse>;
2757
2884
  /**
2758
2885
  * An interceptor that wraps each `generate()` call.
@@ -3031,8 +3158,11 @@ interface ToolpackInitConfig {
3031
3158
  tools?: boolean;
3032
3159
  /** Context window management configuration for automatic conversation pruning/summarization */
3033
3160
  contextWindow?: ContextWindowConfig;
3034
- /** Custom tool projects to load in addition to built-ins */
3035
- customTools?: ToolProject[];
3161
+ /**
3162
+ * Tool runtime configuration (autoExecute, maxToolRounds, additionalConfigurations, etc.).
3163
+ * Merged over DEFAULT_TOOLS_CONFIG. Use ModeConfig.toolsConfig for per-agent overrides.
3164
+ */
3165
+ toolsConfig?: Partial<ToolsConfig>;
3036
3166
  /** Multi-provider config (overrides single provider settings) */
3037
3167
  providers?: Record<string, ProviderOptions>;
3038
3168
  /** Default provider to use if multiple are configured */
@@ -3041,8 +3171,6 @@ interface ToolpackInitConfig {
3041
3171
  customModes?: ModeConfig[];
3042
3172
  /** Default mode to activate on init (default: 'default') */
3043
3173
  defaultMode?: string;
3044
- /** Optional system prompt overrides for specific modes */
3045
- modeOverrides?: Record<string, Partial<ModeConfig>>;
3046
3174
  /**
3047
3175
  * Custom provider adapter instances.
3048
3176
  * Can be:
@@ -3052,11 +3180,6 @@ interface ToolpackInitConfig {
3052
3180
  customProviders?: ProviderAdapter[] | Record<string, ProviderAdapter>;
3053
3181
  /** Disable base agent context injection (for testing or custom prompts) */
3054
3182
  disableBaseContext?: boolean;
3055
- /**
3056
- * Optional path to a configuration file.
3057
- * If provided, the SDK will load configuration from this path instead of the default toolpack.config.json in the current working directory.
3058
- */
3059
- configPath?: string;
3060
3183
  mcp?: McpToolsConfig;
3061
3184
  /**
3062
3185
  * Optional Knowledge instance for RAG (Retrieval-Augmented Generation).
@@ -3092,6 +3215,16 @@ interface ToolpackInitConfig {
3092
3215
  * The workflow execution path (when a mode has planning enabled) is also unaffected.
3093
3216
  */
3094
3217
  interceptors?: ToolpackInterceptor[];
3218
+ /**
3219
+ * Logging configuration. Takes precedence over any value in toolpack.config.json.
3220
+ * Env vars (TOOLPACK_SDK_LOG_ENABLED, TOOLPACK_SDK_LOG_FILE, etc.) still override this.
3221
+ */
3222
+ logging?: LoggingConfig;
3223
+ /**
3224
+ * Human-in-the-loop configuration. Takes precedence over any value in toolpack.config.json.
3225
+ * Merged with confirmationMode and onToolConfirm — the most-specific setting wins.
3226
+ */
3227
+ hitl?: HitlConfig;
3095
3228
  }
3096
3229
  /**
3097
3230
  * Duck-typed interface for Knowledge instances to avoid circular dependency
@@ -3809,12 +3942,15 @@ interface McpServerCapabilities {
3809
3942
  declare function createSkillInterceptor(options?: SkillInterceptorOptions): ToolpackInterceptor;
3810
3943
 
3811
3944
  declare class RuleLoader {
3812
- private fileCache;
3945
+ private readonly cacheTtlMs;
3813
3946
  private modeCache;
3947
+ constructor(cacheTtlMs?: number);
3814
3948
  loadForMode(modeName: string, rulesDir?: string): Promise<string>;
3949
+ /** Evict all cached entries — useful in tests or after a known rule file change. */
3950
+ clearCache(): void;
3815
3951
  private collectFromFolder;
3816
3952
  private collectRecursive;
3817
- private readFileCached;
3953
+ private readFile;
3818
3954
  }
3819
3955
 
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 };
3956
+ 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 ToolpackCredentials, 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 };