toolpack-sdk 2.1.1 → 2.2.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,4 +1,7 @@
1
+ import * as zod from 'zod';
1
2
  import { EventEmitter } from 'events';
3
+ import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
4
+ export { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
2
5
 
3
6
  /**
4
7
  * Core type definitions for the Tool Calling System.
@@ -26,6 +29,45 @@ interface ToolContext {
26
29
  /** Scoped logger — writes to toolpack-sdk.log */
27
30
  log: (message: string) => void;
28
31
  }
32
+ /**
33
+ * Hints about tool behaviour sent to MCP clients in tools/list.
34
+ * All fields are optional — clients use them for safety UX (e.g. confirmation
35
+ * dialogs before destructive actions) but must not rely on them for security.
36
+ *
37
+ * MCP spec defaults when annotations are omitted entirely:
38
+ * readOnlyHint: false, destructiveHint: true, openWorldHint: true, idempotentHint: false
39
+ *
40
+ * The MCP server auto-derives annotations when this field is not set:
41
+ * - confirmation present → { destructiveHint: true }
42
+ * - neither set → annotations omitted (MCP spec defaults apply)
43
+ * Set explicitly to override.
44
+ */
45
+ interface ToolAnnotations {
46
+ /**
47
+ * Tool only reads data — never writes, calls APIs, or modifies state.
48
+ * MCP spec default (when absent): false.
49
+ * Set to true for pure read tools: fs.read_file, search, list-dir.
50
+ */
51
+ readOnlyHint?: boolean;
52
+ /**
53
+ * Tool may cause irreversible side-effects (delete, overwrite, deploy, send).
54
+ * MCP spec default (when absent): true — clients assume worst case.
55
+ * Set to false for safe write operations (e.g. create-if-not-exists).
56
+ */
57
+ destructiveHint?: boolean;
58
+ /**
59
+ * Calling the tool multiple times with the same args has no additional effect.
60
+ * MCP spec default (when absent): false.
61
+ * Set to true for idempotent operations.
62
+ */
63
+ idempotentHint?: boolean;
64
+ /**
65
+ * Tool may interact with external systems: web, APIs, databases, shell, filesystem.
66
+ * MCP spec default (when absent): true.
67
+ * Set to false only for purely in-process, local tools with no side-effects.
68
+ */
69
+ openWorldHint?: boolean;
70
+ }
29
71
  type ConfirmationLevel$1 = 'high' | 'medium';
30
72
  interface ToolConfirmation {
31
73
  level: ConfirmationLevel$1;
@@ -51,6 +93,15 @@ interface ToolDefinition {
51
93
  * Note: Only effective when onToolConfirm callback is provided to AIClient.
52
94
  */
53
95
  confirmation?: ToolConfirmation;
96
+ /**
97
+ * MCP annotation hints describing tool behaviour to clients.
98
+ * When omitted, the MCP server auto-derives from `confirmation`:
99
+ * - confirmation set → { destructiveHint: true }
100
+ * - no confirmation → annotations omitted (MCP spec defaults apply)
101
+ * Set explicitly to override — particularly useful for marking read-only tools
102
+ * (readOnlyHint: true) or idempotent tools (idempotentHint: true).
103
+ */
104
+ annotations?: ToolAnnotations;
54
105
  }
55
106
  /**
56
107
  * Schema-only version of ToolDefinition (no execute function).
@@ -68,6 +119,8 @@ interface ToolSchema {
68
119
  * Default: true
69
120
  */
70
121
  cacheable?: boolean;
122
+ /** MCP annotation hints. See ToolAnnotations for details. */
123
+ annotations?: ToolAnnotations;
71
124
  }
