Skip to content
Merged

Dev #57

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/@memclaw/bin-darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@memclaw/bin-darwin-arm64",
"version": "0.1.0",
"description": "MemClaw binaries for macOS Apple Silicon",
"publishConfig": {
"access": "public"
},
"os": [
"darwin"
],
Expand Down
3 changes: 3 additions & 0 deletions examples/@memclaw/bin-win-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@memclaw/bin-win-x64",
"version": "0.1.0",
"description": "MemClaw binaries for Windows x64",
"publishConfig": {
"access": "public"
},
"os": [
"win32"
],
Expand Down
File renamed without changes.
36 changes: 25 additions & 11 deletions examples/memclaw/README.md → examples/@memclaw/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ OpenClaw + MemClaw Plugin
### Install Plugin

```bash
openclaw plugins install memclaw
openclaw plugins install @memclaw/plugin
```

### Local Development Installation
Expand All @@ -69,30 +69,44 @@ For developers who want to use a local version of memclaw or develop the plugin:
```bash
# Clone the repository
git clone https://github.com/sopaco/cortex-mem.git
cd cortex-mem/examples/memclaw
cd cortex-mem/examples/@memclaw/plugin

# Install dependencies
bun install

# Build the plugin
bun run build
```

**Option A: Use plugins.load.paths**

```json
{
"plugins": {
"load": {
"paths": ["/path/to/cortex-mem/examples/@memclaw/plugin"]
},
"entries": {
"memclaw": { "enabled": true }
}
}
}
```

**Option B: Symlink to extensions directory**

# Create a symlink to the plugin directory
# This makes OpenClaw use your local version
mkdir -p ~/.openclaw/plugins
ln -sf "$(pwd)" ~/.openclaw/plugins/memclaw
```bash
mkdir -p ~/.openclaw/extensions
ln -sf "$(pwd)" ~/.openclaw/extensions/memclaw
```

Then configure in `openclaw.json` with the local plugin path:
Then enable in `openclaw.json`:

```json
{
"plugins": {
"entries": {
"memclaw": {
"enabled": true,
"path": "./plugins/memclaw"
}
"memclaw": { "enabled": true }
}
}
}
Expand Down
File renamed without changes.
100 changes: 100 additions & 0 deletions examples/@memclaw/plugin/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/**
* MemClaw - Layered Semantic Memory for OpenClaw
*
* Provides:
* - L0/L1/L2 tiered memory retrieval
* - Automatic service startup (Qdrant + cortex-mem-service)
* - Migration from OpenClaw native memory
*
* Installation:
* openclaw plugins install memclaw
*
* Configuration (in openclaw.json):
* {
* "plugins": {
* "entries": {
* "memclaw": {
* "enabled": true,
* "config": {
* "serviceUrl": "http://127.0.0.1:8085",
* "tenantId": "tenant_claw",
* "autoStartServices": true
* }
* }
* }
* }
* }
*/
export type { CortexMemClient } from './src/client.js';
export type { MemClawConfig } from './src/config.js';
interface PluginLogger {
debug?: (msg: string, ...args: unknown[]) => void;
info: (msg: string, ...args: unknown[]) => void;
warn: (msg: string, ...args: unknown[]) => void;
error: (msg: string, ...args: unknown[]) => void;
}
interface ToolDefinition {
name: string;
description: string;
parameters: object;
execute: (_id: string, params: Record<string, unknown>) => Promise<unknown>;
optional?: boolean;
}
interface PluginAPI {
pluginConfig?: Record<string, unknown>;
registerTool(tool: ToolDefinition, opts?: {
optional?: boolean;
}): void;
registerService(service: {
id: string;
start: () => Promise<void>;
stop: () => Promise<void>;
}): void;
logger: PluginLogger;
}
export default function memclawPlugin(api: PluginAPI): {
id: string;
name: string;
version: string;
};
export declare const plugin: {
id: string;
name: string;
version: string;
configSchema: {
type: string;
properties: {
serviceUrl: {
type: string;
default: string;
};
defaultSessionId: {
type: string;
default: string;
};
searchLimit: {
type: string;
default: number;
};
minScore: {
type: string;
default: number;
};
tenantId: {
type: string;
default: string;
};
autoStartServices: {
type: string;
default: boolean;
};
};
required: never[];
};
register(api: PluginAPI): {
id: string;
name: string;
version: string;
};
};
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions examples/@memclaw/plugin/dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions examples/@memclaw/plugin/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/@memclaw/plugin/dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions examples/@memclaw/plugin/dist/plugin-impl.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* MemClaw Plugin Implementation
*
* Provides layered semantic memory for OpenClaw with:
* - Automatic service startup
* - Memory tools (search, recall, add, list, close)
* - Migration from OpenClaw native memory
*/
interface PluginLogger {
debug?: (msg: string, ...args: unknown[]) => void;
info: (msg: string, ...args: unknown[]) => void;
warn: (msg: string, ...args: unknown[]) => void;
error: (msg: string, ...args: unknown[]) => void;
}
interface ToolDefinition {
name: string;
description: string;
parameters: object;
execute: (_id: string, params: Record<string, unknown>) => Promise<unknown>;
optional?: boolean;
}
interface PluginAPI {
pluginConfig?: Record<string, unknown>;
registerTool(tool: ToolDefinition, opts?: {
optional?: boolean;
}): void;
registerService(service: {
id: string;
start: () => Promise<void>;
stop: () => Promise<void>;
}): void;
logger: PluginLogger;
}
export declare function createPlugin(api: PluginAPI): {
id: string;
name: string;
version: string;
};
export {};
//# sourceMappingURL=plugin-impl.d.ts.map
1 change: 1 addition & 0 deletions examples/@memclaw/plugin/dist/plugin-impl.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading