Commit Graph

916 Commits

Author SHA1 Message Date
Hunter Bown 8dcb467bf5 feat(commands): scan workspace-local .deepseek/.cursor/.claude commands
Extend load_user_commands() to scan workspace-local command directories
in addition to the global ~/.deepseek/commands/. Precedence model
mirrors skills_directories(): project-local shadows global by name.

Scanned directories (in precedence order):
  1. <workspace>/.deepseek/commands/
  2. <workspace>/.claude/commands/   (Claude Code interop)
  3. <workspace>/.cursor/commands/   (Cursor interop)
  4. ~/.deepseek/commands/           (user-global fallback)

Workspace context threaded through:
  - try_dispatch_user_command (has App reference)
  - user_commands_matching (new workspace parameter)
  - all_command_names_matching (new workspace parameter)
  - slash_completion_hints (new workspace parameter)

Closes #1259
2026-05-09 00:11:28 -05:00
Hunter Bown 15f62e3e93 docs(readme): update What's New to v0.8.23 2026-05-08 22:21:01 -05:00
Hunter Bown cfb5f08ae5 fix(update): pass --ssl-no-revoke to curl on Windows (#1252)
Pre-tag fix for v0.8.23. Resolves Windows users hitting CRYPT_E_NO_REVOCATION_CHECK on `deepseek update`.
2026-05-08 21:07:56 -05:00
Hunter Bown 8f0bef9f15 fix(update): pass --ssl-no-revoke to curl on Windows
Windows ships curl built against Schannel, which performs mandatory
certificate-revocation checks. When the user's network can't reach
OCSP/CRL responders (corporate firewalls, captive portals, IPv6
hiccups, some ISPs), the TLS handshake fails with
\`CRYPT_E_NO_REVOCATION_CHECK (0x80092012)\` and \`deepseek update\`
is unable to fetch \`api.github.com\` or download release assets.

Add \`--ssl-no-revoke\` to every curl invocation issued by the
self-update path on Windows. Other platforms (OpenSSL/LibreSSL on
macOS/Linux/BSD) continue to use no extra flags. Helper is a pure
function over the OS string, so both branches are unit-tested.
2026-05-08 20:56:48 -05:00
Hunter Bown 73b5f5ea77 chore(release): merge v0.8.23 (#1245)
Security-focused release. Hardens child-process env, plan-mode tools, sub-agent approvals, MCP config paths, run_tests approval policy, fetch_url redirects (v0.8.22 backfill), runtime API auth. Fixes #1244 and the v0.8.21/v0.8.22 changelog gap. Thanks to @47Cid for responsible disclosure.
2026-05-08 19:51:25 -05:00
Hunter Bown 22414f15f7 fix(security): containment check for workspace-local skills dir
Replaces the autofix in 326a1da (reverted in 51f2f04b4), which mistakenly
required `workspace` to live under the global config's skills directory
and therefore caused `resolve_skills_dir` to *always* fall back to the
global skills dir — silently breaking workspace-local `.agents/skills`
and `./skills` loading.

Apply the right containment check instead: canonicalize the workspace
once, canonicalize each candidate, and require the candidate to
`.starts_with` the canonicalized workspace before returning it. A
`skills` symlink that escapes the workspace (e.g. to `/etc`) now causes
the candidate to be rejected and resolution to fall back to the
configured global skills directory, preserving real symlink-escape
defense without regressing the feature.

Adds three regression tests: positive case for `.agents/skills`,
positive case for the `./skills` fallback, and a Unix-only test that
constructs a symlink-escaping `skills` directory and asserts it is
rejected.
2026-05-08 19:40:06 -05:00
Hunter Bown 51f2f04b47 Revert "Potential fix for pull request finding 'CodeQL / Uncontrolled data used in path expression'"
This reverts commit 326a1dacb9.
2026-05-08 19:38:14 -05:00
Hunter Bown 326a1dacb9 Potential fix for pull request finding 'CodeQL / Uncontrolled data used in path expression'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-05-08 19:34:01 -05:00
Hunter Bown 43e572342a fix(tests): gate unix-only env_lock helper on cfg(unix)
The env_lock helper and its Mutex/OnceLock imports are only used by a
`#[cfg(unix)]` env-mutating test. On Windows that test compiles out
entirely, leaving env_lock as dead code under `-Dwarnings`. Gate both
the import and the helper with `#[cfg(unix)]` so the Windows test job
compiles.
2026-05-08 19:06:31 -05:00
Hunter Bown 0ffa7bf720 docs(changelog): credit security disclosure across 0.8.22 + 0.8.23
Adds a Security bullet to v0.8.23 for the run_tests approval-policy
change, and credits @47Cid as the reporter on both the v0.8.22
fetch_url hardening and the v0.8.23 run_tests hardening. Neutral
language — no attack-vector detail.
2026-05-08 18:58:01 -05:00
Hunter Bown 401c1f6cf8 fix(security): tighten approval policy for run_tests
`run_tests` declares `ToolCapability::ExecutesCode` and runs `cargo test`,
which executes workspace code at test, build-script, and proc-macro time.
Match the default approval policy for code-executing tools by returning
`ApprovalRequirement::Required` explicitly instead of overriding to
`Auto`. Adds a regression test pinning the approval requirement.
2026-05-08 18:58:01 -05:00
Hunter Bown cd78b41fa3 test(release): replace hardcoded version assertion with CHANGELOG gate
The prior `package_version_is_current_hotfix_release` test was a
brittle hardcoded `assert_eq!(env!("CARGO_PKG_VERSION"), "0.8.22")`
that needed manual update on every release and only restated what
`scripts/release/check-versions.sh` already enforces.

Replace with `changelog_entry_exists_for_current_package_version`,
which reads `CHANGELOG.md` and asserts a `## [X.Y.Z]` entry exists
for the current `CARGO_PKG_VERSION`. No hardcoded version string —
this self-updates with the workspace version bump and gates against
the actual class of bug we just patched (the v0.8.21 / v0.8.22
backfill gap).
2026-05-08 18:21:21 -05:00
Hunter Bown 8e9957da5c chore(release): prepare v0.8.23
- Bump workspace version 0.8.22 → 0.8.23 across Cargo.toml, every per-crate
  path-dependency pin, npm/deepseek-tui/package.json (both `version` and
  `deepseekBinaryVersion`), and Cargo.lock.
- Add a 0.8.23 CHANGELOG entry covering the security hardening stack
  (sanitized child env, plan-mode tool surface, sub-agent approvals,
  symlink walks, runtime API auth, shell safety classification, MCP
  config path traversal), the macOS Keychain prompt fix, the #1244 MCP
  spawn error visibility + env passthrough work, the compact-thinking UX
  change, and a Known issues callout for mid-run MCP stderr.
- Backfill missing CHANGELOG entries for v0.8.21 (community-heavy
  release, contributors credited) and v0.8.22 (fetch_url redirect
  validation). The gap was unintentional, so contributor work is being
  reflected in-repo now.
- Add docs/RELEASE_CHECKLIST.md so future releases gate on the
  CHANGELOG/version/preflight steps explicitly.
2026-05-08 18:17:44 -05:00
Hunter Bown 77adb1030c fix(mcp): preserve spawn error chain and pass Node/proxy env (#1244)
`cmd.spawn()` failures now show the underlying io::Error via `{err:#}`
instead of dropping the chain in the snapshot, the `mcp connect`/`mcp
validate` CLI commands, and the engine status event. Users now see
"No such file or directory (os error 2)" or similar instead of the
opaque "MCP stdio spawn failed (...)" wrapper.

MCP stdio launches also get a wider env allowlist than arbitrary shell
tools — NVM_DIR, NODE_OPTIONS, NODE_PATH, NODE_EXTRA_CA_CERTS,
NPM_CONFIG_*, VOLTA_HOME, COREPACK_HOME, PYTHONPATH, PYTHONHOME,
VIRTUAL_ENV, PIPX_*, POETRY_HOME, UV_*, GEM_HOME/PATH, BUNDLE_*,
JAVA_HOME, HTTP/HTTPS/NO/ALL/FTP_PROXY (case-insensitive), and
SSL_CERT_*/REQUESTS_CA_BUNDLE/CURL_CA_BUNDLE — so common `npx`,
`uvx`, and proxy-bound corporate setups don't break under the
v0.8.22 child-env scrub. Secret-bearing parent env (AWS_*, GITHUB_TOKEN,
*_API_KEY, …) stays scrubbed, and the strict allowlist remains in
force for shell tools and other non-MCP child spawns.
2026-05-08 18:10:26 -05:00
Hunter Bown 07410521d7 fix(auth): default to file-backed secret store 2026-05-08 17:20:07 -05:00
Hunter Bown 9e6924c749 fix(security): narrow Plan mode tool surface 2026-05-08 14:47:16 -05:00
Hunter Bown 9dcbc94d51 test(skills): isolate command tests from global skills 2026-05-08 14:47:08 -05:00
Hunter Bown 2de3766477 fix(security): tighten shell safety classification 2026-05-08 14:38:20 -05:00
Hunter Bown 9ee3b51582 fix(security): require runtime API auth by default 2026-05-08 14:34:45 -05:00
Hunter Bown 6248dc0508 fix(security): preserve sub-agent approval boundaries 2026-05-08 14:30:14 -05:00
Hunter Bown 9864f64019 fix(security): avoid following symlinked workspace walks 2026-05-08 14:27:07 -05:00
Hunter Bown e6d4eae5d6 fix(security): scrub child process environments 2026-05-08 14:24:07 -05:00
Hunter Bown 8380784308 fix(security): tighten paths and output handling 2026-05-08 14:13:55 -05:00
Hunter Bown 4de726abc5 feat(tui): compact live thinking by default 2026-05-08 14:13:50 -05:00
Hunter Bown 69862467c7 chore(deps): update security-sensitive dependencies 2026-05-08 14:13:46 -05:00
Hunter Bown 8b60275981 chore(release): prepare v0.8.22
Validate redirected fetch targets before following them and prepare v0.8.22.
2026-05-08 13:34:26 -05:00
Hunter Bown 1fc892e604 chore(release): prepare v0.8.21 (#1229) 2026-05-08 11:20:03 -05:00
Hunter Bown 9fecd7a24d docs(readme): use dispatcher path for PR prompt (#1227) 2026-05-08 11:08:11 -05:00
Hunter Bown dcd23464ef fix(tui): render git branch status item (#1226) 2026-05-08 11:04:22 -05:00
Hunter Bown f29d1a3a21 fix(mcp): wait for SSE endpoint before connect returns (#1225) 2026-05-08 11:00:01 -05:00
Hunter Bown 360438f0c9 docs(docker): prefer writable named data volume
## Summary
- Prefer a writable named Docker volume for the container home data path.
- Document the non-root UID/GID ownership requirement for host bind mounts.
- Update README and Docker docs examples to avoid permission-denied first runs.

## Test plan
- git diff --check
- GitHub CI green: version drift, lint, ubuntu, macOS, Windows, npm wrapper smoke, GitGuardian
2026-05-08 10:22:22 -05:00
Hunter Bown 6f1b23e052 fix(tui): make pager exit hint prominent
## Summary
- Move the pager exit hint to the front of the footer so q/Esc is immediately discoverable.
- Preserve the rest of the pager footer metadata and styling.

## Test plan
- cargo test -p deepseek-tui pager --locked
- cargo fmt --all -- --check
- git diff --check
- GitHub CI green: version drift, lint, ubuntu, macOS, Windows, npm wrapper smoke, GitGuardian
2026-05-08 10:21:45 -05:00
Hunter Bown caf77949d9 fix(tui): hide transcript rail before code blocks
## Summary
- carry markdown render metadata through the message renderer so fenced code lines are identified explicitly
- keep normal conversational continuation rails for prose, but replace the rail with alignment spaces before fenced code lines
- add a regression test for assistant code blocks so the visible U+258F rail does not appear inside code output

## Test plan
- cargo test -p deepseek-tui assistant_code_block_lines_do_not_get_transcript_rail --locked
- cargo fmt --all -- --check
- git diff --check origin/main..HEAD
- GitHub CI: lint, version drift, ubuntu/macos/windows tests, npm wrapper smoke, GitGuardian
2026-05-08 10:15:43 -05:00
Hunter Bown 37178ed6b4 fix(tui): make transcript scrollbar inert
## Summary
- remove app-owned transcript scrollbar click/drag state so the right gutter cannot capture mouse drags
- keep wheel scrolling, jump-to-latest, and normal transcript text selection intact
- align the behavior with opencode's session surface: scroll via wheel/key paths, no app-level scrollbar drag affordance

## Test plan
- cargo test -p deepseek-tui transcript_scrollbar_gutter_is_not_draggable --locked
- cargo test -p deepseek-tui left_down_inside_transcript_starts_selection --locked
- cargo fmt --all -- --check
- git diff --check
- GitHub CI: lint, version drift, ubuntu/macos/windows tests, npm wrapper smoke, GitGuardian
2026-05-08 10:05:07 -05:00
Hunter Bown cd8f247fa1 fix(tui): accept uppercase approval shortcuts
## Summary
- accept uppercase Y/A/N/D approval shortcuts in addition to lowercase and numeric input
- keep destructive approvals on the existing two-step confirmation path
- leave #1199 open because the Windows ConHost rendering report is broader than shortcut casing

## Test plan
- cargo test -p deepseek-tui benign_y_one_step_approves --locked
- cargo test -p deepseek-tui benign_a_two_approves_for_session --locked
- cargo test -p deepseek-tui benign_n_d_three_all_deny --locked
- cargo test -p deepseek-tui destructive_y_first_press_stages_then_second_commits --locked
- cargo test -p deepseek-tui destructive_a_first_press_stages_then_second_commits_session --locked
- cargo test -p deepseek-tui destructive_deny_does_not_require_confirmation --locked
- cargo fmt --all -- --check
- git diff --check
- GitHub CI: lint, version drift, ubuntu/macos/windows tests, npm wrapper smoke, GitGuardian
2026-05-08 10:04:30 -05:00
Hunter Bown c0fe2e3360 fix(tui): handle macOS option-v details shortcut
## Summary
- treat the macOS Option+V legacy glyph as the tool-details shortcut instead of inserting text
- show the platform-appropriate details shortcut label in active tool status/footer copy
- add regression coverage for macOS glyph handling and existing tool-details target behavior

## Test plan
- cargo test -p deepseek-tui macos_option_v_glyph_is_treated_as_details_shortcut_only_on_macos --locked
- cargo test -p deepseek-tui detail_target_prefers_visible_tool_card --locked
- cargo test -p deepseek-tui active_tool_status_label_summarizes_live_tool_group --locked
- cargo fmt --all -- --check
- git diff --check
- GitHub CI: Version drift, Lint, Test (ubuntu-latest), Test (macos-latest), Test (windows-latest), npm wrapper smoke, GitGuardian
2026-05-08 09:54:05 -05:00
Hunter Bown a332077410 fix(client): fallback empty tool call names
## Summary
- normalize empty or missing tool-call names to unknown_tool in streaming and non-streaming responses
- include source/id context in fallback warnings
- add regression coverage for empty streaming names and missing non-streaming names

## Test plan
- cargo test -p deepseek-tui decoder_uses_fallback_name_for_empty_streaming_tool_name --locked
- cargo test -p deepseek-tui non_streaming_response_uses_fallback_name_for_missing_tool_name --locked
- cargo fmt --all -- --check
- git diff --check
- GitHub CI: Version drift, Lint, Test (ubuntu-latest), Test (macos-latest), Test (windows-latest), npm wrapper smoke, GitGuardian
2026-05-08 09:17:35 -05:00
Liu-Vince 7d5c411845 fix(tui): preserve code block indentation
## Summary
- Preserve leading whitespace when rendering fenced code blocks.
- Hard-wrap code lines without word-splitting away indentation.
- Account for tab width when wrapping code lines.
- Close #1149.

## Verification
- GitHub CI passed: lint, version drift, ubuntu/macos/windows tests, npm wrapper smoke, GitGuardian.
2026-05-08 09:01:24 -05:00
Reid d2fea408f5 fix(tui): add headers to task list output
## Summary
- Add explicit ID, Status, Time, and Title headers to /task list output.
- Align task rows without changing task storage or execution behavior.

## Verification
- GitHub CI passed: lint, version drift, ubuntu/macos/windows tests, npm wrapper smoke, GitGuardian.
2026-05-08 09:01:14 -05:00
Liu-Vince 66a20ded2e docs(config): document additional environment variables
## Summary
- Document DEEPSEEK_STREAM_OPEN_TIMEOUT_SECS.
- Document DEEPSEEK_FORCE_HTTP1.
- Document DEEPSEEK_HOME and DEEPSEEK_AUTOMATIONS_DIR.

## Verification
- GitHub CI passed: lint, version drift, ubuntu/macos/windows tests, npm wrapper smoke, GitGuardian.
2026-05-08 09:01:03 -05:00
kitty 096cb64504 fix(tools): find gh across common install paths
## Summary
- Probe common Linux and macOS gh CLI paths when DEEPSEEK_GH_BIN is not set.
- Keep the existing /opt/homebrew/bin/gh fallback for compatibility.
- Improve the not-installed error message.

## Verification
- GitHub CI passed: lint, version drift, ubuntu/macos/windows tests, npm wrapper smoke, GitGuardian.
2026-05-08 09:00:54 -05:00
Sun 967236f9ef fix(tui): preserve upstream stream pacing
## Summary
- Preserve upstream SSE delta cadence for normal-motion streaming.
- Keep one-grapheme pacing for low-motion mode.
- Close #1200.

## Verification
- GitHub CI passed: lint, version drift, ubuntu/macos/windows tests, npm wrapper smoke, GitGuardian.
2026-05-08 09:00:43 -05:00
Hunter Bown f183501fbd fix(client): route non-beta paths from beta base to v1 (#1174)
* test: add reproducer for /models 404 on beta base URL

* fix: route non-beta paths to /v1 when base URL ends with /beta

---------

Co-authored-by: Hanmiao Li <894876246@qq.com>
2026-05-08 02:59:56 -05:00
Hunter Bown 236a529a9d fix(deps): extend libc to all Unix targets for FreeBSD compatibility (#1173)
`libc` was declared only for macOS and Linux, causing a build failure on
FreeBSD (#1143). All call sites that use `libc` are already guarded with
`#[cfg(unix)]` or narrower OS-specific guards, so broadening the
dependency to `cfg(unix)` fixes FreeBSD (and other BSDs) with no
behavioural change on macOS or Linux.

Co-authored-by: Vince <liuwenchang.x@qq.com>
2026-05-08 02:57:25 -05:00
ZzzPL 219e15a85f fix(tui): add stale busy-state watchdog (#1170) 2026-05-08 02:48:32 -05:00
Hunter Bown ad31d2bcec docs(competitive-analysis): reflect LSP diagnostics implementation (#1171)
Update competitive analysis to reflect that LSP integration is now
implemented as automatic post-edit diagnostics injection, and adjust
the recommended implementation order accordingly.

Co-authored-by: Stephen Xu <wexu@expediagroup.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-08 02:47:35 -05:00
Hunter Bown ec268e50a1 feat: distinct user message body color (green) (#1168)
Use a dedicated user_body_style() with a green (#4ADE80 / #15803D)
foreground color for user messages instead of sharing the
message_body_style() (TEXT_PRIMARY) used by assistant messages.

This makes user input visually distinguishable from assistant
responses in the transcript.

Changes:
- palette.rs: add USER_BODY and LIGHT_USER_BODY color constants
- palette.rs: adapt_fg_for_palette_mode entry for light-mode mapping
- history.rs: add user_body_style() function
- history.rs: replace message_body_style() with user_body_style()
  in all three User render paths (lines / lines_with_options /
  transcript_lines)

Co-authored-by: Assassin-D007 <ws1554410958@163.com>
2026-05-08 02:44:02 -05:00
Hunter Bown 218d797b0b fix(cli): preserve split prompt words from Windows shims (#1160) 2026-05-08 02:39:09 -05:00
Hunter Bown f91970f092 fix(skills): accept workflow pack archive layouts (#1164)
Teach /skill install to recognize compatible skill directories such as .claude/skills/<name>/SKILL.md, nested packages/.../skills/<name>/SKILL.md, and single nested skill repos while still extracting only the selected subtree.

Also make /init treat an existing AGENTS.md as an idempotent no-op so the TUI matches the dispatcher behavior instead of surfacing a scary error for an already-initialized project.
2026-05-08 02:37:21 -05:00
Hunter Bown 724af9494a fix(tui): keep interactive sessions in alternate screen (#1158) 2026-05-08 02:30:57 -05:00