# Extension points — clash-verge-rev/clash-verge-rev

> Canonical page: https://codevetter.com/unpack/clash-verge-rev/extension-points

# Extension points — clash-verge-rev/clash-verge-rev

Scanned commit fd06fbb3b71ee5c4467bc0e3cc505dcac5348371 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

New behavior is expected to plug into a few explicit tables rather than into new processes. IPC commands go in cmd/ and generate_handlers. UI routes go in navigationItems. Hotkeys, tray items, URI schemes, and media-unlock checks are enums or maps. Profile enhancement is a fixed chain of merge and script items plus two builtin JS files, not a dynamic plugin loader. The Draft type and Run State are the shared extension surfaces for config and service status.
- New Tauri commands must be added as #[tauri::command] functions under src-tauri/src/cmd/ and listed in app_init::generate_handlers. The module re-exports each command module from cmd/mod.rs. — [src-tauri/src/lib.rs#L126-L216](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/lib.rs#L126-L216) [src-tauri/src/cmd/mod.rs#L94-L129](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/cmd/mod.rs#L94-L129)
- Frontend routes are data, not a nested route file tree. Adding a page means a navigationItems entry plus a navItems Component. The router maps those path/Component pairs and nothing else. — [src/pages/_navigation-meta.ts](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src/pages/_navigation-meta.ts) [src/pages/_navigation.tsx#L37-L78](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src/pages/_navigation.tsx#L37-L78) [src/pages/_routers.tsx](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src/pages/_routers.tsx)
- Hotkey functions are the HotkeyFunction enum plus FromStr names. Adding a shortcut means extending that enum and the register path in core/hotkey.rs; unknown names bail with invalid hotkey function. — [src-tauri/src/core/hotkey.rs#L21-L74](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/hotkey.rs#L21-L74)
- Tray labels and ids are generated by the define_menu! macro in core/tray/menu_def.rs, with display strings looked up through clash_verge_i18n::t. A new tray row is a new macro entry, not a free-form menu builder at the call site. — [src-tauri/src/core/tray/menu_def.rs#L1-L51](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/tray/menu_def.rs#L1-L51)
- Share-link import extends URI_PARSERS in src/utils/uri-parser/index.ts. Each scheme maps to a function (uri) => IProxyConfig. — [src/utils/uri-parser/index.ts#L15-L40](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src/utils/uri-parser/index.ts#L15-L40)
- A new streaming check is an UnlockCheck variant in crates/clash-verge-media-unlock/src/lib.rs, a name() match arm, an ALL entry, and a module such as netflix.rs. The UI calls get_unlock_items and check_media_unlock; it does not hardcode the list. — [crates/clash-verge-media-unlock/src/lib.rs#L26-L80](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/crates/clash-verge-media-unlock/src/lib.rs#L26-L80) [src-tauri/src/cmd/media_unlock_checker/mod.rs#L6-L9](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/cmd/media_unlock_checker/mod.rs#L6-L9)
- Profile enhancement extension points are per-profile and global ChainItems of type merge, script, rules, proxies, and groups, applied by process_seq_items, process_global_items, and process_profile_items. Builtin JS is the fixed pair meta_guard.js and meta_hy_alpn.js under enhance/builtin/, gated by enable_builtin_enhanced. — [src-tauri/src/enhance/mod.rs#L50-L98](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/enhance/mod.rs#L50-L98) [src-tauri/src/enhance/mod.rs#L914-L956](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/enhance/mod.rs#L914-L956)
- Backend user-visible strings go through crates/clash-verge-i18n, which loads YAML locales with rust_i18n and falls back to zh. Frontend strings are JSON under src/locales, with generated key types from pnpm i18n:types. — [crates/clash-verge-i18n/src/lib.rs#L1-L8](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/crates/clash-verge-i18n/src/lib.rs#L1-L8) [Makefile.toml#L58-L74](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/Makefile.toml#L58-L74)
- Service vs sidecar policy is the startup_decision function over ServiceStatus, plus Run State in core/runstate. New install/repair outcomes should map there rather than grow a second status enum in the UI. — [src-tauri/src/core/manager/lifecycle.rs#L40-L49](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/manager/lifecycle.rs#L40-L49) [src-tauri/src/core/service.rs#L154-L180](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/service.rs#L154-L180)
- Verge and profile mutations are supposed to go through DraftTransaction and Config::lock_config_write, not direct YAML writes. patch_verge and generate_with_profiles are the two patterns. — [src-tauri/src/feat/config.rs#L296-L321](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/feat/config.rs#L296-L321) [src-tauri/src/config/config.rs#L224-L248](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/config/config.rs#L224-L248)
- Frontend event names are the VergeEvents map in src/services/events.ts. A new backend emit is invisible to React until that map and a subscribeVergeEvents handler both include it. — [src/services/events.ts#L6-L36](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src/services/events.ts#L6-L36)
- Command failures that the UI can classify should use CommandFailure::coded or SysproxyFailure codes. proxy_aware_coded_error lets a proxy classification outrank the operation fallback such as CORE_RESTART_FAILED. — [src-tauri/src/cmd/mod.rs#L6-L91](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/cmd/mod.rs#L6-L91) [src-tauri/src/cmd/mod.rs#L204-L214](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/cmd/mod.rs#L204-L214)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
