Bilingual command descriptions (EN/RU)#64
Conversation
- Add notify() helper: emoji + toast + log in one call - startupSync: 🔄 Syncing..., ✅ ready, ❌ error - pull: 📥 Pulling..., 📥 result - push: 📤 Pushing..., 📤 result - link: 🔗 Linking..., 🔗 result - init: 🚀 Sync configured
- session-db.ts: read/write sessions from SQLite and JSON dir - session-merge.ts: syncSessions() — union-merge per record (messages, parts, todos, session_messages, shares by id+time_updated) - service.ts: integrate syncSessions in pull, push, runStartup - @types/node: ^22.15.0 for node:sqlite types
- Config field includeProjects (bool, default false) - resolveProjectsFilePath(): Windows → %APPDATA%\ai.opencode.desktop\, Linux/macOS → /opencode - SyncItem with preserveWhenMissing: true for graceful handling
- shell.ts: createNodeShell() wraps child_process.execSync with Bun-compatible tagged-template API - service.ts: detect ctx.$ === undefined at createSyncService entry, replace with createNodeShell() - Enables gh/git commands in OpenCode Desktop (Electron/Node.js)
…ned/objects - All insert* functions now pass values through v() = asSQLValue() - asSQLValue() now also serializes objects/arrays via JSON.stringify - Fixes 'Provided value cannot be bound to SQLite parameter' on startup
projects-merge.ts: syncGlobalData() — union-merge проектов * server.projects.local — объединение по worktree * layout.page.lastProjectSession — объединение по директории, новее at * остальные ключи — если нет в локальном, берётся с удалённого service.ts: вызов syncGlobalData в pull/push/startup paths.ts: удалён старый SyncItem для простого копирования
При пустой директории remoteSessions (первый запуск, нет удалённых сессий) syncSessions пишет только JSON-файлы, не перезаписывая локальную БД. Это избегает ошибки 'Provided value cannot be bound to SQLite parameter 1', которая возникала из-за NOT NULL constraint в таблицах session/message/part при DELETE+INSERT
- Убирает deleteSession + каскадное удаление - Все insert* функции заменены на upsert* (INSERT OR REPLACE) - Избегает NOT NULL constraint violations при перезаписи сессий - Предотвращает ошибку 'Provided value cannot be bound to SQLite parameter 1'
- Убрано копирование opencode.db и storage/* (SESSION_DIRS) - Сессии синхронизируются только через per-session JSON merge (syncSessions) - Предотвращает затирание локальных сессий при pull
Add bilingual descriptions to all 14 sync-* commands. All code unchanged — only markdown frontmatter.
There was a problem hiding this comment.
Code Review
This pull request updates the project configuration by adding package-lock.json to .gitignore and removing several Mise task scripts. The core changes involve significant updates to the command documentation in src/command/, introducing bilingual descriptions (English and Russian), standardized tool-calling instructions, and more detailed behavioral guidelines for the AI. Review feedback highlights a critical issue with a Byte Order Mark (BOM) in sync-push.md that would break the frontmatter parser and recommends using a consistent "|" separator for translations to avoid ambiguity in commands that already contain slashes.
| @@ -1,5 +1,10 @@ | |||
| --- | |||
There was a problem hiding this comment.
This file starts with a Byte Order Mark (BOM) (\ufeff). This will cause the frontmatter parser in src/index.ts to fail because the regex ^--- (line 26) expects the dashes to be at the absolute start of the string. Please remove the BOM to ensure the command description is parsed correctly.
| --- | |
| --- |
| @@ -1,8 +1,9 @@ | |||
| --- | |||
| description: Switch session sync backend between git and turso | |||
| description: Switch session sync backend (git/turso) / Переключить бэкенд синхронизации сессий | |||
There was a problem hiding this comment.
There is a discrepancy between the PR description (which specifies a | separator) and the implementation (which uses /). In this specific command, the English description already contains a slash (git/turso), which makes the / separator ambiguous for any potential parsing logic. It is recommended to use the | separator as mentioned in the PR summary across all command files to ensure robustness and consistency.
| description: Switch session sync backend (git/turso) / Переключить бэкенд синхронизации сессий | |
| description: Switch session sync backend (git/turso) | Переключить бэкенд синхронизации сессий |
Summary
Adds Russian translations alongside English descriptions for all 14 sync commands, using the existing YAML frontmatter \description:\ field (format: \EN description | RU описание).
Commands affected
All .md\ files in \src/command/:
Design decisions