@toon-protocol/rig 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,7 +17,7 @@ Git-to-TOON write path core — build git objects and NIP-34 events for the Rig
17
17
  ## `rig` quickstart
18
18
 
19
19
  ```sh
20
- npm install -g @toon-protocol/rig @toon-protocol/client
20
+ npm install -g @toon-protocol/rig
21
21
 
22
22
  # 1. identity — a BIP-39 seed phrase, either in your environment…
23
23
  export RIG_MNEMONIC="abandon abandon … about"
@@ -57,15 +57,22 @@ rig pr status <event-id> applied # kind:1631
57
57
  # (bare `rig status` is git's)
58
58
  ```
59
59
 
60
+ ### Strict `--json` stdout (machine consumers)
61
+
62
+ With `--json`, stdout carries **exactly one JSON document** — everything human-facing (identity reports, deprecation nudges, migration hints, chain-selection rationales, discovery warnings, progress lines, even stray `console.log` output from dependencies) is routed to stderr, so `rig <command> --json | jq` always parses. Errors emit one machine envelope (`{"error": "<code>", "detail": …}`) on stdout with the human detail on stderr and a non-zero exit; runs that fail before producing output (usage errors, pre-payment refusals) still emit a backstop error envelope. `--json` is a per-subcommand flag on the commands rig owns, **not** a global rig flag — see the passthrough note below.
63
+
60
64
  ### Git passthrough
61
65
 
62
66
  Any subcommand rig does not own is executed as `git <args...>` verbatim: the exact argv tail is handed to the system git with `stdio: 'inherit'` (interactive commands, pagers, colors, and prompts work), and git's exit code is rig's exit code (a child killed by a signal maps to the shell convention 128+N). rig-owned verbs always take precedence — in particular `rig push` is the TOON transport and shadows `git push`; plain-git pushes remain available by calling `git push` directly. If no system git is installed, passthrough fails with a clear error (exit 127).
63
67
 
68
+ The passthrough is exempt from the `--json` contract: `rig status --json` runs `git status --json` (git rejects the flag), and flags before the subcommand (`rig --json status`) are not rig's either — the whole argv passes through to git untouched.
69
+
64
70
  ### Identity
65
71
 
66
72
  The CLI is **standalone-only**: it embeds its own payment client built from
67
- your seed phrase (install the optional `@toon-protocol/client` peer to use
68
- it). The mnemonic is resolved along one precedence chain — highest first:
73
+ your seed phrase (`@toon-protocol/client` is a regular dependency, installed
74
+ automatically with the package). The mnemonic is resolved along one
75
+ precedence chain — highest first:
69
76
 
70
77
  1. `RIG_MNEMONIC` environment variable
71
78
  2. `TOON_CLIENT_MNEMONIC` environment variable — deprecated alias, warns on