335 Commits
Author SHA1 Message Date
Willie 012a4ba97e fix(ui): resolve stuck update checks 2026-05-25 00:33:26 +08:00
Willie a2f958d288 feat(ui): background mode, in-place upgrade, and PWA support
Three user-visible additions to the web dashboard, plus the CLI surface
needed to drive them.

* `skillshare ui start` / `skillshare ui stop` — run the dashboard as a
  managed background process. Re-running start reuses the existing
  healthy process; stop uses the remembered host/port. Foreground
  `skillshare ui` keeps working unchanged. Process tracking lives in
  ui_process_{unix,windows,other}.go via a PID + current-state file.
* `--app` — opens the dashboard in a Chromium app-mode window (Chrome,
  Edge, Brave) on macOS, Windows, and Linux for a separate Dock/taskbar
  entry without browser chrome.
* In-place upgrade from the browser — the Update dialog and the Doctor
  page's Version card now expose an Update now button. Backed by two
  new endpoints (POST /api/upgrade, POST /api/restart in
  handler_restart_upgrade.go); the browser polls GET /api/health and
  reloads once the new server is ready. Dev builds short-circuit with
  `devMode: true` and a simulated restart so the flow can be exercised
  without rebuilding the binary.
* Progressive Web App — site.webmanifest, app icons (192/512), and a
  minimal service worker registered from main.tsx. Supporting browsers
  can install the dashboard as a standalone desktop app.
* Doctor Version card redesign — state-coloured icon (blue when an
  update is available, green when up to date), explicit
  `current → latest` delta, Update button only when there is something
  to upgrade.
* i18n — translate "DEV mode" in zh-TW / zh-CN / ko (previously left
  as raw English).

Adds CHANGELOG.md and website changelog entries for v0.19.20 and
refreshes website/docs/reference/commands/ui.md to document the new
modes, --app flag, new REST endpoints, and the in-place upgrade flow.
2026-05-24 01:21:06 +08:00
Willie 996d00e342 feat(config): migrate consumers to Effective*Source helpers (Phase 3+5)
Make the v0.19.16 sources map actually do something: route all path
reads through Config.EffectiveSkillsSource() / EffectiveAgentsSource() /
EffectiveExtrasSource() so users who set sources.skills / sources.agents /
sources.extras get the configured paths everywhere.

Mechanical changes (~50 files):
- cmd/skillshare/**: replace cfg.Source / cfg.ExtrasSource reads with
  cfg.EffectiveSkillsSource() / cfg.EffectiveExtrasSource()
- internal/server/**: replace s.cfg.Source / s.cfg.ExtrasSource reads
  with the same helpers; server.skillsSource() / gitignoreDir() use the
  global-mode helper
- internal/config/config_validate.go: validate using EffectiveSkillsSource
  while still rejecting configs that set neither field explicitly
- internal/config/reconcile.go, registry.go: read via helpers

Behavioral fixes (paired with the migration):
- extras init / extras source / POST /api/extras no longer silently
  backfill the legacy extras_source field — the runtime fallback inside
  EffectiveExtrasSource() handles it. This stops surprise diffs in users'
  config.yaml after running extras commands.
- extras source command writes back to whichever field the user already
  configured (sources.extras if set, otherwise legacy extras_source) so
  the update is not shadowed.
- source_type in /api/extras and extras list correctly reports "default"
  vs "extras_source" by inspecting the raw (unresolved) configured value;
  sources.extras counts as configured for this purpose.

UI:
- ui/src/lib/fieldDocs.ts: neutralize sources / sources.* descriptions
  so they describe both project and global modes (Phase 5).

Preserved (intentional):
- Direct writes to cfg.Source / cfg.AgentsSource / cfg.ExtrasSource in
  init, migrate.go, cloneForSave, and server.reloadConfig — these are
  raw-field writes, not path reads.
- Updated test expectations for the removed backfills.
2026-05-21 14:49:11 +08:00
Willie a0d5b561dd docs(ui): add sources map entries to fieldDocs for ConfigPage assistant 2026-05-21 13:57:58 +08:00
Willie 9a7271c1ae fix: address PR #151 review feedback
- Project mode JSON sync now includes context_cost (was nil)
- Server handler respects symlink mode (skips include/exclude filters)
- checkBudget reports all targets exceeding threshold (not just worst)
- Budget warnings include target name in CLI and UI output
- ConfigPage indentation restored to original 2-space style
2026-05-11 21:34:38 +08:00
Willie 786af85ae4 feat(ui): add i18n for context cost section on Sync page
All 11 locales: en, zh-TW, zh-CN, ja, ko, de, es, fr, pt-BR, id, fa.
2026-05-11 21:34:38 +08:00
Willie 06d2f9fefa refactor(ui): remove redundant context budget card from ConfigPage
The assistant panel already shows field documentation via JSON schema.
A static reference card is redundant and breaks the page's interaction
pattern of cursor-driven contextual help.
2026-05-11 21:34:38 +08:00
Willie 60ed5eb857 feat(ui): add context budget reference to Config page 2026-05-11 21:34:38 +08:00
Willie 1ea07afeea feat(ui): display context cost and budget warnings on Sync page 2026-05-11 21:34:38 +08:00
Willie e48a301623 feat: add azure_hosts config for Azure DevOps Server on-premises
Add azure_hosts config parameter (analogous to gitlab_hosts) that allows
users to register self-hosted Azure DevOps Server hostnames so they
receive proper URL parsing without appending .git to clone URLs.

- Add AzureHosts field to Config and ProjectConfig structs
- Add SKILLSHARE_AZURE_HOSTS env var support with merge semantics
- Generalize hostname validation into shared normalizeHostList/mergeHostsFromEnv
- Add azureOnPremPattern regex and parseAzureOnPrem for /_git/ URL routing
- Add isAzureHost for config-based host detection (no auto-detect)
- Update TrackName to handle on-prem Azure DevOps clone URLs
- Wire AzureHosts through InstallContext, ParseOptions, and Server
- Add JSON Schema, UI fieldDocs, and website documentation
- Add 19 new tests covering config, source parsing, and server

Closes #147
2026-05-05 18:33:07 +08:00
Willie 07c091529b refactor(search): harden preview error handling, cache, and a11y
- Add ErrSkillNotFound sentinel error in search/preview.go so callers
  can distinguish 404 from other errors with errors.Is instead of
  brittle string matching
- Cap previewCache at 200 entries with TTL purge + full reset on
  overflow to prevent unbounded memory growth
- Make Card and SearchResultsTable rows keyboard-accessible
  (role=button, tabIndex=0, Enter/Space handlers)
- Refactor SkillPreviewModal to accept a single SearchResult prop
  instead of 6 individual fields — reduces prop drilling and keeps
  the modal in sync with the result shape
- Fix search_online_test: add --list flag so output is not gated
  behind interactive TUI
2026-04-23 16:46:53 +08:00
Willie a3235473eb feat: add skill preview modal to Search page (#141)
Add a preview modal so users can read a skill's SKILL.md content
before installing. Clicking a search result card or table row opens
the modal; the Install button is now inside the modal.

Backend:
- New GET /api/preview?source=owner/repo/path endpoint
- FetchSkillContent fetches SKILL.md from GitHub Contents API
- Git Tree API fallback for hub sources where the install shorthand
  doesn't match the repo's actual file path
- In-memory TTL cache (5 min) via sync.Map
- Proper 404/429/500 error handling with rate-limit support

Frontend:
- SkillPreviewModal component (DialogShell-based, lazy-fetch)
- Cards and table rows clickable to open preview
- Graceful fallback: if fetch fails but hub metadata exists, show
  description + tags instead of error
- Hide Stars column in table view for hub mode
- Fix Card component missing onClick prop passthrough
- Fix IntersectionObserver not reconnecting after loading more items
- Prevent background scroll when any modal is open (DialogShell)
- i18n keys added to all 11 locales

Closes #141
2026-04-23 14:20:42 +08:00
Willie 63a4a57a0c feat(ui): allow editing source URL on skill detail page
Add PATCH /api/resources/{name}/source endpoint to update the source URL
for installed skills. For tracked repos, all sibling skills sharing the
same git remote are updated together with the new repo base URL, and the
git remote origin is also updated.

Frontend changes:
- Add Source URL input field in the skill editor (visible for all skills
  with metadata)
- Use shared Input/Textarea components in FrontmatterEditor for visual
  consistency, with new size='sm' variant
- Replace custom kind-badge/tracked-badge with shared KindBadge/SourceBadge
  components in the editor header
- Preserve original YAML frontmatter formatting when only the body or
  source URL is changed (avoids spurious quote style / line wrap diffs)
- Skip diff review dialog when only source URL is modified

Backend fixes:
- Two-pass skill lookup in handleGetSkill: prefer exact FlatName match
  over baseName fallback to prevent name collisions between standalone
  and tracked repo skills
- Add basename-only fallback in MetadataStore.GetByPath for tracked repo
  skills stored with short keys
- Use cfg.Source (global) consistently in save/patch handlers to match
  the source used by list/detail handlers in project mode

Closes #142
2026-04-22 23:06:53 +08:00
Willie 10126e034e feat(ui): highlight $ARGUMENTS tokens on detail page
Extract highlightArgs utility from SkillEditor to shared lib so both
the editor and ResourceDetailPage render $ARGUMENTS with the warning
badge style.

- Add p/li component overrides in ResourceDetailPage mdComponents
- Move .arg-token CSS from scoped editor styles to global index.css
- Simplify argsCount to hasArgs boolean (count display removed)
- Remove ×{count} prefix from argsHint in all 11 locales
2026-04-20 12:40:07 +08:00
Willie 6353bb2e7c fix(ui): remove unused prefix variable in InstallForm 2026-04-19 09:29:18 +08:00
Willie 489cbcffae feat: add i18n 2026-04-19 09:29:18 +08:00
Willie f4409e7ee0 feat(i18n): extract DashboardPage strings to en.json
Replace all hardcoded English strings in DashboardPage.tsx with t() calls
using the existing useT() hook from the custom i18n system.

Added ~80 new dashboard.* keys to en.json covering:
- Stats cards (skills, agents, targets, extras)
- Source directories section
- Star CTA reminder
- Tracked repositories (labels, toasts, confirm dialogs)
- Skill updates section (status badges, check buttons)
- Security audit section (summary stats, findings)
- Targets health section (drift warnings, sync status)
- Version status section (CLI/skill version badges)
- Quick actions (sync, audit, browse, update all)
- Toast messages with parameterized interpolation

Also renamed loop variable 't' to 'tgt' in TargetsHealthSection to
avoid shadowing the t() translation function.
2026-04-19 09:29:18 +08:00
Willie e3c5208b50 style(ui): restore paper-themed segmented control in skill editor
The shared SegmentedControl has no gap between icon and label, making
Edit/Split/Preview look cramped. Revert the visual to the original
editor-themed .seg-btn/.seg-group CSS (4px icon gap, paper background,
shadow-sm active state).

Keep the DRY JSX win by introducing a small EditorSegment helper that
renders the same markup the three inline call sites previously duplicated.
2026-04-19 09:29:18 +08:00
Willie 0c5efdb291 test(ui): update useCursorField test for bare list value handling
resolveFieldPath() was intentionally updated in 7c913086 to treat bare
list values like "- skill-a" as resolvable keys (for short-form target
name docs lookup), but the corresponding test still asserted the old
null-returning behaviour and had been failing silently ever since.
2026-04-19 09:29:18 +08:00
Willie fdf2ce0f6f refactor(ui): consolidate skill editor controls and throttle scroll sync
Follow-up to the earlier simplify pass — addresses the larger refactors
called out by the three review agents:

- Drop local SegmentedField in favour of the shared SegmentedControl used
  across the dashboard; reuse it for the Fields/YAML toggle, the
  Edit/Split/Preview mode switcher, and the enum frontmatter fields. Removes
  ~34 lines of duplicated .seg-group / .seg-btn CSS.
- Split the 80-line FrontmatterField if/else into per-type subcomponents
  (EnumField / BoolField / ArrayField / TextField) dispatched from a small
  FieldControl switch. The synthetic 'conditional' field type is gone —
  visibility is now a plain 'showWhen' predicate on a 'text' field, with an
  optional 'placeholder' override.
- Extract a shared CollapsibleGroup wrapper; both FrontmatterGroup and
  FrontmatterMetadataGroup use it, deleting the copy-pasted fm-group chrome.
- requestAnimationFrame-throttle the synced-scroll handlers. Previously
  every onScroll event (~60×/s) ran buildSyncAnchors, which measures
  scrollHeight / getComputedStyle / querySelectorAll and sometimes the DOM
  mirror. Now one pass per frame per scroll source, with RAF + timer
  cleanup on unmount.

useLineDiff consolidation was considered but skipped — computeLineDiff
returns only add/remove rows, whereas DiffView needs the eq rows for the
side-by-side view, so merging would complicate the shared hook.
2026-04-19 09:29:18 +08:00
Willie 615bcf9f66 refactor(ui): simplify skill editor — dedupe parser, defer preview, drop dead code
- Drop unused EditorCustomField / initialCustomFields / draftTargets / FileText
  re-export; narrow onSaved signature to (nextContent: string).
- Gate DiffView render on showDiff so the O(n·m) LCS + composeSkillMarkdown
  don't run on every keystroke while the dialog is closed.
- Route the markdown preview and Outline through useDeferredValue so typing
  stays responsive while react-markdown catches up.
- Serialize frontmatter YAML lazily (only when yamlMode is active).
- Equality-guard the metadata-row reconcile effect to avoid no-op setState
  storms on every frontmatter keystroke.
- Memoize derived stats (tokens/words/lines) into a single pass instead of
  two splits per render.
- Replace the private YAML parser in ResourceDetailPage with
  lib/frontmatter's parseSkillMarkdown; removes ~60 LOC of duplicate logic.
- Remove WHAT-narrating comments ("Keyboard shortcuts", "Derived stats",
  "Stage 1: Content Stats Bar", etc.).
2026-04-19 09:29:18 +08:00
Willie 5fc5ee4fe5 feat(ui): add web-based skill editor with metadata, live preview, and diff review
Introduces a full in-browser skill editor reachable from the skill detail
page, replacing the previous read-only detail view for edits.

Editor
- Two-pane layout with Markdown textarea, live preview, and synced scroll
- Edit / Split / Preview mode toggle in the status bar (⌘P to cycle)
- Keyboard shortcuts: ⌘S save (with diff review), Esc cancel
- Outline drawer with jump-to-heading
- Token / word / line / file count in status bar, 5K budget warning

Frontmatter
- Grouped field editor (Identity / Invocation / Execution / Metadata)
  matching the 13 official SKILL.md fields
- Shared 1,536-char budget enforced across description + when_to_use
- Switch toggles for booleans, segmented control for enums, chip array
  inputs for list-valued fields
- Metadata group edits nested metadata.* keys directly, with stable row
  ids so typing key → clicking value no longer remounts the inputs
- Special handling for metadata.targets so values serialize as a YAML
  list (backend ParseFrontmatterList requires arrays)
- YAML mode for raw editing; Fields ↔ YAML round-trips cleanly
- Legacy root-level 'targets:' migrated to metadata.targets on load

Diff review
- Save triggers a side-by-side diff modal built on the shared DialogShell
  with focus trap and backdrop, using the Button component for actions
- YAML serializer emits plain scalars when safe instead of wrapping every
  value containing ':', '*', '#', or '"', eliminating spurious churn in
  the save diff

Misc
- DialogShell gains 4xl–7xl maxWidth presets
- Resource detail sidebar shows a Targets row when metadata.targets is set

Backend additions (server handlers):
- POST /api/resources/:name/content   save SKILL.md content
- POST /api/resources/:name/open      open in local editor
2026-04-19 09:29:18 +08:00
Willie 85abcb8bd6 chore: release v0.19.2 2026-04-14 18:16:11 +08:00
Willie 8a2196acdb feat(ui): show local agent count in targets and fix agent batch uninstall
Add agentLocalCount to target API and CLI JSON output so the UI can
display how many local (non-source) agents exist per target.

- Add LocalCount to AgentSummary, computed via FindLocalAgents
- Surface agentLocalCount in both CLI target list JSON and server API
- Show local agent counts in target detail summaries (CLI + UI)
- Collect button now appears for targets with local agents and routes
  to CollectPage with scope=agent query param
- CollectPage reads scope from URL and auto-scans on mount
- Fix BatchUninstallPage: agents tab was collapsing individual agent
  names into the repo name via buildApiNames(), causing 'agent not
  found' errors; now sends each agent flatName individually
- Invalidate targets + diff queries after successful collect
2026-04-14 18:03:41 +08:00
Willie 5d17da89c7 fix(ui): show tab-aware empty text on Uninstall Agents tab
"No skills match your filter" now correctly says "No agents match
your filter" when the Agents tab is active.
2026-04-14 14:41:10 +08:00
Willie 80061a7107 fix(ui): show tab-aware empty state on Resources Agents tab
The empty state always displayed skill-related copy (icon, title,
description) regardless of which tab was active. Now it switches to
agent-specific text and the Bot icon when the Agents tab is selected.
2026-04-14 14:40:22 +08:00
Willie 526fbbd03a fix(ui): add missing 'warning' variant to Button component
UpdatePage uses variant="warning" on the Force Retry button for
blocked items to visually distinguish them from error-state Force
Retry (which uses danger). The Button component didn't expose a
warning variant, causing the Docker build to fail with a TS2322
type error.

Adds warning alongside existing danger variant, mirroring the same
outlined-with-hover-fill pattern and matching the warning color
scheme already used by Badge and in-line text-warning classes.
2026-04-10 17:55:19 +08:00
Willie 8d8434d6d8 fix(ui): remove pop-in check progress bar to avoid layout shift
The large StreamProgressBar appeared between the PageHeader and the tab
bar when checking started, pushing the whole list down. Loading state
is already conveyed by the Check All / Check Selected button spinners
and the per-item 'Checking' badges, so the big bar was redundant.
2026-04-10 13:40:43 +08:00
Willie c501e55c1d fix(ui): propagate tracked repo check status to all items in the repo
Check results were keyed by repo directory name (e.g. _awesome-claude-agents)
while UI items used per-skill names (api-architect, backend-developer, ...).
applyCheckResult now iterates updatable items and maps each repo's status
to all items belonging to it, so tracked repo entries no longer get stuck
in the Checking state.
2026-04-10 12:00:33 +08:00
Willie 17ab4aaeb2 feat(ui): add skills/agents tabs and group-based sort to UpdatePage 2026-04-10 11:55:14 +08:00
Willie 03a7b7ab13 refactor(ui): fix quality issues in UpdatePage — EventSource leak, dedup status cards, shared glob utility
- Store api.updateAllStream() return value in esRef so unmount cleanup
  closes both check and update EventSource connections
- Extract ItemStatusCard component to deduplicate ~50 lines of per-item
  status card rendering between updating and done phases
- Wrap successCount/skippedCount/blockedCount/errorCount in a single
  useMemo pass instead of 4 separate .filter() calls
- Move globToRegex to ui/src/lib/glob.ts shared utility, imported by
  both UpdatePage and BatchUninstallPage
2026-04-10 03:56:33 +08:00
Willie 7537872743 fix(ui): address spec compliance issues in UpdatePage
- CheckItemStatus: change from flat string union to interface with
  status, message?, and behind? fields; applyCheckResult now preserves
  repo.behind and repo.message; CheckStatusBadge renders 'N behind'
- Done phase: blocked items now show Force Retry button (variant=warning)
- Search filter: add globToRegex for glob pattern matching (* and ?)
- Check button loading: track checkMode ('all'|'selected'|null) state
  so loading spinner shows on the correct button regardless of selection
2026-04-10 03:48:29 +08:00
Willie 3df973c8bb feat(ui): redesign UpdatePage with selecting/updating/done phases
Replace the old idle/updating/done flow with a new three-phase state machine:

- selecting: Virtuoso checkbox list of all tracked + GitHub skills with
  sticky search bar, SegmentedControl type filter (All/Tracked/GitHub),
  Select All/Deselect All, and per-item CheckStatusBadge
- updating: StreamProgressBar + per-item status cards with auto-scroll
- done: Summary card with badges + per-item result cards with
  Force Retry/Purge buttons + Back to List

Key changes:
- No auto-check on mount; manual Check All / Check Selected buttons
- Check results stored in Map<string, CheckItemStatus> with 6 states
- Unified selection via Set<string> (no split repos/skills)
- Repo deduplication in handleUpdate (same repo = one update)
- Action buttons in PageHeader (not bottom bar)
- No confirm dialog before update
- useQuery for skills list (replaces inline SSE-only check)
2026-04-10 03:41:20 +08:00
Willie 0efdb643b2 feat(ui): add .agentignore tab to Config page
Add GET/PUT /api/agentignore endpoints mirroring the existing
skillignore API, backed by skillignore.ReadAgentIgnoreMatcher()
and resource.AgentKind{}.Discover() for ignore stats.

On the frontend, extend the Config page with a third tab for
editing .agentignore. Generalize the former SkillignoreTab into
a shared IgnoreTab component with a kind prop, and extend
AssistantPanel to show ignored agents in the sidebar.
2026-04-10 03:38:43 +08:00
Willie 379407e3dd fix(ui): use GitBranch icon instead of folder for tracked repos in tree view
Tracked repo folders now show a single GitBranch icon replacing the
folder icon, avoiding the awkward two-icon layout.
2026-04-10 03:22:55 +08:00
Willie abeb5b9392 fix(ui): unify resource terminology and compact action bars
- Rename 'Uninstall Skills' → 'Uninstall Resources' on BatchUninstallPage
- Rename 'Pull local skills' → 'Pull local resources' on CollectPage
- Rename 'Push your skills' → 'Push resources' on SyncPage
- Compact Sync/Collect action bars: inline SegmentedControl + button
  on the same row instead of stacked vertically
- Replace badge grid sync summary with inline text stats (dot-separated)
  showing totals with a secondary skill/agent breakdown line
- Simplify 'all in sync' state to single-line inline layout
2026-04-10 03:15:03 +08:00
Willie 0838ee6367 fix(ui): replace Track badge with GitBranch icon in tree view
The badge looked out of place in the folder tree. A subtle GitBranch
icon integrates better with the tree aesthetic.
2026-04-10 03:14:20 +08:00
Willie 8970a5ee56 fix(ui): sort table view by group/repo before name
Items from the same tracked repo or directory group are now sorted
together instead of being interleaved alphabetically by name alone.
2026-04-10 03:13:15 +08:00
Willie 7a319fa8f3 fix(ui): remove duplicate Track badge from card view
The Track badge in SkillPostit was redundant with the existing Tracked
indicator at the bottom. Revert to Users icon — Track badge is only
used in the folder tree view.
2026-04-10 03:12:15 +08:00
Willie cbbfcde390 fix(ui): improve Sync page stats layout and ignored section grouping
- Replace flex-wrap badge layout with CSS Grid for aligned KindBadge rows
- Fix ignored count showing only skills instead of total (skills + agents)
- Group ignored items by kind (skill/agent) with KindBadge sub-headers
- Increase spacing between groups for better visual hierarchy
2026-04-10 02:38:44 +08:00
Willie 0e314e19e3 fix(ui): apply Track badge and name formatting to sticky folder header 2026-04-10 02:26:47 +08:00
Willie 3c4d057950 refactor(ui): centralize display name formatting via resourceNames utilities
Replace 25+ inline .replace(/__/g, '/') calls with shared utilities:
- formatSkillDisplayName() for flat name → path conversion
- formatTrackedRepoName() for tracked repo name display (strip _ + unflatten)
- formatAgentDisplayName() for agent names (.md removal + unflatten)

Consolidate error toasts into single summary in DashboardPage update-all.
Remove duplicate displayPath() in BatchUninstallPage (was reimplementing
formatSkillDisplayName).

Backend: refactor agentIgnorePayload to accept pre-discovered agents,
eliminating duplicate filesystem traversal in sync/diff handlers.
2026-04-10 02:25:27 +08:00
Willie 92d5fc66ba fix(agents): exclude convention files and respect agents/ subdir in tracked repos
Agent discovery was treating non-agent files (CLAUDE.md, AGENTS.md, etc.)
as agent resources when they appeared in tracked repos.

Two fixes:
- Expand ConventionalExcludes with 7 well-known convention filenames
  (CLAUDE.md, AGENTS.md, GEMINI.md, COPILOT.md, CONTRIBUTING.md,
  CODE_OF_CONDUCT.md, SUPPORT.md)
- For tracked repos with an agents/ subdirectory, only discover files
  inside agents/ — skip repo root files and other subdirs (docs/, etc.)

Also includes UI polish:
- Display flat names (__ separator) as path separators in toasts/labels
- Consolidate batch install errors into single toast
- Show .agentignore state in sync diff/preview responses
- Track badge + friendly repo name in resource list/folder tree
2026-04-10 02:14:15 +08:00
Willie 5c99a1cb9f feat(ui): audit cache invalidation, agent target display, UX polish
- auditCache: centralized cache with installed-count staleness check
- resourceNames: agent display name formatting (strip .md suffix)
- AuditPage: skip audit when 0 installed, show empty state per kind
- clearAuditCache on install/uninstall/update across all pages
- ResourcesPage: agent target summary, context menu for agents
- FilterStudioPage: agent display name in preview search
- SkillPickerModal: accessible radio button (button element)
- fieldDocs: agents sub-keys no longer marked reserved
- Integration tests: diff/sync prune after uninstall-all, tracked agent install
2026-04-10 02:05:23 +08:00
Willie b8a189ba58 Improve resource install agent support
Add local-path resource discovery so install flows can detect agents as well as skills. Preserve nested agent paths and suffixless agent metadata keys during batch install and update, and refresh the UI copy to use resource-aware wording on the install surface.
2026-04-10 01:26:40 +08:00
Willie 35fcb7475b feat(ui): add SegmentedControl for agent scope on Collect page
CollectPage now has Skills/Agents/Both scope selector matching
SyncPage pattern. Scan and collect operations pass kind to API.
Selected set uses 3-segment key (target/kind/name) to prevent
collision between skills and agents with same name.
2026-04-10 00:28:39 +08:00
Willie bf2aff0059 feat(ui): extend collect API client with kind parameter
collectScan now accepts optional kind param for agent scanning.
collect method items accept optional kind field.
2026-04-10 00:25:53 +08:00
Willie a73d55dc26 refactor: extract agent helpers and simplify duplicated patterns
- Extract agent_helpers.go: kind constants, discoverActiveAgents(),
  resolveAgentPath(), builtinAgentTargets(), mergeAgentDiffItems()
- Replace 3 inline agent path resolution blocks with resolveAgentPath()
- Replace 3 inline agent discovery blocks with discoverActiveAgents()
- Replace 2 inline diff merge blocks with mergeAgentDiffItems()
- Fix handleSync prune triple-scan: capture index from merge pass
- Frontend: replace 10 filter() calls with single useMemo reduce pass
- Use kind constants instead of raw strings across all server files
2026-04-10 00:02:53 +08:00
Willie 568d2b7f64 fix: address code review findings
- Fix data race: read agentsSource inside RLock in handleDiffStream
- Validate kind param in handleSync (reject invalid values)
- Add test for symlink-points-elsewhere agent diff case
- Always show KindBadge on DiffItemRow (default to 'skill')
2026-04-09 23:50:42 +08:00
Willie 3dfbff7f53 feat(ui): add sync scope control and kind-separated summary
- SegmentedControl with Skills / Agents / Both options (default: Both)
- Sync button text and API kind param change with selection
- Diff summary shows separate skill/agent counts with KindBadge
- Split button labels (Force Sync) also reflect scope
2026-04-09 23:44:33 +08:00