dsh-bili-scroll
c1overzz
DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:AlanWYChen/dsh-github-actions
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A DSH Web bundle that shows, live, the GitHub Actions workflow runs that are currently running or queued for the workspace selected in the Harness UI, plus a Recent list of the last finished runs, when that workspace is connected to a GitHub repository. Clicking any run opens it on GitHub.
The package ships both halves:
src/index.js) — resolves the workspace checkout, reads GitHub over
HTTPS, presents seven authenticated /api/githubActions.* RPC routes, and
keeps the OAuth access token on the Host only.src/client.js) — a "GitHub Actions" sidebar panel and main page,
registered through the Harness module loader. It talks to the Host only
through the authenticated /api bridge and polls the snapshot while mounted
and visible.snapshot of the selected workspace.git remote -v, and picks the GitHub remote (a remote with upstream tracking
evidence first, then origin, then declaration order).GET .../actions/runs?per_page=50, keeping only
queued, in_progress, requested, waiting, pending, newest first,
capped at 20, cached per repository for refreshMs;GET .../actions/runs?status=completed&per_page={historyLimit},
newest completedAt first, capped at historyLimit, cached independently
for historyRefreshMs.
A history-only failure never fails the snapshot: the last finished list (or
an empty one) is kept and a historyWarning is added. A 401 on either read
still signs the user out.pollMs while the page is mounted and the
document is visible. The page always shows two sections: Running (runs
that are still active) and Recent (the finished runs, each with a
conclusion pill such as Success, Failed, or Timed out). Clicking or pressing
Enter/Space on a row opens the run on GitHub in a new tab.The panel remembers the last selected workspace in browser localStorage (key
github-actions.workspace, best-effort). It also keeps a session-only in-memory
snapshot cache per workspace (at most 20 entries, never persisted): returning to
a workspace renders its last snapshot immediately while a background refresh
runs, and a workspace with no cache shows a localized "Loading runs…" status.
Pressing Refresh starts a cold reload: the previous list is cleared, the same
localized "Loading runs…" state is shown, one forced read bypasses the Host
caches, and the refresh control spins while that read is in flight; on failure
the error surface and banner replace the list instead of restoring stale rows.
The header shows one workspace select (always the workspace title) followed by
a button-like GitHub control containing the repository owner/name and icon.
The panel fills its host height: Running is bounded and Recent takes the
remaining space and scrolls internally.
Authentication uses the GitHub OAuth device flow, so there is no client secret, no redirect handling, and no password typed into the panel. The token is stored in the Host credential store and is never sent to the browser.
DSH GitHub Actions.http://127.0.0.1:3080 (this profile's DSH Web GUI
origin).http://127.0.0.1:3080. The device flow
never redirects, so it is never used; GitHub only requires the field to be
non-empty. (Do not leave it blank — GitHub rejects the form.)device_flow_disabled (HTTP 400) from
begin.Ov23lioKDGMGDQLQXTIz). No client secret is needed.If device flow is disabled: GitHub answers
beginwith HTTP 400 and{"error":"device_flow_disabled"}. The plugin surfaces this as thedevice-flow-disablederror code, and the page shows an actionable banner with a one-click link to https://github.com/settings/developers. Tick Enable Device Flow on the app, click Update application, then retry.If you enabled token expiry anyway: tokens last 8 hours (GitHub shows the expiry on the app settings page) and the device flow returns no refresh token. After expiry the panel's reads fail with
auth-required; recover by signing out in the panel and signing in again.
From this repository:
# inside the DSH profile that runs http://127.0.0.1:3080
dsh plugin add "/path/to/dsh-github-actions"
or install the bundle from the Web GUI's plugin manager by pointing it at this
directory (the package is @local/dsh-github-actions). The bundle inserts one
Host row:
- insert:
- id: github-actions
name: '@local/dsh-github-actions'
After enabling the bundle, the GitHub Actions entry appears in the sidebar (order 30). Open it.
clientId configured, the setup surface appears. Paste the OAuth App
Client ID into the input and press Save. This persists the value
through githubActions.setClientId into the plugin config row — no YAML
editing and no Host restart required.userCode and an
Open GitHub link. Enter the code on GitHub and authorize the app.slow_down). When authorization completes, the account login
appears and the run list loads.GitHub answers githubActions.begin with HTTP 400 and
{"error":"device_flow_disabled"} when the OAuth App does not have device flow
enabled. The Host reports this as the actionable device-flow-disabled error
and the panel shows a one-click link to the app settings.
If you enabled Expire user access tokens, the token lasts 8 hours and device flow returns no refresh token. Sign out in the panel and sign in again. For a long-lived prototype, disable token expiry (see above).
All fields are optional; the defaults are shown.
| Key | Default | Meaning |
|---|---|---|
clientId |
'' |
GitHub OAuth App client ID. Empty means sign-in cannot start and the panel shows setup instructions. |
scopes |
'repo' |
Space-separated OAuth scopes. Add read:user if needed; repo is required for private-repository visibility. |
host |
'github.com' |
GitHub host used for remote parsing and web URLs (GitHub Enterprise is configurable but not exercised in v1). |
apiBaseUrl |
'https://api.github.com' |
GitHub REST base URL. |
refreshMs |
3000 |
Host-side per-repository active-runs cache TTL. |
pollMs |
5000 |
Client poll interval; clamped to be at least refreshMs. |
timeoutMs |
10000 |
Per GitHub HTTP request timeout. |
historyLimit |
20 |
How many finished runs the Recent section shows (integer, clamped to 1–100); also the per_page of the history read. |
historyRefreshMs |
15000 |
Host-side per-repository finished-runs cache TTL, independent of refreshMs. |
Example row config:
- id: github-actions
name: '@local/dsh-github-actions'
config:
clientId: 'Ov23lioKDGMGDQLQXTIz'
scopes: 'repo'
host: 'github.com'
apiBaseUrl: 'https://api.github.com'
refreshMs: 3000
pollMs: 5000
timeoutMs: 10000
historyLimit: 20
historyRefreshMs: 15000
Every route is POST /api/githubActions.<method>, registered with
methods: ['POST'] and requestBody: 'buffered' on the authenticated /api
bridge. Requests use the client-request envelope and answers use the
server-response envelope; a malformed or mismatched envelope is HTTP 400 with
a short text body, and a malformed payload is ok:false with
error.code: 'invalid-input'.
| Method | Payload | Value |
|---|---|---|
status |
{} |
AuthStatus |
begin |
{} |
{deviceCode, userCode, verificationUri, expiresIn, interval} |
poll |
{} |
{state:'authorized', auth} | {state:'pending', interval} | {state:'expired'} | {state:'denied'} |
cancel |
{} |
AuthStatus |
signOut |
{} |
AuthStatus |
snapshot |
{workspaceId, refresh?} |
Snapshot |
setClientId |
{clientId} |
AuthStatus |
Snapshot carries both lists: runs (active only) and history (finished runs,
newest completedAt first, at most historyLimit). refresh: true bypasses
both host caches. When only the history read fails, the response still succeeds
with the previous history (or []) and a historyWarning string; the Client
renders that warning above the Recent rows.
Error codes: no-client-id, auth-required, rate-limited,
github-unreachable, no-git, workspace-missing, not-signed-in,
invalid-input, internal, config-unavailable, and the actionable
device-flow-disabled.
github-actions/oauth). It is never returned to the Client, never included in
an RPC error, and never logged./api bridge; there is no
unauthenticated route.workspaceId, refresh,
clientId), with hand-rolled validation and no extra dependency.owner/name/host are validated against GitHub-safe characters before
being interpolated into a URL or a git invocation.execFile with a scrubbed environment and a timeout; the
plugin spawns no shell.historyLimit
and never paginated beyond that.defaultBranch is always null (v1 makes no extra API call).host/apiBaseUrl is not exercised.source: 'manual') is modeled but not exposed.The only runtime dependency is schemastery (declared in package.json and
resolved from the DSH install/profile; the workspace node_modules/schemastery
dev symlink is not packaged). Everything else uses Node built-ins and the global
fetch.
node scripts/run-tests.mjs all CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。