9 Commits

Author SHA1 Message Date
fullex
53a3577389 refactor(renderer): flatten src/renderer/src to src/renderer
Move all renderer source from src/renderer/src/* up one level to
src/renderer/*, removing the redundant nested src directory.

- Update path aliases (@renderer, @types, @logger, @data) and TanStack
  Router paths in electron.vite.config.ts; update tsconfig.{json,web,node}
  path mappings and include globs.
- Fix Vite root-relative script paths in the 8 renderer HTML entries.
- Update cross-process relative imports in main/preload (language,
  apiServer models, preload index) to drop the /src segment.
- Switch renderer test imports of the logger mock to the @test-mocks alias.
- Update hardcoded renderer paths in scripts and their fixtures, lint
  configs (eslint/oxlint/biome), CODEOWNERS, docs, and the data-classify tool.
- Convert deep (../../+) relative imports within the renderer to the
  @renderer alias (69 files, 108 imports); keep single-level relatives.
- Fix doc links broken by the move and correct one pre-existing broken
  link in naming-conventions.md.
2026-05-28 21:40:20 -07:00
fullex
c514dcc049 refactor(shared): move packages/shared to src/shared
packages/shared was never a real pnpm workspace package (no package.json); it was referenced only through the @shared TypeScript path alias. Relocate it under src/ via git mv (143 files, detected as pure renames).

Repoint the @shared alias and include globs to src/shared across electron.vite.config.ts, tsconfig.{json,node,web}.json and vitest.config.ts; update scripts/check-custom-exts.ts, scripts/update-languages.ts, the eslint.config.mjs generated-file globs, the data-classify generator output targets, .github/CODEOWNERS path rules, and CLAUDE.md/docs/source-comment references.

The @shared alias name is unchanged, so all 1403 @shared/* import sites resolve without modification. Verified with typecheck:node, typecheck:web and the full test suite (700 files, 9739 tests passing).
2026-05-28 21:02:49 -07:00
jidan745le
780a884c67 feat(data): provider/model data migration and registry service (backend only) (#14115)
### What this PR does

Before this PR:
- v2 migration did not include provider/model data migration from legacy
`llm` state.
- Provider/model data APIs and handlers were incomplete.
- `@cherrystudio/provider-registry` (formerly provider-catalog) package
was not integrated into the data layer.

After this PR:
- Add provider/model migration path (`ProviderModelMigrator` + mappings)
and register it in v2 migrator flow.
- Add `@cherrystudio/provider-registry` package with JSON-based registry
data, Zod-validated schemas, and lifecycle-managed
`ProviderRegistryService`.
- Complete provider/model schemas, services, handlers, shared API
schemas/types, and model merger utility.
- Complete provider API endpoints (`registry-models`, `auth-config`,
`api-keys`) aligned with lifecycle DI patterns.

**Note:** This PR is intentionally scoped to backend/data-layer only.
Renderer consumer migration will be submitted in a separate PR to
maintain domain separation.

Fixes #

N/A

### Why we need it and why it was done in this way

The following tradeoffs were made:
- Kept migration and data API implementation within current v2
architecture (handler -> service -> db schema) instead of adding
temporary compatibility layers.
- Replaced protobuf toolchain with JSON + Zod validation for simpler
data pipeline and better debuggability.
- Converted all numeric enums to string-valued `as-const` objects
(EndpointType, ModelCapability, Modality, etc.) for runtime
debuggability.
- Unified separate `baseUrls`, `modelsApiUrls`, `reasoningFormatTypes`
fields into a single `endpointConfigs` map keyed by EndpointType.

The following alternatives were considered:
- Keep protobuf-based registry data; rejected due to complexity of proto
toolchain and poor debuggability of binary data.
- Include renderer consumer migration in same PR; deferred to separate
PR for cleaner domain boundaries.

Links to places where the discussion took place:
- Original combined PR: #14034

### Breaking changes

None.

### Special notes for your reviewer

- This is a backend-only extraction from #14034, which contained both
backend and renderer consumer code. The renderer migration will follow
in a separate PR.
- Please focus review on migration flow (`ProviderModelMigrator`),
provider/model service contracts, and the registry package design.
- The `@cherrystudio/provider-registry` package was renamed from
`provider-catalog` and uses JSON data files instead of protobuf.

### Checklist

- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: Write code that humans can understand and Keep it simple
- [x] Refactor: You have left the code cleaner than you found it (Boy
Scout Rule)
- [ ] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: Not required (internal data layer, no user-facing
changes)
- [x] Self-review: I have reviewed my own code

### Release note

```release-note
NONE
```

---------

Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: suyao <sy20010504@gmail.com>
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
2026-04-10 19:12:33 +08:00
MyPrototypeWhat
4b65dfa6ea feat: integrate HeroUI and Tailwind CSS for enhanced styling (#9973) 2025-09-07 16:49:30 +08:00
kangfenmao
4805e07106 Revert "feat(cherry-store): add cherry store (#8683)"
This reverts commit 4d79c96a4b.
2025-08-06 14:29:55 +08:00
MyPrototypeWhat
4d79c96a4b feat(cherry-store): add cherry store (#8683)
* feat(discover): implement Discover feature with routing and UI components

- Added a new Discover page with sidebar and main content areas.
- Integrated routing for Discover, including subcategories and tabs.
- Created components for Discover sidebar and main content.
- Updated localization files to include new Discover titles and labels.
- Refactored existing components to accommodate the new Discover feature.
- Enhanced sidebar icons and navigation for better user experience.

* feat(discover): enhance Discover page with Tailwind CSS integration and routing improvements

- Added Tailwind CSS import to the entry point for styling.
- Updated the ThemeProvider to dynamically apply Tailwind themes based on user selection.
- Refactored Discover page to utilize new ROUTERS structure for better routing management.
- Simplified category handling in useDiscoverCategories hook by leveraging ROUTERS_ENTRIES.
- Introduced InternalCategory interface for better type management in Discover components.
- Cleaned up unused code and comments for improved readability.

* fix: update import statement for linguist-languages in update-languages.ts

* fix: standardize import quotes and improve localization files

- Updated import statements in use-mobile.ts and motionVariants.ts to use single quotes for consistency.
- Added new localization entries for the "discover" section in multiple language files, including English, Japanese, Russian, Traditional Chinese, Greek, Spanish, French, and Portuguese.

* refactor(discover): simplify Discover page structure and improve routing logic

- Refactored DiscoverPage component to streamline tab and sidebar handling.
- Updated routing logic to utilize a new ROUTERS_MAP for better category management.
- Removed unused props and simplified state management in useDiscoverCategories hook.
- Enhanced DiscoverSidebar and DiscoverMain components for improved clarity and performance.
- Adjusted CherryStoreType enum values for consistency in path definitions.

* fix: update file upload body type in MineruPreprocessProvider

- Changed the body of the fetch request from a Buffer to a Uint8Array to ensure proper handling of binary data during PDF uploads.

* fix: ensure Blob creation uses a copy of byte arrays for image handling

- Updated Blob creation in ImageGenerationMiddleware, ImageViewer, and MessageImage components to use `slice()` on byte arrays, preventing potential mutations of the original data.

* chore: update Vite React SWC plugin and adjust Electron config for conditional styling

- Upgraded `@vitejs/plugin-react-swc` from version 3.9.0 to 3.11.0 for improved performance and features.
- Modified Electron Vite configuration to conditionally apply styled-components plugin based on the VITEST environment variable.
- Updated snapshot tests for `InputEmbeddingDimension` and `Spinner` components to reflect style changes.

* chore: upgrade @swc/plugin-styled-components to version 9.0.2 in package.json and yarn.lock

* refactor: streamline styled-components plugin configuration in Electron Vite setup

- Consolidated the styled-components plugin configuration in the Electron Vite config file for improved readability and maintainability.
- Removed conditional application of the plugin based on the VITEST environment variable, ensuring consistent styling behavior across environments.

* i18n: update translations for discover section across multiple languages

- Replaced placeholder text with accurate translations for the "discover" section in English, Japanese, Russian, Traditional Chinese, Greek, Spanish, French, and Portuguese.
- Ensured consistency in terminology and improved clarity in user-facing messages.

* i18n: update "discover" title translations across multiple languages

- Updated the "discover" title in English, Japanese, Russian, Traditional Chinese, Greek, Spanish, French, and Portuguese to ensure accurate and consistent terminology.
- Adjusted related key mappings in the localization files for improved clarity in user-facing messages.

* chore: update lucide-react to version 0.536.0 and clean up tsconfig paths

* fix: update input style in snapshot tests and format message mentions in MessageContent component
2025-08-06 14:13:31 +08:00
alickreborn0
3b123863b5 feat: Support LLM Tracing by Alibaba Cloud EDAS product (#7895)
* feat: add tracing modules

* Initial commit

* fix: problem

* fix: update trace web

* fix: trace view

* fix: trace view

* fix: fix some problem

* fix: knowledge and mcp trace

* feat: save trace to user home dir

* feat: open trace with electron browser window

* fix: root trace outputs

* feat: trace internationalization and add trace icon

* feat: add trace title

* feat: update

* package.json添加windows运行script

* feat: update window title

* fix: mcp trace param

* fix: error show

* fix: listTool result

* fix: merge error

* feat: add stream usage and response

* feat: change trace stream

* fix: change stream adapter

* fix: span detail show problem

* fix: process show by time

* fix: stream outputs

* fix: merge problem

* fix: stream outputs

* fix: output text

* fix: EDAS support text

* fix: change trace footer style

* fix: topicId is loaded multiple times

* fix: span reload problem & attribute with cache

* fix: refresh optimization

* Change Powered by text.

* resolve upstream conflicts

* fix: build-time type exception

* fix: exceptions not used when building

* fix: recend no trace

* fix: resend trace list

* fix: delete temporary files

* feat: trace for resend

* fix: trace for resend message with edit

* fix: directory structure and construction method of mcp-trace

* fix: change CRLF to LF

* fix: add function call outputs

* Revert "fix: change CRLF to LF"

* fix: reorganize multi-model display

* fix: append model trace binding topic

* fix: some problems

* fix: code optimization

* fix: delete async

* fix: UI optimization

* fix: sort import

---------

Co-authored-by: 崔顺发 <csf01409784@alibaba-inc.com>
Co-authored-by: 管鑫荣 <gxr01409783@alibaba-inc.com>
2025-07-20 14:53:35 +08:00
kangfenmao
c8711c5804 feat: add local module 2024-08-27 11:31:05 +08:00
kangfenmao
21f937a9cc feat: add vite-electron template 2024-05-24 10:03:02 +08:00