36b0929fae
* Add server beta runtime foundation * Address server beta review findings * Resolve server beta review comments * Tighten server beta review follow-ups * Harden server beta auth and search * Avoid unnecessary FTS rebuilds * Block scoped keys from creating projects * Release BullMQ claims best effort on close * Address server beta review blockers * Reset BullMQ claims best effort * Add Postgres observation storage foundation * feat(server-beta): add independent runtime service Introduce src/server/runtime/ as a self-contained server-beta runtime that owns its lifecycle, Postgres bootstrap, and HTTP boundary without depending on WorkerService. ServerBetaService wraps the existing Server class, exposes /healthz and /v1/info with runtime="server-beta", and persists state to dedicated paths (.server-beta.pid|.port|.runtime.json). The four boundary managers (queue, generation worker, provider registry, event broadcaster) are intentionally disabled in this phase and report their status through /v1/info; later phases activate them. Adds plans/2026-05-07-finish-bullmq-branch-ship-plan.md to track the remaining work for this branch. Phase 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(server-beta): route CLI lifecycle and bundle separate runtime scripts/build-hooks.js now produces plugin/scripts/server-beta-service.cjs as a separate Node CJS bundle, alongside the existing worker-service bundle. The server-beta runtime is now installable independently. src/npx-cli/commands/server.ts routes start|stop|restart|status to the server-beta lifecycle instead of the legacy worker. The worker keeps its own start|stop|restart|status under the worker namespace; the two runtimes can be operated independently. src/services/worker-service.ts adds a server-* command parser branch that delegates to the sibling server-beta-service.cjs bundle so direct worker-service invocations still route to the right runtime. tests/npx-cli-server-namespace.test.ts updated to expect server-beta lifecycle routing. Includes rebuilt plugin/scripts/*.cjs bundles produced by build-and-sync. Phase 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(server-beta): add BullMQ job queue primitives Introduce src/server/jobs/ as the queue-side primitives that Phase 3 of the server-beta runtime needs to operate. types.ts defines a discriminated union over the four job kinds (event, event-batch, summary, reindex) and maps each to a per-kind BullMQ queue name and deterministic-ID prefix. job-id.ts builds deterministic, colon-free BullMQ jobIds from (kind, team, project, source). The colon ban exists because BullMQ uses ':' as a Redis key separator internally; embedding ':' in jobIds breaks scan and state lookups. ServerJobQueue.ts is a thin wrapper over BullMQ Queue + Worker that enforces autorun:false, default concurrency 1, and an attached error listener — all per BullMQ docs requirements. Test seams accept queue and worker factories so unit tests do not need Redis. outbox.ts publishes through the Postgres ObservationGenerationJob repository as canonical history. enqueueOutbox writes the row first, then publishes to BullMQ; if BullMQ throws, the row is transitioned to failed and a failed event is appended. reconcileOnStartup re-enqueues queued + processing rows after a restart, replacing terminal BullMQ jobs that may still be holding the deterministic ID slot. markCompleted and markFailed wrap transitionStatus and append the matching event row. Includes 20 unit tests covering deterministic ID stability, colon-free output, queue lifecycle, error-listener attachment, double-start refusal, idempotent enqueue, BullMQ failure rollback, startup reconciliation, max-attempts skipping, and completion / failure / retry transitions. Phase 3 commit 1 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(server-beta): activate queue boundary in runtime service Wire ActiveServerBetaQueueManager into the server-beta runtime graph. The active manager owns one ServerJobQueue per generation kind (event, event-batch, summary, reindex) and surfaces lane metadata through boundary health. Selection is opt-in and fail-fast: if CLAUDE_MEM_QUEUE_ENGINE is set to bullmq the active manager is constructed (and any Redis/config error throws — no silent fallback to SQLite, per Phase 3 anti-pattern guard). For any other engine the disabled boundary remains so worker-era and test setups stay compatible. Widens ServerBetaBoundaryHealth.status to a discriminated union ('disabled' | 'active' | 'errored') with optional details. The disabled adapter still emits status='disabled', which keeps the existing server-beta-service test green. ServerBetaService receives the manager through a new optional queueManager field on CreateServerBetaServiceOptions so test graphs and Phase 4 wiring can inject custom managers. Adds tests/server/runtime/active-queue-manager.test.ts covering bullmq guard, active health shape, per-kind queue access, close behavior, and post-close errored health. Phase 3 commit 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(server-beta): cap /v1/events/batch at 500 events Prevents unbounded array DoS surface flagged in PR review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
299 lines
13 KiB
Markdown
299 lines
13 KiB
Markdown
🌐 Tämä on automaattinen käännös. Yhteisön korjaukset ovat tervetulleita!
|
|
|
|
<h1 align="center">
|
|
<br>
|
|
<a href="https://github.com/thedotmack/claude-mem">
|
|
<picture>
|
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/thedotmack/claude-mem/main/docs/public/claude-mem-logo-for-dark-mode.webp">
|
|
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/thedotmack/claude-mem/main/docs/public/claude-mem-logo-for-light-mode.webp">
|
|
<img src="https://raw.githubusercontent.com/thedotmack/claude-mem/main/docs/public/claude-mem-logo-for-light-mode.webp" alt="Claude-Mem" width="400">
|
|
</picture>
|
|
</a>
|
|
<br>
|
|
</h1>
|
|
|
|
<p align="center">
|
|
<a href="README.zh.md">🇨🇳 中文</a> •
|
|
<a href="README.zh-tw.md">🇹🇼 繁體中文</a> •
|
|
<a href="README.ja.md">🇯🇵 日本語</a> •
|
|
<a href="README.pt-br.md">🇧🇷 Português</a> •
|
|
<a href="README.ko.md">🇰🇷 한국어</a> •
|
|
<a href="README.es.md">🇪🇸 Español</a> •
|
|
<a href="README.de.md">🇩🇪 Deutsch</a> •
|
|
<a href="README.fr.md">🇫🇷 Français</a>
|
|
<a href="README.he.md">🇮🇱 עברית</a> •
|
|
<a href="README.ar.md">🇸🇦 العربية</a> •
|
|
<a href="README.ru.md">🇷🇺 Русский</a> •
|
|
<a href="README.pl.md">🇵🇱 Polski</a> •
|
|
<a href="README.cs.md">🇨🇿 Čeština</a> •
|
|
<a href="README.nl.md">🇳🇱 Nederlands</a> •
|
|
<a href="README.tr.md">🇹🇷 Türkçe</a> •
|
|
<a href="README.uk.md">🇺🇦 Українська</a> •
|
|
<a href="README.vi.md">🇻🇳 Tiếng Việt</a> •
|
|
<a href="README.id.md">🇮🇩 Indonesia</a> •
|
|
<a href="README.th.md">🇹🇭 ไทย</a> •
|
|
<a href="README.hi.md">🇮🇳 हिन्दी</a> •
|
|
<a href="README.bn.md">🇧🇩 বাংলা</a> •
|
|
<a href="README.ur.md">🇵🇰 اردو</a> •
|
|
<a href="README.ro.md">🇷🇴 Română</a> •
|
|
<a href="README.sv.md">🇸🇪 Svenska</a> •
|
|
<a href="README.it.md">🇮🇹 Italiano</a> •
|
|
<a href="README.el.md">🇬🇷 Ελληνικά</a> •
|
|
<a href="README.hu.md">🇭🇺 Magyar</a> •
|
|
<a href="README.fi.md">🇫🇮 Suomi</a> •
|
|
<a href="README.da.md">🇩🇰 Dansk</a> •
|
|
<a href="README.no.md">🇳🇴 Norsk</a>
|
|
</p>
|
|
|
|
<h4 align="center">Pysyvä muistinpakkaamisjärjestelmä, joka on rakennettu <a href="https://claude.com/claude-code" target="_blank">Claude Code</a> -ympäristöön.</h4>
|
|
|
|
<p align="center">
|
|
<a href="LICENSE">
|
|
<img src="https://img.shields.io/badge/License-Apache--2.0-blue.svg" alt="License">
|
|
</a>
|
|
<a href="package.json">
|
|
<img src="https://img.shields.io/badge/version-6.5.0-green.svg" alt="Version">
|
|
</a>
|
|
<a href="package.json">
|
|
<img src="https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg" alt="Node">
|
|
</a>
|
|
<a href="https://github.com/thedotmack/awesome-claude-code">
|
|
<img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Claude Code">
|
|
</a>
|
|
</p>
|
|
|
|
<p align="center">
|
|
<a href="https://trendshift.io/repositories/15496" target="_blank">
|
|
<picture>
|
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/thedotmack/claude-mem/main/docs/public/trendshift-badge-dark.svg">
|
|
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/thedotmack/claude-mem/main/docs/public/trendshift-badge.svg">
|
|
<img src="https://raw.githubusercontent.com/thedotmack/claude-mem/main/docs/public/trendshift-badge.svg" alt="thedotmack/claude-mem | Trendshift" width="250" height="55"/>
|
|
</picture>
|
|
</a>
|
|
</p>
|
|
|
|
<br>
|
|
|
|
<p align="center">
|
|
<a href="https://github.com/thedotmack/claude-mem">
|
|
<picture>
|
|
<img src="https://raw.githubusercontent.com/thedotmack/claude-mem/main/docs/public/cm-preview.gif" alt="Claude-Mem Preview" width="800">
|
|
</picture>
|
|
</a>
|
|
</p>
|
|
|
|
<p align="center">
|
|
<a href="#pikaopas">Pikaopas</a> •
|
|
<a href="#miten-se-toimii">Miten se toimii</a> •
|
|
<a href="#hakutyökalut">Hakutyökalut</a> •
|
|
<a href="#dokumentaatio">Dokumentaatio</a> •
|
|
<a href="#asetukset">Asetukset</a> •
|
|
<a href="#vianmääritys">Vianmääritys</a> •
|
|
<a href="#lisenssi">Lisenssi</a>
|
|
</p>
|
|
|
|
<p align="center">
|
|
Claude-Mem säilyttää kontekstin saumattomasti istuntojen välillä tallentamalla automaattisesti työkalujen käyttöhavaintoja, luomalla semanttisia yhteenvetoja ja asettamalla ne tulevien istuntojen saataville. Tämä mahdollistaa Clauden säilyttää tiedon jatkuvuuden projekteista senkin jälkeen, kun istunnot päättyvät tai yhteys palautuu.
|
|
</p>
|
|
|
|
---
|
|
|
|
## Pikaopas
|
|
|
|
Aloita uusi Claude Code -istunto terminaalissa ja syötä seuraavat komennot:
|
|
|
|
```
|
|
> /plugin marketplace add thedotmack/claude-mem
|
|
|
|
> /plugin install claude-mem
|
|
```
|
|
|
|
Käynnistä Claude Code uudelleen. Aiempien istuntojen konteksti ilmestyy automaattisesti uusiin istuntoihin.
|
|
|
|
**Keskeiset ominaisuudet:**
|
|
|
|
- 🧠 **Pysyvä muisti** - Konteksti säilyy istuntojen välillä
|
|
- 📊 **Asteittainen paljastaminen** - Kerrostettu muistin haku tokenikustannusten näkyvyydellä
|
|
- 🔍 **Taitopohjainen haku** - Kysy projektihistoriaasi mem-search-taidolla
|
|
- 🖥️ **Web-katselukäyttöliittymä** - Reaaliaikainen muistivirta osoitteessa http://localhost:37777
|
|
- 💻 **Claude Desktop -taito** - Hae muistista Claude Desktop -keskusteluissa
|
|
- 🔒 **Yksityisyyden hallinta** - Käytä `<private>`-tageja arkaluonteisen sisällön poissulkemiseen tallennuksesta
|
|
- ⚙️ **Kontekstin määrittely** - Tarkka hallinta siitä, mikä konteksti injektoidaan
|
|
- 🤖 **Automaattinen toiminta** - Ei vaadi manuaalista puuttumista
|
|
- 🔗 **Viittaukset** - Viittaa aiempiin havaintoihin ID:llä (käytettävissä osoitteessa http://localhost:37777/api/observation/{id} tai näytä kaikki web-katselussa osoitteessa http://localhost:37777)
|
|
- 🧪 **Beta-kanava** - Kokeile kokeellisia ominaisuuksia kuten Endless Mode versionvaihdolla
|
|
|
|
---
|
|
|
|
## Dokumentaatio
|
|
|
|
📚 **[Näytä täydellinen dokumentaatio](https://docs.claude-mem.ai/)** - Selaa virallisella verkkosivustolla
|
|
|
|
### Aloitus
|
|
|
|
- **[Asennusopas](https://docs.claude-mem.ai/installation)** - Pikaopas ja edistynyt asennus
|
|
- **[Käyttöopas](https://docs.claude-mem.ai/usage/getting-started)** - Miten Claude-Mem toimii automaattisesti
|
|
- **[Hakutyökalut](https://docs.claude-mem.ai/usage/search-tools)** - Kysy projektihistoriaasi luonnollisella kielellä
|
|
- **[Beta-ominaisuudet](https://docs.claude-mem.ai/beta-features)** - Kokeile kokeellisia ominaisuuksia kuten Endless Mode
|
|
|
|
### Parhaat käytännöt
|
|
|
|
- **[Kontekstisuunnittelu](https://docs.claude-mem.ai/context-engineering)** - AI-agentin kontekstin optimointiperiaatteet
|
|
- **[Asteittainen paljastaminen](https://docs.claude-mem.ai/progressive-disclosure)** - Filosofia Claude-Mem-kontekstin valmistelustrategian takana
|
|
|
|
### Arkkitehtuuri
|
|
|
|
- **[Yleiskatsaus](https://docs.claude-mem.ai/architecture/overview)** - Järjestelmän komponentit ja datavirta
|
|
- **[Arkkitehtuurin kehitys](https://docs.claude-mem.ai/architecture-evolution)** - Matka versiosta v3 versioon v5
|
|
- **[Koukku-arkkitehtuuri](https://docs.claude-mem.ai/hooks-architecture)** - Miten Claude-Mem käyttää elinkaarikkoukkuja
|
|
- **[Koukku-viittaus](https://docs.claude-mem.ai/architecture/hooks)** - 7 koukku-skriptiä selitettynä
|
|
- **[Worker-palvelu](https://docs.claude-mem.ai/architecture/worker-service)** - HTTP API ja Bun-hallinta
|
|
- **[Tietokanta](https://docs.claude-mem.ai/architecture/database)** - SQLite-skeema ja FTS5-haku
|
|
- **[Hakuarkkitehtuuri](https://docs.claude-mem.ai/architecture/search-architecture)** - Hybridihaku Chroma-vektoritietokannalla
|
|
|
|
### Asetukset ja kehitys
|
|
|
|
- **[Asetukset](https://docs.claude-mem.ai/configuration)** - Ympäristömuuttujat ja asetukset
|
|
- **[Kehitys](https://docs.claude-mem.ai/development)** - Rakentaminen, testaus, osallistuminen
|
|
- **[Vianmääritys](https://docs.claude-mem.ai/troubleshooting)** - Yleiset ongelmat ja ratkaisut
|
|
|
|
---
|
|
|
|
## Miten se toimii
|
|
|
|
**Keskeiset komponentit:**
|
|
|
|
1. **5 elinkaarikoukua** - SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd (6 koukku-skriptiä)
|
|
2. **Älykäs asennus** - Välimuistettu riippuvuuksien tarkistaja (esikoukku-skripti, ei elinkaarikkoukku)
|
|
3. **Worker-palvelu** - HTTP API portissa 37777 web-katselukäyttöliittymällä ja 10 hakupäätepisteellä, Bun-hallinnoimana
|
|
4. **SQLite-tietokanta** - Tallentaa istunnot, havainnot, yhteenvedot
|
|
5. **mem-search-taito** - Luonnollisen kielen kyselyt asteittaisella paljastamisella
|
|
6. **Chroma-vektoritietokanta** - Hybridi semanttinen + avainsanahaku älykkääseen kontekstin hakuun
|
|
|
|
Katso [Arkkitehtuurin yleiskatsaus](https://docs.claude-mem.ai/architecture/overview) yksityiskohdista.
|
|
|
|
---
|
|
|
|
## mem-search-taito
|
|
|
|
Claude-Mem tarjoaa älykkään haun mem-search-taidon kautta, joka käynnistyy automaattisesti kun kysyt aiemmasta työstä:
|
|
|
|
**Miten se toimii:**
|
|
- Kysy vain luonnollisesti: *"Mitä teimme viime istunnossa?"* tai *"Korjasimmeko tämän bugin aiemmin?"*
|
|
- Claude käynnistää automaattisesti mem-search-taidon löytääkseen relevantin kontekstin
|
|
|
|
**Saatavilla olevat hakutoiminnot:**
|
|
|
|
1. **Hae havaintoja** - Koko tekstin haku havainnoissa
|
|
2. **Hae istuntoja** - Koko tekstin haku istuntojen yhteenvedoissa
|
|
3. **Hae prompteja** - Hae raakoista käyttäjäpyynnöistä
|
|
4. **Konseptin mukaan** - Hae konseptitageilla (discovery, problem-solution, pattern, jne.)
|
|
5. **Tiedoston mukaan** - Hae tiettyihin tiedostoihin viittaavia havaintoja
|
|
6. **Tyypin mukaan** - Hae tyypillä (decision, bugfix, feature, refactor, discovery, change)
|
|
7. **Viimeaikainen konteksti** - Hae projektin viimeaikainen istuntokonteksti
|
|
8. **Aikajana** - Hae yhtenäinen aikajana kontekstista tietyn ajankohdan ympärillä
|
|
9. **Aikajana kyselyn mukaan** - Hae havaintoja ja saa aikalinjakonteksti parhaan osuman ympärillä
|
|
10. **API-ohje** - Hae haku-API:n dokumentaatio
|
|
|
|
**Esimerkkejä luonnollisen kielen kyselyistä:**
|
|
|
|
```
|
|
"Mitkä bugit korjasimme viime istunnossa?"
|
|
"Miten toteutimme autentikoinnin?"
|
|
"Mitä muutoksia tehtiin worker-service.ts:ään?"
|
|
"Näytä viimeaikainen työ tässä projektissa"
|
|
"Mitä tapahtui kun lisäsimme katselukäyttöliittymän?"
|
|
```
|
|
|
|
Katso [Hakutyökalujen opas](https://docs.claude-mem.ai/usage/search-tools) yksityiskohtaisia esimerkkejä varten.
|
|
|
|
---
|
|
|
|
## Beta-ominaisuudet
|
|
|
|
Claude-Mem tarjoaa **beta-kanavan** kokeellisilla ominaisuuksilla kuten **Endless Mode** (biomimeettinen muistiarkkitehtuuri pidennetyille istunnoille). Vaihda vakaan ja beta-version välillä web-katselukäyttöliittymästä osoitteessa http://localhost:37777 → Settings.
|
|
|
|
Katso **[Beta-ominaisuuksien dokumentaatio](https://docs.claude-mem.ai/beta-features)** yksityiskohdista Endless Moden ja sen kokeilemisen osalta.
|
|
|
|
---
|
|
|
|
## Järjestelmävaatimukset
|
|
|
|
- **Node.js**: 18.0.0 tai uudempi
|
|
- **Claude Code**: Uusin versio plugin-tuella
|
|
- **Bun**: JavaScript-ajoympäristö ja prosessinhallinta (asennetaan automaattisesti jos puuttuu)
|
|
- **uv**: Python-paketinhallinta vektorihakuun (asennetaan automaattisesti jos puuttuu)
|
|
- **SQLite 3**: Pysyvälle tallennukselle (sisältyy)
|
|
|
|
---
|
|
|
|
## Asetukset
|
|
|
|
Asetuksia hallitaan tiedostossa `~/.claude-mem/settings.json` (luodaan automaattisesti oletusarvoilla ensimmäisellä suorituskerralla). Määritä AI-malli, worker-portti, datahakemisto, lokitaso ja kontekstin injektointiasetukset.
|
|
|
|
Katso **[Asetusopas](https://docs.claude-mem.ai/configuration)** kaikista saatavilla olevista asetuksista ja esimerkeistä.
|
|
|
|
---
|
|
|
|
## Kehitys
|
|
|
|
Katso **[Kehitysopas](https://docs.claude-mem.ai/development)** rakennusohjeista, testauksesta ja osallistumisen työnkulusta.
|
|
|
|
---
|
|
|
|
## Vianmääritys
|
|
|
|
Jos kohtaat ongelmia, kuvaile ongelma Claudelle ja troubleshoot-taito diagnosoi automaattisesti ja tarjoaa korjauksia.
|
|
|
|
Katso **[Vianmääritysopas](https://docs.claude-mem.ai/troubleshooting)** yleisistä ongelmista ja ratkaisuista.
|
|
|
|
---
|
|
|
|
## Bugiraportit
|
|
|
|
Luo kattavia bugiraportteja automaattisella generaattorilla:
|
|
|
|
```bash
|
|
cd ~/.claude/plugins/marketplaces/thedotmack
|
|
npm run bug-report
|
|
```
|
|
|
|
## Osallistuminen
|
|
|
|
Osallistuminen on tervetullutta! Ole hyvä:
|
|
|
|
1. Haarukoi repositorio
|
|
2. Luo ominaisuushaara
|
|
3. Tee muutoksesi testeineen
|
|
4. Päivitä dokumentaatio
|
|
5. Lähetä Pull Request
|
|
|
|
Katso [Kehitysopas](https://docs.claude-mem.ai/development) osallistumisen työnkulusta.
|
|
|
|
---
|
|
|
|
## License
|
|
|
|
This project is licensed under the **Apache License 2.0** (Apache-2.0).
|
|
|
|
Copyright (C) 2025 Alex Newman (@thedotmack). All rights reserved.
|
|
|
|
See the [LICENSE](LICENSE) file for full details.
|
|
|
|
Apache-2.0 allows broad use, modification, distribution, and commercial use, subject to its terms.
|
|
|
|
**Ragtime note**: The ragtime/ directory is licensed under the **Apache License 2.0**. See [ragtime/LICENSE](ragtime/LICENSE) for details.
|
|
|
|
---
|
|
|
|
|
|
## Tuki
|
|
|
|
- **Dokumentaatio**: [docs/](docs/)
|
|
- **Ongelmat**: [GitHub Issues](https://github.com/thedotmack/claude-mem/issues)
|
|
- **Repositorio**: [github.com/thedotmack/claude-mem](https://github.com/thedotmack/claude-mem)
|
|
- **Tekijä**: Alex Newman ([@thedotmack](https://github.com/thedotmack))
|
|
|
|
---
|
|
|
|
**Rakennettu Claude Agent SDK:lla** | **Claude Coden voimalla** | **Tehty TypeScriptillä** |