Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.26'
go-version: "1.26"
cache: true

- name: Setup ccache
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.26'
go-version: "1.26"
cache: false

- name: golangci-lint
Expand All @@ -80,18 +80,18 @@ jobs:
ports:
- 11434:11434
env:
OLLAMA_NUM_PARALLEL: '1'
OLLAMA_NUM_PARALLEL: "1"
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.26'
go-version: "1.26"
cache: true

- uses: actions/setup-node@v4
with:
node-version: '22'
node-version: "22"

- name: Wait for Ollama
run: |
Expand All @@ -101,25 +101,24 @@ jobs:
done

- name: Pull embedding model
run:
'curl -sf http://localhost:11434/api/pull -d ''{"name":"all-minilm"}'''
run: 'curl -sf http://localhost:11434/api/pull -d ''{"name":"all-minilm"}'''

- name: E2E tests
run: make e2e
env:
OLLAMA_HOST: http://localhost:11434
LUMEN_EMBED_MODEL: all-minilm
LUMEN_EMBED_DIMS: '384'
LUMEN_EMBED_DIMS: "384"

- name: E2E lang tests
run: make e2e-lang
env:
OLLAMA_HOST: http://localhost:11434
LUMEN_EMBED_MODEL: all-minilm
LUMEN_EMBED_DIMS: '384'
LUMEN_EMBED_DIMS: "384"

- name: Install pinned agent CLIs
run: npm install --global @anthropic-ai/claude-code@2.1.226 opencode-ai@1.18.15
run: npm install --global @anthropic-ai/claude-code@2.1.226 @opencode/cli@2.2.7

- name: Install pinned Codex CLI
run: |
Expand All @@ -138,7 +137,7 @@ jobs:
env:
OLLAMA_HOST: http://localhost:11434
LUMEN_EMBED_MODEL: all-minilm
LUMEN_EMBED_DIMS: '384'
LUMEN_EMBED_DIMS: "384"

build:
name: Build (${{ matrix.os }})
Expand All @@ -155,7 +154,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.26'
go-version: "1.26"
cache: true

- name: Set up MinGW for native CGO
Expand Down Expand Up @@ -222,7 +221,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.26'
go-version: "1.26"
cache: true

- name: Unix script tests
Expand All @@ -242,7 +241,23 @@ jobs:
- name: Setup Node.js for spawn-semantics test
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: "22"

- name: Verify packed OpenCode plugin selects the Windows launcher
if: runner.os == 'Windows'
shell: pwsh
run: |
$packDir = Join-Path $env:RUNNER_TEMP "lumen-opencode-pack"
$installDir = Join-Path $env:RUNNER_TEMP "lumen-opencode-install"
New-Item -ItemType Directory -Force -Path $packDir, $installDir | Out-Null
$packed = npm pack --json --pack-destination $packDir | ConvertFrom-Json
if ($LASTEXITCODE -ne 0) { throw "npm pack failed" }
$tarball = Join-Path $packDir $packed[0].filename
npm install --no-audit --no-fund --prefix $installDir $tarball
if ($LASTEXITCODE -ne 0) { throw "npm install failed" }
$packageRoot = Join-Path $installDir "node_modules/@ory/lumen-opencode"
node scripts/verify_opencode_package.mjs $packageRoot
if ($LASTEXITCODE -ne 0) { throw "OpenCode package verification failed" }

- name: Install cross-spawn for parallel transport test
working-directory: scripts
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ bench-swe/overview.txt
**/.claire
.worktrees

# npm dependencies
node_modules/

# scripts/ test-only npm install (cross-spawn for spawn-semantics test)
scripts/node_modules/
scripts/package-lock.json
32 changes: 15 additions & 17 deletions .opencode/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
# Installing Lumen for OpenCode

<!-- Updated 2026-11-10T17:42:18-03:00: align setup and verification with OpenCode V2. -->

Install Lumen as an OpenCode plugin from npm. The plugin registers a local MCP
server automatically.

## Prerequisites

