dsh-erp-bridge
Two-way enterprise system (ERP) integration for DeepSeek Harness: signed inbound events, durable outbound delivery, adapters, and approval-gated write-back. 适合需要将DSH与企业内部ERP数据及事件进行对接的场景。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dengkun0/dsh-erp-bridgeREADME
Read the full README ↗配置
配置写在 profile 的 cordis.patch.yml(或 bundle 自带 patch)中,整段替换,不深合并:
- id: dsh-erp-bridge
name: dsh-erp-bridge
config:
dataDir: 'D:\dsh-data\erp-bridge'
adapter:
id: http-gateway
baseUrl: 'http://erp-gateway.internal:8080'
authRef: ERP_GATEWAY_TOKEN
entities:
purchase_order:
fields: [id, number, vendor, vendorName, amount, currency, status]
writable: true
vendor:
fields: [id, name, taxId, status]
writable: false
ingress:
enabled: true
mode: standalone # standalone | embedded
host: 127.0.0.1
port: 3081
path: /erp/events
signature:
secretRef: DSH_ERP_HMAC_SECRET
timestampWindowSec: 300
autoGenerate: false # 生产建议 false,密钥走凭据 seam
outbound:
enabled: true
targetUrl: 'http://erp-gateway.internal:8080/dsh/turn-result'
scope: linked # linked | erp-tools | all
includeSummary: true
summaryMaxChars: 2000
maxAttempts: 8
baseDelayMs: 2000
maxDelayMs: 300000
timeoutMs: 10000
inbound:
enabled: true
agentPreset: standard
permissionPreset: read-only
eventNames: [] # 空 = 全部;可填 [purchase_order.approved]
maxAttempts: 10
policy:
allowWrite: false
allowResend: true
writableEntities: [purchase_order]
maxQueryRows: 50
字段说明(摘要)
| 字段 | 默认 | 说明 |
|---|---|---|
dataDir | /erp-bridge | 台账、密钥、演示工作区的根目录;需单实例独占 |
adapter.id | mock | mock / odoo / http-gateway |
ingress.mode | standalone | standalone 独立 loopback 监听;embedded 挂到现有 DSH webServer(仅演示) |
ingress.host/port | 127.0.0.1:3081 | 只绑回环;外层反代终结 TLS |
ingress.signature.secretRef | DSH_ERP_HMAC_SECRET | 先查 DSH 凭据 seam,再查环境变量,最后查 dataDir/secret |
ingress.signature.autoGenerate | true | 首次无密钥时生成 32 字节随机值写入 0600 文件 |
outbound.scope | linked | linked 只回写由 ERP 事件打开的会话;erp-tools 还包含用过 erp_* 工具的会话;all 全部 |
outbound.includeSummary | true | 是否把回合最终答复摘要发给 ERP;敏感场景设 false |
inbound.permissionPreset | read-only | 入站会话强制切换到的权限预设;不可用则拒绝创建 |
inbound.workspacePath | /workspace | 入站会话工作区,默认与 profile 隔离 |
policy.allowWrite | false | 为 true 才注册写工具;仍逐次审批 |
policy.writableEntities | [] | 写实体白名单,必须与适配器 writable 同时满足 |
完整字段与默认值见 lib/config.js。