Skip to content

feat(core,desktop): M6-rest part 4 — typed IPC protocol + real handlers + renderer wiring#52

Merged
oratis merged 1 commit into
mainfrom
feat/m6-rest-ipc-protocol
May 28, 2026
Merged

feat(core,desktop): M6-rest part 4 — typed IPC protocol + real handlers + renderer wiring#52
oratis merged 1 commit into
mainfrom
feat/m6-rest-ipc-protocol

Conversation

@oratis

@oratis oratis commented May 28, 2026

Copy link
Copy Markdown
Owner

Type-safe IpcRequestMap covering 14 channels; AgentStreamEvent union for streamed turns. Preload exposes the full surface; main wires 5 list handlers. 4 list screens now call real IPC with graceful fallback. 508→512 passing.

…rs + renderer wiring

Defines the type-safe IPC contract between renderer ↔ main, wires the
listed handlers in electron/main.ts (still skipped by default until the
electron binary lands), and switches the 4 list-y screens (Sessions /
Plugins / MCP / Skills) to call the real IPC with a graceful empty-list
fallback when window.deepcode.* isn't present.

  · packages/core/src/ipc/protocol.ts (NEW, ~160 lines)
    - IpcRequestMap — exhaustive per-channel { req, res } typing for
      app:version, creds:load/save, settings:load, sessions:list/resume,
      plugins:list/install/setEnabled, mcp:list, skills:list/body,
      agent:start/abort/approve/answer.
    - IpcEventMap — one-way events (agent:event for streamed turns,
      updater:update-downloaded).
    - AgentStreamEvent — union of agent loop event (text_delta /
      tool_use / tool_result / usage / turn_complete / error) +
      approval_request + ask_user + turn_done — keyed by turnId so the
      renderer can route multiple concurrent turns.
    - newTurnId / newQuestionId helpers.
    - 4 tests + re-export from core index.

  · apps/desktop/electron/preload.ts — full typed surface exposed to
    renderer via contextBridge. window.deepcode now has sessions, plugins,
    mcp, skills, agent + onUpdateDownloaded.

  · apps/desktop/src/types/global.d.ts — corresponding renderer-side
    declarations for window.deepcode.

  · apps/desktop/electron/main.ts — added handlers:
    sessions:list, plugins:list, mcp:list, skills:list, skills:body.
    (Agent loop handlers + install/setEnabled mutators land alongside
    the live agent streaming wiring in a follow-up; the protocol is
    pinned now so the renderer code is final.)

  · apps/desktop/src/screens/{Sessions,Plugins,MCPManager,Skills}.tsx —
    real IPC fetch with empty-list fallback for current pre-electron state.

Tests: core 445 → 449 (+4 ipc); total 508 → 512 passing. Build clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oratis oratis merged commit d1a4f63 into main May 28, 2026
1 of 3 checks passed
@oratis oratis deleted the feat/m6-rest-ipc-protocol branch May 28, 2026 07:45
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.

1 participant