Commit Graph

8 Commits

Author SHA1 Message Date
Бородин Роман fff0213666 fix: keep lock file after cleanup so client always skips
Server holds the lock even after cleanup. Client always sees the lock
and skips bot startup. On crash, stale PID is detected and lock is
cleaned up automatically.
2026-09-26 00:20:51 +03:00
Бородин Роман bf61b1ef1f feat: use storagePath config for plugin data directory
All plugin files (lock, logs) now live under the configured storage
path (default ~/.local/share/opencode-matrix-bot/plugin-data),
matching matrix-client.ts behavior. No extra directories created.
2026-09-26 00:17:33 +03:00
Бородин Роман a5dda163ea fix: use fixed plugin data dir so mutex lock is shared across instances
mkdtemp creates unique dirs per process, breaking the mutex.
Use a fixed path ~/.opencode-matrix-plugin/ instead.
2026-09-26 00:13:56 +03:00
Бородин Роман e4ae5ff997 chore: move plugin files from /tmp to home directory
Replace /tmp/opencode-matrix-plugin/* with ~/.opencode-matrix-plugin-*
to support systems without /tmp (e.g. Termux on Android).
2026-09-26 00:12:27 +03:00
Бородин Роман f981998ab8 fix: prevent double Matrix bot startup (server + client)
OpenCode V2 loads plugins in both the background server and the client.
Add a file-based mutex (/tmp/opencode-matrix-plugin.lock) so only the
first instance (server) starts the Matrix bot. The second instance
(client) detects the lock and returns a no-op cleanup.
2026-09-26 00:09:28 +03:00
Бородин Роман 51b98e02a5 refactor: remove V1 code, plugin is V2-only now
- Remove isV2Context() detection and all V1 branches
- Remove sdkClient parameter and V1 SDK polling logic
- Remove extractContent/formatMessage helpers (V1-only)
- Remove sentMessageIds dedup map (V1-only)
- Remove v1Server() entry point and server() export
- Remove encodeSessionId() from session-manager
- Remove crypto dependency
- Simplify help text (no mode info)
- Session ID now uses roomId:threadRootId directly
2026-09-25 23:24:12 +03:00
Бородин Роман 6199f75c4e fix: restore plugins/matrix-plugin/ path structure for OpenCode V2 plugin loading
- Add plugins/matrix-plugin/ directory with symlinks to root files
  (OpenCode V2 resolver appends path suffix after symlink resolution)
- Rename plugin id from 'opencode-matrix' to 'matrix-plugin'
2026-09-25 23:15:29 +03:00
Бородин Роман 5fdb2510b4 правильная организация директории плагина 2026-09-25 22:16:45 +03:00