Skip to content

Add IPC protocol layer for clean separation of core and integration concerns#1

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/mimic-ipc-protocol
Draft

Add IPC protocol layer for clean separation of core and integration concerns#1
Copilot wants to merge 4 commits intomainfrom
copilot/mimic-ipc-protocol

Conversation

Copy link

Copilot AI commented Jan 9, 2026

Implements Unix socket-based IPC protocol inspired by claude-canvas to decouple core Zellij operations from AI assistant integrations.

Architecture

Before: Monolithic MCP server mixing core Zellij operations with OpenCode-specific code.

After: Layered architecture enabling separate integration repositories:

zellij-pane-tracker (core)          zellij-pane-opencode (separate repo)
├── Plugin (Rust/WASM)               ├── MCP server (uses IPC client)
├── IPC protocol (TypeScript)  ◄────┤ └── OpenCode-specific features
├── Canvas API (abstraction)         
└── Reference MCP (example)          

Changes

IPC Protocol (ipc/)

  • types.ts: JSON message protocol (getPanes, dumpPane, runInPane, newPane, renameSession)
  • server.ts: Unix socket server with multi-client support
  • client.ts: Client with automatic retry logic
  • ipc-server-standalone.ts: Standalone server binary
  • ipc-client-cli.ts: CLI test client

Canvas API (api/)

  • canvas-api.ts: High-level Zellij abstraction hiding CLI complexity
  • Methods: listPanes(), dumpPane(), runInPane(), createPane(), renameSession()

Documentation

  • Protocol specification with message examples
  • Integration guide for creating separate repos
  • Testing procedures, ADR, quick reference

Usage

Start IPC server in Zellij:

bun run ipc/ipc-server-standalone.ts

Connect from separate integration repo:

import { connectWithRetry, getSocketPath } from "zellij-pane-tracker/ipc";

const client = await connectWithRetry({
  socketPath: getSocketPath(),
  onMessage: (msg) => { /* handle responses */ }
});

client.send({ type: "dumpPane", paneId: "terminal_2", options: { lines: 50 } });

Benefits

  • Separation: Core repo handles plugin + protocol, integrations are independent repos
  • Extensibility: Multiple AI assistants (OpenCode, Claude Desktop) can connect simultaneously
  • Language agnostic: Any language can implement IPC client (Python example included)
  • Testability: Each layer independently testable

Migration Path

Existing MCP server remains functional. Users can migrate to IPC-based integrations at their own pace.

Original prompt

There is a ipc protocol or something that this repo uses. We could somehow mimick this in a way and fork this for opencode making another repo that references this one in a clear sepaarations of convern method. you feel me? https://github.com/dvdsgl/claude-canvas


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 3 commits January 9, 2026 23:49
Co-authored-by: theslyprofessor <20659937+theslyprofessor@users.noreply.github.com>
Co-authored-by: theslyprofessor <20659937+theslyprofessor@users.noreply.github.com>
Co-authored-by: theslyprofessor <20659937+theslyprofessor@users.noreply.github.com>
Copilot AI changed the title [WIP] Fork IPC protocol for open code reference Add IPC protocol layer for clean separation of core and integration concerns Jan 9, 2026
Copilot AI requested a review from theslyprofessor January 9, 2026 23:57
@theslyprofessor
Copy link
Owner

Is there a way to abstract this further so to create IPC directly within Zellij so that zellij pane dump calls that native primitive directly? And when I do create the claude-canvas clone it uses the native ipc as well? Any developments on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants