@@ -4,10 +4,12 @@ import * as path from "node:path"
44import * as readline from "node:readline"
55import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
66import type { SupermemoryClient } from "../client.ts"
7- import type { SupermemoryConfig } from "../config.ts"
87import { 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}
0 commit comments