feat: port OpenClaw bidirectional integration from omx

Ports the complete OpenClaw integration system from oh-my-codex:

Outbound (opencode→OpenClaw):
- wakeOpenClaw() fire-and-forget gateway notifications
- HTTP and command gateway dispatchers
- Template variable interpolation
- Config from oh-my-opencode.jsonc (no env gate needed)

Inbound (OpenClaw→opencode):
- Reply listener daemon (Discord/Telegram polling)
- Session registry for message↔tmux pane correlation
- Tmux pane detection, content capture, and text injection
- Input sanitization and rate limiting
- Pane verification before injection

Files:
- src/openclaw/ (types, config, dispatcher, index, reply-listener, session-registry, tmux, daemon)
- src/config/schema/openclaw.ts (Zod v4 schema)
- src/hooks/openclaw.ts (session hook)
- Tests: 12 pass (config + dispatcher)
This commit is contained in:
YeonGyu-Kim
2026-03-16 21:55:10 +09:00
parent 427fa6d7a2
commit b79df5e018
13 changed files with 1804 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
import type { OpenClawConfig, OpenClawGateway, OpenClawHook } from "../config/schema/openclaw"
export type { OpenClawConfig, OpenClawGateway, OpenClawHook }
export interface OpenClawContext {
sessionId?: string
projectPath?: string
projectName?: string
tmuxSession?: string
prompt?: string
contextSummary?: string
reasoning?: string
question?: string
tmuxTail?: string
replyChannel?: string
replyTarget?: string
replyThread?: string
[key: string]: string | undefined
}
export interface OpenClawPayload {
event: string
instruction: string
text: string
timestamp: string
sessionId?: string
projectPath?: string
projectName?: string
tmuxSession?: string
tmuxTail?: string
channel?: string
to?: string
threadId?: string
context: OpenClawContext
}
export interface WakeResult {
gateway: string
success: boolean
error?: string
statusCode?: number
}