# `MingaEditor.State.Workspace.RemoteSession`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/state/workspace/remote_session.ex#L1)

Durable remote session identity for an agent workspace.

Workspaces own remote identity. Tabs may project this data for display, but lifecycle code should read the workspace copy so reconnect and teardown still work when a file tab is active or the agent tab has been closed.

# `connection_status`

```elixir
@type connection_status() :: :connected | :disconnected | :ended | :unavailable
```

Remote connection status.

# `t`

```elixir
@type t() :: %MingaEditor.State.Workspace.RemoteSession{
  connection_status: connection_status(),
  last_seen_event_id: non_neg_integer(),
  server_name: String.t(),
  session_id: String.t()
}
```

Durable remote session metadata for a workspace.

# `matches?`

```elixir
@spec matches?(t(), String.t(), String.t()) :: boolean()
```

Returns true when the remote metadata points at the server/session pair.

# `new`

```elixir
@spec new(String.t(), String.t(), connection_status(), non_neg_integer()) :: t()
```

Creates durable remote metadata.

# `server?`

```elixir
@spec server?(t(), String.t()) :: boolean()
```

Returns true when the remote metadata belongs to the server.

# `set_connection_status`

```elixir
@spec set_connection_status(t(), connection_status()) :: t()
```

Updates the connection status.

# `set_last_seen_event_id`

```elixir
@spec set_last_seen_event_id(t(), non_neg_integer()) :: t()
```

Updates the last seen event id.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
