@finchtech/cli 0.5.2 → 0.5.4

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 +33 -13
  2. package/dist/finch.js +1278 -868
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -10,13 +10,15 @@ For an existing private key, run `finch wallet use --file <PATH>` on a fresh ins
10
10
 
11
11
  CLI-authored EVM addresses accept canonical lowercase or valid EIP-55 input and are normalized to lowercase before request validation and transport. Invalid mixed-case and uppercase forms are rejected. Remote responses and Remote MCP plans remain strictly lowercase so normalization cannot change signed or hashed plan bytes.
12
12
 
13
- Valid remote Identity, Agent, Task, Skill, and OAuth errors are emitted in their original domain envelope with the remote trace ID. Local transport failures use `CLI_REMOTE_UNAVAILABLE`; malformed or contract-invalid responses use `CLI_RESPONSE_INVALID`. Locally synthesized failures use a null trace ID rather than impersonating a server trace.
13
+ Valid remote Identity, Agent, Task, Skill, and OAuth errors are emitted in their original domain envelope with the remote trace ID. Local transport failures use `CLI_REMOTE_UNAVAILABLE`; malformed or contract-invalid responses use `CLI_RESPONSE_INVALID`. Locally synthesized failures carry a local trace ID matching the secret-safe `finch_cli_local_failure` record on stderr. This identifies a local attempt, not a server request.
14
14
 
15
- Skill upload failures also retain the final `uploadBytes`, `uploadObjectKind`, HTTP `remoteStatus` (null when no response was obtained), and available allowlisted `remoteCode`, `remoteRequestId`, and `remoteTraceId` in the JSON-encoded `state`. Locally synthesized errors retain the existing null `reasonCode` and `traceId` contract; downstream evidence is labelled explicitly in `state`. These fields never include raw response text, upload filenames, credentials, or transport causes. `not_attempted` refers only to chain submission: storage may have accepted an object before a response was lost. Follow `contact_support` until the individual attempt is reconciled; another publication's status is not evidence about this attempt.
15
+ Remote MCP technical failures use stable public codes `API_CONNECTION_FAILED`, `API_TIMEOUT`, `API_RATE_LIMITED`, and `API_RESPONSE_INVALID`. Authentication and permission failures reuse the family codes (`UNAUTHORIZED`/`FORBIDDEN` for Skill and Task; Agent/Identity use their existing auth/scope codes). Unknown failures retain the family internal/store code. A technical code describes the reason, not whether a write executed: on an unknown write outcome, read the resource before deciding whether to retry. MCP text includes the available trace; protocol failures link the tool trace to the upstream trace in secret-safe diagnostics. Response-body socket failures and timeouts retain their category for JSON and Artifact downloads, separately from malformed JSON.
16
+
17
+ Skill upload failures also retain the final `uploadBytes`, `uploadObjectKind`, HTTP `remoteStatus` (null when no response was obtained), and available allowlisted `remoteCode`, `remoteRequestId`, and `remoteTraceId` in the JSON-encoded `state`. Locally synthesized errors retain null `reasonCode`; local `traceId` and explicitly labelled downstream evidence in `state` identify separate diagnostic boundaries. These fields never include raw response text, upload filenames, credentials, or transport causes. `not_attempted` refers only to chain submission: storage may have accepted an object before a response was lost. Follow `contact_support` until the individual attempt is reconciled; another publication's status is not evidence about this attempt.
16
18
 
17
19
  ZIP import failures return `AGENT_MARKET_REQUEST_INVALID`, exit code `2`, and `fix_request` before upload. The JSON-encoded `state` identifies `SKILL_SOURCE_ZIP_INVALID` and a `zipReason`: `archive_too_large`, `expanded_content_too_large`, `utf8_flag_missing`, `filename_encoding_invalid`, or `invalid_archive`. Size failures include `actualBytes`, `maxBytes` (10,485,760), and `sizeBasis`: `archive` measures the compressed input; `declared_expanded` is the cumulative uncompressed size declared by entries at the first limit violation, before decompression. A safely decoded root-relative entry `path` is included when available. Non-ASCII filenames require valid UTF-8 bytes and bit 11 in the ZIP headers; rebuilding with those flags preserves file contents. These import limits are independent of final upload admission.
