dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH 原生 macOS 桌面小组件中心:管理任意多个 widget 实例——行情小窗(5 源 fallback、交易时段感知节流)与便签,每实例一个独立 NSPanel+WKWebView 窗口(detached 独立进程、任意拖动、类型感知右键菜单)。实例以三层视图(列表 / 类型选择 / 详情)在 DSH 设置页卡片式配置;market_quote 模型工具供任意会话拉标准化行情;Type Studio 一键创建「创造模式」空会话并预填 issue-template 模板,起草新的 widget type。
English | 中文
settings.section slot · /widget-center/* API · Type Studio 会话管道
dsh-widget-center 是一个 DSH 插件:在桌面上管理任意多个原生 macOS 小窗 (widget 实例)——**行情(shares)与便签(notes)**两种类型,每实例独立窗口、 独立配置、独立生命周期;在 DSH 设置 UI 的「Widget Center」页以两层卡片配置 (卡片列表 → 点进详情编辑)。行情数据由 host 常驻进程直抓免费公开接口: 零 token、秒级轮询、多源 fallback,附
market_quote模型工具供任意会话调用。 设置页与桌面窗文案双语(zh 默认 / en,分别跟随 DSH 语言与浏览器 Accept-Language)。
type + 名称 + 窗口几何 + 类型专属配置;
可同时开多个行情、多个便签,互不干扰。swiftc 懒编译,二进制缓存):NSPanel borderless +
nonactivating + WKWebView——无 dock 图标、悬浮于普通窗口之上、跟随所有桌面空间。detached 独立进程:DSH 重启不影响已开的 widget;每个实例独立 pidfile
(widget-<id>.pid),二进制全实例共享。--app 命令(浏览器窗,功能等价,如实标注为 fallback)。settings.section slot,additive)。sessions.create 挂当前工作区 + 创造模式
cordis 预设,缺失回退 standard)创建不启动的会话并钉标题,composer
预填 issue-template 创作模板,补全 {{占位}} 后发送开始。PUT /api/instances 全量提交;创建/删除即时持久化;host 校验热应用、
重启保留、非法输入 400 显原因。页内不渲染行情数据。market_quote(symbols[]) 模型工具:任意会话拉标准化 Quote(强制引用时间戳);
开关在 shares 实例 config(conversationTool),execute 内检查,注册常驻。# 安装(DSH ≥ 0.1.1-rc.6)
dsh plugin --profile web add github:NattoCB/dsh-widget-center
# 插件集变更需重启 dsh web;client 内容变更刷新页面即热更
swiftc(Xcode Command Line Tools)。首次「显示 Widget」
自动编译(数秒),二进制缓存在 ~/.dsh/storages/widget-center/SharesWidget。market_quote 工具应答。| 形式 | 市场 | 主源 |
|---|---|---|
sh000852 sz399006 | A股指数 | tencent → eastmoney → sina |
sz159845 sh560010 | A股 ETF | 同上 |
sh600519 等 | A股个股 | 同上 |
hk00700 | 港股 | tencent(yahoo 兜底) |
usAAPL | 美股 | tencent(yahoo 兜底) |
fx_susdcny | 外汇 | sina(yahoo 兜底) |
binance:USDCUSDT | 加密 | binance |
nf_CU0 | 期货 | 未实现(无 provider 支持时进 failed 列表) |
{
"version": 2,
"instances": [
{
"id": "shares-1", "type": "shares", "name": "行情",
"enabled": true, "autoStart": true,
"window": { "x": 120, "y": 240, "w": 380, "h": 460 },
"config": { "conversationTool": true, "watchlist": [ /* … */ ] }
},
{
"id": "notes-1", "type": "notes", "name": "便签",
"enabled": true, "autoStart": true,
"window": { "x": 160, "y": 160, "w": 260, "h": 320 },
"config": { "lines": ["第一行", "第二行"] }
}
]
}
shares config 要点(完整表见 PRD §6):conversationTool(market_quote
开关,实例级)、watchlist、refreshIntervalSec(5–600)、openTtlSec/closedTtlSec
(交易相位 TTL)、providerPriority、proxy、theme/upsideGreen/showSparkline/
extendedHours。notes config:lines: string[]。v1 单 widget 设置与 v0.10 顶层
conversationTool 均自动迁移。
/widget-center/ 前缀,JSON envelope {ok,data}/{ok:false,error})GET /api/instances # {instances[+widget{running,pid}]}
PUT /api/instances # 全量替换,非法 400;热应用
POST /api/instances/:id/show # 懒编译 + detached 启动实例窗
POST /api/instances/:id/hide # SIGTERM + 清 pidfile
GET /api/quotes?symbols=sh000852,usAAPL # 省略 symbols = 首个 enabled shares 实例 watchlist
GET /api/health # {providers, cacheSize, instances[]摘要}
GET /dashboard/:id # 实例桌面窗 HTML(shares/notes 按 type 分派)
node --test # 63 项单测(parser/相位/设置/服务/路由/widget-host/dashboard)
node scripts/verify-live.mjs # 真机六品种 + 断源 fallback 演示(只读)
swiftc -O -swift-version 5 -o /tmp/SharesWidget src/widget/WidgetApp.swift # 手动编译验证
本地开发安装:克隆本仓库后 dsh plugin --profile web add file:<repo>(file: 依赖
指向本目录,源码即真相源);改源码后同步安装副本
cp -R src client cordis.patch.yml package.json ~/.dsh/profiles/web/node_modules/dsh-widget-center/。
nf_*:FR-1.1 列入符号规范,无 provider 实现;请求即入 failed。ts 为准。Referer: https://finance.sina.com.cn,否则 403(provider 已固化)。src/dashboard.js)与设置页是两处独立实现(client bundle 不能 import
host 模块);改行情行视觉两处同步。