@huanban/rulego-editor-core 1.3.7 → 1.3.9
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.cjs.js +1288 -913
- package/dist/index.esm.js +19128 -18172
- package/dist/index.umd.js +1332 -957
- package/dist/standalone/HuanbanRulegoEditor.d.ts +15 -0
- package/dist/standalone/ai-model-policy.d.ts +60 -0
- package/dist/standalone/editor-property-drawers.d.ts +2 -0
- package/dist/standalone/models-dev-catalog.d.ts +1 -0
- package/package.json +1 -1
|
@@ -278,6 +278,8 @@ export declare class HuanbanRulegoEditor {
|
|
|
278
278
|
private toolbarIcons;
|
|
279
279
|
private aiAssistantOpen;
|
|
280
280
|
private aiAssistantUnread;
|
|
281
|
+
private savedSnapshotJson;
|
|
282
|
+
private isLoadingDataIntoCanvas;
|
|
281
283
|
/** 组件数据 @internal */
|
|
282
284
|
components: ComponentDefinition[];
|
|
283
285
|
/** 左侧分组展开状态 @internal */
|
|
@@ -411,6 +413,19 @@ export declare class HuanbanRulegoEditor {
|
|
|
411
413
|
/** 关闭弹窗 */
|
|
412
414
|
/** @internal 子模块(editor-dialogs)使用 */
|
|
413
415
|
_closeModal(): void;
|
|
416
|
+
/** 标记画布存在未保存修改。供事件桥接和属性抽屉复用。 */
|
|
417
|
+
/** @internal */
|
|
418
|
+
_markDirty(reason?: string): void;
|
|
419
|
+
/** 保存或加载完成后记录前端 diff 的基线快照。 */
|
|
420
|
+
/** @internal */
|
|
421
|
+
_markSavedSnapshot(data?: RuleChainData | null): void;
|
|
422
|
+
/** 在 LogicFlow 完成渲染后用画布导出结果作为 clean 基线。 */
|
|
423
|
+
/** @internal */
|
|
424
|
+
_markSavedSnapshotFromCanvas(): void;
|
|
425
|
+
/** 刷新保存按钮和 diff 按钮的未保存状态。 */
|
|
426
|
+
private _updateDirtySaveUi;
|
|
427
|
+
/** 打开前端规则链 JSON 变更 diff 弹窗。 */
|
|
428
|
+
showUnsavedDiffDialog(): void;
|
|
414
429
|
/**
|
|
415
430
|
* 显示规则链选择器弹窗 — 支持搜索和分页
|
|
416
431
|
* 实现已提取到 editor-dialogs.ts
|
|
@@ -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
|
|
@@ -27,6 +27,8 @@ export interface PropertyDrawerContext {
|
|
|
27
27
|
_escapeHtml(str: string): string;
|
|
28
28
|
/** 关闭 Drawer */
|
|
29
29
|
_closeDrawer(): void;
|
|
30
|
+
/** 标记画布存在未保存修改 */
|
|
31
|
+
_markDirty?(reason?: string): void;
|
|
30
32
|
/** 当前正在添加的节点 (可变状态, 供取消时删除) */
|
|
31
33
|
_currentAddNode: any;
|
|
32
34
|
/** 当前正在添加的边 (可变状态, 供取消时删除) */
|