18
20
 
19
- Publication intent HTTP failures identify the Session-owned `/api/v1/agent-cli/signing-intents/skills/<intentId>/prepare` resource in `remotePath`. Failures include `remoteStatus` and available safe correlation IDs. `responseIssue` distinguishes `transport_failed`, `body_read_failed`, `empty_body`, `invalid_content_length`, `response_too_large`, `invalid_json`, and `schema_mismatch`. Schema failures include at most eight `schemaIssues` with known field paths and validation keywords; an empty path means the response root or an unrecognized field, whose name is withheld. No response values, arbitrary property names, URLs, or raw causes are printed. Malformed success responses are rejected during `intent`, before signing or writing a pending-send marker. Use the returned recovery command for the same publication; the CLI never automatically retries intent requests or resubmits transactions. The fingerprint identifies the local recovery journal, not a server trace; use returned remote IDs to correlate server logs.
21
+ Publication intent HTTP failures identify the Session-owned `/api/v1/agent-cli/signing-intents/skills/<intentId>/prepare` resource in `remotePath`. Failures include `remoteStatus` and available safe correlation IDs. `responseIssue` distinguishes `transport_failed`, `body_read_failed`, `empty_body`, `invalid_content_length`, `response_too_large`, `invalid_json`, and `schema_mismatch`. Schema failures include at most eight `schemaIssues` with known field paths and validation keywords; an empty path means the response root or an unrecognized field, whose name is withheld. No response values, arbitrary property names, URLs, or raw causes are printed. Malformed success responses are rejected during `intent`, before signing or writing a pending-send marker. Retry the same publication command or use its saved recovery command; completed stages are checked on chain, and pending transactions are awaited before another attempt. The fingerprint identifies the local recovery journal, not a server trace; use returned remote IDs to correlate server logs.
20
22
 
21
23
  The CLI measures the exact final multipart request, including metadata and framing. At or below 4,000,000 bytes it posts that request to the inline upload route. Above it the object goes through the staged transport instead: the CLI asks for a signed URL, writes the bytes straight to storage, and has the server read them back, verify them and pin them, so the platform's 4,500,000-byte request-body limit does not apply. These MB thresholds are decimal. The per-object ceilings are enforced against the final object either way: 30 MiB (31,457,280 bytes) for a package, 5 MiB for a cover, and 3 MiB (3,145,728 bytes) for a manifest. The package ceiling is one shared constant, applied by upload admission, by the retrieval route, by this client before it uploads, and by this client when it downloads, so a package that publishes is a package that reads back. Repacking a compressed source ZIP may increase its size. Passing admission does not certify production upload success or authorize replaying a previously failed publication.
22
24
 
