dsh-github-flow 0.2.1 → 0.4.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/README.en.md +234 -130
- package/README.md +217 -112
- package/docs/UPGRADE-NOTES.md +15 -9
- package/docs/architecture.md +120 -108
- package/docs/images/2.png +0 -0
- package/docs/npm-publish-guide.md +12 -1
- package/lib/api/routes-actions.js +117 -0
- package/lib/api/routes-overview.js +198 -3
- package/lib/cache.d.ts +4 -0
- package/lib/cache.js +14 -0
- package/lib/client.d.ts +13 -1
- package/lib/client.js +3162 -2162
- package/lib/executor/git-parser.d.ts +25 -0
- package/lib/executor/git-parser.js +143 -0
- package/lib/executor/platform-guide.d.ts +14 -0
- package/lib/executor/platform-guide.js +40 -0
- package/lib/executor/process-utils.d.ts +51 -0
- package/lib/executor/process-utils.js +162 -0
- package/lib/executor/version-utils.d.ts +12 -0
- package/lib/executor/version-utils.js +27 -0
- package/lib/executor.d.ts +131 -17
- package/lib/executor.js +411 -223
- package/lib/git-watcher.d.ts +36 -0
- package/lib/git-watcher.js +91 -0
- package/lib/main.js +11 -0
- package/lib/renderers/cache.d.ts +8 -0
- package/lib/renderers/cache.js +66 -0
- package/lib/renderers/common.d.ts +24 -0
- package/lib/renderers/common.js +88 -0
- package/lib/renderers/gist.d.ts +15 -0
- package/lib/renderers/gist.js +99 -0
- package/lib/renderers/issue.d.ts +4 -0
- package/lib/renderers/issue.js +70 -0
- package/lib/renderers/label.d.ts +4 -0
- package/lib/renderers/label.js +48 -0
- package/lib/renderers/markdown.d.ts +15 -26
- package/lib/renderers/markdown.js +15 -517
- package/lib/renderers/pr.d.ts +4 -0
- package/lib/renderers/pr.js +107 -0
- package/lib/renderers/release.d.ts +4 -0
- package/lib/renderers/release.js +74 -0
- package/lib/renderers/repo.d.ts +4 -0
- package/lib/renderers/repo.js +149 -0
- package/lib/renderers/ruleset.d.ts +4 -0
- package/lib/renderers/ruleset.js +74 -0
- package/lib/renderers/run.d.ts +4 -0
- package/lib/renderers/run.js +79 -0
- package/lib/renderers/skill.d.ts +4 -0
- package/lib/renderers/skill.js +61 -0
- package/lib/renderers/status.d.ts +23 -0
- package/lib/renderers/status.js +124 -0
- package/lib/tools/cache.d.ts +64 -0
- package/lib/tools/cache.js +186 -0
- package/lib/tools/gist.d.ts +155 -0
- package/lib/tools/gist.js +190 -0
- package/lib/tools/help.js +233 -11
- package/lib/tools/image-utils.d.ts +8 -0
- package/lib/tools/image-utils.js +34 -0
- package/lib/tools/issue.d.ts +17 -1
- package/lib/tools/issue.js +114 -8
- package/lib/tools/label.d.ts +80 -0
- package/lib/tools/label.js +237 -0
- package/lib/tools/pr.d.ts +12 -0
- package/lib/tools/pr.js +96 -4
- package/lib/tools/repo.d.ts +8 -0
- package/lib/tools/repo.js +127 -3
- package/lib/tools/ruleset.d.ts +80 -0
- package/lib/tools/ruleset.js +177 -0
- package/lib/tools/run.d.ts +8 -0
- package/lib/tools/run.js +104 -3
- package/lib/tools/secret.d.ts +5 -0
- package/lib/tools/secret.js +108 -23
- package/lib/tools/status.d.ts +39 -0
- package/lib/tools/status.js +53 -0
- package/lib/types.d.ts +112 -0
- package/lib/ui/auth-guide-card.d.ts +4 -0
- package/lib/ui/auth-guide-card.js +161 -0
- package/lib/ui/branch-selector.d.ts +10 -0
- package/lib/ui/branch-selector.js +163 -0
- package/lib/ui/commit-modal.d.ts +8 -0
- package/lib/ui/commit-modal.js +89 -0
- package/lib/ui/icons.d.ts +7 -0
- package/lib/ui/icons.js +53 -0
- package/lib/ui/network-banner.d.ts +10 -0
- package/lib/ui/network-banner.js +54 -0
- package/lib/ui/storage.d.ts +26 -0
- package/lib/ui/storage.js +134 -0
- package/lib/ui/styles.d.ts +6 -0
- package/lib/ui/styles.js +1285 -0
- package/lib/ui/sync-settings-modal.d.ts +11 -0
- package/lib/ui/sync-settings-modal.js +350 -0
- package/lib/ui/sync-status-badge.d.ts +8 -0
- package/lib/ui/sync-status-badge.js +64 -0
- package/lib/ui/upgrade-card.d.ts +7 -0
- package/lib/ui/upgrade-card.js +197 -0
- package/lib/ui/utils.d.ts +10 -0
- package/lib/ui/utils.js +66 -0
- package/lib/ui/workspace-panel.d.ts +4 -0
- package/lib/ui/workspace-panel.js +464 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<b>Give DeepSeek Harness Agents native hands and feet to operate GitHub, crafting an immersive collaboration cockpit for developers.</b><br>
|
|
13
|
-
Natively reuses host <code>gh</code> CLI login credentials to eliminate Personal Access Token (PAT) leaks; deeply bridges local Git workspaces with remote GitHub collaboration, equipped with <b>
|
|
13
|
+
Natively reuses host <code>gh</code> CLI login credentials to eliminate Personal Access Token (PAT) leaks; deeply bridges local Git workspaces with remote GitHub collaboration, equipped with <b>14 core domain Agent tools (85+ actions covering PR review/Issue tracking/Actions workflow & cache governance/clone-free file reads/branch ruleset policy diagnosis/Gist snippets/labels & global status dashboards/secrets & variables)</b>, <b>human slash commands</b>, <b>Web UI visual cockpits</b>, and <b>cross-platform one-click seamless upgrades</b>.
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
@@ -29,7 +29,8 @@ When using AI Agents for collaborative coding, developers frequently hit these f
|
|
|
29
29
|
| **CI / Actions Failure Debugging** | Sifting through pages of Actions logs in a browser, copying stack traces to chat for debugging. | **Pinpoint Error Extraction**: Tell the Agent *"Why did CI fail?"*; Agent calls `github_run(log_failed)` to grab failed step logs and patch code instantly. |
|
|
30
30
|
| **Security & Token Management** | Pasting plain-text Personal Access Tokens (PATs) in plugin configs, risking token leaks and permission sprawl. | **Zero Token Exposure**: Directly reuses local `gh auth login` credentials via native OS Keychains/Keyrings securely. |
|
|
31
31
|
| **Context Switching Overhead** | Jumping back and forth between VS Code, browser GitHub tabs, and DSH chat windows. | **Immersive Dual Cockpit**: Live PR status, Actions pipelines, and 3D issue matrices right inside DSH. |
|
|
32
|
-
| **
|
|
32
|
+
| **Branch Switching & Real-Time Sync** | Switching branches requires hopping into a terminal, while the sidebar remains stale regarding local stage/commit changes. | **Safe In-UI Branch Switching + Live Git Watch**: Instant keyword filter with uncommitted dirty change guard; 800ms debounced `.git` watcher aligns right sidebar in milliseconds. |
|
|
33
|
+
| **First-Screen Latency & Loading** | Staring at full-screen spinners for 8~15s while waiting for heavy background `gh` processes. | **SWR 0ms Instant Render + Scheduled Sync**: Instantly displays local persistent snapshots; features a 3-way mutually exclusive sync model (SWR, Cloud Auto-Sync with visibility pause, Manual) and standalone local Git watch. |
|
|
33
34
|
| **Plugin Upgrades & Maintenance** | Manually checking npm registry versions, complicated commands, fear of breaking configs. | **Idle Silent Detection + One-Click Upgrade**: Dual-registry acceleration, auto macOS/Windows adaptation, upgrade with one click. |
|
|
34
35
|
|
|
35
36
|
---
|
|
@@ -72,7 +73,7 @@ dsh plugin --profile web add dsh-github-flow
|
|
|
72
73
|
|
|
73
74
|
## 🤖 Core Agent Tools: Equipping Agents with Native GitHub Powers
|
|
74
75
|
|
|
75
|
-
Consolidates scattered GitHub endpoints into **
|
|
76
|
+
Consolidates scattered GitHub endpoints into **14 core domain tools (85+ actions)**, featuring **Token Budget Protection (default 24KB intelligent truncation)**, **High-density Native Markdown Rendering (70%+ list output token reduction)** and **Zero-argument CWD auto-binding**.
|
|
76
77
|
|
|
77
78
|
### 1. `github_pr`: Pull Request Lifecycle & Automated Code Review
|
|
78
79
|
> **Example Agent Prompts**:
|
|
@@ -86,142 +87,227 @@ Consolidates scattered GitHub endpoints into **9 core domain tools**, featuring
|
|
|
86
87
|
* `view`: Inspect PR description, metadata, and mergeability;
|
|
87
88
|
* `diff`: Retrieve complete code diffs (`stat_only` for file-change overview, safely truncated against token limits);
|
|
88
89
|
* `checks`: Audit CI gate status (pass/fail/skip category badges, owning workflow, and detail links);
|
|
89
|
-
* `create`: Auto-create PRs (supports draft mode & `--dry-run`);
|
|
90
|
+
* `create`: Auto-create PRs (supports draft mode & `--dry-run`, supports `attach_images` local uploads);
|
|
91
|
+
* `edit`: 🆕 Edit PR title, body description, and metadata with image attachment support;
|
|
92
|
+
* `comment`: 🆕 Post comments and reviews to pull requests with image attachment support;
|
|
90
93
|
* `checkout`: 🆕 Check out PR code to a local branch for sandboxed testing;
|
|
91
94
|
* `status`: 🆕 Inspect merge conflict status (`CLEAN` / `CONFLICT`) for the current branch's PR;
|
|
92
95
|
* `review`: Submit code reviews (`APPROVE`, `REQUEST_CHANGES`, `COMMENT`);
|
|
93
96
|
* `merge`: Merge pull requests (`squash` / `merge` / `rebase`, optional `delete_branch`; requires `confirm: true`);
|
|
94
|
-
* `
|
|
97
|
+
* `ready`: 🆕 Toggle Draft ↔ Ready (`undo: true` converts back to Draft — fully reversible);
|
|
98
|
+
* `revert`: 🆕 Create a revert commit (generates a new revert PR on the remote; requires `confirm: true`);
|
|
99
|
+
* `update_branch`: 🆕 Sync the latest base-branch commits into the PR branch — the self-healing action for "branch is out-of-date" CI gate failures;
|
|
100
|
+
* `view_images`: 🆕 Download PR discussion screenshots (body + comments; `image_urls` targeting with budget-overflow resume list);
|
|
101
|
+
* `attach_images` (param): 🆕 Upload local images/attachments to PRs (up to 50 files/batch, symmetric with view_images, requires gh ≥ 2.99).
|
|
95
102
|
|
|
96
103
|
---
|
|
97
104
|
|
|
98
|
-
### 2. `
|
|
105
|
+
### 2. `github_issue`: Issue Tracking & Branch Creation
|
|
99
106
|
> **Example Agent Prompts**:
|
|
100
|
-
> - *"
|
|
101
|
-
> - *"
|
|
102
|
-
> - *"
|
|
107
|
+
> - *"List all open issues assigned to me."*
|
|
108
|
+
> - *"Branch off a local fix branch 'fix-login-error' from Issue #42 and start working."*
|
|
109
|
+
> - *"Add a comment to Issue #15 summarizing the edge cases we just discovered with screenshots."*
|
|
103
110
|
|
|
104
111
|
* **Supported Actions**:
|
|
105
|
-
* `
|
|
106
|
-
* `
|
|
107
|
-
* `
|
|
108
|
-
* `
|
|
109
|
-
* `
|
|
110
|
-
* `
|
|
112
|
+
* `list`: List issues with flexible filtering (`state` / `labels` / `assignees`);
|
|
113
|
+
* `view`: Inspect full issue threads, body descriptions, and assignees;
|
|
114
|
+
* `create`: Create new issue tickets (supports `attach_images` local uploads);
|
|
115
|
+
* `comment`: Add comments to issue threads (supports `attach_images` error screenshot uploads);
|
|
116
|
+
* `edit`: Update titles, `add_labels`, or `remove_labels`;
|
|
117
|
+
* `close` / `reopen`: Manage lifecycle status (`close` requires `confirm: true`);
|
|
118
|
+
* `develop`: 🆕 Automatically branch off a local Git branch linked to the issue;
|
|
119
|
+
* `delete`: 🆕 Irreversible physical deletion (requires `confirm: true`);
|
|
120
|
+
* `transfer`: 🆕 Move issue to another repository with 301 redirects (requires `confirm: true`);
|
|
121
|
+
* `pin` / `unpin`: 🆕 Manage pinned issues on the repository;
|
|
122
|
+
* `lock` / `unlock`: 🆕 Lock discussions with standard reasons (`off_topic`, `resolved`, `spam`, `too_heated`);
|
|
123
|
+
* `status`: 🆕 Retrieve a comprehensive dashboard of issues assigned to the active user;
|
|
124
|
+
* `view_images`: 🆕 Download screenshot attachments from issue descriptions and comments into local image blocks;
|
|
125
|
+
* `attach_images` (param): 🆕 Upload local file screenshots alongside issues (up to 50 local files/batch, requires gh ≥ 2.99).
|
|
111
126
|
|
|
112
127
|
---
|
|
113
128
|
|
|
114
|
-
### 3. `
|
|
129
|
+
### 3. `github_run`: Actions Monitoring & Intelligent Troubleshooting
|
|
115
130
|
> **Example Agent Prompts**:
|
|
116
|
-
> - *"
|
|
117
|
-
> - *"
|
|
118
|
-
> - *"
|
|
119
|
-
> - *"Close Issue #45."*
|
|
131
|
+
> - *"Did the latest CI run on main fail?"*
|
|
132
|
+
> - *"Extract the failed step logs from the recent failed run and debug the root cause."*
|
|
133
|
+
> - *"Re-run the latest failed CI pipeline."*
|
|
120
134
|
|
|
121
135
|
* **Supported Actions**:
|
|
122
|
-
* `list`: Query
|
|
123
|
-
* `view`:
|
|
124
|
-
* `
|
|
125
|
-
* `
|
|
126
|
-
* `
|
|
127
|
-
* `
|
|
128
|
-
* `
|
|
129
|
-
* `
|
|
136
|
+
* `list`: Query workflow runs by branch or status;
|
|
137
|
+
* `view`: Inspect step breakdown and conclusion states;
|
|
138
|
+
* `log_failed`: **🔥 Troubleshooting Swiss Army Knife**! Pinpoints exact failing jobs and steps, extracting only the critical failure lines;
|
|
139
|
+
* `rerun`: Re-trigger failed workflows with one click;
|
|
140
|
+
* `cancel`: Cancel in-progress or queued runs;
|
|
141
|
+
* `trigger`: Manually dispatch `workflow_dispatch` workflows with custom parameters;
|
|
142
|
+
* `workflow_list`: 🆕 List all workflows in the repository (`all: true` includes disabled ones);
|
|
143
|
+
* `workflow_view`: 🆕 Inspect workflow YAML definitions and total run metrics;
|
|
144
|
+
* `workflow_enable` / `workflow_disable`: 🆕 Toggle workflow status dynamically;
|
|
145
|
+
* `download`: 🆕 Download build artifacts (strictly adhering to GHSA path-traversal safeguards).
|
|
130
146
|
|
|
131
147
|
---
|
|
132
148
|
|
|
133
|
-
### 4. `github_repo`:
|
|
149
|
+
### 4. `github_repo`: Metadata, Fork Sync, Clone-Free File Reads & Global Search
|
|
134
150
|
> **Example Agent Prompts**:
|
|
135
|
-
> - *"
|
|
136
|
-
> - *"Search
|
|
137
|
-
> - *"
|
|
151
|
+
> - *"Sync my fork with the upstream repository."*
|
|
152
|
+
> - *"Search where 'useAuthToken' is used across this repository."*
|
|
153
|
+
> - *"Read 'src/utils.ts' on the remote repository without cloning."*
|
|
154
|
+
> - *"Fetch the README, and download the architecture diagrams inside it."*
|
|
138
155
|
|
|
139
156
|
* **Supported Actions**:
|
|
140
|
-
* `view`:
|
|
141
|
-
* `readme`: 🆕 Read
|
|
142
|
-
* `sync`:
|
|
143
|
-
* `
|
|
144
|
-
* `
|
|
157
|
+
* `view`: Inspect repository metadata, default branch, Star/Fork counts, licenses, and topics;
|
|
158
|
+
* `readme`: 🆕 Read README text and extract all referenced image URLs, with optional `image_urls` batch downloads;
|
|
159
|
+
* `sync`: Sync fork branch with upstream (`--force` hard reset supported);
|
|
160
|
+
* `read_file`: 🆕 Clone-free remote file reading (`gh ≥ 2.95` direct, older CLI versions auto-fallback to REST API);
|
|
161
|
+
* `read_dir`: 🆕 Clone-free remote directory enumeration with file types and sizes;
|
|
162
|
+
* `search_code`: Search code across GitHub repositories;
|
|
163
|
+
* `search_repos`: Search repositories by keywords and topics;
|
|
164
|
+
* `search_issues` / `search_prs`: Global issue and pull request queries;
|
|
165
|
+
* `search_commits`: Global commit message search.
|
|
145
166
|
|
|
146
167
|
---
|
|
147
168
|
|
|
148
|
-
### 5. `
|
|
169
|
+
### 5. `github_release`: Release Governance & Build Artifact Delivery
|
|
149
170
|
> **Example Agent Prompts**:
|
|
150
|
-
> - *"
|
|
171
|
+
> - *"Check the latest release notes and assets for this repository."*
|
|
172
|
+
> - *"Draft a new v0.4.0 release using commits since the last tag."*
|
|
173
|
+
> - *"Upload the local build artifact 'dsh-github-flow-0.4.0.tgz' to the latest release."*
|
|
151
174
|
|
|
152
|
-
* **
|
|
175
|
+
* **Supported Actions**:
|
|
176
|
+
* `list`: Query release history;
|
|
177
|
+
* `view`: Inspect notes and asset manifests for a given tag;
|
|
178
|
+
* `create`: Publish releases (supports `generate_notes`, drafts, prereleases, and asset attachments);
|
|
179
|
+
* `upload`: Attach build assets to an existing release (`clobber: true` requires `confirm: true`);
|
|
180
|
+
* `download`: Download release artifacts with glob pattern filters;
|
|
181
|
+
* `delete`: Delete releases (`cleanup_tag: true` deletes associated Git tag; requires `confirm: true`).
|
|
153
182
|
|
|
154
183
|
---
|
|
155
184
|
|
|
156
|
-
### 6. `
|
|
185
|
+
### 6. `github_secret`: CI/CD Secrets & Variables Governance
|
|
157
186
|
> **Example Agent Prompts**:
|
|
158
|
-
> - *"
|
|
159
|
-
> - *"
|
|
187
|
+
> - *"List the names of all configured Actions secrets."*
|
|
188
|
+
> - *"Set a repository secret named 'DEPLOY_KEY'."*
|
|
189
|
+
> - *"Read the value of plaintext variable 'NODE_ENV'."*
|
|
160
190
|
|
|
161
191
|
* **Supported Actions**:
|
|
162
|
-
* `list
|
|
163
|
-
* `
|
|
164
|
-
* `
|
|
165
|
-
* `delete
|
|
192
|
+
* `list`: Enumerate secret or variable names (secret values are never echoed);
|
|
193
|
+
* `set`: Configure secrets (**Security Invariant: ciphertext safely passed via stdin, never in command arguments or process tables**) or variables;
|
|
194
|
+
* `get`: 🆕 Read variable values (available only for `kind: 'variable'`; secrets are cryptographically shielded by GitHub);
|
|
195
|
+
* `delete`: Remove secrets or variables (secret deletion requires `confirm: true`).
|
|
166
196
|
|
|
167
197
|
---
|
|
168
198
|
|
|
169
|
-
### 7. `
|
|
199
|
+
### 7. `github_skill`: Agent Skills Ecosystem Discovery & Local Installation
|
|
170
200
|
> **Example Agent Prompts**:
|
|
171
|
-
> - *"
|
|
172
|
-
> - *"
|
|
201
|
+
> - *"Search GitHub for open-source Agent skills related to 'markdown'."*
|
|
202
|
+
> - *"Preview and install the code review skill from 'github/awesome-copilot' into this project."*
|
|
173
203
|
|
|
174
204
|
* **Supported Actions**:
|
|
175
|
-
* `
|
|
176
|
-
* `
|
|
177
|
-
* `
|
|
178
|
-
*
|
|
205
|
+
* `search`: Discover compliant Agent skills across open-source GitHub repositories;
|
|
206
|
+
* `preview`: Preview `SKILL.md` rule instructions without installing;
|
|
207
|
+
* `install`: Install skills locally (`scope: 'project'` or `'user'`; requires `confirm: true`);
|
|
208
|
+
* `list`: Inspect installed skills in the current environment.
|
|
179
209
|
|
|
180
210
|
---
|
|
181
211
|
|
|
182
|
-
### 8. `
|
|
212
|
+
### 8. `github_help`: Comprehensive Mapping, Official Syntax & Self-Healing
|
|
183
213
|
> **Example Agent Prompts**:
|
|
184
|
-
> - *"
|
|
185
|
-
> - *"
|
|
214
|
+
> - *"I am not sure which tool manages Discussions; check the mapping table for me."*
|
|
215
|
+
> - *"What is the syntax for filtering GitHub search results by date?"*
|
|
216
|
+
> - *"How do I debug 'authentication failed' errors from gh?"*
|
|
186
217
|
|
|
187
218
|
* **Supported Actions**:
|
|
188
|
-
* `
|
|
189
|
-
* `
|
|
190
|
-
* `
|
|
191
|
-
* `
|
|
192
|
-
*
|
|
219
|
+
* `overview`: Complete toolbox navigation and summary table (14 core tools);
|
|
220
|
+
* `mapping`: **Official gh Command ↔ Tool Action Mapping Table**, detailing exact tool calls and REST/GraphQL fallback routes;
|
|
221
|
+
* `search_syntax`: Date ranges, qualifiers, and boolean query syntax;
|
|
222
|
+
* `troubleshooting`: Self-healing recipes for authentication loss, timeouts, SOCKS5 proxy configs, and permissions;
|
|
223
|
+
* Domain guides: In-depth usage guides for `pr`, `issue`, `run`, `repo`, `release`, `secret`, `skill`, `label`, `ruleset`, `cache`, `gist`, and `status`;
|
|
224
|
+
* `gh_command`: Direct pass-through lookup of official gh manual entries (e.g. `gh_command: 'ruleset'`).
|
|
193
225
|
|
|
194
226
|
---
|
|
195
227
|
|
|
196
|
-
### 9. `
|
|
228
|
+
### 9. `github_api`: Raw GitHub REST & GraphQL Escape Hatch
|
|
197
229
|
> **Example Agent Prompts**:
|
|
198
|
-
> - *"
|
|
199
|
-
> - *"
|
|
230
|
+
> - *"Call GitHub API to fetch the current user's profile JSON."*
|
|
231
|
+
> - *"Run a GraphQL query to inspect repository Discussions."*
|
|
200
232
|
|
|
201
|
-
* **
|
|
202
|
-
* Task-routing navigation across all 9 tools;
|
|
203
|
-
* Official advanced search syntax cheat sheet (date ranges, status qualifiers, code search scopes);
|
|
204
|
-
* Self-healing recipes for common errors (403 rate limits, 422 missing params, stale forks, outdated CLI);
|
|
205
|
-
* Direct passthrough to the official `gh help <command>` offline manual.
|
|
233
|
+
* **Supported Features**: Direct invocation of arbitrary GitHub REST or GraphQL endpoints using host credentials, supporting `--jq` filtering, auto-pagination (`paginate: true`), and `raw: true` mode.
|
|
206
234
|
|
|
207
235
|
---
|
|
208
236
|
|
|
209
|
-
|
|
237
|
+
### 10. `github_label`: Label System Management & Cross-Repo Cloning
|
|
238
|
+
> **Example Agent Prompts**:
|
|
239
|
+
> - *"List all labels in this repository sorted by name."*
|
|
240
|
+
> - *"Create a label 'priority/p0' with color #d73a4a for critical bugs."*
|
|
241
|
+
> - *"Clone the label system from 'cli/cli' repository into our new repository."*
|
|
242
|
+
> - *"Delete the deprecated 'invalid' label."*
|
|
210
243
|
|
|
211
|
-
* **
|
|
212
|
-
*
|
|
213
|
-
*
|
|
244
|
+
* **Supported Actions**:
|
|
245
|
+
* `list`: List repository labels (supports `search` regex/keyword, `sort: 'created' | 'name'`, and `order: 'asc' | 'desc'`);
|
|
246
|
+
* `create`: Create a new label (hex color normalization, optional `force: true` to update existing);
|
|
247
|
+
* `edit`: Update label color, description, or rename via `new_name`;
|
|
248
|
+
* `delete`: Safe deletion (affects associated issues/PRs; requires `confirm: true` confirmation, injects `--yes`);
|
|
249
|
+
* `clone`: 🆕 **One-click cross-repo label cloning**: Copy all labels from a source repository (`source_repo`) into the target repository (supports `force: true` to overwrite conflicts).
|
|
214
250
|
|
|
215
251
|
---
|
|
216
252
|
|
|
217
|
-
|
|
253
|
+
### 11. `github_ruleset`: Branch Protection Rules & Policy Diagnosis
|
|
254
|
+
> **Example Agent Prompts**:
|
|
255
|
+
> - *"Why can't I merge this PR? Check all applicable rules for this branch."*
|
|
256
|
+
> - *"Verify whether branch master requires CI status checks or 2 approvals."*
|
|
257
|
+
> - *"List all repository rulesets."*
|
|
258
|
+
|
|
259
|
+
* **Supported Actions**:
|
|
260
|
+
* `check`: **🔥 Core PR Merge Blocker Diagnosis**! View all protective rules governing a branch (e.g. required approvals, required status checks, linear history, force-push denial), complementing `github_pr(action: 'checks')` with authoritative policy perspective;
|
|
261
|
+
* `list`: List rulesets for repository or organization (`--org` and `--no-parents` support);
|
|
262
|
+
* `view`: Inspect ruleset configuration and target branches (requires `ruleset_id`).
|
|
218
263
|
|
|
219
|
-
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### 12. `github_cache`: Actions Build Cache Auditing & Safe Cleanup
|
|
267
|
+
> **Example Agent Prompts**:
|
|
268
|
+
> - *"How much cache space is consumed by GitHub Actions in this repository?"*
|
|
269
|
+
> - *"List build caches sorted by size in descending order."*
|
|
270
|
+
> - *"Purge all build caches in this repository."*
|
|
271
|
+
|
|
272
|
+
* **Supported Actions**:
|
|
273
|
+
* `list`: Audit Actions caches with human-readable size formatting (KB/MB/GB), key prefix and ref filtering, and size/access sorting;
|
|
274
|
+
* `delete`: Precise 3-way cleanup (by `cache_id`, by `key`, or purge everything via `all: true`; purge is destructive and requires `confirm: true`, injects `--succeed-on-no-caches` for idempotency).
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
### 13. `github_gist`: Code Snippets & Diagnostics Archiving
|
|
279
|
+
> **Example Agent Prompts**:
|
|
280
|
+
> - *"Publish this diagnostic error log as a Secret Gist and share the link."*
|
|
281
|
+
> - *"List all gists on my user account."*
|
|
282
|
+
> - *"Inspect the contents of Gist '5b0e0062eb8e9654adad7bb1d81cc75f'."*
|
|
220
283
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
*
|
|
224
|
-
*
|
|
284
|
+
* **Supported Actions**:
|
|
285
|
+
* `list`: List user gists (structured TSV parser, supports `public` / `secret` / `filter` options);
|
|
286
|
+
* `view`: View raw code contents of a gist (optional `filename` targeting, requires `gist_id`);
|
|
287
|
+
* `create`: Create gists from `content` string (streamed via safe stdin pipeline) or local `files`, defaults to Secret mode with **explicit unlisted security warnings**;
|
|
288
|
+
* `edit`: Update descriptions or files in a gist;
|
|
289
|
+
* `delete`: Permanently delete a gist (requires `confirm: true` and `--yes`).
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
### 14. `github_status`: Cross-Repository Todo & Activity Dashboard
|
|
294
|
+
> **Example Agent Prompts**:
|
|
295
|
+
> - *"What tasks and pull requests need my attention on GitHub today?"*
|
|
296
|
+
> - *"Check recent @mentions and activity across all repositories I follow."*
|
|
297
|
+
|
|
298
|
+
* **Supported Actions**:
|
|
299
|
+
* `view`: **Account-level global status cockpit**, aggregating Assigned Issues, Assigned PRs, Review Requests, Mentions, and Repository Activity across all subscribed repositories without needing repository context; supports `-o` org filtering and `-e` noise repository exclusion.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 🖥️ Web UI Cockpit & Right Sidebar Workspace Panel
|
|
304
|
+
|
|
305
|
+
`dsh-github-flow` delivers native visual controls alongside its Agent toolset:
|
|
306
|
+
|
|
307
|
+
### 1. Global Cockpit (Main Dashboard)
|
|
308
|
+
Click the **Octocat icon** in DSH's left navigation bar to open the full-screen cockpit:
|
|
309
|
+
* **⚡ 0ms Instant Render (SWR Persistent Cache)**: Powered by local snapshot persistence; enjoy instant dashboard loading;
|
|
310
|
+
* **📦 Live Freshness Status Pill**: Transparently communicates data freshness right next to the title (`[📦 Local Snapshot (21m ago)]` ➔ `[⏳ Syncing in background...]` ➔ `[✅ Up to date (15:30)]` ➔ `[⚠️ Network failed, offline snapshot displayed]`);
|
|
225
311
|
* **Account-Wide Overview**: Live view of all cloud repositories, default branches, and star counts;
|
|
226
312
|
* **Local Workspace Matrix**: Automatically detects open projects and bridges local directories with remote repos;
|
|
227
313
|
* **3D Issue Governance Matrix**: Categorizes issues into *"📥 User Reported"*, *"🎯 Assigned to Me"*, and *"✍️ Created by Me"* with responsive pill filters;
|
|
@@ -232,41 +318,54 @@ Access via the GitHub icon in the main left navigation:
|
|
|
232
318
|
</p>
|
|
233
319
|
|
|
234
320
|
### 2. Session Right Sidebar Panel (Workspace Drawer)
|
|
235
|
-
Located in the right drawer of every chat workspace:
|
|
236
|
-
* **Context Auto-Binding**: Automatically locks onto the active Git repository;
|
|
237
|
-
* **
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* **
|
|
321
|
+
Located in the right drawer of every chat workspace, seamlessly bridging your local Git workspace with remote GitHub repositories:
|
|
322
|
+
* **Context Auto-Binding**: Automatically locks onto the active Git repository of the current session;
|
|
323
|
+
* **Branch Viewing & Safe In-UI Switching (Branch Selector)**:
|
|
324
|
+
* Visual branch dropdown directly inside the repository card;
|
|
325
|
+
* Built with official **Git diamond vector icons (`#1296db` SVG)**;
|
|
326
|
+
* Pre-fetched with the overview payload for an **instant 0ms dropdown opening**, featuring live keyword search across local and remote branches;
|
|
327
|
+
* **Dirty File Guard**: Strict pre-flight checks block switching if there are uncommitted changes, protecting work from destructive overwrites;
|
|
328
|
+
* **Freshness Pill Alignment**: Compact indicator `[📦 Local Snapshot (2m ago)]` with live `[🔄 Refresh]` button;
|
|
241
329
|
* **Quick Action Grid**: Open repo in browser, jump to Issues/PRs, create PRs with one click;
|
|
242
|
-
*
|
|
330
|
+
* **Five Mutually Exclusive Tabs**: Compact tabbed navigation directly below the quick action grid:
|
|
331
|
+
* **Git Records (`Git`)** (Default tab):
|
|
332
|
+
* Branch & Remote Sync: Real-time branch indicator (e.g. `master`) with tracking sync status (`✓ Up to date` or `↑N to push` / `↓N to pull`);
|
|
333
|
+
* Three-Section Commit View: Unpushed commits (ahead of remote), unpulled commits (behind remote), and recent commit history;
|
|
334
|
+
* 15 commits displayed by default, with **infinite scroll loading** when scrolling to the bottom (with live `15 / 74` progress counter and click trigger);
|
|
335
|
+
* Latest Release badge (`🏷️ v0.4.0`) anchored in the top right with hover details and direct release link;
|
|
336
|
+
* **Commit Detail Modal**: Click any commit row to open a clean modal dialog centered within the right sidebar, featuring smooth vertical scrolling, full 40-char SHA, author email, date, multi-line commit message body, and file diff stat table (`--stat`), pure local 0ms instant display;
|
|
337
|
+
* **Uncommitted Changes (`📁 Uncommitted (N)`)**: Full-width list of uncommitted files with color-coded status codes (`??` untracked, `M` modified, `D` deleted, `R` renamed) and change counts;
|
|
338
|
+
* **Pull Requests (`🔀 PR (N)`)**: Open PR inspection with 3-state CI check rollup (`✅ CI Passed` / `❌ CI Failed` / `⏳ CI Pending`), merge conflict detection, review decisions (`✔ Approved` / `✋ Changes Requested` / `👀 Review Required`), Draft pills, and humanized relative timestamps;
|
|
339
|
+
* **Workspace Issues (`📋 Issues (N)`)**: Direct issue task review with assignees, labels, and category pills;
|
|
340
|
+
* **Actions Pipeline (`⚡ Actions (N)`)**: Real-time CI workflow status tracking with trigger event badges (`push`/`schedule`/`manual`/`PR`), relative time, and self-healing diagnostic notes for failed runs (embedding `run_id` for Agent one-click log inspection);
|
|
341
|
+
* **⚙️ Full Settings Access**: Dedicated settings button reusing the same settings modal as the cockpit (all four sections: Sync / Proxy / Update Source / About) — no need to switch back to the main page.
|
|
243
342
|
|
|
244
343
|
<p align="center">
|
|
245
344
|
<img src="./docs/images/2.png" alt="Session Right Sidebar Panel" width="100%" />
|
|
246
345
|
</p>
|
|
247
346
|
|
|
248
347
|
### 3. Settings Center (Settings Modal)
|
|
249
|
-
Click **`[⚙️ Settings]`** in the top right of the Cockpit (or the ⚙️ button in the right sidebar) to open the sectioned settings modal
|
|
348
|
+
Click **`[⚙️ Settings]`** in the top right of the Cockpit (or the ⚙️ button in the right sidebar) to open the sectioned settings modal:
|
|
250
349
|
|
|
251
|
-
**🔄 Data Sync Section** — tune data fetching rhythm:
|
|
252
|
-
* **
|
|
253
|
-
* **⚡ Instant Render (SWR,
|
|
350
|
+
**🔄 Data Sync Section** — tune data fetching rhythm and perception sensitivity:
|
|
351
|
+
* **Three Mutually Exclusive Data Refresh Strategies**:
|
|
352
|
+
* **⚡ Instant Render (SWR, Default)**: Instantly displays local cache (0ms), then silently syncs the latest state in the background on initial load;
|
|
353
|
+
* **☁️ Cloud Scheduled Auto-Sync (SWR + Polling)**: Instantly renders local cache and syncs once on mount, then counts down cyclically (**5/10/30/60 minutes** selectable; features automatic window visibility pause to prevent API quota drain in background tabs);
|
|
254
354
|
* **📋 Manual Only (Energy Saver)**: Browse local cache only; zero background `gh` processes triggered; click `[🔄 Refresh]` whenever you want updates.
|
|
355
|
+
* **Advanced Automation & Status Perception**:
|
|
356
|
+
* **📁 Local Git Real-Time Watch (Right Sidebar Only, Enabled by Default)**: Monitors `.git/HEAD` and `.git/index` metadata directly; staging, commit, and branch changes synchronize to the sidebar within milliseconds with an 800ms debounce, consuming zero external network quota; omitted from the main cockpit to preserve lightweight performance.
|
|
255
357
|
* **Visual Cache Management**: Real-time snapshot size and timestamp visibility with one-click `[🗑️ Clear Cache]`.
|
|
256
358
|
|
|
257
359
|
**🌐 Network Proxy Section** — route all plugin traffic through your proxy:
|
|
258
|
-
* **Global Scope**: Once configured, the cockpit, right-sidebar panel, all 9 Agent tool invocations, and one-click upgrades route through the proxy;
|
|
259
|
-
* **Protocol Support**: `http://` / `https://` / `socks5://` / `socks5h://` (
|
|
360
|
+
* **Global Scope**: Once configured, the cockpit, right-sidebar panel, all 9 Agent tool invocations, and one-click upgrades route through the proxy;
|
|
361
|
+
* **Protocol Support**: `http://` / `https://` / `socks5://` / `socks5h://` (`socks5h` delegates DNS resolution to the proxy for stronger pollution resistance);
|
|
260
362
|
* **`[🧪 Test Connectivity]`**: One-click latency probe against the GitHub API through the current proxy;
|
|
261
363
|
* **Instant Effect**: Persisted to `~/.dsh/data/dsh-github-flow/proxy.json` (auto-restored on DSH restart) — no restart, no plugin reload;
|
|
262
|
-
* **
|
|
263
|
-
* **NO_PROXY Exclusions**: `localhost` and `127.0.0.1` are forcibly included — loopback Web API requests are never hijacked by the proxy.
|
|
364
|
+
* **NO_PROXY Exclusions**: `localhost` and `127.0.0.1` are forcibly included.
|
|
264
365
|
|
|
265
366
|
**⬆️ Update Source Section** — choose which npm registry checks for new versions:
|
|
266
367
|
* **Three options**: 🌍 npm official registry (default — new releases visible immediately) / 🇨🇳 npmmirror (fast in China; minutes-level sync delay) / ⛔ No update checks (only silences the upgrade banner; `/gh upgrade` and one-click upgrade remain available);
|
|
267
368
|
* **Strict single-source**: the selected source is never silently swapped — probe failures are reported honestly;
|
|
268
|
-
* **Detection & upgrade traffic follows the global proxy setting** (socks5 boundary stated honestly in the UI);
|
|
269
|
-
* **One-click upgrade installs from the selected source** — consistent with version detection;
|
|
270
369
|
* **Verify on save**: switching sources immediately probes the new registry and shows the latest version.
|
|
271
370
|
|
|
272
371
|
**ℹ️ About Section** — plugin identity & project info:
|
|
@@ -286,15 +385,14 @@ Click **`[⚙️ Settings]`** in the top right of the Cockpit (or the ⚙️ but
|
|
|
286
385
|
Never miss an update! Built-in industrial-grade update management:
|
|
287
386
|
|
|
288
387
|
1. **Parallel Detection, Zero gh-Dependency**:
|
|
289
|
-
- Update checks fire **in parallel with the gh environment chain**
|
|
388
|
+
- Update checks fire **in parallel with the gh environment chain** on mount — never serialized behind gh overviews; gh failures never block upgrade banners;
|
|
290
389
|
- Server-side `inFlightPromise` merging + 24h cache keeps multi-panel mounting storm-free.
|
|
291
390
|
2. **Selectable Update Source** (see the "⬆️ Update Source" settings section):
|
|
292
391
|
- Defaults to the **npm official registry** (new releases visible immediately), or switch to **npmmirror** (minutes-level sync delay);
|
|
293
|
-
- Auto checks can be disabled entirely
|
|
392
|
+
- Auto checks can be disabled entirely.
|
|
294
393
|
3. **Cross-Platform One-Click Upgrade**:
|
|
295
394
|
- **Click to Upgrade**: Click **`[⚡ Upgrade]`** in the UI to update in the background;
|
|
296
395
|
- **Auto OS Adaptation**: Differentiates macOS and Windows; auto-injects Homebrew PATH variables on macOS GUI launches;
|
|
297
|
-
- **Registry Follows Setting**: One-click upgrades install from the source selected in Update Source settings;
|
|
298
396
|
- **Source Protection**: Automatically aborts npm overwrites when running in local Git linked development mode (`link:`);
|
|
299
397
|
- **Restart Guidance**: Clearly notifies users to restart DSH service to reload backend tools, with instant web refresh options.
|
|
300
398
|
|
|
@@ -304,10 +402,11 @@ Never miss an update! Built-in industrial-grade update management:
|
|
|
304
402
|
|
|
305
403
|
Why did the Global Cockpit take several seconds to load in earlier releases? Because it concurrently executes a dozen `gh` processes scanning multiple repositories and workspaces. This plugin integrates the **Stale-While-Revalidate (SWR)** caching pattern, putting total control back in your hands:
|
|
306
404
|
|
|
307
|
-
```
|
|
405
|
+
```text
|
|
308
406
|
Initial Mount (0ms) ──────────> Instantly render local persistent snapshot
|
|
309
407
|
│
|
|
310
|
-
├── SWR Mode: Idle 300ms delay, silently revalidate in background
|
|
408
|
+
├── SWR Mode: Idle 300ms delay, silently revalidate in background once
|
|
409
|
+
├── Cloud Scheduled Sync: Starts countdown after initial sync (5/10/30/60m pause on hide)
|
|
311
410
|
└── Manual Mode: Browse offline snapshot, only fetch on click [🔄 Refresh]
|
|
312
411
|
```
|
|
313
412
|
|
|
@@ -315,49 +414,50 @@ Initial Mount (0ms) ──────────> Instantly render local persi
|
|
|
315
414
|
|
|
316
415
|
| Sync Strategy | Mechanism | Recommended Use Case |
|
|
317
416
|
| :--- | :--- | :--- |
|
|
318
|
-
| **⚡ Instant Render (SWR, Default)** | **0ms instantaneous mount** from local cache, silently revalidating in background
|
|
417
|
+
| **⚡ Instant Render (SWR, Default)** | **0ms instantaneous mount** from local cache, silently revalidating in background once on mount — however stale the snapshot, opening the panel self-heals to fresh data. | **Recommended for all developers**. Eliminates spinner freezes, delivering seamless UX. |
|
|
418
|
+
| **☁️ Cloud Scheduled Auto-Sync (SWR + Polling)** | Instantly renders local cache and revalidates on mount, then starts a recurring timer (5/10/30/60m); features visibility-change pause to prevent background API quota drain. | **Active developers managing multiple repositories, PR workflows, and team issues**. |
|
|
319
419
|
| **📋 Manual Only (Energy Saver)** | Browse local cache only; zero automated background `gh` processes. | **Battery-powered laptops, low-spec hardware, or metered networks**. Zero background waste. |
|
|
320
420
|
|
|
321
|
-
* **Offline Resilience (Fail-Safe)**: Even when disconnected or hitting network timeouts, **your dashboard preserves the complete snapshot for searching, navigation, and review—zero blank screens or crash popups!**
|
|
421
|
+
* **Offline Resilience (Fail-Safe)**: Even when disconnected or hitting network timeouts, **your dashboard preserves the complete snapshot for searching, navigation, and review, paired with prominent offline warning banners and toasts—zero blank screens or crash popups!**
|
|
322
422
|
|
|
323
423
|
---
|
|
324
424
|
|
|
325
425
|
## 💬 Human Slash Commands
|
|
326
426
|
|
|
327
|
-
|
|
427
|
+
Enter in any DSH chat window:
|
|
328
428
|
|
|
329
|
-
* `/gh status`: Diagnostics for GitHub
|
|
330
|
-
* `/gh upgrade`: Check latest npm
|
|
331
|
-
* `/gh help`: View
|
|
429
|
+
* `/gh status`: Diagnostics for GitHub CLI auth status, scopes, active workspace repository, and plugin version;
|
|
430
|
+
* `/gh upgrade`: Check the latest npm release and output platform-tailored upgrade instructions (macOS / Windows / Linux);
|
|
431
|
+
* `/gh help`: View help documentation and example Agent dialogue recipes.
|
|
332
432
|
|
|
333
433
|
---
|
|
334
434
|
|
|
335
|
-
## ⚙️ Configuration (`cordis.
|
|
435
|
+
## ⚙️ Plugin Configuration (`cordis.yml`)
|
|
336
436
|
|
|
337
|
-
|
|
437
|
+
Fine-tune options via DSH config:
|
|
338
438
|
|
|
339
439
|
```yaml
|
|
340
|
-
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
440
|
+
- id: github-flow
|
|
441
|
+
name: dsh-github-flow
|
|
442
|
+
config:
|
|
443
|
+
ghPath: 'gh' # GitHub CLI executable path (default 'gh')
|
|
444
|
+
defaultTimeoutMs: 30000 # Command execution timeout in ms (default 30s)
|
|
445
|
+
maxOutputChars: 24000 # Max character output threshold (Token overflow protection)
|
|
446
|
+
maxOutputBytes: 96000 # Hard UTF-8 byte output cap, defaults to maxOutputChars * 4
|
|
447
|
+
defaultListLimit: 20 # Default query limit for list operations across PR/Issue/Run/Release/Skill
|
|
448
|
+
cacheTtlMs: 15000 # Repository overview cache TTL in ms (default 15s)
|
|
449
|
+
checkUpdate: true # Enable automated version checks (default true)
|
|
450
|
+
agentEnvInjection: true # Inject AI_AGENT=dsh for gh CLI recognition (default true)
|
|
451
|
+
updateCheckIntervalMs: 86400000 # Update check interval in ms (default 24h)
|
|
452
|
+
registryUrl: '' # Custom npm registry (defaults to Update Source setting)
|
|
453
|
+
proxyUrl: '' # Default proxy URL (overridden by UI settings)
|
|
354
454
|
```
|
|
355
455
|
|
|
356
456
|
---
|
|
357
457
|
|
|
358
|
-
## 🔌 Ecosystem
|
|
458
|
+
## 🔌 Cordis Ecosystem Service (`ctx.github`)
|
|
359
459
|
|
|
360
|
-
|
|
460
|
+
Exports a standard Cordis service `ctx.github` for other DSH plugins:
|
|
361
461
|
|
|
362
462
|
```typescript
|
|
363
463
|
import type { Context } from '@deepseek-ai/cordis';
|
|
@@ -373,16 +473,20 @@ export function apply(ctx: Context) {
|
|
|
373
473
|
|
|
374
474
|
---
|
|
375
475
|
|
|
376
|
-
## 📚 Documentation
|
|
476
|
+
## 📚 Documentation & Technical References
|
|
377
477
|
|
|
378
478
|
- [npm Publishing & Automated CI Guide](./docs/npm-publish-guide.md)
|
|
379
479
|
- [Architecture & Technical Specifications](./docs/architecture.md)
|
|
480
|
+
- [Release Checklist & Pitfall Guide](./docs/UPGRADE-NOTES.md)
|
|
380
481
|
|
|
381
482
|
---
|
|
382
483
|
|
|
383
|
-
##
|
|
384
|
-
|
|
484
|
+
## Community Links
|
|
485
|
+
|
|
486
|
+
- [LINUX DO - A New Community for Developers](https://linux.do/)
|
|
487
|
+
|
|
488
|
+
---
|
|
385
489
|
|
|
386
490
|
## 📄 License
|
|
387
491
|
|
|
388
|
-
Open-sourced under the [MIT License](./LICENSE). Contributions
|
|
492
|
+
Open-sourced under the [MIT License](./LICENSE). Contributions and PRs welcome!
|