wszw142857-beep/dsh-tool-cards ↗★ 0

dsh-tool-cards

Interactive cards for DeepSeek Harness replies, rendered from a tool result: sliders, selects, forms, charts and tables, with a submit action that flows back to the agent as a real user message. 适合需要通过滑块、表单等 UI 交互并将结果回传给智能体的场景。

パッケージ
dsh-tool-cards
互換性
未検証
バージョン
0.1.0
ライセンス
MIT
最終更新
2026/10/19

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:wszw142857-beep/dsh-tool-cards

ドキュメント

README 全文を読む ↗

Usage

The chat_ui tool appears in the model's tool set. Its description tells the model when to reach for it (parameter tuning, multi-dimensional comparison, "build me a calculator") and when not to (pure explanation, one-shot answers).

A minimal payload:

{
  "title": "药剂投加量计算器",
  "ui": {
    "schemaVersion": "chat-ui/1.0",
    "initialState": { "soilTons": 1000, "doseGPerKg": 2 },
    "tree": {
      "id": "root",
      "type": "Card",
      "props": { "title": "药剂投加量" },
      "children": [
        { "id": "soil", "type": "Input", "label": "土壤质量 (t)", "bind": "soilTons",
          "props": { "inputType": "number", "min": 0 } },
        { "id": "dose", "type": "Slider", "label": "投加量 (g/kg)", "bind": "doseGPerKg",
          "props": { "min": 0.1, "max": 5, "step": 0.1 } },
        { "id": "total", "type": "Metric", "label": "理论药剂质量", "props": { "unit": "t" },
          "value": { "op": "round", "args": [
            { "op": "div", "args": [
              { "op": "mul", "args": [{ "var": "soilTons" }, { "var": "doseGPerKg" }] }, 1000
            ] }, 3 ] } },
        { "id": "submit", "type": "Button", "label": "提交这次配比", "actionId": "apply" }
      ]
    },
    "actions": {
      "apply": {
        "kind": "submitToAgent",
        "operation": "apply-dose",
        "includeKeys": ["soilTons", "doseGPerKg"]
      }
    }
  }
}

Action kinds: submitToAgent, callTool, openUrl (http/https only).