262 Commits
Author SHA1 Message Date
Willie 3743a1ef3f fix(sync): honor file ignore patterns in copy mode
Apply config ignore patterns to copy-mode file traversal, checksum, mtime, CLI diff, and server sync/diff paths.

Add default ignores for .DS_Store, .git, and __pycache__ in global and project init configs.

Tests: go test ./... -count=1
2026-06-29 10:30:11 +08:00
Willie 54ae7b04e2 fix(install): reject project-root self-install via web UI
The project-root self-install guard lived only in the CLI handler, so the
web UI could still copy the project root into its own .skillshare/skills/
subtree in project mode. Extract the check into a shared
install.RejectProjectRootLocalInstall and apply it in handleInstall and
handleInstallBatch, returning 400 with the same guidance.

Also restructure the rejection message into a cause line plus an
actionable "Run '...'" hint, matching the project's error convention.
2026-06-16 10:04:57 +08:00
Willie 140df6b4c9 fix(server): surface git fetch failures
Return errors from branch refresh and checkout when git fetch fails instead of serving stale refs or proceeding with checkout.

Cover branch-list and checkout fetch failures with server regression tests.
2026-06-14 15:08:19 +08:00
Willie 224607af81 fix(server): fail source updates when remote update fails
Update tracked repo remotes before persisting source metadata so the API cannot report success while the on-disk git remote remains unchanged.

Cover both remote update failure and successful remote plus metadata updates.
2026-06-14 15:01:51 +08:00
Willie e5cf18eef5 fix(server): preserve targets when cleanup fails 2026-06-14 13:37:35 +08:00
britz 11c31ab742 fix: handle os.Remove and filepath.Rel errors in symlink conversion 2026-06-14 02:43:32 +08:00
Willie 54dd7d12a3 fix(update): surface missing tracked repos in update --all across CLI, API, and UI
When tracked repo metadata is committed but the gitignored clone dirs are
absent on a fresh machine, `update --all` silently reported zero work: the
batch path skipped missing repos with no message, and the web UI's
update-all paths only listed repos present on disk.

Missing tracked repos are now detected and surfaced everywhere:
- CLI: a warning block (human output) plus an aggregated
  `missing_tracked_repos` summary (names + one-shot rehydrate hint) in JSON;
  the per-item error is concise. Fixed for both global and project modes,
  and batch and single-target paths.
- Server: GET /api/update/missing-tracked-repos and the update-all/stream
  summaries report them; POST /api/update/rehydrate re-clones them from
  metadata (mirrors bare `skillshare install`).
- UI: the Update page shows a warning banner listing missing repos with a
  Rehydrate button; strings added to all 11 locales.

Closes #212
2026-06-11 15:32:28 +08:00
Willie abdee142b9 fix(ui): respect agent filters during sync 2026-06-11 01:46:08 +08:00
Willie 59754ca3e6 fix(sync): resolve agent target aliases 2026-06-11 01:32:34 +08:00
Willie 2b08bdf400 fix: use relative project symlinks for agents 2026-06-10 23:39:45 +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
Willie 6e86537987 fix(audit): honor enabled:false for synthetic tier and cross-skill findings
Tier and cross-skill findings are generated programmatically rather than
compiled from the rule list, so they bypassed the disabled-ID filter applied
at rule-compile time. Setting enabled:false in audit-rules.yaml marked the
rule disabled in the listing but the scan still fired it at full severity.

Filter synthetic findings against the disabled-ID set in both the skill-scan
and single-file paths, threading the set through the cross-skill call sites
(analyzer, cmd, server). Fixes #204.
2026-06-05 20:51:32 +08:00
Willie 419bbaabf0 fix(server): uninstall disabled skills from resource endpoint 2026-06-03 22:33:11 +08:00
Willie 694d784799 fix(preview): render SKILL.md for non-github.com hub sources
The web UI skill preview always fetched SKILL.md via api.github.com, so skills from GHE or other non-github.com hubs showed only index metadata (name, description, tags) instead of the full rendered content.