72
125
  interface ToolProjectManifest {
73
126
  key: string;
@@ -227,13 +280,30 @@ interface ToolCallResult {
227
280
  result?: string;
228
281
  duration?: number;
229
282
  }
230
- interface CompletionRequest {
283
+ interface CompletionRequest<T = unknown> {
231
284
  messages: Message[];
232
285
  model: string;
233
286
  temperature?: number;
234
287
  max_tokens?: number;
235
288
  top_p?: number;
236
- response_format?: 'text' | 'json_object';
289
+ /**
290
+ * Controls the output format:
291
+ * - `'text'` — plain text (default)
292
+ * - `'json_object'` — unstructured JSON; you parse `response.content` yourself
293
+ * - `ZodType<T>` — structured JSON matching the schema; parsed and validated result
294
+ * available in `response.data` as fully typed `T`
295
+ *
296
+ * @example structured output
297
+ * ```typescript
298
+ * import { z } from 'zod'
299
+ * const result = await sdk.generate({
300
+ * messages,
301
+ * response_format: z.object({ sentiment: z.string(), score: z.number() }),
302
+ * })
303
+ * result.data.sentiment // typed as string
304
+ * ```
305
+ */
306
+ response_format?: 'text' | 'json_object' | zod.ZodType<T>;
237
307
  stream?: boolean;
238
308
  tools?: ToolCallRequest[];
239
309
  requestTools?: RequestToolDefinition[];
@@ -255,8 +325,14 @@ interface Usage {
255
325
  completion_tokens?: number;
256
326
  total_tokens: number;
257
327
  }
258
- interface CompletionResponse {
328
+ interface CompletionResponse<T = unknown> {
259
329
  content: string | null;
330
+ /**
331
+ * Parsed and validated structured output.
332
+ * Only present when `response_format` is a ZodType.
333
+ * TypeScript type is inferred from the schema via the generic on `generate<T>()`.
334
+ */
335
+ data?: T;
260
336
  usage?: Usage;
261
337
  /** Detailed breakdown of token usage when executed in agent/workflow mode */
262
338
  usage_details?: {
@@ -1251,7 +1327,7 @@ declare class AIClient extends EventEmitter {
1251
1327
  * When tools are enabled and autoExecute is true, handles the full
1252
1328
  * tool call → execute → send result → get final answer loop.
1253
1329
  */
1254
- generate(request: CompletionRequest, providerName?: string): Promise<CompletionResponse>;
1330
+ generate<T = unknown>(request: CompletionRequest<T>, providerName?: string): Promise<CompletionResponse<T>>;
1255
1331
  /**
1256
1332
  * unified stream completion
1257
1333
  * When tools are enabled and autoExecute is true, handles tool calls
@@ -1314,7 +1390,7 @@ declare class AIClient extends EventEmitter {
1314
1390
  /**
1315
1391
  * Execute tool.search using BM25 engine.
1316
1392
  */
1317
- private executeToolSearch;
1393
+ executeToolSearch(args: Record<string, any>): string;
1318
1394
  private wrapError;
1319
1395
  /**
1320
1396
  * Truncate a tool result to fit within the remaining round budget.
@@ -2072,8 +2148,12 @@ declare const execRunShellTool: ToolDefinition;
2072
2148
 
2073
2149
  declare const execRunBackgroundTool: ToolDefinition;
2074
2150
 
2151
+ declare const execRunBlockingTool: ToolDefinition;
2152
+
2075
2153
  declare const execReadOutputTool: ToolDefinition;
2076
2154
 
2155
+ declare const execTailOutputTool: ToolDefinition;
2156
+
2077
2157
  declare const execKillTool: ToolDefinition;
2078
2158
 
2079
2159
  declare const execListProcessesTool: ToolDefinition;
@@ -2588,6 +2668,210 @@ type ToolpackInterceptor = {
2588
2668
  init?(): Promise<void>;
2589
2669
  };
2590
2670
 
2671
+ type McpTransport = 'stdio' | 'http';
2672
+
2673
+ interface McpServerExposeConfig {
2674
+ /** Expose only tools in these categories. Mutually exclusive with `tools`. */
2675
+ categories?: string[];
2676
+ /** Expose only these exact tool names. Mutually exclusive with `categories`. */
2677
+ tools?: string[];
2678
+ }
2679
+ interface McpStaticAuthConfig {
2680
+ mode: 'static';
2681
+ /**
2682
+ * One or more pre-shared bearer tokens that grant access.
2683
+ * Generate with: crypto.randomBytes(32).toString('hex')
2684
+ * All tokens in the array are valid — useful for token rotation.
2685
+ */
2686
+ tokens: string[];
2687
+ }
2688
+ interface McpJwtAuthConfig {
2689
+ mode: 'jwt';
2690
+ /**
2691
+ * JWKS endpoint URL for JWT signature verification.
2692
+ * @example 'https://your-tenant.auth0.com/.well-known/jwks.json'
2693
+ * @example 'https://your-project.supabase.co/auth/v1/jwks'
2694
+ */
2695
+ jwksUrl: string;
2696
+ /**
2697
+ * Expected `aud` claim in the JWT.
2698
+ * Required for most OIDC providers — omitting may accept tokens intended for other services.
2699
+ */
2700
+ audience?: string;
2701
+ /**
2702
+ * Expected `iss` claim in the JWT. Recommended.
2703
+ * Also used to populate the `authorization_servers` field in
2704
+ * /.well-known/oauth-protected-resource when serverUrl is set.
2705
+ */
2706
+ issuer?: string;
2707
+ /** JWT must have all of these scopes. Checked after signature verification. */
2708
+ requiredScopes?: string[];
2709
+ }
2710
+ interface McpCustomAuthConfig {
2711
+ mode: 'custom';
2712
+ /**
2713
+ * Your own token verification logic.
2714
+ * Throw any error to reject the token — the caller receives a 401.
2715
+ * Return a valid AuthInfo on success.
2716
+ *
2717
+ * @example
2718
+ * ```typescript
2719
+ * verifyAccessToken: async (token) => {
2720
+ * const user = await db.findByToken(token);
2721
+ * if (!user) throw new Error('Invalid token');
2722
+ * return { token, clientId: user.id, scopes: user.scopes };
2723
+ * }
2724
+ * ```
2725
+ */
2726
+ verifyAccessToken(token: string): Promise<AuthInfo>;
2727
+ /** Token must have all of these scopes. Checked after verifyAccessToken resolves. */
2728
+ requiredScopes?: string[];
2729
+ }
2730
+ type McpAuthConfig = McpStaticAuthConfig | McpJwtAuthConfig | McpCustomAuthConfig;
2731
+ /**
2732
+ * Minimal contract for exposing an agent as an MCP tool.
2733
+ * Satisfied by McpChannel.asAgentDefinition() from toolpack-agents,
2734
+ * or by any plain object with these four fields.
2735
+ */
2736
+ interface McpAgentDefinition {
2737
+ /** Exposed as "agent.<name>" in tools/list. Must be unique across all agents. */
2738
+ name: string;
2739
+ /** Shown to the MCP client as the tool description. */
2740
+ description: string;
2741
+ /** JSON Schema for the arguments the agent accepts. Defaults to empty object schema. */
2742
+ inputSchema?: Record<string, unknown>;
2743
+ /**
2744
+ * Called when tools/call arrives for this agent.
2745
+ * Must return the agent's output as a string.
2746
+ * Throw to signal an error — the MCP client receives isError: true.
2747
+ */
2748
+ invoke(args: Record<string, unknown>): Promise<string>;
2749
+ }
2750
+ interface ToolpackMcpServerConfig {
2751
+ /** Transport type. 'stdio' for Claude Desktop / Cursor. 'http' for remote use. */
2752
+ transport: McpTransport;
2753
+ /** Port for HTTP transport. Default: 3000. Only used when transport is 'http'. */
2754
+ port?: number;
2755
+ /** Filter which tools to expose. Exposes all enabled tools when omitted. */
2756
+ expose?: McpServerExposeConfig;
2757
+ /** Server name shown to MCP clients. Default: 'Toolpack SDK'. */
2758
+ serverName?: string;
2759
+ /** Server version shown to MCP clients. Default: '2.0.0'. */
2760
+ serverVersion?: string;
2761
+ /**
2762
+ * Authentication for the HTTP transport. Ignored when transport is 'stdio'.
2763
+ *
2764
+ * When omitted, the HTTP server accepts all requests — safe for localhost only.
2765
+ * When set, every request must carry a valid Bearer token; missing or invalid
2766
+ * tokens are rejected with 401. Scope violations are rejected with 403.
2767
+ *
2768
+ * @example Static tokens (dev / self-hosted)
2769
+ * ```typescript
2770
+ * auth: { mode: 'static', tokens: [process.env.MCP_TOKEN!] }
2771
+ * ```
2772
+ *
2773
+ * @example JWT with Auth0 / Supabase / Clerk
2774
+ * ```typescript
2775
+ * auth: {
2776
+ * mode: 'jwt',
2777
+ * jwksUrl: 'https://your-tenant.auth0.com/.well-known/jwks.json',
2778
+ * audience: 'https://your-mcp-server.example.com',
2779
+ * issuer: 'https://your-tenant.auth0.com/',
2780
+ * }
2781
+ * ```
2782
+ *
2783
+ * @example Custom verification
2784
+ * ```typescript
2785
+ * auth: {
2786
+ * mode: 'custom',
2787
+ * verifyAccessToken: async (token) => {
2788
+ * const user = await db.findByToken(token);
2789
+ * if (!user) throw new Error('invalid');
2790
+ * return { token, clientId: user.id, scopes: user.scopes };
2791
+ * }
2792
+ * }
2793
+ * ```
2794
+ */
2795
+ auth?: McpAuthConfig;
2796
+ /**
2797
+ * Agents to expose as MCP tools alongside regular tools.
2798
+ * Each agent appears in tools/list as "agent.<name>".
2799
+ *
2800
+ * Agents run to completion before returning — synchronous from the MCP
2801
+ * client's perspective. For long-running agents, ensure the MCP client's
2802
+ * timeout is set appropriately.
2803
+ *
2804
+ * The easiest way to produce an entry is via McpChannel.asAgentDefinition()
2805
+ * from toolpack-agents. A plain object with { name, description, invoke }
2806
+ * also works — no import from toolpack-agents required.
2807
+ *
2808
+ * @example using McpChannel (toolpack-agents)
2809
+ * ```typescript
2810
+ * const ch = new McpChannel();
2811
+ * const agent = new PrReviewerAgent({ channels: [ch] });
2812
+ * await agent.start();
2813
+ * await sdk.startMcpServer({
2814
+ * transport: 'stdio',
2815
+ * agents: [ch.asAgentDefinition(agent)],
2816
+ * });
2817
+ * ```
2818
+ *
2819
+ * @example plain object (no extra dependency)
2820
+ * ```typescript
2821
+ * await sdk.startMcpServer({
2822
+ * transport: 'stdio',
2823
+ * agents: [{
2824
+ * name: 'pr_reviewer',
2825
+ * description: 'Reviews a pull request end-to-end.',
2826
+ * inputSchema: { type: 'object', properties: { pr_url: { type: 'string' } }, required: ['pr_url'] },
2827
+ * invoke: async (args) => {
2828
+ * const result = await prReviewer.invokeAgent({ data: args });
2829
+ * return result.output;
2830
+ * },
2831
+ * }],
2832
+ * });
2833
+ * ```
2834
+ */
2835
+ agents?: McpAgentDefinition[];
2836
+ /**
2837
+ * Enable tool search mode.
2838
+ *
2839
+ * When true, tools/list returns only `tool.search` plus any always-loaded tools
2840
+ * configured in ToolSearchConfig (alwaysLoadedTools / alwaysLoadedCategories).
2841
+ * MCP clients call `tool.search` first to discover tools on-demand, dramatically
2842
+ * reducing context token usage for registries with 110+ tools.
2843
+ *
2844
+ * Requires the system prompt to instruct the client to use tool.search.
2845
+ * See docs/examples/mcp-server-example.ts for the recommended prompt snippet.
2846
+ *
2847
+ * Default: false — all enabled tools sent upfront.
2848
+ */
2849
+ searchMode?: boolean;
2850
+ /**
2851
+ * Public base URL of this MCP server (e.g. 'https://mcp.example.com').
2852
+ * Only used when auth.mode is 'jwt'.
2853
+ *
2854
+ * When provided alongside jwt auth, the server mounts
2855
+ * /.well-known/oauth-protected-resource so MCP clients can
2856
+ * auto-discover which OAuth server issues tokens for this server.
2857
+ *
2858
+ * Ignored for static and custom auth modes.
2859
+ */
2860
+ serverUrl?: string;
2861
+ }
2862
+ interface McpServerHandle {
2863
+ /** Stop the MCP server and release all resources. */
2864
+ stop(): Promise<void>;
2865
+ /** Number of tools currently exposed. */
2866
+ toolCount: number;
2867
+ /**
2868
+ * Actual bound port (HTTP transport only). Useful when port:0 is passed and
2869
+ * the OS assigns a free port — integration tests read this to know where to connect.
2870
+ * Always 0 for stdio transport.
2871
+ */
2872
+ port: number;
2873
+ }
2874
+
2591
2875
  interface ProviderOptions {
2592
2876
  /**
2593
2877
  * API key for the provider.
@@ -2793,6 +3077,67 @@ declare class Toolpack extends EventEmitter {
2793
3077
  * Validates dependencies and registers all tools.
2794
3078
  */
2795
3079
  loadToolProject(project: ToolProject): Promise<void>;
3080
+ /**
3081
+ * Expose Toolpack's built-in tools as an MCP server.
3082
+ *
3083
+ * Any MCP-compatible client (Claude Desktop, Cursor, Windsurf, custom agents)
3084
+ * can connect and use the full tool catalog without importing this SDK.
3085
+ *
3086
+ * Requires `@modelcontextprotocol/sdk` to be installed:
3087
+ * npm install @modelcontextprotocol/sdk
3088
+ *
3089
+ * @example stdio — Claude Desktop / Cursor
3090
+ * ```typescript
3091
+ * const sdk = await Toolpack.init({ provider: 'anthropic', tools: true });
3092
+ * await sdk.startMcpServer({ transport: 'stdio' });
3093
+ * ```
3094
+ *
3095
+ * @example HTTP — open (localhost only)
3096
+ * ```typescript
3097
+ * await sdk.startMcpServer({ transport: 'http', port: 3000 });
3098
+ * ```
3099
+ *
3100
+ * @example HTTP — with static bearer token auth (dev / self-hosted)
3101
+ * ```typescript
3102
+ * await sdk.startMcpServer({
3103
+ * transport: 'http',
3104
+ * port: 3000,
3105
+ * auth: { mode: 'static', tokens: [process.env.MCP_TOKEN!] },
3106
+ * });
3107
+ * ```
3108
+ *
3109
+ * @example HTTP — with JWT auth (Auth0 / Supabase / Clerk / any OIDC provider)
3110
+ * ```typescript
3111
+ * await sdk.startMcpServer({
3112
+ * transport: 'http',
3113
+ * port: 3000,
3114
+ * auth: {
3115
+ * mode: 'jwt',
3116
+ * jwksUrl: 'https://your-tenant.auth0.com/.well-known/jwks.json',
3117
+ * audience: 'https://your-mcp-server.example.com',
3118
+ * issuer: 'https://your-tenant.auth0.com/',
3119
+ * },
3120
+ * serverUrl: 'https://your-mcp-server.example.com',
3121
+ * });
3122
+ * ```
3123
+ *
3124
+ * @example expose only specific categories
3125
+ * ```typescript
3126
+ * await sdk.startMcpServer({
3127
+ * transport: 'stdio',
3128
+ * expose: { categories: ['filesystem', 'github', 'slack'] },
3129
+ * });
3130
+ * ```
3131
+ *
3132
+ * @example search mode — reduces context token usage for 110+ tools
3133
+ * ```typescript
3134
+ * // tools/list returns only tool.search; clients discover tools on-demand.
3135
+ * // Add this to your system prompt:
3136
+ * // "Use tool.search to discover tools before calling them."
3137
+ * await sdk.startMcpServer({ transport: 'stdio', searchMode: true });
3138
+ * ```
3139
+ */
3140
+ startMcpServer(config: ToolpackMcpServerConfig): Promise<McpServerHandle>;
2796
3141
  /**
2797
3142
  * Convenience method to get a flat list of all models across all providers.
2798
3143
  */
@@ -3346,4 +3691,4 @@ interface McpServerCapabilities {
3346
3691
 
3347
3692
  declare function createSkillInterceptor(options?: SkillInterceptorOptions): ToolpackInterceptor;
3348
3693
 
3349
- export { AGENT_MODE, AGENT_PLANNING_PROMPT, AGENT_WORKFLOW, AIClient, type AIClientConfig, type AddBypassRuleOptions, AnthropicAdapter, 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, McpClient, type McpClientConfig, McpConnectionError, type McpServerCapabilities, type McpServerConfig, McpTimeoutError, type McpTool, McpToolManager, type McpToolsConfig, 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, 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 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 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, execRunShellTool, execRunTool, 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 };
3694
+ export { AGENT_MODE, AGENT_PLANNING_PROMPT, AGENT_WORKFLOW, AIClient, type AIClientConfig, type AddBypassRuleOptions, AnthropicAdapter, 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, 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 };