Install a pinned @larksuite/cli with the plugin, register its bin
directory as a private Shell PATH contribution, and publish the CLI's
embedded skills with DSH guidance for setup and sign-in in the
conversation through the shared default CLI account. Repository
installs deny the CLI's binary download; profiles that install the
plugin approve it through Plugin Manager.
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.
The set of auto-opened links lived as long as the connection, so a later
operation offering the same device page never opened it. A rejected start
kept following the operation of an earlier start, which went on opening
its links and reporting its success after the page's latest action failed.
The followed operation now carries its own opened links. Each start
attempt drops the operation followed before, an accepted start follows
the returned one, and the stream's result for it ends the following.
`retry()` claimed the reopen only after awaiting the stopped stream, so a
second retry or a disposal in that window still subscribed a stream that
nothing released. A start that answered after disposal, or a view the
stream yielded just before it, still opened the operation's link.
`retry()` now clears `stopped` before the reopen awaits, and the reopen
subscribes only while the page is live. A start answer and a stream item
that arrive after disposal are dropped.
The Web shell links ui-cli-account statically, and webworker-runtime
reaches the Web shell from the Host aggregate. ui-cli-account referenced
the api-remotes Client project, so the Host compiler compiled Client code
that imports generated /remote modules before the Typert step had written
them, and the build failed. ui-cli-account needs only the Gateway's
`ctx.remote` declaration, so it drops the api-remotes import, project
reference, and development dependency. The event matrix no longer counts
terminal-controller, whose Client listener the Host program reached only
through that path.
Client feature packages may not request another row's runtime values through dsh.client.external, so the shared pieces become a static library the shell seeds into its module table, like ui-dockkit. Plugins import the package root, the web-app row is gone, and the badge takes a structural subject instead of importing the Plugins page types.
The config catalog reads a plugin's imported schema only from the entry file it resolves to, so CLI app plugins can now use CliAccountConfig as their Config.
Register both packages with the README, Model Experience, and product-package gates, and regenerate the config catalog, module graph, and composition reference.
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.
Port the Feishu page connection specs to the kit's connection mirror and
cover the section, tag, activation prompt, confirmation, and notice against
the shared dictionary keys.
Port the Feishu CLI runner specs to the kit executor and cover the account
runtime through a scripted fixture account: one operation at a time,
phase-gated cancellation, trusted links, classified failures that never log
exception text, the follow stream, and disposal.
The section labels its status from the plugin's `status.*` keys unless the
plugin passes a step label for an operation in progress. The notice
translator no longer narrows the toast's notice type.
CLI plugins translate one shared key set, CliAccountKey, for the section
title, hint, tags, activation prompt, confirmation buttons, and failure
diagnostics; the components read those keys through the plugin's
translator, so the plugin passes only its own text. The section takes its
buttons and extra rows as data and disables them while an action is pending
or the Host stream is down.
Client plugin bundles may not inline another plugin's values, so the client
kit becomes a client row that CLI plugins request through
dsh.client.external. The web app mounts the row once, as it does for other
shared Plugins page surfaces, and the plugins import its components and
connection mirror from the module table. Add the package manifests,
TypeScript projects, and path mappings for both kit packages.
Run account commands through CliOperationControl.run so the runtime records
the plugin's classification of each command result. A failed operation logs
only that classification at error level and returns it in the result;
exception messages and native output, which may contain credentials, are
neither logged nor returned. exitFailure classifies by exit code alone.
CliAccountConnection mirrors a plugin's account view, opens the
authorization link once in the browser that started the operation, and
reports outcomes; the section, tag, activation prompt, confirmation, and
notice components render a plugin's six display phases with the copy the
plugin translates. Each plugin keeps its own presentation and dictionary.
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.
* fix(forge): make reference and worktree tests portable
* test(worktree): cover error and text cancellation reasons
* test(forge): brace void arrow bodies in the reference lookup spec
* test(ci): expect the joined version script path in the pre-merge check
---------
Co-authored-by: imccyu <[email protected]>