FetchPreview now resolves the source platform: github.com and GHE use the host's REST Contents API, while other platforms (GitLab, Bitbucket, Azure, SSH) fall back to a shallow clone. Sources whose content can't be retrieved degrade gracefully with a clear notice in the modal.

Fixes #193
2026-06-03 15:37:57 +08:00
Willie acb150dfe3 fix(server): allow uninstalling disabled skills via Web UI
The skill list endpoint discovers skills with DiscoverSourceSkillsAll
(which includes disabled skills), but the uninstall handler used
DiscoverSourceSkills, which excludes anything listed in .skillignore.
A disabled skill therefore stayed visible in the dashboard yet failed
to uninstall with "skill not found".

Switch handleBatchUninstallSkills to DiscoverSourceSkillsAll so the two
endpoints agree on which skills exist. The CLI was unaffected.

Fixes #190
2026-06-02 23:48:09 +08:00
Willie 86b91efe95 feat(extras): refine per-target management UI and path resolution
UI (Extras page):
- Label per-target flatten/extension/mode controls with column headers
- Render flatten as a dropdown so it matches the adjacent selects
- Collapse the add-target form behind a button and widen the path input
- Confirm before removing a target
- Polish layout: tinted icon, inset source chip, hover rows, aligned columns

Components:
- Select: bound the dropdown width so long option descriptions wrap instead
  of stretching the popup across the page
- Toast: render messages multi-line, widen the container, and give
  error/warning toasts more time to read

Sync feedback:
- Restructure extras sync-failure toasts into readable lines and fix the
  contradictory "N more errors" count (new nMoreErrors translation)

CLI/server:
- Match extra target paths by resolved absolute path (handles ~ vs /home)
  when adding, removing, or updating targets
2026-06-02 18:40:00 +08:00
Willie 78a06da3d2 feat(server): add per-target add/remove endpoints for extras 2026-06-02 17:16:21 +08:00
Willie 1d0ee69955 feat: support SSH hub sources for private and GHE hosts
Hub index fetch previously handled only unauthenticated HTTP(S) GET or
local file paths, leaving private and GitHub Enterprise repos out of
reach — raw HTTPS URLs redirect to login before token headers apply, and
SSH-style hub URLs were unrecognized.

Resolve SSH hub sources by shallow-cloning the repo with the user's SSH
keys and reading the index from it. The in-repo index path uses the
existing //path subdir convention (consistent with `install`), defaulting
to skillshare-hub.json at the repo root. Both scp-style and ssh:// URLs
are accepted. In the web dashboard, SSH clones are restricted to saved
hubs so a request-supplied URL can't drive an arbitrary clone.

Ref #185
2026-06-02 16:29:25 +08:00
Willie 4d08690d36 fix(review): address PR #174 review feedback
- handler_git: dashboard Pull auto-sync now uses EffectiveSkillsSource()
  instead of the git_root scope dir, so it no longer mangles skill rel
  paths (skills/foo -> skills__foo) when git_root is root/agents/extras
- extension: run the transform subprocess via CommandContext with a 30s
  timeout so a hung extension can't block sync indefinitely
- md-toml.js (codex-agents, gemini-commands): escape values via
  JSON.stringify so control characters produce valid TOML basic strings
- gitroot: quote paths in the commit/push mv guidance so paths with spaces
  can be pasted safely
- extras list + extras server handlers: warn when an extension fails to
  resolve instead of silently falling back and reporting false drift

Lock-contention suggestions on handleSetGitRoot/handleAbsorbNested are not
applied: this is a single-user localhost dashboard, and dropping the write
lock around .git-mutating operations trades safety for negligible throughput.
2026-05-30 19:23:12 +08:00
Willie e1c4761333 fix(extras): apply output_ext when computing diff target filenames
The /api/extras/diff path resolved the copy mode but ignored a transform
extension's output_ext, so buildExtrasDiffItems compared source relative
paths against the target directory. After a .md -> .toml transform sync,
the diff looked for the original .md name and reported false drift, even
though the status path already handled this.

