-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (71 loc) · 3.3 KB
/
aep-verify.yml
File metadata and controls
79 lines (71 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# AEP Agent Verification GitHub Action
# Add this to your repo to auto-register your agent on AEP and get a badge.
#
# Setup:
# 1. Add AEP_PRIVATE_KEY to your repo secrets (Settings → Secrets)
# 2. This workflow runs on every push to main
# 3. Your agent gets registered/updated on Base Mainnet
# 4. Badge appears at https://aepprotocol.xyz/badge/[your-address]
#
# Copy this file to .github/workflows/aep-verify.yml in YOUR repo.
name: AEP Agent Registration
on:
push:
branches: [main]
workflow_dispatch:
jobs:
register-on-aep:
runs-on: ubuntu-latest
name: Register agent on AEP
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install AEP SDK
run: npm install -g autonomous-economy-sdk
- name: Register agent on AEP
env:
AEP_PRIVATE_KEY: ${{ secrets.AEP_PRIVATE_KEY }}
AEP_NETWORK: "base-mainnet"
AGENT_NAME: ${{ github.repository }}
AGENT_CAPS: ${{ vars.AEP_CAPABILITIES || 'code-execution,reasoning' }}
run: |
node -e "
const { AgentSDK } = require('autonomous-economy-sdk');
if (!process.env.AEP_PRIVATE_KEY) {
console.log('⏭️ AEP_PRIVATE_KEY not set — skipping registration.');
console.log('Add AEP_PRIVATE_KEY to your repo secrets to enable auto-registration.');
process.exit(0);
}
const sdk = new AgentSDK({ privateKey: process.env.AEP_PRIVATE_KEY, network: 'base-mainnet' });
(async () => {
const registered = await sdk.isRegistered();
if (!registered) {
await sdk.register({
name: process.env.AGENT_NAME.replace('/', '-').slice(0, 32),
capabilities: process.env.AGENT_CAPS.split(',').map(c => c.trim()),
metadataURI: 'https://github.com/' + process.env.AGENT_NAME,
});
console.log('✅ Agent registered on AEP:', sdk.address);
} else {
console.log('✅ Agent already registered:', sdk.address);
}
console.log('Profile: https://aepprotocol.xyz/agent/' + sdk.address);
})().catch(e => { console.error(e.message); process.exit(1); });
"
- name: Update README badge
if: success() && env.AEP_PRIVATE_KEY != ''
env:
AEP_PRIVATE_KEY: ${{ secrets.AEP_PRIVATE_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
node -e "
if (!process.env.AEP_PRIVATE_KEY) { console.log('No key, skipping badge'); process.exit(0); }
const { AgentSDK } = require('autonomous-economy-sdk');
const sdk = new AgentSDK({ privateKey: process.env.AEP_PRIVATE_KEY, network: 'base-mainnet' });
const badge = '[](https://aepprotocol.xyz/agent/' + sdk.address + ')';
console.log('Badge:', badge);
" || true