Add OpenClaw plugin and JSONL event store#95
Merged
Merged
Conversation
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
Shriiii01
pushed a commit
to Shriiii01/ekai-gateway
that referenced
this pull request
Mar 7, 2026
Add OpenClaw plugin and JSONL event store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session_startthroughafter_compaction), published to npm as v0.1.0EventWriter(normalization, safe serialization, per-session files organized by agent/session) andEventReader(session listing, JSONL parsing, session reconstruction with tool call pairing and userId attribution)Test plan
npm run build --workspace=storecompiles with .js + .d.ts outputnpm 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/storenpm run build— full workspace build succeeds (store builds first)