Export ApplyOutputExt as the single source of truth for source->target
filename mapping (previously unexported applyOutputExt) and use it in the
diff path so sync, status, and diff all agree on the transformed name.
2026-05-30 19:23:12 +08:00
Willie 2f6f6bd052 fix(git): enforce root-scope safety on commit/push instead of warning
Root-scope git operations detected hazards but proceeded anyway, letting
preventable mistakes reach the remote:

- Nested git repos were only warned about, then committed/pushed as empty
  submodules (silent data loss). Now commit/push abort (CLI non-zero exit,
  server 400) until the nested repos are disabled, and the web UI disables
  the commit/push buttons while any are present.
- The pre-stage safety sweep ran before the dry-run check, so `--dry-run`
  wrote .gitignore and ran `git rm --cached config.yaml`. The sweep/guard is
  now strictly read-only on dry-run and only reports what would change.
- Server git endpoints used EffectiveGitRoot() without validating git_root,
  so a hand-edited invalid scope silently fell back to skills. They now share
  a gitSource() guard that rejects invalid scopes with 400, mirroring the
  CLI's resolveGitRoot.
2026-05-30 19:23:12 +08:00
Willie 7419bc74d2 fix(extras): resolve extension target mode consistently in CLI and server
The dashboard computed extension target status with EffectiveMode, which defaults an empty mode to merge, so a valid transform extension target (extension set, no explicit mode) was always reported as drift. Introduce sync.ResolveExtensionMode as the single source of truth (empty/copy resolve to copy, anything else errors) and use it across the CLI, sync, status, and diff paths.
2026-05-30 19:23:12 +08:00
Willie eda9ac75a4 feat(git-root): guard root scope against submodule traps and config leaks
At the root git_root scope, `git add -A` over the config base directory
records any subdirectory that has its own .git (e.g. the skills source) as
an empty submodule, and can commit the machine-specific config.yaml.

- Detect nested repos and warn before commit/push (CLI) or surface them on
  the Git Sync page with a one-click "Disable nested .git" action (UI),
  which renames .git to .git.disabled (reversible) and drops any stale
  gitlink from the index so the directory's files track as normal blobs.
- Keep config.yaml out of a root-scope repo automatically: ensure it is
  ignored and untrack it (git rm --cached) before staging, on both the CLI
  and the web UI commit/push paths.
- Expose nestedRepos/configTracked in GET /api/git/status and add
  POST /api/git/absorb-nested (validated against detected nested repos).
2026-05-30 19:23:12 +08:00
Willie 96ead0b361 feat(ui): make Git Sync not-a-repo state actionable
The not-a-repo state was a dead end: the scope switcher only rendered once a
repo existed, so there was no way to initialize git or set a remote from the
UI. Add an 'Initialize git repository' button that opens the existing scope
dialog (with optional remote) — POST /api/git/root already inits the scope
repo and wires origin. Dialog title/message adapt for the init case.

Also detect a missing git executable: gitStatus reports gitInstalled (via
exec.LookPath), the page shows a clear 'Git is not installed' notice instead
of a cryptic 500 on init, and handleSetGitRoot rejects with a plain message.
2026-05-30 19:23:12 +08:00
Willie 53e5b2455b feat(ui): set git remote during scope switch on Git Sync page
The Git Sync scope switcher now accepts an optional remote URL, reaching
UI parity with the CLI's `init --git-root <scope> --remote <url>`. The
POST /api/git/root handler takes an optional remoteURL and wires origin on
the just-initialized scope repo via a new git.SetOrAddRemote helper (adds
origin when absent, updates the URL otherwise). Adds gitSync.scope.remote*
strings across all locales.
2026-05-30 19:23:12 +08:00
Willie 372dd65768 fix(extras): enforce --force contract and consistent status for transform extensions
Transform-extension sync previously wrote each generated file via
runExtensionFile unconditionally, so a regular local target file (e.g. a
hand-edited hello.toml) could be overwritten from hello.md without --force,
violating the same conflict contract that copy/merge modes honor.

- Split runExtension (subprocess → bytes) from runExtensionFile (writes),
  and have syncExtraTransform apply the conflict/force rules: idempotent
  when identical, skipped on conflict without --force, overwrite with
  --force, and auto-replace leftover symlinks.
- Centralize the copy-only mode rule in SyncExtra so the API and CLI reject
  extension+merge/symlink identically; align the server sync handler's mode
  normalization (EffectiveMode's "merge" default no longer leaks through).
- CLI `extras list` no longer short-circuits to an "extension" status before
  existence/drift checks. Status is now computed via output_ext-aware
  CheckSyncStatus; a new Extension field carries the display label, decoupled
  from sync status (plain-text + TUI rendering updated).
- Roll back the optimistic cache update in the UI mode-change handler on
  failure (fixes the unused-var build break).

Adds regression tests covering conflict skip/force/idempotent/symlink-replace
and non-copy mode rejection.
2026-05-30 19:23:12 +08:00
Willie f88044e2cc fix(extras): report synced status for transform targets
CheckSyncStatus compared each source file against targetDir/<source-name>,
but a transform extension renames output (foo.md -> foo.toml), so the
.toml file was never found and the target was always reported as drift —
even right after a successful sync. Thread the extension's output_ext
through CheckSyncStatus so the expected target filename matches the
transformed output. The web list now resolves the spec to pass it.
2026-05-30 19:23:12 +08:00
Willie 5fbe4a76f0 feat(ui): remove installed extensions with in-use guard
Add a Remove action to each installed extension in the Config Extensions
list (DELETE /api/extensions/{name}). The list now reports used_by — the
extras whose targets reference each extension — so the row shows an
in-use badge and the confirm dialog warns, in danger style, which extras
will fail on next sync before removing. Path-traversal names are rejected
server-side. Includes server tests for usage reporting and removal.
2026-05-30 19:23:12 +08:00
Willie 9aa09de9c0 fix(extras): apply transform extension on all sync paths
The web UI sync handler, sync --all --json, and the extras TUI sync all
passed a nil ExtensionSpec to SyncExtra, so a target's configured
extension was silently ignored — files were copied verbatim (e.g. .md
stayed .md instead of being transformed to .toml). Resolve the per-target
extension on each path, mirroring the regular CLI sync. Add a server
regression test asserting the transform runs (output renamed to .toml).
2026-05-30 19:23:12 +08:00
Willie fcbfd39be2 refactor(extensions): describe and rename built-ins by output
md2codex / md2gemini named the *input* (markdown) and read poorly. Rename
the bundled extensions after what they produce: codex-agents and
gemini-commands. Turn the BuiltinExtensions catalog into structs carrying
a human-readable description so the dashboard can explain each one before
install, and propagate the new names across tests and docs.
2026-05-30 19:23:12 +08:00
Willie a42cf78f19 feat(ui): add extension picker to Add Extra modal
The create-extra dialog now offers the same per-target extension
dropdown as the Extras cards. Selecting an extension forces the target
into copy mode and disables the mode selector. createExtra carries the
extension, and the server coerces such targets to copy mode on create.
2026-05-30 19:23:12 +08:00
Willie 3b927ff4f1 fix(ui): open extensions directory in file manager, not editor
The "Open directory" action launched a text editor; switch it to the
OS file manager (Finder on macOS, Explorer on Windows, xdg-open on
Linux/BSD) so it reveals the folder as users expect. Drop the editor
override parameter and the {editor} toast placeholder.
2026-05-30 19:23:12 +08:00
Willie f6eca1fc7d feat(ui): add extensions management to Config page
Add an "Extensions" tab to the Config page for managing transform
extensions in the active mode (global or project):

- GET /api/extensions lists installed extensions with their manifest
  descriptions, merged with the built-in catalog so users can see what
  is available to download.
- POST /api/extensions/install downloads a whitelisted built-in
  extension into the active mode's extensions directory.
- POST /api/extensions/open opens that directory in the user's editor,
  mirroring the skill "open in editor" affordance.

ExtensionSpec now carries the manifest description so the list can
surface it. The UI shows installed extensions with a built-in badge,
available built-ins with a Download button, and an Open-directory
action. Strings are translated across all 11 locales.
2026-05-30 19:23:12 +08:00
Willie f6c9b98562 feat(ui): add per-target extension picker to Extras page
Surface the per-target extension transform in the dashboard. A new
GET /api/extras/extensions endpoint lists extensions available in the
current mode's directory (global or project), and the Extras page renders
a picker per target. Selecting an extension forces copy mode (transforms
are copy-only) and locks the mode control; changes apply optimistically
via the query cache. Adds i18n keys across all locales.
2026-05-30 19:23:12 +08:00
Willie 425c32d489 refactor(sync): thread extension spec param through SyncExtra 2026-05-30 19:23:12 +08:00
Willie e51134af24 feat(git-root): surface scope mismatch in UI and document git_root field
Add Config.GitRootMismatch() as the single source of truth for detecting
when the git repo lives at a different scope than git_root configures, and
reuse it across the CLI guidance, the server status response (scopeMismatch
/mismatchScope/mismatchDir), and a new warning banner on the Git Sync page.

Document git_root in the config structure-view field docs (fieldDocs) and the
GitStatus client type, and add the gitSync.scope.* / gitSync.mismatch.* i18n
keys across all locales to keep dictionary parity.

Cover the behavior with config, server handler, and CLI integration tests:
push/pull honor the root scope (agents files reach the remote, config.yaml
stays untracked), POST /git/root inits+persists the scope and rejects invalid
scopes and project mode, and git status reports scope mismatches.
2026-05-30 19:23:12 +08:00
Willie 16c6e8ec8d feat(server): git operations honor git_root scope + POST /git/root to switch scope
- extract shared git.InitScopeRepo/WriteScopeGitignore/EnsureLocalIdentity (UI-free)
- cmd init delegates to the shared helpers (no logic duplication)
- handler_git operations use EffectiveGitRoot; status exposes the scope
- new POST /api/git/root inits a repo at the target scope dir + persists git_root
2026-05-30 19:23:12 +08:00
Willie d6600e744a feat: add UI local commit action 2026-05-27 16:28:50 +08:00
Willie 0e091a5e63 fix: refresh metadata after nested skill updates 2026-05-26 13:37:47 +08:00
Willie 89080cf4f1 refactor(install): typed ambiguity error with counts, save one clone
The mixed-tracked-repo recovery path used a fragile substring match on
the error message and re-cloned the repo via /discover to count skills
and agents. Both problems share one root cause: the counts InferTrackedKind
already computed during the failed first install were thrown away.

- Add install.TrackKindAmbiguousError carrying the discovered Skills /
  Agents counts. InferTrackedKind returns it on the ambiguous branch.
  Error() preserves the legacy message verbatim so CLI output is unchanged.
- Server handleInstall track branch uses errors.As to detect it and emits
  writeCodedError with stable code 'install.track_kind_ambiguous' plus
  skills/agents counts in error_params.
- UI replaces the substring match with an ApiError.code check and reads
  counts straight from err.params, skipping the second /discover clone.
- Add unit tests asserting errors.As, count fidelity, and explicit-kind
  short-circuit (no clone).

Net result: 2 clones instead of 3 on the mixed-track recovery path, and a
stable cross-language contract instead of a brittle English substring.
2026-05-26 11:05:32 +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 4d7011983c feat(sync): warn on skill path overlap with one-line hint
Detect overlapping target paths during sync — either two targets
sharing the same primary path, or cross-runtime discovery via the
also_scans table — and surface a brief one-liner pointing users at
`skillshare doctor` for the full breakdown.

Triggers in both CLI (sync.go, sync_project.go) and Web UI (sync API
warnings array, rendered by existing SyncPage warnings card). Detection
logic lives in internal/config/path_overlap.go and is shared between
both paths.

Quiet by design: no output when no overlap exists. JSON output mode
remains untouched.
2026-05-22 01:00:54 +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 5b7ca8ba3d fix: trash before gitignore cleanup and skip gitignore for external sources
Reorder handleUninstallRepo to move repo to trash before removing the
.gitignore entry, preventing accidental exposure of tracked content
when trashing fails.

ProjectGitignoreTarget now returns empty strings for source paths
outside projectRoot, since parent-relative patterns (../) are invalid
in .gitignore. All six callers guard on empty gitignoreDir and skip
gitignore management for external sources.
2026-05-20 16:34:02 +08:00
Willie 0c010c55f4 fix: wire custom sources into server reload and gitignore paths
reloadConfig now updates s.cfg.Source and s.cfg.AgentsSource from the
refreshed ProjectConfig so project UI handlers see the latest source
directories after a config edit.

Add ProjectGitignoreTarget helper that computes the correct .gitignore
directory and entry prefix based on whether the source path is inside
.skillshare/ or a custom location. All gitignore write and remove
operations (reconcile, install, uninstall, server handlers) now use
this helper instead of hardcoded 'skills/' prefix.

Fix nil projectCfg panics in three server tests that simulate project
mode by setting projectRoot without projectCfg.
2026-05-20 16:12:02 +08:00
Willie 68d5eadc0b feat: support custom project source directories via sources map
Add ProjectSources struct to ProjectConfig with optional skills, agents,
and extras fields. When set, project-mode commands resolve source paths
from these values instead of hardcoded .skillshare/{skills,agents,extras}/.

Config example:
  sources:
    skills: ./docs/skills
    agents: ./docs/agents

Three EffectiveXxxSource(projectRoot) methods provide the central
resolution logic with fallback to defaults. The projectRuntime gateway
and server layer route through these methods, so most commands get
custom source support automatically.

Closes #153
2026-05-20 15:42:53 +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 9510476c45 feat(server): include context_cost in sync API response
Self-contained token estimation (chars/4) since buildAnalyzeEntries
is in main package. Returns grouped counts and budget violations.
2026-05-11 21:34:38 +08:00
Willie 5975c1109a test: add regression tests for azure_hosts wiring in project install and agent update
- TestParseOptsFromConfig_IncludesAzureHosts: verify global config
  helper passes AzureHosts to ParseOptions
- TestParseOptsFromProjectConfig_IncludesAzureHosts: verify project
  config helper passes AzureHosts
- TestParseOptsFromProjectConfig_AzureHostsParseOnPrem: end-to-end
  verify project config azure_hosts produces correct on-prem CloneURL
- TestUpdateAgent_AzureOnPrem_UsesParseOpts: verify server agent
  update handler parses on-prem Azure source via ParseSourceWithOptions
2026-05-05 19:26:11 +08:00
Willie 204340c2e0 fix: wire azure_hosts through project install and agent update paths
- install_project.go: pass AzureHosts to temporary Config (was only
  passing GitLabHosts, so project-mode direct install ignored azure_hosts)
- update_agents.go: thread ParseOptions through batchUpdateAgents and
  reinstallAgent, replacing bare ParseSource with ParseSourceWithOptions
- handler_update.go: use ParseSourceWithOptions with s.parseOpts() for
  agent update in web UI

Without this fix, azure_hosts in .skillshare/config.yaml was silently
ignored during project install and agent update, causing on-prem Azure
DevOps URLs to be parsed incorrectly.
2026-05-05 18:54:45 +08:00