Skip to content

Architecture ​

The SDK is a renderer-side conversation UI with optional trusted adapters beside it. Each layer has a specific trust boundary and public vocabulary.

Agent UI SDK architecture

Where the SDK sits ​

Three packages cooperate. Only the first is this one.

PackageOwnsMust not own
@korus-dev/agent-ui-sdkVue conversation controls, session and controller composition, host capability contracts, optional Electron, speech and browser adaptersProvider execution, protocol handling, authentication, navigation, persistence
@korus-dev/multi-agent-sdkHarness sessions for Codex, Claude, Cursor and Antigravity: neutral state, capabilities, requests and promptsUI
@korus-dev/codex-sdkThe raw Codex protocolNeutral session semantics, UI

Release order follows the dependency order: codex-sdk, then multi-agent-sdk, then agent-ui-sdk.

One package, several entry points ​

The package has explicit, extensionless exports so that trusted code never ships to a renderer by accident.

EntryLayerTrust
rootVue controls, session composition, themes, providers, document panelsRenderer
/styles.cssControl styles and packaged fontsRenderer
/hostCapability contracts and prompt-option translationNeutral
/browser, /browser-ui, /documentsBrowser contracts, browser panel, file classificationRenderer
/electron, /electron/preloadTyped IPC, window policy, native capabilitiesMain process and preload
/electron/browser, /speechGuarded browser manager, speech sessionsTrusted process

A boundary test walks the emitted runtime import graph of the root entry and fails if it reaches Node, Electron, ws or provider execution modules.

Data flow ​

  1. The trusted host runs a harness session and receives neutral SessionState snapshots plus HarnessCapabilities.
  2. Your bridge carries the snapshot to the renderer and carries session-bound actions back. Identity stays in the host; the renderer holds opaque handles at most.
  3. createSessionConversationController projects the snapshot into ConversationPaneState and maps pane actions onto your client operations.
  4. ConversationPane renders from that state. Capabilities decide which controls exist; presentation flags decide which optional ones are shown.
text
Harness session ──snapshot──▶ your bridge ──▶ SessionState
                                                  │
        client operations ◀── controller ◀── createSessionConversationController
                                                  │
                                           ConversationPane

Snapshots are authoritative. Keep message identities stable across updates so settled Markdown, selection and scroll position survive streaming.

Capability-driven behavior ​

The UI never asks which provider it is talking to. It asks what the session can do:

  • Capabilities flags (steering, interruption, goals, plan mode, history, turn editing, approvals, models, skills, reasoning effort, service tier) enable controls.
  • capabilities.permissions lists the harness's own permission ids; the app supplies wording.
  • Catalogs for models, commands, skills, plugins, files and mention groups arrive as host-owned state.
  • Policy flags (attachEnabled, canForkTurn, canEditTurn, …) reflect host decisions.

Do not invent a universal model list, and do not map one harness's permission ids onto another's.

The renderer boundary ​

No raw provider payloads, Node primitives, filesystem paths, credentials or Electron objects need to cross into renderer code. Attachments are HostAttachment records whose reference is an opaque host capability, never a path. See the security boundary.

Optional adapters ​

  • Electron (/electron): registerNativeIpc installs validated handlers for attachments, clipboard, links, image previews and speech; installWindowPolicy keeps windows on the app renderer; typed IPC helpers carry your own session bridge.
  • Speech (/speech): Apple SpeechAnalyzer through a packaged universal helper, and OpenAI realtime dictation. Both consume mono Float32 PCM.
  • Browser (/electron/browser, /browser-ui): a main-process manager owns navigation, annotation and viewport policy for renderer-hosted webviews; the Vue panel is the UI.

Where code belongs ​

ConcernLives in
Rendering messages, composer, requests, toolsThis SDK
Running sessions, model catalogs, authentication@korus-dev/multi-agent-sdk
Navigation, titles, conversation listsYour application
Durable attachments, retention, draftsYour application
Authorization and policyYour trusted process
Diff views and treemapsYour application, over the document panels

Released under the Apache License 2.0.