@elgora/cli 10.2.0 → 12.0.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.
Files changed (3) hide show
  1. package/README.md +92 -40
  2. package/dist/cli.js +4055 -2853
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -33,16 +33,22 @@ answer.
33
33
  funds the new bounty. It reuses the saved approval for those bytes without
34
34
  another AI review, or reviews them first.
35
35
  - `poster:open-winning-submission` retrieves the finalized winning Submission
36
- for the funding Poster and decrypts it locally.
36
+ for the funding Poster, decrypts it locally, and saves it as one `.tar.gz`.
37
37
  - `check-challenge <bounty_challenge_md_path|->` checks structural conformance offline,
38
38
  returns an issue list and exits non-zero on failure. It needs no wallet or
39
39
  network and does not replace hosted semantic readiness review.
40
40
  - `spec-commitment` reproduces the challenge's `spec_commitment` offline.
41
- - `solver:submit` encrypts a Submission for the bounty's pinned Guardian roster
42
- and prepares or sends the exact ElgoraHub transaction.
41
+ - `solver:check <bounty_id> <folder_or_file>` runs the Submission check that
42
+ `solver:submit` and `guardian:open` also run, without submitting, and exits
43
+ 1 on any issue.
44
+ - `solver:submit <bounty_id> <folder_or_file>` packs a folder (subfolders
45
+ included) or a single file into one `.tar.gz`, encrypts it for the bounty's
46
+ pinned Guardian roster, and prepares or sends the exact ElgoraHub
47
+ transaction.
43
48
  - `guardian:judgeable` lists open bounties ready for Guardian review.
44
49
  - `guardian:open` signs the protected content read, then verifies and decrypts
45
- one exact Solver and Submission pair.
50
+ one exact Solver and Submission pair, extracts its tree into a new or empty
51
+ folder, and reports the Submission check's issues.
46
52
  - `guardian:verdict` publishes a written Verdict and records the same Verdict
47
53
  on ElgoraHub.
48
54
  - `guardian:deliver-key` wraps one Solver–Submission content key for delivery
@@ -55,35 +61,92 @@ answer.
55
61
  creates the small advisory `VerificationRecord` for a finalized bounty, which
56
62
  `GET /api/bounties/<bounty_id>` inlines.
57
63
 
58
- Run `elgora-cli help <command>` for exact arguments and environment variables.
64
+ Run `elgora-cli help <command>` for exact arguments, options, and secrets.
65
+
66
+ ### Which version a bounty needs
67
+
68
+ It follows the profile the bounty's challenge declares:
69
+
70
+ - `elgora_markdown_bounty_challenge_v1`: the latest release, at least 12.0.0.
71
+ - `elgora_markdown_bounty_challenge_v0`: CLI 11, which CLI 12 names when it
72
+ refuses such a bounty; `npx` runs it beside the installed release:
73
+
74
+ ```sh
75
+ npx @elgora/cli@11 poster:open-winning-submission <bounty_id>
76
+ ```
59
77
  Run `elgora-cli --version` to print the installed release's version; it is the
60
78
  version of the npm package or standalone binary in use, stamped in at build
61
79
  time, so it stays correct however the CLI was installed.
62
80
 
63
- ## Wallets and keys
81
+ ## Signers
82
+
83
+ Functional choices are options; the environment holds only secrets. A command
84
+ names any option it does not accept. `--signer` chooses how its one account
85
+ signs:
86
+
87
+ | `--signer` | Use | Settings |
88
+ | --- | --- | --- |
89
+ | `local` (default) | a private key | `ELGORA_PRIVATE_KEY` |
90
+ | `privy` | a Privy server wallet, e.g. an unattended Guardian | `--privy-wallet-id <id>`, optional `--privy-sponsor`; `PRIVY_APP_ID`, `PRIVY_APP_SECRET`, optional `PRIVY_AUTHORIZATION_PRIVATE_KEY` |
91
+ | `manual` | your own wallet tooling, so no key enters this process | `--signer-address <address>` |
64
92
 
65
- Posters use `ELGORA_POSTER_PRIVATE_KEY`. Solvers should normally use
66
- `--solver-address` and sign the emitted EIP-712 requests and prepared
67
- transaction with an external wallet; `ELGORA_SOLVER_PRIVATE_KEY` is an optional
68
- local testing convenience. Each emitted `typed_data` is in the
69
- `eth_signTypedData_v4` shape, with `EIP712Domain` in its types; for ethers v6,
70
- delete `types.EIP712Domain` before passing it to `signTypedData`. Claimants can
71
- use `--claimant-address`, or `ELGORA_CLAIMANT_PRIVATE_KEY` for a local test
72
- wallet.
93
+ `--signer-address` also checks the account any signer resolves to. The account
94
+ may be a plain key, a contract wallet (ERC-1271/6492), or an EIP-7702 account;
95
+ Elgora verifies every signature on chain.
96
+
97
+ ### `--signer manual`
98
+
99
+ For each signature or transaction the command needs, it writes a request file
100
+ and prints one line on stdout:
101
+
102
+ ```json
103
+ {"event":"signer.request_written","kind":"api_request_approval","request_path":"…/01-api_request_approval.request.json","response_path":"…/01-api_request_approval.response","expires_at":"…"}
104
+ ```
105
+
106
+ The request holds `kind`, `address`, `chain_id`, and one of `typed_data`
107
+ (EIP-712, `eth_signTypedData_v4` shape), `message` (hex bytes for
108
+ `personal_sign`), or `calls` (`to`, `value`, `data`). Sign or send it with your
109
+ own wallet, then write the signature, or the transaction hash(es) separated by
110
+ spaces, to `response_path` before `expires_at` (25 minutes for a signature, 60
111
+ for transactions). The CLI verifies each signature on chain and keeps
112
+ checking an answer that does not pass, so one refused during an RPC outage
113
+ still counts once the check succeeds. An unanswered transaction request ends in
114
+ `verification_pending`, since it may have been sent anyway.
115
+
116
+ ### Transactions
117
+
118
+ Commands send their transactions last. `--prepare-only` prints them as
119
+ `<event>.calls_prepared` (`chain_id`, `from`, `calls`) instead. A sent
120
+ transaction counts only once ElgoraHub shows its effect: the command prints
121
+ `<event>.recorded`, fails, or prints `<event>.verification_pending` and exits
122
+ 75 when it may be on chain but is not confirmed yet. Check ElgoraHub before
123
+ running it again; a second `poster:publish-fund` funds a second bounty.
124
+
125
+ The CLI checks only real transactions: their receipts and ElgoraHub, through
126
+ its RPC. It never talks to a bundler or paymaster and cannot resolve a user
127
+ operation hash or a Safe transaction id. A smart wallet's calls count once the
128
+ wallet hands back the hash of the transaction they were mined in; with
129
+ `--signer manual`, write that hash, and with `--signer privy --privy-sponsor`,
130
+ Privy reports it.
131
+
132
+ A local key funds a bounty with one USDC authorization (EIP-3009); any other
133
+ signer funds through `approve`, then `createBounty`.
134
+
135
+ ### Guardian keys
73
136
 
74
137
  Guardian commands use two different kinds of secret:
75
138
 
76
- - `ELGORA_GUARDIAN_ACCOUNT_PRIVATE_KEY` is the Guardian's Ethereum account key.
77
- It signs protected Submission reads, API writes, and `commitVerdict`
78
- transactions.
139
+ - The Guardian's account, as above. It signs protected Submission reads, API
140
+ writes, the roster key proof, and `commitVerdict` transactions.
79
141
  - `ELGORA_GUARDIAN_PRIVATE_KEYS_JSON` contains retained X25519 encryption keys.
80
- They decrypt Submissions and never sign transactions.
142
+ They decrypt Submissions and never sign. They stay local whatever
143
+ `--signer` is.
81
144
 
82
145
  A Guardian may retain old and new X25519 keys after rotating the public key for
83
146
  the same account. The CLI tries the retained keys locally so an earlier bounty
84
147
  can still use the roster and key it pinned.
85
148
 
86
- Never put private keys, decrypted artifacts, or raw Submission keys in command
149
+ Never put private keys, decrypted files, or raw Submission keys in command
87
150
  arguments, logs, or submitted files. Each command reads only the secrets it
88
151
  needs.
89
152
 
@@ -107,15 +170,16 @@ elgora-cli claim --network 84532 7 # the same, by chain id
107
170
  export ELGORA_CHAIN_ID=84532 # testnet for every run in this shell
108
171
  ```
109
172
 
110
- The chain's public RPC, the ElgoraHub address, the escrow token, and the subgraph
111
- endpoint are all defaulted from that chain id, so targeting Elgora's own
112
- deployment needs no other configuration. They stay individually settable:
113
- `ELGORA_HUB_ADDRESS`, `ELGORA_RPC_URL`, and `ELGORA_SUBGRAPH_ENDPOINT` override
114
- what the chain id resolved — a local anvil stack needs them, since its addresses
115
- change on every run. `elgora-cli help <command>` lists what that command reads
116
- and which values it defaults. Supply a complete, coherent configuration when
117
- targeting a deployment this CLI release does not know about, and do not mix
118
- addresses or endpoints from different deployments.
173
+ The chain's public RPC, the ElgoraHub address, and the subgraph endpoint are all
174
+ defaulted from that chain id, so targeting Elgora's own deployment needs no
175
+ other configuration. They stay individually settable: `--hub-address`,
176
+ `--rpc-url`, and `--subgraph-endpoint` (or `ELGORA_HUB_ADDRESS`,
177
+ `ELGORA_RPC_URL`, `ELGORA_SUBGRAPH_ENDPOINT`) override what the chain id
178
+ resolved — a local anvil stack needs them, since its addresses change on every
179
+ run. The escrow token is read from ElgoraHub. `elgora-cli help <command>` lists
180
+ the options that command accepts. Supply a complete, coherent configuration
181
+ when targeting a deployment this CLI release does not know about, and do not
182
+ mix addresses or endpoints from different deployments.
119
183
 
120
184
  The API follows the chain too: `https://elgora.ai` for `base` and
121
185
  `https://testnet.elgora.ai` for `base-sepolia`. Commands that use the public API
@@ -136,18 +200,6 @@ wallet, gets the same result a bounty page visit would — it reads that page's
136
200
  own `GET /api/bounties/<bounty_id>`. A bounty with no record yet fails with the
137
201
  reason the API gave.
138
202
 
139
- ## Solver custody
140
-
141
- `solver:submit --solver-address <address> <bounty_id> <artifact_dir>` prints an
142
- approval request whenever the API needs a signed write. Sign its exact
143
- `typed_data` value and return only the hex signature on stdin. The CLI then
144
- checks the pinned Guardian roster directly against ElgoraHub, verifies the four
145
- prepared `submit` values, and locally encodes the transaction for the same
146
- wallet.
147
-
148
- Without `--solver-address`, `ELGORA_SOLVER_PRIVATE_KEY` signs and sends the same
149
- requests locally. It is intended only for controlled testing.
150
-
151
203
  ## Development
152
204
 
153
205
  From the repository root: