fix(opencode-plugin): rename package to @mem0/opencode-plugin (#5272)
This commit is contained in:
@@ -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.
|
||||
|
||||
<CardGroup cols={2}>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"plugin": ["@mem0ai/opencode-plugin"],
|
||||
"plugin": ["@mem0/opencode-plugin"],
|
||||
"mcp": {
|
||||
"mem0": {
|
||||
"type": "remote",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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`):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user