Skip to content

Editor Transport

probe ide serve lets an editor extension ask FlutterProbe for two things a person can already do by hand: lint an unsaved buffer, and list the connected devices. It is a child process that the extension starts and talks to over its standard input and output. It listens on no port, writes no token file and opens no window. The CLI reference has the same methods in a table; this page is for the people who write the extension.

Early. The first slice has two read-only methods. The protocol can change before it is marked stable, and each change is listed in the CHANGELOG.

Start the probe binary the person chose, with the workspace folder as its working directory, and write requests to its standard input:

Terminal window
probe ide serve

Close its standard input to stop it. It exits with status 0 when its input ends. Nothing except responses is written to standard output.

  • JSON-RPC 2.0, one JSON object per line, in UTF-8. There are no Content-Length headers.
  • A request has "jsonrpc": "2.0", an id (a string, a number or null), a method, and optional params. The response has the same id and either a result or an error.
  • A line with no id is a notification, and it gets no response.
  • Requests are answered one at a time, in the order they arrive.
  • A line may be up to 2 MiB. The text sent to lint_text may be up to 1 MiB.

Errors use the JSON-RPC codes:

Code Meaning
-32700 The line is not JSON.
-32600 The request is not valid, or its line is over 2 MiB. An oversize line is dropped, and the next line is read.
-32601 The method is not one of the two below.
-32602 The parameters are missing or wrong: a root that is not an absolute folder, or a path outside it, for example.
-32603 The work failed, for example the devices could not be listed. The message is one line.

Parameters:

  • root: the absolute path of the workspace folder. A file system root is refused.
  • text: the buffer’s text.
  • path (optional): the file the text belongs to, relative to root or absolute inside it. It need not exist. Without it, the text is linted as untitled.probe in root.

The lint reads the probe.yaml in root, as probe lint reads the one in its working directory. Its reads (use targets, CSV sources and the recipes folder) stay inside root. A use target outside it is not read, and the answer carries one warning for it. That warning’s text does not name the file.

Request:

{"jsonrpc":"2.0","id":1,"method":"lint_text","params":{"root":"/Users/me/app","path":"tests/login.probe","text":"before all test\n"}}

Response, shortened:

{"jsonrpc":"2.0","id":1,"result":{"findings":[{"line":1,"severity":"error","message":"..."}]}}

findings is always present, and a clean text gives an empty list. The findings come in the order probe lint prints them: reference errors, then program warnings, then reference warnings. A line of 0 means the finding has no line.

No parameters. The result is {"devices":[{"id":"...","name":"...","platform":"android","state":"online"}]}. os_version, transport and model appear when the device reports them. Every field is one line of text. The listing gives up after 60 seconds, and requests behind it wait for it.

  • Run a test, a recording, or a device action such as a tap, an install, a clear or a start.
  • Answer a confirmation, or accept --yes. Anything that asks a person is not part of this transport.
  • Listen on a port or a socket, or write a token file. It listens on nothing.
  • Make an update check. The check is off for probe ide serve.
  • Write to the workspace. The lint reads files and saves nothing.
  • Start it only in a workspace the person trusts, with a probe binary the person chose. A binary that a repository supplies is not one to run without the person’s consent.
  • Send only the text the person is editing. Do not write that text, or the answers, to a shared log.
  • Run one process per window, and close its standard input when the window closes.
  • Time out your own requests, too. list_devices has its 60-second limit, but lint_text has none.

The VS Code extension does not use this transport yet. It runs the probe CLI directly.