1548 Commits

Author SHA1 Message Date
程序员阿江(Relakkes)
441979aa2d test(desktop): make the dev launcher tests install-independent
The resolveElectronExecutable case asserted against the real
node_modules/electron/dist, which bun never downloads without the
electron postinstall, so it failed on macOS/Linux dev machines.
Point the tests at a self-built fixture desktop root instead and
extend coverage to the darwin/linux candidates and the missing-
executable error path.

Follow-up to #1096.
2026-07-25 16:23:39 +08:00
程序员阿江(Relakkes)
6b7e90aec7 Merge pull request #1098 from RaspberryLee/feat/installed-skills-overview
feat(desktop): show installed skills in the Skills Market
2026-07-25 16:11:43 +08:00
程序员阿江(Relakkes)
cfd13f9883 Merge pull request #1096 from RaspberryLee/fix/windows-electron-dev-launcher
fix(desktop): make the Electron dev launcher work on Windows
2026-07-25 16:11:43 +08:00
程序员阿江-Relakkes
4dfeb26c25
Merge pull request #1098 from RaspberryLee/feat/installed-skills-overview
feat(desktop): show installed skills in the Skills Market
2026-07-25 16:09:13 +08:00
程序员阿江-Relakkes
c4334c3d12
Merge pull request #1096 from RaspberryLee/fix/windows-electron-dev-launcher
fix(desktop): make the Electron dev launcher work on Windows
2026-07-25 16:08:52 +08:00
程序员阿江(Relakkes)
2b89d4a678 fix(skills): correct the .agents badge, doctor, and listing safety
Follow-ups to 9ef170bb, where the discovery path itself is sound but three
surfaces around it are not.

The desktop badge showed the same tooltip for both scopes, and that tooltip
names ~/.agents/skills. A skill that ships inside a checked-out repository was
therefore described as one the user had installed in their own home directory
-- the least trusted source presented as the most trusted. Project-scope
skills now get their own copy, in all five locales.

The doctor listed both .agents targets unconditionally, so a user who set
disableAgentSkillsDirectory (or the env var) still saw them reported, with an
entry count if the directory had contents. That reads as "these skills are in
use" when the loader is ignoring them.

Skill directory names went into the catalog the model sees verbatim, one
`- name: description` line per skill, with no validation. A name containing a
line break writes entries of its own -- and .agents/skills is a directory
other clients and repositories write into, so the name is not necessarily the
user's. Names carrying control characters are now skipped. Deliberately
narrower than the Agent Skills spec's lowercase-and-hyphens rule: existing
.claude/skills directories predate it, and silently dropping one of those
would be the worse failure.

Also collapses the two spellings of the scoped dedup key -- the main loader
joined with a raw NUL byte embedded in the source, the --add-dir path with a
space -- into one helper, so the comment claiming both apply the same rule is
true and the invisible byte is gone.

Adds coverage for the two scopes 9ef170bb claimed but left untested: the
hot-reload watcher (no test file existed for it at all) and on-demand monorepo
discovery. Both were already correct; nothing was holding them that way.
2026-07-25 15:56:55 +08:00
程序员阿江(Relakkes)
ced096c894 fix(desktop): keep the dragged pet at the display edge across restarts
8a3ea62b taught dragging to clamp against the mascot rather than the whole
window, so a saved edge position deliberately leaves the transparent padding
off-screen. Recreating the window re-clamps that position against the whole
window again, and the reposition-on-restore step that undoes it was gated on
darwin -- so on Windows and Linux the mascot walked inwards by the padding
width on every hide/show, not just on restart. The gate only existed because
visibleDragRegion used to be darwin-only; the region now arrives everywhere,
so the repositioning runs everywhere.

e24d59fe restated the recorded window size on every drag tick to stop
setPosition from growing the window, but sampled that size from getBounds().
Chromium converts window rects between physical pixels and DIP with ceil in
both directions, so the sampled value has already been rounded up once and
restating it rounds up again: stable within a drag, a pixel per drag across
them. The window is created non-resizable at the nominal size, so restating
the constants is idempotent instead -- and heals a window that already drifted.
Both call sites now go through movePetWindow.

petWindowContentExtent fell back to the nominal constants when
getContentBounds returned an empty rect, which silently reinstates the exact
clamp it exists to avoid. Fall through to the live window box first.

The fake window in the tests returned one object for both getBounds and
getContentBounds, and modelled setBounds as inherently size-neutral -- so
neither "clamp to the content box" nor "size-neutral drag" was actually
proven: reverting either left all 33 tests green. It now models the ceil/ceil
DIP round trip and carries a distinct content box, and covers the previously
untested paths: cross-platform restore, multi-region shapes, the region
normalization bounds, and the getContentBounds fallbacks.
2026-07-25 15:56:39 +08:00
程序员阿江(Relakkes)
5b4e224f2e fix(desktop): address shadcn migration review findings
- Prevent EmptySession crash when settings have not loaded: fall back
  to the default permission-mode display and an empty model list, and
  stop undefined models responses from poisoning the settings store
- Sync Tauri terminal hardening with Electron: owner binding, input
  limits, window-destroy session cleanup, malformed config fallback
- Fix Sheet/MobileBottomSheet z-order so dialogs render above sheets
- Migrate ConfirmPopover to the shadcn Button; remove dead legacy
  shared form components and unused mockup pages
- Keep underscores readable in shared diagnostics, redact provider
  models only on secret-scanner hits, clean stale WhatsApp login
  staging dirs, and add recovery hints for corrupt computer-use config
- Token-ize find-in-page highlight colors, restore the indeterminate
  progress slide animation, and tidy a11y/displayName details
2026-07-25 15:07:00 +08:00
程序员阿江(Relakkes)
9ef170bb42 feat(skills): discover the cross-client .agents/skills convention #1093
Skills installed by Codex, Cursor, Gemini CLI, or opencode live under
`.agents/skills/` -- the convention documented at agentskills.io -- so users
had to keep a duplicate copy in `.claude/skills/` before cc-haha could see
them. The spec only constrains SKILL.md itself, which we already parse, so
this is purely a directory-discovery gap.

Scan both conventions at every scope: user (`~/.agents/skills`), project
(every level up to the repo root), `--add-dir` roots, on-demand monorepo
discovery, and the hot-reload watcher. skillRoots.ts is the single source of
truth for those paths; the REST API now reports which convention a skill came
from and the desktop list badges the `.agents` ones.

`.claude` is always ordered first, so first-wins dedup keeps a user's own
skills authoritative rather than letting an externally installed same-named
skill shadow them. Name collisions are collapsed per scope, which covers
copy-based sync -- symlink-based sync was already handled by the existing
realpath dedup. Collisions across different scopes, such as a user skill and
a project skill sharing a name, keep their existing behavior, and the shadowed
file's identity is recorded so overlapping roots (CLAUDE_CONFIG_DIR pointing
inside the project) cannot reintroduce it under the other scope.

getProjectDirsUpToHome is untouched -- it is shared by commands, agents,
output-styles, and workflows. Only its directory walk is extracted so the
skill resolver reuses the same submodule/worktree stop boundary. Writes stay
where they were: market installs and /skillify still target
`~/.claude/skills`.

`.agents` is anchored at $HOME rather than CLAUDE_CONFIG_DIR, since it is a
space shared with other tools that read $HOME. Note that Bun snapshots
os.homedir() at startup while Node re-reads $HOME per call, so the resolver
reads the env var explicitly.

Opt out with `disableAgentSkillsDirectory` in settings.json or
CLAUDE_CODE_DISABLE_AGENT_SKILLS_DIR=1; no `.agents` root is produced at all
then, so there is not even a failed stat.

(cherry picked from commit ba9338f85d6beaba237753e42e823c87b59633d4)
2026-07-25 02:50:21 +08:00
程序员阿江(Relakkes)
8a3ea62b9b fix(desktop): let the dragged pet reach display edges on Windows
setInteractiveRegions only recorded visibleDragRegion inside the darwin
branch, so on Windows and Linux it stayed null and dragging fell back to
clamping against the whole PET_WINDOW_WIDTH x PET_WINDOW_HEIGHT window. That
window is mostly transparent padding around a mascot anchored bottom center,
so the mascot stopped short of every display edge by the width of that
padding and could not be dragged into a corner. Record the region on all
platforms; the reposition-on-restore step stays darwin-only.

