Skip to content
Agent Workspaces
Agent

ipc

All renderer-main application traffic uses `@emdash/wire`:

From plugin
emdash
6.3k33 skills33 agents

Agent definition

ipc.md

IPC Conventions

Wire Pattern

All renderer-main application traffic uses `@emdash/wire`:

  • **Contracts**: `src/core/features/<domain>/api/` using `defineContract`.
  • **Controllers**: `src/core/features/<domain>/node/` using `createController`.
  • **Manifest**: `src/core/manifests/shared/desktop-wire-contract.ts`.
  • **Gateway**: `src/main/gateway/desktop-wire.ts`.
  • **Connection seam**: `src/core/primitives/wire/browser/connection.ts` — the renderer bootstrap

seeds the connection once (`seedWireConnection`, via `src/renderer/lib/runtime/seed-desktop-wire.ts`); core code never acquires a connection itself.

  • **Clients**: each slice exports a typed domain client from its `api/`, built on `domainClient`

and the slice's exported domain constant.

// Contract (api/contract.ts)
export const exampleDomain = 'example' as const;
export const exampleContract = defineContract({
  doSomething: procedure({
    input: z.object({ id: z.string() }),
    output: z.custom<Result>(),
  }),
});

// Domain client (api/client.ts)
export type ExampleClient = ContractClient<typeof exampleContract>;
export function getExampleClient(): Promise<ExampleClient> {
  return domainClient<ExampleClient>(exampleDomain, exampleContract);
}

// Consumer
const client = await getExampleClient();
const result = await client.doSomething({ id: '123' });

Preload Bridge

The preload bridge in `src/entry/preload.ts` exposes only `requestWirePort` and `getPathForFile` on `window.electronAPI`. Add renderer-main operations to a Wire contract instead of extending the bridge.

Events And State

  • Request/response operations use `procedure`.
  • Notifications use `eventStream`.
  • Resource-backed notifications whose attach acknowledgment must mean ready use

`resourcedStream`; never encode readiness as a one-shot no-retention event. See the [Wire event-stream attachment law](../../packages/wire/docs/README.md#event-stream-attachment-law).

  • Broadcast state uses a Wire live model.
  • Long-running cancellable work uses a Wire live job.
  • Persisted renderer state uses mementos.

Rules

  • Keep contracts in the owning slice's `api/` surface and implementations in `node/`.
  • Reach the wire through the owning slice's domain client; the aggregate client in

`src/renderer/lib/runtime/desktop-wire-client.ts` is renderer-internal only.

  • Register contracts and controllers through the desktop Wire manifest and gateway.
  • Keep provider-specific adaptation at plugin or slice edges.
  • Never import a `node/` surface from browser code.
  • Test contracts, controllers, event hosts, and browser stores at their owning boundary.
Read more
@generalaction
Ships withemdash

Emdash is the Open-Source Agentic Development Environment (🧡 YC W26). Run multiple coding agents in parallel. Use any provider.

Stars on GitHub

Momentum

stars in total
6.3k
Star history of generalaction/emdash on GitHub, a chart by star-history.com

Other agents on emdash.

acp-runtime

acp-runtime

Agent

The ACP runtime is the domain service that serves the ACP API contract. It owns the host-scoped dependencies needed to run…

core-modules

core-modules

Agent

This page defines the target organization of `packages/core/src/`. Core is organized by module type so that shared domain APIs…

git-runtime

git-runtime

Agent

Git is split into a transport contract and a host-scoped runtime. Renderer, desktop, and workspace-server code share the Wire…

main-process

main-process

Agent

The main process is organized into domain modules under `src/main/core/`. Each domain typically has a `controller.ts` (RPC…

path-system

path-system

Agent

`@emdash/core/primitives/path/api` is the source of truth for portable file identity and lexical path operations. The detailed…

More agents from other plugins.

api-builder

api-builder

Agent

Deprecated placeholder. Do not use; follow root AGENTS.md and package instructions instead.

happier6d2.2k
@happier-dev@happier-devInstall Agent

Questions about ipc.

Which coding agents can use ipc?
ipc installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.