@@ -72,7 +74,7 @@ Skill preparations return `walletIntent.intentId`. With the updated CLI, run `sk
72
74
 
73
75
  `skill publish-submit --path <file-or-directory> --intent <intentId>` and `skill version-submit` retain local filtering, ZIP construction, packaging, encryption, upload and key custody. The server fixes the prepared business metadata and records each transaction stage once. `skill asset-upload --path <cover> --intent <intentId>` uploads a prepared public cover. `skill presentation-submit` is retired and refuses before wallet or network access. Use Remote MCP `skill_market_presentation_update` to save listing text, cover, demo video and detail tabs as database overrides without a transaction. Repeating an intent with a recorded transaction resumes confirmation. An unfinished publication requires its original protected material journal; restoring it preserves uploaded bytes and keys.
74
76
 
75
- Recover wallet results with `skill recover intent <fingerprint>` and publication material with `skill recover publication <fingerprint>`. Recovery preserves broadcast hashes and the publication pending-send protections. Old buyer journals are admitted only as receipt-only recovery after the server reconstructs and verifies their confirmed canonical transaction. Existing publication journals retain their conservative typed recovery path. A confirmed receipt or projected stage can replay without another signature/broadcast; preserve journals during projection lag.
77
+ Recover wallet results with `skill recover intent <fingerprint>` and publication material with `skill recover publication <fingerprint>`. Publication recovery checks chain facts and preserves known transaction identities to avoid duplicate gas. Old buyer journals are admitted only as receipt-only recovery after the server reconstructs and verifies their confirmed canonical transaction. Existing publication journals recover from chain state, including v4/v5/v6 records. A confirmed receipt or projected stage can replay without another signature/broadcast; preserve journals during projection lag.
76
78
 
77
79
  `skill download --intent <intentId> --out-file <new-file>` requires an active CLI Session for plaintext and protected content. It fetches the owned MCP delivery preparation, retrieves through the authenticated gateway, signs locally for protected keys, verifies the SkillRoot/files or historical ZIP hash, acknowledges delivery, and then creates an exclusive owner-only output file. Upload size/type admission, staged tickets, Oracle V2, Lit sealing and raw key locality remain unchanged. Each transaction is reconstructed from its explicit reviewed chain deployment and rejects different destinations, calldata, values, source commits or envelope tags.
78
80
 
@@ -134,14 +136,24 @@ journal contents are never printed.
134
136
  Publication failures report `retryable` and `nextAction` according to the failure. A projection failure after confirmed transactions can be retryable; inspect `unconfirmedActions` before claiming the complete publication succeeded. This is not permission to replay a paid operation.
135
137
  `not_attempted` means no send was attempted in this invocation and no hashes were found in the
136
138
  validated journal; it is not proof about other invocations. `hash_known` includes known transaction
137
- hashes. `uncertain` means sending or durable checkpointing failed. For creation/version/key stages, contact support before retrying or
138
- recovering, even when a hash is shown. A non-null `recoveryCommand` is provided only after a journal
139
- is validated or saved and no submission/checkpoint uncertainty was observed. Recheck CLI/MCP identity
140
- and use that command rather than repeating publish-submit. Cleanup failures do not claim a journal
141
- still exists. If source is unavailable or its excluded-path inventory changed across CLI versions,
142
- the fingerprint-only recovery command can use the already stored publication bytes.
143
-
144
- These fixes require CLI 0.3.3 or newer; npm 0.3.2 does not include them. Updating a Skill does not upgrade the installed CLI. Journal v6 saves a pending stage before signing/submitting. Missing hashes in creating stages of a pending or legacy v4/v5 journal block automatic resubmission; follow the reported chain-state checks and contact support. CLI 0.3.7 permits the URI assignment stage to converge through its typed recovery path. Known hashes are verified without rebroadcast. The pending marker protects transaction resubmission while authorization cleanup and wallet switching preserve the journal.
139
+ hashes. An unknown outcome is recoverable: retry `publish-submit` / `version-submit` with the same
140
+ intent and source, or use the saved fingerprint recovery command after checking CLI/MCP identity.
141
+ The CLI reads the exact owner, package hash and version, URI, or version-specific key flag on chain
142
+ before each stage. Completed stages are skipped; a slug owned by another wallet is an explicit conflict.
143
+ A reverted transaction is discarded after a fresh state check. A pending hash is awaited; confirmed
144
+ nonce replacement or receipt timeout permits a fresh state check and another attempt.
145
+
146
+ Journal v7 saves the signed transaction hash and nonce before broadcast. Hashless completion uses
147
+ confirmed-block chain evidence without inventing a transaction hash; such transaction fields in a
148
+ successful result are `null`. The gateway records these facts so remaining URI/key stages can proceed.
149
+ `indexing_pending` does not block further chain stages. Legacy v4/v5/v6 journals follow the same chain
150
+ checks. Journals predating Session intent references use the existing publication admission and
151
+ projection adapters with their saved immutable material; new submissions still require an intent.
152
+ Keep journals and their original wallet material across authorization changes. Fingerprint-only
153
+ recovery can use stored bytes when the source is unavailable. Cleanup failures do not claim the journal
154
+ still exists. These behaviors require CLI 0.5.3 or newer and the corresponding
155
+ gateway plus `20261010020000_skill_publication_chain_checkpoints.sql`, applied separately through the
156
+ protected environment workflow. Updating a website or Skill does not update the installed CLI.
145
157
 
146
158
  ## Bootstrap and health reports (CLI 0.3.4+)
147
159
 
@@ -175,7 +187,7 @@ CLI 0.4.1 supports Skill publication, acquisition, management, and delivery on A
175
187
 
176
188
  CLI 0.5.0 depends on the Agent, Task and Skill intent migrations/routes from Issue #1144 parts 1–3. Apply the ordered migrations through the separately authorized workflow and deploy the corresponding Session endpoints before distributing this package. Validate CLI custody/recovery against the intended environment, publish the reviewed package, then release the matching Finch Market Skill instructions. A repository version bump or website deployment is not npm publication; before that release, public npm 0.4.1 retains its older command and preparation-file workflow.
177
189
 
178
- Keep existing journals when upgrading. Agent recovery uses the owned operation/intent endpoints; old Task v2 journals adopt their original preparation audit receipt; old Skill purchase/convert checkpoints adopt only an already verified receipt. Unexecuted old plan files must be prepared again through MCP. Historical Skill publication journals without an intent ID cannot safely manufacture one or fall back to business authority: preserve the journal and reconcile any broadcast stages before continuing. Old clients' server interfaces remain available during rollout; their eventual retirement is separate work.
190
+ Keep existing journals when upgrading. Agent recovery uses the owned operation/intent endpoints; old Task v2 journals adopt their original preparation audit receipt; old Skill purchase/convert checkpoints adopt only an already verified receipt. Unexecuted old plan files must be prepared again through MCP. Historical Skill publication journals without an intent ID recover from chain state and submit only unfinished stages through the existing publication admission adapter, using their saved immutable material. Old clients' server interfaces remain available during rollout; their eventual retirement is separate work.
179
191
 
180
192
  ## Recovery-preserving Account transitions (CLI 0.5.1)
181
193
 
@@ -184,3 +196,11 @@ CLI 0.5.1 allows ordinary logout and wallet switching with unfinished transactio
184
196
  ## Actionable usage errors, wallet list and network diagnostics (CLI 0.5.2)
185
197
 
186
198
  CLI 0.5.2 names the rejected option, missing argument or unknown subcommand together with the command's usage instead of a generic schema message; every command already prints JSON, so there is no `--json` option. `finch wallet list` shows the current wallet and registered addresses offline. Failed `finch mcp doctor` network checks report `httpStatus` or `networkErrorCode`, so a TLS-intercepting proxy, DNS failure or timeout is distinguishable from a server outage. Its PROD authentication-chain help also lists Injective (`1776`). Upgrade the installed executable to receive these changes; updating the Skill or website alone does not apply them.
199
+
200
+ ### Injective Skill transactions (0.5.4)
201
+
202
+ CLI 0.5.4 supports Skill publication, acquisition, version updates, price/supply changes and recovery on Injective EVM (`1776`). The real transaction adapter now accepts the reviewed Injective chain definition; older executables can reject these plans before reaching RPC. Use the exact chain from the Remote MCP plan; prices and gas use INJ. Upgrade the executable while preserving existing recovery journals.
203
+
204
+ ### Skill display languages (0.5.4)
205
+
206
+ Publication plans accept `sourceLocale` (`en`, `zh`, `zh-TW`). The gateway records it when the publication is confirmed; it stays outside chain metadata and SkillRoot hashes. Display edits and confirmation use Remote MCP after publication. A display-save failure retains recovery state: retry the same intent or fingerprint to finish database initialization without repeating the mint. Deploy the matching gateway and migration before using language-bearing plans.