Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
5f13d95
Initial plan
Copilot Sep 1, 2025
2a96a7e
Initial plan
Copilot Sep 1, 2025
264520b
Implement payouts exporters with CSV and canonical JSON support
Copilot Sep 1, 2025
d56aefe
Implement transaction preparer for push-only payouts with comprehensi…
Copilot Sep 1, 2025
9b01237
Update src/__tests__/payouts/exporters.test.ts
mickeyjoes Sep 1, 2025
5f94b05
Update src/__tests__/payouts/exporters.test.ts
mickeyjoes Sep 1, 2025
ee3acc4
Add multi-chain configuration support for SuperDappAirdrop contracts
Copilot Sep 1, 2025
8a786cd
Fix tx-preparer tests and validation logic for multi-chain configuration
Copilot Sep 1, 2025
0a9f305
Merge pull request #33 from SuperDappAI/copilot/fix-26
mickeyjoes Sep 2, 2025
9ae930c
Merge branch 'releases/v1.1.0' into copilot/fix-27
mickeyjoes Sep 2, 2025
c068195
Merge pull request #34 from SuperDappAI/copilot/fix-27
mickeyjoes Sep 2, 2025
2086ba0
Initial plan
Copilot Sep 2, 2025
7598076
Initial plan for payouts execute and reconcile helpers
Copilot Sep 2, 2025
84a69d5
Implement payouts execute and reconcile helpers with viem integration
Copilot Sep 2, 2025
1773dbc
Merge branch 'releases/v1.1.0' into copilot/fix-28-2
mickeyjoes Sep 2, 2025
31a86b5
Implement extractAddressFromTopic utility function and integrate with…
Copilot Sep 2, 2025
1ced345
Merge pull request #43 from SuperDappAI/copilot/fix-28-2
mickeyjoes Sep 2, 2025
f80d388
Initial plan
Copilot Sep 2, 2025
d32ead9
feat: wire payouts module into SDK public API with full integration
Copilot Sep 2, 2025
03f66a4
resolve merge conflicts: integrate releases/v1.1.0 payouts modules wi…
Copilot Sep 2, 2025
1c18508
Merge branch 'releases/v1.1.0' into copilot/fix-29
mickeyjoes Sep 2, 2025
542176c
fix: resolve EIP-55 checksumming and linting issues after merge confl…
Copilot Sep 2, 2025
8429e89
Initial plan
Copilot Sep 2, 2025
08b55ec
Merge pull request #44 from SuperDappAI/copilot/fix-29
mickeyjoes Sep 2, 2025
9c79d7d
Add comprehensive platform setup documentation for first-time developers
Copilot Sep 2, 2025
b6f889f
Actions taken
mickeyjoes Sep 2, 2025
3a3981b
Initial plan
Copilot Sep 2, 2025
1de9e9a
Initial commit: setup AI module scaffold plan
Copilot Sep 2, 2025
c6cb2d0
Implement AI module scaffold with required dependencies
Copilot Sep 2, 2025
6635679
Merge branch 'releases/v1.1.0' into copilot/fix-36
mickeyjoes Sep 3, 2025
7d66da6
Address PR feedback: Fix agent creation flow, remove unsupported webh…
Copilot Sep 3, 2025
1a5ffbc
Merge pull request #46 from SuperDappAI/copilot/fix-a3c2bd62-5168-4bb…
mickeyjoes Sep 3, 2025
0d95078
Update package.json
mickeyjoes Sep 3, 2025
cde1aa3
Merge pull request #47 from SuperDappAI/copilot/fix-36
mickeyjoes Sep 3, 2025
4f63d88
Implement AI Provider Configuration & Loader for Vercel AI SDK Integr…
Copilot Sep 3, 2025
1151620
Complete AI integration module implementation for SuperDapp JS SDK (#52)
Copilot Sep 4, 2025
9ffd4ed
Merge branch 'master' into releases/v1.1.0
mickeyjoes Sep 4, 2025
0917aba
ai(enhanced): add EnhancedAIClient with guardrails, tracing, human-ap…
mickeyjoes Sep 4, 2025
1af745f
feat: Add optional OpenAI Agents SDK integration with feature flag su…
Copilot Sep 5, 2025
f816384
feat: Restructure AI examples into standalone runnable projects with …
Copilot Sep 5, 2025
0458416
Updated .env.example with proper openai model
mickeyjoes Sep 5, 2025
952355b
Fixed Configuration Error Handling
mickeyjoes Sep 5, 2025
381d7a8
Corrected AI examples message processing
mickeyjoes Sep 5, 2025
e289989
Include Ngrok tunnel webhook URL
mickeyjoes Sep 5, 2025
5981dd3
✅ AI SDK v5 Upgrade Complete
mickeyjoes Sep 5, 2025
1517ee1
✅ Issue Resolution Summary
mickeyjoes Sep 5, 2025
591026c
Complete payouts SDK example with comprehensive agent demonstrating a…
Copilot Sep 8, 2025
cfcb971
Added missing .env.example files to examples
mickeyjoes Sep 8, 2025
6f399ee
feat: Implement real blockchain transaction capabilities for SuperDap…
Copilot Sep 9, 2025
296b20e
WebhookAgent: support commands with arguments via prefix matching
mickeyjoes Sep 25, 2025
fd98672
WebhookAgent: support commands with arguments via prefix matching (mi…
mickeyjoes Sep 25, 2025
2d199db
WebhookAgent: robust message text extraction for nested payloads
mickeyjoes Sep 25, 2025
349e4ca
Build: annotate loadModel return type to avoid TS2742
mickeyjoes Sep 25, 2025
15d6285
sdk: bundle AI provider deps into SDK and simplify consumers; keep bu…
mickeyjoes Oct 1, 2025
6eb90cb
examples(super-group-starter): add vibrant Cloudflare-ready super gro…
mickeyjoes Oct 10, 2025
63ffd87
remove
mickeyjoes Oct 10, 2025
b5597ca
feat: add chat type differentiation and group chat support (#70)
vieiraricardo Oct 10, 2025
e686ad5
Update default ngrok domain placeholder
mickeyjoes Oct 10, 2025
a97af37
sdk: use native fetch in Cloudflare Workers; keep axios in Node; avoi…
mickeyjoes Oct 15, 2025
c4d23ab
sdk: use native fetch in Cloudflare Workers; keep axios in Node; avoi…
mickeyjoes Oct 15, 2025
b872f32
fix: properly handles roomId for channels and DM (#71)
vieiraricardo Nov 5, 2025
cb08754
chore: merge main into releases/v1.1.0, resolve conflicts
mickeyjoes Jan 5, 2026
aefc08b
fix: exclude __tests__ from build and add node/jest types
mickeyjoes Jan 5, 2026
b4e5018
fix: change module output to ESNext for Cloudflare Workers compatibility
mickeyjoes Jan 5, 2026
57c39c6
fix: revert to CommonJS for CLI compatibility
mickeyjoes Jan 6, 2026
7b84c8d
feat(ai): add EdgeAIClient for Cloudflare Workers/Edge runtime compat…
mickeyjoes Jan 29, 2026
0c15322
fix(edge-client): omit temperature for OpenAI reasoning models (o1/o3…
mickeyjoes Jan 29, 2026
2ad34ce
fix(edge-client): include gpt-5 models in temperature restriction
mickeyjoes Jan 30, 2026
e592ef1
feat: export generateText, streamText, runAgent from SDK for AI integ…
mickeyjoes Jan 30, 2026
4ef1fd6
chore: add logging to EdgeAIClient for debugging
mickeyjoes Jan 30, 2026
72a91fd
fix: improve OpenAI response parsing for newer models
mickeyjoes Feb 2, 2026
6fa3ed4
feat: exposes method to update connection messages and get contact in…
vieiraricardo Apr 8, 2026
2c7ad39
fix: rename ai module to ai-service to resolve build conflict with Ve…
vieiraricardo Apr 8, 2026
d90b4fd
fix: correct imports and update tests for ai-service module migration
vieiraricardo Apr 8, 2026
4b43371
fix: resolve ESLint errors to ensure CI/CD pipeline passes
vieiraricardo Apr 8, 2026
dd496b0
fix: address all Copilot PR review findings (#80)
vieiraricardo Apr 8, 2026
69ea1a9
fix: migrate CI/CD workflow to pnpm to resolve ENOLOCK security audit…
Copilot Apr 8, 2026
c07dff4
chore: remove pnpm version from ci-cd.yml
vieiraricardo Apr 8, 2026
0538aa3
chore: remove duplicate declarion for the ai module in both dependenc…
vieiraricardo Apr 8, 2026
a362d1e
chore: remove pnpm version from ci-cd.yml
vieiraricardo Apr 8, 2026
9ce2d6f
chore: update vulnerable dependencies
vieiraricardo Apr 8, 2026
fa56e1f
fix: correct dependencies based on depcheck analysis
vieiraricardo Apr 8, 2026
f80c152
chore: update lock file
vieiraricardo Apr 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,26 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Run linter
run: npm run lint
run: pnpm run lint

- name: Run tests
run: npm test
run: pnpm test

- name: Build project
run: npm run build
run: pnpm run build

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand All @@ -46,11 +49,23 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run security audit
run: npm audit --audit-level moderate
run: pnpm audit --audit-level moderate

- name: Check dependencies
run: npx depcheck --config=.depcheckrc
run: pnpm dlx depcheck --config=.depcheckrc

publish:
needs: [test, security]
Expand All @@ -60,17 +75,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build project
run: npm run build
run: pnpm run build

- name: Validate version
run: |
Expand All @@ -83,6 +102,6 @@ jobs:
echo "Version validated!"

- name: Publish to NPM
run: npm publish
run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,12 @@ tmp
my-test-project
/examples/*/package-lock.json
projects/
projects/*/
docs/sessions
*.tgz

# TypeScript build artifacts
src/**/*.js
src/**/*.d.ts
src/**/*.js.map
src/**/*.d.ts.map
151 changes: 151 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,26 @@ yarn add @superdapp/agents
pnpm add @superdapp/agents
```

### AI Dependencies (Optional)

For AI integration, install the providers you need:

```bash
# Base AI SDK (required for any AI functionality)
npm install ai

# Provider-specific packages (install only what you need)
npm install @ai-sdk/openai # For OpenAI GPT models
npm install @ai-sdk/anthropic # For Anthropic Claude models
npm install @ai-sdk/google # For Google Gemini models

# Optional: Enhanced OpenAI Agents SDK (advanced features)
npm install @openai/agents # For advanced agent workflows, tools, streaming

# All providers at once
npm install ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google @openai/agents
```

## 🛠️ Development

For local development and testing, see [DEVELOPMENT.md](./DEVELOPMENT.md) for instructions on setting up the development environment using `npm link`.
Expand All @@ -127,9 +147,140 @@ For comprehensive documentation, visit our **[Documentation Hub](./docs/README.m
- **[Quick Start Guide](./docs/quick-start.md)** - Get up and running in minutes
- **[CLI Guide](./docs/cli-guide.md)** - Complete command-line interface documentation
- **[API Reference](./docs/api-reference.md)** - Complete SDK reference
- **[AI Integration Guide](./docs/ai-integration.md)** - Multi-provider AI integration
- **[Deployment Guide](./docs/deployment.md)** - Deploy to production
- **[Tunneling (ngrok)](./docs/tunneling.md)** - Expose your local webhook

## 🤖 Model-Agnostic AI Integration

Build intelligent agents with multiple AI providers:

### Quick Setup

```bash
# Install AI dependencies
npm install ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google

# Configure your agent
superagent configure
```

### Example Usage

```typescript
import { SuperDappAgent, createBotConfig } from '@superdapp/agents';

const agent = new SuperDappAgent(createBotConfig());

// Add AI-powered command
agent.addCommand('/ask', async (message, replyMessage, roomId) => {
const question = message.body.m?.body?.split(' ').slice(1).join(' ');

try {
const aiClient = agent.getAiClient();
const response = await aiClient.generateText(question);
await agent.sendConnectionMessage(roomId, response);
} catch (error) {
console.error('AI Error:', error);
await agent.sendConnectionMessage(roomId, 'Sorry, I had trouble with that request.');
}
});
```

### Supported Providers

- **OpenAI**: GPT-4, GPT-3.5 Turbo, and other OpenAI models
- **Anthropic**: Claude 3 (Opus, Sonnet, Haiku)
- **Google AI**: Gemini Pro and Gemini Pro Vision

### Environment Variables

```bash
AI_PROVIDER=openai # or anthropic, google
AI_MODEL=gpt-4 # Provider-specific model
AI_API_KEY=sk-your-key # Your API key
AI_BASE_URL=https://... # Optional custom endpoint

# OpenAI Agents SDK Configuration (optional)
SUPERDAPP_AI_AGENTS=1 # Enable OpenAI Agents SDK features
SUPERDAPP_AI_AGENTS_STREAMING=1 # Enable streaming mode
SUPERDAPP_AI_AGENTS_MAX_TURNS=10 # Maximum agent conversation turns
```

### Enhanced OpenAI Agents Integration

**NEW**: Optional OpenAI Agents SDK integration for advanced features:

```typescript
import { createEnhancedAIClient } from '@superdapp/agents';

// Enhanced client with OpenAI Agents support
const enhancedClient = await createEnhancedAIClient({
provider: 'openai',
model: 'gpt-4',
apiKey: process.env.AI_API_KEY,
agents: {
enabled: true, // Enable OpenAI Agents features
streaming: true, // Enable real-time streaming
maxTurns: 10, // Conversation turn limit
},
});

// Advanced agent with tools and guardrails
const result = await enhancedClient.runEnhancedAgent({
instructions: 'You are a helpful assistant with calculation abilities.',
messages: [{ role: 'user', content: 'Calculate 15% tip on $45' }],
tools: {
calculator: {
type: 'function',
function: {
name: 'calculate',
description: 'Perform mathematical calculations',
parameters: {
type: 'object',
properties: {
expression: { type: 'string' },
},
},
},
},
},
guardrails: {
outputValidation: {
maxLength: 500,
bannedWords: ['inappropriate'],
},
},
enableTracing: true,
});

console.log('Agent Response:', result.outputText);
console.log('Tracing Data:', result.tracing);
```

**Features when OpenAI Agents SDK is installed:**

- 🛠️ **Advanced Tools**: Function calling with parallel execution
- 📡 **Real-time Streaming**: Live event streaming from agents
- 🛡️ **Built-in Guardrails**: Input/output validation and content filtering
- 👥 **Agent Handoffs**: Transfer conversations between specialized agents
- 📊 **Enhanced Tracing**: Detailed execution monitoring and token usage
- ⚡ **Parallel Execution**: Run multiple agents simultaneously

**Graceful Fallback**: When `@openai/agents` is not installed, the SDK automatically falls back to the standard `generateText` functionality with no breaking changes.

### Features

- **Zero Configuration**: Works without AI dependencies installed
- **Provider Switching**: Change providers via environment variables
- **Error Handling**: Clear error messages and fallback behavior
- **TypeScript Support**: Full type safety for all AI operations
- **Cost Control**: Built-in token limits and usage monitoring
- **OpenAI Agents SDK**: Optional advanced features when installed
- **Production Ready**: Graceful fallback and robust error handling

**See the complete [AI Integration Guide](./docs/ai-integration.md) for setup instructions, examples, and best practices.**

## 🔧 Advanced Usage

### API Client Coverage
Expand Down
5 changes: 4 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ Welcome to the comprehensive documentation for the SuperDapp Agents SDK. This do

### 🚀 Getting Started

- **[Quick Start Guide](./quick-start.md)** - Get up and running with your first agent in minutes
- **[Quick Start Guide](./quick-start.md)** - Complete setup guide including SuperDapp platform registration, API key generation, webhook configuration, and your first agent
- **[CLI Guide](./cli-guide.md)** - Complete command-line interface documentation

### 🛠️ Development

- **[API Reference](./api-reference.md)** - Complete SDK reference with classes, methods, and types
- **[Payouts Module](./payouts.md)** - Push-only batch payouts for ERC-20 and native
- **[AI Integration](./ai-integration.md)** - Model-agnostic AI via Agents SDK + AI SDK

### 🚀 Deployment

Expand All @@ -21,6 +23,7 @@ Welcome to the comprehensive documentation for the SuperDapp Agents SDK. This do

| Topic | Description | Link |
| --------------------- | ------------------------------- | ----------------------------------- |
| **Platform Setup** | SuperDapp account & API setup | [Quick Start](./quick-start.md#platform-setup) |
| **First Steps** | Create your first agent | [Quick Start](./quick-start.md) |
| **CLI Commands** | Manage agents from command line | [CLI Guide](./cli-guide.md) |
| **Advanced Features** | Complex patterns and scenarios | [API Reference](./api-reference.md) |
Expand Down
Loading
Loading