Files
mokosh/README.md
Mark d21ed17310 fix(01-12): brand polish — replace stale 'AI Call Recorder' refs with Mokosh (4 files)
Plan 01-12 D-07 (commit 5efc2a8) migrated manifest.json:name + tooltip
+ extName/extDesc keys to chrome.i18n placeholders + _locales/{en,ru}/
messages.json resolving to 'Mokosh — Session Capture' (EN) / 'Mokosh —
Запись сессии' (RU). However, 4 trailing references to the pre-D-07
literal 'AI Call Recorder' in non-manifest content surfaces were never
propagated. Operator noticed during Plan 01-10 cycle-2 UAT 2026-05-20.

This commit applies the user-approved 4-file surgical rename:

  - src/welcome/copy.ts: welcome.body.cta.toolbar RU CTA
    "иконку AI Call Recorder" → "иконку Mokosh" (matches toolbar tooltip
    i18n key tooltipOff = "Mokosh — щёлкните, чтобы начать запись").
    Inline rationale comment added cross-ref'ing the i18n key + this
    debug session.

  - README.md: H1 + first paragraph rewritten to
    "# Mokosh — Session Capture" + EN tagline line. Rest of README body
    preserved verbatim (technical-stack section historical mentions
    left as project history, not brand surface).

  - package.json: name "ai-call-extension" → "mokosh-session-capture",
    description rewritten to "Mokosh — Session Capture: Chrome MV3
    extension for operator session recording." version, scripts,
    dependencies, devDependencies untouched.

  - tests/i18n/manifest-i18n.test.ts: header comment block rewritten to
    label the "AI Call Recorder" string as Wave-0 historical state +
    describe the post-D-07 regression-pin role. Test bodies + assertions
    unchanged (already pin the post-D-07 canonical state).

