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.
Files changed (65) hide show
  1. package/README.en.md +287 -69
  2. package/README.md +290 -68
  3. package/docs/architecture.md +71 -14
  4. package/docs/images/1.png +0 -0
  5. package/docs/images/2.png +0 -0
  6. package/docs/images/3.png +0 -0
  7. package/docs/images/4.png +0 -0
  8. package/docs/npm-publish-guide.md +12 -0
  9. package/lib/api/route-helpers.d.ts +47 -0
  10. package/lib/api/route-helpers.js +134 -0
  11. package/lib/api/routes-actions.d.ts +9 -0
  12. package/lib/api/routes-actions.js +115 -0
  13. package/lib/api/routes-lifecycle.d.ts +9 -0
  14. package/lib/api/routes-lifecycle.js +75 -0
  15. package/lib/api/routes-overview.d.ts +11 -0
  16. package/lib/api/routes-overview.js +227 -0
  17. package/lib/api/routes-proxy.d.ts +18 -0
  18. package/lib/api/routes-proxy.js +63 -0
  19. package/lib/api/routes.d.ts +17 -5
  20. package/lib/api/routes.js +18 -417
  21. package/lib/client.js +1179 -40
  22. package/lib/commands/gh.d.ts +2 -1
  23. package/lib/commands/gh.js +40 -3
  24. package/lib/executor.d.ts +17 -0
  25. package/lib/executor.js +40 -2
  26. package/lib/main.d.ts +12 -0
  27. package/lib/main.js +73 -4
  28. package/lib/proxy.d.ts +87 -0
  29. package/lib/proxy.js +275 -0
  30. package/lib/renderers/markdown.d.ts +24 -0
  31. package/lib/renderers/markdown.js +493 -0
  32. package/lib/tools/api.d.ts +4 -0
  33. package/lib/tools/api.js +14 -4
  34. package/lib/tools/help.d.ts +31 -0
  35. package/lib/tools/help.js +212 -0
  36. package/lib/tools/issue.d.ts +32 -1
  37. package/lib/tools/issue.js +94 -17
  38. package/lib/tools/pr.d.ts +22 -1
  39. package/lib/tools/pr.js +67 -15
  40. package/lib/tools/release.d.ts +89 -0
  41. package/lib/tools/release.js +219 -0
  42. package/lib/tools/repo.d.ts +13 -1
  43. package/lib/tools/repo.js +46 -14
  44. package/lib/tools/run.d.ts +22 -1
  45. package/lib/tools/run.js +74 -14
  46. package/lib/tools/secret.d.ts +60 -0
  47. package/lib/tools/secret.js +175 -0
  48. package/lib/tools/skill.d.ts +63 -0
  49. package/lib/tools/skill.js +146 -0
  50. package/lib/types.d.ts +57 -0
  51. package/lib/updater.d.ts +49 -0
  52. package/lib/updater.js +169 -0
  53. package/lib/upgrade-manager.d.ts +58 -0
  54. package/lib/upgrade-manager.js +309 -0
  55. package/lib/version.d.ts +13 -0
  56. package/lib/version.js +13 -0
  57. package/package.json +3 -2
  58. package/lib/client/icons.d.ts +0 -13
  59. package/lib/client/icons.js +0 -41
  60. package/lib/client/index.d.ts +0 -3
  61. package/lib/client/index.js +0 -36
  62. package/lib/client/panel.d.ts +0 -1
  63. package/lib/client/panel.js +0 -102
  64. package/lib/client/style.d.ts +0 -1
  65. 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>Modern, native GitHub workflow integration plugin for DeepSeek Harness (DSH) powered by GitHub CLI (<code>gh</code>).</b><br>
12
- Deeply connects local Git repository development with remote GitHub collaboration (PRs, Issues, Actions CI diagnosis, and code reviews), featuring Agent model tools, human slash commands, and dual native Web UI views.
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
- ## 🌟 Key Features
22
+ ## 🎯 Why `dsh-github-flow`?
22
23
 
23
- 1. **Zero-Configuration Authentication**:
24
- - Seamlessly reuses existing host credentials from `gh auth login` (OAuth tokens / system Keyrings) without exposing plain-text Personal Access Tokens (PATs) in DSH.
25
- 2. **Deep Workspace Affinity & Zero-Config Detection**:
26
- - Automatically scopes commands to the active session workspace by natively reading local `.git/config` and mapping DSH `workspace.json`. Enhanced with Git repository validation, parent-child directory auto-penetration, and session ID propagation to eliminate misidentification, so neither models nor humans need to supply redundant `owner/repo` arguments.
27
- 3. **High Signal-to-Noise Ratio & Token Budget Protection**:
28
- - Consolidates over 70+ scattered micro-tools into **5 focused domain tools**.
29
- - Queries use `--json <fields>` projections by default; long diffs and failed CI logs are safely truncated (default 24KB) to protect the model's context window.
30
- - All tool outputs are defensively normalized into root objects to strictly comply with DSH Tool Gateway schema validation.
31
- 4. **Dual Native Web UI Views & Multi-Dimensional Task Governance**:
32
- - **Global Cockpit** (`sidebar.panellist`, Order 20): Account-wide repository overview, local workspace matrix mapping, and a reconstructed **3-dimensional Issue aggregation engine** ("User Reported" / "Assigned to Me" / "Created by Me") featuring 4-state filter pills and role badges.
33
- - **Right Sidebar Panel** (`sidebarRightTabs`, Order 40): Shows current repository status, PR list with CI check pills, **active workspace issues list** (with author attribution, role badges, labels, and external links), Actions pipelines, and quick action shortcuts (Open Repo, View All Issues, View All PRs, Create PR, New Issue) with zero popup dependencies.
34
- - **Native Light/Dark Dual-Theme Adaptation**: Deeply aligned with DSH official DSW (DeepSeek Web) design tokens, seamlessly reacting to `body[data-ds-dark-theme]` without lag or flickering.
35
- 5. **Robust Environment Diagnosis & Three-State Setup Engine**:
36
- - Zero-guesswork onboarding: Accurately differentiates `NOT_INSTALLED` (`Missing`), `NOT_LOGGED_IN` (`Required`), and `AUTHENTICATED` (`Active`).
37
- - OS-aware installation guides: Auto-detects platform (Windows/macOS/Linux) and suggests native package manager commands (`winget install --id GitHub.cli`, `brew install gh`) with official installer links.
38
- - Interactive helpers: One-click command copying and security-whitelisted terminal launcher.
39
- - **Focus Auto-Recovery**: Automatically detects authorization completion when returning to the DSH window, transitioning to full workspace view without manual page reloads.
40
- 6. **Standard Cordis Microkernel Compliance**:
41
- - Exposes native `GitHubService` (`ctx.github`) for ecosystem extensibility;
42
- - Strongly typed runtime validation via Standard Schema (`Config`);
43
- - Domain event broadcasting (`github/pr:create`, `github/issue:create`).
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
- ## πŸ“Έ UI Previews
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
- ### Global Cockpit (Main Navigation)
50
- Overview of account-wide repositories, local workspace matrix mapping, and multi-dimensional categorized issues (supports filter pills across All, User Reported, Assigned, and Created with status badges):
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 (In-Session Collaboration)
57
- Automatically detects current workspace repository, displaying live PR checks, workspace open issues list, Actions pipelines, and quick action shortcuts:
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
+ | ![Settings Center Β· Data Sync](./docs/images/3.png) | ![Settings Center Β· Network Proxy](./docs/images/4.png) |
264
+
63
265
  ---
64
266
 
65
- ## πŸš€ Installation
267
+ ## ⚑ Smart Upgrades & Cross-Platform Engine
66
268
 
67
- Run in your DSH terminal to install directly from npm:
269
+ Never miss an update! Built-in industrial-grade update management:
68
270
 
69
- ```bash
70
- # Install to desktop profile
71
- dsh plugin --profile desktop add dsh-github-flow
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
- # Or install to web profile
74
- dsh plugin --profile web add dsh-github-flow
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
- ## πŸ› οΈ Agent Tools Reference
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
- | Tool Name | Actions | Typical Use Cases |
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
- In any DSH chat prompt:
94
- - `/gh status`: Check current GitHub CLI authentication status, granted scopes, and active repository;
95
- - `/gh help`: Display quick reference and help information.
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
- Customize options in your `cordis.patch.yml` or profile:
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' # Custom path to gh binary
109
- defaultTimeoutMs: 30000 # Timeout in milliseconds
110
- maxOutputChars: 24000 # Maximum characters per output (Token guard)
111
- maxOutputBytes: 96000 # Hard UTF-8 byte ceiling per output, defaults to maxOutputChars * 4
112
- cacheTtlMs: 15000 # Single-repo overview cache TTL (ms); the global cockpit caches for 20x this, floor 5 minutes
113
- defaultListLimit: 20 # Default page size
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 Service Extension (Cordis Service)
339
+ ## πŸ”Œ Ecosystem Extensibility (Cordis Service)
125
340
 
126
- Other DSH plugins can consume GitHub CLI capabilities via dependency injection:
341
+ Provides standard Cordis service `ctx.github`. Other plugins can reuse it directly:
127
342
 
128
- ```ts
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 & Maintenance Guide](./docs/npm-publish-guide.md)
145
- - [Architecture & Design Specifications](./docs/architecture.md)
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
- This project is licensed under the [MIT License](./LICENSE).
369
+ Open-sourced under the [MIT License](./LICENSE). Contributions, PRs, and Issues are welcome!