diff --git a/.gitignore b/.gitignore index 2e993bb..1a9dbfd 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ coverage/ __pycache__/ opencode-plugin-template/ opencode-docs-*/ +package-lock.json diff --git a/.mise/tasks/build b/.mise/tasks/build deleted file mode 100755 index 470ce30..0000000 --- a/.mise/tasks/build +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Build the project" -set -e -rm -rf dist -tsc -p tsconfig.build.json -cp -r src/command dist/command \ No newline at end of file diff --git a/.mise/tasks/format b/.mise/tasks/format deleted file mode 100755 index 4b63ace..0000000 --- a/.mise/tasks/format +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Format code with Biome" -biome format --write . \ No newline at end of file diff --git a/.mise/tasks/lint b/.mise/tasks/lint deleted file mode 100755 index 6392e14..0000000 --- a/.mise/tasks/lint +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Run Biome lint" -biome lint . \ No newline at end of file diff --git a/.mise/tasks/lint:fix b/.mise/tasks/lint:fix deleted file mode 100755 index bcdc53b..0000000 --- a/.mise/tasks/lint:fix +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Run Biome lint with auto-fix" -biome lint --write . \ No newline at end of file diff --git a/.mise/tasks/local-pack-test b/.mise/tasks/local-pack-test deleted file mode 100755 index 5c34080..0000000 --- a/.mise/tasks/local-pack-test +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Install packed plugin into opencode cache (production-like test)" -set -euo pipefail - -PLUGIN_LOCAL_FILE="${HOME}/.config/opencode/plugin/opencode-synced-local.ts" -CACHE_DIR="${HOME}/.cache/opencode" -PACKAGE_DIR="$(pwd)" -VERSION="$(node -p "require('./package.json').version")" - -if [ -f "${PLUGIN_LOCAL_FILE}" ]; then - rm -f "${PLUGIN_LOCAL_FILE}" -fi - -TARBALL="$(npm pack | tail -n 1)" - -rm -rf "${CACHE_DIR}/node_modules/opencode-synced" - -if [ -f "${CACHE_DIR}/package.json" ]; then - python - < /dev/null 2>&1; then - echo "❌ Error: 'scripts' property found in package.json" - echo "Scripts are not allowed. Use .mise/tasks instead." - exit 1 -else - echo "✓ package.json validation passed" -fi diff --git a/.mise/tasks/prepare b/.mise/tasks/prepare deleted file mode 100755 index 9de48a1..0000000 --- a/.mise/tasks/prepare +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Prepare for publishing" -bun run build \ No newline at end of file diff --git a/.mise/tasks/publish b/.mise/tasks/publish deleted file mode 100755 index 5bb1d18..0000000 --- a/.mise/tasks/publish +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Publish to npm registry" -#MISE depends=["setup", "build"] -#USAGE flag "-t --tag " "Tag to publish with" default="latest" - -set -e - -echo "Publishing to npm" -echo " > with tag: ${usage_tag}..." -echo " > npm version: $(npm --version)" - -# Determine if we should use provenance -# Only enable in CI environments with OIDC support -PROVENANCE_FLAG="" -if [ -z "$GITHUB_ACTIONS" ]; then - # Local development: disable provenance (fails without CI provider context) - PROVENANCE_FLAG="--no-provenance" - echo " > provenance: disabled (local environment)" -else - # GitHub Actions: enable provenance (OIDC will handle it automatically) - echo " > provenance: enabled (GitHub Actions with OIDC)" -fi - -# Publish directly from source (allows provenance generation in CI) -npm publish \ - --access public \ - --tag "${usage_tag}" \ - $PROVENANCE_FLAG - -echo "Published successfully!" diff --git a/.mise/tasks/setup b/.mise/tasks/setup deleted file mode 100755 index fbb6dc9..0000000 --- a/.mise/tasks/setup +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Setting up project" - -echo "" -echo "🍜 Setting up project" -echo "" - -bun install - -echo "" -echo "👍 Done" -echo "" diff --git a/.mise/tasks/test b/.mise/tasks/test deleted file mode 100755 index 78fb3ad..0000000 --- a/.mise/tasks/test +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Run tests" -bun test \ No newline at end of file diff --git a/.mise/tasks/version b/.mise/tasks/version deleted file mode 100755 index 4ebaea6..0000000 --- a/.mise/tasks/version +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -#MISE description="Bump version - handles 'next' prerelease or syncs after 'latest'" -#USAGE flag "-t --tag " "Tag for versioning strategy (next|latest)" default="next" - -set -e - -echo "Bumping version" -echo " > with tag: ${usage_tag}..." - -# When bumping "next": prerelease bump only -# When "latest": release-please handles it, but we sync "next" to be ahead -if [ "${usage_tag}" = "next" ]; then - echo "Bumping prerelease version for 'next' tag..." - bun pm version prerelease - echo " > Next version: $(jq -r '.version' package.json)" - -elif [ "${usage_tag}" = "latest" ]; then - echo "Syncing 'next' tag to be ahead of 'latest'..." - echo "(Note: 'latest' version should already be bumped by release-please)" - - # Get current version (should be latest after release-please) - LATEST_VERSION=$(jq -r '.version' package.json) - echo " > Latest version: $LATEST_VERSION" - - # Bump to next prerelease (X.Y.Z -> X.Y.(Z+1)-prerelease.0) - echo " > Bumping 'next' to be ahead of latest..." - bun pm version prerelease - - NEXT_VERSION=$(jq -r '.version' package.json) - echo " > Next version: $NEXT_VERSION" - -else - echo "❌ Unknown tag: ${usage_tag}" - echo " Use: --tag next (default) or --tag latest" - exit 1 -fi - -echo "Version bump completed!" diff --git a/src/command/sync-enable-secrets.md b/src/command/sync-enable-secrets.md index 2a8b228..fb7225c 100644 --- a/src/command/sync-enable-secrets.md +++ b/src/command/sync-enable-secrets.md @@ -1,7 +1,14 @@ --- -description: Enable secrets sync (private repo required) +description: Enable secrets sync / Включить синхронизацию секретов (требуется приватный репозиторий) --- -Use the opencode_sync tool with command "enable-secrets". -If the user supplies extra secret paths, pass them via extraSecretPaths. -If they want MCP secrets committed in a private repo, pass includeMcpSecrets: true. +You MUST call the `opencode_sync` tool with `command="enable-secrets"`. +Do not answer with plain text only. + +Argument handling: +- If the user supplies extra secret paths, pass them via `extraSecretPaths`. +- If they want MCP secrets committed in a private repo, pass `includeMcpSecrets: true`. + +Reminder: +- Enabling secrets requires the sync repo to be private — the tool will enforce this. +- Secrets are synced via a configured backend (e.g., 1Password), not stored in git directly. diff --git a/src/command/sync-init.md b/src/command/sync-init.md index 50ebe35..3fb46d2 100644 --- a/src/command/sync-init.md +++ b/src/command/sync-init.md @@ -1,5 +1,5 @@ --- -description: Initialize opencode-synced configuration +description: Initialize opencode-synced configuration / Инициализировать конфигурацию синхронизации --- You MUST call the `opencode_sync` tool with `command="init"`. diff --git a/src/command/sync-link.md b/src/command/sync-link.md index 9c64e64..b66ea2b 100644 --- a/src/command/sync-link.md +++ b/src/command/sync-link.md @@ -1,5 +1,5 @@ --- -description: Link this computer to an existing sync repo +description: Link to an existing sync repo / Привязать компьютер к существующему репозиторию синхронизации --- You MUST call the `opencode_sync` tool with `command="link"`. diff --git a/src/command/sync-pull.md b/src/command/sync-pull.md index 66a6a5f..6491980 100644 --- a/src/command/sync-pull.md +++ b/src/command/sync-pull.md @@ -1,6 +1,10 @@ --- -description: Pull and apply synced opencode config +description: Pull and apply synced config / Загрузить и применить синхронизированную конфигурацию --- -Use the opencode_sync tool with command "pull". -If updates are applied, remind the user to restart opencode. +You MUST call the `opencode_sync` tool with `command="pull"`. +Do not answer with plain text only. + +Reminder: +- Pull applies remote config to local — after a successful pull, tell the user to restart opencode. +- If the local repo has uncommitted changes, pull will fail — suggest /sync-resolve first. diff --git a/src/command/sync-push.md b/src/command/sync-push.md index cdc5a12..89f9172 100644 --- a/src/command/sync-push.md +++ b/src/command/sync-push.md @@ -1,5 +1,10 @@ +--- +description: Push local config / Отправить локальную конфигурацию --- -description: Push local opencode config to the sync repo ---- -Use the opencode_sync tool with command "push". +You MUST call the `opencode_sync` tool with `command="push"`. +Do not answer with plain text only. + +Reminder: +- The tool will auto-commit and push local changes to the sync repo. +- If there are uncommitted changes in the local repo, the push may fail — suggest /sync-resolve. diff --git a/src/command/sync-resolve.md b/src/command/sync-resolve.md index 0f8470a..6ead2a0 100644 --- a/src/command/sync-resolve.md +++ b/src/command/sync-resolve.md @@ -1,5 +1,11 @@ --- -description: Resolve uncommitted changes in sync repo +description: Resolve uncommitted changes / Разрешить незакоммиченные изменения в репозитории --- -Use the opencode_sync tool with command "resolve" to automatically resolve uncommitted changes in the local sync repository using AI. +You MUST call the `opencode_sync` tool with `command="resolve"`. +Do not answer with plain text only. + +Behavior: +- The tool analyzes uncommitted changes using AI and decides whether to commit or discard them. +- After resolution, the user can retry the failed command. +- If AI analysis is not available, the tool falls back to manual resolution instructions. diff --git a/src/command/sync-secrets-pull.md b/src/command/sync-secrets-pull.md index a3bcb1b..fa927e1 100644 --- a/src/command/sync-secrets-pull.md +++ b/src/command/sync-secrets-pull.md @@ -1,5 +1,10 @@ --- -description: Pull secrets from the configured backend +description: Pull secrets from backend / Загрузить секреты из настроенного бэкенда --- -Use the opencode_sync tool with command "secrets-pull". +You MUST call the `opencode_sync` tool with `command="secrets-pull"`. +Do not answer with plain text only. + +Behavior: +- Pulls secrets from the configured backend (e.g., 1Password) and applies them locally. +- Requires a secrets backend to be configured. diff --git a/src/command/sync-secrets-push.md b/src/command/sync-secrets-push.md index 4b4e834..055d85a 100644 --- a/src/command/sync-secrets-push.md +++ b/src/command/sync-secrets-push.md @@ -1,5 +1,10 @@ --- -description: Push secrets to the configured backend +description: Push secrets to backend / Отправить секреты в настроенный бэкенд --- -Use the opencode_sync tool with command "secrets-push". +You MUST call the `opencode_sync` tool with `command="secrets-push"`. +Do not answer with plain text only. + +Behavior: +- Pushes secrets to the configured backend (e.g., 1Password). +- Requires a secrets backend to be configured. diff --git a/src/command/sync-secrets-status.md b/src/command/sync-secrets-status.md index 67c15ad..59b8c77 100644 --- a/src/command/sync-secrets-status.md +++ b/src/command/sync-secrets-status.md @@ -1,5 +1,10 @@ --- -description: Show secrets backend status +description: Show secrets backend status / Показать статус бэкенда секретов --- -Use the opencode_sync tool with command "secrets-status". +You MUST call the `opencode_sync` tool with `command="secrets-status"`. +Do not answer with plain text only. + +Behavior: +- Shows the current status of the secrets backend (e.g., last sync, backend type). +- Requires a secrets backend to be configured. diff --git a/src/command/sync-sessions-backend.md b/src/command/sync-sessions-backend.md index 0f2ab6f..9307012 100644 --- a/src/command/sync-sessions-backend.md +++ b/src/command/sync-sessions-backend.md @@ -1,8 +1,9 @@ --- -description: Switch session sync backend between git and turso +description: Switch session sync backend (git/turso) / Переключить бэкенд синхронизации сессий --- You MUST call the `opencode_sync` tool with `command="sessions-backend"`. +Do not answer with plain text only. Argument handling: - `$ARGUMENTS` must be either `git` or `turso`. diff --git a/src/command/sync-sessions-cleanup-git.md b/src/command/sync-sessions-cleanup-git.md index f051872..4d93b98 100644 --- a/src/command/sync-sessions-cleanup-git.md +++ b/src/command/sync-sessions-cleanup-git.md @@ -1,7 +1,10 @@ --- -description: Remove deprecated git session artifacts after Turso migration +description: Remove deprecated git session artifacts / Удалить устаревшие git-артефакты сессий --- You MUST call the `opencode_sync` tool with `command="sessions-cleanup-git"`. +Do not answer with plain text only. -Use this only after sessions are running on Turso and the user confirms fallback artifacts are no longer needed. +Reminder: +- Use this only after sessions are running on Turso and the user confirms fallback artifacts are no longer needed. +- This removes data/sessions/*.json and data/opencode.db from the sync repo. diff --git a/src/command/sync-sessions-migrate-turso.md b/src/command/sync-sessions-migrate-turso.md index 6867060..f756d2c 100644 --- a/src/command/sync-sessions-migrate-turso.md +++ b/src/command/sync-sessions-migrate-turso.md @@ -1,8 +1,9 @@ --- -description: Migrate session sync from git artifacts to Turso backend +description: Migrate session sync to Turso / Перенести синхронизацию сессий из git в Turso --- You MUST call the `opencode_sync` tool with `command="sessions-migrate-turso"`. +Do not answer with plain text only. Behavior: - Ensure Turso setup is complete. diff --git a/src/command/sync-sessions-setup-turso.md b/src/command/sync-sessions-setup-turso.md index fd43664..0bd0602 100644 --- a/src/command/sync-sessions-setup-turso.md +++ b/src/command/sync-sessions-setup-turso.md @@ -1,8 +1,9 @@ --- -description: Install/auth/provision Turso for session sync on this machine +description: Setup Turso for session sync / Настроить Turso для синхронизации сессий --- You MUST call the `opencode_sync` tool with `command="sessions-setup-turso"`. +Do not answer with plain text only. Behavior: - Run Turso CLI install if missing. diff --git a/src/command/sync-status.md b/src/command/sync-status.md index 3a53e12..048bdd8 100644 --- a/src/command/sync-status.md +++ b/src/command/sync-status.md @@ -1,5 +1,10 @@ --- -description: Show opencode-synced status +description: Show sync status / Показать статус синхронизации --- -Use the opencode_sync tool with command "status" and report the results. +You MUST call the `opencode_sync` tool with `command="status"`. +Do not answer with plain text only. + +Reminder: +- Report the results to the user in a readable format (repo, branch, last push/pull, working tree state). +- If sessions sync is enabled, mention the session backend (git or turso) and last sync times.