Preservation rationale: .planning/intel/* (brand-decisions-v1.md D-07,
design-system.md, brand-identity.md, classifications/README-*.json,
design-incoming/system/bundle/mokosh-handoff/handoff.html) is audit
trail documenting the "why" of D-07 — kept verbatim. _locales/{en,ru}/
messages.json and manifest.json already post-D-07 canonical — untouched.

Acceptance gates (all PASS 2026-05-20):
  - Empirical grep src/ tests/ README.md package.json: ZERO non-historical
    "AI Call Recorder" matches (only the labeled audit anchor in
    tests/i18n/manifest-i18n.test.ts:8).
  - npx tsc --noEmit: clean.
  - npm run build: ✓ built in 5.29s.
  - npx vitest run tests/i18n/manifest-i18n.test.ts: 10/10 GREEN.
  - npx vitest run tests/background/no-test-hooks-in-prod-bundle.test.ts
    (Tier-1 hook-string grep gate): 13/13 GREEN; FORBIDDEN_HOOK_STRINGS
    list intact.
  - npm test: 151/153 (2 pre-existing ffprobe/ffmpeg timeout flakes in
    webm-remux + webm-playback — verified identical to pristine HEAD
    a2dfc8c via git stash baseline; unrelated to rename).
  - npm run test:uat: 24/24 GREEN.
  - Production bundle grep dist/: ZERO "AI Call Recorder" + ZERO
    "ai-call-extension" matches.

Unblocks Plan 01-10 closure + Phase 1 final closure (REQUIREMENTS /
ROADMAP / STATE marker flip).

Debug record: .planning/debug/resolved/01-12-stale-ai-call-recorder-references.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 11:49:46 +02:00

162 lines
6.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Mokosh — Session Capture
Chrome MV3 extension that records operator sessions for bug reports.
Фаза 1 — Локальная запись + экспорт архива
## Установка и запуск
### Разработка
```bash
# Установка зависимостей
npm install
# Сборка для разработки с HMR
npm run dev
# Сборка для продакшена
npm run build
```
### Установка расширения в Chrome
1. Соберите проект:
```bash
npm run build
```
2. Откройте Chrome и перейдите по адресу: `chrome://extensions/`
3. Включите "Режим разработчика" (Developer mode) в правом верхнем углу
4. Нажмите кнопку "Загрузить распакованное расширение" (Load unpacked)
5. Выберите папку `dist` в корне проекта
6. Расширение установлено!
## Использование
1. При первом открытии popup расширение запросит разрешение на запись экрана
2. Разрешение обязательно для работы расширения
3. Расширение автоматически начнет запись:
- Видео: последние 30 секунд (кольцевой буфер)
- DOM-события через rrweb: последние 10 минут
- Лог действий пользователя: последние 10 минут
4. Для сохранения отчета об ошибке:
- Нажмите на иконку расширения
- Нажмите кнопку "Сохранить отчёт об ошибке"
- Архив автоматически загрузится в папку "Загрузки"
## Структура архива
Архив `session_report_YYYY-MM-DD_HH-MM-SS.zip` содержит:
```
session_report_2025-05-15_14-32-10.zip
├── video/
│ └── last_30sec.webm # склеенные чанки видеобуфера
├── rrweb/
│ └── session.json # массив DOM-событий rrweb
├── logs/
│ └── events.json # лог действий пользователя
├── screenshot.png # скриншот в момент сохранения
└── meta.json # метаданные сессии
```
## Технический стек
- **Тип расширения**: Chrome Extension, Manifest V3
- **Service Worker**: Background script (Manifest V3)
- **Захват экрана**: `chrome.tabCapture` API
- **Захват DOM**: `rrweb` (npm: rrweb)
- **Лог событий**: Content Script
- **Упаковка архива**: `JSZip` (npm: jszip)
- **Сохранение файла**: `chrome.downloads` API
- **Хранение буфера**: In-memory (Service Worker + Content Script)
- **Build**: Vite + crxjs + TypeScript
## Особенности
### Маскирование чувствительных данных
- Пароли (`input[type=password]`) маскируются автоматически в rrweb и логах
- Поля с атрибутом `data-sensitive="true"` также маскируются в rrweb
### Записываемые события
#### Пользовательские события
- **click** — клик по любому элементу
- **input** — изменение значения поля (без паролей)
- **navigation** — переходы по страницам (popstate, hashchange, History API)
- **js_error** — JavaScript ошибки (window.onerror, unhandledrejection)
- **network_error** — сетевые ошибки (fetch/XHR с кодом ответа >= 400)
### Кольцевой буфер
- **Видео**: 30 секунд, первый чанк (WebM заголовок) хранится всегда
- **rrweb события**: 10 минут, максимум 5000 событий
- **Пользовательские события**: 10 минут
### Память
- Ожидаемое потребление: ~5-10 МБ в фоновом режиме
## Критерии приёмки Фазы 1
- ✅ Расширение устанавливается в Chrome без ошибок
- ✅ Видеобуфер непрерывно работает на любой вкладке
- ✅ В буфере всегда есть не более 30 секунд видео
- ✅ rrweb пишет DOM-события без ошибок на типовых страницах
- ✅ Лог событий фиксирует клики, навигацию и сетевые ошибки
- ✅ При нажатии кнопки архив скачивается в "Загрузки" за < 5 секунд
- ✅ Архив открывается, `last_30sec.webm` воспроизводится в браузере
- ✅ Пароли не попадают в лог и rrweb-снимки
- ✅ RAM-потребление расширения не превышает 50 МБ в фоне
## Отладка
### Console Logs
Расширение пишет подробные логи в консоль:
- **Service Worker**: Chrome DevTools → Extensions → Service Worker → Console
- **Content Script**: Chrome DevTools на любой странице → Console
- **Popup**: Правый клик по popup → Проверить
### Структура проекта
```
ai-call-extension/
├── src/
│ ├── background/ # Service Worker
│ │ └── index.ts
│ ├── content/ # Content Script
│ │ └── index.ts
│ ├── popup/ # Popup UI
│ │ ├── index.html
│ │ ├── index.ts
│ │ └── style.css
│ └── shared/ # Общие типы и утилиты
│ ├── types.ts
│ └── logger.ts
├── icons/ # Иконки расширения
├── dist/ # Собранные файлы
├── manifest.json # Manifest расширения
├── vite.config.ts # Конфигурация Vite
├── tsconfig.json # Конфигурация TypeScript
└── package.json
```
## Лицензия
MIT
## Контакты
Для вопросов и предложений обращайтесь в support.