@blueking/bkflow-canvas-editor 1.1.0-beta.4 → 1.1.0-beta.41

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
@@ -1,9 +1,10 @@
1
1
  import * as vue from 'vue';
2
- import { ComputedRef, Ref } from 'vue';
2
+ import { Component, ComputedRef, Ref, App } from 'vue';
3
3
  import { AxiosInstance, AxiosRequestConfig } from 'axios';
4
4
  import * as _blueking_flow_canvas from '@blueking/flow-canvas';
5
- import { CanvasUiEvent, QuickAddConfig, CanvasSchema, FlowModel, FlowNodeModel, NodeActionsConfig, ConnectionValidator, CanvasPlugin, CanvasToolbarItem, CommandEnvelope } from '@blueking/flow-canvas';
6
- export { InsertDirection, QuickAddConfig, QuickAddInsertDirectionResolver, QuickAddPortResolver } from '@blueking/flow-canvas';
5
+ import { ZoomToFitOptions, CanvasUiEvent, QuickAddConfig, CanvasSchema, FlowModel, FlowNodeModel, NodeActionsConfig, ConnectionValidator, CanvasPlugin, CanvasToolbarItem, CommandEnvelope } from '@blueking/flow-canvas';
6
+ export { Locale, MessageTree, Translator, getLocale, registerMessages, setLocale, setTranslator, t } from '@blueking/flow-canvas';
7
+ import { defaultRootConfig } from 'bkui-vue/lib/config-provider';
7
8
 
8
9
  /**
9
10
  * Flow API 配置接口
@@ -18,10 +19,7 @@ interface FlowApiConfig {
18
19
  /** CSRF cookie 名称(可选,用于创建新的 axios 实例时设置 xsrfCookieName) */
19
20
  xsrfCookieName?: string;
20
21
  /** 作用域数据(必需,由外部传入) */
21
- scopeData: {
22
- scope_type: string;
23
- scope_value: number;
24
- };
22
+ scopeData: ScopeData;
25
23
  /**
26
24
  * 用户查询 API 地址(可选)
27
25
  * @deprecated 请改用 FlowEdit/FlowView 顶层组件的 `memberSelectorConfig.fetchUserApi`。
@@ -31,12 +29,18 @@ interface FlowApiConfig {
31
29
  /** 是否启用第三方插件(可选,默认为 true) */
32
30
  enableThirdPlugin?: boolean;
33
31
  }
32
+ interface ScopeData {
33
+ scope_type: string;
34
+ scope_value: number;
35
+ /** 业务方传入的空间 ID,语义独立于 scope_value。 */
36
+ space_id: number;
37
+ }
34
38
 
35
- type __VLS_Slots$5 = {
39
+ type __VLS_Slots$7 = {
36
40
  header?: () => any;
37
41
  extend?: () => any;
38
42
  };
39
- type __VLS_Props$6 = {
43
+ type __VLS_Props$7 = {
40
44
  flowId: string;
41
45
  taskId: string | number;
42
46
  apiConfig: FlowApiConfig;
@@ -44,17 +48,17 @@ type __VLS_Props$6 = {
44
48
  defaultZoom?: number;
45
49
  onBack?: () => void;
46
50
  };
47
- declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$6, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
51
+ declare const __VLS_base$7: vue.DefineComponent<__VLS_Props$7, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
48
52
  back: () => any;
49
- }, string, vue.PublicProps, Readonly<__VLS_Props$6> & Readonly<{
53
+ }, string, vue.PublicProps, Readonly<__VLS_Props$7> & Readonly<{
50
54
  onBack?: (() => any) | undefined;
51
55
  }>, {
52
56
  defaultZoom: number;
53
57
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
54
- declare const __VLS_export$6: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
55
- declare const _default$7: typeof __VLS_export$6;
58
+ declare const __VLS_export$7: __VLS_WithSlots$7<typeof __VLS_base$7, __VLS_Slots$7>;
59
+ declare const _default$8: typeof __VLS_export$7;
56
60
 
57
- type __VLS_WithSlots$5<T, S> = T & {
61
+ type __VLS_WithSlots$7<T, S> = T & {
58
62
  new (): {
59
63
  $slots: S;
60
64
  };
@@ -62,11 +66,11 @@ type __VLS_WithSlots$5<T, S> = T & {
62
66
 
63
67
  declare namespace __mock_vue {
64
68
  export {
65
- _default$7 as default,
69
+ _default$8 as default,
66
70
  };
67
71
  }
68
72
 
69
- type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED';
73
+ type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED' | 'SKIP';
70
74
  type ExecutionNodeAction = 'retry' | 'skip' | 'resume' | 'approve' | 'forceFail' | 'gatewaySkip';
71
75
  interface NodeExecutionState {
72
76
  status: NodeExecutionStatus;
@@ -110,6 +114,11 @@ interface NodeExecutionState {
110
114
  actions?: ExecutionNodeAction[];
111
115
  /** 兼容旧版后端直接透出的动作数组字段 */
112
116
  action_list?: ExecutionNodeAction[];
117
+ /**
118
+ * 条件网关命中的出边 flow_id。
119
+ * 有值时执行态连线优先按它着色,不要求目标节点已经执行(网关单步不会跑下游)。
120
+ */
121
+ selectedFlowIds?: string[];
113
122
  }
114
123
  type TaskExecutionStates = Record<string, NodeExecutionState>;
115
124
 
@@ -142,13 +151,26 @@ interface ActivityComponent {
142
151
  api_meta?: {
143
152
  id: string;
144
153
  name: string;
154
+ /** 项目内 uniform_api 仍可能写入;标准运维 V4 对齐 bkflow,不再落这个字段 */
145
155
  alias?: string;
146
- meta_url: string;
156
+ /** 目录项有 meta_url 才写;V4 开放插件通常只有 meta_url_template */
157
+ meta_url?: string;
147
158
  api_key: string;
148
159
  category: {
149
160
  id: string;
150
161
  name: string;
151
162
  };
163
+ // 标准运维 V4 开放插件的落库字段,对齐 bkflow NodeConfig.vue `if (isV4)` 保存分支
164
+ plugin_source?: string;
165
+ plugin_code?: string;
166
+ plugin_version?: string;
167
+ wrapper_version?: string;
168
+ versions?: string[];
169
+ meta_url_template?: string;
170
+ latest_version?: string;
171
+ default_version?: string;
172
+ desc?: string;
173
+ source_key?: string;
152
174
  };
153
175
  }
154
176
 
@@ -443,15 +465,20 @@ interface FlowDraftDetail {
443
465
  md5sum: string;
444
466
  pipeline_tree: PipelineTree;
445
467
  }
468
+ interface SpaceUniformApiEntry {
469
+ meta_apis: string;
470
+ api_categories?: string;
471
+ display_name?: string;
472
+ source_key?: string;
473
+ catalog_mode?: 'remote' | 'cache_first' | 'cache_only';
474
+ headers?: Record<string, string>;
475
+ }
446
476
  interface SpaceFlowConfig {
447
477
  gateway_expression?: 'boolrule' | 'FEEL' | 'MAKO';
448
- uiform_api?: {
449
- api: Record<string, {
450
- api_category: string;
451
- display_name: string;
452
- meta_apis: string;
453
- }>;
454
- };
478
+ uniform_api?: {
479
+ api?: Record<string, SpaceUniformApiEntry | null>;
480
+ common?: SpaceUniformApiEntry | null;
481
+ } | null;
455
482
  }
456
483
  interface UpdateFlowParams {
457
484
  name: string;
@@ -481,6 +508,88 @@ interface PluginMetaItem {
481
508
  icon?: string;
482
509
  category_id: string;
483
510
  }
511
+ interface SopsPluginSourceItem {
512
+ id: string;
513
+ name: string;
514
+ /** 空间配置 uniform_api.api[api_name].source_key,缺省时等于 api_name */
515
+ source_key?: string;
516
+ }
517
+ interface SopsPluginCategory {
518
+ id: string;
519
+ name: string;
520
+ }
521
+ interface SopsPluginItem {
522
+ id: string;
523
+ name: string;
524
+ category?: string;
525
+ category_name?: string;
526
+ description?: string;
527
+ meta_url?: string;
528
+ meta_url_template?: string;
529
+ plugin_source?: string;
530
+ plugin_code?: string;
531
+ source_key?: string;
532
+ wrapper_version?: string;
533
+ default_version?: string;
534
+ latest_version?: string;
535
+ versions?: string[];
536
+ }
537
+ interface SopsPluginListResult {
538
+ total: number;
539
+ apis: SopsPluginItem[];
540
+ }
541
+ /**
542
+ * 统一插件详情里的表单描述符(bkflow V4 开放插件协议)。
543
+ * component_js / renderform(string) 走 $.atoms 注册链路,key 即注册用的 atom key;
544
+ * is_embedded 为 false 时 data 是脚本地址,否则 data 是脚本源码。
545
+ */
546
+ type SopsPluginFormDescriptor = {
547
+ type: 'component_js';
548
+ key: string;
549
+ data: string;
550
+ base?: string;
551
+ is_embedded?: boolean;
552
+ } | {
553
+ type: 'renderform';
554
+ key?: string;
555
+ data: string | RenderformInputsItem[] | Record<string, unknown>;
556
+ base?: string;
557
+ is_embedded?: boolean;
558
+ } | {
559
+ type: 'jsonschema';
560
+ data: JsonschemaformInputs;
561
+ } | {
562
+ type: 'api_plugin_json';
563
+ data?: Record<string, unknown>;
564
+ };
565
+ interface SopsPluginDetail {
566
+ plugin_type: 'component' | 'remote_plugin' | 'uniform_api';
567
+ plugin_code: string;
568
+ plugin_version: string;
569
+ source_key: string;
570
+ plugin_source?: string;
571
+ protocol?: string;
572
+ wrapper_version?: string;
573
+ name: string;
574
+ description?: string;
575
+ inputs?: UniformApiPluginInputsItem[];
576
+ outputs?: PluginOutputItem[];
577
+ credentials?: Record<string, unknown> | null;
578
+ forms?: {
579
+ input?: SopsPluginFormDescriptor | null;
580
+ output?: SopsPluginFormDescriptor | null;
581
+ } | null;
582
+ form_schema?: Record<string, unknown> | null;
583
+ /** 表单脚本运行所需的上下文(site_url / project 等),由插件提供方下发 */
584
+ form_context?: Record<string, unknown> | null;
585
+ execution_kind?: string;
586
+ url?: string;
587
+ methods?: string[];
588
+ response_data_path?: string;
589
+ polling?: Record<string, any> | null;
590
+ callback?: Record<string, any> | null;
591
+ credential_key?: string;
592
+ }
484
593
  interface BkflowThirdPartyPluginGroupItem {
485
594
  code_name: string;
486
595
  id: number;
@@ -564,7 +673,7 @@ interface BkflowThirdPartyPluginAppDetail {
564
673
  };
565
674
  }
566
675
  interface GroupsPluginItem extends PluginGroupConfig {
567
- children: (PluginMetaItem | BkflowThirdPartyPluginGroupItem)[];
676
+ children: (PluginMetaItem | BkflowThirdPartyPluginGroupItem | SopsPluginSourceItem)[];
568
677
  }
569
678
  interface DndNodeItem {
570
679
  type: string;
@@ -667,14 +776,29 @@ interface PluginOutputItem {
667
776
  type: string;
668
777
  name: string;
669
778
  }
670
- interface PluginDetailCommon {
779
+ /**
780
+ * 输入表单的渲染方式与表单项数据。
781
+ *
782
+ * 两者必须配对:renderform 的表单项以 tag_code 标识、uniformApiForm 用 key,jsonschemaform
783
+ * 给的则是一个 schema 对象而非数组。做成判别联合,取默认值、取字段名、选渲染组件这些地方
784
+ * 就必须先按 inputParamsFormType 收窄,漏掉一种由编译器报出来,而不是在遍历时崩掉。
785
+ */
786
+ type PluginInputForm = {
787
+ inputParamsFormType: 'renderform';
788
+ inputs: RenderformInputsItem[];
789
+ } | {
790
+ inputParamsFormType: 'jsonschemaform';
791
+ inputs: JsonschemaformInputs;
792
+ } | {
793
+ inputParamsFormType: 'uniformApiForm';
794
+ inputs: UniformApiPluginInputsItem[];
795
+ };
796
+ interface PluginDetailBase {
671
797
  code: string;
672
798
  name: string;
673
799
  desc: string;
674
800
  version: string;
675
- inputs: UniformApiPluginInputsItem[] | RenderformInputsItem[] | JsonschemaformInputs;
676
801
  outputs: PluginOutputItem[];
677
- inputParamsFormType: string;
678
802
  versions?: string[];
679
803
  category?: string;
680
804
  group?: string;
@@ -682,10 +806,20 @@ interface PluginDetailCommon {
682
806
  methods?: string[];
683
807
  uniformApiName?: string;
684
808
  polling?: Record<string, any>;
809
+ callback?: Record<string, any>;
810
+ response_data_path?: string;
685
811
  credential_key?: string;
812
+ /** V4 开放插件身份,执行时引擎从 component.data 的同名隐藏字段读取 */
813
+ openPluginIdentity?: {
814
+ pluginId: string;
815
+ pluginVersion: string;
816
+ sourceKey: string;
817
+ wrapperVersion: string;
818
+ };
686
819
  component_type?: string;
687
820
  displayGroupName?: string;
688
821
  }
822
+ type PluginDetailCommon = PluginDetailBase & PluginInputForm;
689
823
  interface CustomVariableType {
690
824
  name: string;
691
825
  form: string;
@@ -696,11 +830,428 @@ interface CustomVariableType {
696
830
  code: string;
697
831
  }
698
832
 
699
- interface FlowEditExpose {
833
+ /**
834
+ * filter 变量的宿主配置契约与注入。
835
+ *
836
+ * `RetrievalFilterField` 与 `getValues` 的返回结构和宿主
837
+ * `src/components/bk-monitor-retieval-filter/types.d.ts` 里的 `IFilterField`
838
+ * 逐字段一致——依赖包不带 `.d.ts`,宿主已经自己维护了一份,这里刻意同源,
839
+ * 避免出现两套形状相近但不兼容的类型。
840
+ */
841
+
842
+ /**
843
+ * 关联节点的插件配置摘要。getFields 在节点表单未挂载时要用它自行取维度,
844
+ * 不能依赖「打开过节点配置」留下的内存缓存。
845
+ */
846
+ interface FilterVariableSourceNodeComponent {
847
+ code?: string;
848
+ /** `name` 是插件的稳定标识(如 log_plugin);`id` 随环境变化,不能用来做判断 */
849
+ api_meta?: {
850
+ id?: string;
851
+ name?: string;
852
+ };
853
+ data?: Record<string, {
854
+ value?: unknown;
855
+ }>;
856
+ }
857
+ /** 关联来源。创建时由宿主锁定,用户不能在编辑器里改 */
858
+ interface FilterVariableSourceContext {
859
+ sourceNodeId: string;
860
+ sourceNodeName: string;
861
+ /** 关联表单项稳定 KEY,例如 query_condition */
862
+ sourceFieldKey: string;
863
+ sourceFieldName: string;
864
+ /** 关联节点当前 component,供宿主 getFields 在节点配置未打开时解析 */
865
+ sourceNodeComponent?: FilterVariableSourceNodeComponent;
866
+ }
867
+ interface RetrievalFilterField {
868
+ alias: string;
869
+ name: string;
870
+ type: string;
871
+ isEnableOptions?: boolean;
872
+ methods: Array<{
873
+ alias: string;
874
+ value: string;
875
+ placeholder?: string;
876
+ wildcardValue?: string;
877
+ options?: unknown[];
878
+ }>;
879
+ }
880
+ /**
881
+ * 候选值查询参数。
882
+ *
883
+ * 这是适配器归一化之后的稳定形状:依赖组件内部有四条 `getValueFn` 调用路径,
884
+ * 参数形状互不一致(`search`/`field`/`isInit__` vs `where` + `operator` vs
885
+ * `where` + `method`),禁止把 raw params 直接透给宿主。升级依赖时需重新核对。
886
+ */
887
+ interface FilterCandidateQuery {
888
+ field?: string;
889
+ keyword?: string;
890
+ limit?: number;
891
+ method?: string;
892
+ /** 通配搜索路径会带 `options.is_wildcard`,宿主据此选择精确或模糊匹配 */
893
+ isWildcard?: boolean;
894
+ }
895
+ interface FilterVariableConfig {
896
+ /**
897
+ * 宿主注入的 **原始** `RetrievalFilter` 组件,即
898
+ * `import { RetrievalFilter } from '@blueking/monitor-vue3-components'`。
899
+ *
900
+ * 必须是原始组件而不是宿主自己的封装(例如 bk-incident 的
901
+ * `BkMonitorRetievalFilter`):封装层 props 是 `filters/fieldList/query`、事件是
902
+ * `change`,与适配器传入的 `fields/where` + `whereChange` 不兼容;且它的
903
+ * `getValueFn` 只透传 `fields`,会丢掉搜索关键词,候选值搜索无法工作。
904
+ *
905
+ * 编辑器不把该依赖列入自身 dependencies,所以拿不到注入就是不可用。
906
+ */
907
+ retrievalFilterComponent: Component;
908
+ getFields(source: FilterVariableSourceContext): Promise<RetrievalFilterField[]>;
909
+ getValues(source: FilterVariableSourceContext, params: FilterCandidateQuery): Promise<{
910
+ count: number;
911
+ list: Array<{
912
+ id: string;
913
+ name: string;
914
+ }>;
915
+ }>;
916
+ /** 传给依赖组件的 `zIndex`,用于让候选值弹层盖在侧滑之上 */
917
+ popupZIndex?: number;
918
+ loadDelay?: number;
919
+ limit?: number;
920
+ }
921
+ /**
922
+ * 在顶层组件中提供 FilterVariableConfig。
923
+ *
924
+ * 与 `provideMemberSelectorConfig` 一致:`config` 为 undefined 时不调用 provide,
925
+ * 避免遮蔽父级已提供的配置。
926
+ */
927
+ declare function provideFilterVariableConfig(config?: FilterVariableConfig): void;
928
+
929
+ interface CreateVariablePayload {
930
+ keyword?: string;
931
+ cursorIndex?: number;
932
+ defaultCustomType?: string;
933
+ }
934
+ /**
935
+ * 宿主自定义的候选项来源标识。
936
+ *
937
+ * 编辑器**不解释**它的内容,只做原样存储与回传:`key` 用于让宿主找到自己的加载器,
938
+ * `params` 放宿主拉取时需要的补充信息。
939
+ *
940
+ * 之所以由宿主带进来而不是编辑器从 pipeline_tree 反查关联节点的插件:节点配置尚未
941
+ * 保存时,`activities[nodeId].component` 还是换插件之前的那个,反查会拿到错的插件。
942
+ */
943
+ interface SelectRelatedOptionSourceRef {
944
+ key: string;
945
+ params?: Record<string, unknown>;
946
+ }
947
+ /**
948
+ * select 变量「关联数据」的来源,由宿主在节点表单里发起受控创建时锁定。
949
+ * 与 filter 的 FilterVariableSourceContext 平行。
950
+ */
951
+ interface SelectRelatedSourceContext {
952
+ sourceNodeId: string;
953
+ /**
954
+ * 关联来源在「关联数据」栏展示的名字,由宿主决定放什么(bk-incident 放当前选中的插件名)。
955
+ *
956
+ * 它**优先于**画布实时解析的节点名:select 的关联源连同候选项来源一起冻结在创建时刻,
957
+ * 展示名跟着来源走而不是跟着节点实例走。不传则回落实时节点名、再回落裸 nodeId——
958
+ * 而空节点选插件后配置尚未写回 pipeline_tree,实时节点名恰恰是空的。
959
+ */
960
+ sourceNodeName?: string;
961
+ /** 关联表单项稳定 KEY,例如 index_set_id */
962
+ sourceFieldKey: string;
963
+ /**
964
+ * 关联表单项的展示名,例如「查询条件」——即节点表单上那一栏的标题,不是 fieldKey 本身。
965
+ * 全局变量侧滑没有加载插件 schema 的时机,不带进来就只能显示裸 fieldKey。
966
+ */
967
+ sourceFieldName?: string;
968
+ /** 候选项从哪来。缺省则该变量没有可拉取的候选项 */
969
+ optionSource?: SelectRelatedOptionSourceRef;
970
+ }
971
+
972
+ /**
973
+ * filter(复合条件选择)变量的领域逻辑。
974
+ *
975
+ * `Variable.value` 直接就是提交给后端的条件数组 `{ key, operator, value, options }[]`,
976
+ * 不引入编辑态中间形状:编辑器与依赖组件之间只有一处命名差异(`operator` ⇄ `method`),
977
+ * 那一次转换收在适配器边界上(见 retrieval-filter-adapter/index.vue)。
978
+ *
979
+ * 关联标识复用 `Variable.source_info`(C-09),不另立字段。既有的节点删除清理逻辑
980
+ * 原先只放行 component_inputs / component_outputs,已显式把 filter 一并纳入
981
+ * (canvas-adapter/plugin/index.ts 的节点删除,以及 node-config-sideslider 保存时
982
+ * 对照节点数据里是否还引用 `${var}`)。节点删掉或表单里取消引用后不清理,
983
+ * 就会留下用户无法修复的孤儿变量——关联信息是只读的。
984
+ */
985
+
986
+ /**
987
+ * 条件值标量。
988
+ *
989
+ * 必须允许 number:依赖协议里 `value` 是 `number[] | string[]`,整型字段的候选值
990
+ * 就是数字,统一转成字符串会改变提交给后端的类型。
991
+ */
992
+ type FilterConditionValue = string | number;
993
+ /**
994
+ * 单条条件的附加选项。
995
+ *
996
+ * `is_wildcard`(通配匹配)与 `group_relation`(多值关系)由依赖组件在运算符的
997
+ * `methods[].options` 里声明、由用户勾选,并原样带在条件上。丢掉它等于静默改写
998
+ * 用户的选择,所以读写两侧都必须透传,也不做已知字段白名单。
999
+ */
1000
+ interface FilterConditionOptions {
1001
+ is_wildcard?: boolean;
1002
+ group_relation?: boolean;
1003
+ [key: string]: unknown;
1004
+ }
1005
+ /** 单条条件,即 Variable.value 的元素。形状对齐宿主既有协议 */
1006
+ interface FilterWhereItem {
1007
+ key: string;
1008
+ operator: string;
1009
+ value: FilterConditionValue[];
1010
+ options?: FilterConditionOptions;
1011
+ }
1012
+ type FilterWhereValue = FilterWhereItem[];
1013
+
1014
+ /**
1015
+ * 全局变量受控创建的对外契约与守卫。
1016
+ *
1017
+ * filter 变量不能从普通「新建变量」入口创建——它必须携带关联节点与关联字段,
1018
+ * 所以对外只暴露这一个方法,由宿主在节点表单里发起。
1019
+ *
1020
+ * select 的「关联数据」态同样只能受控创建(`selectRelatedContext`),但它是**可选**的:
1021
+ * select 缺少关联源时退化为「手动输入」,仍是一个可用的变量,不像 filter 那样必须锁定。
1022
+ */
1023
+
1024
+ interface OpenFilterVariableCreateRequest {
1025
+ defaultCustomType: 'filter';
1026
+ /** 关联来源,filter 场景必填 */
1027
+ filterContext: FilterVariableSourceContext;
1028
+ selectRelatedContext?: never;
1029
+ keyword?: string;
1030
+ /**
1031
+ * 可选:把宿主表单里已配好的真实维度条件带进来作为默认值。
1032
+ * 已 hook 的 `${var}` 占位会被丢掉,不能当默认条件。
1033
+ */
1034
+ initialValue?: FilterWhereValue;
1035
+ onCreated?: (variable: Variable) => void;
1036
+ }
1037
+ interface OpenStandardVariableCreateRequest {
1038
+ defaultCustomType?: string;
1039
+ filterContext?: never;
1040
+ /**
1041
+ * 可选:把 select 变量初始化成「关联数据」态并锁定关联源。
1042
+ * 不传则 select 按「手动输入」初始化。
1043
+ */
1044
+ selectRelatedContext?: SelectRelatedSourceContext;
1045
+ keyword?: string;
1046
+ cursorIndex?: number;
1047
+ onCreated?: (variable: Variable) => void;
1048
+ }
1049
+ type OpenGlobalVariableCreateRequest = OpenFilterVariableCreateRequest | OpenStandardVariableCreateRequest;
1050
+
1051
+ /** 画布视口相关方法,供 FlowView / FlowEdit 对外透传 */
1052
+ interface CanvasViewportExpose {
1053
+ zoomToFit: (options?: ZoomToFitOptions) => void;
1054
+ centerContent: () => void;
1055
+ getZoom: () => number;
1056
+ }
1057
+ /** 受控创建能力。返回 false 表示未通过同步守卫,开发态会打印具体原因 */
1058
+ interface GlobalVariableCreateExpose {
1059
+ openGlobalVariableCreate: (request?: OpenGlobalVariableCreateRequest) => boolean;
1060
+ }
1061
+ interface FlowEditExpose extends CanvasViewportExpose, GlobalVariableCreateExpose {
700
1062
  isFlowEdited: boolean;
701
1063
  updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
702
1064
  openGlobalVariables: () => void;
703
1065
  }
1066
+ interface FlowViewExpose extends CanvasViewportExpose {
1067
+ }
1068
+ /** FlowDetail 统一详情页对外暴露(设计 §7.1) */
1069
+ interface FlowDetailExpose extends CanvasViewportExpose, GlobalVariableCreateExpose {
1070
+ isFlowEdited: boolean;
1071
+ updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
1072
+ openGlobalVariables: () => void;
1073
+ refreshDebugContext: () => Promise<void>;
1074
+ openDebugResult: (nodeId?: string) => void;
1075
+ }
1076
+
1077
+ type DebugContextStatus = 'idle' | 'running' | 'terminating';
1078
+ type DebugNodeStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'finished' | 'failed' | 'revoked' | 'suspended' | 'skipped';
1079
+ type DebugExecutionMode = 'real' | 'mock';
1080
+ interface DebugMissingVar {
1081
+ key: string;
1082
+ source_node_id: string | null;
1083
+ }
1084
+ type DebugRunType = 'global' | 'step';
1085
+ type DebugRunStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'terminating' | 'finished' | 'failed' | 'revoked';
1086
+ /** 运行级 / 节点级错误详情(last_error_detail、nodes[].error_detail)。 */
1087
+ interface DebugErrorFailure {
1088
+ message: string;
1089
+ node_id?: string;
1090
+ template_node_id?: string;
1091
+ [key: string]: unknown;
1092
+ }
1093
+ interface DebugErrorDetail {
1094
+ type?: string;
1095
+ message?: string;
1096
+ task_id?: number | string;
1097
+ failures?: DebugErrorFailure[];
1098
+ [key: string]: unknown;
1099
+ }
1100
+ /** 条件网关分支求值结果(`debug_context.nodes[].condition_results`)。 */
1101
+ interface DebugConditionResult {
1102
+ flow_id: string;
1103
+ name?: string;
1104
+ expression?: string;
1105
+ resolved_expression?: string;
1106
+ matched?: boolean;
1107
+ [key: string]: unknown;
1108
+ }
1109
+ interface DebugContextNode {
1110
+ node_id: string;
1111
+ node_type: string;
1112
+ execution_mode: DebugExecutionMode;
1113
+ status: DebugNodeStatus;
1114
+ can_step: boolean;
1115
+ missing_vars: DebugMissingVar[];
1116
+ waiting_reason?: string | null;
1117
+ /** 是否支持单步调试;并行/汇聚网关为 false,仅用于展示全局调试状态。 */
1118
+ supports_step?: boolean;
1119
+ /** 是否支持 Mock;全部网关为 false。 */
1120
+ supports_mock?: boolean;
1121
+ mock_result?: 'success' | 'fail' | null;
1122
+ error_detail?: DebugErrorDetail | string | null;
1123
+ duration_ms?: number | null;
1124
+ log_ref?: {
1125
+ instance_id: number | string;
1126
+ node_id: string;
1127
+ version: string;
1128
+ } | null;
1129
+ mock_outputs?: Record<string, unknown> | null;
1130
+ mock_error?: string | null;
1131
+ outputs?: Record<string, unknown> | null;
1132
+ /** 条件网关命中的出边 flow_id;画布用它把命中连线标绿。 */
1133
+ selected_flow_ids?: string[];
1134
+ /** 条件网关每个分支的表达式与命中结果。 */
1135
+ condition_results?: DebugConditionResult[];
1136
+ }
1137
+ /**
1138
+ * /debug_context/ 顶层结构。
1139
+ *
1140
+ * 前端按 status 分支:
1141
+ * - running:任务定位用 active_*,进度用 last_run_status
1142
+ * - terminating:继续用 active_*,UI 展示「终止中」并轮询
1143
+ * - idle:active_* 为空,结果摘要用 last_*;last_task_id=null 表示尚无调试记录
1144
+ */
1145
+ interface DebugContext {
1146
+ template_id: number;
1147
+ status: DebugContextStatus;
1148
+ locked_by: string;
1149
+ active_task_id: number | string | null;
1150
+ active_run_type: DebugRunType | null;
1151
+ active_node_id: string | null;
1152
+ last_task_id: number | string | null;
1153
+ last_run_type: DebugRunType | null;
1154
+ last_run_status: DebugRunStatus | null;
1155
+ last_error_detail?: DebugErrorDetail | null;
1156
+ last_inputs?: Record<string, unknown>;
1157
+ global_vars: Record<string, unknown>;
1158
+ missing_vars?: DebugMissingVar[];
1159
+ nodes: DebugContextNode[];
1160
+ }
1161
+ interface DebugInputSchemaField {
1162
+ key: string;
1163
+ name: string;
1164
+ type: string;
1165
+ default?: unknown;
1166
+ required?: boolean;
1167
+ [key: string]: unknown;
1168
+ }
1169
+ interface DebugInputSchema {
1170
+ fields?: DebugInputSchemaField[];
1171
+ constants?: Record<string, unknown>;
1172
+ [key: string]: unknown;
1173
+ }
1174
+ interface DebugResetImpact {
1175
+ reset_node_ids: string[];
1176
+ reasons?: Record<string, string>;
1177
+ }
1178
+ interface UpdateNodeDebugMockResult {
1179
+ node_id: string;
1180
+ execution_mode: DebugExecutionMode;
1181
+ updated_global_vars?: Record<string, unknown>;
1182
+ [key: string]: unknown;
1183
+ }
1184
+ interface RunNodeDebugStepResult {
1185
+ node_id: string;
1186
+ status: DebugNodeStatus;
1187
+ outputs?: Record<string, unknown> | null;
1188
+ error_detail?: unknown;
1189
+ updated_global_vars?: Record<string, unknown>;
1190
+ log_ref?: DebugContextNode['log_ref'];
1191
+ selected_flow_ids?: string[];
1192
+ condition_results?: DebugConditionResult[];
1193
+ [key: string]: unknown;
1194
+ }
1195
+ interface RunGlobalDebugResult {
1196
+ task_id: number | string;
1197
+ status: DebugContextStatus;
1198
+ [key: string]: unknown;
1199
+ }
1200
+ /**
1201
+ * /debug_terminate/ 返回。
1202
+ *
1203
+ * 全局终止返回 `terminating`,需要继续轮询 /debug_context/ 直到 idle + last_run_status=revoked;
1204
+ * 单节点终止直接返回 `idle`,并用 reset_node_ids 告知哪些节点被恢复为「未调试」。
1205
+ */
1206
+ interface TerminateDebugResult {
1207
+ status?: DebugContextStatus;
1208
+ /** 单节点终止:被恢复为 not_run 的节点,本地需同步清空输入、输出、耗时、错误与日志。 */
1209
+ reset_node_ids?: string[];
1210
+ [key: string]: unknown;
1211
+ }
1212
+ interface DebugResetResult {
1213
+ reset_node_ids?: string[];
1214
+ [key: string]: unknown;
1215
+ }
1216
+ interface UpdateNodeDebugMockParams {
1217
+ templateId: string | number;
1218
+ nodeId: string;
1219
+ enable: boolean;
1220
+ mockResult?: 'success' | 'fail';
1221
+ mockOutputs?: Record<string, unknown>;
1222
+ mockError?: string;
1223
+ }
1224
+ interface RunNodeDebugStepParams {
1225
+ templateId: string | number;
1226
+ nodeId: string;
1227
+ mode: 'real' | 'mock';
1228
+ inputOverrides?: Record<string, unknown>;
1229
+ mockResult?: 'success' | 'fail';
1230
+ mockOutputs?: Record<string, unknown>;
1231
+ mockError?: string;
1232
+ }
1233
+ interface RunGlobalDebugParams {
1234
+ templateId: string | number;
1235
+ inputs: Record<string, unknown>;
1236
+ }
1237
+ interface TerminateDebugParams {
1238
+ templateId: string | number;
1239
+ nodeId?: string;
1240
+ }
1241
+ interface ResetDebugResultParams {
1242
+ templateId: string | number;
1243
+ nodeIds?: string[];
1244
+ }
1245
+ interface DebugApiServices {
1246
+ fetchDebugContext(templateId: string | number): Promise<DebugContext>;
1247
+ fetchDebugInputSchema(templateId: string | number): Promise<DebugInputSchema>;
1248
+ fetchDebugResetImpact(templateId: string | number): Promise<DebugResetImpact>;
1249
+ updateNodeDebugMock(params: UpdateNodeDebugMockParams): Promise<UpdateNodeDebugMockResult>;
1250
+ runNodeDebugStep(params: RunNodeDebugStepParams): Promise<RunNodeDebugStepResult>;
1251
+ runGlobalDebug(params: RunGlobalDebugParams): Promise<RunGlobalDebugResult>;
1252
+ terminateDebug(params: TerminateDebugParams): Promise<TerminateDebugResult>;
1253
+ resetDebugResult(params: ResetDebugResultParams): Promise<DebugResetResult>;
1254
+ }
704
1255
 
705
1256
  interface DrawPipelineParams {
706
1257
  pipeline_tree: PipelineTree;
@@ -730,6 +1281,7 @@ interface FetchTaskStateParams {
730
1281
  interface FetchTaskNodeDetailParams {
731
1282
  task_id: number | string;
732
1283
  node_id: string;
1284
+ component_code?: string;
733
1285
  }
734
1286
  interface FetchTaskNodeSnapshotParams {
735
1287
  task_id: number | string;
@@ -751,12 +1303,75 @@ interface OperateTaskNodeParams {
751
1303
  interface GetFlowTaskDetailParams {
752
1304
  task_id: number | string;
753
1305
  }
1306
+ interface SopsPluginCategoryParams {
1307
+ template_id: number | string;
1308
+ /** 空间 uniform_api 配置里的 api_name,如 sops_builtin / sops_third_party */
1309
+ api_name: string;
1310
+ }
1311
+ interface SopsPluginListParams extends SopsPluginCategoryParams {
1312
+ category?: string;
1313
+ /** 插件名称搜索关键字 */
1314
+ key?: string;
1315
+ limit?: number;
1316
+ offset?: number;
1317
+ }
1318
+ /**
1319
+ * 统一插件详情请求参数。
1320
+ * 后端 serializer 会拒绝契约外字段(不是静默忽略),调用方不要附加额外参数;
1321
+ * space_id / scope_type / scope_value 由 service 从 scopeData 补齐。
1322
+ */
1323
+ interface SopsPluginDetailParams {
1324
+ template_id: number | string;
1325
+ plugin_type: 'component' | 'remote_plugin' | 'uniform_api';
1326
+ /** 标准运维网关 plugin id:内置为 `builtin__<code>`,第三方即裸 code */
1327
+ plugin_code: string;
1328
+ plugin_version: string;
1329
+ /** uniform_api 必填,缺失时后端直接 400 */
1330
+ source_key?: string;
1331
+ }
754
1332
  interface FlowTaskDetail {
755
1333
  id: number | string;
756
1334
  template_id: number;
757
1335
  pipeline_tree: PipelineTree;
1336
+ /** 任务已耗时(秒),调试摘要弹层刷新恢复用。 */
1337
+ elapsed_time?: number;
1338
+ [key: string]: unknown;
1339
+ }
1340
+ interface CreateFlowTaskParams {
1341
+ template_id: number;
1342
+ name: string;
1343
+ creator: string;
1344
+ constants: Record<string, any>;
1345
+ label_ids?: number[];
1346
+ [key: string]: unknown;
1347
+ }
1348
+ interface CreateFlowTaskResult {
1349
+ data: {
1350
+ id: number | string;
1351
+ template_id?: number;
1352
+ [key: string]: unknown;
1353
+ };
1354
+ [key: string]: unknown;
1355
+ }
1356
+ interface ExecuteFlowTaskResult {
1357
+ result?: boolean;
1358
+ code?: number;
1359
+ data?: {
1360
+ /** 任务详情页跳转地址(含正确的 bkflow task id 与 templateId) */
1361
+ url?: string;
1362
+ [key: string]: unknown;
1363
+ };
1364
+ message?: string | null;
1365
+ request_id?: string;
1366
+ trace_id?: string | null;
758
1367
  [key: string]: unknown;
759
1368
  }
1369
+ interface FlowTaskExecuteSuccessResult {
1370
+ /** createFlowTask(create_task)接口响应 */
1371
+ createResult: CreateFlowTaskResult;
1372
+ /** executeFlowTask(operate_task)接口响应,data.url 用于任务详情跳转 */
1373
+ executeResult: ExecuteFlowTaskResult;
1374
+ }
760
1375
  interface TaskStateResult {
761
1376
  state?: string;
762
1377
  status?: string;
@@ -782,6 +1397,8 @@ interface FlowViewApiConfig {
782
1397
  scopeData: {
783
1398
  scope_type: string;
784
1399
  scope_value: number;
1400
+ /** 业务方传入的空间 ID,调试接口专用,语义独立于 scope_value */
1401
+ space_id: number;
785
1402
  };
786
1403
  fetchFlowDraftDetail?: (id: string) => Promise<FlowDraftDetail>;
787
1404
  fetchFlowDetailByVersion?: (id: string, version: string) => Promise<FlowDetailByVersion>;
@@ -801,23 +1418,13 @@ interface FlowViewApiConfig {
801
1418
  data: any[];
802
1419
  };
803
1420
  }>;
804
- createFlowTask?: (params: {
805
- template_id: number;
806
- name: string;
807
- creator: string;
808
- constants: Record<string, any>;
809
- }) => Promise<{
810
- data: {
811
- id: number;
812
- template_id: number;
813
- };
814
- }>;
1421
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
815
1422
  executeFlowTask?: (params: {
816
1423
  task_id: number | string;
817
1424
  resource_type: string;
818
1425
  resource_id: number | string;
819
1426
  permission_type: string;
820
- }) => Promise<any>;
1427
+ }) => Promise<ExecuteFlowTaskResult>;
821
1428
  revokeFlowTask?: (params: {
822
1429
  task_id: number | string;
823
1430
  resource_type: string;
@@ -869,28 +1476,21 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
869
1476
  fetchCategoryPlugins: (category: string) => Promise<PluginMetaItem[]>;
870
1477
  fetchAllPluginGroups: () => Promise<GroupsPluginItem[]>;
871
1478
  enableThirdPlugin?: boolean;
1479
+ fetchSopsPluginCategories?: (params: SopsPluginCategoryParams) => Promise<SopsPluginCategory[]>;
1480
+ fetchSopsPluginList?: (params: SopsPluginListParams) => Promise<SopsPluginListResult>;
1481
+ fetchSopsPluginDetail?: (params: SopsPluginDetailParams) => Promise<SopsPluginDetail>;
872
1482
  fetchPluginDetail?: (id: string) => Promise<UniformApiPluginDetail>;
873
1483
  fetchApplyInstructionData?: (params: any) => Promise<any>;
874
1484
  drawPipeline?: (params: DrawPipelineParams) => Promise<{
875
1485
  pipeline_tree: PipelineTree;
876
1486
  }>;
877
- createFlowTask?: (params: {
878
- template_id: number;
879
- name: string;
880
- creator: string;
881
- constants: Record<string, any>;
882
- }) => Promise<{
883
- data: {
884
- id: number;
885
- template_id: number;
886
- };
887
- }>;
1487
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
888
1488
  executeFlowTask?: (params: {
889
1489
  task_id: number | string;
890
1490
  resource_type: string;
891
1491
  resource_id: number | string;
892
1492
  permission_type: string;
893
- }) => Promise<any>;
1493
+ }) => Promise<ExecuteFlowTaskResult>;
894
1494
  revokeFlowTask?: (params: {
895
1495
  task_id: number | string;
896
1496
  resource_type: string;
@@ -910,6 +1510,8 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
910
1510
  fetchTaskNodeLog?: (params: FetchTaskNodeLogParams) => Promise<unknown>;
911
1511
  getFlowTaskDetail?: (params: GetFlowTaskDetailParams) => Promise<FlowTaskDetail>;
912
1512
  }
1513
+ interface FlowDetailApiConfig extends FlowEditApiConfig, Partial<DebugApiServices> {
1514
+ }
913
1515
 
914
1516
  /**
915
1517
  * 插件分组选择面板配置
@@ -919,6 +1521,7 @@ interface SelectPanelConfig {
919
1521
  agentResourceUrl?: string;
920
1522
  agentButtonText?: string;
921
1523
  knowledgebaseResourceUrl?: string;
1524
+ sopsCategoryWhitelist?: string;
922
1525
  }
923
1526
  /**
924
1527
  * 人员选择器配置
@@ -954,13 +1557,13 @@ type MemberSelectorConfig = {
954
1557
  * @param config FlowApiConfig 配置对象或已处理的 API 配置对象
955
1558
  * @returns 返回处理后的 API 配置对象
956
1559
  */
957
- declare function provideFlowApiConfig(config: FlowApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowEditApiConfig | FlowViewApiConfig;
1560
+ declare function provideFlowApiConfig(config: FlowApiConfig | FlowDetailApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowDetailApiConfig | FlowEditApiConfig | FlowViewApiConfig;
958
1561
  /**
959
1562
  * 在子组件中注入 FlowApiConfig(通用版本)
960
1563
  * @returns FlowEditApiConfig
961
1564
  * @throws 如果 apiConfig 未提供则抛出错误
962
1565
  */
963
- declare function useFlowApiConfig(): FlowEditApiConfig;
1566
+ declare function useFlowApiConfig(): FlowDetailApiConfig;
964
1567
  /**
965
1568
  * 在子组件中注入 FlowEditApiConfig(类型化版本)
966
1569
  * @returns FlowEditApiConfig
@@ -1002,7 +1605,7 @@ declare function provideMemberSelectorConfig(config?: MemberSelectorConfig): voi
1002
1605
  */
1003
1606
  declare function useMemberSelectorConfig(): MemberSelectorConfig;
1004
1607
 
1005
- type __VLS_Props$5 = {
1608
+ type __VLS_Props$6 = {
1006
1609
  flowId: string;
1007
1610
  show: boolean;
1008
1611
  editable?: boolean;
@@ -1026,15 +1629,15 @@ declare var __VLS_72: {
1026
1629
  };
1027
1630
  variablesValue: Record<string, any>;
1028
1631
  };
1029
- type __VLS_Slots$4 = {} & {
1632
+ type __VLS_Slots$6 = {} & {
1030
1633
  'custom-form-content'?: (props: typeof __VLS_72) => any;
1031
1634
  };
1032
- declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1635
+ declare const __VLS_base$6: vue.DefineComponent<__VLS_Props$6, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1033
1636
  close: (...args: any[]) => void;
1034
1637
  "update:show": (...args: any[]) => void;
1035
1638
  confirm: (...args: any[]) => void;
1036
1639
  "before-close": (...args: any[]) => void;
1037
- }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
1640
+ }, string, vue.PublicProps, Readonly<__VLS_Props$6> & Readonly<{
1038
1641
  onClose?: ((...args: any[]) => any) | undefined;
1039
1642
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
1040
1643
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -1045,10 +1648,10 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, v
1045
1648
  useCustomConfirm: boolean;
1046
1649
  enableVersion: boolean;
1047
1650
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1048
- declare const __VLS_export$5: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
1049
- declare const _default$6: typeof __VLS_export$5;
1651
+ declare const __VLS_export$6: __VLS_WithSlots$6<typeof __VLS_base$6, __VLS_Slots$6>;
1652
+ declare const _default$7: typeof __VLS_export$6;
1050
1653
 
1051
- type __VLS_WithSlots$4<T, S> = T & {
1654
+ type __VLS_WithSlots$6<T, S> = T & {
1052
1655
  new (): {
1053
1656
  $slots: S;
1054
1657
  };
@@ -1056,15 +1659,15 @@ type __VLS_WithSlots$4<T, S> = T & {
1056
1659
 
1057
1660
  declare namespace __debug_vue {
1058
1661
  export {
1059
- _default$6 as default,
1662
+ _default$7 as default,
1060
1663
  };
1061
1664
  }
1062
1665
 
1063
- type __VLS_Slots$3 = {
1666
+ type __VLS_Slots$5 = {
1064
1667
  header?: () => any;
1065
1668
  extend?: () => any;
1066
1669
  };
1067
- type __VLS_Props$4 = {
1670
+ type __VLS_Props$5 = {
1068
1671
  pipelineTree: PipelineTree;
1069
1672
  nodeStates?: TaskExecutionStates;
1070
1673
  defaultZoom?: number;
@@ -1073,7 +1676,7 @@ type __VLS_Props$4 = {
1073
1676
  showHeader?: boolean;
1074
1677
  onBack?: () => void;
1075
1678
  };
1076
- declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1679
+ declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1077
1680
  retry: (nodeId: string) => any;
1078
1681
  skip: (nodeId: string) => any;
1079
1682
  resume: (nodeId: string) => any;
@@ -1092,7 +1695,7 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
1092
1695
  nodeId: string;
1093
1696
  action: ExecutionNodeAction;
1094
1697
  }) => any;
1095
- }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{
1698
+ }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
1096
1699
  onRetry?: ((nodeId: string) => any) | undefined;
1097
1700
  onSkip?: ((nodeId: string) => any) | undefined;
1098
1701
  onResume?: ((nodeId: string) => any) | undefined;
@@ -1116,10 +1719,10 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
1116
1719
  defaultZoom: number;
1117
1720
  nodeStates: TaskExecutionStates;
1118
1721
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1119
- declare const __VLS_export$4: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
1120
- declare const _default$5: typeof __VLS_export$4;
1722
+ declare const __VLS_export$5: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
1723
+ declare const _default$6: typeof __VLS_export$5;
1121
1724
 
1122
- type __VLS_WithSlots$3<T, S> = T & {
1725
+ type __VLS_WithSlots$5<T, S> = T & {
1123
1726
  new (): {
1124
1727
  $slots: S;
1125
1728
  };
@@ -1127,27 +1730,101 @@ type __VLS_WithSlots$3<T, S> = T & {
1127
1730
 
1128
1731
  declare namespace __execute_vue {
1129
1732
  export {
1130
- _default$5 as default,
1733
+ _default$6 as default,
1131
1734
  };
1132
1735
  }
1133
1736
 
1134
- type __VLS_Props$3 = {
1737
+ /**
1738
+ * select 变量「关联数据」候选来源的领域逻辑。
1739
+ *
1740
+ * 关联标识落在 `meta.related` 的 `node_id` / `field_key` 上,不复用 `source_info`——
1741
+ * 那里表达的是「哪些节点表单项 hook 了本变量」,两种语义混在一起会让节点删除时的
1742
+ * 清理逻辑误伤。
1743
+ *
1744
+ * 与 filter 的差异是刻意的:filter 脱离关联节点就无法执行,所以它锁定类型、并在
1745
+ * 节点删除时连变量一起清理;select 关联失效后退回「手动输入」就能继续用,而且可能
1746
+ * 已被多处引用,因此这里既不锁类型也不做清理,只把「关联节点已不存在」暴露给配置态。
1747
+ */
1748
+
1749
+ /** 关联标识。select 恒为单节点单表单项 */
1750
+ interface SelectRelatedSource {
1751
+ nodeId: string;
1752
+ fieldKey: string;
1753
+ }
1754
+ /** 关联来源的完整信息:标识 + 宿主自定义的来源引用 */
1755
+ interface SelectRelatedSourceInfo extends SelectRelatedSource {
1756
+ optionSource?: SelectRelatedOptionSourceRef;
1757
+ }
1758
+
1759
+ /**
1760
+ * 关联态 select 的候选项来源:由宿主注入。
1761
+ *
1762
+ * 编辑器不认识具体插件与接口,只要 `{ id, name }[]`——「调哪条指令、响应怎么解析」
1763
+ * 是宿主的知识,放进来就得在编辑器里写死插件名。
1764
+ *
1765
+ * 契约刻意比 FilterVariableConfig 小:filter 需要注入依赖组件、字段与候选值三件套,
1766
+ * select 只需要一次列表拉取。
1767
+ */
1768
+
1769
+ interface SelectRelatedOptionItem {
1770
+ id: string;
1771
+ name: string;
1772
+ }
1773
+ interface SelectRelatedOptionSource extends SelectRelatedSourceInfo {
1774
+ /**
1775
+ * 关联节点当前 component,仅在节点配置**已写回** pipeline_tree 时才反映真实插件。
1776
+ * 从节点配置面板发起创建时它还是换插件之前的那个,所以宿主必须核对后再用,
1777
+ * 不能把它当作插件标识的唯一来源。
1778
+ */
1779
+ nodeComponent?: FilterVariableSourceNodeComponent;
1780
+ }
1781
+ interface SelectRelatedOptionConfig {
1782
+ getOptions(source: SelectRelatedOptionSource): Promise<SelectRelatedOptionItem[]>;
1783
+ /**
1784
+ * 关联来源在「关联数据」栏的展示名(如「查询条件」)。
1785
+ *
1786
+ * 由宿主实时提供而不是沿用创建时的快照:那个文案属于宿主的节点表单,改了之后已存
1787
+ * 变量也该跟着显示新的。不实现或返回空时回落快照。
1788
+ */
1789
+ resolveSourceLabel?(source: SelectRelatedSourceInfo): string | undefined;
1790
+ }
1791
+ /**
1792
+ * 在顶层组件中提供候选项来源。
1793
+ *
1794
+ * 与 `provideFilterVariableConfig` 一致:config 为 undefined 时不调用 provide,
1795
+ * 避免遮蔽父级已提供的配置。
1796
+ */
1797
+ declare function provideSelectRelatedOptionConfig(config?: SelectRelatedOptionConfig): void;
1798
+
1799
+ type __VLS_Slots$4 = {
1800
+ customFormContent?: (props: {
1801
+ customFormData: Record<string, any>;
1802
+ additionalTaskParams: Record<string, any>;
1803
+ updateCustomFormData: (data: Record<string, any>) => void;
1804
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1805
+ }) => any;
1806
+ };
1807
+ type __VLS_Props$4 = {
1135
1808
  flowId: string;
1136
1809
  show: boolean;
1137
1810
  editable?: boolean;
1138
1811
  showFlowEntry?: boolean;
1139
1812
  apiConfig: FlowApiConfig;
1140
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1813
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1141
1814
  bkflowSaasUrl?: string;
1142
1815
  memberSelectorConfig?: MemberSelectorConfig;
1816
+ /** 执行时填写 filter 变量条件所需的能力;不传则这类变量退化为只读文本 */
1817
+ filterVariableConfig?: FilterVariableConfig;
1818
+ /** 执行时关联态 select 变量的候选项来源;不传则这类变量的下拉为空 */
1819
+ selectRelatedOptionConfig?: SelectRelatedOptionConfig;
1143
1820
  };
1144
- declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1821
+ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1145
1822
  close: (...args: any[]) => void;
1146
1823
  "update:show": (...args: any[]) => void;
1147
1824
  confirm: (...args: any[]) => void;
1148
1825
  "before-close": (...args: any[]) => void;
1149
1826
  "view-flow": (...args: any[]) => void;
1150
- }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1827
+ }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{
1151
1828
  onClose?: ((...args: any[]) => any) | undefined;
1152
1829
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
1153
1830
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -1157,20 +1834,27 @@ declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {},
1157
1834
  editable: boolean;
1158
1835
  showFlowEntry: boolean;
1159
1836
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1160
- declare const _default$4: typeof __VLS_export$3;
1837
+ declare const __VLS_export$4: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
1838
+ declare const _default$5: typeof __VLS_export$4;
1839
+
1840
+ type __VLS_WithSlots$4<T, S> = T & {
1841
+ new (): {
1842
+ $slots: S;
1843
+ };
1844
+ };
1161
1845
 
1162
1846
  declare namespace __create_task_vue {
1163
1847
  export {
1164
- _default$4 as default,
1848
+ _default$5 as default,
1165
1849
  };
1166
1850
  }
1167
1851
 
1168
- type __VLS_Slots$2 = {
1852
+ type __VLS_Slots$3 = {
1169
1853
  header?: () => any;
1170
1854
  inputParams?: (props: {
1171
1855
  node: any;
1172
1856
  pluginDetail: PluginDetailCommon | null;
1173
- inputs: any[];
1857
+ inputs: PluginInputForm['inputs'];
1174
1858
  editable: boolean;
1175
1859
  fullVariableList: {
1176
1860
  key: string;
@@ -1189,7 +1873,7 @@ type __VLS_Slots$2 = {
1189
1873
  variablesValue: Record<string, any>;
1190
1874
  }) => any;
1191
1875
  };
1192
- type __VLS_Props$2 = {
1876
+ type __VLS_Props$3 = {
1193
1877
  flowId: string;
1194
1878
  apiConfig: FlowApiConfig;
1195
1879
  permissions?: {
@@ -1203,6 +1887,10 @@ type __VLS_Props$2 = {
1203
1887
  useCustomDebugConfirm?: boolean;
1204
1888
  selectPanelConfig?: SelectPanelConfig;
1205
1889
  memberSelectorConfig?: MemberSelectorConfig;
1890
+ /** 复合条件选择(filter)变量的宿主配置;不传则该类型变量不可用,其余功能不受影响 */
1891
+ filterVariableConfig?: FilterVariableConfig;
1892
+ /** 关联态 select 变量的候选项来源;不传则这类变量的下拉为空,其余功能不受影响 */
1893
+ selectRelatedOptionConfig?: SelectRelatedOptionConfig;
1206
1894
  onSave?: (flowData: FlowTemplate) => void;
1207
1895
  onSaveSuccess?: () => void;
1208
1896
  onBack?: () => void;
@@ -1218,11 +1906,17 @@ type __VLS_Props$2 = {
1218
1906
  bkflowSaasUrl?: string;
1219
1907
  enableThirdPlugin?: boolean;
1220
1908
  quickAdd?: QuickAddConfig;
1909
+ /** 是否隐藏基础信息中的触发器配置表单,默认 false */
1910
+ hideTrigger?: boolean;
1221
1911
  };
1222
- declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1912
+ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$3, {
1223
1913
  isFlowEdited: ComputedRef<FlowEditExpose["isFlowEdited"]>;
1224
1914
  updateNodeInputParams: FlowEditExpose["updateNodeInputParams"];
1225
1915
  openGlobalVariables: FlowEditExpose["openGlobalVariables"];
1916
+ openGlobalVariableCreate: FlowEditExpose["openGlobalVariableCreate"];
1917
+ zoomToFit: FlowEditExpose["zoomToFit"];
1918
+ centerContent: FlowEditExpose["centerContent"];
1919
+ getZoom: FlowEditExpose["getZoom"];
1226
1920
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1227
1921
  back: () => any;
1228
1922
  save: (flowData: FlowTemplate) => any;
@@ -1233,11 +1927,8 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1233
1927
  saveSuccess: () => any;
1234
1928
  exitEdit: () => any;
1235
1929
  debugBeforeClose: () => any;
1236
- createVariable: (payload: {
1237
- keyword: string;
1238
- cursorIndex: number;
1239
- }) => any;
1240
- }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1930
+ createVariable: (payload: CreateVariablePayload) => any;
1931
+ }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1241
1932
  onBack?: (() => any) | undefined;
1242
1933
  onSave?: ((flowData: FlowTemplate) => any) | undefined;
1243
1934
  onMockDebugCreated?: ((params: {
@@ -1247,25 +1938,23 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1247
1938
  onSaveSuccess?: (() => any) | undefined;
1248
1939
  onExitEdit?: (() => any) | undefined;
1249
1940
  onDebugBeforeClose?: (() => any) | undefined;
1250
- onCreateVariable?: ((payload: {
1251
- keyword: string;
1252
- cursorIndex: number;
1253
- }) => any) | undefined;
1941
+ onCreateVariable?: ((payload: CreateVariablePayload) => any) | undefined;
1254
1942
  }>, {
1255
1943
  quickAdd: QuickAddConfig;
1944
+ enableThirdPlugin: boolean;
1945
+ hideTrigger: boolean;
1256
1946
  defaultZoom: number;
1947
+ enableDebug: boolean;
1257
1948
  enableVersion: boolean;
1258
1949
  permissions: {
1259
1950
  canSave?: boolean;
1260
1951
  };
1261
- enableDebug: boolean;
1262
1952
  useCustomDebugConfirm: boolean;
1263
- enableThirdPlugin: boolean;
1264
1953
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1265
- declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
1266
- declare const _default$3: typeof __VLS_export$2;
1954
+ declare const __VLS_export$3: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
1955
+ declare const _default$4: typeof __VLS_export$3;
1267
1956
 
1268
- type __VLS_WithSlots$2<T, S> = T & {
1957
+ type __VLS_WithSlots$3<T, S> = T & {
1269
1958
  new (): {
1270
1959
  $slots: S;
1271
1960
  };
@@ -1273,16 +1962,16 @@ type __VLS_WithSlots$2<T, S> = T & {
1273
1962
 
1274
1963
  declare namespace __edit_vue {
1275
1964
  export {
1276
- _default$3 as default,
1965
+ _default$4 as default,
1277
1966
  };
1278
1967
  }
1279
1968
 
1280
- type __VLS_Slots$1 = {
1969
+ type __VLS_Slots$2 = {
1281
1970
  header?: () => any;
1282
1971
  inputParams?: (props: {
1283
1972
  node: any;
1284
1973
  pluginDetail: PluginDetailCommon | null;
1285
- inputs: any[];
1974
+ inputs: PluginInputForm['inputs'];
1286
1975
  editable: boolean;
1287
1976
  fullVariableList: {
1288
1977
  key: string;
@@ -1290,6 +1979,12 @@ type __VLS_Slots$1 = {
1290
1979
  }[];
1291
1980
  updateInputParams: (data: Record<string, any>) => void;
1292
1981
  }) => any;
1982
+ customFormContent?: (props: {
1983
+ customFormData: Record<string, any>;
1984
+ additionalTaskParams: Record<string, any>;
1985
+ updateCustomFormData: (data: Record<string, any>) => void;
1986
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1987
+ }) => any;
1293
1988
  debugCustomFormContent?: (props: {
1294
1989
  formData: {
1295
1990
  name: string;
@@ -1297,11 +1992,12 @@ type __VLS_Slots$1 = {
1297
1992
  variablesValue: Record<string, any>;
1298
1993
  }) => any;
1299
1994
  };
1300
- type __VLS_Props$1 = {
1995
+ type __VLS_Props$2 = {
1301
1996
  flowId: string;
1302
1997
  apiConfig: FlowApiConfig;
1303
1998
  permissions?: {
1304
1999
  canEdit?: boolean;
2000
+ canExecute?: boolean;
1305
2001
  };
1306
2002
  onEdit?: () => void;
1307
2003
  onBack?: () => void;
@@ -1311,22 +2007,28 @@ type __VLS_Props$1 = {
1311
2007
  showHeaderActions?: boolean;
1312
2008
  defaultZoom?: number;
1313
2009
  bkflowSaasUrl?: string;
1314
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
2010
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1315
2011
  memberSelectorConfig?: MemberSelectorConfig;
1316
2012
  enableDebug?: boolean;
1317
2013
  onMockDebugCreated?: (params: {
1318
2014
  taskId: number | string;
1319
2015
  templateId: number | string;
1320
2016
  }) => void;
2017
+ /** 是否隐藏基础信息中的触发器配置表单,默认 false */
2018
+ hideTrigger?: boolean;
1321
2019
  };
1322
- declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
2020
+ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
2021
+ zoomToFit: (options?: ZoomToFitOptions) => void;
2022
+ centerContent: () => void;
2023
+ getZoom: () => number;
2024
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1323
2025
  edit: () => any;
1324
2026
  back: () => any;
1325
2027
  mockDebugCreated: (params: {
1326
2028
  taskId: number | string;
1327
2029
  templateId: number | string;
1328
2030
  }) => any;
1329
- }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
2031
+ }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1330
2032
  onEdit?: (() => any) | undefined;
1331
2033
  onBack?: (() => any) | undefined;
1332
2034
  onMockDebugCreated?: ((params: {
@@ -1335,18 +2037,20 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, v
1335
2037
  }) => any) | undefined;
1336
2038
  }>, {
1337
2039
  thumbnail: boolean;
2040
+ hideTrigger: boolean;
1338
2041
  defaultZoom: number;
2042
+ enableDebug: boolean;
1339
2043
  enableVersion: boolean;
1340
2044
  permissions: {
1341
2045
  canEdit?: boolean;
2046
+ canExecute?: boolean;
1342
2047
  };
1343
2048
  showHeaderActions: boolean;
1344
- enableDebug: boolean;
1345
2049
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1346
- declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
1347
- declare const _default$2: typeof __VLS_export$1;
2050
+ declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
2051
+ declare const _default$3: typeof __VLS_export$2;
1348
2052
 
1349
- type __VLS_WithSlots$1<T, S> = T & {
2053
+ type __VLS_WithSlots$2<T, S> = T & {
1350
2054
  new (): {
1351
2055
  $slots: S;
1352
2056
  };
@@ -1354,10 +2058,108 @@ type __VLS_WithSlots$1<T, S> = T & {
1354
2058
 
1355
2059
  declare namespace __view_vue {
1356
2060
  export {
1357
- _default$2 as default,
2061
+ _default$3 as default,
1358
2062
  };
1359
2063
  }
1360
2064
 
2065
+ /**
2066
+ * FlowDetail 权限(默认拒绝,设计 §3.1 / §7.2)。
2067
+ */
2068
+ interface FlowDetailPermissions {
2069
+ canEdit: boolean;
2070
+ canDebug: boolean;
2071
+ canExecute: boolean;
2072
+ }
2073
+
2074
+ type __VLS_Slots$1 = {
2075
+ header?: () => any;
2076
+ /** 头部右侧操作区追加宿主自定义按钮,位于内置「保存」「执行流程」之后 */
2077
+ headerActions?: (props: {
2078
+ savePending: boolean;
2079
+ canMutateFlow: boolean;
2080
+ }) => any;
2081
+ inputParams?: (props: {
2082
+ node: any;
2083
+ pluginDetail: PluginDetailCommon | null;
2084
+ inputs: PluginInputForm['inputs'];
2085
+ editable: boolean;
2086
+ fullVariableList: {
2087
+ key: string;
2088
+ name: string;
2089
+ source_type?: string;
2090
+ custom_type?: string;
2091
+ }[];
2092
+ updateInputParams: (data: Record<string, PluginInputDataItem>) => void;
2093
+ updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
2094
+ updateVariableSourceInfo: (variableKey: string, nodeId: string, formKey: string) => void;
2095
+ }) => any;
2096
+ customFormContent?: (props: {
2097
+ customFormData: Record<string, any>;
2098
+ additionalTaskParams: Record<string, any>;
2099
+ updateCustomFormData: (data: Record<string, any>) => void;
2100
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
2101
+ }) => any;
2102
+ };
2103
+ type __VLS_Props$1 = {
2104
+ flowId: string;
2105
+ apiConfig: FlowApiConfig | FlowDetailApiConfig;
2106
+ permissions?: Partial<FlowDetailPermissions>;
2107
+ enableVersion?: boolean;
2108
+ flowVersion?: string;
2109
+ defaultZoom?: number;
2110
+ bkflowSaasUrl?: string;
2111
+ enableThirdPlugin?: boolean;
2112
+ quickAdd?: QuickAddConfig;
2113
+ hideTrigger?: boolean;
2114
+ selectPanelConfig?: SelectPanelConfig;
2115
+ memberSelectorConfig?: MemberSelectorConfig;
2116
+ /** 复合条件选择(filter)变量的宿主配置;不传则该类型变量不可用,其余功能不受影响 */
2117
+ filterVariableConfig?: FilterVariableConfig;
2118
+ /** 关联态 select 变量的候选项来源;不传则这类变量的下拉为空,其余功能不受影响 */
2119
+ selectRelatedOptionConfig?: SelectRelatedOptionConfig;
2120
+ onSave?: (flowData: FlowTemplate) => void;
2121
+ onSaveSuccess?: () => void;
2122
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
2123
+ onBack?: () => void;
2124
+ };
2125
+ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {
2126
+ isFlowEdited: ComputedRef<boolean>;
2127
+ updateNodeInputParams: FlowDetailExpose["updateNodeInputParams"];
2128
+ openGlobalVariables: FlowDetailExpose["openGlobalVariables"];
2129
+ openGlobalVariableCreate: FlowDetailExpose["openGlobalVariableCreate"];
2130
+ refreshDebugContext: FlowDetailExpose["refreshDebugContext"];
2131
+ openDebugResult: FlowDetailExpose["openDebugResult"];
2132
+ zoomToFit: FlowDetailExpose["zoomToFit"];
2133
+ centerContent: FlowDetailExpose["centerContent"];
2134
+ getZoom: FlowDetailExpose["getZoom"];
2135
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
2136
+ back: () => any;
2137
+ save: (flowData: FlowTemplate) => any;
2138
+ saveSuccess: () => any;
2139
+ createVariable: (payload: CreateVariablePayload) => any;
2140
+ executeSuccess: (result: FlowTaskExecuteSuccessResult) => any;
2141
+ }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
2142
+ onBack?: (() => any) | undefined;
2143
+ onSave?: ((flowData: FlowTemplate) => any) | undefined;
2144
+ onSaveSuccess?: (() => any) | undefined;
2145
+ onCreateVariable?: ((payload: CreateVariablePayload) => any) | undefined;
2146
+ onExecuteSuccess?: ((result: FlowTaskExecuteSuccessResult) => any) | undefined;
2147
+ }>, {
2148
+ quickAdd: QuickAddConfig;
2149
+ enableThirdPlugin: boolean;
2150
+ hideTrigger: boolean;
2151
+ defaultZoom: number;
2152
+ enableVersion: boolean;
2153
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
2154
+ declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
2155
+ declare const _default$2: typeof __VLS_export$1;
2156
+
2157
+ type __VLS_WithSlots$1<T, S> = T & {
2158
+ new (): {
2159
+ $slots: S;
2160
+ };
2161
+ };
2162
+
1361
2163
  type SimulateDebugStage = 'edit' | 'mock-config' | 'mock-running';
1362
2164
  type MockFormControl = 'bk-input' | 'bk-input-number' | 'bk-textarea' | 'json-editor' | 'bk-select' | 'bk-checkbox-group' | 'bk-radio-group' | 'bk-switcher' | 'bk-date-picker' | 'bk-date-range-picker' | 'data-table';
1363
2165
  interface MockOutputField extends PluginOutputItem {
@@ -1407,10 +2209,19 @@ declare function isMockableNode(node: NodeType | Activity | undefined | null): n
1407
2209
  declare const random4: () => string;
1408
2210
  declare const generateId: (group?: number) => string;
1409
2211
 
2212
+ interface ValidatePipelineTreeOptions {
2213
+ /**
2214
+ * 需要「已配置插件」的节点集合,不传时要求全部节点均已配置。
2215
+ *
2216
+ * 单步 / Mock 调试只依赖目标节点自身的配置(后端 step_run 用目标节点单独拼一棵最小流程树),
2217
+ * 画布其余未配置节点不影响调试,因此这类场景只传目标节点,允许空节点先存为草稿。
2218
+ */
2219
+ requireConfiguredNodeIds?: string[];
2220
+ }
1410
2221
  /**
1411
2222
  * 画布pipeline_tree数据校验
1412
2223
  */
1413
- declare const validatePipelineTree: (pipelineTree: PipelineTree) => {
2224
+ declare const validatePipelineTree: (pipelineTree: PipelineTree, options?: ValidatePipelineTreeOptions) => {
1414
2225
  valid: boolean;
1415
2226
  message: string;
1416
2227
  ids: string[];
@@ -1467,6 +2278,25 @@ declare class BkFlowModelAccessor {
1467
2278
  get flowModel(): FlowModel;
1468
2279
  }
1469
2280
 
2281
+ /**
2282
+ * 新调试(FlowDetail)向画布节点透出的最小上下文(设计 §14.3)。
2283
+ *
2284
+ * - isMockNode:节点渲染据此显示 MOCK 标签;
2285
+ * - 其余为可选能力:独立调试聚焦态、打开节点调试面板。
2286
+ * 保持可选以兼容仅需 Mock 标签的场景,且不改变对外 npm 公共 API。
2287
+ */
2288
+ interface DebugCanvasContext {
2289
+ isMockNode(nodeId: string): boolean;
2290
+ /** 节点调试状态;任务节点用它补充未执行(not_run)标识,不写入连线执行态。 */
2291
+ getNodeStatus?(nodeId: string): string | undefined;
2292
+ /** 当前独立调试聚焦节点(不复用 X6 编辑选择态,设计 §9.3.2) */
2293
+ focusedNodeId?(): string;
2294
+ /** 打开该节点详情侧滑的“调试配置”Tab */
2295
+ openNodeDebugPanel?(nodeId: string): void;
2296
+ /** 调试锁定期(running/terminating);节点配置据此展示只读说明 Alert */
2297
+ isLocked?(): boolean;
2298
+ }
2299
+
1470
2300
  type __VLS_Props = {
1471
2301
  pipelineTree: PipelineTree;
1472
2302
  mode?: BkflowBusinessCanvasMode;
@@ -1478,6 +2308,7 @@ type __VLS_Props = {
1478
2308
  additionalPlugins?: CanvasPlugin[];
1479
2309
  toolbarItems?: CanvasToolbarItem[];
1480
2310
  simulateDebugContext?: SimulateDebugCanvasContext;
2311
+ debugContext?: DebugCanvasContext;
1481
2312
  };
1482
2313
  declare var __VLS_8: {};
1483
2314
  declare var __VLS_22: {
@@ -1572,8 +2403,8 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
1572
2403
  }) => any) | undefined;
1573
2404
  "onFormat-position"?: (() => any) | undefined;
1574
2405
  }>, {
1575
- mode: BkflowBusinessCanvasMode;
1576
2406
  thumbnail: boolean;
2407
+ mode: BkflowBusinessCanvasMode;
1577
2408
  nodeActions: NodeActionsConfig;
1578
2409
  quickAdd: QuickAddConfig;
1579
2410
  defaultZoom: number;
@@ -1617,7 +2448,7 @@ declare function exportToPipelineTree(flowModel: FlowModel): PipelineTree;
1617
2448
  * - edge.reconnect:若源从条件网关迁出,清理旧条件
1618
2449
  * - node.remove:主动查找将被级联删除的边,清理对应网关条件;
1619
2450
  * 若删除的是分支网关,级联删除关联的 placeholder 节点;
1620
- * 同时清理全局变量中对被删除节点的 source_info 引用,并删除已无引用的变量
2451
+ * 同时清理全局变量中对被删除节点的 source_info 引用,并删除已无引用的派生变量
1621
2452
  */
1622
2453
  declare function createBkflowPlugin(): CanvasPlugin;
1623
2454
 
@@ -1640,14 +2471,40 @@ declare function createExecutionStatusPlugin(stateRef: Ref<TaskExecutionStates>)
1640
2471
  */
1641
2472
  declare function resolveExecutionActions(state: NodeExecutionState | undefined, nodeType: string): ExecutionNodeAction[];
1642
2473
 
2474
+ type BkuiLocale = typeof defaultRootConfig.locale;
2475
+ /** 取当前语言对应的 bkui-vue 语言包;消费方注册的第三语言从 registry 取。 */
2476
+ declare function resolveBkuiLocale(locale: string): BkuiLocale | undefined;
2477
+ /**
2478
+ * 顶层 Flow 组件 setup 内调用:在本组件子树内应用语言(含 Teleport 弹层),
2479
+ * 并改写 defaultRootConfig 覆盖脱离组件树的命令式 Message / InfoBox。
2480
+ *
2481
+ * 约束 1:必须先读 useGlobalConfig() 再合并。provideGlobalConfig 内部是
2482
+ * merge(defaultRootConfig, config),直接传 { locale } 会拿 defaultRootConfig.prefix
2483
+ * 覆盖宿主自定义的 prefix。
2484
+ * 约束 2:zh-cn 时整段跳过,保证现有消费方零行为变化,也不会把已设为英文的宿主拽回中文。
2485
+ * 代价是不会把 defaultRootConfig 改回中文——语言切换本就要求宿主刷新页面。
2486
+ *
2487
+ * 注意 defaultRootConfig 是 bkui-vue 的模块级单例,这一行的**影响范围是整个宿主应用**,
2488
+ * 不限于本组件子树:宿主在别处调用的 bkui-vue 命令式弹窗语言也会随之变化。
2489
+ * 这是覆盖命令式组件的唯一手段(它们没有组件上下文可供 inject),已在
2490
+ * docs/usage.md「对宿主 bkui-vue 全局配置的影响」中对消费方说明。
2491
+ */
2492
+ declare function applyBkuiLocaleToTree(): void;
2493
+ /** 自建 createApp 调用:该 app 脱离宿主 provide 链,从 defaultRootConfig 起步合并。 */
2494
+ declare function applyBkuiLocale(app: App): void;
2495
+
1643
2496
  declare const _default: {
1644
2497
  FlowView: () => Promise<typeof __view_vue>;
1645
2498
  FlowEdit: () => Promise<typeof __edit_vue>;
1646
2499
  FlowCreateTask: () => Promise<typeof __create_task_vue>;
1647
2500
  FlowExecute: () => Promise<typeof __execute_vue>;
1648
2501
  FlowDebug: () => Promise<typeof __debug_vue>;
2502
+ /**
2503
+ * @deprecated Use FlowDetail with permissions.canDebug instead.
2504
+ * FlowMockDebug will be removed in the next major version.
2505
+ */
1649
2506
  FlowMockDebug: () => Promise<typeof __mock_vue>;
1650
2507
  };
1651
2508
 
1652
- export { _default$1 as BkFlowCanvas, BkFlowModelAccessor, BkFlowNodeAccessor, _default$4 as FlowCreateTask, _default$6 as FlowDebug, _default$3 as FlowEdit, _default$5 as FlowExecute, _default$7 as FlowMockDebug, _default$2 as FlowView, bkflowConnectionValidator, createBkflowPlugin, createBkflowSchema, createExecutionStatusPlugin, _default as default, exportToPipelineTree, generateId, getUniformApiPluginFormValue, getVariableDefaultConfig, importFromPipelineTree, isMockableNode, mergeOutputs, normalizePluginOutputItems, provideFlowApiConfig, provideMemberSelectorConfig, provideSelectPanelConfig, random4, resolveExecutionActions, resolveMockFormControl, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useMemberSelectorConfig, useSelectPanelConfig, validatePipelineTree };
1653
- export type { Activity, DndNodeItem, ExecutionNodeAction, FlowApiConfig, FlowEditExpose, FlowTemplate, Gateway, GatewayCondition, MemberSelectorConfig, MockOutputField, NodeExecutionState, NodeExecutionStatus, NodeMockConfig, NotifyConfig, PipelineTree, PluginDetailCommon, PluginInputDataItem, SelectPanelConfig, SimulateDebugCanvasContext, SimulateDebugStage, SimulateDebugState, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };
2509
+ export { _default$1 as BkFlowCanvas, BkFlowModelAccessor, BkFlowNodeAccessor, _default$5 as FlowCreateTask, _default$7 as FlowDebug, _default$2 as FlowDetail, _default$4 as FlowEdit, _default$6 as FlowExecute, _default$8 as FlowMockDebug, _default$3 as FlowView, applyBkuiLocale, applyBkuiLocaleToTree, bkflowConnectionValidator, createBkflowPlugin, createBkflowSchema, createExecutionStatusPlugin, _default as default, exportToPipelineTree, generateId, getUniformApiPluginFormValue, getVariableDefaultConfig, importFromPipelineTree, isMockableNode, mergeOutputs, normalizePluginOutputItems, provideFilterVariableConfig, provideFlowApiConfig, provideMemberSelectorConfig, provideSelectPanelConfig, provideSelectRelatedOptionConfig, random4, resolveBkuiLocale, resolveExecutionActions, resolveMockFormControl, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useMemberSelectorConfig, useSelectPanelConfig, validatePipelineTree };
2510
+ export type { Activity, CanvasViewportExpose, CreateFlowTaskResult, DndNodeItem, ExecuteFlowTaskResult, ExecutionNodeAction, FilterCandidateQuery, FilterConditionOptions, FilterConditionValue, FilterVariableConfig, FilterVariableSourceContext, FilterVariableSourceNodeComponent, FilterWhereItem, FilterWhereValue, FlowApiConfig, FlowDetailExpose, FlowDetailPermissions, FlowEditExpose, FlowTaskExecuteSuccessResult, FlowTemplate, FlowViewExpose, Gateway, GatewayCondition, GlobalVariableCreateExpose, MemberSelectorConfig, MockOutputField, NodeExecutionState, NodeExecutionStatus, NodeMockConfig, NotifyConfig, OpenFilterVariableCreateRequest, OpenGlobalVariableCreateRequest, OpenStandardVariableCreateRequest, PipelineTree, PluginDetailCommon, PluginInputDataItem, RetrievalFilterField, SelectPanelConfig, SelectRelatedOptionConfig, SelectRelatedOptionItem, SelectRelatedOptionSource, SelectRelatedOptionSourceRef, SelectRelatedSourceContext, SimulateDebugCanvasContext, SimulateDebugStage, SimulateDebugState, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };