Skip to content

Variable: HostSchemas

Makaio Framework


Makaio Framework / contracts / HostSchemas

const HostSchemas: object

Defined in: ../../../packages/contracts/src/host/schemas.ts:62

Host shell domain schemas.

Cross-cutting RPCs that any host shell (Electron, Electrobun, browser) should implement. Framework UI packages import these subjects directly from @makaio/contracts instead of reaching into a specific host app.

Covers window lifecycle events (host → bus) consumed by the tray, and window management RPCs (bus → host) issued by the tray.

app.focus: object

Focus the application: bring an existing window to front, or open the default shell window if none are open.

Used by: second-instance detection (Electrobun health-probe), makaio open CLI command, Electron second-instance event.

Subject: host.app.focus Type: Request (RPC)

request: ZodObject<{ }, $strip>

response: ZodObject<{ focused: ZodBoolean; windowId: ZodNullable<ZodNumber>; }, $strip>

tray.activate: object

Activate the tray popover panel. Fired when the user left-clicks the tray icon.

The response tells whether the host handled the click. When handled is true, suppress the native menu. This is true for both showing and dismissing the popover (toggle).

Subject: host.tray.activate Type: Request (RPC)

request: ZodObject<{ }, $strip>

response: ZodObject<{ handled: ZodBoolean; }, $strip>

window.closed: ZodObject<{ params: ZodOptional<ZodRecord<ZodString, ZodString>>; registrationId: ZodString; windowId: ZodNumber; }, $strip>

Emitted when a desktop window is closed.

Subject: host.window.closed Type: Event

window.create: object

Create a new desktop window identified by its registry registration ID.

Subject: host.window.create Type: Request (RPC)

request: ZodObject<{ params: ZodOptional<ZodRecord<ZodString, ZodString>>; registrationId: ZodString; }, $strip>

response: ZodObject<{ windowId: ZodNumber; }, $strip>

window.focus: object

Focus an existing window. If no windowId is provided, focuses the most recently active window.

Subject: host.window.focus Type: Request (RPC)

request: ZodObject<{ windowId: ZodOptional<ZodNumber>; }, $strip>

response: ZodObject<{ success: ZodBoolean; }, $strip>

window.labelChanged: ZodObject<{ label: ZodString; windowId: ZodNumber; }, $strip>

Emitted by the web UI when a window’s display label changes — for example, when a project name becomes available or when the first message of a chat session is typed.

The host main process listens for this event and calls WindowManager.updateLabel so the internal registry stays current. Because the event is on the shared bus, the tray handler can also react to it (e.g. to update the tray menu item label) without any additional wiring.

Subject: host.window.labelChanged Type: Event

window.list: object

List all currently open desktop windows with their current state.

Subject: host.window.list Type: Request (RPC)

request: ZodObject<{ }, $strip>

response: ZodObject<{ windows: ZodArray<ZodObject<{ focused: ZodBoolean; label: ZodOptional<ZodString>; params: ZodOptional<ZodRecord<ZodString, ZodString>>; registrationId: ZodString; visible: ZodBoolean; windowId: ZodNumber; }, $strip>>; }, $strip>

window.openDashboard: object

Open (or focus) the primary dashboard window managed by the host shell.

Request: empty — the handler knows the dashboard registration ID. Response: windowId — the host-assigned window ID, or null when no window could be created or focused.

Subject: host.window.openDashboard Type: Request (RPC)

request: ZodObject<{ }, $strip>

response: ZodObject<{ windowId: ZodNullable<ZodNumber>; }, $strip>

window.opened: ZodObject<{ focused: ZodBoolean; label: ZodOptional<ZodString>; params: ZodOptional<ZodRecord<ZodString, ZodString>>; registrationId: ZodString; visible: ZodBoolean; windowId: ZodNumber; }, $strip>

Emitted when a new desktop window is opened.

Subject: host.window.opened Type: Event