From eb4afc6ef7e322100d42448b3f54da85edf93613 Mon Sep 17 00:00:00 2001 From: Saket Aryan Date: Thu, 28 May 2026 20:20:05 +0530 Subject: [PATCH 1/2] ci(opencode-plugin): add build & publish workflows for @mem0/opencode-plugin (#5287) Co-authored-by: Claude Opus 4.7 (1M context) --- .github/workflows/opencode-plugin-cd.yml | 44 ++++++++++++++++++++ .github/workflows/opencode-plugin-checks.yml | 40 ++++++++++++++++++ AGENTS.md | 2 + 3 files changed, 86 insertions(+) create mode 100644 .github/workflows/opencode-plugin-cd.yml create mode 100644 .github/workflows/opencode-plugin-checks.yml diff --git a/.github/workflows/opencode-plugin-cd.yml b/.github/workflows/opencode-plugin-cd.yml new file mode 100644 index 0000000000..746569aa8f --- /dev/null +++ b/.github/workflows/opencode-plugin-cd.yml @@ -0,0 +1,44 @@ +name: Publish @mem0/opencode-plugin 📦 to npm + +on: + release: + types: [published] + +jobs: + build-n-publish: + name: Build and publish @mem0/opencode-plugin 📦 to npm + if: startsWith(github.event.release.tag_name, 'opencode-v') + runs-on: ubuntu-latest + permissions: + id-token: write + defaults: + run: + working-directory: mem0-plugin/.opencode-plugin + steps: + - uses: actions/checkout@v4 + + - name: Install Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Build + run: bun run build + + - name: Publish to npm + run: | + if [ "${{ github.event.release.prerelease }}" = "true" ]; then + PREID=$(node -p "require('./package.json').version.split('-')[1].split('.')[0]") + npx npm@latest publish --provenance --access public --tag "$PREID" + else + npx npm@latest publish --provenance --access public + fi diff --git a/.github/workflows/opencode-plugin-checks.yml b/.github/workflows/opencode-plugin-checks.yml new file mode 100644 index 0000000000..032e8817a8 --- /dev/null +++ b/.github/workflows/opencode-plugin-checks.yml @@ -0,0 +1,40 @@ +name: opencode-plugin checks + +on: + workflow_dispatch: + push: + branches: [main] + paths: + - 'mem0-plugin/.opencode-plugin/**' + - '.github/workflows/opencode-plugin-checks.yml' + pull_request: + paths: + - 'mem0-plugin/.opencode-plugin/**' + - '.github/workflows/opencode-plugin-checks.yml' + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: mem0-plugin/.opencode-plugin + steps: + - uses: actions/checkout@v4 + + - name: Install Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Type check + run: bun run type-check + + - name: Build + run: bun run build + + - name: Verify dist output exists + run: | + test -f dist/index.js || (echo "Build output missing: dist/index.js" && exit 1) diff --git a/AGENTS.md b/AGENTS.md index 7754b84a21..bc40190b36 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -413,6 +413,7 @@ To add a new LLM, embedding, vector store, or reranker provider: | Python CLI | `cli-python-ci.yml` | Push to `cli/python/`, PRs, manual | Ruff lint + pytest + hatch build on Python 3.10, 3.11, 3.12 | | Node CLI | `cli-node-ci.yml` | Push to `cli/node/`, PRs, manual | Biome lint + tsc + vitest + tsup build on Node 20, 22 | | OpenClaw | `openclaw-checks.yml` | Push to `openclaw/`, PRs, manual | tsc + vitest (with Codecov) + tsup build on Node 20, 22 | +| OpenCode Plugin | `opencode-plugin-checks.yml` | Push to `mem0-plugin/.opencode-plugin/`, PRs, manual | Bun: tsc type-check + build + dist artifact check | ### CD Workflows (automated publishing) @@ -424,6 +425,7 @@ To add a new LLM, embedding, vector store, or reranker provider: | Node CLI | `cli-node-cd.yml` | `cli-node-v*` | npm (`@mem0/cli`) | | Vercel AI SDK | `vercel-ai-cd.yml` | `vercel-ai-v*` | npm (`@mem0/vercel-ai-provider`) | | OpenClaw | `openclaw-cd.yml` | `openclaw-v*` | npm (`@mem0/openclaw-mem0`) | +| OpenCode Plugin | `opencode-plugin-cd.yml` | `opencode-v*` | npm (`@mem0/opencode-plugin`) | - All publishing uses **OIDC trusted publishing** — no tokens or secrets required. - First publish of a new npm package must be done manually; OIDC works for subsequent versions. From 9328c36a46d6fb5fa2e22bc8e9f865e20f6fc6c9 Mon Sep 17 00:00:00 2001 From: Saket Aryan Date: Thu, 28 May 2026 20:35:06 +0530 Subject: [PATCH 2/2] chore(opencode-plugin): bump to 0.1.1 to test CI/CD publish flow (#5288) --- mem0-plugin/.opencode-plugin/opencode-mem0.ts | 2 ++ mem0-plugin/.opencode-plugin/package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mem0-plugin/.opencode-plugin/opencode-mem0.ts b/mem0-plugin/.opencode-plugin/opencode-mem0.ts index 90bb3a6f87..e46f900497 100644 --- a/mem0-plugin/.opencode-plugin/opencode-mem0.ts +++ b/mem0-plugin/.opencode-plugin/opencode-mem0.ts @@ -1,3 +1,5 @@ +// Mem0 memory plugin for OpenCode: captures and recalls memories across sessions +// (add / search / manage) via the Mem0 platform, wired through OpenCode plugin hooks. import type { Plugin } from "@opencode-ai/plugin"; import { MemoryClient } from "mem0ai"; import { userInfo } from "os"; diff --git a/mem0-plugin/.opencode-plugin/package.json b/mem0-plugin/.opencode-plugin/package.json index d13498652d..1f821e3ade 100644 --- a/mem0-plugin/.opencode-plugin/package.json +++ b/mem0-plugin/.opencode-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@mem0/opencode-plugin", - "version": "0.1.0", + "version": "0.1.1", "type": "module", "description": "Mem0 persistent memory plugin for OpenCode — add, search, and manage memories across sessions", "main": "dist/index.js",