Agent Resource Platform - this is an exploration into what a backbone for human-agent interaction in a business context might look like.
|
|
7 hours ago | |
|---|---|---|
| arp_agent | 2 days ago | |
| arp_cli | 7 hours ago | |
| auth | 6 days ago | |
| graph | 7 hours ago | |
| logging | 6 days ago | |
| mcp | 1 day ago | |
| models | 4 days ago | |
| .gitignore | 1 day ago | |
| ARP_AGENT_README.MD | 2 days ago | |
| CLIENT_GUIDE.md | 3 days ago | |
| README.md | 5 days ago | |
| TODO.md | 4 days ago | |
| arp_server | 7 hours ago | |
| go.mod | 6 days ago | |
| go.sum | 6 days ago | |
| gqlgen.yml | 6 days ago | |
| init_prod.sql | 3 days ago | |
| server.go | 3 days ago |
A GraphQL-based coordination system for users and agents to collaborate on services, tasks, and communications.
ARP (Agent Resource Platform) is a coordination backend that enables human users and AI agents to work together on shared services. It provides:
┌─────────────────────────────────────────────────────────────┐
│ GraphQL API │
│ (gqlgen - schema-first, type-safe resolvers) │
├─────────────────────────────────────────────────────────────┤
│ Auth Middleware │
│ (JWT tokens, permission checks) │
├─────────────────────────────────────────────────────────────┤
│ GORM Models │
│ User → Role → Permission │
│ Service → Task → TaskStatus │
│ Channel → Message │
│ Note │
├─────────────────────────────────────────────────────────────┤
│ SQLite Database │
│ (arp.db - can be swapped for PostgreSQL/MySQL) │
└─────────────────────────────────────────────────────────────┘
# Clone and run
go run server.go
# Server starts on http://localhost:8080
go test ./... -v
go run server.go &
# Server runs on http://localhost:8080
Use GraphQL introspection to discover the API schema:
# Get all types in the schema
curl -s -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"query":"{ __schema { types { name kind description fields { name type { name kind ofType { name } } } } } }"}' | jq
# Get all queries and mutations
curl -s -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"query":"{ __schema { queryType { fields { name description } } mutationType { fields { name description } } } }"}' | jq
Run the SQL bootstrap script to create permissions, roles, task statuses, and an admin user:
# Initialize the database with seed data
sqlite3 arp.db < init.sql
# Verify the data was created
sqlite3 arp.db "SELECT name FROM roles;"
# Output:
# admin
# manager
# user
sqlite3 arp.db "SELECT email FROM users;"
# Output:
# admin@example.com
The init.sql script creates:
admin@example.com and password secret123# Login to get JWT token
TOKEN=$(curl -s -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"query":"mutation { login(email: \"admin@example.com\", password: \"secret123\") { token user { email roles { name } } } }"}' | jq -r '.data.login.token')
echo "Token: $TOKEN"
# Get all services with authentication
curl -s -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"query":"{ services { id name description createdAt participants { email } tasks { title status { label } } } }"}' | jq
# Create a new service
curl -s -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"query":"mutation { createService(input: {name: \"Project Alpha\", description: \"New project\", createdById: \"1\", participants: [\"1\"]}) { id name } }"}' | jq
# Get a specific service
curl -s -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"query":"{ service(id: \"1\") { id name description createdBy { email } participants { email } tasks { id title priority status { code label } } } }"}' | jq
The system uses a hierarchical permission model:
User ─┬─ has many ─→ Role ─┬─ has many ─→ Permission
│ │
└─ e.g., "admin" └─ e.g., "service:create"
| Operation | Required Permission |
|---|---|
| Update User | user:update |
| Delete User | user:delete |
| Update Task | task:update |
| Delete Task | task:delete |
| Update Note | note:update |
| Delete Note | note:delete |
| Update Service | service:update |
| Delete Service | service:delete |
| ... | ... |
# Include JWT token in Authorization header
curl -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{"query":"..."}'
task:create)type Query {
users: [User!]!
user(id: ID!): User
services: [Service!]!
service(id: ID!): Service
tasks: [Task!]!
task(id: ID!): Task
roles: [Role!]!
permissions: [Permission!]!
# ... more queries
}
type Mutation {
login(email: String!, password: String!): AuthPayload!
createUser(input: NewUser!): User!
createService(input: NewService!): Service!
createTask(input: NewTask!): Task!
# ... more mutations
}
| Variable | Default | Description |
|---|---|---|
JWT_SECRET |
your-secret-key-change-in-production |
Secret for JWT signing |