Repository navigation
Smart wallet and CLI wizard integration - #6
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds smart-wallet support (ERC-4337 + Safe) and a new interactive agentarc setup CLI wizard that scaffolds AgentARC-protected agent projects from templates.
Changes:
- Added
ERC4337Adapter,SafeAdapter, andSmartWalletAdapterplusWalletFactoryconstructors for ERC-4337 and Safe. - Implemented a new Click-based setup wizard (
agentarc/cli/wizard.py) and added scaffold templates underagentarc/cli/templates/. - Added new tests and example agent scripts for smart-wallet flows; updated package exports and dependency metadata.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_smart_wallets.py | Adds adapter + factory + export coverage for new smart-wallet types. |
| tests/test_cli_setup.py | Adds end-to-end CLI wizard tests and template presence checks. |
| pyproject.toml | Adds eth-account and new optional dependency groups/extras. |
| examples/smart-wallet-agents/safe_agent.py | Example agent using Safe + PolicyWallet + OpenAI tools. |
| examples/smart-wallet-agents/erc4337_agent.py | Example agent using ERC-4337 + bundler flow + OpenAI tools. |
| examples/smart-wallet-agents/policy.yaml | Example policy config for smart-wallet examples. |
| examples/smart-wallet-agents/.env.example | Example environment file covering ERC-4337 + Safe. |
| agentarc/wallets/factory.py | Adds WalletFactory.from_erc4337() and WalletFactory.from_safe(). |
| agentarc/wallets/adapters/smart_wallet_base.py | Introduces ABC for smart-wallet-specific concepts (owner/deployed/type info). |
| agentarc/wallets/adapters/erc4337.py | Implements ERC-4337 adapter (user op build/sign/send via bundler). |
| agentarc/wallets/adapters/safe_adapter.py | Implements Safe adapter (threshold-aware exec vs pending result). |
| agentarc/wallets/adapters/init.py | Exposes smart-wallet adapters from the adapters package. |
| agentarc/wallets/init.py | Re-exports new adapters from agentarc.wallets. |
| agentarc/core/types.py | Extends WalletType enum with ERC4337 and SAFE. |
| agentarc/cli/wizard.py | Adds interactive scaffolding wizard + YAML/requirements generation. |
| agentarc/cli/templates/env_safe.template | Adds Safe env template for wizard scaffolds. |
| agentarc/cli/templates/env_erc4337.template | Adds ERC-4337 env template for wizard scaffolds. |
| agentarc/cli/templates/env_eoa.template | Adds EOA env template for wizard scaffolds. |
| agentarc/cli/templates/env_cdp.template | Adds CDP env template for wizard scaffolds. |
| agentarc/cli/templates/agent_safe_openai.py.template | Adds Safe + OpenAI agent scaffold template. |
| agentarc/cli/templates/agent_safe_langchain.py.template | Adds Safe + LangChain agent scaffold template. |
| agentarc/cli/templates/agent_erc4337_openai.py.template | Adds ERC-4337 + OpenAI agent scaffold template. |
| agentarc/cli/templates/agent_erc4337_langchain.py.template | Adds ERC-4337 + LangChain agent scaffold template. |
| agentarc/cli/templates/agent_eoa_openai.py.template | Adds EOA + OpenAI agent scaffold template. |
| agentarc/cli/templates/agent_eoa_langchain.py.template | Adds EOA + LangChain agent scaffold template. |
| agentarc/cli/templates/agent_cdp_openai.py.template | Adds CDP + OpenAI agent scaffold template. |
| agentarc/cli/templates/agent_cdp_langchain.py.template | Adds CDP + LangChain agent scaffold template. |
| agentarc/cli/templates/init.py | Documents template package purpose. |
| agentarc/cli/init.py | Introduces CLI package and exports SetupWizard. |
| agentarc/main.py | Replaces old setup logic with SetupWizard. |
| agentarc/init.py | Exposes new smart-wallet adapters at the top-level package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request introduces a new interactive CLI wizard for setting up AgentARC-protected agent projects, significantly streamlining the onboarding and configuration process. It also expands wallet adapter support and adds a set of ready-to-use agent code templates for various wallet types and frameworks. The most important changes are grouped below:
CLI Setup Wizard and Project Structure:
setupcommand logic inagentarc/__main__.pywith a new interactive wizard, now implemented inagentarc/cli/wizard.py(imported viaSetupWizard). The old inline setup logic and setup guide generation are removed, simplifying the entrypoint and delegating all setup responsibilities to the wizard.agentarc/cli/package, including__init__.pyand theSetupWizardclass, to encapsulate CLI-related functionality and expose the wizard for use.Wallet Adapter Support:
SmartWalletAdapter,ERC4337Adapter,SafeAdapter) to the main package exports inagentarc/__init__.py, making them available for agent projects and templates. [1] [2] [3]Agent Code Templates:
agentarc/cli/templates/, covering EOA, CDP, and ERC-4337 wallets for both LangChain and OpenAI SDK frameworks. These templates demonstrate best practices for integrating policy enforcement and are utilized by the new setup wizard. [1] [2] [3] [4] [5] [6]These changes collectively make it much easier for users to bootstrap new secure agent projects with minimal manual setup, while expanding support for modern wallet architectures.