@jbcom/agentic (Control)
@jbcom/agentic — Control
Section titled “@jbcom/agentic — Control”Spawn, coordinate, and manage fleets of AI agents with automatic token routing, sandboxed execution, and handoff protocols.
What It Does
Section titled “What It Does”@jbcom/agentic is the orchestration layer of the Agentic ecosystem. It handles the hard coordination problems that come up when you run multiple AI agents across multiple repositories and organizations:
| Capability | Description |
|---|---|
| Token Routing | Automatically selects the right GitHub token based on repository organization — no manual switching |
| Fleet Orchestration | Spawn, monitor, and coordinate multiple Cursor Background Agents in parallel |
| Sandbox Execution | Run AI agents in isolated Docker containers with resource limits |
| Handoff Protocol | Transfer work between agents with full context preservation |
| AI Triage | Analyze agent conversations and extract actionable insights |
| Provider Agnostic | Works with Anthropic, OpenAI, Google, Mistral, Azure, and Ollama |
Installation
Section titled “Installation”# Global CLInpm install -g @jbcom/agentic
# As a librarynpm install @jbcom/agenticInstall at least one AI provider for triage features:
npm install @ai-sdk/anthropic # Recommended# or: @ai-sdk/openai, @ai-sdk/google, @ai-sdk/mistral, @ai-sdk/azureCLI Reference
Section titled “CLI Reference”Configuration
Section titled “Configuration”agentic init # Interactive setupagentic init --non-interactive # Auto-detect everythingToken Management
Section titled “Token Management”agentic tokens status # Show all token statusagentic tokens validate # Validate required tokensagentic tokens for-repo my-org/r # Show which token a repo usesFleet Management
Section titled “Fleet Management”agentic fleet list # List all agentsagentic fleet list --running # Running agents onlyagentic fleet summary # Fleet overviewagentic fleet models # Available Cursor models
# Spawn agentsagentic fleet spawn <repo> <task>agentic fleet spawn <repo> <task> --auto-pr --branch fix/ci
# Communicationagentic fleet followup <agent-id> "Status update?"agentic fleet coordinate --pr 123 --repo my-org/repoSandbox
Section titled “Sandbox”# Single agentagentic sandbox run "Security audit" \ --runtime claude --workspace . --timeout 300
# Parallel fleetagentic sandbox fleet \ "Review auth" "Analyze queries" "Check security" \ --runtime claude --workspace . --output ./resultsHandoff
Section titled “Handoff”agentic handoff initiate <id> --pr 123 --branch my-branchagentic handoff confirm <id>agentic handoff takeover <id> 123 new-branchProgrammatic API
Section titled “Programmatic API”Fleet Management
Section titled “Fleet Management”import { Fleet } from '@jbcom/agentic';
const fleet = new Fleet();
// Spawn an agentconst result = await fleet.spawn({ repository: 'https://github.com/my-org/my-repo', task: 'Fix the failing CI workflow', target: { autoCreatePr: true, branchName: 'fix/ci' },});
// Monitor multiple agentsconst results = await fleet.monitorAgents(agentIds, { pollInterval: 30000, onProgress: (statusMap) => { for (const [id, status] of statusMap) { console.log(`${id}: ${status}`); } },});
// Broadcast to agentsawait fleet.broadcast(['agent-1', 'agent-2'], 'Status update?');Token Routing
Section titled “Token Routing”import { getTokenForRepo, addOrganization } from '@jbcom/agentic';
addOrganization({ name: 'my-company', tokenEnvVar: 'GITHUB_COMPANY_TOKEN',});
// Automatically returns GITHUB_COMPANY_TOKENconst token = getTokenForRepo('my-company/my-repo');Sandbox Execution
Section titled “Sandbox Execution”import { SandboxExecutor } from '@jbcom/agentic';
const sandbox = new SandboxExecutor();
const result = await sandbox.execute({ runtime: 'claude', workspace: './src', outputDir: './analysis', prompt: 'Analyze for performance bottlenecks', timeout: 300000, memory: 1024,});Architecture
Section titled “Architecture”src/├── core/ # Types, tokens, config│ ├── types.ts # Shared type definitions│ ├── tokens.ts # Token routing logic│ └── config.ts # cosmiconfig-based config├── fleet/ # Agent fleet management│ ├── fleet.ts # High-level Fleet API│ └── cursor-api.ts├── triage/ # AI analysis│ └── analyzer.ts # Multi-provider analyzer├── github/ # Token-aware GitHub client├── handoff/ # Agent continuity protocols├── sandbox/ # Docker execution├── cli.ts # Commander-based CLI└── index.ts # Public API exportsSecurity
Section titled “Security”- No hardcoded values — All tokens configured via environment variables
- Safe subprocess execution —
spawnSyncinstead of shell interpolation - Token sanitization — Tokens never logged or exposed in error messages
- SHA-pinned Actions — All GitHub Actions pinned to full commit SHA
- OIDC publishing — npm publishing via OpenID Connect, no long-lived tokens
- ReDoS protection — Regex patterns designed to prevent denial of service
Related Packages
Section titled “Related Packages”- @jbcom/agentic (Triage) — Triage primitives consumed by control
- agentic-crew — Framework-agnostic crew orchestration
- @agentic/meshy — 3D asset pipelines
- game-generator — AI-powered game generation