Variable: HostSchemas
Makaio Framework / contracts / HostSchemas
Variable: HostSchemas
Section titled “Variable: HostSchemas”
constHostSchemas: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.
Type Declaration
Section titled “Type Declaration”app.focus
Section titled “app.focus”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)
app.focus.request
Section titled “app.focus.request”request:
ZodObject<{ },$strip>
app.focus.response
Section titled “app.focus.response”response:
ZodObject<{focused:ZodBoolean;windowId:ZodNullable<ZodNumber>; },$strip>
tray.activate
Section titled “tray.activate”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)
tray.activate.request
Section titled “tray.activate.request”request:
ZodObject<{ },$strip>
tray.activate.response
Section titled “tray.activate.response”response:
ZodObject<{handled:ZodBoolean; },$strip>
window.closed
Section titled “window.closed”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
Section titled “window.create”window.create:
object
Create a new desktop window identified by its registry registration ID.
Subject: host.window.create
Type: Request (RPC)
window.create.request
Section titled “window.create.request”request:
ZodObject<{params:ZodOptional<ZodRecord<ZodString,ZodString>>;registrationId:ZodString; },$strip>
window.create.response
Section titled “window.create.response”response:
ZodObject<{windowId:ZodNumber; },$strip>
window.focus
Section titled “window.focus”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)
window.focus.request
Section titled “window.focus.request”request:
ZodObject<{windowId:ZodOptional<ZodNumber>; },$strip>
window.focus.response
Section titled “window.focus.response”response:
ZodObject<{success:ZodBoolean; },$strip>
window.labelChanged
Section titled “window.labelChanged”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
Section titled “window.list”window.list:
object
List all currently open desktop windows with their current state.
Subject: host.window.list
Type: Request (RPC)
window.list.request
Section titled “window.list.request”request:
ZodObject<{ },$strip>
window.list.response
Section titled “window.list.response”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
Section titled “window.openDashboard”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)
window.openDashboard.request
Section titled “window.openDashboard.request”request:
ZodObject<{ },$strip>
window.openDashboard.response
Section titled “window.openDashboard.response”response:
ZodObject<{windowId:ZodNullable<ZodNumber>; },$strip>
window.opened
Section titled “window.opened”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