Commit Graph
2100 Commits
Author SHA1 Message Date
Willie 86dca7924f feat(backup): browse and restore file history, delete snapshots
skillshare backs up AGENTS.md, CLAUDE.md and shared-file locations before
rewriting them, but nothing could list or restore those copies, and a
target snapshot could not be deleted on its own. The file backups now
record why they were taken in their name (<time>.<reason>.bak; older ones
have none), and the server and CLI can list them, show a version and
restore it, saving the current content first. A link is only replaced
when the caller asks for it.

Also:
- DELETE /api/backups/{timestamp} and `backup --delete`.
- Agents snapshots (<target>-agents) could not be restored from the
  dashboard: the name was looked up as a target.
- Project mode uses the project's backups folder for snapshots and lists
  only file backups inside the project.
- MCP backups report which servers they changed and when.

Refs #299
2026-09-28 19:23:16 +08:00
Willie 5262ee32dd docs: describe shared files in project mode
The project Extras page no longer has a file-name field on folder
targets; shared files and their locations moved to the AGENTS.md tab.
Document the project differences (root-relative folders, tool files
allowed, relative links) and update the unreleased changelog entry.

Refs #299
2026-09-28 18:40:45 +08:00
Willie ccd7e31ebb feat(ui): show project shared files on the AGENTS.md tab
Single-file extras in a project sat in the Folders tab and looked like
folder extras: a folder icon, folder modes and a flatten switch, with
no import mode and no sync on add. They now appear as shared-file cards
on the project AGENTS.md tab, reusing the global location rows and Add
location dialog with project-relative paths. The Folders tab lists only
folder extras in both modes, so the file-name field added there is gone.

The CJK location counts now say "locations", since the card header has
no heading next to it to give "2" its meaning.

Refs #299
2026-09-28 18:40:24 +08:00
Willie 342fac7691 feat(server): serve shared files and their locations in project mode
In a project, single-file extras were only reachable through the folder
extras API, which has no file name, no import mode and no immediate
sync. The dashboard now shows them on the AGENTS.md tab like global
shared files, so the instructions routes it needs must work in project
mode: list, create, content, resolve and the locations routes.

A project location must stay inside the project (absolute, ~ and ..
paths are refused with instructions_location_outside_project) and is
stored relative, so a clone keeps working. A tool's own file is a valid
location in a project, so the is_target check is skipped there.

Refs #299
2026-09-28 18:40:15 +08:00
Willie 7d1f1fca91 docs: use a notes folder in the --as changelog example
Gemini CLI is already a target, so the dashboard sends a GEMINI.md
location back to the Targets list; a notes folder with instructions.md
shows what --as is for.

Refs #299
2026-09-28 18:00:36 +08:00
Willie 98bc3b243c docs: add 0.21.13 changelog entry
Refs #299
2026-09-28 17:45:01 +08:00
Willie 1c8b9d6998 docs: mention collect and reapply for edited locations
Refs #299
2026-09-28 17:41:34 +08:00
Willie 01874ed338 fix(ui): offer collect and reapply on edited locations
An edited location only showed a hint, with no way to settle it. It now
gets the same collect and reapply note as a target row. The remove
dialog closes before removing, so the refetch no longer asks for the
preview of a location that is gone.

Refs #299
2026-09-28 17:41:33 +08:00
Willie 0bbcbd7d54 fix(server): settle and roll back instruction locations
A location whose file was edited outside skillshare had no way to collect
or reapply, and a location whose config save failed stayed written on
disk. Resolve now takes a location path, and a failed save restores
what the file held; a failed reload keeps the saved location.

Refs #299
2026-09-28 17:41:33 +08:00
Willie 716d318a51 docs: document other locations for shared AGENTS.md
Explain adding, changing and removing a location outside the tool list,
the refusals, and the file name field on the project Extras page.

Refs #299
2026-09-28 17:33:46 +08:00
Willie 69c2b29b4b feat(ui): manage other locations of a shared AGENTS.md
Show locations outside the tool list under the shared file, with an add
dialog for folder, file name and mode, a restore preview before removal,
and localized errors. The project Extras page takes a file name for
single-file extras.

