{"id":48313879,"url":"https://github.com/just-be-dev/agents","last_synced_at":"2026-04-05T00:26:42.045Z","repository":{"id":339803623,"uuid":"1162986712","full_name":"just-be-dev/agents","owner":"just-be-dev","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-14T14:50:49.000Z","size":802,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-15T01:39:13.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/just-be-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-20T23:49:23.000Z","updated_at":"2026-03-14T14:50:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/just-be-dev/agents","commit_stats":null,"previous_names":["just-be-dev/agents"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/just-be-dev/agents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fagents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fagents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fagents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fagents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/just-be-dev","download_url":"https://codeload.github.com/just-be-dev/agents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-be-dev%2Fagents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31419767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T00:25:07.052Z","status":"ssl_error","status_checked_at":"2026-04-05T00:25:05.923Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-05T00:26:41.404Z","updated_at":"2026-04-05T00:26:42.036Z","avatar_url":"https://github.com/just-be-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @just-be/agents\n\nA monorepo for building and deploying multiple AI agents as Cloudflare Workers with Durable Objects. Each agent is isolated in its own workspace but shares common packages and a unified deployment router.\n\n## Structure\n\n```\nagents/\n├── agents/          # Individual agent implementations\n│   └── github/      # GitHub App agent (webhook handler, issue/PR automation)\n├── packages/        # Shared code across agents (available for future use)\n├── src/             # Unified router (routes webhooks to specific agents)\n│   └── index.ts     # Entry point that routes to agent Durable Objects\n├── wrangler.jsonc   # Cloudflare Workers deployment configuration\n└── package.json     # Monorepo root with workspace configuration\n```\n\n## Architecture\n\nThe monorepo uses a **router pattern** where a single Worker (`src/index.ts`) routes incoming requests to the appropriate agent Durable Object:\n\n```\nPOST /webhooks/github\n  → Worker Router (src/index.ts)\n    → Extract repo name from payload\n    → Route to GitHubAgent Durable Object (agents/github/)\n      → Agent instance per repository (isolated state)\n      → SQLite storage, WebSocket state updates\n      → GitHub API integration\n\nGET /\n  → Status endpoint listing all available agents\n```\n\nEach agent:\n\n- Runs as a **Durable Object** with isolated state and SQLite storage\n- Uses the [Agents SDK](https://www.npmjs.com/package/agents) for stateful WebSocket connections and RPC\n- Gets its own instance per resource (e.g., one GitHub agent per repository)\n\n## Getting Started\n\n### Prerequisites\n\n- [Bun](https://bun.sh) runtime (managed via [mise](https://mise.jdx.dev))\n- [Cloudflare account](https://dash.cloudflare.com/sign-up)\n- Wrangler CLI (installed via `bun install`)\n\n### Installation\n\n```bash\n# Install Bun via mise (if not already installed)\nmise install\n\n# Install all dependencies (for all workspaces)\nbun install\n\n# Type check all packages\nbun run typecheck\n```\n\n### Local Development\n\n```bash\n# Run the router worker locally with hot reload\nbun run dev\n\n# The dev server starts at http://localhost:8787\n# Test the status endpoint: curl http://localhost:8787\n```\n\n### Deployment\n\n```bash\n# Deploy the unified router and all agents to Cloudflare\nbun run deploy\n```\n\nThe router worker will be deployed to your Cloudflare account with all configured Durable Object bindings.\n\n## Available Agents\n\n### GitHub Agent\n\nA GitHub App agent that handles webhook events, stores them in SQLite, and can respond via the GitHub API.\n\n- **Location**: `agents/github/`\n- **Webhook Path**: `/webhooks/github`\n- **Features**: Per-repo isolation, event storage, auto-commenting, WebSocket state\n- **Documentation**: See [agents/github/README.md](./agents/github/README.md)\n\nExample usage:\n\n```bash\n# GitHub webhooks are sent to:\nPOST https://your-worker.workers.dev/webhooks/github\n```\n\n## Adding a New Agent\n\nFollow these steps to add a new agent to the monorepo:\n\n### 1. Create Agent Directory\n\n```bash\nmkdir -p agents/my-agent/src\ncd agents/my-agent\n```\n\n### 2. Create `package.json`\n\n```json\n{\n  \"name\": \"@just-be/my-agent\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"typecheck\": \"tsc --noEmit\"\n  },\n  \"dependencies\": {\n    \"agents\": \"^0.5.1\"\n  },\n  \"devDependencies\": {\n    \"@types/bun\": \"latest\",\n    \"wrangler\": \"^4.67.0\"\n  },\n  \"peerDependencies\": {\n    \"typescript\": \"^5\"\n  }\n}\n```\n\n### 3. Implement Agent Class\n\nCreate `agents/my-agent/src/my-agent.ts`:\n\n```typescript\nimport { Agent } from \"agents\";\n\nexport class MyAgent extends Agent {\n  constructor(state: DurableObjectState, env: Env) {\n    super(state, env);\n  }\n\n  async fetch(request: Request): Promise\u003cResponse\u003e {\n    const url = new URL(request.url);\n\n    // Handle webhooks or other requests\n    if (request.method === \"POST\" \u0026\u0026 url.pathname === \"/webhook\") {\n      // Process webhook\n      return Response.json({ status: \"received\" });\n    }\n\n    return new Response(\"Not found\", { status: 404 });\n  }\n}\n```\n\n### 4. Add Router Integration\n\nUpdate `src/index.ts` to export your agent and add routing:\n\n```typescript\nimport { MyAgent } from \"../agents/my-agent/src/my-agent.ts\";\n\nexport { GitHubAgent, MyAgent };\n\ninterface Env {\n  GITHUB_AGENT: DurableObjectNamespace\u003cGitHubAgent\u003e;\n  MY_AGENT: DurableObjectNamespace\u003cMyAgent\u003e; // Add this\n}\n\nexport default {\n  async fetch(request: Request, env: Env): Promise\u003cResponse\u003e {\n    const url = new URL(request.url);\n\n    // Add your agent's route\n    if (url.pathname.startsWith(\"/webhooks/my-agent\")) {\n      return handleMyAgentRoute(request, env);\n    }\n\n    // ... existing routes\n  },\n};\n\nasync function handleMyAgentRoute(request: Request, env: Env): Promise\u003cResponse\u003e {\n  // Get agent instance (use a name/ID scheme that makes sense)\n  const id = env.MY_AGENT.idFromName(\"default\");\n  const stub = env.MY_AGENT.get(id);\n  return stub.fetch(request);\n}\n```\n\n### 5. Update Wrangler Configuration\n\nAdd your agent to `wrangler.jsonc`:\n\n```jsonc\n{\n  \"durable_objects\": {\n    \"bindings\": [\n      {\n        \"name\": \"GITHUB_AGENT\",\n        \"class_name\": \"GitHubAgent\",\n        \"script_name\": \"agents-router\",\n      },\n      {\n        \"name\": \"MY_AGENT\",\n        \"class_name\": \"MyAgent\",\n        \"script_name\": \"agents-router\",\n      },\n    ],\n  },\n  \"migrations\": [\n    {\n      \"tag\": \"v1\",\n      \"new_sqlite_classes\": [\"GitHubAgent\"],\n    },\n    {\n      \"tag\": \"v2\",\n      \"new_sqlite_classes\": [\"MyAgent\"],\n    },\n  ],\n}\n```\n\n### 6. Test and Deploy\n\n```bash\n# Type check your new agent\nbun run typecheck\n\n# Test locally\nbun run dev\n\n# Deploy to Cloudflare\nbun run deploy\n```\n\nYour new agent is now available at `/webhooks/my-agent` (or whatever path you configured).\n\n## Development Commands\n\n```bash\n# Install dependencies for all workspaces\nbun install\n\n# Type check all packages\nbun run typecheck\n\n# Run development server (with hot reload)\nbun run dev\n\n# Deploy to Cloudflare Workers\nbun run deploy\n\n# Build GitHub agent CLI tool\nbun run build:cli\n```\n\n## Architecture Patterns\n\n### Per-Instance Isolation\n\nAgents use Durable Objects to provide per-resource isolation. For example:\n\n- GitHub agent: One instance per repository (`repo.full_name.replace(\"/\", \"-\")`)\n- Slack agent: One instance per workspace/channel\n- Custom agent: One instance per user, organization, etc.\n\n### State Management\n\nEach agent instance has:\n\n- **Durable Object storage**: Key-value store for small state\n- **SQLite**: Relational database for structured data\n- **WebSocket connections**: Real-time state updates to clients\n\n### Webhook Routing\n\nThe router extracts identifying information from webhooks and routes to the correct agent instance:\n\n```typescript\n// Example: Route GitHub webhooks by repository\nconst agentName = repo.full_name.replace(\"/\", \"-\");\nconst id = env.GITHUB_AGENT.idFromName(agentName);\nconst stub = env.GITHUB_AGENT.get(id);\nreturn stub.fetch(request);\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-be-dev%2Fagents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjust-be-dev%2Fagents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-be-dev%2Fagents/lists"}