- [OpenCode.ai](https://opencode.ai) installed
- [OpenCode.ai](https://opencode.ai) V2, version 2.2.7 or newer

## Installation

Add Lumen to the `plugin` array in your `opencode.json`:
Add Lumen to the `plugins` array in your `opencode.json`:

```json
{
"plugin": ["@ory/lumen-opencode"]
"plugins": ["@ory/lumen-opencode"]
}
```

Restart OpenCode. The plugin registers a local `mcp.lumen` server that runs
`scripts/run stdio` on all platforms (cross-spawn resolves `scripts/run.cmd`
via PATHEXT on Windows).
The plugin registers a local `mcp.lumen` server. It runs `scripts/run stdio` on
Linux and macOS, and `scripts/run.cmd stdio` on Windows. OpenCode reloads
configuration changes automatically; use `/reload` if the server does not
appear after installation.

## Verify

```bash
opencode mcp list
```

Then ask OpenCode to call the Lumen `semantic_search`, `health_check`, or
`index_status` MCP tools directly.
In an active OpenCode TUI, ask it to call the Lumen `semantic_search`,
`health_check`, or `index_status` MCP tools. If the server does not appear,
use `/reload` to reload the plugin configuration.

## Updating

Restart OpenCode after updating the version pin in `opencode.json`, or pin a
specific version:
Update the package version in `opencode.json` to select a specific release:

```json
{
"plugin": ["@ory/lumen-opencode@0.0.29"]
"plugins": ["@ory/lumen-opencode@<version>"]
}
```

## Uninstalling

Remove the `@ory/lumen-opencode` entry from `opencode.json` and restart
OpenCode.
Remove the `@ory/lumen-opencode` entry from `opencode.json`.
28 changes: 14 additions & 14 deletions .opencode/plugins/lumen.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Plugin } from "@opencode/plugin";
import path from "path";
import { fileURLToPath } from "url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const pluginRoot = path.resolve(__dirname, "../..");
const runCommand = path.join(pluginRoot, "scripts", "run");
const launcher = process.platform === "win32" ? "run.cmd" : "run";
const runCommand = path.join(pluginRoot, "scripts", launcher);

export const LumenPlugin = async () => {
return {
config: async (config) => {
config.mcp = config.mcp || {};
if (!config.mcp.lumen) {
config.mcp.lumen = {
export default Plugin.define({
id: "ory.lumen",
async setup(ctx) {
await ctx.mcp.transform((editor) => {
if (!editor.get("lumen")) {
editor.set("lumen", {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
type: "local",
command: [runCommand, "stdio"],
enabled: true,
};
disabled: false,
});
}
},
};
};

export default LumenPlugin;
});
},
});
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,30 +131,30 @@ codex mcp get lumen --json

**OpenCode**

Add `@ory/lumen-opencode` to the `plugin` array in your `opencode.json`:
<!-- Updated 2026-11-10T17:42:18-03:00: align installation and verification with OpenCode V2. -->

OpenCode V2 2.2.7 or newer is required. Add `@ory/lumen-opencode` to the
`plugins` array in your `opencode.json`:

```json
{
"plugin": ["@ory/lumen-opencode"]
"plugins": ["@ory/lumen-opencode"]
}
```

Detailed docs: [.opencode/INSTALL.md](.opencode/INSTALL.md)

Verify with:

```bash
opencode mcp list
```
Verify by asking an active OpenCode TUI to call the Lumen MCP tools. If they do
not appear, use `/reload` to reload the plugin configuration.

**Updating**

- **Claude Code** - update through Claude's plugin marketplace
- **Cursor** - refresh or reinstall the bundled plugin through Cursor after
updating this repository or the published package
- **Codex** - upgrade the `ory` marketplace, reinstall `lumen@ory`, and restart
- **OpenCode** - update the version pin in `opencode.json` (e.g.
`@ory/lumen-opencode@0.0.29`) and restart OpenCode
- **OpenCode** - update the package version in `opencode.json` and use `/reload`
if the new version does not appear

On first Claude Code or Cursor session start, Lumen:

Expand Down
Loading
Loading