Create @chatcops/store-sqlite, a store for single-server setups
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- express, node.js, sqlite, typescript
調査の方向性
Read packages/core/src/storage/types.ts and packages/core/src/storage/memory.ts to understand the storage contract and reference behavior, then review packages/core/tests/storage/conformance.test.ts and the store package layout in CONTRIBUTING.md. Implement packages/store-sqlite with all four capabilities and run runStorageConformance on both in-memory and temporary file databases. Done means the listed acceptance checks pass, including persistence after reopening, README, changeset, build, coverage, lint, and publint.
索引モデルが issue の本文から書いたものです。
説明
ChatCops keeps conversations in memory unless you write your own store, so an Express server on a VPS forgets every chat on restart. SQLite is the easiest fix for that setup: one file, no service to run. Node 22 ships node:sqlite, so there's no native build step either.
This is a bigger one, for someone who has had a few PRs merged here. The interfaces and the tests it has to pass already exist: packages/core/src/storage/types.ts and runStorageConformance from @chatcops/core/testing. CONTRIBUTING.md has a "Writing a store package" section with the package layout.
What to do
Create packages/store-sqlite:
import { sqliteStorage } from '@chatcops/store-sqlite';
storage: sqliteStorage({ path: './chatcops.db' }) // or ':memory:'
storage: sqliteStorage({ database: db }) // an open node:sqlite DatabaseSync or a better-sqlite3 Database
- All four capabilities:
conversations(withappend,updateMessage,removeMessage,list,purge),counters,kv(withsetIfAbsent) andevents(withquery). - Tables:
chatcops_conversations(id, metadata JSON, version, created_at, updated_at),chatcops_messages(conversation_id, seq, id, the message as JSON, primary key on conversation_id and seq, unique on conversation_id and id,ON DELETE CASCADE),chatcops_counters,chatcops_kv,chatcops_events. Times are integer milliseconds. Create them on first use (CREATE TABLE IF NOT EXISTS) and record a schema version in a smallchatcops_metatable so later releases can migrate. Turn onPRAGMA foreign_keys = ON. appendruns in one transaction (BEGIN IMMEDIATE) that checksexpectedVersion, inserts the messages with the nextseqvalues and bumps the version. ThrowConflictErrorfrom@chatcops/coreon a mismatch.- Counters: one
INSERT ... ON CONFLICT DO UPDATE ... RETURNINGthat starts over when the stored row has expired. - Expired kv and counter rows count as missing when read.
purgedeletes old conversations, and their messages go with them through the cascade. node:sqliteis the default. Accept a better-sqlite3Databasetoo, through a tiny shim over the few methods you use (prepare,run,get,all,exec). Don't add better-sqlite3 as a dependency; use it only in a test if you want to cover the shim."engines": { "node": ">=22.13" }. That's the first Node 22 withnode:sqliteunflagged."private": trueinpackage.json. A maintainer publishes it for the first time.
Where to look
packages/core/src/storage/types.tsandpackages/core/src/storage/memory.ts(the reference implementation)packages/core/tests/storage/conformance.test.ts(how the suite is called)- node:sqlite docs
Acceptance criteria
-
runStorageConformance('sqlite', ...)passes with nothing skipped, on a:memory:database and on a temp file - Data survives closing and reopening a file database
- A short README with the setup for Express
- Changeset for
@chatcops/store-sqlite(minor) -
pnpm -r build,pnpm test:coverage(90% lines, 80% branches for store packages),pnpm lintandpnpm publintpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 7
- 平均マージ
- 4時間 11分
- マージ済み PR(30日)
- 122
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/chatcops のほかの issue
-
enhancement hacktoberfest help wanted server
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
Document the pre-chat form対応中かも @masyarakatai が 4 日前に担当しました。 オープンdocumentation good first issue hacktoberfest widget
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
codercops/chatcops#70 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement hacktoberfest help wanted server
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
Create @chatcops/store-redis for Upstash and other Redis clients対応中かも @bhushan4work が今日担当しました。 オープンenhancement hacktoberfest help wanted server
codercops/chatcops#248 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
core enhancement hacktoberfest help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
codercops/chatcops の issue をすべて見る
似ている issue
-
area:editor bug issue-form:bug P0 platform:windows review: low
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
1lck/Lithe-IDEA#1388 ·
メンテナーはふだん 1 日以内に返信
-
fix(api): isToolAuditEnabled swallows database read errors on auditToolOperations without loggingオープンarea: backend bug priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
snapotter-hq/SnapOtter#3238 ·
メンテナーはふだん 1 日以内に返信
-
rig up --plan times out after 5 s and reports an UNKNOWN outcome while the daemon completes the planオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
modelcontextprotocol/servers#5216 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信