Skip to content

fix(client): restore the GitHub card and add an editable token field - #30

Merged
PerryLink merged 5 commits into
PerryLink:mainfrom
fishdivinity:fix/github-card-029
Oct 27, 2026
Merged

PerryLink merged 5 commits into
PerryLink:mainfrom
fishdivinity:fix/github-card-029

Conversation

@fishdivinity

Copy link
Copy Markdown
Contributor

Checklist

  • pnpm run typecheck && pnpm test && pnpm run build && pnpm run check:readmes is green (200 passed, 3 skipped)
  • Tests cover the configured token source and the volatile field
  • CHANGELOG.md has an entry under ## [Unreleased]
  • All five READMEs updated (config table and the token paragraph)
  • Fixes #29
  • No credentials, tokens or private paths in the diff

Summary

Fixes #29.

On DSH 0.2.1 the host half works but the card never mounts: the browser half still declares the browser-side credentials remote, which 0.2.1 removed. A pending client entry is a fatal web boot there, and the defensive variant returned before ctx.slots.register, so the card disappeared without an error.

Two further contracts moved with it: plugins.item now hands the entry a form shaped { state, mutate }, not getSnapshot() / subscribe(); and settings.describe() serves a namespace only when its Config exposes a .volatile() field, which dsh-github did not have.

The card now reads and writes the page-supplied form, registers on plugins.item unconditionally, and renders through the shipped SettingsForm / SettingsSecretField, with a short guide to the classic and fine-grained token pages. Config.githubToken is the new .volatile() field, read through its live reference per operation; tokenSource gains a config member that auto tries first.

The tradeoff worth a decision: the token now sits in the profile configuration as plain text, which this plugin previously avoided by writing through the credentials seam. The browser has no credentials remote on 0.2.1, so a UI-editable token has to live in configuration today. Happy to switch to a host-side remote if you prefer that direction.

Two small pieces ride along: a .gitattributes pinning eol=lf (on Windows with core.autocrlf=true, every lib/ file a build rewrote showed as modified with no content change), and the README/CHANGELOG updates the doc gate requires for the new config key.

DSH 0.2.1 serves a settings namespace only for a plugin whose Config
carries at least one volatile() field. dsh-github had none, so the
settings service skipped the whole namespace and the GitHub row had no
editable form at all.

githubToken is now that field. tokenSource also gains a config member
that auto tries before the credentials file, the environment and the
gh CLI, so a token saved on the page is what the host resolves.

A volatile field hands the plugin a live reference instead of the
stored string, and a Settings write updates that reference in place.
liveValue() reads it on every operation, which is also what makes a
saved token apply without reloading the plugin.

Refs PerryLink#29
The browser half required the browser-side credentials remote, which
DSH 0.2.1 removed: @deepseek-ai/dsh-credentials exports no ./remote,
and nothing else provides that namespace. The client entry therefore
stayed pending, which 0.2.x treats as a fatal web boot, and the
defensive variant returned before ctx.slots.register, so no card ever
appeared in the Plugins panel.

The card now reads and writes the form the page supplies, whose shape
is { state, mutate } rather than the getSnapshot/subscribe pair the old
controller assumed. It registers on plugins.item unconditionally and
renders through the shipped SettingsForm and SettingsSecretField, so
themes and installed skins restyle it.

The page body adds a short guide to the two GitHub token pages. The
summary line stays a plain description, because the list render
supplies no form to read a state from. dsh.client.inject drops the
client packages the card no longer imports.

Refs PerryLink#29
lib/ is generated by tsc and is therefore always LF, while core.autocrlf=true checks everything else out as CRLF. After every build, all 31 lib files tsc rewrote showed up as modified with no content change. The attribute makes the checkout bytes match the build output.
@PerryLink
PerryLink merged commit 5bfde13 into PerryLink:main Oct 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: no GitHub card in the Plugins panel on DSH 0.2.1 — the browser half still requires the removed credentials remote

2 participants