PhoenixAssets.DevIntelligence.TidewaveTools (PhoenixAssets v0.1.0)

View Source

Runtime introspection helpers for the asset pipeline, reachable from Tidewave.

Surfaces the dev-process state, recent logs, restart control, and a doctor run as plain functions. Nothing here registers an MCP tool -- Tidewave reaches them through its generic eval, the same way a developer would from iex. This is the one dev-intelligence integration the stack ships; the broader overlay, Tower, and BeamLens bridges are intentionally out of scope until a host needs them.

Opting in

The surface can restart OS processes and shell out to the doctor, so it is off until the host asks for it:

config :phoenix_assets, :dev_intelligence, tidewave: true

Every function returns {:error, :disabled} while it is off. Put the setting in config/dev.exs, next to config :phoenix_assets, :dev, enabled: true.

Summary

Types

Returned by every function here when :tidewave is not enabled.

Functions

Runs the asset-pipeline doctor against the configured preset.

Whether the host has opted into this surface.

Recent output lines for a dev process (:vite or :storybook).

Restarts a supervised dev process.

A snapshot of each supervised dev process's status, keyed by process id.

Types

disabled()

@type disabled() :: {:error, :disabled}

Returned by every function here when :tidewave is not enabled.

Functions

doctor(opts \\ [])

Runs the asset-pipeline doctor against the configured preset.

enabled?()

@spec enabled?() :: boolean()

Whether the host has opted into this surface.

Reads config :phoenix_assets, :dev_intelligence, tidewave: true.

logs(id, opts \\ [])

@spec logs(
  atom(),
  keyword()
) :: [String.t()] | disabled()

Recent output lines for a dev process (:vite or :storybook).

restart(id)

@spec restart(atom()) :: {:ok, pid()} | {:error, term()}

Restarts a supervised dev process.

status()

@spec status() ::
  %{required(atom()) => :running | :restarting | :down | :unknown} | disabled()

A snapshot of each supervised dev process's status, keyed by process id.

Enumerates whatever the dev supervisor actually runs (so custom presets and disabled processes are reflected), excluding the supervisor's own infrastructure children. Empty when the dev supervisor is not running.