> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usechar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CharAgentShellElement

> Generated API reference for CharAgentShellElement.

# Interface: CharAgentShellElement

`<char-agent-shell>` custom element.

Opinionated host shell that composes a persistent inner `<char-agent>` and
owns responsive mode policy plus host layout orchestration.
This shell does not render chat controls, prompts, or composer UI.
Visible assistant UI is always iframe-owned.

Policy:

* closed to `pip`
* open desktop to `inline`
* open narrow viewport to `fullscreen`

## Extends

* `HTMLElement`

## Properties

### apiBase?

> `optional` **apiBase**: `string`

## Accessors

### open

#### Get Signature

> **get** **open**(): `boolean`

##### Returns

`boolean`

#### Set Signature

> **set** **open**(`value`): `void`

##### Parameters

###### value

`boolean`

##### Returns

`void`

## Methods

### attributeChangedCallback()

> **attributeChangedCallback**(`name`, `_oldValue`, `newValue`): `void`

#### Parameters

##### name

`string`

##### \_oldValue

`string` | `null`

##### newValue

`string` | `null`

#### Returns

`void`

***

### connect()

> **connect**(`options`): `boolean`

Connects shell authentication and starts availability health checks.

#### Parameters

##### options

`ConnectOptions`

Authentication payload (`publishableKey` + optional `idToken`).

#### Returns

`boolean`

`true` when connect is accepted by the inner element.

***

### connectedCallback()

> **connectedCallback**(): `void`

#### Returns

`void`

***

### disconnect()

> **disconnect**(): `boolean`

Clears authentication and disconnects the inner `<char-agent>`.

#### Returns

`boolean`

`true` when disconnect dispatch succeeds.

***

### disconnectedCallback()

> **disconnectedCallback**(): `void`

#### Returns

`void`

***

### setAuth()

> **setAuth**(`options`): `boolean`

Convenience method for declarative wrappers.
Applies auth when provided, otherwise clears auth.

#### Parameters

##### options

Auth payload to connect, or `null` to disconnect.

`ConnectOptions` | `null`

#### Returns

`boolean`

Result from `connect()` or `disconnect()`.

***

### setHostContext()

> **setHostContext**(`hostContext`): `void`

Merges and forwards host context to the inner `<char-agent>`.
Shell-owned fields (`displayMode`, `availableDisplayModes`) are ignored.

#### Parameters

##### hostContext

`CharHostContext`

Partial host context patch to forward.

#### Returns

`void`

***

### setOpen()

> **setOpen**(`open`): `void`

Sets shell open state.

#### Parameters

##### open

`boolean`

Next desired open state.

#### Returns

`void`

***

### toggleOpen()

> **toggleOpen**(): `void`

Toggles shell open state.

#### Returns

`void`
