channels library
What a panel inside a running app declares, and how it serves it.
Two halves of one vocabulary. The descriptors (PanelDescriptor and
friends) are pure data — a cockpit, fw and MCP all render from them, and
so does the in-app overlay, which is what stops the two surfaces drifting.
The serving side (Panels, Panel) turns a declaration into channels
and handlers on the app's InspectorCore, reached over the VM service.
Commands are PluginAction from package:flutterware/plugins.dart and
knobs are KnobDescriptor from the catalog's vocabulary — reused, not
re-invented, so an agent that has learned one flutterware surface has
learned this one.
No Flutter in here. The renderers live next door in
package:flutterware/channels_ui.dart, because everything that only wants
to talk to a panel is not a Flutter program: fw and the MCP server are
pure Dart entry points, and a library that pulled material.dart in behind
a PanelDescriptor would make them ones. A test pins that
(app/test/utils/entry_point_purity_test.dart), and it is what caught the
original single library.
Classes
- ActionOption
- One legal value of a ActionParameterKind.choice parameter.
- ActionParameter
- One argument of a PluginAction.
- FeedDescriptor
- An append-only stream of events — requests, queries, log lines.
- FieldDescriptor
- One value inside a feed event or a state snapshot.
- GuestChannels
- The app-side singleton: one core for the whole process, installed by the run guest, filled with channels by whoever has something to report.
- InspectorCore
- InspectorEvent
- One event received from an inspected process — replayed from its ring or live off its tail.
- InspectorPeer
- One attached peer, from the core's point of view: somewhere frames go.
- KnobDescriptor
- Panel
- One panel being served. Obtained from Panels.add, never constructed.
- PanelDescriptor
- Everything one panel offers.
- Panels
- Every panel one app is serving, over one InspectorCore.
- PluginAction
-
Something a plugin can do, offered identically to a button,
fw run, and an agent. - StateDescriptor
- A snapshot the app can be asked for — permissions held, package info, the device's own account of itself. State, not timeline.
- VmServiceTransport
Enums
- ActionParameterKind
- What a parameter accepts — the smallest vocabulary that lets a renderer build an input and an agent know what is legal.
- FieldKind
- How a renderer should read one value out of a payload.
- KnobKind
- What kind of control a knob is, which is what a panel switches on.
Constants
- channelExtension → const String
-
The one extension. Params:
peer(host-chosen id), optionalframe(a JSON-encoded request frame), optionaldetach. Returns{"frames": [...], "dropped": n}. - channelNudgeKind → const String
-
The nudge's event kind on the
Extensionstream. Its data is{"peer": …}and nothing else: it says pull, it does not carry the news. - panelKnobsMethod → const String
- panelsChannel → const String
-
Where the list of panels lives.
panels/listanswers with every descriptor; an event on the same channel means the list changed. - panelSetKnobMethod → const String
- panelsList → const String
- panelStateMethod → const String
- Methods reserved on a panel's own channel.
Functions
-
panelFeedChannel(
String panelId, String feedId) → String - The ring channel a panel's feed reports on.
Typedefs
-
InspectorCommandHandler
= FutureOr<
Object?> Function(Map<String, Object?> params) -
What a command handler receives and returns. A returned map becomes the
response payload as-is; anything else is wrapped as
{"value": …}. - KnobReader = Object? Function()
-
KnobWriter
= FutureOr<
void> Function(Object? value) -
PanelActionHandler
= FutureOr<
Object?> Function(Map<String, Object?> args) -
PanelStateReader
= FutureOr<
Map< Function()String, Object?> >