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)
16 lines
502 B
TypeScript
16 lines
502 B
TypeScript
import { join } from "node:path";
|
|
import { xdgData } from "xdg-basedir";
|
|
|
|
export const OPENCODE_STORAGE = join(xdgData ?? "", "opencode", "storage");
|
|
export const INTERACTIVE_BASH_SESSION_STORAGE = join(
|
|
OPENCODE_STORAGE,
|
|
"interactive-bash-session",
|
|
);
|
|
|
|
export const OMO_SESSION_PREFIX = "omo-";
|
|
|
|
export function buildSessionReminderMessage(sessions: string[]): string {
|
|
if (sessions.length === 0) return "";
|
|
return `\n\n[System Reminder] Active omo-* tmux sessions: ${sessions.join(", ")}`;
|
|
}
|