AGENTS.md@openclaw-plugin · git:20260311.e617ba8 · 2026-03-11 · sha256 98e34a82fb607de6
AGENTS.md@openclaw-plugin git:20260311.e617ba8A
Immutable. This exact content is served forever at /api/v1/blob/98e34a82fb607de6.
--- title: openclaw-plugin — OpenClaw memory plugin --- ## Overview TypeScript memory plugin for OpenClaw. This subtree is self-contained: registration, hooks, backend, config schema, and shared types all live here. ## Commands ```bash cd openclaw-plugin && npm run typecheck ``` ## Where to look | Task | File | |------|------| | Plugin entry / registration | `index.ts` | | Backend abstraction | `backend.ts` | | REST API client | `server-backend.ts` | | Lifecycle hooks | `hooks.ts` | | Shared types / config | `types.ts` | | Plugin manifest | `openclaw.plugin.json` | ## Local conventions - ESM only; local imports always end with `.js`. - `MemoryBackend` is the seam between hooks/tools and the HTTP implementation. - `ServerBackend` is the only backend currently used; keep request logic centralized there. - `AbortSignal.timeout(8_000)` is the standard fetch timeout. - Plugin uses `kind: "memory"`; OpenClaw owns lifecycle timing, this package only supplies tools/hooks. ## Error handling - `get()` / `update()` return `null` for known not-found cases. - Unexpected HTTP failures should throw. - Public methods keep explicit `Promise<T>` return types. ## Anti-patterns - Do NOT add direct DB access here. - Do NOT remove `.js` extensions from imports; NodeNext resolution depends on them. - Do NOT scatter fetch logic across tools/hooks; reuse the backend.