CLI app plugins now give the model each CLI's absolute path in required
runtime context instead of putting the CLI on a private Shell PATH.
- registerCliPathContext registers the path at the new PLUGIN_CLIS
context order without interpolation. With `scripts`, it also tells
the model to prefix only the commands that run the skill's scripts
with PATH="<dir>:$PATH"; with `ready`, it contributes nothing until
the CLI is installed.
- CliCommandExecutor takes the absolute `executable`, verifies it
through the subprocess runtime, and spawns it without preparing an
environment, so the kit no longer depends on shell-env.
- An Agent Note records the decision and the rejected private PATH,
paths in skill text, shared registry, and Host check.
A descendant that inherits the CLI's stdout or stderr keeps the pipes
open after the CLI exits. The executor waited for both pipes to end, so
such a command hung until its deadline and reported a timeout, or hung
indefinitely, even through cancellation and disposal, when the
descendant had left the managed process range. A reader failure, such as
an `onLine` throw, left the other reader running, so `onLine` could be
called after `run` rejected.
The executor now waits for the exit and reads the pipes for at most 2
seconds after the subprocess runtime reports it, keeping the output read
before the cut. On every path it terminates the command and stops both
readers before it settles, so every `onLine` call precedes the result.
The executor's module and class comments and the README now state that
its subprocess runtime must run on the Host, and `run` lists executable
lookup, spawn, and `onLine` failures among its rejections. The README and
`authorizationHosts` state that hosts are lowercase ASCII with punycode
IDNs. `CliCommandFailure.exitCode` lists every failure that leaves it
null, and `CliAccountBadge` names the bundle and row pages it renders on.
The line buffer grew without limit and filled even without an `onLine`
observer, so a CLI writing output without a newline during the 10-minute
authorization wait bypassed the 1 MiB and 4 KiB output limits. A line the
CLI ended with a lone `\r`, as a link followed by a redrawn spinner,
reached the observer only at exit. The stderr tail was cut in UTF-16 code
units, so multibyte output kept up to three times 4 KiB and could split a
surrogate pair.
Lines are now split only for an observer, end at `\n`, `\r\n`, or a lone
`\r` as in Node's `readline`, and a line longer than its stream's limit
is skipped whole. The stderr tail keeps the last 4 KiB of UTF-8 bytes from
a character boundary.
Document the executor's deadlines and output limits, the runtime's
one-operation, phase-gated cancellation, trusted-link, and classified-failure
contracts, the shared config fields, and the client mirror and components.
CLI app plugins run a third-party CLI that owns the user's account and let
the Plugins page check, connect, and cancel through a Remote. Extract the
mechanism the Feishu plugin introduced: CliCommandExecutor runs one command
on the private Shell PATH with a deadline, an output limit, and line
callbacks; CliAccountRuntime runs one account operation at a time, offers
authorization links on the plugin's trusted hosts, cancels only in the
phases the plugin declares, logs failures, and streams the account view.
Each plugin keeps its own commands, parsing, and states.