@legendzd/ai-agent-vue 1.0.1
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/README.md +679 -0
- package/dist/ai-agent-vue.css +2 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons.svg +24 -0
- package/dist/index.cjs +239 -0
- package/dist/index.mjs +68891 -0
- package/dist/src/api/agent.d.ts +21 -0
- package/dist/src/components/AIIcon.vue.d.ts +3 -0
- package/dist/src/components/AgentButton.vue.d.ts +13 -0
- package/dist/src/components/AgentHistoryList.vue.d.ts +18 -0
- package/dist/src/components/AgentWindow.vue.d.ts +8 -0
- package/dist/src/components/ChatMessage.vue.d.ts +7 -0
- package/dist/src/components/HistoryPopover.vue.d.ts +15 -0
- package/dist/src/components/OrbCircle.vue.d.ts +14 -0
- package/dist/src/composables/useAgentSetup.d.ts +24 -0
- package/dist/src/composables/useClickOutside.d.ts +7 -0
- package/dist/src/composables/useSpeechRecognition.d.ts +22 -0
- package/dist/src/plugin/index.d.ts +1 -0
- package/dist/src/stores/chat.d.ts +406 -0
- package/dist/src/stores/pinia.d.ts +7 -0
- package/dist/src/types/agent.d.ts +136 -0
- package/dist/src/utils/echart.d.ts +84 -0
- package/dist/src/utils/echarts-zh-cn-locale.d.ts +1 -0
- package/dist/src/views/AgentChat.vue.d.ts +59 -0
- package/dist/src/views/AgentChatFull.vue.d.ts +56 -0
- package/dist/src/views/AgentChatMobile.vue.d.ts +62 -0
- package/package.json +80 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
/** 主题模式 */
|
|
3
|
+
export type AgentThemeMode = 'dark' | 'light';
|
|
4
|
+
/** 主题变量覆盖:键为 CSS 变量名(含 --agent- 前缀),值为 CSS 值 */
|
|
5
|
+
export type AgentThemeOverrides = Record<string, string>;
|
|
6
|
+
/** 智能体插件配置(所有字段均可选,由组件 props 或 install 时传入) */
|
|
7
|
+
export interface AgentPluginOptions {
|
|
8
|
+
/** API 基础地址(如 http://host:port/api/v2) */
|
|
9
|
+
apiUrl?: string;
|
|
10
|
+
/** 认证 token 获取函数 */
|
|
11
|
+
getAccessToken?: () => string;
|
|
12
|
+
/** 认证 session 获取函数 */
|
|
13
|
+
getSession?: () => string;
|
|
14
|
+
/** 用户 ID 获取函数,用于创建/查询会话(动态场景优先使用) */
|
|
15
|
+
getUserId?: () => string;
|
|
16
|
+
/** 用户 ID 静态值(简化用法,getUserId 优先) */
|
|
17
|
+
userId?: string;
|
|
18
|
+
/** LLM 提供商 ID */
|
|
19
|
+
llmProviderId?: number;
|
|
20
|
+
/** 提示词模板 ID */
|
|
21
|
+
promptTemplateId?: number;
|
|
22
|
+
/** 自定义提示词 */
|
|
23
|
+
customPrompt?: string;
|
|
24
|
+
/** 窗口标题文本 */
|
|
25
|
+
headerTitle?: string;
|
|
26
|
+
/** 空状态提示文本 */
|
|
27
|
+
emptyText?: string;
|
|
28
|
+
/** 输入框占位文本 */
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/** 主题模式,默认 dark */
|
|
31
|
+
mode?: AgentThemeMode;
|
|
32
|
+
/** 主题变量覆盖,如 { '--agent-btn-bg': '#2563eb', '--agent-window-width': '480px' } */
|
|
33
|
+
theme?: AgentThemeOverrides;
|
|
34
|
+
/** 是否启用语音输入,默认 true(浏览器不支持时自动隐藏) */
|
|
35
|
+
enableVoice?: boolean;
|
|
36
|
+
/** 语音识别语言,默认 zh-CN */
|
|
37
|
+
voiceLang?: string;
|
|
38
|
+
/** 实例 ID,用于多实例隔离,默认 'default' */
|
|
39
|
+
instanceId?: string;
|
|
40
|
+
}
|
|
41
|
+
/** provide/inject key */
|
|
42
|
+
export declare const AGENT_CONFIG_KEY: InjectionKey<ComputedRef<AgentPluginOptions>>;
|
|
43
|
+
/** 实例 ID provide/inject key */
|
|
44
|
+
export declare const AGENT_INSTANCE_KEY: InjectionKey<string>;
|
|
45
|
+
/** 聊天消息角色 */
|
|
46
|
+
export type ChatMessageRole = 'user' | 'assistant' | 'system';
|
|
47
|
+
/** 聊天消息状态 */
|
|
48
|
+
export type ChatMessageStatus = 'pending' | 'streaming' | 'done' | 'error';
|
|
49
|
+
/** 来源信息 */
|
|
50
|
+
export interface SourceInfo {
|
|
51
|
+
id: string;
|
|
52
|
+
title: string;
|
|
53
|
+
}
|
|
54
|
+
/** 单条聊天消息 */
|
|
55
|
+
export interface ChatMessage {
|
|
56
|
+
/** 唯一标识 */
|
|
57
|
+
id: string;
|
|
58
|
+
/** 消息角色 */
|
|
59
|
+
role: ChatMessageRole;
|
|
60
|
+
/** 消息内容 */
|
|
61
|
+
content: string;
|
|
62
|
+
/** 消息状态 */
|
|
63
|
+
status: ChatMessageStatus;
|
|
64
|
+
/** 创建时间戳 */
|
|
65
|
+
createdAt: number;
|
|
66
|
+
/** 关联的报告 ID(流式完成后服务端返回) */
|
|
67
|
+
reportId?: number;
|
|
68
|
+
/** 报告标题 */
|
|
69
|
+
title?: string;
|
|
70
|
+
/** 错误信息 */
|
|
71
|
+
errorMessage?: string;
|
|
72
|
+
/** AI 处理阶段提示(如"正在查询数据…") */
|
|
73
|
+
statusText?: string;
|
|
74
|
+
/** 生成的 SQL 语句 */
|
|
75
|
+
sql?: string;
|
|
76
|
+
/** 结构化数据 */
|
|
77
|
+
data?: any[];
|
|
78
|
+
/** 数据表格是否展开 */
|
|
79
|
+
dataExpanded?: boolean;
|
|
80
|
+
/** ECharts 图表配置 */
|
|
81
|
+
chartConfig?: any;
|
|
82
|
+
/** 来源依据 */
|
|
83
|
+
sources?: SourceInfo[];
|
|
84
|
+
}
|
|
85
|
+
/** 会话信息 */
|
|
86
|
+
export interface SessionInfo {
|
|
87
|
+
id: string;
|
|
88
|
+
title: string;
|
|
89
|
+
created_at: string;
|
|
90
|
+
}
|
|
91
|
+
/** 流式请求参数 */
|
|
92
|
+
export interface StreamRequestData {
|
|
93
|
+
sessionId: string;
|
|
94
|
+
query: string;
|
|
95
|
+
userId?: string;
|
|
96
|
+
}
|
|
97
|
+
/** 流式事件类型 */
|
|
98
|
+
export type StreamEventType = 'status' | 'sql' | 'data' | 'chart_config' | 'sources' | 'analysis_chunk' | 'delta' | 'done' | 'error';
|
|
99
|
+
/** 流式事件数据 */
|
|
100
|
+
export interface StreamEvent {
|
|
101
|
+
type: StreamEventType;
|
|
102
|
+
content?: any;
|
|
103
|
+
message?: string;
|
|
104
|
+
report_id?: number;
|
|
105
|
+
title?: string;
|
|
106
|
+
}
|
|
107
|
+
/** 布局模式 */
|
|
108
|
+
export type AgentLayoutMode = 'popup' | 'full' | 'mobile';
|
|
109
|
+
/** Full 布局特有参数 */
|
|
110
|
+
export interface AgentFullLayoutProps {
|
|
111
|
+
/** 是否显示历史侧栏,默认 true */
|
|
112
|
+
showSidebar?: boolean;
|
|
113
|
+
/** 侧栏宽度,默认 '280px' */
|
|
114
|
+
sidebarWidth?: string;
|
|
115
|
+
/** 侧栏位置,默认 'left' */
|
|
116
|
+
sidebarPosition?: 'left' | 'right';
|
|
117
|
+
}
|
|
118
|
+
/** Mobile 布局特有参数 */
|
|
119
|
+
export interface AgentMobileLayoutProps {
|
|
120
|
+
/** 顶部安全区,默认 'env(safe-area-inset-top, 0px)' */
|
|
121
|
+
safeAreaTop?: string;
|
|
122
|
+
/** 底部安全区,默认 'env(safe-area-inset-bottom, 0px)' */
|
|
123
|
+
safeAreaBottom?: string;
|
|
124
|
+
}
|
|
125
|
+
/** 流式回调 */
|
|
126
|
+
export interface StreamCallbacks {
|
|
127
|
+
onStatus?: (text: string) => void;
|
|
128
|
+
onSql?: (sql: string) => void;
|
|
129
|
+
onData?: (data: any[]) => void;
|
|
130
|
+
onChartConfig?: (config: any) => void;
|
|
131
|
+
onSources?: (sources: SourceInfo[]) => void;
|
|
132
|
+
onAnalysisChunk?: (chunk: string) => void;
|
|
133
|
+
onDone?: (reportId: number, title: string) => void;
|
|
134
|
+
onError?: (message: string) => void;
|
|
135
|
+
onComplete?: () => void;
|
|
136
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { EChartsOption, TooltipComponentOption } from 'echarts';
|
|
2
|
+
/** 当前是否暗色主题(由插件 mode 驱动,默认 true) */
|
|
3
|
+
export declare const isDarkMode: import('vue').Ref<boolean, boolean>;
|
|
4
|
+
/**
|
|
5
|
+
* 默认提示框样式配置
|
|
6
|
+
* - 半透明黑色背景和边框
|
|
7
|
+
* - 白色文本,12px 大小
|
|
8
|
+
*/
|
|
9
|
+
export declare const defaultTooltipStyle: TooltipComponentOption;
|
|
10
|
+
/**
|
|
11
|
+
* 图表点击事件回调的数据结构
|
|
12
|
+
*/
|
|
13
|
+
type ChartClickCallbackData = {
|
|
14
|
+
name: string;
|
|
15
|
+
value: unknown;
|
|
16
|
+
seriesName: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* ECharts 封装工具类
|
|
20
|
+
* 提供图表初始化、配置更新、自动轮播等功能
|
|
21
|
+
* 支持响应式布局和资源自动释放
|
|
22
|
+
*/
|
|
23
|
+
export declare class useEcharts {
|
|
24
|
+
private chart;
|
|
25
|
+
private interval;
|
|
26
|
+
private readonly resizeHandler;
|
|
27
|
+
private dom;
|
|
28
|
+
/**
|
|
29
|
+
* 构造函数
|
|
30
|
+
* @param dom 图表容器 DOM 元素
|
|
31
|
+
* @param option 图表配置项
|
|
32
|
+
* @param callback 点击事件回调函数
|
|
33
|
+
* @param scroll 是否启用自动轮播
|
|
34
|
+
*/
|
|
35
|
+
constructor(dom: HTMLElement, option: EChartsOption, callback?: (data: ChartClickCallbackData) => void, scroll?: boolean);
|
|
36
|
+
/**
|
|
37
|
+
* 初始化图表
|
|
38
|
+
* - 创建 ECharts 实例
|
|
39
|
+
* - 设置图表配置
|
|
40
|
+
* - 绑定点击事件
|
|
41
|
+
* - 启用自动轮播(如果需要)
|
|
42
|
+
*/
|
|
43
|
+
private initChart;
|
|
44
|
+
/**
|
|
45
|
+
* 更新图表配置
|
|
46
|
+
* @param option 新的图表配置
|
|
47
|
+
*/
|
|
48
|
+
setOption(option: EChartsOption): void;
|
|
49
|
+
/**
|
|
50
|
+
* 设置图表点击事件处理
|
|
51
|
+
* @param callback 点击事件回调函数
|
|
52
|
+
*/
|
|
53
|
+
private setupClickEvent;
|
|
54
|
+
/**
|
|
55
|
+
* 设置自动轮播功能
|
|
56
|
+
* @param option 图表配置,用于获取数据长度
|
|
57
|
+
*/
|
|
58
|
+
private setupCarousel;
|
|
59
|
+
/**
|
|
60
|
+
* 启动自动轮播
|
|
61
|
+
* @param dataLen 数据项数量
|
|
62
|
+
* @param intervalTime 轮播间隔时间(毫秒)
|
|
63
|
+
*/
|
|
64
|
+
private startCarousel;
|
|
65
|
+
/**
|
|
66
|
+
* 设置轮播交互逻辑
|
|
67
|
+
* - 鼠标悬停时暂停轮播
|
|
68
|
+
* - 鼠标移出时恢复轮播
|
|
69
|
+
*/
|
|
70
|
+
private setupCarouselInteraction;
|
|
71
|
+
/**
|
|
72
|
+
* 清除轮播定时器
|
|
73
|
+
*/
|
|
74
|
+
private clearCarousel;
|
|
75
|
+
/**
|
|
76
|
+
* 销毁图表实例并清理资源
|
|
77
|
+
* - 清除轮播定时器
|
|
78
|
+
* - 释放 ECharts 实例
|
|
79
|
+
* - 移除窗口大小变化监听器
|
|
80
|
+
* 建议在组件卸载时调用此方法,防止内存泄漏
|
|
81
|
+
*/
|
|
82
|
+
dispose(): void;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { AgentPluginOptions, AgentThemeMode } from '../../types/agent';
|
|
2
|
+
type __VLS_Props = AgentPluginOptions & {
|
|
3
|
+
config?: AgentPluginOptions;
|
|
4
|
+
};
|
|
5
|
+
/** 切换窗口显示 */
|
|
6
|
+
declare function toggleWindow(): void;
|
|
7
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
8
|
+
/** 当前会话 ID */
|
|
9
|
+
sessionId: string;
|
|
10
|
+
/** 历史会话列表 */
|
|
11
|
+
sessions: {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
created_at: string;
|
|
15
|
+
}[];
|
|
16
|
+
/** 当前对话消息列表 */
|
|
17
|
+
messages: {
|
|
18
|
+
id: string;
|
|
19
|
+
role: import('../../types/agent').ChatMessageRole;
|
|
20
|
+
content: string;
|
|
21
|
+
status: import('../../types/agent').ChatMessageStatus;
|
|
22
|
+
createdAt: number;
|
|
23
|
+
reportId?: number | undefined;
|
|
24
|
+
title?: string | undefined;
|
|
25
|
+
errorMessage?: string | undefined;
|
|
26
|
+
statusText?: string | undefined;
|
|
27
|
+
sql?: string | undefined;
|
|
28
|
+
data?: any[] | undefined;
|
|
29
|
+
dataExpanded?: boolean | undefined;
|
|
30
|
+
chartConfig?: any;
|
|
31
|
+
sources?: {
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
}[];
|
|
36
|
+
/** 是否正在流式接收 */
|
|
37
|
+
isStreaming: boolean;
|
|
38
|
+
/** 是否正在加载会话 */
|
|
39
|
+
isSessionLoading: boolean;
|
|
40
|
+
/** 初始化会话 */
|
|
41
|
+
initSession: () => Promise<void>;
|
|
42
|
+
/** 加载历史会话列表 */
|
|
43
|
+
loadSessions: () => Promise<void>;
|
|
44
|
+
/** 切换到指定会话 */
|
|
45
|
+
switchSession: (id: string) => void;
|
|
46
|
+
/** 新建聊天 */
|
|
47
|
+
newChat: () => Promise<void>;
|
|
48
|
+
/** 清空对话消息 */
|
|
49
|
+
clearMessages: () => void;
|
|
50
|
+
/** 切换窗口显示 */
|
|
51
|
+
toggleWindow: typeof toggleWindow;
|
|
52
|
+
/** 窗口是否可见 */
|
|
53
|
+
windowVisible: import('vue').Ref<boolean, boolean>;
|
|
54
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
55
|
+
instanceId: string;
|
|
56
|
+
mode: AgentThemeMode;
|
|
57
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AgentFullLayoutProps, AgentPluginOptions, AgentThemeMode } from '../../types/agent';
|
|
2
|
+
type __VLS_Props = AgentPluginOptions & {
|
|
3
|
+
config?: AgentPluginOptions;
|
|
4
|
+
} & AgentFullLayoutProps;
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
6
|
+
/** 当前会话 ID */
|
|
7
|
+
sessionId: string;
|
|
8
|
+
/** 历史会话列表 */
|
|
9
|
+
sessions: {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
created_at: string;
|
|
13
|
+
}[];
|
|
14
|
+
/** 当前对话消息列表 */
|
|
15
|
+
messages: {
|
|
16
|
+
id: string;
|
|
17
|
+
role: import('../../types/agent').ChatMessageRole;
|
|
18
|
+
content: string;
|
|
19
|
+
status: import('../../types/agent').ChatMessageStatus;
|
|
20
|
+
createdAt: number;
|
|
21
|
+
reportId?: number | undefined;
|
|
22
|
+
title?: string | undefined;
|
|
23
|
+
errorMessage?: string | undefined;
|
|
24
|
+
statusText?: string | undefined;
|
|
25
|
+
sql?: string | undefined;
|
|
26
|
+
data?: any[] | undefined;
|
|
27
|
+
dataExpanded?: boolean | undefined;
|
|
28
|
+
chartConfig?: any;
|
|
29
|
+
sources?: {
|
|
30
|
+
id: string;
|
|
31
|
+
title: string;
|
|
32
|
+
}[] | undefined;
|
|
33
|
+
}[];
|
|
34
|
+
/** 是否正在流式接收 */
|
|
35
|
+
isStreaming: boolean;
|
|
36
|
+
/** 是否正在加载会话 */
|
|
37
|
+
isSessionLoading: boolean;
|
|
38
|
+
/** 初始化会话 */
|
|
39
|
+
initSession: () => Promise<void>;
|
|
40
|
+
/** 加载历史会话列表 */
|
|
41
|
+
loadSessions: () => Promise<void>;
|
|
42
|
+
/** 切换到指定会话 */
|
|
43
|
+
switchSession: (id: string) => void;
|
|
44
|
+
/** 新建聊天 */
|
|
45
|
+
newChat: () => Promise<void>;
|
|
46
|
+
/** 清空对话消息 */
|
|
47
|
+
clearMessages: () => void;
|
|
48
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
49
|
+
instanceId: string;
|
|
50
|
+
mode: AgentThemeMode;
|
|
51
|
+
showSidebar: boolean;
|
|
52
|
+
sidebarWidth: string;
|
|
53
|
+
sidebarPosition: "left" | "right";
|
|
54
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
55
|
+
declare const _default: typeof __VLS_export;
|
|
56
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AgentMobileLayoutProps, AgentPluginOptions, AgentThemeMode } from '../../types/agent';
|
|
2
|
+
type __VLS_Props = AgentPluginOptions & {
|
|
3
|
+
config?: AgentPluginOptions;
|
|
4
|
+
} & AgentMobileLayoutProps;
|
|
5
|
+
/** 切换历史抽屉 */
|
|
6
|
+
declare function toggleDrawer(): void;
|
|
7
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
8
|
+
/** 当前会话 ID */
|
|
9
|
+
sessionId: string;
|
|
10
|
+
/** 历史会话列表 */
|
|
11
|
+
sessions: {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
created_at: string;
|
|
15
|
+
}[];
|
|
16
|
+
/** 当前对话消息列表 */
|
|
17
|
+
messages: {
|
|
18
|
+
id: string;
|
|
19
|
+
role: import('../../types/agent').ChatMessageRole;
|
|
20
|
+
content: string;
|
|
21
|
+
status: import('../../types/agent').ChatMessageStatus;
|
|
22
|
+
createdAt: number;
|
|
23
|
+
reportId?: number | undefined;
|
|
24
|
+
title?: string | undefined;
|
|
25
|
+
errorMessage?: string | undefined;
|
|
26
|
+
statusText?: string | undefined;
|
|
27
|
+
sql?: string | undefined;
|
|
28
|
+
data?: any[] | undefined;
|
|
29
|
+
dataExpanded?: boolean | undefined;
|
|
30
|
+
chartConfig?: any;
|
|
31
|
+
sources?: {
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
}[];
|
|
36
|
+
/** 是否正在流式接收 */
|
|
37
|
+
isStreaming: boolean;
|
|
38
|
+
/** 是否正在加载会话 */
|
|
39
|
+
isSessionLoading: boolean;
|
|
40
|
+
/** 初始化会话 */
|
|
41
|
+
initSession: () => Promise<void>;
|
|
42
|
+
/** 加载历史会话列表 */
|
|
43
|
+
loadSessions: () => Promise<void>;
|
|
44
|
+
/** 切换到指定会话 */
|
|
45
|
+
switchSession: (id: string) => void;
|
|
46
|
+
/** 新建聊天 */
|
|
47
|
+
newChat: () => Promise<void>;
|
|
48
|
+
/** 清空对话消息 */
|
|
49
|
+
clearMessages: () => void;
|
|
50
|
+
/** 历史抽屉可见 */
|
|
51
|
+
drawerVisible: import('vue').Ref<boolean, boolean>;
|
|
52
|
+
/** 切换历史抽屉 */
|
|
53
|
+
toggleDrawer: typeof toggleDrawer;
|
|
54
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
55
|
+
instanceId: string;
|
|
56
|
+
mode: AgentThemeMode;
|
|
57
|
+
placeholder: string;
|
|
58
|
+
safeAreaTop: string;
|
|
59
|
+
safeAreaBottom: string;
|
|
60
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
61
|
+
declare const _default: typeof __VLS_export;
|
|
62
|
+
export default _default;
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@legendzd/ai-agent-vue",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "可嵌入的 AI 智能体可视化 Vue 插件 — 浮动按钮、流式对话、Markdown/图表渲染",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"vue",
|
|
8
|
+
"vue3",
|
|
9
|
+
"ai",
|
|
10
|
+
"agent",
|
|
11
|
+
"chat",
|
|
12
|
+
"streaming",
|
|
13
|
+
"plugin",
|
|
14
|
+
"component"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "",
|
|
18
|
+
"main": "./dist/index.cjs",
|
|
19
|
+
"module": "./dist/index.mjs",
|
|
20
|
+
"types": "./dist/src/plugin/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/index.mjs",
|
|
24
|
+
"require": "./dist/index.cjs",
|
|
25
|
+
"types": "./dist/src/plugin/index.d.ts",
|
|
26
|
+
"style": "./dist/style.css"
|
|
27
|
+
},
|
|
28
|
+
"./dist/style.css": {
|
|
29
|
+
"default": "./dist/style.css"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"style": "./dist/style.css",
|
|
36
|
+
"sideEffects": [
|
|
37
|
+
"*.css"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public",
|
|
41
|
+
"registry": "https://registry.npmjs.org/"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"dev": "vite --force --mode development",
|
|
45
|
+
"build": "vue-tsc -b && vite build --force --mode production",
|
|
46
|
+
"build:lib": "vue-tsc -b && vite build --mode lib",
|
|
47
|
+
"preview": "vite preview --force --mode production",
|
|
48
|
+
"format": "prettier --write \"src/**/*.{vue,ts,tsx,js,jsx,json,css,less}\"",
|
|
49
|
+
"format:check": "prettier --check \"src/**/*.{vue,ts,tsx,js,jsx,json,css,less}\"",
|
|
50
|
+
"prepublishOnly": "npm run build:lib",
|
|
51
|
+
"release:patch": "npm version patch --no-git-tag-version && npm run build:lib && npm publish",
|
|
52
|
+
"release:minor": "npm version minor --no-git-tag-version && npm run build:lib && npm publish",
|
|
53
|
+
"release:major": "npm version major --no-git-tag-version && npm run build:lib && npm publish"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"echarts": "^5.6.0",
|
|
57
|
+
"highlight.js": "^11.11.1",
|
|
58
|
+
"markdown-it": "^14.2.0",
|
|
59
|
+
"ogl": "^1.0.11",
|
|
60
|
+
"pinia": "^3.0.4",
|
|
61
|
+
"pinia-plugin-persistedstate": "^4.7.1"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"vue": "^3.3.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@types/markdown-it": "^14.1.2",
|
|
68
|
+
"@types/node": "^24.12.3",
|
|
69
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
70
|
+
"@vue/tsconfig": "^0.9.1",
|
|
71
|
+
"less": "^4.6.4",
|
|
72
|
+
"prettier": "^3.8.3",
|
|
73
|
+
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
74
|
+
"typescript": "~6.0.2",
|
|
75
|
+
"vite": "^8.0.12",
|
|
76
|
+
"vite-plugin-dts": "^5.0.2",
|
|
77
|
+
"vue": "^3.5.34",
|
|
78
|
+
"vue-tsc": "^3.2.8"
|
|
79
|
+
}
|
|
80
|
+
}
|