Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
80c2cb6
fix: align OpenAI config flow (#34)
moinulmoin Nov 5, 2025
6de9eaa
fix: sync microphone list with system
moinulmoin Nov 6, 2025
51d5e3f
fix: ensure audio device listeners clean up
moinulmoin Nov 11, 2025
820bb1e
fix: avoid double log extension
moinulmoin Nov 11, 2025
ba80d62
feat: add clipboard retention preference
moinulmoin Nov 11, 2025
9d3f815
refactor: simplify recording pill event handling
moinulmoin Nov 14, 2025
a99320b
refactor: normalize error handling for license and AI UI
moinulmoin Nov 14, 2025
a44bdd9
feat: improve AI model availability and auto-selection
moinulmoin Nov 14, 2025
2799928
feat: queue critical pill events for reliable delivery
moinulmoin Nov 14, 2025
924d0ff
chore: configure eslint 9
moinulmoin Nov 16, 2025
a51b379
fix: defer mic permission prompts until onboarding complete
moinulmoin Nov 27, 2025
70238af
fix: license errors, app reset, and tauri config
moinulmoin Nov 30, 2025
311c61e
fix: improve AI config auto-selection
moinulmoin Dec 1, 2025
a0627c1
fix: improve recording feedback with sound, throttle, and duration gates
moinulmoin Dec 2, 2025
ade912b
fix: remove unnecessary hooks and additional directories from AI config
moinulmoin Dec 3, 2025
defc907
feat: simplify pill UI to minimal 3-dot indicator with separate toast…
moinulmoin Dec 11, 2025
138c902
fix: add toast window to capabilities and increase pill-toast gap
moinulmoin Dec 11, 2025
a2ad068
refactor: extract modules from lib.rs for better maintainability
moinulmoin Dec 11, 2025
3fba56f
fix: route recording errors via pill toast
moinulmoin Dec 12, 2025
27ab86d
fix: Windows device ID fallback + license status timeout
moinulmoin Dec 13, 2025
f78755d
chore: add debug logs for Windows device ID source
moinulmoin Dec 13, 2025
edc260e
fix: treat only watchdog timeout as timeout
moinulmoin Dec 13, 2025
e0ceb8d
fix: redact API key logging
moinulmoin Dec 13, 2025
39ab78b
feat: move pill/toast lower and auto-reposition on monitor change
moinulmoin Dec 13, 2025
04f90f1
fix: improve toast notification with dynamic width and better error m…
moinulmoin Dec 13, 2025
0a0fa64
fix: improve OpenAI config UX with Update button and better switch vi…
moinulmoin Dec 13, 2025
d33bebb
refactor: simplify release scripts and remove redundant files
moinulmoin Dec 14, 2025
9469a0e
fix: auto-set GITHUB_TOKEN from gh CLI for release-it
moinulmoin Dec 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 1 addition & 53 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,6 @@
"mcp__sequential-thinking__sequentialthinking",
"Bash(pnpm audit:*)"
],
"deny": [],
"additionalDirectories": ["/Users/moinulmoin/Developer/oss/voicetypr-web"]
},
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "echo '📚 Pre-edit analysis for: $FILE_PATH' && echo 'ℹ️ Reminder: Read related files, understand dependencies, and check for regression areas'"
}
]
},
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "echo '📚 Pre-write analysis for: $FILE_PATH' && echo 'ℹ️ Reminder: Check if this file should exist and understand its purpose in the codebase'"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "echo '🔍 Post-edit checks:' && echo '1. Check IDE diagnostics (mcp__ide__getDiagnostics)' && echo '2. Run related tests' && echo '3. Review changes with git diff' && echo '4. Ensure dev server is still running properly'"
}
]
},
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "echo '🔍 Post-write checks:' && echo '1. Verify file integrates with existing code' && echo '2. Add/update tests for new functionality' && echo '3. Check IDE diagnostics' && echo '4. Ensure proper imports/exports'"
}
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "echo '✅ Bash command complete'"
}
]
}
]
"deny": []
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ agent-docs/
.build/

