@huanban/rulego-editor-core 1.3.7 → 1.3.8

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.
@@ -0,0 +1,60 @@
1
+ import type { ModelsDevCatalogModel } from './models-dev-catalog';
2
+ export type AiModelSource = 'models.dev' | 'live' | 'history' | 'host' | 'manual';
3
+ export type AiParamKey = 'temperature' | 'topP' | 'presencePenalty' | 'frequencyPenalty' | 'maxTokens' | 'n';
4
+ export type AiParamMode = 'editable' | 'fixed' | 'unsupported' | 'hidden';
5
+ export interface AiModelProfile {
6
+ providerId?: string;
7
+ providerName?: string;
8
+ apiUrl?: string;
9
+ model: string;
10
+ source: AiModelSource;
11
+ capabilities: {
12
+ reasoning?: boolean;
13
+ toolCall?: boolean;
14
+ temperature?: boolean;
15
+ vision?: boolean;
16
+ attachment?: boolean;
17
+ multimodal?: boolean;
18
+ streaming?: boolean;
19
+ };
20
+ limits?: {
21
+ context?: number;
22
+ output?: number;
23
+ };
24
+ cost?: {
25
+ input?: number;
26
+ output?: number;
27
+ cacheRead?: number;
28
+ cacheWrite?: number;
29
+ };
30
+ raw?: unknown;
31
+ }
32
+ export interface AiParamSpec {
33
+ key: AiParamKey;
34
+ labelKey: string;
35
+ fallbackLabel: string;
36
+ mode: AiParamMode;
37
+ input: 'slider' | 'number';
38
+ fixedValue?: number;
39
+ min?: number;
40
+ max?: number;
41
+ step?: number;
42
+ save: boolean;
43
+ reasonKey?: string;
44
+ fallbackReason?: string;
45
+ }
46
+ export interface AiParamPolicy {
47
+ kind: 'reasoning' | 'standard';
48
+ warnings: Array<{
49
+ key: string;
50
+ fallback: string;
51
+ }>;
52
+ params: AiParamSpec[];
53
+ transformSaveParams(input: Record<string, number | undefined>): Record<string, number>;
54
+ }
55
+ export declare function inferReasoningModel(model: string): boolean;
56
+ export declare function formatAiCompactNumber(value: unknown): string;
57
+ export declare function modelProfileFromModelsDev(model: string, meta: ModelsDevCatalogModel, context?: Partial<AiModelProfile>): AiModelProfile;
58
+ export declare function fallbackAiModelProfile(model: string, context?: Partial<AiModelProfile>): AiModelProfile;
59
+ export declare function buildAiParamPolicy(profile: AiModelProfile): AiParamPolicy;
60
+ //# sourceMappingURL=ai-model-policy.d.ts.map
@@ -12,6 +12,7 @@ export interface ModelsDevCatalogModel {
12
12
  status?: string;
13
13
  reasoning?: boolean;
14
14
  toolCall?: boolean;
15
+ temperature?: boolean;
15
16
  attachment?: boolean;
16
17
  inputModalities?: string[];
17
18
  outputModalities?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huanban/rulego-editor-core",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "RuleGo 规则链编辑器核心库 - 框架无关的 Headless 编辑器引擎 + API 抽象层 (WorkflowFetcher)",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",