fix(omo-codex): use sisyphuslabs plugin identity
This commit is contained in:
@@ -18,7 +18,7 @@ Native Codex marketplace for the `omo` plugin.
|
|||||||
bunx lazycodex install
|
bunx lazycodex install
|
||||||
```
|
```
|
||||||
|
|
||||||
The installer builds `omo`, copies a clean versioned cache entry into `~/.codex/plugins/cache/sisyphuslabs/omo`, installs runtime dependencies in the cache, registers the `sisyphuslabs` marketplace from `https://github.com/code-yeongyu/lazycodex.git`, and enables `[plugins."omo@sisyphuslabs"]` in `~/.codex/config.toml`.
|
The installer builds `omo`, copies a clean versioned cache entry into `~/.codex/plugins/cache/sisyphuslabs/omo`, installs runtime dependencies in the cache, registers the `sisyphuslabs` marketplace from `https://github.com/sisyphuslabs/omo.git`, and enables `[plugins."omo@sisyphuslabs"]` in `~/.codex/config.toml`.
|
||||||
It also enables both `plugins = true` and `plugin_hooks = true` under `[features]` so bundled hook files run.
|
It also enables both `plugins = true` and `plugin_hooks = true` under `[features]` so bundled hook files run.
|
||||||
|
|
||||||
If your local Codex build exposes plugin install commands, you can use those instead. For older local builds, the installer replaces the manual copy fallback:
|
If your local Codex build exposes plugin install commands, you can use those instead. For older local builds, the installer replaces the manual copy fallback:
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
"email": "yeongyu@users.noreply.github.com",
|
"email": "yeongyu@users.noreply.github.com",
|
||||||
"url": "https://github.com/code-yeongyu"
|
"url": "https://github.com/code-yeongyu"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/code-yeongyu/omo",
|
"homepage": "https://github.com/sisyphuslabs/omo",
|
||||||
"repository": "https://github.com/code-yeongyu/omo",
|
"repository": "https://github.com/sisyphuslabs/omo",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": ["codex", "codex-plugin", "omo", "hooks", "mcp", "skills"],
|
"keywords": ["codex", "codex-plugin", "omo", "hooks", "mcp", "skills"],
|
||||||
"skills": "./skills/",
|
"skills": "./skills/",
|
||||||
@@ -21,9 +21,9 @@
|
|||||||
"developerName": "Yeongyu Kim",
|
"developerName": "Yeongyu Kim",
|
||||||
"category": "Developer Tools",
|
"category": "Developer Tools",
|
||||||
"capabilities": ["Hooks", "MCP Tools", "Code Intelligence", "Workflow", "Context Injection"],
|
"capabilities": ["Hooks", "MCP Tools", "Code Intelligence", "Workflow", "Context Injection"],
|
||||||
"websiteURL": "https://github.com/code-yeongyu/omo",
|
"websiteURL": "https://github.com/sisyphuslabs/omo",
|
||||||
"privacyPolicyURL": "https://github.com/code-yeongyu/omo#privacy",
|
"privacyPolicyURL": "https://github.com/sisyphuslabs/omo#privacy",
|
||||||
"termsOfServiceURL": "https://github.com/code-yeongyu/omo#license",
|
"termsOfServiceURL": "https://github.com/sisyphuslabs/omo#license",
|
||||||
"defaultPrompt": [
|
"defaultPrompt": [
|
||||||
"Use OMO LSP diagnostics on this workspace.",
|
"Use OMO LSP diagnostics on this workspace.",
|
||||||
"Show which OMO rules matched this file.",
|
"Show which OMO rules matched this file.",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@code-yeongyu/omo-codex-plugin",
|
"name": "@sisyphuslabs/omo-codex-plugin",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Aggregate Codex plugin root for OMO components.",
|
"description": "Aggregate Codex plugin root for OMO components.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ import {
|
|||||||
validatePathSegment,
|
validatePathSegment,
|
||||||
} from "./install/marketplace.mjs";
|
} from "./install/marketplace.mjs";
|
||||||
|
|
||||||
const SISYPHUS_LEGACY_CACHE_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"];
|
const LEGACY_CODEX_PLUGIN_MARKETPLACE = ["code", "yeongyu", "codex", "plugins"].join("-");
|
||||||
|
const SISYPHUS_LEGACY_CACHE_MARKETPLACES = ["lazycodex", LEGACY_CODEX_PLUGIN_MARKETPLACE];
|
||||||
|
|
||||||
export async function installMarketplaceLocally(options = {}) {
|
export async function installMarketplaceLocally(options = {}) {
|
||||||
const repoRoot = resolve(options.repoRoot ?? process.cwd());
|
const repoRoot = resolve(options.repoRoot ?? process.cwd());
|
||||||
|
|||||||
@@ -1,11 +1,29 @@
|
|||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { mkdir, readFile, readlink, stat, writeFile } from "node:fs/promises";
|
import { mkdir, readFile, readlink, stat, writeFile } from "node:fs/promises";
|
||||||
import { join } from "node:path";
|
import { dirname, join } from "node:path";
|
||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
import { installMarketplaceLocally } from "./install-local.mjs";
|
import { installMarketplaceLocally } from "./install-local.mjs";
|
||||||
import { makeTempDir, writeJson, writePluginAt } from "./install-test-fixtures.mjs";
|
import { makeTempDir, writeJson, writePluginAt } from "./install-test-fixtures.mjs";
|
||||||
|
|
||||||
|
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||||
|
const legacyCodexPluginMarketplace = ["code", "yeongyu", "codex", "plugins"].join("-");
|
||||||
|
|
||||||
|
test("#given omo plugin source #when inspecting identity #then uses sisyphuslabs omo metadata", async () => {
|
||||||
|
const pluginRoot = join(scriptDir, "..", "plugin");
|
||||||
|
|
||||||
|
const manifest = JSON.parse(await readFile(join(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
|
||||||
|
const packageJson = JSON.parse(await readFile(join(pluginRoot, "package.json"), "utf8"));
|
||||||
|
|
||||||
|
assert.equal(packageJson.name, "@sisyphuslabs/omo-codex-plugin");
|
||||||
|
assert.equal(manifest.homepage, "https://github.com/sisyphuslabs/omo");
|
||||||
|
assert.equal(manifest.repository, "https://github.com/sisyphuslabs/omo");
|
||||||
|
assert.equal(manifest.interface.websiteURL, "https://github.com/sisyphuslabs/omo");
|
||||||
|
assert.equal(manifest.interface.privacyPolicyURL, "https://github.com/sisyphuslabs/omo#privacy");
|
||||||
|
assert.equal(manifest.interface.termsOfServiceURL, "https://github.com/sisyphuslabs/omo#license");
|
||||||
|
});
|
||||||
|
|
||||||
test("#given local marketplace #when installing #then copies versioned plugins and enables config", async () => {
|
test("#given local marketplace #when installing #then copies versioned plugins and enables config", async () => {
|
||||||
const repoRoot = await makeTempDir();
|
const repoRoot = await makeTempDir();
|
||||||
const codexHome = await makeTempDir();
|
const codexHome = await makeTempDir();
|
||||||
@@ -129,7 +147,7 @@ test("#given local marketplace #when installing #then copies versioned plugins a
|
|||||||
assert.doesNotMatch(config, /stale@debug-marketplace/);
|
assert.doesNotMatch(config, /stale@debug-marketplace/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("#given sisyphuslabs marketplace #when installing #then registers lazycodex git source", async () => {
|
test("#given sisyphuslabs marketplace #when installing #then registers sisyphuslabs omo git source", async () => {
|
||||||
const repoRoot = await makeTempDir();
|
const repoRoot = await makeTempDir();
|
||||||
const codexHome = await makeTempDir();
|
const codexHome = await makeTempDir();
|
||||||
const codexPackageRoot = join(repoRoot, "packages", "omo-codex");
|
const codexPackageRoot = join(repoRoot, "packages", "omo-codex");
|
||||||
@@ -139,10 +157,10 @@ test("#given sisyphuslabs marketplace #when installing #then registers lazycodex
|
|||||||
plugins: [{ name: "omo", source: "./plugins/omo" }],
|
plugins: [{ name: "omo", source: "./plugins/omo" }],
|
||||||
});
|
});
|
||||||
await writePluginAt(join(codexPackageRoot, "plugin"), "omo", "0.1.0");
|
await writePluginAt(join(codexPackageRoot, "plugin"), "omo", "0.1.0");
|
||||||
await mkdir(join(codexHome, "plugins", "cache", "code-yeongyu-codex-plugins", "omo", "0.1.0"), {
|
await mkdir(join(codexHome, "plugins", "cache", legacyCodexPluginMarketplace, "omo", "0.1.0"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
});
|
});
|
||||||
await writeJson(join(codexHome, "plugins", "cache", "code-yeongyu-codex-plugins", "omo", "0.1.0", ".mcp.json"), {
|
await writeJson(join(codexHome, "plugins", "cache", legacyCodexPluginMarketplace, "omo", "0.1.0", ".mcp.json"), {
|
||||||
mcpServers: {
|
mcpServers: {
|
||||||
lsp: {
|
lsp: {
|
||||||
command: "node",
|
command: "node",
|
||||||
@@ -150,21 +168,22 @@ test("#given sisyphuslabs marketplace #when installing #then registers lazycodex
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const legacyPluginKey = `omo@${legacyCodexPluginMarketplace}`;
|
||||||
await writeFile(
|
await writeFile(
|
||||||
join(codexHome, "config.toml"),
|
join(codexHome, "config.toml"),
|
||||||
[
|
[
|
||||||
"[marketplaces.code-yeongyu-codex-plugins]",
|
`[marketplaces.${legacyCodexPluginMarketplace}]`,
|
||||||
'last_updated = "2026-05-01T00:00:00Z"',
|
'last_updated = "2026-05-01T00:00:00Z"',
|
||||||
'source_type = "git"',
|
'source_type = "git"',
|
||||||
'source = "https://github.com/code-yeongyu/codex-plugins.git"',
|
'source = "https://github.com/code-yeongyu/codex-plugins.git"',
|
||||||
"",
|
"",
|
||||||
'[plugins."omo@code-yeongyu-codex-plugins"]',
|
`[plugins.${JSON.stringify(legacyPluginKey)}]`,
|
||||||
"enabled = true",
|
"enabled = true",
|
||||||
"",
|
"",
|
||||||
'[plugins."omo@code-yeongyu-codex-plugins".mcp_servers.lsp]',
|
`[plugins.${JSON.stringify(legacyPluginKey)}.mcp_servers.lsp]`,
|
||||||
'enabled = true',
|
'enabled = true',
|
||||||
"",
|
"",
|
||||||
'[hooks.state."omo@code-yeongyu-codex-plugins:hooks/hooks.json:post_tool_use:0:0"]',
|
`[hooks.state.${JSON.stringify(`${legacyPluginKey}:hooks/hooks.json:post_tool_use:0:0`)}]`,
|
||||||
'trusted_hash = "sha256:old"',
|
'trusted_hash = "sha256:old"',
|
||||||
"",
|
"",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
@@ -180,14 +199,15 @@ test("#given sisyphuslabs marketplace #when installing #then registers lazycodex
|
|||||||
const config = await readFile(join(codexHome, "config.toml"), "utf8");
|
const config = await readFile(join(codexHome, "config.toml"), "utf8");
|
||||||
assert.match(config, /\[marketplaces\.sisyphuslabs\]/);
|
assert.match(config, /\[marketplaces\.sisyphuslabs\]/);
|
||||||
assert.match(config, /source_type = "git"/);
|
assert.match(config, /source_type = "git"/);
|
||||||
assert.match(config, /source = "https:\/\/github\.com\/code-yeongyu\/lazycodex\.git"/);
|
assert.match(config, /source = "https:\/\/github\.com\/sisyphuslabs\/omo\.git"/);
|
||||||
assert.match(config, /ref = "main"/);
|
assert.match(config, /ref = "main"/);
|
||||||
assert.match(config, /\[plugins\."omo@sisyphuslabs"\]\nenabled = true/);
|
assert.match(config, /\[plugins\."omo@sisyphuslabs"\]\nenabled = true/);
|
||||||
assert.doesNotMatch(config, /\[marketplaces\.lazycodex\]/);
|
assert.doesNotMatch(config, /\[marketplaces\.lazycodex\]/);
|
||||||
assert.doesNotMatch(config, /code-yeongyu-codex-plugins/);
|
assert.doesNotMatch(config, new RegExp(legacyCodexPluginMarketplace));
|
||||||
|
assert.doesNotMatch(config, /lazycodex\.git/);
|
||||||
assert.doesNotMatch(config, /source_type = "local"/);
|
assert.doesNotMatch(config, /source_type = "local"/);
|
||||||
await assert.rejects(
|
await assert.rejects(
|
||||||
stat(join(codexHome, "plugins", "cache", "code-yeongyu-codex-plugins", "omo")),
|
stat(join(codexHome, "plugins", "cache", legacyCodexPluginMarketplace, "omo")),
|
||||||
/code: 'ENOENT'|ENOENT/,
|
/code: 'ENOENT'|ENOENT/,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ import { dirname } from "node:path";
|
|||||||
|
|
||||||
import { exists } from "./utils.mjs";
|
import { exists } from "./utils.mjs";
|
||||||
|
|
||||||
const LAZYCODEX_MARKETPLACE_SOURCE = {
|
const SISYPHUS_MARKETPLACE_SOURCE = {
|
||||||
sourceType: "git",
|
sourceType: "git",
|
||||||
source: "https://github.com/code-yeongyu/lazycodex.git",
|
source: "https://github.com/sisyphuslabs/omo.git",
|
||||||
ref: "main",
|
ref: "main",
|
||||||
};
|
};
|
||||||
const SISYPHUS_LEGACY_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"];
|
const LEGACY_CODEX_PLUGIN_MARKETPLACE = ["code", "yeongyu", "codex", "plugins"].join("-");
|
||||||
|
const SISYPHUS_LEGACY_MARKETPLACES = ["lazycodex", LEGACY_CODEX_PLUGIN_MARKETPLACE];
|
||||||
|
|
||||||
export async function updateCodexConfig({
|
export async function updateCodexConfig({
|
||||||
configPath,
|
configPath,
|
||||||
@@ -51,7 +52,7 @@ function removeMarketplaceBlock(config, marketplaceName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function defaultMarketplaceSource(marketplaceName, repoRoot) {
|
function defaultMarketplaceSource(marketplaceName, repoRoot) {
|
||||||
if (marketplaceName === "sisyphuslabs") return LAZYCODEX_MARKETPLACE_SOURCE;
|
if (marketplaceName === "sisyphuslabs") return SISYPHUS_MARKETPLACE_SOURCE;
|
||||||
return {
|
return {
|
||||||
sourceType: "local",
|
sourceType: "local",
|
||||||
source: repoRoot,
|
source: repoRoot,
|
||||||
|
|||||||
Reference in New Issue
Block a user