Skip to content

Add OpenClaw plugin and JSONL event store#95

Merged
sm86 merged 5 commits into
mainfrom
open-claw-plugin
Mar 3, 2026
Merged

Add OpenClaw plugin and JSONL event store#95
sm86 merged 5 commits into
mainfrom
open-claw-plugin

Conversation

@sm86
Copy link
Copy Markdown
Contributor

@sm86 sm86 commented Mar 3, 2026

Summary

  • @ekai/contexto — OpenClaw plugin capturing all 13 lifecycle hooks (session_start through after_compaction), published to npm as v0.1.0
  • @ekai/store — New workspace package for structured JSONL event storage: EventWriter (normalization, safe serialization, per-session files organized by agent/session) and EventReader (session listing, JSONL parsing, session reconstruction with tool call pairing and userId attribution)
  • Memory workspace — sqlite-vec ANN vector search replaces linear scan, updated data model and retrieval pipeline

Test plan

  • npm run build --workspace=store compiles with .js + .d.ts output
  • npm run test --workspace=store — 48 tests pass (writer normalization, safe serialization, reader listing/parsing/reconstruction, path-traversal rejection, chronological ordering, tool pairing cleanup)
  • npm run type-check --workspace=@ekai/contexto — plugin type-checks against @ekai/store
  • npm run build — full workspace build succeeds (store builds first)

sm86 added 5 commits March 3, 2026 12:55
Lifecycle event logger that registers all 13 OpenClaw hooks via
api.registerHook() and appends JSONL entries with safe serialization.
Published to npm as @ekai/contexto.
Extract event storage from openclaw plugin into @ekai/store workspace
with EventWriter (normalization, safe serialization, per-session JSONL
files) and EventReader (session listing, reconstruction with tool call
pairing and userId attribution). Includes path-traversal protection,
chronological event ordering, and 48 tests.
- Fix durationMs: 0 being overwritten by computed value (falsy check → else-if)
- Sync runtime configSchema with manifest (declare dataDir property)
- Reorder root build: install first for clean-env safety, store before dependents
- Remove redundant double-resolve in reconstructSession
- Fix misleading test name for raw ID storage behavior
- Simplify rawAgentId/rawSessionId storage: remove dead !== check since
  sanitizeId always appends a hash suffix, just check if input is present
- Add _error optional field to StoreEvent and AppendInput interfaces to
  reflect the serialization-failure fallback that appears in JSONL output
@sm86 sm86 merged commit 54ddee9 into main Mar 3, 2026
1 check passed
@sm86 sm86 deleted the open-claw-plugin branch March 3, 2026 06:55
Shriiii01 pushed a commit to Shriiii01/ekai-gateway that referenced this pull request Mar 7, 2026
Add OpenClaw plugin and JSONL event store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant