dsh-d365-kit 0.34.1 → 0.34.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/CHANGELOG.md +318 -308
- package/CHANGELOG.zh-CN.md +317 -307
- package/INSTALL.md +94 -94
- package/INSTALL.zh-CN.md +93 -93
- package/LICENSE +21 -21
- package/README.md +336 -327
- package/README.zh-CN.md +336 -327
- package/client.js +1818 -1818
- package/cordis.patch.yml +44 -44
- package/docs/en/architecture.md +172 -172
- package/docs/en/checks.md +184 -184
- package/docs/en/installation.md +151 -151
- package/docs/en/permissions.md +161 -161
- package/docs/en/scenarios.md +202 -202
- package/docs/en/tools.md +665 -665
- package/docs/en/troubleshooting.md +131 -131
- package/docs/zh/architecture.md +172 -172
- package/docs/zh/checks.md +184 -184
- package/docs/zh/installation.md +151 -151
- package/docs/zh/permissions.md +161 -161
- package/docs/zh/scenarios.md +202 -202
- package/docs/zh/tools.md +665 -665
- package/docs/zh/troubleshooting.md +131 -131
- package/examples/prompts.en.md +206 -206
- package/examples/prompts.zh-CN.md +206 -206
- package/examples/waivers.example.json +20 -20
- package/icon.svg +6 -6
- package/index.js +139 -139
- package/lib/auth.js +181 -181
- package/lib/client.js +496 -496
- package/lib/code-check.js +549 -549
- package/lib/config.js +323 -323
- package/lib/contract-history.js +49 -49
- package/lib/contract.js +583 -583
- package/lib/csharp-check.js +493 -493
- package/lib/data-migrate.js +1318 -1318
- package/lib/data-policy.js +78 -78
- package/lib/error-codes.js +80 -80
- package/lib/gitlab.js +161 -161
- package/lib/health.js +205 -205
- package/lib/migrate.js +732 -732
- package/lib/preflight.js +116 -116
- package/lib/refs.js +191 -191
- package/lib/resources.js +320 -320
- package/lib/retention-defaults.js +17 -17
- package/lib/retention.js +384 -384
- package/lib/runtime.js +232 -232
- package/lib/settings-http.js +512 -512
- package/lib/settings-store.js +371 -371
- package/lib/snapshot.js +149 -149
- package/lib/tool-code-check.js +133 -133
- package/lib/tool-configure.js +169 -169
- package/lib/tool-contract.js +376 -376
- package/lib/tool-data-sync.js +559 -559
- package/lib/tool-data-write.js +203 -203
- package/lib/tool-data.js +282 -282
- package/lib/tool-diff.js +484 -484
- package/lib/tool-environments.js +106 -106
- package/lib/tool-flows.js +540 -540
- package/lib/tool-health.js +127 -127
- package/lib/tool-layers.js +497 -497
- package/lib/tool-metadata.js +417 -417
- package/lib/tool-migrate.js +102 -102
- package/lib/tool-refs.js +206 -206
- package/lib/tool-reports.js +299 -299
- package/lib/tool-sync.js +430 -430
- package/lib/tool-write.js +563 -563
- package/lib/waivers.js +83 -83
- package/lib/write-actions.js +1374 -1374
- package/lib/write-policy.js +199 -199
- package/lib/write-store.js +167 -167
- package/locale/en.json +68 -68
- package/locale/zh.json +68 -68
- package/package.json +2 -2
- package/skills/d365-troubleshooting/SKILL.md +115 -115
package/INSTALL.md
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
# Install (for colleagues)
|
|
2
|
-
|
|
3
|
-
**English** | [简体中文](INSTALL.zh-CN.md)
|
|
4
|
-
|
|
5
|
-
`dsh-d365-kit` is a DeepSeek Harness bundle (host plugin + settings page). Once installed you get
|
|
6
|
-
|
|
7
|
-
For the complete steps, see [docs/en/installation.md](docs/en/installation.md).
|
|
8
|
-
|
|
9
|
-
## Prerequisites
|
|
10
|
-
|
|
11
|
-
- DSH desktop app, able to open the Web GUI;
|
|
12
|
-
- the machine can reach your Dataverse environment (`*.dynamics.com` or the regional domain);
|
|
13
|
-
- an **application user** (ClientId + secret) granted permission in the environment to read metadata,
|
|
14
|
-
read solutions (`prvReadSolution`) and read the layer table (`prvReadmsdyn_componentlayer`). Read-only is
|
|
15
|
-
enough; add the relevant permissions when you need writes.
|
|
16
|
-
|
|
17
|
-
## Install
|
|
18
|
-
|
|
19
|
-
### Option 1: Install from npm (shortest, upgradeable)
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
plugin_manager install_bundle target="dsh-d365-kit@0.34.
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
This needs the package to be published to the registry pnpm uses — public npm or an internal mirror. The name has no scope, so no scope mapping is required.
|
|
26
|
-
|
|
27
|
-
> Publishing to GitHub does not put the package in a registry: with only a GitHub repo, use option 2 (or `npm install github:<user>/<repo>#<tag>`).
|
|
28
|
-
|
|
29
|
-
### Option 2: Install from Git (no registry needed)
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
plugin_manager install_bundle target="git+https://<your Git>/<group>/dsh-d365-kit.git#v0.34.
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Option 3: Install from a local directory
|
|
36
|
-
|
|
37
|
-
Put the whole repository directory anywhere on the machine:
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
plugin_manager install_bundle target="D:\path\to\dsh-d365-kit"
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
This is a `link:` install: code changes take effect immediately, but upgrading is your own `git pull`.
|
|
44
|
-
|
|
45
|
-
All paths are the same: **restart DSH once after installing**, so the Web client loads the settings page code into the module graph.
|
|
46
|
-
|
|
47
|
-
## First-time configuration
|
|
48
|
-
|
|
49
|
-
1. Settings → D365 Toolkit → Environments → Add environment: key (e.g. `dev`), URL, tenant ID, ClientId, client secret;
|
|
50
|
-
2. Click "Test connection"; if you see a version number, the credentials are fine;
|
|
51
|
-
3. On the "Permissions" tab, tick what this machine is allowed to do (one block per environment, separated by a rule):
|
|
52
|
-
- "Read metadata" — already ticked by default; untick it and tables, fields and views become unreadable too;
|
|
53
|
-
- "Read business data" — without it the records in tables are unreadable;
|
|
54
|
-
- write capabilities are all off by default, and even when ticked every execution still needs a person to confirm it in the conversation;
|
|
55
|
-
4. Click "Save".
|
|
56
|
-
|
|
57
|
-
By default the configuration is written to `<your DSH workspace>/d365.config.json`, and the secret is stored separately in `d365.secrets.json` in the same directory
|
|
58
|
-
(plain text, don't commit it). If your workspace isn't in the default location, set the `D365_CONFIG_FILE` environment variable, or point `configFile` at an absolute path in the profile's
|
|
59
|
-
`cordis.patch.yml`.
|
|
60
|
-
|
|
61
|
-
## Verify
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
d365_envs check=true
|
|
65
|
-
d365_metadata resource=entities top=3
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
If both return content, you're connected. The first `d365_sync` pulls the full metadata (about 125 MB, three minutes or so); if you don't want to spend the disk space, you can skip it for now.
|
|
69
|
-
|
|
70
|
-
### The troubleshooting skill comes with the plugin
|
|
71
|
-
|
|
72
|
-
The package ships an agent skill at `skills/d365-troubleshooting/SKILL.md` (how to work a plug-in failure: trace level → signature → one full call → registration → reproduce). The plugin registers it into the Host skill registry when it loads, so installing the bundle is all you have to do — nothing to copy, and the agent picks it up by description without anyone invoking it by name.
|
|
73
|
-
|
|
74
|
-
To change it, edit the file in the installed package (or in your clone, when you installed from source) and reload the plugin; edits made anywhere else are not read.
|
|
75
|
-
|
|
76
|
-
## Upgrade
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
plugin_manager remove_bundle target=dsh-d365-kit
|
|
80
|
-
plugin_manager install_bundle target="...<new version>..."
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
You must remove before installing: when the package already exists the installer only returns `already-installed` and does not replace the code. Restart DSH after upgrading.
|
|
84
|
-
|
|
85
|
-
## FAQ
|
|
86
|
-
|
|
87
|
-
- **Tools don't appear**: run `plugin_manager list_plugins` and check whether `include:dsh-d365-kit` is `active`; a fresh install needs a restart.
|
|
88
|
-
- **No "D365 Toolkit" on the settings page**: the client plugin didn't make it into the module graph — restart; if it's still missing, check whether the module id in `client.js` matches the package name.
|
|
89
|
-
- **Save reports "writes can only be started from the settings page"**: that's the CSRF guard — only save from the settings page; rejections are logged to `.d365/write-guard.log`.
|
|
90
|
-
- **Reading business data reports `data-read-forbidden`**: tick "Read business data" on the Permissions tab.
|
|
91
|
-
- **A write is rejected with `environment-busy`**: the environment is importing or publishing; wait for it to finish and retry.
|
|
92
|
-
- **GitLab 403**: the token's user needs at least the Reporter role in that project.
|
|
93
|
-
|
|
94
|
-
For other error codes, see [docs/en/troubleshooting.md](docs/en/troubleshooting.md).
|
|
1
|
+
# Install (for colleagues)
|
|
2
|
+
|
|
3
|
+
**English** | [简体中文](INSTALL.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
`dsh-d365-kit` is a DeepSeek Harness bundle (host plugin + settings page). Once installed you get 19 `d365_*` tools and a "Settings → D365 Toolkit" page.
|
|
6
|
+
|
|
7
|
+
For the complete steps, see [docs/en/installation.md](docs/en/installation.md).
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- DSH desktop app, able to open the Web GUI;
|
|
12
|
+
- the machine can reach your Dataverse environment (`*.dynamics.com` or the regional domain);
|
|
13
|
+
- an **application user** (ClientId + secret) granted permission in the environment to read metadata,
|
|
14
|
+
read solutions (`prvReadSolution`) and read the layer table (`prvReadmsdyn_componentlayer`). Read-only is
|
|
15
|
+
enough; add the relevant permissions when you need writes.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
### Option 1: Install from npm (shortest, upgradeable)
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
plugin_manager install_bundle target="dsh-d365-kit@0.34.3"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This needs the package to be published to the registry pnpm uses — public npm or an internal mirror. The name has no scope, so no scope mapping is required.
|
|
26
|
+
|
|
27
|
+
> Publishing to GitHub does not put the package in a registry: with only a GitHub repo, use option 2 (or `npm install github:<user>/<repo>#<tag>`). `.github/workflows/publish.yml` publishes on every push to `main` whose `package.json` version is not on npm yet, once either the `NPM_TRUSTED_PUBLISHING` variable (trusted publishing) or the `NPM_TOKEN` secret exists.
|
|
28
|
+
|
|
29
|
+
### Option 2: Install from Git (no registry needed)
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
plugin_manager install_bundle target="git+https://<your Git>/<group>/dsh-d365-kit.git#v0.34.3"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Option 3: Install from a local directory
|
|
36
|
+
|
|
37
|
+
Put the whole repository directory anywhere on the machine:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
plugin_manager install_bundle target="D:\path\to\dsh-d365-kit"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This is a `link:` install: code changes take effect immediately, but upgrading is your own `git pull`.
|
|
44
|
+
|
|
45
|
+
All paths are the same: **restart DSH once after installing**, so the Web client loads the settings page code into the module graph.
|
|
46
|
+
|
|
47
|
+
## First-time configuration
|
|
48
|
+
|
|
49
|
+
1. Settings → D365 Toolkit → Environments → Add environment: key (e.g. `dev`), URL, tenant ID, ClientId, client secret;
|
|
50
|
+
2. Click "Test connection"; if you see a version number, the credentials are fine;
|
|
51
|
+
3. On the "Permissions" tab, tick what this machine is allowed to do (one block per environment, separated by a rule):
|
|
52
|
+
- "Read metadata" — already ticked by default; untick it and tables, fields and views become unreadable too;
|
|
53
|
+
- "Read business data" — without it the records in tables are unreadable;
|
|
54
|
+
- write capabilities are all off by default, and even when ticked every execution still needs a person to confirm it in the conversation;
|
|
55
|
+
4. Click "Save".
|
|
56
|
+
|
|
57
|
+
By default the configuration is written to `<your DSH workspace>/d365.config.json`, and the secret is stored separately in `d365.secrets.json` in the same directory
|
|
58
|
+
(plain text, don't commit it). If your workspace isn't in the default location, set the `D365_CONFIG_FILE` environment variable, or point `configFile` at an absolute path in the profile's
|
|
59
|
+
`cordis.patch.yml`.
|
|
60
|
+
|
|
61
|
+
## Verify
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
d365_envs check=true
|
|
65
|
+
d365_metadata resource=entities top=3
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If both return content, you're connected. The first `d365_sync` pulls the full metadata (about 125 MB, three minutes or so); if you don't want to spend the disk space, you can skip it for now.
|
|
69
|
+
|
|
70
|
+
### The troubleshooting skill comes with the plugin
|
|
71
|
+
|
|
72
|
+
The package ships an agent skill at `skills/d365-troubleshooting/SKILL.md` (how to work a plug-in failure: trace level → signature → one full call → registration → reproduce). The plugin registers it into the Host skill registry when it loads, so installing the bundle is all you have to do — nothing to copy, and the agent picks it up by description without anyone invoking it by name.
|
|
73
|
+
|
|
74
|
+
To change it, edit the file in the installed package (or in your clone, when you installed from source) and reload the plugin; edits made anywhere else are not read.
|
|
75
|
+
|
|
76
|
+
## Upgrade
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
plugin_manager remove_bundle target=dsh-d365-kit
|
|
80
|
+
plugin_manager install_bundle target="...<new version>..."
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
You must remove before installing: when the package already exists the installer only returns `already-installed` and does not replace the code. Restart DSH after upgrading.
|
|
84
|
+
|
|
85
|
+
## FAQ
|
|
86
|
+
|
|
87
|
+
- **Tools don't appear**: run `plugin_manager list_plugins` and check whether `include:dsh-d365-kit` is `active`; a fresh install needs a restart.
|
|
88
|
+
- **No "D365 Toolkit" on the settings page**: the client plugin didn't make it into the module graph — restart; if it's still missing, check whether the module id in `client.js` matches the package name.
|
|
89
|
+
- **Save reports "writes can only be started from the settings page"**: that's the CSRF guard — only save from the settings page; rejections are logged to `.d365/write-guard.log`.
|
|
90
|
+
- **Reading business data reports `data-read-forbidden`**: tick "Read business data" on the Permissions tab.
|
|
91
|
+
- **A write is rejected with `environment-busy`**: the environment is importing or publishing; wait for it to finish and retry.
|
|
92
|
+
- **GitLab 403**: the token's user needs at least the Reporter role in that project.
|
|
93
|
+
|
|
94
|
+
For other error codes, see [docs/en/troubleshooting.md](docs/en/troubleshooting.md).
|
package/INSTALL.zh-CN.md
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
# 安装(给同事)
|
|
2
|
-
|
|
3
|
-
**[English](INSTALL.md)** | 简体中文
|
|
4
|
-
|
|
5
|
-
`dsh-d365-kit` 是 DeepSeek Harness 的 bundle(Host 插件 + 设置页)。装完会有
|
|
6
|
-
|
|
7
|
-
更完整的步骤见 [docs/installation.md](docs/zh/installation.md)。
|
|
8
|
-
|
|
9
|
-
## 前置
|
|
10
|
-
|
|
11
|
-
- DSH 桌面版,能打开 Web GUI;
|
|
12
|
-
- 机器能访问你的 Dataverse 环境(`*.dynamics.com` 或对应区域域名);
|
|
13
|
-
- 一个**应用用户**(ClientId + 密钥),在环境里给了读元数据、读解决方案(`prvReadSolution`)、
|
|
14
|
-
读层表(`prvReadmsdyn_componentlayer`)的权限。只读就够用;要写入再加相应权限。
|
|
15
|
-
|
|
16
|
-
## 安装
|
|
17
|
-
|
|
18
|
-
### 方式一:从 npm 装(最短,可升级)
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
plugin_manager install_bundle target="dsh-d365-kit@0.34.
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
前提是包已经发到 pnpm 用的那个 registry——公网 npm 或公司内网镜像都行。包名没有 scope,不需要配 scope 映射。
|
|
25
|
-
|
|
26
|
-
> 只推 GitHub 不等于进了 registry:只有 GitHub 仓库时用方式二(或 `npm install github:<user>/<repo>#<tag
|
|
27
|
-
|
|
28
|
-
### 方式二:从 Git 装(不需要 registry)
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
plugin_manager install_bundle target="git+https://<你的 Git>/<group>/dsh-d365-kit.git#v0.34.
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### 方式三:从本地目录装
|
|
35
|
-
|
|
36
|
-
把整个仓库目录放到本机任意位置:
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
plugin_manager install_bundle target="D:\path\to\dsh-d365-kit"
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
这是 `link:` 安装:改代码立刻生效,但升级要自己 `git pull`。
|
|
43
|
-
|
|
44
|
-
三条路一样:**装完重启一次 DSH**,Web 客户端才会把设置页代码加载进模块图。
|
|
45
|
-
|
|
46
|
-
## 首次配置
|
|
47
|
-
|
|
48
|
-
1. 设置 → D365 工具箱 → 环境 → 添加环境:key(如 `dev`)、URL、租户 ID、ClientId、客户端密钥;
|
|
49
|
-
2. 点「测试连接」,看到版本号说明凭据没问题;
|
|
50
|
-
3. 到「权限」标签勾选这台机器允许做什么(每个环境单独一块,用分隔线隔开):
|
|
51
|
-
- 「读取元数据」——默认就是勾上的;不勾连表、字段、视图都查不到;
|
|
52
|
-
- 「读取业务数据」——不勾就读不到表里的记录;
|
|
53
|
-
- 写入类能力默认全关,勾了之后每次执行仍要人在对话里确认;
|
|
54
|
-
4. 点「保存」。
|
|
55
|
-
|
|
56
|
-
配置默认写到 `<你的 DSH 工作区>/d365.config.json`,密钥单独存同目录的 `d365.secrets.json`
|
|
57
|
-
(明文,别提交)。工作区不在默认位置时,设环境变量 `D365_CONFIG_FILE`,或在 profile 的
|
|
58
|
-
`cordis.patch.yml` 里给 `configFile` 写绝对路径。
|
|
59
|
-
|
|
60
|
-
## 验证
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
d365_envs check=true
|
|
64
|
-
d365_metadata resource=entities top=3
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
都有内容就说明通了。第一次 `d365_sync` 会拉全量元数据(约 125 MB、三分钟左右),不想占盘可以先不做。
|
|
68
|
-
|
|
69
|
-
### 排查 skill 随插件一起装
|
|
70
|
-
|
|
71
|
-
包里带了一个 agent skill:`skills/d365-troubleshooting/SKILL.md`(插件失败怎么查:跟踪级别 → 归并签名 → 取一条完整调用 → 看步骤注册 → 复现)。插件加载时会把它注册进 Host 的 skill 注册表,所以装完 bundle 就有了——不需要复制文件,也不用谁按名字手动调用,agent 按描述就会自己用。
|
|
72
|
-
|
|
73
|
-
要改就直接改装好的包里的这一份(源码安装就改克隆里的那份),然后重载插件;写在别处的副本不会被读到。
|
|
74
|
-
|
|
75
|
-
## 升级
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
plugin_manager remove_bundle target=dsh-d365-kit
|
|
79
|
-
plugin_manager install_bundle target="...新版本..."
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
必须先 remove 再 install:包已存在时安装器只返回 `already-installed`,不会替换代码。升级后重启 DSH。
|
|
83
|
-
|
|
84
|
-
## 常见问题
|
|
85
|
-
|
|
86
|
-
- **工具没出现**:`plugin_manager list_plugins` 看 `include:dsh-d365-kit` 是否 `active`;刚装完要重启。
|
|
87
|
-
- **设置页没有「D365 工具箱」**:客户端插件未进模块图,重启;仍没有就查 `client.js` 的模块 id 是否与包名一致。
|
|
88
|
-
- **保存报「写入只能从设置页发起」**:CSRF 守卫,只在设置页里保存;被拒记录在 `.d365/write-guard.log`。
|
|
89
|
-
- **读业务数据报 `data-read-forbidden`**:到权限标签勾「读取业务数据」。
|
|
90
|
-
- **写入被拒 `environment-busy`**:环境正在导入或发布,等结束再试。
|
|
91
|
-
- **GitLab 403**:令牌用户在该项目里至少要有 Reporter 角色。
|
|
92
|
-
|
|
93
|
-
其余错误码见 [docs/troubleshooting.md](docs/zh/troubleshooting.md)。
|
|
1
|
+
# 安装(给同事)
|
|
2
|
+
|
|
3
|
+
**[English](INSTALL.md)** | 简体中文
|
|
4
|
+
|
|
5
|
+
`dsh-d365-kit` 是 DeepSeek Harness 的 bundle(Host 插件 + 设置页)。装完会有 19 个 `d365_*` 工具和「设置 → D365 工具箱」页面。
|
|
6
|
+
|
|
7
|
+
更完整的步骤见 [docs/installation.md](docs/zh/installation.md)。
|
|
8
|
+
|
|
9
|
+
## 前置
|
|
10
|
+
|
|
11
|
+
- DSH 桌面版,能打开 Web GUI;
|
|
12
|
+
- 机器能访问你的 Dataverse 环境(`*.dynamics.com` 或对应区域域名);
|
|
13
|
+
- 一个**应用用户**(ClientId + 密钥),在环境里给了读元数据、读解决方案(`prvReadSolution`)、
|
|
14
|
+
读层表(`prvReadmsdyn_componentlayer`)的权限。只读就够用;要写入再加相应权限。
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
### 方式一:从 npm 装(最短,可升级)
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
plugin_manager install_bundle target="dsh-d365-kit@0.34.3"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
前提是包已经发到 pnpm 用的那个 registry——公网 npm 或公司内网镜像都行。包名没有 scope,不需要配 scope 映射。
|
|
25
|
+
|
|
26
|
+
> 只推 GitHub 不等于进了 registry:只有 GitHub 仓库时用方式二(或 `npm install github:<user>/<repo>#<tag>`)。`.github/workflows/publish.yml` 会在每次推 `main` 且 `package.json` 版本还没上架时自动发布 —— 前提是配了 `NPM_TRUSTED_PUBLISHING` 变量(trusted publishing)或 `NPM_TOKEN` secret。
|
|
27
|
+
|
|
28
|
+
### 方式二:从 Git 装(不需要 registry)
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
plugin_manager install_bundle target="git+https://<你的 Git>/<group>/dsh-d365-kit.git#v0.34.3"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 方式三:从本地目录装
|
|
35
|
+
|
|
36
|
+
把整个仓库目录放到本机任意位置:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
plugin_manager install_bundle target="D:\path\to\dsh-d365-kit"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
这是 `link:` 安装:改代码立刻生效,但升级要自己 `git pull`。
|
|
43
|
+
|
|
44
|
+
三条路一样:**装完重启一次 DSH**,Web 客户端才会把设置页代码加载进模块图。
|
|
45
|
+
|
|
46
|
+
## 首次配置
|
|
47
|
+
|
|
48
|
+
1. 设置 → D365 工具箱 → 环境 → 添加环境:key(如 `dev`)、URL、租户 ID、ClientId、客户端密钥;
|
|
49
|
+
2. 点「测试连接」,看到版本号说明凭据没问题;
|
|
50
|
+
3. 到「权限」标签勾选这台机器允许做什么(每个环境单独一块,用分隔线隔开):
|
|
51
|
+
- 「读取元数据」——默认就是勾上的;不勾连表、字段、视图都查不到;
|
|
52
|
+
- 「读取业务数据」——不勾就读不到表里的记录;
|
|
53
|
+
- 写入类能力默认全关,勾了之后每次执行仍要人在对话里确认;
|
|
54
|
+
4. 点「保存」。
|
|
55
|
+
|
|
56
|
+
配置默认写到 `<你的 DSH 工作区>/d365.config.json`,密钥单独存同目录的 `d365.secrets.json`
|
|
57
|
+
(明文,别提交)。工作区不在默认位置时,设环境变量 `D365_CONFIG_FILE`,或在 profile 的
|
|
58
|
+
`cordis.patch.yml` 里给 `configFile` 写绝对路径。
|
|
59
|
+
|
|
60
|
+
## 验证
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
d365_envs check=true
|
|
64
|
+
d365_metadata resource=entities top=3
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
都有内容就说明通了。第一次 `d365_sync` 会拉全量元数据(约 125 MB、三分钟左右),不想占盘可以先不做。
|
|
68
|
+
|
|
69
|
+
### 排查 skill 随插件一起装
|
|
70
|
+
|
|
71
|
+
包里带了一个 agent skill:`skills/d365-troubleshooting/SKILL.md`(插件失败怎么查:跟踪级别 → 归并签名 → 取一条完整调用 → 看步骤注册 → 复现)。插件加载时会把它注册进 Host 的 skill 注册表,所以装完 bundle 就有了——不需要复制文件,也不用谁按名字手动调用,agent 按描述就会自己用。
|
|
72
|
+
|
|
73
|
+
要改就直接改装好的包里的这一份(源码安装就改克隆里的那份),然后重载插件;写在别处的副本不会被读到。
|
|
74
|
+
|
|
75
|
+
## 升级
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
plugin_manager remove_bundle target=dsh-d365-kit
|
|
79
|
+
plugin_manager install_bundle target="...新版本..."
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
必须先 remove 再 install:包已存在时安装器只返回 `already-installed`,不会替换代码。升级后重启 DSH。
|
|
83
|
+
|
|
84
|
+
## 常见问题
|
|
85
|
+
|
|
86
|
+
- **工具没出现**:`plugin_manager list_plugins` 看 `include:dsh-d365-kit` 是否 `active`;刚装完要重启。
|
|
87
|
+
- **设置页没有「D365 工具箱」**:客户端插件未进模块图,重启;仍没有就查 `client.js` 的模块 id 是否与包名一致。
|
|
88
|
+
- **保存报「写入只能从设置页发起」**:CSRF 守卫,只在设置页里保存;被拒记录在 `.d365/write-guard.log`。
|
|
89
|
+
- **读业务数据报 `data-read-forbidden`**:到权限标签勾「读取业务数据」。
|
|
90
|
+
- **写入被拒 `environment-busy`**:环境正在导入或发布,等结束再试。
|
|
91
|
+
- **GitLab 403**:令牌用户在该项目里至少要有 Reporter 角色。
|
|
92
|
+
|
|
93
|
+
其余错误码见 [docs/troubleshooting.md](docs/zh/troubleshooting.md)。
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 iTanzhao
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 iTanzhao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|