Skip to content

Smart wallet and CLI wizard integration - #6

Merged
ARK-ASWINRAJ merged 7 commits into
mainfrom
feat/smart-wallet
Feb 26, 2026
Merged

ARK-ASWINRAJ merged 7 commits into
mainfrom
feat/smart-wallet

Conversation

@itsshantanu

Copy link
Copy Markdown
Contributor

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:

  • Replaces the previous setup command logic in agentarc/__main__.py with a new interactive wizard, now implemented in agentarc/cli/wizard.py (imported via SetupWizard). The old inline setup logic and setup guide generation are removed, simplifying the entrypoint and delegating all setup responsibilities to the wizard.
  • Introduces the agentarc/cli/ package, including __init__.py and the SetupWizard class, to encapsulate CLI-related functionality and expose the wizard for use.

Wallet Adapter Support:

  • Adds new wallet adapters (SmartWalletAdapter, ERC4337Adapter, SafeAdapter) to the main package exports in agentarc/__init__.py, making them available for agent projects and templates. [1] [2] [3]

Agent Code Templates:

  • Adds a comprehensive set of agent starter templates under 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]
  • Introduces a module docstring for the template package, clarifying its purpose.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and SmartWalletAdapter plus WalletFactory constructors for ERC-4337 and Safe.
  • Implemented a new Click-based setup wizard (agentarc/cli/wizard.py) and added scaffold templates under agentarc/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.

Comment thread tests/test_cli_setup.py Resolved
Comment thread agentarc/cli/wizard.py Resolved
Comment thread agentarc/__main__.py Resolved
Comment thread tests/test_smart_wallets.py Resolved
Comment thread agentarc/cli/wizard.py Resolved
Comment thread pyproject.toml Resolved
Comment thread agentarc/wallets/adapters/erc4337.py Resolved
Comment thread agentarc/wallets/adapters/erc4337.py Resolved
Comment thread tests/test_cli_setup.py Resolved
@ARK-ASWINRAJ
ARK-ASWINRAJ merged commit 6bbfe0f into main Feb 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants