JSPM

opencode-agentmemory-launcher

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 30
  • Score
    100M100P100Q91080F
  • License AGPL-3.0-only

OpenCode plugin that auto-starts the agentmemory backend with health-check supervision

Package Exports

  • opencode-agentmemory-launcher

Readme

npm version License Node.js CI

opencode-agentmemory-launcher

OpenCode plugin that auto-starts the agentmemory backend with health-check supervision.

Requirements

  • Node.js ≥ 18.0.0
  • OpenCode with plugin support
  • agentmemory backend (auto-installed via npx @agentmemory/agentmemory if not present)

What It Does

This plugin automatically starts the agentmemory backend (REST API + iii-engine) when OpenCode loads its configuration. It runs once per OpenCode process and health-checks the backend every 60 seconds, restarting it if the process dies.

Installation

Add to your OpenCode config:

// opencode.json
{
  "plugin": ["opencode-agentmemory-launcher"]
}

OpenCode will automatically install the package at startup. See the OpenCode Plugins documentation for more details.

From local file

Place the plugin file in .opencode/plugins/:

.opencode/plugins/
└── agentmemory-launcher.ts

Files in this directory are automatically loaded at startup.

How It Works

  1. On first config load: The plugin starts a health-check interval (60s)
  2. Health check: Pings GET /agentmemory/health on the backend
  3. Auto-restart: If the health check fails, spawns npx @agentmemory/agentmemory in a detached process
  4. Debug mode: Set OPENCODE_AGENTMEMORY_DEBUG=1 for verbose logging

Environment Variables

Variable Default Description
AGENTMEMORY_URL http://localhost:3111 Backend API URL
OPENCODE_AGENTMEMORY_DEBUG unset Set to 1 for debug logging

API

The plugin exports a single object conforming to the @opencode-ai/plugin interface:

import type { Plugin } from "@opencode-ai/plugin";

export const AgentmemoryLauncherPlugin: Plugin;

This plugin implements the config lifecycle hook, which is called each time OpenCode loads its configuration.

Development

# Install dependencies
npm install

# Type-check
npm run typecheck

# Build
npm run build

# Run tests
npm test

Community

License

GNU Affero General Public License v3.0

© Cle2ment