dsh-workflow-bar 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jaycebox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,257 @@
1
- # Temporary Holding Version
1
+ # dsh-workflow-bar
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ English | [中文](README.zh.md)
4
+
5
+ A saved-workflow library for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH): write a
6
+ workflow script once, then run it by name from the composer, and manage the
7
+ whole library from a row in the left sidebar.
8
+
9
+ - **`/workflow`** opens a searchable picker of saved workflows; choosing one
10
+ fills the composer with the exact command.
11
+ - **`/workflow <name> <input>`** runs a saved workflow: the script, its metadata,
12
+ and your input are handed to the agent's `workflow` tool.
13
+ - **`Workflow 库`** in the left sidebar opens the management page — list, search,
14
+ create, edit, delete, and copy the run command.
15
+ - **Every run ends with a summary**, because the plugin adds a standing
16
+ system-prompt rule instead of hoping the model remembers to report back.
17
+
18
+ ![The Workflow library page beside the left sidebar](docs/preview.svg)
19
+
20
+ ## Contents
21
+
22
+ - [Requirements](#requirements)
23
+ - [Install](#install)
24
+ - [Quick start](#quick-start)
25
+ - [Commands](#commands)
26
+ - [The picker](#the-picker)
27
+ - [The management page](#the-management-page)
28
+ - [Where workflows live](#where-workflows-live)
29
+ - [The agent tool](#the-agent-tool)
30
+ - [Configuration](#configuration)
31
+ - [Permissions and privacy](#permissions-and-privacy)
32
+ - [Limitations](#limitations)
33
+ - [Development](#development)
34
+ - [Storefront assets](#storefront-assets)
35
+ - [Publishing to the plugin market](#publishing-to-the-plugin-market)
36
+ - [License](#license)
37
+
38
+ ## Requirements
39
+
40
+ - DSH `0.2.2-rc.1` or newer, Web or Desktop surface (the management page is a
41
+ browser UI; the commands and the tool also work headlessly).
42
+ - An agent preset that mounts the `workflow` tool for the run path: `standard`
43
+ and `cordis` do, `ptc` and `minimal` do not.
44
+
45
+ ## Install
46
+
47
+ **From a market or GitHub** (once the repository is published):
48
+
49
+ ```bash
50
+ dsh plugin --profile desktop add github:<owner>/dsh-workflow-bar
51
+ ```
52
+
53
+ **From a local checkout**: `Plugins` → `Add plugin` → the directory containing
54
+ this `package.json`. The same path works through the agent:
55
+
56
+ ```text
57
+ plugin_manager install_bundle target="<absolute path to this directory>"
58
+ ```
59
+
60
+ **Prebuilt tarball** (no build approval): every release attaches the packed
61
+ package, so this also works:
62
+
63
+ ```bash
64
+ dsh plugin --profile desktop add -w "https://github.com/Jaycebox/dsh-workflow-bar/releases/download/v1.0.0/dsh-workflow-bar-1.0.0.tgz"
65
+ ```
66
+
67
+ Installation writes the bundle into the profile and survives restarts. Reload
68
+ the window once so the sidebar row and the client half are in the page's module
69
+ graph.
70
+
71
+ ## Quick start
72
+
73
+ 1. Reload the window; a **Workflow 库** row appears in the left sidebar.
74
+ 2. Type `/workflow` in the composer and press **Enter**; pick a workflow from
75
+ the list (or create one from the panel's **新建** button).
76
+ 3. Type your input after the filled command and press Enter. The agent calls
77
+ the `workflow` tool with the saved script and answers with a summary.
78
+
79
+ To have the agent author a workflow for you, run
80
+ `/workflow-add 并行检索百度与谷歌并比较重合度` — it lists the library first,
81
+ designs the script, and saves it through the `workflow_library` tool.
82
+
83
+ ## Commands
84
+
85
+ | Command | What it does |
86
+ |---|---|
87
+ | `/workflow` | Opens the picker of saved workflows. Choosing one completes the composer to `/workflow <name> ` and focuses it. |
88
+ | `/workflow <name> <input>` | Runs a saved workflow with your input. Without input, the record's `defaultInput` is used when one exists. |
89
+ | `/workflow-list [query]` | Lists the library; the optional query filters names and descriptions. |
90
+ | `/workflow-add <requirement>` | Starts the creation flow: the agent inspects the library, designs the script, and saves it. |
91
+
92
+ Bare `/workflow` also prints the registered names when the picker is not
93
+ available (headless or older surfaces), so the command is useful everywhere.
94
+
95
+ ## The picker
96
+
97
+ `/workflow` + **Enter** (or picking the row from the `/` menu) opens a popup
98
+ listing every saved workflow with its description, input hint, and default
99
+ input. It is a client-side *decoration* over the Host command
100
+ (`ctx.commandUi.decorate` with a `popupSelect`, the same shell `/model` and
101
+ `/permission` use), so the command keeps its catalog row, argument claim, and
102
+ lifecycle logging.
103
+
104
+ A leading space after `/workflow` claims the argument instead of opening the
105
+ popup — that is the contract for commands that declare an input hint, and it is
106
+ how you type a name the picker does not know.
107
+
108
+ ## The management page
109
+
110
+ The **Workflow 库** row selects a page in the main column:
111
+
112
+ - **List** with a filter box; each row shows the name and one-line description.
113
+ - **Detail** with description, when-to-use, input hint, default input, update
114
+ time, the exact run command (with a copy button), and the script source.
115
+ - **新建 / 编辑** with fields for name (a lowercase slug), description,
116
+ when-to-use, input hint, default input, and the script body.
117
+ - **删除** in two steps: the first click arms it for five seconds, the second
118
+ removes the record. Deleting is user-only; the agent tool cannot do it.
119
+ - **返回对话** returns the main column to the Conversation.
120
+
121
+ ## Where workflows live
122
+
123
+ One JSON file per workflow under `$DSH_HOME/workflows` (default
124
+ `~/.dsh/workflows`), or the directory the plugin row configures:
125
+
126
+ ```yaml
127
+ - id: workflow-bar
128
+ name: dsh-workflow-bar
129
+ config:
130
+ directory: 'D:\workflows'
131
+ ```
132
+
133
+ ```json
134
+ {
135
+ "version": 1,
136
+ "name": "open-bilibili",
137
+ "description": "Open a bilibili page in the existing Chrome profile",
138
+ "whenToUse": "When you want bilibili open without typing a URL",
139
+ "argsHint": "Target: home page, search words, a BV id, or a full URL",
140
+ "defaultInput": "首页",
141
+ "script": "const target = String(args.input || '').trim()\n...",
142
+ "createdAt": "2026-12-02T00:00:00.000Z",
143
+ "updatedAt": "2026-12-02T00:00:00.000Z"
144
+ }
145
+ ```
146
+
147
+ `script` is the body the `workflow` tool executes: plain JavaScript with
148
+ top-level `await`, the `agent()`, `parallel()`, `pipeline()`, `phase()`, and
149
+ `log()` hooks, and a final JSON return value. Your input reaches it as
150
+ `args.input`. Nothing is generated or evaluated by this plugin — the file is
151
+ plain data you can edit by hand or keep in version control.
152
+
153
+ ## The agent tool
154
+
155
+ `workflow_library` is host-wide and visible to every agent:
156
+
157
+ | Action | Purpose |
158
+ |---|---|
159
+ | `list` | Names, descriptions, input hints, and defaults before creating anything. |
160
+ | `save` | Persist one workflow: `name`, `description`, `script`, optional `whenToUse`, `argsHint`, `defaultInput`, and `overwrite`. |
161
+
162
+ Saving an existing name fails unless `overwrite` is true. Deleting is
163
+ user-only on purpose: a model cannot remove your library.
164
+
165
+ ## Configuration
166
+
167
+ | Field | Default | Meaning |
168
+ |---|---|---|
169
+ | `directory` | `$DSH_HOME/workflows` | Where workflow files are read and written. |
170
+ | `summarySection` | `true` | Add the standing "summarize every workflow run" prompt section. |
171
+
172
+ ## Permissions and privacy
173
+
174
+ - Reads and writes only inside the workflow directory; nothing else on disk.
175
+ - No outbound network. Workflows themselves may call the tools their child
176
+ agents have; that is the script's business, not this plugin's.
177
+ - Adds one local HTTP route, `POST /workflow-bar/api`, used by the management
178
+ page. It accepts only loopback (or a deployment-trusted host) requests with a
179
+ same-origin `Origin`, and only a fixed list of operations (list, detail, save,
180
+ remove) — it is not a generic proxy into the Host.
181
+ - Registers three slash commands, one model-facing tool (`workflow_library`),
182
+ one prompt section, and the sidebar page.
183
+
184
+ ## Limitations
185
+
186
+ - **It does not execute scripts itself.** The workflow engine lives inside each
187
+ Agent preset, so the run path is the agent calling the `workflow` tool. A
188
+ preset without that tool cannot run a workflow.
189
+ - **Running costs model tokens**: one agent turn plus whatever the workflow's
190
+ own subagents consume. Browsing the panel costs nothing.
191
+ - **No run history in the panel.** Runs are visible in the transcript (the
192
+ official workflow-run node and the tool result).
193
+ - **No recursion.** A workflow script cannot call another saved workflow; DSH's
194
+ workflow engine has no `workflow()` hook.
195
+ - **UI copy is Chinese.** The panel and command output use Chinese text with the
196
+ host's theme tokens; display metadata is localized for the plugin page.
197
+
198
+ ## Development
199
+
200
+ ```bash
201
+ npm run check # node --check on every module + the client smoke test
202
+ npm run test # client bundle evaluation test
203
+ ```
204
+
205
+ `test/client-smoke.mjs` evaluates the browser bundle against stubs and asserts
206
+ both slot registrations and the picker. It exists because `node --check` cannot
207
+ catch a broken template literal that still parses: a stray backtick in the CSS
208
+ once passed the syntax check and threw only at runtime, which unregistered the
209
+ whole plugin.
210
+
211
+ Layout:
212
+
213
+ | Path | Role |
214
+ |---|---|
215
+ | `lib/index.js` | Host half: commands, tool, prompt section, API wiring |
216
+ | `lib/store.js` | Workflow records on disk |
217
+ | `lib/prompts.js` | Command output and the follow-up prompts |
218
+ | `lib/web.js` | The same-origin JSON route and its trust fence |
219
+ | `lib/client.js` | Sidebar row, management page, `/workflow` picker |
220
+ | `test/client-smoke.mjs` | Browser-bundle evaluation test |
221
+ | `scripts/render-assets.py` | Draws the storefront icon and panel illustration |
222
+
223
+ ## Storefront assets
224
+
225
+ `assets/icon-256.png` and `assets/panel-illustration.png` are produced by
226
+ `scripts/render-assets.py` (Pillow, bundled with the DSH runtime), and
227
+ `screenshots.json` declares the illustration for storefronts. The illustration
228
+ is **drawn, not captured** — it depicts the page faithfully but is not a live
229
+ window capture; replace the file with a real one when you have it and the
230
+ declaration keeps working. The plugin's own detail page still uses the vector
231
+ `docs/preview.svg`, which DSH renders natively.
232
+
233
+ ## Publishing to the plugin market
234
+
235
+ 1. Push the repository. `repository`, `homepage`, and `bugs` in `package.json`
236
+ already point at `Jaycebox/dsh-workflow-bar`; change them only if you publish
237
+ under another account.
238
+ 2. **Community market (awesome-dsh-plugin).** `dshmarket` and the Discover page
239
+ read the `plugins.json` that
240
+ [awesome-dsh-plugin/awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
241
+ generates from `data/plugins/*.yml`. Submission is one file in a pull request:
242
+ copy [`market/awesome-dsh-plugin.yml`](market/awesome-dsh-plugin.yml) to
243
+ `data/plugins/Jaycebox__dsh-workflow-bar.yml`. Two rules bite: the repository
244
+ must be at least one day old and carry the `dsh-plugin` topic, and a custom
245
+ `icon:` must be a GitHub-hosted raster image (SVG is refused, so the card
246
+ falls back to your avatar without one).
247
+ 3. **Official DSH market index (optional, self-hosted).** `npm run index`
248
+ generates a format-1 index at `market/index.json` from the current git remote
249
+ and commit. Host it anywhere public (for example this repository's raw URL)
250
+ and add it under Settings → plugin sources.
251
+
252
+ Tag releases with SemVer (`v1.0.0`) so an entry's `version` and `added` fields
253
+ stay meaningful.
254
+
255
+ ## License
256
+
257
+ MIT. See [LICENSE](LICENSE).
package/README.zh.md ADDED
@@ -0,0 +1,203 @@
1
+ # dsh-workflow-bar
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)用的 workflow 库:
6
+ 脚本写一次、按名字跑,左侧边栏一整页管理。
7
+
8
+ - **`/workflow`** 弹出可搜索的 workflow 列表,选中直接把完整命令填进输入框。
9
+ - **`/workflow <名称> <输入>`** 运行已保存的 workflow:脚本、元数据、你的输入一起交给 agent 的 `workflow` 工具。
10
+ - **左侧边栏「Workflow 库」** 打开管理页——列出、搜索、新建、编辑、删除、复制运行命令。
11
+ - **每次运行结束都会有一句总结**:插件往系统提示词里加了一条常驻规则,而不是指望模型自己想起来汇报。
12
+
13
+ ![Workflow 库管理页与左侧边栏](docs/preview.svg)
14
+
15
+ ## 目录
16
+
17
+ - [环境要求](#环境要求)
18
+ - [安装](#安装)
19
+ - [快速上手](#快速上手)
20
+ - [命令](#命令)
21
+ - [联想弹层](#联想弹层)
22
+ - [管理页](#管理页)
23
+ - [workflow 存在哪](#workflow-存在哪)
24
+ - [给 agent 的工具](#给-agent-的工具)
25
+ - [配置](#配置)
26
+ - [权限与隐私](#权限与隐私)
27
+ - [已知限制](#已知限制)
28
+ - [开发](#开发)
29
+ - [市场素材](#市场素材)
30
+ - [发布到插件市场](#发布到插件市场)
31
+ - [License](#license)
32
+
33
+ ## 环境要求
34
+
35
+ - DSH `0.2.2-rc.1` 及以上;Web 或 Desktop 界面(管理页是浏览器 UI;命令与工具在无界面环境也能用)。
36
+ - 运行路径需要一个挂载了 `workflow` 工具的 agent preset:`standard` 和 `cordis` 有,`ptc` 和 `minimal` 没有。
37
+
38
+ ## 安装
39
+
40
+ **从市场或 GitHub 安装**(仓库发布后):
41
+
42
+ ```bash
43
+ dsh plugin --profile desktop add github:<owner>/dsh-workflow-bar
44
+ ```
45
+
46
+ **从本地目录安装**:`Plugins` → `Add plugin` → 选这个 `package.json` 所在目录。
47
+ 也可以让 agent 装:
48
+
49
+ ```text
50
+ plugin_manager install_bundle target="<本目录的绝对路径>"
51
+ ```
52
+
53
+ **预构建 tarball**(免构建授权):每个 release 都附带打包好的包,所以这样也行:
54
+
55
+ ```bash
56
+ dsh plugin --profile desktop add -w "https://github.com/Jaycebox/dsh-workflow-bar/releases/download/v1.0.0/dsh-workflow-bar-1.0.0.tgz"
57
+ ```
58
+
59
+ 安装会写进 profile,重启后仍在。装完刷新一次窗口,侧边栏那一行和客户端半区才会进入页面的模块图。
60
+
61
+ ## 快速上手
62
+
63
+ 1. 刷新窗口,左侧边栏出现 **Workflow 库**。
64
+ 2. 输入框敲 `/workflow` 按**回车**,从列表里挑一个(或点面板里的**新建**自己写)。
65
+ 3. 在补全好的命令后面补上输入再回车。agent 会用保存的脚本调用 `workflow` 工具,并用一段总结回你。
66
+
67
+ 想让 agent 帮你写一个,直接 `/workflow-add 并行检索百度与谷歌并比较重合度`:它会先看库里有什么、再设计脚本,最后通过 `workflow_library` 工具保存。
68
+
69
+ ## 命令
70
+
71
+ | 命令 | 作用 |
72
+ |---|---|
73
+ | `/workflow` | 打开 workflow 选择弹层;选中后把输入框补成 `/workflow <名称> ` 并把焦点交回输入框。 |
74
+ | `/workflow <名称> <输入>` | 运行已保存的 workflow。没给输入时,若记录里有 `defaultInput` 就用它。 |
75
+ | `/workflow-list [查询词]` | 列出整个库;查询词过滤名称与描述。 |
76
+ | `/workflow-add <需求描述>` | 进入创建流程:agent 查库、设计脚本、保存。 |
77
+
78
+ 没有弹层的环境(无界面或旧界面)下,裸 `/workflow` 会直接打印已注册的名称,所以这条命令在哪儿都有用。
79
+
80
+ ## 联想弹层
81
+
82
+ `/workflow` 后按**回车**(或从 `/` 菜单里选中这一行)会弹出一个列表,每行显示名称、描述、输入提示和默认输入。
83
+ 它是对 Host 命令的客户端**装饰**(`ctx.commandUi.decorate` + `popupSelect`,与 `/model`、`/permission` 同一套外壳),所以命令本身仍保留目录行、参数声明与生命周期日志。
84
+
85
+ `/workflow` 后按**空格**不会弹层——那会进入参数输入态,这是"声明了输入提示的命令"的既定行为,也是你手打一个列表里没有的名字时的入口。
86
+
87
+ ## 管理页
88
+
89
+ 左侧「Workflow 库」会在主区域打开管理页:
90
+
91
+ - **列表**带过滤框,每行显示名称与一行描述。
92
+ - **详情**显示描述、适用时机、输入提示、默认输入、更新时间、可直接复制的运行命令,以及脚本正文。
93
+ - **新建 / 编辑**:名称(小写 slug)、描述、适用时机、输入提示、默认输入、脚本正文。
94
+ - **删除**是两段式:第一次点击进入待确认(5 秒后自动取消),第二次才真的删除。删除只允许人来做,agent 工具没有这个动作。
95
+ - **返回对话**把主区域切回会话。
96
+
97
+ ## workflow 存在哪
98
+
99
+ 一个 workflow 一个 JSON 文件,放在 `$DSH_HOME/workflows`(默认 `~/.dsh/workflows`),或插件行配置的目录:
100
+
101
+ ```yaml
102
+ - id: workflow-bar
103
+ name: dsh-workflow-bar
104
+ config:
105
+ directory: 'D:\workflows'
106
+ ```
107
+
108
+ ```json
109
+ {
110
+ "version": 1,
111
+ "name": "open-bilibili",
112
+ "description": "用现有 Chrome 配置打开一个 bilibili 页面",
113
+ "whenToUse": "想直接打开 bilibili、又不想手输网址时",
114
+ "argsHint": "目标:首页、搜索词、BV 号或完整 URL",
115
+ "defaultInput": "首页",
116
+ "script": "const target = String(args.input || '').trim()\n...",
117
+ "createdAt": "2026-12-02T00:00:00.000Z",
118
+ "updatedAt": "2026-12-02T00:00:00.000Z"
119
+ }
120
+ ```
121
+
122
+ `script` 就是 `workflow` 工具执行的脚本正文:普通 JavaScript,允许顶层 `await`,可用 `agent()`、`parallel()`、`pipeline()`、`phase()`、`log()`,最后 `return` 一个 JSON 值。你的输入以 `args.input` 传进去。插件不会生成或执行任何代码,这些就是纯数据,可以手改,也可以纳入版本管理。
123
+
124
+ ## 给 agent 的工具
125
+
126
+ `workflow_library` 挂在 Host 侧,所有 agent 都能用:
127
+
128
+ | action | 用途 |
129
+ |---|---|
130
+ | `list` | 创建之前先看已有名称、描述、输入提示与默认输入。 |
131
+ | `save` | 保存一个 workflow:`name`、`description`、`script`,可选 `whenToUse`、`argsHint`、`defaultInput`,以及 `overwrite`。 |
132
+
133
+ 同名保存会失败,除非 `overwrite` 为 true。删除刻意只给人做:模型不能清空你的库。
134
+
135
+ ## 配置
136
+
137
+ | 字段 | 默认 | 含义 |
138
+ |---|---|---|
139
+ | `directory` | `$DSH_HOME/workflows` | workflow 文件的读写目录。 |
140
+ | `summarySection` | `true` | 是否加入"每次 workflow 运行后总结"的常驻提示词段落。 |
141
+
142
+ ## 权限与隐私
143
+
144
+ - 只读写 workflow 目录内的文件,不碰磁盘上其他东西。
145
+ - 没有对外网络请求。workflow 自己会不会联网,取决于它让子代理用了什么工具,那是脚本的事。
146
+ - 新增一条本机 HTTP 路由 `POST /workflow-bar/api`,只给管理页用:只接受回环地址(或部署信任的主机)且同源的请求,并且只开放固定几个操作(list / detail / save / remove),不是通往 Host 的通用代理。
147
+ - 注册三条 slash 命令、一个模型工具(`workflow_library`)、一个提示词段落,以及侧边栏页面。
148
+
149
+ ## 已知限制
150
+
151
+ - **插件自己不执行脚本。** workflow 引擎在 agent preset 内部,所以运行路径是 agent 调用 `workflow` 工具;没挂这个工具的 preset 跑不了。
152
+ - **运行要花 token**:一轮 agent 对话,加上 workflow 自己起的子代理。翻面板不花 token。
153
+ - **面板里没有运行历史。** 运行过程看对话(官方 workflow 运行节点 + 工具结果)。
154
+ - **不支持嵌套。** workflow 脚本不能调用另一个已保存的 workflow——DSH 的引擎没有 `workflow()` 钩子。
155
+ - **界面文案是中文。** 面板与命令输出用中文并沿用宿主的主题 token;插件页的显示元数据是中英双语的。
156
+
157
+ ## 开发
158
+
159
+ ```bash
160
+ npm run check # 对所有模块做 node --check,再跑客户端冒烟测试
161
+ npm run test # 客户端 bundle 求值测试
162
+ ```
163
+
164
+ `test/client-smoke.mjs` 会在桩环境里真正求值浏览器 bundle,断言两处插槽注册和选择器。它存在的理由很具体:`node --check` 抓不到"模板字符串被截断但仍是合法 JS"这类问题——之前 CSS 里一个多余的反引号就通过了语法检查,却在运行时抛错,把整个插件从侧边栏里摘掉了。
165
+
166
+ 目录:
167
+
168
+ | 路径 | 作用 |
169
+ |---|---|
170
+ | `lib/index.js` | Host 半区:命令、工具、提示词段落、API 接线 |
171
+ | `lib/store.js` | 磁盘上的 workflow 记录 |
172
+ | `lib/prompts.js` | 命令输出与 follow-up 文案 |
173
+ | `lib/web.js` | 同源 JSON 路由及其信任栅栏 |
174
+ | `lib/client.js` | 侧边栏行、管理页、`/workflow` 选择器 |
175
+ | `test/client-smoke.mjs` | 浏览器 bundle 求值测试 |
176
+ | `scripts/render-assets.py` | 绘制市场图标与面板插图 |
177
+
178
+ ## 市场素材
179
+
180
+ `assets/icon-256.png` 与 `assets/panel-illustration.png` 由
181
+ `scripts/render-assets.py`(Pillow,DSH 运行时自带)生成,`screenshots.json`
182
+ 把插图声明给市场。插图是**画出来的,不是截屏**——它如实描绘了页面,但不是真实窗口
183
+ 捕获;以后有真截图直接替换同名文件即可,声明不用改。插件详情页仍用矢量
184
+ `docs/preview.svg`,由 DSH 原生渲染。
185
+
186
+ ## 发布到插件市场
187
+
188
+ 1. 推仓库。`package.json` 里的 `repository`、`homepage`、`bugs` 已经指向 `Jaycebox/dsh-workflow-bar`,只有换账号发布时才需要改。
189
+ 2. **社区市场(awesome-dsh-plugin)**:`dshmarket` 与 Discover 页读的是
190
+ [awesome-dsh-plugin/awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
191
+ 由 `data/plugins/*.yml` 生成的 `plugins.json`。投稿方式是 PR 里只加一个文件:
192
+ 把 [`market/awesome-dsh-plugin.yml`](market/awesome-dsh-plugin.yml) 复制成
193
+ `data/plugins/Jaycebox__dsh-workflow-bar.yml`。有两条硬规则:仓库创建需满 1 天、
194
+ 并带 `dsh-plugin` topic;自定义 `icon:` 必须是 GitHub 图床上的位图(SVG 不收,
195
+ 不写则回退到作者头像)。
196
+ 3. **官方 DSH 市场索引(可选、自托管)**:`npm run index` 会按当前 git remote 与 commit 生成 format-1 索引 `market/index.json`,
197
+ 放到任意公开地址(例如本仓库的 raw 链接),再到 Settings → 插件源里添加。
198
+
199
+ 打 release 建议用 SemVer(`v1.0.0`),这样条目里的 `version` 与 `added` 才有意义。
200
+
201
+ ## License
202
+
203
+ MIT,见 [LICENSE](LICENSE)。
Binary file
Binary file
@@ -0,0 +1,6 @@
1
+ # dsh-workflow-bar bundle patch.
2
+ # Inserted when this bundle is composed into a profile. One Host row; the
3
+ # client half rides the package's `dsh.client` declaration.
4
+ - insert:
5
+ - id: workflow-bar
6
+ name: 'dsh-workflow-bar'
package/docs/DETAIL.md ADDED
@@ -0,0 +1 @@
1
+ ![The Workflows page beside the left sidebar: a saved workflow list on the left, and the selected workflow's run command and script on the right](preview.svg)
@@ -0,0 +1 @@
1
+ ![Workflow 库管理页与左侧边栏:左侧是已保存的 workflow 列表,右侧是选中项的运行命令与脚本](preview.svg)
@@ -0,0 +1,49 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 300" width="640" height="300" role="img" aria-label="A Workflows page beside the left sidebar: a saved workflow list on the left and its script and run command on the right">
2
+ <rect x="24" y="24" width="592" height="252" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5"/>
3
+ <rect x="24" y="24" width="118" height="252" rx="14" fill="#EEF2F7"/>
4
+ <rect x="24" y="24" width="118" height="44" fill="#EEF2F7"/>
5
+ <rect x="40" y="40" width="58" height="9" rx="4.5" fill="#94A3B8"/>
6
+ <rect x="40" y="72" width="86" height="20" rx="7" fill="#DCE6F5"/>
7
+ <rect x="40" y="72" width="3" height="20" rx="1.5" fill="#2563EB"/>
8
+ <g fill="#B9C6D8">
9
+ <rect x="40" y="106" width="78" height="20" rx="7"/>
10
+ <rect x="40" y="136" width="78" height="20" rx="7"/>
11
+ <rect x="40" y="166" width="78" height="20" rx="7"/>
12
+ </g>
13
+ <rect x="142" y="24" width="1.5" height="252" fill="#E2E8F0"/>
14
+ <rect x="162" y="42" width="96" height="11" rx="5.5" fill="#334155"/>
15
+ <rect x="162" y="72" width="1.5" height="182" fill="#EDF1F7"/>
16
+ <rect x="180" y="74" width="184" height="1.5" fill="#EDF1F7"/>
17
+ <g>
18
+ <rect x="164" y="82" width="184" height="42" rx="9" fill="#FFFFFF" stroke="#DCE6F5" stroke-width="1.2"/>
19
+ <rect x="176" y="92" width="92" height="8" rx="4" fill="#475569"/>
20
+ <rect x="176" y="106" width="150" height="7" rx="3.5" fill="#CBD5E1"/>
21
+ <rect x="174" y="82" width="3" height="42" rx="1.5" fill="#2563EB"/>
22
+ </g>
23
+ <g>
24
+ <rect x="164" y="134" width="184" height="42" rx="9" fill="#FFFFFF" stroke="#E6ECF5" stroke-width="1.2"/>
25
+ <rect x="176" y="144" width="76" height="8" rx="4" fill="#64748B"/>
26
+ <rect x="176" y="158" width="138" height="7" rx="3.5" fill="#D7DFEA"/>
27
+ </g>
28
+ <g>
29
+ <rect x="164" y="186" width="184" height="42" rx="9" fill="#FFFFFF" stroke="#E6ECF5" stroke-width="1.2"/>
30
+ <rect x="176" y="196" width="104" height="8" rx="4" fill="#64748B"/>
31
+ <rect x="176" y="210" width="120" height="7" rx="3.5" fill="#D7DFEA"/>
32
+ </g>
33
+ <rect x="372" y="42" width="220" height="212" rx="11" fill="#FFFFFF" stroke="#E2E8F0" stroke-width="1.5"/>
34
+ <rect x="390" y="60" width="118" height="11" rx="5.5" fill="#334155"/>
35
+ <rect x="390" y="82" width="172" height="7" rx="3.5" fill="#D7DFEA"/>
36
+ <rect x="390" y="104" width="182" height="30" rx="7" fill="#F1F5F9"/>
37
+ <rect x="400" y="115" width="126" height="8" rx="4" fill="#8FA1B8"/>
38
+ <rect x="560" y="110" width="0" height="0"/>
39
+ <rect x="522" y="110" width="40" height="18" rx="6" fill="#2563EB"/>
40
+ <rect x="390" y="152" width="182" height="84" rx="8" fill="#0F1B2D"/>
41
+ <g fill="#5F89C0">
42
+ <rect x="402" y="164" width="86" height="6" rx="3"/>
43
+ <rect x="402" y="178" width="132" height="6" rx="3"/>
44
+ <rect x="402" y="192" width="104" height="6" rx="3"/>
45
+ <rect x="402" y="206" width="146" height="6" rx="3"/>
46
+ <rect x="402" y="220" width="70" height="6" rx="3"/>
47
+ </g>
48
+ <circle cx="278" cy="103" r="0" fill="none"/>
49
+ </svg>
package/icon.svg ADDED
@@ -0,0 +1,19 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="64" height="64" role="img" aria-label="Workflow bar">
2
+ <rect width="32" height="32" rx="7.5" fill="#17233A"/>
3
+ <g stroke="#8FD3F4" stroke-width="1.6" stroke-linecap="round" fill="none">
4
+ <path d="M9.5 8.5v15"/>
5
+ <path d="M9.5 8.5h4.5"/>
6
+ <path d="M9.5 16h7.5"/>
7
+ <path d="M9.5 23.5h4.5"/>
8
+ </g>
9
+ <g fill="#8FD3F4">
10
+ <circle cx="9.5" cy="8.5" r="1.9"/>
11
+ <circle cx="9.5" cy="16" r="1.9"/>
12
+ <circle cx="9.5" cy="23.5" r="1.9"/>
13
+ </g>
14
+ <g fill="#F4F8FF">
15
+ <rect x="16" y="6.7" width="7.5" height="3.6" rx="1.8"/>
16
+ <rect x="16" y="21.7" width="7.5" height="3.6" rx="1.8"/>
17
+ </g>
18
+ <rect x="19" y="14.2" width="6.5" height="3.6" rx="1.8" fill="#4A8CF7"/>
19
+ </svg>