dengkun0/dsh-erp-bridge ↗★ 0

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数据及事件进行对接的场景。

패키지
dsh-erp-bridge
호환성
미검증
버전
0.1.0
라이선스
MIT
최근 업데이트
2026. 10. 24.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dengkun0/dsh-erp-bridge

配置

配置写在 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.idmockmock / odoo / http-gateway
ingress.modestandalonestandalone 独立 loopback 监听;embedded 挂到现有 DSH webServer(仅演示)
ingress.host/port127.0.0.1:3081只绑回环;外层反代终结 TLS
ingress.signature.secretRefDSH_ERP_HMAC_SECRET先查 DSH 凭据 seam,再查环境变量,最后查 dataDir/secret
ingress.signature.autoGeneratetrue首次无密钥时生成 32 字节随机值写入 0600 文件
outbound.scopelinkedlinked 只回写由 ERP 事件打开的会话;erp-tools 还包含用过 erp_* 工具的会话;all 全部
outbound.includeSummarytrue是否把回合最终答复摘要发给 ERP;敏感场景设 false
inbound.permissionPresetread-only入站会话强制切换到的权限预设;不可用则拒绝创建
inbound.workspacePath/workspace入站会话工作区,默认与 profile 隔离
policy.allowWritefalse为 true 才注册写工具;仍逐次审批
policy.writableEntities[]写实体白名单,必须与适配器 writable 同时满足

完整字段与默认值见 lib/config.js。