2c796d144f
Co-authored-by: Claude <noreply@anthropic.com>
5.7 KiB
5.7 KiB
Changelog
All notable changes to the @mem0/opencode-plugin will be documented in this file.
0.1.3 — File-context injection, session summaries & activity timeline
Added
- File-context injection (
tool.execute.before/ Read): Before the agent reads a file, the plugin searches mem0 for memories referencing that file path and injects prior work as system context. Gates on file size (>= 1,500 bytes). Gives the agent "I've worked on this file before" awareness automatically. - Stop hook session summary (
experimental.session.compacting): Enhanced session compaction to store a structuredsession_summarymemory withinfer=True, letting the mem0 backend AI extract key facts (request, decisions, learnings, next steps). Previously only stored a raw stats string. - SessionStart activity timeline: The initial memory loading now formats recent memories with type icons (⚖️ decision, 🔴 bug_fix, 🔵 task_learning, etc.) and relative age indicators (2h ago, 1d ago) instead of bare text. Provides a visual "Recent Activity" timeline on first message.
Changed
experimental.session.compactinghandler: Now storesmetadata.type=session_summarywithmetadata.source=opencode-stopinstead ofmetadata.type=session_statewithmetadata.source=pre-compaction. Includes a structured prompt that instructs mem0's AI to extract request, decisions, learnings, and next steps.- Initial context formatting: Memories shown on first message now include type icons and age labels for quick scanning.
0.1.2 — Automatic coding categories & global search
Added
- Auto-configured coding categories: The plugin now automatically sets up 17 coding categories (e.g.
architecture_decisions,api_design,security,debugging_notes) on the Mem0 project at startup. Runs in the background on every session start viaautoSetupCategories(), is fully idempotent, and never blocks initialization. Uses SHA-256 fingerprints of the category list and API key — stored in~/.mem0/categories_setup.json— to skip redundant API calls on subsequent sessions. - Global search mode (
global_searchsetting): Newglobal_searchtoggle in~/.mem0/settings.json(default:false). When enabled, allsearch_memoriesandget_memoriescalls use{"OR": [{"user_id": "*"}]}instead of the per-user per-projectANDfilter — returning all memories across all users and allapp_idscopes. Writes (add_memory) still tag with the currentuser_idandapp_id. Applies to all plugin search paths: initial load, per-message recall, resume detection, error-pattern lookup, and compaction context. /mem0:switch-project --global/--no-global: Enables or disables global search via the switch-project skill. Persists to~/.mem0/settings.json. No manual config editing needed.MEM0_GLOBAL_SEARCHenvironment variable: Exported to child shells via theshell.envhook ("true"or"false").
Changed
- Search filters are now dynamic: All search paths throughout the plugin construct filters based on the
global_searchsetting instead of always usingAND [user_id, app_id]. - Resume-context searches broadened: Resume and error-pattern searches no longer include
metadata.typesub-filters (session_state,decision,anti_pattern,bug_fix), broadening recall. - System context message updated: Informs the model when global search is active (
"Global search is ON — searches return all memories across all users and projects. Writes still use user_id=..., app_id=..."). /mem0:onboardStep 5 is no longer interactive: Removed the manual category installation prompt. Categories now configure automatically in the background; the onboarding step only verifies status and stores a fallbackproject_profilememory if the background run hasn't finished yet./mem0:switch-projectskill expanded: Description and execution updated to document the--globaland--no-globalflags alongside the existing project-name argument.
0.1.1
- CI/CD publish flow test (
#5288). - Fixed tsconfig, added
publishConfigand bun lockfile (#5273). - Renamed package to
@mem0/opencode-plugin(#5272). - Added plugin array to bundled
opencode.json(#5271).
0.1.0 — Initial release
- OpenCode plugin (
@mem0/opencode-pluginon npm): Pure TypeScript plugin using themem0aiTS 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. - CLI installer (
cli.ts):bunx @mem0/opencode-plugin installauto-configures plugin and MCP server in~/.config/opencode/opencode.json.