Omni.UI.Sessions (Omni UI v0.1.0)

Copy Markdown View Source

Default Omni.Session.Manager shipped with Omni.UI.

Configure the store under the :omni_ui app and add the module to your application supervision tree:

# config/config.exs
config :omni_ui, Omni.UI.Sessions,
  sessions_base_dir: "/absolute/path/to/sessions",
  store:
    {Omni.Session.Stores.FileSystem,
     base_dir: "/absolute/path/to/sessions"},
  title_generator: {:anthropic, "claude-haiku-4-5"}

# application.ex
children = [Omni.UI.Sessions]

Start-time opts override app-env values, so a host app can compute config at boot when needed.

Consumers wanting multiple Managers (e.g. multi-tenant isolation) define their own modules — defmodule MyApp.Sessions, do: use Omni.Session.Manager, otp_app: :my_app — and pass them to Omni.UI.attach_session/2 via the :manager option.

Summary

Functions

child_spec(opts \\ [])

close(id)

create(opts \\ [])

delete(id)

list(opts \\ [])

list_open()

open(id, opts \\ [])

rename(id, title)

session_dir(session_id)

@spec session_dir(String.t()) :: String.t()

Returns the root directory path for a session's on-disk storage.

session_files_dir(session_id)

@spec session_files_dir(String.t()) :: String.t()

Returns the directory path where a session's user-facing files are stored.

start_link(opts \\ [])

subscribe()

unsubscribe()

whereis(id)