feat: persisted tx mode + flatten ERC-8004 commands (agent agent → top-level) - #134
Merged
Merged
Conversation
Live interactive-login verification skipped to avoid triggering a real browser auth; non-TTY guard and mode persistence covered by inspection and mode.test.ts.
- register/identity/reputation/reviews/feedback are now top-level commands; the nested 'agent agent *' group and hidden legacy aliases are removed (agent-legacy.ts deleted). identity merges the old agent wallet + metadata. - fix: reputation/reviews no longer crash with 'Cannot assign to read only property 0' (frozen ethers Result spread before reuse). - fix: reputation no longer fails to serialize a BigInt decimals field.
Deletes the duplicate root skills/SKILL.md (npx skills add was offering two near-identical 'Polygon agent' skills) and the stale in-package polygon-defi fork; keeps skills/polygon-agent-cli/SKILL.md as canonical. Fixes the broken README SKILL.md links and the CLAUDE.md claim that skills ship via npm.
…sit framing - SKILL.md + README: top-level register/identity/reputation/reviews/feedback, the agent mode command and mode-aware write behavior, onboarding mode prompt. - Fix documented-but-missing flags (--include-revoked, drop fund --token, document x402-pay --chain). - Rename the DeFi sub-skill framing to 'Swap, Bridge & Deposit' (use cases, not infra) in titles and routing labels; slug/URL unchanged.
…gentconnect, not npm)
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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
Two agent-facing DX changes from the Fable DX audit, plus the doc/skill cleanup that fell out of it.
1. Persisted transaction mode (
agent mode)Instead of remembering
--broadcaston every write, the mode is chosen once and saved to~/.polygon-agent/config.json:agent mode auto— write commands broadcast immediately.agent mode dry-run(default) — write commands preview first.--dry-runon any command forces a preview regardless of mode;--broadcastforces execution. Precedence:--dry-run>--broadcast/--no-broadcast> persisted mode.wallet loginasks once: an interactive[y/N]prompt on a TTY, or amodePromptfield in the JSON output telling the driving agent to ask its user (no hanging on stdin). Auto mode is never enabled without an explicit answer.Wired through every write command in
operations.ts,polymarket.ts, and the ERC-8004 commands.2. Flattened the
agent agent *groupagent agent registeris gone. The ERC-8004 commands are now top-level:register,reputation,reviews,feedbackidentity(merges the oldagent agent wallet+agent agent metadata;--keydecodes metadata)The nested group, the six hidden legacy aliases, and
agent-legacy.tsare removed. This is a breaking change (changeset included, minor).Fixes made along the way
reputationandreviewswere completely broken (Cannot assign to read only property '0'— a frozen ethers v6Resultreused in a contract call). Fixed by spreading.reputationalso failed to serialize a BigIntdecimalsfield.reviews --revoked→--include-revoked, droppedfund --token) and documented the realx402-pay --chain.Docs / skill hygiene
skills/SKILL.mdsonpx skills addstops offering two near-identical "Polygon agent" skills;skills/polygon-agent-cli/SKILL.mdis now canonical (the better lines from the deleted copy were ported first).polygon-defiskill fork.SKILL.mdlinks and the CLAUDE.md claim that skills ship via npm (they ship vianpx skills add/ agentconnect;package.jsonfilesisdist+contracts).Testing
pnpm --filter @polygonlabs/agent-cli test— 29 passing (7 new for mode persistence + precedence).typecheck,lint(0 errors), and fullpnpm run buildclean.reputation --agent-id 1andidentity --agent-id 1returnok:true(previously crashed);--helpshows the flattened surface with noagentgroup;agent registercorrectly fails.wallet loginmode prompt (skipped to avoid triggering a real browser auth). The non-TTYmodePromptpath and mode persistence are covered by inspection +mode.test.ts.