sapbuddy-dsh 0.0.1 → 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/README.md +154 -0
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# sapbuddy-dsh
|
|
2
|
+
|
|
3
|
+
[SapBuddy](https://github.com/gxx950224/sapbuddy) 的 **DeepSeek Harness(DSH)** 底座:
|
|
4
|
+
**41 个 SAP ABAP 工具 + 8 个 ABAP 技能 + agent preset `sapbuddy` + 三层写门禁 + 连接设置页**。
|
|
5
|
+
|
|
6
|
+
面向 **DSH 0.2.0-rc.2**,需要 Node >= 22。**一个包名装完全部。**
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 安装
|
|
11
|
+
|
|
12
|
+
在 DSH 的 **插件 → 添加插件** 对话框里填:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
sapbuddy-dsh
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
或命令行:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
dsh plugin --profile <profile> add sapbuddy-dsh
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**装完必须完整重启 DSH**(托盘退出,不是关窗口)——插件代码在宿主启动时加载。
|
|
25
|
+
重启后新建会话时选择 **SapBuddy** preset,并在 **设置 → SAP 连接** 里新建 SAP 连接。
|
|
26
|
+
|
|
27
|
+
### ⚠️ 手工安装前必须配好构建放行
|
|
28
|
+
|
|
29
|
+
依赖链里有个遥测包会注册构建脚本:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
sapbuddy-dsh → abap-adt-api → io-ts-reporters → @scarf/scarf(遥测,无需构建)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
pnpm 11 把「存在未批准的构建脚本」当**错误**(`ERR_PNPM_IGNORED_BUILDS`,退出码 1)。
|
|
36
|
+
而 **`dsh plugin add` 在 pnpm 失败后不会再注册 bundle** —— 包进了 `node_modules`,
|
|
37
|
+
`dsh.profile.bundles` 却没更新,于是 **preset 永远不出现,且没有任何明显报错**。
|
|
38
|
+
|
|
39
|
+
在目标 profile 的 `pnpm-workspace.yaml` 里放行:
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
allowBuilds:
|
|
43
|
+
'@scarf/scarf': false
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
或在仓库里跑安装器(会自动做这一步):
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
node scripts/install.mjs --profile desktop
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> 包自身声明 `pnpm.ignoredBuiltDependencies` **不足以**覆盖三级传递依赖(已实测),
|
|
53
|
+
> 必须在安装侧声明。
|
|
54
|
+
|
|
55
|
+
### 这个包往 profile 里插两条行
|
|
56
|
+
|
|
57
|
+
| 行 | 作用 |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `sapbuddy-dsh`(顶层) | 设置页的 HTTP 路由,并让客户端页面被加载 |
|
|
60
|
+
| preset 内的 `sapbuddy-dsh/tools` | 41 个工具 + 写门禁 + 提示词注入 |
|
|
61
|
+
|
|
62
|
+
两条都必须存在,写法也受 DSH 约束(`dsh-client-modules` 只扫描**顶层**行、
|
|
63
|
+
且只认**精确包名**)。这也是包的主入口是设置页、工具走子路径的原因。
|
|
64
|
+
详见仓库 README 的「为什么只有一个包」。
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 首次运行会落盘什么
|
|
69
|
+
|
|
70
|
+
插件加载时把包内 `defaults/` 中**缺失**的文件补写到配置根
|
|
71
|
+
(`<DSH_HOME|~/.dsh>/.agent-presets/sapbuddy/`),并创建 `prompts/ logs/ output/ uploads/`:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
prompts/SYSTEM.md # 铁律与输出约定(每次会话实时注入)
|
|
75
|
+
prompts/Memory.md # 避坑记录,随会话累积
|
|
76
|
+
AGENTS.md # 项目开发指南
|
|
77
|
+
connections.example.json # 连接配置示例(参考用)
|
|
78
|
+
settings.example.json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**仅补缺,绝不覆盖**——`Memory.md` 是累积数据,用户改过的 `SYSTEM.md` / `AGENTS.md` 同理。
|
|
82
|
+
配置根可用环境变量 `SAPBUDDY_HOME` 覆盖。
|
|
83
|
+
|
|
84
|
+
本包**不创建 `connections.json`**:那是用户数据(含凭据),请在
|
|
85
|
+
「设置 → SAP 连接」中新建,或参照 `connections.example.json` 手工创建。
|
|
86
|
+
密码在设置页的响应中脱敏为 `***`。
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 写门禁
|
|
91
|
+
|
|
92
|
+
写操作受三层约束,任一层都能单独拒绝:
|
|
93
|
+
|
|
94
|
+
1. **连接级只读** —— 连接未声明 `security.readOnly: false` 即拒写(连接级优先、顶层兜底,
|
|
95
|
+
读取失败 fail-closed)。连接级判定不会被"不传 `connectionId`"绕过,所以可以做到
|
|
96
|
+
开发系统可写、QAS/生产锁死。
|
|
97
|
+
2. **开发客户端守卫** —— 读 `T000.CCCATEGORY`,默认只放行 `C`(定制/客户开发);
|
|
98
|
+
查不到时 fail-closed。生产系统(`P`)即使关掉只读也写不进去。
|
|
99
|
+
3. **人工确认** —— 需用户批准(确认词须位于句首;窗口默认 15 分钟,见配置根
|
|
100
|
+
`settings.json` 的 `approvalWindowMinutes`)。
|
|
101
|
+
|
|
102
|
+
另有内容级硬校验:写入含用户可见中文字面量的代码会被拒(须走消息类 / 文本元素)。
|
|
103
|
+
命名空间强制:只写 `Z*`/`Y*`,SAP 标准对象只读。
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 工具清单
|
|
108
|
+
|
|
109
|
+
41 个工具覆盖:对象搜索 / 读码 / 代码定位、ADT 文档、ATC 检查、单元测试、SQL 查询、
|
|
110
|
+
DDIC(域 / 数据元素 / 结构 / 表)、文本池与文本元素、屏幕文字、消息类、函数模块接口、
|
|
111
|
+
传输请求、激活与语法诊断、Mermaid 校验等。
|
|
112
|
+
|
|
113
|
+
8 个技能:`abap-code-review`、`abap-explain`、`abap-templates`、`abap-wiki`、
|
|
114
|
+
`clean-abap`、`dev-write`、`sap-abap-skills`、`translate-workflow`。
|
|
115
|
+
|
|
116
|
+
完整清单见技能 `sap-abap-skills/references/tool-guide.md`(场景 → 工具 → 传参示例)。
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 导出
|
|
121
|
+
|
|
122
|
+
| 子路径 | 内容 |
|
|
123
|
+
|---|---|
|
|
124
|
+
| `sapbuddy-dsh`(主入口) | 顶层插件:设置页的 `webServer` 路由 |
|
|
125
|
+
| `sapbuddy-dsh/tools` | preset 内插件:41 工具注册 + 写门禁 + 提示词注入 |
|
|
126
|
+
| `sapbuddy-dsh/client` | 设置页浏览器端 bundle(`dsh.client`) |
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 开发
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pnpm install
|
|
134
|
+
pnpm --filter sapbuddy-dsh build # clean + tsc + esbuild → dist/
|
|
135
|
+
pnpm --filter sapbuddy-dsh test # 172 用例
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
技能与默认提示词分别在 `skills/` 与 `defaults/`,两者都随包发布——改动后请跑一次
|
|
139
|
+
`npm pack --dry-run` 确认内容仍在(`README.md` 与 `LICENSE` 是 npm 自动收录的)。
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 链接
|
|
144
|
+
|
|
145
|
+
- 仓库与完整文档:<https://github.com/gxx950224/sapbuddy-dsh>
|
|
146
|
+
- 上游 CLI / Web 版(pi 引擎):<https://github.com/gxx950224/sapbuddy>
|
|
147
|
+
- 问题反馈:<https://github.com/gxx950224/sapbuddy-dsh/issues>
|
|
148
|
+
|
|
149
|
+
> 注意区分:npm 上的 `sapbuddy` 是上游 CLI 版;本包 `sapbuddy-dsh` 是 DSH 底座版。
|
|
150
|
+
> 旧的 `sapbuddy-tools` / `sapbuddy-settings` / `sapbuddy-settings-ui` 已合并进本包并弃用。
|
|
151
|
+
|
|
152
|
+
## 许可证
|
|
153
|
+
|
|
154
|
+
MIT。工具实现同步自上游 [gxx950224/sapbuddy](https://github.com/gxx950224/sapbuddy)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sapbuddy-dsh",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "SapBuddy —— SAP ABAP AI 全能助手(DeepSeek Harness 插件):41 个 SAP 工具 + 8 个 ABAP 技能 + SapBuddy preset + 连接设置页。一个包名装完。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"scripts": {
|
|
80
80
|
"build": "node scripts/clean.mjs && tsc && node scripts/build-client.mjs",
|
|
81
81
|
"test": "node scripts/clean.mjs && tsc && node --test",
|
|
82
|
-
"check": "tsc --noEmit"
|
|
82
|
+
"check": "tsc --noEmit",
|
|
83
|
+
"prepack": "node scripts/clean.mjs && tsc && node scripts/build-client.mjs"
|
|
83
84
|
}
|
|
84
|
-
}
|
|
85
|
+
}
|