sidecar/ffmpeg/vendor
opencodetmp
4 changes: 4 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
},
"hooks": {
"before:init": ["pnpm typecheck"],
"after:bump": [
"sed -i '' 's/^version = \".*\"/version = \"'${version}'\"/' src-tauri/Cargo.toml",
"git add src-tauri/Cargo.toml"
],
"after:release": "echo 'Release draft created for v${version}'"
},
"plugins": {
Expand Down
159 changes: 108 additions & 51 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,110 @@
# AGENTS.md — AI Agent Guide for VoiceTypr

## Purpose & Scope
Guidance for AI coding agents and contributors working in this repository. Keep changes minimal, correct, and aligned with existing patterns. For deeper context, read:
- `agent-docs/ARCHITECTURE.md`
- `agent-docs/README.md`
- `agent-reports/` (analysis reports)
- `CLAUDE.md` (coding assistant ground rules)

## Repository Overview
- Frontend (React + TypeScript): `src/`
- `components/`, `components/ui/`, `components/tabs/`, `components/sections/`
- `contexts/`, `hooks/`, `lib/`, `utils/`
- `assets/`, `globals.css`, `test/`
- Backend (Rust + Tauri v2): `src-tauri/src/`
- `ai/`, `audio/`, `commands/`, `state/`, `utils/`, `whisper/`, `tests/`
- Shared/other: `public/`, `scripts/`, `agent-docs/`, `agent-reports/`
- Path alias: `@/*` → `./src/*` (see `tsconfig.json`)

## Toolchain & Commands
- Dev: `pnpm dev` (frontend), `pnpm tauri dev` (full app)
- Build: `pnpm build`
- Quality: `pnpm lint`, `pnpm typecheck`, `pnpm format`, `pnpm quality-gate`
- Tests: `pnpm test`, `pnpm test:watch`, `pnpm test:backend` (Cargo)

## Coding Conventions
- Frontend
- React 19 with function components + hooks; strict TypeScript (see `tsconfig.json`)
- Tailwind CSS v4 utilities; shadcn/ui components in `src/components/ui/`
- Keep logic in hooks/lib; small, focused components; no unnecessary comments
- Backend
- Rust 2021+, modules under `src-tauri/src/*`; run `cargo fmt`/`clippy` locally
- Tauri v2 commands in `src-tauri/src/commands`; audio/whisper modules encapsulate native work

## Testing Strategy
- Frontend: Vitest + React Testing Library; component tests near components (e.g. `__tests__`) and integration in `src/test/`
- Backend: Rust unit/integration tests in `src-tauri/src/tests`; run with `pnpm test:backend`

## Agent Workflow & Guardrails
1. Understand first: prefer `functions.Read`, `Grep`, `Glob`, `LS` for exploration; use absolute paths.
2. Spec-first when asked “how to approach”: propose a concise plan before edits; await approval.
3. Follow existing patterns/libraries; do not introduce new deps without necessity.
4. Before completion: run `pnpm lint`, `pnpm typecheck`, `pnpm test`, and `cd src-tauri && cargo test` unless explicitly waived.
5. Git safety: `git status` → review diffs → commit; never include secrets; don’t push unless asked.

## Commit & PR Guidelines
- Conventional Commits (e.g., `feat:`, `fix:`, `docs:`); keep scopes tight and messages concise.
- Run `pnpm quality-gate` before opening PRs; document capability changes (Tauri) in the PR.
# VoiceTypr

macOS desktop app for offline voice transcription using Whisper AI. Built with Tauri v2 (Rust backend) and React 19 (TypeScript frontend). Features system-wide hotkey recording, automatic text insertion at cursor, and local model management.

## Core Commands

```bash
# Development
pnpm dev # Frontend only (Vite)
pnpm tauri dev # Full Tauri app (frontend + Rust)

# Quality checks (run before commits)
pnpm lint # ESLint
pnpm typecheck # TypeScript compiler
pnpm test # Vitest frontend tests
pnpm test:backend # Rust tests (cd src-tauri && cargo test)
pnpm quality-gate # All checks in one script

# Build
pnpm build # Frontend build
pnpm tauri build # Native .app bundle
```

## Project Layout

```
src/ # React frontend
├── components/ # UI components
│ ├── ui/ # shadcn/ui primitives
│ ├── tabs/ # Tab panel components
│ └── sections/ # Page sections
├── contexts/ # React context providers
├── hooks/ # Custom React hooks
├── lib/ # Shared utilities
├── utils/ # Helper functions
├── services/ # External service integrations
├── state/ # State management (Zustand)
└── test/ # Integration tests

src-tauri/src/ # Rust backend
├── commands/ # Tauri command handlers
├── audio/ # CoreAudio recording
├── whisper/ # Transcription engine
├── ai/ # AI model management
├── parakeet/ # Parakeet sidecar integration
├── state/ # Backend state management
├── utils/ # Rust utilities
└── tests/ # Rust unit tests
```

## Development Patterns

### Frontend
- **Framework**: React 19 with function components + hooks
- **Styling**: Tailwind CSS v4; use `@/*` path alias for imports
- **Components**: shadcn/ui in `src/components/ui/`; extend, don't modify
- **State**: React hooks + Zustand + Tauri events
- **Types**: Strict TypeScript; avoid `any`
- **Tests**: Vitest + React Testing Library; test user behavior, not implementation

### Backend
- **Language**: Rust 2021 edition
- **Framework**: Tauri v2 with async commands
- **Modules**: Commands in `commands/`; domain logic in dedicated modules
- **Style**: Run `cargo fmt` and `cargo clippy` before commits
- **Tests**: Unit tests in `tests/` directory; use `#[tokio::test]` for async

### Communication
- Frontend calls backend via `invoke()` from `@tauri-apps/api`
- Backend emits events via `app.emit()` or `window.emit()`
- Event coordination handled by `EventCoordinator` class

## Git Workflow

- **Commits**: Conventional Commits (`feat:`, `fix:`, `docs:`, `refactor:`)
- **Pre-commit**: Run `pnpm quality-gate` or individual checks
- **Branches**: Feature branches off `main`
- **Never push** without explicit user instruction

```bash
git status # Always check first
git diff # Review changes
git add -A && git commit -m "feat: description"
```

## Gotchas

1. **macOS only**: Parakeet models use Apple Neural Engine; Whisper uses Metal GPU
2. **Path alias**: Use `@/` not `./src/` for imports (e.g., `@/components/ui/button`)
3. **NSPanel focus**: Pill window uses NSPanel to avoid focus stealing; test carefully
4. **Clipboard**: Text insertion preserves user clipboard; restored after 500ms
5. **Model preloading**: Models preload on startup; don't assume instant availability
6. **Tauri capabilities**: Permission changes require edits in `src-tauri/capabilities/`
7. **Large lib.rs**: Main Rust entry point at 96KB; navigate via module imports
8. **Sidecar builds**: Parakeet Swift sidecar built via `build.rs` during `tauri build`

## Key Files

- `src-tauri/src/lib.rs` — Main Rust entry, command registration
- `src-tauri/src/commands/` — All Tauri command implementations
- `src/hooks/` — React hooks for Tauri integration
- `src/components/tabs/` — Main UI tab components
- `src-tauri/capabilities/` — Tauri permission definitions

## References
- `agent-docs/ARCHITECTURE.md`, `agent-docs/EVENT-FLOW-ANALYSIS.md`, security docs in `agent-docs/` and `agent-reports/`
- `README.md` for product overview and repo structure
- `CLAUDE.md` for assistant rules and commands

- `agent-docs/ARCHITECTURE.md` — Detailed architecture diagrams
- `agent-docs/EVENT-FLOW-ANALYSIS.md` — Event system documentation
- `CLAUDE.md` — Coding assistant guidelines
- `README.md` — Product overview
Loading