diff --git a/bun.lock b/bun.lock index 5cc2586ed..357d50479 100644 --- a/bun.lock +++ b/bun.lock @@ -31,6 +31,7 @@ "@oh-my-opencode/comment-checker-core": "workspace:*", "@oh-my-opencode/hashline-core": "workspace:*", "@oh-my-opencode/model-core": "workspace:*", + "@oh-my-opencode/omo-codex": "workspace:*", "@oh-my-opencode/prompts-core": "workspace:*", "@oh-my-opencode/rules-engine": "workspace:*", "@oh-my-opencode/utils": "workspace:*", @@ -109,6 +110,17 @@ "@oh-my-opencode/utils": "workspace:*", }, }, + "packages/omo-codex": { + "name": "@oh-my-opencode/omo-codex", + "version": "0.1.0", + "dependencies": { + "@oh-my-opencode/utils": "workspace:*", + "posthog-node": "^5.34.3", + }, + "devDependencies": { + "bun-types": "1.3.14", + }, + }, "packages/prompts-core": { "name": "@oh-my-opencode/prompts-core", "version": "0.1.0", @@ -218,6 +230,8 @@ "@oh-my-opencode/model-core": ["@oh-my-opencode/model-core@workspace:packages/model-core"], + "@oh-my-opencode/omo-codex": ["@oh-my-opencode/omo-codex@workspace:packages/omo-codex"], + "@oh-my-opencode/prompts-core": ["@oh-my-opencode/prompts-core@workspace:packages/prompts-core"], "@oh-my-opencode/rules-engine": ["@oh-my-opencode/rules-engine@workspace:packages/rules-engine"], diff --git a/bunfig.toml b/bunfig.toml index 665e9a149..deb3170f4 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,6 +1,6 @@ [test] preload = ["./test-setup.ts"] -pathIgnorePatterns = ["packages/web/**", "packages/lsp-tools-mcp/**"] +pathIgnorePatterns = ["packages/web/**", "packages/lsp-tools-mcp/**", "packages/omo-codex/plugin/**"] [loader] ".md" = "text" diff --git a/package.json b/package.json index f497f7442..86beb8a93 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,14 @@ "packages/comment-checker-core", "packages/hashline-core", "packages/boulder-state", - "packages/agents-md-core" + "packages/agents-md-core", + "packages/omo-codex" ], "bin": { "oh-my-opencode": "bin/oh-my-opencode.js", - "oh-my-openagent": "bin/oh-my-opencode.js" + "oh-my-openagent": "bin/oh-my-opencode.js", + "omo": "bin/oh-my-opencode.js", + "lazycodex": "bin/oh-my-opencode.js" }, "files": [ "dist", @@ -30,7 +33,10 @@ ".agents/command", ".agents/skills", "packages/lsp-tools-mcp/dist", - "packages/ast-grep-mcp/dist" + "packages/ast-grep-mcp/dist", + "packages/omo-codex/marketplace.json", + "packages/omo-codex/plugin", + "packages/omo-codex/scripts" ], "exports": { ".": { @@ -54,7 +60,7 @@ "prepublishOnly": "bun run clean && bun run build:lsp-tools-mcp && bun run build", "test:model-capabilities": "bun test src/shared/model-capability-aliases.test.ts src/shared/model-capability-guardrails.test.ts src/shared/model-capabilities.test.ts src/cli/doctor/checks/model-resolution.test.ts --bail", "typecheck": "tsgo --noEmit && bun run typecheck:packages", - "typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/ast-grep-core/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json", + "typecheck:packages": "tsgo --noEmit -p packages/rules-engine/tsconfig.json && tsgo --noEmit -p packages/ast-grep-core/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json && tsgo --noEmit -p packages/utils/tsconfig.json && tsgo --noEmit -p packages/model-core/tsconfig.json && tsgo --noEmit -p packages/prompts-core/tsconfig.json && tsgo --noEmit -p packages/comment-checker-core/tsconfig.json && tsgo --noEmit -p packages/hashline-core/tsconfig.json && tsgo --noEmit -p packages/boulder-state/tsconfig.json && tsgo --noEmit -p packages/agents-md-core/tsconfig.json && tsgo --noEmit -p packages/omo-codex/tsconfig.json", "typecheck:script": "tsgo --noEmit -p script/tsconfig.json", "test": "bun test", "build:ast-grep-mcp": "bun run --cwd packages/ast-grep-mcp build" @@ -105,6 +111,7 @@ "@oh-my-opencode/comment-checker-core": "workspace:*", "@oh-my-opencode/hashline-core": "workspace:*", "@oh-my-opencode/model-core": "workspace:*", + "@oh-my-opencode/omo-codex": "workspace:*", "@oh-my-opencode/prompts-core": "workspace:*", "@oh-my-opencode/rules-engine": "workspace:*", "@oh-my-opencode/utils": "workspace:*", diff --git a/packages/omo-codex/README.md b/packages/omo-codex/README.md new file mode 100644 index 000000000..ceca21223 --- /dev/null +++ b/packages/omo-codex/README.md @@ -0,0 +1,56 @@ +# @oh-my-opencode/omo-codex + +Codex harness adapter for **oh-my-openagent**. Brings the OMO experience (rules injection, comment checker, LSP MCP, ultrawork, ultragoal) into [OpenAI Codex CLI](https://github.com/openai/codex) through Codex's native plugin system. + +## Layout + +| Path | Purpose | +|------|---------| +| `plugin/` | Vendored Codex plugin namespace `omo` with 5 components. Shipped to the user via `~/.codex/plugins/cache/`. | +| `marketplace.json` | Codex marketplace manifest. Identifies `omo` as the single installable plugin. | +| `scripts/` | Node ESM build scripts (port of the original `codex-plugins/scripts/install-local.mjs`). | +| `src/` | TypeScript runtime: installer + telemetry consumed by the omodex CLI. | +| `MARKETPLACE.md` | Vendored upstream marketplace README. | + +## Components Vendored + +- `rules` (TypeScript) - injects `AGENTS.md` / `CLAUDE.md` / `.omo/rules/**` into context via `SessionStart`, `UserPromptSubmit`, `PostToolUse`, `PostCompact`. +- `comment-checker` (TypeScript) - runs `@code-yeongyu/comment-checker` after `apply_patch` / `edit` / `write` tool use. +- `lsp` (TypeScript + LSP MCP) - exposes LSP diagnostics, navigation, symbols, rename via MCP + post-edit hooks. +- `ultrawork` (Python) - keyword detector (`ulw` / `ultrawork`) that injects the full ultrawork directive, plus a `SessionStart` hook that syncs bundled agent TOML files into `CODEX_HOME/agents`. +- `ultragoal` (TypeScript) - durable multi-goal orchestration backed by `.omo/ultragoal/` evidence audit. + +## Install + +End users invoke through the omodex CLI: + +```bash +bunx omo install --codex=yes +# or, equivalently: +bunx oh-my-opencode install --codex=yes +bunx oh-my-openagent install --codex=yes +``` + +The installer copies the built plugin into `~/.codex/plugins/cache/code-yeongyu-codex-plugins/omo//`, enables it in `~/.codex/config.toml`, and links the per-component binaries into `~/.local/bin/` (or `CODEX_LOCAL_BIN_DIR`). + +## Telemetry + +Anonymous telemetry uses the same PostHog project as oh-my-openagent but emits the distinct event `omo_codex_daily_active`. Opt out with: + +```bash +export OMO_CODEX_DISABLE_POSTHOG=1 +# or globally for every OMO product: +export OMO_DISABLE_POSTHOG=1 +``` + +See `/Users/yeongyu/local-workspaces/omodex/docs/legal/privacy-policy.md` for the full disclosure. + +## Provenance + +Vendored from [`code-yeongyu/codex-plugins`](https://github.com/code-yeongyu/codex-plugins) at the snapshot present in `/Users/yeongyu/local-workspaces/codex-plugins/` on 2026-05-25. Per-component upstream: + +- [code-yeongyu/codex-rules](https://github.com/code-yeongyu/codex-rules) +- [code-yeongyu/codex-comment-checker](https://github.com/code-yeongyu/codex-comment-checker) +- [code-yeongyu/codex-lsp](https://github.com/code-yeongyu/codex-lsp) +- [code-yeongyu/codex-ultrawork](https://github.com/code-yeongyu/codex-ultrawork) +- [code-yeongyu/codex-ultragoal](https://github.com/code-yeongyu/codex-ultragoal) diff --git a/packages/omo-codex/index.d.ts b/packages/omo-codex/index.d.ts new file mode 100644 index 000000000..e910bb060 --- /dev/null +++ b/packages/omo-codex/index.d.ts @@ -0,0 +1 @@ +export * from "./src/index"; diff --git a/packages/omo-codex/package.json b/packages/omo-codex/package.json new file mode 100644 index 000000000..b0780791e --- /dev/null +++ b/packages/omo-codex/package.json @@ -0,0 +1,29 @@ +{ + "name": "@oh-my-opencode/omo-codex", + "version": "0.1.0", + "type": "module", + "private": true, + "description": "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./src/index.ts" + }, + "./telemetry": "./src/telemetry/index.ts", + "./marketplace.json": "./marketplace.json" + }, + "types": "./index.d.ts", + "scripts": { + "typecheck": "tsgo --noEmit -p tsconfig.json", + "test": "bun test src/**/*.test.ts", + "build:plugin": "node ./scripts/build-plugin.mjs", + "sync:skills": "node plugin/scripts/sync-skills.mjs" + }, + "dependencies": { + "@oh-my-opencode/utils": "workspace:*", + "posthog-node": "^5.34.3" + }, + "devDependencies": { + "bun-types": "1.3.14" + } +} diff --git a/packages/omo-codex/src/index.ts b/packages/omo-codex/src/index.ts new file mode 100644 index 000000000..fecc03d28 --- /dev/null +++ b/packages/omo-codex/src/index.ts @@ -0,0 +1,2 @@ +export * from "./telemetry" +export * from "./install" diff --git a/packages/omo-codex/src/install/index.ts b/packages/omo-codex/src/install/index.ts new file mode 100644 index 000000000..190e7fe7c --- /dev/null +++ b/packages/omo-codex/src/install/index.ts @@ -0,0 +1,4 @@ +// Codex install module entry point. Implemented in subsequent commits. +// Hosts the TypeScript port of scripts/install-local.mjs invoked from the +// omodex CLI when the user passes `--codex=yes` to `bunx omo install`. +export {} diff --git a/packages/omo-codex/tsconfig.json b/packages/omo-codex/tsconfig.json new file mode 100644 index 000000000..7a69d1222 --- /dev/null +++ b/packages/omo-codex/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "lib": ["ESNext"], + "types": ["bun-types"] + }, + "include": ["src/**/*"] +}