diff --git a/.github/workflows/release-oc-memwal.yml b/.github/workflows/release-oc-memwal.yml new file mode 100644 index 00000000..9994accc --- /dev/null +++ b/.github/workflows/release-oc-memwal.yml @@ -0,0 +1,103 @@ +name: Release OC-MemWal Plugin + +on: + push: + branches: + - main + - staging + - dev + paths: + - 'packages/openclaw-memory-memwal/**' + - '.github/workflows/release-oc-memwal.yml' + workflow_dispatch: + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Version & Publish + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: pnpm + registry-url: 'https://registry.npmjs.org' + + - name: Upgrade npm for OIDC Trusted Publishing + run: npm install -g npm@latest + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + + - name: Build SDK (dependency) + run: pnpm build:sdk + + - name: Typecheck + run: cd packages/openclaw-memory-memwal && npm run typecheck + + - name: Build plugin + run: cd packages/openclaw-memory-memwal && npm run build + + # ── main branch → stable release (latest) ── + - name: Publish stable release + if: github.ref == 'refs/heads/main' + run: | + BASE_VERSION=$(node -p "require('./packages/openclaw-memory-memwal/package.json').version") + npm view @mysten-incubation/oc-memwal@$BASE_VERSION version 2>/dev/null \ + && echo "Version $BASE_VERSION already published, skipping" && exit 0 + cd packages/openclaw-memory-memwal && npm publish --provenance --access public + + # ── staging branch → release candidate (rc tag, auto-increment) ── + - name: Publish staging release candidate + if: github.ref == 'refs/heads/staging' + run: | + BASE_VERSION=$(node -p "require('./packages/openclaw-memory-memwal/package.json').version") + LATEST=$(npm view @mysten-incubation/oc-memwal versions --json 2>/dev/null \ + | node -p " + const versions = JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); + const nums = (Array.isArray(versions) ? versions : [versions]) + .filter(v => v.startsWith('${BASE_VERSION}-rc.')) + .map(v => +v.split('-rc.')[1]) + .sort((a,b) => b - a); + nums.length ? nums[0] : -1; + " || echo "-1") + NEXT=$((LATEST + 1)) + NEW_VERSION="${BASE_VERSION}-rc.${NEXT}" + echo "Publishing @mysten-incubation/oc-memwal@${NEW_VERSION}" + cd packages/openclaw-memory-memwal + node -e "const p=require('./package.json');p.version='${NEW_VERSION}';require('fs').writeFileSync('./package.json',JSON.stringify(p,null,4)+'\n')" + npm publish --tag rc --provenance --access public + + # ── dev branch → prerelease (dev tag, auto-increment) ── + - name: Publish dev prerelease + if: github.ref == 'refs/heads/dev' + run: | + BASE_VERSION=$(node -p "require('./packages/openclaw-memory-memwal/package.json').version") + LATEST=$(npm view @mysten-incubation/oc-memwal versions --json 2>/dev/null \ + | node -p " + const versions = JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); + const nums = (Array.isArray(versions) ? versions : [versions]) + .filter(v => v.startsWith('${BASE_VERSION}-dev.')) + .map(v => +v.split('-dev.')[1]) + .sort((a,b) => b - a); + nums.length ? nums[0] : -1; + " || echo "-1") + NEXT=$((LATEST + 1)) + NEW_VERSION="${BASE_VERSION}-dev.${NEXT}" + echo "Publishing @mysten-incubation/oc-memwal@${NEW_VERSION}" + cd packages/openclaw-memory-memwal + node -e "const p=require('./package.json');p.version='${NEW_VERSION}';require('fs').writeFileSync('./package.json',JSON.stringify(p,null,4)+'\n')" + npm publish --tag dev --provenance --access public diff --git a/docs/openclaw/how-it-works.md b/docs/openclaw/how-it-works.md index 6a99a5e9..02586441 100644 --- a/docs/openclaw/how-it-works.md +++ b/docs/openclaw/how-it-works.md @@ -20,7 +20,7 @@ graph TB LLM_PROC["Language Model\n(Gemini, GPT, Claude)"] end - subgraph "MemWal Server (TEE)" + subgraph "MemWal Relayer" SEARCH["Vector Search"] ANALYZE["Fact Extraction (LLM)"] STORE["Encrypted Storage"] @@ -56,7 +56,7 @@ graph TB | **Auto-recall hook** | Gateway (Node.js) | Searches MemWal before each turn, injects memories into prompt | | **Auto-capture hook** | Gateway (Node.js) | Extracts facts after each turn, stores via MemWal | | **Tool execution** | Gateway (Node.js) | Runs `memory_search` / `memory_store` when the LLM calls them | -| **MemWal Server** | Remote (TEE) | Handles vector search, LLM fact extraction, encrypted storage | +| **MemWal Relayer** | Remote | Handles vector search, LLM fact extraction, encrypted storage | | **Walrus** | Decentralized | Stores encrypted memory blobs | ## Message Flow diff --git a/docs/openclaw/quick-start.md b/docs/openclaw/quick-start.md index 86e485fc..2a6bd43c 100644 --- a/docs/openclaw/quick-start.md +++ b/docs/openclaw/quick-start.md @@ -1,6 +1,6 @@ --- title: "Quick Start" -description: "Install the MemWal memory plugin for OpenClaw and verify it works." +description: "Install the MemWal memory plugin for NemoClaw/OpenClaw and verify it works." --- Get the plugin running and test the memory loop in a few minutes. @@ -8,7 +8,6 @@ Get the plugin running and test the memory loop in a few minutes. ## Prerequisites - [OpenClaw](https://openclaw.ai) `>=2026.3.11` installed and running -- A package manager — [bun](https://bun.sh), [pnpm](https://pnpm.io), or [npm](https://www.npmjs.com) You'll also need a **delegate key**, **account ID**, and **relayer URL** from MemWal — the steps below will guide you through getting these. @@ -16,38 +15,10 @@ You'll also need a **delegate key**, **account ID**, and **relayer URL** from Me - ### Install dependencies - - - - ```bash - cd packages/openclaw-memory-memwal - bun install - ``` - - - ```bash - cd packages/openclaw-memory-memwal - pnpm install - ``` - - - ```bash - cd packages/openclaw-memory-memwal - npm install - ``` - - - - - - ### Link into OpenClaw - - OpenClaw discovers plugins from `~/.openclaw/extensions/`. Create a symlink: + ### Install the plugin ```bash - mkdir -p ~/.openclaw/extensions - ln -s "$(pwd)" ~/.openclaw/extensions/memory-memwal + openclaw plugins install @mysten-incubation/oc-memwal ``` @@ -95,9 +66,9 @@ You'll also need a **delegate key**, **account ID**, and **relayer URL** from Me ```jsonc { "plugins": { - "slots": { "memory": "memory-memwal" }, + "slots": { "memory": "oc-memwal" }, "entries": { - "memory-memwal": { + "oc-memwal": { "enabled": true, "config": { "privateKey": "${MEMWAL_PRIVATE_KEY}", // References the env var @@ -134,8 +105,8 @@ You'll also need a **delegate key**, **account ID**, and **relayer URL** from Me You should see in the logs: ``` - memory-memwal: registered (server: https://..., key: e21d...ed9b, namespace: default) - memory-memwal: connected (status: ok, version: ...) + oc-memwal: registered (server: https://..., key: e21d...ed9b, namespace: default) + oc-memwal: connected (status: ok, version: ...) ``` @@ -169,7 +140,7 @@ Bot: (responds normally) Check logs — you should see: ``` -memory-memwal: auto-captured 1 facts (agent: main, namespace: default) +oc-memwal: auto-captured 1 facts (agent: main, namespace: default) ``` **2. Recall it** — in a **new conversation**, ask about it: @@ -180,7 +151,7 @@ You: What programming languages do I like? Check logs — you should see: ``` -memory-memwal: auto-recall injected 1 memories (agent: main, namespace: default) +oc-memwal: auto-recall injected 1 memories (agent: main, namespace: default) ``` **3. Search from terminal** — confirm the memory exists via CLI: diff --git a/docs/openclaw/reference.md b/docs/openclaw/reference.md index 9f8605c4..2a5bb599 100644 --- a/docs/openclaw/reference.md +++ b/docs/openclaw/reference.md @@ -213,8 +213,8 @@ Full list of config options for `openclaw.json`: ### Plugin not loading -- Check the symlink exists: `ls -la ~/.openclaw/extensions/memory-memwal` -- Check that `openclaw.plugin.json` is in the package root +- Reinstall the plugin: `openclaw plugins install @mysten-incubation/oc-memwal` +- Check that `openclaw.plugin.json` exists in the installed extension - Restart the gateway after any config changes ### Health check failed diff --git a/packages/openclaw-memory-memwal/.gitignore b/packages/openclaw-memory-memwal/.gitignore new file mode 100644 index 00000000..849ddff3 --- /dev/null +++ b/packages/openclaw-memory-memwal/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/packages/openclaw-memory-memwal/README.md b/packages/openclaw-memory-memwal/README.md index c254c8ad..1b1c1024 100644 --- a/packages/openclaw-memory-memwal/README.md +++ b/packages/openclaw-memory-memwal/README.md @@ -1,4 +1,4 @@ -

