dsh-github-flow 0.1.7 β 0.2.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 +287 -69
- package/README.md +290 -68
- package/docs/architecture.md +71 -14
- package/docs/images/1.png +0 -0
- package/docs/images/2.png +0 -0
- package/docs/images/3.png +0 -0
- package/docs/images/4.png +0 -0
- package/docs/npm-publish-guide.md +12 -0
- package/lib/api/route-helpers.d.ts +47 -0
- package/lib/api/route-helpers.js +134 -0
- package/lib/api/routes-actions.d.ts +9 -0
- package/lib/api/routes-actions.js +115 -0
- package/lib/api/routes-lifecycle.d.ts +9 -0
- package/lib/api/routes-lifecycle.js +75 -0
- package/lib/api/routes-overview.d.ts +11 -0
- package/lib/api/routes-overview.js +227 -0
- package/lib/api/routes-proxy.d.ts +18 -0
- package/lib/api/routes-proxy.js +63 -0
- package/lib/api/routes.d.ts +17 -5
- package/lib/api/routes.js +18 -417
- package/lib/client.js +1179 -40
- package/lib/commands/gh.d.ts +2 -1
- package/lib/commands/gh.js +40 -3
- package/lib/executor.d.ts +17 -0
- package/lib/executor.js +40 -2
- package/lib/main.d.ts +12 -0
- package/lib/main.js +73 -4
- package/lib/proxy.d.ts +87 -0
- package/lib/proxy.js +275 -0
- package/lib/renderers/markdown.d.ts +24 -0
- package/lib/renderers/markdown.js +493 -0
- package/lib/tools/api.d.ts +4 -0
- package/lib/tools/api.js +14 -4
- package/lib/tools/help.d.ts +31 -0
- package/lib/tools/help.js +212 -0
- package/lib/tools/issue.d.ts +32 -1
- package/lib/tools/issue.js +94 -17
- package/lib/tools/pr.d.ts +22 -1
- package/lib/tools/pr.js +67 -15
- package/lib/tools/release.d.ts +89 -0
- package/lib/tools/release.js +219 -0
- package/lib/tools/repo.d.ts +13 -1
- package/lib/tools/repo.js +46 -14
- package/lib/tools/run.d.ts +22 -1
- package/lib/tools/run.js +74 -14
- package/lib/tools/secret.d.ts +60 -0
- package/lib/tools/secret.js +175 -0
- package/lib/tools/skill.d.ts +63 -0
- package/lib/tools/skill.js +146 -0
- package/lib/types.d.ts +57 -0
- package/lib/updater.d.ts +49 -0
- package/lib/updater.js +169 -0
- package/lib/upgrade-manager.d.ts +58 -0
- package/lib/upgrade-manager.js +309 -0
- package/lib/version.d.ts +13 -0
- package/lib/version.js +13 -0
- package/package.json +3 -2
- package/lib/client/icons.d.ts +0 -13
- package/lib/client/icons.js +0 -41
- package/lib/client/index.d.ts +0 -3
- package/lib/client/index.js +0 -36
- package/lib/client/panel.d.ts +0 -1
- package/lib/client/panel.js +0 -102
- package/lib/client/style.d.ts +0 -1
- package/lib/client/style.js +0 -555
package/README.en.md
CHANGED
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
<a href="https://www.npmjs.com/package/dsh-github-flow"><img src="https://img.shields.io/npm/dm/dsh-github-flow.svg?style=flat-square&color=2ea043" alt="npm downloads" /></a>
|
|
6
6
|
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="license" /></a>
|
|
7
7
|
<a href="https://deepseek-harness.github.io/deepseek-harness/"><img src="https://img.shields.io/badge/Cordis-Compatible-8957e5.svg?style=flat-square" alt="Cordis" /></a>
|
|
8
|
+
<img src="https://img.shields.io/badge/Platform-macOS%20%7C%20Windows%20%7C%20Linux-informational.svg?style=flat-square" alt="Platform" />
|
|
8
9
|
</p>
|
|
9
10
|
|
|
10
11
|
<p align="center">
|
|
11
|
-
<b>
|
|
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>9 core domain Agent tools</b>, <b>human slash commands</b>, <b>Web UI visual cockpits</b>, and <b>cross-platform one-click seamless upgrades</b>.
|
|
13
14
|
</p>
|
|
14
15
|
|
|
15
16
|
<p align="center">
|
|
@@ -18,122 +19,336 @@
|
|
|
18
19
|
|
|
19
20
|
---
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
+
## π― Why `dsh-github-flow`?
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
When using AI Agents for collaborative coding, developers frequently hit these fragmentation friction points:
|
|
25
|
+
|
|
26
|
+
| Collaborative Scenario | Traditional Approach (Friction-Heavy) | `dsh-github-flow` (Native Experience) |
|
|
27
|
+
| :--- | :--- | :--- |
|
|
28
|
+
| **Agent PRs & Code Review** | Manually push branch in browser, click through GitHub web pages to open PRs, breaking autonomous loops. | **Autonomous PRs & Reviews**: Just tell the Agent *"Create a PR for this branch"*; Agent calls `github_pr` to publish and review diffs automatically. |
|
|
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
|
+
| **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
|
+
| **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
|
+
| **First-Screen Latency & Loading** | Staring at full-screen spinners for 8~15s while waiting for heavy background `gh` processes. | **SWR 0ms Instant Render**: Instantly displays local persistent snapshots; dedicated settings modal to switch between SWR auto-sync and manual mode. |
|
|
33
|
+
| **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
|
+
---
|
|
36
|
+
|
|
37
|
+
## π Installation Guide
|
|
38
|
+
|
|
39
|
+
### Step 1: Prerequisites
|
|
40
|
+
Ensure GitHub CLI (`gh`) is installed and authenticated:
|
|
41
|
+
```bash
|
|
42
|
+
# Windows
|
|
43
|
+
winget install --id GitHub.cli
|
|
44
|
+
|
|
45
|
+
# macOS
|
|
46
|
+
brew install gh
|
|
47
|
+
|
|
48
|
+
# Login (one-time setup)
|
|
49
|
+
gh auth login
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Step 2: Install into DSH
|
|
53
|
+
|
|
54
|
+
Run in your DSH environment:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Scenario A: DSH Desktop Edition (Desktop Profile)
|
|
58
|
+
dsh plugin --profile desktop add dsh-github-flow
|
|
59
|
+
|
|
60
|
+
# Scenario B: DSH Web / CLI Environment
|
|
61
|
+
pnpm dsh plugin add dsh-github-flow
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
> π‘ **Notice (24-Hour Supply-Chain Security Lock Window)**:
|
|
65
|
+
> DSH's bundled package manager enforces a supply-chain safety policy (`minimum-release-age = 24h`) by default to mitigate malicious package takeovers. Within **24 hours** of a new version release, running bare-name install commands without a version suffix will automatically fall back to the preceding stable version that has matured past 24 hours. To **install a newly released version immediately**, append the explicit version tag:
|
|
66
|
+
> ```bash
|
|
67
|
+
> dsh plugin --profile desktop add dsh-github-flow@<latest-version>
|
|
68
|
+
> ```
|
|
69
|
+
> Once 24 hours have passed since release, the standard bare-name command will resolve to the latest version automatically.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## π€ Core Agent Tools: Equipping Agents with Native GitHub Powers
|
|
74
|
+
|
|
75
|
+
Consolidates scattered GitHub endpoints into **9 core domain tools**, 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
|
+
### 1. `github_pr`: Pull Request Lifecycle & Automated Code Review
|
|
78
|
+
> **Example Agent Prompts**:
|
|
79
|
+
> - *"Check if there are any open PRs awaiting my review in this repository."*
|
|
80
|
+
> - *"Create a PR for the current branch titled 'feat: add dark mode' with a brief summary of changes."*
|
|
81
|
+
> - *"Review code diffs in PR #12 and provide security and refactoring suggestions."*
|
|
82
|
+
> - *"Did CI checks pass for PR #8? If so, squash merge it and delete the source branch."*
|
|
83
|
+
|
|
84
|
+
* **Supported Actions**:
|
|
85
|
+
* `list`: List open PRs with author, review decisions, and CI status (`state` / `author` / `limit` filters);
|
|
86
|
+
* `view`: Inspect PR description, metadata, and mergeability;
|
|
87
|
+
* `diff`: Retrieve complete code diffs (`stat_only` for file-change overview, safely truncated against token limits);
|
|
88
|
+
* `checks`: Audit CI status check rollups and test suites;
|
|
89
|
+
* `create`: Auto-create PRs (supports draft mode & `--dry-run`);
|
|
90
|
+
* `checkout`: π Check out PR code to a local branch for sandboxed testing;
|
|
91
|
+
* `status`: π Inspect merge conflict status (`CLEAN` / `CONFLICT`) for the current branch's PR;
|
|
92
|
+
* `review`: Submit code reviews (`APPROVE`, `REQUEST_CHANGES`, `COMMENT`);
|
|
93
|
+
* `merge`: Merge pull requests (`squash` / `merge` / `rebase`, optional `delete_branch`; requires `confirm: true`).
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### 2. `github_run`: Actions CI Pipeline & Failure Diagnostics (Agent Auto-Fix Core)
|
|
98
|
+
> **Example Agent Prompts**:
|
|
99
|
+
> - *"Why did the latest Actions workflow fail? Extract failed step logs and fix the code."*
|
|
100
|
+
> - *"Show me the status of the last 5 CI runs in this repository."*
|
|
101
|
+
> - *"Rerun the failed workflow from earlier."*
|
|
102
|
+
|
|
103
|
+
* **Supported Actions**:
|
|
104
|
+
* `log_failed` (π₯ **Killer Feature**): **Optimized for Agents**; automatically extracts isolated error logs from failed steps for instant root-cause analysis;
|
|
105
|
+
* `list`: View recent workflow runs and conclusions (`branch` / `status: failure` filters to pin down broken builds);
|
|
106
|
+
* `view`: Inspect jobs and steps for a specific run ID;
|
|
107
|
+
* `trigger`: π Manually dispatch `workflow_dispatch` workflows to verify fixes immediately;
|
|
108
|
+
* `rerun`: Re-trigger failed CI runs;
|
|
109
|
+
* `cancel`: Cancel in-progress workflows.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### 3. `github_issue`: Issue Tracking & Closed-Loop Tasks
|
|
114
|
+
> **Example Agent Prompts**:
|
|
115
|
+
> - *"File an issue for the memory leak we just reproduced, labeled 'bug' and 'backend'."*
|
|
116
|
+
> - *"List all open issues assigned to me."*
|
|
117
|
+
> - *"Comment on Issue #45: 'Fixed on master branch, awaiting verification'."*
|
|
118
|
+
> - *"Close Issue #45."*
|
|
119
|
+
|
|
120
|
+
* **Supported Actions**:
|
|
121
|
+
* `list`: Query issues with flexible filters (`state` / `labels` / `assignees` / `limit`);
|
|
122
|
+
* `view`: Read issue body and discussion history;
|
|
123
|
+
* `create`: Create new issues (title, body, labels, assignees);
|
|
124
|
+
* `edit`: π Update title, body, and add/remove labels;
|
|
125
|
+
* `develop`: π Create a linked development branch from an issue and check it out locally;
|
|
126
|
+
* `comment`: Append debugging updates or notes;
|
|
127
|
+
* `close` (requires `confirm: true`) / `reopen`: Manage issue lifecycle states.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### 4. `github_repo`: Repository Exploration & Cross-Repo Code Search
|
|
132
|
+
> **Example Agent Prompts**:
|
|
133
|
+
> - *"Search for usages of 'createPrTool' across this repository."*
|
|
134
|
+
> - *"Search GitHub for popular open-source repositories related to 'dsh-plugin'."*
|
|
135
|
+
> - *"Show repository metadata and star count for cli/cli."*
|
|
136
|
+
|
|
137
|
+
* **Supported Actions**:
|
|
138
|
+
* `view`: View repository metadata (default branch, stars, description, topics & license);
|
|
139
|
+
* `sync`: π One-click fork sync with upstream to fix stale-fork CI gate failures;
|
|
140
|
+
* `search_code`: Search code symbols in current or specified repositories;
|
|
141
|
+
* `search_repos`: Search open-source GitHub repositories globally.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### 5. `github_api`: Low-Level Escape Hatch
|
|
146
|
+
> **Example Agent Prompts**:
|
|
147
|
+
> - *"Call GitHub API to fetch latest releases of current repository and parse tag names with jq."*
|
|
148
|
+
|
|
149
|
+
* **Core Strength**: Call any GitHub REST or GraphQL API using local credentials with `--jq` filtering, `raw` text mode, and `paginate` auto-aggregation.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### 6. `github_release`: Version Releases & Build Asset Delivery π
|
|
154
|
+
> **Example Agent Prompts**:
|
|
155
|
+
> - *"Publish v0.2.0 for this repository with auto-generated release notes."*
|
|
156
|
+
> - *"Upload dsh-github-flow-0.2.0.tgz to the v0.2.0 release."*
|
|
157
|
+
|
|
158
|
+
* **Supported Actions**:
|
|
159
|
+
* `list` / `view`: Browse release history and per-version details (assets, notes);
|
|
160
|
+
* `create`: Create releases (`generate_notes` auto-notes, `draft` / `prerelease` flags, attach assets directly);
|
|
161
|
+
* `upload` / `download`: Upload `.tgz` build artifacts or download assets by glob pattern;
|
|
162
|
+
* `delete` (requires `confirm: true`): Delete a release, optionally cleaning up its tag.
|
|
44
163
|
|
|
45
164
|
---
|
|
46
165
|
|
|
47
|
-
|
|
166
|
+
### 7. `github_secret`: CI/CD Secrets Management π
|
|
167
|
+
> **Example Agent Prompts**:
|
|
168
|
+
> - *"Update the NPM_TOKEN secret for this repository."*
|
|
169
|
+
> - *"Show which secrets are configured for this repo."*
|
|
170
|
+
|
|
171
|
+
* **Supported Actions**:
|
|
172
|
+
* `list`: Show secret names and update times (the GitHub API never exposes secret values);
|
|
173
|
+
* `set`: Set/update secret values β **passed via subprocess stdin, never on the command line (ps-safe), never echoed in output**;
|
|
174
|
+
* `delete` (requires `confirm: true`): Remove a secret.
|
|
175
|
+
* Supports repository / organization (`org`) / environment (`env`) scopes across `actions` / `codespaces` / `dependabot` / `agents` apps.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### 8. `github_skill`: Cross-Agent Open-Source Skills Discovery π
|
|
180
|
+
> **Example Agent Prompts**:
|
|
181
|
+
> - *"Search GitHub for an Agent Skill about code review."*
|
|
182
|
+
> - *"Preview that skill's content, then install it to this project if it looks good."*
|
|
183
|
+
|
|
184
|
+
* **Supported Actions**:
|
|
185
|
+
* `search`: Search open-source `SKILL.md` skills across GitHub (Code Search based, ranked by stars);
|
|
186
|
+
* `preview`: Read-only preview of skill content before installing β nothing touches disk;
|
|
187
|
+
* `install` (requires `confirm: true`): Install to local agent hosts (Claude Code / Cursor / Copilot and 50+ others), `project` or `user` scope;
|
|
188
|
+
* `list`: List all skills installed on this machine.
|
|
189
|
+
* Requires the official `gh skill` preview feature in GitHub CLI 2.9x+.
|
|
48
190
|
|
|
49
|
-
|
|
50
|
-
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### 9. `github_help`: Meta Guide & Troubleshooting Hub π
|
|
194
|
+
> **Example Agent Prompts**:
|
|
195
|
+
> - *"I'm not sure which GitHub tool to use for this task."*
|
|
196
|
+
> - *"How do I write advanced GitHub search syntax?"*
|
|
197
|
+
|
|
198
|
+
* **Core Capabilities**:
|
|
199
|
+
* Task-routing navigation across all 9 tools;
|
|
200
|
+
* Official advanced search syntax cheat sheet (date ranges, status qualifiers, code search scopes);
|
|
201
|
+
* Self-healing recipes for common errors (403 rate limits, 422 missing params, stale forks, outdated CLI);
|
|
202
|
+
* Direct passthrough to the official `gh help <command>` offline manual.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## π‘οΈ Safety Guardrails
|
|
207
|
+
|
|
208
|
+
* **Destructive-action double confirmation**: `merge`, `close`, `release delete`, clobber uploads, `secret delete`, and `skill install` require an explicit `confirm: true` parameter; without it, only an impact assessment is returned β nothing executes. This prevents accidental merges or deletions from model hallucinations.
|
|
209
|
+
* **Secret stdin channel**: Secret values travel via subprocess stdin β never on the command line (ps / task-manager safe), never persisted, never echoed; gh encrypts locally with the repository public key before uploading.
|
|
210
|
+
* **Command-injection immunity**: All gh invocations use `execFile` array-argument isolation with zero shell string concatenation.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## π₯οΈ Native Web UI Workspace & Settings Center
|
|
215
|
+
|
|
216
|
+
No more window switching! Seamlessly integrated into DSH with DSW design tokens and instant light/dark theme adaptation.
|
|
217
|
+
|
|
218
|
+
### 1. Global Cockpit (Main Navigation Slot)
|
|
219
|
+
Access via the GitHub icon in the main left navigation:
|
|
220
|
+
* **β‘ 0ms Instant Render (SWR Persistent Cache)**: Powered by local snapshot persistence; say goodbye to full-screen 8~15s spinner freezes and enjoy instant dashboard loading;
|
|
221
|
+
* **π¦ 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)]` β `[β οΈ Timeout, cached data preserved]`);
|
|
222
|
+
* **Account-Wide Overview**: Live view of all cloud repositories, default branches, and star counts;
|
|
223
|
+
* **Local Workspace Matrix**: Automatically detects open projects and bridges local directories with remote repos;
|
|
224
|
+
* **3D Issue Governance Matrix**: Categorizes issues into *"π₯ User Reported"*, *"π― Assigned to Me"*, and *"βοΈ Created by Me"* with responsive pill filters;
|
|
225
|
+
* **Update Notification Banner**: Smoothly glides down when an update is available with one-click automated upgrade.
|
|
51
226
|
|
|
52
227
|
<p align="center">
|
|
53
228
|
<img src="./docs/images/1.png" alt="GitHub Global Cockpit" width="100%" />
|
|
54
229
|
</p>
|
|
55
230
|
|
|
56
|
-
### Session Right Sidebar Panel (
|
|
57
|
-
|
|
231
|
+
### 2. Session Right Sidebar Panel (Workspace Drawer)
|
|
232
|
+
Located in the right drawer of every chat workspace:
|
|
233
|
+
* **Context Auto-Binding**: Automatically locks onto the active Git repository;
|
|
234
|
+
* **Freshness Pill Alignment**: Compact indicator `[π¦ Local Snapshot (2m ago)]` with live `[π Refresh]` button, 100% aligned with global rules;
|
|
235
|
+
* **PR Status Pills**: Live PR inspection with CI checks and review badges;
|
|
236
|
+
* **Workspace Open Issues List**: Direct issue task review with author badges and external links;
|
|
237
|
+
* **Latest Actions Pipeline**: Real-time CI workflow status tracking;
|
|
238
|
+
* **Quick Action Grid**: Open repo in browser, jump to Issues/PRs, create PRs with one click.
|
|
58
239
|
|
|
59
240
|
<p align="center">
|
|
60
241
|
<img src="./docs/images/2.png" alt="Session Right Sidebar Panel" width="100%" />
|
|
61
242
|
</p>
|
|
62
243
|
|
|
244
|
+
### 3. Settings Center (Settings Modal)
|
|
245
|
+
Click **`[βοΈ Settings]`** in the top right of the Cockpit to open the sectioned settings modal (left-side navigation, independently scrolling content; collapses to horizontal tabs on narrow screens):
|
|
246
|
+
|
|
247
|
+
**π Data Sync Section** β tune data fetching rhythm:
|
|
248
|
+
* **Two Sync Strategies**:
|
|
249
|
+
* **β‘ Instant Render (SWR, Recommended)**: Instantly displays local cache (0ms), then silently syncs the latest state within 300ms β no matter how stale the cache is, opening the panel self-heals to fresh data;
|
|
250
|
+
* **π Manual Only (Energy Saver)**: Browse local cache only; zero background `gh` processes triggered; click `[π Refresh]` whenever you want updates.
|
|
251
|
+
* **Visual Cache Management**: Real-time snapshot size and timestamp visibility with one-click `[ποΈ Clear Cache]`.
|
|
252
|
+
|
|
253
|
+
**π Network Proxy Section** β route all plugin traffic through your proxy:
|
|
254
|
+
* **Global Scope**: Once configured, the cockpit, right-sidebar panel, all 9 Agent tool invocations, and one-click upgrades route through the proxy; when disabled, system environment proxies (`HTTPS_PROXY` etc.) or direct connections apply;
|
|
255
|
+
* **Protocol Support**: `http://` / `https://` / `socks5://` / `socks5h://` (gh and npm chains natively support SOCKS5; `socks5h` delegates DNS resolution to the proxy for stronger pollution resistance; the npm version probe uses Node fetch which does not support SOCKS β it stays direct and the UI states this honestly);
|
|
256
|
+
* **`[π§ͺ Test Connectivity]`**: One-click latency probe against the GitHub API through the current proxy;
|
|
257
|
+
* **Instant Effect**: Persisted to `~/.dsh/data/dsh-github-flow/proxy.json` (auto-restored on DSH restart) β no restart, no plugin reload;
|
|
258
|
+
* **Visibility**: A `π Proxy` badge appears in the cockpit title bar while active; hover to inspect the current proxy URL;
|
|
259
|
+
* **NO_PROXY Exclusions**: `localhost` and `127.0.0.1` are forcibly included β loopback Web API requests are never hijacked by the proxy.
|
|
260
|
+
|
|
261
|
+
| π Data Sync Section | π Network Proxy Section |
|
|
262
|
+
| :---: | :---: |
|
|
263
|
+
|  |  |
|
|
264
|
+
|
|
63
265
|
---
|
|
64
266
|
|
|
65
|
-
##
|
|
267
|
+
## β‘ Smart Upgrades & Cross-Platform Engine
|
|
66
268
|
|
|
67
|
-
|
|
269
|
+
Never miss an update! Built-in industrial-grade update management:
|
|
68
270
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
271
|
+
1. **Business-First, Idle Background Detection**:
|
|
272
|
+
- Primary PR/Issue data loads and renders **instantly in milliseconds**;
|
|
273
|
+
- Update checks run **1.5 seconds later during idle periods**, ensuring zero impact on user workflows.
|
|
274
|
+
2. **Dual-Registry Acceleration**:
|
|
275
|
+
- Prioritizes npmmirror for ultra-fast checks (50~150ms in mainland regions) with seamless fallback to official npmjs.
|
|
276
|
+
3. **Cross-Platform One-Click Upgrade**:
|
|
277
|
+
- **Click to Upgrade**: Click **`[β‘ Upgrade]`** in the UI to update in the background;
|
|
278
|
+
- **Auto OS Adaptation**: Differentiates macOS and Windows; auto-injects Homebrew PATH variables on macOS GUI launches;
|
|
279
|
+
- **Source Protection**: Automatically aborts npm overwrites when running in local Git linked development mode (`link:`);
|
|
280
|
+
- **Restart Guidance**: Clearly notifies users to restart DSH service to reload backend tools, with instant web refresh options.
|
|
72
281
|
|
|
73
|
-
|
|
74
|
-
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## β±οΈ SWR Instant Render & Sync Rhythm Control
|
|
285
|
+
|
|
286
|
+
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:
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
Initial Mount (0ms) ββββββββββ> Instantly render local persistent snapshot
|
|
290
|
+
β
|
|
291
|
+
βββ SWR Mode: Idle 300ms delay, silently revalidate in background
|
|
292
|
+
βββ Manual Mode: Browse offline snapshot, only fetch on click [π Refresh]
|
|
75
293
|
```
|
|
76
294
|
|
|
77
|
-
|
|
295
|
+
### Strategy Comparison & Recommendations:
|
|
78
296
|
|
|
79
|
-
|
|
297
|
+
| Sync Strategy | Mechanism | Recommended Use Case |
|
|
298
|
+
| :--- | :--- | :--- |
|
|
299
|
+
| **β‘ Instant Render (SWR, Default)** | **0ms instantaneous mount** from local cache, silently revalidating in background within 300ms β however stale the snapshot, opening the panel self-heals to fresh data. | **Recommended for all developers**. Eliminates spinner freezes, delivering seamless UX. |
|
|
300
|
+
| **π 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. |
|
|
80
301
|
|
|
81
|
-
|
|
82
|
-
|---|---|---|
|
|
83
|
-
| `github_pr` | `list`, `view`, `create`, `diff`, `checks`, `review`, `merge` | Inspect PR details, verify CI checks, conduct code reviews, merge pull requests |
|
|
84
|
-
| `github_issue` | `list`, `view`, `create`, `comment`, `close`, `reopen` | Search and view issues, create issues, add comments |
|
|
85
|
-
| `github_run` | `list`, `view`, `log_failed`, `rerun`, `cancel` | Monitor Actions workflows; `log_failed` extracts failure logs for automatic fixes |
|
|
86
|
-
| `github_repo` | `view`, `search_code`, `search_repos` | Query repository metadata, search cross-repo code |
|
|
87
|
-
| `github_api` | Any GitHub REST / GraphQL endpoint | Universal escape hatch for custom queries (supports `--jq`, plus a `raw` response-body mode) |
|
|
302
|
+
* **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!**
|
|
88
303
|
|
|
89
304
|
---
|
|
90
305
|
|
|
91
306
|
## π¬ Human Slash Commands
|
|
92
307
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
308
|
+
Type directly into the DSH chat box:
|
|
309
|
+
|
|
310
|
+
* `/gh status`: Diagnostics for GitHub account authentication, scopes, repository binding, and plugin version;
|
|
311
|
+
* `/gh upgrade`: Check latest npm version with platform-adapted upgrade commands;
|
|
312
|
+
* `/gh help`: View command usage and Agent prompt examples.
|
|
96
313
|
|
|
97
314
|
---
|
|
98
315
|
|
|
99
|
-
## βοΈ Configuration
|
|
316
|
+
## βοΈ Configuration (`cordis.patch.yml`)
|
|
100
317
|
|
|
101
|
-
|
|
318
|
+
Works out of the box, with optional tweaks in `cordis.patch.yml` or your profile:
|
|
102
319
|
|
|
103
320
|
```yaml
|
|
104
321
|
- insert:
|
|
105
322
|
- id: github-flow
|
|
106
323
|
name: dsh-github-flow
|
|
107
324
|
config:
|
|
108
|
-
ghPath: 'gh' #
|
|
109
|
-
defaultTimeoutMs: 30000 #
|
|
110
|
-
maxOutputChars: 24000 #
|
|
111
|
-
maxOutputBytes: 96000 #
|
|
112
|
-
|
|
113
|
-
|
|
325
|
+
ghPath: 'gh' # GitHub CLI executable path
|
|
326
|
+
defaultTimeoutMs: 30000 # Command timeout in milliseconds (default 30s)
|
|
327
|
+
maxOutputChars: 24000 # Safe output character ceiling (Token protection)
|
|
328
|
+
maxOutputBytes: 96000 # Safe UTF-8 byte ceiling (default maxOutputChars * 4)
|
|
329
|
+
defaultListLimit: 20 # Default list size for pr/issue/run/release/skill queries
|
|
330
|
+
cacheTtlMs: 15000 # Repository overview cache TTL (default 15s)
|
|
331
|
+
checkUpdate: true # Enable automatic update checks (default true)
|
|
332
|
+
updateCheckIntervalMs: 86400000 # Check interval in ms (default 24h)
|
|
333
|
+
registryUrl: '' # Custom private npm registry URL
|
|
334
|
+
proxyUrl: '' # Preset proxy default (e.g. 'http://127.0.0.1:7890'; only applies before the cockpit setting is saved β UI setting takes precedence)
|
|
114
335
|
```
|
|
115
336
|
|
|
116
|
-
> On Web panel refresh cadence: a global cockpit refresh runs a dozen or so `gh` calls
|
|
117
|
-
> (measured 8-13 s on a local machine), so it caches for 5 minutes and re-fetches when you
|
|
118
|
-
> click "π Refresh global data". The workspace matrix only reads local `.git/config` to
|
|
119
|
-
> identify repository ownership and makes no network requests. The `/gh status` command
|
|
120
|
-
> always bypasses the auth cache, so you see the real state immediately after `gh auth login`.
|
|
121
|
-
|
|
122
337
|
---
|
|
123
338
|
|
|
124
|
-
## π Ecosystem
|
|
339
|
+
## π Ecosystem Extensibility (Cordis Service)
|
|
125
340
|
|
|
126
|
-
|
|
341
|
+
Provides standard Cordis service `ctx.github`. Other plugins can reuse it directly:
|
|
127
342
|
|
|
128
|
-
```
|
|
343
|
+
```typescript
|
|
129
344
|
import type { Context } from '@deepseek-ai/cordis';
|
|
130
345
|
|
|
131
346
|
export const inject = ['github'];
|
|
132
347
|
|
|
133
348
|
export function apply(ctx: Context) {
|
|
134
|
-
// Directly invoke the underlying secure execution engine via ctx.github
|
|
135
349
|
const auth = await ctx.github.checkAuth();
|
|
136
350
|
const repo = await ctx.github.getRepoMetadata();
|
|
351
|
+
const prs = await ctx.github.run(['pr', 'list', '--json', 'number,title']);
|
|
137
352
|
}
|
|
138
353
|
```
|
|
139
354
|
|
|
@@ -141,11 +356,14 @@ export function apply(ctx: Context) {
|
|
|
141
356
|
|
|
142
357
|
## π Documentation
|
|
143
358
|
|
|
144
|
-
- [npm Publishing &
|
|
145
|
-
- [Architecture &
|
|
359
|
+
- [npm Publishing & Automated CI Guide](./docs/npm-publish-guide.md)
|
|
360
|
+
- [Architecture & Technical Specifications](./docs/architecture.md)
|
|
146
361
|
|
|
147
362
|
---
|
|
148
363
|
|
|
364
|
+
## Friendship links
|
|
365
|
+
- [LINUX DO - A new ideal community](https://linux.do/)
|
|
366
|
+
|
|
149
367
|
## π License
|
|
150
368
|
|
|
151
|
-
|
|
369
|
+
Open-sourced under the [MIT License](./LICENSE). Contributions, PRs, and Issues are welcome!
|