Skip to content

Bilingual command descriptions (EN/RU)#64

Closed
Day-Anger wants to merge 19 commits into
iHildy:mainfrom
Day-Anger:pr/bilingual
Closed

Bilingual command descriptions (EN/RU)#64
Day-Anger wants to merge 19 commits into
iHildy:mainfrom
Day-Anger:pr/bilingual

Conversation

@Day-Anger
Copy link
Copy Markdown

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/:

  • \config-open.md, \config-close.md, \config-status.md, \config-sync.md\
  • \git-push.md, \git-pull.md\
  • \secret-open.md, \secret-close.md\
  • \session-status.md, \session-merge.md\
  • \setup.md\
  • \�dvanced.md, \ roubleshooting.md\

Design decisions

  • Single \description\ field with \EN | RU\ format (no separate \description_ru)
  • OpenCode reads only \description\ from frontmatter
  • Backward compatible: English-only clients see the EN part

Day-Anger added 19 commits May 22, 2026 15:39
- 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.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/command/sync-push.md
@@ -1,5 +1,10 @@
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
---
---

@@ -1,8 +1,9 @@
---
description: Switch session sync backend between git and turso
description: Switch session sync backend (git/turso) / Переключить бэкенд синхронизации сессий
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
description: Switch session sync backend (git/turso) / Переключить бэкенд синхронизации сессий
description: Switch session sync backend (git/turso) | Переключить бэкенд синхронизации сессий

@Day-Anger Day-Anger closed this May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant