Repository navigation
Conversation
… a built-in plugin Add plugin-api with its five entries, the plugin host and the built-in plugin list under bootstrap/plugins, and generic registries for error codes, capability predicates, follow-ups, help groups and per-network extension blocks. GasFree now lives in plugins/gasfree and registers through the host; it signs through the signing service with origin "service" and never receives a signer. An unknown first word now suggests the plugin commands. Help, --json-schema, envelopes and exit codes are otherwise unchanged. Dependency-cruiser and ESLint rules cover the plugin directories.
…untime - Snapshot what a plugin declares when the host accepts it, check the whole batch against the target registries before publishing, and refuse inherited wallet-management fields. - Evaluate plugin capability predicates on every configured network before publishing, so a throwing predicate fails only its plugin. - Fail a registration on any refused declaration, even when the plugin catches it; a refused bulk declaration stages none of its entries. - Move plugin error codes and follow-up spellings into tables owned by the composed runtime; the catalog, exit codes and message spelling read them. - Allow the ERC-8004 and x402 SDK wrappers at their plugin-layout paths.
… plugin SDK - plugin install | list | update | remove: sources are a short name, an npm spec with an exact version or dist-tag, a directory or a .tgz. Registry downloads are checked against their SHA-512 integrity value before they are read; npm is never run. Six new error codes and the pluginRegistry config key. Install output and help carry the trust notice. - The store keeps <home>/plugins/<name>/active.json and immutable versions/<id>/ directories; replacing active.json under the store lock is the commit point. Tarballs are read in memory with size limits, and links and entries that leave the package root are refused. - The loader reads every manifest, imports a plugin only for its own group, --json-schema and plugin list, checks its definition against the manifest, and contains every failure to that plugin. Root help lists installed groups from the manifests. The host publishes its API object before the first import, and envelopes of installed-plugin commands carry meta.plugin. - plugin-sdk builds standalone type declarations of the five plugin-api entries, runtime modules bound to the host object, and a stamp tool for the manifest's API numbers. - The qaprobe fixture plugin, built only against the SDK, with variants for the failure cases; unit tests for store, tar, registry, service and loader; golden tests against a local registry stub. - Host services gain contracts.tron/evm call and send, and message signing.
…, and a test API - tronCalls runs one TRON contract call through the transaction lifecycle: the transaction mode, the fee limit, whether the fee can be estimated yet, the multi-signature preflight, a required confirmation, onDispatched with the txId before the node answers, and onSubmitted before the confirmation wait. - The TRON gateway facade gains getAccount, getTransactionInfoById, receivedAmount and triggerConstantContract; tokens gives the token book's official and account layers; networks gives the configured aliases. - plugin-api re-exports the value, error, execution, text and schema helpers that feature code imports, and the host's Zod for HTTP response checks. - The plugin SDK gains a testing entry: one bundle that publishes the real plugin API in a test process and exports the core pieces plugin tests construct. - received-amount names native TRX by the TRON zero address directly.
…ries testing.d.ts now shares its declarations with the other SDK entries, so a core class from the testing entry is assignable to the matching host service type of the application entry.
SunSwap and SunPump are now the installed plugins sunswap and sunpump, built in their own repository against the plugin SDK. The core no longer registers their commands, error codes, follow-ups or capability predicates, ships no sunswap or sunpump network defaults, and no longer merges or validates those config.yaml blocks: they reach the plugin as written. The sun-sdk dependencies, the command pages and the helpers only these features used leave with them. Tests that only mentioned the features are adjusted; the shell refusals that only plugin commands declare are tested on demo commands, and the reserved view key on the fixture plugin.
…late predicates - The loader inspects and registers an imported definition inside the per-plugin failure boundary; a throwing getter marks that plugin broken and the others load. - The definition must match the manifest's group name, summary, description and families. - A capability key recorded before its installed plugin's predicate was known takes that predicate's answer at the next registration, in the gate and in discovery.
…n sources - The store makes the new version directory and every directory it created durable before it replaces active.json, reads active.json through one opened handle, and marks failures after a commit point as committed. - Install, update and remove report a failure after the commit point as the change it is; update with no name carries it in the plugin's result. - An update is refused when the plugin was replaced while it was fetched. - Directory sources bound package.json and entry reads before allocating. - The tar reader validates each whole path and refuses mixed top-level directories. - A tarball HTTP 429 reports provider_rate_limited. - plugin install reads native absolute paths, bare .tgz names and npm:<name> specs. - plugin list reports a built-in plugin that failed to register as broken.
…missions - read, sign and transfer are bound for TRON and EVM; read reports the selected network and account address. - inspect reports whether any value reachable through its context and services equals a canary private key, mnemonic or password, reports the signatures and submissions the controlled fixture observed for the last transfer, and signs with --sign. - The golden test runs transfer through the host's TRON lifecycle against a controlled local node: dry run, build only, sign only, wait, no wait, a reverted receipt and a lost submit reply.
…on every publication - The active manifest and package readers open non-blocking, so a FIFO is refused by the handle's regular-file check instead of blocking the open. - Every publication syncs the links of plugins/, the plugin directory and versions/ before active.json is replaced, including directories left by an earlier failed attempt. - The fixture test searches its output for the raw private keys, with and without 0x; the plugin still receives only their digests.
The 8004 commands, the agent use case and ports, the registry, revert and registration adapters, the Agent formatters, the capability predicates and the error code now live in plugins/erc8004 and register through the plugin host for both families. The plugin reaches EVM receipts through a gateways overload that exposes only getTransactionReceipt, and plugin-api re-exports the helpers the moved code uses.
x402 and B.AI become the built-in plugins x402 and bai under src/plugins/, registered after gasfree and erc8004. bai uses the x402 service through x402/api.ts. Both move together because the core cannot import a plugin and the core B.AI code depended on x402. - Plugins sign through the signing host service and submit through tronCalls; the x402 server lifecycle uses the lifetime service. - New host members: signing.prepare, gateways.client, the EVM getErc20Balance read, networks.resolve, lifetime and accounts. - The daemon child receives its time limit as a global --timeout. - The shell's x402 provider special case is the command field rejectsGlobals. - The x402.serve and bai.recharge predicates and default tokens move into the plugins. - depcruise: a plugin's application and inbound layers may import the api.ts of a plugin it depends on.
The 20 codes that only one plugin uses leave the core table: gasfree, erc8004, x402 and bai each declare theirs. Codes shared by the core and a plugin, or by two plugins, stay in the core table, including gasfree_credentials_missing, payer_mismatch and invalid_x402_response. --json-schema lists the same codes with the same entries; the moved codes now follow the core codes, in plugin order. The error-code index tests check the core table plus the built-in declarations, and that no plugin declares a core code or another plugin's code.
Expose ./testing only under the wallet-cli-testing export condition, refuse to load it in a process where wallet-cli published its plugin API, and document how plugin tests opt in.
The test no longer rebuilds plugin-sdk/dist, which other golden files read in parallel. build-plugin-sdk.mjs takes an optional output directory; the default is unchanged.
…index The exit-code tables of machine-interface.md no longer list the codes of installed plugins, so a code that is in a table and not in the index is an error again. Also drop a comment in network.ts that described the removed SunSwap settings.
…dded for the built-in plugins
… broken plugin is an unknown command
- sleepWithin succeeds only after the whole interval; a timer cut to the deadline that fires before the deadline's clock expires no longer ends the sleep with success. - plugin update reports plugin_conflict when the plugin was removed while its update was being fetched. - The unknown-command hint names the first word the user typed, worded as a condition. - plugin list text has a SOURCE column after KIND. - qaprobe: read requires --value, and qaprobe_refused exits 1.
…gin list The plugin list examples are captured again from the built CLI. The unknown-command example quotes the new hint, list.md says the integrity value is in the JSON output only, and update.md says to install a plugin again when it was removed during its update.
sleepWithin decides that its interval has passed from a monotonic clock, not from the sum of timer delays. After a step cut to the deadline's remaining time finds the deadline not expired, the next step is at least 25 ms, so a paused deadline with a sub-millisecond remainder cannot cause thousands of wakeups or end the sleep early.
… deadlines sleepWithin(deadline, ms) is the plugin API signature again; its clock is private and the tests fake performance. The 25 ms minimum step applies only when the deadline's remaining time did not shrink since the previous cut step, so a disposed deadline is found expired when its remainder is over, not up to 25 ms later.
The stream writer masks every configured credential in everything it writes to stdout and stderr: results, text output, warnings, progress events, log lines, discovery output and errors. It covers the raw, the JSON-escaped and the terminal-escaped form of each value. The error formatter and the internal-error path no longer mask on their own.
…ror codes A plugin lists the configuration keys it reads in `credentials`, in its definition and in its package manifest. The manifest list is validated at install, stored in active.json, and compared with the definition before registration. `config.credential(key)` fails for a key the plugin did not declare. A key the core reads itself is refused. The installed manifests are read once, before the configuration, and the declared keys are read from config.yaml with the rules of the core credentials: stdin only, masked, mode 0600. `config` lists a key while a built-in plugin or an installed plugin with a readable manifest declares it; a key several plugins declare is listed once. GasFree, x402 and B.AI declare their keys. gasfree_credentials_missing, invalid_x402_response and payer_mismatch leave the core table; each plugin that can raise one declares it with the same entry. The qaprobe fixture declares qaprobeApiKey and gains a credential command.
…nifest The stream writer now masks a JSON frame by token: a credential inside a string, key or value, is replaced in the decoded string and the string is encoded again, and a number, true, false or null equal to a credential becomes the string "********". A frame without a credential is written unchanged. Callers say which frames are JSON. Text output is masked as before, now also in the form an error value takes on one line. An installed plugin may read only the credentials of the manifest it was loaded with; the module's own list is read once, for the comparison. The last-resort report uses the masked streams once they exist.
The manifest comparison reads the module's credentials property once. The mask also covers a credential's JSON-escaped spelling with every / written as \/, as some JSON encoders write it.
x402 holds copies of the GasFree network table and lookup, the two GasFree credential declarations and the gasfree_credentials_missing entry, and resolves the GasFree Open API of a network itself. gasfree/api.ts is deleted. A host test registers each built-in plugin with no other plugin registered.
…etween plugins B.AI holds a copy of the x402 code its recharge reaches, at the same paths under plugins/bai/, with its tests; domain/errors.ts and application/capabilities.ts are copied as x402-errors.ts and x402-capabilities.ts, and the capability copy keeps only the default token. B.AI builds the x402 service in its own index.ts and declares the GasFree keys and every x402 and GasFree code its copy raises. x402/api.ts is deleted and x402 builds its service in index.ts. The x402 test cases that drove B.AI's recharge flow now live only in B.AI's copies. The copied payment client and its tests join the known-violation baseline of the x402 payment-module rule, as their sources are.
…n repository The GasFree, ERC-8004, x402 and B.AI plugins are now built and tested in their own repository and installed with `wallet-cli plugin install`. Without them, their command groups fail with `unknown_command` and the generic install hint, and their credential keys are unknown to `config`; values already in config.yaml stay in the file. - Remove src/plugins and empty the built-in plugin list. - Remove the dependencies only those plugins used: @bankofai/8004-sdk, the four @bankofai/x402 packages and their override, and wrap-ansi. - Move their command pages and the parts of the machine interface, the config page and the guides that describe them. - Move their golden tests; rewrite core tests that used them as an example onto demo commands, groups and credential keys. - Export more core test seams from the SDK testing entry for the moved tests. - Drop the depcruise baseline entries of the removed files.
walletCli.plugin.sdkVersion is a semver range in the syntax of package.json, and the core loads a plugin when its own plugin SDK version satisfies that range, as npm's semver library decides with default options. The core adds no rule of its own. A blank value stays invalid, and the declared string is stored and printed as written. An incompatible plugin names the declared range and the core's SDK version. The message and error.details name the side to update when the core's version is below the whole range (wallet-cli) or above it (the plugin); in a gap of the range they name no side. The error code, its retry and exit class, and the incompatible state of plugin list do not change. An exact version now means that version only. The stamp tool writes ^<major>.<minor>.0 of the SDK it ships in (^1.1.0 for SDK 1.1.x) and needs no new dependency. semver becomes a direct dependency at the version Ledger already pins, stays bundled, and joins the allowlist of rule 1.5; rule 9.7 states the range rule. The plugin's own version keeps the strict semver pattern.
The allowlist of rule 1.5 matched node_modules/ anywhere in a path, so a scoped package such as @node_modules/semver or @other-node_modules/semver passed as semver. node_modules now has to be a whole path component; the firing test refuses both lookalikes. The SDK README's opening paragraph, the comment of the SDK build script, the plugin list and update pages and the plugin guide still described the build version and the major/minor rule; they now describe the declared range. The stamp test adds SDK 2.3.4, so a constant stamp fails it, and a padded range is read, stored and listed as written, so trimming it fails three tests.
A plugin command now has one shape with one run. With families, a list such as ["tron", "evm"], it is a ChainCommand: the core resolves the network before run, and every declared family is bound to the same run; familyFields gives a declared family its own extra fields and refine. Without families it is a NeutralCommand whose network is "none" or "optional". TypeScript types the network of run from whether the literal names families. The host translates both cases into the core's CommandDefinition, or one ChainSpec with a FamilyBinding per family; the core's command model does not change, and the validation order of each case stays as it was. The host checks the whole declaration before it adds any of it, and refuses: a missing run or one that is not a function; families that are not a list, empty, or name an unknown family or one family twice; no families and a network other than "none" or "optional"; a field of the other case; familyFields that are malformed or name a family the command does not declare. The checks for "both run and families", "neither" and a family handler without run are gone. The qaprobe fixture and the README example use the new shape. BREAKING CHANGE: RunCommand, FamilyCommand and FamilyHandler are removed with no alias; ChainCommand and NeutralCommand are exported beside Command from /cli. All are types, so the runtime export-name snapshot does not change; the SDK version stays 1.1.0.
The host took any value whose shape was an object as a schema, so
familyFields.tron.fields of { shape: null }, { shape: [] } or
{ shape: { memo: 42 } } registered and failed later when the command was
parsed. Family fields and the command's own fields must now be Zod object
schemas, and the command's refine a function.
familyFields was checked over its own entries but bound by property
lookup, so an entry inherited from a prototype reached the registry
unchecked. familyFields and each of its entries must now be plain
objects, and the bindings use a record rebuilt from the entries that
were checked; an undefined entry still means no extra fields or checks.
Tests cover each case through host.command and through addCommand of
/testing, with the registry unchanged after each refusal.
The SunSwap and SunPump packages now live in sun-protocol/wallet-cli-plugins. The plugin list table shows the new source directory, and the JSON examples of plugin install and plugin list are recaptured from a run of the current build against the new directory.
The SunSwap and SunPump packages are now @sun-protocol/wallet-cli-*-plugin and the GasFree, x402, B.AI and ERC-8004 packages @bankofai/wallet-cli-*-plugin. None is on npm yet, so the README and the plugin guide link the two plugin repositories and show an install from a checkout first, captured from a run, and an install by name as the way once a package is published.
plugin install now takes an npm package name, with an optional exact version or dist-tag, fetched from the pluginRegistry config key and checked against the registry's SHA-512 integrity value. A package directory, a ~ or absolute path, and a .tgz or .tar.gz archive are refused as invalid_value (exit 2) before anything is read, and the message names the package-name form. plugin update keeps its registry semantics: a pinned version stays, an unpinned one or a dist-tag moves. A plugin whose record names a local directory or archive is listed as broken with a reason to uninstall it and install it by name; plugin update reports it as failed and leaves it as it is, and plugin uninstall removes it. To install a plugin that is not on npm, or to test a build, publish it to a private or local registry and set pluginRegistry to it.
The Plugins section of the TypeScript README lists the six official plugins with their npm package and what each adds, and the plugin command row links the plugin guide.
The table of contents gains the Plugins section, the section opens with one line like the other command sections, and the Quickstart's topic links include the plugin guide.
The Plugins section lists the plugin command first, as the other command sections do, then the official plugins with the install form.
plugin install <name> without a version installs the latest dist-tag, as before, and now records and shows the source as <name>@latest, so every source in plugin install and plugin list output names its version or dist-tag. An exact version or a dist-tag is recorded as given. plugin update still moves latest and leaves an exact version. A record without a version still loads and updates, and is recorded with @latest when an update publishes a new version.
A package name that ends in .tgz or .tar.gz, given with a version or dist-tag (demo.tgz@1.0.0, @acme/demo.tar.gz@latest), is a registry package again, and a pinned record of such a name updates as unchanged. Input that itself ends in .tgz or .tar.gz is still refused. The install transcripts in the docs now show the integrity line every registry install prints.
A record whose spec has no version, written before 640114b, now reads as name@latest in plugin list text and JSON, and in every use of the record. The file is not rewritten and no version directory is created. A stored spec that is not a package spec reports the plugin as broken.
…uide Root README: the supported Node.js versions come from the TypeScript prerequisites instead of a wrong 20+, the prompt sentence names what prompts, the feature cells drop the unbounded claims, plugins are a link instead of a second list, and the TypeScript links include the plugin guide. TypeScript README: a short opening, Key features in the contents, accurate account and family wording, tx send covers EVM tokens, the queries section is named for what it holds, the Plugins section states the trust rule and that the official plugins are not on npm yet, the machine interface section has a plain name and lists import keystore as interactive-only, and the example note is limited to what it can promise. Guides: the index points at Getting started without filler; Getting started offers the password manager as an alternative, defines the password variable before using it, drops the stale faucet amount and timing, fixes the list sample, and links the plugin guide.
Without IFS=, read strips leading and trailing spaces, so a valid master password with them fails authentication when piped to tx send.
…k the trust rules The plugins guide links the official catalog instead of repeating it, and shows the registry setting before the first install command, so a reader of an unpublished plugin does not hit not_found first. Its link to the SDK README points at GitHub, because the npm package does not include that file. The plugin command pages link the guide's trust section instead of repeating it, and plugin install says that a source without a version is recorded with @latest. The command index no longer calls plugin install offline, and troubleshooting lists pluginRegistry among the config keys.
ts/plugin-template is the SDK README's hello plugin as files: manifest, register with hello greet and hello network, an esbuild build that keeps the four SDK runtime entries external, refuses the testing entry and stamps the SDK range, a Vitest setup with one test per command. The SDK README and the plugins guide link it instead of carrying copies.
npx would fetch an unrelated wallet-cli-plugin-stamp package from the registry when the SDK is missing; run the SDK's bin by its installed path.
…not type-check The SDK README no longer repeats the template's Vitest configuration, and it says that npm run build bundles and stamps while npm run typecheck checks the types.
The package is no longer private, publishes with public access and builds its dist before npm publish. The stamp bin path drops its leading ./, which npm 11 otherwise removes from the published manifest.
…he plugin commands
wallet-cli read the tar format with its own parser, so one tarball could hold one package for npm and another for wallet-cli: a single zero block, a GNU header's prefix field, and a pax size record were read differently. The integrity check covers the same bytes, so it did not notice. readPackageTarball now hands the tar format to node-tar (pinned 7.5.24), the parser npm uses, in memory. It keeps wallet-cli's own checks: size limits before and after gunzip, the entry limit, regular files and directories only, package paths under one top-level directory, and no duplicate paths. A second gzip layer, which node-tar would decode and npm would not, is refused.
…all differently readPackageTarball still let three archives through that npm extracts differently or that broke wallet-cli's own rules: - A path that is both a file and a directory, in either order and through implicit parent directories. Extraction lets the directory replace the file or skips the later entry. It is now refused. - Empty metadata headers emit no node-tar event, so they escaped the entry limit. Every non-zero header block now counts, through the parser method node-tar calls for each header. - Entries that node-tar ignores (sparse, unknown types) skipped the type and path rules. They now go through them and are refused as a link or special file. Metadata over node-tar's size limit is still skipped, as npm skips it.
A path inside a plugin package must use only ASCII letters, digits and . _ - @ +, have at most 32 segments and 255 characters, and differ from every other path in more than case. Drive letters, colons, deep paths, non-ASCII names and case-only differences are refused instead of being read differently from npm's extraction. File/directory conflicts are checked once after parsing over sorted paths, so memory stays linear in the total path length. The entry limit counts node-tar's public entry, ignoredEntry and meta events; empty metadata headers are bounded by the unpacked size limit.
…in errors A regular file or directory whose pax or GNU long-link metadata sets a link target is refused: npm's extraction skips such an entry when the target escapes. Every message that names an archive path is built with errorMessage, so line separators in a path are escaped in text output, and a path longer than 200 characters is cut with a marker that gives its full length. A path segment inside a plugin package may no longer end with a dot or be a Windows device name (con, prn, aux, nul, com1-9, lpt1-9, with any extension).
The plugin SDK has never been published, so it starts at 1.0.0. The template, the qaprobe fixture, the docs and the examples declare ^1.0.0. Compatibility tests keep their cases against core 1.0.0: a newer minor is ^1.1.0, and an older pre-release (1.0.0-beta.1) replaces the older-minor refusal. The older-sdk-minor fixture variant is dropped, as SDK 1.0.0 has no older minor.
inputSchema.required now lists only what a caller must pass: a top-level field whose outermost schema is an unchecked default is optional and keeps its default. Every other field keeps its output-mode requiredness, and the schema stays closed to unknown flags. The catalog usage names positionals with the same text as the help Usage line, and a new positionals field lists them in argv order. Core and plugin commands share one usage builder.
plugin list already prints each plugin's state and reason, so the loader's "warning: plugin <name> is <state>" lines on stderr and in meta.warnings repeated them. The runner now drops those warnings for plugin list. --json-schema keeps them, because a plugin that is not ok is missing from its catalog.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Protocol features of the TypeScript CLI become plugins a user installs. A plugin adds a command group to the
same executable through one contract; the core keeps wallets, accounts, credentials, configuration, signing,
the transaction lifecycle and the chain-native commands, and no longer knows a feature's commands, options,
error codes or settings. wallet-cli ships no protocol feature and its source names none. Java is unchanged
except for the version: both implementations become 5.0.0.
own repositories against the same contract.
wallet-cli plugin install <package>,plugin list,plugin update [name],plugin uninstall <name>.What changes for users
wallet-cli plugin installwiththe package name of the SunSwap, SunPump, GasFree, ERC-8004, x402 or B.AI plugin brings the commands back
with the same options and outputs. Wallets, credentials and
config.yamlneed no change. Without itsplugin a group answers
unknown_commandwith a pointer toplugin listandplugin install, and the roothelp and
--json-schemado not list it.configgives the same pointer for a key such asgasfreeApiKeyuntil a plugin that declares it is installed; the value stays in
config.yaml.8004is namederc8004.wallet-cli 8004 showbecomeswallet-cli erc8004 show,for all eight commands, and the
commandvalue of their envelopes iserc8004.<verb>. There is no alias.Options, outputs, error codes and capability keys are unchanged.
bai rechargedoes not need the x402 plugin, and a GasFree payment ofx402orbaidoes not need the GasFree plugin.@scope/nameorname, with anoptional exact version or dist-tag). Without one, the
latestdist-tag is installed and the source isrecorded and shown as
name@latest. A directory or a.tgzis refused. The core knows no package scope andno short names. wallet-cli does not use npm for this, so the standalone executable needs neither npm nor
Node; it checks the registry's integrity value before reading a package and never updates a plugin on its
own. New configuration key
pluginRegistry, for a private or local registry.gasfreeApiKey,gasfreeApiSecretandbaiApiKeykeep their namesand their values stay in
config.yaml, butconfigknows a key only while an installed plugin declaresit. The help of
configlists the declared keys with each plugin's summary.meta.plugin: {name, version}; six new error codes(
plugin_conflict,plugin_not_installed,plugin_invalid,plugin_incompatible,plugin_integrity,plugin_load_failed); theunknown_commandmessage for an unknown first word names the install command;the commands and error codes of a protocol feature are in
--json-schemaonly while its plugin isinstalled. The core commands and the envelope are unchanged.
x402 servehas its own option for the time one request may take,--request-timeout <ms>(default90000, 0 for no limit). The global
--timeoutnow limits only the start-up of the server; a user who tunedthe request limit through
--timeoutpasses--request-timeoutinstead.Plugin Commands:, betweenManagement Commands:andCommands:. With no plugin installed the section is absent and the root help isunchanged. Group help, command help and
--json-schemaare unchanged.sdkVersion, as inpackage.json(the build writes^1.0.0; 1.0.0 is the first plugin SDK version). wallet-cli loads it when its own plugin SDK version is in therange, and an incompatible plugin's message names the range, this wallet-cli's SDK version and, when one is
sure to help, the side to update.
Design
ts/src/plugin-sdk/is the contract: the types a plugin implements, the host services it receives, andcurated helpers. Every export is part of the contract and pinned by a snapshot (architecture rule 9.7).
approve receipt) moved into the erc8004 plugin;
TxFormatters.txReceipttakes a caller's own rows, and thecore keeps only the general flag that an
approve(address,uint256)names an ERC-721 token id. The output ofthe
erc8004commands is unchanged. Help examples and core tests use a neutral plugin name.guarantee on every path, what only the core knows, and what the core needs declared for its own work. A
plugin brings its own clock, request timers and helpers.
walletCli.pluginmanifest of itspackage.json(name, groups,credential keys, the range of SDK versions it works with), as a VS Code extension is. Its entry module exports
one function,
register(host).ts/plugin-template/is a plugin to copy: two commands, a test for each, the esbuild build and the testingsetup. The SDK README links its files instead of carrying copies.
ts/plugin-sdkis publishable as@tron-walletcli/plugin-sdk: public access, andnpm publishbuildsits
distfirst.predicates; the core parses, runs, prints and sets the exit code.
host.command: itsfields, an optionalrefineand onerun.With
families(for example["tron", "evm"]) it is a chain command: the core resolves the networkbefore
run, andfamilyFieldsmay give a family its own options and checks. Withoutfamiliesitsnetwork is
"none"or"optional". The host turns each declaration into the core's own command forms,which the SDK does not export.
Pluginprefix (Host,Command,CommandContext,SigningService,Gateways, ...), as VS Code's extension API names its types: the package already says plugin SDK. Thecore keeps its own names for what is "of a plugin" from its side (
PluginLoader, theplugin_*errorcodes), and the testing entry gives the core types that the SDK narrows their own names
(
CoreSigningService,TronGatewayPort,EvmGatewayPort).and the core loads it when its own SDK version satisfies the range, as npm's
semverdecides; the core addsno rule of its own.
semveris a new direct dependency, resolved to the root 7.7.3 that Ledger already pins, so it adds noinstallation.
written (architecture rule 7.1, rewritten). The references to inputs and next steps that inbound used to
spell are gone from the core.
one repository may share source that each bundles.
masked) and names none of them; a plugin reads only the keys it declared. An error code that only plugins
raise is declared by each plugin that raises it, also when several do.
signinghost service, which passes through the one signing entry and its chain identity checks, and itsubmits only through host services that run the transaction lifecycle and the dry-run guard.
tar7.5.24), the tar parser npm uses, so wallet-cli readsthe files npm would install. Its own path rule is stricter: ASCII names, at most 32 segments and 255
characters, no names that differ only in case, no trailing dot or Windows device name, and no links. A
package outside the rule is refused with
plugin_invalid.taris a new direct dependency with five smalldependencies of its own.
<home>/plugins/<name>/as immutable version directories plus oneactive.json;replacing that file is the commit point of an install or update. A plugin that cannot be loaded affects no
core command and no other plugin.
@tron-walletcli/plugin-sdk(ts/plugin-sdk/, built bynpm run build:plugin-sdk).A built plugin imports the SDK entries
domain,application,cliandhttpby name, and the coreanswers those imports with its own objects through
module.registerHooks, the way VS Code servesvscodeto an extension. Errors, Zod and services exist once, in the core. The hooks are registered only when a
command loads a plugin.
npm run build:standalone, Node26.13.1); Bun is no longer used. The Ledger HID addon is embedded and loaded from a private temporary copy.
A plugin starts a detached process (
x402 serve --daemon) through a host service, in both builds.ts/docs/dev/rules/architecture.md.Also fixed
sleepWithin, the wait that confirmation polling and plugins use, could report a full wait when its timerfired a moment before the command deadline. It now measures the interval on a monotonic clock.
in a successful response had it printed. The stream writer now masks every write.
Size
dist/index.jsshrinks from about 2.8 MB to 1.9 MB. The x402 and ERC-8004 SDK dependencies leavets/package.json.Documentation
ts/docs/guide/plugins.md,ts/docs/commands/plugin/, thePluginssection ofts/docs/machine-interface.md,and the README. The command pages of the six protocol features and their parts of the machine interface moved
to the plugin repositories.
Verification
npm run depcruise,npm run typecheck,npm run lint,npm run format:check,npm run test:unit:282 files, 4289 tests.
4bc3a969, by independent QA, with the six plugins packed and served by a loopback registry: eachinstalled alone in an empty home by its package name (state
ok,name@latest, only its group, all 40command help pages, a live read where no key is needed); directories,
~paths,.tgz,file:andversion ranges refused with
invalid_valuebefore any request; exact versions, dist-tags and a name endingin
.tgzwith a version installed; a record stored without a version listed as@latestand leftbyte-identical by an unchanged update; records from a local directory or archive listed as broken and
uninstalled while the other plugins and the core kept working. The Node executable, with neither npm nor
Node on
PATH, installed, ran, updated and uninstalled one plugin of each repository and refused apackage whose integrity value did not match.
46aa11fa: the six published plugins read the same filesand bytes as npm's extraction; crafted archives (drive and colon paths, a newline in a path, a
400,000-character path, names that differ only in case, link targets, symbolic links, a path that is both a
file and a directory) are refused with
plugin_invalidand leave no plugin directory; text output keepseach message on one line and shortens a long path.
7d052bd0, by independent QA on Nile with a Ledger emulator: 962 cases passed;4 differ from the suite's expectation and wait for a product decision; 134 need funds, keys or networks the
run did not have.
npm run test:golden, in one isolated run at452a66f3: 9 files, 235 passed, 2 skipped. After thePlugin Commands:section,test/plugin-fixture.test.ts, the golden file that reads the root help witha plugin installed, passes alone (30 tests).
Plugin Commands:section: the root help with no plugin is byte-equal to the one before it; with thesix plugins installed, the three core sections are byte-equal to the help with no plugin, and the root
--json-schemais byte-equal to the one before it.f9ad3624, by independent QA: the root help, the root schema, the six group help pages and thehelp and schema entries of the 40 plugin commands equal the build before the command declaration and the
SDK names changed, on the npm build and on the executable, and the recorded plugin runs match it. The
author example of
ts/plugin-sdk/README.mdbuilds, installs and runs as written in a home with noaccount, on TRON and on EVM.
have the same schema entries and help, reading
8004aserc8004, exceptx402 serve(the--request-timeoutoption above);wallet-cli 8004 show 1answersunknown_command. 348 command cases ofthe regression suite that need neither funds nor a key were run on both builds in text and JSON, and
stdout, stderr, error code and exit code match except where a live quote, a timestamp or a rate limit of
the public node differed between the two runs; 31 core groups compared with no plugin installed.
plugincommands on the npm build and on the Node executable, 62 scenarios: installs from a localregistry by package name;
npm:name, a version range,node_modulesandfavicon.icorefused with no request sent; SDK version compatibility with the side to update named; arecord of the earlier store schema reported, uninstalled and installed again; a failed update with its results;
an update that changes only the manifest; malformed names refused.
register, whoseregisterthrows, or whoseregisteris asynchronous isbroken alone; the process ends normally and the other plugins and the core commands keep working. The
author example of
ts/plugin-sdk/README.mdbuilds, installs and runs as written.only their own group, and answer every command's help. Each built entry exports only
registerandimports only the four SDK runtime entries.
verify-standalone.mjspasses, the six plugins load,--json-schemathrough a pipe is complete (197,869 bytes), and
x402 serve --daemonstarts, answers 402 and stops.keep working.
as before the messages were rewritten as text, in text mode and in JSON mode.
--json-schemaentries and help; the differencesare the wording of
configandplugin list, which no longer mention built-in plugins.B.AI, their four group help pages and the 161 error codes are identical to the build before the move; the
end-to-end suite of the protocol plugin repository (the former golden tests of the four) passes against
this build, also with each plugin installed alone (197 passed, 100 skipped).
identical to
develop; that repository's end-to-end suite (212 cases) passes against this build.failure and rollback, concurrent management commands, broken and incompatible plugins, secret boundaries,
signing and transaction modes on a controlled node, the single-file binary on darwin-arm64 including the
detached x402 server, an upgraded home with the old credential keys, and masking of every credential on
every output path. A second pass, before the command declaration and the SDK names changed: each of the six plugins installed alone into an empty
home with all 40 command help pages and a read against the real service where none needs a key, the
request time limit of
x402 servein the foreground and as a daemon, and the single-file binary runningthe plugins a Node build installed.
Known limits
config.yamlafter its plugin was uninstalled is no longer checked or masked;nothing reads it.
A service that returns it in another encoding, interactive prompts, and an error raised while the
configuration file is being read are outside it.
by another plugin the user installs.
Before a release
@tron-walletcli/plugin-sdk1.0.0, then the release versions of the six plugin packages. Test builds0.1.0-next.1are on npm under thenextandlatesttags; they declare^1.0.0.sun-protocol/wallet-cli-pluginsandBofAI/wallet-cli-pluginspublic: the README's official plugintable links them.