Normalizing the region also clamped against the nominal constants. Renderer
regions are measured against the live viewport, so clamp against the real
content box instead -- the same petWindowContentExtent the shape clamp
already uses -- and let the shape clamp reuse that one normalizer.
2026-07-25 02:38:19 +08:00
程序员阿江(Relakkes)
e24d59fe92 fix(desktop): stop clipping the dragged pet on Windows #1099 #1104
The Windows shape clamp used the nominal PET_WINDOW_HEIGHT constant. Renderer
regions are measured against the live viewport, so once the content area was
taller than that constant the mascot -- which sits flush with the viewport
bottom -- got sliced off from below, while the task badge kept its own
unclamped rect and stayed visible. Clamp the shape to the real content box.

Dragging also moved the window with setPosition, which Windows resolves as
getSize() + setBounds(); that DIP round trip grows the window a pixel at a
time on fractional display scaling, and the drag timer fires every 16ms.
Restate the recorded size on every tick so dragging stays size-neutral.
2026-07-25 02:12:10 +08:00
程序员阿江(Relakkes)
cc768b87c2 merge: unify desktop UI with shadcn components (#1089)
合入 shadcn/ui 全量迁移。该提交同时包含:
- 桌面端手写组件 -> shadcn/ui (radix-ui + Tailwind v4) 全量替换
- Electron 壳层加固: 终端 owner 绑定/IPC 校验/诊断写盘防逃逸
- server/utils 安全加固与修复: 诊断脱敏、Memory 乐观锁、Computer Use fail-closed、stats UTC 等

合并前已经 merge-tree 预演 + 落盘实证: 与 #1086/#1091 无文本冲突, 功能代码零损失。
2026-07-25 00:49:46 +08:00
程序员阿江(Relakkes)
ad597ffe0b feat(desktop): unify UI with shadcn components (#1089) 2026-07-24 23:59:48 +08:00
RaspberryLee
0e0ac28d0b
Merge branch 'main' into feat/installed-skills-overview 2026-07-24 16:08:39 +08:00
RaspberryLee
f4b1d8a384
Merge branch 'main' into fix/windows-electron-dev-launcher 2026-07-24 14:49:20 +08:00
程序员阿江(Relakkes)
c2774fc170 fix(desktop): support pasted file attachments #1086 2026-07-24 05:30:38 +08:00
程序员阿江(Relakkes)
8e9c104514 fix(desktop): handle missing Windows taskkill #1091 2026-07-24 05:13:36 +08:00
程序员阿江(Relakkes)
27901ee311 fix(site): reference the app icon png directly
The svg icon is only a wrapper around app-icon.png, and the nested
reference is invisible to the static copy step, so the image stayed
invisible on production even after the svg itself deployed.
2026-07-24 04:53:17 +08:00
程序员阿江(Relakkes)
6342070a27 fix(site): include code-referenced images in static output
The docs header logo and favicon 404 on production because the
static copy step only scanned markdown for image references. Scan
site sources as well and fail the build when one goes missing.
2026-07-24 04:48:57 +08:00
程序员阿江(Relakkes)
d1757bfaf5 feat(site): editorial redesign with rewritten landing copy
- rebuild home and docs UI around serif display type, warm paper,
  and a single vermilion accent
- rewrite zh/en landing copy around user value
- fix white screen on the last docs page (adjacent-doc out of bounds)
- curate sidebar labels and add TOC scroll-spy
2026-07-24 04:42:17 +08:00
程序员阿江(Relakkes)
c2fd674662 docs: rebuild documentation site with React 2026-07-23 20:46:33 +08:00
lichengshuo
8061b9b2a5 feat(desktop): show installed skills in the market 2026-07-23 16:57:36 +08:00
lichengshuo
0f22792861 fix(desktop): make electron:dev launcher work on Windows
`new URL('..', import.meta.url).pathname` yields a leading-slash path like
/E:/... on Windows, so Bun.spawn failed with ENOENT. Resolve desktopRoot via
fileURLToPath, start Vite through its Node API instead of spawning `bun run
dev`, and resolve the Electron binary directly per platform.

Recovered from the discarded wip/capabilities snapshot (cb1208c9) as a
standalone fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 16:33:39 +08:00
程序员阿江(Relakkes)
f70fa017ef release: prepare v0.4.11 v0.4.11 2026-07-23 03:30:42 +08:00
程序员阿江(Relakkes)
2240a07088 feat(desktop): improve pet motion and interactions 2026-07-23 03:03:05 +08:00
程序员阿江(Relakkes)
ca0342d252 Merge remote-tracking branch 'origin/main' 2026-07-23 00:31:40 +08:00
Relakkes Yang
3b2e750c6e fix(desktop): polish pet status and agent tools 2026-07-23 00:24:18 +08:00
Relakkes Yang
20b7753281 fix: sync pet status and finish agent editor 2026-07-22 22:12:27 +08:00
Relakkes Yang
a07e68839c fix: harden desktop runtime and pet interactions 2026-07-22 20:46:34 +08:00
程序员阿江(Relakkes)
29b17c8028 fix(models): expose current Claude official lineup 2026-07-22 17:42:19 +08:00
程序员阿江(Relakkes)
91829e91a4 fix(chat): preserve attachment context across resume 2026-07-21 04:05:01 +08:00
程序员阿江(Relakkes)
7f6fdadaa3 feat(agents): add per-agent model and effort controls #1062 2026-07-21 00:16:11 +08:00
程序员阿江(Relakkes)
1270ced4b4 fix(tasks): keep task state reliable across providers #1075 2026-07-20 23:53:46 +08:00
程序员阿江(Relakkes)
727bcea077 fix(desktop): harden Windows crash recovery #1064 #1065 #1071 2026-07-20 22:06:34 +08:00
程序员阿江(Relakkes)
ba8917f1db fix(desktop): decouple provider creation from presets request #1078 2026-07-20 20:39:40 +08:00
程序员阿江(Relakkes)
7d272e0f96 fix(server): handle tool denial interruption #1070 2026-07-20 20:38:45 +08:00
程序员阿江(Relakkes)
6b725a0b6f fix(desktop): show live SubAgent run details #1077 2026-07-20 20:30:33 +08:00
程序员阿江(Relakkes)
bf128cb9c0 fix(desktop): dedupe attachment message replay #1069 2026-07-20 20:28:18 +08:00
程序员阿江(Relakkes)
8995f56d1f fix(server): preserve context estimates for empty usage #1063 2026-07-20 20:20:25 +08:00
程序员阿江(Relakkes)
71dc2fd4cf fix(provider): update Kimi Code preset to K3 2026-07-20 19:25:20 +08:00
程序员阿江(Relakkes)
36560c09d5 feat(pets): add interactive desktop companions 2026-07-20 19:20:18 +08:00
程序员阿江(Relakkes)
100a2b25b8 fix(release): remove environment-dependent alias fixture v0.4.10 2026-07-18 20:25:42 +08:00
程序员阿江(Relakkes)
f8cccb096f fix(release): stabilize Windows recovery self-test 2026-07-18 20:20:34 +08:00
程序员阿江(Relakkes)
34a3fcb22e release: prepare v0.4.10 2026-07-18 19:12:26 +08:00
程序员阿江(Relakkes)
c60d3780b8 fix(server): close release QA regressions (#1019, #1047, #1051) 2026-07-18 15:38:32 +08:00
程序员阿江(Relakkes)
0cb612cb5d fix(desktop): restore conversation scroll after remount (#1057) 2026-07-17 23:51:40 +08:00
程序员阿江(Relakkes)
1b22ac6eb6 fix(desktop): keep conversation search current (#1045) 2026-07-17 23:39:04 +08:00
程序员阿江(Relakkes)
c48171e2f0 fix(desktop): harden Windows upgrades (#1028, #1029, #1036) 2026-07-17 23:38:59 +08:00
程序员阿江(Relakkes)
ef841c2962 fix(server): flush context before runtime restart (#1033) 2026-07-17 23:17:05 +08:00
程序员阿江(Relakkes)
d9bb517287 fix(desktop): bound and refresh conversation search (#1045) 2026-07-17 23:12:14 +08:00