@mysten-incubation/memory-memwal

+

@mysten-incubation/oc-memwal

Cloud-based long-term memory plugin for NemoClaw/OpenClaw — gives your AI agents persistent, encrypted, cross-session memory powered by MemWal. @@ -44,9 +44,9 @@ The plugin needs three values: | **Account ID** | Your MemWalAccount object ID on Sui (`0x...`) | | **Relayer URL** | The MemWal relayer endpoint that handles search, storage, and encryption | -Get your delegate key and account ID from the [MemWal dashboard](https://memwal.ai), or see the [Quick Start guide](/getting-started/quick-start) for detailed setup. +Get your delegate key and account ID from the [MemWal dashboard](https://memwal.ai), or see the [Quick Start guide](https://docs.memwal.ai/getting-started/quick-start) for detailed setup. -For the relayer, use a managed endpoint or [self-host your own](/relayer/self-hosting): +For the relayer, use a managed endpoint or [self-host your own](https://docs.memwal.ai/relayer/self-hosting): | Environment | Relayer URL | |-------------|-------------| @@ -55,15 +55,10 @@ For the relayer, use a managed endpoint or [self-host your own](/relayer/self-ho ## Quick Start -### 1. Install and link +### 1. Install ```bash -cd packages/openclaw-memory-memwal -bun install # or: pnpm install / npm install - -# Link into OpenClaw's extensions directory -mkdir -p ~/.openclaw/extensions -ln -s "$(pwd)" ~/.openclaw/extensions/memory-memwal +openclaw plugins install @mysten-incubation/oc-memwal ``` ### 2. Set your delegate key @@ -82,9 +77,9 @@ Add the plugin config to `~/.openclaw/openclaw.json`: ```jsonc { "plugins": { - "slots": { "memory": "memory-memwal" }, + "slots": { "memory": "oc-memwal" }, "entries": { - "memory-memwal": { + "oc-memwal": { "enabled": true, "config": { "privateKey": "${MEMWAL_PRIVATE_KEY}", // References the env var diff --git a/packages/openclaw-memory-memwal/openclaw.plugin.json b/packages/openclaw-memory-memwal/openclaw.plugin.json index e96fb644..d9a36710 100644 --- a/packages/openclaw-memory-memwal/openclaw.plugin.json +++ b/packages/openclaw-memory-memwal/openclaw.plugin.json @@ -57,12 +57,12 @@ "label": "Ed25519 Private Key", "sensitive": true, "placeholder": "64-character hex string or ${ENV_VAR}", - "help": "Get from app.memwal.com. Supports ${ENV_VAR} syntax." + "help": "Get from memwal.ai. Supports ${ENV_VAR} syntax." }, "accountId": { "label": "MemWalAccount ID", "placeholder": "0x3247e3da...", - "help": "MemWalAccount object ID on Sui. Get from app.memwal.com." + "help": "MemWalAccount object ID on Sui. Get from memwal.ai." }, "serverUrl": { "label": "MemWal Server URL", diff --git a/packages/openclaw-memory-memwal/package.json b/packages/openclaw-memory-memwal/package.json index 6be2e428..176f1698 100644 --- a/packages/openclaw-memory-memwal/package.json +++ b/packages/openclaw-memory-memwal/package.json @@ -1,26 +1,48 @@ { - "name": "@mysten-incubation/memory-memwal", - "version": "0.2.0", - "private": true, + "name": "@mysten-incubation/oc-memwal", + "version": "0.0.1", "type": "module", - "description": "OpenClaw memory plugin — encrypted, decentralized long-term memory via MemWal + Walrus", + "description": "NemoClaw/OpenClaw memory plugin — encrypted, decentralized long-term memory via MemWal + Walrus", "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/MystenLabs/MemWal", + "directory": "packages/openclaw-memory-memwal" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "files": [ + "dist", + "openclaw.plugin.json", + "README.md" + ], + "scripts": { + "build": "tsc", + "typecheck": "tsc --noEmit", + "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"", + "prepublishOnly": "npm run clean && npm run build" + }, + "engines": { + "node": ">=20.0.0" + }, "dependencies": { "@mysten-incubation/memwal": "^0.0.1", "@sinclair/typebox": "0.34.48", - "zod": "^4.3.6" - }, - "peerDependencies": { - "openclaw": ">=2026.3.11" + "zod": "^3.23.0" }, - "peerDependenciesMeta": { - "openclaw": { - "optional": true - } + "devDependencies": { + "@types/node": "^22.0.0", + "typescript": "^5.7.0" }, "openclaw": { "extensions": [ - "./src/index.ts" + "./dist/index.js" ] } } diff --git a/packages/openclaw-memory-memwal/tsconfig.json b/packages/openclaw-memory-memwal/tsconfig.json new file mode 100644 index 00000000..c1142464 --- /dev/null +++ b/packages/openclaw-memory-memwal/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022"], + "outDir": "dist", + "rootDir": "src", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true, + "verbatimModuleSyntax": true + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +}