1.1 KiB
1.1 KiB
Shared
Cross-process code used by main and renderer.
What Goes Here
- Types shared between processes
- Pure utility functions (no Node/DOM APIs)
- Constants used across processes
What Doesn't Go Here
- Node.js APIs → main/
- DOM/React APIs → renderer/
- Process-specific logic
Structure
types/- Shared type definitions (api.ts,notifications.ts,visualization.ts)utils/- Pure utility functionstokenFormatting.ts- Token formatting and estimation (estimateTokens,formatTokensCompact)modelParser.ts- Model name/family parsingteammateMessageParser.ts-<teammate-message>XML parsingmarkdownTextSearch.ts- Markdown-aware text searchcontentSanitizer.ts- Content sanitizationerrorHandling.ts- Error helperslogger.ts- Logging utility
constants/- Shared constantscache.ts- Cache configurationtrafficLights.ts- macOS traffic light constantstriggerColors.ts- Trigger color palettewindow.ts- Window configuration
Import
import { SomeType } from '@shared/types';
import { estimateTokens } from '@shared/utils/tokenFormatting';