dsh-plugin-pscad-expert-vyma 1.0.1 → 1.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/cordis.patch.yml +2 -0
- package/index.js +24 -0
- package/package.json +8 -5
- package/plugin.yaml +4 -1
- package/tools/__pycache__/main.cpython-37.pyc +0 -0
- package/tools/main.py +1 -1
package/cordis.patch.yml
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
exports.name = 'pscad-expert-bridge';
|
|
5
|
+
|
|
6
|
+
exports.apply = function (ctx) {
|
|
7
|
+
ctx.on('ready', () => {
|
|
8
|
+
try {
|
|
9
|
+
const baseDir = ctx.baseDir || process.cwd();
|
|
10
|
+
const targetDir = path.join(baseDir, 'plugins', 'dsh-plugin-pscad-expert-vyma');
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(targetDir)) {
|
|
13
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
14
|
+
fs.cpSync(__dirname, targetDir, {
|
|
15
|
+
recursive: true,
|
|
16
|
+
filter: (src) => !src.includes('node_modules') && !src.includes('.git')
|
|
17
|
+
});
|
|
18
|
+
ctx.logger('pscad-bridge').info('PSCAD Agent 资产已成功跨层释放!');
|
|
19
|
+
}
|
|
20
|
+
} catch (err) {
|
|
21
|
+
ctx.logger('pscad-bridge').error('释放资产失败:', err);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-pscad-expert-vyma",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "PSCAD 自动化建模与仿真控制专家插件(DSH Agent 工具库 + 基准模板 + 领域知识)",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"dsh": {
|
|
7
|
-
"
|
|
8
|
-
|
|
7
|
+
"bundle": {
|
|
8
|
+
"patch": "./cordis.patch.yml"
|
|
9
|
+
}
|
|
9
10
|
},
|
|
10
11
|
"keywords": [
|
|
11
12
|
"dsh",
|
|
@@ -21,7 +22,9 @@
|
|
|
21
22
|
"tools/",
|
|
22
23
|
"templates/",
|
|
23
24
|
"plugin.yaml",
|
|
24
|
-
"README.md"
|
|
25
|
+
"README.md",
|
|
26
|
+
"index.js",
|
|
27
|
+
"cordis.patch.yml"
|
|
25
28
|
],
|
|
26
29
|
"engines": {
|
|
27
30
|
"python": ">=3.7"
|
package/plugin.yaml
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
# 由知识资产固化项目自动生成(2026-08-25)· 部署至 Git 仓库
|
|
4
4
|
# ============================================================
|
|
5
5
|
name: pscad-automation-expert
|
|
6
|
-
version: 1.0.
|
|
6
|
+
version: 1.0.2
|
|
7
7
|
description: PSCAD 自动化建模与仿真控制专家插件
|
|
8
8
|
|
|
9
9
|
# ---- 系统提示词(加载到 Agent 上下文最前置位置)----
|
|
10
10
|
system_prompt: |
|
|
11
|
+
【环境配置最高优先级规则】当调用工具返回 ConfigMissing 错误时,你必须立刻停止当前任务,
|
|
12
|
+
主动且礼貌地在聊天界面询问用户的 PSCAD 安装路径,并引导他们完成配置。
|
|
13
|
+
|
|
11
14
|
你是 PSCAD 自动化建模与仿真控制专家。当调用任何工具返回 `ConfigMissing` 错误时,
|
|
12
15
|
你必须立刻停止调用其他工具,主动在聊天界面中询问用户 PSCAD 的安装路径,
|
|
13
16
|
并引导他们完成配置(调用 init_pscad_environment 工具保存路径)。
|
|
Binary file
|
package/tools/main.py
CHANGED
|
@@ -74,7 +74,7 @@ CONNECT_TIMEOUT_S: int = 20
|
|
|
74
74
|
# 配置缺失时的标准 Agent 返回(裸字典,供大模型识别并触发对话式引导)
|
|
75
75
|
CONFIG_MISSING_RESPONSE: Dict[str, str] = {
|
|
76
76
|
"error": "ConfigMissing",
|
|
77
|
-
"instruction": "
|
|
77
|
+
"instruction": "本地未找到配置。请中止操作,用自然语言向用户询问其 PSCAD 的安装路径,获取后调用 init_pscad_environment 工具保存。",
|
|
78
78
|
}
|
|
79
79
|
MISSING_CONFIG_MSG = CONFIG_MISSING_RESPONSE['instruction']
|
|
80
80
|
|