UllrAI/dsh-mqtt1

dsh-mqtt

MQTT protocol driver and agent worker gateway for DeepSeek Harness

包名
dsh-mqtt
版本
0.1.0
许可证
MIT
最近更新
2026年8月18日

安装

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

Configuration reference

OptionDefaultDescription
urlmqtt://127.0.0.1:1883mqtt, mqtts, ws, or wss broker URL.
namespacelocalTopic namespace; 1–64 topic-safe characters.
nodeIddsh-nodeNode topic segment; 1–64 topic-safe characters.
clientIddsh-mqtt-{namespace}-{nodeId}Stable MQTT client ID.
protocolVersion55 for MQTT 5, 4 for MQTT 3.1.1.
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.
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.
stateFile.dsh-mqtt/state.jsonDurable deduplication/result/Session-ownership JSON file.
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.
capabilities[]Informational values published in online presence.
eventExposuresafesafe normalized events or full raw event data.
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.

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.