Commit Graph
4 Commits
Author SHA1 Message Date
Willie 89fc4fbdf1 feat(sourcewalk): follow first-level source links when enabled
Users link a checkout directly under the skills source (e.g.
skills/_dev-skills -> ~/code/dev-skills) and expect it to behave like any
other first-level entry. sourcewalk resolved only the root, so these links
were invisible to discovery, sync, update, and the dashboard.

follow_source_links (global and project config, default false) enables a
per-operation sourcewalk.Follow policy. Walk, WalkDir, and ReadDir report a
followed link under its own name as a directory and descend into its
target, so names, RelPath, FlatName, SourcePath, tracked-repo detection, and
metadata keys stay logical. Only entries directly under the source root are
followed. The policy is built from config and passed explicitly to every
discovery caller in the CLI, server, and reconcile, so counts agree; the
server keeps a per-instance snapshot refreshed on config load and save
instead of a process-global flag.

A link is skipped, with one warning per operation, when its target is
missing or unreadable, is the source or a parent of it, or overlaps an
active skills target. A missing or unreadable target marks the operation
incomplete: sync then skips pruning and copy-orphan deletion, and reconcile
keeps metadata, so an unmounted drive or a re-clone in progress cannot
erase target entries or install records. A link to an existing file is not
a directory link and stays an ordinary entry; treating it as incomplete
would disable pruning for anyone sharing a file such as .skillignore.

doctor keeps raw link identity: with the key off it still says the link is
not followed and names follow_source_links: true; with it on it reports
followed links and skipped links with the reason.

The raw-walk allowlist gains entries for the policy path in Walk and
WalkDir: the source root walk with a policy, and the walk of a validated
link target whose paths are remapped to the logical link path. Both live
in sourcewalk itself, the package that owns source traversal.

Refs #274
2026-10-05 14:26:09 +08:00
Willie d4c2f6e9a0 fix(server): report toggles that .local ignore rules override
Disabling a skill only checked that its path was written to .skillignore.
A "!" rule in .skillignore.local is applied after that file, and an
unanchored one such as "!feature-radar" re-includes every path segment with
that name, so the skill stayed enabled while the dashboard reported success.
The dashboard also never showed the .local file, so nothing explained why.

Single and batch toggles now re-discover after writing and report an item
that did not reach the requested state as failed, naming the overriding
file; the batch toast shows the first failure's reason. GET /api/skillignore
and /api/agentignore return the .local file, and Settings > Files shows its
rules above the editor.
2026-10-04 19:34:24 +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 90f9609e64 feat(resources): add batch enable/disable in web UI
Add multi-select mode to the Resources page so users can enable or
disable many skills or agents at once (issue #203), instead of toggling
each one individually.

- New POST /api/resources/batch/toggle endpoint (skills + agents) backed
  by the shared .skillignore/.agentignore, returning per-item results and
  an updated/unchanged/failed summary
- Selection mode across grid, tree, and table views with a unified
  checkbox, folder-level tri-state select-all in the tree, a bottom
  action bar (Enable applies immediately, Disable confirms first), and
  optimistic updates
- i18n keys for all 11 locales
2026-06-05 23:41:03 +08:00