UllrAI/dsh-mqtt ↗★ 2

dsh-mqtt

MQTT protocol driver and agent worker gateway for DeepSeek Harness 适合需要将DSH智能体与物联网设备或MQTT消息队列进行集成的开发者。

패키지
dsh-mqtt
호환성
미검증
Harness peer 범위
^0.1.0-rc.8
Cordis peer 범위
^4.0.1
버전
0.1.6
라이선스
MIT
최근 업데이트
2026. 8. 22.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:UllrAI/dsh-mqtt

Configuration reference

Options are grouped the same way the DSH settings form renders them. The resolved configuration stays flat, so the YAML below is unaffected by the grouping.

Broker connection
OptionDefaultDescription
urlmqtt://127.0.0.1:1883mqtt, mqtts, ws, or wss broker URL.
protocolVersion55 for MQTT 5, 4 for MQTT 3.1.1.
clientIddsh-mqtt-{namespace}-{nodeId}Stable MQTT client ID.
cleanfalseMQTT clean-session/start flag. Keep false for offline command delivery.
keepaliveSeconds30MQTT keepalive.
connectTimeoutMs10000Initial connection timeout.
reconnectPeriodMs1000Reconnect delay; 0 disables reconnect.
sessionExpirySeconds86400MQTT 5 Session expiry; ignored for MQTT 3.1.1.
username, passwordunsetDirect broker credentials. Avoid storing password in a profile.
usernameEnv, passwordEnvunsetEnvironment variable names containing broker credentials. Mutually exclusive with direct values.
TLS
OptionDefaultDescription
caFileunsetAbsolute CA bundle path for TLS.
certFile, keyFileunsetClient certificate and private key paths for mutual TLS.
rejectUnauthorizedtrueVerify broker TLS certificates. Do not disable in production.
Node identity
OptionDefaultDescription
namespacelocalTopic namespace; 1–64 topic-safe characters.
nodeIddsh-nodeNode topic segment; 1–64 topic-safe characters.
displayNamethe node IDName shown to controllers and in the Worker UI.
capabilities[]Informational values published in online presence.
Agents and workspaces
OptionDefaultDescription
workspaces{}Alias-to-directory allowlist for new Sessions.
defaultWorkspaceunsetAlias used when a new request omits workspace.
allowExternalSessionsfalsePermit continuation of Sessions not recorded by this gateway. See the security warning above.
provider, model, maxTokenscurrent DSH profile selectionOptional Agent creation overrides. provider and model must be set together; otherwise the gateway reads ctx.agentDefaultModel.
eventExposuresafesafe normalized events or full raw event data.
stateFile.dsh-mqtt/state.jsonDurable deduplication/result/Session-ownership JSON file.
Limits
OptionDefaultDescription
maxMessageBytes65536Maximum inbound MQTT payload size.
maxMetadataBytes8192Maximum serialized metadata size; cannot exceed maxMessageBytes.
maxInputChars32768Maximum input length in JavaScript characters.
maxActiveRequests16Maximum accepted/active requests.
dedupTtlSeconds604800Terminal request/control retention.
heartbeatSeconds15Interval between retained status publishes. Controllers treat a node as stale after two missed beats.
Management interface
OptionDefaultDescription
managementPort3210Port for the management API and standalone page. 0 disables both, and leaves the DSH panel with nothing to read.
managementHost127.0.0.1Bind address. Anything other than loopback requires a management token.
managementCorsOriginunsetOne exact origin allowed to call the API. Unset means loopback origins only, which is what the DSH panel needs.
managementTokenunsetBearer token required by the API.
managementTokenEnvunsetEnvironment variable holding the management token. Mutually exclusive with managementToken.
requireControllerAuthfalseRequire controllers to be invited and approved before they may submit or steer. Left off, broker credentials alone are enough to run agent work on this node, so the gateway warns at startup.

Credentials and TLS

The gateway supports direct MQTT username/password values or environment-backed credentials. Prefer environment variables for unattended deployments so the password is not stored in the DSH profile.

Username/password without TLS

This is suitable only for a loopback interface, VPN, or otherwise trusted private network. MQTT username/password authentication does not encrypt the credentials or payload.

- id: mqtt-gateway
  config:
    url: mqtt://broker.internal.example:1883
    namespace: ullrai
    nodeId: mac-mini
    username: dsh-mac-mini
    password: replace-with-broker-password

The direct password form is shown for completeness. Do not commit a real password to the profile. Use mqtts:// or wss:// whenever traffic crosses an untrusted network.

Username/password over TLS

This is the recommended configuration for a cloud broker:

- id: mqtt-gateway
  config:
    url: mqtts://broker.example.com:8883
    namespace: ullrai
    nodeId: mac-mini
    usernameEnv: DSH_MQTT_USERNAME
    passwordEnv: DSH_MQTT_PASSWORD
    rejectUnauthorized: true
    stateFile: /var/lib/dsh-mqtt/state.json
    workspaces:
      repo-foo: /srv/repos/repo-foo
export DSH_MQTT_USERNAME='dsh-mac-mini'
export DSH_MQTT_PASSWORD='...'
npx @deepseek-ai/dsh --profile web

Use the exact hostname and port supplied by the broker. A public-CA certificate normally needs no caFile; hostname and certificate verification remain enabled by default. Secure WebSocket endpoints use wss:// with the provider's path and the same credential fields.

Custom CA and mutual TLS

For a private CA or a broker that requires a client certificate, add the relevant files to the TLS configuration:

- id: mqtt-gateway
  config:
    url: mqtts://broker.internal.example:8883
    namespace: ullrai
    nodeId: mac-mini
    usernameEnv: DSH_MQTT_USERNAME
    passwordEnv: DSH_MQTT_PASSWORD
    caFile: /etc/dsh-mqtt/ca.pem
    certFile: /etc/dsh-mqtt/client.pem
    keyFile: /etc/dsh-mqtt/client-key.pem
    rejectUnauthorized: true

caFile supplies the trusted CA bundle. certFile and keyFile enable mutual TLS and must be configured together when the broker requires them. A broker can require mTLS in addition to, or instead of, username/password authentication. Do not set rejectUnauthorized: false in production.