Skip to content

Commit 6b66e55

Browse files
authored
Merge pull request #50 from supermemoryai/codex/openclaw-2026-5-7-compat
[codex] Fix OpenClaw 2026.5.7 plugin compatibility
2 parents 5e969b5 + 8cf9f2d commit 6b66e55

5 files changed

Lines changed: 66 additions & 29 deletions

File tree

bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commands/cli.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import * as path from "node:path"
44
import * as readline from "node:readline"
55
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
66
import type { SupermemoryClient } from "../client.ts"
7-
import type { SupermemoryConfig } from "../config.ts"
87
import { log } from "../logger.ts"
98

10-
export function registerCliSetup(api: OpenClawPluginApi): void {
9+
export function registerCli(
10+
api: OpenClawPluginApi,
11+
client?: SupermemoryClient,
12+
): void {
1113
api.registerCli(
1214
// biome-ignore lint/suspicious/noExplicitAny: openclaw SDK does not ship types
1315
({ program }: { program: any }) => {
@@ -60,6 +62,9 @@ export function registerCliSetup(api: OpenClawPluginApi): void {
6062

6163
entries["openclaw-supermemory"] = {
6264
enabled: true,
65+
hooks: {
66+
allowConversationAccess: true,
67+
},
6368
config: {
6469
apiKey: apiKey.trim(),
6570
},
@@ -289,6 +294,9 @@ export function registerCliSetup(api: OpenClawPluginApi): void {
289294

290295
entries["openclaw-supermemory"] = {
291296
enabled: true,
297+
hooks: {
298+
allowConversationAccess: true,
299+
},
292300
config: pluginConfig,
293301
}
294302

@@ -418,24 +426,8 @@ export function registerCliSetup(api: OpenClawPluginApi): void {
418426
console.log(` Container count: ${customContainers.length}`)
419427
console.log("")
420428
})
421-
},
422-
{ commands: ["supermemory"] },
423-
)
424-
}
425429

426-
export function registerCli(
427-
api: OpenClawPluginApi,
428-
client: SupermemoryClient,
429-
_cfg: SupermemoryConfig,
430-
): void {
431-
api.registerCli(
432-
// biome-ignore lint/suspicious/noExplicitAny: openclaw SDK does not ship types
433-
({ program }: { program: any }) => {
434-
const cmd = program.commands.find(
435-
// biome-ignore lint/suspicious/noExplicitAny: openclaw SDK does not ship types
436-
(c: any) => c.name() === "supermemory",
437-
)
438-
if (!cmd) return
430+
if (!client) return
439431

440432
cmd
441433
.command("search")
@@ -512,6 +504,14 @@ export function registerCli(
512504
console.log(`Wiped ${result.deletedCount} memories from "${tag}".`)
513505
})
514506
},
515-
{ commands: ["supermemory"] },
507+
{
508+
descriptors: [
509+
{
510+
name: "supermemory",
511+
description: "Supermemory long-term memory commands",
512+
hasSubcommands: true,
513+
},
514+
],
515+
},
516516
)
517517
}

index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import os from "node:os"
33
import path from "node:path"
44
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
55
import { SupermemoryClient } from "./client.ts"
6-
import { registerCli, registerCliSetup } from "./commands/cli.ts"
6+
import { registerCli } from "./commands/cli.ts"
77
import { registerCommands, registerStubCommands } from "./commands/slash.ts"
88
import { parseConfig, supermemoryConfigSchema } from "./config.ts"
99
import { buildCaptureHandler } from "./hooks/capture.ts"
@@ -37,9 +37,8 @@ export default {
3737

3838
initLogger(api.logger, cfg.debug)
3939

40-
registerCliSetup(api)
41-
4240
if (!cfg.apiKey) {
41+
registerCli(api)
4342
api.logger.info(
4443
"supermemory: not configured - run 'openclaw supermemory setup'",
4544
)
@@ -48,6 +47,7 @@ export default {
4847
}
4948

5049
const client = new SupermemoryClient(cfg.apiKey, cfg.containerTag)
50+
registerCli(api, client)
5151

5252
const memoryRuntime = buildMemoryRuntime(client)
5353
const noopFlushPlan = () => null
@@ -87,7 +87,6 @@ export default {
8787
}
8888

8989
registerCommands(api, client, cfg, getSessionKey)
90-
registerCli(api, client, cfg)
9190

9291
api.registerService({
9392
id: "openclaw-supermemory",

openclaw.plugin.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
22
"id": "openclaw-supermemory",
33
"kind": "memory",
4+
"contracts": {
5+
"tools": [
6+
"supermemory_search",
7+
"supermemory_store",
8+
"supermemory_forget",
9+
"supermemory_profile"
10+
]
11+
},
412
"uiHints": {
513
"apiKey": {
614
"label": "Supermemory API Key",

package.json

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,56 @@
11
{
22
"name": "@supermemory/openclaw-supermemory",
3-
"version": "2.1.11",
3+
"version": "2.1.12",
44
"type": "module",
55
"description": "OpenClaw Supermemory memory plugin",
66
"license": "MIT",
77
"dependencies": {
88
"supermemory": "^4.0.0",
99
"@sinclair/typebox": "0.34.47"
1010
},
11+
"files": [
12+
"README.md",
13+
"openclaw.plugin.json",
14+
"index.ts",
15+
"client.ts",
16+
"commands",
17+
"hooks",
18+
"tools",
19+
"config.ts",
20+
"logger.ts",
21+
"memory.ts",
22+
"runtime.ts",
23+
"types",
24+
"lib/validate.d.ts",
25+
"lib/validate.js",
26+
"dist"
27+
],
1128
"scripts": {
29+
"build": "npm run build:runtime && npm run build:lib",
30+
"build:runtime": "esbuild index.ts --bundle --format=esm --platform=node --target=es2022 --external:openclaw --external:openclaw/* --external:supermemory --outfile=dist/index.js",
1231
"check-types": "tsc --noEmit",
1332
"lint": "bunx @biomejs/biome ci .",
1433
"lint:fix": "bunx @biomejs/biome check --write .",
15-
"build:lib": "esbuild lib/validate.ts --bundle --minify --format=esm --platform=node --target=es2022 --external:node:crypto --outfile=lib/validate.js"
34+
"build:lib": "esbuild lib/validate.ts --bundle --minify --format=esm --platform=node --target=es2022 --external:node:crypto --outfile=lib/validate.js",
35+
"prepack": "npm run build"
1636
},
1737
"peerDependencies": {
18-
"openclaw": ">=2026.2.17"
38+
"openclaw": ">=2026.5.7"
1939
},
2040
"openclaw": {
2141
"extensions": [
2242
"./index.ts"
23-
]
43+
],
44+
"runtimeExtensions": [
45+
"./dist/index.js"
46+
],
47+
"compat": {
48+
"pluginApi": ">=2026.5.7",
49+
"minGatewayVersion": "2026.5.7"
50+
},
51+
"build": {
52+
"openclawVersion": "2026.5.7"
53+
}
2454
},
2555
"repository": {
2656
"type": "git",

0 commit comments

Comments
 (0)