claude-prism/apps/desktop/src-tauri/icons/ios/AppIcon-512@2x.png
GerardDevlin 973005e086
Some checks failed
Lint / lint (push) Has been cancelled
Improve Windows setup, Muti-model extension, API auth, sessions, and project recovery (#154)
* Improve Windows setup, API auth, sessions, and project recovery

* Restore recent project on startup

* Extract PDF attachment text with MuPDF

* Add OpenAI-compatible provider mode

* Add tool loop for OpenAI-compatible providers

* Stream OpenAI-compatible provider responses

* Fallback when compatible providers reject tools

* Surface compatible provider reasoning content

* Support legacy function calls for compatible providers

* Add OpenAI-compatible provider presets

* Add planning and listing tools for compatible providers

* Show direct provider model in chat composer

* Expose direct provider status fields

* Add direct provider task compatibility tools

* Persist direct provider task state

* Read PDF sidecars in direct provider

* Create PDF sidecars for project attachments

* Sanitize direct provider reasoning history

* Allow API provider setup without Claude CLI

* Repair auth settings when saving API keys

* Preserve DeepSeek reasoning history for direct provider

* Restore direct provider reasoning from sessions

* Parse compatible provider token usage

* Keep direct provider sessions consistent

* Pair cancelled direct tool calls

* Verify compatible provider keys before saving

* Support ModelGate Claude proxy setup

* Reject mismatched ModelGate proxy URLs

* Allow changing configured AI provider

* Expose AI provider management when ready

* Replace provider dropdowns with setup cards

* Support multiple direct provider credentials

* Fix provider credential string normalization

* Show provider logos in model selectors

* Add Anthropic and Zhipu provider logos

* Simplify OpenAI-compatible provider presets

* Derive provider labels from configured endpoints

* Remove custom Claude proxy preset

* Support chat provider and model switching

* Use Anthropic icon for Claude Code selector

* Add provider setup from chat picker

* Prevent provider dialog overflow

* Expand direct provider tool compatibility

* Bring direct provider runtime closer to Claude Code

* Raise Rust macro recursion limit

* Show direct provider API errors

* Force final answer after direct provider tool loops

* feat: add OpenAI-compatible provider support and polish desktop UX

- Add project-level OpenAI-compatible provider configuration for Qwen, DeepSeek, GLM, Gemini, Moonshot, and OpenAI
- Support provider/model switching inside the chat composer
- Preserve chat continuity when switching between direct providers
- Bridge direct-provider conversation context when switching back to Claude Code
- Improve direct-provider tool compatibility, Python/uv context, skills behavior, and PDF text extraction
- Replace app icons with the new ClaudePrism prism icon
- Improve project naming, rename handling, recent project/session migration, and session deletion UX
- Polish provider icons, chat error spacing, uv dialog layout, and light-mode native title bar

* feat: add OpenAI-compatible provider support and polish desktop UX

- Add project-level OpenAI-compatible provider configuration for Qwen, DeepSeek, GLM, Gemini, Moonshot, and OpenAI
- Support provider/model switching inside the chat composer
- Preserve chat continuity when switching between direct providers
- Bridge direct-provider conversation context when switching back to Claude Code
- Improve direct-provider tool compatibility, Python/uv context, skills behavior, and PDF text extraction
- Replace app icons with the new ClaudePrism prism icon
- Improve project naming, rename handling, recent project/session migration, and session deletion UX
- Polish provider icons, chat error spacing, uv dialog layout, and light-mode native title bar

* fix: resolve Dependabot security vulnerabilities

NPM (via pnpm.overrides):
- ws 8.19.0 → 8.21.0 (uninitialized memory disclosure)
- postcss 8.5.6 → 8.5.15 (XSS via unescaped style tags)
- uuid 10.0.0 → 14.0.0 (missing buffer bounds check)

Cargo (via tectonic 0.15 → 0.16 + cargo update):
- rand 0.8.5 → 0.8.6, 0.9.2 → 0.9.4 (unsound with custom logger)
- gix-validate 0.7.7 → 0.10.1 (submodule name validation bypass)
- gix-fs 0.18.2 remains at 0.18.x (upstream constraint, cannot
  reach 0.21.1 until watchexec/ignore-files updates gix deps)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: bump Linux vcpkg cache key for tectonic 0.16 compat

Force fresh vcpkg rebuild on Linux CI to resolve graphite2
gr_label_destroy linker error after tectonic 0.15 → 0.16 upgrade.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use static vcpkg triplet for Linux build

The default x64-linux triplet builds dynamic libraries, causing
graphite2's gr_label_destroy symbol to be hidden and unlinkable
after tectonic 0.15 → 0.16 upgrade.

Switch to a custom x64-linux-static triplet (static library linkage)
to match the approach used by macOS and Windows builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: set VCPKGRS_TRIPLET for Linux static build

tectonic's vcpkg dep_support looks for packages under the default
x64-linux triplet, but we install them under x64-linux-static.
Set VCPKGRS_TRIPLET=x64-linux-static so the Rust vcpkg crate
finds libpng and other dependencies in the correct location.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: revert Linux to x64-linux vcpkg triplet and add system graphite2

Revert the custom static triplet (didn't fix the issue) and instead
install libgraphite2-dev via apt. The vcpkg-built graphite2 marks
gr_label_destroy as a hidden symbol, but tectonic 0.16's bridge
crate references it. The system graphite2 package exports it properly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Expand provider support and refine desktop UX

Add OpenAI-compatible provider workflows, improve Claude/provider switching behavior, refresh desktop window theming and app icons, smooth PDF toolbar and touchpad zoom handling, and add Windows-friendly build scripts.

* fix: revert tectonic to 0.15 to fix Linux build

tectonic 0.16 causes undefined hidden symbol gr_label_destroy on
Linux due to graphite2 visibility issues in vcpkg builds. Revert to
tectonic 0.15 which works correctly with the existing vcpkg setup.

Security fixes retained:
- rand 0.8.5 → 0.8.6, 0.9.2 → 0.9.4

Workflow: revert to x64-linux triplet with libgraphite2-dev, fresh
cache key v3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: update render scale debounce time and enhance zoom anchor functionality in PDF viewer

* fix: revert tectonic to 0.15, keep tauri 2.11.1

Previous commit reverted Cargo.lock too far, bringing tauri back to
2.10.3 which mismatches NPM @tauri-apps/api 2.11.0. This commit
keeps tauri at 2.11.1 while reverting tectonic to 0.15.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: update tauri plugin crates to match NPM packages

tauri-plugin-dialog 2.6.0 → 2.7.1, tauri-plugin-fs 2.4.5 → 2.5.1
to match their NPM counterparts and fix version mismatch build error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: restore Linux vcpkg cache key to v1

The graphite2 hidden symbol issue is caused by fresh vcpkg builds,
not by tectonic version. The old v1 cache had a working graphite2
build. Restore the cache key to reuse it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove vcpkg graphite2 to use system library on Linux

vcpkg builds graphite2 with hidden symbol visibility, causing
undefined symbol errors at link time. Remove vcpkg's graphite2
before building so the linker falls back to the system
libgraphite2-dev which exports all symbols properly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: symlink system graphite2 into vcpkg path on Linux

tectonic's dep_support requires graphite2 at the vcpkg path.
Replace vcpkg's hidden-visibility graphite2 with symlinks to
the system libgraphite2 (from libgraphite2-dev) which exports
all symbols properly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use objcopy to globalize hidden graphite2 symbols on Linux

vcpkg builds graphite2 with -fvisibility=hidden, making gr_* API
symbols invisible to the linker. Use objcopy --globalize-symbol to
make them visible again before the Tauri build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: extract .a archive before objcopy to fix graphite2 symbols

objcopy cannot modify symbols inside .a archives directly. Extract
individual .o files with ar, globalize gr_* symbols in each, then
repack the archive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: avoid process substitution in objcopy graphite2 fix

Use a temp file for symbol list instead of <() process substitution,
which fails in GitHub Actions shell. Also add explicit shell: bash.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: prevent grep exit code 1 from aborting objcopy script

grep returns exit 1 when no match found, which aborts the script
under set -e. Wrap with { ... || true; } to prevent this.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use ld.bfd instead of lld for Linux build

rust-lld treats hidden symbol references as hard errors, but ld.bfd
resolves them. vcpkg's graphite2 has STV_HIDDEN on gr_* symbols which
lld refuses to link. Switch to ld.bfd via RUSTFLAGS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address provider security review and desktop UX regressions

* Polish workspace toolbar alignment

* Improve chat session recovery and titles

* Improve direct provider parity and session UX

Add Claude Code-style context compaction for OpenAI-compatible direct providers, including no-tools summaries and retry handling.

Generate cached model-backed session titles and auto-resume the latest project chat without delaying on title generation.

Polish editor search theming and keyboard navigation.

* feat(provider): run OpenAI-compatible models through Claude Code proxy

Replace the hand-written direct-provider runtime with a local Anthropic-to-OpenAI-compatible proxy so Qwen, DeepSeek, GLM, Gemini, and other compatible providers use the Claude Code CLI tool/session experience.

Normalize strict OpenAI tool_call/tool_result pairing to avoid provider 400 errors, keep session titles stable and synced, allow switching sessions while another chat is streaming, show running indicators, add provider deletion with confirmation, and auto-refresh the file sidebar with refresh feedback.

* feat(provider): run OpenAI-compatible models through Claude Code proxy

Replace the hand-written direct-provider runtime with a local Anthropic-to-OpenAI-compatible proxy so Qwen, DeepSeek, GLM, Gemini, and other compatible providers use the Claude Code CLI tool/session experience.

Normalize strict OpenAI tool_call/tool_result pairing to avoid provider 400 errors, keep session titles stable and synced, allow switching sessions while another chat is streaming, show running indicators, add provider deletion with confirmation, and auto-refresh the file sidebar with refresh feedback.

* fix(chat): enforce minimum composer drawer height

* feat(provider): add Ollama local model support

* feat(provider): add Ollama local model support

* chore: update version to 1.2.0 in package.json and Cargo files

* fix(BashWidget): update styles for terminal and result display

* feat(MarkdownRenderer): enhance table and horizontal rule rendering

* feat: stream compatible providers through Claude proxy

Stream OpenAI-compatible provider responses through the local Anthropic proxy instead of buffering full responses. Map reasoning and tool-call deltas into Claude Code-compatible SSE events, and cache generated session titles so opening history does not regenerate them.

* feat: align compatible proxy with Claude Code Router

Keep OpenAI-compatible providers on the native Claude Code pipeline while moving proxy transforms into dedicated modules. Add CCR-style message, provider, stream, and tool handling for thinking signatures, ExitTool fallback, streamed tool argument repair, cache cleanup, stream usage, and provider token compatibility.

* chore: bump version to 1.3.0 across all relevant files

* feat(chat): support queued guidance during active runs

Extract Claude CLI process lifecycle management into a dedicated claude_process module and expose an interrupt command for guided continuations.

Add per-tab queued guidance state so users can type follow-up direction while a response is streaming, force a selected guidance item into the next turn, and preserve the tab's provider when resuming.

Render pending guidance inline in the conversation, keep the composer send/stop behavior ergonomic during streaming, allow individual guidance removal, and polish the compact guidance row spacing and hover states.

Cover the queue, display, consume, and forced-guidance flows with store tests.

* fix(chat): allow multiple guided follow-ups

Keep guided follow-ups additive when users select multiple queued items during an active run instead of replacing the previously displayed guidance.

Prefer already-displayed guidance when continuing the next turn, preserve the first forced guidance item, and keep the forced queue state consistent when entries are removed or interrupted.

Add store coverage for displaying multiple guidance entries and consuming displayed guidance before ordinary queued items.

* fix(chat): interrupt active runs for guided follow-ups

Terminate the current Claude process on Windows when a guided follow-up is selected so queued guidance can take effect immediately instead of waiting for the active run to finish naturally.

Handle forced queued guidance before snapshot and file refresh work in the completion event, then resume the same tab with the preserved provider context.

* feat(messages): enhance handling of tool result images in OpenAI requests

* feat: add provider model capability metadata

Return OpenAI-compatible model metadata from the backend and preserve provider model ordering.

Add chat/vision capability badges, metadata-driven model filtering, Qwen vision fallbacks, and tests.

Keep pasted chat images as temporary context and block image sends for text-only provider models.

* fix: guard unsupported proxy image payloads

Send Anthropic image blocks as OpenAI image_url parts with high detail.

Detect endpoints known to reject OpenAI-style image parts and fail early with a clear provider error.

* feat: add multi-select file tree actions

Preserve app context menus while suppressing the browser menu elsewhere.

Support Ctrl/Cmd multi-select, batch drag moves, Delete/Backspace deletion, and a themed confirmation dialog for file tree items.

* fix: disable global webview zoom shortcuts

Disable Tauri zoom hotkeys for normal and debug windows.

Reset stale persisted app zoom on startup and consume Ctrl/Cmd zoom shortcuts without changing the whole webview scale.

* feat: implement cleanup for temporary files in chat composer and event hooks

* feat: enhance message handling to sanitize stored user prompts and improve context display

* refactor: clean up formatting and improve regex matching in chat store

* fix: restore smooth PDF touchpad and wheel zoom

Enable WebView2 pinch gestures by allowing zoom hotkeys at the native layer, while keeping app-level zoom shortcuts guarded in the frontend.

Rework PDF preview zoom handling to distinguish touchpad pinch from Ctrl/Cmd mouse-wheel zoom, preserve the cursor anchor, and make mouse wheel zoom respond on the first notch.

* refactor: remove PDF sidecar extraction and related logic from project attachments

* feat(providers): align compatible models with Claude Code runtime

Route DeepSeek and Qwen through native Anthropic-compatible Claude Code endpoints, including canonical base URL handling and model environment overrides.

Add CCR-style proxy transformer plumbing for remaining OpenAI-compatible providers and harden tool argument repair in the local Anthropic proxy.

Preserve per-session provider behavior, improve stop/guidance flow handling, and update setup/chat store tests for provider routing.

* feat(providers): route Kimi through Claude Code

Use Moonshot/Kimi Anthropic-compatible endpoints for the native Claude Code runtime.

Canonicalize legacy Moonshot OpenAI URLs to /anthropic while keeping model discovery on the provider's /v1/models endpoint.

Add setup-store and Rust route coverage for domestic and international Moonshot endpoints.

* fix(security): harden Claude Code provider routing

Remove the global Claude Code permission bypass so native Anthropic provider runs rely on Claude Code's normal approval model.

Clear inherited ANTHROPIC_* variables before proxy or native provider launches to prevent credential and endpoint leakage across routes.

Require HTTPS for known cloud provider endpoints, tighten DeepSeek proxy matching, and harden manual code-block shell execution with cwd validation, timeouts, and output limits.

* feat(pdf-viewer): enhance zoom functionality and add permission skip option

* feat(stream): improve error handling for provider stream and add SSE error rendering

* fix: align Kimi Claude Code native route

* feat(layout): enhance workspace components with responsive design adjustments

* refactor(tests): normalize recent project paths and improve readability
refactor(proposed-changes-panel): simplify JSX structure for added/removed indicators
refactor(pdf-viewer): format function parameters for better readability
fix(project-name): enhance validation for project names to prevent invalid characters
refactor(build): improve environment flag handling for better clarity
refactor(dev): streamline environment flag appending logic

* refactor(tests): update file paths in project and chat prompt tests for consistency

* feat(install): update install_claude_cli to return success status and handle timeout errors

* feat(skills): add timeout handling for skills installation and improve download logic

* feat(onboarding): add close button to the dialog in scientific skills onboarding

* feat: enhance skills management with import and delete functionality

- Added `import_skill_from_folder` command to import skills from a local directory.
- Implemented `delete_installed_skill` command to remove specific skills.
- Updated the skills installation process to provide detailed download progress.
- Refactored skills loading and management logic for better organization and efficiency.
- Enhanced the UI to support skill importing and deletion with appropriate user feedback.

* feat: enhance skills downloading and proxy configuration

* Add workspace layout controls

* Keep PDF preview for non-TeX selections

* Refine project picker experience

* Polish sidebar collapse animations

* Polish home and workspace interactions

* feat: enhance Claude setup with embedded variant and error handling

- Updated `useClaudeSetupStore` to require Claude Code installation before saving provider credentials.
- Modified `ClaudeSetup` component to support an embedded variant with improved UI for installation and configuration.
- Added detailed status messages for missing Git and installation prompts.
- Refactored project picker to include theme toggle and version display.
- Improved layout and styling for settings and environment status sections.

* feat: enhance anthropic response handling to include "thinking" block type

* Add required environment onboarding

* Polish environment onboarding completion flow

* Fix chat provider and attachment interactions

* Scope chat sessions by project

* feat: add file attachment functionality and improve message actions in chat

* style: update ChatComposer component styles for improved UI consistency

---------

Co-authored-by: Hanjin Bae <iwdhanjin@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Hanjin Bae <82585834+delibae@users.noreply.github.com>
2026-07-04 17:46:14 +09:00

778 KiB
1024x1024px