Commit Graph
11 Commits
Author SHA1 Message Date
Willie 2bc791ed19 perf(plugin): check every plugin at once and skip sources that did not move (#812)
* perf(plugin): check every plugin at once and skip sources that did not move

The Plugins page's update check read every Agent CLI, cloned and hashed
every source, and asked npm about every package one after another, so it
grew with each plugin added. A single Agent CLI that stopped answering
held the whole page at "Checking for updates" with no way to tell which
plugin was stuck.

The check now asks every Agent and checks every plugin at the same time.
Plugins share one read of each Agent and each source, so an Agent with
many plugins is still asked once, and a plugin waits only on its own
Agents, including when proving its own leftover installs. Before downloading a remote source with no pinned ref, the
check asks the remote which commit its default branch points at with
`git ls-remote` and reports no update when that is the installed commit.
A check of three unchanged GitHub plugins on two Agents went from 4.3s
with three clones to 0.6s with none.

The dashboard reads the check from a new stream, GET
/api/plugins/check/stream, that sends each plugin as soon as it is
checked. The page marks rows as they arrive and counts progress in the
header. The stream stops waiting after 60 seconds: a plugin bound to an
Agent that has not answered by then shows "Check failed" with the
reason, and plugins on other Agents are unaffected. There is no limit on
how many plugins run together, because plugins waiting on a hung Agent
would otherwise hold every slot and starve the rest.

A cancelled command did not return when the Agent CLI was a shim that
starts the real client, such as an npm, mise or volta wrapper: killing
the shim left the child holding its output, so the command waited until
the child exited and no timeout took effect. Commands now stop waiting
for output two seconds after they are cancelled; a command that exits on
its own while a helper keeps its output open still counts as answered.

* fix(ui): offer every update the Plugins page shows in the update dialog

The header counted updates from the per-plugin marks, but the update
dialog offered only the targets in the last completed check's plan. Two
cases left the header saying Update N with nothing to tick in the dialog:
a first check that broke off after finding an update never set the plan,
and a recheck that could not reach an Agent kept that Agent's earlier
update while the plan said blocked.

The dialog's plan is now derived from each plugin's last answer together
with the kept updates, so a kept update stands in for the blocked or
missing answer and both always agree. A broken-off check also keeps the
answers it did receive.
2026-11-09 15:06:55 +08:00
Willie e9dc4d0360 feat(server)!: answer only at localhost, IP addresses and trusted origins (#811)
DNS rebinding lets a page point its own domain at the user's machine,
which makes its requests same-origin to the dashboard, so the CSRF
guard cannot refuse them. Only the MCP, Hooks and Plugins routes
required a localhost or IP Host, so such a page could still install,
sync and push. That rule also blocked those three pages for people who
run the dashboard behind their own reverse proxy (#809).

The dashboard now answers every route only at localhost, an IP address,
the --host name, and origins given with --trusted-origin or
SKILLSHARE_UI_TRUSTED_ORIGINS. Configuration stays outside config.yaml
so the dashboard cannot widen its own trust through its config API. A
trusted origin must match the Host with its scheme, and an Origin
header, when sent, must be that origin. A refused browser gets a page
with the exact setting to copy, the API gets it in the error, and the
server log names each refused Host once.

BREAKING CHANGE: a dashboard opened by a domain name, such as a reverse
proxy, a Tailscale or mDNS name, or a Docker service name, now returns
403 on every page until that address is trusted, for example with
`skillshare ui start --trusted-origin https://skills.example.com`.

Release-As: 0.30.0
2026-11-09 11:59:50 +08:00
Willie 6a9e9efbe2 fix(server): release the config lock before slow plugin, Pi and MCP reads (#747)
Every /api/ request reloads config under the write lock of s.mu. The
Plugins page's inventory (Agent CLIs) and update check (network) held
the read lock for their whole run, and Go's RWMutex makes later readers
queue behind a waiting writer. Switching pages or reloading while a
check ran froze the whole dashboard until the check finished.

Build each service under the read lock and release it before the slow
work: plugin list, discover and preview; Pi extensions view and
preview, which run the Pi CLI; and MCP check, which looks up hosts and
probes servers live. Writes still take the write lock, and apply paths
still compare revisions, so a read that races a write is refused at
apply time rather than applied.
2026-11-02 15:13:01 +08:00
Rusty Shackleford da3383ed5f fix(plugins): separate shared intent from local installation state (#660)
* fix(plugins): separate shared intent from machine-local receipts

Shared configs currently carry native paths, reviewed snapshots and pending
failures, so one host can publish local progress over another host's target
selection. Persist versioned declarations separately from local applied and
pending receipts, and reconcile reviewed installs, imports and cleanup against
this machine's native inventory without rewriting intent during sync/update.

Keep snapshot names and adapter safeguards, move the operation lock locally,
validate legacy adoption with local evidence, and invalidate approval on local
state or native-context changes. Preserve source recipes after native adoption,
require local import for absent native-only targets, and document the shared
writer upgrade boundary in schemas and translated references.

Cover two-host behavior, generated legacy fixtures, failure/recovery, stale
intent, cleanup, npm recipes and the existing CLI/API/UI consumers with focused
resource-capped tests. Fixes #651.

* fix(plugins): preserve intent and ownership across host transitions

Repeat-add must retain shared target selection, and update previews must resolve
the requested ref before reviewing fresh or replacement installs. Keep disabled
targets on the uninstall path and reject refs unsupported by native-only/npm
intent before they can produce invalid shared declarations.

Block changed-context add/import before Pi registration preparation so a new
account cannot overwrite the old receipt. Preserve unresolved legacy bindings
as passive private proof candidates before rewriting shared YAML, retaining
original intent/store for later verified adoption and cleanup. Never compose
these hints as executable state, and persist their explicit resolution.

Cover the five review classes, native/private failure boundaries, requested-ref
retry, and original-context hint proofs with isolated focused regressions.
Keep local format v1 and baseline account validation unchanged. Refs #651.

* fix(plugins): allow receipt-only orphan cleanup to complete

An installation already removed on this host can retain a local receipt when
another host removes or replaces shared intent. Sync correctly plans forget,
but native command verification rejects that metadata-only action and blocks
all targets before the receipt can be cleared.

Exclude forget from native command verification while retaining host inventory
checks and OMP scoped cleanup preparation. The existing completion path then
persists receipt deletion, including pending work and passive legacy hints.

Cover the cross-host disable/re-enable/remove walk, five native adapters,
failed work with a legacy hint, and absent source replacement alongside a
healthy target. Assert Apply completion, unchanged shared bytes/mtime, and a
quiet second sync. Refs #651.

* fix(plugin): reconcile ref intent across inventory consumers

Validate explicit ref changes before disabled targets can save them and reuse
one reviewed discovery throughout a preview. Surface shared ref changes as local
reconciliation work while preserving the applied native identity and receipts.

Reuse scoped legacy proofs for Pi extension ownership and make full inventory
the dashboard's authoritative package/host pair. Cover invalid and replacement
refs, read-only ownership, and shared-state properties without new persisted
state or dependencies.

* test(plugin): repair and consolidate host-state fixtures

Create source intent and a pending imported Claude update through supported
operations so direct and batch updates exercise the intended fixture. Keep the
marketplace-loss case locally owned before testing its skipped reinstall.

Consolidate cross-host repeat-add and requested-ref replacement/orphan retries
at their existing owners, retaining failure recovery and shared-byte checks.
Trim duplicate HTTP and translated-text assertions from consumer tests.

* fix(plugin): reconcile legacy snapshot reads and native imports

Resolve legacy snapshot ownership through existing scoped proofs before listing,
reading or discovering cached source files. Keep adoption read-only and limit
proof work to the requested package and targets; current receipts need no CLI.

Only preserve reviewed source metadata on reimport when intent remains source
managed. Native-only intent must not resurrect an older Git source after a
same-ID local import. Retain identity mismatch and reviewed-source safeguards.

Remove the unused source-folding helper left by the old shared runtime writer.

* Preserve reviewed package versions locally

* Fix reviewed package version lifecycle

* fix(plugin): report missing local imports in doctor

Show the local-import instruction instead of claiming a skipped imported
plugin is healthy. Preserve the missing-CLI warning and shared config bytes.

Keep fixture native settings inside scratch XDG directories and serialize
the fake CLI calls used by concurrent inventories. Update assertions to
separate shared declarations from local versions and native IDs, and align
the raw-write audit with private plugin state and operation locks.

* test(plugin): use declarations for doctor source fixture

The missing-CLI case has no native ID, so encode it with the version 2
declaration schema. Keep the native-only import case in legacy syntax.

* fix(plugin): install shared sources from reviewed snapshots

When a source target is already declared, first sync must install its
reviewed local snapshot even if the native client has a package from the
same marketplace. Keep explicit add adoption and native-only import intact.

Extend the existing two-host adoption check to cover an independent native
installation on the second host and verify a quiet subsequent sync.

* fix(plugin): preserve reviewed retries and native collision boundaries

Retry a pending source update through the existing reviewed update path,
so a rolled-back native failure cannot clear progress at the old snapshot.
Record default-source versions for add, sync, and update while retaining
the recipe fingerprint and generic-version checks for target overrides.

Keep explicit native adoption, but block shared Claude sources when an
independent same-name native plugin could shadow their hooks. Extract the
existing adoption decision so the preview function becomes smaller.

* test(plugin): respect OMP update safety in version control

Check generic and target versions during review, then confirm the existing
OMP upgrade guard preserves the installed and default-source versions.

* fix(plugin): declare first local native imports explicitly

A first local import into a shared source target now changes that target
to native-only intent while preserving its sync selection. Verified source
reimports retain their reviewed source and the preview discloses conversion.

Cover the explicit import, local sync, and other-host cleanup flow, and
remove the unconsumed internal observation assertion from the OMP test.

* docs(plugin): explain first local import intent changes

Describe the shared native-only target conversion and its effect on other
machines, while distinguishing verified source reimports.

* fix(plugin): verify checked sources before native reinstalls

A checked update that becomes an install after native removal must still
match the source digest the user approved. Reject moved or unchecked
sources before native work, and allow a stable approved reinstall.

Clear completed reinstalls from dashboard update availability while keeping
failed targets available for retry. Cover both native presence states in
the existing checked-update tests and the dashboard outcome rule.

* fix(plugin): guard replacement before cleanup

* fix(plugin): refresh discovery for each manager action

A later Add action must review the current source even when the manager
previously observed that source. Keep discovery sharing across one action
while ending its cache before the next wizard invocation.

Exercise a fresh source version after an earlier Add preview without TTY
input or native writes, using an unavailable client to stop at review.

* test(plugin): cover desired checks and final update outcomes

Consolidate checked batch approval and dashboard completion tests while
retaining removed-native, digest, version and approval controls. Reproduce
stale shared recipes and failed or unfinished replacement installs.

* test(plugin): make stale source discovery observable

Remove the old repository before native-only and npm desired checks so
those existing cases cannot pass by reading the applied source.

* fix(plugin): check desired source and final outcome

* test(plugin): bind checked updates to the observed recipe

Reproduce a shared candidate change with equal version, commit and digest,
and preserve a freshly checked replacement whose native ID differs. Use
actual check observations in approval and native update controls, reject
missing source identity, and verify the UI carries the observation through.

* fix(plugin): bind checked update to source recipe

* fix(ui): classify npm recipes as Pi packages

* fix(plugin): retain legacy removal intent during migration

Omit pending removals from shared declarations while retaining original local ownership proof so sync retries cleanup.

Verification: focused regression passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): keep imports local to an existing shared recipe

Adopt a native installation into its local receipt without converting the shared source target or removing other machines installations.

Verification: focused import regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): capture legacy evidence on first read

Persist passive hints before another machine writes v2 and save verified adoption on reads. Apply reuses preview receipts instead of querying every legacy binding again. Document the per-machine pre-migration read.

Verification: migration regressions passed in isolated Linux Codex container runs, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): target named declarations in interactive imports

Offer unresolved package names in dashboard and TUI imports and pass the selected name in single and batch requests. Drop display-only rendered assertions.

Verification: 47 UI tests passed with at most four workers in an isolated Linux Codex container, not the devcontainer.

* fix(plugin): localize shared intent plan guidance

Add message keys for local imports, account changes, cleanup and native collisions across all dashboard locales. Localized guidance contains no CLI flags.

Verification: failing localization regression now passes in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* refactor(plugin): reuse preview inventory and guard apply boundaries

Capture hints on first load without persisting in-memory adoption during preview, keeping approval revisions stable. Apply reuses preview inventory. Reuse accountEnv and guard applyChange plus native write boundaries without inspecting argv.

Verification: migration, receipt, account and sync regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* test(plugin): organize host state coverage around lifecycle scenarios

Group migration, ref drift, account context and cleanup tests behind shared host fixtures and public Preview/Apply assertions. Cover Codex, Cursor, Antigravity and project scopes; add second-machine doctor coverage and the two-machine runbook. Consolidate package-version tests and remove the unused private-record fixture.

Verification: focused plugin regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* docs(plugin): explain local imports and per-machine migration

Document local receipts, per-machine review and commit pinning, config-path state identity and the required legacy read on every machine. Align sharing, doctor, troubleshooting, file-layout and four translated plugin references; restore schema editing guidance.

Verification: context-router check passed. Runtime verification uses an isolated Linux Codex container, not the devcontainer.

* refactor(plugin): separate unrelated review scope

Move project OMP configuration, plugin list ordering, and npm Pi classification to independent local branches based on upstream/main. Keep the shared intent change focused and cover named import selection in the pure flow helper.

The three local branches have passing builds in a Linux Codex container, not the devcontainer, with isolated test homes and capped parallelism.

* perf(plugin): avoid recapturing v2 state on reads

Only compare and persist passive migration hints when legacy bindings exist. Native v2 reads need no state serialization for migration.

Verification: pending removal and first-read/import regressions passed in a Linux Codex container, not the devcontainer, with isolated HOME/XDG/TMPDIR and GOMAXPROCS=4 GOFLAGS=-p=4.

* docs(plugin): clarify native marketplace repair after import

A local import receipt is not a reviewed reinstall source. Correct the remaining troubleshooting instruction and its four translations to require native-client repair, and align the nearby code comment.

Validation: checked against prepareChange, context-router check and git diff --check passed. Verification for this review ran in a Linux Codex container, not the devcontainer.

* fix(plugins): preserve local ownership across shared intent changes

Retain completed legacy migration markers so unchanged v1 YAML cannot
uninstall a later manual reinstall. Serialize read-side hint persistence
with native operations and keep local imports when shared recipes change.
Require explicit dashboard import names and validate recipe identities.

Correct schema descriptions, messages, CLI ref status, translated migration
guidance and runbooks. Add failing-first Preview/Apply regressions and a
real two-ssenv CLI lifecycle script.

* fix(plugins): preserve migration history and show retained import guidance

Mark existing legacy hints and receipts as captured before cleanup so state
from the previous serializer cannot re-adopt a later manual installation.
Keep recipe-change guidance in unchanged sync outcomes and visible dashboard
rows, and resolve nested OpenCode entries through their package manifest.

Cover public migration, ref, account, import and message contracts across
adapters. Correct the real two-host Cursor assertions, explicit dashboard
selection flow, and remaining localized guidance.

* fix(plugins): retain explicit OpenCode entry during import matching

Standalone OpenCode packages can rely on a reviewed explicit entry rather
than an SDK dependency. Preserve that entry when reading native package
identity so matching nested imports remain supported.

* fix(plugins): preserve migrated imports and verify native entry identity

Recognize older native-only receipts by their existing declaration
fingerprint so remote source recipe edits cannot replace migrated imports.
Keep managed npm receipts distinct through their source fingerprints.

Only borrow an ancestor OpenCode package identity when its resolved entry
is the actual registered file. Retain nested and explicit entry support.
Add public two-host migration and mismatching-entry regressions.

* fix(plugins): retain imported ownership through repeated adds

Persist inferred imported ownership when a matching add refreshes the
receipt intent, so later shared recipe changes still preserve local
native installations. Keep the legacy replacement regression aligned
with that ownership contract while retaining removed-intent cleanup.

Reject missing or unstatable absolute OpenCode entries before identity
matching rather than falling back to the file name. Cover both paths
through public Preview and Apply regressions.

* test(plugins): isolate OpenCode adapter fixtures from host config

Keep native registration fixtures inside their fake agent home by setting
XDG_CONFIG_HOME and clearing inherited OpenCode overrides. Ambient config
writes can otherwise leak into config-discovery tests in other packages.

Cover the XDG, file, directory and inline override cases with temporary
config sentinels, while retaining the existing MCP listing expectation.

* fix(plugin): let local imports return to the shared source

Add a local unimport action that removes only this machine’s installation and receipt while preserving the shared source declaration. Keep retained-import guidance visible across matching adds, list, doctor and dashboard consumers.

Avoid idle OMP guidance and unchanged legacy-read locks, preserve localized errors, keep import identity checks offline, and normalize OpenCode drive URLs. Cover the A/B transition and align translations, runbooks and environment cleanup.

* fix(plugin): complete unimport validation and guidance

Reject missing targets before planning local unimports and share per-target eligibility with the wizard. Make native uninstall effects explicit in help and translated docs, preserve structured update guidance, and cover error paths and shell completion.
2026-10-31 04:23:20 +08:00
Willie 99c7911bf3 feat(plugins): update a batch of plugins over one stream (#534)
Updating several plugins from the dashboard was slow: each plugin took a
preview and an apply round trip, apply previewed again, every plugin cloned
its source on its own, and config reloaded after each one.

The dashboard now sends the picks to POST /api/plugins/update/stream. The
server holds the plugin lock once, previews each plugin once and applies that
plan, lets plugins from one source share a single read of it, and reloads
config once at the end. POST /api/plugins/update/stop lets the plugin under
way finish and starts no other; a closed page does not cut an install short.

The check-to-update safety moves to the server: an Agent whose source moved
since the check, or that no check showed, installs nothing. npm packages in
Pi are exempt, since Pi installs whatever npm names latest; the old
client-side comparison flagged them as moved on every update.

The update dialog follows the Skills update page, shows per-Agent old -> new
versions, fails rows a broken stream never finished, and lists every plugin
with its Agent and version when all are current.

Release-As: 0.25.6
2026-10-12 16:09:12 +08:00
Willie 56b4f79ac4 fix(plugin): find global owners of inherited Pi packages in project mode
Codex review on #399: a dashboard started in project mode gives the
plugin service the project's config, so a global Pi package that
Skillshare installed, inherited by the project, found no owner and its
card fell back to the state path again. The earlier test kept
ConfigPath on the global config and missed this.

The service now takes the global config path in project mode, and the
project view looks up inherited global entries there.
2026-10-04 23:08:33 +08:00
Willie 886e3672a2 feat(plugin): run a compatible CLI for an account target
Pi forks such as omo keep Pi's directory layout and commands but ship
their own executable, so an account target pointed at one still ran
`pi` for plugin commands. A shell alias cannot help, since Skillshare
runs the CLI without a shell.

An account target can now set `cli` (or `target add --cli`) to a name
on PATH or an absolute path. Pi accounts also export
SENPI_CODING_AGENT_DIR and OMO_CODING_AGENT_DIR, which omo reads before
PI_CODING_AGENT_DIR. A missing CLI fails instead of falling back, and a
missing working directory is no longer reported as a missing CLI.

Refs #307
2026-10-01 15:50:43 +08:00
Willie 36a314442b refactor(server): decode JSON request bodies through one size-limited helper
About 57 handlers decoded request bodies with no size limit, and the few
that had one each picked their own. They now go through decodeJSON with a
1 MiB default; handlers that need more keep their larger limit. An
oversized body gets 413 instead of whatever the handler returned for bad
JSON (MCP and plugin requests used to answer 400). Every other decode
error keeps the handler's existing status and message.
2026-09-30 02:25:42 +08:00
Willie c25eb4f708 fix(plugins): open managed plugins from their snapshot and explain slow reads
Opening a plugin cloned its whole source again to learn which Agents
can take it, which took tens of seconds per row. A managed plugin
already has a reviewed snapshot; it answers when its digest still
matches, and the network is used only otherwise.

A failed clone said only that git failed. Git's output is sorted into
an unreachable source or a missing one without passing it on, since it
can hold credentials. The dashboard translates those, notes when a read
or an Agent's CLI is slow, and says when the browser is offline.
2026-09-27 23:03:21 +08:00
Willie bb57a9af9c feat(targets): add account targets for a second Claude, Codex or Pi config directory
A target declared with `agent` and `config_dir` is another config directory of a
built-in Agent, such as a second Claude account. Its skills and agents paths are
derived from the Agent's defaults at load time, so the config only records the
directory. The same target name works for MCP (written in the Agent's format into
the account's own file), for plugins (the Agent CLI runs with CLAUDE_CONFIG_DIR,
CODEX_HOME or PI_CODING_AGENT_DIR) and for `mcp import --from`. Removing such a
target warns when MCP config still names it instead of failing later at sync.

The dashboard gains an "another account" mode in the add-target dialog and lists
accounts next to the Agents on the MCP and plugin pages.

Refs #289
2026-09-22 11:21:35 +08:00
Willie 4bcd569e25 feat: MCP connections, plugins and a redesigned dashboard (v0.21.0) (#285)
* feat(mcp): sync portable server configuration across six clients

Add inline and external MCP sources with guided CLI and dashboard setup, native imports, conflict previews, ownership tracking, backups, and restore. Support Claude Code, Codex, Cursor, VS Code, OpenCode, and Grok CLI in global and project scopes.

Format YAML on save, document MCP fields in the config assistant, and keep its layout stable for scalar list items. Include schemas, localized UI copy, documentation, and regression and end-to-end coverage.

* fix(config): keep loading config when the MCP section is invalid

A mistake in the mcp section (an unknown key, a targets value that is
not a list, an invalid server field) made config.Load, LoadProject,
Save, SaveIn and ValidateConfig fail. Every command that reads config,
including skills sync, install, list and the dashboard, stopped working
because of settings it never uses.

MCPConfig now keeps a section that does not parse exactly as written and
records the error instead of returning it, so commands unrelated to MCP
load and save the config without touching that section. MCP commands
still validate their source on every run, and the dashboard config
editor calls the new ValidateMCP, so saving an invalid MCP section there
is still rejected.

Also correct the ProjectSources comment: sources.mcp resolves from the
directory containing config.yaml, not from the project root.

* fix(mcp): protect Agent files during concurrent edits and recovery

A release review of the MCP sync engine found ways it could lock users
out, report false conflicts, or change entries it does not own.

Recovery
- A failed write left pending.json behind, and every later MCP command
  refused to run. Failed writes now remove their journal, and a journal
  whose Agent file changed again is discarded, because ownership hashes
  still flag entries that no longer match.
- Preview no longer writes. It reads the ownership that recovery will
  record, byte for byte, so a preview stays valid across the recovery
  that the next write performs under the lock.

Concurrent Agent writes
- Claude Code rewrites ~/.claude.json on its own, so hashing whole files
  expired previews and failed applies. Revisions and pre-write checks
  now cover only the MCP entries, and apply rereads each file and applies
  the previewed entry edits to its current content, keeping settings the
  Agent wrote after the preview.

Comparison and ownership
- Only fields Skillshare renders are hashed, after dropping defaults
  Agents add or omit (type stdio/http, empty env, args or headers,
  enabled: true) and header name case, so equivalent entries are not
  reported as drift. enabled and disabled are compared, so turning off a
  managed server is a conflict instead of being overwritten.
- An unmanaged entry that already matches the source is reported as
  unchanged but no longer claimed, so removing the server never deletes
  an entry the user wrote. Import adopts it explicitly, and without
  --replace refuses to rewrite a differing entry, such as a literal token
  that import turned into an environment reference.
- Sync keeps Agent-only fields such as timeouts in existing entries.

Import
- Agent-only fields become warnings instead of blocking the import.
- streamable-http is accepted, and enabled/disabled flags are checked
  for every client.
- Values carrying a URL password, such as database DSNs, become
  environment references, and credential-like arguments are flagged.

Writes and state
- Save only renders the definition first, so a server that could never
  sync, such as one without targets, is rejected before it is saved.
- A symlinked config.yaml is written through to its target.
- TOML entries are updated in place, keep CRLF line endings, and repeated
  add/remove cycles no longer grow blank lines.
- JSON edits no longer HTML-escape characters such as &.
- GROK_HOME is honored.
- Backups keep the newest 20 per Agent file, pruned by file name, and
  damaged backup files are skipped instead of failing the list.
- GET /api/mcp no longer fails when an Agent that no server uses has an
  unresolvable path.

* feat(mcp): detect the client format of pasted JSON

Import without --from, the add wizard and the dashboard import API
assumed Claude's mcpServers shape unless a client was named, so VS Code
"servers" and OpenCode "mcp" snippets copied from server docs failed to
import. The client is now chosen by the top-level key, and a bare server
object still reads as Claude's single-entry shape.

TOML stays explicit because Codex and Grok share the format; a .toml
file without --from is still read as Codex.

* refactor(mcp): print CLI results through internal/ui

MCP commands wrote plain fmt output and duplicated statusFromErr, unlike
every other command. Plans, backup IDs and save/apply messages now use
the shared ui helpers, so they get the standard status prefixes and
colors; each change line shows the server name, action and target. The
operation log uses statusFromErr. --json output is unchanged.

* fix(server): serve MCP settings only to localhost or IP hosts

MCP settings include stdio commands that Agents execute, so a web page
must not be able to read or change them. The existing Origin check does
not stop DNS rebinding: once an attacker's domain resolves to 127.0.0.1,
the browser sends that domain as both Origin and Host from a loopback
address, and the dashboard also binds 0.0.0.0 in Docker.

Rebinding always needs a domain name, so every MCP route now also
requires a Host that is localhost or an IP literal, whatever the bind
address. Other dashboard routes are unaffected. Opening the dashboard
through a domain name, including a reverse proxy, therefore returns 403
for MCP settings; the message says to use localhost or an IP address,
because rewriting Host at the proxy would still fail the Origin check
and would reopen the hole.

Remove the unused POST /api/mcp/sync endpoint. Configuring with sync
covers it, and the guard wraps every remaining MCP route.

* fix(sync): make sync --all report MCP results reliably

- "sync -g mcp" and "sync --dry-run mcp" ran skills sync, because mcp
  was only recognized as the first argument. It now matches in any
  position.
- sync --all --json printed plain-text errors when the MCP preflight
  failed, and only an error on conflicts. Preflight errors now use the
  JSON error shape, and conflicts also return the credential-free plan so
  scripts can see which entries conflict.
- When resource sync failed, MCP was skipped without notice. Text output
  now warns that MCP settings were not applied; JSON output omits the mcp
  field, which --all otherwise always includes.
- MCP was applied with the preflight revision, which failed whenever the
  resource sync changed config or state in between. It is now planned
  again under the MCP lock, and conflicts found then still stop the
  write.

* fix(sync): recognize agents and extras after flags

sync only checked the first argument for a resource kind, so
"sync --dry-run agents" and "sync -g extras" silently synchronized
skills instead. Sync flags take no values, so the kind now matches in
any position.

The shared parseKindArg keeps its first-argument rule: uninstall, update
and similar commands accept resource names, and a name such as "agents"
must not be read as a kind.

* feat(ui): redesign the MCP dashboard around a server-by-agent matrix

The MCP page listed servers and planned changes as flat text, which made
it hard to see where each server is written and what needs attention.

- A matrix shows each server's status per Agent, summarizes pending
  changes and conflicts, and can hide synced entries. Agents whose MCP
  file or config directory exists are marked as detected; GET /api/mcp
  now returns the detected clients.
- Setup is a two-step dialog: add a remote URL, paste JSON or TOML, or
  import from an Agent, then preview which Agent files change. Importing
  an entry the Agent already has adopts it, Replace overrides only that
  entry, and a target selection equal to the inherited mcp.targets is
  saved without pinning targets on the server.
- Conflicts explain their cause and offer Import from <agent> or
  Replace. Removal lists the affected Agent files and offers removing
  from the source only or removing and syncing. Backups are grouped by
  day, with a preview before restoring a file.
- Agent icons appear on the MCP and Targets pages, and the universal
  target is marked as a path shared across agents. Brand icons come from
  @lobehub/icons-static-svg, with bundled SVGs for Warp and Zed.
- Segmented controls wrap instead of overflowing narrow containers.
- New copy is translated for every supported locale.

* fix(ui): let Sync all apply MCP after syncing resources

Sync all previewed MCP, synced skills, agents and extras, then applied
MCP with the revision from the first preview. When the resource sync
changed config or state, that revision was stale and MCP failed with
"preview again" after everything else had already been synced.

MCP is now rechecked before and after the resource sync by comparing the
reviewed changes (target, name and action) instead of the revision, and
applied with the fresh revision. A different set of changes still stops
before any MCP file is written.

* fix(ui): keep flow-style YAML collections when saving config

Formatting on save forced every collection into block style, so a
hand-written "targets: [claude, codex]" was expanded into a list each
time the config was saved. Each collection now keeps its flow or block
style, indentation is still normalized and comments are preserved, and
flow collections are not padded with spaces.

* docs(mcp): document ownership, normalization and dashboard host rules

- Explain that matching entries stay unmanaged until imported, so
  removing a server leaves them in place, and that import adopts an
  identical entry while --replace rewrites a differing one.
- Note that Agent defaults and header case are not treated as changes,
  that disabling a managed server is a conflict, and that previews stay
  valid while an Agent rewrites unrelated settings.
- Describe Agent-specific fields, streamable-http, GROK_HOME, backup
  retention, recovery by the next MCP write, and the VS Code limitation
  on environment references in headers.
- Document that MCP settings require opening the dashboard by localhost
  or an IP address, with SSH port forwarding for remote machines.
- Update the built-in skill for all six clients and the adoption rule,
  and the MCP runbook for import refusal, Agent-specific fields and
  pulled changes.

* docs(skill): streamline guidance and refresh resource workflows

Keep the built-in skill entrypoint focused and route agent and MCP details to dedicated references. Correct scope, audit, automation, and recovery guidance against the current CLI.

* feat(ui): redesign the dashboard around two styles and a flatter layout

The dashboard had grown page by page, so the same idea looked different
depending on where you met it and pages held controls with nothing to act on.
This rebuilds it on one token set that drives both the Clean and Playful styles
in light and dark, and reshapes the pages around what a person actually does.

Notable changes:

- MCP: replace the server-by-agent matrix with one row per server. The agents a
  server writes to are chips inside the row, so the list grows downwards as more
  CLIs gain MCP support instead of scrolling sideways.
- Settings: collect General, Backup, Log, Health, Extensions and Files into one
  page. The Files tab keeps a panel beside the editor showing what the field
  under the cursor does, the file's shape, or the unsaved changes.
- Audit rules: the YAML editor gets the same panel, plus a Test tab that runs a
  rule's regex against pasted lines.
- Skills and Agents become separate pages; install, search, updates and trash
  move into them. Old routes redirect.
- Tour: rewrite every step's copy, add MCP and Install steps, and anchor each
  step to a control that is always rendered so no step silently times out.
- Give every button a pointer cursor; the browser default does not say a button
  is clickable and each component class had to opt in by hand.

Docs follow the new Settings tabs and the MCP list.

* chore(devcontainer): move dev servers to uncommon ports

5173, 19420 and 8888 are defaults that other projects on the same
machine already hold, so `make devc` failed to bind and the container
never started. Use 45173, 49420 and 48888 instead, identical inside and
outside the container so every banner, log and doc prints the URL that
actually works.

* feat(ui): link dashboard source counts to their pages

The counts in the playful dashboard's source note named a number but led
nowhere, so reaching Skills or MCP from there meant going back to the
sidebar. Each row is now a link to its own page.

The hover fill uses currentColor because .ss-pinnote.src overrides the ink
tokens for the yellow note.

* feat(ui): build and browse hubs from the dashboard

A hub is a JSON index that lists skills, and until now the web UI could
only consume one someone else had already hosted. Writing the index by
hand was the only way to produce one, and the two halves never met: the
dialog that searched hubs and the page that would have built one shared a
config file but nothing else.

The new /hubs page holds both halves behind two tabs:

  Browse   pick a hub, filter its contents by tag or text, install from it
           without leaving the page
  My hubs  assemble an index from installed skills, validate it, export it

A draft is offered as a source in Browse straight away, read from the
draft API rather than a file, so you can see what a recipient sees before
deciding whether to host anything. Where the index is hosted is stored on
the draft and stripped from the exported document, so a reopened hub
remembers where it was published and the published file stays clean.

Hub management moves out of the install dialog, which keeps only the
search-source dropdown and links here.

Routing switches to createBrowserRouter for useBlocker, which guards the
builder against navigating away from unsaved entries.

* docs(extras): add shared instructions recipe for AGENTS.md across agents

Answers a recurring question about sharing one instruction file between AI
agents: extras already covers it, since each agent keeps its user-level
copy in its own directory and one extra can target all of them.

Naming the source file AGENTS.md rather than something neutral matters —
Codex concatenates AGENTS.md files and has no import syntax, so it only
recognises the file by name. Claude Code and Antigravity read a fixed
filename of their own but resolve @-imports, so a one-line CLAUDE.md or
GEMINI.md picks up the synced file.

Says plainly that this is not agent memory. Agents keep their own
learnings in private stores — a Markdown directory for Claude Code, a
database for Codex, non-file storage for Cursor — so that side is a
migration problem, not something syncing files can solve.

* feat(ui): filter skills and agents by target

The Targets column showed which targets a resource reaches, but there was
no way to narrow the list down to one. The filter reads the sync matrix —
the same source that column renders — so a result always matches the icons
the rows show.

Options and counts are derived from the matrix, so no target is offered
that would filter to nothing, and the control stays hidden until at least
two targets have something. A selected target that disappears on a kind
switch or an uninstall falls back to All rather than emptying the list.

The toolbar had 24px to spare at 1440px, so the new control wrapped the
row. Source moves from a 325px segmented control to a dropdown like its
neighbours, and every filter now sizes to its label instead of a fixed
width that truncated the longer values.

* fix(ui): tighten page headers and reach hubs from skills

PageHeader carried mb-7 while .ss-wrap already separates its children with a
28px flex gap. Margins and flex gaps add up rather than collapse, so every
page inside the wrapper opened with a 56px hole under its title. Move the
default onto .ss-pgh so the wrapper can zero it, keeping the 28px for pages
that lay out their own children.

Hubs is a source you install from and a catalog you publish, not inventory
you own, so it no longer sits in the Library group next to Skills, Agents and
Plugins. The Skills page header already links to it and the page already
carries a back link there. Skills stays highlighted while the hub page is
open. Plugins takes the Package icon its own page identifies with, so the
sidebar no longer shows two identical puzzle pieces.

* fix(skill): stop implement-feature from running --no-tui as a command

The dispatch-order note wrote "not --no-tui" as !`--no-tui`. In a skill file
that is the syntax for running a shell command at load time, so the skill died
with "command not found: --no-tui" before any of it could be read. Spell the
condition out in words instead.

* feat(list): toggle model invocation for a skill with M

The only cheap gesture in the list TUI was E, which hides a skill from every
harness. Wanting a skill installed but not auto-loaded meant leaving the TUI
to edit SKILL.md, so people disabled skills they only meant to make
manual-only. M flips disable-model-invocation in place and the detail panel
shows a "manual only" badge so the state is never a blind toggle.

Unlike E this edits the skill file, which upstream may own: update skips
tracked repos with local changes, and reinstalling a skill drops the edit. M
says so and asks before writing in those cases. The flag is written as a
single-line edit rather than a YAML round-trip, and turning it back off
removes the line, so two presses return the file byte for byte and a tracked
repo is clean again. Agents are left alone; their harnesses do not read the key.

Refs #283

* feat(plugin): manage complete plugins across agent tools

Add CLI, TUI, and web flows for discovery, adoption, sync selection, updates, and removal while preserving native package formats and unrelated installations.

Support Claude, Codex, Cursor, Antigravity desktop, Pi, and OpenCode. Update help, completions, built-in skill, and documentation; keep plugins outside sync --all.

* docs(skill): describe the redesigned dashboard in the style skill

The style skill still documented the pre-redesign hand-drawn system, so
pages written with it came out on legacy tokens and outside the ss-*
classes; the new Plugins page was the first casualty.

The rewrite names tokens and classes and points to components.css for
their values, because copied values are what went stale last time. The
ui command docs described Playful by the old look as well.

* fix(ui): keep Playful ghost buttons free of stray shadows

The hover and disabled rules outranked the ghost variant's
box-shadow: none, so a frameless button grew a lone shadow arc in
Playful. Bulk toolbar and toast buttons shared the problem.

Ghost also gets a soft outline in Playful: beside 2px ink frames a bare
label such as Cancel did not read as a button.

* refactor(ui): lay out the Plugins page like the MCP page

The page was built on legacy tokens and plain markup, so it missed the
Playful frames and drifted from every other page. A per-agent column
layout would not have scaled either: each agent that gains plugin
support would add a column.

Plugins now follow the MCP server list: one row per plugin with its
agents as toggles inside the row, so the list only grows downwards.
Per-agent sync and update move to package-level actions in the row
menu, and the dialogs use the standard header, body and footer.

* feat(ui): give plugins a kind colour and per-agent actions

Plugins borrowed a neutral grey tile because no kind colour existed,
which made them the one resource without an identity on the page.
Magenta sits furthest from the five hues already taken.

Laying plugins out as rows had dropped the per-agent sync and update.
Retrying one agent after a partial failure should not re-run the rest,
so each agent in the expanded row gets its own menu. Update is left out
for a deselected agent, which has nothing installed to update.

* feat(ui): count plugins on the Dashboard

The source summary listed every resource kind except plugins, so the
Dashboard under-reported what a source holds. The Playful source note
grows to fit a fifth row.

MCP now sits above Plugins in the sidebar to match that order, and its
Dashboard label reuses the sidebar's "MCP" instead of a longer string
of its own.

* feat(scripts): add a host verification environment

Plugin and MCP work talks to the real Agent CLIs, and those live on the
host, not in the devcontainer, where every target reports "not installed".
Verifying by hand meant either pointing a build at real config or
assembling a dozen environment variables each time.

`make verify` builds a host binary and runs it against .verify-home/ in
the repo, redirecting HOME, the XDG dirs and each agent's own config
variable. The environment starts from `env -i`, so a stray
SKILLSHARE_CONFIG in the caller's shell cannot pull the run back to real
paths. Living inside the repo is safe because project-mode detection
only inspects the working directory and never walks up to a parent.

It also seeds the dashboard cache from ui/dist. A dev build serves a
placeholder rather than the working tree, because runtime download only
applies to numbered versions, so the UI was previously unverifiable
without a release.

* fix(ui): show progress while a plugin selection is applied

Toggling an agent shells out to that agent's own CLI, which takes
seconds. The row gave no sign of it: the toggle only greyed out, and
the confirmation badge is hidden while a target is deselected, so
turning one on looked like nothing happened at all.

The toggle being applied now lifts out of the greyed state and spins in
its badge. Agent versions also get room for their real strings, since
"2.1.276 (Claude Code)" was truncated to a width chosen for a bare
version number.

verify.sh gains a 'run' subcommand, so the same throwaway environment
can be driven from a script rather than only an interactive shell.

* fix(ui): spin the control that started a plugin action

Reading the inventory shells out to six agent CLIs and takes about two
and a half seconds, and every action refreshes it afterwards. Nothing on
the page said so: a menu action closed the menu and left the page still,
so the wait read as a freeze.

Each control now tracks its own work. Check, sync and import spin in
place, a menu action spins the row it acts on, and the agents refresh
follows the query itself rather than the mutation flag.

* feat(ui): split MCP add and import by where the configuration comes from

"Import from a target" opened a dialog whose second tab pasted a snippet,
which is not a target and usually comes from a provider's setup page rather
than a tool the user already configured. Pasting is a way to add a server,
so it moves under "Add server" beside the form, and importing now means one
thing: read what an installed Agent already has.

The paste side gains a file picker, matching `mcp import --file`; the API
only ever took content, so the browser reads the file and fills the editor.

The target picker no longer waits for a successful parse, and a footer that
said "writes 0 config files" next to a greyed-out button now names what is
missing instead.

* fix(ui): label the plugins result strip as the last action

The strip and the plugin inventory below it used the same list styling with
no heading on either, so two rows carrying the same plugin name read as one
list. The status word made it worse: "imported" is one of the outcomes
lifecycle.go returns for an action, but it sat where an inventory row shows
state, so it looked like a property of the plugin.

Give it the section heading the Agents list already has, plus a count and a
dismiss button, so it reads as the report it is.

* feat(plugins): expand compatibility and clarify setup guidance

Support additional native targets, safe source links, Git refs, and explicit OpenCode entries while exposing per-target capabilities across CLI, TUI, and UI.

Separate unsupported integrations from environment errors, explain next steps in plain language, and link official documentation. Update built-in guidance, website docs, completions, and regression coverage.

* feat(plugin): serve a plugin's files and translatable discovery problems

The dashboard could only show a plugin's name and targets, so reviewing
what a plugin ships meant opening the snapshot by hand. Files and
ReadFile expose the reviewed local copy read-only through os.OpenRoot,
which keeps reads inside the snapshot even across symlinks.

Discovery problems now carry a key and arguments next to the English
sentence, so the dashboard can translate them while the CLI keeps its
wording. Inventory asks every Agent CLI in parallel and Packages answers
from config alone, so the plugin list no longer waits on the slowest CLI.

* feat(mcp): sync to Pi, show native config, and lay out written entries

Pi has no built-in MCP support, so a server targeting it must name the
third-party extension that will read the file. `--pi-extension` and the
`piExtension` source field record that choice, and sync writes the file
format of the chosen package instead of guessing.

RenderNative and POST /api/mcp/render return what each Agent would
receive for a definition, with secrets kept as references, so the
dashboard can show the result before anything is written.

Sync used to insert entries on a single line and never revisit them. A
managed entry that still sits on one line is now reported as an update
and rewritten one field per line; entries formatted by hand are left
alone.

* feat(ui): choose plugin Agents like MCP, browse plugin files, view MCP config

The plugin fold listed bound Agents with a per-Agent menu, while MCP let
you simply tick the Agents you want. Plugins now work the same way: the
fold discovers where the source can also go, shows those Agents as
unticked toggles, and a tick previews an install. The per-Agent menu is
gone, and updating a plugin targets only the Agents that support it
instead of hiding the action when one of them does not.

A plugin with a local copy can be browsed in a read-only files dialog,
using the same tree as a skill's Files tab. The MCP "view config" moved
out of a fold in the server form into its own view, reachable from the
server menu, so the native result has room to be read. The MCP dialogs
also ask for the Pi extension when Pi is selected.

Playful tile names drop from 25px to 22px: "brainstorming" was 1px wider
than the tile and lost its last letter to the next line.

* docs: reshoot dashboard screenshots for the redesigned UI

The README and website still showed the pre-redesign dashboard, which no longer matches what users see after upgrading.

* docs: describe MCP, plugins and the new dashboard for v0.21.0

The README still announced v0.20.0 and never mentioned plugins, and its
MCP section listed four clients. The built-in skill and the docs pick up
the Pi extension setup, the formatting-only MCP update, and the plugin
fold and files dialog, so agents and users are not surprised by them.
2026-09-19 03:14:03 +08:00