-
Notifications
You must be signed in to change notification settings - Fork 81
feat: add full Oh My Pi (OMP) support — rebased, conflict-free #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
0e365c9
1a840c3
5661876
63ce85a
b6476d0
6d08c07
d75b214
1fe6c4e
842e979
92113ff
262d702
2af097f
59765ee
3db3340
d9e1d32
4786467
7ec6999
ad47cd9
8302900
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import { afterEach, describe, expect, it } from "bun:test"; | ||
| import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs"; | ||
| import { tmpdir } from "node:os"; | ||
| import { join } from "node:path"; | ||
| import { OmpAdapter } from "./omp"; | ||
|
|
||
| const original = { | ||
| HOME: process.env.HOME, | ||
| PATH: process.env.PATH, | ||
| PI_CODING_AGENT_DIR: process.env.PI_CODING_AGENT_DIR, | ||
| XDG_DATA_HOME: process.env.XDG_DATA_HOME, | ||
| }; | ||
| const roots: string[] = []; | ||
|
|
||
| afterEach(() => { | ||
| for (const [key, value] of Object.entries(original)) { | ||
| if (value === undefined) delete process.env[key]; | ||
| else process.env[key] = value; | ||
| } | ||
| for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true }); | ||
| }); | ||
|
|
||
| describe("OmpAdapter", () => { | ||
| it("detects an enabled Magic Context plugin from omp plugin list", () => { | ||
| const root = mkdtempSync(join(tmpdir(), "mc-omp-adapter-")); | ||
| roots.push(root); | ||
| const bin = join(root, "bin"); | ||
| mkdirSync(bin, { recursive: true }); | ||
| const omp = join(bin, "omp"); | ||
| writeFileSync( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: This test mocks the Prompt for AI agents |
||
| omp, | ||
| `#!/bin/sh | ||
| if [ "$1 $2 $3" = "plugin list --json" ]; then | ||
| printf '%s' '{"npm":[{"name":"@cortexkit/pi-magic-context","version":"0.33.0","enabled":true}],"marketplace":[]}' | ||
| fi | ||
| `, | ||
| { mode: 0o755 }, | ||
| ); | ||
| process.env.PATH = bin; | ||
| process.env.HOME = root; | ||
| delete process.env.XDG_DATA_HOME; | ||
|
|
||
| const adapter = new OmpAdapter(); | ||
| expect(adapter.isInstalled()).toBe(true); | ||
| expect(adapter.hasPluginEntry()).toBe(true); | ||
| expect(adapter.getInstalledPluginVersion()).toBe("0.33.0"); | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: The pipeline-shape comment at the top of this file still enumerates the Docker smoke layer as only "e2e-opencode, e2e-pi", and no longer reflects the newly added e2e-omp job. Update the diagram and the following layer descriptions so the documented architecture matches the actual workflow and future readers understand OMP is part of the gated Docker smoke tier.
Prompt for AI agents