Skip to content

Releases: ryopc/Koshi

v4.0.0: Platform Extensions for Pito

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 19 Oct 03:17
7030b5b

🎯 Overview

koshi v4.0.0 extends the platform as a backend for Pito (React Native/Expo messenger) with group chat, E2E key management, read receipts, and typing indicators.

✨ New Features

👥 E2EE Group Chats (Sender Keys)

  • Create groups with up to 100 members
  • All groups are always end-to-end encrypted
  • Server only verifies signatures, never decrypts
  • Sender Keys for group E2E (MLS migration path exists)

📱 X3DH Key Management

  • Device registration with identityKey, signedPreKey, preKeySignature
  • One-time prekey consumption per session
  • Key bundle fetching for X3DH handshake

✅ Read Receipts

  • Unified table for DMs and group messages
  • WebSocket broadcast for instant cross-device sync

⌨️ Typing Indicators

  • Real-time typing start/stop for DMs and groups
  • Broadcast to conversation participants only

🔧 TypeScript SDK

npm install @ryopc/koshi
import { Group, GroupMessage, Device, KeyBundle, WSEventMap } from '@ryopc/koshi/types'

📡 New API Endpoints

Category Endpoints
Groups GET/POST /api/groups, GET/PATCH/DELETE /api/groups/:id, POST/DELETE /api/groups/:id/members, GET/POST /api/groups/:id/messages, PUT /api/groups/:id/messages/:msgId/read
Devices GET/POST /api/devices, DELETE /api/devices/:deviceId, GET /api/devices/user/:userId
Keys GET /api/keys/bundle/:userId

🔌 New WebSocket Events

Client → Server Server → Client
group:create group_created
group:update group_updated
group:delete group_deleted
group:invite group_member_added
group:leave group_member_removed
group:message group_message
group:read group_message_read
typing:start typing_start
typing:stop typing_stop
key_bundle:request key_bundle_response

🗄️ New Database Tables

  • groups - E2EE group chats
  • group_members - Membership with roles (admin/member)
  • group_messages - Encrypted group messages
  • message_read_receipts - Unified read receipts
  • user_devices - X3DH device keys
  • group_session_keys - Sender Keys

🛠️ New CLI Commands

kb groups [list|create|delete|info]
kb group <name> members [add|remove|list]
kb devices [list|remove]
kb keys [rotate|bundle]
kb admin promote <username>
kb config set <key> <value>

⚠️ Important Notes

  • PostgreSQL required for new features (not available in P2P/SQLite mode)
  • Existing APIs (DMs, posts, follows, P2P) remain unchanged
  • All groups are E2EE (isE2EE: true always)
  • E2E is client responsibility — server only relays, verifies signatures

📦 Installation

npm install -g @ryopc/koshi@4.0.0

v3.1.5

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 18 Oct 00:28
f3420a8

Release v3.1.5 - Docker multi-arch build optimization (native ARM runner + GHA layer cache)

koshi v3.0.0 — Serverless P2P Mesh

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 14 Oct 20:52
8b59fdd

koshi v3.0.0 — Serverless P2P Mesh 🎉

Zero-setup decentralized SNS. Koshi v3.0 makes it effortless to run a full P2P social node — just pull a Docker image, no database or server configuration required.

🚀 Highlights

  • Serverless P2P Mesh (Default): SQLite + hypercore/hyperswarm for peer-to-peer sync — no PostgreSQL needed
  • kb serve: Start a local serverless node (REST API + WebSocket + Web UI + P2P mesh)
  • kb connect <url>: Connect CLI to a remote server; --reset returns to serverless mode
  • Docker Multi-Arch: Pre-built images for linux/amd64 and linux/arm64 (Docker Hub / GHCR)
  • CLI Bilingual: English/Japanese support via KOSHI_LANG=ja|en env var
  • Quiet Logs: LOG_LEVEL=warn by default in serverless mode — only warnings/errors shown

🐳 Quick Start (Docker)

docker run -d -p 3000:3000 \
  -v $HOME/.config/koshi:/home/koshi/.config/koshi \
  ghcr.io/ryopc/koshi:standalone-v3.0.0

# Then open http://localhost:3000

📚 Documentation

  • Full English documentation at docs/docs/index.html
  • Updated CLI reference with kb serve, kb connect, kb p2p, kb nostr commands
  • Project structure updated to reflect serverless architecture (src/local/, src/p2p/, src/nostr/)

🔧 Docker Images

Image Architecture Use Case External DB
ghcr.io/ryopc/koshi:standalone-v3.0.0 amd64, arm64 Personal / Serverless (Recommended) No (SQLite)
ghcr.io/ryopc/koshi:runner-v3.0.0 amd64, arm64 Production Server Yes (PostgreSQL)

📦 CLI

npm install -g @ryopc/koshi

# Default language is auto-detected (English / Japanese)
KOSHI_LANG=en kb serve          # Start local serverless node (English)
KOSHI_LANG=ja kb serve          # Start local serverless node (Japanese)
kb connect https://example.com  # Connect to remote server

🌍 CLI Language

# Set language globally
export KOSHI_LANG=en  # English
export KOSHI_LANG=ja  # Japanese

# Or use system locale (auto-detected from $LANG)

🐛 Bug Fixes & Improvements

  • Fixed version display in bin/server.js (was v1.1.1, now v3.0.0)
  • Web UI api.js now dynamically reads config.serverUrl via /api/config
  • Suppressed verbose pino debug logs in serverless mode (LOG_LEVEL=warn)
  • .dockerignore corrected to include web/ build output
  • Dockerfile sets LOG_LEVEL=warn for clean container logs

📊 Stats

  • CLI Commands: 24
  • API Endpoints: 32
  • Protocols: REST, WebSocket, P2P (hypercore/hyperswarm), Nostr

Full Changelog: https://github.com/ryopc/koshi/releases/tag/v3.0.0

v2.0.1 — Nostr + P2P 統合リリース 🎉

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 17 Jul 04:11
07f38e6

🎉 v2.0.1 — Nostr/P2P Integration Release

🔑 New Features

  • Nostr Protocol Integration — Generate/manage Nostr keys (nsec/npub), push koshi posts to Nostr relays, pull events from the Nostr network
  • 🖧 P2P Sync — Hypercore-powered peer-to-peer data synchronization using hyperswarm DHT
  • 👥 Multi-Account Support — Manage multiple koshi identities from a single CLI with interactive switching

📝 Documentation

  • Homepage completely revamped with v2 features
  • Full Nostr integration guide added to docs
  • P2P sync documentation added
  • Multi-account management guide added

🐛 Bug Fixes

  • Fixed Cannot read properties of undefined (reading activeUsername) error in config loading

v1.4.0 — 複数アカウント対応・吹き出しチャットUI

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 16 Jul 06:37
07f38e6

🎉 v1.4.0 — 複数アカウント対応&吹き出しチャットTUI

🔑 複数アカウント管理

  • 複数アカウントを保存・切り替え可能に
  • 新しいコマンド: kb accounts, kb switch, kb account remove
  • 既存の設定ファイルは自動的に新しい形式にマイグレーション
  • kb login を対話式に改善(引数なしでアカウント一覧から選択)

💬 LINE風吹き出しチャット (kb chat)

  • 自分のメッセージ: 右寄せ・水色バブル
  • 相手のメッセージ: 左寄せ・緑色バブル
  • 各メッセージにタイムスタンプ表示
  • メッセージ履歴の自動再描画
  • 楽観的UI更新(送信即表示、重複除去)

📨 受信箱の会話グループ表示 (kb dms)

  • DM一覧を会話相手ごとにグループ化
  • 最新メッセージのプレビュー表示
  • 未読バッジ・メッセージ件数表示
  • 番号選択でチャットにジャンプ

🎯 各コマンドを対話式に改善

  • kb dm: 引数なしでユーザー検索→選択→メッセージ入力
  • kb follow / kb unfollow: 引数なしで検索→選択
  • kb profile: 引数なしで検索→選択
  • kb search: 引数なしで検索クエリ入力
  • kb post: 引数なしで本文を対話式入力
  • kb edit-profile: 引数なしで各フィールドを対話式編集
  • kb register: 引数なしでユーザー名入力

⚙️ 内部改善

  • 設定ファイルを複数アカウント対応に変更
  • レガシー .snsrc 形式からの自動マイグレーション
  • ヘルプ画面をカテゴリ別に改善
  • 削除された web/ ディレクトリをクリーンアップ

v1.3.1

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 15 Jul 07:30
dc0142a

What's Changed\n\n- ユーザー名にハイフン(-)を許可するようサーバー側のバリデーションを修正\n- Server-side username validation now allows hyphens (-) in addition to alphanumeric and underscores

v1.3.0

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 15 Jul 06:27

Fix: add missing Vite entry files (index.html, main.tsx) for frontend build

v1.2.0

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 14 Jul 21:27
b5fdc16

What's Changed

Features

  • Admin API now accepts both UUID and username in :id parameters
  • Added resolveUserClause helper to auto-detect UUID vs username
  • GET/DELETE /api/admin/users/:id now supports both formats
  • PUT /api/admin/users/:id/admin now supports both formats

Documentation

  • Updated docs to reflect UUID/username dual support
  • Improved curl examples with both UUID and username usage

Maintenance

  • Bumped version to 1.2.0

v1.1.1

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 14 Jul 08:24
9adb3bd

v1.1.1\n\n### 修正\n- 管理者権限付与ルートの解析と確認\n- バージョン 1.1.1 へ更新\n\n### 詳細\nサーバールート PUT /api/admin/users/:id/admin と CLI のリクエスト形式 (UUID) に不一致がないことを確認しました。パッチバージョンを 1.1.0 から 1.1.1 に繰り上げました。

v1.1.0 - Real-time Chat, Admin Controls & Profile Editing

Choose a tag to compare

@ryotagtagtag-wq ryotagtagtag-wq released this 14 Jul 07:29
4bc3664

🚀 What's New

💬 Real-Time DM Chat

  • New interactive chat mode: kb chat <username>
  • Real-time message delivery via WebSocket with ed25519 signatures
  • See online/offline status of the other user
  • Type /exit or Ctrl+C to quit

🛠️ Admin Controls

  • kb admin users — List all users with stats
  • kb admin user <id> — View detailed user info
  • kb admin delete-user <username> — Permanently delete a user account
  • kb admin grant <username> — Grant admin privileges
  • kb admin revoke <username> — Revoke admin privileges

🛡️ Admin API

  • GET /api/admin/users — List all users
  • GET /api/admin/users/:id — Get user details (with keys, DMs)
  • DELETE /api/admin/users/:id — Delete a user (cascade)
  • PUT /api/admin/users/:id/admin — Toggle admin status

✏️ Profile Editing

  • kb edit-profile --display-name="..." --bio="..." --avatar-url="..."

🔒 Security

  • New requireAdmin middleware
  • ADMIN_USERNAME env var for bootstrapping the first admin
  • Admin self-deletion and self-revocation protection

📖 Documentation

  • README, docs landing page, and full docs updated with all new features
  • API reference includes admin endpoints