@blueking/chat-x 0.0.42 → 0.0.43
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/ag-ui/types/contents.d.ts +1 -0
- package/dist/components/ai-buttons/tool-btn/tool-btn.vue.d.ts +11 -1
- package/dist/components/chat-content/flow-agent-content/flow-agent-content.vue.d.ts +1 -0
- package/dist/components/chat-content/flow-agent-content/flow-agent-state.d.ts +34 -0
- package/dist/components/chat-content/flow-agent-content/use-flow-agent.d.ts +47 -0
- package/dist/components/chat-content/flow-agent-content/use-flow-tab.d.ts +18 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/use-full-screen.d.ts +17 -0
- package/dist/composables/use-message-group.d.ts +3 -0
- package/dist/directives/overflow-tips.d.ts +1 -1
- package/dist/icons/execution.d.ts +3 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/screen.d.ts +6 -0
- package/dist/index.css +1 -1
- package/dist/index.js +2124 -1949
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +4 -1
- package/dist/mcp/generated/docs/chat-container.md +28 -11
- package/dist/mcp/generated/docs/message-tools.md +3 -3
- package/dist/mcp/generated/docs/tool-btn.md +37 -6
- package/dist/mcp/generated/docs/use-full-screen.md +114 -0
- package/dist/mcp/generated/index.json +19 -1
- package/dist/types/tool.d.ts +1 -1
- package/package.json +2 -2
|
@@ -6,10 +6,20 @@ type __VLS_Props = IToolBtn & {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
tippyOptions?: Partial<Omit<TippyOptions, 'getReferenceClientRect' | 'triggerTarget'>>;
|
|
8
8
|
};
|
|
9
|
-
declare
|
|
9
|
+
declare var __VLS_1: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
14
|
click: (data: IToolBtn, event: MouseEvent) => any;
|
|
11
15
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
16
|
onClick?: ((data: IToolBtn, event: MouseEvent) => any) | undefined;
|
|
13
17
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
19
|
declare const _default: typeof __VLS_export;
|
|
15
20
|
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MessageStatus as MessageStatusType } from '../../../ag-ui/types/constants';
|
|
2
2
|
import type { BkFlowMessageContent } from '../../../ag-ui/types/contents';
|
|
3
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
content?: BkFlowMessageContent;
|
|
5
6
|
messageUid?: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type VNode } from 'vue';
|
|
2
|
+
/** 归一后的执行状态 */
|
|
3
|
+
export type ConvergedState = 'failed' | 'pending' | 'running' | 'skipped' | 'success' | 'suspended';
|
|
4
|
+
/** 单个归一状态的完整定义 */
|
|
5
|
+
interface FlowStateDef {
|
|
6
|
+
/** 状态主题色,供统计标签文字与图标语义复用 */
|
|
7
|
+
color: string;
|
|
8
|
+
/** 节点状态点的边框色,缺省回退到 color(仅 pending 与主题色不同) */
|
|
9
|
+
dotColor?: string;
|
|
10
|
+
/** 状态图标(VNode);running 走 Loading 动画,故为 null */
|
|
11
|
+
icon: null | VNode;
|
|
12
|
+
/** 归一状态标识 */
|
|
13
|
+
key: ConvergedState;
|
|
14
|
+
/** 国际化标签 */
|
|
15
|
+
label: string;
|
|
16
|
+
/** 归一到该状态的后端原始状态枚举 */
|
|
17
|
+
rawStates: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 执行状态唯一配置源(Single Source of Truth)。
|
|
21
|
+
* 新增 / 调整状态只需维护此处:归一映射、统计标签、颜色、图标均由它派生,
|
|
22
|
+
* 避免状态逻辑散落在组件与 SCSS 多处。
|
|
23
|
+
* 数组顺序即统计概览(visibleStats)的展示顺序。
|
|
24
|
+
*/
|
|
25
|
+
export declare const STATE_DEFS: FlowStateDef[];
|
|
26
|
+
/** 后端原始状态归一;未知状态回退 running(保持原有行为) */
|
|
27
|
+
export declare const getConvergedState: (rawState: string) => ConvergedState;
|
|
28
|
+
/** 状态主题色(用于统计标签文字) */
|
|
29
|
+
export declare const getStateColor: (state: ConvergedState) => string;
|
|
30
|
+
/** 节点状态点边框色 */
|
|
31
|
+
export declare const getStateDotColor: (state: ConvergedState) => string;
|
|
32
|
+
/** 取状态图标,返回克隆的 VNode 以支持多处复用;running 无图标返回 null */
|
|
33
|
+
export declare const getStateIcon: (state: ConvergedState) => null | VNode;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref, type VNode } from 'vue';
|
|
2
|
+
import { type ConvergedState } from './flow-agent-state';
|
|
3
|
+
import type { BkFlowMessageContent, BkFlowNode, BkFlowTask } from '../../../ag-ui/types/contents';
|
|
4
|
+
/** 节点视图模型:模板直接消费,避免重复 Object.values / 状态归一 / 时间格式化 */
|
|
5
|
+
export interface FlowNodeVM {
|
|
6
|
+
convergedState: ConvergedState;
|
|
7
|
+
dotColor: string;
|
|
8
|
+
elapsedTimeText: string;
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
raw: BkFlowNode;
|
|
12
|
+
}
|
|
13
|
+
/** 统计概览项视图模型 */
|
|
14
|
+
export interface FlowStatVM {
|
|
15
|
+
/** 计数文字色 */
|
|
16
|
+
color: string;
|
|
17
|
+
display: string;
|
|
18
|
+
/** 状态圆点(环)边框色,pending 等需与文字色区分时回退到独立 dotColor */
|
|
19
|
+
dotColor: string;
|
|
20
|
+
key: ConvergedState;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
/** 任务视图模型 */
|
|
24
|
+
export interface FlowTaskVM {
|
|
25
|
+
confidenceTitle?: string;
|
|
26
|
+
convergedState: ConvergedState;
|
|
27
|
+
hasConfidence: boolean;
|
|
28
|
+
isActive: boolean;
|
|
29
|
+
nodes: FlowNodeVM[];
|
|
30
|
+
raw: BkFlowTask;
|
|
31
|
+
stateIcon: null | VNode;
|
|
32
|
+
taskId: number;
|
|
33
|
+
taskName: string;
|
|
34
|
+
totalTimeText: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* flow-agent 视图模型 composable。
|
|
38
|
+
* 将原始 BkFlowTask[] 转换为模板友好的视图模型,并集中处理统计聚合与展开态,
|
|
39
|
+
* 纯派生逻辑(不依赖注入),便于复用与单测。
|
|
40
|
+
*/
|
|
41
|
+
export declare const useFlowAgent: (contentRef: Ref<BkFlowMessageContent | undefined>) => {
|
|
42
|
+
isTaskExpanded: (task: BkFlowTask) => boolean;
|
|
43
|
+
taskList: ComputedRef<BkFlowTask[]>;
|
|
44
|
+
toggleTaskExpanded: (task: BkFlowTask) => void;
|
|
45
|
+
viewTasks: ComputedRef<FlowTaskVM[]>;
|
|
46
|
+
visibleStats: ComputedRef<FlowStatVM[]>;
|
|
47
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { BkFlowNode, BkFlowTask } from '../../../ag-ui/types/contents';
|
|
3
|
+
/**
|
|
4
|
+
* flow-agent 自定义 Tab 集成 composable。
|
|
5
|
+
* 收敛与 useCustomTab 的交互:选中态计算、打开节点详情 / 有效证据、
|
|
6
|
+
* 以及挂载时默认激活、卸载时清理 Tab 的生命周期。
|
|
7
|
+
*/
|
|
8
|
+
export declare const useFlowTab: (options: {
|
|
9
|
+
messageUid: Ref<string | undefined>;
|
|
10
|
+
taskList: Ref<BkFlowTask[]>;
|
|
11
|
+
}) => {
|
|
12
|
+
displaySelectedTabName: import("vue").ComputedRef<string>;
|
|
13
|
+
isNodeSelected: (task: BkFlowTask, node: BkFlowNode) => boolean;
|
|
14
|
+
isTaskSelected: (task: BkFlowTask) => boolean;
|
|
15
|
+
markUserTabSelection: () => void;
|
|
16
|
+
openConfidence: (task?: BkFlowTask) => void;
|
|
17
|
+
openNodeDetail: (task: BkFlowTask, node: BkFlowNode) => void;
|
|
18
|
+
};
|
|
@@ -3,6 +3,7 @@ export * from './use-clipboard';
|
|
|
3
3
|
export * from './use-command-selection';
|
|
4
4
|
export * from './use-container-scroll';
|
|
5
5
|
export * from './use-custom-tab';
|
|
6
|
+
export * from './use-full-screen';
|
|
6
7
|
export * from './use-global-config';
|
|
7
8
|
export * from './use-menu-keydown';
|
|
8
9
|
export * from './use-message-group';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 将传入的目标元素以浏览器原生全屏方式展示。
|
|
4
|
+
*
|
|
5
|
+
* @param target 需要全屏的目标元素(支持 ref);缺省时回退到 document.documentElement。
|
|
6
|
+
* @returns
|
|
7
|
+
* - `isSupported` 当前环境是否支持全屏
|
|
8
|
+
* - `isFullScreen` 只读响应式状态,始终与真实全屏同步(含用户按 ESC 退出)
|
|
9
|
+
* - `enter` / `exit` / `toggle` 控制方法
|
|
10
|
+
*/
|
|
11
|
+
export declare const useFullScreen: (target?: MaybeRef<HTMLElement | null>) => {
|
|
12
|
+
isSupported: boolean;
|
|
13
|
+
isFullScreen: Readonly<import("vue").Ref<boolean, boolean>>;
|
|
14
|
+
enter: () => Promise<void>;
|
|
15
|
+
exit: () => Promise<void>;
|
|
16
|
+
toggle: () => Promise<void>;
|
|
17
|
+
};
|
|
@@ -21,6 +21,7 @@ export declare const useMessageGroup: (options: {
|
|
|
21
21
|
messages: ({
|
|
22
22
|
activityType: MessageContentType.FlowAgent | MessageContentType.KnowledgeRag | MessageContentType.ReferenceDocument | string;
|
|
23
23
|
content: {
|
|
24
|
+
confidence_title?: string | undefined;
|
|
24
25
|
has_confidence?: boolean | undefined;
|
|
25
26
|
is_active?: boolean | undefined;
|
|
26
27
|
nodes: Record<string, import("..").BkFlowNode>;
|
|
@@ -12387,6 +12388,7 @@ export declare const useMessageGroup: (options: {
|
|
|
12387
12388
|
messages: ({
|
|
12388
12389
|
activityType: MessageContentType.FlowAgent | MessageContentType.KnowledgeRag | MessageContentType.ReferenceDocument | string;
|
|
12389
12390
|
content: {
|
|
12391
|
+
confidence_title?: string | undefined;
|
|
12390
12392
|
has_confidence?: boolean | undefined;
|
|
12391
12393
|
is_active?: boolean | undefined;
|
|
12392
12394
|
nodes: Record<string, import("..").BkFlowNode>;
|
|
@@ -24756,6 +24758,7 @@ export declare const useMessageGroup: (options: {
|
|
|
24756
24758
|
onConfirmShare: () => ({
|
|
24757
24759
|
activityType: MessageContentType.FlowAgent | MessageContentType.KnowledgeRag | MessageContentType.ReferenceDocument | string;
|
|
24758
24760
|
content: {
|
|
24761
|
+
confidence_title?: string | undefined;
|
|
24759
24762
|
has_confidence?: boolean | undefined;
|
|
24760
24763
|
is_active?: boolean | undefined;
|
|
24761
24764
|
nodes: Record<string, import("..").BkFlowNode>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ObjectDirective } from 'vue';
|
|
2
2
|
import { type Props } from 'tippy.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { noop } from '../types';
|
|
4
4
|
import 'tippy.js/dist/tippy.css';
|
|
5
5
|
type MouseEnterFunc = (e?: MouseEvent) => void;
|
|
6
6
|
type OverflowElement = HTMLElement & {
|
|
@@ -10,6 +10,9 @@ export declare const BkFlowSuspendedIcon: import("vue").VNode<import("vue").Rend
|
|
|
10
10
|
export declare const BkFlowPendingIcon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
}>;
|
|
13
|
+
export declare const BkFlowSkippedIcon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}>;
|
|
13
16
|
export declare const ExecutionIcon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
14
17
|
[key: string]: any;
|
|
15
18
|
}>;
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const FullScreenIcon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const UnFullScreenIcon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}>;
|