From 116c439b1d8d37c6a957b9e24e7d326d4a3c90d3 Mon Sep 17 00:00:00 2001 From: Kartik Date: Thu, 28 May 2026 00:16:45 +0530 Subject: [PATCH] fix(opencode-plugin): rename package to @mem0/opencode-plugin (#5272) --- docs/integrations/opencode.mdx | 8 ++++---- mem0-plugin/.opencode-plugin/README.md | 10 +++++----- mem0-plugin/.opencode-plugin/cli.ts | 2 +- mem0-plugin/.opencode-plugin/opencode.json | 2 +- mem0-plugin/.opencode-plugin/package.json | 2 +- mem0-plugin/CHANGELOG.md | 4 ++-- mem0-plugin/README.md | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/integrations/opencode.mdx b/docs/integrations/opencode.mdx index fc5983c21..78b57fdd5 100644 --- a/docs/integrations/opencode.mdx +++ b/docs/integrations/opencode.mdx @@ -27,7 +27,7 @@ echo 'export MEM0_API_KEY="m0-your-api-key"' >> ~/.bashrc && source ~/.bashrc ### Option A — Plugin Install (Recommended) ```bash -opencode plugin @mem0ai/opencode-plugin +opencode plugin @mem0/opencode-plugin ``` @@ -35,7 +35,7 @@ Or using this command which does the same thing: ```bash -bunx @mem0ai/opencode-plugin@latest install +bunx @mem0/opencode-plugin@latest install ``` @@ -43,7 +43,7 @@ bunx @mem0ai/opencode-plugin@latest install **Or let your agent do it** — paste this into OpenCode: ``` -Install @mem0ai/opencode-plugin by following https://raw.githubusercontent.com/mem0ai/mem0/main/mem0-plugin/.opencode-plugin/README.md +Install @mem0/opencode-plugin by following https://raw.githubusercontent.com/mem0ai/mem0/main/mem0-plugin/.opencode-plugin/README.md ``` All commands auto-add the plugin and MCP server to your `~/.config/opencode/opencode.json`. Restart OpenCode — you get the MCP server, lifecycle hooks, and all `/mem0:` slash commands. @@ -110,7 +110,7 @@ The plugin uses the [mem0ai](https://www.npmjs.com/package/mem0ai) TypeScript SD - **No tools appearing** — Restart OpenCode after installing - **"Connection failed"** — Verify your key is set: `echo $MEM0_API_KEY` -- **Plugin not loading** — Run `opencode plugin @mem0ai/opencode-plugin` again, then restart +- **Plugin not loading** — Run `opencode plugin @mem0/opencode-plugin` again, then restart - **Hooks not firing** — Hooks require the plugin install (Option A). MCP-only installs don't include hooks. diff --git a/mem0-plugin/.opencode-plugin/README.md b/mem0-plugin/.opencode-plugin/README.md index c64037823..fac980ad7 100644 --- a/mem0-plugin/.opencode-plugin/README.md +++ b/mem0-plugin/.opencode-plugin/README.md @@ -1,23 +1,23 @@ -# @mem0ai/opencode-plugin +# @mem0/opencode-plugin Persistent memory for [OpenCode](https://opencode.ai). Your agent remembers decisions, preferences, and learnings across sessions automatically. ## Install ```bash -bunx @mem0ai/opencode-plugin@latest install +bunx @mem0/opencode-plugin@latest install ``` Or using OpenCode's built-in CLI: ```bash -opencode plugin @mem0ai/opencode-plugin +opencode plugin @mem0/opencode-plugin ``` **Or let your agent do it** — paste this into OpenCode: ``` -Install @mem0ai/opencode-plugin by following https://raw.githubusercontent.com/mem0ai/mem0/main/mem0-plugin/.opencode-plugin/README.md +Install @mem0/opencode-plugin by following https://raw.githubusercontent.com/mem0ai/mem0/main/mem0-plugin/.opencode-plugin/README.md ``` All commands auto-add the plugin and MCP server to your `~/.config/opencode/opencode.json`. No manual config needed. @@ -77,7 +77,7 @@ If the `mem0` tools respond, you're all set. |---------|-----| | No tools appearing | Restart OpenCode after installing | | 401 Unauthorized | `echo $MEM0_API_KEY` must print your `m0-` key | -| Plugin not loading | Run `opencode plugin @mem0ai/opencode-plugin` again | +| Plugin not loading | Run `opencode plugin @mem0/opencode-plugin` again | ## License diff --git a/mem0-plugin/.opencode-plugin/cli.ts b/mem0-plugin/.opencode-plugin/cli.ts index 4c6cee0fa..6d02f2178 100644 --- a/mem0-plugin/.opencode-plugin/cli.ts +++ b/mem0-plugin/.opencode-plugin/cli.ts @@ -12,7 +12,7 @@ import { import { join, dirname } from "path"; import { homedir } from "os"; -const PLUGIN_NAME = "@mem0ai/opencode-plugin"; +const PLUGIN_NAME = "@mem0/opencode-plugin"; const MCP_CONFIG = { mem0: { type: "remote", diff --git a/mem0-plugin/.opencode-plugin/opencode.json b/mem0-plugin/.opencode-plugin/opencode.json index f7512b0ea..701e57c05 100644 --- a/mem0-plugin/.opencode-plugin/opencode.json +++ b/mem0-plugin/.opencode-plugin/opencode.json @@ -1,6 +1,6 @@ { "$schema": "https://opencode.ai/config.json", - "plugin": ["@mem0ai/opencode-plugin"], + "plugin": ["@mem0/opencode-plugin"], "mcp": { "mem0": { "type": "remote", diff --git a/mem0-plugin/.opencode-plugin/package.json b/mem0-plugin/.opencode-plugin/package.json index 2b40f4940..633e0c2e3 100644 --- a/mem0-plugin/.opencode-plugin/package.json +++ b/mem0-plugin/.opencode-plugin/package.json @@ -1,5 +1,5 @@ { - "name": "@mem0ai/opencode-plugin", + "name": "@mem0/opencode-plugin", "version": "0.1.0", "type": "module", "description": "Mem0 persistent memory plugin for OpenCode — add, search, and manage memories across sessions", diff --git a/mem0-plugin/CHANGELOG.md b/mem0-plugin/CHANGELOG.md index e24583bc7..69e976e22 100644 --- a/mem0-plugin/CHANGELOG.md +++ b/mem0-plugin/CHANGELOG.md @@ -6,13 +6,13 @@ All notable changes to the Mem0 plugin will be documented in this file. ### Added -- **OpenCode plugin** (`@mem0ai/opencode-plugin` on npm): Pure TypeScript plugin using the `mem0ai` TS SDK — no Python, no shell scripts. Hooks into all 6 OpenCode events (`chat.message`, `tool.execute.before`, `tool.execute.after`, `experimental.chat.system.transform`, `experimental.session.compacting`, `shell.env`). Features: session start memory loading, per-prompt semantic search, error pattern detection with memory lookup, resume/remember intent detection, auto-capture every 3rd message, periodic save nudges, full metadata defaults injection (confidence, source, type, session_id, files, branch), identity injection for search/get/delete filters, type-filtered error pre-fetch (anti_pattern + bug_fix), pre-compaction memory capture, MEMORY.md write blocking, and secret redaction. +- **OpenCode plugin** (`@mem0/opencode-plugin` on npm): Pure TypeScript plugin using the `mem0ai` TS SDK — no Python, no shell scripts. Hooks into all 6 OpenCode events (`chat.message`, `tool.execute.before`, `tool.execute.after`, `experimental.chat.system.transform`, `experimental.session.compacting`, `shell.env`). Features: session start memory loading, per-prompt semantic search, error pattern detection with memory lookup, resume/remember intent detection, auto-capture every 3rd message, periodic save nudges, full metadata defaults injection (confidence, source, type, session_id, files, branch), identity injection for search/get/delete filters, type-filtered error pre-fetch (anti_pattern + bug_fix), pre-compaction memory capture, MEMORY.md write blocking, and secret redaction. - **16 OpenCode-native skills** bundled in `opencode-skills/`: `context-loader`, `dream`, `export`, `forget`, `health`, `import`, `list-projects`, `mem0` (SDK reference), `memory-reviewer`, `onboard`, `peek`, `pin`, `remember`, `stats`, `switch-project`, `tour`. All skills are pure MCP-tool-based — no Python scripts, no shell scripts, no Claude Code dependencies. - **Auto-install skills and commands (`installSkills()`):** On plugin load, copies all 16 skills to `.opencode/skills/` and creates command wrapper files in `.opencode/commands/` so they appear in the OpenCode `/` palette. No manual setup needed. - **`extractUserText()` handler:** Robust text extraction from OpenCode response shapes — handles `parts[]` array, `content[]` array, `message.content`, and plain string responses. - **Identity resolution:** `getUserId()` uses `os.userInfo().username` (matching Claude Code's `${USER}` convention) with `MEM0_USER_ID` env override. `getProjectId()` uses git remote with `MEM0_APP_ID` env override. - **Context injection via `experimental.chat.system.transform`:** All memory context (session start memories, per-prompt search results, error-related memories, compaction context) injected as system context. -- **CLI installer (`cli.ts`):** `bunx @mem0ai/opencode-plugin install` auto-configures plugin and MCP server in `~/.config/opencode/opencode.json`. +- **CLI installer (`cli.ts`):** `bunx @mem0/opencode-plugin install` auto-configures plugin and MCP server in `~/.config/opencode/opencode.json`. - **Antigravity plugin** (`.antigravity/`): Restructured to follow the same shared-infrastructure pattern as Claude Code, Cursor, and Codex. Self-contained plugin directory with `plugin.json`, `mcp_config.json`, `hooks/hooks.json` (own file), `scripts/` (symlink → `../scripts/`), and `skills/` (symlink → `../skills/`). Installable via `agy plugin install .antigravity` or `npx degit mem0ai/mem0/mem0-plugin/.antigravity ~/.gemini/config/plugins/mem0`. Uses `contextFileName: "AGENTS.md"` per Antigravity convention. - **Codex hooks parity:** Added missing `PreToolUse` Write/Edit/MultiEdit block and `PreCompact` hook to Codex hooks config, bringing it to full parity with Claude Code. diff --git a/mem0-plugin/README.md b/mem0-plugin/README.md index 28e588a94..7a39722f9 100644 --- a/mem0-plugin/README.md +++ b/mem0-plugin/README.md @@ -158,10 +158,10 @@ Install from the [Cursor Marketplace](https://cursor.com/marketplace) for the co ### OpenCode ```bash -bunx @mem0ai/opencode-plugin@latest install +bunx @mem0/opencode-plugin@latest install ``` -Or via OpenCode's built-in CLI: `opencode plugin @mem0ai/opencode-plugin` +Or via OpenCode's built-in CLI: `opencode plugin @mem0/opencode-plugin` Then add the MCP server to your `opencode.json` (project or global at `~/.config/opencode/opencode.json`):