Commit Graph
2264 Commits
Author SHA1 Message Date
Willie 1930a37e7c style(ui): align the preview file list with the file header
The first list item started at the top of the pane while the header
icon beside it sat centred in a 32px row, so the two columns looked
offset. Nudge the list down so its first item lines up with the icon.
2026-09-30 15:18:23 +08:00
Willie fb16fcc3d1 style(ui): widen the MCP paste and import dialog to match
The paste tab of the add-server dialog opens MCPImportDialog, which
stayed at 640px after the manual tab moved to 880px, so switching tabs
changed the dialog width and pasted snippets scrolled sideways.
2026-09-30 15:16:35 +08:00
Willie 524c103011 style(ui): widen the MCP server and config preview dialogs
The preview now shows the file list and the file content side by side,
and 720px left the content pane too narrow, so long paths and JSON lines
scrolled sideways. The paste tab had the same problem with pasted
snippets.
2026-09-30 15:14:46 +08:00
Willie b780f268a7 feat(ui): show every Agent file side by side in the MCP config preview
The old preview picked one Agent at a time from a dropdown, so it hid
how many files Sync would write and whether they land in the global or
a project scope. The preview now lists the Skillshare source and every
target Agent with its file path relative to the scope, shows the picked
file in full next to the list, counts the files Sync writes, and names
the scope (global, or the project and its root). Render errors stay
with the Agent they belong to.
2026-09-30 15:11:39 +08:00
Willie 88855431dd docs(mcp): describe the built-in Pi default
The Pi section told scripts to always pass --pi-extension and said new
setups "can choose" builtin, which no longer matches: mcp add, mcp import
and the dashboard dialogs now store builtin for a new server that reaches
Pi without a mode. Say so, note that the default does not follow other
servers' mode, and keep the ja, ko, zh-Hans and zh-Hant pages aligned at
the same positions.
2026-09-30 15:09:31 +08:00
Willie a044b2397b feat(ui): start new Pi servers on the built-in mode
The add dialog preselected the mode of the first existing server, so a
user with one pi-mcp-adapter server got the adapter for every new server,
and the import dialog blocked on "choose a mode" when importing into Pi.
The maintainer decided new servers default to Pi's built-in MCP and that
the default must not be inferred from other servers.

A new server now starts on builtin and the defaultPiExtension prop is
gone. Editing keeps the server's stored mode, and a server that has none
still asks for one. Import into Pi no longer blocks: a picked mode
applies to every server, otherwise each keeps the mode it carries and
the rest are built-in.
2026-09-30 15:09:26 +08:00
Willie 83ac85bae4 feat(mcp): default new Pi servers to the built-in MCP
`mcp add --target pi` without `--pi-extension` failed at render time with
"Pi requires piExtension", so scripts had to know about Pi's modes before
they could add anything. The maintainer decided new servers that reach Pi
should use Pi's built-in MCP (Pi >= 0.99.0) when no mode was chosen.

`mcp add` and `mcp import` now store `piExtension: builtin` at creation
time when the server's own or inherited targets include Pi or a Pi
account. The mode of other servers is not consulted, stored values are
never rewritten, and switch-only entries keep inheriting the global
server's mode. renderPi still refuses an entry without a mode, so a
hand-written config stays explicit.

Integration tests prove the built-in file follows the scope:
~/.pi/agent/mcp.json globally, <root>/.pi/mcp.json in project mode and
for a server under mcp.projects.
2026-09-30 15:09:19 +08:00
Willie be18505dae fix(completion): complete missing subcommands and flags
The five completion scripts are hand-written and had drifted from the
CLI's argument parsing. Some entries sent users down paths that no longer
exist: `backup restore` backed up a target named "restore", `extras mode`
only printed help, `install --source` failed as an unknown option, and
`hub index --audit-skills` was rejected because the flag is `--audit`.
pull, push and commit were offered -p/-g, which they ignore.

Those stale entries are gone, and the scripts now complete:
- backup files list/show/restore, audit rules disable/enable/severity/
  reset/init, ui start/stop, mcp edit (bash, PowerShell, Nushell)
- sync scopes and the `agents` kind keyword where commands accept it
- flags the CLI parses but no shell offered, among them sync --quiet,
  status --json, new/search flags, enable/disable --kind, backup
  --delete/--all, restore/trash --all, ui --base-path/--clear-cache/--app,
  hub add --label, hub default --reset, mcp --disabled/--keep-files,
  analyze --verbose/--filter, init --git-root/--visible/--config and
  the extras subcommand and `extras <name>` flags
- fish: the target filter flags, --agent and --config-dir, and restore

PowerShell also stops swallowing a flag typed as the second word for
commands that have a subcommand list, so adding list, sync and the other
kind-aware commands to that table keeps their flag completion.

The completion reference page in every locale listed the stale
subcommands; it now lists the current ones.
2026-09-30 15:08:35 +08:00
Willie 3106f7d4a3 fix(i18n): say 目标 instead of target in Simplified Chinese
Same cleanup as zh-TW: buttons and messages such as "从 target 导入"
mixed an English noun into zh-CN copy that elsewhere already says 目标.
The config field names targets (skill frontmatter, config.yaml section)
stay as written.
2026-09-30 15:07:46 +08:00
Willie eb4e217467 fix(i18n): say 目標 instead of target in Traditional Chinese
Buttons and messages such as "從 target 匯入" and "{count} 個 target
同步失敗" mixed an English noun into zh-TW copy, while the rest of the
dashboard already calls targets 目標. The config field names targets
(skill frontmatter, config.yaml section) stay as written.
2026-09-30 15:05:45 +08:00
Willie fb6325df88 fix(ui): name the only Agent in the MCP config preview
The preview always showed an Agent picker, so a server with one target
got a dropdown with a single option. With one Agent the preview now
names it; the picker appears only when there is a choice.
2026-09-30 14:57:42 +08:00
Willie 54d0d5eed0 docs(wiki): require all five shell completions for command changes
The completion scripts are written by hand and never read the CLI's
dispatch, so new subcommands (mcp edit in bash and fish, backup list
and show in fish) went missing in some shells without any test failing.
Contributors now have an explicit rule and a completion-criteria check
for it.
2026-09-30 14:53:16 +08:00
Willie 74c17c10c0 test(ui): drop the slow Pi untick case from the MCP server dialog
It ran the same long click sequence twice and exceeded the 5s timeout
whenever the whole suite ran in parallel, failing unrelated runs. It
guarded a narrow case (Pi settings typed, then Pi unticked before the
first save) whose worst outcome is unused Pi fields in the source.
2026-09-30 14:50:14 +08:00
Willie 71583e1cf4 fix(completion): complete the remaining mcp flags in fish
Fish offered only the Pi and check flags for mcp and left out edit,
while bash and zsh completed --url, --target, --sync, --dry-run and the
rest. The fish script now lists the same mcp flags and subcommands.
2026-09-30 14:50:14 +08:00
Willie 69963c69f1 fix(ui): open a dashboard target on its own page
Each dashboard target row, Playful pin note, and "needs attention" entry
names one target but linked to the target list, so reaching that target
took a second click and a search. They now open the target's detail
page; "Manage targets" still opens the list.
2026-09-30 14:43:28 +08:00
Willie cb4b55a91b test(mcp): cover --live in the mcp check runbook
Unit tests use a fake server built from the test binary, so nothing
exercised --live against separate real processes, a real HTTP server
or the process tree a server leaves behind. Steps 8-13 use sh stdio
servers (server/discover, initialize only, one that ignores SIGTERM and
starts a child, one that crashes), a Python server that answers 401,
and an unreachable URL, and check that nothing starts without --live.

Refs #141
2026-09-30 14:42:50 +08:00
Willie 1bb37a89a9 docs(i18n): translate mcp check --live docs
The English mcp reference gained the --live and --timeout flags, the
Probe servers live section and the changed safety note, so the ja, ko,
zh-Hans and zh-Hant pages would otherwise still say that Skillshare
never starts a server. Anchors and code blocks match the English page.

Refs #141
2026-09-30 14:42:49 +08:00
Willie 0e0899a4c7 fix(ui): size the project MCP label column to its labels
The label column was a fixed 110px to fit the Pi adapter label, so
projects without that row showed a wide gap between "Targets" and its
pill. The column now sizes to its labels, and the expanded Agent picker
sits in the value column of the same grid instead of a hardcoded indent
that only matched the old width.
2026-09-30 14:39:12 +08:00
Willie 3c2d0a169e docs(mcp): document mcp check --live
--live is the first command that starts a server or calls one, which
the reference and the built-in skill both described as something
Skillshare never does. Readers need to know what it runs (the server
command, with their environment), how it falls back for servers older
than 2026-07-28, what a 401 reports, the timeout, the live JSON object,
and that the dashboard check stays static.

Refs #141
2026-09-30 14:38:54 +08:00
Willie 8c98ab3b51 test(completion): exercise zsh and fish completions
The completion tests only grepped the generated scripts, so a script
that parses but offers nothing, or a flag listed in the wrong place,
passed. These tests load the scripts in a real fish (complete -C) and a
real zsh (compinit under zpty, capturing what compadd receives) and
assert the mcp subcommands and the mcp check flags, including --live
and --timeout. They skip where the shells are not installed; the
testing wiki says how to run them in a throwaway container.

Refs #141
2026-09-30 14:37:43 +08:00
Willie 733d20aace fix(ui): drop the circle from the MCP check problem icon
The success state already uses a plain check; the problem and error
states still used a circled alert icon, so the note's leading icon
changed shape between states. A triangle alert keeps both plain.

Refs #141
2026-09-30 14:35:46 +08:00
Willie 33c64a78c2 feat(completion): complete mcp check --live and --timeout
mcp check gained --live and --timeout, and a flag that no shell offers
is one users do not find. All five completion scripts list both with
the other mcp flags, and the all-shells test asserts they are present.

Refs #141
2026-09-30 14:35:45 +08:00
Willie b7969308bf feat(mcp): probe servers live with mcp check --live
The static check can say a variable is set and a command is on PATH,
but not whether the server actually starts and speaks MCP, which is the
other half of "synced, but the Agent does not see it".

--live runs after the static checks and only for servers without a
static error. A stdio server is started with the current environment
plus its env and fromEnv values, probed with server/discover and, for
servers before 2026-07-28, the initialize handshake, then stopped:
stdin closed, then SIGTERM and SIGKILL to its process group. A remote
server gets a Streamable HTTP POST with its resolved headers; a 401
reports the WWW-Authenticate resource metadata as a warning and never
signs in. Each probe has one timeout (--timeout, default 10s), a few
run at once, and configured values are redacted from every message.

Without --live nothing is started and no request is sent, and the
dashboard API stays static.

Refs #141
2026-09-30 14:35:41 +08:00
Willie 35a4092bca feat(ui): run MCP check from the project page
The check API already reports servers under mcp.projects, but only the
global MCP page could run it, so problems with a project's own servers
never showed where those servers are managed.

The project view now has the same Check button, summary note, and
per-row findings as the MCP page. Findings are scoped by the server's
project root, because names repeat across scopes: a global server with
the same name must not mark a project row, and the global page keeps
ignoring project findings.

Refs #141
2026-09-30 14:29:21 +08:00
Willie 9a25e34938 fix(ui): keep MCP restore preview height stable
Switching backups replaced the preview with a small spinner, resizing the centered dialog on every selection. Keep a fixed, scrollable preview viewport across loading, results, and errors to prevent the dialog from jumping.

Add regression tests for viewport and dialog identity, focus and list scroll preservation, and restoring only with the selected backup's completed preview revision.
2026-09-30 14:20:36 +08:00
Willie 3779be1cef docs(i18n): translate mcp check docs
The English mcp reference gained the mcp check section, its --no-dns
flag, the project-server coverage, the JSON report fields and the
dashboard Check button, but the ja, ko, zh-Hans and zh-Hant pages did
not, so readers of those locales could not find the command at all.

Add the same content at the same positions with identical anchors,
unchanged code blocks, and the dashboard's own localized button label.
2026-09-30 14:17:07 +08:00
Willie 3d23b4a964 test(mcp): add mcp check E2E runbook
Integration tests cover the check with stubbed lookups and a sandbox, but
not the real resolver, the NO_COLOR human output, or the dashboard endpoint
served by skillshare ui. The runbook drives one global config through every
finding, including an mcp.projects root, and checks exit codes, the --json
shape, --no-dns, name filtering, and GET /api/mcp/check with and without
?dns=0. It passed 7/7 under mdproof in a fresh ssenv.
2026-09-30 13:49:07 +08:00
Willie cbf5fc06a4 docs(mcp): cover project servers in mcp check
The mcp check section said servers under mcp.projects were not checked,
which is no longer true. It now explains that the global config's project
servers are checked in their root, how names select across scopes, how a
project server's heading reads, the new project field in --json, and that
the dashboard's MCP page leaves project servers out.
2026-09-30 13:49:07 +08:00
Willie d938fc8853 feat(completion): complete mcp check and --no-dns
skillshare mcp check shipped without shell completion, so tab never offered
the subcommand or its --no-dns flag. Each shell now lists check among the mcp
subcommands and --no-dns among the mcp flags, described as "Skip host
lookups" where the shell shows descriptions. PowerShell and Nushell had no
mcp subcommand list, so they gain one in their existing plugin style.
2026-09-30 13:46:00 +08:00
Willie a4c4575193 fix(ui): keep project check findings off the global MCP rows
mcp check now reports servers under mcp.projects too, and a project server
may share a global server's name. Keyed by name alone, its findings would
mark the global row and inflate the note's counts on a page that does not
list project servers.

The MCP page now reads only servers without a project, and the note counts
errors and warnings from those servers instead of the report-wide summary.
2026-09-30 13:44:55 +08:00
Willie f43a6734eb feat(mcp): check servers under mcp.projects
A global config syncs every mcp.projects root in the same plan, but mcp check
only looked at the global list, so a project server with a missing variable,
an unresolvable command, or an entry out of sync went unreported.

Check now covers each root's servers in global mode, rendering client rules in
that root and reading sync state from the plan's changes with the same Root.
Each result carries the root in a new project field (empty for global
servers), and name filtering and the unknown-name error span every scope.
2026-09-30 13:43:45 +08:00
Willie 7b564fe112 fix(ui): use a plain check icon in the MCP check note
The all-good note put a circled check right beside the circled Info icon on the next line, and the two circles read as the same mark. A plain check keeps the state clear without repeating the shape.
2026-09-30 13:42:00 +08:00
Willie 9bd5c158f1 docs(mcp): mention the dashboard check and the subject field
The JSON report gained a subject field and the MCP page gained a Check
button; the command reference should describe both so the docs match
what the code does.
2026-09-30 13:36:25 +08:00
Willie fab3e9832a feat(ui): run MCP check from the MCP page
A Check button next to Backups runs the check only when clicked, so the
page never does DNS or PATH lookups on load. The result note sits above
the unmanaged-servers note, and each server row with findings gets a
count tag and a fold listing them.

The component tests land here with the locale strings they assert on,
since the parity-checked locale files belong to this commit.
2026-09-30 13:36:25 +08:00
Willie fac0277818 feat(ui): add MCP check result note and finding rows
The MCP page needs to show what `mcp check` found without reading
terminal output. These pieces fetch GET /api/mcp/check on demand, keep
the result in memory only, summarize it in a note, and list each error
or warning under its server with the Agent it concerns. Env, command,
and DNS findings are phrased from the new subject field so they can be
translated; other checks fall back to the backend message.
2026-09-30 13:35:57 +08:00
Willie 3355b4f218 feat(mcp): add subject to check findings and a check endpoint
The dashboard needs to phrase each finding in the reader's language, so a
finding now names what it is about (variable name, command, or host) in a
separate subject field instead of only inside the English message. The
value of a variable is still never included.

GET /api/mcp/check serves the same report as `mcp check --json` so the MCP
page can run the check on demand. It is read-only, writes no oplog entry,
returns 200 when findings include errors, and accepts ?dns=0 to skip host
lookups.
2026-09-30 13:35:57 +08:00
Willie c523b940c5 docs(mcp): document mcp check
Users and agents need to know what the check verifies, which findings fail
it, and the JSON shape scripts can rely on. English only; translations are
left for a follow-up.
2026-09-30 13:35:57 +08:00
Willie 90950f701a test(mcp): cover mcp check end to end in global mode
Exercises the built binary: exit code 1 and the JSON shape when a variable
is missing, exit code 0 after sync with the variable set and no value
printed, and the known-server list for an unknown name.
2026-09-30 13:35:57 +08:00
Willie a4aae58fec feat(mcp): dispatch mcp check subcommand
The check takes several names and --no-dns, which the shared MCP option
parser rejects, so it is dispatched before that parser runs. Kept to its
own commit so the hook rebases cleanly over concurrent mcp.go edits.
2026-09-30 13:35:57 +08:00
Willie 70198a56b4 feat(mcp): add static check of servers as synced
A synced server can still fail when its Agent starts it: a referenced
variable is unset, the command is not on PATH, the host does not resolve,
or the Agent's entry drifted from the source. Nothing reported this without
starting the server.

Service.Check answers it without starting anything or sending requests. It
reuses the sync plan for per-target state and renders each server alone per
target, so a client rule names the Agent that refuses it and does not hide
the other servers' state. DNS is the only network access and can be skipped.
2026-09-30 13:35:57 +08:00
Willie c4ab37a0a2 feat(mcp): support Pi built-in MCP
Support Pi 0.99.0 built-in MCP alongside existing adapter and extension modes, with mode-aware paths, imports, and per-server options.

Preserve custom native settings and remove cleared options only when explicitly requested and ownership is unchanged. Align CLI, dashboard previews, exposure controls, and localized documentation; simplify complex MCP components.

Add regression coverage for import dialects, escaped values, mode selection, option pruning, conflicts, and migration previews. Verified in the devcontainer with Go vet and tests, MCP integration, make check, UI build and 527 tests, five-language website build, and ai-context validation.
2026-09-30 13:35:33 +08:00
Willie 2d909c7b6c chore: release v0.22.1 v0.22.1 2026-09-30 09:44:24 +08:00
Willie 9b09fc468d docs: add 0.22.1 changelog entry 2026-09-30 09:44:24 +08:00
Willie 0b12e5916d fix(ui): keep the update dialog closed on dev builds
Dev builds always report a simulated CLI update so the upgrade flow can be
tested, which made the dialog pop up on every dashboard load. Skip the
auto-open when the server reports cliDevMode; ?update-test still forces it.
2026-09-30 09:39:45 +08:00
Willie 682e31adda fix(ui): dedupe CodeMirror and Lezer packages to one version
The toolchain update left two copies of @codemirror/state (and of view,
language, commands, @lezer/common and @lezer/lr) in the lockfile. Extensions
built against one copy fail instanceof checks in the other, so the file editor
crashed with "Unrecognized extension value in extension set" and Lezer trees
could silently lose highlighting.

Pin each package with pnpm overrides so the graph resolves to a single copy.
2026-09-30 09:39:45 +08:00
Willie 68c1c4e56d chore: release v0.22.0 v0.22.0 2026-09-30 04:14:38 +08:00
Willie 5756c87c3a docs: add 0.22.0 changelog entry
Record the sync partial-failure work, the tracked-repo git status fix
and the dashboard fixes since 0.21.17. The version moves to 0.22.0
because several changes alter exit codes and API responses that
scripts may rely on; they are listed under Breaking Changes.
2026-09-30 04:01:31 +08:00
Willie a040eacf83 test(sync): compare the resolved extras path on macOS
TestSyncExtras_ProjectJSONReportsResolvedPath failed on the macOS CI
runner: the CLI reports the real target path, and the macOS temp dir
sits behind the /var -> /private/var symlink, so it no longer matched
the unresolved path the test built. Resolve the expected path the same
way, as json_output_test.go already does.
2026-09-30 04:01:05 +08:00
Willie 7b60645397 fix(server): keep the project dashboard up when a target has no path
The project dashboard resolved every target's path on startup and before
each API request, so one custom target without `skills.path` kept
`skillshare ui -p` from starting and made every request of a running
dashboard fail with "failed to reload config". Targets that cannot
resolve are now left out with a startup warning, and the dashboard sync
reports them as failed with part "config", like `sync -p` does.
ResolveProjectTargets keeps failing for the commands that need every
target.
2026-09-30 03:49:21 +08:00
Willie cefa7c50ee fix(server): report a sync where every target fails instead of a 500
When every skills target failed, including when every target's settings
were invalid, the dashboard sync returned 500 with only the first error.
The page lost the failed list and its explanations, agents were never
synced, and the dashboard's extras and MCP steps did not run. The sync
now finishes like any partial failure: it returns 200 with every target
in `failed`, and the operation log still records it as `error`.
2026-09-30 03:42:47 +08:00