@mybricks/plugin-ai 0.0.2 → 0.0.3
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/_virtual/_rollupPluginBabelHelpers.js +164 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/dist/agents/app.js +335 -0
- package/dist/agents/app.js.map +1 -0
- package/dist/agents/common.js +483 -0
- package/dist/agents/common.js.map +1 -0
- package/dist/agents/custom.js +16 -0
- package/dist/agents/custom.js.map +1 -0
- package/dist/agents/index.js +38 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/knowledges/knowledge-base.js +579 -0
- package/dist/agents/knowledges/knowledge-base.js.map +1 -0
- package/dist/agents/knowledges/knowledge-node.js +228 -0
- package/dist/agents/knowledges/knowledge-node.js.map +1 -0
- package/dist/agents/knowledges/types.js +105 -0
- package/dist/agents/knowledges/types.js.map +1 -0
- package/dist/agents/utils/config.js +229 -0
- package/dist/agents/utils/config.js.map +1 -0
- package/dist/agents/workspace/coding-manager.js +20 -0
- package/dist/agents/workspace/coding-manager.js.map +1 -0
- package/dist/agents/workspace/components-manager.js +113 -0
- package/dist/agents/workspace/components-manager.js.map +1 -0
- package/dist/agents/workspace/outline-focus.js +167 -0
- package/dist/agents/workspace/outline-focus.js.map +1 -0
- package/dist/agents/workspace/outline-info.js +430 -0
- package/dist/agents/workspace/outline-info.js.map +1 -0
- package/dist/agents/workspace/page-tree-generator.js +70 -0
- package/dist/agents/workspace/page-tree-generator.js.map +1 -0
- package/dist/agents/workspace/workspace.js +251 -0
- package/dist/agents/workspace/workspace.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/providers/component-docs-provider.js +100 -0
- package/dist/agents/workspace-by-knowledges/providers/component-docs-provider.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/providers/focus-info-provider.js +120 -0
- package/dist/agents/workspace-by-knowledges/providers/focus-info-provider.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/providers/project-info-provider.js +146 -0
- package/dist/agents/workspace-by-knowledges/providers/project-info-provider.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/test.js +242 -0
- package/dist/agents/workspace-by-knowledges/test.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/utils/components-manager.js +132 -0
- package/dist/agents/workspace-by-knowledges/utils/components-manager.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/utils/outline-focus.js +167 -0
- package/dist/agents/workspace-by-knowledges/utils/outline-focus.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/utils/outline-info.js +430 -0
- package/dist/agents/workspace-by-knowledges/utils/outline-info.js.map +1 -0
- package/dist/agents/workspace-by-knowledges/workspace.js +169 -0
- package/dist/agents/workspace-by-knowledges/workspace.js.map +1 -0
- package/dist/api/cloud-components.js +85 -0
- package/dist/api/cloud-components.js.map +1 -0
- package/dist/api-record-replay/manager.js +168 -0
- package/dist/api-record-replay/manager.js.map +1 -0
- package/{src/api-record-replay/recorder.ts → dist/api-record-replay/recorder.js} +22 -32
- package/dist/api-record-replay/recorder.js.map +1 -0
- package/dist/api-record-replay/replayer.js +136 -0
- package/dist/api-record-replay/replayer.js.map +1 -0
- package/dist/components/attachments/index.js +124 -0
- package/dist/components/attachments/index.js.map +1 -0
- package/dist/components/attachments/index.less.js +8 -0
- package/dist/components/attachments/index.less.js.map +1 -0
- package/dist/components/icons/index.js +112 -0
- package/dist/components/icons/index.js.map +1 -0
- package/dist/components/icons/index.less.js +8 -0
- package/dist/components/icons/index.less.js.map +1 -0
- package/dist/components/mention/index.js +19 -0
- package/dist/components/mention/index.js.map +1 -0
- package/dist/components/mention/index.less.js +8 -0
- package/dist/components/mention/index.less.js.map +1 -0
- package/dist/components/messages/index.js +429 -0
- package/dist/components/messages/index.js.map +1 -0
- package/dist/components/messages/index.less.js +8 -0
- package/dist/components/messages/index.less.js.map +1 -0
- package/dist/components/sender/index.js +244 -0
- package/dist/components/sender/index.js.map +1 -0
- package/dist/components/sender/index.less.js +8 -0
- package/dist/components/sender/index.less.js.map +1 -0
- package/dist/context/RequestStatusTracker.js +44 -0
- package/dist/context/RequestStatusTracker.js.map +1 -0
- package/dist/context/index.js +45 -0
- package/dist/context/index.js.map +1 -0
- package/dist/data.js +4 -0
- package/dist/data.js.map +1 -0
- package/dist/index.js +306 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-ai/node_modules/style-inject/dist/style-inject.es.js +27 -0
- package/dist/plugin-ai/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/plugin-ai/package.json.js +8 -0
- package/dist/plugin-ai/package.json.js.map +1 -0
- package/dist/plugin-ai/test/index.js +206 -0
- package/dist/plugin-ai/test/index.js.map +1 -0
- package/dist/preset/createTemplates.js +29 -0
- package/dist/preset/createTemplates.js.map +1 -0
- package/dist/preset/index.js +13 -0
- package/dist/preset/index.js.map +1 -0
- package/dist/preset/prompts.js +34 -0
- package/dist/preset/prompts.js.map +1 -0
- package/{src/preset/user.ts → dist/preset/user.js} +4 -3
- package/dist/preset/user.js.map +1 -0
- package/dist/requestAsStream.js +269 -0
- package/dist/requestAsStream.js.map +1 -0
- package/dist/rxai/node_modules/idb/build/index.js +277 -0
- package/dist/rxai/node_modules/idb/build/index.js.map +1 -0
- package/dist/rxai/src/agent/base.js +16 -0
- package/dist/rxai/src/agent/base.js.map +1 -0
- package/dist/rxai/src/agent/planning.js +1076 -0
- package/dist/rxai/src/agent/planning.js.map +1 -0
- package/dist/rxai/src/agent/rxai.js +254 -0
- package/dist/rxai/src/agent/rxai.js.map +1 -0
- package/dist/rxai/src/error/base.js +39 -0
- package/dist/rxai/src/error/base.js.map +1 -0
- package/dist/rxai/src/prompt/base.js +11 -0
- package/dist/rxai/src/prompt/base.js.map +1 -0
- package/dist/rxai/src/prompt/planning.js +23 -0
- package/dist/rxai/src/prompt/planning.js.map +1 -0
- package/dist/rxai/src/prompt/tool.js +14 -0
- package/dist/rxai/src/prompt/tool.js.map +1 -0
- package/dist/rxai/src/request/request.js +123 -0
- package/dist/rxai/src/request/request.js.map +1 -0
- package/dist/rxai/src/tool/getHistoryRecords.js +65 -0
- package/dist/rxai/src/tool/getHistoryRecords.js.map +1 -0
- package/dist/rxai/src/tool/util.js +424 -0
- package/dist/rxai/src/tool/util.js.map +1 -0
- package/dist/rxai/src/utils/events.js +43 -0
- package/dist/rxai/src/utils/events.js.map +1 -0
- package/dist/rxai/src/utils/idb.js +240 -0
- package/dist/rxai/src/utils/idb.js.map +1 -0
- package/dist/rxai/src/utils/retry.js +32 -0
- package/dist/rxai/src/utils/retry.js.map +1 -0
- package/dist/rxai/src/utils/uuid.js +7 -0
- package/dist/rxai/src/utils/uuid.js.map +1 -0
- package/dist/startView/components/header/header.js +12 -0
- package/dist/startView/components/header/header.js.map +1 -0
- package/dist/startView/components/header/header.less.js +8 -0
- package/dist/startView/components/header/header.less.js.map +1 -0
- package/dist/startView/index.js +62 -0
- package/dist/startView/index.js.map +1 -0
- package/dist/startView/index.less.js +8 -0
- package/dist/startView/index.less.js.map +1 -0
- package/dist/tools/analyze-and-expand-prd.js +116 -0
- package/dist/tools/analyze-and-expand-prd.js.map +1 -0
- package/dist/tools/analyze-requirement-and-components.js +208 -0
- package/dist/tools/analyze-requirement-and-components.js.map +1 -0
- package/dist/tools/answer.js +33 -0
- package/dist/tools/answer.js.map +1 -0
- package/dist/tools/build-process.js +550 -0
- package/dist/tools/build-process.js.map +1 -0
- package/dist/tools/coding-subagent-as-tool.js +101 -0
- package/dist/tools/coding-subagent-as-tool.js.map +1 -0
- package/dist/tools/generate-ui-content.js +528 -0
- package/dist/tools/generate-ui-content.js.map +1 -0
- package/dist/tools/index.js +31 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/open-dsl.js +49 -0
- package/dist/tools/open-dsl.js.map +1 -0
- package/dist/tools/refactor-ui-content.js +292 -0
- package/dist/tools/refactor-ui-content.js.map +1 -0
- package/dist/tools/utils.js +832 -0
- package/dist/tools/utils.js.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/view/components/header/header.js +59 -0
- package/dist/view/components/header/header.js.map +1 -0
- package/dist/view/components/header/header.less.js +8 -0
- package/dist/view/components/header/header.less.js.map +1 -0
- package/dist/view/index.js +184 -0
- package/dist/view/index.js.map +1 -0
- package/dist/view/index.less.js +8 -0
- package/dist/view/index.less.js.map +1 -0
- package/package.json +28 -6
- package/src/agents/app.ts +0 -301
- package/src/agents/common.ts +0 -471
- package/src/agents/custom.ts +0 -14
- package/src/agents/index.ts +0 -37
- package/src/agents/knowledges/README.md +0 -614
- package/src/agents/knowledges/SUMMARY.md +0 -527
- package/src/agents/knowledges/index.ts +0 -8
- package/src/agents/knowledges/knowledge-base.ts +0 -565
- package/src/agents/knowledges/knowledge-node.ts +0 -266
- package/src/agents/knowledges/types.ts +0 -208
- package/src/agents/utils/config.ts +0 -427
- package/src/agents/workspace/coding-manager.ts +0 -31
- package/src/agents/workspace/components-manager.ts +0 -124
- package/src/agents/workspace/outline-focus.ts +0 -188
- package/src/agents/workspace/outline-info.ts +0 -520
- package/src/agents/workspace/page-tree-generator.ts +0 -83
- package/src/agents/workspace/workspace.ts +0 -319
- package/src/agents/workspace-by-knowledges/MIGRATION.md +0 -568
- package/src/agents/workspace-by-knowledges/README.md +0 -521
- package/src/agents/workspace-by-knowledges/index.ts +0 -11
- package/src/agents/workspace-by-knowledges/providers/component-docs-provider.ts +0 -92
- package/src/agents/workspace-by-knowledges/providers/focus-info-provider.ts +0 -131
- package/src/agents/workspace-by-knowledges/providers/index.ts +0 -8
- package/src/agents/workspace-by-knowledges/providers/project-info-provider.ts +0 -151
- package/src/agents/workspace-by-knowledges/test.ts +0 -240
- package/src/agents/workspace-by-knowledges/types.ts +0 -56
- package/src/agents/workspace-by-knowledges/utils/components-manager.ts +0 -145
- package/src/agents/workspace-by-knowledges/utils/index.ts +0 -8
- package/src/agents/workspace-by-knowledges/utils/outline-focus.ts +0 -178
- package/src/agents/workspace-by-knowledges/utils/outline-info.ts +0 -521
- package/src/agents/workspace-by-knowledges/workspace.ts +0 -166
- package/src/api/cloud-components.ts +0 -129
- package/src/api-record-replay/README.md +0 -187
- package/src/api-record-replay/index.ts +0 -11
- package/src/api-record-replay/manager.ts +0 -168
- package/src/api-record-replay/replayer.ts +0 -148
- package/src/components/attachments/index.less +0 -117
- package/src/components/attachments/index.tsx +0 -136
- package/src/components/icons/index.less +0 -8
- package/src/components/icons/index.tsx +0 -44
- package/src/components/index.less +0 -34
- package/src/components/mention/index.less +0 -23
- package/src/components/mention/index.tsx +0 -19
- package/src/components/messages/index.less +0 -1013
- package/src/components/messages/index.tsx +0 -519
- package/src/components/sender/index.less +0 -203
- package/src/components/sender/index.tsx +0 -298
- package/src/components/types.ts +0 -31
- package/src/constants/index.ts +0 -8
- package/src/context/RequestStatusTracker.ts +0 -50
- package/src/context/index.ts +0 -83
- package/src/data.ts +0 -5
- package/src/global.d.ts +0 -100
- package/src/index.tsx +0 -264
- package/src/mock.ts +0 -1267
- package/src/preset/agents.ts +0 -380
- package/src/preset/createTemplates.ts +0 -25
- package/src/preset/index.ts +0 -12
- package/src/preset/prompts.ts +0 -235
- package/src/preset/requestAsStream.ts +0 -246
- package/src/startView/components/header/header.less +0 -17
- package/src/startView/components/header/header.tsx +0 -15
- package/src/startView/components/index.ts +0 -1
- package/src/startView/index.less +0 -34
- package/src/startView/index.tsx +0 -61
- package/src/tools/analyze-and-expand-prd.ts +0 -272
- package/src/tools/analyze-requirement-and-components.ts +0 -589
- package/src/tools/answer.ts +0 -59
- package/src/tools/build-process.ts +0 -1174
- package/src/tools/coding-subagent-as-tool.ts +0 -119
- package/src/tools/generate-ui-content.ts +0 -1083
- package/src/tools/index.ts +0 -28
- package/src/tools/open-dsl.ts +0 -69
- package/src/tools/refactor-ui-content.ts +0 -801
- package/src/tools/type.d.ts +0 -12
- package/src/tools/utils.ts +0 -914
- package/src/types/index.ts +0 -4
- package/src/view/components/header/header.less +0 -51
- package/src/view/components/header/header.tsx +0 -60
- package/src/view/components/index.ts +0 -1
- package/src/view/index.less +0 -5
- package/src/view/index.tsx +0 -168
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
import { MyBricksParamsTools, MYBRICKS_TOOLS } from "../../tools";
|
|
2
|
-
import { context } from "../../context";
|
|
3
|
-
import { Rxai, IDB } from "@mybricks/rxai";
|
|
4
|
-
|
|
5
|
-
export { MyBricksParamsTools } from "../../tools";
|
|
6
|
-
|
|
7
|
-
type SystemAgentType = 'page' | 'uiCom' | 'app' | 'section';
|
|
8
|
-
|
|
9
|
-
type AgentType = SystemAgentType | string;
|
|
10
|
-
|
|
11
|
-
// 自定义工具格式(参考 answer.ts)
|
|
12
|
-
type CustomTool = {
|
|
13
|
-
name: string;
|
|
14
|
-
displayName?: string;
|
|
15
|
-
description: string;
|
|
16
|
-
getPrompts?: (params?: any) => string;
|
|
17
|
-
execute: (params: { files?: any; content?: any }) => any;
|
|
18
|
-
aiRole?: string;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export interface AgentConfigParams {
|
|
22
|
-
/** ui展示名称 */
|
|
23
|
-
name?: string
|
|
24
|
-
/** 类型 */
|
|
25
|
-
type?: AgentType
|
|
26
|
-
/** 定义这是一个干什么用的Agent */
|
|
27
|
-
goal?: string
|
|
28
|
-
/** 背景知识补充 */
|
|
29
|
-
backstory?: string,
|
|
30
|
-
/** 重点关注的内容 */
|
|
31
|
-
attentions?: string,
|
|
32
|
-
/** 工具列表:系统类型使用 MyBricksParamsTools 的返回值,自定义类型使用 CustomTool 格式 */
|
|
33
|
-
tools?: ReturnType<typeof MyBricksParamsTools[keyof typeof MyBricksParamsTools]>[] | CustomTool[];
|
|
34
|
-
formatUserMessage?: (text: string, { focusParams }: { focusParams: AiServiceFocusParams }) => string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function Agent(config: AgentConfigParams) {
|
|
38
|
-
const { name = '智能助手', type = 'page', tools = [], goal, backstory, attentions } = config;
|
|
39
|
-
|
|
40
|
-
// 判断是否为系统类型
|
|
41
|
-
const systemAgentTypes: SystemAgentType[] = ['page', 'uiCom', 'app', 'section'];
|
|
42
|
-
const isSystemType = systemAgentTypes.includes(type as SystemAgentType);
|
|
43
|
-
|
|
44
|
-
// 如果是系统类型,返回现有结构
|
|
45
|
-
if (isSystemType) {
|
|
46
|
-
return {
|
|
47
|
-
name,
|
|
48
|
-
type,
|
|
49
|
-
goal,
|
|
50
|
-
attentions,
|
|
51
|
-
tools,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 如果是自定义类型,使用 BaseAgent 创建
|
|
56
|
-
return BaseAgent({
|
|
57
|
-
name,
|
|
58
|
-
type,
|
|
59
|
-
goal,
|
|
60
|
-
backstory,
|
|
61
|
-
tools,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function BaseAgent(config: AgentConfigParams) {
|
|
66
|
-
const { name = '智能助手', type, goal, backstory, tools = [], formatUserMessage } = config;
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
...config,
|
|
70
|
-
request(params: any) {
|
|
71
|
-
return new Promise((resolve, reject) => {
|
|
72
|
-
if (!context.rxai) {
|
|
73
|
-
return reject('Rxai instance not initialized');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// 自定义工具的 tools 已经是工具对象格式,可以直接传给 requestAI
|
|
77
|
-
const customTools = tools as CustomTool[];
|
|
78
|
-
|
|
79
|
-
// 调用 requestAI
|
|
80
|
-
// 注意:system prompt 在 createRxai 时已设置,如需自定义 system prompt,
|
|
81
|
-
// 可以通过创建新的 Rxai 实例或使用 messages 参数传递
|
|
82
|
-
context.rxai.requestAI({
|
|
83
|
-
...params,
|
|
84
|
-
system: {
|
|
85
|
-
title: name,
|
|
86
|
-
prompt: backStoryPrompts({ goal, backstory }),
|
|
87
|
-
},
|
|
88
|
-
message: params?.message,
|
|
89
|
-
formatUserMessage: (text: string) => {
|
|
90
|
-
return formatUserMessage ? formatUserMessage(text, { focusParams: context.currentFocus as AiServiceFocusParams }) : text;
|
|
91
|
-
},
|
|
92
|
-
emits: {
|
|
93
|
-
write: () => {},
|
|
94
|
-
complete: () => {
|
|
95
|
-
resolve('complete');
|
|
96
|
-
params?.onProgress?.("complete");
|
|
97
|
-
},
|
|
98
|
-
error: (error: any) => {
|
|
99
|
-
reject(error);
|
|
100
|
-
params?.onProgress?.("error");
|
|
101
|
-
},
|
|
102
|
-
cancel: () => {
|
|
103
|
-
params?.onProgress?.("complete");
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
tools: customTools,
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function getAgentConfigs(agents: AgentConfigParams[], type: AgentType = 'page') {
|
|
114
|
-
if (!Array.isArray(agents)) return null
|
|
115
|
-
const targetAgent = agents.find(agent => agent.type === type);
|
|
116
|
-
|
|
117
|
-
// 根据工具名称获取对应工具的完整参数
|
|
118
|
-
const getToolParams = (toolName: string) => {
|
|
119
|
-
const tools = targetAgent?.tools;
|
|
120
|
-
const tool: any = tools?.find(t => t.name === toolName);
|
|
121
|
-
return (tool?.params as any) || {};
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
return {
|
|
125
|
-
system: backStoryPrompts({ goal: targetAgent?.goal, backstory: targetAgent?.backstory }),
|
|
126
|
-
attentions: targetAgent?.attentions,
|
|
127
|
-
getToolParams,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* 根据类型获取 agent 实例
|
|
133
|
-
* 如果是自定义类型,返回包含 request 方法的 agent 实例
|
|
134
|
-
* 如果是系统类型,返回 null
|
|
135
|
-
*/
|
|
136
|
-
export function getAgentInstance(agents: AgentConfigParams[] | undefined, type: AgentType): ReturnType<typeof BaseAgent> | null {
|
|
137
|
-
if (!Array.isArray(agents)) return null;
|
|
138
|
-
|
|
139
|
-
const targetAgent = agents.find(agent => agent.type === type);
|
|
140
|
-
if (!targetAgent) return null;
|
|
141
|
-
|
|
142
|
-
// 判断是否为系统类型
|
|
143
|
-
const systemAgentTypes: SystemAgentType[] = ['page', 'uiCom', 'app', 'section'];
|
|
144
|
-
const isSystemType = systemAgentTypes.includes(type as SystemAgentType);
|
|
145
|
-
|
|
146
|
-
// 如果是系统类型,返回 null(使用默认的 requestCommonAgent)
|
|
147
|
-
if (isSystemType) return null;
|
|
148
|
-
|
|
149
|
-
// 如果是自定义类型,使用 BaseAgent 创建实例
|
|
150
|
-
return BaseAgent(targetAgent);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* 转换历史的 prompts 配置为新的 agents 配置
|
|
155
|
-
* 用于兼容旧版本的 { prompts: { systemAppendPrompts, prdExamplesPrompts, generatePageActionExamplesPrompts } } 配置
|
|
156
|
-
*/
|
|
157
|
-
export function transformLegacyPromptsToAgents(prompts: any): AgentConfigParams[] {
|
|
158
|
-
if (!prompts) return [];
|
|
159
|
-
|
|
160
|
-
const tools: any[] = [];
|
|
161
|
-
|
|
162
|
-
// 如果有 prdExamplesPrompts,说明需要 AnalyzeRequirementAndComponents 工具
|
|
163
|
-
if (prompts.prdExamplesPrompts) {
|
|
164
|
-
tools.push(MyBricksParamsTools.AnalyzeRequirementAndComponents({
|
|
165
|
-
fewShots: prompts.prdExamplesPrompts
|
|
166
|
-
}));
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// 如果有 generatePageActionExamplesPrompts,说明需要 GenerateUiContent 工具
|
|
170
|
-
if (prompts.generatePageActionExamplesPrompts) {
|
|
171
|
-
tools.push(MyBricksParamsTools.GenerateUiContent({
|
|
172
|
-
fewShots: prompts.generatePageActionExamplesPrompts
|
|
173
|
-
}));
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return [{
|
|
177
|
-
type: 'page',
|
|
178
|
-
attentions: prompts.systemAppendPrompts,
|
|
179
|
-
tools
|
|
180
|
-
}];
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export function backStoryPrompts({ goal = '主要处理 MyBricks 低代码搭建页面相关的问题,帮助用户完成搭建需求', backstory }: { goal?: string, backstory?: string } = {}): string {
|
|
184
|
-
return `<关于当前所处理的问题领域/>
|
|
185
|
-
${goal}。
|
|
186
|
-
|
|
187
|
-
${backstory ? `\n${backstory}` : `你对以下几个领域的知识都十分擅长并且专业,包含但不限于:
|
|
188
|
-
<设计器领域>
|
|
189
|
-
工具来自与设计器的交互,MyBricks设计器提供多画布的搭建系统用于快速搭建UI和逻辑,提供通过拖拉拽来完成IT需求的系统。
|
|
190
|
-
设计器往往往包含丰富的工具,遵循人类的操作逻辑来完成工具调用,比如要生成一个页面,需要由聚焦到哪个页面来决定,生成的时候添加组件又需要组件的配置文档。
|
|
191
|
-
|
|
192
|
-
你需要了解的定义:
|
|
193
|
-
<聚焦元素>
|
|
194
|
-
聚焦是指当前设计器中用户正在操作的画布(也可以说是页面/对话框)或者组件,聚焦决定了工具调用的作用域和目标,也决定了需求指向的目标和上下文。
|
|
195
|
-
所以每一次用户咨询,都必须明确「当前聚焦」的是什么,聚焦多次则以最后一次为准。
|
|
196
|
-
</聚焦元素>
|
|
197
|
-
|
|
198
|
-
<搭建元素>
|
|
199
|
-
搭建元素是设计器中的基本构建单元,可以是页面、对话框、组件、数据源、逻辑流、区块等。
|
|
200
|
-
<组件>
|
|
201
|
-
MyBricks 组件是搭建的基本单元之一,在搭建时,除了通用的尺寸、定位、位置等配置,其余必须参考组件配置文档来进行配置。
|
|
202
|
-
如果要修改/新增组件:必须参考配置文档来配置。
|
|
203
|
-
</组件>
|
|
204
|
-
|
|
205
|
-
<页面>
|
|
206
|
-
MyBricks 页面是构成APP的基本单元,支持切换不同页面进行搭建。
|
|
207
|
-
</页面>
|
|
208
|
-
|
|
209
|
-
<区块>
|
|
210
|
-
MyBricks 区块是对一个区域的搭建,区块可以包含复合组件。
|
|
211
|
-
</区块>
|
|
212
|
-
</搭建元素>
|
|
213
|
-
|
|
214
|
-
<布局>
|
|
215
|
-
flex布局和智能布局,是MyBricks设计器提供的两大布局方式,当然还有固定布局和绝对定位布局。
|
|
216
|
-
</布局>
|
|
217
|
-
|
|
218
|
-
<事件流程>
|
|
219
|
-
事件流程是MyBricks设计器中实现交互逻辑的核心机制。它让静态的界面元素能够响应用户操作或系统状态变化,执行预设的动作序列,从而实现动态的、智能的应用行为。
|
|
220
|
-
|
|
221
|
-
事件流程由三个核心部分构成:
|
|
222
|
-
1. 事件触发器:流程的起点。代表“当什么事情发生”。通常是用户的某个交互动作(如点击、输入、选择)或系统自动触发的时机(如页面加载完成、定时器到点、数据更新)。
|
|
223
|
-
2. 处理动作:流程的执行步骤。代表“要做什么事情”。可以是:
|
|
224
|
-
- 更新界面:例如,显示或隐藏某个区域、修改文本内容、调整样式。
|
|
225
|
-
- 处理数据:执行计算、转换格式、发起网络请求。
|
|
226
|
-
- 控制导航:跳转到其他页面、打开或关闭弹窗。
|
|
227
|
-
3. 数据流向:连接各个步骤的数据通道。一个动作的执行结果可以作为下一个动作的输入,形成连贯的处理链条。
|
|
228
|
-
|
|
229
|
-
类比理解:事件流程就像一套精心编排的“自动化剧本”。
|
|
230
|
-
- 触发事件:是剧本的开场信号(例如,用户按下“提交”按钮)。
|
|
231
|
-
- 处理动作:是剧本中一幕幕连贯的情节(例如:收集表单信息 -> 验证数据 -> 发送请求 -> 处理响应)。
|
|
232
|
-
- 最终效果:是剧本的结局呈现(例如:显示成功提示并刷新列表)。
|
|
233
|
-
|
|
234
|
-
在设计器中,你通过**可视化连接不同功能模块的端口**来编排这个“剧本”。整个过程无需编写复杂代码,通过拖拽和配置即可完成从简单交互到复杂业务逻辑的自动化处理。
|
|
235
|
-
|
|
236
|
-
关键特性:
|
|
237
|
-
- 可视化编排:逻辑以直观的流程图方式呈现,结构清晰,易于理解和维护。
|
|
238
|
-
- 声明式配置:通过选择与配置来定义行为,降低技术门槛。
|
|
239
|
-
- 模块化封装:每个功能模块(页面、组件)拥有独立的事件流程空间,保证逻辑清晰、互不干扰。
|
|
240
|
-
</事件流程>
|
|
241
|
-
</设计器领域>
|
|
242
|
-
|
|
243
|
-
<软件工程领域>
|
|
244
|
-
我们是低代码搭建系统,对于设计互联网产品的知识你同样非常了解,包含UI设计、产品、原型等知识,你都是极其了解的,对设计风格、美化、产品设计都不在话下。
|
|
245
|
-
作为一名软件工程领域的专家,你拥有大量的专业知识可以将这些抽象概念转化为具体的、可执行的设计方案(如颜色、字体、布局、圆角等),而不是第一时间要求用户提供所有细节。只有在完全无法解读或用户时,才可进行追问。
|
|
246
|
-
</软件工程领域>
|
|
247
|
-
|
|
248
|
-
<图片领域>
|
|
249
|
-
我们有大量的图片资源以供搜索,通过修改组件和生成UI可以通过特定的链接使用在线图片搜索服务。
|
|
250
|
-
</图片领域>
|
|
251
|
-
`}
|
|
252
|
-
</关于当前所处理的问题领域/>
|
|
253
|
-
|
|
254
|
-
<针对当前领域如何规划工具>
|
|
255
|
-
工具的规划必须遵循工具的「参数」「作用」「前置依赖」「聚焦元素要求」等描述信息,合理提出思考,同时给出规划,对于不合理的要求及时纠正用户。
|
|
256
|
-
|
|
257
|
-
<规则>
|
|
258
|
-
关于附件:用户上传的图片和文件,能够同时作用于页面和组件;
|
|
259
|
-
工具分类:目前主要有*信息获取类*和*操作执行类*,信息获取类作为最后一个工具被调用时,需要调用回答工具;
|
|
260
|
-
</规则>
|
|
261
|
-
|
|
262
|
-
${
|
|
263
|
-
// TODO:这里后续需要重新梳理,现在是特殊的hack,有backstory就不要这些信息了
|
|
264
|
-
backstory ? '' : `<如何思考>
|
|
265
|
-
1. 判断是否遵循规则,对于不遵循规则的不合理需求,给予用户合理的建议;
|
|
266
|
-
2. 判断需求的分类;
|
|
267
|
-
3. 规划工具
|
|
268
|
-
3.1 如果当前需求是「修改组件/区块」;
|
|
269
|
-
3.1.1 首先先获取「获取DSL」来获取上下文和组件配置文档;
|
|
270
|
-
3.1.2 判断是否需要新增组件,如果需要新增,则还需要「需求分析和组件选型」来获取新增组件的配置文档;
|
|
271
|
-
3.1.3 调用「修改/重构组件」来执行修改;
|
|
272
|
-
3.2 如果当前需求是「生成UI」,生成UI会清空画布,所以无需关心上下文;
|
|
273
|
-
3.2.1 调用「需求分析/组件选型」来获取组件配置文档和需求;
|
|
274
|
-
3.2.2 调用「生成UI」来执行页面生成;
|
|
275
|
-
3.3 如果当前需求是「咨询提问」类,则灵活决定是否需要先获取信息再回答用户;
|
|
276
|
-
> 注意:聚焦信息默认每次都会提供,有时候问题通过聚焦信息就可以回答;
|
|
277
|
-
3.4 如果当前需求是「追加提问」类,则需要根据上下文和工具灵活地咨询用户更多信息,比如不断提问“没实现”“没搞好”“搞错了”,由于你对当前的搭建效果的感知有限,可以向用户获取你通过工具无法知道的信息(比如截图等);
|
|
278
|
-
3.5 当需求涉及“开发、搭建”等操作性描述时,以当前聚焦的元素(页面、组件或区块)为判断依据;
|
|
279
|
-
|
|
280
|
-
<思考示例>
|
|
281
|
-
- 改成苹果风格:你对设计领域非常熟悉,有大量的设计知识,苹果风格你太了解了,可以直接修改,改风格需要修改样式,先获取相关DSL,接下来调用「重构UI」来修改UI;
|
|
282
|
-
- 改成XX卡片:判断是不是完全重构内容,如果重构内容涉及组件的替换,为了防止出现缺失组件使用文档的情况,先获取DSL、再组件选型,最后调用「重构UI」来修改UI,同时注意逻辑修改需要添加逻辑编排节点;
|
|
283
|
-
- 修改背景色 / 换个图标:修改样式和配置需要组件文档,所以先获取相关DSL,接下来调用「修改/重构组件」;
|
|
284
|
-
- 总结下之前的操作:无需调用工具,通过历史对话总结下用户的操作;
|
|
285
|
-
- 这是什么:通过工作空间的简略信息即可知道个大概,如果用户想知道样式等信息,需要获取DSL,再使用「分析回答」回答用户的问题;
|
|
286
|
-
- 可以改颜色吗:先获取DSL,然后使用「分析回答」回答用户的问题;
|
|
287
|
-
- 梳理这个页面的内容变成一个PRD文档:先获取DSL梳理内容,然后使用「分析回答」回答用户的问题;
|
|
288
|
-
- 替换成XX组件:由于替换组件不确定要替换成什么,所以需要先获取DSL,然后调用「组件选型」,最后调用「修改/重构组件」;
|
|
289
|
-
</思考示例>
|
|
290
|
-
</如何思考>`
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
<如何处理用户的负面追问>
|
|
295
|
-
当用户给出负面反馈时(例如“搞错了”、“效果不对”、“不是这样”),你**必须**遵循以下步骤:
|
|
296
|
-
1. **自我反思**:在内部回顾你上一步规划是什么。
|
|
297
|
-
2. **提出假设**:基于你上一步的规划,分析可能出错的几个点(例如:是理解错了目标?还是修改的细节不对?是工具选错了?)。
|
|
298
|
-
3. **主动提问**:将你的反思和假设以简明扼要的选项或问题形式呈现给用户,引导用户做出具体判断,而不是被动地等待用户提供所有信息。
|
|
299
|
-
</如何处理用户的负面追问>
|
|
300
|
-
|
|
301
|
-
<如何处理用户的模糊提问>
|
|
302
|
-
当收到模糊或不明确的指令时(例如“处理一下”、“优化它”),你【必须】遵循以下行动优先级,这与处理负面反馈的逻辑类似:
|
|
303
|
-
1. **优先尝试规划**:首先,你必须基于当前上下文和你的专业能力,对用户的意图做出最合理的假设,并【直接制定一个完整的计划去执行】。这体现了你的主动性和专业性,是解决问题的首选路径。
|
|
304
|
-
2. **引导式提问**:只有在你完全无法做出任何合理假设,导致制定任何有意义的规划都【彻底不可能】时,才能作为最终手段向用户提问。提问时,必须将你的思考和假设作为选项提供给用户,而不是宽泛地要求用户澄清。
|
|
305
|
-
</如何处理用户的模糊提问>
|
|
306
|
-
|
|
307
|
-
</针对当前领域如何规划工具>
|
|
308
|
-
` }
|
|
309
|
-
|
|
310
|
-
interface SingleInstanceAgentOptions {
|
|
311
|
-
name: string;
|
|
312
|
-
type: string;
|
|
313
|
-
goal: string;
|
|
314
|
-
backstory: string;
|
|
315
|
-
tools: (params: any) => ReturnType<typeof MyBricksParamsTools[keyof typeof MyBricksParamsTools]>[] | CustomTool[];
|
|
316
|
-
}
|
|
317
|
-
export class SingleInstanceAgent {
|
|
318
|
-
system: any;
|
|
319
|
-
tools: any;
|
|
320
|
-
type: string;
|
|
321
|
-
constructor(options: SingleInstanceAgentOptions) {
|
|
322
|
-
this.system = backStoryPrompts({ goal: options.goal, backstory: options.backstory });
|
|
323
|
-
this.tools = options.tools;
|
|
324
|
-
this.type = options.type;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
rxaiMap: Record<string, {
|
|
328
|
-
rxai: Rxai;
|
|
329
|
-
tools: ReturnType<typeof MyBricksParamsTools[keyof typeof MyBricksParamsTools]>[] | CustomTool[];
|
|
330
|
-
focus: any;
|
|
331
|
-
}> = {};
|
|
332
|
-
|
|
333
|
-
getRxai(options: any) {
|
|
334
|
-
const { key, focus } = options;
|
|
335
|
-
if (!this.rxaiMap[key]) {
|
|
336
|
-
this.rxaiMap[key] = {
|
|
337
|
-
rxai: new Rxai({
|
|
338
|
-
system: this.system,
|
|
339
|
-
request: {
|
|
340
|
-
maxRetries: 3,
|
|
341
|
-
requestAsStream: context.pluginParams.requestAsStream
|
|
342
|
-
},
|
|
343
|
-
idb: new IDB({
|
|
344
|
-
dbName: "@mybricks/plugin-ai/messages",
|
|
345
|
-
key
|
|
346
|
-
})
|
|
347
|
-
}),
|
|
348
|
-
tools: this.tools({ focus }),
|
|
349
|
-
focus,
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return this.rxaiMap[key].rxai;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
request(key: string, params: any) {
|
|
356
|
-
return new Promise((resolve, reject) => {
|
|
357
|
-
const { formatUserMessage } = params;
|
|
358
|
-
const { rxai, tools, focus } = this.rxaiMap[key];
|
|
359
|
-
rxai.requestAI({
|
|
360
|
-
...params,
|
|
361
|
-
formatUserMessage: (text: string) => {
|
|
362
|
-
return formatUserMessage ? formatUserMessage(text, { focusParams: focus as AiServiceFocusParams }) : text;
|
|
363
|
-
},
|
|
364
|
-
emits: {
|
|
365
|
-
write: () => {},
|
|
366
|
-
complete: () => {
|
|
367
|
-
resolve('complete');
|
|
368
|
-
params?.onProgress?.("complete");
|
|
369
|
-
},
|
|
370
|
-
error: (error: any) => {
|
|
371
|
-
reject(error);
|
|
372
|
-
params?.onProgress?.("error");
|
|
373
|
-
},
|
|
374
|
-
cancel: () => {},
|
|
375
|
-
},
|
|
376
|
-
tools,
|
|
377
|
-
});
|
|
378
|
-
})
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
export abstract class AbstractAgent {
|
|
383
|
-
type: string;
|
|
384
|
-
system: any;
|
|
385
|
-
rxaiMap: any = {};
|
|
386
|
-
|
|
387
|
-
constructor(options: { type: string; goal: string; backstory: string; name: string }) {
|
|
388
|
-
this.type = options.type
|
|
389
|
-
this.system = {
|
|
390
|
-
title: options.name,
|
|
391
|
-
prompt: backStoryPrompts({ goal: options.goal, backstory: options.backstory })
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
getRxai(params: { key: any }) {
|
|
396
|
-
const { key } = params;
|
|
397
|
-
if (!this.rxaiMap[key]) {
|
|
398
|
-
this.rxaiMap[key] = new Rxai({
|
|
399
|
-
system: this.system,
|
|
400
|
-
request: {
|
|
401
|
-
maxRetries: 3,
|
|
402
|
-
requestAsStream: context.pluginParams.requestAsStream
|
|
403
|
-
},
|
|
404
|
-
idb: new IDB({
|
|
405
|
-
dbName: "@mybricks/plugin-ai/messages",
|
|
406
|
-
key
|
|
407
|
-
})
|
|
408
|
-
})
|
|
409
|
-
}
|
|
410
|
-
return this.rxaiMap[key];
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
abstract request(params: { key: any; params: any; focus: any; }): Promise<any>;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
export class CustomAgent extends AbstractAgent {
|
|
417
|
-
requestAI: any;
|
|
418
|
-
constructor(options: any) {
|
|
419
|
-
super(options);
|
|
420
|
-
this.requestAI = options.request;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
request(params: { key: any; params: any; focus: any; }): Promise<any> {
|
|
424
|
-
const rxai = this.getRxai({ key: params.key });
|
|
425
|
-
return this.requestAI({ rxai, ...params });
|
|
426
|
-
}
|
|
427
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface CodingCom {
|
|
2
|
-
pageId: string
|
|
3
|
-
comId: string
|
|
4
|
-
title: string
|
|
5
|
-
requirement: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/** 只负责存储待开发组件 ID 列表及获取所需上下文 */
|
|
9
|
-
export class CodingManager {
|
|
10
|
-
attachments: any
|
|
11
|
-
getJsxById: (id: string) => string
|
|
12
|
-
pageId: string
|
|
13
|
-
waitForCoding: CodingCom[] = []
|
|
14
|
-
|
|
15
|
-
constructor(params: {
|
|
16
|
-
pageId: string
|
|
17
|
-
attachments: any[]
|
|
18
|
-
getJsxById: (id: string) => string
|
|
19
|
-
}) {
|
|
20
|
-
this.pageId = params.pageId
|
|
21
|
-
this.attachments = params.attachments
|
|
22
|
-
this.getJsxById = params.getJsxById
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
addCodingCom(com: CodingCom) {
|
|
26
|
-
if (this.waitForCoding.some((c) => c.comId === com.comId)) {
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
this.waitForCoding.push(com)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
export class ComponentsManager {
|
|
2
|
-
private static isLoaded = false
|
|
3
|
-
private static aiComponentMap = new Map<string, any>()
|
|
4
|
-
private static namespaceAbbrevMap = new Map<string, string>() // 缩写 -> 完整namespace
|
|
5
|
-
private static abbreviationMap = new Map<string, string>() // 完整namespace -> 缩写
|
|
6
|
-
|
|
7
|
-
private static init = () => {
|
|
8
|
-
if (this.isLoaded) {
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
if (!window.__comlibs_edit_) {
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const forEachComponent = (com: any, callback: (com: any) => void) => {
|
|
16
|
-
if (com?.namespace) {
|
|
17
|
-
callback?.(com)
|
|
18
|
-
}
|
|
19
|
-
if (Array.isArray(com?.comAray)) {
|
|
20
|
-
com?.comAray.forEach((child: any) => {
|
|
21
|
-
forEachComponent(child, callback)
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
window.__comlibs_edit_.forEach((comlib: any) => {
|
|
27
|
-
forEachComponent(comlib, (com) => {
|
|
28
|
-
if (com?.ai) {
|
|
29
|
-
this.aiComponentMap.set(com.namespace, {
|
|
30
|
-
...com.ai,
|
|
31
|
-
all: com
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
const abbreviation = com.namespace
|
|
35
|
-
.replace('mybricks.normal-pc.antd5.', 'pc.')
|
|
36
|
-
.replace('mybricks.normal-pc.', 'pc.')
|
|
37
|
-
.replace('mybricks.harmony.', 'mb.')
|
|
38
|
-
.replace('mybricks.taro.', 'mb.')
|
|
39
|
-
|
|
40
|
-
// 收集缩写映射关系
|
|
41
|
-
if (abbreviation !== com.namespace) {
|
|
42
|
-
this.namespaceAbbrevMap.set(abbreviation, com.namespace)
|
|
43
|
-
this.abbreviationMap.set(com.namespace, abbreviation)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
this.isLoaded = true
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
static getRequireComponents = (ns: string): any[] => {
|
|
53
|
-
this.init()
|
|
54
|
-
|
|
55
|
-
let res: any[] = []
|
|
56
|
-
if (this.aiComponentMap.has(ns)) {
|
|
57
|
-
const ai = this.aiComponentMap.get(ns)
|
|
58
|
-
if (Array.isArray(ai.requires)) {
|
|
59
|
-
res = res.concat(ai.requires)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return res
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* 判断是否为布局组件(asLayout)
|
|
67
|
-
*/
|
|
68
|
-
static isLayoutComponent = (namespace: string): boolean => {
|
|
69
|
-
this.init()
|
|
70
|
-
const ai = this.aiComponentMap.get(this.getFullNamespace(namespace))
|
|
71
|
-
return !!ai?.asLayout
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 获取所有布局组件的 namespace 缩写数组
|
|
76
|
-
*/
|
|
77
|
-
static getLayoutComponentsAbbreviationNs = (): string[] => {
|
|
78
|
-
this.init()
|
|
79
|
-
const res: string[] = []
|
|
80
|
-
|
|
81
|
-
this.aiComponentMap.forEach((ai, namespace) => {
|
|
82
|
-
if (ai?.asLayout) {
|
|
83
|
-
res.push(this.getAbbreviation(namespace))
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
return res
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* 根据完整namespace获取缩写
|
|
92
|
-
* @param namespace 完整的namespace
|
|
93
|
-
* @returns 缩写namespace,如果没有缩写则返回原namespace
|
|
94
|
-
*/
|
|
95
|
-
static getAbbreviation = (namespace: string): string => {
|
|
96
|
-
this.init()
|
|
97
|
-
return this.abbreviationMap.get(namespace) || namespace
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* 根据缩写获取完整namespace
|
|
102
|
-
* @param abbreviation 缩写
|
|
103
|
-
* @returns 完整namespace,如果没有对应的完整namespace则返回原缩写
|
|
104
|
-
*/
|
|
105
|
-
static getFullNamespace = (abbreviation: string): string => {
|
|
106
|
-
this.init()
|
|
107
|
-
return this.namespaceAbbrevMap.get(abbreviation) || abbreviation
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* 重置加载状态(用于测试或重新初始化)
|
|
112
|
-
*/
|
|
113
|
-
static reset = () => {
|
|
114
|
-
this.isLoaded = false
|
|
115
|
-
this.aiComponentMap.clear()
|
|
116
|
-
this.namespaceAbbrevMap.clear()
|
|
117
|
-
this.abbreviationMap.clear()
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
static getAiComponent(namespace: string) {
|
|
121
|
-
this.init()
|
|
122
|
-
return this.aiComponentMap.get(namespace)
|
|
123
|
-
}
|
|
124
|
-
}
|