Skip to content

Commit c9a1240

Browse files
committed
feat(bridge): add CLI with setup, pairing, and plugin management
Add comprehensive CLI interface for ReCursor bridge with the following capabilities: - Setup command with transport provider selection (Tailscale, Cloudflare, Ngrok, Manual) - QR code pairing for mobile app connection - Claude plugin installation and management - Doctor command for configuration validation - Pass-through to Claude CLI with plugin hooks Bridge enhancements supporting the CLI: - Optional ANTHROPIC_API_KEY with DisabledAgentRuntime fallback - TLS support (HTTPS/WSS) via cert/key configuration - Graceful shutdown with BridgeRuntime management - Connection state subscriptions for monitoring - Dynamic feature detection based on available configuration Package updates: - Added qrcode dependency and types - Added bin entry for recursor CLI command
1 parent dc131b5 commit c9a1240

22 files changed

Lines changed: 2599 additions & 34 deletions

packages/bridge/package-lock.json

Lines changed: 140 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/bridge/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
"description": "ReCursor bridge server",
66
"license": "MIT",
77
"main": "dist/index.js",
8+
"bin": {
9+
"recursor": "dist/cli.js"
10+
},
811
"scripts": {
912
"build": "tsc -p tsconfig.json",
13+
"cli": "node dist/cli.js",
1014
"check": "npm run format:check && npm run typecheck && npm run test:ci && npm run build",
1115
"dev": "nodemon --exec ts-node src/index.ts",
1216
"format": "prettier --write .",
@@ -21,6 +25,7 @@
2125
"cors": "^2.8.5",
2226
"dotenv": "^16.4.7",
2327
"express": "^4.21.1",
28+
"qrcode": "^1.5.4",
2429
"simple-git": "^3.27.0",
2530
"uuid": "^10.0.0",
2631
"ws": "^8.18.0",
@@ -31,6 +36,7 @@
3136
"@types/express": "^5.0.0",
3237
"@types/jest": "^29.5.14",
3338
"@types/node": "^22.0.0",
39+
"@types/qrcode": "^1.5.6",
3440
"@types/supertest": "^7.2.0",
3541
"@types/uuid": "^10.0.0",
3642
"@types/ws": "^8.5.13",

packages/bridge/src/agents/agent_runtime.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ function isRecord(value: unknown): value is Record<string, unknown> {
6060
return typeof value === "object" && value !== null;
6161
}
6262

63+
export class DisabledAgentRuntime implements AgentRuntime {
64+
constructor(private readonly reason: string) {}
65+
66+
async runTurn(_request: AgentRuntimeTurnRequest): Promise<AgentRuntimeTurnResult> {
67+
throw new Error(this.reason);
68+
}
69+
}
70+
6371
export class AnthropicMessageRuntime implements AgentRuntime {
6472
constructor(private client: Anthropic) {}
6573

0 commit comments

Comments
 (0)