feat(tools): add interactive_bash tool for tmux session management

Add a new tool for managing tmux sessions with automatic tracking and cleanup:

- interactive_bash tool: Accepts tmux commands via tmux_command parameter
- Session tracking hook: Tracks omo-* prefixed tmux sessions per OpenCode session
- System reminder: Appends active session list after create/delete operations
- Auto cleanup: Kills all tracked tmux sessions on OpenCode session deletion
- Output truncation: Registered in TRUNCATABLE_TOOLS for long capture-pane outputs

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-15 19:02:31 +09:00
parent 2524c90850
commit 5cbef252a3
13 changed files with 304 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ import {
createKeywordDetectorHook,
createAgentUsageReminderHook,
createNonInteractiveEnvHook,
createInteractiveBashSessionHook,
} from "./hooks";
import { createGoogleAntigravityAuthPlugin } from "./auth/antigravity";
import {
@@ -242,6 +243,9 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
const nonInteractiveEnv = isHookEnabled("non-interactive-env")
? createNonInteractiveEnvHook(ctx)
: null;
const interactiveBashSession = isHookEnabled("interactive-bash-session")
? createInteractiveBashSessionHook(ctx)
: null;
updateTerminalTitle({ sessionId: "main" });
@@ -387,6 +391,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
await anthropicAutoCompact?.event(input);
await keywordDetector?.event(input);
await agentUsageReminder?.event(input);
await interactiveBashSession?.event(input);
const { event } = input;
const props = event.properties as Record<string, unknown> | undefined;
@@ -508,6 +513,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
await rulesInjector?.["tool.execute.after"](input, output);
await emptyTaskResponseDetector?.["tool.execute.after"](input, output);
await agentUsageReminder?.["tool.execute.after"](input, output);
await interactiveBashSession?.["tool.execute.after"](input, output);
if (input.sessionID === getMainSessionID()) {
updateTerminalTitle({