Cursor rule
.cursor/rules/client.mdcCursor rules
Quality
60/100
Scores the file, not the repository.Length
337 words
5 headings · 0 code blocksRepository
4.0k
— · pushed 2 days agoLast changed
3 days ago
First indexed 3 days ago.12345## Client Adapters (packages/client)67- **Role**: Bridge between UI (Vue/Pinia) and core (`packages/core`) in both:8 - **Browser-only mode** (embedded core via `core-runtime` / `core-bridge`).9 - **Server mode** (WebSocket adapter to `apps/server`).10- Keep this package thin and focused on:11 - Event wiring.12 - Session/account management.13 - Store updates and derivations for UI consumption.1415### Core Runtime & Bridge1617- `core-runtime`:18 - Owns the lifecycle of `CoreContext` and DB initialization in browser mode.19 - Exposes helper methods (`getCtx`, `destroy`, etc.) instead of leaking internal implementation.20- `core-bridge`:21 - Manages sessions, the active account slot, and event handler registration.22 - On account switch:23 - Destroy the existing `CoreContext`.24 - Re-register client-side event handlers for the new active account.25 - Never share a single runtime instance across different account IDs.2627### Events & Type Safety2829- Always go through the typed WebSocket/core event maps:30 - Use `WsEventToServer`, `WsEventToClient`, and `FromCoreEvent` / `ToCoreEvent` types.31 - Avoid untyped `any` payloads or generic `Record<string, unknown>` where stronger types are available.32- When adding new events:33 - Update the shared `@tg-search/server/types`.34 - Extend client event handler maps and registration helpers.35 - Keep the mapping between WS event names and core events explicit.3637### Pinia Stores & Composables3839- Stores in `packages/client` are the **source of truth** for app state:40 - Use actions to emit events to core and react to `FromCoreEvent` updates.41 - Avoid duplicating the same state in both `apps/web` and `packages/client`.42- For reusable logic, prefer composables and pure utilities inside this package rather than re-implementing logic in components.4344### Logging & Error Handling4546- Use `useLogger` with a **component/module name** (e.g. `'CoreBridge'`) for all logs in this package.47- Log:48 - High-level intent (event name, account/session IDs).49 - Errors when event delivery or handler invocation fails.50- Do not log sensitive payload data (raw messages, tokens, secrets).51- When something fails:52 - Prefer emitting a client-facing event that the UI can react to (e.g. a `core:error` or domain-specific failure event).53 - Avoid throwing unhandled exceptions that would crash the whole bridge.5455
Also in groupultra/telegram-search
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| groupultra/telegram-search.cursor/rules/testing.mdc · 4.0k | Cursor rules | teststyletesting-strategydatabase | 55/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/architecture.mdc · 4.0k | Cursor rules | buildtestlint-formatarch+4 | 89/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/backend-server.mdc · 4.0k | Cursor rules | setupsecuritymonorepo | 52/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/contributing.mdc · 4.0k | Cursor rules | styletypesgit | 56/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/core.mdc · 4.0k | Cursor rules | stylearchdependenciesdatabase+1 | 60/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/db.mdc · 4.0k | Cursor rules | styletypesdatabaseperformance | 59/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/events.mdc · 4.0k | Cursor rules | style | 60/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/frontend-web.mdc · 4.0k | Cursor rules | stylesecurityuimonorepo | 56/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/pglite-inspector.mdc · 4.0k | Cursor rules | securityapi | 47/100 | 3 days ago | |
| groupultra/telegram-search.cursor/rules/tooling.mdc · 4.0k | Cursor rules | buildlint-formatstyledeployment+1 | 67/100 | 3 days ago | |
| groupultra/telegram-search.github/copilot-instructions.md · 4.0k | Copilot instructions | teststyleagent-behaviour | 76/100 | 3 days ago | |
| groupultra/telegram-searchAGENTS.md · 4.0k | AGENTS.md | setupbuildtestlint-format+10 | 83/100 | 3 days ago |
Diff against .cursor/rules/testing.mdc Diff against .cursor/rules/architecture.mdc Diff against .cursor/rules/backend-server.mdc Diff against .cursor/rules/contributing.mdc Diff against .cursor/rules/core.mdc Diff against .cursor/rules/db.mdc Diff against .cursor/rules/events.mdc Diff against .cursor/rules/frontend-web.mdc Diff against .cursor/rules/pglite-inspector.mdc Diff against .cursor/rules/tooling.mdc Diff against .github/copilot-instructions.md Diff against AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
