chore(sync): mirror docs from openclaw/openclaw@d8a600f2ad

This commit is contained in:
openclaw-docs-sync[bot] 2026-04-29 01:23:46 +00:00
parent ad2af3a818
commit 4c014a31ef
4 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,5 @@
{
"repository": "openclaw/openclaw",
"sha": "b96e7739a993ed42085d0d290ff1139ffac33f86",
"syncedAt": "2026-04-29T00:39:44.502Z"
"sha": "d8a600f2ad01dc8171a649c34136fb6491e099ed",
"syncedAt": "2026-04-29T01:22:14.088Z"
}

View File

@ -1,2 +1,2 @@
46476e7b4fee105ca27aed9c769c507f70f02b8ce8586c135feb18e751db0de1 plugin-sdk-api-baseline.json
4bc1c0dc66d910c80694fa1a6b7ba3ab488bf737b3566e53b8a5857c16d2e0b1 plugin-sdk-api-baseline.jsonl
e7d03a0d5aed4f1afb5c7d5e235a166e1e248090632248eaa92b0016531e7f3b plugin-sdk-api-baseline.json
b9bbf8e444b358485cb33c634d3f6f6588004a5c32482c1a473167957269ae58 plugin-sdk-api-baseline.jsonl

View File

@ -122,7 +122,7 @@ A plugin can register a context engine using the plugin API:
import { buildMemorySystemPromptAddition } from "openclaw/plugin-sdk/core";
export default function register(api) {
api.registerContextEngine("my-engine", () => ({
api.registerContextEngine("my-engine", (ctx) => ({
info: {
id: "my-engine",
name: "My Context Engine",
@ -154,6 +154,10 @@ export default function register(api) {
}
```
The factory `ctx` includes optional `config`, `agentDir`, and `workspaceDir`
values so plugins can initialize per-agent or per-workspace state before the
first lifecycle hook runs.
Then enable it in config:
```json5

View File

@ -960,7 +960,7 @@ pipeline rather than just add memory search or hooks.
import { buildMemorySystemPromptAddition } from "openclaw/plugin-sdk/core";
export default function (api) {
api.registerContextEngine("lossless-claw", () => ({
api.registerContextEngine("lossless-claw", (ctx) => ({
info: { id: "lossless-claw", name: "Lossless Claw", ownsCompaction: true },
async ingest() {
return { ingested: true };
@ -982,6 +982,9 @@ export default function (api) {
}
```
The factory `ctx` exposes optional `config`, `agentDir`, and `workspaceDir`
values for construction-time initialization.
If your engine does **not** own the compaction algorithm, keep `compact()`
implemented and delegate it explicitly:
@ -992,7 +995,7 @@ import {
} from "openclaw/plugin-sdk/core";
export default function (api) {
api.registerContextEngine("my-memory-engine", () => ({
api.registerContextEngine("my-memory-engine", (ctx) => ({
info: {
id: "my-memory-engine",
name: "My Memory Engine",