feat(omp): add extension-based rewrite integration for Oh My Pi#1365
feat(omp): add extension-based rewrite integration for Oh My Pi#1365makoMakoGo wants to merge 1 commit into
Conversation
abc616a to
915ef53
Compare
|
I have used this pr for about 2 days on my omp. |
|
@aeppling @KuSh @FlorianBruniaux this is now rebased onto current
This PR has been open since 2026-04-17. Could one of you review it when you have time? Thanks. |
|
@pszymkowiak also pinging you here since you merge/review a lot of RTK work and this touches init/hook integration paths. |
|
this looks like a vibe coded mess, isn't this other one looking much better? https://github.com/beeemT/rtk/pull/2 |
PR #2 is prompt-only, while OMP supports a cleaner command-rewrite path via PR #2 describes Capability A(which I mentioned above), but the actual patch does not implement it; it ends up as Capability B (prompt-injection) only. |
There was a problem hiding this comment.
Hi @makoMakoGo, thanks for your PR.
There's a lot of documentation changes that feels like nitpicks around terms (extensions/hooks/...). That seems uneeded and unwanted. Could you try to stay closer to what we already have?
Also OMP do have pre hooks, why not just use that? Why did you choose to use an extension?
|
Thanks for the review, @KuSh. On the docs: Agreed — I'll strip the broad terminology changes and keep the diff to OMP-specific additions On extension vs pre hook: The goal is the same as a pre-execution rewrite: intercept the bash tool call before it runs and replace the command with the rtk rewrite result. I chose the extension path because it's the actively maintained surface for tool interception in current OMP. Specifically:
This also aligns with RTK's existing transparent-rewrite integrations (OpenCode plugin, OpenClaw plugin) rather than the rules-file approach or hooks. That said — if you'd prefer a pre-hook implementation, or would rather wait for another contributor's take, I'm happy to adjust or close. Just let me know which direction you'd prefer. 🤗 |
No, I was just questioning the choice since, after a quick review of the OMP repo, I didn't find anything that prioritizes extensions over hooks. But after your explanation and a closer review of the documentation, extensions seem like the right choice. So rebase, handle conflicts, and reduce documentation noise—the principles remain the same even if OMP chooses different wording. |
32043fc to
f22686a
Compare
|
Automatic message from CI checks : It seems like this branch is targeting the wrong branch, any contribution should target develop branch. See CONTRIBUTING.md for details. |
9a2fba8 to
2e4b84c
Compare
2e4b84c to
c13a98a
Compare
Add Oh My Pi (OMP) as a CLI integration. OMP loads TypeScript extensions that intercept tool_call events; RTK installs a dedicated rtk.ts extension that delegates bash command rewrites to rtk rewrite. - hooks/omp/rtk.ts: extension source (Bun runtime, tool_call handler) - hooks/omp/README.md: hook-specific documentation - src/hooks/constants.rs: OMP extension path constants - src/hooks/init.rs: run_omp_mode, uninstall_omp, show_omp_config - src/main.rs: --omp init flag and dispatch - Docs: additive OMP entries in README, supported-agents, hooks/README Supports both project-scoped (.omp/extensions/rtk.ts) and global (~/.omp/agent/extensions/rtk.ts) installation. Fails closed when rtk binary is not on PATH.
c13a98a to
6f39049
Compare
|
@KuSh updated. Changed:
Verified:
Ready for re-review when you have time. |
Summary
Adds Oh My Pi (OMP) as a first-class RTK CLI integration via a TypeScript extension that intercepts
tool_callevents for thebashtool and delegates command rewrite decisions tortk rewrite.rtk init --omp/rtk init -g --omp./.omp/extensions/rtk.tsfor project scope or~/.omp/agent/extensions/rtk.tsfor global scope--show,--uninstall,--dry-run, project-scoped install, and global installCloses #591.
Review cleanup
This version was rebased onto current
developto keep the PR focused on OMP only:--agent ompto--ompbecause OMP is a CLI/runtime integration, closer to OpenCode/Gemini/Codex than IDE rules-file integrationsTest plan
cargo fmt --all -- --checkcargo clippy --all-targetscargo testbun --eval 'await import("./hooks/omp/rtk.ts")'cargo run -- init --helpcargo run -- init --omp --dry-runcargo run -- init --omp --show