mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 21:01:32 +08:00
chore: bump @cherrystudio/ai-core version to 1.0.0-alpha.2 and update exports
- Updated version in package.json to 1.0.0-alpha.2. - Added new path mapping for @cherrystudio/ai-core in tsconfig.web.json. - Refactored export paths in tsdown.config.ts and index.ts for consistency. - Cleaned up type exports in index.ts and types.ts for better organization.
This commit is contained in:
parent
0bc5e3d24d
commit
c3ad18b77e
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cherrystudio/ai-core",
|
||||
"version": "1.0.0-alpha.1",
|
||||
"version": "1.0.0-alpha.2",
|
||||
"description": "Cherry Studio AI Core - Unified AI Provider Interface Based on Vercel AI SDK",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
@ -137,12 +137,12 @@
|
||||
"require": "./dist/index.js",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"./core/plugins/built-in": {
|
||||
"types": "./dist/core/plugins/built-in/index.d.ts",
|
||||
"react-native": "./dist/core/plugins/built-in/index.js",
|
||||
"import": "./dist/core/plugins/built-in/index.mjs",
|
||||
"require": "./dist/core/plugins/built-in/index.js",
|
||||
"default": "./dist/core/plugins/built-in/index.js"
|
||||
"./built-in/plugins": {
|
||||
"types": "./dist/built-in/plugins/index.d.ts",
|
||||
"react-native": "./dist/built-in/plugins/index.js",
|
||||
"import": "./dist/built-in/plugins/index.mjs",
|
||||
"require": "./dist/built-in/plugins/index.js",
|
||||
"default": "./dist/built-in/plugins/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 核心类型和接口
|
||||
export type { AiPlugin, AiRequestContext, HookResult, HookType, PluginManagerConfig } from './types'
|
||||
export type { AiPlugin, AiRequestContext, HookResult, PluginManagerConfig } from './types'
|
||||
import type { ProviderId } from '../../types'
|
||||
import type { AiPlugin, AiRequestContext } from './types'
|
||||
|
||||
@ -30,5 +30,3 @@ export function definePlugin<T extends (...args: any[]) => AiPlugin>(pluginFacto
|
||||
export function definePlugin(plugin: AiPlugin | ((...args: any[]) => AiPlugin)) {
|
||||
return plugin
|
||||
}
|
||||
|
||||
export { createLoggingPlugin } from './built-in/logging'
|
||||
|
||||
@ -66,11 +66,6 @@ export interface PluginManagerConfig {
|
||||
context: Partial<AiRequestContext>
|
||||
}
|
||||
|
||||
/**
|
||||
* 钩子执行器类型
|
||||
*/
|
||||
export type HookType = 'first' | 'sequential' | 'parallel' | 'stream'
|
||||
|
||||
/**
|
||||
* 钩子执行结果
|
||||
*/
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
} from './core/models'
|
||||
import { aiProviderRegistry, isProviderSupported } from './core/providers/registry'
|
||||
import { createExecutor } from './core/runtime'
|
||||
import { ProviderId, type ProviderSettingsMap } from './types'
|
||||
import type { ProviderId, ProviderSettingsMap } from './types'
|
||||
|
||||
// ==================== 主要用户接口 ====================
|
||||
export { createExecutor, createOpenAICompatibleExecutor } from './core/runtime'
|
||||
@ -19,9 +19,9 @@ export { createExecutor, createOpenAICompatibleExecutor } from './core/runtime'
|
||||
export { createModel, type ModelConfig } from './core/models'
|
||||
|
||||
// ==================== 插件系统 ====================
|
||||
export type { AiPlugin, AiRequestContext, HookResult, HookType, PluginManagerConfig } from './core/plugins'
|
||||
export type { AiPlugin, AiRequestContext, HookResult, PluginManagerConfig } from './core/plugins'
|
||||
export { createContext, definePlugin, PluginManager } from './core/plugins'
|
||||
export { createPromptToolUsePlugin, webSearchPlugin } from './core/plugins/built-in'
|
||||
// export { createPromptToolUsePlugin, webSearchPlugin } from './core/plugins/built-in'
|
||||
export { PluginEngine } from './core/runtime/pluginEngine'
|
||||
|
||||
// ==================== 低级 API ====================
|
||||
@ -38,11 +38,36 @@ export { aiProviderRegistry } from './core/providers/registry'
|
||||
export type { ProviderConfig } from './core/providers/registry'
|
||||
export type { ProviderError } from './core/providers/types'
|
||||
export type {
|
||||
AmazonBedrockProviderSettings,
|
||||
AnthropicProviderSettings,
|
||||
AnthropicVertexProviderSettings,
|
||||
AzureOpenAIProviderSettings,
|
||||
CerebrasProviderSettings,
|
||||
CohereProviderSettings,
|
||||
DeepInfraProviderSettings,
|
||||
DeepSeekProviderSettings,
|
||||
FalProviderSettings,
|
||||
FireworksProviderSettings,
|
||||
GenerateObjectParams,
|
||||
GenerateTextParams,
|
||||
GoogleGenerativeAIProviderSettings,
|
||||
GoogleVertexProviderSettings,
|
||||
GroqProviderSettings,
|
||||
MistralProviderSettings,
|
||||
OllamaProviderSettings,
|
||||
OpenAICompatibleProviderSettings,
|
||||
OpenAIProviderSettings,
|
||||
OpenRouterProviderSettings,
|
||||
PerplexityProviderSettings,
|
||||
ProviderId,
|
||||
ProviderSettings,
|
||||
ProviderSettingsMap,
|
||||
ReplicateProviderSettings,
|
||||
StreamObjectParams,
|
||||
StreamTextParams
|
||||
StreamTextParams,
|
||||
TogetherAIProviderSettings,
|
||||
VercelProviderSettings,
|
||||
XaiProviderSettings
|
||||
} from './types'
|
||||
export * as aiSdk from 'ai'
|
||||
|
||||
@ -91,35 +116,6 @@ export {
|
||||
// 重新导出 Agent
|
||||
export { Experimental_Agent as Agent } from 'ai'
|
||||
|
||||
// 重新导出所有 Provider Settings 类型
|
||||
export type {
|
||||
AmazonBedrockProviderSettings,
|
||||
AnthropicProviderSettings,
|
||||
AnthropicVertexProviderSettings,
|
||||
AzureOpenAIProviderSettings,
|
||||
CerebrasProviderSettings,
|
||||
CohereProviderSettings,
|
||||
DeepInfraProviderSettings,
|
||||
DeepSeekProviderSettings,
|
||||
FalProviderSettings,
|
||||
FireworksProviderSettings,
|
||||
GoogleGenerativeAIProviderSettings,
|
||||
GoogleVertexProviderSettings,
|
||||
GroqProviderSettings,
|
||||
MistralProviderSettings,
|
||||
OllamaProviderSettings,
|
||||
OpenAICompatibleProviderSettings,
|
||||
OpenAIProviderSettings,
|
||||
OpenRouterProviderSettings,
|
||||
PerplexityProviderSettings,
|
||||
ProviderId,
|
||||
ProviderSettingsMap,
|
||||
ReplicateProviderSettings,
|
||||
TogetherAIProviderSettings,
|
||||
VercelProviderSettings,
|
||||
XaiProviderSettings
|
||||
} from './types'
|
||||
|
||||
// ==================== 选项 ====================
|
||||
export {
|
||||
createAnthropicOptions,
|
||||
|
||||
@ -38,3 +38,6 @@ export type {
|
||||
VercelProviderSettings,
|
||||
XaiProviderSettings
|
||||
} from './core/providers/registry'
|
||||
|
||||
// 重新导出插件类型
|
||||
export type { AiPlugin, AiRequestContext, HookResult, PluginManagerConfig } from './core/plugins/types'
|
||||
|
||||
@ -3,7 +3,7 @@ import { defineConfig } from 'tsdown'
|
||||
export default defineConfig({
|
||||
entry: {
|
||||
index: 'src/index.ts',
|
||||
'core/plugins/built-in/index': 'src/core/plugins/built-in/index.ts'
|
||||
'built-in/plugins/index': 'src/core/plugins/built-in/index.ts'
|
||||
},
|
||||
outDir: 'dist',
|
||||
format: ['esm', 'cjs'],
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
"@renderer/*": ["src/renderer/src/*"],
|
||||
"@shared/*": ["packages/shared/*"],
|
||||
"@types": ["src/renderer/src/types/index.ts"],
|
||||
"@cherrystudio/ai-core": ["packages/aiCore/src/index.ts"],
|
||||
"@cherrystudio/ai-core/*": ["packages/aiCore/src/*"]
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user