Refs #299
2026-09-28 17:30:41 +08:00
Willie 04485099ed feat(server): add locations API for shared instruction files
The dashboard could only attach a shared AGENTS.md to known tools, while
the CLI's --add-target/--as already writes it to any folder under any
name. Add list/add/mode/remove/restore-preview routes for such locations,
syncing a new location right away and refusing folders in the way, tool
files and files held by another shared file. The extras add-target route
now accepts as and runs the same config validation as the CLI.

Refs #299
2026-09-28 17:30:41 +08:00
Willie 892d3f5153 docs: sync AGENTS.md and Windows copy-fallback docs with recent fixes
Document local preserved counts, the junction replacement warning,
the Convert dialog without a picker, the folder-in-the-way hint and
update progress so the docs match the dashboard and CLI.

Refs #299
2026-09-28 16:57:03 +08:00
Willie 759269f67f fix(ui): move 'reads skills from universal' into a tooltip
Every rider row repeated the same line under its path on the AGENTS.md page, which is about instructions, not skills. The origin now shows when hovering the tool name.

Refs #299
2026-09-28 16:46:54 +08:00
Willie ea7c2ad6af fix(ui): say the copy Sync button appears on this page
Naming the Targets heading was confused with the Targets page.

Refs #299
2026-09-28 16:33:31 +08:00
Willie de0fbdee63 fix(ui): point the copy hint at the Targets heading
The Sync button sits beside the Targets heading, not above the list.

Refs #299
2026-09-28 16:31:43 +08:00
Willie acbe757574 fix(ui): say where to sync an out-of-date copy
"Run a sync" did not say where. The copy option now points at the Sync button that appears above the targets when the shared file changes elsewhere.

Refs #299
2026-09-28 16:30:37 +08:00
Willie e386e15bce fix(ui): give the copy mode its own description
The copy option reused the Skills folder-copy text and glued a second sentence on with a space, which read oddly in Chinese. It now has one sentence about copying the shared file.

Refs #299
2026-09-28 16:27:37 +08:00
Willie 7baf716c63 feat(instructions): translate dashboard warnings and errors
Mode changes, attach and the other AGENTS.md actions returned English
sentences, so a zh-TW dashboard showed "backed up ... before replacing
it" and "... is a directory" untranslated. Warnings are now
{code, params, message} and every instructions error carries a code,
so the dashboard shows them from i18n and falls back to the English
message for unknown codes. CLI output is unchanged.

Also from the Windows re-test:
- replacing a user's junction says so and where it pointed;
- status, doctor and sync agree on identical unowned copies (kept, not
  linked), and an identical copy no longer suggests --force;
- the targets list shows a Developer Mode tooltip when file links are
  unavailable;
- file names are taken from Windows paths too.

Refs #299
2026-09-28 16:12:59 +08:00
Willie aafb55a309 fix(ui): name the instructions tab by file name on Windows
The tab split the path on / only, so on Windows it showed the whole C:\...\CLAUDE.md path. fileName splits on both separators.

Refs #299
2026-09-28 16:05:21 +08:00
Willie 8063a6f424 chore(windows): add UTM verification helper and skill
Windows acceptance on the local UTM guest was a pile of one-off
commands: finding utmctl, polling async exec, running as the desktop
user with a basic token, pinning builds, and pre-seeding the UI cache.
utm.sh wraps those steps, manual-setup.ps1 gives a one-line hands-on
setup in an isolated home, and the skill records the workflow and the
pitfalls hit along the way (S4U tokens, ARM64 emulation, zsh echo).

Refs #299
2026-09-28 16:05:16 +08:00
Willie 29e140e1c8 feat(ui): show update progress and group failed updates
Updating many resources gave no sense of progress, and a failure was
easy to miss among the rest. The status card now shows a progress bar,
the row being updated gets a moving line and a pop when it finishes,
and blocked or failed updates move to their own section with a
one-line reason. Motion is off under prefers-reduced-motion.
2026-09-28 16:05:16 +08:00
Willie 2e7164fbb5 fix(ui): drop the one-option shared file picker in convert
When every shared file is already used by the target, the picker only offered "New one…"; the dialog now asks just for the name.

Refs #299
2026-09-28 16:05:16 +08:00
Willie 0ae1e17e15 fix(instructions): say when a folder blocks a target, pluralize kept files
A real directory at a target path showed the generic drift hint ("sync
will change it back") although sync refuses to replace a directory. The
assignment now carries reason "directory" and the row says to remove or
rename the folder.

The restore plan read "personal stay" in English because the kept-files
line had no singular form.

Refs #299
2026-09-28 15:41:35 +08:00
Willie 81ed0f1529 docs(extras): document shared-file ownership, --as, and restore behavior
Refs #299
2026-09-28 15:37:03 +08:00
Willie c6ed46260f fix(ui): skip copy-held targets in connect-all and lift tab underline
Connect-all still planned to switch a target that another shared file
holds in copy mode (the API marks only links as linked_shared), which
would silently take it from that file. Any link or copy assignment now
marks the target as held, so the switch step is gone.

The header tabs sat on the strip's divider; they are now centred with
room under the underline.

Refs #299
2026-09-28 15:31:08 +08:00
Willie 87e6cc9538 fix(extras): guard shared-file ownership and keep user files on restore
Exploratory CLI, dashboard and real-Windows testing of single-file extras
found paths that corrupted another shared file, lost user content, or
reported the wrong state.

- One shared file per link/copy target is now enforced in config
  validation, so the CLI, sync and API all refuse it; an import is never
  written through a link into another shared file (409
  instructions_target_held in the API).
- Restore recreates an original Windows junction as a junction, which
  needs no privilege, and remove restores before saving config so a
  failed restore no longer orphans the record.
- Imports into dotfiles links, damaged managed blocks, repointed links
  and CRLF files keep the user's content; project imports use paths
  relative to the file so a moved repo keeps working.
- Mode and assign responses carry sync warnings; dry-run says when an
  edit would be backed up; invalid modes no longer show as healthy.
- An edited copy reports modified, identical unowned copies count as
  synced without being owned, and relative project links no longer show
  drift.
- sync extras --json exits non-zero on errors; extras <name> --help
  works; --add-target gains --as; detach messages match behavior.

Refs #299
2026-09-28 15:27:02 +08:00
Willie 4a2d05e9ce fix(ui): guard AGENTS.md edits and surface shared-file conflicts
Exploratory testing of the dashboard found edits lost without warning,
Cmd+S saving the page editor through an open dialog, and a connect-all
plan that would write an import through another shared file's link.

- Unsaved edits now ask before leaving the target tab, closing the edit
  dialog, or reloading.
- Cmd+S does nothing to the page editor while a dialog is open.
- Connect-all skips targets already held by another shared file
  (linked_shared), and 409 instructions_target_held shows its reason.
- Mode and attach warnings (such as a backed-up edit) show in a toast.
- Restore wording matches what restore does; the per-file connect time
  was dropped because the record is per target file.
- Convert defaults to a new shared file; a new file is selected at once;
  an unknown ?file= falls back and fixes the URL.
- The collapsed shared-file card scrolls instead of clipping.
- Change location is disabled while a shared file holds the target.

Refs #299
2026-09-28 15:24:56 +08:00
Willie f307c8a114 fix(sync): keep user files safe in copy fallback and mode switches
Review of the file-link fallback found paths that lost or misreported
user data:

- An identical local file was adopted as a skillshare copy and later
  pruned without backup. Only files sync writes are tracked now.
- Clearing all own text in import mode was treated as no record, so
  switching back resurrected the attach-time content.
- The mode API saved the new mode and returned success when a directory
  blocked the sync; it now keeps the old mode and returns 409.
- Restore preview promised a delete for files restore leaves alone; both
  now share one ownership decision.
- Prune forgot ownership even when removing the copy failed.

Refs #299
2026-09-28 14:27:53 +08:00
Willie 269f18b5e6 docs(instructions): note Cmd+S on the target page and Preview-first card
Refs #299
2026-09-28 14:19:52 +08:00
Willie a26cf4a8f3 feat(ui): unify AGENTS.md editor headers and save with Cmd+S on target page
Every AGENTS.md box showed its size and view switch differently, which
read as clutter. One header strip now carries the live line count and
the Preview/Source switch everywhere; the read-only card opens in
Preview since that is what people read first.

The target page editor now saves with Cmd/Ctrl+S. An open editor
claims the shortcut so it no longer jumps to Sync while editing.
Read-only raw text wraps instead of scrolling sideways.

Refs #299
2026-09-28 14:19:29 +08:00
Willie 2742da5bc8 docs: cover copy updates on save, previews, and hidden empty rule folders
The sharing guide still told users to sync after every edit of a shared
file in copy mode, and did not mention the source/preview switch or that
empty rule folders drop out of the read order.

Refs #299
2026-09-28 14:13:37 +08:00
Willie a4fb4f59f6 feat(ui): preview AGENTS.md everywhere it is shown and hide empty rule folders
The edit/preview switch existed only on the target page, so the shared
file's editor, the new-file dialog and the read-only card still showed
raw Markdown. They now share one tab component: Edit | Preview in the
editors and Source | Preview on the read-only card, with previews built
from the unsaved draft.

The read order also listed rule folders such as claude's rules/*.md with
"0 files" for everyone who does not use them; empty folders are now left
out and a folder appears once it holds files.

Refs #299
2026-09-28 14:11:37 +08:00
Willie c6ec545e96 feat(instructions): update copies when a shared file is saved
Saving a shared AGENTS.md in the dashboard only wrote the source, so every
target in copy mode (including the Windows copy fallback) kept the old
content until someone found the sync button. Saving now rewrites that
file's copy targets through the regular extras sync, so an edited copy is
still backed up first, and the toast names the copies it updated. Link and
import targets already read the source and are left alone.

Refs #299
2026-09-28 14:08:46 +08:00
Willie faa5186818 fix(sync): keep import-mode edits when switching back to import
Switching a target from import to copy or symlink and back rebuilt the
file from the attach-time restore point, so lines the user wrote while in
import mode vanished (they survived only as a drift backup). Save the
file's own content when leaving import and rebuild from that on the way
back; the attach-time restore point itself is never re-recorded.

Refs #299
2026-09-28 14:04:15 +08:00
Willie 42c1051b88 docs: describe Windows file links and the new AGENTS.md controls
The docs said Windows always links with NTFS junctions and needs no admin
rights, which is only true for folders. Explain that single files need
Developer Mode for symlinks and otherwise sync as tracked copies, with the
warning line users will see and the folder-icon symptom from the issue.

Cover the per-target mode picker, the restore preview, changing a target's
file location, the single-column file tab with edit/preview, universal's
file list, and switching back to import. Also correct status and doctor
output that no longer matched the code, and the doctor "Link not
supported" advice, which pointed at Developer Mode although that check
creates a folder junction.

Refs #299
2026-09-28 13:57:40 +08:00
Willie 3f4d347e61 fix(ui): honor NO_COLOR in every command's output
The legacy color constants in internal/ui (Red, Gray, Dim, Bold, Reset, …)
were compile-time strings that ignored the theme, so status, doctor, extras
list and about twenty other commands printed ANSI codes even with NO_COLOR
set. Make them variables and blank them at startup when the theme reports
NoColor, so the theme stays the single source of that decision. The two
places that hardcoded escape codes (usage and log --stats) now use the same
variables.
2026-09-28 13:56:59 +08:00
Willie 88f5201911 feat(instructions): choose sync modes, preview restores, and move files
The AGENTS.md tab picked each target's mode for the user (import where
supported, a link elsewhere), which left Windows users without Developer
Mode no way out of a broken link and gave no copy option. Restore replaced
a file without showing what would come back, and only custom tools could
change which file a target reads.

- Each connected target gets a mode picker (import, symlink, copy); symlink
  is unavailable when the machine cannot create file links, and a target
  whose file is a folder link says so.
- Restore opens a preview of the file after restore and its diff.
- Every supported target can change its file location and name in a
  dialog, with reset to default.
- The target file tab is a single column with the read order on one line,
  a tinted managed import block, soft wrap, and an edit/preview switch;
  universal lists the files of the tools that read its skills.
- The convert dialog shows only the methods that apply and a ready preview.

Refs #299
2026-09-28 13:55:51 +08:00
Willie c7eb59a78f fix(sync): stop linking single files with junctions on Windows
createLink always tried `mklink /J` first. mklink does not check the
source type, so agents, single-file extras such as a shared AGENTS.md, and
per-file extras links became directory junctions that point at a file:
Explorer shows a folder and tools cannot read it. Sync then compared only
the link destination and kept the broken junction forever.

Files now get real symlinks only. When the OS cannot create them (Windows
without Developer Mode, non-elevated), file-based link modes fall back to
copies at the mode level, so status, doctor, the API and later syncs all
see an effective `copy` mode. Fallback copies are tracked by hash so they
keep updating and pruning without touching the user's own files, and turn
back into links once links work. Single-file extras remember what they last
wrote, so an unedited copy is replaced silently instead of producing a
drift backup on every source edit, and switching a target back to import
restores the user's attach-time content plus the import block.

Includes a Windows runbook and script, verified on a Windows 11 ARM64 VM
with and without symlink rights.

Refs #299
2026-09-28 13:54:52 +08:00
Willie 97499ebcc4 fix: recognise Windows junctions wherever links are detected
Since Go 1.23, os.Lstat reports NTFS junctions as irregular files instead
of symlinks (winsymlink, active for go 1.25 in go.mod). Every check that
looked only at os.ModeSymlink therefore missed the junctions skillshare
itself creates on Windows: linked skills could be treated as local folders,
backed up, copied through, or left behind on prune.

Detect links through utils.IsLinkMode, which also asks the OS about the
reparse tag of irregular entries, and count only real symlinks and
junctions as links so OneDrive placeholders and deduplicated files stay
regular files. restore.go also used os.Stat for its link check, which
follows the link and never matched.

Refs #299
2026-09-28 13:53:16 +08:00
Willie afa8c09758 chore: release v0.21.12 v0.21.12 2026-09-28 02:15:18 +08:00
Willie daf77b037f fix(target): keep skills another target still syncs when removing one
Codex and universal both write to ~/.agents/skills. Removing one of them
unlinked that folder, turning the other's synced skills into local
copies it no longer managed. Removal now leaves the folder alone while
another remaining target uses it, in the dashboard, the CLI, the TUI and
the dry-run preview.
2026-09-28 01:58:29 +08:00
Willie ad3d84b76a feat(instructions): manage the files of tools that read universal's skills
With only universal configured, tools such as Codex, Gemini CLI and Pi
still read skills from ~/.agents/skills, but none of them reads
~/.agents/AGENTS.md, and their own instruction files had no page and
could not take a shared AGENTS.md. Universal's AGENTS.md tab now offers
the installed ones in a dropdown, and the shared AGENTS.md list includes
them. A tool is listed once per file and disappears when it becomes a
target of its own.

Cline and the Warp Agent CLI read ~/.agents/AGENTS.md itself, per their
docs, so they now share universal's file.
2026-09-28 01:36:42 +08:00
Willie 95f168feda fix(upgrade): say how to take back a skill left owned by root
Before v0.21.10 an upgrade that needed sudo wrote the built-in skill as
root, so every later skill upgrade failed with a bare "permission
denied". The error now adds the chown command for the skills source.
2026-09-28 01:36:42 +08:00
Willie 682d142a3d chore: release v0.21.11 v0.21.11 2026-09-27 23:22:03 +08:00
Willie 3d08cbc670 fix(plugins): name a git failure's cause only when git names it
Git opens every HTTPS failure with "unable to access", a bad certificate
or a 403 included, and a missing git-lfs says "command not found". Those
were reported as a network problem or a missing source and sent the user
to the wrong fix; they now fall back to the general failure.

Discovery of a managed plugin is also cached per plugin, since two
plugins of one source can have snapshots at different commits.
2026-09-27 23:08:39 +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 31697d9bdb feat(targets): know the instruction files of more targets
Targets without an instructions entry asked the user to type the path,
even when the tool documents a fixed one: universal always reads
~/.agents/AGENTS.md and Pi reads ~/.pi/agent/AGENTS.md. Paths for 20
more targets come from each tool's official documentation; targets
whose file is undocumented or changing are left for the user to set.
2026-09-27 23:03:21 +08:00
Willie ad34dbde2d fix(server): load the dashboard when opened at a nested route
The build links its files as ./assets/..., so a page reloaded at
/targets/claude asked for /targets/assets/... and got index.html back.
The browser refused the chunks as text/html and the page stayed on its
skeleton. The server now injects a <base> for the base path.
2026-09-27 23:03:21 +08:00
Willie c1596262d5 build(website): compile the docs with Rspack
The docs build spent over five minutes in webpack for five locales.
@docusaurus/faster swaps in Rspack and SWC and cuts a local build from
161s to 25s, with the same pages and an identical search index.

Rspack orders one Infima rule after the search box's padding, which
pushed the navbar items right; custom.css restores the padding.
2026-09-27 19:28:48 +08:00