@yiyi_zhang/reactflow-ui 1.1.0 → 1.3.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/AiWorkflowIDE.d.ts +28 -0
- package/dist/WorkflowIDE.d.ts +30 -0
- package/dist/actions/fromDefinitions.d.ts +70 -0
- package/dist/actions/registry.d.ts +1 -0
- package/dist/actions/types.d.ts +26 -0
- package/dist/ai.d.ts +25 -0
- package/dist/components/AiNative/AiCommandCenter.d.ts +4 -0
- package/dist/components/business/ActionPickerModal.d.ts +25 -0
- package/dist/components/business/DataPillInput.d.ts +2 -0
- package/dist/components/business/DecisionBranchCard.d.ts +2 -0
- package/dist/components/business/ForkJoinCard.d.ts +2 -0
- package/dist/components/business/LibraryVersionBadge.d.ts +29 -0
- package/dist/components/business/LoopDoWhileCard.d.ts +2 -0
- package/dist/components/business/NestedControlStep.d.ts +22 -0
- package/dist/components/business/StepFlowEditor.d.ts +15 -0
- package/dist/components/business/StepListEditor.d.ts +29 -0
- package/dist/components/import/ApiImportDialog.d.ts +27 -0
- package/dist/components/onboarding/ModalShell.d.ts +15 -0
- package/dist/components/onboarding/OnboardingController.d.ts +67 -0
- package/dist/components/onboarding/OnboardingGuideCard.d.ts +10 -0
- package/dist/components/onboarding/OnboardingWizard.d.ts +42 -0
- package/dist/components/onboarding/PromotionPanel.d.ts +20 -0
- package/dist/components/onboarding/WorkflowNameBuilder.d.ts +19 -0
- package/dist/components/onboarding/index.d.ts +8 -0
- package/dist/components/onboarding/styles.d.ts +11 -0
- package/dist/components/onboarding/useOnboardingData.d.ts +17 -0
- package/dist/components/template/TemplateGallery.d.ts +2 -0
- package/dist/components/template/TemplateSetupWizard.d.ts +2 -0
- package/dist/import/buildAction.d.ts +23 -0
- package/dist/import/common.d.ts +17 -0
- package/dist/import/curl.d.ts +12 -0
- package/dist/import/detect.d.ts +9 -0
- package/dist/import/index.d.ts +10 -0
- package/dist/import/insert.d.ts +16 -0
- package/dist/import/openapi.d.ts +9 -0
- package/dist/import/postman.d.ts +9 -0
- package/dist/import/schema.d.ts +15 -0
- package/dist/import/sensitive.d.ts +18 -0
- package/dist/import/types.d.ts +62 -0
- package/dist/import/util.d.ts +23 -0
- package/dist/index.d.ts +23 -1
- package/dist/library/catalog.d.ts +93 -0
- package/dist/library/conductorProvider.d.ts +41 -0
- package/dist/library/diff.d.ts +62 -0
- package/dist/library/index.d.ts +16 -0
- package/dist/library/level.d.ts +6 -0
- package/dist/library/naming.d.ts +28 -0
- package/dist/library/projections.d.ts +53 -0
- package/dist/library/types.d.ts +58 -0
- package/dist/library/useLibraryCatalog.d.ts +9 -0
- package/dist/library/version.d.ts +17 -0
- package/dist/library/versionStatus.d.ts +44 -0
- package/dist/onboarding/index.d.ts +6 -0
- package/dist/onboarding/naming.d.ts +41 -0
- package/dist/onboarding/poll.d.ts +39 -0
- package/dist/onboarding/wizardState.d.ts +44 -0
- package/dist/product-launch.html +3 -3
- package/dist/providers/WorkflowIdeProvider.d.ts +23 -0
- package/dist/providers/resolve.d.ts +20 -0
- package/dist/providers/types.d.ts +65 -0
- package/dist/reactflow-ui-ai.es.js +18748 -10262
- package/dist/reactflow-ui.css +1 -1
- package/dist/reactflow-ui.es.js +12741 -8916
- package/dist/reactflow-ui.umd.js +38 -23
- package/dist/sample-imports/cmdb-openapi3.json +334 -0
- package/dist/sample-imports/cmdb-postman.json +100 -0
- package/dist/sample-imports/ticket-swagger2.json +231 -0
- package/dist/sample-workflows/library-capabilities-demo.json +66 -0
- package/dist/services/ai/agentRunner.d.ts +11 -0
- package/dist/services/ai/schemaRegistry.d.ts +7 -1
- package/dist/services/ai/systemPrompt.d.ts +11 -0
- package/dist/services/ai/toolExecutor.d.ts +12 -0
- package/dist/services/ai/workflowSynthesizer.d.ts +28 -3
- package/dist/stepmodel/compile.d.ts +6 -0
- package/dist/stepmodel/decompile.d.ts +5 -0
- package/dist/stepmodel/factory.d.ts +8 -0
- package/dist/stepmodel/types.d.ts +3 -0
- package/dist/store/ideStoresContext.d.ts +3 -0
- package/dist/store/sandboxRunObserver.d.ts +19 -0
- package/dist/store/workflowStore.d.ts +1 -0
- package/dist/telemetry/buffer.d.ts +37 -0
- package/dist/telemetry/once.d.ts +11 -0
- package/dist/telemetry/track.d.ts +17 -0
- package/dist/telemetry/types.d.ts +24 -0
- package/dist/telemetry/useTelemetry.d.ts +22 -0
- package/dist/types/conductor.d.ts +13 -8
- package/dist/types/workflow.d.ts +9 -0
- package/dist/types/workflowLibrary.d.ts +2 -0
- package/dist/utils/taskTypeMeta.d.ts +3 -3
- package/package.json +1 -1
- package/dist/components/AiNative/BusinessCanvas.d.ts +0 -15
package/dist/AiWorkflowIDE.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ import type { WorkflowDef, WorkflowInstance } from './types/conductor';
|
|
|
10
10
|
import type { AiConfig } from './services/ai/protocolAdapter';
|
|
11
11
|
import type { AiMetrics } from './store/aiStore';
|
|
12
12
|
import type { WorkflowLibraryItem } from './types/workflowLibrary';
|
|
13
|
+
import type { LibraryProvider } from './library/types';
|
|
14
|
+
import type { IdeProviders } from './providers/types';
|
|
13
15
|
import type { ExecutionActions, ThemeMode, ThemeColor, LayoutDirection, ViewMode, WorkflowExecutionInput } from './types/workflow';
|
|
14
16
|
import type { CustomTool } from './services/ai/toolRegistry';
|
|
15
17
|
import type { CustomValidationRule } from './services/ai/ruleEngine';
|
|
@@ -42,6 +44,32 @@ export interface AiWorkflowIDEProps {
|
|
|
42
44
|
* ```
|
|
43
45
|
*/
|
|
44
46
|
workflowLibrary?: WorkflowLibraryItem[];
|
|
47
|
+
/**
|
|
48
|
+
* 流程库数据源(LibraryProvider)。提供后,库内流程 / 任务定义经规范化后同时投影为
|
|
49
|
+
* AI 目录(`workflowLibrary`)、任务 Schema(`taskSchemas`)与检索工具的数据来源;
|
|
50
|
+
* 同名条目 Provider 优先于静态 prop,静态 prop 仍可单独使用。
|
|
51
|
+
*
|
|
52
|
+
* `libraryProvider` 引用变化时重新加载,组件卸载时中止进行中的请求。
|
|
53
|
+
* AI 新建的 SUB_WORKFLOW 会固定为目录当前最新版本,已有版本号不会被自动改变。
|
|
54
|
+
*
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const provider = createConductorLibraryProvider({ baseUrl, headers });
|
|
57
|
+
* <AiWorkflowIDE libraryProvider={provider} />
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
libraryProvider?: LibraryProvider;
|
|
61
|
+
/**
|
|
62
|
+
* 统一扩展点集合(`library` / `onboarding` / `telemetry`)。
|
|
63
|
+
* 解析顺序:专用 prop(如 `libraryProvider`)> 本 prop > 外层 `WorkflowIdeProvider` > 无。
|
|
64
|
+
* 按字段比较引用,宿主每次渲染新建对象但 provider 实例不变时不会触发目录重载。
|
|
65
|
+
*/
|
|
66
|
+
providers?: IdeProviders;
|
|
67
|
+
/**
|
|
68
|
+
* 流程库目录注入系统提示词的条数上限,默认 50(按层级 L3 -> L1 截断)。
|
|
69
|
+
* 超出部分会提示 AI 改用 `search_workflow_library` 检索。
|
|
70
|
+
* 提供 `libraryProvider` 时,任务 Schema 段落同样受此上限约束。
|
|
71
|
+
*/
|
|
72
|
+
promptCatalogLimit?: number;
|
|
45
73
|
/**
|
|
46
74
|
* AI 模型配置(集成方提供)。
|
|
47
75
|
*
|
package/dist/WorkflowIDE.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { ThemeMode, ThemeColor, LayoutDirection, ValidationResults, ExecutionAct
|
|
|
2
2
|
import { WorkflowDef, WorkflowInstance } from './types/conductor';
|
|
3
3
|
import { AIServiceConfig } from './services/aiService';
|
|
4
4
|
import { ActionDefinition } from './actions/types';
|
|
5
|
+
import type { WorkflowLevel } from './types/workflowLibrary';
|
|
6
|
+
import type { LibraryProvider } from './library/types';
|
|
7
|
+
import type { IdeProviders } from './providers/types';
|
|
5
8
|
import './styles/tokens.css';
|
|
6
9
|
import './styles/executionStyles.css';
|
|
7
10
|
/**
|
|
@@ -16,6 +19,8 @@ export interface WorkflowIDERef {
|
|
|
16
19
|
save: () => void;
|
|
17
20
|
/** 创建空白工作流 */
|
|
18
21
|
createBlankWorkflow: (name?: string) => void;
|
|
22
|
+
/** 打开「导入接口」对话框(OpenAPI / Swagger / Postman / curl),供宿主或自助接入向导调用 */
|
|
23
|
+
openApiImport: () => void;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* WorkflowIDE 组件的属性接口
|
|
@@ -105,6 +110,31 @@ export interface WorkflowIDEProps {
|
|
|
105
110
|
* 宿主可传入自定义业务动作(如私有云/特定系统连接器)。
|
|
106
111
|
*/
|
|
107
112
|
actions?: ActionDefinition[];
|
|
113
|
+
/**
|
|
114
|
+
* 流程库数据源(LibraryProvider)。提供后,库内流程 / 任务定义会生成业务动作并注册到本实例的动作库:
|
|
115
|
+
* 流程库能力编译为 `SUB_WORKFLOW`,步骤在首次引用时固定为目录当前最新版本,
|
|
116
|
+
* 库发布新版本后步骤不会自动跟随,徽标提示「有新版本」,由用户确认差异后手动升级。
|
|
117
|
+
*
|
|
118
|
+
* 同名动作 Provider 优先于 `actions`;不传时 `actions` 的行为完全不变。
|
|
119
|
+
* `libraryProvider` 引用变化时重新加载,组件卸载时中止进行中的请求。
|
|
120
|
+
*
|
|
121
|
+
* ```tsx
|
|
122
|
+
* const provider = createConductorLibraryProvider({ baseUrl, headers });
|
|
123
|
+
* <WorkflowIDE uiMode="business" libraryProvider={provider} />
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
libraryProvider?: LibraryProvider;
|
|
127
|
+
/**
|
|
128
|
+
* 统一扩展点集合(`library` / `onboarding` / `telemetry`)。
|
|
129
|
+
* 解析顺序:专用 prop(如 `libraryProvider`)> 本 prop > 外层 `WorkflowIdeProvider` > 无。
|
|
130
|
+
* 按字段比较引用,宿主每次渲染新建对象但 provider 实例不变时不会触发目录重载。
|
|
131
|
+
*/
|
|
132
|
+
providers?: IdeProviders;
|
|
133
|
+
/**
|
|
134
|
+
* 当前正在编辑的工作流层级(L1 / L2 / L3)。
|
|
135
|
+
* 提供时,动作选择器隐藏违反分层调用规则的流程库动作(L1 不显示 L2/L3,L2 不显示 L3);未提供则不过滤。
|
|
136
|
+
*/
|
|
137
|
+
currentWorkflowLevel?: WorkflowLevel;
|
|
108
138
|
/**
|
|
109
139
|
* 组件容器高度。
|
|
110
140
|
* @default '100%'
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { SchemaDef, WorkflowDef } from '../types/conductor';
|
|
2
|
+
import type { ActionCategory, ActionDefinition, ActionField, ActionOutputField } from './types';
|
|
3
|
+
import type { WorkflowLevel } from '../types/workflowLibrary';
|
|
4
|
+
/**
|
|
5
|
+
* 从 Conductor OSS 标准定义(WorkflowDef / 已注册 TaskDef)生成业务动作。
|
|
6
|
+
*
|
|
7
|
+
* 设计原则:
|
|
8
|
+
* - 库本身不发请求:定义数据由接入方从治理层取得(权限过滤也在治理层完成)。
|
|
9
|
+
* - 标准结构给不了的信息(中文名、分类、图标、风险等级、特殊控件、层级、标签)
|
|
10
|
+
* 通过可选的 ActionExtension 补充;缺省时按合理默认值降级,保证任何定义都能出现在动作库里。
|
|
11
|
+
*/
|
|
12
|
+
/** 治理层/接入方提供的补充字段(均可选,按名称一一对应) */
|
|
13
|
+
export interface ActionExtension {
|
|
14
|
+
/** 业务展示名(缺省使用定义名称) */
|
|
15
|
+
label?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
category?: ActionCategory;
|
|
18
|
+
icon?: string;
|
|
19
|
+
riskLevel?: 'safe' | 'sensitive';
|
|
20
|
+
connector?: string;
|
|
21
|
+
level?: WorkflowLevel;
|
|
22
|
+
/** 业务域展示名 */
|
|
23
|
+
domain?: string;
|
|
24
|
+
tags?: string[];
|
|
25
|
+
/** 为 true 时不进入动作库(例如用户无权限、已下线) */
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
/** 按入参 key 覆盖表单字段属性(中文标签、控件类型、下拉选项等) */
|
|
28
|
+
fieldOverrides?: Record<string, Partial<ActionField>>;
|
|
29
|
+
/** 按出参 key 覆盖出参说明(中文标签、示例值) */
|
|
30
|
+
outputOverrides?: Record<string, Partial<ActionOutputField>>;
|
|
31
|
+
}
|
|
32
|
+
/** Conductor `/metadata/taskdefs` 返回的已注册任务定义(只列本模块用到的标准字段) */
|
|
33
|
+
export interface RegisteredTaskDef {
|
|
34
|
+
name: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
/** 仅文档用途,不强制 */
|
|
37
|
+
inputKeys?: string[];
|
|
38
|
+
outputKeys?: string[];
|
|
39
|
+
inputTemplate?: Record<string, any>;
|
|
40
|
+
inputSchema?: SchemaDef;
|
|
41
|
+
outputSchema?: SchemaDef;
|
|
42
|
+
ownerEmail?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 将 JSON Schema 的 properties 转为表单字段;没有 schema 时退化为仅有 key 列表
|
|
46
|
+
* (Conductor 的 inputKeys / inputParameters 只有名称),类型一律按文本处理。
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildFields(schema: SchemaDef | undefined, fallbackKeys: string[], inputTemplate?: Record<string, any>): ActionField[];
|
|
49
|
+
/** 出参:优先 outputSchema;其次 outputKeys / outputParameters 的 key(后者是输出模板,其 key 即对外接口) */
|
|
50
|
+
export declare function buildOutputs(schema: SchemaDef | undefined, fallbackKeys: string[], outputTemplate?: Record<string, any>): ActionOutputField[];
|
|
51
|
+
/**
|
|
52
|
+
* 把流程库中的一个工作流定义生成为动作:业务用户只面对入参表单与出参,
|
|
53
|
+
* 编译为 SUB_WORKFLOW 引用。版本由步骤上的 libraryRef 决定(首次引用时固定)。
|
|
54
|
+
* 被 extension.hidden 标记时返回 null。
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildActionFromWorkflowDef(def: WorkflowDef, ext?: ActionExtension): ActionDefinition | null;
|
|
57
|
+
/** 已注册任务定义生成原子动作,编译为同名 SIMPLE 任务。 */
|
|
58
|
+
export declare function buildActionFromTaskDef(def: RegisteredTaskDef, ext?: ActionExtension): ActionDefinition | null;
|
|
59
|
+
export interface LibraryWorkflowEntry {
|
|
60
|
+
workflowDef: WorkflowDef;
|
|
61
|
+
extension?: ActionExtension;
|
|
62
|
+
}
|
|
63
|
+
export interface RegisteredTaskEntry {
|
|
64
|
+
taskDef: RegisteredTaskDef;
|
|
65
|
+
extension?: ActionExtension;
|
|
66
|
+
}
|
|
67
|
+
/** 批量生成流程库动作(自动跳过 hidden) */
|
|
68
|
+
export declare function buildActionsFromLibrary(entries: LibraryWorkflowEntry[]): ActionDefinition[];
|
|
69
|
+
/** 批量生成原子任务动作(自动跳过 hidden) */
|
|
70
|
+
export declare function buildActionsFromTaskDefs(entries: RegisteredTaskEntry[]): ActionDefinition[];
|
|
@@ -5,6 +5,7 @@ export declare class ActionRegistry {
|
|
|
5
5
|
constructor(initialActions?: ActionDefinition[]);
|
|
6
6
|
register(action: ActionDefinition): void;
|
|
7
7
|
registerAll(actions: ActionDefinition[]): void;
|
|
8
|
+
unregister(id: string): void;
|
|
8
9
|
getAction(id: string): ActionDefinition | undefined;
|
|
9
10
|
getAllActions(): ActionDefinition[];
|
|
10
11
|
getActionsByCategory(category?: ActionCategory): ActionDefinition[];
|
package/dist/actions/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TaskDef } from '../types/conductor';
|
|
2
|
+
import type { WorkflowLevel } from '../types/workflowLibrary';
|
|
2
3
|
export type ActionCategory = 'compute' | 'storage' | 'network' | 'monitor' | 'notify' | 'logic' | 'human' | 'custom';
|
|
3
4
|
export type ActionFieldType = 'text' | 'textarea' | 'number' | 'select' | 'boolean' | 'account' | 'cron-friendly';
|
|
4
5
|
export interface ActionFieldOption {
|
|
@@ -28,6 +29,16 @@ export interface CompileCtx {
|
|
|
28
29
|
taskReferenceName: string;
|
|
29
30
|
stepIndex: number;
|
|
30
31
|
workflowName?: string;
|
|
32
|
+
/**
|
|
33
|
+
* 该步骤引用流程库能力时记录的 {名称, 版本}。
|
|
34
|
+
* 版本在首次引用时固定,库升级后不会自动跟随;version 缺省表示沿用原定义(不显式指定版本)。
|
|
35
|
+
*/
|
|
36
|
+
libraryRef?: LibraryRef;
|
|
37
|
+
}
|
|
38
|
+
/** 步骤对流程库能力(SUB_WORKFLOW)的引用记录 */
|
|
39
|
+
export interface LibraryRef {
|
|
40
|
+
name: string;
|
|
41
|
+
version?: number;
|
|
31
42
|
}
|
|
32
43
|
export interface ActionDefinition {
|
|
33
44
|
id: string;
|
|
@@ -36,6 +47,21 @@ export interface ActionDefinition {
|
|
|
36
47
|
icon: string;
|
|
37
48
|
description: string;
|
|
38
49
|
connector?: string;
|
|
50
|
+
/** 动作来源:task = 原子任务(默认),workflow = 流程库能力(以 SUB_WORKFLOW 引用) */
|
|
51
|
+
kind?: 'task' | 'workflow';
|
|
52
|
+
/** kind = workflow 时:库中该能力的当前最新版本,用于提示“有新版本可升级” */
|
|
53
|
+
workflowRef?: {
|
|
54
|
+
name: string;
|
|
55
|
+
version: number;
|
|
56
|
+
};
|
|
57
|
+
/** 流程库层级 L1 / L2 / L3(调用方向规则见 workflowLibrary) */
|
|
58
|
+
level?: WorkflowLevel;
|
|
59
|
+
/** 业务域展示名(流程库动作);动作选择器据此分组,缺省归入「其他」 */
|
|
60
|
+
domain?: string;
|
|
61
|
+
/** 已下线 / 不建议新引用:动作选择器隐藏,但已引用的步骤照常显示与编译 */
|
|
62
|
+
deprecated?: boolean;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
ownerEmail?: string;
|
|
39
65
|
riskLevel: 'safe' | 'sensitive';
|
|
40
66
|
fields: ActionField[];
|
|
41
67
|
outputs: ActionOutputField[];
|
package/dist/ai.d.ts
CHANGED
|
@@ -21,6 +21,15 @@ export type { CustomTool } from './services/ai/toolRegistry';
|
|
|
21
21
|
export type { CustomValidationRule } from './services/ai/ruleEngine';
|
|
22
22
|
export type { TaskSchema } from './services/ai/schemaRegistry';
|
|
23
23
|
export type { WorkflowLevel, WorkflowLibraryItem, WorkflowLibraryDetail } from './types/workflowLibrary';
|
|
24
|
+
export type { LibraryProvider, LibraryExtension, LibraryWorkflowRecord, LibraryTaskRecord, LibraryListResult, LibrarySearchOptions, LibraryLoadStatus, } from './library/types';
|
|
25
|
+
export { LibraryCatalog } from './library/catalog';
|
|
26
|
+
export type { LibraryEntry, LibraryCatalogSnapshot, LibraryCatalogOptions } from './library/catalog';
|
|
27
|
+
export { toActions, toTaskSchemas, toLibraryItems } from './library/projections';
|
|
28
|
+
export { parseWorkflowName, validateWorkflowName } from './library/naming';
|
|
29
|
+
export type { ParsedWorkflowName, WorkflowNameType } from './library/naming';
|
|
30
|
+
export { createConductorLibraryProvider } from './library/conductorProvider';
|
|
31
|
+
export type { ConductorLibraryProviderOptions } from './library/conductorProvider';
|
|
32
|
+
export { DEFAULT_PROMPT_CATALOG_LIMIT } from './services/ai/systemPrompt';
|
|
24
33
|
export type { AiEvent, AiEventType } from './types/aiEvents';
|
|
25
34
|
export type { DiffSummary, PartialAcceptSelection, PatchOp } from './services/ai/toolExecutor';
|
|
26
35
|
export { applyPartialProposal, describeDiff, computeDiff } from './services/ai/toolExecutor';
|
|
@@ -32,3 +41,19 @@ export { getCompletionItems, buildDataFlowGraph, refactorTaskReferenceName, getU
|
|
|
32
41
|
export type { WlspCompletionItem, DataFlowGraph, DataFlowEdge, InferredField, UpstreamTaskInfo, } from './services/wlsp/workflowLsp';
|
|
33
42
|
export { executeLocalSandboxDryRun, buildDefaultWorkflowMockInput, generateDefaultTaskOutputPreview, } from './utils/localSandboxEngine';
|
|
34
43
|
export type { SandboxDryRunOptions, TaskMockOverride, } from './utils/localSandboxEngine';
|
|
44
|
+
export { WorkflowIdeProvider, useIdeProviders } from './providers/WorkflowIdeProvider';
|
|
45
|
+
export type { WorkflowIdeProviderProps } from './providers/WorkflowIdeProvider';
|
|
46
|
+
export { resolveProviders, stabilizeProviders } from './providers/resolve';
|
|
47
|
+
export type { ProviderSources } from './providers/resolve';
|
|
48
|
+
export type { IdeProviders, OnboardingProvider, OnboardingContext, ProductInfo, StartTrialResult, PromotionStatus, } from './providers/types';
|
|
49
|
+
export { WorkflowNameBuilder, OnboardingWizard, PromotionPanel, OnboardingGuideCard } from './components/onboarding';
|
|
50
|
+
export type { WorkflowNameBuilderProps, OnboardingWizardProps, OnboardingCreateResult, PromotionPanelProps, OnboardingGuideCardProps, } from './components/onboarding';
|
|
51
|
+
export { buildWorkflowName, validateNameParts, suggestFuncSlug, promotionTargetName, isPromotableName, buildSkeletonWorkflow, nextPollDelay, isTerminalPromotionState, buildPromotionTimeline, promotionStateLabel, pollPromotion, } from './onboarding';
|
|
52
|
+
export type { WorkflowNameParts, PromotionTargetType, SkeletonInput, TimelineItem, PromotionState, StartSource } from './onboarding';
|
|
53
|
+
export { createTelemetryBuffer } from './telemetry/buffer';
|
|
54
|
+
export type { TelemetryBuffer, TelemetryBufferOptions } from './telemetry/buffer';
|
|
55
|
+
export type { TelemetrySink, IdeEvent, IdeEventName } from './telemetry/types';
|
|
56
|
+
export { detectFormat, parseApiText, parseOpenApi3, parseSwagger2, parsePostman21, parseCurl, buildHttpAction, appendImportedActions, sanitizeHeaders, } from './import';
|
|
57
|
+
export type { ImportFormat, DetectedFormat, ImportedOperation, ImportedParam, ImportedBody, ParseResult, BuildHttpActionOptions, } from './import';
|
|
58
|
+
export { ApiImportDialog } from './components/import/ApiImportDialog';
|
|
59
|
+
export type { ApiImportDialogProps, ApiImportInsertInfo } from './components/import/ApiImportDialog';
|
|
@@ -12,6 +12,10 @@ import type { AiEvent } from '../../types/aiEvents';
|
|
|
12
12
|
interface AiCommandCenterProps {
|
|
13
13
|
systemPrompt?: string;
|
|
14
14
|
systemPromptExtra?: string;
|
|
15
|
+
/** 流程库目录注入提示词的条数上限(缺省 50) */
|
|
16
|
+
promptCatalogLimit?: number;
|
|
17
|
+
/** 任务 Schema 注入提示词的条数上限(缺省不限制) */
|
|
18
|
+
promptSchemaLimit?: number;
|
|
15
19
|
showConfigButton?: boolean;
|
|
16
20
|
onShowConfig: () => void;
|
|
17
21
|
executionActions?: ExecutionActions;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ActionRegistry } from '../../actions/registry';
|
|
3
|
+
import type { ActionDefinition } from '../../actions/types';
|
|
4
|
+
import type { WorkflowLevel } from '../../types/workflowLibrary';
|
|
5
|
+
import type { LibraryCatalog } from '../../library/catalog';
|
|
6
|
+
export interface ActionPickerModalProps {
|
|
7
|
+
registry: ActionRegistry;
|
|
8
|
+
/** 展示用的步骤序号(从 1 开始) */
|
|
9
|
+
stepNumber: number;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onSelect: (action: ActionDefinition) => void;
|
|
12
|
+
/**
|
|
13
|
+
* 当前正在编辑的工作流层级。提供时隐藏违反分层调用规则的流程库动作
|
|
14
|
+
* (L1 不显示 L2/L3,L2 不显示 L3);未提供则不按层级过滤。
|
|
15
|
+
*/
|
|
16
|
+
currentWorkflowLevel?: WorkflowLevel;
|
|
17
|
+
/** 流程库目录:用于显示「加载中 / 加载失败,点击重试」状态 */
|
|
18
|
+
libraryCatalog?: LibraryCatalog;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 业务动作选择弹窗:分类筛选 + 关键字搜索。
|
|
22
|
+
* 筛选状态与过滤计算都放在弹窗内部:仅在弹窗打开时才会随输入重新计算,
|
|
23
|
+
* 不再拖累编辑器每次渲染(动作库可能有成百上千项)。
|
|
24
|
+
*/
|
|
25
|
+
export declare const ActionPickerModal: React.FC<ActionPickerModalProps>;
|
|
@@ -10,5 +10,7 @@ export interface DataPillInputProps {
|
|
|
10
10
|
registry?: ActionRegistry;
|
|
11
11
|
workflowInputParams?: any[];
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
/** 初始即展开「插入数据」选择面板(例如下拉字段刚切换为动态取值时) */
|
|
14
|
+
defaultShowPicker?: boolean;
|
|
13
15
|
}
|
|
14
16
|
export declare const DataPillInput: React.FC<DataPillInputProps>;
|
|
@@ -9,5 +9,7 @@ export interface DecisionBranchCardProps {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
onChange: (updated: BusinessStep) => void;
|
|
11
11
|
onOpenInsertModal: (callback: (action: ActionDefinition) => void) => void;
|
|
12
|
+
/** 嵌套深度:顶层卡片为 0,其内部子控制流依次 +1 */
|
|
13
|
+
depth?: number;
|
|
12
14
|
}
|
|
13
15
|
export declare const DecisionBranchCard: React.FC<DecisionBranchCardProps>;
|
|
@@ -9,5 +9,7 @@ export interface ForkJoinCardProps {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
onChange: (updated: BusinessStep) => void;
|
|
11
11
|
onOpenInsertModal: (callback: (action: ActionDefinition) => void) => void;
|
|
12
|
+
/** 嵌套深度:顶层卡片为 0,其内部子控制流依次 +1 */
|
|
13
|
+
depth?: number;
|
|
12
14
|
}
|
|
13
15
|
export declare const ForkJoinCard: React.FC<ForkJoinCardProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BusinessStep } from '../../stepmodel/types';
|
|
3
|
+
import type { ActionDefinition } from '../../actions/types';
|
|
4
|
+
import type { LibraryCatalog } from '../../library/catalog';
|
|
5
|
+
import { type WorkflowVersionDiff } from '../../library/diff';
|
|
6
|
+
export interface LibraryVersionBadgeProps {
|
|
7
|
+
step: BusinessStep;
|
|
8
|
+
action?: ActionDefinition;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 流程库目录。提供后:
|
|
12
|
+
* - 升级前取旧、新两个版本的定义,展示入参 / 出参差异再确认
|
|
13
|
+
* - 固定版本在库中不存在 / 已下线时显示「⚠ 版本不可用」
|
|
14
|
+
* 未提供时沿用旧行为(只按动作上记录的最新版本提示升级)。
|
|
15
|
+
*/
|
|
16
|
+
catalog?: LibraryCatalog;
|
|
17
|
+
/** 其它步骤中引用了本步骤哪些出参 key(用于差异里的「下游引用将失效」提示) */
|
|
18
|
+
getReferencedOutputs?: () => Iterable<string>;
|
|
19
|
+
/** 用户确认升级后回调:库中最新版本号,以及(能取到两个版本定义时的)升级差异 */
|
|
20
|
+
onUpgrade: (latestVersion: number, diff?: WorkflowVersionDiff) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 流程库能力的版本标记:
|
|
24
|
+
* - 显示步骤引用时固定的版本(库升级后不会自动跟随)
|
|
25
|
+
* - 库中有更新版本时,提示并允许用户在看过升级差异后手动升级
|
|
26
|
+
* - 固定版本不可用(不存在 / 已下线)时给出警示,保持原样编译,不自动改版本
|
|
27
|
+
* - 目录加载失败时不显示新版本提示,不影响编辑与编译
|
|
28
|
+
*/
|
|
29
|
+
export declare const LibraryVersionBadge: React.FC<LibraryVersionBadgeProps>;
|
|
@@ -9,5 +9,7 @@ export interface LoopDoWhileCardProps {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
onChange: (updated: BusinessStep) => void;
|
|
11
11
|
onOpenInsertModal: (callback: (action: ActionDefinition) => void) => void;
|
|
12
|
+
/** 嵌套深度:顶层卡片为 0,其内部子控制流依次 +1 */
|
|
13
|
+
depth?: number;
|
|
12
14
|
}
|
|
13
15
|
export declare const LoopDoWhileCard: React.FC<LoopDoWhileCardProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BusinessStep } from '../../stepmodel/types';
|
|
3
|
+
import { ActionRegistry } from '../../actions/registry';
|
|
4
|
+
import type { ActionDefinition } from '../../actions/types';
|
|
5
|
+
export interface NestedControlStepProps {
|
|
6
|
+
step: BusinessStep;
|
|
7
|
+
index: number;
|
|
8
|
+
/** 当前嵌套层级(顶层卡片内的第一层子控制流为 1),用于缩进与视觉区分 */
|
|
9
|
+
depth?: number;
|
|
10
|
+
upstreamSteps: BusinessStep[];
|
|
11
|
+
registry?: ActionRegistry;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
onChange: (updated: BusinessStep) => void;
|
|
14
|
+
onDelete: () => void;
|
|
15
|
+
onOpenInsertModal: (callback: (action: ActionDefinition) => void) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 分支 / 并行泳道 / 循环体内部的"子控制流"渲染器。
|
|
19
|
+
* 通过它,DecisionBranchCard / ForkJoinCard / LoopDoWhileCard 可以互相递归嵌套,
|
|
20
|
+
* 支持例如「分支 A 内再包含一个分支」「泳道内再有并行或循环」等任意层级。
|
|
21
|
+
*/
|
|
22
|
+
export declare const NestedControlStep: React.FC<NestedControlStepProps>;
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WorkflowDef, WorkflowInstance } from '../../types/conductor';
|
|
3
|
+
import type { BusinessStep } from '../../stepmodel/types';
|
|
3
4
|
import { ActionRegistry } from '../../actions/registry';
|
|
5
|
+
import type { LibraryCatalog } from '../../library/catalog';
|
|
6
|
+
import type { WorkflowLevel } from '../../types/workflowLibrary';
|
|
4
7
|
export interface StepFlowEditorProps {
|
|
5
8
|
workflowDef: WorkflowDef | null;
|
|
6
9
|
onChange: (def: WorkflowDef) => void;
|
|
7
10
|
registry?: ActionRegistry;
|
|
8
11
|
readOnly?: boolean;
|
|
9
12
|
workflowExecution?: WorkflowInstance;
|
|
13
|
+
/** 流程库目录(由 WorkflowIDE 按 libraryProvider 创建):用于动作选择器状态与版本徽标 */
|
|
14
|
+
libraryCatalog?: LibraryCatalog;
|
|
15
|
+
/** 当前正在编辑的工作流层级:提供时选择器隐藏违反分层调用规则的流程库动作 */
|
|
16
|
+
currentWorkflowLevel?: WorkflowLevel;
|
|
17
|
+
/** 提供时,步骤头部显示「🤖」按钮,点击请 AI 介绍该步骤(AI IDE 中使用) */
|
|
18
|
+
onAskAi?: (step: BusinessStep) => void;
|
|
19
|
+
/** 通过动作选择器新增步骤后回调(埋点用):source = library(流程库能力)/ builtin(内置或宿主动作) */
|
|
20
|
+
onStepAdded?: (info: {
|
|
21
|
+
source: 'library' | 'builtin';
|
|
22
|
+
}) => void;
|
|
23
|
+
/** 本地沙箱试跑结束后回调(埋点用):result 为执行状态,或 'error'(试跑抛错) */
|
|
24
|
+
onSandboxRun?: (result: string) => void;
|
|
10
25
|
}
|
|
11
26
|
export declare const StepFlowEditor: React.FC<StepFlowEditorProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BusinessStep } from '../../stepmodel/types';
|
|
3
|
+
import { ActionRegistry } from '../../actions/registry';
|
|
4
|
+
import type { ActionDefinition } from '../../actions/types';
|
|
5
|
+
export interface StepListEditorProps {
|
|
6
|
+
steps: BusinessStep[];
|
|
7
|
+
onStepsChange: (next: BusinessStep[]) => void;
|
|
8
|
+
/** 本列表之前的所有上游步骤(用于参数胶囊联想);列表内前序步骤会自动追加 */
|
|
9
|
+
upstreamSteps: BusinessStep[];
|
|
10
|
+
registry?: ActionRegistry;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** 本列表所在容器的嵌套深度(顶层容器为 0) */
|
|
13
|
+
depth: number;
|
|
14
|
+
onOpenInsertModal: (callback: (action: ActionDefinition) => void) => void;
|
|
15
|
+
/** regular:分支 / 循环体内的宽松行;compact:并行泳道内的窄列行 */
|
|
16
|
+
variant?: 'regular' | 'compact';
|
|
17
|
+
/** 行背景色调;展开区域使用相反色调,保持层次 */
|
|
18
|
+
rowTone?: 'primary' | 'secondary';
|
|
19
|
+
/** 序号徽标前缀,如「轮内 」 */
|
|
20
|
+
indexPrefix?: string;
|
|
21
|
+
/** 序号徽标是否使用强调色(默认为中性底色) */
|
|
22
|
+
accentIndexBadge?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 分支 / 并行泳道 / 循环体共用的"子步骤列表":
|
|
26
|
+
* - 普通动作渲染为可展开的表单行
|
|
27
|
+
* - 控制流步骤(分支 / 并行 / 循环)交给 NestedControlStep 递归渲染,因此可任意层级嵌套
|
|
28
|
+
*/
|
|
29
|
+
export declare const StepListEditor: React.FC<StepListEditorProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ActionDefinition } from '../../actions/types';
|
|
3
|
+
import type { ImportFormat } from '../../import/types';
|
|
4
|
+
export interface ApiImportInsertInfo {
|
|
5
|
+
format: ImportFormat;
|
|
6
|
+
/** 本次插入的步骤数 */
|
|
7
|
+
count: number;
|
|
8
|
+
/** 解析时产生的提示(敏感头替换、不支持的部分等) */
|
|
9
|
+
warnings: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ApiImportDialogProps {
|
|
12
|
+
open: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* 确认插入:actions 为所选接口生成的 HTTP 业务动作(按文档顺序)。
|
|
16
|
+
* 调用方负责把动作注册到动作库并把步骤追加到流程(可用 `appendImportedActions`);
|
|
17
|
+
* 对话框在回调返回后自动关闭。B2 向导的「从接口导入」可直接复用本组件。
|
|
18
|
+
*/
|
|
19
|
+
onInsert: (actions: ActionDefinition[], info: ApiImportInsertInfo) => void;
|
|
20
|
+
/** 已存在的动作 id,用于避免重复导入时 id 冲突 */
|
|
21
|
+
existingActionIds?: Iterable<string>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 接口导入对话框:粘贴或上传 -> 识别格式 -> 勾选接口 -> 插入为步骤。
|
|
25
|
+
* 外层仅在打开时挂载内容,因此每次打开都是干净状态。
|
|
26
|
+
*/
|
|
27
|
+
export declare const ApiImportDialog: React.FC<ApiImportDialogProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ModalShellProps {
|
|
3
|
+
/** 用于 aria-labelledby 的标题元素 id */
|
|
4
|
+
titleId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
width?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 自助接入弹窗外壳:Portal 渲染到 body,并带上 data-mode / data-brand 使主题变量生效。
|
|
13
|
+
* 无障碍:role="dialog" + aria-modal + 标题关联;Esc 关闭;Tab 在弹窗内循环;关闭后焦点回到打开前的元素。
|
|
14
|
+
*/
|
|
15
|
+
export declare function ModalShell({ titleId, title, onClose, children, footer, width }: ModalShellProps): import("react").ReactPortal | null;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { OnboardingProvider, ProductInfo } from '../../providers/types';
|
|
2
|
+
import type { WorkflowLevel } from '../../types/workflowLibrary';
|
|
3
|
+
import type { IdeEventName } from '../../telemetry/types';
|
|
4
|
+
import type { OnboardingCreateResult } from './OnboardingWizard';
|
|
5
|
+
import type { OnboardingData } from './useOnboardingData';
|
|
6
|
+
/** 向导创建骨架后、选择了模板 / 导入时暂存的流程身份,供宿主在后续步骤里保留名称 */
|
|
7
|
+
export interface PendingIdentity {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
ownerEmail?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface OnboardingControllerOptions {
|
|
13
|
+
/** 解析后的 providers.onboarding;不存在时一切入口都不出现 */
|
|
14
|
+
provider: OnboardingProvider | undefined;
|
|
15
|
+
/** useTelemetry 返回的 track */
|
|
16
|
+
track: (name: IdeEventName, props?: Record<string, unknown>) => void;
|
|
17
|
+
/** 只读 / 运行态时隐藏入口 */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** 向导「模板中心」起点的回调;不提供则隐藏该选项 */
|
|
20
|
+
onPickTemplate?: () => void;
|
|
21
|
+
/** 向导「从接口导入」起点的回调;不提供则隐藏该选项 */
|
|
22
|
+
onImportApi?: () => void;
|
|
23
|
+
ownerEmail?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface OnboardingController {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
data: OnboardingData;
|
|
28
|
+
/** 向导选择的层级;宿主没有传 currentWorkflowLevel 时作为默认值 */
|
|
29
|
+
level: WorkflowLevel | undefined;
|
|
30
|
+
wizardOpen: boolean;
|
|
31
|
+
promoOpen: boolean;
|
|
32
|
+
openWizard: () => void;
|
|
33
|
+
openPromotion: () => void;
|
|
34
|
+
/** 当前流程是否可申请上线(名称可解析且类型为 tmp) */
|
|
35
|
+
canPromote: boolean;
|
|
36
|
+
/** 是否显示空画布的「开始试用」引导 */
|
|
37
|
+
showGuide: boolean;
|
|
38
|
+
dismissGuide: () => void;
|
|
39
|
+
/** 取走并清空暂存的流程身份(选了模板 / 导入后使用) */
|
|
40
|
+
takePendingIdentity: () => PendingIdentity | null;
|
|
41
|
+
provider: OnboardingProvider | undefined;
|
|
42
|
+
/** 以下供 OnboardingOverlays 使用 */
|
|
43
|
+
close: () => void;
|
|
44
|
+
handleCreate: (r: OnboardingCreateResult) => void;
|
|
45
|
+
handleTrialStarted: (p: ProductInfo) => void;
|
|
46
|
+
onPickTemplate?: () => void;
|
|
47
|
+
onImportApi?: () => void;
|
|
48
|
+
ownerEmail?: string;
|
|
49
|
+
track: OnboardingControllerOptions['track'];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* IDE 内部使用:把自助接入的状态与动作集中在一处,IDE 只需渲染
|
|
53
|
+
* `<OnboardingToolbarButtons>`、`<OnboardingOverlays>` 与(可选)引导卡片。
|
|
54
|
+
*/
|
|
55
|
+
export declare function useOnboardingController(opts: OnboardingControllerOptions): OnboardingController;
|
|
56
|
+
/** 工具栏入口:「新建流程」与「申请上线」。没有 onboarding provider 时不渲染任何内容 */
|
|
57
|
+
export declare function OnboardingToolbarButtons({ c }: {
|
|
58
|
+
c: OnboardingController;
|
|
59
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
60
|
+
/** 弹窗:向导与申请上线面板(Portal 渲染,自带主题属性) */
|
|
61
|
+
export declare function OnboardingOverlays({ c }: {
|
|
62
|
+
c: OnboardingController;
|
|
63
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
64
|
+
/** 空画布引导:覆盖整个 IDE 的半透明层(不拦截点击),卡片居中;仅 `c.showGuide` 时渲染 */
|
|
65
|
+
export declare function OnboardingGuideOverlay({ c }: {
|
|
66
|
+
c: OnboardingController;
|
|
67
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface OnboardingGuideCardProps {
|
|
2
|
+
onStart: () => void;
|
|
3
|
+
/** 提供时显示「暂不使用」,用于露出画布原有的空状态 */
|
|
4
|
+
onDismiss?: () => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 空画布上的「开始试用」引导卡片。
|
|
8
|
+
* 仅在测试环境开放自助试用且用户还没有所属产品时由宿主显示。
|
|
9
|
+
*/
|
|
10
|
+
export declare function OnboardingGuideCard({ onStart, onDismiss }: OnboardingGuideCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { OnboardingProvider, ProductInfo } from '../../providers/types';
|
|
2
|
+
import type { WorkflowDef } from '../../types/conductor';
|
|
3
|
+
import type { WorkflowLevel } from '../../types/workflowLibrary';
|
|
4
|
+
import type { StartSource } from '../../onboarding/wizardState';
|
|
5
|
+
export interface OnboardingCreateResult {
|
|
6
|
+
/** 向导生成的骨架定义(名称已按规范拼好) */
|
|
7
|
+
def: WorkflowDef;
|
|
8
|
+
/** 所选层级,宿主可据此设置 `currentWorkflowLevel` */
|
|
9
|
+
level: WorkflowLevel;
|
|
10
|
+
/** 起点:空白 / 模板中心 / 从接口导入 */
|
|
11
|
+
source: StartSource;
|
|
12
|
+
}
|
|
13
|
+
export interface OnboardingWizardProps {
|
|
14
|
+
/** 只用到 startTrial;传完整的 OnboardingProvider 即可 */
|
|
15
|
+
provider: Pick<OnboardingProvider, 'startTrial'>;
|
|
16
|
+
/** 当前环境是否开放自助试用(决定能否登记新产品、类型是否固定 tmp) */
|
|
17
|
+
trialEnabled: boolean;
|
|
18
|
+
/** 我的产品 */
|
|
19
|
+
products: ProductInfo[];
|
|
20
|
+
/** 业务域列表 */
|
|
21
|
+
domains: string[];
|
|
22
|
+
/** 默认层级,默认 L2 */
|
|
23
|
+
defaultLevel?: WorkflowLevel;
|
|
24
|
+
/** 写入骨架定义的负责人邮箱 */
|
|
25
|
+
ownerEmail?: string;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
/** 完成:交给宿主把骨架设为当前流程 */
|
|
28
|
+
onCreate: (result: OnboardingCreateResult) => void;
|
|
29
|
+
/** 新产品登记成功(宿主可刷新「我的产品」、上报 trial_started) */
|
|
30
|
+
onTrialStarted?: (product: ProductInfo) => void;
|
|
31
|
+
/** 选择「从模板中心开始」:创建骨架后调用,宿主打开模板中心;不提供则隐藏该选项 */
|
|
32
|
+
onPickTemplate?: () => void;
|
|
33
|
+
/** 选择「从接口导入」:创建骨架后调用,宿主打开导入面板;不提供则隐藏该选项 */
|
|
34
|
+
onImportApi?: () => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 自助接入向导(3 步弹窗):产品 → 命名 → 起点。
|
|
38
|
+
* - 试用环境可登记新产品(startTrial);产品被他人占用时提示联系负责人;
|
|
39
|
+
* - 接口失败停在当前步,显示「重试」,已填内容保留;
|
|
40
|
+
* - 完成后用 `onCreate({ def, level, source })` 交给宿主设置当前流程。
|
|
41
|
+
*/
|
|
42
|
+
export declare function OnboardingWizard({ provider, trialEnabled, products, domains, defaultLevel, ownerEmail, onClose, onCreate, onTrialStarted, onPickTemplate, onImportApi, }: OnboardingWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { OnboardingProvider, PromotionStatus } from '../../providers/types';
|
|
2
|
+
import type { PromotionTargetType } from '../../onboarding/naming';
|
|
3
|
+
export interface PromotionPanelProps {
|
|
4
|
+
/** 用到 requestPromotion / getPromotion */
|
|
5
|
+
provider: Pick<OnboardingProvider, 'requestPromotion' | 'getPromotion'>;
|
|
6
|
+
/** 当前(tmp 类型的)流程名称 */
|
|
7
|
+
workflowName: string;
|
|
8
|
+
/** 当前流程版本 */
|
|
9
|
+
version: number;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/** 提交成功(埋点:promotion_requested) */
|
|
12
|
+
onRequested?: (targetType: PromotionTargetType) => void;
|
|
13
|
+
/** 状态变化(埋点:promotion_state),同一状态只回调一次 */
|
|
14
|
+
onStateChange?: (state: PromotionStatus['state']) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 申请上线面板:选择目标类型 → 预览正式名称 → 提交 → 轮询进度(指数退避,30 秒封顶)。
|
|
18
|
+
* 轮询在关闭面板 / 卸载时中止。
|
|
19
|
+
*/
|
|
20
|
+
export declare function PromotionPanel({ provider, workflowName, version, onClose, onRequested, onStateChange }: PromotionPanelProps): import("react/jsx-runtime").JSX.Element;
|