feat: 支持自托管的 remote-control-server (#214)

* feat: 支持自托管的 remote-control-server (#214)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
claude-code-best
2026-04-09 17:40:50 +08:00
committed by GitHub
parent f17b7c7163
commit 2da6514095
81 changed files with 9875 additions and 40 deletions

View File

@@ -1,7 +1,5 @@
import {
getClaudeAiBaseUrl,
getRemoteSessionUrl,
} from '../constants/product.js'
import { getClaudeAiBaseUrl } from '../constants/product.js'
import { isSelfHostedBridge, getBridgeBaseUrl } from './bridgeConfig.js'
import { stringWidth } from '@anthropic/ink'
import { formatDuration, truncateToWidth } from '../utils/format.js'
import { getGraphemeSegmenter } from '../utils/intl.js'
@@ -40,7 +38,10 @@ export function buildBridgeConnectUrl(
environmentId: string,
ingressUrl?: string,
): string {
const baseUrl = getClaudeAiBaseUrl(undefined, ingressUrl)
// Self-hosted: use the configured server URL directly
const baseUrl = isSelfHostedBridge()
? getBridgeBaseUrl()
: getClaudeAiBaseUrl(undefined, ingressUrl)
return `${baseUrl}/code?bridge=${environmentId}`
}
@@ -54,7 +55,11 @@ export function buildBridgeSessionUrl(
environmentId: string,
ingressUrl?: string,
): string {
return `${getRemoteSessionUrl(sessionId, ingressUrl)}?bridge=${environmentId}`
// Self-hosted: use the configured server URL directly
const baseUrl = isSelfHostedBridge()
? getBridgeBaseUrl()
: getClaudeAiBaseUrl(undefined, ingressUrl)
return `${baseUrl}/code/${sessionId}?bridge=${environmentId}`
}
/** Compute the glimmer index for a reverse-sweep shimmer animation. */