@huyooo/ai-chat-core 0.2.14 → 0.2.15

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.ts CHANGED
@@ -1724,129 +1724,6 @@ declare const DEFAULT_MODEL: string;
1724
1724
  */
1725
1725
  declare function createDefaultToolExecutor(defaultCwd?: string): ToolExecutor$1;
1726
1726
 
1727
- /**
1728
- * 获取当前工作目录工具(Vite 插件风格)
1729
- */
1730
-
1731
- declare function getCwdTool(): ToolPlugin;
1732
-
1733
- /**
1734
- * 获取平台信息工具(Vite 插件风格)
1735
- */
1736
-
1737
- declare function getPlatformTool(): ToolPlugin;
1738
-
1739
- /**
1740
- * 执行命令工具(Vite 插件风格)
1741
- */
1742
-
1743
- declare function executeCommandTool(): ToolPlugin;
1744
-
1745
- /**
1746
- * 分析图片工具(Vite 插件风格)
1747
- */
1748
-
1749
- declare function analyzeImageTool(): ToolPlugin;
1750
-
1751
- /**
1752
- * 生成图片工具(Vite 插件风格)
1753
- */
1754
-
1755
- declare function generateImageTool(): ToolPlugin;
1756
-
1757
- /**
1758
- * 分析视频工具(Vite 插件风格)
1759
- */
1760
-
1761
- declare function analyzeVideoTool(): ToolPlugin;
1762
-
1763
- /**
1764
- * 天气查询工具(Vite 插件风格)
1765
- *
1766
- * 使用高德天气 API
1767
- * - 稳定可靠,国内服务
1768
- * - 支持全国 337 个地级市
1769
- * - 中文输出
1770
- *
1771
- * 返回数据格式匹配 @huyooo/ai-chat-shared 的 WeatherData 类型
1772
- */
1773
-
1774
- declare function getWeatherTool(): ToolPlugin;
1775
-
1776
- /**
1777
- * 显示 Toast 通知
1778
- */
1779
- declare function showToastTool(): ToolPlugin;
1780
-
1781
- /**
1782
- * 打开确认对话框
1783
- */
1784
- declare function openConfirmDialogTool(): ToolPlugin;
1785
-
1786
- /**
1787
- * 打开文件预览(由宿主 UI 消费 ui:file_preview 副作用实现)
1788
- */
1789
- declare function openFilePreviewTool(): ToolPlugin;
1790
-
1791
- /**
1792
- * 跳转到指定目录(由宿主 UI 消费 ui:navigate 副作用实现)
1793
- */
1794
- declare function navigateToDirectoryTool(): ToolPlugin;
1795
-
1796
- /**
1797
- * UI 动作工具集合(用于快速注入)
1798
- */
1799
- declare const uiActionTools: ToolPlugin[];
1800
-
1801
- /**
1802
- * 文档搜索工具集成
1803
- *
1804
- * 可选依赖 @huyooo/ai-search
1805
- * 如果未安装,工具会返回友好提示
1806
- *
1807
- * 注意:这个模块使用 eval + require 来避免 tsup 打包时解析依赖
1808
- */
1809
-
1810
- /**
1811
- * 搜索工具配置
1812
- */
1813
- interface SearchToolsOptions {
1814
- /** 搜索数据存储目录 */
1815
- dataDir?: string;
1816
- /** 默认索引目录(首次使用时自动索引) */
1817
- defaultDirectories?: string[];
1818
- /** 是否在初始化时自动索引 */
1819
- autoIndex?: boolean;
1820
- }
1821
- /**
1822
- * 创建文档搜索工具
1823
- *
1824
- * 如果 @huyooo/ai-search 未安装,返回占位工具(提示用户安装)
1825
- *
1826
- * @example
1827
- * ```typescript
1828
- * import { createDocumentSearchTools } from '@huyooo/ai-chat-core';
1829
- *
1830
- * const searchTools = await createDocumentSearchTools({
1831
- * dataDir: './.search-data',
1832
- * defaultDirectories: ['~/Documents'],
1833
- * });
1834
- *
1835
- * const agent = new HybridAgent({
1836
- * ...config,
1837
- * tools: [...otherTools, ...searchTools],
1838
- * });
1839
- * ```
1840
- */
1841
- declare function createDocumentSearchTools(options?: SearchToolsOptions): Promise<Tool[]>;
1842
- /**
1843
- * 获取搜索插件实例(高级用法)
1844
- */
1845
- declare function getDocumentSearchInstance(dataDir?: string, workspace?: string): Promise<{
1846
- tools: Tool[];
1847
- [key: string]: unknown;
1848
- } | null>;
1849
-
1850
1727
  /**
1851
1728
  * 调试日志工具
1852
1729
  *
@@ -1899,4 +1776,4 @@ declare const DebugLogger: {
1899
1776
  error: (module: string, message: string, data?: unknown) => void;
1900
1777
  };
1901
1778
 
1902
- export { type AbortEvent, type AdapterConfig, type AgentConfig, AnthropicProtocol, ArkProtocol, type AutoRunConfig$1 as AutoRunConfig, type AutoRunMode, CLAUDE_FAMILY, type ChatEvent, type ChatEventType, type ChatMessage, type ChatMode, type ChatOptions, ChatOrchestrator, DEEPSEEK_FAMILY, DEFAULT_MODEL, DOUBAO_FAMILY, DebugLogger, DeepSeekProtocol, type DoneEvent, type ErrorCategory, type ErrorDetails, type ErrorEvent, GEMINI_FAMILY, GPT_FAMILY, GeminiProtocol, HybridAgent, type ImageEvent, MODELS, MODEL_FAMILIES, MODEL_REGISTRY, type MediaEvent, type ModelFamilyConfig, type ModelFamilyId, type ModelOption, type ModelRegistryEntry, OpenAIProtocol, type OrchestratorConfig, type OrchestratorContext, type OrchestratorOptions, type ToolExecutor as OrchestratorToolExecutor, type Protocol, type ProtocolConfig, type ProtocolId, type ProtocolMessage, type ProtocolToolCall, type ProtocolToolDefinition, type ProviderAdapter, type ProviderType, QWEN_FAMILY, QwenProtocol, type RawEvent, type RawEventType, type RawSearchResult, type RawToolCall, type ResponsesApiTool, type RouteResult, type RuntimeConfig, type SearchEndEvent, type SearchEvent, type SearchResult, type SearchResultEvent, type SearchResultItem, type SearchStartEvent, type SearchStrategy, type SearchToolsOptions, type SideEffect$1 as SideEffect, type SimpleToolDefinition, type StandardMessage, type StatusEvent, type StepEndEvent, type StepEvent, type StepStartEvent, type StreamChunk, type StreamChunkType, type StreamOnceOptions, type StreamOptions, type StreamStartEvent, type TextDeltaEvent, type TextEvent, type ThinkingDeltaEvent, type ThinkingEndEvent, type ThinkingEvent, type ThinkingFormat, type ThinkingMode, type ThinkingStartEvent, type TokenUsage, type Tool, type ToolCallFormat, type ToolCallInfo, type ToolCallRequest, type ToolCallResultEvent, type ToolCallStartEvent, type ToolCallStatus, type ToolConfigItem, type ToolContext, type ToolDefinition, type ToolEvent, type ToolExecutor$1 as ToolExecutor, type ToolPlugin, type ToolResult, UnifiedAdapter, type UnifiedAdapterConfig, type VideoEvent, analyzeImageTool, analyzeVideoTool, createAbort, createAnthropicProtocol, createApiError, createArkProtocol, createDeepSeekProtocol, createDefaultToolExecutor, createDocumentSearchTools, createDone, createError, createGeminiProtocol, createImage, createOpenAIProtocol, createOrchestrator, createParseError, createQwenProtocol, createRateLimitError, createSearchEnd, createSearchResult, createSearchStart, createStepEnd, createStepStart, createStreamStart, createTextDelta, createThinkingDelta, createThinkingEnd, createThinkingStart, createTimeoutError, createToolCallResult, createToolCallStart, createToolError, createUnifiedAdapter, createVideo, executeCommandTool, generateImageTool, getCwdTool, getDefaultProvider, getDocumentSearchInstance, getModelByModelId, getModelEntry, getModelFamily, getModelProtocol, getModelSearchStrategy, getModelsByFamily, getModelsByProtocol, getPlatformTool, getVisibleModels, getWeatherTool, isAbortEvent, isErrorEvent, isMediaEvent, isModelForProvider, isRetryableError, isSearchEvent, isStatusEvent, isStepEvent, isTextEvent, isThinkingEvent, isToolEvent, modelSupportsNativeSearch, modelSupportsThinking, navigateToDirectoryTool, openConfirmDialogTool, openFilePreviewTool, resolveTools, routeModelToProvider, routeModelWithDetails, showToastTool, tool, tools, uiActionTools };
1779
+ export { type AbortEvent, type AdapterConfig, type AgentConfig, AnthropicProtocol, ArkProtocol, type AutoRunConfig$1 as AutoRunConfig, type AutoRunMode, CLAUDE_FAMILY, type ChatEvent, type ChatEventType, type ChatMessage, type ChatMode, type ChatOptions, ChatOrchestrator, DEEPSEEK_FAMILY, DEFAULT_MODEL, DOUBAO_FAMILY, DebugLogger, DeepSeekProtocol, type DoneEvent, type ErrorCategory, type ErrorDetails, type ErrorEvent, GEMINI_FAMILY, GPT_FAMILY, GeminiProtocol, HybridAgent, type ImageEvent, MODELS, MODEL_FAMILIES, MODEL_REGISTRY, type MediaEvent, type ModelFamilyConfig, type ModelFamilyId, type ModelOption, type ModelRegistryEntry, OpenAIProtocol, type OrchestratorConfig, type OrchestratorContext, type OrchestratorOptions, type ToolExecutor as OrchestratorToolExecutor, type Protocol, type ProtocolConfig, type ProtocolId, type ProtocolMessage, type ProtocolToolCall, type ProtocolToolDefinition, type ProviderAdapter, type ProviderType, QWEN_FAMILY, QwenProtocol, type RawEvent, type RawEventType, type RawSearchResult, type RawToolCall, type ResponsesApiTool, type RouteResult, type RuntimeConfig, type SearchEndEvent, type SearchEvent, type SearchResult, type SearchResultEvent, type SearchResultItem, type SearchStartEvent, type SearchStrategy, type SideEffect$1 as SideEffect, type SimpleToolDefinition, type StandardMessage, type StatusEvent, type StepEndEvent, type StepEvent, type StepStartEvent, type StreamChunk, type StreamChunkType, type StreamOnceOptions, type StreamOptions, type StreamStartEvent, type TextDeltaEvent, type TextEvent, type ThinkingDeltaEvent, type ThinkingEndEvent, type ThinkingEvent, type ThinkingFormat, type ThinkingMode, type ThinkingStartEvent, type TokenUsage, type Tool, type ToolCallFormat, type ToolCallInfo, type ToolCallRequest, type ToolCallResultEvent, type ToolCallStartEvent, type ToolCallStatus, type ToolConfigItem, type ToolContext, type ToolDefinition, type ToolEvent, type ToolExecutor$1 as ToolExecutor, type ToolPlugin, type ToolResult, UnifiedAdapter, type UnifiedAdapterConfig, type VideoEvent, createAbort, createAnthropicProtocol, createApiError, createArkProtocol, createDeepSeekProtocol, createDefaultToolExecutor, createDone, createError, createGeminiProtocol, createImage, createOpenAIProtocol, createOrchestrator, createParseError, createQwenProtocol, createRateLimitError, createSearchEnd, createSearchResult, createSearchStart, createStepEnd, createStepStart, createStreamStart, createTextDelta, createThinkingDelta, createThinkingEnd, createThinkingStart, createTimeoutError, createToolCallResult, createToolCallStart, createToolError, createUnifiedAdapter, createVideo, getDefaultProvider, getModelByModelId, getModelEntry, getModelFamily, getModelProtocol, getModelSearchStrategy, getModelsByFamily, getModelsByProtocol, getVisibleModels, isAbortEvent, isErrorEvent, isMediaEvent, isModelForProvider, isRetryableError, isSearchEvent, isStatusEvent, isStepEvent, isTextEvent, isThinkingEvent, isToolEvent, modelSupportsNativeSearch, modelSupportsThinking, resolveTools, routeModelToProvider, routeModelWithDetails, tool, tools };